@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.
- package/browser/applicationinsights-common.integrity.json +9 -9
- package/browser/applicationinsights-common.js +445 -23
- package/browser/applicationinsights-common.js.map +1 -1
- package/browser/applicationinsights-common.min.js +2 -2
- package/browser/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.api.json +69 -10
- package/dist/applicationinsights-common.api.md +7 -4
- package/dist/applicationinsights-common.d.ts +16 -3
- package/dist/applicationinsights-common.js +445 -23
- package/dist/applicationinsights-common.js.map +1 -1
- package/dist/applicationinsights-common.min.js +2 -2
- package/dist/applicationinsights-common.min.js.map +1 -1
- package/dist/applicationinsights-common.rollup.d.ts +16 -3
- package/dist-esm/ConnectionStringParser.js +1 -1
- package/dist-esm/Constants.js +1 -1
- package/dist-esm/DomHelperFuncs.js +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/HelperFuncs.js +1 -1
- package/dist-esm/Interfaces/ConnectionString.js +1 -1
- package/dist-esm/Interfaces/Context/IApplication.js +1 -1
- package/dist-esm/Interfaces/Context/IDevice.js +1 -1
- package/dist-esm/Interfaces/Context/IInternal.js +1 -1
- package/dist-esm/Interfaces/Context/ILocation.js +1 -1
- package/dist-esm/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-esm/Interfaces/Context/ISample.js +1 -1
- package/dist-esm/Interfaces/Context/ISession.js +1 -1
- package/dist-esm/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-esm/Interfaces/Context/IUser.js +1 -1
- package/dist-esm/Interfaces/Context/IWeb.js +1 -1
- package/dist-esm/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-esm/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-esm/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-esm/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/AvailabilityData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/Base.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/ContextTagKeys.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/Data.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/DataPoint.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/DataPointType.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/DependencyKind.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/DependencySourceType.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/Domain.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/Envelope.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/EventData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/ExceptionData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/ExceptionDetails.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/MessageData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/MetricData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/PageViewData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/PageViewPerfData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/RemoteDependencyData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/RequestData.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/SeverityLevel.js +1 -1
- package/dist-esm/Interfaces/Contracts/Generated/StackFrame.js +1 -1
- package/dist-esm/Interfaces/Contracts/IBase.js +1 -1
- package/dist-esm/Interfaces/Contracts/IData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-esm/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-esm/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-esm/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-esm/Interfaces/Contracts/SeverityLevel.js +1 -1
- package/dist-esm/Interfaces/IAppInsights.js +1 -1
- package/dist-esm/Interfaces/IChannelControlsAI.js +1 -1
- package/dist-esm/Interfaces/IConfig.js +1 -1
- package/dist-esm/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-esm/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-esm/Interfaces/IEventTelemetry.js +1 -1
- package/dist-esm/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-esm/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-esm/Interfaces/IPartC.js +1 -1
- package/dist-esm/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-esm/Interfaces/IRequestContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryContext.js +1 -1
- package/dist-esm/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-esm/Interfaces/PartAExtensions.js +1 -1
- package/dist-esm/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-esm/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-esm/RequestResponseHeaders.js +1 -1
- package/dist-esm/StorageHelperFuncs.js +27 -12
- package/dist-esm/StorageHelperFuncs.js.map +1 -1
- package/dist-esm/Telemetry/Common/Base.js +1 -1
- package/dist-esm/Telemetry/Common/Data.js +1 -1
- package/dist-esm/Telemetry/Common/DataPoint.js +1 -1
- package/dist-esm/Telemetry/Common/DataSanitizer.js +8 -8
- package/dist-esm/Telemetry/Common/DataSanitizer.js.map +1 -1
- package/dist-esm/Telemetry/Common/Envelope.js +1 -1
- package/dist-esm/Telemetry/Event.js +1 -1
- package/dist-esm/Telemetry/Exception.js +1 -1
- package/dist-esm/Telemetry/Metric.js +1 -1
- package/dist-esm/Telemetry/PageView.js +1 -1
- package/dist-esm/Telemetry/PageViewPerformance.js +1 -1
- package/dist-esm/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-esm/Telemetry/Trace.js +1 -1
- package/dist-esm/TelemetryItemCreator.js +1 -1
- package/dist-esm/UrlHelperFuncs.js +1 -1
- package/dist-esm/Util.js +1 -1
- package/dist-esm/applicationinsights-common.js +2 -2
- package/dist-esm/applicationinsights-common.js.map +1 -1
- package/package.json +2 -2
- package/src/StorageHelperFuncs.ts +28 -11
- package/src/Telemetry/Common/DataSanitizer.ts +8 -8
- package/src/applicationinsights-common.ts +1 -1
- package/types/StorageHelperFuncs.d.ts +14 -2
- 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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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";
|