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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +2 -2
  3. package/browser/applicationinsights-core-js.js.map +1 -1
  4. package/browser/applicationinsights-core-js.min.js +2 -2
  5. package/browser/applicationinsights-core-js.min.js.map +1 -1
  6. package/dist/applicationinsights-core-js.api.json +113 -206
  7. package/dist/applicationinsights-core-js.api.md +11 -14
  8. package/dist/applicationinsights-core-js.d.ts +15 -13
  9. package/dist/applicationinsights-core-js.js +2 -2
  10. package/dist/applicationinsights-core-js.js.map +1 -1
  11. package/dist/applicationinsights-core-js.min.js +2 -2
  12. package/dist/applicationinsights-core-js.min.js.map +1 -1
  13. package/dist/applicationinsights-core-js.rollup.d.ts +15 -13
  14. package/dist-esm/Config/ConfigDefaultHelpers.js +1 -1
  15. package/dist-esm/Config/ConfigDefaults.js +1 -1
  16. package/dist-esm/Config/DynamicConfig.js +1 -1
  17. package/dist-esm/Config/DynamicProperty.js +1 -1
  18. package/dist-esm/Config/DynamicState.js +1 -1
  19. package/dist-esm/Config/DynamicSupport.js +1 -1
  20. package/dist-esm/Config/IConfigDefaults.js +1 -1
  21. package/dist-esm/Config/IDynamicConfigHandler.js +1 -1
  22. package/dist-esm/Config/IDynamicPropertyHandler.js +1 -1
  23. package/dist-esm/Config/IDynamicWatcher.js +1 -1
  24. package/dist-esm/Config/_IDynamicConfigHandlerState.js +1 -1
  25. package/dist-esm/JavaScriptSDK/AggregationError.js +1 -1
  26. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
  27. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  28. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  29. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  30. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  31. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +2 -2
  32. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  33. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  34. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  35. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  36. package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
  37. package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -1
  38. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  39. package/dist-esm/JavaScriptSDK/InternalConstants.js +1 -1
  40. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  41. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  42. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  43. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  44. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  45. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  46. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  47. package/dist-esm/JavaScriptSDK/UnloadHookContainer.js +1 -1
  48. package/dist-esm/JavaScriptSDK/W3cTraceParent.js +1 -1
  49. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
  50. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  51. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  52. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  53. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  69. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  70. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  71. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  72. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  73. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  75. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
  76. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  77. package/dist-esm/__DynamicConstants.js +1 -1
  78. package/dist-esm/applicationinsights-core-js.js +1 -1
  79. package/package.json +1 -1
  80. package/types/JavaScriptSDK/AppInsightsCore.d.ts +5 -6
  81. package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +9 -6
  82. package/src/JavaScriptSDK/AggregationError.ts +0 -36
  83. package/src/JavaScriptSDK/AppInsightsCore.ts +0 -1322
  84. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +0 -343
  85. package/src/JavaScriptSDK/Constants.ts +0 -4
  86. package/src/JavaScriptSDK/CookieMgr.ts +0 -449
  87. package/src/JavaScriptSDK/CoreUtils.ts +0 -58
  88. package/src/JavaScriptSDK/DataCacheHelper.ts +0 -107
  89. package/src/JavaScriptSDK/DbgExtensionUtils.ts +0 -56
  90. package/src/JavaScriptSDK/DiagnosticLogger.ts +0 -380
  91. package/src/JavaScriptSDK/EnvUtils.ts +0 -312
  92. package/src/JavaScriptSDK/EventHelpers.ts +0 -550
  93. package/src/JavaScriptSDK/HelperFuncs.ts +0 -351
  94. package/src/JavaScriptSDK/InstrumentHooks.ts +0 -280
  95. package/src/JavaScriptSDK/InternalConstants.ts +0 -31
  96. package/src/JavaScriptSDK/NotificationManager.ts +0 -165
  97. package/src/JavaScriptSDK/PerfManager.ts +0 -288
  98. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +0 -674
  99. package/src/JavaScriptSDK/RandomHelper.ts +0 -145
  100. package/src/JavaScriptSDK/TelemetryHelpers.ts +0 -184
  101. package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +0 -112
  102. package/src/JavaScriptSDK/UnloadHandlerContainer.ts +0 -45
  103. package/src/JavaScriptSDK/UnloadHookContainer.ts +0 -52
  104. package/src/JavaScriptSDK/W3cTraceParent.ts +0 -197
  105. package/src/JavaScriptSDK.Enums/EnumHelperFuncs.ts +0 -24
  106. package/src/JavaScriptSDK.Enums/EventsDiscardedReason.ts +0 -71
  107. package/src/JavaScriptSDK.Enums/LoggingEnums.ts +0 -121
  108. package/src/JavaScriptSDK.Enums/SendRequestReason.ts +0 -56
  109. package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +0 -27
  110. package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +0 -27
  111. package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +0 -216
  112. package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +0 -46
  113. package/src/JavaScriptSDK.Interfaces/IConfiguration.ts +0 -176
  114. package/src/JavaScriptSDK.Interfaces/ICookieMgr.ts +0 -116
  115. package/src/JavaScriptSDK.Interfaces/IDbgExtension.ts +0 -14
  116. package/src/JavaScriptSDK.Interfaces/IDiagnosticLogger.ts +0 -75
  117. package/src/JavaScriptSDK.Interfaces/IDistributedTraceContext.ts +0 -54
  118. package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +0 -100
  119. package/src/JavaScriptSDK.Interfaces/INotificationListener.ts +0 -39
  120. package/src/JavaScriptSDK.Interfaces/INotificationManager.ts +0 -52
  121. package/src/JavaScriptSDK.Interfaces/IPerfEvent.ts +0 -69
  122. package/src/JavaScriptSDK.Interfaces/IPerfManager.ts +0 -53
  123. package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +0 -157
  124. package/src/JavaScriptSDK.Interfaces/ITelemetryInitializers.ts +0 -17
  125. package/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts +0 -62
  126. package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +0 -94
  127. package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +0 -30
  128. package/src/JavaScriptSDK.Interfaces/ITelemetryUnloadState.ts +0 -10
  129. package/src/JavaScriptSDK.Interfaces/ITelemetryUpdateState.ts +0 -44
  130. package/src/JavaScriptSDK.Interfaces/ITraceParent.ts +0 -38
  131. package/src/JavaScriptSDK.Interfaces/IUnloadHook.ts +0 -22
  132. package/src/JavaScriptSDK.Interfaces/IUnloadableComponent.ts +0 -17
