@microsoft/applicationinsights-core-js 3.0.0-beta.2303-09 → 3.0.0-beta.2303-11

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 (96) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +89 -47
  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 +119 -177
  7. package/dist/applicationinsights-core-js.api.md +7 -7
  8. package/dist/applicationinsights-core-js.d.ts +62 -30
  9. package/dist/applicationinsights-core-js.js +89 -47
  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 +62 -30
  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 +18 -7
  17. package/dist-esm/Config/DynamicConfig.js.map +1 -1
  18. package/dist-esm/Config/DynamicProperty.js +8 -10
  19. package/dist-esm/Config/DynamicProperty.js.map +1 -1
  20. package/dist-esm/Config/DynamicState.js +1 -1
  21. package/dist-esm/Config/DynamicSupport.js +114 -1
  22. package/dist-esm/Config/DynamicSupport.js.map +1 -1
  23. package/dist-esm/Config/IConfigDefaults.js +1 -1
  24. package/dist-esm/Config/IDynamicConfigHandler.js +1 -1
  25. package/dist-esm/Config/IDynamicPropertyHandler.js +1 -1
  26. package/dist-esm/Config/IDynamicWatcher.js +1 -1
  27. package/dist-esm/Config/_IDynamicConfigHandlerState.js +1 -1
  28. package/dist-esm/JavaScriptSDK/AggregationError.js +1 -1
  29. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +2 -2
  30. package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
  31. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  32. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  33. package/dist-esm/JavaScriptSDK/CookieMgr.js +23 -19
  34. package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
  35. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  36. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +2 -2
  37. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  38. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  39. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +11 -23
  40. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
  41. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  42. package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
  43. package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -1
  44. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  45. package/dist-esm/JavaScriptSDK/InternalConstants.js +1 -1
  46. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  47. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  48. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  49. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  50. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  51. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  52. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  53. package/dist-esm/JavaScriptSDK/UnloadHookContainer.js +1 -1
  54. package/dist-esm/JavaScriptSDK/W3cTraceParent.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControlsHost.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  69. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  70. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  71. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  72. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  73. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  75. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  76. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  77. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  78. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  79. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  80. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  81. package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  82. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
  83. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  84. package/dist-esm/__DynamicConstants.js +1 -2
  85. package/dist-esm/__DynamicConstants.js.map +1 -1
  86. package/dist-esm/applicationinsights-core-js.js +2 -2
  87. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  88. package/package.json +1 -1
  89. package/types/Config/DynamicProperty.d.ts +1 -1
  90. package/types/Config/DynamicSupport.d.ts +67 -0
  91. package/types/Config/IDynamicConfigHandler.d.ts +3 -1
  92. package/types/JavaScriptSDK/DiagnosticLogger.d.ts +0 -14
  93. package/types/JavaScriptSDK.Interfaces/IConfiguration.d.ts +1 -1
  94. package/types/JavaScriptSDK.Interfaces/IDiagnosticLogger.d.ts +0 -14
  95. package/types/__DynamicConstants.d.ts +0 -1
  96. package/types/applicationinsights-core-js.d.ts +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@microsoft/applicationinsights-core-js",
3
3
  "author": "Microsoft Application Insights Team",
4
- "version": "3.0.0-beta.2303-09",
4
+ "version": "3.0.0-beta.2303-11",
5
5
  "description": "Microsoft Application Insights Core Javascript SDK",
6
6
  "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
