@microsoft/applicationinsights-web-basic 2.8.0-beta.2203-04 → 2.8.0-beta.2203-07
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.8.0-beta.2203-07.integrity.json +26 -0
- package/browser/{aib.2.8.0-beta.2203-04.js → aib.2.8.0-beta.2203-07.js} +340 -123
- package/browser/aib.2.8.0-beta.2203-07.js.map +1 -0
- package/browser/aib.2.8.0-beta.2203-07.min.js +6 -0
- package/browser/aib.2.8.0-beta.2203-07.min.js.map +1 -0
- package/browser/aib.2.js +339 -122
- 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 +122 -8
- package/dist/applicationinsights-web-basic.api.md +5 -3
- package/dist/applicationinsights-web-basic.d.ts +140 -8
- package/dist/applicationinsights-web-basic.js +339 -122
- 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 +140 -8
- package/dist-esm/index.js +1 -1
- package/package.json +4 -4
- package/browser/aib.2.8.0-beta.2203-04.integrity.json +0 -26
- package/browser/aib.2.8.0-beta.2203-04.js.map +0 -1
- package/browser/aib.2.8.0-beta.2203-04.min.js +0 -6
- package/browser/aib.2.8.0-beta.2203-04.min.js.map +0 -1
|
@@ -708,7 +708,7 @@
|
|
|
708
708
|
{
|
|
709
709
|
"kind": "MethodSignature",
|
|
710
710
|
"canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#addPlugin:member(1)",
|
|
711
|
-
"docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced\n *\n * @param doAsync - Should the add be performed asynchronously\n */\n",
|
|
711
|
+
"docComment": "/**\n * Add a new plugin to the installation\n *\n * @param plugin - The new plugin to add\n *\n * @param replaceExisting - should any existing plugin be replaced, default is false\n *\n * @param doAsync - Should the add be performed asynchronously\n *\n * @param addCb - [Optional] callback to call after the plugin has been added\n */\n",
|
|
712
712
|
"excerptTokens": [
|
|
713
713
|
{
|
|
714
714
|
"kind": "Content",
|
|
@@ -742,7 +742,7 @@
|
|
|
742
742
|
},
|
|
743
743
|
{
|
|
744
744
|
"kind": "Content",
|
|
745
|
-
"text": ", replaceExisting
|
|
745
|
+
"text": ", replaceExisting?: "
|
|
746
746
|
},
|
|
747
747
|
{
|
|
748
748
|
"kind": "Content",
|
|
@@ -750,7 +750,7 @@
|
|
|
750
750
|
},
|
|
751
751
|
{
|
|
752
752
|
"kind": "Content",
|
|
753
|
-
"text": ", doAsync
|
|
753
|
+
"text": ", doAsync?: "
|
|
754
754
|
},
|
|
755
755
|
{
|
|
756
756
|
"kind": "Content",
|
|
@@ -979,6 +979,96 @@
|
|
|
979
979
|
"parameters": [],
|
|
980
980
|
"name": "evtNamespace"
|
|
981
981
|
},
|
|
982
|
+
{
|
|
983
|
+
"kind": "MethodSignature",
|
|
984
|
+
"canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#flush:member(1)",
|
|
985
|
+
"docComment": "/**\n * Flush and send any batched / cached data immediately\n *\n * @param async - send data asynchronously when true (defaults to true)\n *\n * @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called. If the caller doesn't return true the caller should assume that it may never be called.\n *\n * @param sendReason - specify the reason that you are calling \"flush\" defaults to ManualFlush (1) if not specified\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n *\n * @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called\n */\n",
|
|
986
|
+
"excerptTokens": [
|
|
987
|
+
{
|
|
988
|
+
"kind": "Content",
|
|
989
|
+
"text": "flush(isAsync?: "
|
|
990
|
+
},
|
|
991
|
+
{
|
|
992
|
+
"kind": "Content",
|
|
993
|
+
"text": "boolean"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
"kind": "Content",
|
|
997
|
+
"text": ", callBack?: "
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
"kind": "Content",
|
|
1001
|
+
"text": "(flushComplete?: boolean) => void"
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"kind": "Content",
|
|
1005
|
+
"text": ", sendReason?: "
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"kind": "Reference",
|
|
1009
|
+
"text": "SendRequestReason",
|
|
1010
|
+
"canonicalReference": "@microsoft/applicationinsights-web-basic!SendRequestReason:enum"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"kind": "Content",
|
|
1014
|
+
"text": ", cbTimeout?: "
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
"kind": "Content",
|
|
1018
|
+
"text": "number"
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
"kind": "Content",
|
|
1022
|
+
"text": "): "
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"kind": "Content",
|
|
1026
|
+
"text": "boolean | void"
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
"kind": "Content",
|
|
1030
|
+
"text": ";"
|
|
1031
|
+
}
|
|
1032
|
+
],
|
|
1033
|
+
"isOptional": false,
|
|
1034
|
+
"returnTypeTokenRange": {
|
|
1035
|
+
"startIndex": 9,
|
|
1036
|
+
"endIndex": 10
|
|
1037
|
+
},
|
|
1038
|
+
"releaseTag": "Public",
|
|
1039
|
+
"overloadIndex": 1,
|
|
1040
|
+
"parameters": [
|
|
1041
|
+
{
|
|
1042
|
+
"parameterName": "isAsync",
|
|
1043
|
+
"parameterTypeTokenRange": {
|
|
1044
|
+
"startIndex": 1,
|
|
1045
|
+
"endIndex": 2
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
"parameterName": "callBack",
|
|
1050
|
+
"parameterTypeTokenRange": {
|
|
1051
|
+
"startIndex": 3,
|
|
1052
|
+
"endIndex": 4
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
"parameterName": "sendReason",
|
|
1057
|
+
"parameterTypeTokenRange": {
|
|
1058
|
+
"startIndex": 5,
|
|
1059
|
+
"endIndex": 6
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
"parameterName": "cbTimeout",
|
|
1064
|
+
"parameterTypeTokenRange": {
|
|
1065
|
+
"startIndex": 7,
|
|
1066
|
+
"endIndex": 8
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
],
|
|
1070
|
+
"name": "flush"
|
|
1071
|
+
},
|
|
982
1072
|
{
|
|
983
1073
|
"kind": "MethodSignature",
|
|
984
1074
|
"canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#getCookieMgr:member(1)",
|
|
@@ -1543,7 +1633,7 @@
|
|
|
1543
1633
|
{
|
|
1544
1634
|
"kind": "MethodSignature",
|
|
1545
1635
|
"canonicalReference": "@microsoft/applicationinsights-web-basic!IAppInsightsCore#unload:member(1)",
|
|
1546
|
-
"docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n */\n",
|
|
1636
|
+
"docComment": "/**\n * Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous unload call return `true` stating that all plugins reported that they also unloaded, the recommended approach is to create a new instance and initialize that instance. This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable to successfully remove any global references or they may just be completing the unload process asynchronously.\n *\n * @param isAsync - Can the unload be performed asynchronously (default)\n *\n * @param unloadComplete - An optional callback that will be called once the unload has completed\n *\n * @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.\n */\n",
|
|
1547
1637
|
"excerptTokens": [
|
|
1548
1638
|
{
|
|
1549
1639
|
"kind": "Content",
|
|
@@ -1559,7 +1649,24 @@
|
|
|
1559
1649
|
},
|
|
1560
1650
|
{
|
|
1561
1651
|
"kind": "Content",
|
|
1562
|
-
"text": "(
|
|
1652
|
+
"text": "(unloadState: "
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
"kind": "Reference",
|
|
1656
|
+
"text": "ITelemetryUnloadState",
|
|
1657
|
+
"canonicalReference": "@microsoft/applicationinsights-web-basic!ITelemetryUnloadState:interface"
|
|
1658
|
+
},
|
|
1659
|
+
{
|
|
1660
|
+
"kind": "Content",
|
|
1661
|
+
"text": ") => void"
|
|
1662
|
+
},
|
|
1663
|
+
{
|
|
1664
|
+
"kind": "Content",
|
|
1665
|
+
"text": ", cbTimeout?: "
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
"kind": "Content",
|
|
1669
|
+
"text": "number"
|
|
1563
1670
|
},
|
|
1564
1671
|
{
|
|
1565
1672
|
"kind": "Content",
|
|
@@ -1576,8 +1683,8 @@
|
|
|
1576
1683
|
],
|
|
1577
1684
|
"isOptional": false,
|
|
1578
1685
|
"returnTypeTokenRange": {
|
|
1579
|
-
"startIndex":
|
|
1580
|
-
"endIndex":
|
|
1686
|
+
"startIndex": 9,
|
|
1687
|
+
"endIndex": 10
|
|
1581
1688
|
},
|
|
1582
1689
|
"releaseTag": "Public",
|
|
1583
1690
|
"overloadIndex": 1,
|
|
@@ -1593,7 +1700,14 @@
|
|
|
1593
1700
|
"parameterName": "unloadComplete",
|
|
1594
1701
|
"parameterTypeTokenRange": {
|
|
1595
1702
|
"startIndex": 3,
|
|
1596
|
-
"endIndex":
|
|
1703
|
+
"endIndex": 6
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
"parameterName": "cbTimeout",
|
|
1708
|
+
"parameterTypeTokenRange": {
|
|
1709
|
+
"startIndex": 7,
|
|
1710
|
+
"endIndex": 8
|
|
1597
1711
|
}
|
|
1598
1712
|
}
|
|
1599
1713
|
],
|
|
@@ -45,7 +45,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
45
45
|
// Warning: (ae-forgotten-export) The symbol "INotificationListener" needs to be exported by the entry point index.d.ts
|
|
46
46
|
addNotificationListener?(listener: INotificationListener): void;
|
|
47
47
|
// Warning: (ae-forgotten-export) The symbol "ITelemetryPlugin" needs to be exported by the entry point index.d.ts
|
|
48
|
-
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting
|
|
48
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
49
49
|
// Warning: (ae-forgotten-export) The symbol "TelemetryInitializerFunction" needs to be exported by the entry point index.d.ts
|
|
50
50
|
// Warning: (ae-forgotten-export) The symbol "ITelemetryInitializerHandler" needs to be exported by the entry point index.d.ts
|
|
51
51
|
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
@@ -54,6 +54,8 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
54
54
|
// (undocumented)
|
|
55
55
|
config: IConfiguration;
|
|
56
56
|
evtNamespace(): string;
|
|
57
|
+
// Warning: (ae-forgotten-export) The symbol "SendRequestReason" needs to be exported by the entry point index.d.ts
|
|
58
|
+
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
|
|
57
59
|
// Warning: (ae-forgotten-export) The symbol "ICookieMgr" needs to be exported by the entry point index.d.ts
|
|
58
60
|
getCookieMgr(): ICookieMgr;
|
|
59
61
|
getNotifyMgr(): INotificationManager;
|
|
@@ -78,7 +80,8 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
78
80
|
stopPollingInternalLogs?(): void;
|
|
79
81
|
// (undocumented)
|
|
80
82
|
track(telemetryItem: ITelemetryItem): void;
|
|
81
|
-
|
|
83
|
+
// Warning: (ae-forgotten-export) The symbol "ITelemetryUnloadState" needs to be exported by the entry point index.d.ts
|
|
84
|
+
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
// @public
|
|
@@ -265,7 +268,6 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControlsAI {
|
|
|
265
268
|
readonly _senderConfig: ISenderConfig;
|
|
266
269
|
// (undocumented)
|
|
267
270
|
teardown(): void;
|
|
268
|
-
// Warning: (ae-forgotten-export) The symbol "SendRequestReason" needs to be exported by the entry point index.d.ts
|
|
269
271
|
triggerSend(async?: boolean, forcedSender?: SenderFunction, sendReason?: SendRequestReason): void;
|
|
270
272
|
// Warning: (ae-forgotten-export) The symbol "XDomainRequest" needs to be exported by the entry point index.d.ts
|
|
271
273
|
_xdrOnLoad(xdr: XDomainRequest, payload: string[]): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft.ApplicationInsights, 2.8.0-beta.2203-
|
|
2
|
+
* Microsoft.ApplicationInsights, 2.8.0-beta.2203-07
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -107,10 +107,20 @@ declare namespace ApplicationInsights {
|
|
|
107
107
|
* approach is to create a new instance and initialize that instance.
|
|
108
108
|
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
109
109
|
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
110
|
+
* @param isAsync - Can the unload be performed asynchronously (default)
|
|
111
|
+
* @param unloadComplete - An optional callback that will be called once the unload has completed
|
|
112
|
+
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
110
113
|
*/
|
|
111
|
-
unload(isAsync?: boolean, unloadComplete?: () => void): void;
|
|
114
|
+
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
112
115
|
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
113
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Add a new plugin to the installation
|
|
118
|
+
* @param plugin - The new plugin to add
|
|
119
|
+
* @param replaceExisting - should any existing plugin be replaced, default is false
|
|
120
|
+
* @param doAsync - Should the add be performed asynchronously
|
|
121
|
+
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
122
|
+
*/
|
|
123
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
114
124
|
/**
|
|
115
125
|
* Returns the unique event namespace that should be used
|
|
116
126
|
*/
|
|
@@ -120,7 +130,23 @@ declare namespace ApplicationInsights {
|
|
|
120
130
|
* @param handler - the handler
|
|
121
131
|
*/
|
|
122
132
|
addUnloadCb(handler: UnloadHandler): void;
|
|
133
|
+
/**
|
|
134
|
+
* Flush and send any batched / cached data immediately
|
|
135
|
+
* @param async - send data asynchronously when true (defaults to true)
|
|
136
|
+
* @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
|
|
137
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
138
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
139
|
+
* @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
|
|
140
|
+
*/
|
|
141
|
+
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): void;
|
|
123
142
|
protected releaseQueue(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Hook for Core extensions to allow them to update their own configuration before updating all of the plugins.
|
|
145
|
+
* @param updateCtx - The plugin update context
|
|
146
|
+
* @param updateState - The Update State
|
|
147
|
+
* @returns boolean - True means the extension class will call updateState otherwise the Core will
|
|
148
|
+
*/
|
|
149
|
+
protected _updateHook?(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
124
150
|
}
|
|
125
151
|
|
|
126
152
|
/**
|
|
@@ -177,6 +203,14 @@ declare namespace ApplicationInsights {
|
|
|
177
203
|
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
178
204
|
*/
|
|
179
205
|
protected _doTeardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void) => void | boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Extension hook to allow implementations to perform some additional update operations before the BaseTelemetryPlugin finishes it's removal
|
|
208
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
209
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
210
|
+
* @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.
|
|
211
|
+
* @returns boolean - true if the plugin has or will call asyncCallback, this allows the plugin to perform any asynchronous operations.
|
|
212
|
+
*/
|
|
213
|
+
protected _doUpdate?: (updateCtx?: IProcessTelemetryUpdateContext, updateState?: ITelemetryUpdateState, asyncCallback?: () => void) => void | boolean;
|
|
180
214
|
constructor();
|
|
181
215
|
initialize(config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void;
|
|
182
216
|
/**
|
|
@@ -189,6 +223,13 @@ declare namespace ApplicationInsights {
|
|
|
189
223
|
*/
|
|
190
224
|
teardown(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState): void | boolean;
|
|
191
225
|
abstract processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void;
|
|
226
|
+
/**
|
|
227
|
+
* The the plugin should re-evaluate configuration and update any cached configuration settings.
|
|
228
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
229
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
230
|
+
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
231
|
+
*/
|
|
232
|
+
update(updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState): void | boolean;
|
|
192
233
|
/**
|
|
193
234
|
* Add an unload handler that will be called when the SDK is being unloaded
|
|
194
235
|
* @param handler - the handler
|
|
@@ -388,8 +429,11 @@ declare namespace ApplicationInsights {
|
|
|
388
429
|
* approach is to create a new instance and initialize that instance.
|
|
389
430
|
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
390
431
|
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
432
|
+
* @param isAsync - Can the unload be performed asynchronously (default)
|
|
433
|
+
* @param unloadComplete - An optional callback that will be called once the unload has completed
|
|
434
|
+
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
391
435
|
*/
|
|
392
|
-
unload(isAsync?: boolean, unloadComplete?: () => void): void;
|
|
436
|
+
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
393
437
|
/**
|
|
394
438
|
* Find and return the (first) plugin with the specified identifier if present
|
|
395
439
|
* @param pluginIdentifier
|
|
@@ -398,10 +442,11 @@ declare namespace ApplicationInsights {
|
|
|
398
442
|
/**
|
|
399
443
|
* Add a new plugin to the installation
|
|
400
444
|
* @param plugin - The new plugin to add
|
|
401
|
-
* @param replaceExisting - should any existing plugin be replaced
|
|
445
|
+
* @param replaceExisting - should any existing plugin be replaced, default is false
|
|
402
446
|
* @param doAsync - Should the add be performed asynchronously
|
|
447
|
+
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
403
448
|
*/
|
|
404
|
-
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting
|
|
449
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
405
450
|
/**
|
|
406
451
|
* Returns the unique event namespace that should be used when registering events
|
|
407
452
|
*/
|
|
@@ -411,6 +456,16 @@ declare namespace ApplicationInsights {
|
|
|
411
456
|
* @param handler - the handler
|
|
412
457
|
*/
|
|
413
458
|
addUnloadCb(handler: UnloadHandler): void;
|
|
459
|
+
/**
|
|
460
|
+
* Flush and send any batched / cached data immediately
|
|
461
|
+
* @param async - send data asynchronously when true (defaults to true)
|
|
462
|
+
* @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
|
|
463
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
464
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
465
|
+
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
466
|
+
* @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
|
|
467
|
+
*/
|
|
468
|
+
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
|
|
414
469
|
}
|
|
415
470
|
|
|
416
471
|
/**
|
|
@@ -1467,6 +1522,11 @@ declare namespace ApplicationInsights {
|
|
|
1467
1522
|
* You must always supply the error callback
|
|
1468
1523
|
*/
|
|
1469
1524
|
interface IInstrumentHooksCallbacks {
|
|
1525
|
+
/**
|
|
1526
|
+
* [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
|
|
1527
|
+
* identify the source of the instrumented hooks
|
|
1528
|
+
*/
|
|
1529
|
+
ns?: string | string[];
|
|
1470
1530
|
/**
|
|
1471
1531
|
* The hook callback to call before the original function is called
|
|
1472
1532
|
*/
|
|
@@ -1978,8 +2038,8 @@ declare namespace ApplicationInsights {
|
|
|
1978
2038
|
}
|
|
1979
2039
|
|
|
1980
2040
|
/**
|
|
1981
|
-
* The current context for the current call to
|
|
1982
|
-
*
|
|
2041
|
+
* The current context for the current call to teardown() implementations, used to support when plugins are being removed
|
|
2042
|
+
* or the SDK is being unloaded.
|
|
1983
2043
|
*/
|
|
1984
2044
|
interface IProcessTelemetryUnloadContext extends IBaseProcessingContext {
|
|
1985
2045
|
/**
|
|
@@ -1998,6 +2058,27 @@ declare namespace ApplicationInsights {
|
|
|
1998
2058
|
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUnloadContext;
|
|
1999
2059
|
}
|
|
2000
2060
|
|
|
2061
|
+
/**
|
|
2062
|
+
* The current context for the current call to the plugin update() implementations, used to support the notifications
|
|
2063
|
+
* for when plugins are added, removed or the configuration was changed.
|
|
2064
|
+
*/
|
|
2065
|
+
interface IProcessTelemetryUpdateContext extends IBaseProcessingContext {
|
|
2066
|
+
/**
|
|
2067
|
+
* This Plugin has finished unloading, so unload the next one
|
|
2068
|
+
* @param updateState - The update State
|
|
2069
|
+
* @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
|
|
2070
|
+
*/
|
|
2071
|
+
processNext: (updateState: ITelemetryUpdateState) => boolean | void;
|
|
2072
|
+
/**
|
|
2073
|
+
* Create a new context using the core and config from the current instance, returns a new instance of the same type
|
|
2074
|
+
* @param plugins - The execution order to process the plugins, if null or not supplied
|
|
2075
|
+
* then the current execution order will be copied.
|
|
2076
|
+
* @param startAt - The plugin to start processing from, if missing from the execution
|
|
2077
|
+
* order then the next plugin will be NOT set.
|
|
2078
|
+
*/
|
|
2079
|
+
createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUpdateContext;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2001
2082
|
interface IRequestContext {
|
|
2002
2083
|
status?: number;
|
|
2003
2084
|
xhr?: XMLHttpRequest;
|
|
@@ -2233,6 +2314,15 @@ declare namespace ApplicationInsights {
|
|
|
2233
2314
|
* to later plugins (vs appending items to the telemetry item)
|
|
2234
2315
|
*/
|
|
2235
2316
|
processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void;
|
|
2317
|
+
/**
|
|
2318
|
+
* The the plugin should re-evaluate configuration and update any cached configuration settings or
|
|
2319
|
+
* plugins. If implemented this method will be called whenever a plugin is added or removed and if
|
|
2320
|
+
* the configuration has bee updated.
|
|
2321
|
+
* @param updateCtx - This is the context that should be used during updating.
|
|
2322
|
+
* @param updateState - The details / state of the update process, it holds details like the current and previous configuration.
|
|
2323
|
+
* @returns boolean - true if the plugin has or will call updateCtx.processNext(), this allows the plugin to perform any asynchronous operations.
|
|
2324
|
+
*/
|
|
2325
|
+
update?: (updateCtx: IProcessTelemetryUpdateContext, updateState: ITelemetryUpdateState) => void | boolean;
|
|
2236
2326
|
}
|
|
2237
2327
|
|
|
2238
2328
|
interface ITelemetryUnloadState {
|
|
@@ -2241,6 +2331,27 @@ declare namespace ApplicationInsights {
|
|
|
2241
2331
|
flushComplete?: boolean;
|
|
2242
2332
|
}
|
|
2243
2333
|
|
|
2334
|
+
interface ITelemetryUpdateState {
|
|
2335
|
+
/**
|
|
2336
|
+
* Identifies the reason for the update notification, this is a bitwise numeric value
|
|
2337
|
+
*/
|
|
2338
|
+
reason: TelemetryUpdateReason;
|
|
2339
|
+
/**
|
|
2340
|
+
* If this is a configuration update this was the previous configuration that was used
|
|
2341
|
+
*/
|
|
2342
|
+
/**
|
|
2343
|
+
* If this is a configuration update is the new configuration that is being used
|
|
2344
|
+
*/
|
|
2345
|
+
/**
|
|
2346
|
+
* This holds a collection of plugins that have been added (if the reason identifies that one or more plugins have been added)
|
|
2347
|
+
*/
|
|
2348
|
+
added?: IPlugin[];
|
|
2349
|
+
/**
|
|
2350
|
+
* This holds a collection of plugins that have been removed (if the reason identifies that one or more plugins have been removed)
|
|
2351
|
+
*/
|
|
2352
|
+
removed?: IPlugin[];
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2244
2355
|
interface ITraceTelemetry extends IPartC {
|
|
2245
2356
|
/**
|
|
2246
2357
|
* @description A message string
|
|
@@ -2437,6 +2548,27 @@ declare namespace ApplicationInsights {
|
|
|
2437
2548
|
SdkUnload = 50
|
|
2438
2549
|
}
|
|
2439
2550
|
|
|
2551
|
+
/**
|
|
2552
|
+
* The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
|
|
2553
|
+
*/
|
|
2554
|
+
const enum TelemetryUpdateReason {
|
|
2555
|
+
/**
|
|
2556
|
+
* Unknown.
|
|
2557
|
+
*/
|
|
2558
|
+
Unknown = 0,
|
|
2559
|
+
/**
|
|
2560
|
+
* The configuration has ben updated or changed
|
|
2561
|
+
*/
|
|
2562
|
+
/**
|
|
2563
|
+
* One or more plugins have been added
|
|
2564
|
+
*/
|
|
2565
|
+
PluginAdded = 16,
|
|
2566
|
+
/**
|
|
2567
|
+
* One or more plugins have been removed
|
|
2568
|
+
*/
|
|
2569
|
+
PluginRemoved = 32
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2440
2572
|
type UnloadHandler = (itemCtx: IProcessTelemetryUnloadContext, unloadState: ITelemetryUnloadState) => void;
|
|
2441
2573
|
|
|
2442
2574
|
interface XDomainRequest extends XMLHttpRequestEventTarget {
|