@microsoft/applicationinsights-common 3.0.0-beta.2210-19 → 3.0.0-beta.2211-01

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 (107) hide show
  1. package/browser/applicationinsights-common.integrity.json +9 -9
  2. package/browser/applicationinsights-common.js +399 -174
  3. package/browser/applicationinsights-common.js.map +1 -1
  4. package/browser/applicationinsights-common.min.js +2 -2
  5. package/browser/applicationinsights-common.min.js.map +1 -1
  6. package/dist/applicationinsights-common.api.json +2049 -1177
  7. package/dist/applicationinsights-common.api.md +65 -0
  8. package/dist/applicationinsights-common.d.ts +118 -1
  9. package/dist/applicationinsights-common.js +399 -174
  10. package/dist/applicationinsights-common.js.map +1 -1
  11. package/dist/applicationinsights-common.min.js +2 -2
  12. package/dist/applicationinsights-common.min.js.map +1 -1
  13. package/dist/applicationinsights-common.rollup.d.ts +118 -1
  14. package/dist-esm/ConnectionStringParser.js +1 -1
  15. package/dist-esm/Constants.js +1 -1
  16. package/dist-esm/DomHelperFuncs.js +1 -1
  17. package/dist-esm/Enums.js +1 -1
  18. package/dist-esm/HelperFuncs.js +1 -1
  19. package/dist-esm/Interfaces/ConnectionString.js +1 -1
  20. package/dist-esm/Interfaces/Context/IApplication.js +1 -1
  21. package/dist-esm/Interfaces/Context/IDevice.js +1 -1
  22. package/dist-esm/Interfaces/Context/IInternal.js +1 -1
  23. package/dist-esm/Interfaces/Context/ILocation.js +1 -1
  24. package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
  25. package/dist-esm/Interfaces/Context/ISample.js +1 -1
  26. package/dist-esm/Interfaces/Context/ISession.js +1 -1
  27. package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
  28. package/dist-esm/Interfaces/Context/IUser.js +1 -1
  29. package/dist-esm/Interfaces/Context/IWeb.js +1 -1
  30. package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
  31. package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
  32. package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
  33. package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
  34. package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
  35. package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
  36. package/dist-esm/Interfaces/Contracts/IData.js +1 -1
  37. package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
  38. package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
  39. package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
  40. package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
  41. package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
  42. package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
  43. package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
  44. package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
  45. package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
  46. package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
  47. package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
  48. package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
  49. package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
  50. package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
  51. package/dist-esm/Interfaces/IAppInsights.js +1 -1
  52. package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
  53. package/dist-esm/Interfaces/IConfig.js +1 -1
  54. package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
  55. package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
  56. package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
  57. package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
  58. package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
  59. package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
  60. package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
  61. package/dist-esm/Interfaces/IPartC.js +1 -1
  62. package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
  63. package/dist-esm/Interfaces/IRequestContext.js +1 -1
  64. package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
  65. package/dist-esm/Interfaces/IThrottleMgr.js +6 -0
  66. package/dist-esm/Interfaces/IThrottleMgr.js.map +1 -0
  67. package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
  68. package/dist-esm/Interfaces/PartAExtensions.js +1 -1
  69. package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
  70. package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
  71. package/dist-esm/RequestResponseHeaders.js +1 -1
  72. package/dist-esm/StorageHelperFuncs.js +1 -1
  73. package/dist-esm/Telemetry/Common/Data.js +1 -1
  74. package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
  75. package/dist-esm/Telemetry/Common/DataSanitizer.js +1 -1
  76. package/dist-esm/Telemetry/Common/Envelope.js +1 -1
  77. package/dist-esm/Telemetry/Event.js +1 -1
  78. package/dist-esm/Telemetry/Exception.js +4 -4
  79. package/dist-esm/Telemetry/Exception.js.map +1 -1
  80. package/dist-esm/Telemetry/Metric.js +3 -3
  81. package/dist-esm/Telemetry/Metric.js.map +1 -1
  82. package/dist-esm/Telemetry/PageView.js +1 -1
  83. package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
  84. package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
  85. package/dist-esm/Telemetry/Trace.js +1 -1
  86. package/dist-esm/TelemetryItemCreator.js +1 -1
  87. package/dist-esm/ThrottleMgr.js +259 -0
  88. package/dist-esm/ThrottleMgr.js.map +1 -0
  89. package/dist-esm/UrlHelperFuncs.js +1 -1
  90. package/dist-esm/Util.js +4 -4
  91. package/dist-esm/Util.js.map +1 -1
  92. package/dist-esm/__DynamicConstants.js +16 -10
  93. package/dist-esm/__DynamicConstants.js.map +1 -1
  94. package/dist-esm/applicationinsights-common.js +2 -1
  95. package/dist-esm/applicationinsights-common.js.map +1 -1
  96. package/package.json +5 -4
  97. package/src/Enums.ts +6 -0
  98. package/src/Interfaces/IThrottleMgr.ts +109 -0
  99. package/src/ThrottleMgr.ts +285 -0
  100. package/src/__DynamicConstants.ts +15 -9
  101. package/src/applicationinsights-common.ts +3 -1
  102. package/types/Enums.d.ts +5 -0
  103. package/types/Interfaces/IThrottleMgr.d.ts +94 -0
  104. package/types/ThrottleMgr.d.ts +12 -0
  105. package/types/__DynamicConstants.d.ts +13 -7
  106. package/types/applicationinsights-common.d.ts +3 -1
  107. package/types/tsdoc-metadata.json +1 -1
