@microsoft/applicationinsights-common 3.0.0-beta.2301-20 → 3.0.0-beta.2302-02

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 (116) hide show
  1. package/browser/applicationinsights-common.integrity.json +9 -9
  2. package/browser/applicationinsights-common.js +99 -30
  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 +10 -10
  7. package/dist/applicationinsights-common.api.md +1 -1
  8. package/dist/applicationinsights-common.d.ts +7 -7
  9. package/dist/applicationinsights-common.js +99 -30
  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 +7 -7
  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 +1 -1
  66. package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
  67. package/dist-esm/Interfaces/PartAExtensions.js +1 -1
  68. package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
  69. package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
  70. package/dist-esm/RequestResponseHeaders.js +1 -1
  71. package/dist-esm/StorageHelperFuncs.js +1 -1
  72. package/dist-esm/Telemetry/Common/Data.js +1 -1
  73. package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
  74. package/dist-esm/Telemetry/Common/DataSanitizer.js +1 -1
  75. package/dist-esm/Telemetry/Common/Envelope.js +1 -1
  76. package/dist-esm/Telemetry/Event.js +1 -1
  77. package/dist-esm/Telemetry/Exception.js +1 -1
  78. package/dist-esm/Telemetry/Metric.js +1 -1
  79. package/dist-esm/Telemetry/PageView.js +1 -1
  80. package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
  81. package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
  82. package/dist-esm/Telemetry/Trace.js +1 -1
  83. package/dist-esm/TelemetryItemCreator.js +1 -1
  84. package/dist-esm/ThrottleMgr.js +46 -19
  85. package/dist-esm/ThrottleMgr.js.map +1 -1
  86. package/dist-esm/UrlHelperFuncs.js +1 -1
  87. package/dist-esm/Util.js +1 -1
  88. package/dist-esm/__DynamicConstants.js +6 -5
  89. package/dist-esm/__DynamicConstants.js.map +1 -1
  90. package/dist-esm/applicationinsights-common.js +1 -1
  91. package/package.json +5 -5
  92. package/src/ConnectionStringParser.ts +8 -8
  93. package/src/HelperFuncs.ts +6 -6
  94. package/src/Interfaces/IConfig.ts +7 -7
  95. package/src/Interfaces/IThrottleMgr.ts +6 -6
  96. package/src/StorageHelperFuncs.ts +10 -10
  97. package/src/Telemetry/Common/DataSanitizer.ts +8 -8
  98. package/src/Telemetry/Common/Envelope.ts +11 -11
  99. package/src/Telemetry/Event.ts +11 -11
  100. package/src/Telemetry/Exception.ts +22 -22
  101. package/src/Telemetry/Metric.ts +12 -12
  102. package/src/Telemetry/PageView.ts +14 -14
  103. package/src/Telemetry/PageViewPerformance.ts +12 -12
  104. package/src/Telemetry/RemoteDependencyData.ts +12 -12
  105. package/src/Telemetry/Trace.ts +12 -12
  106. package/src/TelemetryItemCreator.ts +10 -10
  107. package/src/ThrottleMgr.ts +53 -21
  108. package/src/UrlHelperFuncs.ts +6 -6
  109. package/src/Util.ts +16 -16
  110. package/src/__DynamicConstants.ts +50 -49
  111. package/types/Enums.d.ts +2 -2
  112. package/types/Interfaces/ConnectionString.d.ts +2 -2
  113. package/types/Interfaces/Contracts/SeverityLevel.d.ts +1 -1
  114. package/types/Interfaces/IThrottleMgr.d.ts +6 -6
  115. package/types/__DynamicConstants.d.ts +2 -1
  116. package/types/tsdoc-metadata.json +1 -1
