@microsoft/applicationinsights-core-js 2.8.0-beta.2203-07 → 2.8.0-beta.2203-10

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 (76) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +17 -6
  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.d.ts +1 -1
  7. package/dist/applicationinsights-core-js.js +17 -6
  8. package/dist/applicationinsights-core-js.js.map +1 -1
  9. package/dist/applicationinsights-core-js.min.js +2 -2
  10. package/dist/applicationinsights-core-js.min.js.map +1 -1
  11. package/dist/applicationinsights-core-js.rollup.d.ts +1 -1
  12. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
  13. package/dist-esm/JavaScriptSDK/BaseCore.js +1 -1
  14. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  15. package/dist-esm/JavaScriptSDK/ChannelController.js +4 -2
  16. package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
  17. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  18. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  19. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  20. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +1 -1
  21. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  22. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  23. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  24. package/dist-esm/JavaScriptSDK/EventHelpers.js +6 -2
  25. package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -1
  26. package/dist-esm/JavaScriptSDK/HelperFuncs.js +7 -7
  27. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  28. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  29. package/dist-esm/JavaScriptSDK/InternalConstants.js +1 -1
  30. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  31. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  32. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +4 -2
  33. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
  34. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  35. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  36. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  37. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  38. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  39. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  40. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  41. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  42. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  43. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  44. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  45. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  46. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  47. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  48. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  49. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  50. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  51. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  52. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  53. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.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/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  61. package/dist-esm/applicationinsights-core-js.js +1 -1
  62. package/package.json +1 -1
  63. package/src/JavaScriptSDK/BaseCore.ts +6 -6
  64. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +1 -1
  65. package/src/JavaScriptSDK/ChannelController.ts +3 -1
  66. package/src/JavaScriptSDK/CoreUtils.ts +1 -1
  67. package/src/JavaScriptSDK/DiagnosticLogger.ts +1 -1
  68. package/src/JavaScriptSDK/EnvUtils.ts +1 -1
  69. package/src/JavaScriptSDK/EventHelpers.ts +11 -5
  70. package/src/JavaScriptSDK/HelperFuncs.ts +23 -23
  71. package/src/JavaScriptSDK/PerfManager.ts +2 -5
  72. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +10 -8
  73. package/src/JavaScriptSDK/RandomHelper.ts +1 -1
  74. package/src/JavaScriptSDK.Enums/TelemetryUnloadReason.ts +1 -1
  75. package/src/JavaScriptSDK.Enums/TelemetryUpdateReason.ts +1 -1
  76. package/types/JavaScriptSDK/HelperFuncs.d.ts +3 -3
@@ -22,9 +22,9 @@ const strToString = "toString";
22
22
  * Constant string defined to support minimization
23
23
  * @ignore
24
24
  */
25
- const str__Proto = "__proto__";
25
+ const str__Proto = "__proto__";
26
26
 
27
- /**
27
+ /**
28
28
  * Constant string defined to support minimization
29
29
  * @ignore
30
30
  */
@@ -58,27 +58,27 @@ const rLeadingNumeric = /^(\d+[\w\d_$])/;
58
58
  * Pre-lookup to check if we are running on a modern browser (i.e. not IE8)
59
59
  * @ignore
60
60
  */
61
- let _objGetPrototypeOf = Object["getPrototypeOf"];
61
+ let _objGetPrototypeOf = Object["getPrototypeOf"];
62
62
 
63
- /**
63
+ /**
64
64
  * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.
65
65
  * @ignore
66
66
  */
