@microsoft/applicationinsights-core-js 3.0.0-beta.2303-06 → 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 (96) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +115 -98
  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 +170 -4
  7. package/dist/applicationinsights-core-js.api.md +10 -2
  8. package/dist/applicationinsights-core-js.d.ts +54 -3
  9. package/dist/applicationinsights-core-js.js +115 -98
  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 +54 -3
  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 +13 -13
  17. package/dist-esm/Config/DynamicConfig.js.map +1 -1
  18. package/dist-esm/Config/DynamicProperty.js +14 -19
  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 +42 -34
  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 +8 -28
  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 +1 -1
  40. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  41. package/dist-esm/JavaScriptSDK/EventHelpers.js +1 -1
  42. package/dist-esm/JavaScriptSDK/HelperFuncs.js +10 -12
  43. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +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 +11 -9
  48. package/dist-esm/JavaScriptSDK/PerfManager.js.map +1 -1
  49. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  50. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  51. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  52. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +1 -1
  53. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +1 -1
  54. package/dist-esm/JavaScriptSDK/UnloadHookContainer.js +1 -1
  55. package/dist-esm/JavaScriptSDK/W3cTraceParent.js +1 -1
  56. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +1 -1
  57. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  58. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  59. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  60. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControlsHost.js +8 -0
  65. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControlsHost.js.map +1 -0
  66. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  69. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  70. package/dist-esm/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  71. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  72. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  73. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  75. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  76. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  77. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  78. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  79. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  80. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  81. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  82. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  83. package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  84. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadHook.js +1 -1
  85. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  86. package/dist-esm/__DynamicConstants.js +4 -6
  87. package/dist-esm/__DynamicConstants.js.map +1 -1
  88. package/dist-esm/applicationinsights-core-js.js +2 -2
  89. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  90. package/package.json +1 -1
  91. package/types/Config/DynamicProperty.d.ts +1 -1
  92. package/types/Config/DynamicSupport.d.ts +67 -0
  93. package/types/JavaScriptSDK.Interfaces/IChannelControlsHost.d.ts +9 -0
  94. package/types/JavaScriptSDK.Interfaces/IConfiguration.d.ts +2 -2
  95. package/types/__DynamicConstants.d.ts +0 -2
  96. package/types/applicationinsights-core-js.d.ts +2 -1
@@ -6000,6 +6000,64 @@
6000
6000
  }
6001
6001
  ]
6002
6002
  },
6003
+ {
6004
+ "kind": "Function",
6005
+ "canonicalReference": "@microsoft/applicationinsights-core-js!blockDynamicConversion:function(1)",
6006
+ "docComment": "/**\n * Mark the provided value so that if it's included into the configuration it will NOT have its properties converted into a dynamic (reactive) object. If the object is not a plain object or an array (ie. a class) this function has not affect as only Objects and Arrays are converted into dynamic objects in the dynamic configuration.\n *\n * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.\n *\n * You should only need to use this function, if you are creating dynamic \"classes\" from objects which confirm to the require interface. A common case for this is during unit testing where it's easier to create mock extensions.\n *\n * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and if there is an exception adding the property to the value (because its frozen etc) the exception will be swallowed\n *\n * @param value - The object that you want to block from being converted into a trackable dynamic object\n *\n * @returns The original value\n *\n * @example\n * ```ts\n * // This is a valid \"extension\", but it is technically an object\n * // So when included in the config.extensions it WILL be cloned and then\n * // converted into a dynamic object, where all of its properties will become\n * // get/set object properties and will be tracked. While this WILL still\n * // function, when attempt to use a mocking framework on top of this the\n * // functions are now technically get accessors which return a function\n * // and this can cause some mocking frameworks to fail.\n * let mockChannel = {\n * pause: () => { },\n * resume: () => { },\n * teardown: () => { },\n * flush: (async: any, callBack: any) => { },\n * processTelemetry: (env: any) => { },\n * setNextPlugin: (next: any) => { },\n * initialize: (config: any, core: any, extensions: any) => { },\n * identifier: \"testChannel\",\n * priority: 1003\n * };\n * ```\n *\n */\n",
6007
+ "excerptTokens": [
6008
+ {
6009
+ "kind": "Content",
6010
+ "text": "export declare function blockDynamicConversion<T>(value: "
6011
+ },
6012
+ {
6013
+ "kind": "Content",
6014
+ "text": "T"
6015
+ },
6016
+ {
6017
+ "kind": "Content",
6018
+ "text": "): "
6019
+ },
6020
+ {
6021
+ "kind": "Content",
6022
+ "text": "T"
6023
+ },
6024
+ {
6025
+ "kind": "Content",
6026
+ "text": ";"
6027
+ }
6028
+ ],
6029
+ "fileUrlPath": "types/Config/DynamicSupport.d.ts",
6030
+ "returnTypeTokenRange": {
6031
+ "startIndex": 3,
6032
+ "endIndex": 4
6033
+ },
6034
+ "releaseTag": "Public",
6035
+ "overloadIndex": 1,
6036
+ "parameters": [
6037
+ {
6038
+ "parameterName": "value",
6039
+ "parameterTypeTokenRange": {
6040
+ "startIndex": 1,
6041
+ "endIndex": 2
6042
+ },
6043
+ "isOptional": false
6044
+ }
6045
+ ],
6046
+ "typeParameters": [
6047
+ {
6048
+ "typeParameterName": "T",
6049
+ "constraintTokenRange": {
6050
+ "startIndex": 0,
6051
+ "endIndex": 0
6052
+ },
6053
+ "defaultTypeTokenRange": {
6054
+ "startIndex": 0,
6055
+ "endIndex": 0
6056
+ }
6057
+ }
6058
+ ],
6059
+ "name": "blockDynamicConversion"
6060
+ },
6003
6061
  {
6004
6062
  "kind": "Function",
6005
6063
  "canonicalReference": "@microsoft/applicationinsights-core-js!cfgDfBoolean:function(1)",
@@ -11613,6 +11671,114 @@
11613
11671
  }
