@microsoft/applicationinsights-common 3.4.0-nightlybeta3.2505-35 → 3.4.0-nightlybeta3.2507-23
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/es5/applicationinsights-common.cjs.js +794 -202
- package/browser/es5/applicationinsights-common.cjs.js.map +1 -1
- package/browser/es5/applicationinsights-common.cjs.min.js +2 -2
- package/browser/es5/applicationinsights-common.cjs.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.js +796 -204
- package/browser/es5/applicationinsights-common.gbl.js.map +1 -1
- package/browser/es5/applicationinsights-common.gbl.min.js +2 -2
- package/browser/es5/applicationinsights-common.gbl.min.js.map +1 -1
- package/browser/es5/applicationinsights-common.integrity.json +25 -25
- package/browser/es5/applicationinsights-common.js +796 -204
- package/browser/es5/applicationinsights-common.js.map +1 -1
- package/browser/es5/applicationinsights-common.min.js +2 -2
- package/browser/es5/applicationinsights-common.min.js.map +1 -1
- package/dist/es5/applicationinsights-common.js +794 -202
- package/dist/es5/applicationinsights-common.js.map +1 -1
- package/dist/es5/applicationinsights-common.min.js +2 -2
- package/dist/es5/applicationinsights-common.min.js.map +1 -1
- package/dist-es5/ConnectionStringParser.js +1 -1
- package/dist-es5/Constants.js +1 -1
- package/dist-es5/DomHelperFuncs.js +1 -1
- package/dist-es5/Enums.js +13 -8
- package/dist-es5/Enums.js.map +1 -1
- package/dist-es5/HelperFuncs.js +1 -1
- package/dist-es5/Interfaces/ConnectionString.js +1 -1
- package/dist-es5/Interfaces/Context/IApplication.js +1 -1
- package/dist-es5/Interfaces/Context/IDevice.js +1 -1
- package/dist-es5/Interfaces/Context/IInternal.js +1 -1
- package/dist-es5/Interfaces/Context/ILocation.js +1 -1
- package/dist-es5/Interfaces/Context/IOperatingSystem.js +1 -1
- package/dist-es5/Interfaces/Context/ISample.js +1 -1
- package/dist-es5/Interfaces/Context/ISession.js +1 -1
- package/dist-es5/Interfaces/Context/ISessionManager.js +1 -1
- package/dist-es5/Interfaces/Context/ITelemetryTrace.js +1 -1
- package/dist-es5/Interfaces/Context/IUser.js +1 -1
- package/dist-es5/Interfaces/Context/IWeb.js +1 -1
- package/dist-es5/Interfaces/Contracts/AvailabilityData.js +1 -1
- package/dist-es5/Interfaces/Contracts/ContextTagKeys.js +1 -1
- package/dist-es5/Interfaces/Contracts/DataPointType.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencyKind.js +1 -1
- package/dist-es5/Interfaces/Contracts/DependencySourceType.js +1 -1
- package/dist-es5/Interfaces/Contracts/IBase.js +1 -1
- package/dist-es5/Interfaces/Contracts/IData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDataPoint.js +1 -1
- package/dist-es5/Interfaces/Contracts/IDomain.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Contracts/IEventData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IExceptionDetails.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMessageData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IMetricData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IPageViewPerfData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IRemoteDependencyData.js +1 -1
- package/dist-es5/Interfaces/Contracts/IStackFrame.js +1 -1
- package/dist-es5/Interfaces/Contracts/RequestData.js +1 -1
- package/dist-es5/Interfaces/Contracts/SeverityLevel.js +3 -3
- package/dist-es5/Interfaces/Contracts/SeverityLevel.js.map +1 -1
- package/dist-es5/Interfaces/IAppInsights.js +1 -1
- package/dist-es5/Interfaces/IConfig.js +1 -1
- package/dist-es5/Interfaces/ICorrelationConfig.js +1 -1
- package/dist-es5/Interfaces/IDependencyTelemetry.js +1 -1
- package/dist-es5/Interfaces/IEventTelemetry.js +1 -1
- package/dist-es5/Interfaces/IExceptionTelemetry.js +1 -1
- package/dist-es5/Interfaces/IMetricTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewPerformanceTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPageViewTelemetry.js +1 -1
- package/dist-es5/Interfaces/IPartC.js +1 -1
- package/dist-es5/Interfaces/IPropertiesPlugin.js +1 -1
- package/dist-es5/Interfaces/IRequestContext.js +1 -1
- package/dist-es5/Interfaces/IStorageBuffer.js +1 -1
- package/dist-es5/Interfaces/ITelemetryContext.js +1 -1
- package/dist-es5/Interfaces/IThrottleMgr.js +1 -1
- package/dist-es5/Interfaces/ITraceTelemetry.js +1 -1
- package/dist-es5/Interfaces/PartAExtensions.js +1 -1
- package/dist-es5/Interfaces/Telemetry/IEnvelope.js +1 -1
- package/dist-es5/Interfaces/Telemetry/ISerializable.js +1 -1
- package/dist-es5/Offline.js +1 -1
- package/dist-es5/RequestResponseHeaders.js +3 -3
- package/dist-es5/RequestResponseHeaders.js.map +1 -1
- package/dist-es5/StorageHelperFuncs.js +1 -1
- package/dist-es5/Telemetry/Common/Data.js +1 -1
- package/dist-es5/Telemetry/Common/DataPoint.js +1 -1
- package/dist-es5/Telemetry/Common/DataSanitizer.js +7 -4
- package/dist-es5/Telemetry/Common/DataSanitizer.js.map +1 -1
- package/dist-es5/Telemetry/Common/Envelope.js +1 -1
- package/dist-es5/Telemetry/Event.js +1 -1
- package/dist-es5/Telemetry/Exception.js +1 -1
- package/dist-es5/Telemetry/Metric.js +1 -1
- package/dist-es5/Telemetry/PageView.js +1 -1
- package/dist-es5/Telemetry/PageViewPerformance.js +1 -1
- package/dist-es5/Telemetry/RemoteDependencyData.js +1 -1
- package/dist-es5/Telemetry/Trace.js +1 -1
- package/dist-es5/TelemetryItemCreator.js +1 -1
- package/dist-es5/ThrottleMgr.js +1 -1
- package/dist-es5/UrlHelperFuncs.js +1 -1
- package/dist-es5/Util.js +13 -38
- package/dist-es5/Util.js.map +1 -1
- package/dist-es5/__DynamicConstants.js +3 -2
- package/dist-es5/__DynamicConstants.js.map +1 -1
- package/dist-es5/applicationinsights-common.js +1 -1
- package/package.json +2 -2
- package/types/applicationinsights-common.d.ts +165 -15
- package/types/applicationinsights-common.namespaced.d.ts +377 -22
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
import { _throwInternal, getJSON, hasJSON, isObject, objForEachKey, strTrim } from "@microsoft/applicationinsights-core-js";
|
|
8
|
-
import { asString, strSubstr, strSubstring } from "@nevware21/ts-utils";
|
|
7
|
+
import { _throwInternal, fieldRedaction, getJSON, hasJSON, isObject, objForEachKey, strTrim } from "@microsoft/applicationinsights-core-js";
|
|
8
|
+
import { asString, isString, strSubstr, strSubstring } from "@nevware21/ts-utils";
|
|
9
9
|
import { _DYN_LENGTH, _DYN_STRINGIFY, _DYN_TO_STRING } from "../../__DynamicConstants";
|
|
10
10
|
export function dataSanitizeKeyAndAddUniqueness(logger, key, map) {
|
|
11
11
|
var origLength = key[_DYN_LENGTH /* @min:%2elength */];
|
|
@@ -48,7 +48,10 @@ export function dataSanitizeString(logger, value, maxLength) {
|
|
|
48
48
|
}
|
|
49
49
|
return valueTrunc || value;
|
|
50
50
|
}
|
|
51
|
-
export function dataSanitizeUrl(logger, url) {
|
|
51
|
+
export function dataSanitizeUrl(logger, url, config) {
|
|
52
|
+
if (isString(url)) {
|
|
53
|
+
url = fieldRedaction(url, config);
|
|
54
|
+
}
|
|
52
55
|
return dataSanitizeInput(logger, url, 2048 /* DataSanitizerValues.MAX_URL_LENGTH */, 66 /* _eInternalMessageId.UrlTooLong */);
|
|
53
56
|
}
|
|
54
57
|
export function dataSanitizeMessage(logger, message) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataSanitizer.js.map","sources":["DataSanitizer.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _throwInternal, getJSON, hasJSON, isObject, objForEachKey, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { asString, strSubstr, strSubstring } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_STRINGIFY, _DYN_TO_STRING } from \"../../__DynamicConstants\";\r\nexport function dataSanitizeKeyAndAddUniqueness(logger, key, map) {\r\n var origLength = key[_DYN_LENGTH /* @min:%2elength */];\r\n var field = dataSanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field[_DYN_LENGTH /* @min:%2elength */] !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = strSubstring(field, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ - 3) + dsPadNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n}\r\nexport function dataSanitizeKey(logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitespace\r\n name = strTrim(asString(name));\r\n // truncate the string to 150 chars\r\n if (name[_DYN_LENGTH /* @min:%2elength */] > 150 /* DataSanitizerValues.MAX_NAME_LENGTH */) {\r\n nameTrunc = strSubstring(name, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 57 /* _eInternalMessageId.NameTooLong */, \"name is too long. It has been truncated to \" + 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n}\r\nexport function dataSanitizeString(logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; // in case default parameters dont work\r\n value = strTrim(asString(value));\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n valueTrunc = strSubstring(value, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 61 /* _eInternalMessageId.StringValueTooLong */, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n}\r\nexport function dataSanitizeUrl(logger, url) {\r\n return dataSanitizeInput(logger, url, 2048 /* DataSanitizerValues.MAX_URL_LENGTH */, 66 /* _eInternalMessageId.UrlTooLong */);\r\n}\r\nexport function dataSanitizeMessage(logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */) {\r\n messageTrunc = strSubstring(message, 0, 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 56 /* _eInternalMessageId.MessageTruncated */, \"message is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */ + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n}\r\nexport function dataSanitizeException(logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n // Make surte its a string\r\n var value = \"\" + exception;\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */) {\r\n exceptionTrunc = strSubstring(value, 0, 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 52 /* _eInternalMessageId.ExceptionTruncated */, \"exception is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */ + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n}\r\nexport function dataSanitizeProperties(logger, properties) {\r\n if (properties) {\r\n var tempProps_1 = {};\r\n objForEachKey(properties, function (prop, value) {\r\n if (isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 49 /* _eInternalMessageId.CannotSerializeObjectNonSerializable */, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = dataSanitizeString(logger, value, 8192 /* DataSanitizerValues.MAX_PROPERTY_LENGTH */);\r\n prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1);\r\n tempProps_1[prop] = value;\r\n });\r\n properties = tempProps_1;\r\n }\r\n return properties;\r\n}\r\nexport function dataSanitizeMeasurements(logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements_1 = {};\r\n objForEachKey(measurements, function (measure, value) {\r\n measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1);\r\n tempMeasurements_1[measure] = value;\r\n });\r\n measurements = tempMeasurements_1;\r\n }\r\n return measurements;\r\n}\r\nexport function dataSanitizeId(logger, id) {\r\n return id ? dataSanitizeInput(logger, id, 128 /* DataSanitizerValues.MAX_ID_LENGTH */, 69 /* _eInternalMessageId.IdTooLong */)[_DYN_TO_STRING /* @min:%2etoString */]() : id;\r\n}\r\nexport function dataSanitizeInput(logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = strTrim(asString(input));\r\n if (input[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n inputTrunc = strSubstring(input, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n}\r\nexport function dsPadNumber(num) {\r\n var s = \"00\" + num;\r\n return strSubstr(s, s[_DYN_LENGTH /* @min:%2elength */] - 3);\r\n}\r\n//# sourceMappingURL=DataSanitizer.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"DataSanitizer.js.map","sources":["DataSanitizer.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _throwInternal, fieldRedaction, getJSON, hasJSON, isObject, objForEachKey, strTrim } from \"@microsoft/applicationinsights-core-js\";\r\nimport { asString, isString, strSubstr, strSubstring } from \"@nevware21/ts-utils\";\r\nimport { _DYN_LENGTH, _DYN_STRINGIFY, _DYN_TO_STRING } from \"../../__DynamicConstants\";\r\nexport function dataSanitizeKeyAndAddUniqueness(logger, key, map) {\r\n var origLength = key[_DYN_LENGTH /* @min:%2elength */];\r\n var field = dataSanitizeKey(logger, key);\r\n // validation truncated the length. We need to add uniqueness\r\n if (field[_DYN_LENGTH /* @min:%2elength */] !== origLength) {\r\n var i = 0;\r\n var uniqueField = field;\r\n while (map[uniqueField] !== undefined) {\r\n i++;\r\n uniqueField = strSubstring(field, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ - 3) + dsPadNumber(i);\r\n }\r\n field = uniqueField;\r\n }\r\n return field;\r\n}\r\nexport function dataSanitizeKey(logger, name) {\r\n var nameTrunc;\r\n if (name) {\r\n // Remove any leading or trailing whitespace\r\n name = strTrim(asString(name));\r\n // truncate the string to 150 chars\r\n if (name[_DYN_LENGTH /* @min:%2elength */] > 150 /* DataSanitizerValues.MAX_NAME_LENGTH */) {\r\n nameTrunc = strSubstring(name, 0, 150 /* DataSanitizerValues.MAX_NAME_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 57 /* _eInternalMessageId.NameTooLong */, \"name is too long. It has been truncated to \" + 150 /* DataSanitizerValues.MAX_NAME_LENGTH */ + \" characters.\", { name: name }, true);\r\n }\r\n }\r\n return nameTrunc || name;\r\n}\r\nexport function dataSanitizeString(logger, value, maxLength) {\r\n if (maxLength === void 0) { maxLength = 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; }\r\n var valueTrunc;\r\n if (value) {\r\n maxLength = maxLength ? maxLength : 1024 /* DataSanitizerValues.MAX_STRING_LENGTH */; // in case default parameters dont work\r\n value = strTrim(asString(value));\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n valueTrunc = strSubstring(value, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 61 /* _eInternalMessageId.StringValueTooLong */, \"string value is too long. It has been truncated to \" + maxLength + \" characters.\", { value: value }, true);\r\n }\r\n }\r\n return valueTrunc || value;\r\n}\r\nexport function dataSanitizeUrl(logger, url, config) {\r\n if (isString(url)) {\r\n url = fieldRedaction(url, config);\r\n }\r\n return dataSanitizeInput(logger, url, 2048 /* DataSanitizerValues.MAX_URL_LENGTH */, 66 /* _eInternalMessageId.UrlTooLong */);\r\n}\r\nexport function dataSanitizeMessage(logger, message) {\r\n var messageTrunc;\r\n if (message) {\r\n if (message[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */) {\r\n messageTrunc = strSubstring(message, 0, 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 56 /* _eInternalMessageId.MessageTruncated */, \"message is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_MESSAGE_LENGTH */ + \" characters.\", { message: message }, true);\r\n }\r\n }\r\n return messageTrunc || message;\r\n}\r\nexport function dataSanitizeException(logger, exception) {\r\n var exceptionTrunc;\r\n if (exception) {\r\n // Make surte its a string\r\n var value = \"\" + exception;\r\n if (value[_DYN_LENGTH /* @min:%2elength */] > 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */) {\r\n exceptionTrunc = strSubstring(value, 0, 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 52 /* _eInternalMessageId.ExceptionTruncated */, \"exception is too long, it has been truncated to \" + 32768 /* DataSanitizerValues.MAX_EXCEPTION_LENGTH */ + \" characters.\", { exception: exception }, true);\r\n }\r\n }\r\n return exceptionTrunc || exception;\r\n}\r\nexport function dataSanitizeProperties(logger, properties) {\r\n if (properties) {\r\n var tempProps_1 = {};\r\n objForEachKey(properties, function (prop, value) {\r\n if (isObject(value) && hasJSON()) {\r\n // Stringify any part C properties\r\n try {\r\n value = getJSON()[_DYN_STRINGIFY /* @min:%2estringify */](value);\r\n }\r\n catch (e) {\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 49 /* _eInternalMessageId.CannotSerializeObjectNonSerializable */, \"custom property is not valid\", { exception: e }, true);\r\n }\r\n }\r\n value = dataSanitizeString(logger, value, 8192 /* DataSanitizerValues.MAX_PROPERTY_LENGTH */);\r\n prop = dataSanitizeKeyAndAddUniqueness(logger, prop, tempProps_1);\r\n tempProps_1[prop] = value;\r\n });\r\n properties = tempProps_1;\r\n }\r\n return properties;\r\n}\r\nexport function dataSanitizeMeasurements(logger, measurements) {\r\n if (measurements) {\r\n var tempMeasurements_1 = {};\r\n objForEachKey(measurements, function (measure, value) {\r\n measure = dataSanitizeKeyAndAddUniqueness(logger, measure, tempMeasurements_1);\r\n tempMeasurements_1[measure] = value;\r\n });\r\n measurements = tempMeasurements_1;\r\n }\r\n return measurements;\r\n}\r\nexport function dataSanitizeId(logger, id) {\r\n return id ? dataSanitizeInput(logger, id, 128 /* DataSanitizerValues.MAX_ID_LENGTH */, 69 /* _eInternalMessageId.IdTooLong */)[_DYN_TO_STRING /* @min:%2etoString */]() : id;\r\n}\r\nexport function dataSanitizeInput(logger, input, maxLength, _msgId) {\r\n var inputTrunc;\r\n if (input) {\r\n input = strTrim(asString(input));\r\n if (input[_DYN_LENGTH /* @min:%2elength */] > maxLength) {\r\n inputTrunc = strSubstring(input, 0, maxLength);\r\n _throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, _msgId, \"input is too long, it has been truncated to \" + maxLength + \" characters.\", { data: input }, true);\r\n }\r\n }\r\n return inputTrunc || input;\r\n}\r\nexport function dsPadNumber(num) {\r\n var s = \"00\" + num;\r\n return strSubstr(s, s[_DYN_LENGTH /* @min:%2elength */] - 3);\r\n}\r\n//# sourceMappingURL=DataSanitizer.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-es5/ThrottleMgr.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { _throwInternal, arrIndexOf, isNotNullOrUndefined, isNullOrUndefined, onConfigChange, randomValue, safeGetLogger, strTrim } from "@microsoft/applicationinsights-core-js";
|
package/dist-es5/Util.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
import { arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined
|
|
7
|
+
import { arrForEach, arrIndexOf, createDistributedTraceContext, dateNow, getPerformance, isNullOrUndefined } from "@microsoft/applicationinsights-core-js";
|
|
8
8
|
import { strIndexOf } from "@nevware21/ts-utils";
|
|
9
9
|
import { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from "./Constants";
|
|
10
10
|
import { RequestHeaders } from "./RequestResponseHeaders";
|
|
11
11
|
import { dataSanitizeString } from "./Telemetry/Common/DataSanitizer";
|
|
12
12
|
import { urlParseFullHost, urlParseUrl } from "./UrlHelperFuncs";
|
|
13
|
-
import { _DYN_CORRELATION_HEADER_E0, _DYN_LENGTH, _DYN_NAME, _DYN_PATHNAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE } from "./__DynamicConstants";
|
|
13
|
+
import { _DYN_CORRELATION_HEADER_E0, _DYN_LENGTH, _DYN_NAME, _DYN_PATHNAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE, _DYN_TRACE_FLAGS } from "./__DynamicConstants";
|
|
14
14
|
// listing only non-geo specific locations
|
|
15
15
|
var _internalEndpoints = [
|
|
16
16
|
DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH,
|
|
@@ -157,42 +157,17 @@ export function dateTimeUtilsDuration(start, end) {
|
|
|
157
157
|
* @param telemetryTrace - The telemetryTrace instance that is being wrapped
|
|
158
158
|
* @param parentCtx - An optional parent distributed trace instance, almost always undefined as this scenario is only used in the case of multiple property handlers.
|
|
159
159
|
* @returns A new IDistributedTraceContext instance that is backed by the telemetryTrace or temporary object
|
|
160
|
+
* @deprecated This function is deprecated and will be removed in a future version. Use the createDistributedTraceContext function instead and set the necessary properties
|
|
161
|
+
* on the context object directly.
|
|
160
162
|
*/
|
|
161
163
|
export function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) {
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
getTraceId: function () {
|
|
172
|
-
return trace.traceID;
|
|
173
|
-
},
|
|
174
|
-
setTraceId: function (newValue) {
|
|
175
|
-
parentCtx && parentCtx.setTraceId(newValue);
|
|
176
|
-
if (isValidTraceId(newValue)) {
|
|
177
|
-
trace.traceID = newValue;
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
getSpanId: function () {
|
|
181
|
-
return trace.parentID;
|
|
182
|
-
},
|
|
183
|
-
setSpanId: function (newValue) {
|
|
184
|
-
parentCtx && parentCtx.setSpanId(newValue);
|
|
185
|
-
if (isValidSpanId(newValue)) {
|
|
186
|
-
trace.parentID = newValue;
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
getTraceFlags: function () {
|
|
190
|
-
return trace.traceFlags;
|
|
191
|
-
},
|
|
192
|
-
setTraceFlags: function (newTraceFlags) {
|
|
193
|
-
parentCtx && parentCtx.setTraceFlags(newTraceFlags);
|
|
194
|
-
trace.traceFlags = newTraceFlags;
|
|
195
|
-
}
|
|
196
|
-
};
|
|
164
|
+
var traceCtx = createDistributedTraceContext(parentCtx);
|
|
165
|
+
if (telemetryTrace) {
|
|
166
|
+
traceCtx.pageName = telemetryTrace[_DYN_NAME /* @min:%2ename */] || traceCtx.pageName || ""; // The name of the page
|
|
167
|
+
traceCtx.traceId = telemetryTrace.traceID || traceCtx.traceId || ""; // 16 byte hex string
|
|
168
|
+
traceCtx.spanId = telemetryTrace.parentID || traceCtx.spanId || ""; // 8 byte hex string
|
|
169
|
+
traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = (!isNullOrUndefined(telemetryTrace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]) ? telemetryTrace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] : traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]) || 0; // 1 byte hex string
|
|
170
|
+
}
|
|
171
|
+
return traceCtx;
|
|
197
172
|
}
|
|
198
173
|
//# sourceMappingURL=Util.js.map
|
package/dist-es5/Util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.js.map","sources":["Util.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, arrIndexOf, dateNow, getPerformance, isNullOrUndefined, isValidSpanId, isValidTraceId } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from \"./Constants\";\r\nimport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nimport { dataSanitizeString } from \"./Telemetry/Common/DataSanitizer\";\r\nimport { urlParseFullHost, urlParseUrl } from \"./UrlHelperFuncs\";\r\nimport { _DYN_CORRELATION_HEADER_E0, _DYN_LENGTH, _DYN_NAME, _DYN_PATHNAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE } from \"./__DynamicConstants\";\r\n// listing only non-geo specific locations\r\nvar _internalEndpoints = [\r\n DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH,\r\n \"https://breeze.aimon.applicationinsights.io\" + DEFAULT_BREEZE_PATH,\r\n \"https://dc-int.services.visualstudio.com\" + DEFAULT_BREEZE_PATH\r\n];\r\nvar _correlationIdPrefix = \"cid-v1:\";\r\nexport function isInternalApplicationInsightsEndpoint(endpointUrl) {\r\n return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]()) !== -1;\r\n}\r\nexport function correlationIdSetPrefix(prefix) {\r\n _correlationIdPrefix = prefix;\r\n}\r\nexport function correlationIdGetPrefix() {\r\n return _correlationIdPrefix;\r\n}\r\n/**\r\n * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.\r\n * Headers are always included if the current domain matches the request domain. If they do not match (CORS),\r\n * they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.\r\n * Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must\r\n * manually supply domains to include correlation headers on. Else, no headers will be included at all.\r\n */\r\nexport function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHost) {\r\n if (!requestUrl || (config && config.disableCorrelationHeaders)) {\r\n return false;\r\n }\r\n if (config && config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */]) {\r\n for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */][i].test(requestUrl)) {\r\n return false;\r\n }\r\n }\r\n }\r\n var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n if (requestHost && (strIndexOf(requestHost, \":443\") !== -1 || strIndexOf(requestHost, \":80\") !== -1)) {\r\n // [Bug #1260] IE can include the port even for http and https URLs so if present\r\n // try and parse it to remove if it matches the default protocol port\r\n requestHost = (urlParseFullHost(requestUrl, true) || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n }\r\n if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) {\r\n return false;\r\n }\r\n var includedDomains = config && config.correlationHeaderDomains;\r\n if (includedDomains) {\r\n var matchExists_1;\r\n arrForEach(includedDomains, function (domain) {\r\n var regex = new RegExp(domain.toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n matchExists_1 = matchExists_1 || regex.test(requestHost);\r\n });\r\n if (!matchExists_1) {\r\n return false;\r\n }\r\n }\r\n var excludedDomains = config && config.correlationHeaderExcludedDomains;\r\n if (!excludedDomains || excludedDomains[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < excludedDomains[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n if (regex.test(requestHost)) {\r\n return false;\r\n }\r\n }\r\n // if we don't know anything about the requestHost, require the user to use included/excludedDomains.\r\n // Previously we always returned false for a falsy requestHost\r\n return requestHost && requestHost[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n}\r\n/**\r\n * Combines target appId and target role name from response header.\r\n */\r\nexport function correlationIdGetCorrelationContext(responseHeader) {\r\n if (responseHeader) {\r\n var correlationId = correlationIdGetCorrelationContextValue(responseHeader, RequestHeaders[1 /* eRequestHeaders.requestContextTargetKey */]);\r\n if (correlationId && correlationId !== _correlationIdPrefix) {\r\n return correlationId;\r\n }\r\n }\r\n}\r\n/**\r\n * Gets key from correlation response header\r\n */\r\nexport function correlationIdGetCorrelationContextValue(responseHeader, key) {\r\n if (responseHeader) {\r\n var keyValues = responseHeader[_DYN_SPLIT /* @min:%2esplit */](\",\");\r\n for (var i = 0; i < keyValues[_DYN_LENGTH /* @min:%2elength */]; ++i) {\r\n var keyValue = keyValues[i][_DYN_SPLIT /* @min:%2esplit */](\"=\");\r\n if (keyValue[_DYN_LENGTH /* @min:%2elength */] === 2 && keyValue[0] === key) {\r\n return keyValue[1];\r\n }\r\n }\r\n }\r\n}\r\nexport function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) {\r\n var target, name = commandName, data = commandName;\r\n if (absoluteUrl && absoluteUrl[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var parsedUrl = urlParseUrl(absoluteUrl);\r\n target = parsedUrl.host;\r\n if (!name) {\r\n if (parsedUrl[_DYN_PATHNAME /* @min:%2epathname */] != null) {\r\n var pathName = (parsedUrl.pathname[_DYN_LENGTH /* @min:%2elength */] === 0) ? \"/\" : parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n if (pathName.charAt(0) !== \"/\") {\r\n pathName = \"/\" + pathName;\r\n }\r\n data = parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n name = dataSanitizeString(logger, method ? method + \" \" + pathName : pathName);\r\n }\r\n else {\r\n name = dataSanitizeString(logger, absoluteUrl);\r\n }\r\n }\r\n }\r\n else {\r\n target = commandName;\r\n name = commandName;\r\n }\r\n return {\r\n target: target,\r\n name: name,\r\n data: data\r\n };\r\n}\r\nexport function dateTimeUtilsNow() {\r\n // returns the window or webworker performance object\r\n var perf = getPerformance();\r\n if (perf && perf.now && perf.timing) {\r\n var now = perf.now() + perf.timing.navigationStart;\r\n // Known issue with IE where this calculation can be negative, so if it is then ignore and fallback\r\n if (now > 0) {\r\n return now;\r\n }\r\n }\r\n return dateNow();\r\n}\r\nexport function dateTimeUtilsDuration(start, end) {\r\n var result = null;\r\n if (start !== 0 && end !== 0 && !isNullOrUndefined(start) && !isNullOrUndefined(end)) {\r\n result = end - start;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Creates a IDistributedTraceContext from an optional telemetryTrace\r\n * @param telemetryTrace - The telemetryTrace instance that is being wrapped\r\n * @param parentCtx - An optional parent distributed trace instance, almost always undefined as this scenario is only used in the case of multiple property handlers.\r\n * @returns A new IDistributedTraceContext instance that is backed by the telemetryTrace or temporary object\r\n */\r\nexport function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) {\r\n var trace = telemetryTrace || {};\r\n return {\r\n getName: function () {\r\n return trace[_DYN_NAME /* @min:%2ename */];\r\n },\r\n setName: function (newValue) {\r\n parentCtx && parentCtx.setName(newValue);\r\n trace[_DYN_NAME /* @min:%2ename */] = newValue;\r\n },\r\n getTraceId: function () {\r\n return trace.traceID;\r\n },\r\n setTraceId: function (newValue) {\r\n parentCtx && parentCtx.setTraceId(newValue);\r\n if (isValidTraceId(newValue)) {\r\n trace.traceID = newValue;\r\n }\r\n },\r\n getSpanId: function () {\r\n return trace.parentID;\r\n },\r\n setSpanId: function (newValue) {\r\n parentCtx && parentCtx.setSpanId(newValue);\r\n if (isValidSpanId(newValue)) {\r\n trace.parentID = newValue;\r\n }\r\n },\r\n getTraceFlags: function () {\r\n return trace.traceFlags;\r\n },\r\n setTraceFlags: function (newTraceFlags) {\r\n parentCtx && parentCtx.setTraceFlags(newTraceFlags);\r\n trace.traceFlags = newTraceFlags;\r\n }\r\n };\r\n}\r\n//# sourceMappingURL=Util.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"Util.js.map","sources":["Util.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { arrForEach, arrIndexOf, createDistributedTraceContext, dateNow, getPerformance, isNullOrUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nimport { strIndexOf } from \"@nevware21/ts-utils\";\r\nimport { DEFAULT_BREEZE_ENDPOINT, DEFAULT_BREEZE_PATH } from \"./Constants\";\r\nimport { RequestHeaders } from \"./RequestResponseHeaders\";\r\nimport { dataSanitizeString } from \"./Telemetry/Common/DataSanitizer\";\r\nimport { urlParseFullHost, urlParseUrl } from \"./UrlHelperFuncs\";\r\nimport { _DYN_CORRELATION_HEADER_E0, _DYN_LENGTH, _DYN_NAME, _DYN_PATHNAME, _DYN_SPLIT, _DYN_TO_LOWER_CASE, _DYN_TRACE_FLAGS } from \"./__DynamicConstants\";\r\n// listing only non-geo specific locations\r\nvar _internalEndpoints = [\r\n DEFAULT_BREEZE_ENDPOINT + DEFAULT_BREEZE_PATH,\r\n \"https://breeze.aimon.applicationinsights.io\" + DEFAULT_BREEZE_PATH,\r\n \"https://dc-int.services.visualstudio.com\" + DEFAULT_BREEZE_PATH\r\n];\r\nvar _correlationIdPrefix = \"cid-v1:\";\r\nexport function isInternalApplicationInsightsEndpoint(endpointUrl) {\r\n return arrIndexOf(_internalEndpoints, endpointUrl[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]()) !== -1;\r\n}\r\nexport function correlationIdSetPrefix(prefix) {\r\n _correlationIdPrefix = prefix;\r\n}\r\nexport function correlationIdGetPrefix() {\r\n return _correlationIdPrefix;\r\n}\r\n/**\r\n * Checks if a request url is not on a excluded domain list and if it is safe to add correlation headers.\r\n * Headers are always included if the current domain matches the request domain. If they do not match (CORS),\r\n * they are regex-ed across correlationHeaderDomains and correlationHeaderExcludedDomains to determine if headers are included.\r\n * Some environments don't give information on currentHost via window.location.host (e.g. Cordova). In these cases, the user must\r\n * manually supply domains to include correlation headers on. Else, no headers will be included at all.\r\n */\r\nexport function correlationIdCanIncludeCorrelationHeader(config, requestUrl, currentHost) {\r\n if (!requestUrl || (config && config.disableCorrelationHeaders)) {\r\n return false;\r\n }\r\n if (config && config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */]) {\r\n for (var i = 0; i < config.correlationHeaderExcludePatterns[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n if (config[_DYN_CORRELATION_HEADER_E0 /* @min:%2ecorrelationHeaderExcludePatterns */][i].test(requestUrl)) {\r\n return false;\r\n }\r\n }\r\n }\r\n var requestHost = urlParseUrl(requestUrl).host[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n if (requestHost && (strIndexOf(requestHost, \":443\") !== -1 || strIndexOf(requestHost, \":80\") !== -1)) {\r\n // [Bug #1260] IE can include the port even for http and https URLs so if present\r\n // try and parse it to remove if it matches the default protocol port\r\n requestHost = (urlParseFullHost(requestUrl, true) || \"\")[_DYN_TO_LOWER_CASE /* @min:%2etoLowerCase */]();\r\n }\r\n if ((!config || !config.enableCorsCorrelation) && (requestHost && requestHost !== currentHost)) {\r\n return false;\r\n }\r\n var includedDomains = config && config.correlationHeaderDomains;\r\n if (includedDomains) {\r\n var matchExists_1;\r\n arrForEach(includedDomains, function (domain) {\r\n var regex = new RegExp(domain.toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n matchExists_1 = matchExists_1 || regex.test(requestHost);\r\n });\r\n if (!matchExists_1) {\r\n return false;\r\n }\r\n }\r\n var excludedDomains = config && config.correlationHeaderExcludedDomains;\r\n if (!excludedDomains || excludedDomains[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n return true;\r\n }\r\n for (var i = 0; i < excludedDomains[_DYN_LENGTH /* @min:%2elength */]; i++) {\r\n var regex = new RegExp(excludedDomains[i].toLowerCase().replace(/\\\\/g, \"\\\\\\\\\").replace(/\\./g, \"\\\\.\").replace(/\\*/g, \".*\"));\r\n if (regex.test(requestHost)) {\r\n return false;\r\n }\r\n }\r\n // if we don't know anything about the requestHost, require the user to use included/excludedDomains.\r\n // Previously we always returned false for a falsy requestHost\r\n return requestHost && requestHost[_DYN_LENGTH /* @min:%2elength */] > 0;\r\n}\r\n/**\r\n * Combines target appId and target role name from response header.\r\n */\r\nexport function correlationIdGetCorrelationContext(responseHeader) {\r\n if (responseHeader) {\r\n var correlationId = correlationIdGetCorrelationContextValue(responseHeader, RequestHeaders[1 /* eRequestHeaders.requestContextTargetKey */]);\r\n if (correlationId && correlationId !== _correlationIdPrefix) {\r\n return correlationId;\r\n }\r\n }\r\n}\r\n/**\r\n * Gets key from correlation response header\r\n */\r\nexport function correlationIdGetCorrelationContextValue(responseHeader, key) {\r\n if (responseHeader) {\r\n var keyValues = responseHeader[_DYN_SPLIT /* @min:%2esplit */](\",\");\r\n for (var i = 0; i < keyValues[_DYN_LENGTH /* @min:%2elength */]; ++i) {\r\n var keyValue = keyValues[i][_DYN_SPLIT /* @min:%2esplit */](\"=\");\r\n if (keyValue[_DYN_LENGTH /* @min:%2elength */] === 2 && keyValue[0] === key) {\r\n return keyValue[1];\r\n }\r\n }\r\n }\r\n}\r\nexport function AjaxHelperParseDependencyPath(logger, absoluteUrl, method, commandName) {\r\n var target, name = commandName, data = commandName;\r\n if (absoluteUrl && absoluteUrl[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var parsedUrl = urlParseUrl(absoluteUrl);\r\n target = parsedUrl.host;\r\n if (!name) {\r\n if (parsedUrl[_DYN_PATHNAME /* @min:%2epathname */] != null) {\r\n var pathName = (parsedUrl.pathname[_DYN_LENGTH /* @min:%2elength */] === 0) ? \"/\" : parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n if (pathName.charAt(0) !== \"/\") {\r\n pathName = \"/\" + pathName;\r\n }\r\n data = parsedUrl[_DYN_PATHNAME /* @min:%2epathname */];\r\n name = dataSanitizeString(logger, method ? method + \" \" + pathName : pathName);\r\n }\r\n else {\r\n name = dataSanitizeString(logger, absoluteUrl);\r\n }\r\n }\r\n }\r\n else {\r\n target = commandName;\r\n name = commandName;\r\n }\r\n return {\r\n target: target,\r\n name: name,\r\n data: data\r\n };\r\n}\r\nexport function dateTimeUtilsNow() {\r\n // returns the window or webworker performance object\r\n var perf = getPerformance();\r\n if (perf && perf.now && perf.timing) {\r\n var now = perf.now() + perf.timing.navigationStart;\r\n // Known issue with IE where this calculation can be negative, so if it is then ignore and fallback\r\n if (now > 0) {\r\n return now;\r\n }\r\n }\r\n return dateNow();\r\n}\r\nexport function dateTimeUtilsDuration(start, end) {\r\n var result = null;\r\n if (start !== 0 && end !== 0 && !isNullOrUndefined(start) && !isNullOrUndefined(end)) {\r\n result = end - start;\r\n }\r\n return result;\r\n}\r\n/**\r\n * Creates a IDistributedTraceContext from an optional telemetryTrace\r\n * @param telemetryTrace - The telemetryTrace instance that is being wrapped\r\n * @param parentCtx - An optional parent distributed trace instance, almost always undefined as this scenario is only used in the case of multiple property handlers.\r\n * @returns A new IDistributedTraceContext instance that is backed by the telemetryTrace or temporary object\r\n * @deprecated This function is deprecated and will be removed in a future version. Use the createDistributedTraceContext function instead and set the necessary properties\r\n * on the context object directly.\r\n */\r\nexport function createDistributedTraceContextFromTrace(telemetryTrace, parentCtx) {\r\n var traceCtx = createDistributedTraceContext(parentCtx);\r\n if (telemetryTrace) {\r\n traceCtx.pageName = telemetryTrace[_DYN_NAME /* @min:%2ename */] || traceCtx.pageName || \"\"; // The name of the page\r\n traceCtx.traceId = telemetryTrace.traceID || traceCtx.traceId || \"\"; // 16 byte hex string\r\n traceCtx.spanId = telemetryTrace.parentID || traceCtx.spanId || \"\"; // 8 byte hex string\r\n traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] = (!isNullOrUndefined(telemetryTrace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]) ? telemetryTrace[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */] : traceCtx[_DYN_TRACE_FLAGS /* @min:%2etraceFlags */]) || 0; // 1 byte hex string\r\n }\r\n return traceCtx;\r\n}\r\n//# sourceMappingURL=Util.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.
|
|
2
|
+
* Application Insights JavaScript SDK - Common, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -25,7 +25,8 @@ export var _DYN_STRINGIFY = "stringify"; // Count: 4
|
|
|
25
25
|
export var _DYN_PATHNAME = "pathname"; // Count: 4
|
|
26
26
|
export var _DYN_MATCH = "match"; // Count: 5
|
|
27
27
|
export var _DYN_CORRELATION_HEADER_E0 = "correlationHeaderExcludePatterns"; // Count: 2
|
|
28
|
-
export var _DYN_NAME = "name"; // Count:
|
|
28
|
+
export var _DYN_NAME = "name"; // Count: 9
|
|
29
|
+
export var _DYN_TRACE_FLAGS = "traceFlags"; // Count: 4
|
|
29
30
|
export var _DYN_EXTENSION_CONFIG = "extensionConfig"; // Count: 4
|
|
30
31
|
export var _DYN_PROPERTIES = "properties"; // Count: 10
|
|
31
32
|
export var _DYN_MEASUREMENTS = "measurements"; // Count: 9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_SPLIT = \"split\"; // Count: 6\r\nexport var _DYN_LENGTH = \"length\"; // Count: 46\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 6\r\nexport var _DYN_INGESTIONENDPOINT = \"ingestionendpoint\"; // Count: 6\r\nexport var _DYN_TO_STRING = \"toString\"; // Count: 8\r\nexport var _DYN_REMOVE_ITEM = \"removeItem\"; // Count: 3\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 5\r\nexport var _DYN_COUNT = \"count\"; // Count: 6\r\nexport var _DYN_PRE_TRIGGER_DATE = \"preTriggerDate\"; // Count: 4\r\nexport var _DYN_GET_UTCDATE = \"getUTCDate\"; // Count: 3\r\nexport var _DYN_STRINGIFY = \"stringify\"; // Count: 4\r\nexport var _DYN_PATHNAME = \"pathname\"; // Count: 4\r\nexport var _DYN_MATCH = \"match\"; // Count: 5\r\nexport var _DYN_CORRELATION_HEADER_E0 = \"correlationHeaderExcludePatterns\"; // Count: 2\r\nexport var _DYN_NAME = \"name\"; // Count:
|
|
1
|
+
{"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES5 which can result in a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_SPLIT = \"split\"; // Count: 6\r\nexport var _DYN_LENGTH = \"length\"; // Count: 46\r\nexport var _DYN_TO_LOWER_CASE = \"toLowerCase\"; // Count: 6\r\nexport var _DYN_INGESTIONENDPOINT = \"ingestionendpoint\"; // Count: 6\r\nexport var _DYN_TO_STRING = \"toString\"; // Count: 8\r\nexport var _DYN_REMOVE_ITEM = \"removeItem\"; // Count: 3\r\nexport var _DYN_MESSAGE = \"message\"; // Count: 5\r\nexport var _DYN_COUNT = \"count\"; // Count: 6\r\nexport var _DYN_PRE_TRIGGER_DATE = \"preTriggerDate\"; // Count: 4\r\nexport var _DYN_GET_UTCDATE = \"getUTCDate\"; // Count: 3\r\nexport var _DYN_STRINGIFY = \"stringify\"; // Count: 4\r\nexport var _DYN_PATHNAME = \"pathname\"; // Count: 4\r\nexport var _DYN_MATCH = \"match\"; // Count: 5\r\nexport var _DYN_CORRELATION_HEADER_E0 = \"correlationHeaderExcludePatterns\"; // Count: 2\r\nexport var _DYN_NAME = \"name\"; // Count: 9\r\nexport var _DYN_TRACE_FLAGS = \"traceFlags\"; // Count: 4\r\nexport var _DYN_EXTENSION_CONFIG = \"extensionConfig\"; // Count: 4\r\nexport var _DYN_PROPERTIES = \"properties\"; // Count: 10\r\nexport var _DYN_MEASUREMENTS = \"measurements\"; // Count: 9\r\nexport var _DYN_SIZE_IN_BYTES = \"sizeInBytes\"; // Count: 4\r\nexport var _DYN_TYPE_NAME = \"typeName\"; // Count: 5\r\nexport var _DYN_EXCEPTIONS = \"exceptions\"; // Count: 5\r\nexport var _DYN_SEVERITY_LEVEL = \"severityLevel\"; // Count: 5\r\nexport var _DYN_PROBLEM_GROUP = \"problemGroup\"; // Count: 3\r\nexport var _DYN_PARSED_STACK = \"parsedStack\"; // Count: 6\r\nexport var _DYN_HAS_FULL_STACK = \"hasFullStack\"; // Count: 5\r\nexport var _DYN_ASSEMBLY = \"assembly\"; // Count: 4\r\nexport var _DYN_FILE_NAME = \"fileName\"; // Count: 9\r\nexport var _DYN_LINE = \"line\"; // Count: 6\r\nexport var _DYN_AI_DATA_CONTRACT = \"aiDataContract\"; // Count: 4\r\nexport var _DYN_DURATION = \"duration\"; // Count: 4\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-common",
|
|
3
|
-
"version": "3.4.0-nightlybeta3.
|
|
3
|
+
"version": "3.4.0-nightlybeta3.2507-23",
|
|
4
4
|
"description": "Microsoft Application Insights Common JavaScript Library",
|
|
5
5
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
6
|
"author": "Microsoft Application Insights Team",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@microsoft/applicationinsights-shims": "3.0.1",
|
|
58
|
-
"@microsoft/applicationinsights-core-js": "3.4.0-nightlybeta3.
|
|
58
|
+
"@microsoft/applicationinsights-core-js": "3.4.0-nightlybeta3.2507-23",
|
|
59
59
|
"@microsoft/dynamicproto-js": "^2.0.3",
|
|
60
60
|
"@nevware21/ts-utils": ">= 0.11.8 < 2.x"
|
|
61
61
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights Common JavaScript Library, 3.4.0-nightlybeta3.
|
|
2
|
+
* Microsoft Application Insights Common JavaScript Library, 3.4.0-nightlybeta3.2507-23
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -112,6 +112,8 @@ export declare function correlationIdSetPrefix(prefix: string): void;
|
|
|
112
112
|
* @param telemetryTrace - The telemetryTrace instance that is being wrapped
|
|
113
113
|
* @param parentCtx - An optional parent distributed trace instance, almost always undefined as this scenario is only used in the case of multiple property handlers.
|
|
114
114
|
* @returns A new IDistributedTraceContext instance that is backed by the telemetryTrace or temporary object
|
|
115
|
+
* @deprecated This function is deprecated and will be removed in a future version. Use the createDistributedTraceContext function instead and set the necessary properties
|
|
116
|
+
* on the context object directly.
|
|
115
117
|
*/
|
|
116
118
|
export declare function createDistributedTraceContextFromTrace(telemetryTrace?: ITelemetryTrace, parentCtx?: IDistributedTraceContext): IDistributedTraceContext;
|
|
117
119
|
|
|
@@ -264,7 +266,7 @@ export declare const enum DataSanitizerValues {
|
|
|
264
266
|
|
|
265
267
|
export declare function dataSanitizeString(logger: IDiagnosticLogger, value: any, maxLength?: number): any;
|
|
266
268
|
|
|
267
|
-
export declare function dataSanitizeUrl(logger: IDiagnosticLogger, url: any): any;
|
|
269
|
+
export declare function dataSanitizeUrl(logger: IDiagnosticLogger, url: any, config?: IConfiguration): any;
|
|
268
270
|
|
|
269
271
|
export declare function dateTimeUtilsDuration(start: number, end: number): number;
|
|
270
272
|
|
|
@@ -291,17 +293,78 @@ export declare function dsPadNumber(num: number): string;
|
|
|
291
293
|
|
|
292
294
|
export declare const enum eDistributedTracingModes {
|
|
293
295
|
/**
|
|
294
|
-
*
|
|
296
|
+
* Send only the legacy Application Insights correlation headers
|
|
297
|
+
*
|
|
298
|
+
* Headers Sent:
|
|
299
|
+
* - `Request-Id` (Legacy Application Insights header for older Server side SDKs)
|
|
300
|
+
*
|
|
301
|
+
* Config Decimal Value: `0` (Zero)
|
|
295
302
|
*/
|
|
296
303
|
AI = 0,
|
|
297
304
|
/**
|
|
298
|
-
* Send both W3C Trace
|
|
305
|
+
* (Default) Send both W3C Trace parent header and back-compatibility Application Insights headers
|
|
306
|
+
* - `Request-Id`
|
|
307
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
308
|
+
*
|
|
309
|
+
* Config Decimal Value: `1` (One)
|
|
299
310
|
*/
|
|
300
311
|
AI_AND_W3C = 1,
|
|
301
312
|
/**
|
|
302
|
-
* Send W3C Trace
|
|
313
|
+
* Send Only the W3C Trace parent header
|
|
314
|
+
*
|
|
315
|
+
* Headers Sent:
|
|
316
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
317
|
+
*
|
|
318
|
+
* Config Decimal Value: `2` (Two)
|
|
319
|
+
*/
|
|
320
|
+
W3C = 2,
|
|
321
|
+
/**
|
|
322
|
+
* @internal
|
|
323
|
+
* Bitwise mask used to separate the base distributed tracing mode from the additional optional
|
|
324
|
+
* tracing modes.
|
|
325
|
+
* @since 3.4.0
|
|
326
|
+
*/
|
|
327
|
+
_BaseMask = 15,
|
|
328
|
+
/**
|
|
329
|
+
* @internal
|
|
330
|
+
* Enabling this bit will send the W3C Trace State header, it is not intended to be used directly
|
|
331
|
+
* or on its own. The code may assume that if this bit is set, then the W3C Trace Context headers
|
|
332
|
+
* will also be included.
|
|
333
|
+
*
|
|
334
|
+
* Config Decimal Value: `16` (Sixteen in decimal)
|
|
335
|
+
* @since 3.4.0
|
|
336
|
+
*/
|
|
337
|
+
_W3CTraceState = 16,
|
|
338
|
+
/**
|
|
339
|
+
* Send all of the W3C Trace Context headers and the W3C Trace State headers and back-compatibility
|
|
340
|
+
* Application Insights headers.
|
|
341
|
+
*
|
|
342
|
+
* Currently sent headers:
|
|
343
|
+
* - `Request-Id` (Legacy Application Insights header for older Server side SDKs)
|
|
344
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
345
|
+
* - [`tracestate`](https://www.w3.org/TR/trace-context/#tracestate-header)
|
|
346
|
+
*
|
|
347
|
+
* NOTE!: Additional headers may be added as part of a future update should the W3C Trace Context specification be updated
|
|
348
|
+
* to include additional headers.
|
|
349
|
+
*
|
|
350
|
+
* Config Decimal Value: `17` (Seventeen in decimal)
|
|
351
|
+
* @since 3.4.0
|
|
303
352
|
*/
|
|
304
|
-
|
|
353
|
+
AI_AND_W3C_TRACE = 17,
|
|
354
|
+
/**
|
|
355
|
+
* Send all of the W3C Trace Context headers and the W3C Trace State headers.
|
|
356
|
+
*
|
|
357
|
+
* Currently sent headers:
|
|
358
|
+
* - [`traceparent`](https://www.w3.org/TR/trace-context/#traceparent-header)
|
|
359
|
+
* - [`tracestate`](https://www.w3.org/TR/trace-context/#tracestate-header)
|
|
360
|
+
*
|
|
361
|
+
* NOTE!: Additional headers may be added as part of a future update should the W3C Trace Context specification be updated
|
|
362
|
+
* to include additional headers.
|
|
363
|
+
*
|
|
364
|
+
* Config Decimal Value: `18` (Eighteen in decimal)
|
|
365
|
+
* @since 3.4.0
|
|
366
|
+
*/
|
|
367
|
+
W3C_TRACE = 18
|
|
305
368
|
}
|
|
306
369
|
|
|
307
370
|
export declare class Envelope implements IEnvelope {
|
|
@@ -1115,9 +1178,68 @@ export declare interface IContextTagKeys {
|
|
|
1115
1178
|
|
|
1116
1179
|
export declare interface ICorrelationConfig {
|
|
1117
1180
|
enableCorsCorrelation: boolean;
|
|
1181
|
+
/**
|
|
1182
|
+
* [Optional] Domains to be excluded from correlation headers.
|
|
1183
|
+
* To override or discard the default, add an array with all domains to be excluded or
|
|
1184
|
+
* an empty array to the configuration.
|
|
1185
|
+
*
|
|
1186
|
+
* @example
|
|
1187
|
+
* ```ts
|
|
1188
|
+
* import { ApplicationInsights } from '@microsoft/applicationinsights-web';
|
|
1189
|
+
* const appInsights = new ApplicationInsights({
|
|
1190
|
+
* config: {
|
|
1191
|
+
* connectionString: 'InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE',
|
|
1192
|
+
* extensionConfig: {
|
|
1193
|
+
* AjaxDependencyPlugin: {
|
|
1194
|
+
* // Both arrays of strings are used to match the request URL against the
|
|
1195
|
+
* // current host and the request URL to determine if correlation headers
|
|
1196
|
+
* // The strings are converted to RegExp objects by translating
|
|
1197
|
+
* // - `.` to `\\.` (to match a literal dot)
|
|
1198
|
+
* // - `*` to `.*` (to match any character)
|
|
1199
|
+
* // - `\` to `\\` (to match a literal slash)
|
|
1200
|
+
* // All other characters are ignored and passed to the RegExp constructor
|
|
1201
|
+
* correlationHeaderExcludedDomains: ["test", "*.azure.com", "ignore.microsoft.com"],
|
|
1202
|
+
* correlationHeaderDomains: ["azure.com", "prefix.bing.com", "*.microsoft.com", "example.com"]
|
|
1203
|
+
* }
|
|
1204
|
+
* }
|
|
1205
|
+
* });
|
|
1206
|
+
* appInsights.loadAppInsights();
|
|
1207
|
+
* appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
|
|
1208
|
+
* ```
|
|
1209
|
+
*/
|
|
1118
1210
|
correlationHeaderExcludedDomains: string[];
|
|
1211
|
+
/**
|
|
1212
|
+
* [Optional] Domains to be included in correlation headers.
|
|
1213
|
+
* To override or discard the default, add an array with all domains to be included or
|
|
1214
|
+
* an empty array to the configuration.
|
|
1215
|
+
*
|
|
1216
|
+
* @example
|
|
1217
|
+
* ```ts
|
|
1218
|
+
* import { ApplicationInsights } from '@microsoft/applicationinsights-web';
|
|
1219
|
+
* const appInsights = new ApplicationInsights({
|
|
1220
|
+
* config: {
|
|
1221
|
+
* connectionString: 'InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE',
|
|
1222
|
+
* extensionConfig: {
|
|
1223
|
+
* AjaxDependencyPlugin: {
|
|
1224
|
+
* // Values MUST be RegExp objects
|
|
1225
|
+
* correlationHeaderExcludePatterns: [/*\.azure.com/, /prefix.bing.com/, /.*\.microsoft.com/, /example.com/]
|
|
1226
|
+
* }
|
|
1227
|
+
* }
|
|
1228
|
+
* });
|
|
1229
|
+
* appInsights.loadAppInsights();
|
|
1230
|
+
* appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
|
|
1231
|
+
* ```
|
|
1232
|
+
*/
|
|
1119
1233
|
correlationHeaderExcludePatterns?: RegExp[];
|
|
1120
1234
|
disableCorrelationHeaders: boolean;
|
|
1235
|
+
/**
|
|
1236
|
+
* The distributed tracing mode to use for this configuration.
|
|
1237
|
+
* Defaults to AI_AND_W3C.
|
|
1238
|
+
* This is used to determine which headers are sent with requests and how the
|
|
1239
|
+
* telemetry is correlated across services.
|
|
1240
|
+
* @default AI_AND_W3C
|
|
1241
|
+
* @see {@link DistributedTracingModes}
|
|
1242
|
+
*/
|
|
1121
1243
|
distributedTracingMode: DistributedTracingModes;
|
|
1122
1244
|
maxAjaxCallsPerView: number;
|
|
1123
1245
|
disableAjaxTracking: boolean;
|
|
@@ -1145,6 +1267,35 @@ export declare interface ICorrelationConfig {
|
|
|
1145
1267
|
* Defaults to 25.
|
|
1146
1268
|
*/
|
|
1147
1269
|
ajaxPerfLookupDelay?: number;
|
|
1270
|
+
/**
|
|
1271
|
+
* [Optional] Domains to be excluded from correlation headers.
|
|
1272
|
+
* To override or discard the default, add an array with all domains to be excluded or
|
|
1273
|
+
* an empty array to the configuration.
|
|
1274
|
+
*
|
|
1275
|
+
* @example
|
|
1276
|
+
* ```ts
|
|
1277
|
+
* import { ApplicationInsights } from '@microsoft/applicationinsights-web';
|
|
1278
|
+
* const appInsights = new ApplicationInsights({
|
|
1279
|
+
* config: {
|
|
1280
|
+
* connectionString: 'InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE',
|
|
1281
|
+
* extensionConfig: {
|
|
1282
|
+
* AjaxDependencyPlugin: {
|
|
1283
|
+
* // Both arrays of strings are used to match the request URL against the
|
|
1284
|
+
* // current host and the request URL to determine if correlation headers
|
|
1285
|
+
* // The strings are converted to RegExp objects by translating
|
|
1286
|
+
* // - `.` to `\\.` (to match a literal dot)
|
|
1287
|
+
* // - `*` to `.*` (to match any character)
|
|
1288
|
+
* // - `\` to `\\` (to match a literal slash)
|
|
1289
|
+
* // All other characters are ignored and passed to the RegExp constructor
|
|
1290
|
+
* correlationHeaderExcludedDomains: ["test", "*.azure.com", "ignore.microsoft.com"],
|
|
1291
|
+
* correlationHeaderDomains: ["azure.com", "prefix.bing.com", "*.microsoft.com", "example.com"]
|
|
1292
|
+
* }
|
|
1293
|
+
* }
|
|
1294
|
+
* });
|
|
1295
|
+
* appInsights.loadAppInsights();
|
|
1296
|
+
* appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview
|
|
1297
|
+
* ```
|
|
1298
|
+
*/
|
|
1148
1299
|
correlationHeaderDomains?: string[];
|
|
1149
1300
|
/**
|
|
1150
1301
|
* [Optional] Response and request headers to be excluded from AJAX & Fetch tracking data.
|
|
@@ -1164,7 +1315,7 @@ export declare interface ICorrelationConfig {
|
|
|
1164
1315
|
* connectionString: 'InstrumentationKey=YOUR_INSTRUMENTATION_KEY_GOES_HERE',
|
|
1165
1316
|
* extensions: [dependencyPlugin],
|
|
1166
1317
|
* extensionConfig: {
|
|
1167
|
-
*
|
|
1318
|
+
* AjaxDependencyPlugin: {
|
|
1168
1319
|
* ignoreHeaders: [
|
|
1169
1320
|
* "Authorization",
|
|
1170
1321
|
* "X-API-Key",
|
|
@@ -2012,6 +2163,8 @@ export declare interface ITelemetryContext {
|
|
|
2012
2163
|
readonly location: ILocation;
|
|
2013
2164
|
/**
|
|
2014
2165
|
* The object describing a operation tracked by this object.
|
|
2166
|
+
* @deprecated Use the core getTraceCtx method instead to get / set the current trace context, this is required to
|
|
2167
|
+
* support distributed tracing and allows the core to manage the trace context.
|
|
2015
2168
|
*/
|
|
2016
2169
|
readonly telemetryTrace: ITelemetryTrace;
|
|
2017
2170
|
/**
|
|
@@ -2044,6 +2197,11 @@ export declare interface ITelemetryContext {
|
|
|
2044
2197
|
getSessionId: () => string;
|
|
2045
2198
|
}
|
|
2046
2199
|
|
|
2200
|
+
/**
|
|
2201
|
+
* Interface for telemetry trace context.
|
|
2202
|
+
* @deprecated Use the core getTraceCtx method instead to get / set the current trace context, this is required to
|
|
2203
|
+
* support distributed tracing and allows the core to manage the trace context.
|
|
2204
|
+
*/
|
|
2047
2205
|
export declare interface ITelemetryTrace {
|
|
2048
2206
|
/**
|
|
2049
2207
|
* Trace id
|
|
@@ -2053,11 +2211,6 @@ export declare interface ITelemetryTrace {
|
|
|
2053
2211
|
* Parent id
|
|
2054
2212
|
*/
|
|
2055
2213
|
parentID?: string;
|
|
2056
|
-
/**
|
|
2057
|
-
* @deprecated Never Used
|
|
2058
|
-
* Trace state
|
|
2059
|
-
*/
|
|
2060
|
-
traceState?: ITraceState;
|
|
2061
2214
|
/**
|
|
2062
2215
|
* An integer representation of the W3C TraceContext trace-flags. https://www.w3.org/TR/trace-context/#trace-flags
|
|
2063
2216
|
*/
|
|
@@ -2165,9 +2318,6 @@ export declare interface IThrottleResult {
|
|
|
2165
2318
|
|
|
2166
2319
|
export { ITraceParent }
|
|
2167
2320
|
|
|
2168
|
-
export declare interface ITraceState {
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
2321
|
export declare interface ITraceTelemetry extends IPartC {
|
|
2172
2322
|
/**
|
|
2173
2323
|
* @description A message string
|