67
- export function _getObjProto(target:any) {
68
- if (target) {
69
- // This method doesn't existing in older browsers (e.g. IE8)
70
- if (_objGetPrototypeOf) {
71
- return _objGetPrototypeOf(target);
72
- }
67
+ export function _getObjProto(target:any) {
68
+ if (target) {
69
+ // This method doesn't existing in older browsers (e.g. IE8)
70
+ if (_objGetPrototypeOf) {
71
+ return _objGetPrototypeOf(target);
72
+ }
73
73
 
74
- // target[Constructor] May break if the constructor has been changed or removed
75
- let newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
76
- if(newProto) {
77
- return newProto;
78
- }
79
- }
74
+ // target[Constructor] May break if the constructor has been changed or removed
75
+ let newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
76
+ if(newProto) {
77
+ return newProto;
78
+ }
79
+ }
80
80
 
81
- return null;
81
+ return null;
82
82
  }
83
83
 
84
84
  export function objToString(obj: any) {
@@ -186,7 +186,7 @@ export function strEndsWith(value: string, search: string) {
186
186
  * @param search - The characters to be searched for at the end of the value.
187
187
  * @returns true if the given search value is found at the end of the string, otherwise false.
188
188
  */
189
- export function _strEndsWithPoly(value: string, search: string) {
189
+ export function _strEndsWithPoly(value: string, search: string) {
190
190
  let result = false;
191
191
  let searchLen = search ? search.length : 0;
192
192
  let valLen = value ? value.length : 0;
@@ -214,7 +214,7 @@ export function strEndsWith(value: string, search: string) {
214
214
  export function strStartsWith(value: string, checkValue: string) {
215
215
  let result = false;
216
216
  if (value && checkValue && !(result = value === checkValue)) {
217
- // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification
217
+ // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification
218
218
  result = _strStartsWith ? value[cStrStartsWith](checkValue) : _strStartsWithPoly(value, checkValue);
219
219
  }
220
220
 
@@ -227,7 +227,7 @@ export function strStartsWith(value: string, checkValue: string) {
227
227
  * @param checkValue - The characters to be searched for at the start of the value.
228
228
  * @returns true if the given search value is found at the start of the string, otherwise false.
229
229
  */
230
- export function _strStartsWithPoly(value: string, checkValue: string) {
230
+ export function _strStartsWithPoly(value: string, checkValue: string) {
231
231
  // Using helper for performance and because string startsWith() is not available on IE
232
232
  let result = false;
233
233
  let chkLen = checkValue ? checkValue.length : 0;
@@ -328,7 +328,7 @@ export function isPlainObject(value: any): boolean {
328
328
  let result: boolean = false;
329
329
 
330
330
  if (value && typeof value === "object") {
331
- // Inlining _objGetPrototypeOf for performance to avoid an additional function call
331
+ // Inlining _objGetPrototypeOf for performance to avoid an additional function call
332
332
  let proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
333
333
  if (!proto) {
334
334
  // No prototype found so this is a plain Object eg. 'Object.create(null)'
@@ -796,7 +796,7 @@ export function proxyFunctionAs<T, S>(target: T, name: string, source: S | (() =
796
796
  * @param source - The source object which will be assigned / called by setting / calling the targets proxies
797
797
  * @param functionsToProxy - An array of function names that will be proxied on the target
798
798
  */
799
- export function proxyFunctions<T, S>(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget: boolean = true) {
799
+ export function proxyFunctions<T, S>(target: T, source: S | (() => S), functionsToProxy: (keyof S)[], overwriteTarget: boolean = true) {
800
800
  if (target && source && isObject(target) && isArray(functionsToProxy)) {
801
801
  arrForEach(functionsToProxy, (theFuncName) => {
802
802
  if (isString(theFuncName)) {
@@ -888,7 +888,7 @@ export function objExtend<T1, T2, T3, T4, T5, T6>(obj1?: T1 | any, obj2?: T2, ob
888
888
  idx++;
889
889
  }
890
890
 
891
- // Handle case when target is a string or something (possible in deep copy)
891
+ // Handle case when target is a string or something (possible in deep copy)
892
892
  if (!isObject(extended)) {
893
893
  extended = {} as T1 & T2 & T3 & T4 & T5 & T6;
894
894
  }
@@ -104,12 +104,9 @@ export class PerfEvent implements IPerfEvent {
104
104
  _self.isChildEvt = (): boolean => true;
105
105
  }
106
106
  _self[key] = value;
107
- }
108
- else if (key === PerfEvent.ChildrenContextKey) {
107
+ } else if (key === PerfEvent.ChildrenContextKey) {
109
108
  _self[key] = value;
110
- }
111
- else
112
- {
109
+ } else {
113
110
  let ctx = _self[strExecutionContextKey] = _self[strExecutionContextKey] || {};
114
111
  ctx[key] = value;
115
112
  }
@@ -78,7 +78,9 @@ function _createInternalContext<T extends IBaseProcessingContext>(telemetryChain
78
78
  let context: IInternalContext<T> = {
79
79
  _next: _moveNext,
80
80
  ctx: {
81
- core: () => { return core },
81
+ core: () => {
82
+ return core
83
+ },
82
84
  diagLog: () => {
83
85
  return safeGetLogger(core, config);
84
86
  },
@@ -274,7 +276,7 @@ export function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPl
274
276
  * @param core - The current core instance
275
277
  * @param startAt - Identifies the next plugin to execute, if null there is no "next" plugin and if undefined it should assume the start of the chain
276
278
  */
277
- export function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core:IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUpdateContext {
279
+ export function createProcessTelemetryUpdateContext(telemetryChain: ITelemetryPluginChain, config: IConfiguration, core:IAppInsightsCore, startAt?: IPlugin): IProcessTelemetryUpdateContext {
278
280
  let internalContext: IInternalContext<IProcessTelemetryUpdateContext> = _createInternalContext<IProcessTelemetryUpdateContext>(telemetryChain, config, core, startAt);
279
281
  let context = internalContext.ctx;
280
282
 
@@ -307,7 +309,7 @@ export function createProcessTelemetryUnloadContext(telemetryChain: ITelemetryPl
307
309
  * should be for legacy plugins only. Currently, only used for passing the current core instance and to provide better error
308
310
  * reporting (hasRun) when errors occur.
309
311
  */
310
- export function createTelemetryProxyChain(plugins: IPlugin[], config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): ITelemetryPluginChain {
312
+ export function createTelemetryProxyChain(plugins: IPlugin[], config: IConfiguration, core: IAppInsightsCore, startAt?: IPlugin): ITelemetryPluginChain {
311
313
  let firstProxy: ITelemetryPluginChain = null;
312
314
  let add = startAt ? false : true;
313
315
 
@@ -399,11 +401,11 @@ export function createTelemetryPluginProxy(plugin: ITelemetryPlugin, config: ICo
399
401
  }
400
402
 
401
403
  function _processChain<T extends IBaseProcessingContext>(
402
- itemCtx: T,
403
- processPluginFn: (itemCtx: T) => boolean,
404
- name: string,
405
- details: () => any,
406
- isAsync: boolean) {
404
+ itemCtx: T,
405
+ processPluginFn: (itemCtx: T) => boolean,
406
+ name: string,
407
+ details: () => any,
408
+ isAsync: boolean) {
407
409
 
408
410
  let hasRun = false;
409
411
  let identifier = plugin ? plugin.identifier : strTelemetryPluginChain;
@@ -122,7 +122,7 @@ export function mwcRandom32(signed?: boolean) {
122
122
  * The default length is 22 which is 132-bits so almost the same as a GUID but as base64 (the previous default was 5)
123
123
  * @param maxLength - Optional value to specify the length of the id to be generated, defaults to 22
124
124
  */
125
- export function newId(maxLength = 22): string {
125
+ export function newId(maxLength = 22): string {
126
126
  const base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
127
127
 
128
128
  // Start with an initial random number, consuming the value in reverse byte order
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * The TelemetryUnloadReason enumeration contains the possible reasons for why a plugin is being unloaded / torndown().
6
6
  */
7
- export const enum TelemetryUnloadReason {
7
+ export const enum TelemetryUnloadReason {
8
8
  /**
9
9
  * Teardown has been called without any context.
10
10
  */
@@ -4,7 +4,7 @@
4
4
  /**
5
5
  * The TelemetryUpdateReason enumeration contains a set of bit-wise values that specify the reason for update request.
6
6
  */
7
- export const enum TelemetryUpdateReason {
7
+ export const enum TelemetryUpdateReason {
8
8
  /**
9
9
  * Unknown.
10
10
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.
3
- * @ignore
4
- */
2
+ * Helper used to get the prototype of the target object as getPrototypeOf is not available in an ES3 environment.
3
+ * @ignore
4
+ */
5
5
  export declare function _getObjProto(target: any): any;
6
6
  export declare function objToString(obj: any): any;
7
7
  export declare function isTypeof(value: any, theType: string): boolean;