@microsoft/applicationinsights-core-js 2.8.0-nightly.2202-06 → 2.8.0-nightly.2204-06
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/applicationinsights-core-js.integrity.json +9 -9
- package/browser/applicationinsights-core-js.js +2440 -1199
- package/browser/applicationinsights-core-js.js.map +1 -1
- package/browser/applicationinsights-core-js.min.js +2 -2
- package/browser/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.api.json +16710 -8876
- package/dist/applicationinsights-core-js.api.md +465 -140
- package/dist/applicationinsights-core-js.d.ts +856 -217
- package/dist/applicationinsights-core-js.js +2440 -1199
- package/dist/applicationinsights-core-js.js.map +1 -1
- package/dist/applicationinsights-core-js.min.js +2 -2
- package/dist/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.rollup.d.ts +856 -217
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +4 -72
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +496 -99
- package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +120 -21
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +202 -87
- package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +4 -4
- package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +7 -148
- package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js +93 -0
- package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -0
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +45 -12
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +13 -12
- package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
- package/dist-esm/JavaScriptSDK/EventHelpers.js +477 -0
- package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -0
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +80 -86
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +3 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InternalConstants.js +28 -0
- package/dist-esm/JavaScriptSDK/InternalConstants.js.map +1 -0
- package/dist-esm/JavaScriptSDK/NotificationManager.js +37 -42
- package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +430 -119
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +30 -4
- package/dist-esm/JavaScriptSDK/RandomHelper.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +60 -14
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +81 -0
- package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -0
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +33 -0
- package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +51 -0
- package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +10 -9
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +90 -96
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +8 -0
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +8 -0
- package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -2
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +6 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -2
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js.map +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +8 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +8 -0
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js.map +1 -0
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +6 -0
- package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js.map +1 -0
- package/dist-esm/applicationinsights-core-js.js +13 -7
- package/dist-esm/applicationinsights-core-js.js.map +1 -1
- package/package.json +2 -2
- package/src/JavaScriptSDK/AppInsightsCore.ts +4 -105
- package/src/JavaScriptSDK/BaseCore.ts +696 -120
- package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +205 -31
- package/src/JavaScriptSDK/ChannelController.ts +242 -103
- package/src/JavaScriptSDK/CookieMgr.ts +7 -5
- package/src/JavaScriptSDK/CoreUtils.ts +8 -172
- package/src/JavaScriptSDK/DataCacheHelper.ts +106 -0
- package/src/JavaScriptSDK/DiagnosticLogger.ts +49 -12
- package/src/JavaScriptSDK/EnvUtils.ts +13 -12
- package/src/JavaScriptSDK/EventHelpers.ts +550 -0
- package/src/JavaScriptSDK/HelperFuncs.ts +114 -97
- package/src/JavaScriptSDK/InstrumentHooks.ts +4 -2
- package/src/JavaScriptSDK/InternalConstants.ts +26 -0
- package/src/JavaScriptSDK/NotificationManager.ts +34 -37
- package/src/JavaScriptSDK/PerfManager.ts +4 -7
- package/src/JavaScriptSDK/ProcessTelemetryContext.ts +543 -134
- package/src/JavaScriptSDK/RandomHelper.ts +35 -3
- package/src/JavaScriptSDK/TelemetryHelpers.ts +83 -21
- package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +111 -0
- package/src/JavaScriptSDK/UnloadHandlerContainer.ts +46 -0
- package/src/JavaScriptSDK.Enums/EnumHelperFuncs.ts +56 -0
- package/src/JavaScriptSDK.Enums/EventsDiscardedReason.ts +48 -8
- package/src/JavaScriptSDK.Enums/LoggingEnums.ts +183 -87
- package/src/JavaScriptSDK.Enums/SendRequestReason.ts +5 -0
- package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +27 -0
- package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +27 -0
- package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +82 -2
- package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +16 -5
- package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +16 -6
- package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +94 -14
- package/src/JavaScriptSDK.Interfaces/ITelemetryInitializers.ts +16 -0
- package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +28 -10
- package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +9 -11
- package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +10 -0
- package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +34 -0
- package/src/JavaScriptSDK.Interfaces/IUnloadableComponent.ts +17 -0
- package/types/JavaScriptSDK/AppInsightsCore.d.ts +0 -21
- package/types/JavaScriptSDK/BaseCore.d.ts +81 -3
- package/types/JavaScriptSDK/BaseTelemetryPlugin.d.ts +53 -10
- package/types/JavaScriptSDK/ChannelController.d.ts +16 -17
- package/types/JavaScriptSDK/CoreUtils.d.ts +1 -48
- package/types/JavaScriptSDK/DataCacheHelper.d.ts +13 -0
- package/types/JavaScriptSDK/DiagnosticLogger.d.ts +23 -0
- package/types/JavaScriptSDK/EventHelpers.d.ts +154 -0
- package/types/JavaScriptSDK/HelperFuncs.d.ts +37 -32
- package/types/JavaScriptSDK/InternalConstants.d.ts +20 -0
- package/types/JavaScriptSDK/PerfManager.d.ts +1 -1
- package/types/JavaScriptSDK/ProcessTelemetryContext.d.ts +69 -6
- package/types/JavaScriptSDK/RandomHelper.d.ts +6 -0
- package/types/JavaScriptSDK/TelemetryHelpers.d.ts +23 -3
- package/types/JavaScriptSDK/TelemetryInitializerPlugin.d.ts +16 -0
- package/types/JavaScriptSDK/UnloadHandlerContainer.d.ts +11 -0
- package/types/JavaScriptSDK.Enums/EnumHelperFuncs.d.ts +34 -0
- package/types/JavaScriptSDK.Enums/EventsDiscardedReason.d.ts +14 -9
- package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +89 -86
- package/types/JavaScriptSDK.Enums/SendRequestReason.d.ts +4 -0
- package/types/JavaScriptSDK.Enums/TelemetryUnloadReason.d.ts +21 -0
- package/types/JavaScriptSDK.Enums/TelemetryUpdateReason.d.ts +20 -0
- package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +72 -1
- package/types/JavaScriptSDK.Interfaces/IChannelControls.d.ts +16 -5
- package/types/JavaScriptSDK.Interfaces/IInstrumentHooks.d.ts +9 -0
- package/types/JavaScriptSDK.Interfaces/IProcessTelemetryContext.d.ts +82 -11
- package/types/JavaScriptSDK.Interfaces/ITelemetryInitializers.d.ts +13 -0
- package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +25 -8
- package/types/JavaScriptSDK.Interfaces/ITelemetryPluginChain.d.ts +9 -10
- package/types/JavaScriptSDK.Interfaces/ITelemetryUnloadState.d.ts +6 -0
- package/types/JavaScriptSDK.Interfaces/ITelemetryUpdateState.d.ts +22 -0
- package/types/JavaScriptSDK.Interfaces/IUnloadableComponent.d.ts +13 -0
- package/types/applicationinsights-core-js.d.ts +20 -10
- package/types/tsdoc-metadata.json +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +0 -76
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js.map +0 -1
- package/src/JavaScriptSDK/TelemetryPluginChain.ts +0 -120
- package/types/JavaScriptSDK/TelemetryPluginChain.d.ts +0 -32
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import { createEnumStyle } from "../JavaScriptSDK.Enums/EnumHelperFuncs";
|
|
5
|
+
|
|
6
|
+
export const enum eLoggingSeverity {
|
|
4
7
|
/**
|
|
5
8
|
* Error will be sent as internal telemetry
|
|
6
9
|
*/
|
|
@@ -9,97 +12,190 @@ export enum LoggingSeverity {
|
|
|
9
12
|
/**
|
|
10
13
|
* Error will NOT be sent as internal telemetry, and will only be shown in browser console
|
|
11
14
|
*/
|
|
12
|
-
WARNING = 2
|
|
15
|
+
WARNING = 2
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const LoggingSeverity = createEnumStyle<typeof eLoggingSeverity>({
|
|
19
|
+
CRITICAL: eLoggingSeverity.CRITICAL,
|
|
20
|
+
WARNING: eLoggingSeverity.WARNING
|
|
21
|
+
});
|
|
22
|
+
export type LoggingSeverity = number | eLoggingSeverity;
|
|
23
|
+
|
|
24
|
+
export const enum _eInternalMessageId {
|
|
25
|
+
BrowserDoesNotSupportLocalStorage = 0,
|
|
26
|
+
BrowserCannotReadLocalStorage = 1,
|
|
27
|
+
BrowserCannotReadSessionStorage = 2,
|
|
28
|
+
BrowserCannotWriteLocalStorage = 3,
|
|
29
|
+
BrowserCannotWriteSessionStorage = 4,
|
|
30
|
+
BrowserFailedRemovalFromLocalStorage = 5,
|
|
31
|
+
BrowserFailedRemovalFromSessionStorage = 6,
|
|
32
|
+
CannotSendEmptyTelemetry = 7,
|
|
33
|
+
ClientPerformanceMathError = 8,
|
|
34
|
+
ErrorParsingAISessionCookie = 9,
|
|
35
|
+
ErrorPVCalc = 10,
|
|
36
|
+
ExceptionWhileLoggingError = 11,
|
|
37
|
+
FailedAddingTelemetryToBuffer = 12,
|
|
38
|
+
FailedMonitorAjaxAbort = 13,
|
|
39
|
+
FailedMonitorAjaxDur = 14,
|
|
40
|
+
FailedMonitorAjaxOpen = 15,
|
|
41
|
+
FailedMonitorAjaxRSC = 16,
|
|
42
|
+
FailedMonitorAjaxSend = 17,
|
|
43
|
+
FailedMonitorAjaxGetCorrelationHeader = 18,
|
|
44
|
+
FailedToAddHandlerForOnBeforeUnload = 19,
|
|
45
|
+
FailedToSendQueuedTelemetry = 20,
|
|
46
|
+
FailedToReportDataLoss = 21,
|
|
47
|
+
FlushFailed = 22,
|
|
48
|
+
MessageLimitPerPVExceeded = 23,
|
|
49
|
+
MissingRequiredFieldSpecification = 24,
|
|
50
|
+
NavigationTimingNotSupported = 25,
|
|
51
|
+
OnError = 26,
|
|
52
|
+
SessionRenewalDateIsZero = 27,
|
|
53
|
+
SenderNotInitialized = 28,
|
|
54
|
+
StartTrackEventFailed = 29,
|
|
55
|
+
StopTrackEventFailed = 30,
|
|
56
|
+
StartTrackFailed = 31,
|
|
57
|
+
StopTrackFailed = 32,
|
|
58
|
+
TelemetrySampledAndNotSent = 33,
|
|
59
|
+
TrackEventFailed = 34,
|
|
60
|
+
TrackExceptionFailed = 35,
|
|
61
|
+
TrackMetricFailed = 36,
|
|
62
|
+
TrackPVFailed = 37,
|
|
63
|
+
TrackPVFailedCalc = 38,
|
|
64
|
+
TrackTraceFailed = 39,
|
|
65
|
+
TransmissionFailed = 40,
|
|
66
|
+
FailedToSetStorageBuffer = 41,
|
|
67
|
+
FailedToRestoreStorageBuffer = 42,
|
|
68
|
+
InvalidBackendResponse = 43,
|
|
69
|
+
FailedToFixDepricatedValues = 44,
|
|
70
|
+
InvalidDurationValue = 45,
|
|
71
|
+
TelemetryEnvelopeInvalid = 46,
|
|
72
|
+
CreateEnvelopeError = 47,
|
|
73
|
+
|
|
74
|
+
// User actionable
|
|
75
|
+
CannotSerializeObject = 48,
|
|
76
|
+
CannotSerializeObjectNonSerializable = 49,
|
|
77
|
+
CircularReferenceDetected = 50,
|
|
78
|
+
ClearAuthContextFailed = 51,
|
|
79
|
+
ExceptionTruncated = 52,
|
|
80
|
+
IllegalCharsInName = 53,
|
|
81
|
+
ItemNotInArray = 54,
|
|
82
|
+
MaxAjaxPerPVExceeded = 55,
|
|
83
|
+
MessageTruncated = 56,
|
|
84
|
+
NameTooLong = 57,
|
|
85
|
+
SampleRateOutOfRange = 58,
|
|
86
|
+
SetAuthContextFailed = 59,
|
|
87
|
+
SetAuthContextFailedAccountName = 60,
|
|
88
|
+
StringValueTooLong = 61,
|
|
89
|
+
StartCalledMoreThanOnce = 62,
|
|
90
|
+
StopCalledWithoutStart = 63,
|
|
91
|
+
TelemetryInitializerFailed = 64,
|
|
92
|
+
TrackArgumentsNotSpecified = 65,
|
|
93
|
+
UrlTooLong = 66,
|
|
94
|
+
SessionStorageBufferFull = 67,
|
|
95
|
+
CannotAccessCookie = 68,
|
|
96
|
+
IdTooLong = 69,
|
|
97
|
+
InvalidEvent = 70,
|
|
98
|
+
FailedMonitorAjaxSetRequestHeader = 71,
|
|
99
|
+
SendBrowserInfoOnUserInit = 72,
|
|
100
|
+
PluginException = 73,
|
|
101
|
+
NotificationException = 74,
|
|
102
|
+
SnippetScriptLoadFailure = 99,
|
|
103
|
+
InvalidInstrumentationKey = 100,
|
|
104
|
+
CannotParseAiBlobValue = 101,
|
|
105
|
+
InvalidContentBlob = 102,
|
|
106
|
+
TrackPageActionEventFailed = 103,
|
|
107
|
+
FailedAddingCustomDefinedRequestContext = 104,
|
|
108
|
+
InMemoryStorageBufferFull = 105
|
|
13
109
|
}
|
|
14
110
|
|
|
15
111
|
/**
|
|
16
112
|
* Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered
|
|
17
113
|
*/
|
|
18
|
-
export const _InternalMessageId = {
|
|
114
|
+
export const _InternalMessageId = createEnumStyle<typeof _eInternalMessageId>({
|
|
19
115
|
// Non user actionable
|
|
20
|
-
BrowserDoesNotSupportLocalStorage:
|
|
21
|
-
BrowserCannotReadLocalStorage:
|
|
22
|
-
BrowserCannotReadSessionStorage:
|
|
23
|
-
BrowserCannotWriteLocalStorage:
|
|
24
|
-
BrowserCannotWriteSessionStorage:
|
|
25
|
-
BrowserFailedRemovalFromLocalStorage:
|
|
26
|
-
BrowserFailedRemovalFromSessionStorage:
|
|
27
|
-
CannotSendEmptyTelemetry:
|
|
28
|
-
ClientPerformanceMathError:
|
|
29
|
-
ErrorParsingAISessionCookie:
|
|
30
|
-
ErrorPVCalc:
|
|
31
|
-
ExceptionWhileLoggingError:
|
|
32
|
-
FailedAddingTelemetryToBuffer:
|
|
33
|
-
FailedMonitorAjaxAbort:
|
|
34
|
-
FailedMonitorAjaxDur:
|
|
35
|
-
FailedMonitorAjaxOpen:
|
|
36
|
-
FailedMonitorAjaxRSC:
|
|
37
|
-
FailedMonitorAjaxSend:
|
|
38
|
-
FailedMonitorAjaxGetCorrelationHeader:
|
|
39
|
-
FailedToAddHandlerForOnBeforeUnload:
|
|
40
|
-
FailedToSendQueuedTelemetry:
|
|
41
|
-
FailedToReportDataLoss:
|
|
42
|
-
FlushFailed:
|
|
43
|
-
MessageLimitPerPVExceeded:
|
|
44
|
-
MissingRequiredFieldSpecification:
|
|
45
|
-
NavigationTimingNotSupported:
|
|
46
|
-
OnError:
|
|
47
|
-
SessionRenewalDateIsZero:
|
|
48
|
-
SenderNotInitialized:
|
|
49
|
-
StartTrackEventFailed:
|
|
50
|
-
StopTrackEventFailed:
|
|
51
|
-
StartTrackFailed:
|
|
52
|
-
StopTrackFailed:
|
|
53
|
-
TelemetrySampledAndNotSent:
|
|
54
|
-
TrackEventFailed:
|
|
55
|
-
TrackExceptionFailed:
|
|
56
|
-
TrackMetricFailed:
|
|
57
|
-
TrackPVFailed:
|
|
58
|
-
TrackPVFailedCalc:
|
|
59
|
-
TrackTraceFailed:
|
|
60
|
-
TransmissionFailed:
|
|
61
|
-
FailedToSetStorageBuffer:
|
|
62
|
-
FailedToRestoreStorageBuffer:
|
|
63
|
-
InvalidBackendResponse:
|
|
64
|
-
FailedToFixDepricatedValues:
|
|
65
|
-
InvalidDurationValue:
|
|
66
|
-
TelemetryEnvelopeInvalid:
|
|
67
|
-
CreateEnvelopeError:
|
|
116
|
+
BrowserDoesNotSupportLocalStorage: _eInternalMessageId.BrowserDoesNotSupportLocalStorage,
|
|
117
|
+
BrowserCannotReadLocalStorage: _eInternalMessageId.BrowserCannotReadLocalStorage,
|
|
118
|
+
BrowserCannotReadSessionStorage: _eInternalMessageId.BrowserCannotReadSessionStorage,
|
|
119
|
+
BrowserCannotWriteLocalStorage: _eInternalMessageId.BrowserCannotWriteLocalStorage,
|
|
120
|
+
BrowserCannotWriteSessionStorage: _eInternalMessageId.BrowserCannotWriteSessionStorage,
|
|
121
|
+
BrowserFailedRemovalFromLocalStorage: _eInternalMessageId.BrowserFailedRemovalFromLocalStorage,
|
|
122
|
+
BrowserFailedRemovalFromSessionStorage: _eInternalMessageId.BrowserFailedRemovalFromSessionStorage,
|
|
123
|
+
CannotSendEmptyTelemetry: _eInternalMessageId.CannotSendEmptyTelemetry,
|
|
124
|
+
ClientPerformanceMathError: _eInternalMessageId.ClientPerformanceMathError,
|
|
125
|
+
ErrorParsingAISessionCookie: _eInternalMessageId.ErrorParsingAISessionCookie,
|
|
126
|
+
ErrorPVCalc: _eInternalMessageId.ErrorPVCalc,
|
|
127
|
+
ExceptionWhileLoggingError: _eInternalMessageId.ExceptionWhileLoggingError,
|
|
128
|
+
FailedAddingTelemetryToBuffer: _eInternalMessageId.FailedAddingTelemetryToBuffer,
|
|
129
|
+
FailedMonitorAjaxAbort: _eInternalMessageId.FailedMonitorAjaxAbort,
|
|
130
|
+
FailedMonitorAjaxDur: _eInternalMessageId.FailedMonitorAjaxDur,
|
|
131
|
+
FailedMonitorAjaxOpen: _eInternalMessageId.FailedMonitorAjaxOpen,
|
|
132
|
+
FailedMonitorAjaxRSC: _eInternalMessageId.FailedMonitorAjaxRSC,
|
|
133
|
+
FailedMonitorAjaxSend: _eInternalMessageId.FailedMonitorAjaxSend,
|
|
134
|
+
FailedMonitorAjaxGetCorrelationHeader: _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader,
|
|
135
|
+
FailedToAddHandlerForOnBeforeUnload: _eInternalMessageId.FailedToAddHandlerForOnBeforeUnload,
|
|
136
|
+
FailedToSendQueuedTelemetry: _eInternalMessageId.FailedToSendQueuedTelemetry,
|
|
137
|
+
FailedToReportDataLoss: _eInternalMessageId.FailedToReportDataLoss,
|
|
138
|
+
FlushFailed: _eInternalMessageId.FlushFailed,
|
|
139
|
+
MessageLimitPerPVExceeded: _eInternalMessageId.MessageLimitPerPVExceeded,
|
|
140
|
+
MissingRequiredFieldSpecification: _eInternalMessageId.MissingRequiredFieldSpecification,
|
|
141
|
+
NavigationTimingNotSupported: _eInternalMessageId.NavigationTimingNotSupported,
|
|
142
|
+
OnError: _eInternalMessageId.OnError,
|
|
143
|
+
SessionRenewalDateIsZero: _eInternalMessageId.SessionRenewalDateIsZero,
|
|
144
|
+
SenderNotInitialized: _eInternalMessageId.SenderNotInitialized,
|
|
145
|
+
StartTrackEventFailed: _eInternalMessageId.StartTrackEventFailed,
|
|
146
|
+
StopTrackEventFailed: _eInternalMessageId.StopTrackEventFailed,
|
|
147
|
+
StartTrackFailed: _eInternalMessageId.StartTrackFailed,
|
|
148
|
+
StopTrackFailed: _eInternalMessageId.StopTrackFailed,
|
|
149
|
+
TelemetrySampledAndNotSent: _eInternalMessageId.TelemetrySampledAndNotSent,
|
|
150
|
+
TrackEventFailed: _eInternalMessageId.TrackEventFailed,
|
|
151
|
+
TrackExceptionFailed: _eInternalMessageId.TrackExceptionFailed,
|
|
152
|
+
TrackMetricFailed: _eInternalMessageId.TrackMetricFailed,
|
|
153
|
+
TrackPVFailed: _eInternalMessageId.TrackPVFailed,
|
|
154
|
+
TrackPVFailedCalc: _eInternalMessageId.TrackPVFailedCalc,
|
|
155
|
+
TrackTraceFailed: _eInternalMessageId.TrackTraceFailed,
|
|
156
|
+
TransmissionFailed: _eInternalMessageId.TransmissionFailed,
|
|
157
|
+
FailedToSetStorageBuffer: _eInternalMessageId.FailedToSetStorageBuffer,
|
|
158
|
+
FailedToRestoreStorageBuffer: _eInternalMessageId.FailedToRestoreStorageBuffer,
|
|
159
|
+
InvalidBackendResponse: _eInternalMessageId.InvalidBackendResponse,
|
|
160
|
+
FailedToFixDepricatedValues: _eInternalMessageId.FailedToFixDepricatedValues,
|
|
161
|
+
InvalidDurationValue: _eInternalMessageId.InvalidDurationValue,
|
|
162
|
+
TelemetryEnvelopeInvalid: _eInternalMessageId.TelemetryEnvelopeInvalid,
|
|
163
|
+
CreateEnvelopeError: _eInternalMessageId.CreateEnvelopeError,
|
|
68
164
|
|
|
69
165
|
// User actionable
|
|
70
|
-
CannotSerializeObject:
|
|
71
|
-
CannotSerializeObjectNonSerializable:
|
|
72
|
-
CircularReferenceDetected:
|
|
73
|
-
ClearAuthContextFailed:
|
|
74
|
-
ExceptionTruncated:
|
|
75
|
-
IllegalCharsInName:
|
|
76
|
-
ItemNotInArray:
|
|
77
|
-
MaxAjaxPerPVExceeded:
|
|
78
|
-
MessageTruncated:
|
|
79
|
-
NameTooLong:
|
|
80
|
-
SampleRateOutOfRange:
|
|
81
|
-
SetAuthContextFailed:
|
|
82
|
-
SetAuthContextFailedAccountName:
|
|
83
|
-
StringValueTooLong:
|
|
84
|
-
StartCalledMoreThanOnce:
|
|
85
|
-
StopCalledWithoutStart:
|
|
86
|
-
TelemetryInitializerFailed:
|
|
87
|
-
TrackArgumentsNotSpecified:
|
|
88
|
-
UrlTooLong:
|
|
89
|
-
SessionStorageBufferFull:
|
|
90
|
-
CannotAccessCookie:
|
|
91
|
-
IdTooLong:
|
|
92
|
-
InvalidEvent:
|
|
93
|
-
FailedMonitorAjaxSetRequestHeader:
|
|
94
|
-
SendBrowserInfoOnUserInit:
|
|
95
|
-
PluginException:
|
|
96
|
-
NotificationException:
|
|
97
|
-
SnippetScriptLoadFailure:
|
|
98
|
-
InvalidInstrumentationKey:
|
|
99
|
-
CannotParseAiBlobValue:
|
|
100
|
-
InvalidContentBlob:
|
|
101
|
-
TrackPageActionEventFailed:
|
|
102
|
-
FailedAddingCustomDefinedRequestContext:
|
|
103
|
-
InMemoryStorageBufferFull:
|
|
104
|
-
};
|
|
105
|
-
export type _InternalMessageId = number |
|
|
166
|
+
CannotSerializeObject: _eInternalMessageId.CannotSerializeObject,
|
|
167
|
+
CannotSerializeObjectNonSerializable: _eInternalMessageId.CannotSerializeObjectNonSerializable,
|
|
168
|
+
CircularReferenceDetected: _eInternalMessageId.CircularReferenceDetected,
|
|
169
|
+
ClearAuthContextFailed: _eInternalMessageId.ClearAuthContextFailed,
|
|
170
|
+
ExceptionTruncated: _eInternalMessageId.ExceptionTruncated,
|
|
171
|
+
IllegalCharsInName: _eInternalMessageId.IllegalCharsInName,
|
|
172
|
+
ItemNotInArray: _eInternalMessageId.ItemNotInArray,
|
|
173
|
+
MaxAjaxPerPVExceeded: _eInternalMessageId.MaxAjaxPerPVExceeded,
|
|
174
|
+
MessageTruncated: _eInternalMessageId.MessageTruncated,
|
|
175
|
+
NameTooLong: _eInternalMessageId.NameTooLong,
|
|
176
|
+
SampleRateOutOfRange: _eInternalMessageId.SampleRateOutOfRange,
|
|
177
|
+
SetAuthContextFailed: _eInternalMessageId.SetAuthContextFailed,
|
|
178
|
+
SetAuthContextFailedAccountName: _eInternalMessageId.SetAuthContextFailedAccountName,
|
|
179
|
+
StringValueTooLong: _eInternalMessageId.StringValueTooLong,
|
|
180
|
+
StartCalledMoreThanOnce: _eInternalMessageId.StartCalledMoreThanOnce,
|
|
181
|
+
StopCalledWithoutStart: _eInternalMessageId.StopCalledWithoutStart,
|
|
182
|
+
TelemetryInitializerFailed: _eInternalMessageId.TelemetryInitializerFailed,
|
|
183
|
+
TrackArgumentsNotSpecified: _eInternalMessageId.TrackArgumentsNotSpecified,
|
|
184
|
+
UrlTooLong: _eInternalMessageId.UrlTooLong,
|
|
185
|
+
SessionStorageBufferFull: _eInternalMessageId.SessionStorageBufferFull,
|
|
186
|
+
CannotAccessCookie: _eInternalMessageId.CannotAccessCookie,
|
|
187
|
+
IdTooLong: _eInternalMessageId.IdTooLong,
|
|
188
|
+
InvalidEvent: _eInternalMessageId.InvalidEvent,
|
|
189
|
+
FailedMonitorAjaxSetRequestHeader: _eInternalMessageId.FailedMonitorAjaxSetRequestHeader,
|
|
190
|
+
SendBrowserInfoOnUserInit: _eInternalMessageId.SendBrowserInfoOnUserInit,
|
|
191
|
+
PluginException: _eInternalMessageId.PluginException,
|
|
192
|
+
NotificationException: _eInternalMessageId.NotificationException,
|
|
193
|
+
SnippetScriptLoadFailure: _eInternalMessageId.SnippetScriptLoadFailure,
|
|
194
|
+
InvalidInstrumentationKey: _eInternalMessageId.InvalidInstrumentationKey,
|
|
195
|
+
CannotParseAiBlobValue: _eInternalMessageId.CannotParseAiBlobValue,
|
|
196
|
+
InvalidContentBlob: _eInternalMessageId.InvalidContentBlob,
|
|
197
|
+
TrackPageActionEventFailed: _eInternalMessageId.TrackPageActionEventFailed,
|
|
198
|
+
FailedAddingCustomDefinedRequestContext: _eInternalMessageId.FailedAddingCustomDefinedRequestContext,
|
|
199
|
+
InMemoryStorageBufferFull: _eInternalMessageId.InMemoryStorageBufferFull
|
|
200
|
+
});
|
|
201
|
+
export type _InternalMessageId = number | _eInternalMessageId;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
|
|
6
|
+
*/
|
|
7
|
+
export const enum TelemetryUnloadReason {
|
|
8
|
+
/**
|
|
9
|
+
* Teardown has been called without any context.
|
|
10
|
+
*/
|
|
11
|
+
ManualTeardown = 0,
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Just this plugin is being removed
|
|
15
|
+
*/
|
|
16
|
+
PluginUnload = 1,
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This instance of the plugin is being removed and replaced
|
|
20
|
+
*/
|
|
21
|
+
PluginReplace = 2,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The entire SDK is being unloaded
|
|
25
|
+
*/
|
|
26
|
+
SdkUnload = 50
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
|
|
6
|
+
*/
|
|
7
|
+
export const enum TelemetryUpdateReason {
|
|
8
|
+
/**
|
|
9
|
+
* Unknown.
|
|
10
|
+
*/
|
|
11
|
+
Unknown = 0,
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The configuration has ben updated or changed
|
|
15
|
+
*/
|
|
16
|
+
//ConfigurationChanged = 0x01,
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* One or more plugins have been added
|
|
20
|
+
*/
|
|
21
|
+
PluginAdded = 0x10,
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* One or more plugins have been removed
|
|
25
|
+
*/
|
|
26
|
+
PluginRemoved = 0x20,
|
|
27
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { ITelemetryItem } from "./ITelemetryItem";
|
|
4
4
|
import { IChannelControls } from "./IChannelControls";
|
|
5
|
-
import { IPlugin } from "./ITelemetryPlugin";
|
|
5
|
+
import { IPlugin, ITelemetryPlugin } from "./ITelemetryPlugin";
|
|
6
6
|
import { IConfiguration } from "./IConfiguration";
|
|
7
7
|
import { INotificationManager } from "./INotificationManager";
|
|
8
8
|
import { INotificationListener } from "./INotificationListener";
|
|
@@ -10,8 +10,31 @@ import { IDiagnosticLogger } from "./IDiagnosticLogger";
|
|
|
10
10
|
import { IProcessTelemetryContext } from "./IProcessTelemetryContext";
|
|
11
11
|
import { IPerfManagerProvider } from "./IPerfManager";
|
|
12
12
|
import { ICookieMgr } from "./ICookieMgr";
|
|
13
|
+
import { ITelemetryInitializerHandler, TelemetryInitializerFunction } from "./ITelemetryInitializers";
|
|
14
|
+
import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
|
|
15
|
+
import { UnloadHandler } from "../JavaScriptSDK/UnloadHandlerContainer";
|
|
16
|
+
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
export interface ILoadedPlugin<T extends IPlugin> {
|
|
19
|
+
plugin: T;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Identifies whether the plugin is enabled and can process events. This is slightly different from isInitialized as the plugin may be initialized but disabled
|
|
23
|
+
* via the setEnabled() or it may be a shared plugin which has had it's teardown function called from another instance..
|
|
24
|
+
* @returns boolean = true if the plugin is in a state where it is operational.
|
|
25
|
+
*/
|
|
26
|
+
isEnabled: () => boolean;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* You can optionally enable / disable a plugin from processing events.
|
|
30
|
+
* Setting enabled to true will not necessarily cause the `isEnabled()` to also return true
|
|
31
|
+
* as the plugin must also have been successfully initialized and not had it's `teardown` method called
|
|
32
|
+
* (unless it's also been re-initialized)
|
|
33
|
+
*/
|
|
34
|
+
setEnabled: (isEnabled: boolean) => void;
|
|
35
|
+
|
|
36
|
+
remove: (isAsync?: boolean, removeCb?: (removed?: boolean) => void) => void;
|
|
37
|
+
}
|
|
15
38
|
|
|
16
39
|
export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
17
40
|
|
|
@@ -72,6 +95,13 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
72
95
|
*/
|
|
73
96
|
removeNotificationListener?(listener: INotificationListener): void;
|
|
74
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Add a telemetry processor to decorate or drop telemetry events.
|
|
100
|
+
* @param telemetryInitializer - The Telemetry Initializer function
|
|
101
|
+
* @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
|
|
102
|
+
*/
|
|
103
|
+
addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
|
|
104
|
+
|
|
75
105
|
pollInternalLogs?(eventName?: string): number;
|
|
76
106
|
|
|
77
107
|
stopPollingInternalLogs?(): void;
|
|
@@ -80,4 +110,54 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
|
|
|
80
110
|
* Return a new instance of the IProcessTelemetryContext for processing events
|
|
81
111
|
*/
|
|
82
112
|
getProcessTelContext() : IProcessTelemetryContext;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Unload and Tear down the SDK and any initialized plugins, after calling this the SDK will be considered
|
|
116
|
+
* to be un-initialized and non-operational, re-initializing the SDK should only be attempted if the previous
|
|
117
|
+
* unload call return `true` stating that all plugins reported that they also unloaded, the recommended
|
|
118
|
+
* approach is to create a new instance and initialize that instance.
|
|
119
|
+
* This is due to possible unexpected side effects caused by plugins not supporting unload / teardown, unable
|
|
120
|
+
* to successfully remove any global references or they may just be completing the unload process asynchronously.
|
|
121
|
+
* @param isAsync - Can the unload be performed asynchronously (default)
|
|
122
|
+
* @param unloadComplete - An optional callback that will be called once the unload has completed
|
|
123
|
+
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
124
|
+
*/
|
|
125
|
+
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Find and return the (first) plugin with the specified identifier if present
|
|
129
|
+
* @param pluginIdentifier
|
|
130
|
+
*/
|
|
131
|
+
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Add a new plugin to the installation
|
|
135
|
+
* @param plugin - The new plugin to add
|
|
136
|
+
* @param replaceExisting - should any existing plugin be replaced, default is false
|
|
137
|
+
* @param doAsync - Should the add be performed asynchronously
|
|
138
|
+
* @param addCb - [Optional] callback to call after the plugin has been added
|
|
139
|
+
*/
|
|
140
|
+
addPlugin<T extends IPlugin = ITelemetryPlugin>(plugin: T, replaceExisting?: boolean, doAsync?: boolean, addCb?: (added?: boolean) => void): void;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Returns the unique event namespace that should be used when registering events
|
|
144
|
+
*/
|
|
145
|
+
evtNamespace(): string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Add a handler that will be called when the SDK is being unloaded
|
|
149
|
+
* @param handler - the handler
|
|
150
|
+
*/
|
|
151
|
+
addUnloadCb(handler: UnloadHandler): void;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Flush and send any batched / cached data immediately
|
|
155
|
+
* @param async - send data asynchronously when true (defaults to true)
|
|
156
|
+
* @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.
|
|
157
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
158
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
159
|
+
* @param cbTimeout - An optional timeout to wait for any flush operations to complete before proceeding with the unload. Defaults to 5 seconds.
|
|
160
|
+
* @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
|
|
161
|
+
*/
|
|
162
|
+
flush(isAsync?: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason, cbTimeout?: number): boolean | void;
|
|
83
163
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
+
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";
|
|
4
|
+
import { IProcessTelemetryUnloadContext } from "./IProcessTelemetryContext";
|
|
3
5
|
import { ITelemetryPlugin } from "./ITelemetryPlugin";
|
|
6
|
+
import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
|
|
4
7
|
|
|
5
8
|
"use strict";
|
|
6
9
|
|
|
@@ -20,16 +23,24 @@ export interface IChannelControls extends ITelemetryPlugin {
|
|
|
20
23
|
resume(): void;
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
|
-
* Tear down
|
|
26
|
+
* Tear down the plugin and remove any hooked value, the plugin should be removed so that it is no longer initialized and
|
|
27
|
+
* therefore could be re-initialized after being torn down. The plugin should ensure that once this has been called any further
|
|
28
|
+
* processTelemetry calls are ignored and it just calls the processNext() with the provided context.
|
|
29
|
+
* @param unloadCtx - This is the context that should be used during unloading.
|
|
30
|
+
* @param unloadState - The details / state of the unload process, it holds details like whether it should be unloaded synchronously or asynchronously and the reason for the unload.
|
|
31
|
+
* @returns boolean - true if the plugin has or will call processNext(), this for backward compatibility as previously teardown was synchronous and returned nothing.
|
|
24
32
|
*/
|
|
25
|
-
teardown()
|
|
33
|
+
teardown: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
|
|
26
34
|
|
|
27
35
|
/**
|
|
28
36
|
* Flush to send data immediately; channel should default to sending data asynchronously
|
|
29
|
-
* @param async
|
|
30
|
-
* @param callBack
|
|
37
|
+
* @param async - send data asynchronously when true
|
|
38
|
+
* @param callBack - if specified, notify caller when send is complete, the channel should return true to indicate to the caller that it will be called.
|
|
39
|
+
* If the caller doesn't return true the caller should assume that it may never be called.
|
|
40
|
+
* @param sendReason - specify the reason that you are calling "flush" defaults to ManualFlush (1) if not specified
|
|
41
|
+
* @returns - true if the callback will be return after the flush is complete otherwise the caller should assume that any provided callback will never be called
|
|
31
42
|
*/
|
|
32
|
-
flush(async: boolean, callBack?: () => void): void;
|
|
43
|
+
flush(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
export const MinChannelPriorty: number = 100;
|
|
@@ -12,6 +12,11 @@ export type InstrumentorHooksCallback = (funcArgs:IInstrumentCallDetails, ...org
|
|
|
12
12
|
* You must always supply the error callback
|
|
13
13
|
*/
|
|
14
14
|
export interface IInstrumentHooksCallbacks {
|
|
15
|
+
/**
|
|
16
|
+
* [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
|
|
17
|
+
* identify the source of the instrumented hooks
|
|
18
|
+
*/
|
|
19
|
+
ns?: string | string[];
|
|
15
20
|
|
|
16
21
|
/**
|
|
17
22
|
* The hook callback to call before the original function is called
|
|
@@ -40,20 +45,20 @@ export interface IInstrumentHooksCallbacks {
|
|
|
40
45
|
*/
|
|
41
46
|
export interface IInstrumentHook {
|
|
42
47
|
/** Unique Id for this callback on the hooked method */
|
|
43
|
-
id:number;
|
|
48
|
+
id: number;
|
|
44
49
|
|
|
45
50
|
/** Holds the callbacks */
|
|
46
|
-
cbks:IInstrumentHooksCallbacks;
|
|
51
|
+
cbks: IInstrumentHooksCallbacks;
|
|
47
52
|
|
|
48
53
|
/** Remove this hook from the function */
|
|
49
54
|
rm: () => void;
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
export interface IInstrumentHooks {
|
|
53
|
-
i:number; // Used to create unique ids
|
|
54
|
-
n:string; // Function name
|
|
55
|
-
f:any; // Original Function
|
|
56
|
-
h:IInstrumentHook[]; // The hook
|
|
58
|
+
i: number; // Used to create unique ids
|
|
59
|
+
n: string; // Function name
|
|
60
|
+
f: any; // Original Function
|
|
61
|
+
h: IInstrumentHook[]; // The hook
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
export interface IInstrumentCallDetails {
|
|
@@ -85,4 +90,9 @@ export interface IInstrumentCallDetails {
|
|
|
85
90
|
* The error (exception) which occurred while executing the original method
|
|
86
91
|
*/
|
|
87
92
|
err?: Error;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The Event object from (window.event) at the start of the original call
|
|
96
|
+
*/
|
|
97
|
+
evt?: Event;
|
|
88
98
|
}
|