@microsoft/applicationinsights-common 2.8.0-beta.2203-04 → 2.8.0-beta.2203-07

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 +445 -23
  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 +69 -10
  7. package/dist/applicationinsights-common.api.md +7 -4
  8. package/dist/applicationinsights-common.d.ts +16 -3
  9. package/dist/applicationinsights-common.js +445 -23
  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 +16 -3
  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/Generated/AvailabilityData.js +1 -1
  36. package/dist-esm/Interfaces/Contracts/Generated/Base.js +1 -1
  37. package/dist-esm/Interfaces/Contracts/Generated/ContextTagKeys.js +1 -1
  38. package/dist-esm/Interfaces/Contracts/Generated/Data.js +1 -1
  39. package/dist-esm/Interfaces/Contracts/Generated/DataPoint.js +1 -1
  40. package/dist-esm/Interfaces/Contracts/Generated/DataPointType.js +1 -1
  41. package/dist-esm/Interfaces/Contracts/Generated/DependencyKind.js +1 -1
  42. package/dist-esm/Interfaces/Contracts/Generated/DependencySourceType.js +1 -1
  43. package/dist-esm/Interfaces/Contracts/Generated/Domain.js +1 -1
  44. package/dist-esm/Interfaces/Contracts/Generated/Envelope.js +1 -1
  45. package/dist-esm/Interfaces/Contracts/Generated/EventData.js +1 -1
  46. package/dist-esm/Interfaces/Contracts/Generated/ExceptionData.js +1 -1
  47. package/dist-esm/Interfaces/Contracts/Generated/ExceptionDetails.js +1 -1
  48. package/dist-esm/Interfaces/Contracts/Generated/MessageData.js +1 -1
  49. package/dist-esm/Interfaces/Contracts/Generated/MetricData.js +1 -1
  50. package/dist-esm/Interfaces/Contracts/Generated/PageViewData.js +1 -1
  51. package/dist-esm/Interfaces/Contracts/Generated/PageViewPerfData.js +1 -1
  52. package/dist-esm/Interfaces/Contracts/Generated/RemoteDependencyData.js +1 -1
  53. package/dist-esm/Interfaces/Contracts/Generated/RequestData.js +1 -1
  54. package/dist-esm/Interfaces/Contracts/Generated/SeverityLevel.js +1 -1
  55. package/dist-esm/Interfaces/Contracts/Generated/StackFrame.js +1 -1
  56. package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
  57. package/dist-esm/Interfaces/Contracts/IData.js +1 -1
  58. package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
  59. package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
  60. package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
  61. package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
  62. package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
  63. package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
  64. package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
  65. package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
  66. package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
  67. package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
  68. package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
  69. package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
  70. package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
  71. package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
  72. package/dist-esm/Interfaces/IAppInsights.js +1 -1
  73. package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
  74. package/dist-esm/Interfaces/IConfig.js +1 -1
  75. package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
  76. package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
  77. package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
  78. package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
  79. package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
  80. package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
  81. package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
  82. package/dist-esm/Interfaces/IPartC.js +1 -1
  83. package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
  84. package/dist-esm/Interfaces/IRequestContext.js +1 -1
  85. package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
  86. package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
  87. package/dist-esm/Interfaces/PartAExtensions.js +1 -1
  88. package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
  89. package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
  90. package/dist-esm/RequestResponseHeaders.js +1 -1
  91. package/dist-esm/StorageHelperFuncs.js +27 -12
  92. package/dist-esm/StorageHelperFuncs.js.map +1 -1
  93. package/dist-esm/Telemetry/Common/Base.js +1 -1
  94. package/dist-esm/Telemetry/Common/Data.js +1 -1
  95. package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
  96. package/dist-esm/Telemetry/Common/DataSanitizer.js +8 -8
  97. package/dist-esm/Telemetry/Common/DataSanitizer.js.map +1 -1
  98. package/dist-esm/Telemetry/Common/Envelope.js +1 -1
  99. package/dist-esm/Telemetry/Event.js +1 -1
  100. package/dist-esm/Telemetry/Exception.js +1 -1
  101. package/dist-esm/Telemetry/Metric.js +1 -1
  102. package/dist-esm/Telemetry/PageView.js +1 -1
  103. package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
  104. package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
  105. package/dist-esm/Telemetry/Trace.js +1 -1
  106. package/dist-esm/TelemetryItemCreator.js +1 -1
  107. package/dist-esm/UrlHelperFuncs.js +1 -1
  108. package/dist-esm/Util.js +1 -1
  109. package/dist-esm/applicationinsights-common.js +2 -2
  110. package/dist-esm/applicationinsights-common.js.map +1 -1
  111. package/package.json +2 -2
  112. package/src/StorageHelperFuncs.ts +28 -11
  113. package/src/Telemetry/Common/DataSanitizer.ts +8 -8
  114. package/src/applicationinsights-common.ts +1 -1
  115. package/types/StorageHelperFuncs.d.ts +14 -2
  116. package/types/applicationinsights-common.d.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation. All rights reserved.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { IDiagnosticLogger, eLoggingSeverity, _InternalMessageId, hasJSON, getJSON, objForEachKey, isObject, strTrim } from "@microsoft/applicationinsights-core-js";
