@microsoft/applicationinsights-core-js 2.7.0-beta.1 → 2.7.1-nightly.202110-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 (97) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +110 -17
  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 +182 -1
  7. package/dist/applicationinsights-core-js.api.md +15 -0
  8. package/dist/applicationinsights-core-js.d.ts +27 -1
  9. package/dist/applicationinsights-core-js.js +110 -17
  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 +27 -1
  14. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +21 -3
  15. package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
  16. package/dist-esm/JavaScriptSDK/BaseCore.js +3 -3
  17. package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
  18. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +2 -2
  19. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
  20. package/dist-esm/JavaScriptSDK/ChannelController.js +1 -2
  21. package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
  22. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  23. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  24. package/dist-esm/JavaScriptSDK/CoreUtils.js +2 -2
  25. package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
  26. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  27. package/dist-esm/JavaScriptSDK/EnvUtils.js +86 -3
  28. package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
  29. package/dist-esm/JavaScriptSDK/HelperFuncs.js +27 -17
  30. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  31. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -2
  32. package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +1 -1
  33. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  34. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  35. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  36. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  37. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +2 -2
  38. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
  39. package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +4 -3
  40. package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js.map +1 -1
  41. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  42. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  43. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -2
  44. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js.map +1 -1
  45. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  46. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  47. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  48. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  49. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  50. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  51. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  52. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  53. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  59. package/dist-esm/applicationinsights-core-js.js +2 -2
  60. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  61. package/package.json +70 -70
  62. package/src/JavaScriptSDK/AppInsightsCore.ts +27 -6
  63. package/src/JavaScriptSDK/BaseCore.ts +3 -3
  64. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +4 -4
  65. package/src/JavaScriptSDK/ChannelController.ts +3 -3
  66. package/src/JavaScriptSDK/CookieMgr.ts +6 -6
  67. package/src/JavaScriptSDK/CoreUtils.ts +20 -20
  68. package/src/JavaScriptSDK/DiagnosticLogger.ts +1 -2
  69. package/src/JavaScriptSDK/EnvUtils.ts +115 -21
  70. package/src/JavaScriptSDK/HelperFuncs.ts +41 -29
  71. package/src/JavaScriptSDK/InstrumentHooks.ts +1 -1
  72. package/src/JavaScriptSDK/NotificationManager.ts +1 -1
  73. package/src/JavaScriptSDK/PerfManager.ts +8 -8
  74. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +1 -1
  75. package/src/JavaScriptSDK/RandomHelper.ts +1 -1
  76. package/src/JavaScriptSDK/TelemetryHelpers.ts +4 -4
  77. package/src/JavaScriptSDK/TelemetryPluginChain.ts +4 -3
  78. package/src/JavaScriptSDK.Enums/EventsDiscardedReason.ts +1 -1
  79. package/src/JavaScriptSDK.Enums/SendRequestReason.ts +1 -1
  80. package/src/JavaScriptSDK.Interfaces/IAppInsightsCore.ts +3 -1
  81. package/src/JavaScriptSDK.Interfaces/IChannelControls.ts +2 -2
  82. package/src/JavaScriptSDK.Interfaces/IConfiguration.ts +6 -6
  83. package/src/JavaScriptSDK.Interfaces/ICookieMgr.ts +1 -1
  84. package/src/JavaScriptSDK.Interfaces/IInstrumentHooks.ts +2 -2
  85. package/src/JavaScriptSDK.Interfaces/INotificationListener.ts +1 -1
  86. package/src/JavaScriptSDK.Interfaces/INotificationManager.ts +1 -1
  87. package/src/JavaScriptSDK.Interfaces/IPerfEvent.ts +1 -1
  88. package/src/JavaScriptSDK.Interfaces/IPerfManager.ts +2 -2
  89. package/src/JavaScriptSDK.Interfaces/IProcessTelemetryContext.ts +1 -1
  90. package/src/JavaScriptSDK.Interfaces/ITelemetryItem.ts +1 -1
  91. package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +4 -4
  92. package/src/JavaScriptSDK.Interfaces/ITelemetryPluginChain.ts +1 -1
  93. package/types/JavaScriptSDK/AppInsightsCore.d.ts +4 -0
  94. package/types/JavaScriptSDK/EnvUtils.d.ts +17 -0
  95. package/types/JavaScriptSDK.Interfaces/IAppInsightsCore.d.ts +1 -0
  96. package/types/applicationinsights-core-js.d.ts +1 -1
  97. package/types/tsdoc-metadata.json +1 -1