11614
11672
  ]
11615
11673
  },
11674
+ {
11675
+ "kind": "Interface",
11676
+ "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControlsHost:interface",
11677
+ "docComment": "",
11678
+ "excerptTokens": [
11679
+ {
11680
+ "kind": "Content",
11681
+ "text": "export interface IChannelControlsHost extends "
11682
+ },
11683
+ {
11684
+ "kind": "Reference",
11685
+ "text": "IChannelControls",
11686
+ "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControls:interface"
11687
+ },
11688
+ {
11689
+ "kind": "Content",
11690
+ "text": " "
11691
+ }
11692
+ ],
11693
+ "fileUrlPath": "types/JavaScriptSDK.Interfaces/IChannelControlsHost.d.ts",
11694
+ "releaseTag": "Public",
11695
+ "name": "IChannelControlsHost",
11696
+ "preserveMemberOrder": false,
11697
+ "members": [
11698
+ {
11699
+ "kind": "MethodSignature",
11700
+ "canonicalReference": "@microsoft/applicationinsights-core-js!IChannelControlsHost#getChannel:member(1)",
11701
+ "docComment": "/**\n * Get and return the named channel instance (if present) from the queues\n *\n * @param pluginIdentifier - The identifier name of the plugin\n */\n",
11702
+ "excerptTokens": [
11703
+ {
11704
+ "kind": "Content",
11705
+ "text": "getChannel<T extends "
11706
+ },
11707
+ {
11708
+ "kind": "Reference",
11709
+ "text": "IPlugin",
11710
+ "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface"
11711
+ },
11712
+ {
11713
+ "kind": "Content",
11714
+ "text": " = "
11715
+ },
11716
+ {
11717
+ "kind": "Reference",
11718
+ "text": "IPlugin",
11719
+ "canonicalReference": "@microsoft/applicationinsights-core-js!IPlugin:interface"
11720
+ },
11721
+ {
11722
+ "kind": "Content",
11723
+ "text": ">(pluginIdentifier: "
11724
+ },
11725
+ {
11726
+ "kind": "Content",
11727
+ "text": "string"
11728
+ },
11729
+ {
11730
+ "kind": "Content",
11731
+ "text": "): "
11732
+ },
11733
+ {
11734
+ "kind": "Content",
11735
+ "text": "T"
11736
+ },
11737
+ {
11738
+ "kind": "Content",
11739
+ "text": ";"
11740
+ }
11741
+ ],
11742
+ "isOptional": false,
11743
+ "returnTypeTokenRange": {
11744
+ "startIndex": 7,
11745
+ "endIndex": 8
11746
+ },
11747
+ "releaseTag": "Public",
11748
+ "overloadIndex": 1,
11749
+ "parameters": [
11750
+ {
11751
+ "parameterName": "pluginIdentifier",
11752
+ "parameterTypeTokenRange": {
11753
+ "startIndex": 5,
11754
+ "endIndex": 6
11755
+ },
11756
+ "isOptional": false
11757
+ }
11758
+ ],
11759
+ "typeParameters": [
11760
+ {
11761
+ "typeParameterName": "T",
11762
+ "constraintTokenRange": {
11763
+ "startIndex": 1,
11764
+ "endIndex": 2
11765
+ },
11766
+ "defaultTypeTokenRange": {
11767
+ "startIndex": 3,
11768
+ "endIndex": 4
11769
+ }
11770
+ }
11771
+ ],
11772
+ "name": "getChannel"
11773
+ }
11774
+ ],
11775
+ "extendsTokenRanges": [
11776
+ {
11777
+ "startIndex": 1,
11778
+ "endIndex": 2
11779
+ }
11780
+ ]
11781
+ },
11616
11782
  {
11617
11783
  "kind": "TypeAlias",
11618
11784
  "canonicalReference": "@microsoft/applicationinsights-core-js!IConfigCheckFn:type",
@@ -12098,7 +12264,7 @@
12098
12264
  "excerptTokens": [
12099
12265
  {
12100
12266
  "kind": "Content",
12101
- "text": "channels?: "
12267
+ "text": "readonly channels?: "
12102
12268
  },
12103
12269
  {
12104
12270
  "kind": "Reference",
@@ -12114,7 +12280,7 @@
12114
12280
  "text": ";"
12115
12281
  }
12116
12282
  ],
12117
- "isReadonly": false,
12283
+ "isReadonly": true,
12118
12284
  "isOptional": true,
12119
12285
  "releaseTag": "Public",
12120
12286
  "name": "channels",
@@ -12586,7 +12752,7 @@
12586
12752
  "excerptTokens": [
12587
12753
  {
12588
12754
  "kind": "Content",
12589
- "text": "extensions?: "
12755
+ "text": "readonly extensions?: "
12590
12756
  },
12591
12757
  {
12592
12758
  "kind": "Reference",
@@ -12602,7 +12768,7 @@
12602
12768
  "text": ";"
12603
12769
  }
12604
12770
  ],
12605
- "isReadonly": false,
12771
+ "isReadonly": true,
12606
12772
  "isOptional": true,
12607
12773
  "releaseTag": "Public",
12608
12774
  "name": "extensions",
@@ -171,6 +171,9 @@ export abstract class BaseTelemetryPlugin implements ITelemetryPlugin {
171
171
  version?: string;
172
172
  }
173
173
 
174
+ // @public
175
+ export function blockDynamicConversion<T>(value: T): T;
176
+
174
177
  // @public
175
178
  export function cfgDfBoolean<T, C = IConfiguration>(defaultValue?: boolean, fallBackName?: keyof T | keyof C | Array<keyof T | keyof C>): IConfigDefaultCheck<T, boolean, C>;
176
179
 
@@ -602,6 +605,11 @@ export interface IChannelControls extends ITelemetryPlugin {
602
605
  teardown?: (unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState) => void | boolean;
603
606
  }
604
607
 
608
+ // @public (undocumented)
609
+ export interface IChannelControlsHost extends IChannelControls {
610
+ getChannel<T extends IPlugin = IPlugin>(pluginIdentifier: string): T;
611
+ }
612
+
605
613
  // @public
606
614
  export type IConfigCheckFn<V> = (value: V) => boolean;
607
615
 
@@ -627,7 +635,7 @@ export type IConfigSetFn<T, V> = (value: any, defValue: V, theConfig: T) => V;
627
635
 
628
636
  // @public
629
637
  export interface IConfiguration {
630
- channels?: IChannelControls[][];
638
+ readonly channels?: IChannelControls[][];
631
639
  connectionString?: string;
632
640
  cookieCfg?: ICookieMgrConfig;
633
641
  cookieDomain?: string;
@@ -646,7 +654,7 @@ export interface IConfiguration {
646
654
  extensionConfig?: {
647
655
  [key: string]: any;
648
656
  };
649
- extensions?: ITelemetryPlugin[];
657
+ readonly extensions?: ITelemetryPlugin[];
650
658
  idLength?: number;
651
659
  instrumentationKey?: string;
652
660
  loggingLevelConsole?: number;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights Core Javascript SDK, 3.0.0-beta.2303-06
2
+ * Microsoft Application Insights Core Javascript SDK, 3.0.0-beta.2303-10
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -389,6 +389,49 @@ declare namespace ApplicationInsights {
389
389
  protected _addHook(hooks: IUnloadHook | IUnloadHook[] | Iterator<IUnloadHook> | ILegacyUnloadHook | ILegacyUnloadHook[] | Iterator<ILegacyUnloadHook>): void;
390
390
  }
391
391
 
392
+ /**
393
+ * Mark the provided value so that if it's included into the configuration it will NOT have
394
+ * its properties converted into a dynamic (reactive) object. If the object is not a plain object
395
+ * or an array (ie. a class) this function has not affect as only Objects and Arrays are converted
396
+ * into dynamic objects in the dynamic configuration.
397
+ *
398
+ * When you have tagged a value as both {@link forceDynamicConversion} and blocked force will take precedence.
399
+ *
400
+ * You should only need to use this function, if you are creating dynamic "classes" from objects
401
+ * which confirm to the require interface. A common case for this is during unit testing where it's
402
+ * easier to create mock extensions.
403
+ *
404
+ * If `value` is falsy (null / undefined / 0 / empty string etc) it will not be tagged and
405
+ * if there is an exception adding the property to the value (because its frozen etc) the
406
+ * exception will be swallowed
407
+ *
408
+ * @example
409
+ * ```ts
410
+ * // This is a valid "extension", but it is technically an object
411
+ * // So when included in the config.extensions it WILL be cloned and then
412
+ * // converted into a dynamic object, where all of its properties will become
413
+ * // get/set object properties and will be tracked. While this WILL still
414
+ * // function, when attempt to use a mocking framework on top of this the
415
+ * // functions are now technically get accessors which return a function
416
+ * // and this can cause some mocking frameworks to fail.
417
+ * let mockChannel = {
418
+ * pause: () => { },
419
+ * resume: () => { },
420
+ * teardown: () => { },
421
+ * flush: (async: any, callBack: any) => { },
422
+ * processTelemetry: (env: any) => { },
423
+ * setNextPlugin: (next: any) => { },
424
+ * initialize: (config: any, core: any, extensions: any) => { },
425
+ * identifier: "testChannel",
426
+ * priority: 1003
427
+ * };
428
+ * ```
429
+ * @param value - The object that you want to block from being converted into a
430
+ * trackable dynamic object
431
+ * @returns The original value
432
+ */
433
+ function blockDynamicConversion<T>(value: T): T;
434
+
392
435
  /**
393
436
  * Helper which returns an IConfigDefaultCheck instance that will validate and convert the user
394
437
  * provided value to a boolean from a string or boolean value
@@ -1128,6 +1171,14 @@ declare namespace ApplicationInsights {
1128
1171
  flush?(async: boolean, callBack?: (flushComplete?: boolean) => void, sendReason?: SendRequestReason): boolean | void;
1129
1172
  }
1130
1173
 
1174
+ interface IChannelControlsHost extends IChannelControls {
1175
+ /**
1176
+ * Get and return the named channel instance (if present) from the queues
1177
+ * @param pluginIdentifier - The identifier name of the plugin
1178
+ */
1179
+ getChannel<T extends IPlugin = IPlugin>(pluginIdentifier: string): T;
1180
+ }
1181
+
1131
1182
  /**
1132
1183
  * The type to identify whether the default value should be applied in preference to the provided value.
1133
1184
  */
@@ -1255,12 +1306,12 @@ declare namespace ApplicationInsights {
1255
1306
  /**
1256
1307
  * Additional plugins that should be loaded by core at runtime
1257
1308
  */
1258
- extensions?: ITelemetryPlugin[];
1309
+ readonly extensions?: ITelemetryPlugin[];
1259
1310
  /**
1260
1311
  * Channel queues that is setup by caller in desired order.
1261
1312
  * If channels are provided here, core will ignore any channels that are already setup, example if there is a SKU with an initialized channel
1262
1313
  */
1263
- channels?: IChannelControls[][];
1314
+ readonly channels?: IChannelControls[][];
1264
1315
  /**
1265
1316
  * @type {boolean}
1266
1317
  * Flag that disables the Instrumentation Key validation.