@microsoft/applicationinsights-dependencies-js 2.8.5-nightly.2206-02 → 2.8.5-nightly.2206-06

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 (39) hide show
  1. package/browser/applicationinsights-dependencies-js.integrity.json +9 -9
  2. package/browser/applicationinsights-dependencies-js.js +1127 -934
  3. package/browser/applicationinsights-dependencies-js.js.map +1 -1
  4. package/browser/applicationinsights-dependencies-js.min.js +2 -2
  5. package/browser/applicationinsights-dependencies-js.min.js.map +1 -1
  6. package/dist/applicationinsights-dependencies-js.api.json +159 -46
  7. package/dist/applicationinsights-dependencies-js.api.md +6 -1
  8. package/dist/applicationinsights-dependencies-js.d.ts +9 -3
  9. package/dist/applicationinsights-dependencies-js.js +1127 -934
  10. package/dist/applicationinsights-dependencies-js.js.map +1 -1
  11. package/dist/applicationinsights-dependencies-js.min.js +2 -2
  12. package/dist/applicationinsights-dependencies-js.min.js.map +1 -1
  13. package/dist/applicationinsights-dependencies-js.rollup.d.ts +9 -3
  14. package/dist-esm/DependencyListener.js +1 -1
  15. package/dist-esm/InternalConstants.js +14 -0
  16. package/dist-esm/InternalConstants.js.map +1 -0
  17. package/dist-esm/__DynamicConstants.js +64 -0
  18. package/dist-esm/__DynamicConstants.js.map +1 -0
  19. package/dist-esm/ajax.js +201 -189
  20. package/dist-esm/ajax.js.map +1 -1
  21. package/dist-esm/ajaxRecord.js +59 -54
  22. package/dist-esm/ajaxRecord.js.map +1 -1
  23. package/dist-esm/ajaxUtils.js +3 -2
  24. package/dist-esm/ajaxUtils.js.map +1 -1
  25. package/dist-esm/applicationinsights-dependencies-js.js +2 -2
  26. package/dist-esm/applicationinsights-dependencies-js.js.map +1 -1
  27. package/package.json +7 -4
  28. package/src/InternalConstants.ts +13 -0
  29. package/src/__DynamicConstants.ts +62 -0
  30. package/src/ajax.ts +39 -32
  31. package/src/ajaxRecord.ts +25 -24
  32. package/src/ajaxUtils.ts +6 -6
  33. package/src/applicationinsights-dependencies-js.ts +1 -1
  34. package/types/InternalConstants.d.ts +2 -0
  35. package/types/__DynamicConstants.d.ts +50 -0
  36. package/types/ajax.d.ts +6 -4
  37. package/types/ajaxRecord.d.ts +2 -1
  38. package/types/applicationinsights-dependencies-js.d.ts +1 -1
  39. package/types/tsdoc-metadata.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ajaxRecord.js.map","sources":["ajaxRecord.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { dataSanitizeUrl, dateTimeUtilsDuration, urlGetAbsoluteUrl, urlGetCompleteUrl, msToTimeSpan } from \"@microsoft/applicationinsights-common\";\r\nimport { objKeys, arrForEach, isNumber, isString, normalizeJsName, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nvar strProperties = \"properties\";\r\n/** @ignore */\r\nfunction _calcPerfDuration(resourceEntry, start, end) {\r\n var result = 0;\r\n var from = resourceEntry[start];\r\n var to = resourceEntry[end];\r\n if (from && to) {\r\n result = dateTimeUtilsDuration(from, to);\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfDuration(props, name, resourceEntry, start, end) {\r\n var result = 0;\r\n var value = _calcPerfDuration(resourceEntry, start, end);\r\n if (value) {\r\n result = _setPerfValue(props, name, msToTimeSpan(value));\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfValue(props, name, value) {\r\n var strPerf = \"ajaxPerf\";\r\n var result = 0;\r\n if (props && name && value) {\r\n var perfData = props[strPerf] = (props[strPerf] || {});\r\n perfData[name] = value;\r\n result = 1;\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _populatePerfData(ajaxData, dependency) {\r\n /*\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API\r\n * | -startTime\r\n * | -redirectStart\r\n * | | -redirectEnd\r\n * | | | -fetchStart\r\n * | | | | -domainLookupStart\r\n * | | | | |- domainLookupEnd\r\n * | | | | | | -connectStart\r\n * | | | | | | | -secureConnectionStart\r\n * | | | | | | | | -connectEnd\r\n * | | | | | | | | | -requestStart\r\n * | | | | | | | | | | | -responseStart\r\n * | | | | | | | | | | | | | -responseEnd\r\n * +------------+-+---+----------------+-+--+--------+-+-----------+-+------------+-+\r\n * |--redirect--| |---|--domainLookup--| |--connect--| |--request--| |--response--| |\r\n * |-------------------networkConnect----------------|\r\n * | |---------sentRequest--------|\r\n * |------------------------------------perfTotal-----------------------------------|\r\n */\r\n var resourceEntry = ajaxData.perfTiming;\r\n var props = dependency[strProperties] || {};\r\n var propsSet = 0;\r\n var strName = \"name\";\r\n var strStart = \"Start\";\r\n var strEnd = \"End\";\r\n var strDomainLookup = \"domainLookup\";\r\n var strConnect = \"connect\";\r\n var strRedirect = \"redirect\";\r\n var strRequest = \"request\";\r\n var strResponse = \"response\";\r\n var strDuration = \"duration\";\r\n var strStartTime = \"startTime\";\r\n var strDomainLookupStart = strDomainLookup + strStart;\r\n var strDomainLookupEnd = strDomainLookup + strEnd;\r\n var strConnectStart = strConnect + strStart;\r\n var strConnectEnd = strConnect + strEnd;\r\n var strRequestStart = strRequest + strStart;\r\n var strRequestEnd = strRequest + strEnd;\r\n var strResponseStart = strResponse + strStart;\r\n var strResponseEnd = strResponse + strEnd;\r\n var strRedirectStart = strRedirect + strStart;\r\n var strRedirectEnd = strRedirect = strEnd;\r\n var strTransferSize = \"transferSize\";\r\n var strEncodedBodySize = \"encodedBodySize\";\r\n var strDecodedBodySize = \"decodedBodySize\";\r\n var strServerTiming = \"serverTiming\";\r\n if (resourceEntry) {\r\n // redirect\r\n propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd);\r\n // domainLookup\r\n propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd);\r\n // connect\r\n propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd);\r\n // request\r\n propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd);\r\n // response\r\n propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd);\r\n // Network connection time\r\n propsSet |= _setPerfDuration(props, \"networkConnect\", resourceEntry, strStartTime, strConnectEnd);\r\n // Sent Request\r\n propsSet |= _setPerfDuration(props, \"sentRequest\", resourceEntry, strRequestStart, strResponseEnd);\r\n // PerfTotal / Duration\r\n var duration = resourceEntry[strDuration];\r\n if (!duration) {\r\n duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0;\r\n }\r\n propsSet |= _setPerfValue(props, strDuration, duration);\r\n propsSet |= _setPerfValue(props, \"perfTotal\", duration);\r\n var serverTiming = resourceEntry[strServerTiming];\r\n if (serverTiming) {\r\n var server_1 = {};\r\n arrForEach(serverTiming, function (value, idx) {\r\n var name = normalizeJsName(value[strName] || \"\" + idx);\r\n var newValue = server_1[name] || {};\r\n objForEachKey(value, function (key, val) {\r\n if (key !== strName && isString(val) || isNumber(val)) {\r\n if (newValue[key]) {\r\n val = newValue[key] + \";\" + val;\r\n }\r\n if (val || !isString(val)) {\r\n // Only set the value if it has a value and it's not an empty string\r\n newValue[key] = val;\r\n }\r\n }\r\n });\r\n server_1[name] = newValue;\r\n });\r\n propsSet |= _setPerfValue(props, strServerTiming, server_1);\r\n }\r\n propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]);\r\n propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]);\r\n propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]);\r\n }\r\n else {\r\n if (ajaxData.perfMark) {\r\n propsSet |= _setPerfValue(props, \"missing\", ajaxData.perfAttempts);\r\n }\r\n }\r\n if (propsSet) {\r\n dependency[strProperties] = props;\r\n }\r\n}\r\nvar XHRMonitoringState = /** @class */ (function () {\r\n function XHRMonitoringState() {\r\n var self = this;\r\n self.openDone = false;\r\n self.setRequestHeaderDone = false;\r\n self.sendDone = false;\r\n self.abortDone = false;\r\n // <summary>True, if onreadyStateChangeCallback function attached to xhr, otherwise false</summary>\r\n self.stateChangeAttached = false;\r\n }\r\n return XHRMonitoringState;\r\n}());\r\nexport { XHRMonitoringState };\r\nvar ajaxRecord = /** @class */ (function () {\r\n function ajaxRecord(traceID, spanID, logger) {\r\n var self = this;\r\n var _logger = logger;\r\n var strResponseText = \"responseText\";\r\n // Assigning the initial/default values within the constructor to avoid typescript from creating a bunch of\r\n // this.XXXX = null\r\n self.perfMark = null;\r\n self.completed = false;\r\n self.requestHeadersSize = null;\r\n self.requestHeaders = null;\r\n self.responseReceivingDuration = null;\r\n self.callbackDuration = null;\r\n self.ajaxTotalDuration = null;\r\n self.aborted = 0;\r\n self.pageUrl = null;\r\n self.requestUrl = null;\r\n self.requestSize = 0;\r\n self.method = null;\r\n self.status = null;\r\n self.requestSentTime = null;\r\n self.responseStartedTime = null;\r\n self.responseFinishedTime = null;\r\n self.callbackFinishedTime = null;\r\n self.endTime = null;\r\n self.xhrMonitoringState = new XHRMonitoringState();\r\n self.clientFailure = 0;\r\n self.traceID = traceID;\r\n self.spanID = spanID;\r\n dynamicProto(ajaxRecord, self, function (self) {\r\n self.getAbsoluteUrl = function () {\r\n return self.requestUrl ? urlGetAbsoluteUrl(self.requestUrl) : null;\r\n };\r\n self.getPathName = function () {\r\n return self.requestUrl ? dataSanitizeUrl(_logger, urlGetCompleteUrl(self.method, self.requestUrl)) : null;\r\n };\r\n self.CreateTrackItem = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n var _a;\r\n // round to 3 decimal points\r\n self.ajaxTotalDuration = Math.round(dateTimeUtilsDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000;\r\n if (self.ajaxTotalDuration < 0) {\r\n return null;\r\n }\r\n var dependency = (_a = {\r\n id: \"|\" + self.traceID + \".\" + self.spanID,\r\n target: self.getAbsoluteUrl(),\r\n name: self.getPathName(),\r\n type: ajaxType,\r\n startTime: null,\r\n duration: self.ajaxTotalDuration,\r\n success: (+(self.status)) >= 200 && (+(self.status)) < 400,\r\n responseCode: (+(self.status)),\r\n method: self.method\r\n },\r\n _a[strProperties] = { HttpMethod: self.method },\r\n _a);\r\n if (self.requestSentTime) {\r\n // Set the correct dependency start time\r\n dependency.startTime = new Date();\r\n dependency.startTime.setTime(self.requestSentTime);\r\n }\r\n // Add Ajax perf details if available\r\n _populatePerfData(self, dependency);\r\n if (enableRequestHeaderTracking) {\r\n if (objKeys(self.requestHeaders).length > 0) {\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n dependency[strProperties].requestHeaders = self.requestHeaders;\r\n }\r\n }\r\n if (getResponse) {\r\n var response = getResponse();\r\n if (response) {\r\n // enrich dependency target with correlation context from the server\r\n var correlationContext = response.correlationContext;\r\n if (correlationContext) {\r\n dependency.correlationContext = /* dependency.target + \" | \" + */ correlationContext;\r\n }\r\n if (response.headerMap) {\r\n if (objKeys(response.headerMap).length > 0) {\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n dependency[strProperties].responseHeaders = response.headerMap;\r\n }\r\n }\r\n if (self.errorStatusText && self.status >= 400) {\r\n var responseType = response.type;\r\n dependency[strProperties] = dependency[strProperties] || {};\r\n if (responseType === \"\" || responseType === \"text\") {\r\n dependency[strProperties][strResponseText] = response[strResponseText] ? response.statusText + \" - \" + response[strResponseText] : response.statusText;\r\n }\r\n if (responseType === \"json\") {\r\n dependency[strProperties][strResponseText] = response.response ? response.statusText + \" - \" + JSON.stringify(response.response) : response.statusText;\r\n }\r\n }\r\n }\r\n }\r\n return dependency;\r\n };\r\n });\r\n }\r\n ajaxRecord.prototype.getAbsoluteUrl = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n ajaxRecord.prototype.getPathName = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n ajaxRecord.prototype.CreateTrackItem = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return ajaxRecord;\r\n}());\r\nexport { ajaxRecord };\r\n//# sourceMappingURL=ajaxRecord.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;yDAWM;AACN;AACA;AACA;AACA"}
