@microsoft/applicationinsights-osplugin-js 3.3.0-nightly3.2406-07 → 3.3.0-nightly3.2406-09
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.0-nightly3.2406-07.cjs.js → ai.osplugin.3.3.0-nightly3.2406-09.cjs.js} +50 -43
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.cjs.js.map +1 -0
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.cjs.min.js +6 -0
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.cjs.min.js.map +1 -0
- package/browser/es5/{ai.osplugin.3.3.0-nightly3.2406-07.gbl.js → ai.osplugin.3.3.0-nightly3.2406-09.gbl.js} +52 -45
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.gbl.js.map +1 -0
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.gbl.min.js +6 -0
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.gbl.min.js.map +1 -0
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.integrity.json +66 -0
- package/browser/es5/{ai.osplugin.3.3.0-nightly3.2406-07.js → ai.osplugin.3.3.0-nightly3.2406-09.js} +52 -45
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.js.map +1 -0
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.min.js +6 -0
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-09.min.js.map +1 -0
- package/browser/es5/ai.osplugin.3.cjs.js +49 -42
- 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 +51 -44
- 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 +51 -44
- 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 +49 -42
- 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 -1
- package/types/applicationinsights-osplugin-js.namespaced.d.ts +52 -5
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.cjs.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.cjs.min.js +0 -6
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.cjs.min.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.gbl.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.gbl.min.js +0 -6
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.gbl.min.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.integrity.json +0 -66
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.js.map +0 -1
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.min.js +0 -6
- package/browser/es5/ai.osplugin.3.3.0-nightly3.2406-07.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.0-nightly3.2406-
|
|
2
|
+
* Application Insights JavaScript SDK - OS Plugin, 3.3.0-nightly3.2406-09
|
|
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.0-nightly3.2406-
|
|
29
|
+
_this.version = '3.3.0-nightly3.2406-09';
|
|
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.0-nightly3.2406-07';\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.0-nightly3.2406-09';\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.0-nightly3.2406-
|
|
3
|
+
"version": "3.3.0-nightly3.2406-09",
|
|
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.0-nightly3.2406-
|
|
33
|
+
"@microsoft/applicationinsights-common": "3.3.0-nightly3.2406-09",
|
|
34
34
|
"@microsoft/dynamicproto-js": "^2.0.3",
|
|
35
|
-
"@microsoft/applicationinsights-core-js": "3.3.0-nightly3.2406-
|
|
35
|
+
"@microsoft/applicationinsights-core-js": "3.3.0-nightly3.2406-09",
|
|
36
36
|
"@nevware21/ts-utils": ">= 0.11.1 < 2.x",
|
|
37
37
|
"@nevware21/ts-async": ">= 0.5.1 < 2.x"
|
|
38
38
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Microsoft Application Insights osplugin plugin, 3.3.0-nightly3.2406-
|
|
2
|
+
* Microsoft Application Insights osplugin plugin, 3.3.0-nightly3.2406-09
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*
|
|
5
5
|
* Microsoft Application Insights Team
|
|
@@ -110,6 +110,23 @@ declare namespace ApplicationInsights {
|
|
|
110
110
|
|
|
111
111
|
type DistributedTracingModes = number | eDistributedTracingModes;
|
|
112
112
|
|
|
113
|
+
const enum eActiveStatus {
|
|
114
|
+
NONE = 0,
|
|
115
|
+
/**
|
|
116
|
+
* inactive status means there might be rejected ikey/endpoint promises or ikey/endpoint resolved is not valid
|
|
117
|
+
*/
|
|
118
|
+
INACTIVE = 1,
|
|
119
|
+
/**
|
|
120
|
+
* active mean ikey/endpoint promises is resolved and initializing with ikey/endpoint is successful
|
|
121
|
+
*/
|
|
122
|
+
ACTIVE = 2,
|
|
123
|
+
/**
|
|
124
|
+
* Waiting for promises to be resolved
|
|
125
|
+
* NOTE: if status is set to be pending, incoming changes will be dropped until pending status is removed
|
|
126
|
+
*/
|
|
127
|
+
PENDING = 3
|
|
128
|
+
}
|
|
129
|
+
|
|
113
130
|
const enum eDistributedTracingModes {
|
|
114
131
|
/**
|
|
115
132
|
* (Default) Send Application Insights correlation headers
|
|
@@ -214,7 +231,8 @@ declare namespace ApplicationInsights {
|
|
|
214
231
|
DynamicConfigException = 108,
|
|
215
232
|
DefaultThrottleMsgKey = 109,
|
|
216
233
|
CdnDeprecation = 110,
|
|
217
|
-
SdkLdrUpdate = 111
|
|
234
|
+
SdkLdrUpdate = 111,
|
|
235
|
+
InitPromiseException = 112
|
|
218
236
|
}
|
|
219
237
|
|
|
220
238
|
const enum eLoggingSeverity {
|
|
@@ -414,6 +432,21 @@ declare namespace ApplicationInsights {
|
|
|
414
432
|
* Function used to identify the get w parameter used to identify status bit to some channels
|
|
415
433
|
*/
|
|
416
434
|
getWParam: () => number;
|
|
435
|
+
/**
|
|
436
|
+
* Watches and tracks status of initialization process
|
|
437
|
+
* @returns ActiveStatus
|
|
438
|
+
* @since 3.3.0
|
|
439
|
+
* If returned status is active, it means initialization process is completed.
|
|
440
|
+
* If returned status is pending, it means the initialization process is waiting for promieses to be resolved.
|
|
441
|
+
* If returned status is inactive, it means ikey is invalid or can 't get ikey or enpoint url from promsises.
|
|
442
|
+
*/
|
|
443
|
+
activeStatus?: () => eActiveStatus | number;
|
|
444
|
+
/**
|
|
445
|
+
* Set Active Status to pending, which will block the incoming changes until internal promises are resolved
|
|
446
|
+
* @internal Internal use
|
|
447
|
+
* @since 3.3.0
|
|
448
|
+
*/
|
|
449
|
+
_setPendingStatus?: () => void;
|
|
417
450
|
}
|
|
418
451
|
|
|
419
452
|
interface IBaseProcessingContext {
|
|
@@ -925,11 +958,11 @@ declare namespace ApplicationInsights {
|
|
|
925
958
|
/**
|
|
926
959
|
* Instrumentation key of resource. Either this or connectionString must be specified.
|
|
927
960
|
*/
|
|
928
|
-
instrumentationKey?: string
|
|
961
|
+
instrumentationKey?: string | IPromise<string>;
|
|
929
962
|
/**
|
|
930
963
|
* Connection string of resource. Either this or instrumentationKey must be specified.
|
|
931
964
|
*/
|
|
932
|
-
connectionString?: string
|
|
965
|
+
connectionString?: string | IPromise<string>;
|
|
933
966
|
/**
|
|
934
967
|
* Set the timer interval (in ms) for internal logging queue, this is the
|
|
935
968
|
* amount of time to wait after logger.queue messages are detected to be sent.
|
|
@@ -973,7 +1006,7 @@ declare namespace ApplicationInsights {
|
|
|
973
1006
|
/**
|
|
974
1007
|
* Endpoint where telemetry data is sent
|
|
975
1008
|
*/
|
|
976
|
-
endpointUrl?: string
|
|
1009
|
+
endpointUrl?: string | IPromise<string>;
|
|
977
1010
|
/**
|
|
978
1011
|
* Extension configs loaded in SDK
|
|
979
1012
|
*/
|
|
@@ -1075,6 +1108,20 @@ declare namespace ApplicationInsights {
|
|
|
1075
1108
|
* @defaultValue undefined
|
|
1076
1109
|
*/
|
|
1077
1110
|
featureOptIn?: IFeatureOptIn;
|
|
1111
|
+
/**
|
|
1112
|
+
* If your connection string, instrumentation key and endpoint url are promises,
|
|
1113
|
+
* this config is to manually set timeout for those promises.
|
|
1114
|
+
* Default: 50000ms
|
|
1115
|
+
* @since 3.3.0
|
|
1116
|
+
*/
|
|
1117
|
+
initTimeOut?: number;
|
|
1118
|
+
/**
|
|
1119
|
+
* If your connection string, instrumentation key and endpoint url are promises,
|
|
1120
|
+
* this config is to manually set in memory proxy track calls count limit before promises finished.
|
|
1121
|
+
* Default: 100
|
|
1122
|
+
* @since 3.3.0
|
|
1123
|
+
*/
|
|
1124
|
+
initInMemoMaxSize?: number;
|
|
1078
1125
|
}
|
|
1079
1126
|
|
|
1080
1127
|
interface ICookieMgr {
|