@@ -1,16 +1,16 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
- import { strNotSpecified } from "../Constants";
6
- import { FieldType } from "../Enums";
7
- import { msToTimeSpan } from "../HelperFuncs";
8
- import { IPageViewData } from "../Interfaces/Contracts/IPageViewData";
9
- import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
10
- import {
11
- dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl
12
- } from "./Common/DataSanitizer";
13
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
+ import { strNotSpecified } from "../Constants";
6
+ import { FieldType } from "../Enums";
7
+ import { msToTimeSpan } from "../HelperFuncs";
8
+ import { IPageViewData } from "../Interfaces/Contracts/IPageViewData";
9
+ import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
10
+ import {
11
+ dataSanitizeId, dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl
12
+ } from "./Common/DataSanitizer";
13
+
14
14
  export class PageView implements IPageViewData, ISerializable {
15
15
 
16
16
  public static envelopeType = "Microsoft.ApplicationInsights.{0}.Pageview";
@@ -76,4 +76,4 @@ export class PageView implements IPageViewData, ISerializable {
76
76
  _self.properties = dataSanitizeProperties(logger, properties);
77
77
  _self.measurements = dataSanitizeMeasurements(logger, measurements);
78
78
  }
79
- }
79
+ }
@@ -1,14 +1,14 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
- import { strNotSpecified } from "../Constants";
6
- import { FieldType } from "../Enums";
7
- import { IPageViewPerfData } from "../Interfaces/Contracts/IPageViewPerfData";
8
- import { IPageViewPerformanceTelemetry } from "../Interfaces/IPageViewPerformanceTelemetry";
9
- import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
10
- import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
11
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
+ import { strNotSpecified } from "../Constants";
6
+ import { FieldType } from "../Enums";
7
+ import { IPageViewPerfData } from "../Interfaces/Contracts/IPageViewPerfData";
8
+ import { IPageViewPerformanceTelemetry } from "../Interfaces/IPageViewPerformanceTelemetry";
9
+ import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
10
+ import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
11
+
12
12
  export class PageViewPerformance implements IPageViewPerfData, ISerializable {
13
13
 
14
14
  public static envelopeType = "Microsoft.ApplicationInsights.{0}.PageviewPerformance";
@@ -110,4 +110,4 @@ export class PageViewPerformance implements IPageViewPerfData, ISerializable {
110
110
  _self.sentRequest = cs4BaseData.sentRequest;
111
111
  }
112
112
  }
113
- }
113
+ }
@@ -1,14 +1,14 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
- import { FieldType } from "../Enums";
6
- import { msToTimeSpan } from "../HelperFuncs";
7
- import { IRemoteDependencyData } from "../Interfaces/Contracts/IRemoteDependencyData";
8
- import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
9
- import { AjaxHelperParseDependencyPath } from "../Util";
10
- import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
11
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
+ import { FieldType } from "../Enums";
6
+ import { msToTimeSpan } from "../HelperFuncs";
7
+ import { IRemoteDependencyData } from "../Interfaces/Contracts/IRemoteDependencyData";
8
+ import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
9
+ import { AjaxHelperParseDependencyPath } from "../Util";
10
+ import { dataSanitizeMeasurements, dataSanitizeProperties, dataSanitizeString, dataSanitizeUrl } from "./Common/DataSanitizer";
11
+
12
12
  export class RemoteDependencyData implements IRemoteDependencyData, ISerializable {
13
13
 
14
14
  public static envelopeType = "Microsoft.ApplicationInsights.{0}.RemoteDependency";
@@ -119,4 +119,4 @@ export class RemoteDependencyData implements IRemoteDependencyData, ISerializabl
119
119
  _self.properties = dataSanitizeProperties(logger, properties);
120
120
  _self.measurements = dataSanitizeMeasurements(logger, measurements);
121
121
  }
122
- }
122
+ }
@@ -1,14 +1,14 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
- import { strNotSpecified } from "../Constants";
6
- import { FieldType } from "../Enums";
7
- import { IMessageData } from "../Interfaces/Contracts/IMessageData";
8
- import { SeverityLevel } from "../Interfaces/Contracts/SeverityLevel";
9
- import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
10
- import { dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties } from "./Common/DataSanitizer";
11
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
5
+ import { strNotSpecified } from "../Constants";
6
+ import { FieldType } from "../Enums";
7
+ import { IMessageData } from "../Interfaces/Contracts/IMessageData";
8
+ import { SeverityLevel } from "../Interfaces/Contracts/SeverityLevel";
9
+ import { ISerializable } from "../Interfaces/Telemetry/ISerializable";
10
+ import { dataSanitizeMeasurements, dataSanitizeMessage, dataSanitizeProperties } from "./Common/DataSanitizer";
11
+
12
12
  export class Trace implements IMessageData, ISerializable {
13
13
 
14
14
  public static envelopeType = "Microsoft.ApplicationInsights.{0}.Message";
@@ -61,4 +61,4 @@ export class Trace implements IMessageData, ISerializable {
61
61
  _self.severityLevel = severityLevel;
62
62
  }
63
63
  }