@@ -6,9 +6,11 @@
6
6
 
7
7
  import { createTraceParent } from '@microsoft/applicationinsights-core-js';
8
8
  import { _eInternalMessageId } from '@microsoft/applicationinsights-core-js';
9
+ import { eLoggingSeverity } from '@microsoft/applicationinsights-core-js';
9
10
  import { EnumValue } from '@microsoft/applicationinsights-core-js';
10
11
  import { findW3cTraceParent } from '@microsoft/applicationinsights-core-js';
11
12
  import { formatTraceParent } from '@microsoft/applicationinsights-core-js';
13
+ import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
12
14
  import { IChannelControls } from '@microsoft/applicationinsights-core-js';
13
15
  import { IConfiguration } from '@microsoft/applicationinsights-core-js';
14
16
  import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
@@ -838,6 +840,50 @@ export interface ITelemetryTrace {
838
840
  traceState?: ITraceState;
839
841
  }
840
842
 
843
+ // @public
844
+ export interface IThrottleInterval {
845
+ dayInterval?: number;
846
+ maxTimesPerMonth?: number;
847
+ monthInterval?: number;
848
+ }
849
+
850
+ // @public
851
+ export interface IThrottleLimit {
852
+ maxSendNumber?: number;
853
+ samplingRate?: number;
854
+ }
855
+
856
+ // @public
857
+ export interface IThrottleLocalStorageObj {
858
+ count: number;
859
+ date: Date;
860
+ preTriggerDate?: Date;
861
+ }
862
+
863
+ // @public
864
+ export interface IThrottleMgrConfig {
865
+ disabled?: boolean;
866
+ interval?: IThrottleInterval;
867
+ limit?: IThrottleLimit;
868
+ msgKey: IThrottleMsgKey;
869
+ }
870
+
871
+ // @public (undocumented)
872
+ export const enum IThrottleMsgKey {
873
+ // (undocumented)
874
+ cdnDeprecate = 2,
875
+ // (undocumented)
876
+ default = 0,
877
+ // (undocumented)
878
+ ikeyDeprecate = 1
879
+ }
880
+
881
+ // @public
882
+ export interface IThrottleResult {
883
+ isThrottled: boolean;
884
+ throttleNum: number;
885
+ }
886
+
841
887
  export { ITraceParent }
842
888
 
843
889
  // @public (undocumented)
@@ -1083,6 +1129,25 @@ export class TelemetryItemCreator {
1083
1129
  static create: typeof createTelemetryItem;
1084
1130
  }
1085
1131
 
1132
+ // @public (undocumented)
1133
+ export class ThrottleMgr {
1134
+ constructor(throttleMgr?: IThrottleMgrConfig, core?: IAppInsightsCore, namePrefix?: string);
1135
+ // (undocumented)
1136
+ canThrottle: () => boolean;
1137
+ // (undocumented)
1138
+ flush: () => boolean;
1139
+ // (undocumented)
1140
+ getConfig: () => IThrottleMgrConfig;
1141
+ // (undocumented)
1142
+ isReady: () => boolean;
1143
+ // (undocumented)
1144
+ isTriggered: () => boolean;
1145
+ // (undocumented)
1146
+ onReadyState: (isReady?: boolean) => boolean;
1147
+ // (undocumented)
1148
+ sendMessage: (msgID: _eInternalMessageId, message: string, severity?: eLoggingSeverity) => IThrottleResult | null;
1149
+ }
1150
+
1086
1151
  // Warning: (ae-forgotten-export) The symbol "IMessageData" needs to be exported by the entry point applicationinsights-common.d.ts
1087
1152
  //
