@microsoft/applicationinsights-osplugin-js 3.3.5-nightly3.2411-14 → 3.3.5-nightly3.2412-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.
- package/browser/es5/{ai.osplugin.3.3.5-nightly3.2411-14.cjs.js → ai.osplugin.3.3.5-nightly3.2412-02.cjs.js} +4 -4
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2412-02.cjs.js.map +1 -0
- package/browser/es5/{ai.osplugin.3.3.5-nightly3.2411-14.cjs.min.js → ai.osplugin.3.3.5-nightly3.2412-02.cjs.min.js} +3 -3
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2412-02.cjs.min.js.map +1 -0
- package/browser/es5/{ai.osplugin.3.3.5-nightly3.2411-14.gbl.js → ai.osplugin.3.3.5-nightly3.2412-02.gbl.js} +6 -6
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2412-02.gbl.js.map +1 -0
- package/browser/es5/{ai.osplugin.3.3.5-nightly3.2411-14.gbl.min.js → ai.osplugin.3.3.5-nightly3.2412-02.gbl.min.js} +3 -3
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2412-02.gbl.min.js.map +1 -0
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2412-02.integrity.json +66 -0
- package/browser/es5/{ai.osplugin.3.3.5-nightly3.2411-14.js → ai.osplugin.3.3.5-nightly3.2412-02.js} +6 -6
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2412-02.js.map +1 -0
- package/browser/es5/{ai.osplugin.3.3.5-nightly3.2411-14.min.js → ai.osplugin.3.3.5-nightly3.2412-02.min.js} +3 -3
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2412-02.min.js.map +1 -0
- package/browser/es5/ai.osplugin.3.cjs.js +3 -3
- package/browser/es5/ai.osplugin.3.cjs.js.map +1 -1
- package/browser/es5/ai.osplugin.3.cjs.min.js +2 -2
- package/browser/es5/ai.osplugin.3.cjs.min.js.map +1 -1
- package/browser/es5/ai.osplugin.3.gbl.js +5 -5
- package/browser/es5/ai.osplugin.3.gbl.js.map +1 -1
- package/browser/es5/ai.osplugin.3.gbl.min.js +2 -2
- package/browser/es5/ai.osplugin.3.gbl.min.js.map +1 -1
- package/browser/es5/ai.osplugin.3.integrity.json +25 -25
- package/browser/es5/ai.osplugin.3.js +5 -5
- package/browser/es5/ai.osplugin.3.js.map +1 -1
- package/browser/es5/ai.osplugin.3.min.js +2 -2
- package/browser/es5/ai.osplugin.3.min.js.map +1 -1
- package/dist/es5/applicationinsights-osplugin-js.js +3 -3
- package/dist/es5/applicationinsights-osplugin-js.js.map +1 -1
- package/dist/es5/applicationinsights-osplugin-js.min.js +2 -2
- package/dist/es5/applicationinsights-osplugin-js.min.js.map +1 -1
- package/dist-es5/DataModels.js +1 -1
- package/dist-es5/OsPlugin.js +2 -2
- package/dist-es5/OsPlugin.js.map +1 -1
- package/dist-es5/__DynamicConstants.js +1 -1
- package/dist-es5/applicationinsights-osplugin-js.js +1 -1
- package/package.json +3 -3
- package/types/applicationinsights-osplugin-js.d.ts +1 -3
- package/types/applicationinsights-osplugin-js.namespaced.d.ts +20 -28
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2411-14.cjs.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2411-14.cjs.min.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2411-14.gbl.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2411-14.gbl.min.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2411-14.integrity.json +0 -66
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2411-14.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.5-nightly3.2411-14.min.js.map +0 -1
package/dist-es5/DataModels.js
CHANGED
package/dist-es5/OsPlugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Application Insights JavaScript SDK - OS Plugin, 3.3.5-nightly3.
|
|
2
|
+
* Application Insights JavaScript SDK - OS Plugin, 3.3.5-nightly3.2412-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
|
@@ -26,7 +26,7 @@ var OsPlugin = /** @class */ (function (_super) {
|
|
|
26
26
|
var _this = _super.call(this) || this;
|
|
27
27
|
_this.identifier = "OsPlugin";
|
|
28
28
|
_this.priority = 195;
|
|
29
|
-
_this.version = '3.3.5-nightly3.
|
|
29
|
+
_this.version = '3.3.5-nightly3.2412-02';
|
|
30
30
|
var _core;
|
|
31
31
|
var _ocConfig;
|
|
32
32
|
var _getOSInProgress;
|
package/dist-es5/OsPlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OsPlugin.js.map","sources":["OsPlugin.js"],"sourcesContent":["import { __extends } from \"tslib\";\r\n/**\r\n* OsPlugin.ts\r\n* @author Siyu Niu (siyuniu)\r\n* @copyright Microsoft 2024\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { Extensions, utlCanUseSessionStorage, utlGetSessionStorage, utlSetSessionStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _throwInternal, addPageHideEventListener, addPageUnloadEventListener, arrForEach, createProcessTelemetryContext, createUniqueNamespace, getSetValue, mergeEvtNamespace, onConfigChange, removePageHideEventListener, removePageUnloadEventListener, setValue } from \"@microsoft/applicationinsights-core-js\";\r\nimport { doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { isString, objDeepFreeze, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_MERGE_OS_NAME_VERSIO0, _DYN_PLATFORM, _DYN_PLATFORM_VERSION } from \"./__DynamicConstants\";\r\nvar defaultMaxTimeout = 200;\r\nvar strExt = \"ext\";\r\nvar defaultOSConfig = objDeepFreeze({\r\n maxTimeout: defaultMaxTimeout,\r\n mergeOsNameVersion: undefined\r\n});\r\nvar OsPlugin = /** @class */ (function (_super) {\r\n __extends(OsPlugin, _super);\r\n function OsPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"OsPlugin\";\r\n _this.priority = 195;\r\n _this.version = '3.3.5-nightly3.2411-14';\r\n var _core;\r\n var _ocConfig;\r\n var _getOSInProgress;\r\n var _getOSTimeout;\r\n var _maxTimeout;\r\n var _platformVersionResponse;\r\n var _retrieveFullVersion;\r\n var _mergeOsNameVersion;\r\n var _eventQueue;\r\n var _evtNamespace;\r\n var _excludePageUnloadEvents;\r\n var _os;\r\n var _osVer;\r\n var _firstAttempt;\r\n dynamicProto(OsPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (coreConfig, core, extensions) {\r\n var _self = _this;\r\n _core = core;\r\n _super.prototype.initialize.call(_this, coreConfig, core, extensions);\r\n var identifier = _self.identifier;\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(identifier), core.evtNamespace && core.evtNamespace());\r\n if (utlCanUseSessionStorage) {\r\n try {\r\n _platformVersionResponse = JSON.parse(utlGetSessionStorage(core.logger, \"ai_osplugin\"));\r\n }\r\n catch (error) {\r\n // do nothing\r\n }\r\n }\r\n if (_platformVersionResponse) {\r\n _retrieveFullVersion = true;\r\n _osVer = parseInt(_platformVersionResponse[_DYN_PLATFORM_VERSION /* @min:%2eplatformVersion */]);\r\n _os = _platformVersionResponse[_DYN_PLATFORM /* @min:%2eplatform */];\r\n }\r\n _self._addHook(onConfigChange(coreConfig, function (details) {\r\n var coreConfig = details.cfg;\r\n var ctx = createProcessTelemetryContext(null, coreConfig, core);\r\n _ocConfig = ctx.getExtCfg(identifier, defaultOSConfig);\r\n _maxTimeout = _ocConfig.maxTimeout;\r\n if (_ocConfig[_DYN_MERGE_OS_NAME_VERSIO0 /* @min:%2emergeOsNameVersion */] !== undefined) {\r\n _mergeOsNameVersion = _ocConfig[_DYN_MERGE_OS_NAME_VERSIO0 /* @min:%2emergeOsNameVersion */];\r\n }\r\n else if (core.getPlugin(\"Sender\").plugin) {\r\n _mergeOsNameVersion = true;\r\n }\r\n else {\r\n _mergeOsNameVersion = false;\r\n }\r\n var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || [];\r\n if (_excludePageUnloadEvents && _excludePageUnloadEvents !== excludePageUnloadEvents) {\r\n removePageUnloadEventListener(null, _evtNamespace);\r\n removePageHideEventListener(null, _evtNamespace);\r\n _excludePageUnloadEvents = null;\r\n }\r\n if (!_excludePageUnloadEvents) {\r\n // If page is closed release queue\r\n addPageUnloadEventListener(_doUnload, excludePageUnloadEvents, _evtNamespace);\r\n addPageHideEventListener(_doUnload, excludePageUnloadEvents, _evtNamespace);\r\n }\r\n _excludePageUnloadEvents = excludePageUnloadEvents;\r\n }));\r\n function _doUnload() {\r\n _releaseEventQueue();\r\n }\r\n };\r\n _self.processTelemetry = function (event, itemCtx) {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n if (!_retrieveFullVersion && !_getOSInProgress && _firstAttempt) {\r\n // Start Requesting OS version process\r\n _getOSInProgress = true;\r\n startRetrieveOsVersion();\r\n _firstAttempt = false;\r\n }\r\n if (_getOSInProgress) {\r\n _eventQueue.push({\r\n ctx: itemCtx,\r\n item: event\r\n });\r\n }\r\n else {\r\n updateTeleItemWithOs(event);\r\n _self.processNext(event, itemCtx);\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _completeOsRetrieve();\r\n removePageUnloadEventListener(null, _evtNamespace);\r\n removePageHideEventListener(null, _evtNamespace);\r\n // Just register to remove all events associated with this namespace\r\n _initDefaults();\r\n };\r\n /**\r\n * Wait for the response from the browser for the OS version and store info in the session storage\r\n */\r\n function startRetrieveOsVersion() {\r\n // Timeout request if it takes more than 5 seconds (by default)\r\n var _a;\r\n _getOSTimeout = scheduleTimeout(function () {\r\n _completeOsRetrieve();\r\n }, _maxTimeout);\r\n if (navigator.userAgent) {\r\n var getHighEntropyValues = (_a = navigator.userAgentData) === null || _a === void 0 ? void 0 : _a.getHighEntropyValues;\r\n if (getHighEntropyValues) {\r\n doAwaitResponse(navigator.userAgentData.getHighEntropyValues([\"platformVersion\"]), function (response) {\r\n if (!response.rejected) {\r\n _platformVersionResponse = response.value;\r\n _retrieveFullVersion = true;\r\n if (_platformVersionResponse[_DYN_PLATFORM_VERSION /* @min:%2eplatformVersion */] && _platformVersionResponse[_DYN_PLATFORM /* @min:%2eplatform */]) {\r\n _os = _platformVersionResponse[_DYN_PLATFORM /* @min:%2eplatform */];\r\n _osVer = parseInt(_platformVersionResponse[_DYN_PLATFORM_VERSION /* @min:%2eplatformVersion */]);\r\n if (_os === \"Windows\") {\r\n if (_osVer == 0) {\r\n _osVer = 8;\r\n }\r\n else if (_osVer < 13) {\r\n _osVer = 10;\r\n }\r\n else {\r\n _osVer = 11;\r\n }\r\n }\r\n utlSetSessionStorage(_core.logger, \"ai_osplugin\", JSON.stringify({ platform: _os, platformVersion: _osVer }));\r\n }\r\n }\r\n else {\r\n _throwInternal(_core.logger, 1 /* eLoggingSeverity.CRITICAL */, 73 /* _eInternalMessageId.PluginException */, \"Could not retrieve operating system: \" + response.reason);\r\n }\r\n _completeOsRetrieve();\r\n });\r\n }\r\n }\r\n }\r\n function updateTeleItemWithOs(event) {\r\n if (_retrieveFullVersion) {\r\n var extOS = getSetValue(getSetValue(event, strExt), Extensions.OSExt);\r\n if (_mergeOsNameVersion) {\r\n setValue(extOS, \"osVer\", _os + _osVer, isString);\r\n }\r\n else {\r\n setValue(extOS, \"osVer\", _osVer);\r\n setValue(extOS, \"os\", _os, isString);\r\n }\r\n }\r\n }\r\n /**\r\n * Complete retrieving operating system info process, cleanup and release the event queue\r\n */\r\n function _completeOsRetrieve() {\r\n if (_getOSTimeout) {\r\n _getOSTimeout.cancel();\r\n }\r\n _getOSInProgress = false;\r\n _releaseEventQueue();\r\n }\r\n /**\r\n * Release internal event queue\r\n */\r\n function _releaseEventQueue() {\r\n arrForEach(_eventQueue, function (evt) {\r\n updateTeleItemWithOs(evt.item);\r\n _self.processNext(evt.item, evt.ctx);\r\n });\r\n _eventQueue = [];\r\n }\r\n function _initDefaults() {\r\n _core = null;\r\n _ocConfig = null;\r\n _getOSInProgress = false;\r\n _getOSTimeout = null;\r\n _maxTimeout = null;\r\n _retrieveFullVersion = false;\r\n _eventQueue = [];\r\n _firstAttempt = true;\r\n }\r\n // Special internal method to allow the DebugPlugin to hook embedded objects\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_platformVersionResponse, _eventQueue, _getOSInProgress];\r\n };\r\n });\r\n return _this;\r\n }\r\n OsPlugin.prototype.initialize = function (config, core, extensions) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Process the event and add it to an internal queue if handshake in process\r\n * @param event - The event to process\r\n * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\r\n * can optionally use this to access the current core instance or define / pass additional information\r\n * to later plugins (vs appending items to the telemetry item)\r\n */\r\n OsPlugin.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 OsPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { OsPlugin };\r\n//# sourceMappingURL=OsPlugin.js.map"],"names":[],"mappings":";;;;AAAA,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;wDAYM,CAAC;;;;;oBACa;AACpB;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"OsPlugin.js.map","sources":["OsPlugin.js"],"sourcesContent":["import { __extends } from \"tslib\";\r\n/**\r\n* OsPlugin.ts\r\n* @author Siyu Niu (siyuniu)\r\n* @copyright Microsoft 2024\r\n*/\r\nimport dynamicProto from \"@microsoft/dynamicproto-js\";\r\nimport { Extensions, utlCanUseSessionStorage, utlGetSessionStorage, utlSetSessionStorage } from \"@microsoft/applicationinsights-common\";\r\nimport { BaseTelemetryPlugin, _throwInternal, addPageHideEventListener, addPageUnloadEventListener, arrForEach, createProcessTelemetryContext, createUniqueNamespace, getSetValue, mergeEvtNamespace, onConfigChange, removePageHideEventListener, removePageUnloadEventListener, setValue } from \"@microsoft/applicationinsights-core-js\";\r\nimport { doAwaitResponse } from \"@nevware21/ts-async\";\r\nimport { isString, objDeepFreeze, scheduleTimeout } from \"@nevware21/ts-utils\";\r\nimport { _DYN_MERGE_OS_NAME_VERSIO0, _DYN_PLATFORM, _DYN_PLATFORM_VERSION } from \"./__DynamicConstants\";\r\nvar defaultMaxTimeout = 200;\r\nvar strExt = \"ext\";\r\nvar defaultOSConfig = objDeepFreeze({\r\n maxTimeout: defaultMaxTimeout,\r\n mergeOsNameVersion: undefined\r\n});\r\nvar OsPlugin = /** @class */ (function (_super) {\r\n __extends(OsPlugin, _super);\r\n function OsPlugin() {\r\n var _this = _super.call(this) || this;\r\n _this.identifier = \"OsPlugin\";\r\n _this.priority = 195;\r\n _this.version = '3.3.5-nightly3.2412-02';\r\n var _core;\r\n var _ocConfig;\r\n var _getOSInProgress;\r\n var _getOSTimeout;\r\n var _maxTimeout;\r\n var _platformVersionResponse;\r\n var _retrieveFullVersion;\r\n var _mergeOsNameVersion;\r\n var _eventQueue;\r\n var _evtNamespace;\r\n var _excludePageUnloadEvents;\r\n var _os;\r\n var _osVer;\r\n var _firstAttempt;\r\n dynamicProto(OsPlugin, _this, function (_self, _base) {\r\n _initDefaults();\r\n _self.initialize = function (coreConfig, core, extensions) {\r\n var _self = _this;\r\n _core = core;\r\n _super.prototype.initialize.call(_this, coreConfig, core, extensions);\r\n var identifier = _self.identifier;\r\n _evtNamespace = mergeEvtNamespace(createUniqueNamespace(identifier), core.evtNamespace && core.evtNamespace());\r\n if (utlCanUseSessionStorage) {\r\n try {\r\n _platformVersionResponse = JSON.parse(utlGetSessionStorage(core.logger, \"ai_osplugin\"));\r\n }\r\n catch (error) {\r\n // do nothing\r\n }\r\n }\r\n if (_platformVersionResponse) {\r\n _retrieveFullVersion = true;\r\n _osVer = parseInt(_platformVersionResponse[_DYN_PLATFORM_VERSION /* @min:%2eplatformVersion */]);\r\n _os = _platformVersionResponse[_DYN_PLATFORM /* @min:%2eplatform */];\r\n }\r\n _self._addHook(onConfigChange(coreConfig, function (details) {\r\n var coreConfig = details.cfg;\r\n var ctx = createProcessTelemetryContext(null, coreConfig, core);\r\n _ocConfig = ctx.getExtCfg(identifier, defaultOSConfig);\r\n _maxTimeout = _ocConfig.maxTimeout;\r\n if (_ocConfig[_DYN_MERGE_OS_NAME_VERSIO0 /* @min:%2emergeOsNameVersion */] !== undefined) {\r\n _mergeOsNameVersion = _ocConfig[_DYN_MERGE_OS_NAME_VERSIO0 /* @min:%2emergeOsNameVersion */];\r\n }\r\n else if (core.getPlugin(\"Sender\").plugin) {\r\n _mergeOsNameVersion = true;\r\n }\r\n else {\r\n _mergeOsNameVersion = false;\r\n }\r\n var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || [];\r\n if (_excludePageUnloadEvents && _excludePageUnloadEvents !== excludePageUnloadEvents) {\r\n removePageUnloadEventListener(null, _evtNamespace);\r\n removePageHideEventListener(null, _evtNamespace);\r\n _excludePageUnloadEvents = null;\r\n }\r\n if (!_excludePageUnloadEvents) {\r\n // If page is closed release queue\r\n addPageUnloadEventListener(_doUnload, excludePageUnloadEvents, _evtNamespace);\r\n addPageHideEventListener(_doUnload, excludePageUnloadEvents, _evtNamespace);\r\n }\r\n _excludePageUnloadEvents = excludePageUnloadEvents;\r\n }));\r\n function _doUnload() {\r\n _releaseEventQueue();\r\n }\r\n };\r\n _self.processTelemetry = function (event, itemCtx) {\r\n itemCtx = _self._getTelCtx(itemCtx);\r\n if (!_retrieveFullVersion && !_getOSInProgress && _firstAttempt) {\r\n // Start Requesting OS version process\r\n _getOSInProgress = true;\r\n startRetrieveOsVersion();\r\n _firstAttempt = false;\r\n }\r\n if (_getOSInProgress) {\r\n _eventQueue.push({\r\n ctx: itemCtx,\r\n item: event\r\n });\r\n }\r\n else {\r\n updateTeleItemWithOs(event);\r\n _self.processNext(event, itemCtx);\r\n }\r\n };\r\n _self._doTeardown = function (unloadCtx, unloadState) {\r\n _completeOsRetrieve();\r\n removePageUnloadEventListener(null, _evtNamespace);\r\n removePageHideEventListener(null, _evtNamespace);\r\n // Just register to remove all events associated with this namespace\r\n _initDefaults();\r\n };\r\n /**\r\n * Wait for the response from the browser for the OS version and store info in the session storage\r\n */\r\n function startRetrieveOsVersion() {\r\n // Timeout request if it takes more than 5 seconds (by default)\r\n var _a;\r\n _getOSTimeout = scheduleTimeout(function () {\r\n _completeOsRetrieve();\r\n }, _maxTimeout);\r\n if (navigator.userAgent) {\r\n var getHighEntropyValues = (_a = navigator.userAgentData) === null || _a === void 0 ? void 0 : _a.getHighEntropyValues;\r\n if (getHighEntropyValues) {\r\n doAwaitResponse(navigator.userAgentData.getHighEntropyValues([\"platformVersion\"]), function (response) {\r\n if (!response.rejected) {\r\n _platformVersionResponse = response.value;\r\n _retrieveFullVersion = true;\r\n if (_platformVersionResponse[_DYN_PLATFORM_VERSION /* @min:%2eplatformVersion */] && _platformVersionResponse[_DYN_PLATFORM /* @min:%2eplatform */]) {\r\n _os = _platformVersionResponse[_DYN_PLATFORM /* @min:%2eplatform */];\r\n _osVer = parseInt(_platformVersionResponse[_DYN_PLATFORM_VERSION /* @min:%2eplatformVersion */]);\r\n if (_os === \"Windows\") {\r\n if (_osVer == 0) {\r\n _osVer = 8;\r\n }\r\n else if (_osVer < 13) {\r\n _osVer = 10;\r\n }\r\n else {\r\n _osVer = 11;\r\n }\r\n }\r\n utlSetSessionStorage(_core.logger, \"ai_osplugin\", JSON.stringify({ platform: _os, platformVersion: _osVer }));\r\n }\r\n }\r\n else {\r\n _throwInternal(_core.logger, 1 /* eLoggingSeverity.CRITICAL */, 73 /* _eInternalMessageId.PluginException */, \"Could not retrieve operating system: \" + response.reason);\r\n }\r\n _completeOsRetrieve();\r\n });\r\n }\r\n }\r\n }\r\n function updateTeleItemWithOs(event) {\r\n if (_retrieveFullVersion) {\r\n var extOS = getSetValue(getSetValue(event, strExt), Extensions.OSExt);\r\n if (_mergeOsNameVersion) {\r\n setValue(extOS, \"osVer\", _os + _osVer, isString);\r\n }\r\n else {\r\n setValue(extOS, \"osVer\", _osVer);\r\n setValue(extOS, \"os\", _os, isString);\r\n }\r\n }\r\n }\r\n /**\r\n * Complete retrieving operating system info process, cleanup and release the event queue\r\n */\r\n function _completeOsRetrieve() {\r\n if (_getOSTimeout) {\r\n _getOSTimeout.cancel();\r\n }\r\n _getOSInProgress = false;\r\n _releaseEventQueue();\r\n }\r\n /**\r\n * Release internal event queue\r\n */\r\n function _releaseEventQueue() {\r\n arrForEach(_eventQueue, function (evt) {\r\n updateTeleItemWithOs(evt.item);\r\n _self.processNext(evt.item, evt.ctx);\r\n });\r\n _eventQueue = [];\r\n }\r\n function _initDefaults() {\r\n _core = null;\r\n _ocConfig = null;\r\n _getOSInProgress = false;\r\n _getOSTimeout = null;\r\n _maxTimeout = null;\r\n _retrieveFullVersion = false;\r\n _eventQueue = [];\r\n _firstAttempt = true;\r\n }\r\n // Special internal method to allow the DebugPlugin to hook embedded objects\r\n _self[\"_getDbgPlgTargets\"] = function () {\r\n return [_platformVersionResponse, _eventQueue, _getOSInProgress];\r\n };\r\n });\r\n return _this;\r\n }\r\n OsPlugin.prototype.initialize = function (config, core, extensions) {\r\n // @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging\r\n };\r\n /**\r\n * Process the event and add it to an internal queue if handshake in process\r\n * @param event - The event to process\r\n * @param itemCtx - This is the context for the current request, ITelemetryPlugin instances\r\n * can optionally use this to access the current core instance or define / pass additional information\r\n * to later plugins (vs appending items to the telemetry item)\r\n */\r\n OsPlugin.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 OsPlugin;\r\n}(BaseTelemetryPlugin));\r\nexport { OsPlugin };\r\n//# sourceMappingURL=OsPlugin.js.map"],"names":[],"mappings":";;;;AAAA,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;wDAYM,CAAC;;;;;oBACa;AACpB;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/applicationinsights-osplugin-js",
|
|
3
|
-
"version": "3.3.5-nightly3.
|
|
3
|
+
"version": "3.3.5-nightly3.2412-02",
|
|
4
4
|
"description": "Microsoft Application Insights OS Plugin",
|
|
5
5
|
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
|
6
6
|
"author": "Microsoft Application Insights Team",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@microsoft/applicationinsights-shims": "3.0.1",
|
|
33
|
-
"@microsoft/applicationinsights-common": "3.3.5-nightly3.
|
|
33
|
+
"@microsoft/applicationinsights-common": "3.3.5-nightly3.2412-02",
|
|
34
34
|
"@microsoft/dynamicproto-js": "^2.0.3",
|
|
35
|
-
"@microsoft/applicationinsights-core-js": "3.3.5-nightly3.
|
|
35
|
+
"@microsoft/applicationinsights-core-js": "3.3.5-nightly3.2412-02",
|
|
36
36
|
"@nevware21/ts-utils": ">= 0.11.3 < 2.x",
|
|
37
37
|
"@nevware21/ts-async": ">= 0.5.2 < 2.x"
|
|
38
38
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights osplugin plugin, 3.3.5-nightly3.
|
|
2
|
+
* Microsoft Application Insights osplugin plugin, 3.3.5-nightly3.2412-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -35,13 +35,11 @@ export declare interface IOSPluginConfiguration {
|
|
|
35
35
|
/**
|
|
36
36
|
* Maximum time to wait for the OS plugin to return the OS information
|
|
37
37
|
* Default: 200
|
|
38
|
-
* @type {number}
|
|
39
38
|
*/
|
|
40
39
|
maxTimeout?: number;
|
|
41
40
|
/**
|
|
42
41
|
* Whether to merge the OS name and version into one field
|
|
43
42
|
* Default: undefined
|
|
44
|
-
* @type {boolean}
|
|
45
43
|
*/
|
|
46
44
|
mergeOsNameVersion?: boolean;
|
|
47
45
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights osplugin plugin, 3.3.5-nightly3.
|
|
2
|
+
* Microsoft Application Insights osplugin plugin, 3.3.5-nightly3.2412-02
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -369,7 +369,6 @@ declare namespace ApplicationInsights {
|
|
|
369
369
|
unload(isAsync?: boolean, unloadComplete?: (unloadState: ITelemetryUnloadState) => void, cbTimeout?: number): void | IPromise<ITelemetryUnloadState>;
|
|
370
370
|
/**
|
|
371
371
|
* Find and return the (first) plugin with the specified identifier if present
|
|
372
|
-
* @param pluginIdentifier
|
|
373
372
|
*/
|
|
374
373
|
getPlugin<T extends IPlugin = IPlugin>(pluginIdentifier: string): ILoadedPlugin<T>;
|
|
375
374
|
/**
|
|
@@ -424,7 +423,6 @@ declare namespace ApplicationInsights {
|
|
|
424
423
|
/**
|
|
425
424
|
* Watches and tracks changes for accesses to the current config, and if the accessed config changes the
|
|
426
425
|
* handler will be recalled.
|
|
427
|
-
* @param handler
|
|
428
426
|
* @returns A watcher handler instance that can be used to remove itself when being unloaded
|
|
429
427
|
*/
|
|
430
428
|
onCfgChange(handler: WatcherFunction<CfgType>): IUnloadHook;
|
|
@@ -671,7 +669,7 @@ declare namespace ApplicationInsights {
|
|
|
671
669
|
*/
|
|
672
670
|
disableFlushOnBeforeUnload?: boolean;
|
|
673
671
|
/**
|
|
674
|
-
* Default value of
|
|
672
|
+
* Default value of `disableFlushOnBeforeUnload`. If true, flush method will not be called when onPageHide or onVisibilityChange (hidden state) event(s) trigger.
|
|
675
673
|
*/
|
|
676
674
|
disableFlushOnUnload?: boolean;
|
|
677
675
|
/**
|
|
@@ -723,12 +721,12 @@ declare namespace ApplicationInsights {
|
|
|
723
721
|
*/
|
|
724
722
|
isStorageUseDisabled?: boolean;
|
|
725
723
|
/**
|
|
726
|
-
* If false, the SDK will send all telemetry using the
|
|
724
|
+
* If false, the SDK will send all telemetry using the <a href="https://www.w3.org/TR/beacon">Beacon API</a>.
|
|
727
725
|
* @defaultValue true
|
|
728
726
|
*/
|
|
729
727
|
isBeaconApiDisabled?: boolean;
|
|
730
728
|
/**
|
|
731
|
-
* Don't use XMLHttpRequest or XDomainRequest (for IE
|
|
729
|
+
* Don't use XMLHttpRequest or XDomainRequest (for IE \< 9) by default instead attempt to use fetch() or sendBeacon.
|
|
732
730
|
* If no other transport is available it will still use XMLHttpRequest
|
|
733
731
|
*/
|
|
734
732
|
disableXhr?: boolean;
|
|
@@ -985,8 +983,8 @@ declare namespace ApplicationInsights {
|
|
|
985
983
|
* be logged to console if their severity meets the configured loggingConsoleLevel
|
|
986
984
|
*
|
|
987
985
|
* 0: ALL console logging off
|
|
988
|
-
* 1: logs to console: severity
|
|
989
|
-
* 2: logs to console: severity
|
|
986
|
+
* 1: logs to console: severity \>= CRITICAL
|
|
987
|
+
* 2: logs to console: severity \>= WARNING
|
|
990
988
|
*/
|
|
991
989
|
loggingLevelConsole?: number;
|
|
992
990
|
/**
|
|
@@ -995,8 +993,8 @@ declare namespace ApplicationInsights {
|
|
|
995
993
|
* the configured instrumentation key.
|
|
996
994
|
*
|
|
997
995
|
* 0: ALL iKey logging off
|
|
998
|
-
* 1: logs to iKey: severity
|
|
999
|
-
* 2: logs to iKey: severity
|
|
996
|
+
* 1: logs to iKey: severity \>= CRITICAL
|
|
997
|
+
* 2: logs to iKey: severity \>= WARNING
|
|
1000
998
|
*/
|
|
1001
999
|
loggingLevelTelemetry?: number;
|
|
1002
1000
|
/**
|
|
@@ -1023,7 +1021,6 @@ declare namespace ApplicationInsights {
|
|
|
1023
1021
|
*/
|
|
1024
1022
|
readonly channels?: IChannelControls[][];
|
|
1025
1023
|
/**
|
|
1026
|
-
* @type {boolean}
|
|
1027
1024
|
* Flag that disables the Instrumentation Key validation.
|
|
1028
1025
|
*/
|
|
1029
1026
|
disableInstrumentationKeyValidation?: boolean;
|
|
@@ -1054,14 +1051,12 @@ declare namespace ApplicationInsights {
|
|
|
1054
1051
|
/**
|
|
1055
1052
|
* @description Custom cookie domain. This is helpful if you want to share Application Insights cookies across subdomains. It
|
|
1056
1053
|
* can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
|
|
1057
|
-
* @type {string}
|
|
1058
1054
|
* @defaultValue ""
|
|
1059
1055
|
*/
|
|
1060
1056
|
cookieDomain?: string;
|
|
1061
1057
|
/**
|
|
1062
1058
|
* @description Custom cookie path. This is helpful if you want to share Application Insights cookies behind an application
|
|
1063
1059
|
* gateway. It can be set here or as part of the cookieCfg.domain, the cookieCfg takes precedence if both are specified.
|
|
1064
|
-
* @type {string}
|
|
1065
1060
|
* @defaultValue ""
|
|
1066
1061
|
*/
|
|
1067
1062
|
cookiePath?: string;
|
|
@@ -1173,7 +1168,7 @@ declare namespace ApplicationInsights {
|
|
|
1173
1168
|
/**
|
|
1174
1169
|
* Optional Callback hook to allow the cookie manager to update it's configuration, not generally implemented now that
|
|
1175
1170
|
* dynamic configuration is supported
|
|
1176
|
-
* @param updateState
|
|
1171
|
+
* @param updateState - The new configuration state to apply to the cookie manager
|
|
1177
1172
|
*/
|
|
1178
1173
|
update?(updateState: ITelemetryUpdateState): void;
|
|
1179
1174
|
/**
|
|
@@ -1287,7 +1282,7 @@ declare namespace ApplicationInsights {
|
|
|
1287
1282
|
logInternalMessage?(severity: LoggingSeverity, message: _InternalLogMessage): void;
|
|
1288
1283
|
/**
|
|
1289
1284
|
* Optional Callback hook to allow the diagnostic logger to update it's configuration
|
|
1290
|
-
* @param updateState
|
|
1285
|
+
* @param updateState - The new configuration state to apply to the diagnostic logger
|
|
1291
1286
|
*/
|
|
1292
1287
|
update?(updateState: ITelemetryUpdateState): void;
|
|
1293
1288
|
/**
|
|
@@ -1308,7 +1303,7 @@ declare namespace ApplicationInsights {
|
|
|
1308
1303
|
getName(): string;
|
|
1309
1304
|
/**
|
|
1310
1305
|
* Sets the current name of the page
|
|
1311
|
-
* @param pageName
|
|
1306
|
+
* @param pageName - The name of the page
|
|
1312
1307
|
*/
|
|
1313
1308
|
setName(pageName: string): void;
|
|
1314
1309
|
/**
|
|
@@ -1340,7 +1335,7 @@ declare namespace ApplicationInsights {
|
|
|
1340
1335
|
getTraceFlags(): number | undefined;
|
|
1341
1336
|
/**
|
|
1342
1337
|
* https://www.w3.org/TR/trace-context/#trace-flags
|
|
1343
|
-
* @param newValue
|
|
1338
|
+
* @param newValue - An integer representation of the W3C TraceContext trace-flags.
|
|
1344
1339
|
*/
|
|
1345
1340
|
setTraceFlags(newValue?: number): void;
|
|
1346
1341
|
}
|
|
@@ -1379,10 +1374,10 @@ declare namespace ApplicationInsights {
|
|
|
1379
1374
|
*
|
|
1380
1375
|
* This callback is called before telemetry data is sent, allowing for dynamic customization of the logs.
|
|
1381
1376
|
*
|
|
1382
|
-
* @returns
|
|
1377
|
+
* @returns An object with the following property:
|
|
1383
1378
|
* - logs: An array of strings, where each string represents a log entry to be included in the telemetry.
|
|
1384
1379
|
*
|
|
1385
|
-
* @property
|
|
1380
|
+
* @property maxLogs - Specifies the maximum number of logs that can be generated. If not explicitly set, it defaults to 50.
|
|
1386
1381
|
*/
|
|
1387
1382
|
expLog?: () => {
|
|
1388
1383
|
logs: string[];
|
|
@@ -1441,32 +1436,31 @@ declare namespace ApplicationInsights {
|
|
|
1441
1436
|
getUrl: () => string;
|
|
1442
1437
|
/**
|
|
1443
1438
|
* Create payload data
|
|
1444
|
-
* @param data data
|
|
1445
1439
|
* @returns IPayloadData
|
|
1446
1440
|
*/
|
|
1447
1441
|
createPayload: (data: string | Uint8Array) => IPayloadData;
|
|
1448
1442
|
/**
|
|
1449
1443
|
* Serialize an item into a string
|
|
1450
|
-
* @param input telemetry item
|
|
1451
|
-
* @param convertUndefined convert undefined to a custom-defined object
|
|
1444
|
+
* @param input - telemetry item
|
|
1445
|
+
* @param convertUndefined - convert undefined to a custom-defined object
|
|
1452
1446
|
* @returns Serialized string
|
|
1453
1447
|
*/
|
|
1454
1448
|
serialize?: (input: ITelemetryItem, convertUndefined?: any) => string;
|
|
1455
1449
|
/**
|
|
1456
1450
|
* Batch an array of strings into one string
|
|
1457
|
-
* @param arr array of strings
|
|
1451
|
+
* @param arr - array of strings
|
|
1458
1452
|
* @returns a string represent all items in the given array
|
|
1459
1453
|
*/
|
|
1460
1454
|
batch?: (arr: string[]) => string;
|
|
1461
1455
|
/**
|
|
1462
1456
|
* If the item should be processed by offline channel
|
|
1463
|
-
* @param evt telemetry item
|
|
1457
|
+
* @param evt - telemetry item
|
|
1464
1458
|
* @returns should process or not
|
|
1465
1459
|
*/
|
|
1466
1460
|
shouldProcess?: (evt: ITelemetryItem) => boolean;
|
|
1467
1461
|
/**
|
|
1468
1462
|
* Create 1ds payload data
|
|
1469
|
-
* @param evts ITelemetryItems
|
|
1463
|
+
* @param evts - ITelemetryItems
|
|
1470
1464
|
* @returns IPayloadData
|
|
1471
1465
|
*/
|
|
1472
1466
|
createOneDSPayload?: (evts: ITelemetryItem[]) => IPayloadData;
|
|
@@ -1526,7 +1520,7 @@ declare namespace ApplicationInsights {
|
|
|
1526
1520
|
/**
|
|
1527
1521
|
* [Optional] This event is sent if you have enabled perf events, they are primarily used to track internal performance testing and debugging
|
|
1528
1522
|
* the event can be displayed via the debug plugin extension.
|
|
1529
|
-
* @param perfEvent
|
|
1523
|
+
* @param perfEvent - The performance event object
|
|
1530
1524
|
*/
|
|
1531
1525
|
perfEvent?: (perfEvent: IPerfEvent) => void;
|
|
1532
1526
|
/**
|
|
@@ -1652,13 +1646,11 @@ declare namespace ApplicationInsights {
|
|
|
1652
1646
|
/**
|
|
1653
1647
|
* Maximum time to wait for the OS plugin to return the OS information
|
|
1654
1648
|
* Default: 200
|
|
1655
|
-
* @type {number}
|
|
1656
1649
|
*/
|
|
1657
1650
|
maxTimeout?: number;
|
|
1658
1651
|
/**
|
|
1659
1652
|
* Whether to merge the OS name and version into one field
|
|
1660
1653
|
* Default: undefined
|
|
1661
|
-
* @type {boolean}
|
|
1662
1654
|
*/
|
|
1663
1655
|
mergeOsNameVersion?: boolean;
|
|
1664
1656
|
}
|