@microsoft/applicationinsights-properties-js 2.8.15-nightly.2307-26 → 2.8.15
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 +14 -6
- 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 +14 -6
- 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 +5 -2
- package/dist-esm/PropertiesPlugin.js.map +1 -1
- package/dist-esm/TelemetryContext.js +1 -1
- package/dist-esm/__DynamicConstants.js +1 -1
- package/dist-esm/applicationinsights-properties-js.js +1 -1
- package/package.json +62 -65
- package/src/PropertiesPlugin.ts +6 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - Properties Plugin, 2.8.15
|
|
2
|
+
* Application Insights JavaScript SDK - Properties Plugin, 2.8.15
|
|
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 = '2.8.15';
|
|
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 = '2.8.15';\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.8.15
|
|
2
|
+
* Application Insights JavaScript SDK - Properties Plugin, 2.8.15
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
|
10
10
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
11
|
-
import { BreezeChannelIdentifier, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace } from "@microsoft/applicationinsights-common";
|
|
11
|
+
import { BreezeChannelIdentifier, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace, utlSetStoragePrefix } from "@microsoft/applicationinsights-common";
|
|
12
12
|
import { BaseTelemetryPlugin, _InternalLogMessage, _logInternalMessage, createProcessTelemetryContext, getNavigator, getSetValue, isNullOrUndefined, objForEachKey } from "@microsoft/applicationinsights-core-js";
|
|
13
13
|
import { TelemetryContext } from "./TelemetryContext";
|
|
14
14
|
import { _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_COOKIE_DOMAIN, _DYN_GET_NEW_ID, _DYN_GET_SESSION_ID, _DYN_GET_TRACE_CTX, _DYN_ID_LENGTH, _DYN_IS_NEW_USER, _DYN_IS_USER_COOKIE_SET, _DYN_NAME_PREFIX, _DYN_SDK_EXTENSION, _DYN_SESSION_COOKIE_POSTF6, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE, _DYN_UPDATE, _DYN_USER_COOKIE_POSTFIX } from "./__DynamicConstants";
|
|
@@ -85,6 +85,9 @@ var PropertiesPlugin = /** @class */ (function (_super) {
|
|
|
85
85
|
objForEachKey(defaultConfig, function (field, value) {
|
|
86
86
|
_extensionConfig[field] = function () { return ctx.getConfig(identifier, field, value()); };
|
|
87
87
|
});
|
|
88
|
+
if (config.storagePrefix) {
|
|
89
|
+
utlSetStoragePrefix(config.storagePrefix);
|
|
90
|
+
}
|
|
88
91
|
_previousTraceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);
|
|
89
92
|
_self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx);
|
|
90
93
|
_distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */], _previousTraceCtx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertiesPlugin.js.map","sources":["PropertiesPlugin.js"],"sourcesContent":["/**\r\n* PropertiesPlugin.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BreezeChannelIdentifier, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _InternalLogMessage, _logInternalMessage, createProcessTelemetryContext, getNavigator, getSetValue, isNullOrUndefined, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { TelemetryContext } from \"./TelemetryContext\";\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_COOKIE_DOMAIN, _DYN_GET_NEW_ID, _DYN_GET_SESSION_ID, _DYN_GET_TRACE_CTX, _DYN_ID_LENGTH, _DYN_IS_NEW_USER, _DYN_IS_USER_COOKIE_SET, _DYN_NAME_PREFIX, _DYN_SDK_EXTENSION, _DYN_SESSION_COOKIE_POSTF6, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE, _DYN_UPDATE, _DYN_USER_COOKIE_POSTFIX } from \"./__DynamicConstants\";\r\nvar PropertiesPlugin = /** @class */ (function (_super) {\r\n __extends(PropertiesPlugin, _super);\r\n function PropertiesPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 110;\r\n _this.identifier = PropertiesPluginIdentifier;\r\n var _extensionConfig;\r\n var _distributedTraceCtx;\r\n var _previousTraceCtx;\r\n dynamicProto(PropertiesPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _populateDefaults(config);\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event The event that needs to be processed\r\n */\r\n _self.processTelemetry = function (event, itemCtx) {\r\n if (isNullOrUndefined(event)) {\r\n // TODO(barustum): throw an internal event once we have support for internal logging\r\n }\r\n else {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page.\r\n if (event.name === PageView.envelopeType) {\r\n itemCtx.diagLog().resetInternalMessageCount();\r\n }\r\n var theContext = (_self.context || {});\r\n if (theContext.session) {\r\n // If customer did not provide custom session id update the session manager\r\n if (typeof _self.context.session.id !== \"string\" && theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */]) {\r\n theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */][_DYN_UPDATE /* @min:%2eupdate */]();\r\n }\r\n }\r\n var userCtx = theContext.user;\r\n if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */]) {\r\n userCtx[_DYN_UPDATE /* @min:%2eupdate */](theContext.user.id);\r\n }\r\n _processTelemetryInternal(event, itemCtx);\r\n if (userCtx && userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */]) {\r\n userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = false;\r\n var message = new _InternalLogMessage(72 /* _eInternalMessageId.SendBrowserInfoOnUserInit */, ((getNavigator() || {}).userAgent || \"\"));\r\n _logInternalMessage(itemCtx.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, message);\r\n }\r\n _self.processNext(event, itemCtx);\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n var core = (unloadCtx || {}).core();\r\n if (core && core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */]) {\r\n var traceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n if (traceCtx === _distributedTraceCtx) {\r\n core.setTraceCtx(_previousTraceCtx);\r\n }\r\n }\r\n _initDefaults();\r\n };\r\n function _initDefaults() {\r\n _extensionConfig = null;\r\n _distributedTraceCtx = null;\r\n _previousTraceCtx = null;\r\n }\r\n function _populateDefaults(config) {\r\n var identifier = _self.identifier;\r\n var core = _self.core;\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n var defaultConfig = PropertiesPlugin.getDefaultConfig();\r\n _extensionConfig = _extensionConfig || {};\r\n objForEachKey(defaultConfig, function (field, value) {\r\n _extensionConfig[field] = function () { return ctx.getConfig(identifier, field, value()); };\r\n });\r\n _previousTraceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n _self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx);\r\n _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */], _previousTraceCtx);\r\n core.setTraceCtx(_distributedTraceCtx);\r\n _self.context.appId = function () {\r\n var breezeChannel = core.getPlugin(BreezeChannelIdentifier);\r\n return breezeChannel ? breezeChannel.plugin[\"_appId\"] : null;\r\n };\r\n // Test hook to allow accessing the internal values -- explicitly not defined as an available property on the class\r\n _self[\"_extConfig\"] = _extensionConfig;\r\n }\r\n function _processTelemetryInternal(evt, itemCtx) {\r\n // Set Part A fields\r\n getSetValue(evt, \"tags\", []);\r\n getSetValue(evt, \"ext\", {});\r\n var ctx = _self.context;\r\n ctx[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_DEVICE_CONTEXT /* @min:%2eapplyDeviceContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_USER_CONTEXT /* @min:%2eapplyUserContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */](evt, itemCtx);\r\n ctx.applyWebContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */](evt, itemCtx); // legacy tags\r\n ctx[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */](evt, itemCtx); // legacy tags\r\n ctx.cleanUp(evt, itemCtx);\r\n }\r\n });\r\n return _this;\r\n }\r\n PropertiesPlugin.getDefaultConfig = function () {\r\n var _a;\r\n var defaultValue;\r\n var nullValue = null;\r\n var defaultConfig = (_a = {\r\n instrumentationKey: function () { return defaultValue; }\r\n },\r\n _a[_DYN_ACCOUNT_ID /* @min:accountId */] = function () { return nullValue; },\r\n _a.sessionRenewalMs = function () { return 30 * 60 * 1000; },\r\n _a.samplingPercentage = function () { return 100; },\r\n _a.sessionExpirationMs = function () { return 24 * 60 * 60 * 1000; },\r\n _a[_DYN_COOKIE_DOMAIN /* @min:cookieDomain */] = function () { return nullValue; },\r\n _a[_DYN_SDK_EXTENSION /* @min:sdkExtension */] = function () { return nullValue; },\r\n _a.isBrowserLinkTrackingEnabled = function () { return false; },\r\n _a.appId = function () { return nullValue; },\r\n _a[_DYN_GET_SESSION_ID /* @min:getSessionId */] = function () { return nullValue; },\r\n _a[_DYN_NAME_PREFIX /* @min:namePrefix */] = function () { return defaultValue; },\r\n _a[_DYN_SESSION_COOKIE_POSTF6 /* @min:sessionCookiePostfix */] = function () { return defaultValue; },\r\n _a[_DYN_USER_COOKIE_POSTFIX /* @min:userCookiePostfix */] = function () { return defaultValue; },\r\n _a[_DYN_ID_LENGTH /* @min:idLength */] = function () { return 22; },\r\n _a[_DYN_GET_NEW_ID /* @min:getNewId */] = function () { return nullValue; },\r\n _a);\r\n return defaultConfig;\r\n };\r\n PropertiesPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event The event that needs to be processed\r\n */\r\n PropertiesPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PropertiesPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default PropertiesPlugin;\r\n//# sourceMappingURL=PropertiesPlugin.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA,gFAAkC;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;gEASM;AACN;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"PropertiesPlugin.js.map","sources":["PropertiesPlugin.js"],"sourcesContent":["/**\r\n* PropertiesPlugin.ts\r\n* @copyright Microsoft 2018\r\n*/\r\nimport { __extends } from \"tslib\";\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { BreezeChannelIdentifier, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace, utlSetStoragePrefix } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _InternalLogMessage, _logInternalMessage, createProcessTelemetryContext, getNavigator, getSetValue, isNullOrUndefined, objForEachKey } from \"@microsoft/applicationinsights-core-js\";\r\nimport { TelemetryContext } from \"./TelemetryContext\";\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_COOKIE_DOMAIN, _DYN_GET_NEW_ID, _DYN_GET_SESSION_ID, _DYN_GET_TRACE_CTX, _DYN_ID_LENGTH, _DYN_IS_NEW_USER, _DYN_IS_USER_COOKIE_SET, _DYN_NAME_PREFIX, _DYN_SDK_EXTENSION, _DYN_SESSION_COOKIE_POSTF6, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE, _DYN_UPDATE, _DYN_USER_COOKIE_POSTFIX } from \"./__DynamicConstants\";\r\nvar PropertiesPlugin = /** @class */ (function (_super) {\r\n __extends(PropertiesPlugin, _super);\r\n function PropertiesPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.priority = 110;\r\n _this.identifier = PropertiesPluginIdentifier;\r\n var _extensionConfig;\r\n var _distributedTraceCtx;\r\n var _previousTraceCtx;\r\n dynamicProto(PropertiesPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (config, core, extensions, pluginChain) {\r\n _base.initialize(config, core, extensions, pluginChain);\r\n _populateDefaults(config);\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event The event that needs to be processed\r\n */\r\n _self.processTelemetry = function (event, itemCtx) {\r\n if (isNullOrUndefined(event)) {\r\n // TODO(barustum): throw an internal event once we have support for internal logging\r\n }\r\n else {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n // If the envelope is PageView, reset the internal message count so that we can send internal telemetry for the new page.\r\n if (event.name === PageView.envelopeType) {\r\n itemCtx.diagLog().resetInternalMessageCount();\r\n }\r\n var theContext = (_self.context || {});\r\n if (theContext.session) {\r\n // If customer did not provide custom session id update the session manager\r\n if (typeof _self.context.session.id !== \"string\" && theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */]) {\r\n theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */][_DYN_UPDATE /* @min:%2eupdate */]();\r\n }\r\n }\r\n var userCtx = theContext.user;\r\n if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */]) {\r\n userCtx[_DYN_UPDATE /* @min:%2eupdate */](theContext.user.id);\r\n }\r\n _processTelemetryInternal(event, itemCtx);\r\n if (userCtx && userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */]) {\r\n userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = false;\r\n var message = new _InternalLogMessage(72 /* _eInternalMessageId.SendBrowserInfoOnUserInit */, ((getNavigator() || {}).userAgent || \"\"));\r\n _logInternalMessage(itemCtx.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, message);\r\n }\r\n _self.processNext(event, itemCtx);\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n var core = (unloadCtx || {}).core();\r\n if (core && core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */]) {\r\n var traceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n if (traceCtx === _distributedTraceCtx) {\r\n core.setTraceCtx(_previousTraceCtx);\r\n }\r\n }\r\n _initDefaults();\r\n };\r\n function _initDefaults() {\r\n _extensionConfig = null;\r\n _distributedTraceCtx = null;\r\n _previousTraceCtx = null;\r\n }\r\n function _populateDefaults(config) {\r\n var identifier = _self.identifier;\r\n var core = _self.core;\r\n var ctx = createProcessTelemetryContext(null, config, core);\r\n var defaultConfig = PropertiesPlugin.getDefaultConfig();\r\n _extensionConfig = _extensionConfig || {};\r\n objForEachKey(defaultConfig, function (field, value) {\r\n _extensionConfig[field] = function () { return ctx.getConfig(identifier, field, value()); };\r\n });\r\n if (config.storagePrefix) {\r\n utlSetStoragePrefix(config.storagePrefix);\r\n }\r\n _previousTraceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);\r\n _self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx);\r\n _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */], _previousTraceCtx);\r\n core.setTraceCtx(_distributedTraceCtx);\r\n _self.context.appId = function () {\r\n var breezeChannel = core.getPlugin(BreezeChannelIdentifier);\r\n return breezeChannel ? breezeChannel.plugin[\"_appId\"] : null;\r\n };\r\n // Test hook to allow accessing the internal values -- explicitly not defined as an available property on the class\r\n _self[\"_extConfig\"] = _extensionConfig;\r\n }\r\n function _processTelemetryInternal(evt, itemCtx) {\r\n // Set Part A fields\r\n getSetValue(evt, \"tags\", []);\r\n getSetValue(evt, \"ext\", {});\r\n var ctx = _self.context;\r\n ctx[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_DEVICE_CONTEXT /* @min:%2eapplyDeviceContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_USER_CONTEXT /* @min:%2eapplyUserContext */](evt, itemCtx);\r\n ctx[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */](evt, itemCtx);\r\n ctx.applyWebContext(evt, itemCtx);\r\n ctx[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */](evt, itemCtx); // legacy tags\r\n ctx[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */](evt, itemCtx); // legacy tags\r\n ctx.cleanUp(evt, itemCtx);\r\n }\r\n });\r\n return _this;\r\n }\r\n PropertiesPlugin.getDefaultConfig = function () {\r\n var _a;\r\n var defaultValue;\r\n var nullValue = null;\r\n var defaultConfig = (_a = {\r\n instrumentationKey: function () { return defaultValue; }\r\n },\r\n _a[_DYN_ACCOUNT_ID /* @min:accountId */] = function () { return nullValue; },\r\n _a.sessionRenewalMs = function () { return 30 * 60 * 1000; },\r\n _a.samplingPercentage = function () { return 100; },\r\n _a.sessionExpirationMs = function () { return 24 * 60 * 60 * 1000; },\r\n _a[_DYN_COOKIE_DOMAIN /* @min:cookieDomain */] = function () { return nullValue; },\r\n _a[_DYN_SDK_EXTENSION /* @min:sdkExtension */] = function () { return nullValue; },\r\n _a.isBrowserLinkTrackingEnabled = function () { return false; },\r\n _a.appId = function () { return nullValue; },\r\n _a[_DYN_GET_SESSION_ID /* @min:getSessionId */] = function () { return nullValue; },\r\n _a[_DYN_NAME_PREFIX /* @min:namePrefix */] = function () { return defaultValue; },\r\n _a[_DYN_SESSION_COOKIE_POSTF6 /* @min:sessionCookiePostfix */] = function () { return defaultValue; },\r\n _a[_DYN_USER_COOKIE_POSTFIX /* @min:userCookiePostfix */] = function () { return defaultValue; },\r\n _a[_DYN_ID_LENGTH /* @min:idLength */] = function () { return 22; },\r\n _a[_DYN_GET_NEW_ID /* @min:getNewId */] = function () { return nullValue; },\r\n _a);\r\n return defaultConfig;\r\n };\r\n PropertiesPlugin.prototype.initialize = function (config, core, extensions, pluginChain) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Add Part A fields to the event\r\n * @param event The event that needs to be processed\r\n */\r\n PropertiesPlugin.prototype.processTelemetry = function (event, itemCtx) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n return PropertiesPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport default PropertiesPlugin;\r\n//# sourceMappingURL=PropertiesPlugin.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA,gFAAkC;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;gEASM;AACN;AACA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,65 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@microsoft/applicationinsights-properties-js",
|
|
3
|
-
"version": "2.8.15
|
|
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
|
-
"npm-pack": "npm pack"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@microsoft/ai-test-framework": "0.0.1",
|
|
31
|
-
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
|
32
|
-
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
|
33
|
-
"@microsoft/api-extractor": "^7.18.1",
|
|
34
|
-
"typescript": "^4.9.3",
|
|
35
|
-
"tslib": "^2.0.0",
|
|
36
|
-
"grunt": "^1.5.3",
|
|
37
|
-
"grunt-cli": "^1.4.3",
|
|
38
|
-
"grunt-contrib-qunit": "^6.2.1",
|
|
39
|
-
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
40
|
-
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
41
|
-
"globby": "^11.0.0",
|
|
42
|
-
"magic-string": "^0.25.7",
|
|
43
|
-
"pako": "^2.0.3",
|
|
44
|
-
"@rollup/plugin-commonjs": "^18.0.0",
|
|
45
|
-
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
46
|
-
"@rollup/plugin-replace": "^2.3.3",
|
|
47
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
48
|
-
"rollup": "^2.32.0",
|
|
49
|
-
"qunit": "^2.11.2",
|
|
50
|
-
"sinon": "^7.3.1"
|
|
51
|
-
},
|
|
52
|
-
"peerDependencies": {
|
|
53
|
-
"tslib": "*"
|
|
54
|
-
},
|
|
55
|
-
"dependencies": {
|
|
56
|
-
"@microsoft/dynamicproto-js": "^1.1.9",
|
|
57
|
-
"@microsoft/applicationinsights-shims": "2.0.2",
|
|
58
|
-
"@microsoft/applicationinsights-core-js": "2.8.15
|
|
59
|
-
"@microsoft/applicationinsights-common": "2.8.15
|
|
60
|
-
},
|
|
61
|
-
"license": "MIT"
|
|
62
|
-
|
|
63
|
-
"tag": "nightly"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/applicationinsights-properties-js",
|
|
3
|
+
"version": "2.8.15",
|
|
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
|
+
"npm-pack": "npm pack"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@microsoft/ai-test-framework": "0.0.1",
|
|
31
|
+
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0",
|
|
32
|
+
"@microsoft/applicationinsights-rollup-es3": "1.1.3",
|
|
33
|
+
"@microsoft/api-extractor": "^7.18.1",
|
|
34
|
+
"typescript": "^4.9.3",
|
|
35
|
+
"tslib": "^2.0.0",
|
|
36
|
+
"grunt": "^1.5.3",
|
|
37
|
+
"grunt-cli": "^1.4.3",
|
|
38
|
+
"grunt-contrib-qunit": "^6.2.1",
|
|
39
|
+
"@nevware21/grunt-ts-plugin": "^0.4.3",
|
|
40
|
+
"@nevware21/grunt-eslint-ts": "^0.2.2",
|
|
41
|
+
"globby": "^11.0.0",
|
|
42
|
+
"magic-string": "^0.25.7",
|
|
43
|
+
"pako": "^2.0.3",
|
|
44
|
+
"@rollup/plugin-commonjs": "^18.0.0",
|
|
45
|
+
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
46
|
+
"@rollup/plugin-replace": "^2.3.3",
|
|
47
|
+
"rollup-plugin-cleanup": "^3.2.1",
|
|
48
|
+
"rollup": "^2.32.0",
|
|
49
|
+
"qunit": "^2.11.2",
|
|
50
|
+
"sinon": "^7.3.1"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"tslib": "*"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@microsoft/dynamicproto-js": "^1.1.9",
|
|
57
|
+
"@microsoft/applicationinsights-shims": "2.0.2",
|
|
58
|
+
"@microsoft/applicationinsights-core-js": "2.8.15",
|
|
59
|
+
"@microsoft/applicationinsights-common": "2.8.15"
|
|
60
|
+
},
|
|
61
|
+
"license": "MIT"
|
|
62
|
+
}
|
package/src/PropertiesPlugin.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
7
7
|
import {
|
|
8
|
-
BreezeChannelIdentifier, IConfig, IPropertiesPlugin, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace
|
|
8
|
+
BreezeChannelIdentifier, IConfig, IPropertiesPlugin, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace,
|
|
9
|
+
utlSetStoragePrefix
|
|
9
10
|
} from "@microsoft/applicationinsights-common";
|
|
10
11
|
import {
|
|
11
12
|
BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, IDistributedTraceContext, IPlugin, IProcessTelemetryContext,
|
|
@@ -133,6 +134,10 @@ export default class PropertiesPlugin extends BaseTelemetryPlugin implements IPr
|
|
|
133
134
|
_extensionConfig[field] = () => ctx.getConfig(identifier, field, value());
|
|
134
135
|
});
|
|
135
136
|
|
|
137
|
+
if (config.storagePrefix){
|
|
138
|
+
utlSetStoragePrefix(config.storagePrefix);
|
|
139
|
+
}
|
|
140
|
+
|
|
136
141
|
_previousTraceCtx = core.getTraceCtx(false);
|
|
137
142
|
_self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx);
|
|
138
143
|
_distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context.telemetryTrace, _previousTraceCtx);
|