@microsoft/applicationinsights-core-js 2.8.0-nightly.2204-04 → 2.8.0-nightly.2204-05

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 (85) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +311 -276
  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 +674 -36
  7. package/dist/applicationinsights-core-js.api.md +46 -98
  8. package/dist/applicationinsights-core-js.d.ts +94 -116
  9. package/dist/applicationinsights-core-js.js +311 -276
  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 +94 -116
  14. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +2 -4
  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 +1 -1
  19. package/dist-esm/JavaScriptSDK/ChannelController.js +1 -1
  20. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  21. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  22. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  23. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +2 -2
  24. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  25. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  26. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +21 -1
  27. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
  28. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  29. package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
  30. package/dist-esm/JavaScriptSDK/HelperFuncs.js +12 -21
  31. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  32. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  33. package/dist-esm/JavaScriptSDK/InternalConstants.js +1 -1
  34. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  35. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  36. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  37. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  38. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  39. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  40. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  41. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +51 -0
  42. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js.map +1 -0
  43. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +10 -9
  44. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js.map +1 -1
  45. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +2 -2
  46. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js.map +1 -1
  47. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  48. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  49. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  50. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  51. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  52. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  53. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  69. package/dist-esm/applicationinsights-core-js.js +4 -3
  70. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  71. package/package.json +1 -1
  72. package/src/JavaScriptSDK/AppInsightsCore.ts +2 -4
  73. package/src/JavaScriptSDK/BaseCore.ts +2 -2
  74. package/src/JavaScriptSDK/DataCacheHelper.ts +1 -1
  75. package/src/JavaScriptSDK/DiagnosticLogger.ts +22 -0
  76. package/src/JavaScriptSDK/HelperFuncs.ts +13 -22
  77. package/src/JavaScriptSDK.Enums/EnumHelperFuncs.ts +56 -0
  78. package/src/JavaScriptSDK.Enums/EventsDiscardedReason.ts +48 -8
  79. package/src/JavaScriptSDK.Enums/LoggingEnums.ts +3 -4
  80. package/types/JavaScriptSDK/DiagnosticLogger.d.ts +13 -0
  81. package/types/JavaScriptSDK/HelperFuncs.d.ts +10 -6
  82. package/types/JavaScriptSDK.Enums/EnumHelperFuncs.d.ts +34 -0
  83. package/types/JavaScriptSDK.Enums/EventsDiscardedReason.d.ts +14 -9
  84. package/types/JavaScriptSDK.Enums/LoggingEnums.d.ts +2 -88
  85. package/types/applicationinsights-core-js.d.ts +4 -3
@@ -220,6 +220,15 @@ export declare function throwError(message: string): never;
220
220
  * @param chkSet - An optional callback to determine whether a specific property/function should be proxied
221
221
  */
222
222
  export declare function proxyAssign<T, S>(target: T, source: S, chkSet?: (name: string, isFunc?: boolean, source?: S, target?: T) => boolean): T;
223
+ /**
224
+ * Creates a proxy function on the target which internally will call the source version with all arguments passed to the target method.
225
+ *
226
+ * @param target - The target object to be assigned with the source properties and functions
227
+ * @param name - The function name that will be added on the target
228
+ * @param source - The source object which will be assigned / called by setting / calling the targets proxies
229
+ * @param theFunc - The function name on the source that will be proxied on the target
230
+ * @param overwriteTarget - If `false` this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name
231
+ */
223
232
  export declare function proxyFunctionAs<T, S>(target: T, name: string, source: S | (() => S), theFunc: (keyof S), overwriteTarget?: boolean): void;
224
233
  /**
225
234
  * Creates proxy functions on the target which internally will call the source version with all arguments passed to the target method.
@@ -227,6 +236,7 @@ export declare function proxyFunctionAs<T, S>(target: T, name: string, source: S
227
236
  * @param target - The target object to be assigned with the source properties and functions
228
237
  * @param source - The source object which will be assigned / called by setting / calling the targets proxies
229
238
  * @param functionsToProxy - An array of function names that will be proxied on the target
239
+ * @param overwriteTarget - If false this will not replace any pre-existing name otherwise (the default) it will overwrite any existing name
230
240
  */
231
241
  export declare function proxyFunctions<T, S>(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget?: boolean): T;
232
242
  /**
@@ -235,12 +245,6 @@ export declare function proxyFunctions<T, S>(target: T, source: S | (() => S), f
235
245
  * @param defaults Simple helper
236
246
  */
