@microsoft/applicationinsights-web-basic 2.7.5-nightly.2204-03 → 2.7.6
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.
- package/browser/aib.2.7.6.integrity.json +26 -0
- package/browser/{aib.2.7.5-nightly.2204-03.js → aib.2.7.6.js} +971 -2163
- package/browser/aib.2.7.6.js.map +1 -0
- package/browser/aib.2.7.6.min.js +6 -0
- package/browser/aib.2.7.6.min.js.map +1 -0
- package/browser/aib.2.js +970 -2162
- package/browser/aib.2.js.map +1 -1
- package/browser/aib.2.min.js +2 -2
- package/browser/aib.2.min.js.map +1 -1
- package/dist/applicationinsights-web-basic.api.json +533 -3962
- package/dist/applicationinsights-web-basic.api.md +12 -333
- package/dist/applicationinsights-web-basic.d.ts +101 -667
- package/dist/applicationinsights-web-basic.js +970 -2162
- package/dist/applicationinsights-web-basic.js.map +1 -1
- package/dist/applicationinsights-web-basic.min.js +2 -2
- package/dist/applicationinsights-web-basic.min.js.map +1 -1
- package/dist/applicationinsights-web-basic.rollup.d.ts +104 -670
- package/dist-esm/index.js +57 -47
- package/dist-esm/index.js.map +1 -1
- package/index.ts +125 -0
- package/package.json +57 -62
- package/tsconfig.json +3 -7
- package/types/index.d.ts +5 -34
- package/types/tsdoc-metadata.json +1 -1
- package/browser/aib.2.7.5-nightly.2204-03.integrity.json +0 -26
- package/browser/aib.2.7.5-nightly.2204-03.js.map +0 -1
- package/browser/aib.2.7.5-nightly.2204-03.min.js +0 -6
- package/browser/aib.2.7.5-nightly.2204-03.min.js.map +0 -1
- package/src/index.ts +0 -203
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft.ApplicationInsights, 2.7.
|
|
2
|
+
* Microsoft.ApplicationInsights, 2.7.6
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -17,6 +17,26 @@ export declare class AppInsightsCore extends BaseCore implements IAppInsightsCor
|
|
|
17
17
|
constructor();
|
|
18
18
|
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
|
|
19
19
|
track(telemetryItem: ITelemetryItem): void;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
|
|
22
|
+
* The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
|
|
23
|
+
* called.
|
|
24
|
+
* @param {INotificationListener} listener - An INotificationListener object.
|
|
25
|
+
*/
|
|
26
|
+
addNotificationListener(listener: INotificationListener): void;
|
|
27
|
+
/**
|
|
28
|
+
* Removes all instances of the listener.
|
|
29
|
+
* @param {INotificationListener} listener - INotificationListener to remove.
|
|
30
|
+
*/
|
|
31
|
+
removeNotificationListener(listener: INotificationListener): void;
|
|
32
|
+
/**
|
|
33
|
+
* Periodically check logger.queue for
|
|
34
|
+
*/
|
|
35
|
+
pollInternalLogs(eventName?: string): number;
|
|
36
|
+
/**
|
|
37
|
+
* Periodically check logger.queue for
|
|
38
|
+
*/
|
|
39
|
+
stopPollingInternalLogs(): void;
|
|
20
40
|
}
|
|
21
41
|
|
|
22
42
|
/**
|
|
@@ -25,6 +45,7 @@ export declare class AppInsightsCore extends BaseCore implements IAppInsightsCor
|
|
|
25
45
|
*/
|
|
26
46
|
export declare class ApplicationInsights {
|
|
27
47
|
config: IConfiguration & IConfig;
|
|
48
|
+
private core;
|
|
28
49
|
/**
|
|
29
50
|
* Creates an instance of ApplicationInsights.
|
|
30
51
|
* @param {IConfiguration & IConfig} config
|
|
@@ -50,51 +71,11 @@ export declare class ApplicationInsights {
|
|
|
50
71
|
* @memberof ApplicationInsights
|
|
51
72
|
*/
|
|
52
73
|
flush(async?: boolean): void;
|
|
53
|
-
pollInternalLogs
|
|
74
|
+
private pollInternalLogs;
|
|
54
75
|
stopPollingInternalLogs(): void;
|
|
55
|
-
getSKUDefaults
|
|
56
|
-
/**
|
|
57
|
-
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
58
|
-
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
59
|
-
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
60
|
-
* approach is to create a new instance and initialize that instance.
|
|
61
|
-
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
62
|
-
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
63
|
-
*/
|
|
64
|
-
unload(isAsync?: boolean, unloadComplete?: () => void): void;
|
|
65
|
-
/**
|
|
66
|
-
* Find and return the (first) plugin with the specified identifier if present
|
|
67
|
-
* @param pluginIdentifier
|
|
68
|
-
*/
|
|
69
|
-
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
70
|
-
/**
|
|
71
|
-
* Add a new plugin to the installation
|
|
72
|
-
* @param plugin - The new plugin to add
|
|
73
|
-
* @param replaceExisting - should any existing plugin be replaced
|
|
74
|
-
* @param doAsync - Should the add be performed asynchronously
|
|
75
|
-
*/
|
|
76
|
-
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
|
|
77
|
-
/**
|
|
78
|
-
* Returns the unique event namespace that should be used
|
|
79
|
-
*/
|
|
80
|
-
evtNamespace(): string;
|
|
81
|
-
/**
|
|
82
|
-
* Add an unload handler that will be called when the SDK is being unloaded
|
|
83
|
-
* @param handler - the handler
|
|
84
|
-
*/
|
|
85
|
-
addUnloadCb(handler: UnloadHandler): void;
|
|
76
|
+
private getSKUDefaults;
|
|
86
77
|
}
|
|
87
78
|
|
|
88
|
-
/**
|
|
89
|
-
* Performs the specified action for each element in an array. This helper exists to avoid adding a polyfil for older browsers
|
|
90
|
-
* that do not define Array.prototype.xxxx (eg. ES3 only, IE8) just in case any page checks for presence/absence of the prototype
|
|
91
|
-
* implementation. Note: For consistency this will not use the Array.prototype.xxxx implementation if it exists as this would
|
|
92
|
-
* cause a testing requirement to test with and without the implementations
|
|
93
|
-
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. It can return -1 to break out of the loop
|
|
94
|
-
* @param thisArg [Optional] An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
|
|
95
|
-
*/
|
|
96
|
-
export declare function arrForEach<T = any>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => undefined | void | number, thisArg?: any): void;
|
|
97
|
-
|
|
98
79
|
declare class BaseCore implements IAppInsightsCore {
|
|
99
80
|
static defaultConfig: IConfiguration;
|
|
100
81
|
config: IConfiguration;
|
|
@@ -107,18 +88,6 @@ declare class BaseCore implements IAppInsightsCore {
|
|
|
107
88
|
track(telemetryItem: ITelemetryItem): void;
|
|
108
89
|
getProcessTelContext(): IProcessTelemetryContext;
|
|
109
90
|
getNotifyMgr(): INotificationManager;
|
|
110
|
-
/**
|
|
111
|
-
* Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
|
|
112
|
-
* The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
|
|
113
|
-
* called.
|
|
114
|
-
* @param {INotificationListener} listener - An INotificationListener object.
|
|
115
|
-
*/
|
|
116
|
-
addNotificationListener(listener: INotificationListener): void;
|
|
117
|
-
/**
|
|
118
|
-
* Removes all instances of the listener.
|
|
119
|
-
* @param {INotificationListener} listener - INotificationListener to remove.
|
|
120
|
-
*/
|
|
121
|
-
removeNotificationListener(listener: INotificationListener): void;
|
|
122
91
|
/**
|
|
123
92
|
* Get the current cookie manager for this instance
|
|
124
93
|
*/
|
|
@@ -131,67 +100,7 @@ declare class BaseCore implements IAppInsightsCore {
|
|
|
131
100
|
getPerfMgr(): IPerfManager;
|
|
132
101
|
setPerfMgr(perfMgr: IPerfManager): void;
|
|
133
102
|
eventCnt(): number;
|
|
134
|
-
/**
|
|
135
|
-
* Periodically check logger.queue for
|
|
136
|
-
*/
|
|
137
|
-
pollInternalLogs(eventName?: string): number;
|
|
138
|
-
/**
|
|
139
|
-
* Periodically check logger.queue for
|
|
140
|
-
*/
|
|
141
|
-
stopPollingInternalLogs(): void;
|
|
142
|
-
/**
|
|
143
|
-
* Add a telemetry processor to decorate or drop telemetry events.
|
|
144
|
-
* @param telemetryInitializer - The Telemetry Initializer function
|
|
145
|
-
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
146
|
-
*/
|
|
147
|
-
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
148
|
-
/**
|
|
149
|
-
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
150
|
-
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
151
|
-
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
152
|
-
* approach is to create a new instance and initialize that instance.
|
|
153
|
-
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
154
|
-
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
155
|
-
* @param isAsync - Can the unload be performed asynchronously (default)
|
|
156
|
-
* @param unloadComplete - An optional callback that will be called once the unload has completed
|
|
157
|
-
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
158
|
-
*/
|
|
159
|
-
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
160
|
-
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
161
|
-
/**
|
|
162
|
-
* Add a new plugin to the installation
|
|
163
|
-
* @param plugin - The new plugin to add
|
|
164
|
-
* @param replaceExisting - should any existing plugin be replaced, default is false
|
|
165
|
-
* @param doAsync - Should the add be performed asynchronously
|
|
166
|
-
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
167
|
-
*/
|
|
168
|
-
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
169
|
-
/**
|
|
170
|
-
* Returns the unique event namespace that should be used
|
|
171
|
-
*/
|
|
172
|
-
evtNamespace(): string;
|
|
173
|
-
/**
|
|
174
|
-
* Add an unload handler that will be called when the SDK is being unloaded
|
|
175
|
-
* @param handler - the handler
|
|
176
|
-
*/
|
|
177
|
-
addUnloadCb(handler: UnloadHandler): void;
|
|
178
|
-
/**
|
|
179
|
-
* Flush and send any batched / cached data immediately
|
|
180
|
-
* @param async - send data asynchronously when true (defaults to true)
|
|
181
|
-
* @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.
|
|
182
|
-
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
183
|
-
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
184
|
-
* @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
|
|
185
|
-
*/
|
|
186
|
-
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): void;
|
|
187
103
|
protected releaseQueue(): void;
|
|
188
|
-
/**
|
|
189
|
-
* Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
|
|
190
|
-
* @param updateCtx - The plugin update context
|
|
191
|
-
* @param updateState - The Update State
|
|
192
|
-
* @returns boolean - True means the extension class will call updateState otherwise the Core will
|
|
193
|
-
*/
|
|
194
|
-
protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
195
104
|
}
|
|
196
105
|
|
|
197
106
|
/**
|
|
@@ -200,13 +109,6 @@ declare class BaseCore implements IAppInsightsCore {
|
|
|
200
109
|
* implementation so that new default implementations can be added without breaking all plugins.
|
|
201
110
|
*/
|
|
202
111
|
declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
203
|
-
identifier: string;
|
|
204
|
-
version?: string;
|
|
205
|
-
/**
|
|
206
|
-
* Holds the core instance that was used during initialization
|
|
207
|
-
*/
|
|
208
|
-
core: IAppInsightsCore;
|
|
209
|
-
priority: number;
|
|
210
112
|
/**
|
|
211
113
|
* Call back for telemetry processing before it it is sent
|
|
212
114
|
* @param env - This is the current event being reported
|
|
@@ -228,6 +130,13 @@ declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
228
130
|
* Returns whether the plugin has been initialized
|
|
229
131
|
*/
|
|
230
132
|
isInitialized: () => boolean;
|
|
133
|
+
identifier: string;
|
|
134
|
+
version?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Holds the core instance that was used during initialization
|
|
137
|
+
*/
|
|
138
|
+
core: IAppInsightsCore;
|
|
139
|
+
priority: number;
|
|
231
140
|
/**
|
|
232
141
|
* Helper to return the current IProcessTelemetryContext, if the passed argument exists this just
|
|
233
142
|
* returns that value (helps with minification for callers), otherwise it will return the configured
|
|
@@ -240,51 +149,12 @@ declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
240
149
|
*/
|
|
241
150
|
protected setInitialized: (isInitialized: boolean) => void;
|
|
242
151
|
/**
|
|
243
|
-
*
|
|
244
|
-
* finishes it's removal.
|
|
245
|
-
* @param unloadCtx - This is the context that should be used during unloading.
|
|
246
|
-
* @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.
|
|
247
|
-
* @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async unload/teardown operations.
|
|
248
|
-
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
152
|
+
* Internal helper to initialize the instance
|
|
249
153
|
*/
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
|
|
253
|
-
* @param updateCtx - This is the context that should be used during updating.
|
|
254
|
-
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
255
|
-
* @param asyncCallback - An optional callback that the plugin must call if it returns true to inform the caller that it has completed any async update operations.
|
|
256
|
-
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
257
|
-
*/
|
|
258
|
-
protected _doUpdate?: (updateCtx?: IProcessTelemetryUpdateContext, updateState?: ITelemetryUpdateState, asyncCallback?: () => void) => void | boolean;
|
|
154
|
+
private _baseTelInit;
|
|
259
155
|
constructor();
|
|
260
156
|
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
261
|
-
/**
|
|
262
|
-
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
263
|
-
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
264
|
-
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
265
|
-
* @param unloadCtx - This is the context that should be used during unloading.
|
|
266
|
-
* @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.
|
|
267
|
-
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
268
|
-
*/
|
|
269
|
-
teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
|
|
270
157
|
abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
271
|
-
/**
|
|
272
|
-
* The the plugin should re-evaluate configuration and update any cached configuration settings.
|
|
273
|
-
* @param updateCtx - This is the context that should be used during updating.
|
|
274
|
-
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
275
|
-
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
276
|
-
*/
|
|
277
|
-
update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
278
|
-
/**
|
|
279
|
-
* Add an unload handler that will be called when the SDK is being unloaded
|
|
280
|
-
* @param handler - the handler
|
|
281
|
-
*/
|
|
282
|
-
protected _addUnloadCb(handler: UnloadHandler): void;
|
|
283
|
-
/**
|
|
284
|
-
* Add this hook so that it is automatically removed during unloading
|
|
285
|
-
* @param hooks - The single hook or an array of IInstrumentHook objects
|
|
286
|
-
*/
|
|
287
|
-
protected _addHook(hooks: IInstrumentHook | IInstrumentHook[]): void;
|
|
288
158
|
}
|
|
289
159
|
|
|
290
160
|
/**
|
|
@@ -295,15 +165,7 @@ declare abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
|
|
|
295
165
|
*/
|
|
296
166
|
export declare const CoreUtils: ICoreUtils;
|
|
297
167
|
|
|
298
|
-
declare
|
|
299
|
-
AI: number;
|
|
300
|
-
AI_AND_W3C: number;
|
|
301
|
-
W3C: number;
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
declare type DistributedTracingModes = number | eDistributedTracingModes;
|
|
305
|
-
|
|
306
|
-
declare const enum eDistributedTracingModes {
|
|
168
|
+
declare enum DistributedTracingModes {
|
|
307
169
|
/**
|
|
308
170
|
* (Default) Send Application Insights correlation headers
|
|
309
171
|
*/
|
|
@@ -318,108 +180,6 @@ declare const enum eDistributedTracingModes {
|
|
|
318
180
|
W3C = 2
|
|
319
181
|
}
|
|
320
182
|
|
|
321
|
-
export declare const enum _eInternalMessageId {
|
|
322
|
-
BrowserDoesNotSupportLocalStorage = 0,
|
|
323
|
-
BrowserCannotReadLocalStorage = 1,
|
|
324
|
-
BrowserCannotReadSessionStorage = 2,
|
|
325
|
-
BrowserCannotWriteLocalStorage = 3,
|
|
326
|
-
BrowserCannotWriteSessionStorage = 4,
|
|
327
|
-
BrowserFailedRemovalFromLocalStorage = 5,
|
|
328
|
-
BrowserFailedRemovalFromSessionStorage = 6,
|
|
329
|
-
CannotSendEmptyTelemetry = 7,
|
|
330
|
-
ClientPerformanceMathError = 8,
|
|
331
|
-
ErrorParsingAISessionCookie = 9,
|
|
332
|
-
ErrorPVCalc = 10,
|
|
333
|
-
ExceptionWhileLoggingError = 11,
|
|
334
|
-
FailedAddingTelemetryToBuffer = 12,
|
|
335
|
-
FailedMonitorAjaxAbort = 13,
|
|
336
|
-
FailedMonitorAjaxDur = 14,
|
|
337
|
-
FailedMonitorAjaxOpen = 15,
|
|
338
|
-
FailedMonitorAjaxRSC = 16,
|
|
339
|
-
FailedMonitorAjaxSend = 17,
|
|
340
|
-
FailedMonitorAjaxGetCorrelationHeader = 18,
|
|
341
|
-
FailedToAddHandlerForOnBeforeUnload = 19,
|
|
342
|
-
FailedToSendQueuedTelemetry = 20,
|
|
343
|
-
FailedToReportDataLoss = 21,
|
|
344
|
-
FlushFailed = 22,
|
|
345
|
-
MessageLimitPerPVExceeded = 23,
|
|
346
|
-
MissingRequiredFieldSpecification = 24,
|
|
347
|
-
NavigationTimingNotSupported = 25,
|
|
348
|
-
OnError = 26,
|
|
349
|
-
SessionRenewalDateIsZero = 27,
|
|
350
|
-
SenderNotInitialized = 28,
|
|
351
|
-
StartTrackEventFailed = 29,
|
|
352
|
-
StopTrackEventFailed = 30,
|
|
353
|
-
StartTrackFailed = 31,
|
|
354
|
-
StopTrackFailed = 32,
|
|
355
|
-
TelemetrySampledAndNotSent = 33,
|
|
356
|
-
TrackEventFailed = 34,
|
|
357
|
-
TrackExceptionFailed = 35,
|
|
358
|
-
TrackMetricFailed = 36,
|
|
359
|
-
TrackPVFailed = 37,
|
|
360
|
-
TrackPVFailedCalc = 38,
|
|
361
|
-
TrackTraceFailed = 39,
|
|
362
|
-
TransmissionFailed = 40,
|
|
363
|
-
FailedToSetStorageBuffer = 41,
|
|
364
|
-
FailedToRestoreStorageBuffer = 42,
|
|
365
|
-
InvalidBackendResponse = 43,
|
|
366
|
-
FailedToFixDepricatedValues = 44,
|
|
367
|
-
InvalidDurationValue = 45,
|
|
368
|
-
TelemetryEnvelopeInvalid = 46,
|
|
369
|
-
CreateEnvelopeError = 47,
|
|
370
|
-
CannotSerializeObject = 48,
|
|
371
|
-
CannotSerializeObjectNonSerializable = 49,
|
|
372
|
-
CircularReferenceDetected = 50,
|
|
373
|
-
ClearAuthContextFailed = 51,
|
|
374
|
-
ExceptionTruncated = 52,
|
|
375
|
-
IllegalCharsInName = 53,
|
|
376
|
-
ItemNotInArray = 54,
|
|
377
|
-
MaxAjaxPerPVExceeded = 55,
|
|
378
|
-
MessageTruncated = 56,
|
|
379
|
-
NameTooLong = 57,
|
|
380
|
-
SampleRateOutOfRange = 58,
|
|
381
|
-
SetAuthContextFailed = 59,
|
|
382
|
-
SetAuthContextFailedAccountName = 60,
|
|
383
|
-
StringValueTooLong = 61,
|
|
384
|
-
StartCalledMoreThanOnce = 62,
|
|
385
|
-
StopCalledWithoutStart = 63,
|
|
386
|
-
TelemetryInitializerFailed = 64,
|
|
387
|
-
TrackArgumentsNotSpecified = 65,
|
|
388
|
-
UrlTooLong = 66,
|
|
389
|
-
SessionStorageBufferFull = 67,
|
|
390
|
-
CannotAccessCookie = 68,
|
|
391
|
-
IdTooLong = 69,
|
|
392
|
-
InvalidEvent = 70,
|
|
393
|
-
FailedMonitorAjaxSetRequestHeader = 71,
|
|
394
|
-
SendBrowserInfoOnUserInit = 72,
|
|
395
|
-
PluginException = 73,
|
|
396
|
-
NotificationException = 74,
|
|
397
|
-
SnippetScriptLoadFailure = 99,
|
|
398
|
-
InvalidInstrumentationKey = 100,
|
|
399
|
-
CannotParseAiBlobValue = 101,
|
|
400
|
-
InvalidContentBlob = 102,
|
|
401
|
-
TrackPageActionEventFailed = 103,
|
|
402
|
-
FailedAddingCustomDefinedRequestContext = 104,
|
|
403
|
-
InMemoryStorageBufferFull = 105
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
declare const enum eLoggingSeverity {
|
|
407
|
-
/**
|
|
408
|
-
* Error will be sent as internal telemetry
|
|
409
|
-
*/
|
|
410
|
-
CRITICAL = 1,
|
|
411
|
-
/**
|
|
412
|
-
* Error will NOT be sent as internal telemetry, and will only be shown in browser console
|
|
413
|
-
*/
|
|
414
|
-
WARNING = 2
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
declare const enum GetExtCfgMergeType {
|
|
418
|
-
None = 0,
|
|
419
|
-
MergeDefaultOnly = 1,
|
|
420
|
-
MergeDefaultFromRootOrDefault = 2
|
|
421
|
-
}
|
|
422
|
-
|
|
423
183
|
export declare interface IAppInsightsCore extends IPerfManagerProvider {
|
|
424
184
|
config: IConfiguration;
|
|
425
185
|
logger: IDiagnosticLogger;
|
|
@@ -455,62 +215,12 @@ export declare interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
455
215
|
* @param {INotificationListener} listener - INotificationListener to remove.
|
|
456
216
|
*/
|
|
457
217
|
removeNotificationListener?(listener: INotificationListener): void;
|
|
458
|
-
/**
|
|
459
|
-
* Add a telemetry processor to decorate or drop telemetry events.
|
|
460
|
-
* @param telemetryInitializer - The Telemetry Initializer function
|
|
461
|
-
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
462
|
-
*/
|
|
463
|
-
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
464
218
|
pollInternalLogs?(eventName?: string): number;
|
|
465
219
|
stopPollingInternalLogs?(): void;
|
|
466
220
|
/**
|
|
467
221
|
* Return a new instance of the IProcessTelemetryContext for processing events
|
|
468
222
|
*/
|
|
469
223
|
getProcessTelContext(): IProcessTelemetryContext;
|
|
470
|
-
/**
|
|
471
|
-
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
472
|
-
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
473
|
-
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
474
|
-
* approach is to create a new instance and initialize that instance.
|
|
475
|
-
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
476
|
-
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
477
|
-
* @param isAsync - Can the unload be performed asynchronously (default)
|
|
478
|
-
* @param unloadComplete - An optional callback that will be called once the unload has completed
|
|
479
|
-
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
480
|
-
*/
|
|
481
|
-
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
482
|
-
/**
|
|
483
|
-
* Find and return the (first) plugin with the specified identifier if present
|
|
484
|
-
* @param pluginIdentifier
|
|
485
|
-
*/
|
|
486
|
-
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
487
|
-
/**
|
|
488
|
-
* Add a new plugin to the installation
|
|
489
|
-
* @param plugin - The new plugin to add
|
|
490
|
-
* @param replaceExisting - should any existing plugin be replaced, default is false
|
|
491
|
-
* @param doAsync - Should the add be performed asynchronously
|
|
492
|
-
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
493
|
-
*/
|
|
494
|
-
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
495
|
-
/**
|
|
496
|
-
* Returns the unique event namespace that should be used when registering events
|
|
497
|
-
*/
|
|
498
|
-
evtNamespace(): string;
|
|
499
|
-
/**
|
|
500
|
-
* Add a handler that will be called when the SDK is being unloaded
|
|
501
|
-
* @param handler - the handler
|
|
502
|
-
*/
|
|
503
|
-
addUnloadCb(handler: UnloadHandler): void;
|
|
504
|
-
/**
|
|
505
|
-
* Flush and send any batched / cached data immediately
|
|
506
|
-
* @param async - send data asynchronously when true (defaults to true)
|
|
507
|
-
* @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.
|
|
508
|
-
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
509
|
-
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
510
|
-
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
511
|
-
* @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
|
|
512
|
-
*/
|
|
513
|
-
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
|
|
514
224
|
}
|
|
515
225
|
|
|
516
226
|
/**
|
|
@@ -594,67 +304,6 @@ declare interface IBackendResponse {
|
|
|
594
304
|
readonly appId?: string;
|
|
595
305
|
}
|
|
596
306
|
|
|
597
|
-
declare interface IBaseProcessingContext {
|
|
598
|
-
/**
|
|
599
|
-
* The current core instance for the request
|
|
600
|
-
*/
|
|
601
|
-
core: () => IAppInsightsCore;
|
|
602
|
-
/**
|
|
603
|
-
* THe current diagnostic logger for the request
|
|
604
|
-
*/
|
|
605
|
-
diagLog: () => IDiagnosticLogger;
|
|
606
|
-
/**
|
|
607
|
-
* Gets the current core config instance
|
|
608
|
-
*/
|
|
609
|
-
getCfg: () => IConfiguration;
|
|
610
|
-
/**
|
|
611
|
-
* Gets the named extension config
|
|
612
|
-
*/
|
|
613
|
-
getExtCfg: <T>(identifier: string, defaultValue?: T | any, mergeDefault?: GetExtCfgMergeType) => T;
|
|
614
|
-
/**
|
|
615
|
-
* Gets the named config from either the named identifier extension or core config if neither exist then the
|
|
616
|
-
* default value is returned
|
|
617
|
-
* @param identifier The named extension identifier
|
|
618
|
-
* @param field The config field name
|
|
619
|
-
* @param defaultValue The default value to return if no defined config exists
|
|
620
|
-
*/
|
|
621
|
-
getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
|
|
622
|
-
/**
|
|
623
|
-
* Helper to allow plugins to check and possibly shortcut executing code only
|
|
624
|
-
* required if there is a nextPlugin
|
|
625
|
-
*/
|
|
626
|
-
hasNext: () => boolean;
|
|
627
|
-
/**
|
|
628
|
-
* Returns the next configured plugin proxy
|
|
629
|
-
*/
|
|
630
|
-
getNext: () => ITelemetryPluginChain;
|
|
631
|
-
/**
|
|
632
|
-
* Helper to set the next plugin proxy
|
|
633
|
-
*/
|
|
634
|
-
setNext: (nextCtx: ITelemetryPluginChain) => void;
|
|
635
|
-
/**
|
|
636
|
-
* Synchronously iterate over the context chain running the callback for each plugin, once
|
|
637
|
-
* every plugin has been executed via the callback, any associated onComplete will be called.
|
|
638
|
-
* @param callback - The function call for each plugin in the context chain
|
|
639
|
-
*/
|
|
640
|
-
iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
|
|
641
|
-
/**
|
|
642
|
-
* Set the function to call when the current chain has executed all processNext or unloadNext items.
|
|
643
|
-
* @param onComplete - The onComplete to call
|
|
644
|
-
* @param that - The "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
|
|
645
|
-
* @param args - Any additional arguments to pass to the onComplete function
|
|
646
|
-
*/
|
|
647
|
-
onComplete: (onComplete: () => void, that?: any, ...args: any[]) => void;
|
|
648
|
-
/**
|
|
649
|
-
* Create a new context using the core and config from the current instance, returns a new instance of the same type
|
|
650
|
-
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
651
|
-
* then the current execution order will be copied.
|
|
652
|
-
* @param startAt - The plugin to start processing from, if missing from the execution
|
|
653
|
-
* order then the next plugin will be NOT set.
|
|
654
|
-
*/
|
|
655
|
-
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IBaseProcessingContext;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
307
|
/**
|
|
659
308
|
* Provides data transmission capabilities
|
|
660
309
|
*/
|
|
@@ -668,23 +317,15 @@ declare interface IChannelControls extends ITelemetryPlugin {
|
|
|
668
317
|
*/
|
|
669
318
|
resume(): void;
|
|
670
319
|
/**
|
|
671
|
-
* Tear down
|
|
672
|
-
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
673
|
-
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
674
|
-
* @param unloadCtx - This is the context that should be used during unloading.
|
|
675
|
-
* @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.
|
|
676
|
-
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
320
|
+
* Tear down transmission pipeline
|
|
677
321
|
*/
|
|
678
|
-
teardown
|
|
322
|
+
teardown(): void;
|
|
679
323
|
/**
|
|
680
324
|
* Flush to send data immediately; channel should default to sending data asynchronously
|
|
681
|
-
* @param async
|
|
682
|
-
* @param callBack
|
|
683
|
-
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
684
|
-
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
685
|
-
* @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
|
|
325
|
+
* @param async: send data asynchronously when true
|
|
326
|
+
* @param callBack: if specified, notify caller when send is complete
|
|
686
327
|
*/
|
|
687
|
-
flush(async: boolean, callBack?: (
|
|
328
|
+
flush(async: boolean, callBack?: () => void): void;
|
|
688
329
|
}
|
|
689
330
|
|
|
690
331
|
declare interface IChannelControlsAI extends IChannelControls {
|
|
@@ -1359,7 +1000,7 @@ declare interface ICoreUtils {
|
|
|
1359
1000
|
* @param callback {any} - The callback function that needs to be executed for the given event
|
|
1360
1001
|
* @return {boolean} - true if the handler was successfully added
|
|
1361
1002
|
*/
|
|
1362
|
-
addEventHandler: (eventName: string, callback: any
|
|
1003
|
+
addEventHandler: (eventName: string, callback: any) => boolean;
|
|
1363
1004
|
/**
|
|
1364
1005
|
* Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less)
|
|
1365
1006
|
* https://caniuse.com/#search=Date.now
|
|
@@ -1519,96 +1160,6 @@ export declare interface IEventTelemetry extends IPartC {
|
|
|
1519
1160
|
iKey?: string;
|
|
1520
1161
|
}
|
|
1521
1162
|
|
|
1522
|
-
declare interface IInstrumentCallDetails {
|
|
1523
|
-
name: string;
|
|
1524
|
-
inst: any;
|
|
1525
|
-
/**
|
|
1526
|
-
* This returns an object that the hook function can use to store hook specific
|
|
1527
|
-
* context, it it not shared with any other hook instances and is unique for the
|
|
1528
|
-
* current call.
|
|
1529
|
-
* A hook implementation can use this to pass / share context between different
|
|
1530
|
-
* hook callbacks eg. request/response requst/hookErrors etc.
|
|
1531
|
-
*/
|
|
1532
|
-
ctx: () => any;
|
|
1533
|
-
/**
|
|
1534
|
-
* Allows the hook functions to replace the original arguments
|
|
1535
|
-
* @param idx - The argument index (0 based)
|
|
1536
|
-
* @param value - The new value for the argument
|
|
1537
|
-
*/
|
|
1538
|
-
set: (idx: number, value: any) => void;
|
|
1539
|
-
/**
|
|
1540
|
-
* The result of the original method, only populated after the original method has returned
|
|
1541
|
-
*/
|
|
1542
|
-
rslt?: any;
|
|
1543
|
-
/**
|
|
1544
|
-
* The error (exception) which occurred while executing the original method
|
|
1545
|
-
*/
|
|
1546
|
-
err?: Error;
|
|
1547
|
-
/**
|
|
1548
|
-
* The Event object from (window.event) at the start of the original call
|
|
1549
|
-
*/
|
|
1550
|
-
evt?: Event;
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
/**
|
|
1554
|
-
* The holder of the specific instance callback
|
|
1555
|
-
*/
|
|
1556
|
-
declare interface IInstrumentHook {
|
|
1557
|
-
/** Unique Id for this callback on the hooked method */
|
|
1558
|
-
id: number;
|
|
1559
|
-
/** Holds the callbacks */
|
|
1560
|
-
cbks: IInstrumentHooksCallbacks;
|
|
1561
|
-
/** Remove this hook from the function */
|
|
1562
|
-
rm: () => void;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
/**
|
|
1566
|
-
* The callbacks to call for the instrumented function, you must provide at least the request and/or response callbacks, both are not required.
|
|
1567
|
-
* You must always supply the error callback
|
|
1568
|
-
*/
|
|
1569
|
-
declare interface IInstrumentHooksCallbacks {
|
|
1570
|
-
/**
|
|
1571
|
-
* [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
|
|
1572
|
-
* identify the source of the instrumented hooks
|
|
1573
|
-
*/
|
|
1574
|
-
ns?: string | string[];
|
|
1575
|
-
/**
|
|
1576
|
-
* The hook callback to call before the original function is called
|
|
1577
|
-
*/
|
|
1578
|
-
req?: InstrumentorHooksCallback;
|
|
1579
|
-
/**
|
|
1580
|
-
* The hook callback to call after the original function was called
|
|
1581
|
-
*/
|
|
1582
|
-
rsp?: InstrumentorHooksCallback;
|
|
1583
|
-
/**
|
|
1584
|
-
* The callback to call if the hook function causes an exception
|
|
1585
|
-
*/
|
|
1586
|
-
hkErr?: InstrumentorHooksCallback;
|
|
1587
|
-
/**
|
|
1588
|
-
* The callback to call if the original function causes an exception, even if you
|
|
1589
|
-
* supply a callback the original exception will still be thrown
|
|
1590
|
-
*/
|
|
1591
|
-
fnErr?: InstrumentorHooksCallback;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
export declare interface ILoadedPlugin<T extends IPlugin> {
|
|
1595
|
-
plugin: T;
|
|
1596
|
-
/**
|
|
1597
|
-
* Identifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled
|
|
1598
|
-
* via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..
|
|
1599
|
-
* @returns boolean = true if the plugin is in a state where it is operational.
|
|
1600
|
-
*/
|
|
1601
|
-
isEnabled: () => boolean;
|
|
1602
|
-
/**
|
|
1603
|
-
* You can optionally enable / disable a plugin from processing events.
|
|
1604
|
-
* Setting enabled to true will not necessarily cause the `isEnabled()` to also return true
|
|
1605
|
-
* as the plugin must also have been successfully initialized and not had it's `teardown` method called
|
|
1606
|
-
* (unless it's also been re-initialized)
|
|
1607
|
-
*/
|
|
1608
|
-
setEnabled: (isEnabled: boolean) => void;
|
|
1609
|
-
remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void;
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
1163
|
export declare interface IMetricTelemetry extends IPartC {
|
|
1613
1164
|
/**
|
|
1614
1165
|
* @description (required) - name of this metric
|
|
@@ -1727,12 +1278,6 @@ declare interface INotificationManager {
|
|
|
1727
1278
|
perfEvent?(perfEvent: IPerfEvent): void;
|
|
1728
1279
|
}
|
|
1729
1280
|
|
|
1730
|
-
/**
|
|
1731
|
-
* A callback function that will be called for the wrapped instrumentation function
|
|
1732
|
-
* before the original function is executed.
|
|
1733
|
-
*/
|
|
1734
|
-
declare type InstrumentorHooksCallback = (funcArgs: IInstrumentCallDetails, ...orgArgs: any[]) => void;
|
|
1735
|
-
|
|
1736
1281
|
declare class _InternalLogMessage {
|
|
1737
1282
|
static dataType: string;
|
|
1738
1283
|
message: string;
|
|
@@ -1743,7 +1288,7 @@ declare class _InternalLogMessage {
|
|
|
1743
1288
|
/**
|
|
1744
1289
|
* Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered
|
|
1745
1290
|
*/
|
|
1746
|
-
|
|
1291
|
+
declare const _InternalMessageId: {
|
|
1747
1292
|
BrowserDoesNotSupportLocalStorage: number;
|
|
1748
1293
|
BrowserCannotReadLocalStorage: number;
|
|
1749
1294
|
BrowserCannotReadSessionStorage: number;
|
|
@@ -1828,7 +1373,7 @@ export declare const _InternalMessageId: {
|
|
|
1828
1373
|
InMemoryStorageBufferFull: number;
|
|
1829
1374
|
};
|
|
1830
1375
|
|
|
1831
|
-
|
|
1376
|
+
declare type _InternalMessageId = number | typeof _InternalMessageId;
|
|
1832
1377
|
|
|
1833
1378
|
export declare interface IPageViewPerformanceTelemetry extends IPartC {
|
|
1834
1379
|
/**
|
|
@@ -2027,7 +1572,7 @@ declare interface IPerfManagerProvider {
|
|
|
2027
1572
|
setPerfMgr(perfMgr: IPerfManager): void;
|
|
2028
1573
|
}
|
|
2029
1574
|
|
|
2030
|
-
|
|
1575
|
+
declare interface IPlugin {
|
|
2031
1576
|
/**
|
|
2032
1577
|
* Initialize plugin loaded by SDK
|
|
2033
1578
|
* @param config - The config for the plugin to use
|
|
@@ -2043,14 +1588,10 @@ export declare interface IPlugin {
|
|
|
2043
1588
|
*/
|
|
2044
1589
|
isInitialized?: () => boolean;
|
|
2045
1590
|
/**
|
|
2046
|
-
* Tear down the plugin and remove any hooked value, the plugin should
|
|
2047
|
-
* therefore
|
|
2048
|
-
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
2049
|
-
* @param unloadCtx - This is the context that should be used during unloading.
|
|
2050
|
-
* @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.
|
|
2051
|
-
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
1591
|
+
* Tear down the plugin and remove any hooked value, the plugin should remove that it is no longer initialized and
|
|
1592
|
+
* therefore can be re-initialized after being torn down.
|
|
2052
1593
|
*/
|
|
2053
|
-
teardown?: (
|
|
1594
|
+
teardown?: () => void;
|
|
2054
1595
|
/**
|
|
2055
1596
|
* Extension name
|
|
2056
1597
|
*/
|
|
@@ -2065,63 +1606,57 @@ export declare interface IPlugin {
|
|
|
2065
1606
|
* The current context for the current call to processTelemetry(), used to support sharing the same plugin instance
|
|
2066
1607
|
* between multiple AppInsights instances
|
|
2067
1608
|
*/
|
|
2068
|
-
declare interface IProcessTelemetryContext
|
|
1609
|
+
declare interface IProcessTelemetryContext {
|
|
2069
1610
|
/**
|
|
2070
|
-
*
|
|
2071
|
-
* @param env - This is the current event being reported
|
|
2072
|
-
* @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
|
|
1611
|
+
* The current core instance for the request
|
|
2073
1612
|
*/
|
|
2074
|
-
|
|
1613
|
+
core: () => IAppInsightsCore;
|
|
2075
1614
|
/**
|
|
2076
|
-
*
|
|
2077
|
-
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
2078
|
-
* then the current execution order will be copied.
|
|
2079
|
-
* @param startAt - The plugin to start processing from, if missing from the execution
|
|
2080
|
-
* order then the next plugin will be NOT set.
|
|
1615
|
+
* THe current diagnostic logger for the request
|
|
2081
1616
|
*/
|
|
2082
|
-
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
/**
|
|
2086
|
-
* The current context for the current call to teardown() implementations, used to support when plugins are being removed
|
|
2087
|
-
* or the SDK is being unloaded.
|
|
2088
|
-
*/
|
|
2089
|
-
declare interface IProcessTelemetryUnloadContext extends IBaseProcessingContext {
|
|
1617
|
+
diagLog: () => IDiagnosticLogger;
|
|
2090
1618
|
/**
|
|
2091
|
-
*
|
|
2092
|
-
* @param uploadState - The state of the unload process
|
|
2093
|
-
* @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
|
|
1619
|
+
* Gets the current core config instance
|
|
2094
1620
|
*/
|
|
2095
|
-
|
|
1621
|
+
getCfg: () => IConfiguration;
|
|
2096
1622
|
/**
|
|
2097
|
-
*
|
|
2098
|
-
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
2099
|
-
* then the current execution order will be copied.
|
|
2100
|
-
* @param startAt - The plugin to start processing from, if missing from the execution
|
|
2101
|
-
* order then the next plugin will be NOT set.
|
|
1623
|
+
* Gets the named extension config
|
|
2102
1624
|
*/
|
|
2103
|
-
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
/**
|
|
2107
|
-
* The current context for the current call to the plugin update() implementations, used to support the notifications
|
|
2108
|
-
* for when plugins are added, removed or the configuration was changed.
|
|
2109
|
-
*/
|
|
2110
|
-
declare interface IProcessTelemetryUpdateContext extends IBaseProcessingContext {
|
|
1625
|
+
getExtCfg: <T>(identifier: string, defaultValue?: T | any) => T;
|
|
2111
1626
|
/**
|
|
2112
|
-
*
|
|
2113
|
-
*
|
|
2114
|
-
* @
|
|
1627
|
+
* Gets the named config from either the named identifier extension or core config if neither exist then the
|
|
1628
|
+
* default value is returned
|
|
1629
|
+
* @param identifier The named extension identifier
|
|
1630
|
+
* @param field The config field name
|
|
1631
|
+
* @param defaultValue The default value to return if no defined config exists
|
|
2115
1632
|
*/
|
|
2116
|
-
|
|
1633
|
+
getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean) => number | string | boolean;
|
|
2117
1634
|
/**
|
|
2118
|
-
*
|
|
1635
|
+
* Helper to allow plugins to check and possibly shortcut executing code only
|
|
1636
|
+
* required if there is a nextPlugin
|
|
1637
|
+
*/
|
|
1638
|
+
hasNext: () => boolean;
|
|
1639
|
+
/**
|
|
1640
|
+
* Returns the next configured plugin proxy
|
|
1641
|
+
*/
|
|
1642
|
+
getNext: () => ITelemetryPluginChain;
|
|
1643
|
+
/**
|
|
1644
|
+
* Helper to set the next plugin proxy
|
|
1645
|
+
*/
|
|
1646
|
+
setNext: (nextCtx: ITelemetryPluginChain) => void;
|
|
1647
|
+
/**
|
|
1648
|
+
* Call back for telemetry processing before it it is sent
|
|
1649
|
+
* @param env - This is the current event being reported
|
|
1650
|
+
*/
|
|
1651
|
+
processNext: (env: ITelemetryItem) => void;
|
|
1652
|
+
/**
|
|
1653
|
+
* Create a new context using the core and config from the current instance
|
|
2119
1654
|
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
2120
1655
|
* then the current execution order will be copied.
|
|
2121
1656
|
* @param startAt - The plugin to start processing from, if missing from the execution
|
|
2122
1657
|
* order then the next plugin will be NOT set.
|
|
2123
1658
|
*/
|
|
2124
|
-
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) =>
|
|
1659
|
+
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext;
|
|
2125
1660
|
}
|
|
2126
1661
|
|
|
2127
1662
|
declare interface IRequestContext {
|
|
@@ -2258,17 +1793,11 @@ declare interface ISerializable {
|
|
|
2258
1793
|
aiDataContract: any;
|
|
2259
1794
|
}
|
|
2260
1795
|
|
|
2261
|
-
export declare function isNullOrUndefined(value: any): value is null | undefined;
|
|
2262
|
-
|
|
2263
1796
|
declare interface IStackDetails {
|
|
2264
1797
|
src: string;
|
|
2265
1798
|
obj: string[];
|
|
2266
1799
|
}
|
|
2267
1800
|
|
|
2268
|
-
declare interface ITelemetryInitializerHandler {
|
|
2269
|
-
remove(): void;
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
1801
|
/**
|
|
2273
1802
|
* Telemety item supported in Core
|
|
2274
1803
|
*/
|
|
@@ -2318,7 +1847,15 @@ export declare interface ITelemetryItem {
|
|
|
2318
1847
|
/**
|
|
2319
1848
|
* Configuration provided to SDK core
|
|
2320
1849
|
*/
|
|
2321
|
-
|
|
1850
|
+
declare interface ITelemetryPlugin extends IPlugin {
|
|
1851
|
+
/**
|
|
1852
|
+
* Call back for telemetry processing before it it is sent
|
|
1853
|
+
* @param env - This is the current event being reported
|
|
1854
|
+
* @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
|
|
1855
|
+
* can optionally use this to access the current core instance or define / pass additional information
|
|
1856
|
+
* to later plugins (vs appending items to the telemetry item)
|
|
1857
|
+
*/
|
|
1858
|
+
processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void;
|
|
2322
1859
|
/**
|
|
2323
1860
|
* Set next extension for telemetry processing, this is not optional as plugins should use the
|
|
2324
1861
|
* processNext() function of the passed IProcessTelemetryContext instead. It is being kept for
|
|
@@ -2334,7 +1871,7 @@ export declare interface ITelemetryPlugin extends ITelemetryProcessor, IPlugin {
|
|
|
2334
1871
|
/**
|
|
2335
1872
|
* Configuration provided to SDK core
|
|
2336
1873
|
*/
|
|
2337
|
-
declare interface ITelemetryPluginChain
|
|
1874
|
+
declare interface ITelemetryPluginChain {
|
|
2338
1875
|
/**
|
|
2339
1876
|
* Returns the underlying plugin that is being proxied for the processTelemetry call
|
|
2340
1877
|
*/
|
|
@@ -2343,16 +1880,6 @@ declare interface ITelemetryPluginChain extends ITelemetryProcessor {
|
|
|
2343
1880
|
* Returns the next plugin
|
|
2344
1881
|
*/
|
|
2345
1882
|
getNext: () => ITelemetryPluginChain;
|
|
2346
|
-
/**
|
|
2347
|
-
* This plugin is being unloaded and should remove any hooked events and cleanup any global/scoped values, after this
|
|
2348
|
-
* call the plugin will be removed from the telemetry processing chain and will no longer receive any events..
|
|
2349
|
-
* @param unloadCtx - The unload context to use for this call.
|
|
2350
|
-
* @param unloadState - The details of the unload operation
|
|
2351
|
-
*/
|
|
2352
|
-
unload?: (unloadCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
declare interface ITelemetryProcessor {
|
|
2356
1883
|
/**
|
|
2357
1884
|
* Call back for telemetry processing before it it is sent
|
|
2358
1885
|
* @param env - This is the current event being reported
|
|
@@ -2360,43 +1887,7 @@ declare interface ITelemetryProcessor {
|
|
|
2360
1887
|
* can optionally use this to access the current core instance or define / pass additional information
|
|
2361
1888
|
* to later plugins (vs appending items to the telemetry item)
|
|
2362
1889
|
*/
|
|
2363
|
-
processTelemetry: (env: ITelemetryItem, itemCtx
|
|
2364
|
-
/**
|
|
2365
|
-
* The the plugin should re-evaluate configuration and update any cached configuration settings or
|
|
2366
|
-
* plugins. If implemented this method will be called whenever a plugin is added or removed and if
|
|
2367
|
-
* the configuration has bee updated.
|
|
2368
|
-
* @param updateCtx - This is the context that should be used during updating.
|
|
2369
|
-
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
2370
|
-
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
2371
|
-
*/
|
|
2372
|
-
update?: (updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) => void | boolean;
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
declare interface ITelemetryUnloadState {
|
|
2376
|
-
reason: TelemetryUnloadReason;
|
|
2377
|
-
isAsync: boolean;
|
|
2378
|
-
flushComplete?: boolean;
|
|
2379
|
-
}
|
|
2380
|
-
|
|
2381
|
-
declare interface ITelemetryUpdateState {
|
|
2382
|
-
/**
|
|
2383
|
-
* Identifies the reason for the update notification, this is a bitwise numeric value
|
|
2384
|
-
*/
|
|
2385
|
-
reason: TelemetryUpdateReason;
|
|
2386
|
-
/**
|
|
2387
|
-
* If this is a configuration update this was the previous configuration that was used
|
|
2388
|
-
*/
|
|
2389
|
-
/**
|
|
2390
|
-
* If this is a configuration update is the new configuration that is being used
|
|
2391
|
-
*/
|
|
2392
|
-
/**
|
|
2393
|
-
* This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
|
|
2394
|
-
*/
|
|
2395
|
-
added?: IPlugin[];
|
|
2396
|
-
/**
|
|
2397
|
-
* This holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
|
|
2398
|
-
*/
|
|
2399
|
-
removed?: IPlugin[];
|
|
1890
|
+
processTelemetry: (env: ITelemetryItem, itemCtx: IProcessTelemetryContext) => void;
|
|
2400
1891
|
}
|
|
2401
1892
|
|
|
2402
1893
|
export declare interface ITraceTelemetry extends IPartC {
|
|
@@ -2420,21 +1911,16 @@ export declare interface ITraceTelemetry extends IPartC {
|
|
|
2420
1911
|
iKey?: string;
|
|
2421
1912
|
}
|
|
2422
1913
|
|
|
2423
|
-
declare
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
* @param target - The target object to be assigned with the source properties and functions
|
|
2434
|
-
* @param source - The source object which will be assigned / called by setting / calling the targets proxies
|
|
2435
|
-
* @param functionsToProxy - An array of function names that will be proxied on the target
|
|
2436
|
-
*/
|
|
2437
|
-
export declare function proxyFunctions<T, S>(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget?: boolean): T;
|
|
1914
|
+
declare enum LoggingSeverity {
|
|
1915
|
+
/**
|
|
1916
|
+
* Error will be sent as internal telemetry
|
|
1917
|
+
*/
|
|
1918
|
+
CRITICAL = 1,
|
|
1919
|
+
/**
|
|
1920
|
+
* Error will NOT be sent as internal telemetry, and will only be shown in browser console
|
|
1921
|
+
*/
|
|
1922
|
+
WARNING = 2
|
|
1923
|
+
}
|
|
2438
1924
|
|
|
2439
1925
|
export declare class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
2440
1926
|
static constructEnvelope(orig: ITelemetryItem, iKey: string, logger: IDiagnosticLogger, convertUndefined?: any): IEnvelope;
|
|
@@ -2480,6 +1966,7 @@ export declare class Sender extends BaseTelemetryPlugin implements IChannelContr
|
|
|
2480
1966
|
* Will not flush if the Send has been paused.
|
|
2481
1967
|
*/
|
|
2482
1968
|
onunloadFlush(): void;
|
|
1969
|
+
teardown(): void;
|
|
2483
1970
|
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
2484
1971
|
processTelemetry(telemetryItem: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
2485
1972
|
/**
|
|
@@ -2521,7 +2008,7 @@ declare type SenderFunction = (payload: string[], isAsync: boolean) => void;
|
|
|
2521
2008
|
/**
|
|
2522
2009
|
* The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
|
|
2523
2010
|
*/
|
|
2524
|
-
|
|
2011
|
+
declare const enum SendRequestReason {
|
|
2525
2012
|
/**
|
|
2526
2013
|
* No specific reason was specified
|
|
2527
2014
|
*/
|
|
@@ -2550,10 +2037,6 @@ export declare const enum SendRequestReason {
|
|
|
2550
2037
|
* The event(s) being sent as a retry
|
|
2551
2038
|
*/
|
|
2552
2039
|
Retry = 5,
|
|
2553
|
-
/**
|
|
2554
|
-
* The SDK is unloading
|
|
2555
|
-
*/
|
|
2556
|
-
SdkUnload = 6,
|
|
2557
2040
|
/**
|
|
2558
2041
|
* Maximum batch size would be exceeded
|
|
2559
2042
|
*/
|
|
@@ -2579,55 +2062,6 @@ declare interface Tags {
|
|
|
2579
2062
|
[key: string]: any;
|
|
2580
2063
|
}
|
|
2581
2064
|
|
|
2582
|
-
declare type TelemetryInitializerFunction = <T extends ITelemetryItem>(item: T) => boolean | void;
|
|
2583
|
-
|
|
2584
|
-
/**
|
|
2585
|
-
* The TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
|
|
2586
|
-
*/
|
|
2587
|
-
declare const enum TelemetryUnloadReason {
|
|
2588
|
-
/**
|
|
2589
|
-
* Teardown has been called without any context.
|
|
2590
|
-
*/
|
|
2591
|
-
ManualTeardown = 0,
|
|
2592
|
-
/**
|
|
2593
|
-
* Just this plugin is being removed
|
|
2594
|
-
*/
|
|
2595
|
-
PluginUnload = 1,
|
|
2596
|
-
/**
|
|
2597
|
-
* This instance of the plugin is being removed and replaced
|
|
2598
|
-
*/
|
|
2599
|
-
PluginReplace = 2,
|
|
2600
|
-
/**
|
|
2601
|
-
* The entire SDK is being unloaded
|
|
2602
|
-
*/
|
|
2603
|
-
SdkUnload = 50
|
|
2604
|
-
}
|
|
2605
|
-
|
|
2606
|
-
/**
|
|
2607
|
-
* The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
|
|
2608
|
-
*/
|
|
2609
|
-
declare const enum TelemetryUpdateReason {
|
|
2610
|
-
/**
|
|
2611
|
-
* Unknown.
|
|
2612
|
-
*/
|
|
2613
|
-
Unknown = 0,
|
|
2614
|
-
/**
|
|
2615
|
-
* The configuration has ben updated or changed
|
|
2616
|
-
*/
|
|
2617
|
-
/**
|
|
2618
|
-
* One or more plugins have been added
|
|
2619
|
-
*/
|
|
2620
|
-
PluginAdded = 16,
|
|
2621
|
-
/**
|
|
2622
|
-
* One or more plugins have been removed
|
|
2623
|
-
*/
|
|
2624
|
-
PluginRemoved = 32
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
export declare function throwError(message: string): never;
|
|
2628
|
-
|
|
2629
|
-
declare type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
2630
|
-
|
|
2631
2065
|
declare interface XDomainRequest extends XMLHttpRequestEventTarget {
|
|
2632
2066
|
readonly responseText: string;
|
|
2633
2067
|
send(payload: string): void;
|