@microsoft/applicationinsights-web-basic 3.0.0-beta.2210-01 → 3.0.0-beta.2210-02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/aib.2.js +1349 -760
- 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/browser/aib.3.0.0-beta.2210-02.integrity.json +26 -0
- package/browser/{aib.3.0.0-beta.2210-01.js → aib.3.0.0-beta.2210-02.js} +1350 -761
- package/browser/aib.3.0.0-beta.2210-02.js.map +1 -0
- package/browser/aib.3.0.0-beta.2210-02.min.js +6 -0
- package/browser/aib.3.0.0-beta.2210-02.min.js.map +1 -0
- package/dist/applicationinsights-web-basic.api.json +2003 -158
- package/dist/applicationinsights-web-basic.api.md +76 -25
- package/dist/applicationinsights-web-basic.d.ts +299 -221
- package/dist/applicationinsights-web-basic.js +1349 -760
- 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 +299 -221
- package/dist-esm/__DynamicConstants.js +1 -1
- package/dist-esm/index.js +11 -6
- package/dist-esm/index.js.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +14 -8
- package/types/index.d.ts +5 -5
- package/browser/aib.3.0.0-beta.2210-01.integrity.json +0 -26
- package/browser/aib.3.0.0-beta.2210-01.js.map +0 -1
- package/browser/aib.3.0.0-beta.2210-01.min.js +0 -6
- package/browser/aib.3.0.0-beta.2210-01.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft.ApplicationInsights, 3.0.0-beta.2210-
|
|
2
|
+
* Microsoft.ApplicationInsights, 3.0.0-beta.2210-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -12,81 +12,7 @@ declare namespace ApplicationInsights {
|
|
|
12
12
|
import { isNullOrUndefined } from '@nevware21/ts-utils';
|
|
13
13
|
import { throwError } from '@nevware21/ts-utils';
|
|
14
14
|
|
|
15
|
-
class AppInsightsCore
|
|
16
|
-
constructor();
|
|
17
|
-
initialize(config: IConfiguration, extensions: IPlugin[], logger?: IDiagnosticLogger, notificationManager?: INotificationManager): void;
|
|
18
|
-
track(telemetryItem: ITelemetryItem): void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @export
|
|
23
|
-
* @class ApplicationInsights
|
|
24
|
-
*/
|
|
25
|
-
class ApplicationInsights {
|
|
26
|
-
config: IConfiguration & IConfig;
|
|
27
|
-
/**
|
|
28
|
-
* Creates an instance of ApplicationInsights.
|
|
29
|
-
* @param {IConfiguration & IConfig} config
|
|
30
|
-
* @memberof ApplicationInsights
|
|
31
|
-
*/
|
|
32
|
-
constructor(config: IConfiguration & IConfig);
|
|
33
|
-
/**
|
|
34
|
-
* Initialize this instance of ApplicationInsights
|
|
35
|
-
*
|
|
36
|
-
* @memberof ApplicationInsights
|
|
37
|
-
*/
|
|
38
|
-
initialize(): void;
|
|
39
|
-
/**
|
|
40
|
-
* Send a manually constructed custom event
|
|
41
|
-
*
|
|
42
|
-
* @param {ITelemetryItem} item
|
|
43
|
-
* @memberof ApplicationInsights
|
|
44
|
-
*/
|
|
45
|
-
track(item: ITelemetryItem): void;
|
|
46
|
-
/**
|
|
47
|
-
* Immediately send all batched telemetry
|
|
48
|
-
* @param {boolean} [async=true]
|
|
49
|
-
* @memberof ApplicationInsights
|
|
50
|
-
*/
|
|
51
|
-
flush(async?: boolean): void;
|
|
52
|
-
pollInternalLogs(): void;
|
|
53
|
-
stopPollingInternalLogs(): void;
|
|
54
|
-
getSKUDefaults(): void;
|
|
55
|
-
/**
|
|
56
|
-
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
57
|
-
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
58
|
-
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
59
|
-
* approach is to create a new instance and initialize that instance.
|
|
60
|
-
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
61
|
-
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
62
|
-
*/
|
|
63
|
-
unload(isAsync?: boolean, unloadComplete?: () => void): void;
|
|
64
|
-
/**
|
|
65
|
-
* Find and return the (first) plugin with the specified identifier if present
|
|
66
|
-
* @param pluginIdentifier
|
|
67
|
-
*/
|
|
68
|
-
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
69
|
-
/**
|
|
70
|
-
* Add a new plugin to the installation
|
|
71
|
-
* @param plugin - The new plugin to add
|
|
72
|
-
* @param replaceExisting - should any existing plugin be replaced
|
|
73
|
-
* @param doAsync - Should the add be performed asynchronously
|
|
74
|
-
*/
|
|
75
|
-
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
|
|
76
|
-
/**
|
|
77
|
-
* Returns the unique event namespace that should be used
|
|
78
|
-
*/
|
|
79
|
-
evtNamespace(): string;
|
|
80
|
-
/**
|
|
81
|
-
* Add an unload handler that will be called when the SDK is being unloaded
|
|
82
|
-
* @param handler - the handler
|
|
83
|
-
*/
|
|
84
|
-
addUnloadCb(handler: UnloadHandler): void;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export { arrForEach }
|
|
88
|
-
|
|
89
|
-
class BaseCore implements IAppInsightsCore {
|
|
15
|
+
class AppInsightsCore implements IAppInsightsCore {
|
|
90
16
|
static defaultConfig: IConfiguration;
|
|
91
17
|
config: IConfiguration;
|
|
92
18
|
logger: IDiagnosticLogger;
|
|
@@ -102,12 +28,12 @@ declare namespace ApplicationInsights {
|
|
|
102
28
|
* Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
|
|
103
29
|
* The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
|
|
104
30
|
* called.
|
|
105
|
-
* @param
|
|
31
|
+
* @param listener - An INotificationListener object.
|
|
106
32
|
*/
|
|
107
33
|
addNotificationListener(listener: INotificationListener): void;
|
|
108
34
|
/**
|
|
109
35
|
* Removes all instances of the listener.
|
|
110
|
-
* @param
|
|
36
|
+
* @param listener - INotificationListener to remove.
|
|
111
37
|
*/
|
|
112
38
|
removeNotificationListener(listener: INotificationListener): void;
|
|
113
39
|
/**
|
|
@@ -135,7 +61,7 @@ declare namespace ApplicationInsights {
|
|
|
135
61
|
* @param telemetryInitializer - The Telemetry Initializer function
|
|
136
62
|
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
137
63
|
*/
|
|
138
|
-
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler
|
|
64
|
+
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
|
|
139
65
|
/**
|
|
140
66
|
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
141
67
|
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
@@ -157,6 +83,12 @@ declare namespace ApplicationInsights {
|
|
|
157
83
|
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
158
84
|
*/
|
|
159
85
|
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
86
|
+
/**
|
|
87
|
+
* Update the configuration used and broadcast the changes to all loaded plugins
|
|
88
|
+
* @param newConfig - The new configuration is apply
|
|
89
|
+
* @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to true.
|
|
90
|
+
*/
|
|
91
|
+
updateCfg<T extends IConfiguration = IConfiguration>(newConfig: T, mergeExisting?: boolean): void;
|
|
160
92
|
/**
|
|
161
93
|
* Returns the unique event namespace that should be used
|
|
162
94
|
*/
|
|
@@ -184,6 +116,18 @@ declare namespace ApplicationInsights {
|
|
|
184
116
|
* Sets the current distributed trace context for this instance if available
|
|
185
117
|
*/
|
|
186
118
|
setTraceCtx(newTracectx: IDistributedTraceContext): void;
|
|
119
|
+
/**
|
|
120
|
+
* Add this hook so that it is automatically removed during unloading
|
|
121
|
+
* @param hooks - The single hook or an array of IInstrumentHook objects
|
|
122
|
+
*/
|
|
123
|
+
addUnloadHook(hooks: IUnloadHook | IUnloadHook[] | Iterator<IUnloadHook> | ILegacyUnloadHook | ILegacyUnloadHook[] | Iterator<ILegacyUnloadHook>): void;
|
|
124
|
+
/**
|
|
125
|
+
* Watches and tracks changes for accesses to the current config, and if the accessed config changes the
|
|
126
|
+
* handler will be recalled.
|
|
127
|
+
* @param handler
|
|
128
|
+
* @returns A watcher handler instance that can be used to remove itself when being unloaded
|
|
129
|
+
*/
|
|
130
|
+
onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
|
|
187
131
|
protected releaseQueue(): void;
|
|
188
132
|
/**
|
|
189
133
|
* Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
|
|
@@ -194,6 +138,74 @@ declare namespace ApplicationInsights {
|
|
|
194
138
|
protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
195
139
|
}
|
|
196
140
|
|
|
141
|
+
/**
|
|
142
|
+
* @export
|
|
143
|
+
* @class ApplicationInsights
|
|
144
|
+
*/
|
|
145
|
+
class ApplicationInsights {
|
|
146
|
+
readonly config: IConfiguration & IConfig;
|
|
147
|
+
/**
|
|
148
|
+
* Creates an instance of ApplicationInsights.
|
|
149
|
+
* @param config
|
|
150
|
+
* @memberof ApplicationInsights
|
|
151
|
+
*/
|
|
152
|
+
constructor(config: IConfiguration & IConfig);
|
|
153
|
+
/**
|
|
154
|
+
* Initialize this instance of ApplicationInsights
|
|
155
|
+
*
|
|
156
|
+
* @memberof ApplicationInsights
|
|
157
|
+
*/
|
|
158
|
+
initialize(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Send a manually constructed custom event
|
|
161
|
+
*
|
|
162
|
+
* @param item
|
|
163
|
+
* @memberof ApplicationInsights
|
|
164
|
+
*/
|
|
165
|
+
track(item: ITelemetryItem): void;
|
|
166
|
+
/**
|
|
167
|
+
* Immediately send all batched telemetry
|
|
168
|
+
* @param [async=true]
|
|
169
|
+
* @memberof ApplicationInsights
|
|
170
|
+
*/
|
|
171
|
+
flush(async?: boolean): void;
|
|
172
|
+
pollInternalLogs(): void;
|
|
173
|
+
stopPollingInternalLogs(): void;
|
|
174
|
+
getSKUDefaults(): void;
|
|
175
|
+
/**
|
|
176
|
+
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
177
|
+
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
178
|
+
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
179
|
+
* approach is to create a new instance and initialize that instance.
|
|
180
|
+
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
181
|
+
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
182
|
+
*/
|
|
183
|
+
unload(isAsync?: boolean, unloadComplete?: () => void): void;
|
|
184
|
+
/**
|
|
185
|
+
* Find and return the (first) plugin with the specified identifier if present
|
|
186
|
+
* @param pluginIdentifier
|
|
187
|
+
*/
|
|
188
|
+
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
189
|
+
/**
|
|
190
|
+
* Add a new plugin to the installation
|
|
191
|
+
* @param plugin - The new plugin to add
|
|
192
|
+
* @param replaceExisting - should any existing plugin be replaced
|
|
193
|
+
* @param doAsync - Should the add be performed asynchronously
|
|
194
|
+
*/
|
|
195
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting: boolean, doAsync: boolean, addCb?: (added?: boolean) => void): void;
|
|
196
|
+
/**
|
|
197
|
+
* Returns the unique event namespace that should be used
|
|
198
|
+
*/
|
|
199
|
+
evtNamespace(): string;
|
|
200
|
+
/**
|
|
201
|
+
* Add an unload handler that will be called when the SDK is being unloaded
|
|
202
|
+
* @param handler - the handler
|
|
203
|
+
*/
|
|
204
|
+
addUnloadCb(handler: UnloadHandler): void;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export { arrForEach }
|
|
208
|
+
|
|
197
209
|
/**
|
|
198
210
|
* BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins
|
|
199
211
|
* can avoid implementation the same set of boiler plate code as well as provide a base
|
|
@@ -284,7 +296,7 @@ declare namespace ApplicationInsights {
|
|
|
284
296
|
* Add this hook so that it is automatically removed during unloading
|
|
285
297
|
* @param hooks - The single hook or an array of IInstrumentHook objects
|
|
286
298
|
*/
|
|
287
|
-
protected _addHook(hooks:
|
|
299
|
+
protected _addHook(hooks: IUnloadHook | IUnloadHook[] | ILegacyUnloadHook | ILegacyUnloadHook[]): void;
|
|
288
300
|
}
|
|
289
301
|
|
|
290
302
|
const DistributedTracingModes: EnumValue<typeof eDistributedTracingModes>;
|
|
@@ -389,10 +401,16 @@ declare namespace ApplicationInsights {
|
|
|
389
401
|
TrackPageActionEventFailed = 103,
|
|
390
402
|
FailedAddingCustomDefinedRequestContext = 104,
|
|
391
403
|
InMemoryStorageBufferFull = 105,
|
|
392
|
-
InstrumentationKeyDeprecation = 106
|
|
404
|
+
InstrumentationKeyDeprecation = 106,
|
|
405
|
+
ConfigWatcherException = 107,
|
|
406
|
+
DynamicConfigException = 108
|
|
393
407
|
}
|
|
394
408
|
|
|
395
409
|
const enum eLoggingSeverity {
|
|
410
|
+
/**
|
|
411
|
+
* No Logging will be enabled
|
|
412
|
+
*/
|
|
413
|
+
DISABLED = 0,
|
|
396
414
|
/**
|
|
397
415
|
* Error will be sent as internal telemetry
|
|
398
416
|
*/
|
|
@@ -416,12 +434,6 @@ declare namespace ApplicationInsights {
|
|
|
416
434
|
Critical = 4
|
|
417
435
|
}
|
|
418
436
|
|
|
419
|
-
const enum GetExtCfgMergeType {
|
|
420
|
-
None = 0,
|
|
421
|
-
MergeDefaultOnly = 1,
|
|
422
|
-
MergeDefaultFromRootOrDefault = 2
|
|
423
|
-
}
|
|
424
|
-
|
|
425
437
|
interface IAppInsightsCore extends IPerfManagerProvider {
|
|
426
438
|
config: IConfiguration;
|
|
427
439
|
logger: IDiagnosticLogger;
|
|
@@ -449,12 +461,12 @@ declare namespace ApplicationInsights {
|
|
|
449
461
|
* Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
|
|
450
462
|
* The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
|
|
451
463
|
* called.
|
|
452
|
-
* @param
|
|
464
|
+
* @param listener - An INotificationListener object.
|
|
453
465
|
*/
|
|
454
466
|
addNotificationListener?(listener: INotificationListener): void;
|
|
455
467
|
/**
|
|
456
468
|
* Removes all instances of the listener.
|
|
457
|
-
* @param
|
|
469
|
+
* @param listener - INotificationListener to remove.
|
|
458
470
|
*/
|
|
459
471
|
removeNotificationListener?(listener: INotificationListener): void;
|
|
460
472
|
/**
|
|
@@ -462,7 +474,7 @@ declare namespace ApplicationInsights {
|
|
|
462
474
|
* @param telemetryInitializer - The Telemetry Initializer function
|
|
463
475
|
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
464
476
|
*/
|
|
465
|
-
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler
|
|
477
|
+
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler;
|
|
466
478
|
pollInternalLogs?(eventName?: string): number;
|
|
467
479
|
stopPollingInternalLogs?(): void;
|
|
468
480
|
/**
|
|
@@ -494,6 +506,14 @@ declare namespace ApplicationInsights {
|
|
|
494
506
|
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
495
507
|
*/
|
|
496
508
|
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
509
|
+
/**
|
|
510
|
+
* Update the configuration used and broadcast the changes to all loaded plugins, this does NOT support updating, adding or removing
|
|
511
|
+
* any the plugins (extensions or channels). It will notify each plugin (if supported) that the configuration has changed but it will
|
|
512
|
+
* not remove or add any new plugins, you need to call addPlugin or getPlugin(identifier).remove();
|
|
513
|
+
* @param newConfig - The new configuration is apply
|
|
514
|
+
* @param mergeExisting - Should the new configuration merge with the existing or just replace it. Default is to merge.
|
|
515
|
+
*/
|
|
516
|
+
updateCfg<T extends IConfiguration = IConfiguration>(newConfig: T, mergeExisting?: boolean): void;
|
|
497
517
|
/**
|
|
498
518
|
* Returns the unique event namespace that should be used when registering events
|
|
499
519
|
*/
|
|
@@ -503,6 +523,11 @@ declare namespace ApplicationInsights {
|
|
|
503
523
|
* @param handler - the handler
|
|
504
524
|
*/
|
|
505
525
|
addUnloadCb(handler: UnloadHandler): void;
|
|
526
|
+
/**
|
|
527
|
+
* Add this hook so that it is automatically removed during unloading
|
|
528
|
+
* @param hooks - The single hook or an array of IInstrumentHook objects
|
|
529
|
+
*/
|
|
530
|
+
addUnloadHook(hooks: IUnloadHook | IUnloadHook[] | Iterator<IUnloadHook> | ILegacyUnloadHook | ILegacyUnloadHook[] | Iterator<ILegacyUnloadHook>): void;
|
|
506
531
|
/**
|
|
507
532
|
* Flush and send any batched / cached data immediately
|
|
508
533
|
* @param async - send data asynchronously when true (defaults to true)
|
|
@@ -522,6 +547,13 @@ declare namespace ApplicationInsights {
|
|
|
522
547
|
* Sets the current distributed trace context for this instance if available
|
|
523
548
|
*/
|
|
524
549
|
setTraceCtx(newTraceCtx: IDistributedTraceContext | null | undefined): void;
|
|
550
|
+
/**
|
|
551
|
+
* Watches and tracks changes for accesses to the current config, and if the accessed config changes the
|
|
552
|
+
* handler will be recalled.
|
|
553
|
+
* @param handler
|
|
554
|
+
* @returns A watcher handler instance that can be used to remove itself when being unloaded
|
|
555
|
+
*/
|
|
556
|
+
onCfgChange<T extends IConfiguration = IConfiguration>(handler: WatcherFunction<T>): IUnloadHook;
|
|
525
557
|
}
|
|
526
558
|
|
|
527
559
|
/**
|
|
@@ -621,13 +653,13 @@ declare namespace ApplicationInsights {
|
|
|
621
653
|
/**
|
|
622
654
|
* Gets the named extension config
|
|
623
655
|
*/
|
|
624
|
-
getExtCfg: <T>(identifier: string, defaultValue?: T
|
|
656
|
+
getExtCfg: <T>(identifier: string, defaultValue?: IConfigDefaults<T>) => T;
|
|
625
657
|
/**
|
|
626
658
|
* Gets the named config from either the named identifier extension or core config if neither exist then the
|
|
627
659
|
* default value is returned
|
|
628
|
-
* @param identifier The named extension identifier
|
|
629
|
-
* @param field The config field name
|
|
630
|
-
* @param defaultValue The default value to return if no defined config exists
|
|
660
|
+
* @param identifier - The named extension identifier
|
|
661
|
+
* @param field - The config field name
|
|
662
|
+
* @param defaultValue - The default value to return if no defined config exists
|
|
631
663
|
*/
|
|
632
664
|
getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
|
|
633
665
|
/**
|
|
@@ -1019,6 +1051,51 @@ declare namespace ApplicationInsights {
|
|
|
1019
1051
|
addIntEndpoints?: boolean;
|
|
1020
1052
|
}
|
|
1021
1053
|
|
|
1054
|
+
/**
|
|
1055
|
+
* The type to identify whether the default value should be applied in preference to the provided value.
|
|
1056
|
+
*/
|
|
1057
|
+
type IConfigCheckFn<V> = (value: V) => boolean;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* The default values with a check function
|
|
1061
|
+
*/
|
|
1062
|
+
interface IConfigDefaultCheck<T, V, C extends IConfiguration = IConfiguration> {
|
|
1063
|
+
/**
|
|
1064
|
+
* Callback function to check if the user-supplied value is valid, if not the default will be applied
|
|
1065
|
+
*/
|
|
1066
|
+
isVal?: IConfigCheckFn<V>;
|
|
1067
|
+
/**
|
|
1068
|
+
* Optional function to allow converting and setting of the default value
|
|
1069
|
+
*/
|
|
1070
|
+
set?: IConfigSetFn<T, V>;
|
|
1071
|
+
/**
|
|
1072
|
+
* The default value to apply if the user-supplied value is not valid
|
|
1073
|
+
*/
|
|
1074
|
+
v?: V;
|
|
1075
|
+
/**
|
|
1076
|
+
* The default fallback key if the main key is not present, this is the key value from the config
|
|
1077
|
+
*/
|
|
1078
|
+
fb?: keyof T | keyof C | Array<keyof T | keyof C>;
|
|
1079
|
+
/**
|
|
1080
|
+
* Use this check to determine the default fallback, default only checked whether the property isDefined,
|
|
1081
|
+
* therefore `null`; `""` are considered to be valid values.
|
|
1082
|
+
*/
|
|
1083
|
+
dfVal?: (value: any) => boolean;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
/**
|
|
1087
|
+
* The Type definition to define default values to be applied to the config
|
|
1088
|
+
* The value may be either the direct value or a ConfigDefaultCheck definition
|
|
1089
|
+
*/
|
|
1090
|
+
type IConfigDefaults<T, C extends IConfiguration = IConfiguration> = {
|
|
1091
|
+
[key in keyof T]: T[key] | IConfigDefaultCheck<T, T[key], C>;
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* The type which identifies the function use to validate the user supplied value
|
|
1096
|
+
*/
|
|
1097
|
+
type IConfigSetFn<T, V> = (value: any, defValue: V, theConfig: T) => V;
|
|
1098
|
+
|
|
1022
1099
|
/**
|
|
1023
1100
|
* Configuration provided to SDK core
|
|
1024
1101
|
*/
|
|
@@ -1200,6 +1277,11 @@ declare namespace ApplicationInsights {
|
|
|
1200
1277
|
* @returns - True if the cookie was marked for deletion otherwise false (Because cookie usage is not available)
|
|
1201
1278
|
*/
|
|
1202
1279
|
purge(name: string, path?: string): boolean;
|
|
1280
|
+
/**
|
|
1281
|
+
* Optional Callback hook to allow the diagnostic logger to update it's configuration
|
|
1282
|
+
* @param updateState
|
|
1283
|
+
*/
|
|
1284
|
+
update?(updateState: ITelemetryUpdateState): void;
|
|
1203
1285
|
}
|
|
1204
1286
|
|
|
1205
1287
|
/**
|
|
@@ -1300,20 +1382,20 @@ declare namespace ApplicationInsights {
|
|
|
1300
1382
|
queue: _InternalLogMessage[];
|
|
1301
1383
|
/**
|
|
1302
1384
|
* This method will throw exceptions in debug mode or attempt to log the error as a console warning.
|
|
1303
|
-
* @param severity {LoggingSeverity} - The severity of the log message
|
|
1304
|
-
* @param message {_InternalLogMessage} - The log message.
|
|
1385
|
+
* @param severity - {LoggingSeverity} - The severity of the log message
|
|
1386
|
+
* @param message - {_InternalLogMessage} - The log message.
|
|
1305
1387
|
*/
|
|
1306
|
-
throwInternal(severity: LoggingSeverity, msgId:
|
|
1388
|
+
throwInternal(severity: LoggingSeverity, msgId: _eInternalMessageId, msg: string, properties?: Object, isUserAct?: boolean): void;
|
|
1307
1389
|
/**
|
|
1308
1390
|
* This will write a warning to the console if possible
|
|
1309
|
-
* @param message {string} - The warning message
|
|
1391
|
+
* @param message - {string} - The warning message
|
|
1310
1392
|
*/
|
|
1311
1393
|
warnToConsole(message: string): void;
|
|
1312
1394
|
/**
|
|
1313
1395
|
* This will write an error to the console if possible.
|
|
1314
1396
|
* Provided by the default DiagnosticLogger instance, and internally the SDK will fall back to warnToConsole, however,
|
|
1315
1397
|
* direct callers MUST check for its existence on the logger as you can provide your own IDiagnosticLogger instance.
|
|
1316
|
-
* @param message {string} - The error message
|
|
1398
|
+
* @param message - {string} - The error message
|
|
1317
1399
|
*/
|
|
1318
1400
|
errorToConsole?(message: string): void;
|
|
1319
1401
|
/**
|
|
@@ -1322,10 +1404,15 @@ declare namespace ApplicationInsights {
|
|
|
1322
1404
|
resetInternalMessageCount(): void;
|
|
1323
1405
|
/**
|
|
1324
1406
|
* Logs a message to the internal queue.
|
|
1325
|
-
* @param severity {LoggingSeverity} - The severity of the log message
|
|
1326
|
-
* @param message {_InternalLogMessage} - The message to log.
|
|
1407
|
+
* @param severity - {LoggingSeverity} - The severity of the log message
|
|
1408
|
+
* @param message - {_InternalLogMessage} - The message to log.
|
|
1327
1409
|
*/
|
|
1328
1410
|
logInternalMessage?(severity: LoggingSeverity, message: _InternalLogMessage): void;
|
|
1411
|
+
/**
|
|
1412
|
+
* Optional Callback hook to allow the diagnostic logger to update it's configuration
|
|
1413
|
+
* @param updateState
|
|
1414
|
+
*/
|
|
1415
|
+
update?(updateState: ITelemetryUpdateState): void;
|
|
1329
1416
|
}
|
|
1330
1417
|
|
|
1331
1418
|
interface IDistributedTraceContext {
|
|
@@ -1372,6 +1459,39 @@ declare namespace ApplicationInsights {
|
|
|
1372
1459
|
setTraceFlags(newValue?: number): void;
|
|
1373
1460
|
}
|
|
1374
1461
|
|
|
1462
|
+
/**
|
|
1463
|
+
* This interface identifies the config which can track changes
|
|
1464
|
+
*/
|
|
1465
|
+
interface IDynamicConfigHandler<T extends IConfiguration> {
|
|
1466
|
+
/**
|
|
1467
|
+
* Unique Id for this config handler
|
|
1468
|
+
*/
|
|
1469
|
+
readonly uid: string;
|
|
1470
|
+
/**
|
|
1471
|
+
* Link back to the configuration object that should be used to get/set values
|
|
1472
|
+
*/
|
|
1473
|
+
cfg: T;
|
|
1474
|
+
/**
|
|
1475
|
+
* The logger instance to use to loger any issues
|
|
1476
|
+
*/
|
|
1477
|
+
logger: IDiagnosticLogger;
|
|
1478
|
+
/**
|
|
1479
|
+
* Helper to call any listeners that are waiting to be notified
|
|
1480
|
+
*/
|
|
1481
|
+
notify: () => void;
|
|
1482
|
+
/**
|
|
1483
|
+
* Watch and track changes for accesses to the current config anb
|
|
1484
|
+
*/
|
|
1485
|
+
watch: (configHandler: WatcherFunction<T>) => IWatcherHandler<T>;
|
|
1486
|
+
/**
|
|
1487
|
+
* Set the value against the provided config/name with the value, the property
|
|
1488
|
+
* will be converted to be dynamic (if not already) as long as the provided config
|
|
1489
|
+
* is already a tracked dynamic object.
|
|
1490
|
+
* @throws TypeError if the provided config is not a monitored dynamic config
|
|
1491
|
+
*/
|
|
1492
|
+
set: <C, V>(theConfig: C, name: string, value: V) => V;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1375
1495
|
interface IEnvelope extends ISerializable {
|
|
1376
1496
|
/**
|
|
1377
1497
|
* Envelope version. For internal use only. By assigning this the default, it will not be serialized within the payload unless changed to a value other than #1.
|
|
@@ -1424,76 +1544,14 @@ declare namespace ApplicationInsights {
|
|
|
1424
1544
|
iKey?: string;
|
|
1425
1545
|
}
|
|
1426
1546
|
|
|
1427
|
-
interface IInstrumentCallDetails {
|
|
1428
|
-
name: string;
|
|
1429
|
-
inst: any;
|
|
1430
|
-
/**
|
|
1431
|
-
* This returns an object that the hook function can use to store hook specific
|
|
1432
|
-
* context, it it not shared with any other hook instances and is unique for the
|
|
1433
|
-
* current call.
|
|
1434
|
-
* A hook implementation can use this to pass / share context between different
|
|
1435
|
-
* hook callbacks eg. request/response requst/hookErrors etc.
|
|
1436
|
-
*/
|
|
1437
|
-
ctx: () => any;
|
|
1438
|
-
/**
|
|
1439
|
-
* Allows the hook functions to replace the original arguments
|
|
1440
|
-
* @param idx - The argument index (0 based)
|
|
1441
|
-
* @param value - The new value for the argument
|
|
1442
|
-
*/
|
|
1443
|
-
set: (idx: number, value: any) => void;
|
|
1444
|
-
/**
|
|
1445
|
-
* The result of the original method, only populated after the original method has returned
|
|
1446
|
-
*/
|
|
1447
|
-
rslt?: any;
|
|
1448
|
-
/**
|
|
1449
|
-
* The error (exception) which occurred while executing the original method
|
|
1450
|
-
*/
|
|
1451
|
-
err?: Error;
|
|
1452
|
-
/**
|
|
1453
|
-
* The Event object from (window.event) at the start of the original call
|
|
1454
|
-
*/
|
|
1455
|
-
evt?: Event;
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
1547
|
/**
|
|
1459
|
-
*
|
|
1548
|
+
* An alternate interface which provides automatic removal during unloading of the component
|
|
1460
1549
|
*/
|
|
1461
|
-
interface
|
|
1462
|
-
/** Unique Id for this callback on the hooked method */
|
|
1463
|
-
id: number;
|
|
1464
|
-
/** Holds the callbacks */
|
|
1465
|
-
cbks: IInstrumentHooksCallbacks;
|
|
1466
|
-
/** Remove this hook from the function */
|
|
1467
|
-
rm: () => void;
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
/**
|
|
1471
|
-
* The callbacks to call for the instrumented function, you must provide at least the request and/or response callbacks, both are not required.
|
|
1472
|
-
* You must always supply the error callback
|
|
1473
|
-
*/
|
|
1474
|
-
interface IInstrumentHooksCallbacks {
|
|
1475
|
-
/**
|
|
1476
|
-
* [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
|
|
1477
|
-
* identify the source of the instrumented hooks
|
|
1478
|
-
*/
|
|
1479
|
-
ns?: string | string[];
|
|
1550
|
+
interface ILegacyUnloadHook {
|
|
1480
1551
|
/**
|
|
1481
|
-
*
|
|
1552
|
+
* Legacy Self remove the referenced component
|
|
1482
1553
|
*/
|
|
1483
|
-
|
|
1484
|
-
/**
|
|
1485
|
-
* The hook callback to call after the original function was called
|
|
1486
|
-
*/
|
|
1487
|
-
rsp?: InstrumentorHooksCallback;
|
|
1488
|
-
/**
|
|
1489
|
-
* The callback to call if the hook function causes an exception
|
|
1490
|
-
*/
|
|
1491
|
-
hkErr?: InstrumentorHooksCallback;
|
|
1492
|
-
/**
|
|
1493
|
-
* The callback to call if the original function causes an exception, even if you
|
|
1494
|
-
* supply a callback the original exception will still be thrown
|
|
1495
|
-
*/
|
|
1496
|
-
fnErr?: InstrumentorHooksCallback;
|
|
1554
|
+
remove: () => void;
|
|
1497
1555
|
}
|
|
1498
1556
|
|
|
1499
1557
|
interface ILoadedPlugin<T extends IPlugin> {
|
|
@@ -1567,20 +1625,20 @@ declare namespace ApplicationInsights {
|
|
|
1567
1625
|
interface INotificationListener {
|
|
1568
1626
|
/**
|
|
1569
1627
|
* [Optional] A function called when events are sent.
|
|
1570
|
-
* @param
|
|
1628
|
+
* @param events - The array of events that have been sent.
|
|
1571
1629
|
*/
|
|
1572
1630
|
eventsSent?: (events: ITelemetryItem[]) => void;
|
|
1573
1631
|
/**
|
|
1574
1632
|
* [Optional] A function called when events are discarded.
|
|
1575
|
-
* @param
|
|
1576
|
-
* @param
|
|
1633
|
+
* @param events - The array of events that have been discarded.
|
|
1634
|
+
* @param reason - The reason for discarding the events. The EventsDiscardedReason
|
|
1577
1635
|
* constant should be used to check the different values.
|
|
1578
1636
|
*/
|
|
1579
1637
|
eventsDiscarded?: (events: ITelemetryItem[], reason: number) => void;
|
|
1580
1638
|
/**
|
|
1581
1639
|
* [Optional] A function called when the events have been requested to be sent to the sever.
|
|
1582
|
-
* @param
|
|
1583
|
-
* @param
|
|
1640
|
+
* @param sendReason - The reason why the event batch is being sent.
|
|
1641
|
+
* @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
|
|
1584
1642
|
*/
|
|
1585
1643
|
eventsSendRequest?: (sendReason: number, isAsync?: boolean) => void;
|
|
1586
1644
|
/**
|
|
@@ -1598,60 +1656,47 @@ declare namespace ApplicationInsights {
|
|
|
1598
1656
|
listeners: INotificationListener[];
|
|
1599
1657
|
/**
|
|
1600
1658
|
* Adds a notification listener.
|
|
1601
|
-
* @param
|
|
1659
|
+
* @param listener - The notification listener to be added.
|
|
1602
1660
|
*/
|
|
1603
1661
|
addNotificationListener(listener: INotificationListener): void;
|
|
1604
1662
|
/**
|
|
1605
1663
|
* Removes all instances of the listener.
|
|
1606
|
-
* @param
|
|
1664
|
+
* @param listener - AWTNotificationListener to remove.
|
|
1607
1665
|
*/
|
|
1608
1666
|
removeNotificationListener(listener: INotificationListener): void;
|
|
1609
1667
|
/**
|
|
1610
1668
|
* Notification for events sent.
|
|
1611
|
-
* @param
|
|
1669
|
+
* @param events - The array of events that have been sent.
|
|
1612
1670
|
*/
|
|
1613
1671
|
eventsSent(events: ITelemetryItem[]): void;
|
|
1614
1672
|
/**
|
|
1615
1673
|
* Notification for events being discarded.
|
|
1616
|
-
* @param
|
|
1617
|
-
* @param
|
|
1674
|
+
* @param events - The array of events that have been discarded by the SDK.
|
|
1675
|
+
* @param reason - The reason for which the SDK discarded the events. The EventsDiscardedReason
|
|
1618
1676
|
* constant should be used to check the different values.
|
|
1619
1677
|
*/
|
|
1620
1678
|
eventsDiscarded(events: ITelemetryItem[], reason: number): void;
|
|
1621
1679
|
/**
|
|
1622
1680
|
* [Optional] A function called when the events have been requested to be sent to the sever.
|
|
1623
|
-
* @param
|
|
1624
|
-
* @param
|
|
1681
|
+
* @param sendReason - The reason why the event batch is being sent.
|
|
1682
|
+
* @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
|
|
1625
1683
|
*/
|
|
1626
1684
|
eventsSendRequest?(sendReason: number, isAsync: boolean): void;
|
|
1627
1685
|
/**
|
|
1628
1686
|
* [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
|
|
1629
1687
|
* the event can be displayed via the debug plugin extension.
|
|
1630
|
-
* @param perfEvent
|
|
1688
|
+
* @param perfEvent - The perf event details
|
|
1631
1689
|
*/
|
|
1632
1690
|
perfEvent?(perfEvent: IPerfEvent): void;
|
|
1633
1691
|
}
|
|
1634
1692
|
|
|
1635
|
-
/**
|
|
1636
|
-
* A callback function that will be called for the wrapped instrumentation function
|
|
1637
|
-
* before the original function is executed.
|
|
1638
|
-
*/
|
|
1639
|
-
type InstrumentorHooksCallback = (funcArgs: IInstrumentCallDetails, ...orgArgs: any[]) => void;
|
|
1640
|
-
|
|
1641
1693
|
class _InternalLogMessage {
|
|
1642
1694
|
static dataType: string;
|
|
1643
1695
|
message: string;
|
|
1644
|
-
messageId:
|
|
1645
|
-
constructor(msgId:
|
|
1696
|
+
messageId: _eInternalMessageId;
|
|
1697
|
+
constructor(msgId: _eInternalMessageId, msg: string, isUserAct?: boolean, properties?: Object);
|
|
1646
1698
|
}
|
|
1647
1699
|
|
|
1648
|
-
/**
|
|
1649
|
-
* Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered
|
|
1650
|
-
*/
|
|
1651
|
-
const _InternalMessageId: EnumValue<typeof _eInternalMessageId>;
|
|
1652
|
-
|
|
1653
|
-
type _InternalMessageId = number | _eInternalMessageId;
|
|
1654
|
-
|
|
1655
1700
|
interface IPageViewPerformanceTelemetry extends IPartC {
|
|
1656
1701
|
/**
|
|
1657
1702
|
* name String - The name of the page. Defaults to the document title.
|
|
@@ -1811,14 +1856,14 @@ declare namespace ApplicationInsights {
|
|
|
1811
1856
|
/**
|
|
1812
1857
|
* Create a new event and start timing, the manager may return null/undefined to indicate that it does not
|
|
1813
1858
|
* want to monitor this source event.
|
|
1814
|
-
* @param src The source name of the event
|
|
1859
|
+
* @param src - The source name of the event
|
|
1815
1860
|
* @param payloadDetails - An optional callback function to fetch the payload details for the event.
|
|
1816
1861
|
* @param isAsync - Is the event occurring from a async event
|
|
1817
1862
|
*/
|
|
1818
1863
|
create(src: string, payloadDetails?: () => any, isAsync?: boolean): IPerfEvent | null | undefined;
|
|
1819
1864
|
/**
|
|
1820
1865
|
* Complete the perfEvent and fire any notifications.
|
|
1821
|
-
* @param perfEvent Fire the event which will also complete the passed event
|
|
1866
|
+
* @param perfEvent - Fire the event which will also complete the passed event
|
|
1822
1867
|
*/
|
|
1823
1868
|
fire(perfEvent: IPerfEvent): void;
|
|
1824
1869
|
/**
|
|
@@ -1844,7 +1889,7 @@ declare namespace ApplicationInsights {
|
|
|
1844
1889
|
getPerfMgr(): IPerfManager;
|
|
1845
1890
|
/**
|
|
1846
1891
|
* Set the current performance manager
|
|
1847
|
-
* @param perfMgr The performance manager
|
|
1892
|
+
* @param perfMgr - The performance manager
|
|
1848
1893
|
*/
|
|
1849
1894
|
setPerfMgr(perfMgr: IPerfManager): void;
|
|
1850
1895
|
}
|
|
@@ -2013,68 +2058,68 @@ declare namespace ApplicationInsights {
|
|
|
2013
2058
|
/**
|
|
2014
2059
|
* The url to which payloads will be sent
|
|
2015
2060
|
*/
|
|
2016
|
-
endpointUrl:
|
|
2061
|
+
endpointUrl: string;
|
|
2017
2062
|
/**
|
|
2018
2063
|
* The JSON format (normal vs line delimited). True means line delimited JSON.
|
|
2019
2064
|
*/
|
|
2020
|
-
emitLineDelimitedJson:
|
|
2065
|
+
emitLineDelimitedJson: boolean;
|
|
2021
2066
|
/**
|
|
2022
2067
|
* The maximum size of a batch in bytes
|
|
2023
2068
|
*/
|
|
2024
|
-
maxBatchSizeInBytes:
|
|
2069
|
+
maxBatchSizeInBytes: number;
|
|
2025
2070
|
/**
|
|
2026
2071
|
* The maximum interval allowed between calls to batchInvoke
|
|
2027
2072
|
*/
|
|
2028
|
-
maxBatchInterval:
|
|
2073
|
+
maxBatchInterval: number;
|
|
2029
2074
|
/**
|
|
2030
2075
|
* The master off switch. Do not send any data if set to TRUE
|
|
2031
2076
|
*/
|
|
2032
|
-
disableTelemetry:
|
|
2077
|
+
disableTelemetry: boolean;
|
|
2033
2078
|
/**
|
|
2034
2079
|
* Store a copy of a send buffer in the session storage
|
|
2035
2080
|
*/
|
|
2036
|
-
enableSessionStorageBuffer:
|
|
2081
|
+
enableSessionStorageBuffer: boolean;
|
|
2037
2082
|
/**
|
|
2038
2083
|
* Is retry handler disabled.
|
|
2039
2084
|
* If enabled, retry on 206 (partial success), 408 (timeout), 429 (too many requests), 500 (internal server error) and 503 (service unavailable).
|
|
2040
2085
|
*/
|
|
2041
|
-
isRetryDisabled:
|
|
2042
|
-
isBeaconApiDisabled:
|
|
2086
|
+
isRetryDisabled: boolean;
|
|
2087
|
+
isBeaconApiDisabled: boolean;
|
|
2043
2088
|
/**
|
|
2044
2089
|
* Don't use XMLHttpRequest or XDomainRequest (for IE < 9) by default instead attempt to use fetch() or sendBeacon.
|
|
2045
2090
|
* If no other transport is available it will still use XMLHttpRequest
|
|
2046
2091
|
*/
|
|
2047
|
-
disableXhr:
|
|
2092
|
+
disableXhr: boolean;
|
|
2048
2093
|
/**
|
|
2049
2094
|
* If fetch keepalive is supported do not use it for sending events during unload, it may still fallback to fetch() without keepalive
|
|
2050
2095
|
*/
|
|
2051
|
-
onunloadDisableFetch:
|
|
2096
|
+
onunloadDisableFetch: boolean;
|
|
2052
2097
|
/**
|
|
2053
2098
|
* Is beacon disabled on page unload.
|
|
2054
2099
|
* If enabled, flush events through beaconSender.
|
|
2055
2100
|
*/
|
|
2056
|
-
onunloadDisableBeacon:
|
|
2101
|
+
onunloadDisableBeacon: boolean;
|
|
2057
2102
|
/**
|
|
2058
2103
|
* (Optional) Override the instrumentation key that this channel instance sends to
|
|
2059
2104
|
*/
|
|
2060
|
-
instrumentationKey:
|
|
2061
|
-
namePrefix:
|
|
2062
|
-
samplingPercentage:
|
|
2105
|
+
instrumentationKey: string;
|
|
2106
|
+
namePrefix: string;
|
|
2107
|
+
samplingPercentage: number;
|
|
2063
2108
|
/**
|
|
2064
2109
|
* (Optional) The ability for the user to provide extra headers
|
|
2065
2110
|
*/
|
|
2066
|
-
customHeaders:
|
|
2111
|
+
customHeaders: [{
|
|
2067
2112
|
header: string;
|
|
2068
2113
|
value: string;
|
|
2069
2114
|
}];
|
|
2070
2115
|
/**
|
|
2071
2116
|
* (Optional) Provide user an option to convert undefined field to user defined value.
|
|
2072
2117
|
*/
|
|
2073
|
-
convertUndefined:
|
|
2118
|
+
convertUndefined: any;
|
|
2074
2119
|
/**
|
|
2075
2120
|
* (Optional) The number of events that can be kept in memory before the SDK starts to drop events. By default, this is 10,000.
|
|
2076
2121
|
*/
|
|
2077
|
-
eventsLimitInMem:
|
|
2122
|
+
eventsLimitInMem: number;
|
|
2078
2123
|
}
|
|
2079
2124
|
|
|
2080
2125
|
interface ISerializable {
|
|
@@ -2093,7 +2138,7 @@ declare namespace ApplicationInsights {
|
|
|
2093
2138
|
obj: string[];
|
|
2094
2139
|
}
|
|
2095
2140
|
|
|
2096
|
-
interface ITelemetryInitializerHandler {
|
|
2141
|
+
interface ITelemetryInitializerHandler extends ILegacyUnloadHook {
|
|
2097
2142
|
remove(): void;
|
|
2098
2143
|
}
|
|
2099
2144
|
|
|
@@ -2211,12 +2256,22 @@ declare namespace ApplicationInsights {
|
|
|
2211
2256
|
* Identifies the reason for the update notification, this is a bitwise numeric value
|
|
2212
2257
|
*/
|
|
2213
2258
|
reason: TelemetryUpdateReason;
|
|
2259
|
+
/**
|
|
2260
|
+
* This is a new active configuration that should be used
|
|
2261
|
+
*/
|
|
2262
|
+
cfg?: IConfiguration;
|
|
2263
|
+
/**
|
|
2264
|
+
* The detected changes
|
|
2265
|
+
*/
|
|
2266
|
+
oldCfg?: IConfiguration;
|
|
2214
2267
|
/**
|
|
2215
2268
|
* If this is a configuration update this was the previous configuration that was used
|
|
2216
2269
|
*/
|
|
2270
|
+
newConfig?: IConfiguration;
|
|
2217
2271
|
/**
|
|
2218
|
-
*
|
|
2272
|
+
* Was the new config requested to be merged with the existing config
|
|
2219
2273
|
*/
|
|
2274
|
+
merge?: boolean;
|
|
2220
2275
|
/**
|
|
2221
2276
|
* This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
|
|
2222
2277
|
*/
|
|
@@ -2248,6 +2303,26 @@ declare namespace ApplicationInsights {
|
|
|
2248
2303
|
iKey?: string;
|
|
2249
2304
|
}
|
|
2250
2305
|
|
|
2306
|
+
/**
|
|
2307
|
+
* An interface which provides automatic removal during unloading of the component
|
|
2308
|
+
*/
|
|
2309
|
+
interface IUnloadHook {
|
|
2310
|
+
/**
|
|
2311
|
+
* Self remove the referenced component
|
|
2312
|
+
*/
|
|
2313
|
+
rm: () => void;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
interface IWatchDetails<T extends IConfiguration> {
|
|
2317
|
+
cfg: T;
|
|
2318
|
+
hdlr: IDynamicConfigHandler<T>;
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
interface IWatcherHandler<T extends IConfiguration> extends IUnloadHook {
|
|
2322
|
+
fn: WatcherFunction<T>;
|
|
2323
|
+
rm: () => void;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2251
2326
|
const LoggingSeverity: EnumValue<typeof eLoggingSeverity>;
|
|
2252
2327
|
|
|
2253
2328
|
type LoggingSeverity = number | eLoggingSeverity;
|
|
@@ -2314,8 +2389,8 @@ declare namespace ApplicationInsights {
|
|
|
2314
2389
|
_xhrReadyStateChange(xhr: XMLHttpRequest, payload: string[], countOfItemsInPayload: number): void;
|
|
2315
2390
|
/**
|
|
2316
2391
|
* Immediately send buffered data
|
|
2317
|
-
* @param async {boolean} - Indicates if the events should be sent asynchronously
|
|
2318
|
-
* @param forcedSender {SenderFunction} - Indicates the forcedSender, undefined if not passed
|
|
2392
|
+
* @param async - {boolean} - Indicates if the events should be sent asynchronously
|
|
2393
|
+
* @param forcedSender - {SenderFunction} - Indicates the forcedSender, undefined if not passed
|
|
2319
2394
|
*/
|
|
2320
2395
|
triggerSend(async?: boolean, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void;
|
|
2321
2396
|
/**
|
|
@@ -2336,8 +2411,8 @@ declare namespace ApplicationInsights {
|
|
|
2336
2411
|
_xdrOnLoad(xdr: XDomainRequest, payload: string[]): void;
|
|
2337
2412
|
/**
|
|
2338
2413
|
* Add header to request
|
|
2339
|
-
* @param name
|
|
2340
|
-
* @param value
|
|
2414
|
+
* @param name - Header name.
|
|
2415
|
+
* @param value - Header value.
|
|
2341
2416
|
*/
|
|
2342
2417
|
addHeader(name: string, value: string): void;
|
|
2343
2418
|
}
|
|
@@ -2436,6 +2511,7 @@ declare namespace ApplicationInsights {
|
|
|
2436
2511
|
/**
|
|
2437
2512
|
* The configuration has ben updated or changed
|
|
2438
2513
|
*/
|
|
2514
|
+
ConfigurationChanged = 1,
|
|
2439
2515
|
/**
|
|
2440
2516
|
* One or more plugins have been added
|
|
2441
2517
|
*/
|
|
@@ -2450,6 +2526,8 @@ declare namespace ApplicationInsights {
|
|
|
2450
2526
|
|
|
2451
2527
|
type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
2452
2528
|
|
|
2529
|
+
type WatcherFunction<T extends IConfiguration> = (details: IWatchDetails<T>) => void;
|
|
2530
|
+
|
|
2453
2531
|
interface XDomainRequest extends XMLHttpRequestEventTarget {
|
|
2454
2532
|
readonly responseText: string;
|
|
2455
2533
|
send(payload: string): void;
|