64
- }
64
+ }
@@ -1,12 +1,12 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import {
5
- IDiagnosticLogger, ITelemetryItem, isNullOrUndefined, objForEachKey, throwError, toISOString
6
- } from "@microsoft/applicationinsights-core-js";
7
- import { strIkey, strNotSpecified } from "./Constants";
8
- import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
9
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import {
5
+ IDiagnosticLogger, ITelemetryItem, isNullOrUndefined, objForEachKey, throwError, toISOString
6
+ } from "@microsoft/applicationinsights-core-js";
7
+ import { strIkey, strNotSpecified } from "./Constants";
8
+ import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
9
+
10
10
  /**
11
11
  * Create a telemetry item that the 1DS channel understands
12
12
  * @param item - domain specific properties; part B
@@ -72,4 +72,4 @@ export class TelemetryItemCreator {
72
72
  */
73
73
 
74
74
  public static create = createTelemetryItem;
75
- }
75
+ }
@@ -1,11 +1,11 @@
1
- import {
2
- IAppInsightsCore, IDiagnosticLogger, _eInternalMessageId, _throwInternal, arrForEach, eLoggingSeverity, isNotNullOrUndefined,
3
- isNullOrUndefined, randomValue, safeGetLogger, strTrim
4
- } from "@microsoft/applicationinsights-core-js";
5
- import { IThrottleMsgKey } from "./Enums";
6
- import { IThrottleLocalStorageObj, IThrottleMgrConfig, IThrottleResult } from "./Interfaces/IThrottleMgr";
7
- import { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from "./StorageHelperFuncs";
8
-
1
+ import {
2
+ IAppInsightsCore, IDiagnosticLogger, _eInternalMessageId, _throwInternal, arrForEach, arrIndexOf, eLoggingSeverity, isNotNullOrUndefined,
3
+ isNullOrUndefined, randomValue, safeGetLogger, strTrim
4
+ } from "@microsoft/applicationinsights-core-js";
5
+ import { IThrottleMsgKey } from "./Enums";
6
+ import { IThrottleInterval, IThrottleLocalStorageObj, IThrottleMgrConfig, IThrottleResult } from "./Interfaces/IThrottleMgr";
7
+ import { utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from "./StorageHelperFuncs";
8
+
9
9
  const THROTTLE_STORAGE_PREFIX = "appInsightsThrottle";
10
10
 
11
11
  interface SendMsgParameter {
@@ -34,6 +34,7 @@ export class ThrottleMgr {
34
34
  let _namePrefix: string;
35
35
  let _queue: Array<SendMsgParameter>;
36
36
  let _isReady: boolean = false;
37
+ let _isSpecificDaysGiven: boolean = false;
37
38
 
38
39
  _initConfig();
39
40
 
@@ -150,14 +151,11 @@ export class ThrottleMgr {
150
151
  _config = {} as any;
151
152
  _config.disabled = !!configMgr.disabled;
152
153
  _config.msgKey = configMgr.msgKey;
153
- // default: send data on 28th every 3 month each year
154
- let interval = {
155
- // dafault: sent every three months
156
- monthInterval: configMgr.interval?.monthInterval || 3,
157
- dayInterval : configMgr.interval?.dayInterval || 28,
158
- maxTimesPerMonth: configMgr.interval?.maxTimesPerMonth || 1
159
- };
160
- _config.interval = interval;
154
+
155
+ let configInterval = configMgr.interval || {};
156
+ _isSpecificDaysGiven = configInterval?.daysOfMonth && configInterval?.daysOfMonth.length > 0;
157
+ _config.interval = _getIntervalConfig(configInterval);
158
+
161
159
  let limit = {
162
160
  samplingRate: configMgr.limit?.samplingRate || 100,
163
161
  // dafault: every time sent only 1 event
@@ -174,15 +172,49 @@ export class ThrottleMgr {
174
172
  }
175
173
  }
176
174
 
175
+ function _getIntervalConfig(interval: IThrottleInterval) {
176
+ interval = interval || {};
177
+ let monthInterval = interval?.monthInterval;
178
+ let dayInterval = interval?.dayInterval;
179
+
180
+ // default: send data every 3 month each year
181
+ if (isNullOrUndefined(monthInterval) && isNullOrUndefined(dayInterval)) {
182
+ interval.monthInterval = 3;
183
+ if (!_isSpecificDaysGiven) {
184
+ // default: send data on 28th
185
+ interval.daysOfMonth = [28];
186
+ _isSpecificDaysGiven = true;
187
+ }
188
+ }
189
+ interval = {
190
+ // dafault: sent every three months
191
+ monthInterval: interval?.monthInterval,
192
+ dayInterval: interval?.dayInterval,
193
+ daysOfMonth: interval?.daysOfMonth
194
+ } as IThrottleInterval;
195
+ return interval;
196
+ }
197
+
177
198
  function _canThrottle(config: IThrottleMgrConfig, canUseLocalStorage: boolean, localStorageObj: IThrottleLocalStorageObj) {
178
199
  if (!config.disabled && canUseLocalStorage && isNotNullOrUndefined(localStorageObj)) {
179
200
  let curDate = _getThrottleDate();
180
201
  let date = localStorageObj.date;
181
202
  let interval = config.interval;
182
- let monthExpand = (curDate.getUTCFullYear() - date.getUTCFullYear()) * 12 + curDate.getUTCMonth() - date.getUTCMonth();
183
- let monthCheck = _checkInterval(interval.monthInterval, 0, monthExpand);
184
- let dayCheck = _checkInterval(interval.dayInterval, 0, curDate.getUTCDate()) -1;
185
- return monthCheck >= 0 && dayCheck >= 0 && dayCheck <= config.interval.maxTimesPerMonth;
203
+ let monthCheck = 1;
204
+ if (interval?.monthInterval) {
205
+ let monthExpand = (curDate.getUTCFullYear() - date.getUTCFullYear()) * 12 + curDate.getUTCMonth() - date.getUTCMonth();
206
+ monthCheck = _checkInterval(interval.monthInterval, 0, monthExpand);
207
+ }
208
+
209
+ let dayCheck = 1;
210
+ if (_isSpecificDaysGiven) {
211
+ dayCheck = arrIndexOf(interval.daysOfMonth, curDate.getUTCDate());
212
+ } else if (interval?.dayInterval) {
213
+ let daySpan = Math.floor((curDate.getTime() - date.getTime()) / 86400000);
214
+ dayCheck = _checkInterval(interval.dayInterval, 0, daySpan);
215
+ }
216
+
217
+ return monthCheck >= 0 && dayCheck >= 0;
186
218
  }
187
219
  return false;
188
220
  }
@@ -282,4 +314,4 @@ export class ThrottleMgr {
282
314
  return randomValue(1000000) <= _config.limit.samplingRate;
283
315
  }
284
316
  }
285
- }
317
+ }
@@ -1,8 +1,8 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { getDocument, isString } from "@microsoft/applicationinsights-core-js";
5
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { getDocument, isString } from "@microsoft/applicationinsights-core-js";
5
+
6
6
  let _document: any = getDocument() || {};
7
7
 
8
8
  let _htmlAnchorIdx: number = 0;
@@ -98,4 +98,4 @@ export function urlParseFullHost(url: string, inclPort?: boolean) {
98
98
  }
99
99
 
100
100
  return result;
101
- }
101
+ }
package/src/Util.ts CHANGED
@@ -1,18 +1,18 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import {
5
- IDiagnosticLogger, IDistributedTraceContext, arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined, isValidSpanId,
6
- isValidTraceId
7
- } from "@microsoft/applicationinsights-core-js";
8
- import { strIndexOf } from "@nevware21/ts-utils";
9
- import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from "./Constants";
10
- import { ITelemetryTrace } from "./Interfaces/Context/ITelemetryTrace";
11
- import { ICorrelationConfig } from "./Interfaces/ICorrelationConfig";
12
- import { RequestHeaders, eRequestHeaders } from "./RequestResponseHeaders";
13
- import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
14
- import { urlParseFullHost, urlParseUrl } from "./UrlHelperFuncs";
15
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import {
5
+ IDiagnosticLogger, IDistributedTraceContext, arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined, isValidSpanId,
6
+ isValidTraceId
7
+ } from "@microsoft/applicationinsights-core-js";
8
+ import { strIndexOf } from "@nevware21/ts-utils";
9
+ import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from "./Constants";
10
+ import { ITelemetryTrace } from "./Interfaces/Context/ITelemetryTrace";
11
+ import { ICorrelationConfig } from "./Interfaces/ICorrelationConfig";
12
+ import { RequestHeaders, eRequestHeaders } from "./RequestResponseHeaders";
13
+ import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
14
+ import { urlParseFullHost, urlParseUrl } from "./UrlHelperFuncs";
15
+
16
16
  // listing only non-geo specific locations
