@microsoft/applicationinsights-properties-js 2.8.0-beta.2203-04 → 2.8.0-beta.2203-05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/applicationinsights-properties-js.integrity.json +9 -9
- package/browser/applicationinsights-properties-js.js +85 -16
- package/browser/applicationinsights-properties-js.js.map +1 -1
- package/browser/applicationinsights-properties-js.min.js +2 -2
- package/browser/applicationinsights-properties-js.min.js.map +1 -1
- package/dist/applicationinsights-properties-js.d.ts +1 -1
- package/dist/applicationinsights-properties-js.js +85 -16
- package/dist/applicationinsights-properties-js.js.map +1 -1
- package/dist/applicationinsights-properties-js.min.js +2 -2
- package/dist/applicationinsights-properties-js.min.js.map +1 -1
- package/dist/applicationinsights-properties-js.rollup.d.ts +1 -1
- package/dist-esm/Context/Application.js +1 -1
- package/dist-esm/Context/Device.js +1 -1
- package/dist-esm/Context/Internal.js +2 -2
- package/dist-esm/Context/Internal.js.map +1 -1
- package/dist-esm/Context/Location.js +1 -1
- package/dist-esm/Context/Session.js +1 -1
- package/dist-esm/Context/TelemetryTrace.js +1 -1
- package/dist-esm/Context/User.js +1 -1
- package/dist-esm/Interfaces/IPropTelemetryContext.js +1 -1
- package/dist-esm/Interfaces/ITelemetryConfig.js +1 -1
- package/dist-esm/PropertiesPlugin.js +1 -1
- package/dist-esm/TelemetryContext.js +1 -1
- package/dist-esm/applicationinsights-properties-js.js +1 -1
- package/package.json +3 -3
- package/src/Context/Internal.ts +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "applicationinsights-properties-js",
|
|
3
|
-
"version": "2.8.0-beta.2203-
|
|
3
|
+
"version": "2.8.0-beta.2203-05",
|
|
4
4
|
"ext": {
|
|
5
5
|
"@js": {
|
|
6
6
|
"file": "applicationinsights-properties-js.js",
|
|
7
7
|
"type": "text/javascript; charset=utf-8",
|
|
8
|
-
"integrity": "sha256-
|
|
8
|
+
"integrity": "sha256-YZ48jQOXWKEF6Q2wXkHfkXFB7iLhNl5obXDgcswxCIM= sha384-qFI5jwcgBSTKzdu9vMUG6TR/zHPaK4mI6h7lJvsPOI/4EjxqkU1SLm/cQNSAdcip sha512-+IBPN4C/ZPm6waiQUF1Ucz5JbeJ3Fb+Jqc+3XnVrwdKYh9BYWIPm6jZRb7xr571N8vUDOkgmpGxBaC0/fW/Sjw==",
|
|
9
9
|
"hashes": {
|
|
10
|
-
"sha256": "
|
|
11
|
-
"sha384": "
|
|
12
|
-
"sha512": "
|
|
10
|
+
"sha256": "YZ48jQOXWKEF6Q2wXkHfkXFB7iLhNl5obXDgcswxCIM=",
|
|
11
|
+
"sha384": "qFI5jwcgBSTKzdu9vMUG6TR/zHPaK4mI6h7lJvsPOI/4EjxqkU1SLm/cQNSAdcip",
|
|
12
|
+
"sha512": "+IBPN4C/ZPm6waiQUF1Ucz5JbeJ3Fb+Jqc+3XnVrwdKYh9BYWIPm6jZRb7xr571N8vUDOkgmpGxBaC0/fW/Sjw=="
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"@min.js": {
|
|
16
16
|
"file": "applicationinsights-properties-js.min.js",
|
|
17
17
|
"type": "text/javascript; charset=utf-8",
|
|
18
|
-
"integrity": "sha256-
|
|
18
|
+
"integrity": "sha256-LG8+owGxsqBiaqs4kDxa2q/b7r5bnrNqgmg26s0+vf0= sha384-1lTLSrIaKrv4aQC5CzCSeCcRsURd5zbKkqjACOoc3VAL6GJH2bvVQ8nCjjHo0myX sha512-5qcPNZj2GnDUxQukUikEz4BAtR7RPjjlO884xfewloZAB8mMKALEuR7uDqseiJLpzkmG0fmqz/jJamBtFr+oxw==",
|
|
19
19
|
"hashes": {
|
|
20
|
-
"sha256": "
|
|
21
|
-
"sha384": "
|
|
22
|
-
"sha512": "
|
|
20
|
+
"sha256": "LG8+owGxsqBiaqs4kDxa2q/b7r5bnrNqgmg26s0+vf0=",
|
|
21
|
+
"sha384": "1lTLSrIaKrv4aQC5CzCSeCcRsURd5zbKkqjACOoc3VAL6GJH2bvVQ8nCjjHo0myX",
|
|
22
|
+
"sha512": "5qcPNZj2GnDUxQukUikEz4BAtR7RPjjlO884xfewloZAB8mMKALEuR7uDqseiJLpzkmG0fmqz/jJamBtFr+oxw=="
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Properties Plugin, 2.8.0-beta.2203-
|
|
2
|
+
* Application Insights JavaScript SDK - Properties Plugin, 2.8.0-beta.2203-05
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
(function (global, factory) {
|
|
@@ -327,6 +327,7 @@
|
|
|
327
327
|
var strIsInitialized = "isInitialized";
|
|
328
328
|
var strTeardown = "teardown";
|
|
329
329
|
var strCore = "core";
|
|
330
|
+
var strUpdate = "update";
|
|
330
331
|
var strDisabled = "disabled";
|
|
331
332
|
var strDoTeardown = "_doTeardown";
|
|
332
333
|
|
|
@@ -654,7 +655,7 @@
|
|
|
654
655
|
});
|
|
655
656
|
return objFreeze(enumClass);
|
|
656
657
|
}
|
|
657
|
-
function objExtend(
|
|
658
|
+
function objExtend(obj1, obj2, obj3, obj4, obj5, obj6) {
|
|
658
659
|
var theArgs = arguments;
|
|
659
660
|
var extended = theArgs[0] || {};
|
|
660
661
|
var argLen = theArgs.length;
|
|
@@ -964,6 +965,10 @@
|
|
|
964
965
|
}
|
|
965
966
|
return DiagnosticLogger;
|
|
966
967
|
}());
|
|
968
|
+
function _throwInternal(logger, severity, msgId, msg, properties, isUserAct) {
|
|
969
|
+
if (isUserAct === void 0) { isUserAct = false; }
|
|
970
|
+
(logger || new DiagnosticLogger()).throwInternal(severity, msgId, msg, properties, isUserAct);
|
|
971
|
+
}
|
|
967
972
|
|
|
968
973
|
var strExecutionContextKey = "ctx";
|
|
969
974
|
var PerfEvent = /** @class */ (function () {
|
|
@@ -1290,7 +1295,7 @@
|
|
|
1290
1295
|
completeDetails.func.call(completeDetails.self, completeDetails.args);
|
|
1291
1296
|
}
|
|
1292
1297
|
catch (e) {
|
|
1293
|
-
core.logger
|
|
1298
|
+
_throwInternal(core.logger, 2 , 73 , "Unexpected Exception during onComplete - " + dumpObj(e));
|
|
1294
1299
|
}
|
|
1295
1300
|
});
|
|
1296
1301
|
_onComplete = [];
|
|
@@ -1389,6 +1394,27 @@
|
|
|
1389
1394
|
context.createNew = _createNew;
|
|
1390
1395
|
return context;
|
|
1391
1396
|
}
|
|
1397
|
+
function createProcessTelemetryUpdateContext(telemetryChain, config, core, startAt) {
|
|
1398
|
+
var internalContext = _createInternalContext(telemetryChain, config, core, startAt);
|
|
1399
|
+
var context = internalContext.ctx;
|
|
1400
|
+
function _processNext(updateState) {
|
|
1401
|
+
return context.iterate(function (plugin) {
|
|
1402
|
+
if (isFunction(plugin[strUpdate])) {
|
|
1403
|
+
plugin[strUpdate](context, updateState);
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
function _createNew(plugins, startAt) {
|
|
1408
|
+
if (plugins === void 0) { plugins = null; }
|
|
1409
|
+
if (isArray(plugins)) {
|
|
1410
|
+
plugins = createTelemetryProxyChain(plugins, config, core, startAt);
|
|
1411
|
+
}
|
|
1412
|
+
return createProcessTelemetryUpdateContext(plugins || context.getNext(), config, core, startAt);
|
|
1413
|
+
}
|
|
1414
|
+
context.processNext = _processNext;
|
|
1415
|
+
context.createNew = _createNew;
|
|
1416
|
+
return context;
|
|
1417
|
+
}
|
|
1392
1418
|
function createTelemetryProxyChain(plugins, config, core, startAt) {
|
|
1393
1419
|
var firstProxy = null;
|
|
1394
1420
|
var add = startAt ? false : true;
|
|
@@ -1435,6 +1461,7 @@
|
|
|
1435
1461
|
},
|
|
1436
1462
|
processTelemetry: _processTelemetry,
|
|
1437
1463
|
unload: _unloadPlugin,
|
|
1464
|
+
update: _updatePlugin,
|
|
1438
1465
|
_id: chainId,
|
|
1439
1466
|
_setNext: function (nextPlugin) {
|
|
1440
1467
|
nextProxy = nextPlugin;
|
|
@@ -1474,7 +1501,7 @@
|
|
|
1474
1501
|
hasRun = true;
|
|
1475
1502
|
}
|
|
1476
1503
|
if (!nextProxy || !hasNextRun) {
|
|
1477
|
-
itemCtx.diagLog()
|
|
1504
|
+
_throwInternal(itemCtx.diagLog(), 1 , 73 , "Plugin [" + plugin.identifier + "] failed during " + name + " - " + dumpObj(error) + ", run flags: " + dumpObj(hasRunContext));
|
|
1478
1505
|
}
|
|
1479
1506
|
}
|
|
1480
1507
|
}, details, isAsync);
|
|
@@ -1522,6 +1549,24 @@
|
|
|
1522
1549
|
unloadCtx.processNext(unloadState);
|
|
1523
1550
|
}
|
|
1524
1551
|
}
|
|
1552
|
+
function _updatePlugin(updateCtx, updateState) {
|
|
1553
|
+
function _callUpdate() {
|
|
1554
|
+
var hasRun = false;
|
|
1555
|
+
if (plugin) {
|
|
1556
|
+
var pluginState = _getPluginState(plugin);
|
|
1557
|
+
var pluginCore = plugin[strCore] || pluginState.core;
|
|
1558
|
+
if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
|
|
1559
|
+
if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
|
|
1560
|
+
hasRun = true;
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
return hasRun;
|
|
1565
|
+
}
|
|
1566
|
+
if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
|
|
1567
|
+
updateCtx.processNext(updateState);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1525
1570
|
return objFreeze(proxyChain);
|
|
1526
1571
|
}
|
|
1527
1572
|
|
|
@@ -1691,7 +1736,7 @@
|
|
|
1691
1736
|
_supportsCookies = doc[strCookie] !== undefined;
|
|
1692
1737
|
}
|
|
1693
1738
|
catch (e) {
|
|
1694
|
-
logger
|
|
1739
|
+
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1695
1740
|
}
|
|
1696
1741
|
}
|
|
1697
1742
|
return _supportsCookies;
|
|
@@ -1785,7 +1830,7 @@
|
|
|
1785
1830
|
handler(unloadCtx, unloadState);
|
|
1786
1831
|
}
|
|
1787
1832
|
catch (e) {
|
|
1788
|
-
unloadCtx.diagLog()
|
|
1833
|
+
_throwInternal(unloadCtx.diagLog(), 2 , 73 , "Unexpected error calling unload handler - " + dumpObj(e));
|
|
1789
1834
|
}
|
|
1790
1835
|
});
|
|
1791
1836
|
handlers = [];
|
|
@@ -1844,6 +1889,30 @@
|
|
|
1844
1889
|
}
|
|
1845
1890
|
return result;
|
|
1846
1891
|
};
|
|
1892
|
+
_self.update = function (updateCtx, updateState) {
|
|
1893
|
+
if (!_self.core || (updateCtx && _self.core !== updateCtx.core())) {
|
|
1894
|
+
return;
|
|
1895
|
+
}
|
|
1896
|
+
var result;
|
|
1897
|
+
var updateDone = false;
|
|
1898
|
+
var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, {}, _self.core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
|
1899
|
+
var theUpdateState = updateState || {
|
|
1900
|
+
reason: 0
|
|
1901
|
+
};
|
|
1902
|
+
function _updateCallback() {
|
|
1903
|
+
if (!updateDone) {
|
|
1904
|
+
updateDone = true;
|
|
1905
|
+
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx.getNext());
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
|
1909
|
+
_updateCallback();
|
|
1910
|
+
}
|
|
1911
|
+
else {
|
|
1912
|
+
result = true;
|
|
1913
|
+
}
|
|
1914
|
+
return result;
|
|
1915
|
+
};
|
|
1847
1916
|
_self._addHook = function (hooks) {
|
|
1848
1917
|
if (hooks) {
|
|
1849
1918
|
if (isArray(hooks)) {
|
|
@@ -2045,7 +2114,7 @@
|
|
|
2045
2114
|
name = strTrim(name.toString());
|
|
2046
2115
|
if (name.length > 150 ) {
|
|
2047
2116
|
nameTrunc = name.substring(0, 150 );
|
|
2048
|
-
logger
|
|
2117
|
+
_throwInternal(logger, 2 , _InternalMessageId.NameTooLong, "name is too long. It has been truncated to " + 150 + " characters.", { name: name }, true);
|
|
2049
2118
|
}
|
|
2050
2119
|
}
|
|
2051
2120
|
return nameTrunc || name;
|
|
@@ -2058,7 +2127,7 @@
|
|
|
2058
2127
|
value = strTrim(value);
|
|
2059
2128
|
if (value.toString().length > maxLength) {
|
|
2060
2129
|
valueTrunc = value.toString().substring(0, maxLength);
|
|
2061
|
-
logger
|
|
2130
|
+
_throwInternal(logger, 2 , _InternalMessageId.StringValueTooLong, "string value is too long. It has been truncated to " + maxLength + " characters.", { value: value }, true);
|
|
2062
2131
|
}
|
|
2063
2132
|
}
|
|
2064
2133
|
return valueTrunc || value;
|
|
@@ -2075,7 +2144,7 @@
|
|
|
2075
2144
|
value = getJSON().stringify(value);
|
|
2076
2145
|
}
|
|
2077
2146
|
catch (e) {
|
|
2078
|
-
logger
|
|
2147
|
+
_throwInternal(logger, 2 , _InternalMessageId.CannotSerializeObjectNonSerializable, "custom property is not valid", { exception: e }, true);
|
|
2079
2148
|
}
|
|
2080
2149
|
}
|
|
2081
2150
|
value = dataSanitizeString(logger, value, 8192 );
|
|
@@ -2106,7 +2175,7 @@
|
|
|
2106
2175
|
input = strTrim(input);
|
|
2107
2176
|
if (input.length > maxLength) {
|
|
2108
2177
|
inputTrunc = input.substring(0, maxLength);
|
|
2109
|
-
logger
|
|
2178
|
+
_throwInternal(logger, 2 , _msgId, "input is too long, it has been truncated to " + maxLength + " characters.", { data: input }, true);
|
|
2110
2179
|
}
|
|
2111
2180
|
}
|
|
2112
2181
|
return inputTrunc || input;
|
|
@@ -2181,8 +2250,8 @@
|
|
|
2181
2250
|
}
|
|
2182
2251
|
return null;
|
|
2183
2252
|
}
|
|
2184
|
-
function utlCanUseLocalStorage() {
|
|
2185
|
-
if (_canUseLocalStorage === undefined) {
|
|
2253
|
+
function utlCanUseLocalStorage(reset) {
|
|
2254
|
+
if (reset || _canUseLocalStorage === undefined) {
|
|
2186
2255
|
_canUseLocalStorage = !!_getVerifiedStorageObject(StorageType.LocalStorage);
|
|
2187
2256
|
}
|
|
2188
2257
|
return _canUseLocalStorage;
|
|
@@ -2195,7 +2264,7 @@
|
|
|
2195
2264
|
}
|
|
2196
2265
|
catch (e) {
|
|
2197
2266
|
_canUseLocalStorage = false;
|
|
2198
|
-
logger
|
|
2267
|
+
_throwInternal(logger, 2 , _InternalMessageId.BrowserCannotReadLocalStorage, "Browser failed read of local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2199
2268
|
}
|
|
2200
2269
|
}
|
|
2201
2270
|
return null;
|
|
@@ -2209,7 +2278,7 @@
|
|
|
2209
2278
|
}
|
|
2210
2279
|
catch (e) {
|
|
2211
2280
|
_canUseLocalStorage = false;
|
|
2212
|
-
logger
|
|
2281
|
+
_throwInternal(logger, 2 , _InternalMessageId.BrowserCannotWriteLocalStorage, "Browser failed write to local storage. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2213
2282
|
}
|
|
2214
2283
|
}
|
|
2215
2284
|
return false;
|
|
@@ -2223,7 +2292,7 @@
|
|
|
2223
2292
|
}
|
|
2224
2293
|
catch (e) {
|
|
2225
2294
|
_canUseLocalStorage = false;
|
|
2226
|
-
logger
|
|
2295
|
+
_throwInternal(logger, 2 , _InternalMessageId.BrowserFailedRemovalFromLocalStorage, "Browser failed removal of local storage item. " + getExceptionName(e), { exception: dumpObj(e) });
|
|
2227
2296
|
}
|
|
2228
2297
|
}
|
|
2229
2298
|
return false;
|
|
@@ -2525,7 +2594,7 @@
|
|
|
2525
2594
|
return Device;
|
|
2526
2595
|
}());
|
|
2527
2596
|
|
|
2528
|
-
var Version = "2.8.0-beta.2203-
|
|
2597
|
+
var Version = "2.8.0-beta.2203-05";
|
|
2529
2598
|
var Internal = /** @class */ (function () {
|
|
2530
2599
|
function Internal(config) {
|
|
2531
2600
|
this.sdkVersion = (config.sdkExtension && config.sdkExtension() ? config.sdkExtension() + "_" : "") + "javascript:" + Version;
|