7
7
  "keywords": [
@@ -1,3 +1,3 @@
1
1
  import { _IDynamicConfigHandlerState } from "./_IDynamicConfigHandlerState";
2
- export declare function _setDynamicProperty<T, C, V = any>(state: _IDynamicConfigHandlerState<T>, target: C, name: string, value: V, inPlace?: boolean, rdOnly?: boolean): V;
2
+ export declare function _setDynamicProperty<T, C, V = any>(state: _IDynamicConfigHandlerState<T>, target: C, name: string, value: V, inPlace?: boolean, rdOnly?: boolean): C;
3
3
  export declare function _makeDynamicObject<T>(state: _IDynamicConfigHandlerState<T>, target: any): any;
@@ -8,6 +8,73 @@ export declare function _cfgDeepCopy<T>(source: T): T;
8
8
  * @returns
9
9
  */
10
10
  export declare function getDynamicConfigHandler<T>(value: T | IDynamicConfigHandler<T>): IDynamicConfigHandler<T> | null;
11
+ /**
12
+ * Mark the provided value so that if it's included into the configuration it will NOT have
13
+ * its properties converted into a dynamic (reactive) object. If the object is not a plain object
14
+ * or an array (ie. a class) this function has not affect as only Objects and Arrays are converted
15
+ * into dynamic objects in the dynamic configuration.
16
+ *
17
+ * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.
18
+ *
19
+ * You should only need to use this function, if you are creating dynamic "classes" from objects
20
+ * which confirm to the require interface. A common case for this is during unit testing where it's
21
+ * easier to create mock extensions.
22
+ *
23
+ * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and
24
+ * if there is an exception adding the property to the value (because its frozen etc) the
25
+ * exception will be swallowed
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // This is a valid "extension", but it is technically an object
30
+ * // So when included in the config.extensions it WILL be cloned and then
31
+ * // converted into a dynamic object, where all of its properties will become
32
+ * // get/set object properties and will be tracked. While this WILL still
33
+ * // function, when attempt to use a mocking framework on top of this the
34
+ * // functions are now technically get accessors which return a function
35
+ * // and this can cause some mocking frameworks to fail.
36
+ * let mockChannel = {
37
+ * pause: () => { },
38
+ * resume: () => { },
39
+ * teardown: () => { },
40
+ * flush: (async: any, callBack: any) => { },
41
+ * processTelemetry: (env: any) => { },
42
+ * setNextPlugin: (next: any) => { },
43
+ * initialize: (config: any, core: any, extensions: any) => { },
44
+ * identifier: "testChannel",
45
+ * priority: 1003
46
+ * };
47
+ * ```
48
+ * @param value - The object that you want to block from being converted into a
49
+ * trackable dynamic object
50
+ * @returns The original value
51
+ */
52
+ export declare function blockDynamicConversion<T>(value: T): T;
53
+ /**
54
+ * This is the reverse case of {@link blockDynamicConversion} in that this will tag an
55
+ * object to indicate that it should always be converted into a dynamic trackable object
56
+ * even when not an object or array. So all properties of this object will become
57
+ * get / set accessor functions.
58
+ *
59
+ * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.
60
+ *
61
+ * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and
62
+ * if there is an exception adding the property to the value (because its frozen etc) the
63
+ * exception will be swallowed.
64
+ * @param value - The object that should be tagged and converted if included into a dynamic
65
+ * configuration.
66
+ * @returns The original value
67
+ */
68
+ export declare function forceDynamicConversion<T>(value: T): T;
69
+ /**
70
+ * @internal
71
+ * @ignore
72
+ * Helper function to check whether an object can or should be converted into a dynamic
73
+ * object.
74
+ * @param value - The object to check whether it should be converted
75
+ * @returns `true` if the value should be converted otherwise `false`.
76
+ */
77
+ export declare function _canMakeDynamic<T>(value: any): boolean;
11
78
  /**
12
79
  * Throws an invalid access exception
13
80
  * @param message - The message to include in the exception
@@ -62,6 +62,8 @@ export interface _IInternalDynamicConfigHandler<T extends IConfiguration> extend
62
62
  /**
63
63
  * @ignore
64
64
  * Internal function to explicitly block watching for any config updates
65
+ * @param configHandler - The Callback function to call after blocking update listening
66
+ * @param allowUpdate - An optional flag to enable updating config properties marked as readonly
65
67
  */
66
- _block: (configHandler: WatcherFunction<T>) => void;
68
+ _block: (configHandler: WatcherFunction<T>, allowUpdate?: boolean) => void;
67
69
  }