@@ -1,54 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- export interface IDistributedTraceContext {
5
-
6
- /**
7
- * Returns the current name of the page
8
- */
9
- getName(): string;
10
-
11
- /**
12
- * Sets the current name of the page
13
- * @param pageName
14
- */
15
- setName(pageName: string): void;
16
-
17
- /**
18
- * Returns the unique identifier for a trace. All requests / spans from the same trace share the same traceId.
19
- * Must be read from incoming headers or generated according to the W3C TraceContext specification,
20
- * in a hex representation of 16-byte array. A.k.a. trace-id, TraceID or Distributed TraceID
21
- */
22
- getTraceId(): string;
23
-
24
- /**
25
- * Set the unique identifier for a trace. All requests / spans from the same trace share the same traceId.
26
- * Must be conform to the W3C TraceContext specification, in a hex representation of 16-byte array.
27
- * A.k.a. trace-id, TraceID or Distributed TraceID https://www.w3.org/TR/trace-context/#trace-id
28
- */
29
- setTraceId(newValue: string): void;
30
-
31
- /**
32
- * Self-generated 8-bytes identifier of the incoming request. Must be a hex representation of 8-byte array.
33
- * Also know as the parentId, used to link requests together
34
- */
35
- getSpanId(): string;
36
-
37
- /**
38
- * Self-generated 8-bytes identifier of the incoming request. Must be a hex representation of 8-byte array.
39
- * Also know as the parentId, used to link requests together
40
- * https://www.w3.org/TR/trace-context/#parent-id
41
- */
42
- setSpanId(newValue: string): void;
43
-
44
- /**
45
- * An integer representation of the W3C TraceContext trace-flags.
46
- */
47
- getTraceFlags(): number | undefined;
48
-
49
- /**
50
- * https://www.w3.org/TR/trace-context/#trace-flags
51
- * @param newValue
52
- */
53
- setTraceFlags(newValue?: number): void;
54
- }
@@ -1,100 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { IUnloadHook } from "./IUnloadHook";
5
-
6
- /**
7
- * A callback function that will be called for the wrapped instrumentation function
8
- * before the original function is executed.
9
- */
10
- export type InstrumentorHooksCallback = (funcArgs:IInstrumentCallDetails, ...orgArgs: any[]) => void;
11
-
12
- /**
13
- * The callbacks to call for the instrumented function, you must provide at least the request and/or response callbacks, both are not required.
14
- * You must always supply the error callback
15
- */
16
- export interface IInstrumentHooksCallbacks {
17
- /**
18
- * [Optional] Namespace details (same as the namespace used for events), useful for debugging and testing to
19
- * identify the source of the instrumented hooks
20
- */
21
- ns?: string | string[];
22
-
23
- /**
24
- * The hook callback to call before the original function is called
25
- */
26
- req?: InstrumentorHooksCallback;
27
-
28
- /**
29
- * The hook callback to call after the original function was called
30
- */
31
- rsp?: InstrumentorHooksCallback;
32
-
33
- /**
34
- * The callback to call if the hook function causes an exception
35
- */
36
- hkErr?: InstrumentorHooksCallback;
37
-
38
- /**
39
- * The callback to call if the original function causes an exception, even if you
40
- * supply a callback the original exception will still be thrown
41
- */
42
- fnErr?: InstrumentorHooksCallback;
43
- }
44
-
45
- /**
46
- * The holder of the specific instance callback
47
- */
48
- export interface IInstrumentHook extends IUnloadHook {
49
- /** Unique Id for this callback on the hooked method */
50
- id: number;
51
-
52
- /** Holds the callbacks */
53
- cbks: IInstrumentHooksCallbacks;
54
-
55
- /** Remove this hook from the function */
56
- rm: () => void;
57
- }
58
-
59
- export interface IInstrumentHooks {
60
- i: number; // Used to create unique ids
61
- n: string; // Function name
62
- f: any; // Original Function
63
- h: IInstrumentHook[]; // The hook
64
- }
65
-
66
- export interface IInstrumentCallDetails {
67
- name: string;
68
- inst: any;
69
-
70
- /**
71
- * This returns an object that the hook function can use to store hook specific
72
- * context, it it not shared with any other hook instances and is unique for the
73
- * current call.
74
- * A hook implementation can use this to pass / share context between different
75
- * hook callbacks eg. request/response requst/hookErrors etc.
76
- */
77
- ctx: () => any;
78
-
79
- /**
80
- * Allows the hook functions to replace the original arguments
81
- * @param idx - The argument index (0 based)
82
- * @param value - The new value for the argument
83
- */
84
- set: (idx:number, value:any) => void;
85
-
86
- /**
87
- * The result of the original method, only populated after the original method has returned
88
- */
89
- rslt?: any;
90
-
91
- /**
92
- * The error (exception) which occurred while executing the original method
93
- */
94
- err?: Error;
95
-
96
- /**
97
- * The Event object from (window.event) at the start of the original call
98
- */
99
- evt?: Event;
100
- }
@@ -1,39 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- "use strict";
4
-
5
- import { ITelemetryItem } from "./ITelemetryItem";
6
- import { IPerfEvent } from "./IPerfEvent";
7
-
8
- /**
9
- * An interface used for the notification listener.
10
- * @interface
11
- */
12
- export interface INotificationListener {
13
- /**
14
- * [Optional] A function called when events are sent.
15
- * @param events - The array of events that have been sent.
16
- */
17
- eventsSent?: (events: ITelemetryItem[]) => void;
18
- /**
19
- * [Optional] A function called when events are discarded.
20
- * @param events - The array of events that have been discarded.
21
- * @param reason - The reason for discarding the events. The EventsDiscardedReason
22
- * constant should be used to check the different values.
23
- */
24
- eventsDiscarded?: (events: ITelemetryItem[], reason: number) => void;
25
-
26
- /**
27
- * [Optional] A function called when the events have been requested to be sent to the sever.
28
- * @param sendReason - The reason why the event batch is being sent.
29
- * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
30
- */
31
- eventsSendRequest?: (sendReason: number, isAsync?: boolean) => void;
32
-
33
- /**
34
- * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
35
- * the event can be displayed via the debug plugin extension.
36
- * @param perfEvent
37
- */
38
- perfEvent?: (perfEvent: IPerfEvent) => void;
39
- }
@@ -1,52 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
4
- import { INotificationListener } from "../JavaScriptSDK.Interfaces/INotificationListener";
5
- import { IPerfEvent } from "./IPerfEvent";
6
-
7
- /**
8
- * Class to manage sending notifications to all the listeners.
9
- */
10
- export interface INotificationManager {
11
- listeners: INotificationListener[];
12
-
13
- /**
14
- * Adds a notification listener.
15
- * @param listener - The notification listener to be added.
16
- */
17
- addNotificationListener(listener: INotificationListener): void;
18
-
19
- /**
20
- * Removes all instances of the listener.
21
- * @param listener - AWTNotificationListener to remove.
22
- */
23
- removeNotificationListener(listener: INotificationListener): void;
24
-
25
- /**
26
- * Notification for events sent.
27
- * @param events - The array of events that have been sent.
28
- */
29
- eventsSent(events: ITelemetryItem[]): void;
30
-
31
- /**
32
- * Notification for events being discarded.
33
- * @param events - The array of events that have been discarded by the SDK.
34
- * @param reason - The reason for which the SDK discarded the events. The EventsDiscardedReason
35
- * constant should be used to check the different values.
36
- */
37
- eventsDiscarded(events: ITelemetryItem[], reason: number): void;
38
-
39
- /**
40
- * [Optional] A function called when the events have been requested to be sent to the sever.
41
- * @param sendReason - The reason why the event batch is being sent.
42
- * @param isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
43
- */
44
- eventsSendRequest?(sendReason: number, isAsync: boolean): void;
45
-
46
- /**
47
- * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
48
- * the event can be displayed via the debug plugin extension.
49
- * @param perfEvent - The perf event details
50
- */
51
- perfEvent?(perfEvent: IPerfEvent): void;
52
- }
@@ -1,69 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- /**
5
- * This interface identifies the details of an internal performance event - it does not represent an outgoing reported event
6
- */
7
- export interface IPerfEvent {
8
- /**
9
- * The name of the performance event
10
- */
11
- name: string;
12
-
13
- /**
14
- * The start time of the performance event
15
- */
16
- start: number;
17
-
18
- /**
19
- * The payload (contents) of the perfEvent, may be null or only set after the event has completed depending on
20
- * the runtime environment.
21
- */
22
- payload: any;
23
-
24
- /**
25
- * Is this occurring from an asynchronous event
26
- */
27
- isAsync: boolean;
28
-
29
- /**
30
- * Identifies the total inclusive time spent for this event, including the time spent for child events,
31
- * this will be undefined until the event is completed
32
- */
33
- time?: number;
34
-
35
- /**
36
- * Identifies the exclusive time spent in for this event (not including child events),
37
- * this will be undefined until the event is completed.
38
- */
39
- exTime?: number;
40
- /**
41
- * The Parent event that was started before this event was created
42
- */
43
- parent?: IPerfEvent;
44
-
45
- /**
46
- * The child perf events that are contained within the total time of this event.
47
- */
48
- childEvts?: IPerfEvent[];
49
-
50
- /**
51
- * Identifies whether this event is a child event of a parent
52
- */
53
- isChildEvt: () => boolean;
54
-
55
- /**
56
- * Get the names additional context associated with this perf event
57
- */
58
- getCtx?: (key: string) => any;
59
-
60
- /**
61
- * Set the named additional context to be associated with this perf event, this will replace any existing value
62
- */
63
- setCtx?: (key: string, value: any) => void;
64
-
65
- /**
66
- * Mark this event as completed, calculating the total execution time.
67
- */
68
- complete: () => void;
69
- }
@@ -1,53 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- import { IPerfEvent } from "./../JavaScriptSDK.Interfaces/IPerfEvent";
4
-
5
- /**
6
- * Identifies an interface to a host that can provide an IPerfManager implementation
7
- */
8
- export interface IPerfManagerProvider {
9
- /**
10
- * Get the current performance manager
11
- */
12
- getPerfMgr(): IPerfManager;
13
-
14
- /**
15
- * Set the current performance manager
16
- * @param perfMgr - The performance manager
17
- */
18
- setPerfMgr(perfMgr: IPerfManager): void;
19
- }
20
-
21
- /**
22
- * This defines an internal performance manager for tracking and reporting the internal performance of the SDK -- It does
23
- * not represent or report any event to the server.
24
- */
25
- export interface IPerfManager {
26
- /**
27
- * Create a new event and start timing, the manager may return null/undefined to indicate that it does not
28
- * want to monitor this source event.
29
- * @param src - The source name of the event
30
- * @param payloadDetails - An optional callback function to fetch the payload details for the event.
31
- * @param isAsync - Is the event occurring from a async event
32
- */
33
- create(src: string, payloadDetails?: () => any, isAsync?: boolean): IPerfEvent | null | undefined;
34
-
35
- /**
36
- * Complete the perfEvent and fire any notifications.
37
- * @param perfEvent - Fire the event which will also complete the passed event
38
- */
39
- fire(perfEvent: IPerfEvent): void;
40
-
41
- /**
42
- * Set an execution context value
43
- * @param key - The context key name
44
- * @param value - The value
45
- */
46
- setCtx(key: string, value: any): void;
47
-
48
- /**
49
- * Get the execution context value
50
- * @param key - The context key
51
- */
52
- getCtx(key: string): any;
53
- }
@@ -1,157 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- "use strict";
4
-
5
- import { IConfigDefaults } from "../Config/IConfigDefaults";
6
- import { IAppInsightsCore } from "./IAppInsightsCore";
7
- import { IConfiguration } from "./IConfiguration";
8
- import { IDiagnosticLogger } from "./IDiagnosticLogger";
9
- import { ITelemetryItem } from "./ITelemetryItem";
10
- import { IPlugin, ITelemetryPlugin } from "./ITelemetryPlugin";
11
- import { ITelemetryPluginChain } from "./ITelemetryPluginChain";
12
- import { ITelemetryUnloadState } from "./ITelemetryUnloadState";
13
- import { ITelemetryUpdateState } from "./ITelemetryUpdateState";
14
-
15
- // export const enum GetExtCfgMergeType {
16
- // None = 0,
17
- // MergeDefaultOnly = 1,
18
- // MergeDefaultFromRootOrDefault = 2,
19
- // }
20
-
21
- export interface IBaseProcessingContext {
22
- /**
23
- * The current core instance for the request
24
- */
25
- core: () => IAppInsightsCore;
26
-
27
- /**
28
- * THe current diagnostic logger for the request
29
- */
30
- diagLog: () => IDiagnosticLogger;
31
-
32
- /**
33
- * Gets the current core config instance
34
- */
35
- getCfg: () => IConfiguration;
36
-
37
- /**
38
- * Gets the named extension config
39
- */
40
- getExtCfg: <T>(identifier: string, defaultValue?: IConfigDefaults<T>) => T;
41
-
42
- /**
43
- * Gets the named config from either the named identifier extension or core config if neither exist then the
44
- * default value is returned
45
- * @param identifier - The named extension identifier
46
- * @param field - The config field name
47
- * @param defaultValue - The default value to return if no defined config exists
48
- */
49
- getConfig: (identifier: string, field: string, defaultValue?: number | string | boolean | string[] | RegExp[] | Function) => number | string | boolean | string[] | RegExp[] | Function;
50
-
51
- /**
52
- * Helper to allow plugins to check and possibly shortcut executing code only
53
- * required if there is a nextPlugin
54
- */
55
- hasNext: () => boolean;
56
-
57
- /**
58
- * Returns the next configured plugin proxy
59
- */
60
- getNext: () => ITelemetryPluginChain;
61
-
62
- /**
63
- * Helper to set the next plugin proxy
64
- */
65
- setNext: (nextCtx: ITelemetryPluginChain) => void;
66
-
67
- /**
68
- * Synchronously iterate over the context chain running the callback for each plugin, once
69
- * every plugin has been executed via the callback, any associated onComplete will be called.
70
- * @param callback - The function call for each plugin in the context chain
71
- */
72
- iterate: <T extends ITelemetryPlugin = ITelemetryPlugin>(callback: (plugin: T) => void) => void;
73
-
74
- /**
75
- * Set the function to call when the current chain has executed all processNext or unloadNext items.
76
- * @param onComplete - The onComplete to call
77
- * @param that - The "this" value to use for the onComplete call, if not provided or undefined defaults to the current context
78
- * @param args - Any additional arguments to pass to the onComplete function
79
- */
80
- onComplete: (onComplete: () => void, that?: any, ...args: any[]) => void;
81
-
82
- /**
83
- * Create a new context using the core and config from the current instance, returns a new instance of the same type
84
- * @param plugins - The execution order to process the plugins, if null or not supplied
85
- * then the current execution order will be copied.
86
- * @param startAt - The plugin to start processing from, if missing from the execution
87
- * order then the next plugin will be NOT set.
88
- */
89
- createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IBaseProcessingContext;
90
- }
91
-
92
- /**
93
- * The current context for the current call to processTelemetry(), used to support sharing the same plugin instance
94
- * between multiple AppInsights instances
95
- */
96
- export interface IProcessTelemetryContext extends IBaseProcessingContext {
97
- /**
98
- * Call back for telemetry processing before it it is sent
99
- * @param env - This is the current event being reported
100
- * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
101
- */
102
- processNext: (env: ITelemetryItem) => boolean | void;
103
-
104
- /**
105
- * Create a new context using the core and config from the current instance, returns a new instance of the same type
106
- * @param plugins - The execution order to process the plugins, if null or not supplied
107
- * then the current execution order will be copied.
108
- * @param startAt - The plugin to start processing from, if missing from the execution
109
- * order then the next plugin will be NOT set.
110
- */
111
- createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryContext;
112
- }
113
-
114
- /**
115
- * The current context for the current call to teardown() implementations, used to support when plugins are being removed
116
- * or the SDK is being unloaded.
117
- */
118
- export interface IProcessTelemetryUnloadContext extends IBaseProcessingContext {
119
-
120
- /**
121
- * This Plugin has finished unloading, so unload the next one
122
- * @param uploadState - The state of the unload process
123
- * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
124
- */
125
- processNext: (unloadState: ITelemetryUnloadState) => boolean | void;
126
-
127
- /**
128
- * Create a new context using the core and config from the current instance, returns a new instance of the same type
129
- * @param plugins - The execution order to process the plugins, if null or not supplied
130
- * then the current execution order will be copied.
131
- * @param startAt - The plugin to start processing from, if missing from the execution
132
- * order then the next plugin will be NOT set.
133
- */
134
- createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUnloadContext;
135
- }
136
-
137
- /**
138
- * The current context for the current call to the plugin update() implementations, used to support the notifications
139
- * for when plugins are added, removed or the configuration was changed.
140
- */
141
- export interface IProcessTelemetryUpdateContext extends IBaseProcessingContext {
142
- /**
143
- * This Plugin has finished unloading, so unload the next one
144
- * @param updateState - The update State
145
- * @returns boolean (true) if there is no more plugins to process otherwise false or undefined (void)
146
- */
147
- processNext: (updateState: ITelemetryUpdateState) => boolean | void;
148
-
149
- /**
150
- * Create a new context using the core and config from the current instance, returns a new instance of the same type
151
- * @param plugins - The execution order to process the plugins, if null or not supplied
152
- * then the current execution order will be copied.
153
- * @param startAt - The plugin to start processing from, if missing from the execution
154
- * order then the next plugin will be NOT set.
155
- */
156
- createNew: (plugins?: IPlugin[] | ITelemetryPluginChain, startAt?: IPlugin) => IProcessTelemetryUpdateContext;
157
- }
@@ -1,17 +0,0 @@
1
- import { ITelemetryItem } from "./ITelemetryItem";
2
- import { ILegacyUnloadHook } from "./IUnloadHook";
3
-
4
- export declare type TelemetryInitializerFunction = <T extends ITelemetryItem>(item: T) => boolean | void;
5
-
6
- export interface ITelemetryInitializerHandler extends ILegacyUnloadHook {
7
- remove(): void;
8
- }
9
-
10
- export interface ITelemetryInitializerContainer {
11
- /**
12
- * Add a telemetry processor to decorate or drop telemetry events.
13
- * @param telemetryInitializer - The Telemetry Initializer function
14
- * @returns - A ITelemetryInitializerHandler to enable the initializer to be removed
15
- */
16
- addTelemetryInitializer(telemetryInitializer: TelemetryInitializerFunction): ITelemetryInitializerHandler | void;
17
- }
@@ -1,62 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- "use strict";
4
-
5
- /**
6
- * Telemety item supported in Core
7
- */
8
- export interface ITelemetryItem {
9
- /**
10
- * CommonSchema Version of this SDK
11
- */
12
- ver?: string;
13
-
14
- /**
15
- * Unique name of the telemetry item
16
- */
17
- name: string;
18
-
19
- /**
20
- * Timestamp when item was sent
21
- */
22
- time?: string;
23
-
24
- /**
25
- * Identifier of the resource that uniquely identifies which resource data is sent to
26
- */
27
- iKey?: string;
28
-
29
- /**
30
- * System context properties of the telemetry item, example: ip address, city etc
31
- */
32
- ext?: {[key: string]: any};
33
-
34
- /**
35
- * System context property extensions that are not global (not in ctx)
36
- */
37
- tags?: Tags & Tags[]; // Tags[] will be deprecated.
38
-
39
- /**
40
- * Custom data
41
- */
42
- data?:ICustomProperties;
43
-
44
- /**
45
- * Telemetry type used for part B
46
- */
47
- baseType?: string;
48
-
49
- /**
50
- * Based on schema for part B
51
- */
52
- baseData?: { [key: string]: any };
53
-
54
- }
55
-
56
- export interface Tags {
57
- [key: string]: any;
58
- }
59
-
60
- export interface ICustomProperties {
61
- [key: string]: any;
62
- }