@@ -33,7 +33,7 @@ export interface INotificationListener {
33
33
  /**
34
34
  * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
35
35
  * the event can be displayed via the debug plugin extension.
36
- * @param perfEvent
36
+ * @param perfEvent
37
37
  */
38
38
  perfEvent?: (perfEvent: IPerfEvent) => void;
39
39
  }
@@ -46,7 +46,7 @@ export interface INotificationManager {
46
46
  /**
47
47
  * [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
48
48
  * the event can be displayed via the debug plugin extension.
49
- * @param perfEvent
49
+ * @param perfEvent
50
50
  */
51
51
  perfEvent?(perfEvent: IPerfEvent): void;
52
52
  }
@@ -28,7 +28,7 @@ export interface IPerfEvent {
28
28
  isAsync: boolean;
29
29
 
30
30
  /**
31
- * Identifies the total inclusive time spent for this event, including the time spent for child events,
31
+ * Identifies the total inclusive time spent for this event, including the time spent for child events,
32
32
  * this will be undefined until the event is completed
33
33
  */
34
34
  time?: number;
@@ -25,9 +25,9 @@ export interface IPerfManagerProvider {
25
25
  */
26
26
  export interface IPerfManager {
27
27
  /**
28
- * Create a new event and start timing, the manager may return null/undefined to indicate that it does not
28
+ * Create a new event and start timing, the manager may return null/undefined to indicate that it does not
29
29
  * want to monitor this source event.
30
- * @param src The source name of the event
30
+ * @param src The source name of the event
31
31
  * @param payloadDetails - An optional callback function to fetch the payload details for the event.
32
32
  * @param isAsync - Is the event occurring from a async event
33
33
  */
@@ -69,7 +69,7 @@ export interface IProcessTelemetryContext {
69
69
  * Create a new context using the core and config from the current instance
70
70
  * @param plugins - The execution order to process the plugins, if null or not supplied
71
71
  * then the current execution order will be copied.
72
- * @param startAt - The plugin to start processing from, if missing from the execution
72
+ * @param startAt - The plugin to start processing from, if missing from the execution
73
73
  * order then the next plugin will be NOT set.
74
74
  */
75
75
  createNew: (plugins?:IPlugin[]|ITelemetryPluginChain, startAt?:IPlugin) => IProcessTelemetryContext;
@@ -34,7 +34,7 @@ export interface ITelemetryItem {
34
34
  /**
35
35
  * System context property extensions that are not global (not in ctx)
36
36
  */
37
- tags?: Tags & Tags[]; // Tags[] will be deprecated.
37
+ tags?: Tags & Tags[]; // Tags[] will be deprecated.
38
38
 
39
39
  /**
40
40
  * Custom data
@@ -15,15 +15,15 @@ export interface ITelemetryPlugin extends IPlugin {
15
15
  /**
16
16
  * Call back for telemetry processing before it it is sent
17
17
  * @param env - This is the current event being reported
18
- * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
18
+ * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
19
19
  * can optionally use this to access the current core instance or define / pass additional information
20
20
  * to later plugins (vs appending items to the telemetry item)
21
21
  */
22
22
  processTelemetry: (env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) => void;
23
23
 
24
24
  /**
25
- * Set next extension for telemetry processing, this is not optional as plugins should use the
26
- * processNext() function of the passed IProcessTelemetryContext instead. It is being kept for
25
+ * Set next extension for telemetry processing, this is not optional as plugins should use the
26
+ * processNext() function of the passed IProcessTelemetryContext instead. It is being kept for
27
27
  * now for backward compatibility only.
28
28
  */
29
29
  setNextPlugin?: (next: ITelemetryPlugin | ITelemetryPluginChain) => void;
@@ -40,7 +40,7 @@ export interface IPlugin {
40
40
  * @param config - The config for the plugin to use
41
41
  * @param core - The current App Insights core to use for initializing this plugin instance
42
42
  * @param extensions - The complete set of extensions to be used for initializing the plugin
43
- * @param pluginChain - [Optional] specifies the current plugin chain which identifies the
43
+ * @param pluginChain - [Optional] specifies the current plugin chain which identifies the
44
44
  * set of plugins and the order they should be executed for the current request.
45
45
  */
46
46
  initialize: (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain) => void;
@@ -24,7 +24,7 @@ export interface ITelemetryPluginChain {
24
24
  /**
25
25
  * Call back for telemetry processing before it it is sent
26
26
  * @param env - This is the current event being reported
27
- * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
27
+ * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances
28
28
  * can optionally use this to access the current core instance or define / pass additional information
29
29
  * to later plugins (vs appending items to the telemetry item)
30
30
  */
@@ -26,4 +26,8 @@ export declare class AppInsightsCore extends BaseCore implements IAppInsightsCor
26
26
  * Periodically check logger.queue for
27
27
  */
28
28
  pollInternalLogs(eventName?: string): number;
29
+ /**
30
+ * Periodically check logger.queue for
31
+ */
32
+ stopPollingInternalLogs(): void;
29
33
  }
@@ -123,3 +123,20 @@ export declare function getIEVersion(userAgentStr?: string): number;
123
123
  */
124
124
  export declare function dumpObj(object: any): string;
125
125
  export declare function isSafari(userAgentStr?: string): boolean;
126
+ /**
127
+ * Checks if HTML5 Beacons are supported in the current environment.
128
+ * @returns True if supported, false otherwise.
129
+ */
130
+ export declare function isBeaconsSupported(): boolean;
131
+ /**
132
+ * Checks if the Fetch API is supported in the current environment.
133
+ * @param withKeepAlive - [Optional] If True, check if fetch is available and it supports the keepalive feature, otherwise only check if fetch is supported
134
+ * @returns True if supported, otherwise false
135
+ */
136
+ export declare function isFetchSupported(withKeepAlive?: boolean): boolean;
137
+ export declare function useXDomainRequest(): boolean | undefined;
138
+ /**
139
+ * Checks if XMLHttpRequest is supported
140
+ * @returns True if supported, otherwise false
141
+ */
142
+ export declare function isXhrSupported(): boolean;
@@ -44,6 +44,7 @@ export interface IAppInsightsCore extends IPerfManagerProvider {
44
44
  */
45
45
  removeNotificationListener?(listener: INotificationListener): void;
46
46
  pollInternalLogs?(eventName?: string): number;
47
+ stopPollingInternalLogs?(): void;
47
48
  /**
48
49
  * Return a new instance of the IProcessTelemetryContext for processing events
49
50
  */
@@ -16,7 +16,7 @@ export { BaseTelemetryPlugin } from './JavaScriptSDK/BaseTelemetryPlugin';
16
16
  export { randomValue, random32, mwcRandomSeed, mwcRandom32 } from './JavaScriptSDK/RandomHelper';
17
17
  export { CoreUtils, ICoreUtils, EventHelper, IEventHelper, Undefined, addEventHandler, newGuid, perfNow, newId, generateW3CId, disableCookies, canUseCookies, getCookie, setCookie, deleteCookie, _legacyCookieMgr } from "./JavaScriptSDK/CoreUtils";
18
18
  export { isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strEndsWith, strStartsWith, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, strTrim, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, strContains, isSymbol, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objFreeze, objSeal } from './JavaScriptSDK/HelperFuncs';
19
- export { getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, isSafari, setEnableEnvMocks } from "./JavaScriptSDK/EnvUtils";
19
+ export { getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, isSafari, setEnableEnvMocks, isBeaconsSupported, isFetchSupported, useXDomainRequest, isXhrSupported } from "./JavaScriptSDK/EnvUtils";
20
20
  export { getGlobal, objCreateFn as objCreate, strShimPrototype as strPrototype, strShimFunction as strFunction, strShimUndefined as strUndefined, strShimObject as strObject } from '@microsoft/applicationinsights-shims';
21
21
  export { NotificationManager } from "./JavaScriptSDK/NotificationManager";
22
22
  export { INotificationManager } from "./JavaScriptSDK.Interfaces/INotificationManager";
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.18.5"
8
+ "packageVersion": "7.18.11"
9
9
  }
10
10
  ]
11
11
  }