@microsoft/applicationinsights-core-js 3.0.0-beta.2303-09 → 3.0.0-beta.2303-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 (88) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +50 -24
  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 +58 -0
  7. package/dist/applicationinsights-core-js.api.md +3 -0
  8. package/dist/applicationinsights-core-js.d.ts +44 -1
  9. package/dist/applicationinsights-core-js.js +50 -24
  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 +44 -1
  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 +4 -4
  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 +1 -1
  30. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  31. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  32. package/dist-esm/JavaScriptSDK/CookieMgr.js +23 -19
  33. package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
  34. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  35. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +2 -2
  36. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  37. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  38. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  39. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  40. package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
  41. package/dist-esm/JavaScriptSDK/HelperFuncs.js +1 -1
  42. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  43. package/dist-esm/JavaScriptSDK/InternalConstants.js +1 -1
  44. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  45. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  46. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  47. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  48. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  49. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  50. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  51. package/dist-esm/JavaScriptSDK/UnloadHookContainer.js +1 -1
  52. package/dist-esm/JavaScriptSDK/W3cTraceParent.js +1 -1
  53. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
  54. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  55. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControlsHost.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  69. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  70. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  71. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  72. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  73. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  75. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  76. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  77. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  78. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  79. package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  80. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
  81. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  82. package/dist-esm/__DynamicConstants.js +1 -1
  83. package/dist-esm/applicationinsights-core-js.js +2 -2
  84. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  85. package/package.json +1 -1
  86. package/types/Config/DynamicProperty.d.ts +1 -1
  87. package/types/Config/DynamicSupport.d.ts +67 -0
  88. package/types/applicationinsights-core-js.d.ts +1 -1
@@ -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
@@ -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 } from "./Config/DynamicSupport";
58
58
  export { cfgDfValidate, cfgDfMerge, cfgDfBoolean, cfgDfFunc, cfgDfString, cfgDfSet } from "./Config/ConfigDefaultHelpers";