237
247
  export declare function createClassFromInterface<T>(defaults?: T): new () => T;
238
- /**
239
- * Create an enum style object which has both the key => value and value => key mappings
240
- * @param values - The values to populate on the new object
241
- * @returns
242
- */
243
- export declare function createEnumStyle<T>(values: T): T;
244
248
  /**
245
249
  * A helper function to assist with JIT performance for objects that have properties added / removed dynamically
246
250
  * this is primarily for chromium based browsers and has limited effects on Firefox and none of IE. Only call this
@@ -0,0 +1,34 @@
1
+ export declare type EnumValue<E = any> = {
2
+ readonly [key in keyof E]: E[key];
3
+ };
4
+ export declare type EnumMap<E = any, I = E> = {
5
+ readonly [key in keyof E extends string ? keyof E : never]: key extends string ? key : keyof E;
6
+ } & I;
7
+ /**
8
+ * Create an enum style object which has both the key => value and value => key mappings
9
+ * @param values - The values to populate on the new object
10
+ * @returns
11
+ */
12
+ export declare function createEnumStyle<E>(values: {
13
+ [key in keyof E]: E[keyof E];
14
+ }): EnumValue<E>;
15
+ /**
16
+ * Create a 2 index map that maps an enum's key as both the key and value, X["key"] => "key" and X[0] => "keyof 0".
17
+ * @param values - The values to populate on the new object
18
+ * @returns
19
+ */
20
+ export declare function createEnumMap<E, I = keyof E>(values: {
21
+ [key in keyof E]: E[keyof E];
22
+ }): EnumMap<E, I>;
23
+ /**
24
+ * Create a 2 index map that maps an enum's key and value to the defined map value, X["key"] => mapValue and X[0] => mapValue.
25
+ * Generic values
26
+ * - E = the const enum type (typeof eRequestHeaders);
27
+ * - V = Identifies the valid values for the keys, this should include both the enum numeric and string key of the type. The
28
+ * resulting "Value" of each entry identifies the valid values withing the assignments.
29
+ * @param values - The values to populate on the new object
30
+ * @returns
31
+ */
32
+ export declare function createValueMap<E, V = E>(values: {
33
+ [key in keyof E]: [eValue: E[keyof E], mapValue: V[keyof V]];
34
+ }): V;
@@ -1,29 +1,34 @@
1
1
  /**
2
- * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
2
+ * The eEventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
3
3
  */
4
- export declare const EventsDiscardedReason: {
4
+ export declare const enum eEventsDiscardedReason {
5
5
  /**
6
6
  * Unknown.
7
7
  */
8
- Unknown: number;
8
+ Unknown = 0,
9
9
  /**
10
10
  * Status set to non-retryable.
11
11
  */
12
- NonRetryableStatus: number;
12
+ NonRetryableStatus = 1,
13
13
  /**
14
14
  * The event is invalid.
15
15
  */
16
- InvalidEvent: number;
16
+ InvalidEvent = 2,
17
17
  /**
18
18
  * The size of the event is too large.
19
19
  */
20
- SizeLimitExceeded: number;
20
+ SizeLimitExceeded = 3,
21
21
  /**
22
22
  * The server is not accepting events from this instrumentation key.
23
23
  */
24
- KillSwitch: number;
24
+ KillSwitch = 4,
25
25
  /**
26
26
  * The event queue is full.
27
27
  */
28
- QueueFull: number;
29
- };
28
+ QueueFull = 5
29
+ }
30
+ /**
31
+ * The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
32
+ */
33
+ export declare const EventsDiscardedReason: import("../JavaScriptSDK.Enums/EnumHelperFuncs").EnumValue<typeof eEventsDiscardedReason>;
34
+ export declare type EventsDiscardedReason = number | eEventsDiscardedReason;
@@ -8,10 +8,7 @@ export declare const enum eLoggingSeverity {
8
8
  */
9
9
  WARNING = 2
10
10
  }
11
- export declare const LoggingSeverity: {
12
- CRITICAL: number;
13
- WARNING: number;
14
- };
11
+ export declare const LoggingSeverity: import("../JavaScriptSDK.Enums/EnumHelperFuncs").EnumValue<typeof eLoggingSeverity>;
15
12
  export declare type LoggingSeverity = number | eLoggingSeverity;