17
17
  const _internalEndpoints: string[] = [
18
18
  DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH,
@@ -218,4 +218,4 @@ export function createDistributedTraceContextFromTrace(telemetryTrace?: ITelemet
218
218
  trace.traceFlags = newTraceFlags
219
219
  }
220
220
  };
221
- }
221
+ }
@@ -1,49 +1,50 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
- // @skip-file-minify
4
-
5
- // ##############################################################
6
- // AUTO GENERATED FILE: This file is Auto Generated during build.
7
- // ##############################################################
8
-
9
- // ###########################################################################################################################################
10
- // Note: DON'T Export these const from the package as we are still targeting IE this will export a mutable variables that someone could change
11
- // ###########################################################################################################################################
12
-
13
- export const _DYN_SPLIT = "split"; // Count: 6
14
- export const _DYN_LENGTH = "length"; // Count: 41
15
- export const _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
16
- export const _DYN_INGESTIONENDPOINT = "ingestionendpoint"; // Count: 4
17
- export const _DYN_TO_STRING = "toString"; // Count: 12
18
- export const _DYN_REMOVE_ITEM = "removeItem"; // Count: 3
19
- export const _DYN_NAME = "name"; // Count: 11
20
- export const _DYN_MESSAGE = "message"; // Count: 10
21
- export const _DYN_COUNT = "count"; // Count: 8
22
- export const _DYN_PRE_TRIGGER_DATE = "preTriggerDate"; // Count: 4
23
- export const _DYN_DISABLED = "disabled"; // Count: 3
24
- export const _DYN_DATE = "date"; // Count: 5
25
- export const _DYN_GET_UTCDATE = "getUTCDate"; // Count: 3
26
- export const _DYN_MAX_TIMES_PER_MONTH = "maxTimesPerMonth"; // Count: 2
27
- export const _DYN_STRINGIFY = "stringify"; // Count: 4
28
- export const _DYN_PATHNAME = "pathname"; // Count: 4
29
- export const _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns"; // Count: 2
30
- export const _DYN_EXTENSION_CONFIG = "extensionConfig"; // Count: 4
31
- export const _DYN_EXCEPTIONS = "exceptions"; // Count: 6
32
- export const _DYN_PARSED_STACK = "parsedStack"; // Count: 11
33
- export const _DYN_PROPERTIES = "properties"; // Count: 9
34
- export const _DYN_MEASUREMENTS = "measurements"; // Count: 9
35
- export const _DYN_SIZE_IN_BYTES = "sizeInBytes"; // Count: 11
36
- export const _DYN_TYPE_NAME = "typeName"; // Count: 11
37
- export const _DYN_SEVERITY_LEVEL = "severityLevel"; // Count: 5
38
- export const _DYN_PROBLEM_GROUP = "problemGroup"; // Count: 3
39
- export const _DYN_IS_MANUAL = "isManual"; // Count: 3
40
- export const _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface"; // Count: 2
41
- export const _DYN_HAS_FULL_STACK = "hasFullStack"; // Count: 6
42
- export const _DYN_LEVEL = "level"; // Count: 5
43
- export const _DYN_METHOD = "method"; // Count: 7
44
- export const _DYN_ASSEMBLY = "assembly"; // Count: 5
45
- export const _DYN_FILE_NAME = "fileName"; // Count: 6
46
- export const _DYN_LINE = "line"; // Count: 6
47
- export const _DYN_DURATION = "duration"; // Count: 4
48
- export const _DYN_RECEIVED_RESPONSE = "receivedResponse"; // Count: 2
49
- export const _DYN_SUBSTRING = "substring"; // Count: 6
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+ // @skip-file-minify
4
+
5
+ // ##############################################################
6
+ // AUTO GENERATED FILE: This file is Auto Generated during build.
7
+ // ##############################################################
8
+
9
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
+ // Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!
11
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
+
13
+ export const _DYN_SPLIT = "split"; // Count: 6
14
+ export const _DYN_LENGTH = "length"; // Count: 41
15
+ export const _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
16
+ export const _DYN_INGESTIONENDPOINT = "ingestionendpoint"; // Count: 4
17
+ export const _DYN_TO_STRING = "toString"; // Count: 12
18
+ export const _DYN_REMOVE_ITEM = "removeItem"; // Count: 3
19
+ export const _DYN_NAME = "name"; // Count: 11
20
+ export const _DYN_MESSAGE = "message"; // Count: 10
21
+ export const _DYN_COUNT = "count"; // Count: 8
22
+ export const _DYN_PRE_TRIGGER_DATE = "preTriggerDate"; // Count: 4
23
+ export const _DYN_DISABLED = "disabled"; // Count: 3
24
+ export const _DYN_INTERVAL = "interval"; // Count: 3
25
+ export const _DYN_DAYS_OF_MONTH = "daysOfMonth"; // Count: 3
26
+ export const _DYN_DATE = "date"; // Count: 5
27
+ export const _DYN_GET_UTCDATE = "getUTCDate"; // Count: 3
28
+ export const _DYN_STRINGIFY = "stringify"; // Count: 4
29
+ export const _DYN_PATHNAME = "pathname"; // Count: 4
30
+ export const _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns"; // Count: 2
31
+ export const _DYN_EXTENSION_CONFIG = "extensionConfig"; // Count: 4
32
+ export const _DYN_EXCEPTIONS = "exceptions"; // Count: 6
33
+ export const _DYN_PARSED_STACK = "parsedStack"; // Count: 11
34
+ export const _DYN_PROPERTIES = "properties"; // Count: 9
35
+ export const _DYN_MEASUREMENTS = "measurements"; // Count: 9
36
+ export const _DYN_SIZE_IN_BYTES = "sizeInBytes"; // Count: 11
37
+ export const _DYN_TYPE_NAME = "typeName"; // Count: 11
38
+ export const _DYN_SEVERITY_LEVEL = "severityLevel"; // Count: 5
39
+ export const _DYN_PROBLEM_GROUP = "problemGroup"; // Count: 3
40
+ export const _DYN_IS_MANUAL = "isManual"; // Count: 3
41
+ export const _DYN__CREATE_FROM_INTERFA1 = "CreateFromInterface"; // Count: 2
42
+ export const _DYN_HAS_FULL_STACK = "hasFullStack"; // Count: 6
43
+ export const _DYN_LEVEL = "level"; // Count: 5
44
+ export const _DYN_METHOD = "method"; // Count: 7
45
+ export const _DYN_ASSEMBLY = "assembly"; // Count: 5
46
+ export const _DYN_FILE_NAME = "fileName"; // Count: 6
47
+ export const _DYN_LINE = "line"; // Count: 6
48
+ export const _DYN_DURATION = "duration"; // Count: 4
49
+ export const _DYN_RECEIVED_RESPONSE = "receivedResponse"; // Count: 2
50
+ export const _DYN_SUBSTRING = "substring"; // Count: 6
package/types/Enums.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare const enum eStorageType {
6
6
  SessionStorage = 1
7
7
  }
