@microsoft/applicationinsights-properties-js 2.8.5-nightly.2206-04 → 2.8.5-nightly.2207-02

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 (44) hide show
  1. package/browser/applicationinsights-properties-js.integrity.json +9 -9
  2. package/browser/applicationinsights-properties-js.js +676 -526
  3. package/browser/applicationinsights-properties-js.js.map +1 -1
  4. package/browser/applicationinsights-properties-js.min.js +2 -2
  5. package/browser/applicationinsights-properties-js.min.js.map +1 -1
  6. package/dist/applicationinsights-properties-js.api.json +11 -2
  7. package/dist/applicationinsights-properties-js.d.ts +1 -1
  8. package/dist/applicationinsights-properties-js.js +676 -526
  9. package/dist/applicationinsights-properties-js.js.map +1 -1
  10. package/dist/applicationinsights-properties-js.min.js +2 -2
  11. package/dist/applicationinsights-properties-js.min.js.map +1 -1
  12. package/dist/applicationinsights-properties-js.rollup.d.ts +1 -1
  13. package/dist-esm/Context/Application.js +1 -1
  14. package/dist-esm/Context/Device.js +1 -1
  15. package/dist-esm/Context/Internal.js +4 -3
  16. package/dist-esm/Context/Internal.js.map +1 -1
  17. package/dist-esm/Context/Location.js +1 -1
  18. package/dist-esm/Context/Session.js +36 -35
  19. package/dist-esm/Context/Session.js.map +1 -1
  20. package/dist-esm/Context/TelemetryTrace.js +1 -1
  21. package/dist-esm/Context/User.js +32 -31
  22. package/dist-esm/Context/User.js.map +1 -1
  23. package/dist-esm/Interfaces/IPropTelemetryContext.js +1 -1
  24. package/dist-esm/Interfaces/ITelemetryConfig.js +1 -1
  25. package/dist-esm/PropertiesPlugin.js +65 -56
  26. package/dist-esm/PropertiesPlugin.js.map +1 -1
  27. package/dist-esm/TelemetryContext.js +27 -26
  28. package/dist-esm/TelemetryContext.js.map +1 -1
  29. package/dist-esm/__DynamicConstants.js +48 -0
  30. package/dist-esm/__DynamicConstants.js.map +1 -0
  31. package/dist-esm/applicationinsights-properties-js.js +1 -1
  32. package/package.json +7 -4
  33. package/src/Context/Internal.ts +8 -8
  34. package/src/Context/Session.ts +11 -11
  35. package/src/Context/TelemetryTrace.ts +3 -3
  36. package/src/Context/User.ts +11 -10
  37. package/src/PropertiesPlugin.ts +57 -46
  38. package/src/TelemetryContext.ts +25 -19
  39. package/src/__DynamicConstants.ts +46 -0
  40. package/types/Context/User.d.ts +1 -1
  41. package/types/PropertiesPlugin.d.ts +5 -5
  42. package/types/TelemetryContext.d.ts +6 -6
  43. package/types/__DynamicConstants.d.ts +34 -0
  44. package/types/tsdoc-metadata.json +1 -1
@@ -1,16 +1,17 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Properties Plugin, 2.8.5-nightly.2206-04
2
+ * Application Insights JavaScript SDK - Properties Plugin, 2.8.5-nightly.2207-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  /**
6
- * PropertiesPlugin.ts
7
- * @copyright Microsoft 2018
8
- */
6
+ * PropertiesPlugin.ts
7
+ * @copyright Microsoft 2018
8
+ */
9
9
  import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
10
10
  import dynamicProto from "@microsoft/dynamicproto-js";
11
- import { BaseTelemetryPlugin, isNullOrUndefined, _InternalLogMessage, getNavigator, objForEachKey, getSetValue, _logInternalMessage } from "@microsoft/applicationinsights-core-js";
11
+ import { BreezeChannelIdentifier, PageView, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace } from "@microsoft/applicationinsights-common";
12
+ import { BaseTelemetryPlugin, _InternalLogMessage, _logInternalMessage, createProcessTelemetryContext, getNavigator, getSetValue, isNullOrUndefined, objForEachKey } from "@microsoft/applicationinsights-core-js";
12
13
  import { TelemetryContext } from "./TelemetryContext";