1
+ {"version":3,"file":"ajaxRecord.js.map","sources":["ajaxRecord.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { dataSanitizeUrl, dateTimeUtilsDuration, msToTimeSpan, urlGetAbsoluteUrl, urlGetCompleteUrl } from \"@microsoft/applicationinsights-common\";\r\nimport { arrForEach, isNumber, isString, normalizeJsName, objForEachKey, objKeys } from \"@microsoft/applicationinsights-core-js\";\r\nimport { STR_DURATION, STR_PROPERTIES } from \"./InternalConstants\";\r\nimport { _DYN_ABORT_DONE, _DYN_AJAX_TOTAL_DURATION, _DYN_CORRELATION_CONTEXT, _DYN_GET_ABSOLUTE_URL, _DYN_HEADER_MAP, _DYN_LENGTH, _DYN_METHOD, _DYN_NAME, _DYN_OPEN_DONE, _DYN_PERF_MARK, _DYN_PERF_TIMING, _DYN_REQUEST_HEADERS, _DYN_REQUEST_SENT_TIME, _DYN_REQUEST_URL, _DYN_RESPONSE, _DYN_RESPONSE_FINISHED_TI12, _DYN_SEND_DONE, _DYN_SPAN_ID, _DYN_START_TIME, _DYN_STATE_CHANGE_ATTACHE11, _DYN_STATUS, _DYN_STATUS_TEXT, _DYN_TRACE_ID, _DYN__CREATE_TRACK_ITEM } from \"./__DynamicConstants\";\r\n/** @ignore */\r\nfunction _calcPerfDuration(resourceEntry, start, end) {\r\n var result = 0;\r\n var from = resourceEntry[start];\r\n var to = resourceEntry[end];\r\n if (from && to) {\r\n result = dateTimeUtilsDuration(from, to);\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfDuration(props, name, resourceEntry, start, end) {\r\n var result = 0;\r\n var value = _calcPerfDuration(resourceEntry, start, end);\r\n if (value) {\r\n result = _setPerfValue(props, name, msToTimeSpan(value));\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _setPerfValue(props, name, value) {\r\n var strPerf = \"ajaxPerf\";\r\n var result = 0;\r\n if (props && name && value) {\r\n var perfData = props[strPerf] = (props[strPerf] || {});\r\n perfData[name] = value;\r\n result = 1;\r\n }\r\n return result;\r\n}\r\n/** @ignore */\r\nfunction _populatePerfData(ajaxData, dependency) {\r\n /*\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Resource_Timing_API/Using_the_Resource_Timing_API\r\n * | -startTime\r\n * | -redirectStart\r\n * | | -redirectEnd\r\n * | | | -fetchStart\r\n * | | | | -domainLookupStart\r\n * | | | | |- domainLookupEnd\r\n * | | | | | | -connectStart\r\n * | | | | | | | -secureConnectionStart\r\n * | | | | | | | | -connectEnd\r\n * | | | | | | | | | -requestStart\r\n * | | | | | | | | | | | -responseStart\r\n * | | | | | | | | | | | | | -responseEnd\r\n * +------------+-+---+----------------+-+--+--------+-+-----------+-+------------+-+\r\n * |--redirect--| |---|--domainLookup--| |--connect--| |--request--| |--response--| |\r\n * |-------------------networkConnect----------------|\r\n * | |---------sentRequest--------|\r\n * |------------------------------------perfTotal-----------------------------------|\r\n */\r\n var resourceEntry = ajaxData[_DYN_PERF_TIMING /* @min:%2eperfTiming */];\r\n var props = dependency[STR_PROPERTIES /* @min:%2eproperties */] || {};\r\n var propsSet = 0;\r\n var strName = \"name\";\r\n var strStart = \"Start\";\r\n var strEnd = \"End\";\r\n var strDomainLookup = \"domainLookup\";\r\n var strConnect = \"connect\";\r\n var strRedirect = \"redirect\";\r\n var strRequest = \"request\";\r\n var strResponse = \"response\";\r\n var strStartTime = \"startTime\";\r\n var strDomainLookupStart = strDomainLookup + strStart;\r\n var strDomainLookupEnd = strDomainLookup + strEnd;\r\n var strConnectStart = strConnect + strStart;\r\n var strConnectEnd = strConnect + strEnd;\r\n var strRequestStart = strRequest + strStart;\r\n var strRequestEnd = strRequest + strEnd;\r\n var strResponseStart = strResponse + strStart;\r\n var strResponseEnd = strResponse + strEnd;\r\n var strRedirectStart = strRedirect + strStart;\r\n var strRedirectEnd = strRedirect = strEnd;\r\n var strTransferSize = \"transferSize\";\r\n var strEncodedBodySize = \"encodedBodySize\";\r\n var strDecodedBodySize = \"decodedBodySize\";\r\n var strServerTiming = \"serverTiming\";\r\n if (resourceEntry) {\r\n // redirect\r\n propsSet |= _setPerfDuration(props, strRedirect, resourceEntry, strRedirectStart, strRedirectEnd);\r\n // domainLookup\r\n propsSet |= _setPerfDuration(props, strDomainLookup, resourceEntry, strDomainLookupStart, strDomainLookupEnd);\r\n // connect\r\n propsSet |= _setPerfDuration(props, strConnect, resourceEntry, strConnectStart, strConnectEnd);\r\n // request\r\n propsSet |= _setPerfDuration(props, strRequest, resourceEntry, strRequestStart, strRequestEnd);\r\n // response\r\n propsSet |= _setPerfDuration(props, strResponse, resourceEntry, strResponseStart, strResponseEnd);\r\n // Network connection time\r\n propsSet |= _setPerfDuration(props, \"networkConnect\", resourceEntry, strStartTime, strConnectEnd);\r\n // Sent Request\r\n propsSet |= _setPerfDuration(props, \"sentRequest\", resourceEntry, strRequestStart, strResponseEnd);\r\n // PerfTotal / Duration\r\n var duration = resourceEntry[STR_DURATION /* @min:%2eduration */];\r\n if (!duration) {\r\n duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0;\r\n }\r\n propsSet |= _setPerfValue(props, STR_DURATION, duration);\r\n propsSet |= _setPerfValue(props, \"perfTotal\", duration);\r\n var serverTiming = resourceEntry[strServerTiming];\r\n if (serverTiming) {\r\n var server_1 = {};\r\n arrForEach(serverTiming, function (value, idx) {\r\n var name = normalizeJsName(value[strName] || \"\" + idx);\r\n var newValue = server_1[name] || {};\r\n objForEachKey(value, function (key, val) {\r\n if (key !== strName && isString(val) || isNumber(val)) {\r\n if (newValue[key]) {\r\n val = newValue[key] + \";\" + val;\r\n }\r\n if (val || !isString(val)) {\r\n // Only set the value if it has a value and it's not an empty string\r\n newValue[key] = val;\r\n }\r\n }\r\n });\r\n server_1[name] = newValue;\r\n });\r\n propsSet |= _setPerfValue(props, strServerTiming, server_1);\r\n }\r\n propsSet |= _setPerfValue(props, strTransferSize, resourceEntry[strTransferSize]);\r\n propsSet |= _setPerfValue(props, strEncodedBodySize, resourceEntry[strEncodedBodySize]);\r\n propsSet |= _setPerfValue(props, strDecodedBodySize, resourceEntry[strDecodedBodySize]);\r\n }\r\n else {\r\n if (ajaxData[_DYN_PERF_MARK /* @min:%2eperfMark */]) {\r\n propsSet |= _setPerfValue(props, \"missing\", ajaxData.perfAttempts);\r\n }\r\n }\r\n if (propsSet) {\r\n dependency[STR_PROPERTIES /* @min:%2eproperties */] = props;\r\n }\r\n}\r\nvar XHRMonitoringState = /** @class */ (function () {\r\n function XHRMonitoringState() {\r\n var self = this;\r\n self[_DYN_OPEN_DONE /* @min:%2eopenDone */] = false;\r\n self.setRequestHeaderDone = false;\r\n self[_DYN_SEND_DONE /* @min:%2esendDone */] = false;\r\n self[_DYN_ABORT_DONE /* @min:%2eabortDone */] = false;\r\n // <summary>True, if onreadyStateChangeCallback function attached to xhr, otherwise false</summary>\r\n self[_DYN_STATE_CHANGE_ATTACHE11 /* @min:%2estateChangeAttached */] = false;\r\n }\r\n return XHRMonitoringState;\r\n}());\r\nexport { XHRMonitoringState };\r\nvar ajaxRecord = /** @class */ (function () {\r\n function ajaxRecord(traceID, spanID, logger) {\r\n var self = this;\r\n var _logger = logger;\r\n var strResponseText = \"responseText\";\r\n // Assigning the initial/default values within the constructor to avoid typescript from creating a bunch of\r\n // this.XXXX = null\r\n self[_DYN_PERF_MARK /* @min:%2eperfMark */] = null;\r\n self.completed = false;\r\n self.requestHeadersSize = null;\r\n self[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = null;\r\n self.responseReceivingDuration = null;\r\n self.callbackDuration = null;\r\n self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */] = null;\r\n self.aborted = 0;\r\n self.pageUrl = null;\r\n self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] = null;\r\n self.requestSize = 0;\r\n self[_DYN_METHOD /* @min:%2emethod */] = null;\r\n self[_DYN_STATUS /* @min:%2estatus */] = null;\r\n self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */] = null;\r\n self.responseStartedTime = null;\r\n self[_DYN_RESPONSE_FINISHED_TI12 /* @min:%2eresponseFinishedTime */] = null;\r\n self.callbackFinishedTime = null;\r\n self.endTime = null;\r\n self.xhrMonitoringState = new XHRMonitoringState();\r\n self.clientFailure = 0;\r\n self[_DYN_TRACE_ID /* @min:%2etraceID */] = traceID;\r\n self[_DYN_SPAN_ID /* @min:%2espanID */] = spanID;\r\n dynamicProto(ajaxRecord, self, function (self) {\r\n self.getAbsoluteUrl = function () {\r\n return self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] ? urlGetAbsoluteUrl(self[_DYN_REQUEST_URL /* @min:%2erequestUrl */]) : null;\r\n };\r\n self.getPathName = function () {\r\n return self[_DYN_REQUEST_URL /* @min:%2erequestUrl */] ? dataSanitizeUrl(_logger, urlGetCompleteUrl(self[_DYN_METHOD /* @min:%2emethod */], self[_DYN_REQUEST_URL /* @min:%2erequestUrl */])) : null;\r\n };\r\n self[_DYN__CREATE_TRACK_ITEM /* @min:%2eCreateTrackItem */] = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n var _a;\r\n // round to 3 decimal points\r\n self.ajaxTotalDuration = Math.round(dateTimeUtilsDuration(self.requestSentTime, self.responseFinishedTime) * 1000) / 1000;\r\n if (self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */] < 0) {\r\n return null;\r\n }\r\n var dependency = (_a = {\r\n id: \"|\" + self[_DYN_TRACE_ID /* @min:%2etraceID */] + \".\" + self[_DYN_SPAN_ID /* @min:%2espanID */],\r\n target: self[_DYN_GET_ABSOLUTE_URL /* @min:%2egetAbsoluteUrl */]()\r\n },\r\n _a[_DYN_NAME /* @min:name */] = self.getPathName(),\r\n _a.type = ajaxType,\r\n _a[_DYN_START_TIME /* @min:startTime */] = null,\r\n _a.duration = self[_DYN_AJAX_TOTAL_DURATION /* @min:%2eajaxTotalDuration */],\r\n _a.success = (+(self[_DYN_STATUS /* @min:%2estatus */])) >= 200 && (+(self[_DYN_STATUS /* @min:%2estatus */])) < 400,\r\n _a.responseCode = (+(self[_DYN_STATUS /* @min:%2estatus */])),\r\n _a.method = self[_DYN_METHOD /* @min:%2emethod */],\r\n _a[STR_PROPERTIES] = { HttpMethod: self[_DYN_METHOD /* @min:%2emethod */] },\r\n _a);\r\n if (self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */]) {\r\n // Set the correct dependency start time\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */] = new Date();\r\n dependency[_DYN_START_TIME /* @min:%2estartTime */].setTime(self[_DYN_REQUEST_SENT_TIME /* @min:%2erequestSentTime */]);\r\n }\r\n // Add Ajax perf details if available\r\n _populatePerfData(self, dependency);\r\n if (enableRequestHeaderTracking) {\r\n if (objKeys(self.requestHeaders)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var props = dependency[STR_PROPERTIES /* @min:%2eproperties */] = dependency[STR_PROPERTIES /* @min:%2eproperties */] || {};\r\n props[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */] = self[_DYN_REQUEST_HEADERS /* @min:%2erequestHeaders */];\r\n }\r\n }\r\n if (getResponse) {\r\n var response = getResponse();\r\n if (response) {\r\n // enrich dependency target with correlation context from the server\r\n var correlationContext = response[_DYN_CORRELATION_CONTEXT /* @min:%2ecorrelationContext */];\r\n if (correlationContext) {\r\n dependency.correlationContext = /* dependency.target + \" | \" + */ correlationContext;\r\n }\r\n if (response[_DYN_HEADER_MAP /* @min:%2eheaderMap */]) {\r\n if (objKeys(response.headerMap)[_DYN_LENGTH /* @min:%2elength */] > 0) {\r\n var props = dependency[STR_PROPERTIES /* @min:%2eproperties */] = dependency[STR_PROPERTIES /* @min:%2eproperties */] || {};\r\n props.responseHeaders = response[_DYN_HEADER_MAP /* @min:%2eheaderMap */];\r\n }\r\n }\r\n if (self.errorStatusText && self[_DYN_STATUS /* @min:%2estatus */] >= 400) {\r\n var responseType = response.type;\r\n var props = dependency[STR_PROPERTIES /* @min:%2eproperties */] = dependency[STR_PROPERTIES /* @min:%2eproperties */] || {};\r\n if (responseType === \"\" || responseType === \"text\") {\r\n props.responseText = response.responseText ? response[_DYN_STATUS_TEXT /* @min:%2estatusText */] + \" - \" + response[strResponseText] : response[_DYN_STATUS_TEXT /* @min:%2estatusText */];\r\n }\r\n if (responseType === \"json\") {\r\n props.responseText = response.response ? response[_DYN_STATUS_TEXT /* @min:%2estatusText */] + \" - \" + JSON.stringify(response[_DYN_RESPONSE /* @min:%2eresponse */]) : response[_DYN_STATUS_TEXT /* @min:%2estatusText */];\r\n }\r\n }\r\n }\r\n }\r\n return dependency;\r\n };\r\n });\r\n }\r\n ajaxRecord.prototype.getAbsoluteUrl = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n ajaxRecord.prototype.getPathName = function () {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n ajaxRecord.prototype.CreateTrackItem = function (ajaxType, enableRequestHeaderTracking, getResponse) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n return null;\r\n };\r\n return ajaxRecord;\r\n}());\r\nexport { ajaxRecord };\r\n//# sourceMappingURL=ajaxRecord.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;yDAWM,CAAC;;;;;;sBACe;AACtB;AACA;AACA"}
@@ -1,10 +1,11 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.5-nightly.2206-02
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.5-nightly.2206-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
7
  import { isNullOrUndefined } from "@microsoft/applicationinsights-core-js";
8
+ import { _DYN_LENGTH } from "./__DynamicConstants";
8
9
  var stringUtils = /** @class */ (function () {
9
10
  function stringUtils() {
10
11
  }
@@ -18,7 +19,7 @@ var stringUtils = /** @class */ (function () {
18
19
  catch (ex) {
19
20
  // some troubles with complex object
20
21
  }
21
- res = stringified.length;
22
+ res = stringified[_DYN_LENGTH /* @min:%2elength */];
22
23
  res = isNaN(res) ? 0 : res;
23
24
  }
24
25
  return res;
@@ -1 +1 @@
1
- {"version":3,"file":"ajaxUtils.js.map","sources":["ajaxUtils.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { isNullOrUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nvar stringUtils = /** @class */ (function () {\r\n function stringUtils() {\r\n }\r\n stringUtils.GetLength = function (strObject) {\r\n var res = 0;\r\n if (!isNullOrUndefined(strObject)) {\r\n var stringified = \"\";\r\n try {\r\n stringified = strObject.toString();\r\n }\r\n catch (ex) {\r\n // some troubles with complex object\r\n }\r\n res = stringified.length;\r\n res = isNaN(res) ? 0 : res;\r\n }\r\n return res;\r\n };\r\n return stringUtils;\r\n}());\r\nexport { stringUtils };\r\n//# sourceMappingURL=ajaxUtils.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"}
1
+ {"version":3,"file":"ajaxUtils.js.map","sources":["ajaxUtils.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { isNullOrUndefined } from \"@microsoft/applicationinsights-core-js\";\r\nimport { _DYN_LENGTH } from \"./__DynamicConstants\";\r\nvar stringUtils = /** @class */ (function () {\r\n function stringUtils() {\r\n }\r\n stringUtils.GetLength = function (strObject) {\r\n var res = 0;\r\n if (!isNullOrUndefined(strObject)) {\r\n var stringified = \"\";\r\n try {\r\n stringified = strObject.toString();\r\n }\r\n catch (ex) {\r\n // some troubles with complex object\r\n }\r\n res = stringified[_DYN_LENGTH /* @min:%2elength */];\r\n res = isNaN(res) ? 0 : res;\r\n }\r\n return res;\r\n };\r\n return stringUtils;\r\n}());\r\nexport { stringUtils };\r\n//# sourceMappingURL=ajaxUtils.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"}
@@ -1,9 +1,9 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.5-nightly.2206-02
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 2.8.5-nightly.2206-06
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
6
6
 
7
- export { AjaxMonitor as AjaxPlugin } from "./ajax";
7
+ export { AjaxMonitor as AjaxPlugin, DfltAjaxCorrelationHeaderExDomains } from "./ajax";
8
8
  export { ajaxRecord } from "./ajaxRecord";
9
9
  //# sourceMappingURL=applicationinsights-dependencies-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"applicationinsights-dependencies-js.js.map","sources":["applicationinsights-dependencies-js.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport { AjaxMonitor as AjaxPlugin } from \"./ajax\";\r\nexport { ajaxRecord } from \"./ajaxRecord\";\r\n//# sourceMappingURL=applicationinsights-dependencies-js.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA"}
1
+ {"version":3,"file":"applicationinsights-dependencies-js.js.map","sources":["applicationinsights-dependencies-js.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nexport { AjaxMonitor as AjaxPlugin, DfltAjaxCorrelationHeaderExDomains } from \"./ajax\";\r\nexport { ajaxRecord } from \"./ajaxRecord\";\r\n//# sourceMappingURL=applicationinsights-dependencies-js.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/applicationinsights-dependencies-js",
3
- "version": "2.8.5-nightly.2206-02",
3
+ "version": "2.8.5-nightly.2206-06",
4
4
  "description": "Microsoft Application Insights XHR dependencies plugin",
5
5
  "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
6
6
  "author": "Microsoft Application Insights Team",
@@ -18,9 +18,12 @@
18
18
  "build:browser": "rollup -c",
19
19
  "rebuild": "npm run build",
20
20
  "test": "grunt depstest",
21
+ "mintest": "grunt deps-mintest",
21
22
  "lint": "tslint -p tsconfig.json",
22
23
  "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights XHR dependencies plugin\"",
23
- "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js"
24
+ "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
25
+ "ai-min": "grunt deps-min",
26
+ "ai-restore": "grunt deps-restore"
24
27
  },
25
28
  "devDependencies": {
26
29
  "@microsoft/ai-test-framework": "0.0.1",
@@ -50,8 +53,8 @@
50
53
  "dependencies": {
51
54
  "@microsoft/dynamicproto-js": "^1.1.6",
52
55
  "@microsoft/applicationinsights-shims": "2.0.1",
53
- "@microsoft/applicationinsights-core-js": "2.8.5-nightly.2206-02",
54
- "@microsoft/applicationinsights-common": "2.8.5-nightly.2206-02"
56
+ "@microsoft/applicationinsights-core-js": "2.8.5-nightly.2206-06",
57
+ "@microsoft/applicationinsights-common": "2.8.5-nightly.2206-06"
55
58
  },
56
59
  "license": "MIT",
57
60
  "publishConfig": {
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5
+ // Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!
6
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
+
8
+ // Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)
9
+ // as when using "short" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.
10
+
11
+ export const STR_DURATION = "duration";
12
+ export const STR_PROPERTIES = "properties";
13
+
@@ -0,0 +1,62 @@
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+ // @skip-file-minify
4
+
5
+ // ##############################################################
6
+ // AUTO GENERATED FILE: This file is Auto Generated during build.
7
+ // ##############################################################
8
+
9
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
+ // Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!
11
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
+
13
+ export const _DYN_REQUEST_URL = "requestUrl"; // Count: 12
14
+ export const _DYN_INST = "inst"; // Count: 5
15
+ export const _DYN_LENGTH = "length"; // Count: 9
16
+ export const _DYN_TRACE_ID = "traceID"; // Count: 8
17
+ export const _DYN_SPAN_ID = "spanID"; // Count: 8
18
+ export const _DYN_TRACE_FLAGS = "traceFlags"; // Count: 8
19
+ export const _DYN_CORE = "core"; // Count: 6
20
+ export const _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig"; // Count: 2
21
+ export const _DYN_INCLUDE_CORRELATION_0 = "includeCorrelationHeaders"; // Count: 4
22
+ export const _DYN_CAN_INCLUDE_CORRELAT1 = "canIncludeCorrelationHeader"; // Count: 2
23
+ export const _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl"; // Count: 3
24
+ export const _DYN_HEADERS = "headers"; // Count: 6
25
+ export const _DYN_REQUEST_HEADERS = "requestHeaders"; // Count: 13
26
+ export const _DYN_APP_ID = "appId"; // Count: 5
27
+ export const _DYN_SET_REQUEST_HEADER = "setRequestHeader"; // Count: 3
28
+ export const _DYN_DISTRIBUTED_TRACING_2 = "distributedTracingMode"; // Count: 3
29
+ export const _DYN_START_TIME = "startTime"; // Count: 6
30
+ export const _DYN_TO_LOWER_CASE = "toLowerCase"; // Count: 6
31
+ export const _DYN_ENABLE_REQUEST_HEADE3 = "enableRequestHeaderTracking"; // Count: 2
32
+ export const _DYN_ENABLE_AJAX_ERROR_ST4 = "enableAjaxErrorStatusText"; // Count: 2
33
+ export const _DYN_ENABLE_AJAX_PERF_TRA5 = "enableAjaxPerfTracking"; // Count: 2
34
+ export const _DYN_MAX_AJAX_CALLS_PER_V6 = "maxAjaxCallsPerView"; // Count: 2
35
+ export const _DYN_ENABLE_RESPONSE_HEAD7 = "enableResponseHeaderTracking"; // Count: 2
36
+ export const _DYN_EXCLUDE_REQUEST_FROM8 = "excludeRequestFromAutoTrackingPatterns"; // Count: 2
37
+ export const _DYN_ADD_REQUEST_CONTEXT = "addRequestContext"; // Count: 2
38
+ export const _DYN_DISABLE_AJAX_TRACKIN9 = "disableAjaxTracking"; // Count: 2
39
+ export const _DYN_DISABLE_FETCH_TRACKI10 = "disableFetchTracking"; // Count: 2
40
+ export const _DYN_STATUS = "status"; // Count: 10
41
+ export const _DYN_STATUS_TEXT = "statusText"; // Count: 8
42
+ export const _DYN_HEADER_MAP = "headerMap"; // Count: 8
43
+ export const _DYN_OPEN_DONE = "openDone"; // Count: 3
44
+ export const _DYN_SEND_DONE = "sendDone"; // Count: 3
45
+ export const _DYN_REQUEST_SENT_TIME = "requestSentTime"; // Count: 9
46
+ export const _DYN_ABORT_DONE = "abortDone"; // Count: 3
47
+ export const _DYN_METHOD = "method"; // Count: 10
48
+ export const _DYN_ERROR_STATUS_TEXT = "errorStatusText"; // Count: 3
49
+ export const _DYN_STATE_CHANGE_ATTACHE11 = "stateChangeAttached"; // Count: 2
50
+ export const _DYN_RESPONSE_TEXT = "responseText"; // Count: 5
51
+ export const _DYN_RESPONSE_FINISHED_TI12 = "responseFinishedTime"; // Count: 7
52
+ export const _DYN__CREATE_TRACK_ITEM = "CreateTrackItem"; // Count: 3
53
+ export const _DYN_RESPONSE = "response"; // Count: 4
54
+ export const _DYN_GET_ALL_RESPONSE_HEA13 = "getAllResponseHeaders"; // Count: 2
55
+ export const _DYN_GET_CORRELATION_CONT14 = "getCorrelationContext"; // Count: 2
56
+ export const _DYN_PERF_MARK = "perfMark"; // Count: 4
57
+ export const _DYN_AJAX_PERF_LOOKUP_DEL15 = "ajaxPerfLookupDelay"; // Count: 2
58
+ export const _DYN_NAME = "name"; // Count: 6
59
+ export const _DYN_PERF_TIMING = "perfTiming"; // Count: 3
60
+ export const _DYN_AJAX_DIAGNOSTICS_MES16 = "ajaxDiagnosticsMessage"; // Count: 3
61
+ export const _DYN_CORRELATION_CONTEXT = "correlationContext"; // Count: 3
62
+ export const _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration"; // Count: 3
package/src/ajax.ts CHANGED
@@ -1,23 +1,24 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import {
5
- RequestHeaders, CorrelationIdHelper, createTelemetryItem, ICorrelationConfig,
6
- RemoteDependencyData, dateTimeUtilsNow, DisabledPropertyName, IDependencyTelemetry,
7
- IConfig, ITelemetryContext, PropertiesPluginIdentifier, eDistributedTracingModes, IRequestContext, isInternalApplicationInsightsEndpoint,
8
- eRequestHeaders, formatTraceParent, createTraceParent, createDistributedTraceContextFromTrace
9
- } from "@microsoft/applicationinsights-common";
10
- import {
11
- isNullOrUndefined, arrForEach, isString, strTrim, isFunction, eLoggingSeverity, _eInternalMessageId,
12
- IAppInsightsCore, BaseTelemetryPlugin, ITelemetryPluginChain, IConfiguration, IPlugin, ITelemetryItem, IProcessTelemetryContext,
13
- getLocation, getGlobal, strPrototype, IInstrumentCallDetails, InstrumentFunc, InstrumentProto, getPerformance,
14
- IInstrumentHooksCallbacks, objForEachKey, generateW3CId, getIEVersion, dumpObj, ICustomProperties, isXhrSupported, eventOn,
15
- mergeEvtNamespace, createUniqueNamespace, createProcessTelemetryContext, _throwInternal, IDistributedTraceContext, getExceptionName
16
- } from "@microsoft/applicationinsights-core-js";
17
- import { ajaxRecord, IAjaxRecordResponse } from "./ajaxRecord";
18
- import dynamicProto from "@microsoft/dynamicproto-js";
19
- import { DependencyListenerFunction, IDependencyListenerContainer, IDependencyListenerDetails, IDependencyListenerHandler } from "./DependencyListener";
20
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import dynamicProto from "@microsoft/dynamicproto-js";
5
+ import {
6
+ CorrelationIdHelper, DisabledPropertyName, IConfig, ICorrelationConfig, IDependencyTelemetry, IRequestContext, ITelemetryContext,
7
+ PropertiesPluginIdentifier, RemoteDependencyData, RequestHeaders, createDistributedTraceContextFromTrace, createTelemetryItem,
8
+ createTraceParent, dateTimeUtilsNow, eDistributedTracingModes, eRequestHeaders, formatTraceParent, isInternalApplicationInsightsEndpoint
9
+ } from "@microsoft/applicationinsights-common";
10
+ import {
11
+ BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, ICustomProperties, IDistributedTraceContext, IInstrumentCallDetails,
12
+ IInstrumentHooksCallbacks, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain, InstrumentFunc, InstrumentProto,
13
+ _eInternalMessageId, _throwInternal, arrForEach, createProcessTelemetryContext, createUniqueNamespace, deepFreeze, dumpObj,
14
+ eLoggingSeverity, eventOn, generateW3CId, getExceptionName, getGlobal, getIEVersion, getLocation, getPerformance, isFunction,
15
+ isNullOrUndefined, isString, isXhrSupported, mergeEvtNamespace, objForEachKey, strPrototype, strTrim
16
+ } from "@microsoft/applicationinsights-core-js";
17
+ import {
18
+ DependencyListenerFunction, IDependencyListenerContainer, IDependencyListenerDetails, IDependencyListenerHandler
19
+ } from "./DependencyListener";
20
+ import { IAjaxRecordResponse, ajaxRecord } from "./ajaxRecord";
21
+
21
22
  const AJAX_MONITOR_PREFIX = "ai.ajxmn.";
22
23
  const strDiagLog = "diagLog";
23
24
  const strAjaxData = "ajaxData";
@@ -178,6 +179,13 @@ export interface XMLHttpRequestInstrumented extends XMLHttpRequest {
178
179
  ajaxData: ajaxRecord;
179
180
  }
180
181
 
182
+ export const DfltAjaxCorrelationHeaderExDomains = deepFreeze([
183
+ "*.blob.core.windows.net",
184
+ "*.blob.core.chinacloudapi.cn",
185
+ "*.blob.core.cloudapi.de",
186
+ "*.blob.core.usgovcloudapi.net"
187
+ ]);
188
+
181
189
  export interface IDependenciesPlugin extends IDependencyListenerContainer {
182
190
  /**
183
191
  * Logs dependency call
@@ -202,11 +210,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
202
210
  excludeRequestFromAutoTrackingPatterns: undefined,
203
211
  disableCorrelationHeaders: false,
204
212
  distributedTracingMode: eDistributedTracingModes.AI_AND_W3C,
205
- correlationHeaderExcludedDomains: [
206
- "*.blob.core.windows.net",
207
- "*.blob.core.chinacloudapi.cn",
208
- "*.blob.core.cloudapi.de",
209
- "*.blob.core.usgovcloudapi.net"],
213
+ correlationHeaderExcludedDomains: DfltAjaxCorrelationHeaderExDomains,
210
214
  correlationHeaderDomains: undefined,
211
215
  correlationHeaderExcludePatterns: undefined,
212
216
  appId: undefined,
@@ -302,20 +306,21 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
302
306
  if (!init) {
303
307
  init = {};
304
308
  }
309
+
305
310
  // init headers override original request headers
306
311
  // so, if they exist use only them, otherwise use request's because they should have been applied in the first place
307
312
  // not using original request headers will result in them being lost
308
- init.headers = new Headers(init.headers || (input instanceof Request ? (input.headers || {}) : {}));
313
+ let headers = new Headers(init.headers || (input instanceof Request ? (input.headers || {}) : {}));
309
314
  if (_isUsingAIHeaders) {
310
315
  const id = "|" + ajaxData.traceID + "." + ajaxData.spanID;
311
- init.headers.set(RequestHeaders[eRequestHeaders.requestIdHeader], id);
316
+ headers.set(RequestHeaders[eRequestHeaders.requestIdHeader], id);
312
317
  if (_enableRequestHeaderTracking) {
313
318
  ajaxData.requestHeaders[RequestHeaders[eRequestHeaders.requestIdHeader]] = id;
314
319
  }
315
320
  }
316
321
  const appId: string = _config.appId ||(_context && _context.appId());
317
322
  if (appId) {
318
- init.headers.set(RequestHeaders[eRequestHeaders.requestContextHeader], RequestHeaders[eRequestHeaders.requestContextAppIdFormat] + appId);
323
+ headers.set(RequestHeaders[eRequestHeaders.requestContextHeader], RequestHeaders[eRequestHeaders.requestContextAppIdFormat] + appId);
319
324
  if (_enableRequestHeaderTracking) {
320
325
  ajaxData.requestHeaders[RequestHeaders[eRequestHeaders.requestContextHeader]] = RequestHeaders[eRequestHeaders.requestContextAppIdFormat] + appId;
321
326
  }
@@ -327,11 +332,13 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
327
332
  }
328
333
 
329
334
  const traceParent = formatTraceParent(createTraceParent(ajaxData.traceID, ajaxData.spanID, traceFlags));
330
- init.headers.set(RequestHeaders[eRequestHeaders.traceParentHeader], traceParent);
335
+ headers.set(RequestHeaders[eRequestHeaders.traceParentHeader], traceParent);
331
336
  if (_enableRequestHeaderTracking) {
332
337
  ajaxData.requestHeaders[RequestHeaders[eRequestHeaders.traceParentHeader]] = traceParent;
333
338
  }
334
339
  }
340
+
341
+ init.headers = headers;
335
342
  }
336
343
 
337
344
  return init;
@@ -552,7 +559,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
552
559
 
553
560
  if (_enableResponseHeaderTracking) {
554
561
  const responseHeaderMap = {};
555
- response.headers.forEach((value: string, name: string) => {
562
+ response.headers.forEach((value: string, name: string) => { // @skip-minify
556
563
  if (_canIncludeHeaders(name)) {
557
564
  responseHeaderMap[name] = value;
558
565
  }
@@ -1046,7 +1053,7 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
1046
1053
  let requestHeaders = {};
1047
1054
  if (_enableRequestHeaderTracking) {
1048
1055
  let headers = new Headers((init ? init.headers : 0) || (input instanceof Request ? (input.headers || {}) : {}));
1049
- headers.forEach((value, key) => {
1056
+ headers.forEach((value, key) => { // @skip-minify
1050
1057
  if (_canIncludeHeaders(key)) {
1051
1058
  requestHeaders[key] = value;
1052
1059
  }
@@ -1191,4 +1198,4 @@ export class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlu
1191
1198
  protected trackDependencyDataInternal(dependency: IDependencyTelemetry, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) {
1192
1199
  // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
1193
1200
  }
1194
- }
1201
+ }
package/src/ajaxRecord.ts CHANGED
@@ -1,10 +1,15 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { dataSanitizeUrl, dateTimeUtilsDuration, IDependencyTelemetry, urlGetAbsoluteUrl, urlGetCompleteUrl, msToTimeSpan } from "@microsoft/applicationinsights-common";
5
- import { IDiagnosticLogger, objKeys, arrForEach, isNumber, isString, normalizeJsName, objForEachKey } from "@microsoft/applicationinsights-core-js";
6
- import dynamicProto from "@microsoft/dynamicproto-js";
7
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import dynamicProto from "@microsoft/dynamicproto-js";
5
+ import {
6
+ IDependencyTelemetry, dataSanitizeUrl, dateTimeUtilsDuration, msToTimeSpan, urlGetAbsoluteUrl, urlGetCompleteUrl
7
+ } from "@microsoft/applicationinsights-common";
8
+ import {
9
+ IDiagnosticLogger, arrForEach, isNumber, isString, normalizeJsName, objForEachKey, objKeys
10
+ } from "@microsoft/applicationinsights-core-js";
11
+ import { STR_DURATION, STR_PROPERTIES } from "./InternalConstants";
12
+
8
13
  export interface IAjaxRecordResponse {
9
14
  statusText: string,
10
15
  headerMap: Object,
@@ -14,8 +19,6 @@ export interface IAjaxRecordResponse {
14
19
  response?: Object
15
20
  }
16
21
 
17
- let strProperties = "properties";
18
-
19
22
  /** @ignore */
20
23
  function _calcPerfDuration(resourceEntry:PerformanceResourceTiming, start:string, end:string) {
21
24
  let result = 0;
@@ -76,7 +79,7 @@ function _populatePerfData(ajaxData:ajaxRecord, dependency:IDependencyTelemetry)
76
79
  */
77
80
 
78
81
  let resourceEntry = ajaxData.perfTiming;
79
- let props = dependency[strProperties] || {};
82
+ let props = dependency.properties || {};
80
83
  let propsSet = 0;
81
84
  let strName = "name";
82
85
  let strStart = "Start";
@@ -86,7 +89,6 @@ function _populatePerfData(ajaxData:ajaxRecord, dependency:IDependencyTelemetry)
86
89
  let strRedirect = "redirect";
87
90
  let strRequest = "request";
88
91
  let strResponse = "response";
89
- let strDuration = "duration";
90
92
  let strStartTime = "startTime";
91
93
  let strDomainLookupStart = strDomainLookup + strStart;
92
94
  let strDomainLookupEnd = strDomainLookup + strEnd;
@@ -127,12 +129,12 @@ function _populatePerfData(ajaxData:ajaxRecord, dependency:IDependencyTelemetry)
127
129
  propsSet |= _setPerfDuration(props, "sentRequest", resourceEntry, strRequestStart, strResponseEnd);
128
130
 
129
131
  // PerfTotal / Duration
130
- let duration = resourceEntry[strDuration];
132
+ let duration = resourceEntry.duration;
131
133
  if (!duration) {
132
134
  duration = _calcPerfDuration(resourceEntry, strStartTime, strResponseEnd) || 0;
133
135
  }
134
136
 
135
- propsSet |= _setPerfValue(props, strDuration, duration);
137
+ propsSet |= _setPerfValue(props, STR_DURATION, duration);
136
138
  propsSet |= _setPerfValue(props, "perfTotal", duration);
137
139
 
138
140
  var serverTiming = resourceEntry[strServerTiming];
@@ -167,7 +169,7 @@ function _populatePerfData(ajaxData:ajaxRecord, dependency:IDependencyTelemetry)
167
169
  }
168
170
 
169
171
  if (propsSet) {
170
- dependency[strProperties] = props;
172
+ dependency.properties = props;
171
173
  }
172
174
  }
173
175
 
@@ -296,7 +298,7 @@ export class ajaxRecord {
296
298
  success: (+(self.status)) >= 200 && (+(self.status)) < 400,
297
299
  responseCode: (+(self.status)),
298
300
  method: self.method,
299
- [strProperties]: { HttpMethod: self.method }
301
+ [STR_PROPERTIES]: { HttpMethod: self.method }
300
302
  } as IDependencyTelemetry;
301
303
 
302
304
  if (self.requestSentTime) {
@@ -310,8 +312,8 @@ export class ajaxRecord {
310
312
 
311
313
  if (enableRequestHeaderTracking) {
312
314
  if (objKeys(self.requestHeaders).length > 0) {
313
- dependency[strProperties] = dependency[strProperties] || {};
314
- dependency[strProperties].requestHeaders = self.requestHeaders;
315
+ let props = dependency.properties = dependency.properties || {};
316
+ props.requestHeaders = self.requestHeaders;
315
317
  }
316
318
  }
317
319
 
@@ -327,19 +329,19 @@ export class ajaxRecord {
327
329
 
328
330
  if (response.headerMap) {
329
331
  if (objKeys(response.headerMap).length > 0) {
330
- dependency[strProperties] = dependency[strProperties] || {};
331
- dependency[strProperties].responseHeaders = response.headerMap;
332
+ let props = dependency.properties = dependency.properties || {};
333
+ props.responseHeaders = response.headerMap;
332
334
  }
333
335
  }
334
336
 
335
337
  if (self.errorStatusText && self.status >= 400) {
336
338
  const responseType = response.type;
337
- dependency[strProperties] = dependency[strProperties] || {};
339
+ let props = dependency.properties = dependency.properties || {};
338
340
  if (responseType === "" || responseType === "text") {
339
- dependency[strProperties][strResponseText] = response[strResponseText] ? response.statusText + " - " + response[strResponseText] : response.statusText;
341
+ props.responseText = response.responseText ? response.statusText + " - " + response[strResponseText] : response.statusText;
340
342
  }
341
343
  if (responseType === "json") {
342
- dependency[strProperties][strResponseText] = response.response ? response.statusText + " - " + JSON.stringify(response.response) : response.statusText;
344
+ props.responseText = response.response ? response.statusText + " - " + JSON.stringify(response.response) : response.statusText;
343
345
  }
344
346
  }
345
347
  }
@@ -364,5 +366,4 @@ export class ajaxRecord {
364
366
  // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
365
367
  return null;
366
368
  }
367
- }
368
-
369
+ }
package/src/ajaxUtils.ts CHANGED
@@ -1,8 +1,8 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { isNullOrUndefined } from "@microsoft/applicationinsights-core-js";
5
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { isNullOrUndefined } from "@microsoft/applicationinsights-core-js";
5
+
6
6
  export class stringUtils {
7
7
  public static GetLength(strObject: any) {
8
8
  let res = 0;
@@ -20,4 +20,4 @@ export class stringUtils {
20
20
 
21
21
  return res;
22
22
  }
23
- }
23
+ }
@@ -1,5 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation. All rights reserved.
2
2
  // Licensed under the MIT License.
3
3
 
4
- export { AjaxMonitor as AjaxPlugin, IDependenciesPlugin, XMLHttpRequestInstrumented, IInstrumentationRequirements } from "./ajax";
4
+ export { AjaxMonitor as AjaxPlugin, IDependenciesPlugin, XMLHttpRequestInstrumented, IInstrumentationRequirements, DfltAjaxCorrelationHeaderExDomains } from "./ajax";
5
5
  export { ajaxRecord } from "./ajaxRecord";
@@ -0,0 +1,2 @@
1
+ export declare const STR_DURATION = "duration";
2
+ export declare const STR_PROPERTIES = "properties";
@@ -0,0 +1,50 @@
1
+ export declare const _DYN_REQUEST_URL = "requestUrl";
2
+ export declare const _DYN_INST = "inst";
3
+ export declare const _DYN_LENGTH = "length";
4
+ export declare const _DYN_TRACE_ID = "traceID";
5
+ export declare const _DYN_SPAN_ID = "spanID";
6
+ export declare const _DYN_TRACE_FLAGS = "traceFlags";
7
+ export declare const _DYN_CORE = "core";
8
+ export declare const _DYN_GET_DEFAULT_CONFIG = "getDefaultConfig";
9
+ export declare const _DYN_INCLUDE_CORRELATION_0 = "includeCorrelationHeaders";
10
+ export declare const _DYN_CAN_INCLUDE_CORRELAT1 = "canIncludeCorrelationHeader";
11
+ export declare const _DYN_GET_ABSOLUTE_URL = "getAbsoluteUrl";
12
+ export declare const _DYN_HEADERS = "headers";
13
+ export declare const _DYN_REQUEST_HEADERS = "requestHeaders";
14
+ export declare const _DYN_APP_ID = "appId";
15
+ export declare const _DYN_SET_REQUEST_HEADER = "setRequestHeader";
16
+ export declare const _DYN_DISTRIBUTED_TRACING_2 = "distributedTracingMode";
17
+ export declare const _DYN_START_TIME = "startTime";
18
+ export declare const _DYN_TO_LOWER_CASE = "toLowerCase";
19
+ export declare const _DYN_ENABLE_REQUEST_HEADE3 = "enableRequestHeaderTracking";
20
+ export declare const _DYN_ENABLE_AJAX_ERROR_ST4 = "enableAjaxErrorStatusText";
21
+ export declare const _DYN_ENABLE_AJAX_PERF_TRA5 = "enableAjaxPerfTracking";
22
+ export declare const _DYN_MAX_AJAX_CALLS_PER_V6 = "maxAjaxCallsPerView";
23
+ export declare const _DYN_ENABLE_RESPONSE_HEAD7 = "enableResponseHeaderTracking";
24
+ export declare const _DYN_EXCLUDE_REQUEST_FROM8 = "excludeRequestFromAutoTrackingPatterns";
25
+ export declare const _DYN_ADD_REQUEST_CONTEXT = "addRequestContext";
26
+ export declare const _DYN_DISABLE_AJAX_TRACKIN9 = "disableAjaxTracking";
27
+ export declare const _DYN_DISABLE_FETCH_TRACKI10 = "disableFetchTracking";
28
+ export declare const _DYN_STATUS = "status";
29
+ export declare const _DYN_STATUS_TEXT = "statusText";
30
+ export declare const _DYN_HEADER_MAP = "headerMap";
31
+ export declare const _DYN_OPEN_DONE = "openDone";
32
+ export declare const _DYN_SEND_DONE = "sendDone";
33
+ export declare const _DYN_REQUEST_SENT_TIME = "requestSentTime";
34
+ export declare const _DYN_ABORT_DONE = "abortDone";
35
+ export declare const _DYN_METHOD = "method";
36
+ export declare const _DYN_ERROR_STATUS_TEXT = "errorStatusText";
37
+ export declare const _DYN_STATE_CHANGE_ATTACHE11 = "stateChangeAttached";
38
+ export declare const _DYN_RESPONSE_TEXT = "responseText";
39
+ export declare const _DYN_RESPONSE_FINISHED_TI12 = "responseFinishedTime";
40
+ export declare const _DYN__CREATE_TRACK_ITEM = "CreateTrackItem";
41
+ export declare const _DYN_RESPONSE = "response";
42
+ export declare const _DYN_GET_ALL_RESPONSE_HEA13 = "getAllResponseHeaders";
43
+ export declare const _DYN_GET_CORRELATION_CONT14 = "getCorrelationContext";
44
+ export declare const _DYN_PERF_MARK = "perfMark";
45
+ export declare const _DYN_AJAX_PERF_LOOKUP_DEL15 = "ajaxPerfLookupDelay";
46
+ export declare const _DYN_NAME = "name";
47
+ export declare const _DYN_PERF_TIMING = "perfTiming";
48
+ export declare const _DYN_AJAX_DIAGNOSTICS_MES16 = "ajaxDiagnosticsMessage";
49
+ export declare const _DYN_CORRELATION_CONTEXT = "correlationContext";
50
+ export declare const _DYN_AJAX_TOTAL_DURATION = "ajaxTotalDuration";
package/types/ajax.d.ts CHANGED
@@ -1,10 +1,12 @@
1
- import { ICorrelationConfig, IDependencyTelemetry, IConfig } from "@microsoft/applicationinsights-common";
2
- import { IAppInsightsCore, BaseTelemetryPlugin, ITelemetryPluginChain, IConfiguration, IPlugin, ITelemetryItem, IProcessTelemetryContext } from "@microsoft/applicationinsights-core-js";
3
- import { ajaxRecord } from "./ajaxRecord";
1
+ import { IConfig, ICorrelationConfig, IDependencyTelemetry } from "@microsoft/applicationinsights-common";
2
+ import { BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain } from "@microsoft/applicationinsights-core-js";
4
3
  import { DependencyListenerFunction, IDependencyListenerContainer, IDependencyListenerHandler } from "./DependencyListener";
4
+ import { _DYN_INCLUDE_CORRELATION_0 } from "./__DynamicConstants";
5
+ import { ajaxRecord } from "./ajaxRecord";
5
6
  export interface XMLHttpRequestInstrumented extends XMLHttpRequest {
6
7
  ajaxData: ajaxRecord;
7
8
  }
9
+ export declare const DfltAjaxCorrelationHeaderExDomains: string[];
8
10
  export interface IDependenciesPlugin extends IDependencyListenerContainer {
9
11
  /**
10
12
  * Logs dependency call
@@ -13,7 +15,7 @@ export interface IDependenciesPlugin extends IDependencyListenerContainer {
13
15
  trackDependencyData(dependency: IDependencyTelemetry): void;
14
16
  }
15
17
  export interface IInstrumentationRequirements extends IDependenciesPlugin {
16
- includeCorrelationHeaders: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
18
+ [_DYN_INCLUDE_CORRELATION_0]: (ajaxData: ajaxRecord, input?: Request | string, init?: RequestInit, xhr?: XMLHttpRequestInstrumented) => any;
17
19
  }
18
20
  export declare class AjaxMonitor extends BaseTelemetryPlugin implements IDependenciesPlugin, IInstrumentationRequirements {
19
21
  static identifier: string;
@@ -1,8 +1,9 @@
1
1
  import { IDependencyTelemetry } from "@microsoft/applicationinsights-common";
2
2
  import { IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
3
+ import { _DYN_HEADER_MAP } from "./__DynamicConstants";
3
4
  export interface IAjaxRecordResponse {
4
5
  statusText: string;
5
- headerMap: Object;
6
+ [_DYN_HEADER_MAP]: Object;
6
7
  correlationContext: string;
7
8
  type?: string;
8
9
  responseText?: string;