8
8
  export declare const StorageType: import("@microsoft/applicationinsights-core-js").EnumValue<typeof eStorageType>;
9
- export declare type StorageType = eStorageType | typeof StorageType;
9
+ export type StorageType = eStorageType | typeof StorageType;
10
10
  /**
11
11
  * Enum is used in aiDataContract to describe how fields are serialized.
12
12
  * For instance: (Fieldtype.Required | FieldType.Array) will mark the field as required and indicate it's an array
@@ -32,7 +32,7 @@ export declare const enum eDistributedTracingModes {
32
32
  W3C = 2
33
33
  }
34
34
  export declare const DistributedTracingModes: import("@microsoft/applicationinsights-core-js").EnumValue<typeof eDistributedTracingModes>;
35
- export declare type DistributedTracingModes = number | eDistributedTracingModes;
35
+ export type DistributedTracingModes = number | eDistributedTracingModes;
36
36
  export declare const enum IThrottleMsgKey {
37
37
  default = 0,
38
38
  ikeyDeprecate = 1,
@@ -1,4 +1,4 @@
1
- export declare type ConnectionStringKey = "authorization" | "instrumentationkey" | "ingestionendpoint" | "location" | "endpointsuffix";
2
- export declare type ConnectionString = {
1
+ export type ConnectionStringKey = "authorization" | "instrumentationkey" | "ingestionendpoint" | "location" | "endpointsuffix";
2
+ export type ConnectionString = {
3
3
  [key in ConnectionStringKey]?: string;
4
4
  };
@@ -12,4 +12,4 @@ export declare const enum eSeverityLevel {
12
12
  * Defines the level of severity for the event.
13
13
  */