1088
1153
  // @public (undocumented)
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2210-19
2
+ * Microsoft Application Insights Common JavaScript Library, 3.0.0-beta.2211-01
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -9,9 +9,11 @@
9
9
  declare namespace ApplicationInsights {
10
10
  import { createTraceParent } from '@microsoft/applicationinsights-core-js';
11
11
  import { _eInternalMessageId } from '@microsoft/applicationinsights-core-js';
12
+ import { eLoggingSeverity } from '@microsoft/applicationinsights-core-js';
12
13
  import { EnumValue } from '@microsoft/applicationinsights-core-js';
13
14
  import { findW3cTraceParent } from '@microsoft/applicationinsights-core-js';
14
15
  import { formatTraceParent } from '@microsoft/applicationinsights-core-js';
16
+ import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js';
15
17
  import { IChannelControls } from '@microsoft/applicationinsights-core-js';
16
18
  import { IConfiguration } from '@microsoft/applicationinsights-core-js';
17
19
  import { ICookieMgr } from '@microsoft/applicationinsights-core-js';
@@ -1955,6 +1957,110 @@ declare namespace ApplicationInsights {
1955
1957
  name?: string;
1956
1958
  }
1957
1959
 
1960
+ /**
1961
+ * Identifies frequency of items sent
1962
+ * Default: send data on 28th every 3 month each year
1963
+ */
1964
+ interface IThrottleInterval {
1965
+ /**
1966
+ * Identifies month interval that items can be sent
1967
+ * For example, if it is set to 2 and start date is in Jan, items will be sent out every two months (Jan, March, May etc.)
1968
+ * Default: 3
1969
+ */
1970
+ monthInterval?: number;
1971
+ /**
1972
+ * Identifies days that items can be sent within a month
1973
+ * Default: 28
1974
+ */
1975
+ dayInterval?: number;
1976
+ /**
1977
+ * Identifies max times items can be sent within a month
1978
+ * Default: 1
1979
+ */
1980
+ maxTimesPerMonth?: number;
1981
+ }
1982
+
1983
+ /**
1984
+ * Identifies limit number/percentage of items sent per time
1985
+ * If both are provided, minimum number between the two will be used
1986
+ */
1987
+ interface IThrottleLimit {
1988
+ /**
1989
+ * Identifies sampling percentage of items per time
1990
+ * The percentage is set to 4 decimal places, for example: 1 means 0.0001%
1991
+ * Default: 100 (0.01%)
1992
+ */
1993
+ samplingRate?: number;
1994
+ /**
1995
+ * Identifies limit number of items per time
1996
+ * Default: 1
1997
+ */
1998
+ maxSendNumber?: number;
1999
+ }
2000
+
2001
+ /**
2002
+ * Identifies object for local storage
2003
+ */
2004
+ interface IThrottleLocalStorageObj {
2005
+ /**
2006
+ * Identifies start date
2007
+ */
2008
+ date: Date;
2009
+ /**
2010
+ * Identifies current count
2011
+ */
2012
+ count: number;
2013
+ /**
2014
+ * identifies previous triggered throttle date
2015
+ */
2016
+ preTriggerDate?: Date;
2017
+ }
2018
+
2019
+ /**
2020
+ * Identifies basic config
2021
+ */
2022
+ interface IThrottleMgrConfig {
2023
+ /**
2024
+ * Identifies message key to be used for local storage key
2025
+ */
2026
+ msgKey: IThrottleMsgKey;
2027
+ /**
2028
+ * Identifies if throttle is disabled
2029
+ * Default: false
2030
+ */
2031
+ disabled?: boolean;
2032
+ /**
2033
+ * Identifies limit number/percentage of items sent per time
2034
+ */
2035
+ limit?: IThrottleLimit;
2036
+ /**
2037
+ * Identifies frequency of items sent
2038
+ * Default: send data on 28th every 3 month each year
2039
+ */
2040
+ interval?: IThrottleInterval;
2041
+ }
2042
+
2043
+ const enum IThrottleMsgKey {
2044
+ default = 0,
2045
+ ikeyDeprecate = 1,
2046
+ cdnDeprecate = 2
2047
+ }
2048
+
2049
+ /**
2050
+ * Identifies throttle result
2051
+ */
2052
+ interface IThrottleResult {
2053
+ /**
2054
+ * Identifies if items are sent
2055
+ */
2056
+ isThrottled: boolean;
2057
+ /**
2058
+ * Identifies numbers of items are sent
2059
+ * if isThrottled is false, it will be set to 0
2060
+ */
2061
+ throttleNum: number;
2062
+ }
2063
+
1958
2064
  export { ITraceParent }
1959
2065
 
1960
2066
  interface ITraceState {
@@ -2345,6 +2451,17 @@ declare namespace ApplicationInsights {
2345
2451
  static create: typeof createTelemetryItem;
2346
2452
  }
2347
2453
 
2454
+ class ThrottleMgr {
2455
+ canThrottle: () => boolean;
2456
+ sendMessage: (msgID: _eInternalMessageId, message: string, severity?: eLoggingSeverity) => IThrottleResult | null;
2457
+ getConfig: () => IThrottleMgrConfig;
2458
+ isTriggered: () => boolean;
2459
+ isReady: () => boolean;
2460
+ onReadyState: (isReady?: boolean) => boolean;
2461
+ flush: () => boolean;
2462
+ constructor(throttleMgr?: IThrottleMgrConfig, core?: IAppInsightsCore, namePrefix?: string);
2463
+ }
2464
+
2348
2465
  class Trace implements IMessageData, ISerializable {
2349
2466
  static envelopeType: string;
2350
2467
  static dataType: string;