16
13
  export declare const enum _eInternalMessageId {
17
14
  BrowserDoesNotSupportLocalStorage = 0,
@@ -100,88 +97,5 @@ export declare const enum _eInternalMessageId {
100
97
  /**
101
98
  * Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered
102
99
  */
103
- export declare const _InternalMessageId: {
104
- BrowserDoesNotSupportLocalStorage: number;
105
- BrowserCannotReadLocalStorage: number;
106
- BrowserCannotReadSessionStorage: number;
107
- BrowserCannotWriteLocalStorage: number;
108
- BrowserCannotWriteSessionStorage: number;
109
- BrowserFailedRemovalFromLocalStorage: number;
110
- BrowserFailedRemovalFromSessionStorage: number;
111
- CannotSendEmptyTelemetry: number;
112
- ClientPerformanceMathError: number;
113
- ErrorParsingAISessionCookie: number;
114
- ErrorPVCalc: number;
115
- ExceptionWhileLoggingError: number;
116
- FailedAddingTelemetryToBuffer: number;
117
- FailedMonitorAjaxAbort: number;
118
- FailedMonitorAjaxDur: number;
119
- FailedMonitorAjaxOpen: number;
120
- FailedMonitorAjaxRSC: number;
121
- FailedMonitorAjaxSend: number;
122
- FailedMonitorAjaxGetCorrelationHeader: number;
123
- FailedToAddHandlerForOnBeforeUnload: number;
124
- FailedToSendQueuedTelemetry: number;
125
- FailedToReportDataLoss: number;
126
- FlushFailed: number;
127
- MessageLimitPerPVExceeded: number;
128
- MissingRequiredFieldSpecification: number;
129
- NavigationTimingNotSupported: number;
130
- OnError: number;
131
- SessionRenewalDateIsZero: number;
132
- SenderNotInitialized: number;
133
- StartTrackEventFailed: number;
134
- StopTrackEventFailed: number;
135
- StartTrackFailed: number;
136
- StopTrackFailed: number;
137
- TelemetrySampledAndNotSent: number;
138
- TrackEventFailed: number;
139
- TrackExceptionFailed: number;
140
- TrackMetricFailed: number;
141
- TrackPVFailed: number;
142
- TrackPVFailedCalc: number;
143
- TrackTraceFailed: number;
144
- TransmissionFailed: number;
145
- FailedToSetStorageBuffer: number;
146
- FailedToRestoreStorageBuffer: number;
147
- InvalidBackendResponse: number;
148
- FailedToFixDepricatedValues: number;
149
- InvalidDurationValue: number;
150
- TelemetryEnvelopeInvalid: number;
151
- CreateEnvelopeError: number;
152
- CannotSerializeObject: number;
153
- CannotSerializeObjectNonSerializable: number;
154
- CircularReferenceDetected: number;
155
- ClearAuthContextFailed: number;
156
- ExceptionTruncated: number;
157
- IllegalCharsInName: number;
158
- ItemNotInArray: number;
159
- MaxAjaxPerPVExceeded: number;
160
- MessageTruncated: number;
161
- NameTooLong: number;
162
- SampleRateOutOfRange: number;
163
- SetAuthContextFailed: number;
164
- SetAuthContextFailedAccountName: number;
165
- StringValueTooLong: number;
166
- StartCalledMoreThanOnce: number;
167
- StopCalledWithoutStart: number;
168
- TelemetryInitializerFailed: number;
169
- TrackArgumentsNotSpecified: number;
170
- UrlTooLong: number;
171
- SessionStorageBufferFull: number;
172
- CannotAccessCookie: number;
173
- IdTooLong: number;
174
- InvalidEvent: number;
175
- FailedMonitorAjaxSetRequestHeader: number;
176
- SendBrowserInfoOnUserInit: number;
177
- PluginException: number;
178
- NotificationException: number;
179
- SnippetScriptLoadFailure: number;
180
- InvalidInstrumentationKey: number;
181
- CannotParseAiBlobValue: number;
182
- InvalidContentBlob: number;
183
- TrackPageActionEventFailed: number;
184
- FailedAddingCustomDefinedRequestContext: number;
185
- InMemoryStorageBufferFull: number;
186
- };
100
+ export declare const _InternalMessageId: import("../JavaScriptSDK.Enums/EnumHelperFuncs").EnumValue<typeof _eInternalMessageId>;
187
101
  export declare type _InternalMessageId = number | _eInternalMessageId;
@@ -9,7 +9,7 @@ export { ITelemetryPluginChain } from "./JavaScriptSDK.Interfaces/ITelemetryPlug
9
9
  export { IDiagnosticLogger } from "./JavaScriptSDK.Interfaces/IDiagnosticLogger";
10
10
  export { InstrumentorHooksCallback, IInstrumentHooksCallbacks, IInstrumentHooks, IInstrumentHook, IInstrumentCallDetails } from "./JavaScriptSDK.Interfaces/IInstrumentHooks";
11
11
  export { IUnloadableComponent } from "./JavaScriptSDK.Interfaces/IUnloadableComponent";
12
- export { EventsDiscardedReason } from "./JavaScriptSDK.Enums/EventsDiscardedReason";
12
+ export { eEventsDiscardedReason, EventsDiscardedReason } from "./JavaScriptSDK.Enums/EventsDiscardedReason";
13
13
  export { SendRequestReason } from "./JavaScriptSDK.Enums/SendRequestReason";
14
14
  export { TelemetryUpdateReason } from "./JavaScriptSDK.Enums/TelemetryUpdateReason";
15
15
  export { TelemetryUnloadReason } from "./JavaScriptSDK.Enums/TelemetryUnloadReason";
@@ -18,7 +18,8 @@ export { BaseCore } from "./JavaScriptSDK/BaseCore";
18
18
  export { BaseTelemetryPlugin } from "./JavaScriptSDK/BaseTelemetryPlugin";
19
19
  export { randomValue, random32, mwcRandomSeed, mwcRandom32, newId } from "./JavaScriptSDK/RandomHelper";
20
20
  export { CoreUtils, ICoreUtils, EventHelper, IEventHelper, Undefined, newGuid, perfNow, generateW3CId, disableCookies, canUseCookies, getCookie, setCookie, deleteCookie, _legacyCookieMgr } from "./JavaScriptSDK/CoreUtils";
21
- export { isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, 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, proxyFunctions, proxyFunctionAs, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objFreeze, objSeal, createEnumStyle, objExtend, objToString } from "./JavaScriptSDK/HelperFuncs";
21
+ export { isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, 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, proxyFunctions, proxyFunctionAs, createClassFromInterface, optimizeObject, isNotUndefined, isNotNullOrUndefined, objFreeze, objSeal, objExtend, objToString } from "./JavaScriptSDK/HelperFuncs";
22
+ export { EnumValue, createEnumStyle, EnumMap, createEnumMap, createValueMap } from "./JavaScriptSDK.Enums/EnumHelperFuncs";
22
23
  export { attachEvent, detachEvent, addEventHandler, addEventListeners, addPageUnloadEventListener, addPageHideEventListener, addPageShowEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, _IRegisteredEvents, __getRegisteredEvents } from "./JavaScriptSDK/EventHelpers";
23
24
  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";
24
25
  export { getGlobal, objCreateFn as objCreate, strShimPrototype as strPrototype, strShimFunction as strFunction, strShimUndefined as strUndefined, strShimObject as strObject } from "@microsoft/applicationinsights-shims";
@@ -27,7 +28,7 @@ export { INotificationManager } from "./JavaScriptSDK.Interfaces/INotificationMa
27
28
  export { IPerfEvent } from "./JavaScriptSDK.Interfaces/IPerfEvent";
28
29
  export { IPerfManager, IPerfManagerProvider } from "./JavaScriptSDK.Interfaces/IPerfManager";
29
30
  export { PerfEvent, PerfManager, doPerf, getGblPerfMgr, setGblPerfMgr } from "./JavaScriptSDK/PerfManager";
30
- export { safeGetLogger, DiagnosticLogger, _InternalLogMessage, _throwInternal } from "./JavaScriptSDK/DiagnosticLogger";
31
+ export { safeGetLogger, DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole, _logInternalMessage } from "./JavaScriptSDK/DiagnosticLogger";
31
32
  export { ProcessTelemetryContext, createProcessTelemetryContext } from "./JavaScriptSDK/ProcessTelemetryContext";
32
33
  export { initializePlugins, sortPlugins, unloadComponents } from "./JavaScriptSDK/TelemetryHelpers";
33
34
  export { _InternalMessageId, _eInternalMessageId, LoggingSeverity, eLoggingSeverity } from "./JavaScriptSDK.Enums/LoggingEnums";