14
14
  export declare const SeverityLevel: import("@microsoft/applicationinsights-core-js").EnumValue<typeof eSeverityLevel>;
15
- export declare type SeverityLevel = number | eSeverityLevel;
15
+ export type SeverityLevel = number | eSeverityLevel;
@@ -24,19 +24,19 @@ export interface IThrottleInterval {
24
24
  /**
25
25
  * Identifies month interval that items can be sent
26
26
  * 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.)
27
- * Default: 3
27
+ * If both monthInterval and dayInterval are undefined, it will be set to 3
28
28
  */
29
29
  monthInterval?: number;
30
30
  /**
31
- * Identifies days that items can be sent within a month
32
- * Default: 28
31
+ * Identifies days Interval from start date that items can be sent
32
+ * Default: undefined
33
33
  */
34
34
  dayInterval?: number;
35
35
  /**
36
- * Identifies max times items can be sent within a month
37
- * Default: 1
36
+ * Identifies days within each month that items can be sent
37
+ * If both monthInterval and dayInterval are undefined, it will be default to [28]
38
38
  */
39
- maxTimesPerMonth?: number;
39
+ daysOfMonth?: number[];
40
40
  }
41
41
  /**
42
42
  * Identifies basic config
@@ -9,9 +9,10 @@ export declare const _DYN_MESSAGE = "message";
9
9
  export declare const _DYN_COUNT = "count";
10
10
  export declare const _DYN_PRE_TRIGGER_DATE = "preTriggerDate";
11
11
  export declare const _DYN_DISABLED = "disabled";
12
+ export declare const _DYN_INTERVAL = "interval";
13
+ export declare const _DYN_DAYS_OF_MONTH = "daysOfMonth";
12
14
  export declare const _DYN_DATE = "date";
13
15
  export declare const _DYN_GET_UTCDATE = "getUTCDate";
14
- export declare const _DYN_MAX_TIMES_PER_MONTH = "maxTimesPerMonth";
15
16
  export declare const _DYN_STRINGIFY = "stringify";
16
17
  export declare const _DYN_PATHNAME = "pathname";
17
18
  export declare const _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns";
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.0"
8
+ "packageVersion": "7.34.2"
9
9
  }
10
10
  ]
11
11
  }