@@ -17,26 +17,12 @@ export declare class DiagnosticLogger implements IDiagnosticLogger {
17
17
  */
18
18
  queue: _InternalLogMessage[];
19
19
  constructor(config?: IConfiguration);
20
- /**
21
- * When this is true the SDK will throw exceptions to aid in debugging.
22
- */
23
- enableDebugExceptions(): boolean;
24
20
  /**
25
21
  * 0: OFF (default)
26
22
  * 1: CRITICAL
27
23
  * 2: >= WARNING
28
24
  */
29
25
  consoleLoggingLevel(): number;
30
- /**
31
- * 0: OFF
32
- * 1: CRITICAL (default)
33
- * 2: >= WARNING
34
- */
35
- telemetryLoggingLevel(): number;
36
- /**
37
- * The maximum number of internal messages allowed to be sent per page view
38
- */
39
- maxInternalMessageLimit(): number;
40
26
  /**
41
27
  * This method will throw exceptions in debug mode or attempt to log the error as a console warning.
42
28
  * @param severity - {LoggingSeverity} - The severity of the log message
@@ -51,7 +51,7 @@ export interface IConfiguration {
51
51
  /**
52
52
  * If enabled, uncaught exceptions will be thrown to help with debugging
53
53
  */
54
- enableDebugExceptions?: boolean;
54
+ enableDebug?: boolean;
55
55
  /**
56
56
  * Endpoint where telemetry data is sent
57
57
  */
@@ -2,26 +2,12 @@ import { LoggingSeverity, _InternalMessageId } from "../JavaScriptSDK.Enums/Logg
2
2
  import { _InternalLogMessage } from "../JavaScriptSDK/DiagnosticLogger";
3
3
  import { ITelemetryUpdateState } from "./ITelemetryUpdateState";
4
4
  export interface IDiagnosticLogger {
5
- /**
6
- * When this is true the SDK will throw exceptions to aid in debugging.
7
- */
8
- enableDebugExceptions: () => boolean;
9
5
  /**
10
6
  * 0: OFF
11
7
  * 1: only critical (default)
12
8
  * 2: critical + info
13
9
  */
14
10
  consoleLoggingLevel: () => number;
15
- /**
16
- * 0: OFF (default)
17
- * 1: CRITICAL
18
- * 2: WARNING
19
- */
20
- telemetryLoggingLevel: () => number;
21
- /**
22
- * The maximum number of internal messages allowed to be sent per page view
23
- */
24
- maxInternalMessageLimit: () => number;
25
11
  /**
26
12
  * The internal logging queue
27
13
  */
@@ -40,7 +40,6 @@ export declare const _DYN_USER_AGENT = "userAgent";
40
40
  export declare const _DYN_SPLIT = "split";
41
41
  export declare const _DYN_NODE_TYPE = "nodeType";
42
42
  export declare const _DYN_REPLACE = "replace";
43
- export declare const _DYN_ENABLE_DEBUG_EXCEPTI5 = "enableDebugExceptions";
44
43
  export declare const _DYN_LOG_INTERNAL_MESSAGE = "logInternalMessage";
45
44
  export declare const _DYN_TYPE = "type";
46
45
  export declare const _DYN_HANDLER = "handler";
@@ -54,5 +54,5 @@ export { IDynamicConfigHandler } from "./Config/IDynamicConfigHandler";
54
54
  export { IDynamicPropertyHandler } from "./Config/IDynamicPropertyHandler";
55
55
  export { IWatchDetails, IWatcherHandler, WatcherFunction } from "./Config/IDynamicWatcher";
56
56
  export { createDynamicConfig, onConfigChange } from "./Config/DynamicConfig";
57
- export { getDynamicConfigHandler } from "./Config/DynamicSupport";
57
+ export { getDynamicConfigHandler, blockDynamicConversion, forceDynamicConversion } from "./Config/DynamicSupport";
58
58
  export { cfgDfValidate, cfgDfMerge, cfgDfBoolean, cfgDfFunc, cfgDfString, cfgDfSet } from "./Config/ConfigDefaultHelpers";