4
+ import { IDiagnosticLogger, eLoggingSeverity, _InternalMessageId, hasJSON, getJSON, objForEachKey, isObject, strTrim, _throwInternal } from "@microsoft/applicationinsights-core-js";
5
5
 
6
6
  export const enum DataSanitizerValues {
7
7
  /**
@@ -66,7 +66,7 @@ export function dataSanitizeKey(logger: IDiagnosticLogger, name: any) {
66
66
  // truncate the string to 150 chars
67
67
  if (name.length > DataSanitizerValues.MAX_NAME_LENGTH) {
68
68
  nameTrunc = name.substring(0, DataSanitizerValues.MAX_NAME_LENGTH);
69
- logger && logger.throwInternal(
69
+ _throwInternal(logger,
70
70
  eLoggingSeverity.WARNING,
71
71
  _InternalMessageId.NameTooLong,
72
72
  "name is too long. It has been truncated to " + DataSanitizerValues.MAX_NAME_LENGTH + " characters.",
@@ -84,7 +84,7 @@ export function dataSanitizeString(logger: IDiagnosticLogger, value: any, maxLen
84
84
  value = strTrim(value);
85
85
  if (value.toString().length > maxLength) {
86
86
  valueTrunc = value.toString().substring(0, maxLength);
87
- logger && logger.throwInternal(
87
+ _throwInternal(logger,
88
88
  eLoggingSeverity.WARNING,
89
89
  _InternalMessageId.StringValueTooLong,
90
90
  "string value is too long. It has been truncated to " + maxLength + " characters.",
@@ -104,7 +104,7 @@ export function dataSanitizeMessage(logger: IDiagnosticLogger, message: any) {
104
104
  if (message) {
105
105
  if (message.length > DataSanitizerValues.MAX_MESSAGE_LENGTH) {
106
106
  messageTrunc = message.substring(0, DataSanitizerValues.MAX_MESSAGE_LENGTH);
107
- logger && logger.throwInternal(
107
+ _throwInternal(logger,
108
108
  eLoggingSeverity.WARNING, _InternalMessageId.MessageTruncated,
109
109
  "message is too long, it has been truncated to " + DataSanitizerValues.MAX_MESSAGE_LENGTH + " characters.",
110
110
  { message },
@@ -122,7 +122,7 @@ export function dataSanitizeException(logger: IDiagnosticLogger, exception: any)
122
122
  let value:string = "" + exception;
123
123
  if (value.length > DataSanitizerValues.MAX_EXCEPTION_LENGTH) {
124
124
  exceptionTrunc = value.substring(0, DataSanitizerValues.MAX_EXCEPTION_LENGTH);
125
- logger && logger.throwInternal(
125
+ _throwInternal(logger,
126
126
  eLoggingSeverity.WARNING, _InternalMessageId.ExceptionTruncated, "exception is too long, it has been truncated to " + DataSanitizerValues.MAX_EXCEPTION_LENGTH + " characters.",
127
127
  { exception }, true);
128
128
  }
@@ -140,7 +140,7 @@ export function dataSanitizeProperties(logger: IDiagnosticLogger, properties: an
140
140
  try {
141
141
  value = getJSON().stringify(value);
142
142
  } catch (e) {
143
- logger && logger.throwInternal(eLoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e}, true);
143
+ _throwInternal(logger,eLoggingSeverity.WARNING, _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e}, true);
144
144
  }
145
145
  }
146
146
  value = dataSanitizeString(logger, value, DataSanitizerValues.MAX_PROPERTY_LENGTH);
@@ -177,7 +177,7 @@ export function dataSanitizeInput(logger: IDiagnosticLogger, input: any, maxLeng
177
177
  input = strTrim(input);
178
178
  if (input.length > maxLength) {
179
179
  inputTrunc = input.substring(0, maxLength);
180
- logger && logger.throwInternal(
180
+ _throwInternal(logger,
181
181
  eLoggingSeverity.WARNING,
182
182
  _msgId,
183
183
  "input is too long, it has been truncated to " + maxLength + " characters.",
@@ -282,4 +282,4 @@ export const DataSanitizer: IDataSanitizer = {
282
282
  sanitizeInput: dataSanitizeInput,
283
283
  padNumber: dsPadNumber,
284
284
  trim: strTrim
285
- };
285
+ };
@@ -62,7 +62,7 @@ export { stringToBoolOrDefault, msToTimeSpan, getExtensionByName, isCrossOriginE
62
62
  export { isBeaconsSupported as isBeaconApiSupported } from "@microsoft/applicationinsights-core-js"
63
63
  export { createDomEvent } from "./DomHelperFuncs";
64
64
  export {
65
- utlDisableStorage, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage, utlRemoveStorage,
65
+ utlDisableStorage, utlEnableStorage, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage, utlRemoveStorage,
66
66
  utlCanUseSessionStorage, utlGetSessionStorageKeys, utlGetSessionStorage, utlSetSessionStorage, utlRemoveSessionStorage
67
67
  } from "./StorageHelperFuncs";
68
68
  export { urlParseUrl, urlGetAbsoluteUrl, urlGetPathName, urlGetCompleteUrl, urlParseHost, urlParseFullHost } from "./UrlHelperFuncs";
@@ -1,10 +1,22 @@
1
1
  import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
2
+ /**
3
+ * Disables the global SDK usage of local or session storage if available
4
+ */
2
5
  export declare function utlDisableStorage(): void;
3
- export declare function utlCanUseLocalStorage(): boolean;
6
+ /**
7
+ * Re-enables the global SDK usage of local or session storage if available
8
+ */
9
+ export declare function utlEnableStorage(): void;
10
+ /**
11
+ * Returns whether LocalStorage can be used, if the reset parameter is passed a true this will override
12
+ * any previous disable calls.
13
+ * @param reset - Should the usage be reset and determined only based on whether LocalStorage is available
14
+ */
15
+ export declare function utlCanUseLocalStorage(reset?: boolean): boolean;
4
16
  export declare function utlGetLocalStorage(logger: IDiagnosticLogger, name: string): string;
5
17
  export declare function utlSetLocalStorage(logger: IDiagnosticLogger, name: string, data: string): boolean;
6
18
  export declare function utlRemoveStorage(logger: IDiagnosticLogger, name: string): boolean;
7
- export declare function utlCanUseSessionStorage(): boolean;
19
+ export declare function utlCanUseSessionStorage(reset?: boolean): boolean;
8
20
  export declare function utlGetSessionStorageKeys(): string[];
9
21
  export declare function utlGetSessionStorage(logger: IDiagnosticLogger, name: string): string;
10
22
  export declare function utlSetSessionStorage(logger: IDiagnosticLogger, name: string, data: string): boolean;
@@ -50,7 +50,7 @@ export { eDistributedTracingModes, DistributedTracingModes } from "./Enums";
50
50
  export { stringToBoolOrDefault, msToTimeSpan, getExtensionByName, isCrossOriginError } from "./HelperFuncs";
51
51
  export { isBeaconsSupported as isBeaconApiSupported } from "@microsoft/applicationinsights-core-js";
52
52
  export { createDomEvent } from "./DomHelperFuncs";
53
- export { utlDisableStorage, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage, utlRemoveStorage, utlCanUseSessionStorage, utlGetSessionStorageKeys, utlGetSessionStorage, utlSetSessionStorage, utlRemoveSessionStorage } from "./StorageHelperFuncs";
53
+ export { utlDisableStorage, utlEnableStorage, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage, utlRemoveStorage, utlCanUseSessionStorage, utlGetSessionStorageKeys, utlGetSessionStorage, utlSetSessionStorage, utlRemoveSessionStorage } from "./StorageHelperFuncs";
54
54
  export { urlParseUrl, urlGetAbsoluteUrl, urlGetPathName, urlGetCompleteUrl, urlParseHost, urlParseFullHost } from "./UrlHelperFuncs";
55
55
  export declare const PropertiesPluginIdentifier = "AppInsightsPropertiesPlugin";
56
56
  export declare const BreezeChannelIdentifier = "AppInsightsChannelPlugin";