13
- import { PageView, BreezeChannelIdentifier, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace } from "@microsoft/applicationinsights-common";
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";
14
15
  var PropertiesPlugin = /** @class */ (function (_super) {
15
16
  __extends(PropertiesPlugin, _super);
16
17
  function PropertiesPlugin() {
@@ -24,23 +25,7 @@ var PropertiesPlugin = /** @class */ (function (_super) {
24
25
  _initDefaults();
25
26
  _self.initialize = function (config, core, extensions, pluginChain) {
26
27
  _base.initialize(config, core, extensions, pluginChain);
27
- var ctx = _self._getTelCtx();
28
- var identifier = _self.identifier;
29
- var defaultConfig = PropertiesPlugin.getDefaultConfig();
30
- _extensionConfig = _extensionConfig || {};
31
- objForEachKey(defaultConfig, function (field, value) {
32
- _extensionConfig[field] = function () { return ctx.getConfig(identifier, field, value()); };
33
- });
34
- _previousTraceCtx = core.getTraceCtx(false);
35
- _self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx);
36
- _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context.telemetryTrace, _previousTraceCtx);
37
- core.setTraceCtx(_distributedTraceCtx);
38
- _self.context.appId = function () {
39
- var breezeChannel = core.getPlugin(BreezeChannelIdentifier);
40
- return breezeChannel ? breezeChannel.plugin["_appId"] : null;
41
- };
42
- // Test hook to allow accessing the internal values -- explicitly not defined as an available property on the class
43
- _self["_extConfig"] = _extensionConfig;
28
+ _populateDefaults(config);
44
29
  };
45
30
  /**
46
31
  * Add Part A fields to the event
@@ -59,17 +44,17 @@ var PropertiesPlugin = /** @class */ (function (_super) {
59
44
  var theContext = (_self.context || {});
60
45
  if (theContext.session) {
61
46
  // If customer did not provide custom session id update the session manager
62
- if (typeof _self.context.session.id !== "string" && theContext.sessionManager) {
63
- theContext.sessionManager.update();
47
+ if (typeof _self.context.session.id !== "string" && theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */]) {
48
+ theContext[_DYN_SESSION_MANAGER /* @min:%2esessionManager */][_DYN_UPDATE /* @min:%2eupdate */]();
64
49
  }
65
50
  }
66
51
  var userCtx = theContext.user;
67
- if (userCtx && !userCtx.isUserCookieSet) {
68
- userCtx.update(theContext.user.id);
52
+ if (userCtx && !userCtx[_DYN_IS_USER_COOKIE_SET /* @min:%2eisUserCookieSet */]) {
53
+ userCtx[_DYN_UPDATE /* @min:%2eupdate */](theContext.user.id);
69
54
  }
70
55
  _processTelemetryInternal(event, itemCtx);
71
- if (userCtx && userCtx.isNewUser) {
72
- userCtx.isNewUser = false;
56
+ if (userCtx && userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */]) {
57
+ userCtx[_DYN_IS_NEW_USER /* @min:%2eisNewUser */] = false;
73
58
  var message = new _InternalLogMessage(72 /* _eInternalMessageId.SendBrowserInfoOnUserInit */, ((getNavigator() || {}).userAgent || ""));
74
59
  _logInternalMessage(itemCtx.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, message);
75
60
  }
@@ -78,8 +63,8 @@ var PropertiesPlugin = /** @class */ (function (_super) {
78
63
  };
79
64
  _self._doTeardown = function (unloadCtx, unloadState) {
80
65
  var core = (unloadCtx || {}).core();
81
- if (core && core.getTraceCtx) {
82
- var traceCtx = core.getTraceCtx(false);
66
+ if (core && core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */]) {
67
+ var traceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);
83
68
  if (traceCtx === _distributedTraceCtx) {
84
69
  core.setTraceCtx(_previousTraceCtx);
85
70
  }
@@ -91,43 +76,67 @@ var PropertiesPlugin = /** @class */ (function (_super) {
91
76
  _distributedTraceCtx = null;
92
77
  _previousTraceCtx = null;
93
78
  }
79
+ function _populateDefaults(config) {
80
+ var identifier = _self.identifier;
81
+ var core = _self.core;
82
+ var ctx = createProcessTelemetryContext(null, config, core);
83
+ var defaultConfig = PropertiesPlugin.getDefaultConfig();
84
+ _extensionConfig = _extensionConfig || {};
85
+ objForEachKey(defaultConfig, function (field, value) {
86
+ _extensionConfig[field] = function () { return ctx.getConfig(identifier, field, value()); };
87
+ });
88
+ _previousTraceCtx = core[_DYN_GET_TRACE_CTX /* @min:%2egetTraceCtx */](false);
89
+ _self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx);
90
+ _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */], _previousTraceCtx);
91
+ core.setTraceCtx(_distributedTraceCtx);
92
+ _self.context.appId = function () {
93
+ var breezeChannel = core.getPlugin(BreezeChannelIdentifier);
94
+ return breezeChannel ? breezeChannel.plugin["_appId"] : null;
95
+ };
96
+ // Test hook to allow accessing the internal values -- explicitly not defined as an available property on the class
97
+ _self["_extConfig"] = _extensionConfig;
98
+ }
94
99
  function _processTelemetryInternal(evt, itemCtx) {
95
100
  // Set Part A fields
96
101
  getSetValue(evt, "tags", []);
97
102
  getSetValue(evt, "ext", {});
98
103
  var ctx = _self.context;
99
- ctx.applySessionContext(evt, itemCtx);
100
- ctx.applyApplicationContext(evt, itemCtx);
101
- ctx.applyDeviceContext(evt, itemCtx);
102
- ctx.applyOperationContext(evt, itemCtx);
103
- ctx.applyUserContext(evt, itemCtx);
104
- ctx.applyOperatingSystemContxt(evt, itemCtx);
104
+ ctx[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */](evt, itemCtx);
105
+ ctx[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */](evt, itemCtx);
106
+ ctx[_DYN_APPLY_DEVICE_CONTEXT /* @min:%2eapplyDeviceContext */](evt, itemCtx);
107
+ ctx[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */](evt, itemCtx);
108
+ ctx[_DYN_APPLY_USER_CONTEXT /* @min:%2eapplyUserContext */](evt, itemCtx);
109
+ ctx[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */](evt, itemCtx);
105
110
  ctx.applyWebContext(evt, itemCtx);
106
- ctx.applyLocationContext(evt, itemCtx); // legacy tags
107
- ctx.applyInternalContext(evt, itemCtx); // legacy tags
111
+ ctx[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */](evt, itemCtx); // legacy tags
112
+ ctx[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */](evt, itemCtx); // legacy tags
108
113
  ctx.cleanUp(evt, itemCtx);
109
114
  }
110
115
  });
111
116
  return _this;
112
117
  }
113
118
  PropertiesPlugin.getDefaultConfig = function () {
114
- var defaultConfig = {
115
- instrumentationKey: function () { return undefined; },
116
- accountId: function () { return null; },
117
- sessionRenewalMs: function () { return 30 * 60 * 1000; },
118
- samplingPercentage: function () { return 100; },
119
- sessionExpirationMs: function () { return 24 * 60 * 60 * 1000; },
120
- cookieDomain: function () { return null; },
121
- sdkExtension: function () { return null; },
122
- isBrowserLinkTrackingEnabled: function () { return false; },
123
- appId: function () { return null; },
124
- getSessionId: function () { return null; },
125
- namePrefix: function () { return undefined; },
126
- sessionCookiePostfix: function () { return undefined; },
127
- userCookiePostfix: function () { return undefined; },
128
- idLength: function () { return 22; },
129
- getNewId: function () { return null; }
130
- };
119
+ var _a;
120
+ var defaultValue;
121
+ var nullValue = null;
122
+ var defaultConfig = (_a = {
123
+ instrumentationKey: function () { return defaultValue; }
124
+ },
125
+ _a[_DYN_ACCOUNT_ID /* @min:accountId */] = function () { return nullValue; },
126
+ _a.sessionRenewalMs = function () { return 30 * 60 * 1000; },
127
+ _a.samplingPercentage = function () { return 100; },
128
+ _a.sessionExpirationMs = function () { return 24 * 60 * 60 * 1000; },
129
+ _a[_DYN_COOKIE_DOMAIN /* @min:cookieDomain */] = function () { return nullValue; },
130
+ _a[_DYN_SDK_EXTENSION /* @min:sdkExtension */] = function () { return nullValue; },
131
+ _a.isBrowserLinkTrackingEnabled = function () { return false; },
132
+ _a.appId = function () { return nullValue; },
133
+ _a[_DYN_GET_SESSION_ID /* @min:getSessionId */] = function () { return nullValue; },
134
+ _a[_DYN_NAME_PREFIX /* @min:namePrefix */] = function () { return defaultValue; },
135
+ _a[_DYN_SESSION_COOKIE_POSTF6 /* @min:sessionCookiePostfix */] = function () { return defaultValue; },
136
+ _a[_DYN_USER_COOKIE_POSTFIX /* @min:userCookiePostfix */] = function () { return defaultValue; },
137
+ _a[_DYN_ID_LENGTH /* @min:idLength */] = function () { return 22; },
138
+ _a[_DYN_GET_NEW_ID /* @min:getNewId */] = function () { return nullValue; },
139
+ _a);
131
140
  return defaultConfig;
132
141
  };
133
142
  // Removed Stub for PropertiesPlugin.prototype.initialize.
@@ -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 { BaseTelemetryPlugin, isNullOrUndefined, _InternalLogMessage, getNavigator, objForEachKey, getSetValue, _logInternalMessage } from \"@microsoft/applicationinsights-core-js\";\r\nimport { TelemetryContext } from \"./TelemetryContext\";\r\nimport { PageView, BreezeChannelIdentifier, PropertiesPluginIdentifier, createDistributedTraceContextFromTrace } from \"@microsoft/applicationinsights-common\";\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 var ctx = _self._getTelCtx();\r\n var identifier = _self.identifier;\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.getTraceCtx(false);\r\n _self.context = new TelemetryContext(core, _extensionConfig, _previousTraceCtx);\r\n _distributedTraceCtx = createDistributedTraceContextFromTrace(_self.context.telemetryTrace, _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 /**\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.sessionManager) {\r\n theContext.sessionManager.update();\r\n }\r\n }\r\n var userCtx = theContext.user;\r\n if (userCtx && !userCtx.isUserCookieSet) {\r\n userCtx.update(theContext.user.id);\r\n }\r\n _processTelemetryInternal(event, itemCtx);\r\n if (userCtx && userCtx.isNewUser) {\r\n userCtx.isNewUser = 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.getTraceCtx) {\r\n var traceCtx = core.getTraceCtx(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 _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.applySessionContext(evt, itemCtx);\r\n ctx.applyApplicationContext(evt, itemCtx);\r\n ctx.applyDeviceContext(evt, itemCtx);\r\n ctx.applyOperationContext(evt, itemCtx);\r\n ctx.applyUserContext(evt, itemCtx);\r\n ctx.applyOperatingSystemContxt(evt, itemCtx);\r\n ctx.applyWebContext(evt, itemCtx);\r\n ctx.applyLocationContext(evt, itemCtx); // legacy tags\r\n ctx.applyInternalContext(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 defaultConfig = {\r\n instrumentationKey: function () { return undefined; },\r\n accountId: function () { return null; },\r\n sessionRenewalMs: function () { return 30 * 60 * 1000; },\r\n samplingPercentage: function () { return 100; },\r\n sessionExpirationMs: function () { return 24 * 60 * 60 * 1000; },\r\n cookieDomain: function () { return null; },\r\n sdkExtension: function () { return null; },\r\n isBrowserLinkTrackingEnabled: function () { return false; },\r\n appId: function () { return null; },\r\n getSessionId: function () { return null; },\r\n namePrefix: function () { return undefined; },\r\n sessionCookiePostfix: function () { return undefined; },\r\n userCookiePostfix: function () { return undefined; },\r\n idLength: function () { return 22; },\r\n getNewId: function () { return null; }\r\n };\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;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 } 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,25 +1,26 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Properties Plugin, 2.8.5-nightly.2206-04
2
+ * Application Insights JavaScript SDK - Properties Plugin, 2.8.5-nightly.2207-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  /**
6
- * TelemetryContext.ts
7
- * @copyright Microsoft 2018
8
- */
6
+ * TelemetryContext.ts
7
+ * @copyright Microsoft 2018
8
+ */
9
9
  import dynamicProto from "@microsoft/dynamicproto-js";
10
- import { isString, objKeys, hasWindow, _InternalLogMessage, setValue, getSetValue } from "@microsoft/applicationinsights-core-js";
11
- import { Session, _SessionManager } from "./Context/Session";
12
- import { Extensions, CtxTagKeys, PageView } from "@microsoft/applicationinsights-common";
10
+ import { CtxTagKeys, Extensions, PageView } from "@microsoft/applicationinsights-common";
11
+ import { _InternalLogMessage, getSetValue, hasWindow, isString, objKeys, setValue } from "@microsoft/applicationinsights-core-js";
13
12
  import { Application } from "./Context/Application";
14
13
  import { Device } from "./Context/Device";
15
14
  import { Internal } from "./Context/Internal";
16
- import { User } from "./Context/User";
17
15
  import { Location } from "./Context/Location";
16
+ import { Session, _SessionManager } from "./Context/Session";
18
17
  import { TelemetryTrace } from "./Context/TelemetryTrace";
18
+ import { User } from "./Context/User";
19
+ 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_AUTHENTICATED_ID, _DYN_AUTOMATIC_SESSION, _DYN_GET_SESSION_ID, _DYN_LENGTH, _DYN_SESSION_MANAGER, _DYN_TELEMETRY_TRACE } from "./__DynamicConstants";
19
20
  var strExt = "ext";
20
21
  var strTags = "tags";
21
22
  function _removeEmpty(target, name) {
22
- if (target && target[name] && objKeys(target[name]).length === 0) {
23
+ if (target && target[name] && objKeys(target[name])[_DYN_LENGTH /* @min:%2elength */] === 0) {
23
24
  delete target[name];
24
25
  }
25
26
  }
@@ -28,12 +29,12 @@ var TelemetryContext = /** @class */ (function () {
28
29
  var _this = this;
29
30
  var logger = core.logger;
30
31
  this.appId = function () { return null; };
31
- this.getSessionId = function () { return null; };
32
+ this[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () { return null; };
32
33
  dynamicProto(TelemetryContext, this, function (_self) {
33
34
  _self.application = new Application();
34
35
  _self.internal = new Internal(defaultConfig);
35
36
  if (hasWindow()) {
36
- _self.sessionManager = new _SessionManager(defaultConfig, core);
37
+ _self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] = new _SessionManager(defaultConfig, core);
37
38
  _self.device = new Device();
38
39
  _self.location = new Location();
39
40
  _self.user = new User(defaultConfig, core);
@@ -45,10 +46,10 @@ var TelemetryContext = /** @class */ (function () {
45
46
  parentId = previousTraceCtx.getSpanId();
46
47
  name_1 = previousTraceCtx.getName();
47
48
  }
48
- _self.telemetryTrace = new TelemetryTrace(traceId, parentId, name_1, logger);
49
+ _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */] = new TelemetryTrace(traceId, parentId, name_1, logger);
49
50
  _self.session = new Session();
50
51
  }
51
- _self.getSessionId = function () {
52
+ _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */] = function () {
52
53
  var session = _self.session;
53
54
  var sesId = null;
54
55
  // If customer set session info, apply their context; otherwise apply context automatically generated
@@ -57,18 +58,18 @@ var TelemetryContext = /** @class */ (function () {
57
58
  }
58
59
  else {
59
60
  // Gets the automatic session if it exists or an empty object
60
- var autoSession = (_self.sessionManager || {}).automaticSession;
61
+ var autoSession = (_self[_DYN_SESSION_MANAGER /* @min:%2esessionManager */] || {})[_DYN_AUTOMATIC_SESSION /* @min:%2eautomaticSession */];
61
62
  sesId = autoSession && isString(autoSession.id) ? autoSession.id : null;
62
63
  }
63
64
  return sesId;
64
65
  };
65
- _self.applySessionContext = function (evt, itemCtx) {
66
- setValue(getSetValue(evt.ext, Extensions.AppExt), "sesId", _self.getSessionId(), isString);
66
+ _self[_DYN_APPLY_SESSION_CONTEX0 /* @min:%2eapplySessionContext */] = function (evt, itemCtx) {
67
+ setValue(getSetValue(evt.ext, Extensions.AppExt), "sesId", _self[_DYN_GET_SESSION_ID /* @min:%2egetSessionId */](), isString);
67
68
  };
68
- _self.applyOperatingSystemContxt = function (evt, itemCtx) {
69
+ _self[_DYN_APPLY_OPERATING_SYST3 /* @min:%2eapplyOperatingSystemContxt */] = function (evt, itemCtx) {
69
70
  setValue(evt.ext, Extensions.OSExt, _self.os);
70
71
  };
71
- _self.applyApplicationContext = function (evt, itemCtx) {
72
+ _self[_DYN_APPLY_APPLICATION_CO1 /* @min:%2eapplyApplicationContext */] = function (evt, itemCtx) {
72
73
  var application = _self.application;
73
74
  if (application) {
74
75
  // evt.ext.app
@@ -77,7 +78,7 @@ var TelemetryContext = /** @class */ (function () {
77
78
  setValue(tags, CtxTagKeys.applicationBuild, application.build, isString);
78
79
  }
79
80
  };
80
- _self.applyDeviceContext = function (evt, itemCtx) {
81
+ _self[_DYN_APPLY_DEVICE_CONTEXT /* @min:%2eapplyDeviceContext */] = function (evt, itemCtx) {
81
82
  var device = _self.device;
82
83
  if (device) {
83
84
  // evt.ext.device
@@ -88,7 +89,7 @@ var TelemetryContext = /** @class */ (function () {
88
89
  setValue(extDevice, "deviceClass", device.deviceClass, isString);
89
90
  }
90
91
  };
91
- _self.applyInternalContext = function (evt, itemCtx) {
92
+ _self[_DYN_APPLY_INTERNAL_CONTE5 /* @min:%2eapplyInternalContext */] = function (evt, itemCtx) {
92
93
  var internal = _self.internal;
93
94
  if (internal) {
94
95
  var tags = getSetValue(evt, strTags);
@@ -100,14 +101,14 @@ var TelemetryContext = /** @class */ (function () {
100
101
  }
101
102
  }
102
103
  };
103
- _self.applyLocationContext = function (evt, itemCtx) {
104
+ _self[_DYN_APPLY_LOCATION_CONTE4 /* @min:%2eapplyLocationContext */] = function (evt, itemCtx) {
104
105
  var location = _this.location;
105
106
  if (location) {
106
107
  setValue(getSetValue(evt, strTags, []), CtxTagKeys.locationIp, location.ip, isString);
107
108
  }
108
109
  };
109
- _self.applyOperationContext = function (evt, itemCtx) {
110
- var telemetryTrace = _self.telemetryTrace;
110
+ _self[_DYN_APPLY_OPERATION_CONT2 /* @min:%2eapplyOperationContext */] = function (evt, itemCtx) {
111
+ var telemetryTrace = _self[_DYN_TELEMETRY_TRACE /* @min:%2etelemetryTrace */];
111
112
  if (telemetryTrace) {
112
113
  var extTrace = getSetValue(getSetValue(evt, strExt), Extensions.TraceExt, { traceID: undefined, parentID: undefined });
113
114
  setValue(extTrace, "traceID", telemetryTrace.traceID, isString);
@@ -121,16 +122,16 @@ var TelemetryContext = /** @class */ (function () {
121
122
  setValue(getSetValue(evt, strExt), Extensions.WebExt, web);
122
123
  }
123
124
  };
124
- _self.applyUserContext = function (evt, itemCtx) {
125
+ _self[_DYN_APPLY_USER_CONTEXT /* @min:%2eapplyUserContext */] = function (evt, itemCtx) {
125
126
  var user = _self.user;
126
127
  if (user) {
127
128
  var tags = getSetValue(evt, strTags, []);
128
129
  // stays in tags
129
- setValue(tags, CtxTagKeys.userAccountId, user.accountId, isString);
130
+ setValue(tags, CtxTagKeys.userAccountId, user[_DYN_ACCOUNT_ID /* @min:%2eaccountId */], isString);
130
131
  // CS 4.0
131
132
  var extUser = getSetValue(getSetValue(evt, strExt), Extensions.UserExt);
132
133
  setValue(extUser, "id", user.id, isString);
133
- setValue(extUser, "authId", user.authenticatedId, isString);
134
+ setValue(extUser, "authId", user[_DYN_AUTHENTICATED_ID /* @min:%2eauthenticatedId */], isString);
134
135
  }
135
136
  };
136
137
  _self.cleanUp = 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 { isString, objKeys, hasWindow, _InternalLogMessage, setValue, getSetValue } from \"@microsoft/applicationinsights-core-js\";\r\nimport { Session, _SessionManager } from \"./Context/Session\";\r\nimport { Extensions, CtxTagKeys, PageView } from \"@microsoft/applicationinsights-common\";\r\nimport { Application } from \"./Context/Application\";\r\nimport { Device } from \"./Context/Device\";\r\nimport { Internal } from \"./Context/Internal\";\r\nimport { User } from \"./Context/User\";\r\nimport { Location } from \"./Context/Location\";\r\nimport { TelemetryTrace } from \"./Context/TelemetryTrace\";\r\nvar strExt = \"ext\";\r\nvar strTags = \"tags\";\r\nfunction _removeEmpty(target, name) {\r\n if (target && target[name] && objKeys(target[name]).length === 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.getSessionId = 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.sessionManager = 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.telemetryTrace = new TelemetryTrace(traceId, parentId, name_1, logger);\r\n _self.session = new Session();\r\n }\r\n _self.getSessionId = 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.sessionManager || {}).automaticSession;\r\n sesId = autoSession && isString(autoSession.id) ? autoSession.id : null;\r\n }\r\n return sesId;\r\n };\r\n _self.applySessionContext = function (evt, itemCtx) {\r\n setValue(getSetValue(evt.ext, Extensions.AppExt), \"sesId\", _self.getSessionId(), isString);\r\n };\r\n _self.applyOperatingSystemContxt = function (evt, itemCtx) {\r\n setValue(evt.ext, Extensions.OSExt, _self.os);\r\n };\r\n _self.applyApplicationContext = 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.applyDeviceContext = 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.applyInternalContext = 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.applyLocationContext = 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.applyOperationContext = function (evt, itemCtx) {\r\n var telemetryTrace = _self.telemetryTrace;\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.applyUserContext = 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.accountId, 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.authenticatedId, 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;;;;;;;;;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"}
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Application Insights JavaScript SDK - Properties Plugin, 2.8.5-nightly.2207-02
3
+ * Copyright (c) Microsoft and contributors. All rights reserved.
4
+ */
5
+
6
+
7
+ // @skip-file-minify
8
+ // ##############################################################
9
+ // AUTO GENERATED FILE: This file is Auto Generated during build.
10
+ // ##############################################################
11
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
+ // 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!!!
13
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14
+ export var _DYN_SESSION_MANAGER = "sessionManager"; // Count: 3
15
+ export var _DYN_UPDATE = "update"; // Count: 4
16
+ export var _DYN_IS_USER_COOKIE_SET = "isUserCookieSet"; // Count: 4
17
+ export var _DYN_IS_NEW_USER = "isNewUser"; // Count: 4
18
+ export var _DYN_GET_TRACE_CTX = "getTraceCtx"; // Count: 3
19
+ export var _DYN_TELEMETRY_TRACE = "telemetryTrace"; // Count: 3
20
+ export var _DYN_APPLY_SESSION_CONTEX0 = "applySessionContext"; // Count: 2
21
+ export var _DYN_APPLY_APPLICATION_CO1 = "applyApplicationContext"; // Count: 2
22
+ export var _DYN_APPLY_DEVICE_CONTEXT = "applyDeviceContext"; // Count: 2
23
+ export var _DYN_APPLY_OPERATION_CONT2 = "applyOperationContext"; // Count: 2
24
+ export var _DYN_APPLY_USER_CONTEXT = "applyUserContext"; // Count: 2
25
+ export var _DYN_APPLY_OPERATING_SYST3 = "applyOperatingSystemContxt"; // Count: 2
26
+ export var _DYN_APPLY_LOCATION_CONTE4 = "applyLocationContext"; // Count: 2
27
+ export var _DYN_APPLY_INTERNAL_CONTE5 = "applyInternalContext"; // Count: 2
28
+ export var _DYN_ACCOUNT_ID = "accountId"; // Count: 8
29
+ export var _DYN_SDK_EXTENSION = "sdkExtension"; // Count: 4
30
+ export var _DYN_GET_SESSION_ID = "getSessionId"; // Count: 4
31
+ export var _DYN_NAME_PREFIX = "namePrefix"; // Count: 7
32
+ export var _DYN_SESSION_COOKIE_POSTF6 = "sessionCookiePostfix"; // Count: 4
33
+ export var _DYN_USER_COOKIE_POSTFIX = "userCookiePostfix"; // Count: 4
34
+ export var _DYN_ID_LENGTH = "idLength"; // Count: 5
35
+ export var _DYN_GET_NEW_ID = "getNewId"; // Count: 6
36
+ export var _DYN_LENGTH = "length"; // Count: 4
37
+ export var _DYN_AUTOMATIC_SESSION = "automaticSession"; // Count: 5
38
+ export var _DYN_AUTHENTICATED_ID = "authenticatedId"; // Count: 6
39
+ export var _DYN_SESSION_EXPIRATION_M7 = "sessionExpirationMs"; // Count: 5
40
+ export var _DYN_SESSION_RENEWAL_MS = "sessionRenewalMs"; // Count: 4
41
+ export var _DYN_CONFIG = "config"; // Count: 4
42
+ export var _DYN_ACQUISITION_DATE = "acquisitionDate"; // Count: 5
43
+ export var _DYN_RENEWAL_DATE = "renewalDate"; // Count: 4
44
+ export var _DYN_COOKIE_DOMAIN = "cookieDomain"; // Count: 3
45
+ export var _DYN_JOIN = "join"; // Count: 5
46
+ export var _DYN_COOKIE_SEPARATOR = "cookieSeparator"; // Count: 5
47
+ export var _DYN_AUTH_USER_COOKIE_NAM8 = "authUserCookieName"; // Count: 3
48
+ //# sourceMappingURL=__DynamicConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__DynamicConstants.js.map","sources":["__DynamicConstants.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT License.\r\n// @skip-file-minify\r\n// ##############################################################\r\n// AUTO GENERATED FILE: This file is Auto Generated during build.\r\n// ##############################################################\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n// Note: DON'T Export these const from the package as we are still targeting ES3 this will export a mutable variables that someone could change!!!\r\n// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\nexport var _DYN_SESSION_MANAGER = \"sessionManager\"; // Count: 3\r\nexport var _DYN_UPDATE = \"update\"; // Count: 4\r\nexport var _DYN_IS_USER_COOKIE_SET = \"isUserCookieSet\"; // Count: 4\r\nexport var _DYN_IS_NEW_USER = \"isNewUser\"; // Count: 4\r\nexport var _DYN_GET_TRACE_CTX = \"getTraceCtx\"; // Count: 3\r\nexport var _DYN_TELEMETRY_TRACE = \"telemetryTrace\"; // Count: 3\r\nexport var _DYN_APPLY_SESSION_CONTEX0 = \"applySessionContext\"; // Count: 2\r\nexport var _DYN_APPLY_APPLICATION_CO1 = \"applyApplicationContext\"; // Count: 2\r\nexport var _DYN_APPLY_DEVICE_CONTEXT = \"applyDeviceContext\"; // Count: 2\r\nexport var _DYN_APPLY_OPERATION_CONT2 = \"applyOperationContext\"; // Count: 2\r\nexport var _DYN_APPLY_USER_CONTEXT = \"applyUserContext\"; // Count: 2\r\nexport var _DYN_APPLY_OPERATING_SYST3 = \"applyOperatingSystemContxt\"; // Count: 2\r\nexport var _DYN_APPLY_LOCATION_CONTE4 = \"applyLocationContext\"; // Count: 2\r\nexport var _DYN_APPLY_INTERNAL_CONTE5 = \"applyInternalContext\"; // Count: 2\r\nexport var _DYN_ACCOUNT_ID = \"accountId\"; // Count: 8\r\nexport var _DYN_SDK_EXTENSION = \"sdkExtension\"; // Count: 4\r\nexport var _DYN_GET_SESSION_ID = \"getSessionId\"; // Count: 4\r\nexport var _DYN_NAME_PREFIX = \"namePrefix\"; // Count: 7\r\nexport var _DYN_SESSION_COOKIE_POSTF6 = \"sessionCookiePostfix\"; // Count: 4\r\nexport var _DYN_USER_COOKIE_POSTFIX = \"userCookiePostfix\"; // Count: 4\r\nexport var _DYN_ID_LENGTH = \"idLength\"; // Count: 5\r\nexport var _DYN_GET_NEW_ID = \"getNewId\"; // Count: 6\r\nexport var _DYN_LENGTH = \"length\"; // Count: 4\r\nexport var _DYN_AUTOMATIC_SESSION = \"automaticSession\"; // Count: 5\r\nexport var _DYN_AUTHENTICATED_ID = \"authenticatedId\"; // Count: 6\r\nexport var _DYN_SESSION_EXPIRATION_M7 = \"sessionExpirationMs\"; // Count: 5\r\nexport var _DYN_SESSION_RENEWAL_MS = \"sessionRenewalMs\"; // Count: 4\r\nexport var _DYN_CONFIG = \"config\"; // Count: 4\r\nexport var _DYN_ACQUISITION_DATE = \"acquisitionDate\"; // Count: 5\r\nexport var _DYN_RENEWAL_DATE = \"renewalDate\"; // Count: 4\r\nexport var _DYN_COOKIE_DOMAIN = \"cookieDomain\"; // Count: 3\r\nexport var _DYN_JOIN = \"join\"; // Count: 5\r\nexport var _DYN_COOKIE_SEPARATOR = \"cookieSeparator\"; // Count: 5\r\nexport var _DYN_AUTH_USER_COOKIE_NAM8 = \"authUserCookieName\"; // Count: 3\r\n//# sourceMappingURL=__DynamicConstants.js.map"],"names":[],"mappings":";;;;AAA4D;AAC1B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Properties Plugin, 2.8.5-nightly.2206-04
2
+ * Application Insights JavaScript SDK - Properties Plugin, 2.8.5-nightly.2207-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/applicationinsights-properties-js",
3
- "version": "2.8.5-nightly.2206-04",
3
+ "version": "2.8.5-nightly.2207-02",
4
4
  "description": "Microsoft Application Insights properties (Part A) 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 propertiestests",
21
+ "mintest": "grunt properties-mintests",
21
22
  "lint": "tslint -p tsconfig.json",
22
23
  "dtsgen": "api-extractor run --local && node ../../scripts/dtsgen.js \"Microsoft Application Insights properties plugin\"",
23
- "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js"
24
+ "sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
25
+ "ai-min": "grunt properties-min",
26
+ "ai-restore": "grunt properties-restore"
24
27
  },
25
28
  "devDependencies": {
26
29
  "@microsoft/ai-test-framework": "0.0.1",
@@ -51,8 +54,8 @@
51
54
  "dependencies": {
52
55
  "@microsoft/dynamicproto-js": "^1.1.6",
53
56
  "@microsoft/applicationinsights-shims": "2.0.1",
54
- "@microsoft/applicationinsights-core-js": "2.8.5-nightly.2206-04",
55
- "@microsoft/applicationinsights-common": "2.8.5-nightly.2206-04"
57
+ "@microsoft/applicationinsights-core-js": "2.8.5-nightly.2207-02",
58
+ "@microsoft/applicationinsights-common": "2.8.5-nightly.2207-02"
56
59
  },
57
60
  "license": "MIT",
58
61
  "publishConfig": {
@@ -1,10 +1,10 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { IInternal } from "@microsoft/applicationinsights-common";
5
- import { ITelemetryConfig } from "../Interfaces/ITelemetryConfig";
6
-
7
- const Version = "2.8.5-nightly.2206-04";
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import { IInternal } from "@microsoft/applicationinsights-common";
5
+ import { ITelemetryConfig } from "../Interfaces/ITelemetryConfig";
6
+
7
+ const Version = "#version#";
8
8
 
9
9
  export class Internal implements IInternal {
10
10
 
@@ -39,4 +39,4 @@ export class Internal implements IInternal {
39
39
  constructor(config: ITelemetryConfig) {
40
40
  this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version;
41
41
  }
42
- }
42
+ }
@@ -1,13 +1,13 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import dynamicProto from "@microsoft/dynamicproto-js";
5
- import { ISession, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from "@microsoft/applicationinsights-common";
6
- import {
7
- IDiagnosticLogger, _eInternalMessageId, eLoggingSeverity, IAppInsightsCore, ICookieMgr, safeGetCookieMgr, isFunction,
8
- newId, dumpObj, getExceptionName, dateNow, safeGetLogger, _throwInternal
9
- } from "@microsoft/applicationinsights-core-js";
10
-
1
+ // Copyright (c) Microsoft Corporation. All rights reserved.
2
+ // Licensed under the MIT License.
3
+
4
+ import dynamicProto from "@microsoft/dynamicproto-js";
5
+ import { ISession, utlCanUseLocalStorage, utlGetLocalStorage, utlSetLocalStorage } from "@microsoft/applicationinsights-common";
6
+ import {
7
+ IAppInsightsCore, ICookieMgr, IDiagnosticLogger, _eInternalMessageId, _throwInternal, dateNow, dumpObj, eLoggingSeverity,
8
+ getExceptionName, isFunction, newId, safeGetCookieMgr, safeGetLogger
9
+ } from "@microsoft/applicationinsights-core-js";
10
+
11
11
  const cookieNameConst = "ai_session";
12
12
 
13
13
  export interface ISessionConfig {
@@ -262,4 +262,4 @@ export class _SessionManager {
262
262
  public backup() {
263
263
  // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
264
264
  }
265
- }
265
+ }
@@ -1,8 +1,8 @@
1
1
  // Copyright (c) Microsoft Corporation. All rights reserved.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ITelemetryTrace, ITraceState, dataSanitizeString } from "@microsoft/applicationinsights-common";
5
- import { generateW3CId, getLocation, IDiagnosticLogger } from "@microsoft/applicationinsights-core-js";
4
+ import { ITelemetryTrace, ITraceState, dataSanitizeString } from "@microsoft/applicationinsights-common";
5
+ import { IDiagnosticLogger, generateW3CId, getLocation } from "@microsoft/applicationinsights-core-js";
6
6
 
7
7
  export class TelemetryTrace implements ITelemetryTrace {
8
8
 
@@ -23,4 +23,4 @@ export class TelemetryTrace implements ITelemetryTrace {
23
23
 
24
24
  _self.name = dataSanitizeString(logger, name);
25
25
  }
26
- }
26
+ }