@microsoft/applicationinsights-properties-js 2.8.6 → 3.0.0-beta.2208-04
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-properties-js.integrity.json +9 -9
- package/browser/applicationinsights-properties-js.js +7 -7
- package/browser/applicationinsights-properties-js.js.map +1 -1
- package/browser/applicationinsights-properties-js.min.js +2 -2
- package/browser/applicationinsights-properties-js.min.js.map +1 -1
- package/dist/applicationinsights-properties-js.d.ts +1 -1
- package/dist/applicationinsights-properties-js.js +7 -7
- package/dist/applicationinsights-properties-js.js.map +1 -1
- package/dist/applicationinsights-properties-js.min.js +2 -2
- package/dist/applicationinsights-properties-js.min.js.map +1 -1
- package/dist/applicationinsights-properties-js.rollup.d.ts +1 -1
- package/dist-esm/Context/Application.js +1 -1
- package/dist-esm/Context/Device.js +1 -1
- package/dist-esm/Context/Internal.js +2 -2
- package/dist-esm/Context/Internal.js.map +1 -1
- package/dist-esm/Context/Location.js +1 -1
- package/dist-esm/Context/Session.js +1 -1
- package/dist-esm/Context/TelemetryTrace.js +1 -1
- package/dist-esm/Context/User.js +1 -1
- package/dist-esm/Interfaces/IPropTelemetryContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryConfig.js +1 -1
- package/dist-esm/PropertiesPlugin.js +1 -1
- package/dist-esm/TelemetryContext.js +5 -5
- package/dist-esm/TelemetryContext.js.map +1 -1
- package/dist-esm/__DynamicConstants.js +1 -1
- package/dist-esm/applicationinsights-properties-js.js +1 -1
- package/package.json +64 -61
- package/src/TelemetryContext.ts +4 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Properties Plugin,
|
|
2
|
+
* Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2208-04
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
import { _DYN_SDK_EXTENSION } from "../__DynamicConstants";
|
|
8
|
-
var Version =
|
|
8
|
+
var Version = "3.0.0-beta.2208-04";
|
|
9
9
|
var Internal = /** @class */ (function () {
|
|
10
10
|
/**
|
|
11
11
|
* Constructs a new instance of the internal telemetry data class.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Internal.js.map","sources":["Internal.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _DYN_SDK_EXTENSION } from \"../__DynamicConstants\";\r\nvar Version =
|
|
1
|
+
{"version":3,"file":"Internal.js.map","sources":["Internal.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\nimport { _DYN_SDK_EXTENSION } from \"../__DynamicConstants\";\r\nvar Version = \"3.0.0-beta.2208-04\";\r\nvar Internal = /** @class */ (function () {\r\n /**\r\n * Constructs a new instance of the internal telemetry data class.\r\n */\r\n function Internal(config) {\r\n this.sdkVersion = (config[_DYN_SDK_EXTENSION /* @min:%2esdkExtension */] && config[_DYN_SDK_EXTENSION /* @min:%2esdkExtension */]() ? config[_DYN_SDK_EXTENSION /* @min:%2esdkExtension */]() + \"_\" : \"\") + \"javascript:\" + Version;\r\n }\r\n return Internal;\r\n}());\r\nexport { Internal };\r\n//# sourceMappingURL=Internal.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist-esm/Context/User.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Properties Plugin,
|
|
2
|
+
* Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2208-04
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
10
10
|
import { CtxTagKeys, Extensions, PageView } from "@microsoft/applicationinsights-common";
|
|
11
|
-
import { _InternalLogMessage, getSetValue, hasWindow,
|
|
11
|
+
import { _InternalLogMessage, getSetValue, hasWindow, isString, objKeys, setValue } from "@microsoft/applicationinsights-core-js";
|
|
12
12
|
import { Application } from "./Context/Application";
|
|
13
13
|
import { Device } from "./Context/Device";
|
|
14
14
|
import { Internal } from "./Context/Internal";
|
|
@@ -111,9 +111,9 @@ var TelemetryContext = /** @class */ (function () {
|
|
|
111
111
|
var telemetryTrace = _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */];
|
|
112
112
|
if (telemetryTrace) {
|
|
113
113
|
var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined });
|
|
114
|
-
setValue(extTrace, "traceID", telemetryTrace.traceID, isString
|
|
115
|
-
setValue(extTrace, "name", telemetryTrace.name, isString
|
|
116
|
-
setValue(extTrace, "parentID", telemetryTrace.parentID, isString
|
|
114
|
+
setValue(extTrace, "traceID", telemetryTrace.traceID, isString);
|
|
115
|
+
setValue(extTrace, "name", telemetryTrace.name, isString);
|
|
116
|
+
setValue(extTrace, "parentID", telemetryTrace.parentID, isString);
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
_self.applyWebContext = function (evt, itemCtx) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryContext.js.map","sources":["TelemetryContext.js"],"sourcesContent":["/**\r\n* TelemetryContext.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { CtxTagKeys, Extensions, PageView } from \"@microsoft/applicationinsights-common\";\r\nimport { _InternalLogMessage, getSetValue, hasWindow, isNullOrUndefined, isString, objKeys, setValue } from \"@microsoft/applicationinsights-core-js\";\r\nimport { Application } from \"./Context/Application\";\r\nimport { Device } from \"./Context/Device\";\r\nimport { Internal } from \"./Context/Internal\";\r\nimport { Location } from \"./Context/Location\";\r\nimport { Session, _SessionManager } from \"./Context/Session\";\r\nimport { TelemetryTrace } from \"./Context/TelemetryTrace\";\r\nimport { User } from \"./Context/User\";\r\nimport { _DYN_ACCOUNT_ID, _DYN_APPLY_APPLICATION_CO1, _DYN_APPLY_DEVICE_CONTEXT, _DYN_APPLY_INTERNAL_CONTE5, _DYN_APPLY_LOCATION_CONTE4, _DYN_APPLY_OPERATING_SYST3, _DYN_APPLY_OPERATION_CONT2, _DYN_APPLY_SESSION_CONTEX0, _DYN_APPLY_USER_CONTEXT, _DYN_AUTHENTICATED_ID, _DYN_AUTOMATIC_SESSION, _DYN_GET_SESSION_ID, _DYN_LENGTH, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE } from \"./__DynamicConstants\";\r\nvar strExt = \"ext\";\r\nvar strTags = \"tags\";\r\nfunction _removeEmpty(target, name) {\r\n if (target && target[name] && objKeys(target[name])[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n delete target[name];\r\n }\r\n}\r\nvar TelemetryContext = /** @class */ (function () {\r\n function TelemetryContext(core, defaultConfig, previousTraceCtx) {\r\n var _this = this;\r\n var logger = core.logger;\r\n this.appId = function () { return null; };\r\n this[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () { return null; };\r\n dynamicProto(TelemetryContext, this, function (_self) {\r\n _self.application = new Application();\r\n _self.internal = new Internal(defaultConfig);\r\n if (hasWindow()) {\r\n _self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] = new _SessionManager(defaultConfig, core);\r\n _self.device = new Device();\r\n _self.location = new Location();\r\n _self.user = new User(defaultConfig, core);\r\n var traceId = void 0;\r\n var parentId = void 0;\r\n var name_1;\r\n if (previousTraceCtx) {\r\n traceId = previousTraceCtx.getTraceId();\r\n parentId = previousTraceCtx.getSpanId();\r\n name_1 = previousTraceCtx.getName();\r\n }\r\n _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */] = new TelemetryTrace(traceId, parentId, name_1, logger);\r\n _self.session = new Session();\r\n }\r\n _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () {\r\n var session = _self.session;\r\n var sesId = null;\r\n // If customer set session info, apply their context; otherwise apply context automatically generated\r\n if (session && isString(session.id)) {\r\n sesId = session.id;\r\n }\r\n else {\r\n // Gets the automatic session if it exists or an empty object\r\n var autoSession = (_self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] || {})[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n sesId = autoSession && isString(autoSession.id) ? autoSession.id : null;\r\n }\r\n return sesId;\r\n };\r\n _self[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */] = function (evt, itemCtx) {\r\n setValue(getSetValue(evt.ext, Extensions.AppExt), \"sesId\", _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */](), isString);\r\n };\r\n _self[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */] = function (evt, itemCtx) {\r\n setValue(evt.ext, Extensions.OSExt, _self.os);\r\n };\r\n _self[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */] = function (evt, itemCtx) {\r\n var application = _self.application;\r\n if (application) {\r\n // evt.ext.app\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString);\r\n setValue(tags, CtxTagKeys.applicationBuild, application.build, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_DEVICE_CONTEXT /* @min:%2eapplyDeviceContext */] = function (evt, itemCtx) {\r\n var device = _self.device;\r\n if (device) {\r\n // evt.ext.device\r\n var extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt);\r\n setValue(extDevice, \"localId\", device.id, isString);\r\n setValue(extDevice, \"ip\", device.ip, isString);\r\n setValue(extDevice, \"model\", device.model, isString);\r\n setValue(extDevice, \"deviceClass\", device.deviceClass, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */] = function (evt, itemCtx) {\r\n var internal = _self.internal;\r\n if (internal) {\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); // not mapped in CS 4.0\r\n setValue(tags, CtxTagKeys.internalSdkVersion, internal.sdkVersion, isString);\r\n if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) {\r\n setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString);\r\n setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString);\r\n }\r\n }\r\n };\r\n _self[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */] = function (evt, itemCtx) {\r\n var location = _this.location;\r\n if (location) {\r\n setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */] = function (evt, itemCtx) {\r\n var telemetryTrace = _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */];\r\n if (telemetryTrace) {\r\n var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined });\r\n setValue(extTrace, \"traceID\", telemetryTrace.traceID, isString, isNullOrUndefined);\r\n setValue(extTrace, \"name\", telemetryTrace.name, isString, isNullOrUndefined);\r\n setValue(extTrace, \"parentID\", telemetryTrace.parentID, isString, isNullOrUndefined);\r\n }\r\n };\r\n _self.applyWebContext = function (evt, itemCtx) {\r\n var web = _this.web;\r\n if (web) {\r\n setValue(getSetValue(evt, strExt), Extensions.WebExt, web);\r\n }\r\n };\r\n _self[_DYN_APPLY_USER_CONTEXT /* @min:%2eapplyUserContext */] = function (evt, itemCtx) {\r\n var user = _self.user;\r\n if (user) {\r\n var tags = getSetValue(evt, strTags, []);\r\n // stays in tags\r\n setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID /* @min:%2eaccountId */], isString);\r\n // CS 4.0\r\n var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt);\r\n setValue(extUser, \"id\", user.id, isString);\r\n setValue(extUser, \"authId\", user[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */], isString);\r\n }\r\n };\r\n _self.cleanUp = function (evt, itemCtx) {\r\n var ext = evt.ext;\r\n if (ext) {\r\n _removeEmpty(ext, Extensions.DeviceExt);\r\n _removeEmpty(ext, Extensions.UserExt);\r\n _removeEmpty(ext, Extensions.WebExt);\r\n _removeEmpty(ext, Extensions.OSExt);\r\n _removeEmpty(ext, Extensions.AppExt);\r\n _removeEmpty(ext, Extensions.TraceExt);\r\n }\r\n };\r\n });\r\n }\r\n TelemetryContext.prototype.applySessionContext = function (evt, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyOperatingSystemContxt = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyApplicationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyDeviceContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyInternalContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyLocationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyOperationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyWebContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyUserContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.cleanUp = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return TelemetryContext;\r\n}());\r\nexport { TelemetryContext };\r\n//# sourceMappingURL=TelemetryContext.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;uDA6BM,CAAC;;;;;;4BACqB;AAC5B;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"TelemetryContext.js.map","sources":["TelemetryContext.js"],"sourcesContent":["/**\r\n* TelemetryContext.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { CtxTagKeys, Extensions, PageView } from \"@microsoft/applicationinsights-common\";\r\nimport { _InternalLogMessage, getSetValue, hasWindow, isString, objKeys, setValue } from \"@microsoft/applicationinsights-core-js\";\r\nimport { Application } from \"./Context/Application\";\r\nimport { Device } from \"./Context/Device\";\r\nimport { Internal } from \"./Context/Internal\";\r\nimport { Location } from \"./Context/Location\";\r\nimport { Session, _SessionManager } from \"./Context/Session\";\r\nimport { TelemetryTrace } from \"./Context/TelemetryTrace\";\r\nimport { User } from \"./Context/User\";\r\nimport { _DYN_ACCOUNT_ID, _DYN_APPLY_APPLICATION_CO1, _DYN_APPLY_DEVICE_CONTEXT, _DYN_APPLY_INTERNAL_CONTE5, _DYN_APPLY_LOCATION_CONTE4, _DYN_APPLY_OPERATING_SYST3, _DYN_APPLY_OPERATION_CONT2, _DYN_APPLY_SESSION_CONTEX0, _DYN_APPLY_USER_CONTEXT, _DYN_AUTHENTICATED_ID, _DYN_AUTOMATIC_SESSION, _DYN_GET_SESSION_ID, _DYN_LENGTH, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE } from \"./__DynamicConstants\";\r\nvar strExt = \"ext\";\r\nvar strTags = \"tags\";\r\nfunction _removeEmpty(target, name) {\r\n if (target && target[name] && objKeys(target[name])[_DYN_LENGTH /* @min:%2elength */] === 0) {\r\n delete target[name];\r\n }\r\n}\r\nvar TelemetryContext = /** @class */ (function () {\r\n function TelemetryContext(core, defaultConfig, previousTraceCtx) {\r\n var _this = this;\r\n var logger = core.logger;\r\n this.appId = function () { return null; };\r\n this[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () { return null; };\r\n dynamicProto(TelemetryContext, this, function (_self) {\r\n _self.application = new Application();\r\n _self.internal = new Internal(defaultConfig);\r\n if (hasWindow()) {\r\n _self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] = new _SessionManager(defaultConfig, core);\r\n _self.device = new Device();\r\n _self.location = new Location();\r\n _self.user = new User(defaultConfig, core);\r\n var traceId = void 0;\r\n var parentId = void 0;\r\n var name_1;\r\n if (previousTraceCtx) {\r\n traceId = previousTraceCtx.getTraceId();\r\n parentId = previousTraceCtx.getSpanId();\r\n name_1 = previousTraceCtx.getName();\r\n }\r\n _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */] = new TelemetryTrace(traceId, parentId, name_1, logger);\r\n _self.session = new Session();\r\n }\r\n _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () {\r\n var session = _self.session;\r\n var sesId = null;\r\n // If customer set session info, apply their context; otherwise apply context automatically generated\r\n if (session && isString(session.id)) {\r\n sesId = session.id;\r\n }\r\n else {\r\n // Gets the automatic session if it exists or an empty object\r\n var autoSession = (_self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] || {})[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];\r\n sesId = autoSession && isString(autoSession.id) ? autoSession.id : null;\r\n }\r\n return sesId;\r\n };\r\n _self[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */] = function (evt, itemCtx) {\r\n setValue(getSetValue(evt.ext, Extensions.AppExt), \"sesId\", _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */](), isString);\r\n };\r\n _self[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */] = function (evt, itemCtx) {\r\n setValue(evt.ext, Extensions.OSExt, _self.os);\r\n };\r\n _self[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */] = function (evt, itemCtx) {\r\n var application = _self.application;\r\n if (application) {\r\n // evt.ext.app\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.applicationVersion, application.ver, isString);\r\n setValue(tags, CtxTagKeys.applicationBuild, application.build, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_DEVICE_CONTEXT /* @min:%2eapplyDeviceContext */] = function (evt, itemCtx) {\r\n var device = _self.device;\r\n if (device) {\r\n // evt.ext.device\r\n var extDevice = getSetValue(getSetValue(evt, strExt), Extensions.DeviceExt);\r\n setValue(extDevice, \"localId\", device.id, isString);\r\n setValue(extDevice, \"ip\", device.ip, isString);\r\n setValue(extDevice, \"model\", device.model, isString);\r\n setValue(extDevice, \"deviceClass\", device.deviceClass, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */] = function (evt, itemCtx) {\r\n var internal = _self.internal;\r\n if (internal) {\r\n var tags = getSetValue(evt, strTags);\r\n setValue(tags, CtxTagKeys.internalAgentVersion, internal.agentVersion, isString); // not mapped in CS 4.0\r\n setValue(tags, CtxTagKeys.internalSdkVersion, internal.sdkVersion, isString);\r\n if (evt.baseType === _InternalLogMessage.dataType || evt.baseType === PageView.dataType) {\r\n setValue(tags, CtxTagKeys.internalSnippet, internal.snippetVer, isString);\r\n setValue(tags, CtxTagKeys.internalSdkSrc, internal.sdkSrc, isString);\r\n }\r\n }\r\n };\r\n _self[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */] = function (evt, itemCtx) {\r\n var location = _this.location;\r\n if (location) {\r\n setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString);\r\n }\r\n };\r\n _self[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */] = function (evt, itemCtx) {\r\n var telemetryTrace = _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */];\r\n if (telemetryTrace) {\r\n var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined });\r\n setValue(extTrace, \"traceID\", telemetryTrace.traceID, isString);\r\n setValue(extTrace, \"name\", telemetryTrace.name, isString);\r\n setValue(extTrace, \"parentID\", telemetryTrace.parentID, isString);\r\n }\r\n };\r\n _self.applyWebContext = function (evt, itemCtx) {\r\n var web = _this.web;\r\n if (web) {\r\n setValue(getSetValue(evt, strExt), Extensions.WebExt, web);\r\n }\r\n };\r\n _self[_DYN_APPLY_USER_CONTEXT /* @min:%2eapplyUserContext */] = function (evt, itemCtx) {\r\n var user = _self.user;\r\n if (user) {\r\n var tags = getSetValue(evt, strTags, []);\r\n // stays in tags\r\n setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID /* @min:%2eaccountId */], isString);\r\n // CS 4.0\r\n var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt);\r\n setValue(extUser, \"id\", user.id, isString);\r\n setValue(extUser, \"authId\", user[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */], isString);\r\n }\r\n };\r\n _self.cleanUp = function (evt, itemCtx) {\r\n var ext = evt.ext;\r\n if (ext) {\r\n _removeEmpty(ext, Extensions.DeviceExt);\r\n _removeEmpty(ext, Extensions.UserExt);\r\n _removeEmpty(ext, Extensions.WebExt);\r\n _removeEmpty(ext, Extensions.OSExt);\r\n _removeEmpty(ext, Extensions.AppExt);\r\n _removeEmpty(ext, Extensions.TraceExt);\r\n }\r\n };\r\n });\r\n }\r\n TelemetryContext.prototype.applySessionContext = function (evt, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyOperatingSystemContxt = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyApplicationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyDeviceContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyInternalContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyLocationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyOperationContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyWebContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.applyUserContext = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n TelemetryContext.prototype.cleanUp = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return TelemetryContext;\r\n}());\r\nexport { TelemetryContext };\r\n//# sourceMappingURL=TelemetryContext.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;uDA6BM,CAAC;;;;;;4BACqB;AAC5B;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,61 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@microsoft/applicationinsights-properties-js",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Microsoft Application Insights properties (Part A) plugin",
|
|
5
|
-
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
|
-
"author": "Microsoft Application Insights Team",
|
|
7
|
-
"main": "dist/applicationinsights-properties-js.js",
|
|
8
|
-
"module": "dist-esm/applicationinsights-properties-js.js",
|
|
9
|
-
"types": "types/applicationinsights-properties-js.d.ts",
|
|
10
|
-
"sideEffects": false,
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-properties-js"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
|
|
17
|
-
"build:esm": "grunt properties",
|
|
18
|
-
"build:browser": "rollup -c",
|
|
19
|
-
"rebuild": "npm run build",
|
|
20
|
-
"test": "grunt propertiestests",
|
|
21
|
-
"mintest": "grunt properties-mintests",
|
|
22
|
-
"lint": "tslint -p tsconfig.json",
|
|
23
|
-
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights properties plugin\"",
|
|
24
|
-
"sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
|
|
25
|
-
"ai-min": "grunt properties-min",
|
|
26
|
-
"ai-restore": "grunt properties-restore"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@microsoft/ai-test-framework": "0.0.1",
|
|
30
|
-
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
|
31
|
-
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
|
32
|
-
"@microsoft/api-extractor": "^7.18.1",
|
|
33
|
-
"typescript": "^4.3.4",
|
|
34
|
-
"tslib": "^2.0.0",
|
|
35
|
-
"grunt": "^1.5.3",
|
|
36
|
-
"grunt-cli": "^1.4.3",
|
|
37
|
-
"grunt-contrib-qunit": "^5.0.1",
|
|
38
|
-
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
39
|
-
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
40
|
-
"globby": "^11.0.0",
|
|
41
|
-
"magic-string": "^0.25.7",
|
|
42
|
-
"pako": "^2.0.3",
|
|
43
|
-
"@rollup/plugin-commonjs": "^18.0.0",
|
|
44
|
-
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
45
|
-
"@rollup/plugin-replace": "^2.3.3",
|
|
46
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
47
|
-
"rollup": "^2.32.0",
|
|
48
|
-
"qunit": "^2.11.2",
|
|
49
|
-
"sinon": "^7.3.1"
|
|
50
|
-
},
|
|
51
|
-
"peerDependencies": {
|
|
52
|
-
"tslib": "*"
|
|
53
|
-
},
|
|
54
|
-
"dependencies": {
|
|
55
|
-
"@microsoft/dynamicproto-js": "^1.1.6",
|
|
56
|
-
"@microsoft/applicationinsights-shims": "2.0.1",
|
|
57
|
-
"@microsoft/applicationinsights-core-js": "
|
|
58
|
-
"@microsoft/applicationinsights-common": "
|
|
59
|
-
},
|
|
60
|
-
"license": "MIT"
|
|
61
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/applicationinsights-properties-js",
|
|
3
|
+
"version": "3.0.0-beta.2208-04",
|
|
4
|
+
"description": "Microsoft Application Insights properties (Part A) plugin",
|
|
5
|
+
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
|
+
"author": "Microsoft Application Insights Team",
|
|
7
|
+
"main": "dist/applicationinsights-properties-js.js",
|
|
8
|
+
"module": "dist-esm/applicationinsights-properties-js.js",
|
|
9
|
+
"types": "types/applicationinsights-properties-js.d.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/extensions/applicationinsights-properties-js"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "npm run build:esm && npm run build:browser && npm run sri && npm run dtsgen",
|
|
17
|
+
"build:esm": "grunt properties",
|
|
18
|
+
"build:browser": "rollup -c",
|
|
19
|
+
"rebuild": "npm run build",
|
|
20
|
+
"test": "grunt propertiestests",
|
|
21
|
+
"mintest": "grunt properties-mintests",
|
|
22
|
+
"lint": "tslint -p tsconfig.json",
|
|
23
|
+
"dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights properties plugin\"",
|
|
24
|
+
"sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
|
|
25
|
+
"ai-min": "grunt properties-min",
|
|
26
|
+
"ai-restore": "grunt properties-restore"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@microsoft/ai-test-framework": "0.0.1",
|
|
30
|
+
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
|
31
|
+
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
|
32
|
+
"@microsoft/api-extractor": "^7.18.1",
|
|
33
|
+
"typescript": "^4.3.4",
|
|
34
|
+
"tslib": "^2.0.0",
|
|
35
|
+
"grunt": "^1.5.3",
|
|
36
|
+
"grunt-cli": "^1.4.3",
|
|
37
|
+
"grunt-contrib-qunit": "^5.0.1",
|
|
38
|
+
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
39
|
+
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
40
|
+
"globby": "^11.0.0",
|
|
41
|
+
"magic-string": "^0.25.7",
|
|
42
|
+
"pako": "^2.0.3",
|
|
43
|
+
"@rollup/plugin-commonjs": "^18.0.0",
|
|
44
|
+
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
45
|
+
"@rollup/plugin-replace": "^2.3.3",
|
|
46
|
+
"rollup-plugin-cleanup": "^3.2.1",
|
|
47
|
+
"rollup": "^2.32.0",
|
|
48
|
+
"qunit": "^2.11.2",
|
|
49
|
+
"sinon": "^7.3.1"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"tslib": "*"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@microsoft/dynamicproto-js": "^1.1.6",
|
|
56
|
+
"@microsoft/applicationinsights-shims": "2.0.1",
|
|
57
|
+
"@microsoft/applicationinsights-core-js": "3.0.0-beta.2208-04",
|
|
58
|
+
"@microsoft/applicationinsights-common": "3.0.0-beta.2208-04"
|
|
59
|
+
},
|
|
60
|
+
"license": "MIT",
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"tag": "beta"
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/TelemetryContext.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "@microsoft/applicationinsights-common";
|
|
11
11
|
import {
|
|
12
12
|
IAppInsightsCore, IDistributedTraceContext, IProcessTelemetryContext, ITelemetryItem, _InternalLogMessage, getSetValue, hasWindow,
|
|
13
|
-
|
|
13
|
+
isString, objKeys, setValue
|
|
14
14
|
} from "@microsoft/applicationinsights-core-js";
|
|
15
15
|
import { Application } from "./Context/Application";
|
|
16
16
|
import { Device } from "./Context/Device";
|
|
@@ -145,9 +145,9 @@ export class TelemetryContext implements IPropTelemetryContext {
|
|
|
145
145
|
let telemetryTrace = _self.telemetryTrace;
|
|
146
146
|
if (telemetryTrace) {
|
|
147
147
|
const extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined } as ITelemetryTrace);
|
|
148
|
-
setValue(extTrace, "traceID", telemetryTrace.traceID, isString
|
|
149
|
-
setValue(extTrace, "name", telemetryTrace.name, isString
|
|
150
|
-
setValue(extTrace, "parentID", telemetryTrace.parentID, isString
|
|
148
|
+
setValue(extTrace, "traceID", telemetryTrace.traceID, isString);
|
|
149
|
+
setValue(extTrace, "name", telemetryTrace.name, isString);
|
|
150
|
+
setValue(extTrace, "parentID", telemetryTrace.parentID, isString);
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
|