This commit is contained in:
21
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/LICENSE.TXT
generated
vendored
Normal file
21
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/LICENSE.TXT
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
17
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/NOTICE
generated
vendored
Normal file
17
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/NOTICE
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
NOTICES AND INFORMATION
|
||||
Do Not Translate or Localize
|
||||
|
||||
This software incorporates material from third parties. Microsoft makes certain
|
||||
open source code available at https://3rdpartysource.microsoft.com, or you may
|
||||
send a check or money order for US $5.00, including the product name, the open
|
||||
source component name, and version number, to:
|
||||
|
||||
Source Code Compliance Team
|
||||
Microsoft Corporation
|
||||
One Microsoft Way
|
||||
Redmond, WA 98052
|
||||
USA
|
||||
|
||||
Notwithstanding any other terms, you may reverse engineer this software to the
|
||||
extent required to debug changes to any libraries licensed under the GNU Lesser
|
||||
General Public License.
|
3
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/PRIVACY
generated
vendored
Normal file
3
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/PRIVACY
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Data Collection
|
||||
|
||||
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
|
41
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/SECURITY.md
generated
vendored
Normal file
41
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
5399
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.gbl.js
generated
vendored
Normal file
5399
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.gbl.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.gbl.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.gbl.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.integrity.json
generated
vendored
Normal file
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.integrity.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "ms.core",
|
||||
"version": "3.2.13",
|
||||
"ext": {
|
||||
"@gbl.js": {
|
||||
"file": "ms.core-3.2.13.gbl.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-hrj3aEc/8yLk/6a2QamyNx46xH+czKkG06AVCowf6S8= sha384-yjPkFSpWimv9vfhBQOF7/Jbx+Ug+Gqn3pzPo8zrIFX+CH55Te905V6oMf+JhB36M sha512-ugPZgkyOItqNy+kr0u0dJfysOeKZq/jmo+hxECoRQYNcpqpDInMeRLbnr1fg4AxPcsRLp86TxOrha7C4oI93eA==",
|
||||
"hashes": {
|
||||
"sha256": "hrj3aEc/8yLk/6a2QamyNx46xH+czKkG06AVCowf6S8=",
|
||||
"sha384": "yjPkFSpWimv9vfhBQOF7/Jbx+Ug+Gqn3pzPo8zrIFX+CH55Te905V6oMf+JhB36M",
|
||||
"sha512": "ugPZgkyOItqNy+kr0u0dJfysOeKZq/jmo+hxECoRQYNcpqpDInMeRLbnr1fg4AxPcsRLp86TxOrha7C4oI93eA=="
|
||||
}
|
||||
},
|
||||
"@gbl.min.js": {
|
||||
"file": "ms.core-3.2.13.gbl.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-MoIf0DgYZ/AoT/B+I+9gsplL7EUxhb9qG3vXD7xBpYA= sha384-we4PyUnTdrDTMgspeVAqLdB9fYHXJ/TA6wUXlPT3nFtDrr7Mbr1/b3x0wvYeU/86 sha512-g8d24suP94QufU9mQ0v/K+BMPM3ryKEmL+f8ND6oxUe74QvueCEeITTBOfdmWz77dLgHyknhwOxvmoiMRnomEg==",
|
||||
"hashes": {
|
||||
"sha256": "MoIf0DgYZ/AoT/B+I+9gsplL7EUxhb9qG3vXD7xBpYA=",
|
||||
"sha384": "we4PyUnTdrDTMgspeVAqLdB9fYHXJ/TA6wUXlPT3nFtDrr7Mbr1/b3x0wvYeU/86",
|
||||
"sha512": "g8d24suP94QufU9mQ0v/K+BMPM3ryKEmL+f8ND6oxUe74QvueCEeITTBOfdmWz77dLgHyknhwOxvmoiMRnomEg=="
|
||||
}
|
||||
},
|
||||
"@js": {
|
||||
"file": "ms.core-3.2.13.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-tPdJyun7XDf9601yMjNubMzElE3ZnhQ71d956igTX4U= sha384-2lpmayJeEZ0oV+GREsg/LrVbAVfwiZa2PPwIM9N/AVWkhsNyrCq9X9rMcRMwiWpl sha512-Elb90mM/llKDWWtUmizBn8GBe70RKnVDmywckEuSdPAUL5LYmJnZszBbLgKIYgw0tt2xfzWuak5UZsxv4pYNZQ==",
|
||||
"hashes": {
|
||||
"sha256": "tPdJyun7XDf9601yMjNubMzElE3ZnhQ71d956igTX4U=",
|
||||
"sha384": "2lpmayJeEZ0oV+GREsg/LrVbAVfwiZa2PPwIM9N/AVWkhsNyrCq9X9rMcRMwiWpl",
|
||||
"sha512": "Elb90mM/llKDWWtUmizBn8GBe70RKnVDmywckEuSdPAUL5LYmJnZszBbLgKIYgw0tt2xfzWuak5UZsxv4pYNZQ=="
|
||||
}
|
||||
},
|
||||
"@min.js": {
|
||||
"file": "ms.core-3.2.13.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-imVKRXCOImM1k7gDBDMgJgVXyT71d2L2Nq25NJtU4Ww= sha384-eedN2D/0y5+mR7ymlmdN82zfLmD7JUS5PSNTxtWgp1MtWY3Tu2GnGORKeP0ApRlW sha512-SuJWufVn1uxsDDGUSFljJFiKOBo+GDdiI8LbInrSTWQJaF7/EsGOvlbYOFdjD9F09eG7T9RJDWbJQLgdeDKenQ==",
|
||||
"hashes": {
|
||||
"sha256": "imVKRXCOImM1k7gDBDMgJgVXyT71d2L2Nq25NJtU4Ww=",
|
||||
"sha384": "eedN2D/0y5+mR7ymlmdN82zfLmD7JUS5PSNTxtWgp1MtWY3Tu2GnGORKeP0ApRlW",
|
||||
"sha512": "SuJWufVn1uxsDDGUSFljJFiKOBo+GDdiI8LbInrSTWQJaF7/EsGOvlbYOFdjD9F09eG7T9RJDWbJQLgdeDKenQ=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5403
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.js
generated
vendored
Normal file
5403
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core-3.2.13.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5399
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.gbl.js
generated
vendored
Normal file
5399
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.gbl.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.gbl.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.gbl.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.integrity.json
generated
vendored
Normal file
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.integrity.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "ms.core",
|
||||
"version": "3.2.13",
|
||||
"ext": {
|
||||
"@gbl.js": {
|
||||
"file": "ms.core.gbl.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-BwR6jNrPGXc18+9IHo5jDnPlqKkL5ChEMk+QY6h//mE= sha384-Nj/STc7XPBTlIhiybRZzF7LNzXC0KJP0sXL+645GID3l/6KEQTbIdoF0yVMeLyrc sha512-XMYRVgzSdybr4gkAfeO5cpKcDdFMPfb4LoyxOvMYN4OXHO754GB1Ihas59F+GSFCZnY1p73TZd094gC/oxN6Sw==",
|
||||
"hashes": {
|
||||
"sha256": "BwR6jNrPGXc18+9IHo5jDnPlqKkL5ChEMk+QY6h//mE=",
|
||||
"sha384": "Nj/STc7XPBTlIhiybRZzF7LNzXC0KJP0sXL+645GID3l/6KEQTbIdoF0yVMeLyrc",
|
||||
"sha512": "XMYRVgzSdybr4gkAfeO5cpKcDdFMPfb4LoyxOvMYN4OXHO754GB1Ihas59F+GSFCZnY1p73TZd094gC/oxN6Sw=="
|
||||
}
|
||||
},
|
||||
"@gbl.min.js": {
|
||||
"file": "ms.core.gbl.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-3hFJEJamdjnwJYtZI+xTx/MHkftniWPAsFQvlyNh1eU= sha384-d1vX4ayrjC6szMmzIEUpTdLCnaOxTjupsnSe6HxX1JSPf776SXJVTvVk6mYwj50a sha512-rFqHAExS4N3jgx8oL5+WGPGUV/gUNiKyK/tivjmBKgUScPLf1GTsW2ZC/pPoNt7TEwKYN3kHHdFn81qRMFzpug==",
|
||||
"hashes": {
|
||||
"sha256": "3hFJEJamdjnwJYtZI+xTx/MHkftniWPAsFQvlyNh1eU=",
|
||||
"sha384": "d1vX4ayrjC6szMmzIEUpTdLCnaOxTjupsnSe6HxX1JSPf776SXJVTvVk6mYwj50a",
|
||||
"sha512": "rFqHAExS4N3jgx8oL5+WGPGUV/gUNiKyK/tivjmBKgUScPLf1GTsW2ZC/pPoNt7TEwKYN3kHHdFn81qRMFzpug=="
|
||||
}
|
||||
},
|
||||
"@js": {
|
||||
"file": "ms.core.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-4qFs9p/3IrPrw0cfhq+9LdHy9GdaPdP+30tZz0afppc= sha384-JrTyrTiWBL8rZxOAOnaBUwewbOLCLsOwp6h9mZjhQ96ptJqLUE3514eEPGzlUIG5 sha512-P2ZcFB5lyIZIU2rrJ5HzIZP9tgYWOMYKHUSJuEUXqIn8O7UG4pWAjrFjo2kVYfWs5Cn5P1iQn0QjJw2I+zoCNg==",
|
||||
"hashes": {
|
||||
"sha256": "4qFs9p/3IrPrw0cfhq+9LdHy9GdaPdP+30tZz0afppc=",
|
||||
"sha384": "JrTyrTiWBL8rZxOAOnaBUwewbOLCLsOwp6h9mZjhQ96ptJqLUE3514eEPGzlUIG5",
|
||||
"sha512": "P2ZcFB5lyIZIU2rrJ5HzIZP9tgYWOMYKHUSJuEUXqIn8O7UG4pWAjrFjo2kVYfWs5Cn5P1iQn0QjJw2I+zoCNg=="
|
||||
}
|
||||
},
|
||||
"@min.js": {
|
||||
"file": "ms.core.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-Vn553W5O3KE8MhUaNuKtKxn5BX5k8NbVwN7jq+yEfNM= sha384-cdMEHsNq2ha1zTzuZt/advMl+9mHqBzXkeFu0ZbuR4Uy5y6UYmqH3CLZmNtnmdfQ sha512-5STxYGO4vREX7IfMuHv53VUF1/WVjePOq5IeNUrtijdLQiW3B5bN+YKOOs+CmA+/0oykFSZec3fC00jvpjCE3Q==",
|
||||
"hashes": {
|
||||
"sha256": "Vn553W5O3KE8MhUaNuKtKxn5BX5k8NbVwN7jq+yEfNM=",
|
||||
"sha384": "cdMEHsNq2ha1zTzuZt/advMl+9mHqBzXkeFu0ZbuR4Uy5y6UYmqH3CLZmNtnmdfQ",
|
||||
"sha512": "5STxYGO4vREX7IfMuHv53VUF1/WVjePOq5IeNUrtijdLQiW3B5bN+YKOOs+CmA+/0oykFSZec3fC00jvpjCE3Q=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5403
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.js
generated
vendored
Normal file
5403
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/bundle/ms.core.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
113
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/AppInsightsCore.js
generated
vendored
Normal file
113
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/AppInsightsCore.js
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
||||
/**
|
||||
* AppInsightsCore.ts
|
||||
* @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)
|
||||
* @copyright Microsoft 2018
|
||||
*/
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { AppInsightsCore as InternalCore, DiagnosticLogger, _throwInternal, arrForEach, doPerf, dumpObj, throwError } from "@microsoft/applicationinsights-core-js";
|
||||
import { STR_DEFAULT_ENDPOINT_URL, STR_EMPTY, STR_PROPERTIES, STR_VERSION } from "./InternalConstants";
|
||||
import { FullVersionString, getTime, isLatency } from "./Utils";
|
||||
var AppInsightsCore = /** @class */ (function (_super) {
|
||||
__extends(AppInsightsCore, _super);
|
||||
function AppInsightsCore() {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.pluginVersionStringArr = [];
|
||||
dynamicProto(AppInsightsCore, _this, function (_self, _base) {
|
||||
if (!_self.logger || !_self.logger.queue) {
|
||||
// The AI Base can inject a No-Op logger so if not defined or the No-Op, change to use a default logger so initialization errors
|
||||
// are not dropped on the floor if one is not already defined
|
||||
_self.logger = new DiagnosticLogger({ loggingLevelConsole: 1 /* eLoggingSeverity.CRITICAL */ });
|
||||
}
|
||||
_self.initialize = function (config, extensions, logger, notificationManager) {
|
||||
doPerf(_self, function () { return "AppInsightsCore.initialize"; }, function () {
|
||||
var _pluginVersionStringArr = _self.pluginVersionStringArr;
|
||||
// Add default collector url
|
||||
if (config) {
|
||||
if (!config.endpointUrl) {
|
||||
config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
|
||||
}
|
||||
var propertyStorageOverride = config.propertyStorageOverride;
|
||||
// Validate property storage override
|
||||
if (propertyStorageOverride && (!propertyStorageOverride.getProperty || !propertyStorageOverride.setProperty)) {
|
||||
throwError("Invalid property storage override passed.");
|
||||
}
|
||||
if (config.channels) {
|
||||
arrForEach(config.channels, function (channels) {
|
||||
if (channels) {
|
||||
arrForEach(channels, function (channel) {
|
||||
if (channel.identifier && channel.version) {
|
||||
var ver = channel.identifier + "=" + channel.version;
|
||||
_pluginVersionStringArr.push(ver);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
_self.getWParam = function () {
|
||||
return (typeof document !== "undefined" || !!config.enableWParam) ? 0 : -1;
|
||||
};
|
||||
if (extensions) {
|
||||
arrForEach(extensions, function (ext) {
|
||||
if (ext && ext.identifier && ext.version) {
|
||||
var ver = ext.identifier + "=" + ext.version;
|
||||
_pluginVersionStringArr.push(ver);
|
||||
}
|
||||
});
|
||||
}
|
||||
_self.pluginVersionString = _pluginVersionStringArr.join(";");
|
||||
_self.pluginVersionStringArr = _pluginVersionStringArr;
|
||||
try {
|
||||
_base.initialize(config, extensions, logger, notificationManager);
|
||||
_self.pollInternalLogs("InternalLog");
|
||||
}
|
||||
catch (e) {
|
||||
var logger_1 = _self.logger;
|
||||
var message = dumpObj(e);
|
||||
if (message.indexOf("channels") !== -1) {
|
||||
// Add some additional context to the underlying reported error
|
||||
message += "\n - Channels must be provided through config.channels only!";
|
||||
}
|
||||
_throwInternal(logger_1, 1 /* eLoggingSeverity.CRITICAL */, 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */, "SDK Initialization Failed - no telemetry will be sent: " + message);
|
||||
}
|
||||
}, function () { return ({ config: config, extensions: extensions, logger: logger, notificationManager: notificationManager }); });
|
||||
};
|
||||
_self.track = function (item) {
|
||||
doPerf(_self, function () { return "AppInsightsCore.track"; }, function () {
|
||||
var telemetryItem = item;
|
||||
if (telemetryItem) {
|
||||
telemetryItem.timings = telemetryItem.timings || {};
|
||||
telemetryItem.timings.trackStart = getTime();
|
||||
if (!isLatency(telemetryItem.latency)) {
|
||||
telemetryItem.latency = 1 /* EventLatencyValue.Normal */;
|
||||
}
|
||||
var itemExt = telemetryItem.ext = telemetryItem.ext || {};
|
||||
itemExt.sdk = itemExt.sdk || {};
|
||||
itemExt.sdk.ver = FullVersionString;
|
||||
var baseData = telemetryItem.baseData = telemetryItem.baseData || {};
|
||||
baseData[STR_PROPERTIES] = baseData[STR_PROPERTIES] || {};
|
||||
var itemProperties = baseData[STR_PROPERTIES];
|
||||
itemProperties[STR_VERSION] = itemProperties[STR_VERSION] || _self.pluginVersionString || STR_EMPTY;
|
||||
}
|
||||
_base.track(telemetryItem);
|
||||
}, function () { return ({ item: item }); }, !(item.sync));
|
||||
};
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
// Removed Stub for AppInsightsCore.prototype.initialize.
|
||||
// Removed Stub for AppInsightsCore.prototype.track.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
AppInsightsCore.__ieDyn=1;
|
||||
|
||||
return AppInsightsCore;
|
||||
}(InternalCore));
|
||||
export default AppInsightsCore;
|
59
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/BaseCore.js
generated
vendored
Normal file
59
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/BaseCore.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
||||
/**
|
||||
* BaseCore.ts
|
||||
* Base Core is a subset of 1DS Web SDK Core. The purpose of Base Core is to generate a smaller bundle size while providing essential features of Core. Features that are not included in Base Core are:
|
||||
* 1. Internal logging
|
||||
* 2. Sending notifications on telemetry sent/discarded
|
||||
* @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)
|
||||
* @copyright Microsoft 2018
|
||||
*/
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { BaseCore as InternalCore, _throwInternal, dumpObj } from "@microsoft/applicationinsights-core-js";
|
||||
import { STR_DEFAULT_ENDPOINT_URL } from "./InternalConstants";
|
||||
import { FullVersionString, isDocumentObjectAvailable } from "./Utils";
|
||||
var BaseCore = /** @class */ (function (_super) {
|
||||
__extends(BaseCore, _super);
|
||||
function BaseCore() {
|
||||
var _this = _super.call(this) || this;
|
||||
dynamicProto(BaseCore, _this, function (_self, _base) {
|
||||
_self.initialize = function (config, extensions, logger, notificationManager) {
|
||||
if (config && !config.endpointUrl) {
|
||||
config.endpointUrl = STR_DEFAULT_ENDPOINT_URL;
|
||||
}
|
||||
_self.getWParam = function () {
|
||||
return (isDocumentObjectAvailable || !!config.enableWParam) ? 0 : -1;
|
||||
};
|
||||
try {
|
||||
_base.initialize(config, extensions, logger, notificationManager);
|
||||
}
|
||||
catch (e) {
|
||||
_throwInternal(_self.logger, 1 /* eLoggingSeverity.CRITICAL */, 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */, "Initialization Failed: " + dumpObj(e) + "\n - Note: Channels must be provided through config.channels only");
|
||||
}
|
||||
};
|
||||
_self.track = function (item) {
|
||||
var telemetryItem = item;
|
||||
if (telemetryItem) {
|
||||
var ext = telemetryItem.ext = telemetryItem.ext || {};
|
||||
ext.sdk = ext.sdk || {};
|
||||
ext.sdk.ver = FullVersionString;
|
||||
}
|
||||
_base.track(telemetryItem);
|
||||
};
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
// Removed Stub for BaseCore.prototype.initialize.
|
||||
// Removed Stub for BaseCore.prototype.track.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
BaseCore.__ieDyn=1;
|
||||
|
||||
return BaseCore;
|
||||
}(InternalCore));
|
||||
export default BaseCore;
|
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/DataModels.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/DataModels.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
export {};
|
285
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/ESPromise.js
generated
vendored
Normal file
285
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/ESPromise.js
generated
vendored
Normal file
@ -0,0 +1,285 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* ESPromise.ts
|
||||
* @author Nev Wylie (newylie))
|
||||
* @copyright Microsoft 2019
|
||||
* Simplified wrapper to provide ES6 style Promise callback handling for older browsers
|
||||
*/
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { isFunction } from "@microsoft/applicationinsights-core-js";
|
||||
/**
|
||||
* @ignore -- Don't include in the generated documentation
|
||||
* Using a local variable to assist with minfication
|
||||
*/
|
||||
var _isFunction = isFunction;
|
||||
/**
|
||||
* @ignore -- Don't include in the generated documentation
|
||||
* This function will be used as onFulfilled handler for any Promise found in the iterable passed to Promise.all.
|
||||
* The goal here is to capture in a closure the index of the current item from the iterable. If we did not create
|
||||
* this closure, the captured index variable would be the same one that the for loop updates and thus would always
|
||||
* be pointing to the last index in the iterable by the time that the onFulfilled handler is called.
|
||||
* However, note that for the resolvedCallback callback we want the opposite. For this one we do want to capture
|
||||
* the same variable that the for loop updates so that we have the full count of pending promises by the time
|
||||
* the onFulfilled handlers start getting called.
|
||||
* @param values The resolving promise values
|
||||
* @param index The index of this callback function
|
||||
* @param resolvedCallback THe callback function used to check if the "all" promise is complete
|
||||
*/
|
||||
function _createPromiseAllOnResolvedFunction(values, index, resolvedCallback) {
|
||||
return function (value) {
|
||||
values[index] = value;
|
||||
resolvedCallback();
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Simplified wrapper to provide ES6 style Promise callback handling for older browsers
|
||||
*/
|
||||
var ESPromise = /** @class */ (function () {
|
||||
/**
|
||||
* The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.
|
||||
* @param resolverFunc A function that is passed with the arguments resolve and reject. The executor function is executed
|
||||
* immediately by the Promise implementation, passing resolve and reject functions (the executor is called before the Promise
|
||||
* constructor even returns the created object). The resolve and reject functions, when called, resolve or reject the promise,
|
||||
* respectively. The executor normally initiates some asynchronous work, and then, once that completes, either calls the resolve
|
||||
* function to resolve the promise or else rejects it if an error occurred. If an error is thrown in the executor function, the
|
||||
* promise is rejected. The return value of the executor is ignored.
|
||||
*/
|
||||
function ESPromise(resolverFunc) {
|
||||
var _state = 0 /* PromiseState.Pending */;
|
||||
var _settledValue = null;
|
||||
var _queue = [];
|
||||
dynamicProto(ESPromise, this, function (_this) {
|
||||
_this.then = function (onResolved, onRejected) {
|
||||
return new ESPromise(function (resolve, reject) {
|
||||
// Queue the new promise returned to be resolved or rejected
|
||||
// when this promise settles.
|
||||
_enqueue(onResolved, onRejected, resolve, reject);
|
||||
});
|
||||
};
|
||||
_this["catch"] = function (onRejected) {
|
||||
return _this.then(null, onRejected);
|
||||
};
|
||||
});
|
||||
function _enqueue(onResolved, onRejected, resolve, reject) {
|
||||
_queue.push(function () {
|
||||
var value;
|
||||
try {
|
||||
// First call the onFulfilled or onRejected handler, on the settled value
|
||||
// of this promise. If the corresponding handler does not exist, simply
|
||||
// pass through the settled value.
|
||||
if (_state === 1 /* PromiseState.Resolved */) {
|
||||
value = _isFunction(onResolved) ? onResolved(_settledValue) : _settledValue;
|
||||
}
|
||||
else {
|
||||
value = _isFunction(onRejected) ? onRejected(_settledValue) : _settledValue;
|
||||
}
|
||||
if (value instanceof ESPromise) {
|
||||
// The called handlers returned a new promise, so the chained promise
|
||||
// will follow the state of this promise.
|
||||
value.then(resolve, reject);
|
||||
}
|
||||
else if (_state === 2 /* PromiseState.Rejected */ && !_isFunction(onRejected)) {
|
||||
// If there wasn't an onRejected handler and this promise is rejected, then
|
||||
// the chained promise also rejects with the same reason.
|
||||
reject(value);
|
||||
}
|
||||
else {
|
||||
// If this promise is fulfilled, then the chained promise is also fulfilled
|
||||
// with either the settled value of this promise (if no onFulfilled handler
|
||||
// was available) or the return value of the handler. If this promise is
|
||||
// rejected and there was an onRejected handler, then the chained promise is
|
||||
// fulfilled with the return value of the handler.
|
||||
resolve(value);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
// The chained promise will reject if there is any exception thrown while
|
||||
// calling the onFulfilled or onRejected handlers.
|
||||
reject(error);
|
||||
return;
|
||||
}
|
||||
});
|
||||
// If this promise is already settled, then immediately process the callback we
|
||||
// just added to the queue.
|
||||
if (_state !== 0 /* PromiseState.Pending */) {
|
||||
_processQueue();
|
||||
}
|
||||
}
|
||||
function _processQueue() {
|
||||
if (_queue.length > 0) {
|
||||
// The onFulfilled and onRejected handlers must be called asynchronously. Thus,
|
||||
// we make a copy of the queue and work on it once the current call stack unwinds.
|
||||
var pending_1 = _queue.slice();
|
||||
_queue = [];
|
||||
setTimeout(function () {
|
||||
for (var i = 0, len = pending_1.length; i < len; ++i) {
|
||||
try {
|
||||
pending_1[i]();
|
||||
}
|
||||
catch (e) {
|
||||
// Don't let 1 failing handler break all others
|
||||
// TODO (newylie): Add some form of error reporting (i.e. Call any registered JS error handler so the error is reported)
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
function _resolve(value) {
|
||||
if (_state === 0 /* PromiseState.Pending */) {
|
||||
_settledValue = value;
|
||||
_state = 1 /* PromiseState.Resolved */;
|
||||
_processQueue();
|
||||
}
|
||||
}
|
||||
function _reject(reason) {
|
||||
if (_state === 0 /* PromiseState.Pending */) {
|
||||
_settledValue = reason;
|
||||
_state = 2 /* PromiseState.Rejected */;
|
||||
_processQueue();
|
||||
}
|
||||
}
|
||||
(function _initialize() {
|
||||
if (!_isFunction(resolverFunc)) {
|
||||
throw new TypeError("ESPromise: resolvedFunc argument is not a Function");
|
||||
}
|
||||
try {
|
||||
resolverFunc(_resolve, _reject);
|
||||
}
|
||||
catch (error) {
|
||||
// This promise will immediately reject if any exception is thrown
|
||||
// from within the executor function.
|
||||
_reject(error);
|
||||
}
|
||||
})();
|
||||
}
|
||||
/**
|
||||
* The Promise.resolve() method returns a Promise object that is resolved with a given value. If the value is a promise, that promise is returned;
|
||||
* if the value is a thenable (i.e. has a "then" method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise
|
||||
* the returned promise will be fulfilled with the value. This function flattens nested layers of promise-like objects (e.g. a promise that resolves
|
||||
* to a promise that resolves to something) into a single layer.
|
||||
* @param value Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve.
|
||||
*/
|
||||
ESPromise.resolve = function (value) {
|
||||
if (value instanceof ESPromise) {
|
||||
// Value is a Promise so just return it
|
||||
return value;
|
||||
}
|
||||
else if (value && _isFunction(value.then)) {
|
||||
// Value looks like a promise or thenable (has a then function)
|
||||
return new ESPromise(function (resolve, reject) {
|
||||
try {
|
||||
value.then(resolve, reject);
|
||||
}
|
||||
catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
return new ESPromise(function (resolve) {
|
||||
resolve(value);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* The Promise.reject() method returns a Promise object that is rejected with a given reason.
|
||||
* @param reason The reason why this Promise rejected.
|
||||
*/
|
||||
ESPromise.reject = function (reason) {
|
||||
return new ESPromise(function (resolve, reject) {
|
||||
reject(reason);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* The Promise.all() method returns a single Promise that resolves when all of the promises passed as an iterable
|
||||
* have resolved or when the iterable contains no promises. It rejects with the reason of the first promise that
|
||||
* rejects. There is no implied ordering in the execution of the array of Promises given. On some computers, they
|
||||
* may be executed in parallel, or in some sense concurrently, while on others they may be executed serially. For
|
||||
* this reason, there must be no dependency in any Promise on the order of execution of the Promises.
|
||||
* This method can be useful for aggregating the results of multiple promises.
|
||||
* FulfillmentSection - The returned promise is fulfilled with an array containing all the values of the iterable
|
||||
* passed as argument (also non-promise values).
|
||||
* If an empty iterable is passed, then this method returns (synchronously) an already resolved promise.
|
||||
* If all of the passed-in promises fulfill, or are not promises, the promise returned by Promise.all is fulfilled
|
||||
* asynchronously.
|
||||
* RejectionSection - If any of the passed-in promises reject, Promise.all asynchronously rejects with the value of
|
||||
* the promise that rejected, whether or not the other promises have resolved.
|
||||
* @param iterable
|
||||
*/
|
||||
ESPromise.all = function (iterable) {
|
||||
if (!iterable || !iterable.length) {
|
||||
return;
|
||||
}
|
||||
return new ESPromise(function (resolve, reject) {
|
||||
try {
|
||||
var values_1 = [];
|
||||
var pending_2 = 0;
|
||||
for (var lp = 0; lp < iterable.length; lp++) {
|
||||
var item = iterable[lp];
|
||||
// Quick and direct check for a Promise (will also catch a thenable)
|
||||
if (item && _isFunction(item.then)) {
|
||||
pending_2++;
|
||||
item.then(_createPromiseAllOnResolvedFunction(values_1, lp, function () {
|
||||
if (--pending_2 === 0) {
|
||||
resolve(values_1);
|
||||
}
|
||||
}), reject);
|
||||
}
|
||||
else {
|
||||
values_1[lp] = item;
|
||||
}
|
||||
}
|
||||
if (pending_2 === 0) {
|
||||
// All promises were either resolved or where not a promise
|
||||
setTimeout(function () {
|
||||
resolve(values_1);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* The race function returns a Promise that is settled the same way (and takes the same value) as the first promise
|
||||
* that settles amongst the promises of the iterable passed as an argument.
|
||||
* If the iterable passed is empty, the promise returned will be forever pending.
|
||||
* If the iterable contains one or more non-promise value and/or an already settled promise, then Promise.race will
|
||||
* resolve to the first of these values found in the iterable.
|
||||
* @param iterable
|
||||
*/
|
||||
ESPromise.race = function (iterable) {
|
||||
return new ESPromise(function (resolve, reject) {
|
||||
if (!iterable || !iterable.length) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
var _loop_1 = function (lp) {
|
||||
var item = iterable[lp];
|
||||
// Quick and direct check for a Promise (will also catch a thenable)
|
||||
if (item && _isFunction(item.then)) {
|
||||
item.then(resolve, reject);
|
||||
}
|
||||
else {
|
||||
setTimeout(function () {
|
||||
resolve(item);
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
for (var lp = 0; lp < iterable.length; lp++) {
|
||||
_loop_1(lp);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
// Removed Stub for ESPromise.prototype.then.
|
||||
// Removed Stub for ESPromise.prototype["catch"].
|
||||
return ESPromise;
|
||||
}());
|
||||
export default ESPromise;
|
273
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/ESPromiseScheduler.js
generated
vendored
Normal file
273
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/ESPromiseScheduler.js
generated
vendored
Normal file
@ -0,0 +1,273 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* ESPromiseScheduler.ts
|
||||
* @author Nev Wylie (newylie)
|
||||
* @copyright Microsoft 2019
|
||||
*/
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import ESPromise from "./ESPromise";
|
||||
import { _warnToConsole, getGlobal } from "@microsoft/applicationinsights-core-js";
|
||||
/** This is a default timeout that will cause outstanding running promises to be removed/rejected to avoid filling up memory with blocked events */
|
||||
var LazyRejectPeriod = 600000; // 10 Minutes
|
||||
// These are global variables that are shared across ALL instances of the scheduler
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
var _schedulerId = 0;
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
var _running = [];
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
var _waiting = [];
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
var _timedOut = [];
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _getTime() {
|
||||
return new Date().getTime();
|
||||
}
|
||||
/**
|
||||
* Provides a simple mechanism queueing mechanism for scheduling events based on the ESPromise callbacks, this is used to ensure
|
||||
* order of async operations that are required to be executed in a specific order.
|
||||
*/
|
||||
var ESPromiseScheduler = /** @class */ (function () {
|
||||
function ESPromiseScheduler(name, diagLog) {
|
||||
var _promiseId = 0;
|
||||
var _scheduledName = (name || "<unnamed>") + "." + _schedulerId;
|
||||
_schedulerId++;
|
||||
dynamicProto(ESPromiseScheduler, this, function (_this) {
|
||||
var _lastEvent = null;
|
||||
var _eventCount = 0;
|
||||
_this.scheduleEvent = function (startEventAction, eventName, timeout) {
|
||||
var uniqueId = _scheduledName + "." + _eventCount;
|
||||
_eventCount++;
|
||||
if (eventName) {
|
||||
uniqueId += "-(" + eventName + ")";
|
||||
}
|
||||
var uniqueEventId = uniqueId + "{" + _promiseId + "}";
|
||||
_promiseId++;
|
||||
// Create the next scheduled event details
|
||||
var newScheduledEvent = {
|
||||
evt: null,
|
||||
tm: _getTime(),
|
||||
id: uniqueEventId,
|
||||
isRunning: false,
|
||||
isAborted: false
|
||||
};
|
||||
if (!_lastEvent) {
|
||||
// We don't have any currently running event, so just start the next event
|
||||
newScheduledEvent.evt = _startWaitingEvent(newScheduledEvent);
|
||||
}
|
||||
else {
|
||||
// Start a new promise which will wait until all current active events are complete before starting
|
||||
// the new event, it does not resolve this scheduled event until after the new event is resolve to
|
||||
// ensure that all scheduled events are completed in the correct order
|
||||
newScheduledEvent.evt = _waitForPreviousEvent(newScheduledEvent, _lastEvent);
|
||||
}
|
||||
// Set this new event as the last one, so that any future events will wait for this one
|
||||
_lastEvent = newScheduledEvent;
|
||||
_lastEvent.evt._schId = uniqueEventId;
|
||||
return newScheduledEvent.evt;
|
||||
function _abortAndRemoveOldEvents(eventQueue) {
|
||||
var now = _getTime();
|
||||
var expired = now - LazyRejectPeriod;
|
||||
var len = eventQueue.length;
|
||||
var lp = 0;
|
||||
while (lp < len) {
|
||||
var evt = eventQueue[lp];
|
||||
if (evt && evt.tm < expired) {
|
||||
var message = null;
|
||||
if (evt.abort) {
|
||||
message = "Aborting [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)";
|
||||
evt.abort(message);
|
||||
}
|
||||
else {
|
||||
message = "Removing [" + evt.id + "] due to Excessive runtime (" + (now - evt.tm) + " ms)";
|
||||
}
|
||||
_warnLog(message);
|
||||
eventQueue.splice(lp, 1);
|
||||
len--;
|
||||
}
|
||||
else {
|
||||
lp++;
|
||||
}
|
||||
}
|
||||
}
|
||||
function _cleanup(eventId, completed) {
|
||||
var toQueue = false;
|
||||
var removed = _removeQueuedEvent(_running, eventId);
|
||||
if (!removed) {
|
||||
removed = _removeQueuedEvent(_timedOut, eventId);
|
||||
toQueue = true;
|
||||
}
|
||||
if (removed) {
|
||||
if (removed.to) {
|
||||
// If there was a timeout stop it
|
||||
clearTimeout(removed.to);
|
||||
removed.to = null;
|
||||
}
|
||||
// TODO (newylie): Convert this into reportable metrics
|
||||
var tm = _getTime() - removed.tm;
|
||||
if (completed) {
|
||||
if (!toQueue) {
|
||||
_debugLog("Promise [" + eventId + "] Complete -- " + tm + " ms");
|
||||
}
|
||||
else {
|
||||
_warnLog("Timed out event [" + eventId + "] finally complete -- " + tm + " ms");
|
||||
}
|
||||
}
|
||||
else {
|
||||
_timedOut.push(removed);
|
||||
_warnLog("Event [" + eventId + "] Timed out and removed -- " + tm + " ms");
|
||||
}
|
||||
}
|
||||
else {
|
||||
_debugLog("Failed to remove [" + eventId + "] from running queue");
|
||||
}
|
||||
// Also if the last scheduled event was this event then clear it as we are now finished
|
||||
if (_lastEvent && _lastEvent.id === eventId) {
|
||||
_lastEvent = null;
|
||||
}
|
||||
_abortAndRemoveOldEvents(_running);
|
||||
_abortAndRemoveOldEvents(_waiting);
|
||||
_abortAndRemoveOldEvents(_timedOut);
|
||||
}
|
||||
// Return a callback function that will be called when the waiting promise is resolved or rejected to ensure
|
||||
// that any outer promise is also resolved or rejected
|
||||
function _removeScheduledEvent(eventId, callback) {
|
||||
return function (value) {
|
||||
_cleanup(eventId, true);
|
||||
callback && callback(value);
|
||||
return value;
|
||||
};
|
||||
}
|
||||
function _waitForFinalResult(eventId, startResult, schEventResolve, schEventReject) {
|
||||
startResult.then(function (value) {
|
||||
if (value instanceof ESPromise) {
|
||||
// If the result is a promise then this appears to be a chained result, so wait for this promise to complete
|
||||
_debugLog("Event [" + eventId + "] returned a promise -- waiting");
|
||||
_waitForFinalResult(eventId, value, schEventResolve, schEventReject);
|
||||
return value;
|
||||
}
|
||||
else {
|
||||
return _removeScheduledEvent(eventId, schEventResolve)(value);
|
||||
}
|
||||
}, _removeScheduledEvent(eventId, schEventReject));
|
||||
}
|
||||
// Add the passed event to the active event list with resolve and reject callbacks that will remove
|
||||
// it from the active event list
|
||||
function _createScheduledEvent(eventDetails, startEvent) {
|
||||
var eventId = eventDetails.id;
|
||||
return new ESPromise(function (schEventResolve, schEventReject) {
|
||||
_debugLog("Event [" + eventId + "] Starting -- waited for " + (eventDetails.wTm || "--") + " ms");
|
||||
eventDetails.isRunning = true;
|
||||
eventDetails.abort = function (message) {
|
||||
eventDetails.abort = null;
|
||||
eventDetails.isAborted = true;
|
||||
_cleanup(eventId, false);
|
||||
schEventReject(new Error(message));
|
||||
};
|
||||
var startResult = startEvent(eventId);
|
||||
if (startResult instanceof ESPromise) {
|
||||
if (timeout) {
|
||||
// Note: Only starting a timer if a timeout was specified
|
||||
eventDetails.to = setTimeout(function () {
|
||||
_cleanup(eventId, false);
|
||||
// Cause the listeners to reject (Note: We can't actually reject the waiting event)
|
||||
schEventReject(new Error("Timed out after [" + timeout + "] ms"));
|
||||
}, timeout);
|
||||
}
|
||||
_waitForFinalResult(eventId, startResult, function (theResult) {
|
||||
_debugLog("Event [" + eventId + "] Resolving after " + (_getTime() - eventDetails.tm) + " ms");
|
||||
schEventResolve(theResult);
|
||||
}, schEventReject);
|
||||
}
|
||||
else {
|
||||
// The startEvent didn't return a promise so just return a resolved promise
|
||||
_debugLog("Promise [" + eventId + "] Auto completed as the start action did not return a promise");
|
||||
schEventResolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
function _startWaitingEvent(eventDetails) {
|
||||
var now = _getTime();
|
||||
eventDetails.wTm = now - eventDetails.tm;
|
||||
eventDetails.tm = now;
|
||||
if (eventDetails.isAborted) {
|
||||
return ESPromise.reject(new Error("[" + uniqueId + "] was aborted"));
|
||||
}
|
||||
_running.push(eventDetails);
|
||||
return _createScheduledEvent(eventDetails, startEventAction);
|
||||
}
|
||||
// Start a new promise which will wait until all current active events are complete before starting
|
||||
// the new event, it does not resolve this scheduled event until after the new event is resolve to
|
||||
// ensure that all scheduled events are completed in the correct order
|
||||
function _waitForPreviousEvent(eventDetails, waitForEvent) {
|
||||
var waitEvent = new ESPromise(function (waitResolve, waitReject) {
|
||||
var runTime = _getTime() - waitForEvent.tm;
|
||||
var prevId = waitForEvent.id;
|
||||
_debugLog("[" + uniqueId + "] is waiting for [" + prevId + ":" + runTime + " ms] to complete before starting -- [" + _waiting.length + "] waiting and [" + _running.length + "] running");
|
||||
eventDetails.abort = function (message) {
|
||||
eventDetails.abort = null;
|
||||
_removeQueuedEvent(_waiting, uniqueId);
|
||||
eventDetails.isAborted = true;
|
||||
waitReject(new Error(message));
|
||||
};
|
||||
// Wait for the previous event to complete
|
||||
waitForEvent.evt.then(function (value) {
|
||||
_removeQueuedEvent(_waiting, uniqueId);
|
||||
// Wait for the last event to complete before starting the new one, this ensures the execution
|
||||
// order so that we don't try and remove events that havn't been committed yet
|
||||
_startWaitingEvent(eventDetails).then(waitResolve, waitReject);
|
||||
}, function (reason) {
|
||||
_removeQueuedEvent(_waiting, uniqueId);
|
||||
// Wait for the last event to complete before starting the new one, this ensures the execution
|
||||
// order so that we don't try and remove events that havn't been committed yet
|
||||
_startWaitingEvent(eventDetails).then(waitResolve, waitReject);
|
||||
});
|
||||
});
|
||||
_waiting.push(eventDetails);
|
||||
return waitEvent;
|
||||
}
|
||||
};
|
||||
function _removeQueuedEvent(queue, eventId) {
|
||||
for (var lp = 0; lp < queue.length; lp++) {
|
||||
if (queue[lp].id === eventId) {
|
||||
return queue.splice(lp, 1)[0];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
function _debugLog(message) {
|
||||
// Only log if running within test harness
|
||||
var global = getGlobal();
|
||||
if (global && global["QUnit"]) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console && console.log("ESPromiseScheduler[" + _scheduledName + "] " + message);
|
||||
}
|
||||
}
|
||||
function _warnLog(message) {
|
||||
_warnToConsole(diagLog, "ESPromiseScheduler[" + _scheduledName + "] " + message);
|
||||
}
|
||||
}
|
||||
ESPromiseScheduler.incomplete = function () {
|
||||
return _running;
|
||||
};
|
||||
ESPromiseScheduler.waitingToStart = function () {
|
||||
return _waiting;
|
||||
};
|
||||
// Removed Stub for ESPromiseScheduler.prototype.scheduleEvent.
|
||||
return ESPromiseScheduler;
|
||||
}());
|
||||
export default ESPromiseScheduler;
|
112
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/Enums.js
generated
vendored
Normal file
112
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/Enums.js
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* Enums.ts
|
||||
* @author Abhilash Panwar (abpanwar)
|
||||
* @copyright Microsoft 2018
|
||||
* File containing the enums as constants.
|
||||
*/
|
||||
import { __assignFn as __assign } from "@microsoft/applicationinsights-shims";
|
||||
import { _InternalMessageId, createEnumStyle, objFreeze } from "@microsoft/applicationinsights-core-js";
|
||||
/**
|
||||
* The ValueKind contains a set of values that specify value kind of the property.
|
||||
* Either PII (Personal Identifiable Information) or customer content.
|
||||
*/
|
||||
export var ValueKind = createEnumStyle({
|
||||
NotSet: 0 /* eValueKind.NotSet */,
|
||||
Pii_DistinguishedName: 1 /* eValueKind.Pii_DistinguishedName */,
|
||||
Pii_GenericData: 2 /* eValueKind.Pii_GenericData */,
|
||||
Pii_IPV4Address: 3 /* eValueKind.Pii_IPV4Address */,
|
||||
Pii_IPv6Address: 4 /* eValueKind.Pii_IPv6Address */,
|
||||
Pii_MailSubject: 5 /* eValueKind.Pii_MailSubject */,
|
||||
Pii_PhoneNumber: 6 /* eValueKind.Pii_PhoneNumber */,
|
||||
Pii_QueryString: 7 /* eValueKind.Pii_QueryString */,
|
||||
Pii_SipAddress: 8 /* eValueKind.Pii_SipAddress */,
|
||||
Pii_SmtpAddress: 9 /* eValueKind.Pii_SmtpAddress */,
|
||||
Pii_Identity: 10 /* eValueKind.Pii_Identity */,
|
||||
Pii_Uri: 11 /* eValueKind.Pii_Uri */,
|
||||
Pii_Fqdn: 12 /* eValueKind.Pii_Fqdn */,
|
||||
Pii_IPV4AddressLegacy: 13 /* eValueKind.Pii_IPV4AddressLegacy */,
|
||||
CustomerContent_GenericContent: 32 /* eValueKind.CustomerContent_GenericContent */
|
||||
});
|
||||
/**
|
||||
* The EventLatency contains a set of values that specify the latency with which an event is sent.
|
||||
*/
|
||||
export var EventLatency = createEnumStyle({
|
||||
/**
|
||||
* Normal latency.
|
||||
*/
|
||||
Normal: 1 /* EventLatencyValue.Normal */,
|
||||
/**
|
||||
* Cost deferred latency. At the moment this latency is treated as Normal latency.
|
||||
*/
|
||||
CostDeferred: 2 /* EventLatencyValue.CostDeferred */,
|
||||
/**
|
||||
* Real time latency.
|
||||
*/
|
||||
RealTime: 3 /* EventLatencyValue.RealTime */,
|
||||
/**
|
||||
* Bypass normal batching/timing and send as soon as possible, this will still send asynchronously.
|
||||
* Added in v3.1.1
|
||||
*/
|
||||
Immediate: 4 /* EventLatencyValue.Immediate */
|
||||
});
|
||||
/**
|
||||
* Enum for property types.
|
||||
*/
|
||||
export var EventPropertyType = createEnumStyle({
|
||||
Unspecified: 0 /* eEventPropertyType.Unspecified */,
|
||||
String: 1 /* eEventPropertyType.String */,
|
||||
Int32: 2 /* eEventPropertyType.Int32 */,
|
||||
UInt32: 3 /* eEventPropertyType.UInt32 */,
|
||||
Int64: 4 /* eEventPropertyType.Int64 */,
|
||||
UInt64: 5 /* eEventPropertyType.UInt64 */,
|
||||
Double: 6 /* eEventPropertyType.Double */,
|
||||
Bool: 7 /* eEventPropertyType.Bool */,
|
||||
Guid: 8 /* eEventPropertyType.Guid */,
|
||||
DateTime: 9 /* eEventPropertyType.DateTime */
|
||||
});
|
||||
/**
|
||||
* The EventPersistence contains a set of values that specify the event's persistence.
|
||||
*/
|
||||
export var EventPersistence = createEnumStyle({
|
||||
/**
|
||||
* Normal persistence.
|
||||
*/
|
||||
Normal: 1 /* EventPersistenceValue.Normal */,
|
||||
/**
|
||||
* Critical persistence.
|
||||
*/
|
||||
Critical: 2 /* EventPersistenceValue.Critical */
|
||||
});
|
||||
export var TraceLevel = createEnumStyle({
|
||||
NONE: 0 /* eTraceLevel.NONE */,
|
||||
ERROR: 1 /* eTraceLevel.ERROR */,
|
||||
WARNING: 2 /* eTraceLevel.WARNING */,
|
||||
INFORMATION: 3 /* eTraceLevel.INFORMATION */
|
||||
});
|
||||
export var _ExtendedInternalMessageId = objFreeze(__assign(__assign({}, _InternalMessageId), createEnumStyle({
|
||||
AuthHandShakeError: 501 /* _eExtendedInternalMessageId.AuthHandShakeError */,
|
||||
AuthRedirectFail: 502 /* _eExtendedInternalMessageId.AuthRedirectFail */,
|
||||
BrowserCannotReadLocalStorage: 503 /* _eExtendedInternalMessageId.BrowserCannotReadLocalStorage */,
|
||||
BrowserCannotWriteLocalStorage: 504 /* _eExtendedInternalMessageId.BrowserCannotWriteLocalStorage */,
|
||||
BrowserDoesNotSupportLocalStorage: 505 /* _eExtendedInternalMessageId.BrowserDoesNotSupportLocalStorage */,
|
||||
CannotParseBiBlobValue: 506 /* _eExtendedInternalMessageId.CannotParseBiBlobValue */,
|
||||
CannotParseDataAttribute: 507 /* _eExtendedInternalMessageId.CannotParseDataAttribute */,
|
||||
CVPluginNotAvailable: 508 /* _eExtendedInternalMessageId.CVPluginNotAvailable */,
|
||||
DroppedEvent: 509 /* _eExtendedInternalMessageId.DroppedEvent */,
|
||||
ErrorParsingAISessionCookie: 510 /* _eExtendedInternalMessageId.ErrorParsingAISessionCookie */,
|
||||
ErrorProvidedChannels: 511 /* _eExtendedInternalMessageId.ErrorProvidedChannels */,
|
||||
FailedToGetCookies: 512 /* _eExtendedInternalMessageId.FailedToGetCookies */,
|
||||
FailedToInitializeCorrelationVector: 513 /* _eExtendedInternalMessageId.FailedToInitializeCorrelationVector */,
|
||||
FailedToInitializeSDK: 514 /* _eExtendedInternalMessageId.FailedToInitializeSDK */,
|
||||
InvalidContentBlob: 515 /* _eExtendedInternalMessageId.InvalidContentBlob */,
|
||||
InvalidCorrelationValue: 516 /* _eExtendedInternalMessageId.InvalidCorrelationValue */,
|
||||
SessionRenewalDateIsZero: 517 /* _eExtendedInternalMessageId.SessionRenewalDateIsZero */,
|
||||
SendPostOnCompleteFailure: 518 /* _eExtendedInternalMessageId.SendPostOnCompleteFailure */,
|
||||
PostResponseHandler: 519 /* _eExtendedInternalMessageId.PostResponseHandler */,
|
||||
SDKNotInitialized: 520 /* _eExtendedInternalMessageId.SDKNotInitialized */
|
||||
})));
|
31
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/Index.js
generated
vendored
Normal file
31
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/Index.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* Index.ts
|
||||
* @author Abhilash Panwar (abpanwar)
|
||||
* @copyright Microsoft 2018
|
||||
* File to export public classes, interfaces and enums.
|
||||
*/
|
||||
import { ValueKind, EventLatency, EventPersistence, TraceLevel, EventPropertyType, _ExtendedInternalMessageId } from "./Enums";
|
||||
import AppInsightsCore from "./AppInsightsCore";
|
||||
import BaseCore from "./BaseCore";
|
||||
import ESPromise from "./ESPromise";
|
||||
import ESPromiseScheduler from "./ESPromiseScheduler";
|
||||
import { ValueSanitizer } from "./ValueSanitizer";
|
||||
export { ValueKind, EventLatency, EventPersistence, TraceLevel, AppInsightsCore, BaseCore, _ExtendedInternalMessageId, EventPropertyType, ESPromise, ESPromiseScheduler, ValueSanitizer };
|
||||
export { NotificationManager, BaseTelemetryPlugin, ProcessTelemetryContext, MinChannelPriorty, EventsDiscardedReason, DiagnosticLogger, LoggingSeverity, PerfEvent, PerfManager, doPerf, EventHelper, AppInsightsCore as InternalAppInsightsCore, BaseCore as InternalBaseCore, _InternalLogMessage, _InternalMessageId, createEnumStyle, _throwInternal, _warnToConsole, _logInternalMessage,
|
||||
// The HelperFuncs functions
|
||||
isTypeof, isUndefined, isNullOrUndefined, hasOwnProperty, isObject, isFunction, attachEvent, detachEvent, normalizeJsName, objForEachKey, strStartsWith, strEndsWith, strContains, strTrim, isDate, isArray, isError, isString, isNumber, isBoolean, toISOString, arrForEach, arrIndexOf, arrMap, arrReduce, objKeys, objDefineAccessors, dateNow, getExceptionName, throwError, setValue, getSetValue, isNotTruthy, isTruthy, proxyAssign, proxyFunctions, proxyFunctionAs, optimizeObject, objCreate, addEventHandler, newGuid, perfNow, newId, generateW3CId, safeGetLogger, objFreeze, objSeal,
|
||||
// EnvUtils
|
||||
getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, getCrypto, getMsCrypto, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, getConsole, dumpObj, isIE, getIEVersion, strUndefined, strObject, strPrototype, strFunction, setEnableEnvMocks, strUndefined as Undefined,
|
||||
// Random
|
||||
randomValue, random32, uaDisallowsSameSiteNone as disallowsSameSiteNone, areCookiesSupported, areCookiesSupported as cookieAvailable, createCookieMgr, safeGetCookieMgr,
|
||||
// Aliases
|
||||
toISOString as getISOString, isBeaconsSupported, isFetchSupported, isXhrSupported, useXDomainRequest, addPageHideEventListener, addPageShowEventListener, addEventListeners, addPageUnloadEventListener, removeEventHandler, removeEventListeners, removePageUnloadEventListener, removePageHideEventListener, removePageShowEventListener, eventOn, eventOff, mergeEvtNamespace, createUniqueNamespace, __getRegisteredEvents, createProcessTelemetryContext, createUnloadHandlerContainer, createTraceParent, parseTraceParent, isValidTraceId, isValidSpanId, isValidTraceParent, isSampledFlag, formatTraceParent, findW3cTraceParent } from "@microsoft/applicationinsights-core-js";
|
||||
export { isValueAssigned, isLatency, isUint8ArrayAvailable, getTenantId, sanitizeProperty, Version, FullVersionString, getCommonSchemaMetaData, getCookie, setCookie, deleteCookie, getCookieValue, extend, createGuid, isDocumentObjectAvailable, isWindowObjectAvailable, setProcessTelemetryTimings, getTime, isArrayValid, isValueKind, getFieldValueType, CoreUtils, disableCookies, // exporting the overridden version for tree-shaking
|
||||
Utils, // Replacement for import * as Utils from "./Utils";
|
||||
isChromium, // Replace with ai-core version once published in ai-core
|
||||
openXhr } from "./Utils";
|
18
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/InternalConstants.js
generated
vendored
Normal file
18
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/InternalConstants.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
|
||||
// Licensed under the MIT License.
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// 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!!!
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)
|
||||
// as when using "short" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.
|
||||
export var STR_EMPTY = "";
|
||||
export var STR_DEFAULT_ENDPOINT_URL = "https://browser.events.data.microsoft.com/OneCollector/1.0/";
|
||||
export var STR_PLUGIN_VERSION_STRING = "pluginVersionString";
|
||||
export var STR_PLUGIN_VERSION_STRING_ARR = STR_PLUGIN_VERSION_STRING + "Arr";
|
||||
export var STR_VERSION = "version";
|
||||
export var STR_PROPERTIES = "properties";
|
521
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/Utils.js
generated
vendored
Normal file
521
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/Utils.js
generated
vendored
Normal file
@ -0,0 +1,521 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
var _a;
|
||||
/**
|
||||
* Utils.ts
|
||||
* @author Abhilash Panwar (abpanwar) Hector Hernandez (hectorh)
|
||||
* @copyright Microsoft 2018
|
||||
* File containing utility functions.
|
||||
*/
|
||||
import { addEventHandler, addPageUnloadEventListener, areCookiesSupported, arrForEach, arrIndexOf, arrMap, arrReduce, dateNow, generateW3CId, getDocument, getGlobalInst, getNavigator, getWindow, hasOwnProperty, isArray, isBeaconsSupported, isBoolean, isDate, isError, isFunction, isIE, isNullOrUndefined, isNumber, isObject, isReactNative, isString, isTypeof, isUndefined, mwcRandom32, mwcRandomSeed, newGuid, newId, objDefineAccessors, objForEachKey, objKeys, perfNow, random32, randomValue, safeGetCookieMgr, strEndsWith, strObject, strTrim, strUndefined, toISOString, uaDisallowsSameSiteNone, useXDomainRequest } from "@microsoft/applicationinsights-core-js";
|
||||
import { ObjHasOwnProperty, objCreateFn, strShimObject, strShimPrototype } from "@microsoft/applicationinsights-shims";
|
||||
import { STR_EMPTY } from "./InternalConstants";
|
||||
export var Version = '3.2.13';
|
||||
export var FullVersionString = "1DS-Web-JS-" + Version;
|
||||
// Defining here so we don't need to take (import) the ApplicationInsights Common module
|
||||
var strDisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
||||
var strWithCredentials = "withCredentials";
|
||||
var strTimeout = "timeout";
|
||||
// If value is array just get the type for the first element
|
||||
var _fieldTypeEventPropMap = (_a = {},
|
||||
_a[0 /* FieldValueSanitizerType.NotSet */] = 0 /* eEventPropertyType.Unspecified */,
|
||||
_a[2 /* FieldValueSanitizerType.Number */] = 6 /* eEventPropertyType.Double */,
|
||||
_a[1 /* FieldValueSanitizerType.String */] = 1 /* eEventPropertyType.String */,
|
||||
_a[3 /* FieldValueSanitizerType.Boolean */] = 7 /* eEventPropertyType.Bool */,
|
||||
_a[4096 /* FieldValueSanitizerType.Array */ | 2 /* FieldValueSanitizerType.Number */] = 6 /* eEventPropertyType.Double */,
|
||||
_a[4096 /* FieldValueSanitizerType.Array */ | 1 /* FieldValueSanitizerType.String */] = 1 /* eEventPropertyType.String */,
|
||||
_a[4096 /* FieldValueSanitizerType.Array */ | 3 /* FieldValueSanitizerType.Boolean */] = 7 /* eEventPropertyType.Bool */,
|
||||
_a);
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
// let _uaDisallowsSameSiteNone = null;
|
||||
var uInt8ArraySupported = null;
|
||||
// var _areCookiesAvailable: boolean | undefined;
|
||||
/**
|
||||
* Checks if document object is available
|
||||
*/
|
||||
export var isDocumentObjectAvailable = Boolean(getDocument());
|
||||
/**
|
||||
* Checks if window object is available
|
||||
*/
|
||||
export var isWindowObjectAvailable = Boolean(getWindow());
|
||||
/**
|
||||
* Checks if value is assigned to the given param.
|
||||
* @param value - The token from which the tenant id is to be extracted.
|
||||
* @returns True/false denoting if value is assigned to the param.
|
||||
*/
|
||||
export function isValueAssigned(value) {
|
||||
/// <summary> takes a value and checks for undefined, null and empty string </summary>
|
||||
/// <param type="any"> value to be tested </param>
|
||||
/// <returns> true if value is null undefined or emptyString </returns>
|
||||
return !(value === STR_EMPTY || isNullOrUndefined(value));
|
||||
}
|
||||
/**
|
||||
* Gets the tenant id from the tenant token.
|
||||
* @param apiKey - The token from which the tenant id is to be extracted.
|
||||
* @returns The tenant id.
|
||||
*/
|
||||
export function getTenantId(apiKey) {
|
||||
if (apiKey) {
|
||||
var indexTenantId = apiKey.indexOf("-");
|
||||
if (indexTenantId > -1) {
|
||||
return apiKey.substring(0, indexTenantId);
|
||||
}
|
||||
}
|
||||
return STR_EMPTY;
|
||||
}
|
||||
/**
|
||||
* Checks if Uint8Array are available in the current environment. Safari and Firefox along with
|
||||
* ReactNative are known to not support Uint8Array properly.
|
||||
* @returns True if available, false otherwise.
|
||||
*/
|
||||
export function isUint8ArrayAvailable() {
|
||||
if (uInt8ArraySupported === null) {
|
||||
uInt8ArraySupported = !isUndefined(Uint8Array) && !isSafariOrFirefox() && !isReactNative();
|
||||
}
|
||||
return uInt8ArraySupported;
|
||||
}
|
||||
/**
|
||||
* Checks if the value is a valid EventLatency.
|
||||
* @param value - The value that needs to be checked.
|
||||
* @returns True if the value is in AWTEventLatency, false otherwise.
|
||||
*/
|
||||
export function isLatency(value) {
|
||||
if (value && isNumber(value) && value >= 1 /* EventLatencyValue.Normal */ && value <= 4 /* EventLatencyValue.Immediate */) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Sanitizes the Property. It checks the that the property name and value are valid. It also
|
||||
* checks/populates the correct type and pii of the property value.
|
||||
* @param name - property name - The property name.
|
||||
* @param property - The property value or an IEventProperty containing value,
|
||||
* type ,pii and customer content.
|
||||
* @returns IEventProperty containing valid name, value, pii and type or null if invalid.
|
||||
*/
|
||||
export function sanitizeProperty(name, property, stringifyObjects) {
|
||||
// Check that property is valid
|
||||
if ((!property && !isValueAssigned(property)) || typeof name !== "string") {
|
||||
return null;
|
||||
}
|
||||
// Perf optimization -- only need to get the type once not multiple times
|
||||
var propType = typeof property;
|
||||
// If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.
|
||||
if (propType === "string" || propType === "number" || propType === "boolean" || isArray(property)) {
|
||||
property = { value: property };
|
||||
}
|
||||
else if (propType === "object" && !ObjHasOwnProperty.call(property, "value")) {
|
||||
property = { value: stringifyObjects ? JSON.stringify(property) : property };
|
||||
}
|
||||
else if (isNullOrUndefined(property.value)
|
||||
|| property.value === STR_EMPTY || (!isString(property.value)
|
||||
&& !isNumber(property.value) && !isBoolean(property.value)
|
||||
&& !isArray(property.value))) {
|
||||
// Since property is IEventProperty, we need to validate its value
|
||||
return null;
|
||||
}
|
||||
// We need to check that if the property value is an array, it is valid
|
||||
if (isArray(property.value) &&
|
||||
!isArrayValid(property.value)) {
|
||||
return null;
|
||||
}
|
||||
// If either pii or cc is set convert value to string (since only string pii/cc is allowed).
|
||||
// If the value is a complex type like an array that can't be converted to string we will drop
|
||||
// the property.
|
||||
if (!isNullOrUndefined(property.kind)) {
|
||||
if (isArray(property.value) || !isValueKind(property.kind)) {
|
||||
return null;
|
||||
}
|
||||
property.value = property.value.toString();
|
||||
}
|
||||
return property;
|
||||
}
|
||||
export function getCommonSchemaMetaData(value, kind, type) {
|
||||
var encodedTypeValue = -1;
|
||||
if (!isUndefined(value)) {
|
||||
if (kind > 0) {
|
||||
if (kind === 32) {
|
||||
// encode customer content. Value can only be string. bit 13-16 are for cc
|
||||
encodedTypeValue = (1 << 13);
|
||||
}
|
||||
else if (kind <= 13) {
|
||||
// encode PII. Value can only be string. bits 5-12 are for Pii
|
||||
encodedTypeValue = (kind << 5);
|
||||
}
|
||||
}
|
||||
// isDataType checks that the "type" is a number so we don't need to check for undefined
|
||||
if (isDataType(type)) {
|
||||
// Data Type is provided and valid, so use that
|
||||
if (encodedTypeValue === -1) {
|
||||
// Don't return -1
|
||||
encodedTypeValue = 0;
|
||||
}
|
||||
encodedTypeValue |= type;
|
||||
}
|
||||
else {
|
||||
var propType = _fieldTypeEventPropMap[getFieldValueType(value)] || -1;
|
||||
if (encodedTypeValue !== -1 && propType !== -1) {
|
||||
// pii exists so we must return correct type
|
||||
encodedTypeValue |= propType;
|
||||
}
|
||||
else if (propType === 6 /* eEventPropertyType.Double */) {
|
||||
encodedTypeValue = propType;
|
||||
}
|
||||
}
|
||||
}
|
||||
return encodedTypeValue;
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the core.getCookieMgr().disable()
|
||||
* Force the SDK not to store and read any data from cookies.
|
||||
* Overriding the applicationinsights-core version for tree-shaking
|
||||
*/
|
||||
export function disableCookies() {
|
||||
safeGetCookieMgr(null).setEnabled(false);
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the oneDs.getCookieMgr().set()
|
||||
* Sets the value of a cookie.
|
||||
* @param name - Cookie name.
|
||||
* @param value - Cookie value.
|
||||
* @param days - Expiration days.
|
||||
*/
|
||||
export function setCookie(name, value, days) {
|
||||
if (areCookiesSupported(null)) {
|
||||
safeGetCookieMgr(null).set(name, value, days * 86400, null, "/");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the oneDs.getCookieMgr().del()
|
||||
* Deletes a cookie, by setting its expiration to -1.
|
||||
* @param name - Cookie name to delete.
|
||||
*/
|
||||
export function deleteCookie(name) {
|
||||
if (areCookiesSupported(null)) {
|
||||
safeGetCookieMgr(null).del(name);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the oneDs.getCookieMgr().get()
|
||||
* Gets the cookie value for the specified cookie.
|
||||
* if value is k1=v1&k2==v2 then will return 'v1' for key 'k1'
|
||||
* @param cookieName - Cookie name.
|
||||
*/
|
||||
export function getCookie(name) {
|
||||
if (areCookiesSupported(null)) {
|
||||
return getCookieValue(safeGetCookieMgr(null), name);
|
||||
}
|
||||
return STR_EMPTY;
|
||||
}
|
||||
/**
|
||||
* Helper to get and decode the cookie value using decodeURIComponent, this is for historical
|
||||
* backward compatibility where the document.cookie value was decoded before parsing.
|
||||
* @param cookieMgr - The cookie manager to use
|
||||
* @param name - The name of the cookie to get
|
||||
* @param decode - A flag to indicate whether the cookie value should be decoded
|
||||
* @returns The decoded cookie value (if available) otherwise an empty string.
|
||||
*/
|
||||
export function getCookieValue(cookieMgr, name, decode) {
|
||||
if (decode === void 0) { decode = true; }
|
||||
var cookieValue;
|
||||
if (cookieMgr) {
|
||||
cookieValue = cookieMgr.get(name);
|
||||
if (decode && cookieValue && decodeURIComponent) {
|
||||
cookieValue = decodeURIComponent(cookieValue);
|
||||
}
|
||||
}
|
||||
return cookieValue || STR_EMPTY;
|
||||
}
|
||||
/**
|
||||
* Create a new guid.
|
||||
* @param style - The style of guid to generated, defaults to Digits
|
||||
* Digits (Default) : 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000
|
||||
* Braces - 32 digits separated by hyphens, enclosed in braces: {00000000-0000-0000-0000-000000000000}
|
||||
* Parentheses - 32 digits separated by hyphens, enclosed in parentheses: (00000000-0000-0000-0000-000000000000)
|
||||
* Numeric - 32 digits: 00000000000000000000000000000000
|
||||
* @returns The formatted guid.
|
||||
*/
|
||||
export function createGuid(style) {
|
||||
if (style === void 0) { style = "D" /* GuidStyle.Digits */; }
|
||||
var theGuid = newGuid();
|
||||
if (style === "B" /* GuidStyle.Braces */) {
|
||||
theGuid = "{" + theGuid + "}";
|
||||
}
|
||||
else if (style === "P" /* GuidStyle.Parentheses */) {
|
||||
theGuid = "(" + theGuid + ")";
|
||||
}
|
||||
else if (style === "N" /* GuidStyle.Numeric */) {
|
||||
theGuid = theGuid.replace(/-/g, STR_EMPTY);
|
||||
}
|
||||
return theGuid;
|
||||
}
|
||||
/**
|
||||
* Pass in the objects to merge as arguments.
|
||||
* @param obj1 - object to merge. Set this argument to 'true' for a deep extend.
|
||||
* @param obj2 - object to merge.
|
||||
* @param obj3 - object to merge.
|
||||
* @param obj4 - object to merge.
|
||||
* @param obj5 - object to merge.
|
||||
* @returns The extended object.
|
||||
*/
|
||||
export function extend(obj, obj2, obj3, obj4, obj5) {
|
||||
// Variables
|
||||
var extended = {};
|
||||
var deep = false;
|
||||
var i = 0;
|
||||
var length = arguments.length;
|
||||
var objProto = Object[strShimPrototype];
|
||||
var theArgs = arguments;
|
||||
// Check if a deep merge
|
||||
if (objProto.toString.call(theArgs[0]) === "[object Boolean]") {
|
||||
deep = theArgs[0];
|
||||
i++;
|
||||
}
|
||||
// Loop through each object and conduct a merge
|
||||
for (; i < length; i++) {
|
||||
var obj = theArgs[i];
|
||||
objForEachKey(obj, function (prop, value) {
|
||||
// If deep merge and property is an object, merge properties
|
||||
if (deep && value && isObject(value)) {
|
||||
if (isArray(value)) {
|
||||
extended[prop] = extended[prop] || [];
|
||||
arrForEach(value, function (arrayValue, arrayIndex) {
|
||||
if (arrayValue && isObject(arrayValue)) {
|
||||
extended[prop][arrayIndex] = extend(true, extended[prop][arrayIndex], arrayValue);
|
||||
}
|
||||
else {
|
||||
extended[prop][arrayIndex] = arrayValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
extended[prop] = extend(true, extended[prop], value);
|
||||
}
|
||||
}
|
||||
else {
|
||||
extended[prop] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
return extended;
|
||||
}
|
||||
export var getTime = perfNow;
|
||||
export function isValueKind(value) {
|
||||
// Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization
|
||||
if (value === 0 /* eValueKind.NotSet */ || ((value > 0 /* eValueKind.NotSet */ && value <= 13 /* eValueKind.Pii_IPV4AddressLegacy */) || value === 32 /* eValueKind.CustomerContent_GenericContent */)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isDataType(value) {
|
||||
// Remark: 0 returns false, but it doesn't affect encoding anyways
|
||||
// Always assume that it's a number (no type checking) for performance as this is used during the JSON serialization
|
||||
if (value >= 0 && value <= 9) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isSafariOrFirefox() {
|
||||
var nav = getNavigator();
|
||||
// If non-browser navigator will be undefined
|
||||
if (!isUndefined(nav) && nav.userAgent) {
|
||||
var ua = nav.userAgent.toLowerCase();
|
||||
if ((ua.indexOf("safari") >= 0 || ua.indexOf("firefox") >= 0) && ua.indexOf("chrome") < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export function isArrayValid(value) {
|
||||
return value.length > 0;
|
||||
}
|
||||
export function setProcessTelemetryTimings(event, identifier) {
|
||||
var evt = event;
|
||||
evt.timings = evt.timings || {};
|
||||
evt.timings.processTelemetryStart = evt.timings.processTelemetryStart || {};
|
||||
evt.timings.processTelemetryStart[identifier] = getTime();
|
||||
}
|
||||
/**
|
||||
* Returns a bitwise value for the FieldValueSanitizerType enum representing the decoded type of the passed value
|
||||
* @param value The value to determine the type
|
||||
*/
|
||||
export function getFieldValueType(value) {
|
||||
var theType = 0 /* FieldValueSanitizerType.NotSet */;
|
||||
if (value !== null && value !== undefined) {
|
||||
var objType = typeof value;
|
||||
if (objType === "string") {
|
||||
theType = 1 /* FieldValueSanitizerType.String */;
|
||||
}
|
||||
else if (objType === "number") {
|
||||
theType = 2 /* FieldValueSanitizerType.Number */;
|
||||
}
|
||||
else if (objType === "boolean") {
|
||||
theType = 3 /* FieldValueSanitizerType.Boolean */;
|
||||
}
|
||||
else if (objType === strShimObject) {
|
||||
theType = 4 /* FieldValueSanitizerType.Object */;
|
||||
if (isArray(value)) {
|
||||
theType = 4096 /* FieldValueSanitizerType.Array */;
|
||||
if (value.length > 0) {
|
||||
// Empty arrays are not supported and are considered to be the same as null
|
||||
theType |= getFieldValueType(value[0]);
|
||||
}
|
||||
}
|
||||
else if (ObjHasOwnProperty.call(value, "value")) {
|
||||
// Looks like an IEventProperty
|
||||
theType = 8192 /* FieldValueSanitizerType.EventProperty */ | getFieldValueType(value.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return theType;
|
||||
}
|
||||
export var Utils = {
|
||||
Version: Version,
|
||||
FullVersionString: FullVersionString,
|
||||
strUndefined: strUndefined,
|
||||
strObject: strObject,
|
||||
Undefined: strUndefined,
|
||||
arrForEach: arrForEach,
|
||||
arrIndexOf: arrIndexOf,
|
||||
arrMap: arrMap,
|
||||
arrReduce: arrReduce,
|
||||
objKeys: objKeys,
|
||||
toISOString: toISOString,
|
||||
isReactNative: isReactNative,
|
||||
isString: isString,
|
||||
isNumber: isNumber,
|
||||
isBoolean: isBoolean,
|
||||
isFunction: isFunction,
|
||||
isArray: isArray,
|
||||
isObject: isObject,
|
||||
strTrim: strTrim,
|
||||
isDocumentObjectAvailable: isDocumentObjectAvailable,
|
||||
isWindowObjectAvailable: isWindowObjectAvailable,
|
||||
isValueAssigned: isValueAssigned,
|
||||
getTenantId: getTenantId,
|
||||
isBeaconsSupported: isBeaconsSupported,
|
||||
isUint8ArrayAvailable: isUint8ArrayAvailable,
|
||||
isLatency: isLatency,
|
||||
sanitizeProperty: sanitizeProperty,
|
||||
getISOString: toISOString,
|
||||
useXDomainRequest: useXDomainRequest,
|
||||
getCommonSchemaMetaData: getCommonSchemaMetaData,
|
||||
cookieAvailable: areCookiesSupported,
|
||||
disallowsSameSiteNone: uaDisallowsSameSiteNone,
|
||||
setCookie: setCookie,
|
||||
deleteCookie: deleteCookie,
|
||||
getCookie: getCookie,
|
||||
createGuid: createGuid,
|
||||
extend: extend,
|
||||
getTime: getTime,
|
||||
isValueKind: isValueKind,
|
||||
isArrayValid: isArrayValid,
|
||||
objDefineAccessors: objDefineAccessors,
|
||||
addPageUnloadEventListener: addPageUnloadEventListener,
|
||||
setProcessTelemetryTimings: setProcessTelemetryTimings,
|
||||
addEventHandler: addEventHandler,
|
||||
getFieldValueType: getFieldValueType,
|
||||
strEndsWith: strEndsWith,
|
||||
objForEachKey: objForEachKey
|
||||
};
|
||||
/**
|
||||
* Provides a collection of utility functions, included for backward compatibility with previous releases.
|
||||
* @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions
|
||||
* as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items
|
||||
* in your resulting code.
|
||||
* Overriding the applicationinsights-core version for tree-shaking
|
||||
*/
|
||||
export var CoreUtils = {
|
||||
_canUseCookies: undefined,
|
||||
isTypeof: isTypeof,
|
||||
isUndefined: isUndefined,
|
||||
isNullOrUndefined: isNullOrUndefined,
|
||||
hasOwnProperty: hasOwnProperty,
|
||||
isFunction: isFunction,
|
||||
isObject: isObject,
|
||||
isDate: isDate,
|
||||
isArray: isArray,
|
||||
isError: isError,
|
||||
isString: isString,
|
||||
isNumber: isNumber,
|
||||
isBoolean: isBoolean,
|
||||
toISOString: toISOString,
|
||||
arrForEach: arrForEach,
|
||||
arrIndexOf: arrIndexOf,
|
||||
arrMap: arrMap,
|
||||
arrReduce: arrReduce,
|
||||
strTrim: strTrim,
|
||||
objCreate: objCreateFn,
|
||||
objKeys: objKeys,
|
||||
objDefineAccessors: objDefineAccessors,
|
||||
addEventHandler: addEventHandler,
|
||||
dateNow: dateNow,
|
||||
isIE: isIE,
|
||||
disableCookies: disableCookies,
|
||||
newGuid: newGuid,
|
||||
perfNow: perfNow,
|
||||
newId: newId,
|
||||
randomValue: randomValue,
|
||||
random32: random32,
|
||||
mwcRandomSeed: mwcRandomSeed,
|
||||
mwcRandom32: mwcRandom32,
|
||||
generateW3CId: generateW3CId
|
||||
};
|
||||
/**
|
||||
* Helper to identify whether we are running in a chromium based browser environment
|
||||
*/
|
||||
export function isChromium() {
|
||||
return !!getGlobalInst("chrome");
|
||||
}
|
||||
/**
|
||||
* Create and open an XMLHttpRequest object
|
||||
* @param method - The request method
|
||||
* @param urlString - The url
|
||||
* @param withCredentials - Option flag indicating that credentials should be sent
|
||||
* @param disabled - Optional flag indicating that the XHR object should be marked as disabled and not tracked (default is false)
|
||||
* @param isSync - Optional flag indicating if the instance should be a synchronous request (defaults to false)
|
||||
* @param timeout - Optional value identifying the timeout value that should be assigned to the XHR request
|
||||
* @returns A new opened XHR request
|
||||
*/
|
||||
export function openXhr(method, urlString, withCredentials, disabled, isSync, timeout) {
|
||||
if (disabled === void 0) { disabled = false; }
|
||||
if (isSync === void 0) { isSync = false; }
|
||||
function _wrapSetXhrProp(xhr, prop, value) {
|
||||
try {
|
||||
xhr[prop] = value;
|
||||
}
|
||||
catch (e) {
|
||||
// - Wrapping as depending on the environment setting the property may fail (non-terminally)
|
||||
}
|
||||
}
|
||||
var xhr = new XMLHttpRequest();
|
||||
if (disabled) {
|
||||
// Tag the instance so it's not tracked (trackDependency)
|
||||
// If the environment has locked down the XMLHttpRequest (preventExtensions and/or freeze), this would
|
||||
// cause the request to fail and we no telemetry would be sent
|
||||
_wrapSetXhrProp(xhr, strDisabledPropertyName, disabled);
|
||||
}
|
||||
if (withCredentials) {
|
||||
// Some libraries require that the withCredentials flag is set "before" open and
|
||||
// - Wrapping as IE 10 has started throwing when setting before open
|
||||
_wrapSetXhrProp(xhr, strWithCredentials, withCredentials);
|
||||
}
|
||||
xhr.open(method, urlString, !isSync);
|
||||
if (withCredentials) {
|
||||
// withCredentials should be set AFTER open (https://xhr.spec.whatwg.org/#the-withcredentials-attribute)
|
||||
// And older firefox instances from 11+ will throw for sync events (current versions don't) which happens during unload processing
|
||||
_wrapSetXhrProp(xhr, strWithCredentials, withCredentials);
|
||||
}
|
||||
// Only set the timeout for asynchronous requests as
|
||||
// "Timeout shouldn't be used for synchronous XMLHttpRequests requests used in a document environment or it will throw an InvalidAccessError exception.""
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/timeout
|
||||
if (!isSync && timeout) {
|
||||
_wrapSetXhrProp(xhr, strTimeout, timeout);
|
||||
}
|
||||
return xhr;
|
||||
}
|
210
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/ValueSanitizer.js
generated
vendored
Normal file
210
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist-esm/src/ValueSanitizer.js
generated
vendored
Normal file
@ -0,0 +1,210 @@
|
||||
/*
|
||||
* 1DS JS SDK Core, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
import { isNullOrUndefined, isString, objForEachKey } from "@microsoft/applicationinsights-core-js";
|
||||
import { STR_EMPTY } from "./InternalConstants";
|
||||
import { getFieldValueType, isValueAssigned, isValueKind } from "./Utils";
|
||||
var ValueSanitizer = /** @class */ (function () {
|
||||
function ValueSanitizer(fieldSanitizerProvider) {
|
||||
var _self = this;
|
||||
// To aid with performance this is a lookup map to check if the field value sanitizer supports this field
|
||||
var _sanitizerMap = {};
|
||||
var _sanitizers = [];
|
||||
var _fieldSanitizers = [];
|
||||
if (fieldSanitizerProvider) {
|
||||
_fieldSanitizers.push(fieldSanitizerProvider);
|
||||
}
|
||||
function _getFieldSanitizer(path, name) {
|
||||
var result;
|
||||
var fieldLookup = _sanitizerMap[path];
|
||||
if (fieldLookup) {
|
||||
result = fieldLookup[name];
|
||||
}
|
||||
if (!result && result !== null) {
|
||||
// Null is a valid result indicating that the value sanitizer does not support this field
|
||||
if (isString(path) && isString(name)) {
|
||||
if (_fieldSanitizers.length > 0) {
|
||||
for (var lp = 0; lp < _fieldSanitizers.length; lp++) {
|
||||
if (_fieldSanitizers[lp].handleField(path, name)) {
|
||||
result = {
|
||||
canHandle: true,
|
||||
fieldHandler: _fieldSanitizers[lp]
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (_sanitizers.length === 0) {
|
||||
// Special use-case where there is no sanitizer to pass on to, so just resolving the field
|
||||
// and returning the resulting value (same as sanitizeProperty())
|
||||
result = {
|
||||
canHandle: true
|
||||
};
|
||||
}
|
||||
}
|
||||
// We still don't have a handler so lets lookup the providers
|
||||
if (!result && result !== null) {
|
||||
// Setting the result to null -- which means we and any contained sanitizers can't handle this field
|
||||
result = null;
|
||||
for (var lp = 0; lp < _sanitizers.length; lp++) {
|
||||
if (_sanitizers[lp].handleField(path, name)) {
|
||||
result = {
|
||||
canHandle: true,
|
||||
handler: _sanitizers[lp],
|
||||
fieldHandler: null
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!fieldLookup) {
|
||||
fieldLookup = _sanitizerMap[path] = {};
|
||||
}
|
||||
fieldLookup[name] = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
_self.addSanitizer = function (newSanitizer) {
|
||||
if (newSanitizer) {
|
||||
_sanitizers.push(newSanitizer);
|
||||
// Invalidate any previously mapped fields
|
||||
_sanitizerMap = {};
|
||||
}
|
||||
};
|
||||
_self.addFieldSanitizer = function (fieldSanitizer) {
|
||||
if (fieldSanitizer) {
|
||||
_fieldSanitizers.push(fieldSanitizer);
|
||||
// Invalidate any previously mapped fields
|
||||
_sanitizerMap = {};
|
||||
}
|
||||
};
|
||||
_self.handleField = function (path, name) {
|
||||
var mapValue = _getFieldSanitizer(path, name);
|
||||
return mapValue ? mapValue.canHandle : false;
|
||||
};
|
||||
_self.value = function (path, name, value, stringifyObjects) {
|
||||
var mapValue = _getFieldSanitizer(path, name);
|
||||
if (mapValue && mapValue.canHandle) {
|
||||
if (!mapValue || !mapValue.canHandle) {
|
||||
return null;
|
||||
}
|
||||
if (mapValue.handler) {
|
||||
// This value sanitizer can't handle this field so pass it only the next one
|
||||
return mapValue.handler.value(path, name, value, stringifyObjects);
|
||||
}
|
||||
// Check that property is valid
|
||||
if (!isString(name) || isNullOrUndefined(value) || value === STR_EMPTY) {
|
||||
return null;
|
||||
}
|
||||
var property = null;
|
||||
var fieldType = getFieldValueType(value);
|
||||
if ((fieldType & 8192 /* FieldValueSanitizerType.EventProperty */) === 8192 /* FieldValueSanitizerType.EventProperty */) {
|
||||
var subType = fieldType & ~8192 /* FieldValueSanitizerType.EventProperty */;
|
||||
property = value;
|
||||
if (!isValueAssigned(property.value) ||
|
||||
(subType !== 1 /* FieldValueSanitizerType.String */ &&
|
||||
subType !== 2 /* FieldValueSanitizerType.Number */ &&
|
||||
subType !== 3 /* FieldValueSanitizerType.Boolean */ &&
|
||||
(subType & 4096 /* FieldValueSanitizerType.Array */) !== 4096 /* FieldValueSanitizerType.Array */)) {
|
||||
// Not a supported IEventProperty type to be able to sanitize
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (fieldType === 1 /* FieldValueSanitizerType.String */ ||
|
||||
fieldType === 2 /* FieldValueSanitizerType.Number */ ||
|
||||
fieldType === 3 /* FieldValueSanitizerType.Boolean */ ||
|
||||
(fieldType & 4096 /* FieldValueSanitizerType.Array */) === 4096 /* FieldValueSanitizerType.Array */) {
|
||||
// If the property isn't IEventProperty (and is either string, number, boolean or array), convert it into one.
|
||||
property = _convertToProperty(path, name, value);
|
||||
}
|
||||
else if (fieldType === 4 /* FieldValueSanitizerType.Object */) {
|
||||
property = _convertToProperty(path, name, !!stringifyObjects ? JSON.stringify(value) : value);
|
||||
}
|
||||
if (property) {
|
||||
return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
_self.property = function (path, name, property, stringifyObjects) {
|
||||
var mapValue = _getFieldSanitizer(path, name);
|
||||
if (!mapValue || !mapValue.canHandle) {
|
||||
return null;
|
||||
}
|
||||
// Check that property is valid
|
||||
if (!isString(name) || isNullOrUndefined(property) || !isValueAssigned(property.value)) {
|
||||
return null;
|
||||
}
|
||||
var fieldType = getFieldValueType(property.value);
|
||||
if (fieldType === 0 /* FieldValueSanitizerType.NotSet */) {
|
||||
// Not a supported field that we can sanitize or serialize
|
||||
return null;
|
||||
}
|
||||
return _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects);
|
||||
};
|
||||
function _handleProperty(mapValue, path, name, fieldType, property, stringifyObjects) {
|
||||
if (mapValue.handler) {
|
||||
// This value sanitizer can't handle this field so pass it only the next one
|
||||
return mapValue.handler.property(path, name, property, stringifyObjects);
|
||||
}
|
||||
// If either pii or cc is set convert value to string (since only string pii/cc is allowed).
|
||||
// If the value is a complex type like an array that can't be converted to string we will drop
|
||||
// the property.
|
||||
if (!isNullOrUndefined(property.kind)) {
|
||||
if ((fieldType & 4096 /* FieldValueSanitizerType.Array */) === 4096 /* FieldValueSanitizerType.Array */ || !isValueKind(property.kind)) {
|
||||
return null;
|
||||
}
|
||||
// Convert the value to a string and assign back to the original value
|
||||
property.value = property.value.toString();
|
||||
}
|
||||
return _callFieldSanitizer(mapValue.fieldHandler, path, name, fieldType, property);
|
||||
}
|
||||
function _convertToProperty(path, name, value) {
|
||||
if (isValueAssigned(value)) {
|
||||
return { value: value };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function _callFieldSanitizer(fieldProvider, path, name, theType, property) {
|
||||
if (property && fieldProvider) {
|
||||
var sanitizer = fieldProvider.getSanitizer(path, name, theType, property.kind, property.propertyType);
|
||||
if (sanitizer) {
|
||||
// This is where we the field will call the handler to "scrub" the value. This the primary hook for the ClientHashing Plugin to
|
||||
// be able to apply the hashFunc() / Sha256 conversion of the properties value
|
||||
if (theType === 4 /* FieldValueSanitizerType.Object */) {
|
||||
// Special case of an embedded object (ext.metadata, data.properties)
|
||||
var newValue_1 = {};
|
||||
var propValue = property.value;
|
||||
objForEachKey(propValue, function (propKey, theValue) {
|
||||
var newPath = path + "." + name;
|
||||
if (isValueAssigned(theValue)) {
|
||||
var newProp = _convertToProperty(newPath, propKey, theValue);
|
||||
newProp = _callFieldSanitizer(fieldProvider, newPath, propKey, getFieldValueType(theValue), newProp);
|
||||
if (newProp) {
|
||||
newValue_1[propKey] = newProp.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
property.value = newValue_1;
|
||||
}
|
||||
else {
|
||||
var details = {
|
||||
path: path,
|
||||
name: name,
|
||||
type: theType,
|
||||
prop: property,
|
||||
sanitizer: _self
|
||||
};
|
||||
property = sanitizer.call(_self, details);
|
||||
}
|
||||
}
|
||||
}
|
||||
return property;
|
||||
}
|
||||
}
|
||||
ValueSanitizer.getFieldType = getFieldValueType;
|
||||
return ValueSanitizer;
|
||||
}());
|
||||
export { ValueSanitizer };
|
1304
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist/ms.core.js
generated
vendored
Normal file
1304
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist/ms.core.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist/ms.core.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/dist/ms.core.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/package.json
generated
vendored
Normal file
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/package.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "@microsoft/1ds-core-js",
|
||||
"version": "3.2.13",
|
||||
"description": "Microsoft Application Insights JavaScript SDK - 1ds-core-js extensions",
|
||||
"author": "Microsoft Application Insights Team",
|
||||
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"ai-min": "grunt core-min",
|
||||
"ai-restore": "grunt core-restore",
|
||||
"publishPackage": "npm publish",
|
||||
"docs": "typedoc --out docs docs --excludePrivate --excludeProtected --tsconfig lib/tsconfig.json --theme minimal",
|
||||
"sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
|
||||
"npm-pack": "npm pack"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/ApplicationInsights-JS"
|
||||
},
|
||||
"main": "dist/ms.core.js",
|
||||
"module": "dist-esm/src/Index.js",
|
||||
"keywords": [
|
||||
"1ds",
|
||||
"azure",
|
||||
"cloud",
|
||||
"script errors",
|
||||
"microsoft",
|
||||
"application insights",
|
||||
"Js",
|
||||
"SDK"
|
||||
],
|
||||
"types": "dist-esm/src/Index.d.ts",
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "^2.0.2",
|
||||
"@microsoft/applicationinsights-core-js": "2.8.15",
|
||||
"@microsoft/dynamicproto-js": "^1.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "^1.4.1",
|
||||
"typescript": "^4.3.5"
|
||||
}
|
||||
}
|
24
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/tsconfig.json
generated
vendored
Normal file
24
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-core-js/tsconfig.json
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"module": "es6",
|
||||
"moduleResolution": "Node",
|
||||
"target": "es3",
|
||||
"alwaysStrict": true,
|
||||
"strictNullChecks": false,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"importHelpers": true,
|
||||
"noEmitHelpers": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"outDir": "dist-esm/src/"
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules/"
|
||||
]
|
||||
}
|
21
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/LICENSE.TXT
generated
vendored
Normal file
21
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/LICENSE.TXT
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
17
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/NOTICE
generated
vendored
Normal file
17
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/NOTICE
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
NOTICES AND INFORMATION
|
||||
Do Not Translate or Localize
|
||||
|
||||
This software incorporates material from third parties. Microsoft makes certain
|
||||
open source code available at https://3rdpartysource.microsoft.com, or you may
|
||||
send a check or money order for US $5.00, including the product name, the open
|
||||
source component name, and version number, to:
|
||||
|
||||
Source Code Compliance Team
|
||||
Microsoft Corporation
|
||||
One Microsoft Way
|
||||
Redmond, WA 98052
|
||||
USA
|
||||
|
||||
Notwithstanding any other terms, you may reverse engineer this software to the
|
||||
extent required to debug changes to any libraries licensed under the GNU Lesser
|
||||
General Public License.
|
3
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/PRIVACY
generated
vendored
Normal file
3
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/PRIVACY
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Data Collection
|
||||
|
||||
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
|
41
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/SECURITY.md
generated
vendored
Normal file
41
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/SECURITY.md
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
|
||||
|
||||
## Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
## Policy
|
||||
|
||||
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
||||
|
||||
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
4545
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.gbl.js
generated
vendored
Normal file
4545
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.gbl.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.gbl.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.gbl.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.integrity.json
generated
vendored
Normal file
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.integrity.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "ms.post",
|
||||
"version": "3.2.13",
|
||||
"ext": {
|
||||
"@gbl.js": {
|
||||
"file": "ms.post-3.2.13.gbl.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-3nBRm7HRSUI9+pBWas220pRM4zIde/2HZx9UuLc2thc= sha384-gb450pL8z95KgphWiXozxpNgxW6L635+Ugmf515HtNyBwsQQRhuDSdxBQCsOYBBK sha512-ju1j53HRv1+jHc/mNfnVD/hW2a2ojF8IUnmy5xJxeIhAAozVbxwSECHCbsql0JzjBGnRvi3ObU/Mdg/RqblTZQ==",
|
||||
"hashes": {
|
||||
"sha256": "3nBRm7HRSUI9+pBWas220pRM4zIde/2HZx9UuLc2thc=",
|
||||
"sha384": "gb450pL8z95KgphWiXozxpNgxW6L635+Ugmf515HtNyBwsQQRhuDSdxBQCsOYBBK",
|
||||
"sha512": "ju1j53HRv1+jHc/mNfnVD/hW2a2ojF8IUnmy5xJxeIhAAozVbxwSECHCbsql0JzjBGnRvi3ObU/Mdg/RqblTZQ=="
|
||||
}
|
||||
},
|
||||
"@gbl.min.js": {
|
||||
"file": "ms.post-3.2.13.gbl.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-IfOnOjX1tZZTjg4fxZXM8RY1HsZxh9ZDlfvbD3uYv/M= sha384-+ybkWbjTGX27SgwZi2lTMjfT2wjEOYwwCt6jlWLR/Jn8U0137G4QrDVLVOYw9W2m sha512-rbi7Hj9pCY2qKerfdcon+GAj/TQdVFliS5ewgiC1nmuwfF0TxUZlvGDzOAQchG+n6uivrNfr70a57H5P41EZag==",
|
||||
"hashes": {
|
||||
"sha256": "IfOnOjX1tZZTjg4fxZXM8RY1HsZxh9ZDlfvbD3uYv/M=",
|
||||
"sha384": "+ybkWbjTGX27SgwZi2lTMjfT2wjEOYwwCt6jlWLR/Jn8U0137G4QrDVLVOYw9W2m",
|
||||
"sha512": "rbi7Hj9pCY2qKerfdcon+GAj/TQdVFliS5ewgiC1nmuwfF0TxUZlvGDzOAQchG+n6uivrNfr70a57H5P41EZag=="
|
||||
}
|
||||
},
|
||||
"@js": {
|
||||
"file": "ms.post-3.2.13.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-7RwUOASWq7N/vjJcDcXljElPWaOAw3lxEAWY1Et0Sog= sha384-UOZfVU2kkakKoBvfm9/0tuxOMZ4IvZuV4fbTQA/UcRlyvNXELwBeXtOS23291cZH sha512-0RmyCBRtbZu9rLaztbLM5O2BlUhulRRoy5Ghkh8pFnxM9obeLCblZ2l3ycDUoenzZItIhnC9cBJ+S89XocPQNg==",
|
||||
"hashes": {
|
||||
"sha256": "7RwUOASWq7N/vjJcDcXljElPWaOAw3lxEAWY1Et0Sog=",
|
||||
"sha384": "UOZfVU2kkakKoBvfm9/0tuxOMZ4IvZuV4fbTQA/UcRlyvNXELwBeXtOS23291cZH",
|
||||
"sha512": "0RmyCBRtbZu9rLaztbLM5O2BlUhulRRoy5Ghkh8pFnxM9obeLCblZ2l3ycDUoenzZItIhnC9cBJ+S89XocPQNg=="
|
||||
}
|
||||
},
|
||||
"@min.js": {
|
||||
"file": "ms.post-3.2.13.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-aydMP/5++lC41S8PgoXAj7oXW1vqxgx5Yzq5hqCGRzc= sha384-uOoc91rz4C5nh+RB6LejF5X1EviQatCEYRjg056vKZP8m1RgJU0Zib1DXEsaL7GY sha512-aQRmFdvsYHZdGMDA022aZ3+keOPk0UGqjUhd1GMSYUYKR8NTigIVH3eDffc2BAg+PB9TSwMOGyd/Htz4rFeYnw==",
|
||||
"hashes": {
|
||||
"sha256": "aydMP/5++lC41S8PgoXAj7oXW1vqxgx5Yzq5hqCGRzc=",
|
||||
"sha384": "uOoc91rz4C5nh+RB6LejF5X1EviQatCEYRjg056vKZP8m1RgJU0Zib1DXEsaL7GY",
|
||||
"sha512": "aQRmFdvsYHZdGMDA022aZ3+keOPk0UGqjUhd1GMSYUYKR8NTigIVH3eDffc2BAg+PB9TSwMOGyd/Htz4rFeYnw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
4549
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.js
generated
vendored
Normal file
4549
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post-3.2.13.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4545
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.gbl.js
generated
vendored
Normal file
4545
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.gbl.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.gbl.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.gbl.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.integrity.json
generated
vendored
Normal file
46
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.integrity.json
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"name": "ms.post",
|
||||
"version": "3.2.13",
|
||||
"ext": {
|
||||
"@gbl.js": {
|
||||
"file": "ms.post.gbl.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-4jTrsDjL4+ha4Nt1DTfu2XOsDPrBiX1lSlvMpR800es= sha384-KYAE2hGHDeMNT/gm/6TvBt8vY63SlV+I2WHpE44WThPrvc5UtnljVP+V0LRXV5ET sha512-Sz6A405Jsio3A7pwIs6wORWZpdo/a/QUK08JGGLCArfAmxLbt8ljIhio0iFwqD90Q2hYS53OBApwGg8fOuigUw==",
|
||||
"hashes": {
|
||||
"sha256": "4jTrsDjL4+ha4Nt1DTfu2XOsDPrBiX1lSlvMpR800es=",
|
||||
"sha384": "KYAE2hGHDeMNT/gm/6TvBt8vY63SlV+I2WHpE44WThPrvc5UtnljVP+V0LRXV5ET",
|
||||
"sha512": "Sz6A405Jsio3A7pwIs6wORWZpdo/a/QUK08JGGLCArfAmxLbt8ljIhio0iFwqD90Q2hYS53OBApwGg8fOuigUw=="
|
||||
}
|
||||
},
|
||||
"@gbl.min.js": {
|
||||
"file": "ms.post.gbl.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-Hz92xBgGENEbzFUmpZRL0fMKddOpW9hyQsFq1DJ/o+s= sha384-hIKluwtRRXnMUFEVokozF50z5UKk+eA8Ox3XoE4MhrhrWLdvTnIu0TKA+wiLz71e sha512-jav2tj02PM+FjVH85S4O54xeVVMN0Y4nk5SuGlORHwXJqpB8rP9IC5DocTvfIaXlOCzfYclBDo3sgOXSBcr1MA==",
|
||||
"hashes": {
|
||||
"sha256": "Hz92xBgGENEbzFUmpZRL0fMKddOpW9hyQsFq1DJ/o+s=",
|
||||
"sha384": "hIKluwtRRXnMUFEVokozF50z5UKk+eA8Ox3XoE4MhrhrWLdvTnIu0TKA+wiLz71e",
|
||||
"sha512": "jav2tj02PM+FjVH85S4O54xeVVMN0Y4nk5SuGlORHwXJqpB8rP9IC5DocTvfIaXlOCzfYclBDo3sgOXSBcr1MA=="
|
||||
}
|
||||
},
|
||||
"@js": {
|
||||
"file": "ms.post.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-f3Dsm5rWivCD1z7xHmxNIWUnQVfWGbTFHteXtBfJmVM= sha384-+MFgC8T6kqOdOdsGt8Dlv+WldBxA9OwbASTT/iDqALANt5AxxuHvwEMWmMjZdMqd sha512-yEQ/A+n3z2VHZ6HwSRu6gritTgI+xc/qp+ED8UJ3fSo7RwsbtTTYrfPv8+GEkdjs+EUT46BvkZ2Q/D67fuzM9A==",
|
||||
"hashes": {
|
||||
"sha256": "f3Dsm5rWivCD1z7xHmxNIWUnQVfWGbTFHteXtBfJmVM=",
|
||||
"sha384": "+MFgC8T6kqOdOdsGt8Dlv+WldBxA9OwbASTT/iDqALANt5AxxuHvwEMWmMjZdMqd",
|
||||
"sha512": "yEQ/A+n3z2VHZ6HwSRu6gritTgI+xc/qp+ED8UJ3fSo7RwsbtTTYrfPv8+GEkdjs+EUT46BvkZ2Q/D67fuzM9A=="
|
||||
}
|
||||
},
|
||||
"@min.js": {
|
||||
"file": "ms.post.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-42XmGxam79aS2As2lKPlARKDohtplUvUd/atcp5io2o= sha384-vfNbqCEHCEi09zMJpiw6/rnXAZv7k8dbDxIBUFjF59q7Sold3SO/jAYbgijq+XSz sha512-RCm54k8NvMjPopH+MNum1jauzh8kNatCy56+1ILv23P29HBjTjrBQDbMvUJBuFnFVpyMnE2yarwWFH2O4u0UtA==",
|
||||
"hashes": {
|
||||
"sha256": "42XmGxam79aS2As2lKPlARKDohtplUvUd/atcp5io2o=",
|
||||
"sha384": "vfNbqCEHCEi09zMJpiw6/rnXAZv7k8dbDxIBUFjF59q7Sold3SO/jAYbgijq+XSz",
|
||||
"sha512": "RCm54k8NvMjPopH+MNum1jauzh8kNatCy56+1ILv23P29HBjTjrBQDbMvUJBuFnFVpyMnE2yarwWFH2O4u0UtA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
4549
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.js
generated
vendored
Normal file
4549
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/bundle/ms.post.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/BatchNotificationActions.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/BatchNotificationActions.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
export {};
|
91
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/ClockSkewManager.js
generated
vendored
Normal file
91
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/ClockSkewManager.js
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* ClockSkewManager.ts
|
||||
* @author Abhilash Panwar (abpanwar)
|
||||
* @copyright Microsoft 2018
|
||||
*/
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
/**
|
||||
* Class to manage clock skew correction.
|
||||
*/
|
||||
var ClockSkewManager = /** @class */ (function () {
|
||||
function ClockSkewManager() {
|
||||
var _allowRequestSending = true;
|
||||
var _shouldAddClockSkewHeaders = true;
|
||||
var _isFirstRequest = true;
|
||||
var _clockSkewHeaderValue = "use-collector-delta";
|
||||
var _clockSkewSet = false;
|
||||
dynamicProto(ClockSkewManager, this, function (_self) {
|
||||
/**
|
||||
* Determine if requests can be sent.
|
||||
* @returns True if requests can be sent, false otherwise.
|
||||
*/
|
||||
_self.allowRequestSending = function () {
|
||||
return _allowRequestSending;
|
||||
};
|
||||
/**
|
||||
* Tells the ClockSkewManager that it should assume that the first request has now been sent,
|
||||
* If this method had not yet been called AND the clock Skew had not been set this will set
|
||||
* allowRequestSending to false until setClockSet() is called.
|
||||
*/
|
||||
_self.firstRequestSent = function () {
|
||||
if (_isFirstRequest) {
|
||||
_isFirstRequest = false;
|
||||
if (!_clockSkewSet) {
|
||||
// Block sending until we get the first clock Skew
|
||||
_allowRequestSending = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Determine if clock skew headers should be added to the request.
|
||||
* @returns True if clock skew headers should be added, false otherwise.
|
||||
*/
|
||||
_self.shouldAddClockSkewHeaders = function () {
|
||||
return _shouldAddClockSkewHeaders;
|
||||
};
|
||||
/**
|
||||
* Gets the clock skew header value.
|
||||
* @returns The clock skew header value.
|
||||
*/
|
||||
_self.getClockSkewHeaderValue = function () {
|
||||
return _clockSkewHeaderValue;
|
||||
};
|
||||
/**
|
||||
* Sets the clock skew header value. Once clock skew is set this method
|
||||
* is no-op.
|
||||
* @param timeDeltaInMillis - Time delta to be saved as the clock skew header value.
|
||||
*/
|
||||
_self.setClockSkew = function (timeDeltaInMillis) {
|
||||
if (!_clockSkewSet) {
|
||||
if (timeDeltaInMillis) {
|
||||
_clockSkewHeaderValue = timeDeltaInMillis;
|
||||
_shouldAddClockSkewHeaders = true;
|
||||
_clockSkewSet = true;
|
||||
}
|
||||
else {
|
||||
_shouldAddClockSkewHeaders = false;
|
||||
}
|
||||
// Unblock sending
|
||||
_allowRequestSending = true;
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
// Removed Stub for ClockSkewManager.prototype.allowRequestSending.
|
||||
// Removed Stub for ClockSkewManager.prototype.firstRequestSent.
|
||||
// Removed Stub for ClockSkewManager.prototype.shouldAddClockSkewHeaders.
|
||||
// Removed Stub for ClockSkewManager.prototype.getClockSkewHeaderValue.
|
||||
// Removed Stub for ClockSkewManager.prototype.setClockSkew.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
ClockSkewManager.__ieDyn=1;
|
||||
|
||||
return ClockSkewManager;
|
||||
}());
|
||||
export default ClockSkewManager;
|
20
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/DataModels.js
generated
vendored
Normal file
20
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/DataModels.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* Real Time profile (default profile). RealTime Latency events are sent every 1 sec and
|
||||
* Normal Latency events are sent every 2 sec.
|
||||
*/
|
||||
export var RT_PROFILE = "REAL_TIME";
|
||||
/**
|
||||
* Near Real Time profile. RealTime Latency events are sent every 3 sec and
|
||||
* Normal Latency events are sent every 6 sec.
|
||||
*/
|
||||
export var NRT_PROFILE = "NEAR_REAL_TIME";
|
||||
/**
|
||||
* Best Effort. RealTime Latency events are sent every 9 sec and
|
||||
* Normal Latency events are sent every 18 sec.
|
||||
*/
|
||||
export var BE_PROFILE = "BEST_EFFORT";
|
91
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/EventBatch.js
generated
vendored
Normal file
91
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/EventBatch.js
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* EventBatch.ts
|
||||
* @author Nev Wylie (newylie)
|
||||
* @copyright Microsoft 2020
|
||||
*/
|
||||
import { isNullOrUndefined, isValueAssigned } from "@microsoft/1ds-core-js";
|
||||
import { STR_EMPTY, STR_MSFPC } from "./InternalConstants";
|
||||
function _getEventMsfpc(theEvent) {
|
||||
var intWeb = ((theEvent.ext || {})["intweb"]);
|
||||
if (intWeb && isValueAssigned(intWeb[STR_MSFPC])) {
|
||||
return intWeb[STR_MSFPC];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function _getMsfpc(theEvents) {
|
||||
var msfpc = null;
|
||||
for (var lp = 0; msfpc === null && lp < theEvents.length; lp++) {
|
||||
msfpc = _getEventMsfpc(theEvents[lp]);
|
||||
}
|
||||
return msfpc;
|
||||
}
|
||||
/**
|
||||
* This class defines a "batch" events related to a specific iKey, it is used by the PostChannel and HttpManager
|
||||
* to collect and transfer ownership of events without duplicating them in-memory. This reduces the previous
|
||||
* array duplication and shared ownership issues that occurred due to race conditions caused by the async nature
|
||||
* of sending requests.
|
||||
*/
|
||||
var EventBatch = /** @class */ (function () {
|
||||
/**
|
||||
* Private constructor so that caller is forced to use the static create method.
|
||||
* @param iKey - The iKey to associate with the events (not validated)
|
||||
* @param addEvents - The optional collection of events to assign to this batch - defaults to an empty array.
|
||||
*/
|
||||
function EventBatch(iKey, addEvents) {
|
||||
var events = addEvents ? [].concat(addEvents) : [];
|
||||
var _self = this;
|
||||
var _msfpc = _getMsfpc(events);
|
||||
_self.iKey = function () {
|
||||
return iKey;
|
||||
};
|
||||
_self.Msfpc = function () {
|
||||
// return the cached value unless it's undefined -- used to avoid cpu
|
||||
return _msfpc || STR_EMPTY;
|
||||
};
|
||||
_self.count = function () {
|
||||
return events.length;
|
||||
};
|
||||
_self.events = function () {
|
||||
return events;
|
||||
};
|
||||
_self.addEvent = function (theEvent) {
|
||||
if (theEvent) {
|
||||
events.push(theEvent);
|
||||
if (!_msfpc) {
|
||||
// Not found so try and find one
|
||||
_msfpc = _getEventMsfpc(theEvent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
_self.split = function (fromEvent, numEvents) {
|
||||
// Create a new batch with the same iKey
|
||||
var theEvents;
|
||||
if (fromEvent < events.length) {
|
||||
var cnt = events.length - fromEvent;
|
||||
if (!isNullOrUndefined(numEvents)) {
|
||||
cnt = numEvents < cnt ? numEvents : cnt;
|
||||
}
|
||||
theEvents = events.splice(fromEvent, cnt);
|
||||
// reset the fetched msfpc value
|
||||
_msfpc = _getMsfpc(events);
|
||||
}
|
||||
return new EventBatch(iKey, theEvents);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Creates a new Event Batch object
|
||||
* @param iKey The iKey associated with this batch of events
|
||||
*/
|
||||
EventBatch.create = function (iKey, theEvents) {
|
||||
return new EventBatch(iKey, theEvents);
|
||||
};
|
||||
return EventBatch;
|
||||
}());
|
||||
export { EventBatch };
|
1085
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/HttpManager.js
generated
vendored
Normal file
1085
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/HttpManager.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
14
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/Index.js
generated
vendored
Normal file
14
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/Index.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* @name Index.ts
|
||||
* @author Abhilash Panwar (abpanwar)
|
||||
* @copyright Microsoft 2018
|
||||
* File to export public classes.
|
||||
*/
|
||||
import PostChannel from "./PostChannel";
|
||||
import { BE_PROFILE, NRT_PROFILE, RT_PROFILE, } from "./DataModels";
|
||||
export { PostChannel, BE_PROFILE, NRT_PROFILE, RT_PROFILE, };
|
40
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/InternalConstants.js
generated
vendored
Normal file
40
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/InternalConstants.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
|
||||
// Licensed under the MIT License.
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// 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!!!
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Generally you should only put values that are used more than 2 times and then only if not already exposed as a constant (such as SdkCoreNames)
|
||||
// as when using "short" named values from here they will be will be minified smaller than the SdkCoreNames[eSdkCoreNames.xxxx] value.
|
||||
export var STR_EMPTY = "";
|
||||
export var STR_POST_METHOD = "POST";
|
||||
export var STR_DISABLED_PROPERTY_NAME = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation";
|
||||
export var STR_DROPPED = "drop";
|
||||
export var STR_SENDING = "send";
|
||||
export var STR_REQUEUE = "requeue";
|
||||
export var STR_RESPONSE_FAIL = "rspFail";
|
||||
export var STR_OTHER = "oth";
|
||||
export var DEFAULT_CACHE_CONTROL = "no-cache, no-store";
|
||||
export var DEFAULT_CONTENT_TYPE = "application/x-json-stream";
|
||||
export var STR_CACHE_CONTROL = "cache-control";
|
||||
export var STR_CONTENT_TYPE_HEADER = "content-type";
|
||||
export var STR_KILL_TOKENS_HEADER = "kill-tokens";
|
||||
export var STR_KILL_DURATION_HEADER = "kill-duration";
|
||||
export var STR_KILL_DURATION_SECONDS_HEADER = "kill-duration-seconds";
|
||||
export var STR_TIME_DELTA_HEADER = "time-delta-millis";
|
||||
export var STR_CLIENT_VERSION = "client-version";
|
||||
export var STR_CLIENT_ID = "client-id";
|
||||
export var STR_TIME_DELTA_TO_APPLY = "time-delta-to-apply-millis";
|
||||
export var STR_UPLOAD_TIME = "upload-time";
|
||||
export var STR_API_KEY = "apikey";
|
||||
export var STR_MSA_DEVICE_TICKET = "AuthMsaDeviceTicket";
|
||||
export var STR_AUTH_XTOKEN = "AuthXToken";
|
||||
export var STR_SDK_VERSION = "sdk-version";
|
||||
export var STR_NO_RESPONSE_BODY = "NoResponseBody";
|
||||
export var STR_MSFPC = "msfpc";
|
||||
export var STR_TRACE = "trace";
|
||||
export var STR_USER = "user";
|
68
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/KillSwitch.js
generated
vendored
Normal file
68
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/KillSwitch.js
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* KillSwitch.ts
|
||||
* @author Abhilash Panwar (abpanwar)
|
||||
* @copyright Microsoft 2018
|
||||
*/
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { arrForEach, dateNow, strTrim } from "@microsoft/1ds-core-js";
|
||||
var SecToMsMultiplier = 1000;
|
||||
/**
|
||||
* Class to stop certain tenants sending events.
|
||||
*/
|
||||
var KillSwitch = /** @class */ (function () {
|
||||
function KillSwitch() {
|
||||
var _killedTokenDictionary = {};
|
||||
function _normalizeTenants(values) {
|
||||
var result = [];
|
||||
if (values) {
|
||||
arrForEach(values, function (value) {
|
||||
result.push(strTrim(value));
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
dynamicProto(KillSwitch, this, function (_self) {
|
||||
_self.setKillSwitchTenants = function (killTokens, killDuration) {
|
||||
if (killTokens && killDuration) {
|
||||
try {
|
||||
var killedTokens = _normalizeTenants(killTokens.split(","));
|
||||
if (killDuration === "this-request-only") {
|
||||
return killedTokens;
|
||||
}
|
||||
var durationMs = parseInt(killDuration, 10) * SecToMsMultiplier;
|
||||
for (var i = 0; i < killedTokens.length; ++i) {
|
||||
_killedTokenDictionary[killedTokens[i]] = dateNow() + durationMs;
|
||||
}
|
||||
}
|
||||
catch (ex) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
return [];
|
||||
};
|
||||
_self.isTenantKilled = function (tenantToken) {
|
||||
var killDictionary = _killedTokenDictionary;
|
||||
var name = strTrim(tenantToken);
|
||||
if (killDictionary[name] !== undefined && killDictionary[name] > dateNow()) {
|
||||
return true;
|
||||
}
|
||||
delete killDictionary[name];
|
||||
return false;
|
||||
};
|
||||
});
|
||||
}
|
||||
// Removed Stub for KillSwitch.prototype.setKillSwitchTenants.
|
||||
// Removed Stub for KillSwitch.prototype.isTenantKilled.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
KillSwitch.__ieDyn=1;
|
||||
|
||||
return KillSwitch;
|
||||
}());
|
||||
export default KillSwitch;
|
912
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/PostChannel.js
generated
vendored
Normal file
912
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/PostChannel.js
generated
vendored
Normal file
@ -0,0 +1,912 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
||||
/**
|
||||
* PostManager.ts
|
||||
* @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie)
|
||||
* @copyright Microsoft 2018-2020
|
||||
*/
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { BaseTelemetryPlugin, EventsDiscardedReason, _throwInternal, addPageHideEventListener, addPageShowEventListener, addPageUnloadEventListener, arrForEach, createUniqueNamespace, doPerf, getWindow, isChromium, isNumber, isValueAssigned, mergeEvtNamespace, objDefineAccessors, objForEachKey, optimizeObject, removePageHideEventListener, removePageShowEventListener, removePageUnloadEventListener, setProcessTelemetryTimings } from "@microsoft/1ds-core-js";
|
||||
import { BE_PROFILE, NRT_PROFILE, RT_PROFILE } from "./DataModels";
|
||||
import { EventBatch } from "./EventBatch";
|
||||
import { HttpManager } from "./HttpManager";
|
||||
import { STR_MSA_DEVICE_TICKET, STR_TRACE, STR_USER } from "./InternalConstants";
|
||||
import { retryPolicyGetMillisToBackoffForRetry } from "./RetryPolicy";
|
||||
import { createTimeoutWrapper } from "./TimeoutOverrideWrapper";
|
||||
var FlushCheckTimer = 0.250; // This needs to be in seconds, so this is 250ms
|
||||
var MaxNumberEventPerBatch = 500;
|
||||
var EventsDroppedAtOneTime = 20;
|
||||
var MaxSendAttempts = 6;
|
||||
var MaxSyncUnloadSendAttempts = 2; // Assuming 2 based on beforeunload and unload
|
||||
var MaxBackoffCount = 4;
|
||||
var MaxConnections = 2;
|
||||
var MaxRequestRetriesBeforeBackoff = 1;
|
||||
var strEventsDiscarded = "eventsDiscarded";
|
||||
var strOverrideInstrumentationKey = "overrideInstrumentationKey";
|
||||
var strMaxEventRetryAttempts = "maxEventRetryAttempts";
|
||||
var strMaxUnloadEventRetryAttempts = "maxUnloadEventRetryAttempts";
|
||||
var strAddUnloadCb = "addUnloadCb";
|
||||
/**
|
||||
* Class that manages adding events to inbound queues and batching of events
|
||||
* into requests.
|
||||
*/
|
||||
var PostChannel = /** @class */ (function (_super) {
|
||||
__extends(PostChannel, _super);
|
||||
function PostChannel() {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.identifier = "PostChannel";
|
||||
_this.priority = 1011;
|
||||
_this.version = '3.2.13';
|
||||
var _config;
|
||||
var _isTeardownCalled = false;
|
||||
var _flushCallbackQueue = [];
|
||||
var _flushCallbackTimerId = null;
|
||||
var _paused = false;
|
||||
var _immediateQueueSize = 0;
|
||||
var _immediateQueueSizeLimit = 500;
|
||||
var _queueSize = 0;
|
||||
var _queueSizeLimit = 10000;
|
||||
var _profiles = {};
|
||||
var _currentProfile = RT_PROFILE;
|
||||
var _scheduledTimerId = null;
|
||||
var _immediateTimerId = null;
|
||||
var _currentBackoffCount = 0;
|
||||
var _timerCount = 0;
|
||||
var _xhrOverride;
|
||||
var _httpManager;
|
||||
var _batchQueues = {};
|
||||
var _autoFlushEventsLimit;
|
||||
// either MaxBatchSize * (1+ Max Connections) or _queueLimit / 6 (where 3 latency Queues [normal, realtime, cost deferred] * 2 [allow half full -- allow for retry])
|
||||
var _autoFlushBatchLimit;
|
||||
var _delayedBatchSendLatency = -1;
|
||||
var _delayedBatchReason;
|
||||
var _optimizeObject = true;
|
||||
var _isPageUnloadTriggered = false;
|
||||
var _maxEventSendAttempts = MaxSendAttempts;
|
||||
var _maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts;
|
||||
var _evtNamespace;
|
||||
var _timeoutWrapper;
|
||||
dynamicProto(PostChannel, _this, function (_self, _base) {
|
||||
_initDefaults();
|
||||
// Special internal method to allow the DebugPlugin to hook embedded objects
|
||||
_self["_getDbgPlgTargets"] = function () {
|
||||
return [_httpManager];
|
||||
};
|
||||
_self.initialize = function (coreConfig, core, extensions) {
|
||||
doPerf(core, function () { return "PostChannel:initialize"; }, function () {
|
||||
var extendedCore = core;
|
||||
_base.initialize(coreConfig, core, extensions);
|
||||
try {
|
||||
var hasAddUnloadCb = !!core[strAddUnloadCb];
|
||||
_evtNamespace = mergeEvtNamespace(createUniqueNamespace(_self.identifier), core.evtNamespace && core.evtNamespace());
|
||||
var ctx = _self._getTelCtx();
|
||||
coreConfig.extensionConfig[_self.identifier] = coreConfig.extensionConfig[_self.identifier] || {};
|
||||
_config = ctx.getExtCfg(_self.identifier);
|
||||
_timeoutWrapper = createTimeoutWrapper(_config.setTimeoutOverride, _config.clearTimeoutOverride);
|
||||
// Only try and use the optimizeObject() if this appears to be a chromium based browser and it has not been explicitly disabled
|
||||
_optimizeObject = !_config.disableOptimizeObj && isChromium();
|
||||
_hookWParam(extendedCore);
|
||||
if (_config.eventsLimitInMem > 0) {
|
||||
_queueSizeLimit = _config.eventsLimitInMem;
|
||||
}
|
||||
if (_config.immediateEventLimit > 0) {
|
||||
_immediateQueueSizeLimit = _config.immediateEventLimit;
|
||||
}
|
||||
if (_config.autoFlushEventsLimit > 0) {
|
||||
_autoFlushEventsLimit = _config.autoFlushEventsLimit;
|
||||
}
|
||||
if (isNumber(_config[strMaxEventRetryAttempts])) {
|
||||
_maxEventSendAttempts = _config[strMaxEventRetryAttempts];
|
||||
}
|
||||
if (isNumber(_config[strMaxUnloadEventRetryAttempts])) {
|
||||
_maxUnloadEventSendAttempts = _config[strMaxUnloadEventRetryAttempts];
|
||||
}
|
||||
_setAutoLimits();
|
||||
if (_config.httpXHROverride && _config.httpXHROverride.sendPOST) {
|
||||
_xhrOverride = _config.httpXHROverride;
|
||||
}
|
||||
if (isValueAssigned(coreConfig.anonCookieName)) {
|
||||
_httpManager.addQueryStringParameter("anoncknm", coreConfig.anonCookieName);
|
||||
}
|
||||
_httpManager.sendHook = _config.payloadPreprocessor;
|
||||
_httpManager.sendListener = _config.payloadListener;
|
||||
// Override endpointUrl if provided in Post config
|
||||
var endpointUrl = _config.overrideEndpointUrl ? _config.overrideEndpointUrl : coreConfig.endpointUrl;
|
||||
_self._notificationManager = core.getNotifyMgr();
|
||||
_httpManager.initialize(endpointUrl, _self.core, _self, _xhrOverride, _config);
|
||||
var excludePageUnloadEvents = coreConfig.disablePageUnloadEvents || [];
|
||||
// When running in Web browsers try to send all telemetry if page is unloaded
|
||||
addPageUnloadEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace);
|
||||
addPageHideEventListener(_handleUnloadEvents, excludePageUnloadEvents, _evtNamespace);
|
||||
addPageShowEventListener(_handleShowEvents, coreConfig.disablePageShowEvents, _evtNamespace);
|
||||
}
|
||||
catch (e) {
|
||||
// resetting the initialized state because of failure
|
||||
_self.setInitialized(false);
|
||||
throw e;
|
||||
}
|
||||
}, function () { return ({ coreConfig: coreConfig, core: core, extensions: extensions }); });
|
||||
};
|
||||
_self.processTelemetry = function (ev, itemCtx) {
|
||||
setProcessTelemetryTimings(ev, _self.identifier);
|
||||
itemCtx = _self._getTelCtx(itemCtx);
|
||||
// Get the channel instance from the current request/instance
|
||||
var channelConfig = itemCtx.getExtCfg(_self.identifier);
|
||||
// DisableTelemetry was defined in the config provided during initialization
|
||||
var disableTelemetry = !!_config.disableTelemetry;
|
||||
if (channelConfig) {
|
||||
// DisableTelemetry is defined in the config for this request/instance
|
||||
disableTelemetry = disableTelemetry || !!channelConfig.disableTelemetry;
|
||||
}
|
||||
var event = ev;
|
||||
if (!disableTelemetry && !_isTeardownCalled) {
|
||||
// Override iKey if provided in Post config if provided for during initialization
|
||||
if (_config[strOverrideInstrumentationKey]) {
|
||||
event.iKey = _config[strOverrideInstrumentationKey];
|
||||
}
|
||||
// Override iKey if provided in Post config if provided for this instance
|
||||
if (channelConfig && channelConfig[strOverrideInstrumentationKey]) {
|
||||
event.iKey = channelConfig[strOverrideInstrumentationKey];
|
||||
}
|
||||
_addEventToQueues(event, true);
|
||||
if (_isPageUnloadTriggered) {
|
||||
// Unload event has been received so we need to try and flush new events
|
||||
_releaseAllQueues(2 /* EventSendType.SendBeacon */, 2 /* SendRequestReason.Unload */);
|
||||
}
|
||||
else {
|
||||
_scheduleTimer();
|
||||
}
|
||||
}
|
||||
_self.processNext(event, itemCtx);
|
||||
};
|
||||
_self._doTeardown = function (unloadCtx, unloadState) {
|
||||
_releaseAllQueues(2 /* EventSendType.SendBeacon */, 2 /* SendRequestReason.Unload */);
|
||||
_isTeardownCalled = true;
|
||||
_httpManager.teardown();
|
||||
removePageUnloadEventListener(null, _evtNamespace);
|
||||
removePageHideEventListener(null, _evtNamespace);
|
||||
removePageShowEventListener(null, _evtNamespace);
|
||||
// Just register to remove all events associated with this namespace
|
||||
_initDefaults();
|
||||
};
|
||||
function _hookWParam(extendedCore) {
|
||||
var existingGetWParamMethod = extendedCore.getWParam;
|
||||
extendedCore.getWParam = function () {
|
||||
var wparam = 0;
|
||||
if (_config.ignoreMc1Ms0CookieProcessing) {
|
||||
wparam = wparam | 2;
|
||||
}
|
||||
return wparam | existingGetWParamMethod();
|
||||
};
|
||||
}
|
||||
// Moving event handlers out from the initialize closure so that any local variables can be garbage collected
|
||||
function _handleUnloadEvents(evt) {
|
||||
var theEvt = evt || getWindow().event; // IE 8 does not pass the event
|
||||
if (theEvt.type !== "beforeunload") {
|
||||
// Only set the unload trigger if not beforeunload event as beforeunload can be cancelled while the other events can't
|
||||
_isPageUnloadTriggered = true;
|
||||
_httpManager.setUnloading(_isPageUnloadTriggered);
|
||||
}
|
||||
_releaseAllQueues(2 /* EventSendType.SendBeacon */, 2 /* SendRequestReason.Unload */);
|
||||
}
|
||||
function _handleShowEvents(evt) {
|
||||
// Handle the page becoming visible again
|
||||
_isPageUnloadTriggered = false;
|
||||
_httpManager.setUnloading(_isPageUnloadTriggered);
|
||||
}
|
||||
function _addEventToQueues(event, append) {
|
||||
// If send attempt field is undefined we should set it to 0.
|
||||
if (!event.sendAttempt) {
|
||||
event.sendAttempt = 0;
|
||||
}
|
||||
// Add default latency
|
||||
if (!event.latency) {
|
||||
event.latency = 1 /* EventLatencyValue.Normal */;
|
||||
}
|
||||
// Remove extra AI properties if present
|
||||
if (event.ext && event.ext[STR_TRACE]) {
|
||||
delete (event.ext[STR_TRACE]);
|
||||
}
|
||||
if (event.ext && event.ext[STR_USER] && event.ext[STR_USER]["id"]) {
|
||||
delete (event.ext[STR_USER]["id"]);
|
||||
}
|
||||
// v8 performance optimization for iterating over the keys
|
||||
if (_optimizeObject) {
|
||||
setProcessTelemetryTimings;
|
||||
event.ext = optimizeObject(event.ext);
|
||||
if (event.baseData) {
|
||||
event.baseData = optimizeObject(event.baseData);
|
||||
}
|
||||
if (event.data) {
|
||||
event.data = optimizeObject(event.data);
|
||||
}
|
||||
}
|
||||
if (event.sync) {
|
||||
// If the transmission is backed off then do not send synchronous events.
|
||||
// We will convert these events to Real time latency instead.
|
||||
if (_currentBackoffCount || _paused) {
|
||||
event.latency = 3 /* EventLatencyValue.RealTime */;
|
||||
event.sync = false;
|
||||
}
|
||||
else {
|
||||
// Log the event synchronously
|
||||
if (_httpManager) {
|
||||
// v8 performance optimization for iterating over the keys
|
||||
if (_optimizeObject) {
|
||||
event = optimizeObject(event);
|
||||
}
|
||||
_httpManager.sendSynchronousBatch(EventBatch.create(event.iKey, [event]), event.sync === true ? 1 /* EventSendType.Synchronous */ : event.sync, 3 /* SendRequestReason.SyncEvent */);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
var evtLatency = event.latency;
|
||||
var queueSize = _queueSize;
|
||||
var queueLimit = _queueSizeLimit;
|
||||
if (evtLatency === 4 /* EventLatencyValue.Immediate */) {
|
||||
queueSize = _immediateQueueSize;
|
||||
queueLimit = _immediateQueueSizeLimit;
|
||||
}
|
||||
var eventDropped = false;
|
||||
// Only add the event if the queue isn't full or it's a direct event (which don't add to the queue sizes)
|
||||
if (queueSize < queueLimit) {
|
||||
eventDropped = !_addEventToProperQueue(event, append);
|
||||
}
|
||||
else {
|
||||
var dropLatency = 1 /* EventLatencyValue.Normal */;
|
||||
var dropNumber = EventsDroppedAtOneTime;
|
||||
if (evtLatency === 4 /* EventLatencyValue.Immediate */) {
|
||||
// Only drop other immediate events as they are not technically sharing the general queue
|
||||
dropLatency = 4 /* EventLatencyValue.Immediate */;
|
||||
dropNumber = 1;
|
||||
}
|
||||
// Drop old event from lower or equal latency
|
||||
eventDropped = true;
|
||||
if (_dropEventWithLatencyOrLess(event.iKey, event.latency, dropLatency, dropNumber)) {
|
||||
eventDropped = !_addEventToProperQueue(event, append);
|
||||
}
|
||||
}
|
||||
if (eventDropped) {
|
||||
// Can't drop events from current queues because the all the slots are taken by queues that are being flushed.
|
||||
_notifyEvents(strEventsDiscarded, [event], EventsDiscardedReason.QueueFull);
|
||||
}
|
||||
}
|
||||
_self.setEventQueueLimits = function (eventLimit, autoFlushLimit) {
|
||||
_queueSizeLimit = eventLimit > 0 ? eventLimit : 10000;
|
||||
_autoFlushEventsLimit = autoFlushLimit > 0 ? autoFlushLimit : 0;
|
||||
_setAutoLimits();
|
||||
// We only do this check here as during normal event addition if the queue is > then events start getting dropped
|
||||
var doFlush = _queueSize > eventLimit;
|
||||
if (!doFlush && _autoFlushBatchLimit > 0) {
|
||||
// Check the auto flush max batch size
|
||||
for (var latency = 1 /* EventLatencyValue.Normal */; !doFlush && latency <= 3 /* EventLatencyValue.RealTime */; latency++) {
|
||||
var batchQueue = _batchQueues[latency];
|
||||
if (batchQueue && batchQueue.batches) {
|
||||
arrForEach(batchQueue.batches, function (theBatch) {
|
||||
if (theBatch && theBatch.count() >= _autoFlushBatchLimit) {
|
||||
// If any 1 batch is > than the limit then trigger an auto flush
|
||||
doFlush = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
_performAutoFlush(true, doFlush);
|
||||
};
|
||||
_self.pause = function () {
|
||||
_clearScheduledTimer();
|
||||
_paused = true;
|
||||
_httpManager.pause();
|
||||
};
|
||||
_self.resume = function () {
|
||||
_paused = false;
|
||||
_httpManager.resume();
|
||||
_scheduleTimer();
|
||||
};
|
||||
_self.addResponseHandler = function (responseHandler) {
|
||||
_httpManager._responseHandlers.push(responseHandler);
|
||||
};
|
||||
_self._loadTransmitProfiles = function (profiles) {
|
||||
_resetTransmitProfiles();
|
||||
objForEachKey(profiles, function (profileName, profileValue) {
|
||||
var profLen = profileValue.length;
|
||||
if (profLen >= 2) {
|
||||
var directValue = (profLen > 2 ? profileValue[2] : 0);
|
||||
profileValue.splice(0, profLen - 2);
|
||||
// Make sure if a higher latency is set to not send then don't send lower latency
|
||||
if (profileValue[1] < 0) {
|
||||
profileValue[0] = -1;
|
||||
}
|
||||
// Make sure each latency is multiple of the latency higher then it. If not a multiple
|
||||
// we round up so that it becomes a multiple.
|
||||
if (profileValue[1] > 0 && profileValue[0] > 0) {
|
||||
var timerMultiplier = profileValue[0] / profileValue[1];
|
||||
profileValue[0] = Math.ceil(timerMultiplier) * profileValue[1];
|
||||
}
|
||||
// Add back the direct profile timeout
|
||||
if (directValue >= 0 && profileValue[1] >= 0 && directValue > profileValue[1]) {
|
||||
// Make sure if it's not disabled (< 0) then make sure it's not larger than RealTime
|
||||
directValue = profileValue[1];
|
||||
}
|
||||
profileValue.push(directValue);
|
||||
_profiles[profileName] = profileValue;
|
||||
}
|
||||
});
|
||||
};
|
||||
_self.flush = function (async, callback, sendReason) {
|
||||
if (async === void 0) { async = true; }
|
||||
if (!_paused) {
|
||||
sendReason = sendReason || 1 /* SendRequestReason.ManualFlush */;
|
||||
if (async) {
|
||||
if (_flushCallbackTimerId == null) {
|
||||
// Clear the normal schedule timer as we are going to try and flush ASAP
|
||||
_clearScheduledTimer();
|
||||
// Move all queued events to the HttpManager so that we don't discard new events (Auto flush scenario)
|
||||
_queueBatches(1 /* EventLatencyValue.Normal */, 0 /* EventSendType.Batched */, sendReason);
|
||||
_flushCallbackTimerId = _createTimer(function () {
|
||||
_flushCallbackTimerId = null;
|
||||
_flushImpl(callback, sendReason);
|
||||
}, 0);
|
||||
}
|
||||
else {
|
||||
// Even if null (no callback) this will ensure after the flushImpl finishes waiting
|
||||
// for a completely idle connection it will attempt to re-flush any queued events on the next cycle
|
||||
_flushCallbackQueue.push(callback);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Clear the normal schedule timer as we are going to try and flush ASAP
|
||||
var cleared = _clearScheduledTimer();
|
||||
// Now cause all queued events to be sent synchronously
|
||||
_sendEventsForLatencyAndAbove(1 /* EventLatencyValue.Normal */, 1 /* EventSendType.Synchronous */, sendReason);
|
||||
if (callback !== null && callback !== undefined) {
|
||||
callback();
|
||||
}
|
||||
if (cleared) {
|
||||
// restart the normal event timer if it was cleared
|
||||
_scheduleTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
_self.setMsaAuthTicket = function (ticket) {
|
||||
_httpManager.addHeader(STR_MSA_DEVICE_TICKET, ticket);
|
||||
};
|
||||
_self.hasEvents = _hasEvents;
|
||||
_self._setTransmitProfile = function (profileName) {
|
||||
if (_currentProfile !== profileName && _profiles[profileName] !== undefined) {
|
||||
_clearScheduledTimer();
|
||||
_currentProfile = profileName;
|
||||
_scheduleTimer();
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Batch and send events currently in the queue for the given latency.
|
||||
* @param latency - Latency for which to send events.
|
||||
*/
|
||||
function _sendEventsForLatencyAndAbove(latency, sendType, sendReason) {
|
||||
var queued = _queueBatches(latency, sendType, sendReason);
|
||||
// Always trigger the request as while the post channel may not have queued additional events, the httpManager may already have waiting events
|
||||
_httpManager.sendQueuedRequests(sendType, sendReason);
|
||||
return queued;
|
||||
}
|
||||
function _hasEvents() {
|
||||
return _queueSize > 0;
|
||||
}
|
||||
/**
|
||||
* Try to schedule the timer after which events will be sent. If there are
|
||||
* no events to be sent, or there is already a timer scheduled, or the
|
||||
* http manager doesn't have any idle connections this method is no-op.
|
||||
*/
|
||||
function _scheduleTimer() {
|
||||
// If we had previously attempted to send requests, but the http manager didn't have any idle connections then the requests where delayed
|
||||
// so try and requeue then again now
|
||||
if (_delayedBatchSendLatency >= 0 && _queueBatches(_delayedBatchSendLatency, 0 /* EventSendType.Batched */, _delayedBatchReason)) {
|
||||
_httpManager.sendQueuedRequests(0 /* EventSendType.Batched */, _delayedBatchReason);
|
||||
}
|
||||
if (_immediateQueueSize > 0 && !_immediateTimerId && !_paused) {
|
||||
// During initialization _profiles enforce that the direct [2] is less than real time [1] timer value
|
||||
// If the immediateTimeout is disabled the immediate events will be sent with Real Time events
|
||||
var immediateTimeOut = _profiles[_currentProfile][2];
|
||||
if (immediateTimeOut >= 0) {
|
||||
_immediateTimerId = _createTimer(function () {
|
||||
_immediateTimerId = null;
|
||||
// Only try to send direct events
|
||||
_sendEventsForLatencyAndAbove(4 /* EventLatencyValue.Immediate */, 0 /* EventSendType.Batched */, 1 /* SendRequestReason.NormalSchedule */);
|
||||
_scheduleTimer();
|
||||
}, immediateTimeOut);
|
||||
}
|
||||
}
|
||||
// During initialization the _profiles enforce that the normal [0] is a multiple of the real time [1] timer value
|
||||
var timeOut = _profiles[_currentProfile][1];
|
||||
if (!_scheduledTimerId && !_flushCallbackTimerId && timeOut >= 0 && !_paused) {
|
||||
if (_hasEvents()) {
|
||||
_scheduledTimerId = _createTimer(function () {
|
||||
_scheduledTimerId = null;
|
||||
_sendEventsForLatencyAndAbove(_timerCount === 0 ? 3 /* EventLatencyValue.RealTime */ : 1 /* EventLatencyValue.Normal */, 0 /* EventSendType.Batched */, 1 /* SendRequestReason.NormalSchedule */);
|
||||
// Increment the count for next cycle
|
||||
_timerCount++;
|
||||
_timerCount %= 2;
|
||||
_scheduleTimer();
|
||||
}, timeOut);
|
||||
}
|
||||
else {
|
||||
_timerCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
_self._backOffTransmission = function () {
|
||||
if (_currentBackoffCount < MaxBackoffCount) {
|
||||
_currentBackoffCount++;
|
||||
_clearScheduledTimer();
|
||||
_scheduleTimer();
|
||||
}
|
||||
};
|
||||
_self._clearBackOff = function () {
|
||||
if (_currentBackoffCount) {
|
||||
_currentBackoffCount = 0;
|
||||
_clearScheduledTimer();
|
||||
_scheduleTimer();
|
||||
}
|
||||
};
|
||||
function _initDefaults() {
|
||||
_config = null;
|
||||
_isTeardownCalled = false;
|
||||
_flushCallbackQueue = [];
|
||||
_flushCallbackTimerId = null;
|
||||
_paused = false;
|
||||
_immediateQueueSize = 0;
|
||||
_immediateQueueSizeLimit = 500;
|
||||
_queueSize = 0;
|
||||
_queueSizeLimit = 10000;
|
||||
_profiles = {};
|
||||
_currentProfile = RT_PROFILE;
|
||||
_scheduledTimerId = null;
|
||||
_immediateTimerId = null;
|
||||
_currentBackoffCount = 0;
|
||||
_timerCount = 0;
|
||||
_xhrOverride = null;
|
||||
_batchQueues = {};
|
||||
_autoFlushEventsLimit = undefined;
|
||||
// either MaxBatchSize * (1+ Max Connections) or _queueLimit / 6 (where 3 latency Queues [normal, realtime, cost deferred] * 2 [allow half full -- allow for retry])
|
||||
_autoFlushBatchLimit = 0;
|
||||
_delayedBatchSendLatency = -1;
|
||||
_delayedBatchReason = null;
|
||||
_optimizeObject = true;
|
||||
_isPageUnloadTriggered = false;
|
||||
_maxEventSendAttempts = MaxSendAttempts;
|
||||
_maxUnloadEventSendAttempts = MaxSyncUnloadSendAttempts;
|
||||
_evtNamespace = null;
|
||||
_timeoutWrapper = createTimeoutWrapper();
|
||||
_httpManager = new HttpManager(MaxNumberEventPerBatch, MaxConnections, MaxRequestRetriesBeforeBackoff, {
|
||||
requeue: _requeueEvents,
|
||||
send: _sendingEvent,
|
||||
sent: _eventsSentEvent,
|
||||
drop: _eventsDropped,
|
||||
rspFail: _eventsResponseFail,
|
||||
oth: _otherEvent
|
||||
}, _timeoutWrapper);
|
||||
_initializeProfiles();
|
||||
_clearQueues();
|
||||
_setAutoLimits();
|
||||
}
|
||||
function _createTimer(theTimerFunc, timeOut) {
|
||||
// If the transmission is backed off make the timer at least 1 sec to allow for back off.
|
||||
if (timeOut === 0 && _currentBackoffCount) {
|
||||
timeOut = 1;
|
||||
}
|
||||
var timerMultiplier = 1000;
|
||||
if (_currentBackoffCount) {
|
||||
timerMultiplier = retryPolicyGetMillisToBackoffForRetry(_currentBackoffCount - 1);
|
||||
}
|
||||
return _timeoutWrapper.set(theTimerFunc, timeOut * timerMultiplier);
|
||||
}
|
||||
function _clearScheduledTimer() {
|
||||
if (_scheduledTimerId !== null) {
|
||||
_timeoutWrapper.clear(_scheduledTimerId);
|
||||
_scheduledTimerId = null;
|
||||
_timerCount = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Try to send all queued events using beacons if available
|
||||
function _releaseAllQueues(sendType, sendReason) {
|
||||
_clearScheduledTimer();
|
||||
// Cancel all flush callbacks
|
||||
if (_flushCallbackTimerId) {
|
||||
_timeoutWrapper.clear(_flushCallbackTimerId);
|
||||
_flushCallbackTimerId = null;
|
||||
}
|
||||
if (!_paused) {
|
||||
// Queue all the remaining requests to be sent. The requests will be sent using HTML5 Beacons if they are available.
|
||||
_sendEventsForLatencyAndAbove(1 /* EventLatencyValue.Normal */, sendType, sendReason);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Add empty queues for all latencies in the inbound queues map. This is called
|
||||
* when Transmission Manager is being flushed. This ensures that new events added
|
||||
* after flush are stored separately till we flush the current events.
|
||||
*/
|
||||
function _clearQueues() {
|
||||
_batchQueues[4 /* EventLatencyValue.Immediate */] = {
|
||||
batches: [],
|
||||
iKeyMap: {}
|
||||
};
|
||||
_batchQueues[3 /* EventLatencyValue.RealTime */] = {
|
||||
batches: [],
|
||||
iKeyMap: {}
|
||||
};
|
||||
_batchQueues[2 /* EventLatencyValue.CostDeferred */] = {
|
||||
batches: [],
|
||||
iKeyMap: {}
|
||||
};
|
||||
_batchQueues[1 /* EventLatencyValue.Normal */] = {
|
||||
batches: [],
|
||||
iKeyMap: {}
|
||||
};
|
||||
}
|
||||
function _getEventBatch(iKey, latency, create) {
|
||||
var batchQueue = _batchQueues[latency];
|
||||
if (!batchQueue) {
|
||||
latency = 1 /* EventLatencyValue.Normal */;
|
||||
batchQueue = _batchQueues[latency];
|
||||
}
|
||||
var eventBatch = batchQueue.iKeyMap[iKey];
|
||||
if (!eventBatch && create) {
|
||||
eventBatch = EventBatch.create(iKey);
|
||||
batchQueue.batches.push(eventBatch);
|
||||
batchQueue.iKeyMap[iKey] = eventBatch;
|
||||
}
|
||||
return eventBatch;
|
||||
}
|
||||
function _performAutoFlush(isAsync, doFlush) {
|
||||
// Only perform the auto flush check if the httpManager has an idle connection and we are not in a backoff situation
|
||||
if (_httpManager.canSendRequest() && !_currentBackoffCount) {
|
||||
if (_autoFlushEventsLimit > 0 && _queueSize > _autoFlushEventsLimit) {
|
||||
// Force flushing
|
||||
doFlush = true;
|
||||
}
|
||||
if (doFlush && _flushCallbackTimerId == null) {
|
||||
// Auto flush the queue
|
||||
_self.flush(isAsync, null, 20 /* SendRequestReason.MaxQueuedEvents */);
|
||||
}
|
||||
}
|
||||
}
|
||||
function _addEventToProperQueue(event, append) {
|
||||
// v8 performance optimization for iterating over the keys
|
||||
if (_optimizeObject) {
|
||||
event = optimizeObject(event);
|
||||
}
|
||||
var latency = event.latency;
|
||||
var eventBatch = _getEventBatch(event.iKey, latency, true);
|
||||
if (eventBatch.addEvent(event)) {
|
||||
if (latency !== 4 /* EventLatencyValue.Immediate */) {
|
||||
_queueSize++;
|
||||
// Check for auto flushing based on total events in the queue, but not for requeued or retry events
|
||||
if (append && event.sendAttempt === 0) {
|
||||
// Force the flushing of the batch if the batch (specific iKey / latency combination) reaches it's auto flush limit
|
||||
_performAutoFlush(!event.sync, _autoFlushBatchLimit > 0 && eventBatch.count() >= _autoFlushBatchLimit);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Direct events don't need auto flushing as they are scheduled (by default) for immediate delivery
|
||||
_immediateQueueSize++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function _dropEventWithLatencyOrLess(iKey, latency, currentLatency, dropNumber) {
|
||||
while (currentLatency <= latency) {
|
||||
var eventBatch = _getEventBatch(iKey, latency, true);
|
||||
if (eventBatch && eventBatch.count() > 0) {
|
||||
// Dropped oldest events from lowest possible latency
|
||||
var droppedEvents = eventBatch.split(0, dropNumber);
|
||||
var droppedCount = droppedEvents.count();
|
||||
if (droppedCount > 0) {
|
||||
if (currentLatency === 4 /* EventLatencyValue.Immediate */) {
|
||||
_immediateQueueSize -= droppedCount;
|
||||
}
|
||||
else {
|
||||
_queueSize -= droppedCount;
|
||||
}
|
||||
_notifyBatchEvents(strEventsDiscarded, [droppedEvents], EventsDiscardedReason.QueueFull);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
currentLatency++;
|
||||
}
|
||||
// Unable to drop any events -- lets just make sure the queue counts are correct to avoid exhaustion
|
||||
_resetQueueCounts();
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Internal helper to reset the queue counts, used as a backstop to avoid future queue exhaustion errors
|
||||
* that might occur because of counting issues.
|
||||
*/
|
||||
function _resetQueueCounts() {
|
||||
var immediateQueue = 0;
|
||||
var normalQueue = 0;
|
||||
var _loop_1 = function (latency) {
|
||||
var batchQueue = _batchQueues[latency];
|
||||
if (batchQueue && batchQueue.batches) {
|
||||
arrForEach(batchQueue.batches, function (theBatch) {
|
||||
if (latency === 4 /* EventLatencyValue.Immediate */) {
|
||||
immediateQueue += theBatch.count();
|
||||
}
|
||||
else {
|
||||
normalQueue += theBatch.count();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
for (var latency = 1 /* EventLatencyValue.Normal */; latency <= 4 /* EventLatencyValue.Immediate */; latency++) {
|
||||
_loop_1(latency);
|
||||
}
|
||||
_queueSize = normalQueue;
|
||||
_immediateQueueSize = immediateQueue;
|
||||
}
|
||||
function _queueBatches(latency, sendType, sendReason) {
|
||||
var eventsQueued = false;
|
||||
var isAsync = sendType === 0 /* EventSendType.Batched */;
|
||||
// Only queue batches (to the HttpManager) if this is a sync request or the httpManager has an idle connection
|
||||
// Thus keeping the events within the PostChannel until the HttpManager has a connection available
|
||||
// This is so we can drop "old" events if the queue is getting full because we can't successfully send events
|
||||
if (!isAsync || _httpManager.canSendRequest()) {
|
||||
doPerf(_self.core, function () { return "PostChannel._queueBatches"; }, function () {
|
||||
var droppedEvents = [];
|
||||
var latencyToProcess = 4 /* EventLatencyValue.Immediate */;
|
||||
while (latencyToProcess >= latency) {
|
||||
var batchQueue = _batchQueues[latencyToProcess];
|
||||
if (batchQueue && batchQueue.batches && batchQueue.batches.length > 0) {
|
||||
arrForEach(batchQueue.batches, function (theBatch) {
|
||||
// Add the batch to the http manager to send the requests
|
||||
if (!_httpManager.addBatch(theBatch)) {
|
||||
// The events from this iKey are being dropped (killed)
|
||||
droppedEvents = droppedEvents.concat(theBatch.events());
|
||||
}
|
||||
else {
|
||||
eventsQueued = eventsQueued || (theBatch && theBatch.count() > 0);
|
||||
}
|
||||
if (latencyToProcess === 4 /* EventLatencyValue.Immediate */) {
|
||||
_immediateQueueSize -= theBatch.count();
|
||||
}
|
||||
else {
|
||||
_queueSize -= theBatch.count();
|
||||
}
|
||||
});
|
||||
// Remove all batches from this Queue
|
||||
batchQueue.batches = [];
|
||||
batchQueue.iKeyMap = {};
|
||||
}
|
||||
latencyToProcess--;
|
||||
}
|
||||
if (droppedEvents.length > 0) {
|
||||
_notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.KillSwitch);
|
||||
}
|
||||
if (eventsQueued && _delayedBatchSendLatency >= latency) {
|
||||
// We have queued events at the same level as the delayed values so clear the setting
|
||||
_delayedBatchSendLatency = -1;
|
||||
_delayedBatchReason = 0 /* SendRequestReason.Undefined */;
|
||||
}
|
||||
}, function () { return ({ latency: latency, sendType: sendType, sendReason: sendReason }); }, !isAsync);
|
||||
}
|
||||
else {
|
||||
// remember the min latency so that we can re-trigger later
|
||||
_delayedBatchSendLatency = _delayedBatchSendLatency >= 0 ? Math.min(_delayedBatchSendLatency, latency) : latency;
|
||||
_delayedBatchReason = Math.max(_delayedBatchReason, sendReason);
|
||||
}
|
||||
return eventsQueued;
|
||||
}
|
||||
/**
|
||||
* This is the callback method is called as part of the manual flushing process.
|
||||
* @param callback
|
||||
* @param sendReason
|
||||
*/
|
||||
function _flushImpl(callback, sendReason) {
|
||||
// Add any additional queued events and cause all queued events to be sent asynchronously
|
||||
_sendEventsForLatencyAndAbove(1 /* EventLatencyValue.Normal */, 0 /* EventSendType.Batched */, sendReason);
|
||||
// All events (should) have been queue -- lets just make sure the queue counts are correct to avoid queue exhaustion (previous bug #9685112)
|
||||
_resetQueueCounts();
|
||||
_waitForIdleManager(function () {
|
||||
// Only called AFTER the httpManager does not have any outstanding requests
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
if (_flushCallbackQueue.length > 0) {
|
||||
_flushCallbackTimerId = _createTimer(function () {
|
||||
_flushCallbackTimerId = null;
|
||||
_flushImpl(_flushCallbackQueue.shift(), sendReason);
|
||||
}, 0);
|
||||
}
|
||||
else {
|
||||
// No more flush requests
|
||||
_flushCallbackTimerId = null;
|
||||
// Restart the normal timer schedule
|
||||
_scheduleTimer();
|
||||
}
|
||||
});
|
||||
}
|
||||
function _waitForIdleManager(callback) {
|
||||
if (_httpManager.isCompletelyIdle()) {
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
_flushCallbackTimerId = _createTimer(function () {
|
||||
_flushCallbackTimerId = null;
|
||||
_waitForIdleManager(callback);
|
||||
}, FlushCheckTimer);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Resets the transmit profiles to the default profiles of Real Time, Near Real Time
|
||||
* and Best Effort. This removes all the custom profiles that were loaded.
|
||||
*/
|
||||
function _resetTransmitProfiles() {
|
||||
_clearScheduledTimer();
|
||||
_initializeProfiles();
|
||||
_currentProfile = RT_PROFILE;
|
||||
_scheduleTimer();
|
||||
}
|
||||
function _initializeProfiles() {
|
||||
_profiles = {};
|
||||
_profiles[RT_PROFILE] = [2, 1, 0];
|
||||
_profiles[NRT_PROFILE] = [6, 3, 0];
|
||||
_profiles[BE_PROFILE] = [18, 9, 0];
|
||||
}
|
||||
/**
|
||||
* The notification handler for requeue events
|
||||
* @ignore
|
||||
*/
|
||||
function _requeueEvents(batches, reason) {
|
||||
var droppedEvents = [];
|
||||
var maxSendAttempts = _maxEventSendAttempts;
|
||||
if (_isPageUnloadTriggered) {
|
||||
// If a page unlaod has been triggered reduce the number of times we try to "retry"
|
||||
maxSendAttempts = _maxUnloadEventSendAttempts;
|
||||
}
|
||||
arrForEach(batches, function (theBatch) {
|
||||
if (theBatch && theBatch.count() > 0) {
|
||||
arrForEach(theBatch.events(), function (theEvent) {
|
||||
if (theEvent) {
|
||||
// Check if the request being added back is for a sync event in which case mark it no longer a sync event
|
||||
if (theEvent.sync) {
|
||||
theEvent.latency = 4 /* EventLatencyValue.Immediate */;
|
||||
theEvent.sync = false;
|
||||
}
|
||||
if (theEvent.sendAttempt < maxSendAttempts) {
|
||||
// Reset the event timings
|
||||
setProcessTelemetryTimings(theEvent, _self.identifier);
|
||||
_addEventToQueues(theEvent, false);
|
||||
}
|
||||
else {
|
||||
droppedEvents.push(theEvent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if (droppedEvents.length > 0) {
|
||||
_notifyEvents(strEventsDiscarded, droppedEvents, EventsDiscardedReason.NonRetryableStatus);
|
||||
}
|
||||
if (_isPageUnloadTriggered) {
|
||||
// Unload event has been received so we need to try and flush new events
|
||||
_releaseAllQueues(2 /* EventSendType.SendBeacon */, 2 /* SendRequestReason.Unload */);
|
||||
}
|
||||
}
|
||||
function _callNotification(evtName, theArgs) {
|
||||
var manager = (_self._notificationManager || {});
|
||||
var notifyFunc = manager[evtName];
|
||||
if (notifyFunc) {
|
||||
try {
|
||||
notifyFunc.apply(manager, theArgs);
|
||||
}
|
||||
catch (e) {
|
||||
_throwInternal(_self.diagLog(), 1 /* eLoggingSeverity.CRITICAL */, 74 /* _eInternalMessageId.NotificationException */, evtName + " notification failed: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
function _notifyEvents(evtName, theEvents) {
|
||||
var extraArgs = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
extraArgs[_i - 2] = arguments[_i];
|
||||
}
|
||||
if (theEvents && theEvents.length > 0) {
|
||||
_callNotification(evtName, [theEvents].concat(extraArgs));
|
||||
}
|
||||
}
|
||||
function _notifyBatchEvents(evtName, batches) {
|
||||
var extraArgs = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
extraArgs[_i - 2] = arguments[_i];
|
||||
}
|
||||
if (batches && batches.length > 0) {
|
||||
arrForEach(batches, function (theBatch) {
|
||||
if (theBatch && theBatch.count() > 0) {
|
||||
_callNotification(evtName, [theBatch.events()].concat(extraArgs));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The notification handler for when batches are about to be sent
|
||||
* @ignore
|
||||
*/
|
||||
function _sendingEvent(batches, reason, isSyncRequest) {
|
||||
if (batches && batches.length > 0) {
|
||||
_callNotification("eventsSendRequest", [(reason >= 1000 /* EventBatchNotificationReason.SendingUndefined */ && reason <= 1999 /* EventBatchNotificationReason.SendingEventMax */ ?
|
||||
reason - 1000 /* EventBatchNotificationReason.SendingUndefined */ :
|
||||
0 /* SendRequestReason.Undefined */), isSyncRequest !== true]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This event represents that a batch of events have been successfully sent and a response received
|
||||
* @param batches The notification handler for when the batches have been successfully sent
|
||||
* @param reason For this event the reason will always be EventBatchNotificationReason.Complete
|
||||
*/
|
||||
function _eventsSentEvent(batches, reason) {
|
||||
_notifyBatchEvents("eventsSent", batches, reason);
|
||||
// Try and schedule the processing timer if we have events
|
||||
_scheduleTimer();
|
||||
}
|
||||
function _eventsDropped(batches, reason) {
|
||||
_notifyBatchEvents(strEventsDiscarded, batches, (reason >= 8000 /* EventBatchNotificationReason.EventsDropped */ && reason <= 8999 /* EventBatchNotificationReason.EventsDroppedMax */ ?
|
||||
reason - 8000 /* EventBatchNotificationReason.EventsDropped */ :
|
||||
EventsDiscardedReason.Unknown));
|
||||
}
|
||||
function _eventsResponseFail(batches) {
|
||||
_notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.NonRetryableStatus);
|
||||
// Try and schedule the processing timer if we have events
|
||||
_scheduleTimer();
|
||||
}
|
||||
function _otherEvent(batches, reason) {
|
||||
_notifyBatchEvents(strEventsDiscarded, batches, EventsDiscardedReason.Unknown);
|
||||
// Try and schedule the processing timer if we have events
|
||||
_scheduleTimer();
|
||||
}
|
||||
function _setAutoLimits() {
|
||||
if (!_config || !_config.disableAutoBatchFlushLimit) {
|
||||
_autoFlushBatchLimit = Math.max(MaxNumberEventPerBatch * (MaxConnections + 1), _queueSizeLimit / 6);
|
||||
}
|
||||
else {
|
||||
_autoFlushBatchLimit = 0;
|
||||
}
|
||||
}
|
||||
// Provided for backward compatibility they are not "expected" to be in current use but they are public
|
||||
objDefineAccessors(_self, "_setTimeoutOverride", function () { return _timeoutWrapper.set; }, function (value) {
|
||||
// Recreate the timeout wrapper
|
||||
_timeoutWrapper = createTimeoutWrapper(value, _timeoutWrapper.clear);
|
||||
});
|
||||
objDefineAccessors(_self, "_clearTimeoutOverride", function () { return _timeoutWrapper.clear; }, function (value) {
|
||||
// Recreate the timeout wrapper
|
||||
_timeoutWrapper = createTimeoutWrapper(_timeoutWrapper.set, value);
|
||||
});
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
// Removed Stub for PostChannel.prototype.initialize.
|
||||
// Removed Stub for PostChannel.prototype.processTelemetry.
|
||||
// Removed Stub for PostChannel.prototype.setEventQueueLimits.
|
||||
// Removed Stub for PostChannel.prototype.pause.
|
||||
// Removed Stub for PostChannel.prototype.resume.
|
||||
// Removed Stub for PostChannel.prototype.addResponseHandler.
|
||||
// Removed Stub for PostChannel.prototype.flush.
|
||||
// Removed Stub for PostChannel.prototype.setMsaAuthTicket.
|
||||
// Removed Stub for PostChannel.prototype.hasEvents.
|
||||
// Removed Stub for PostChannel.prototype._loadTransmitProfiles.
|
||||
// Removed Stub for PostChannel.prototype._setTransmitProfile.
|
||||
// Removed Stub for PostChannel.prototype._backOffTransmission.
|
||||
// Removed Stub for PostChannel.prototype._clearBackOff.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
PostChannel.__ieDyn=1;
|
||||
|
||||
return PostChannel;
|
||||
}(BaseTelemetryPlugin));
|
||||
export default PostChannel;
|
49
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/RetryPolicy.js
generated
vendored
Normal file
49
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/RetryPolicy.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* RetryPolicy.ts
|
||||
* @author Abhilash Panwar (abpanwar)
|
||||
* @copyright Microsoft 2018
|
||||
*/
|
||||
var RandomizationLowerThreshold = 0.8;
|
||||
var RandomizationUpperThreshold = 1.2;
|
||||
var BaseBackoff = 3000;
|
||||
var MaxBackoff = 600000;
|
||||
/**
|
||||
* Determine if the request should be retried for the given status code.
|
||||
* The below expression reads that we should only retry for:
|
||||
* - HttpStatusCodes that are smaller than 300.
|
||||
* - HttpStatusCodes greater or equal to 500 (except for 501-NotImplement
|
||||
* and 505-HttpVersionNotSupport).
|
||||
* - HttpStatusCode 408-RequestTimeout.
|
||||
* - HttpStatusCode 429.
|
||||
* This is based on Microsoft.WindowsAzure.Storage.RetryPolicies.ExponentialRetry class
|
||||
* @param httpStatusCode - The status code returned for the request.
|
||||
* @returns True if request should be retried, false otherwise.
|
||||
*/
|
||||
export function retryPolicyShouldRetryForStatus(httpStatusCode) {
|
||||
/* tslint:disable:triple-equals */
|
||||
// Disabling triple-equals rule to avoid httpOverrides from failing because they are returning a string value
|
||||
return !((httpStatusCode >= 300 && httpStatusCode < 500 && httpStatusCode != 408 && httpStatusCode != 429)
|
||||
|| (httpStatusCode == 501)
|
||||
|| (httpStatusCode == 505));
|
||||
/* tslint:enable:triple-equals */
|
||||
}
|
||||
/**
|
||||
* Gets the number of milliseconds to back off before retrying the request. The
|
||||
* back off duration is exponentially scaled based on the number of retries already
|
||||
* done for the request.
|
||||
* @param retriesSoFar - The number of times the request has already been retried.
|
||||
* @returns The back off duration for the request before it can be retried.
|
||||
*/
|
||||
export function retryPolicyGetMillisToBackoffForRetry(retriesSoFar) {
|
||||
var waitDuration = 0;
|
||||
var minBackoff = BaseBackoff * RandomizationLowerThreshold;
|
||||
var maxBackoff = BaseBackoff * RandomizationUpperThreshold;
|
||||
var randomBackoff = Math.floor(Math.random() * (maxBackoff - minBackoff)) + minBackoff;
|
||||
waitDuration = Math.pow(2, retriesSoFar) * randomBackoff;
|
||||
return Math.min(waitDuration, MaxBackoff);
|
||||
}
|
318
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/Serializer.js
generated
vendored
Normal file
318
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/Serializer.js
generated
vendored
Normal file
@ -0,0 +1,318 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* Serializer.ts
|
||||
* @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie)
|
||||
* @copyright Microsoft 2018-2020
|
||||
*/
|
||||
// @skip-file-minify
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { arrIndexOf, doPerf, getCommonSchemaMetaData, getTenantId, isArray, isValueAssigned, objForEachKey, sanitizeProperty, strStartsWith } from "@microsoft/1ds-core-js";
|
||||
import { EventBatch } from "./EventBatch";
|
||||
import { STR_EMPTY } from "./InternalConstants";
|
||||
/**
|
||||
* Note: This is an optimization for V8-based browsers. When V8 concatenates a string,
|
||||
* the strings are only joined logically using a "cons string" or "constructed/concatenated
|
||||
* string". These containers keep references to one another and can result in very large
|
||||
* memory usage. For example, if a 2MB string is constructed by concatenating 4 bytes
|
||||
* together at a time, the memory usage will be ~44MB; so ~22x increase. The strings are
|
||||
* only joined together when an operation requiring their joining takes place, such as
|
||||
* substr(). This function is called when adding data to this buffer to ensure these
|
||||
* types of strings are periodically joined to reduce the memory footprint.
|
||||
* Setting to every 20 events as the JSON.stringify() may have joined many strings
|
||||
* and calling this too much causes a minor delay while processing.
|
||||
*/
|
||||
var _MAX_STRING_JOINS = 20;
|
||||
var RequestSizeLimitBytes = 3984588; // approx 3.8 Mb
|
||||
var BeaconRequestSizeLimitBytes = 65000; // approx 64kb (the current Edge, Firefox and Chrome max limit)
|
||||
var MaxRecordSize = 2000000; // approx 2 Mb
|
||||
var MaxBeaconRecordSize = Math.min(MaxRecordSize, BeaconRequestSizeLimitBytes);
|
||||
var metadata = "metadata";
|
||||
var f = "f";
|
||||
var rCheckDot = /\./;
|
||||
/**
|
||||
* Class to handle serialization of event and request.
|
||||
* Currently uses Bond for serialization. Please note that this may be subject to change.
|
||||
*/
|
||||
var Serializer = /** @class */ (function () {
|
||||
function Serializer(perfManager, valueSanitizer, stringifyObjects, enableCompoundKey) {
|
||||
var strData = "data";
|
||||
var strBaseData = "baseData";
|
||||
var strExt = "ext";
|
||||
var _checkForCompoundkey = !!enableCompoundKey;
|
||||
var _processSubMetaData = true;
|
||||
var _theSanitizer = valueSanitizer;
|
||||
var _isReservedCache = {};
|
||||
dynamicProto(Serializer, this, function (_self) {
|
||||
_self.createPayload = function (retryCnt, isTeardown, isSync, isReducedPayload, sendReason, sendType) {
|
||||
return {
|
||||
apiKeys: [],
|
||||
payloadBlob: STR_EMPTY,
|
||||
overflow: null,
|
||||
sizeExceed: [],
|
||||
failedEvts: [],
|
||||
batches: [],
|
||||
numEvents: 0,
|
||||
retryCnt: retryCnt,
|
||||
isTeardown: isTeardown,
|
||||
isSync: isSync,
|
||||
isBeacon: isReducedPayload,
|
||||
sendType: sendType,
|
||||
sendReason: sendReason
|
||||
};
|
||||
};
|
||||
_self.appendPayload = function (payload, theBatch, maxEventsPerBatch) {
|
||||
var canAddEvents = payload && theBatch && !payload.overflow;
|
||||
if (canAddEvents) {
|
||||
doPerf(perfManager, function () { return "Serializer:appendPayload"; }, function () {
|
||||
var theEvents = theBatch.events();
|
||||
var payloadBlob = payload.payloadBlob;
|
||||
var payloadEvents = payload.numEvents;
|
||||
var eventsAdded = false;
|
||||
var sizeExceeded = [];
|
||||
var failedEvts = [];
|
||||
var isBeaconPayload = payload.isBeacon;
|
||||
var requestMaxSize = isBeaconPayload ? BeaconRequestSizeLimitBytes : RequestSizeLimitBytes;
|
||||
var recordMaxSize = isBeaconPayload ? MaxBeaconRecordSize : MaxRecordSize;
|
||||
var lp = 0;
|
||||
var joinCount = 0;
|
||||
while (lp < theEvents.length) {
|
||||
var theEvent = theEvents[lp];
|
||||
if (theEvent) {
|
||||
if (payloadEvents >= maxEventsPerBatch) {
|
||||
// Maximum events per payload reached, so don't add any more
|
||||
payload.overflow = theBatch.split(lp);
|
||||
break;
|
||||
}
|
||||
var eventBlob = _self.getEventBlob(theEvent);
|
||||
if (eventBlob && eventBlob.length <= recordMaxSize) {
|
||||
// This event will fit into the payload
|
||||
var blobLength = eventBlob.length;
|
||||
var currentSize = payloadBlob.length;
|
||||
if (currentSize + blobLength > requestMaxSize) {
|
||||
// Request or batch size exceeded, so don't add any more to the payload
|
||||
payload.overflow = theBatch.split(lp);
|
||||
break;
|
||||
}
|
||||
if (payloadBlob) {
|
||||
payloadBlob += "\n";
|
||||
}
|
||||
payloadBlob += eventBlob;
|
||||
joinCount++;
|
||||
// v8 memory optimization only
|
||||
if (joinCount > _MAX_STRING_JOINS) {
|
||||
// this substr() should cause the constructed string to join
|
||||
payloadBlob.substr(0, 1);
|
||||
joinCount = 0;
|
||||
}
|
||||
eventsAdded = true;
|
||||
payloadEvents++;
|
||||
}
|
||||
else {
|
||||
if (eventBlob) {
|
||||
// Single event size exceeded so remove from the batch
|
||||
sizeExceeded.push(theEvent);
|
||||
}
|
||||
else {
|
||||
failedEvts.push(theEvent);
|
||||
}
|
||||
// We also need to remove this event from the existing array, otherwise a notification will be sent
|
||||
// indicating that it was successfully sent
|
||||
theEvents.splice(lp, 1);
|
||||
lp--;
|
||||
}
|
||||
}
|
||||
lp++;
|
||||
}
|
||||
if (sizeExceeded && sizeExceeded.length > 0) {
|
||||
payload.sizeExceed.push(EventBatch.create(theBatch.iKey(), sizeExceeded));
|
||||
// Remove the exceeded events from the batch
|
||||
}
|
||||
if (failedEvts && failedEvts.length > 0) {
|
||||
payload.failedEvts.push(EventBatch.create(theBatch.iKey(), failedEvts));
|
||||
// Remove the failed events from the batch
|
||||
}
|
||||
if (eventsAdded) {
|
||||
payload.batches.push(theBatch);
|
||||
payload.payloadBlob = payloadBlob;
|
||||
payload.numEvents = payloadEvents;
|
||||
var apiKey = theBatch.iKey();
|
||||
if (arrIndexOf(payload.apiKeys, apiKey) === -1) {
|
||||
payload.apiKeys.push(apiKey);
|
||||
}
|
||||
}
|
||||
}, function () { return ({ payload: payload, theBatch: { iKey: theBatch.iKey(), evts: theBatch.events() }, max: maxEventsPerBatch }); });
|
||||
}
|
||||
return canAddEvents;
|
||||
};
|
||||
_self.getEventBlob = function (eventData) {
|
||||
try {
|
||||
return doPerf(perfManager, function () { return "Serializer.getEventBlob"; }, function () {
|
||||
var serializedEvent = {};
|
||||
// Adding as dynamic keys for v8 performance
|
||||
serializedEvent.name = eventData.name;
|
||||
serializedEvent.time = eventData.time;
|
||||
serializedEvent.ver = eventData.ver;
|
||||
serializedEvent.iKey = "o:" + getTenantId(eventData.iKey);
|
||||
// Assigning local var so usage in part b/c don't throw if there is no ext
|
||||
var serializedExt = {};
|
||||
// Part A
|
||||
var eventExt = eventData[strExt];
|
||||
if (eventExt) {
|
||||
// Only assign ext if the event had one (There are tests covering this use case)
|
||||
serializedEvent[strExt] = serializedExt;
|
||||
objForEachKey(eventExt, function (key, value) {
|
||||
var data = serializedExt[key] = {};
|
||||
// Don't include a metadata callback as we don't currently set metadata Part A fields
|
||||
_processPathKeys(value, data, "ext." + key, true, null, null, true);
|
||||
});
|
||||
}
|
||||
var serializedData = serializedEvent[strData] = {};
|
||||
serializedData.baseType = eventData.baseType;
|
||||
var serializedBaseData = serializedData[strBaseData] = {};
|
||||
// Part B
|
||||
_processPathKeys(eventData.baseData, serializedBaseData, strBaseData, false, [strBaseData], function (pathKeys, name, value) {
|
||||
_addJSONPropertyMetaData(serializedExt, pathKeys, name, value);
|
||||
}, _processSubMetaData);
|
||||
// Part C
|
||||
_processPathKeys(eventData.data, serializedData, strData, false, [], function (pathKeys, name, value) {
|
||||
_addJSONPropertyMetaData(serializedExt, pathKeys, name, value);
|
||||
}, _processSubMetaData);
|
||||
return JSON.stringify(serializedEvent);
|
||||
}, function () { return ({ item: eventData }); });
|
||||
}
|
||||
catch (e) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
function _isReservedField(path, name) {
|
||||
var result = _isReservedCache[path];
|
||||
if (result === undefined) {
|
||||
if (path.length >= 7) {
|
||||
// Do not allow the changing of fields located in the ext.metadata or ext.web extension
|
||||
result = strStartsWith(path, "ext.metadata") || strStartsWith(path, "ext.web");
|
||||
}
|
||||
_isReservedCache[path] = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function _processPathKeys(srcObj, target, thePath, checkReserved, metadataPathKeys, metadataCallback, processSubKeys) {
|
||||
objForEachKey(srcObj, function (key, srcValue) {
|
||||
var prop = null;
|
||||
if (srcValue || isValueAssigned(srcValue)) {
|
||||
var path = thePath;
|
||||
var name_1 = key;
|
||||
var theMetaPathKeys = metadataPathKeys;
|
||||
var destObj = target;
|
||||
// Handle keys with embedded '.', like "TestObject.testProperty"
|
||||
if (_checkForCompoundkey && !checkReserved && rCheckDot.test(key)) {
|
||||
var subKeys = key.split(".");
|
||||
var keyLen = subKeys.length;
|
||||
if (keyLen > 1) {
|
||||
if (theMetaPathKeys) {
|
||||
// Create a copy of the meta path keys so we can add the extra ones
|
||||
theMetaPathKeys = theMetaPathKeys.slice();
|
||||
}
|
||||
for (var lp = 0; lp < keyLen - 1; lp++) {
|
||||
var subKey = subKeys[lp];
|
||||
// Add/reuse the sub key object
|
||||
destObj = destObj[subKey] = destObj[subKey] || {};
|
||||
path += "." + subKey;
|
||||
if (theMetaPathKeys) {
|
||||
theMetaPathKeys.push(subKey);
|
||||
}
|
||||
}
|
||||
name_1 = subKeys[keyLen - 1];
|
||||
}
|
||||
}
|
||||
var isReserved = checkReserved && _isReservedField(path, name_1);
|
||||
if (!isReserved && _theSanitizer && _theSanitizer.handleField(path, name_1)) {
|
||||
prop = _theSanitizer.value(path, name_1, srcValue, stringifyObjects);
|
||||
}
|
||||
else {
|
||||
prop = sanitizeProperty(name_1, srcValue, stringifyObjects);
|
||||
}
|
||||
if (prop) {
|
||||
// Set the value
|
||||
var newValue = prop.value;
|
||||
destObj[name_1] = newValue;
|
||||
if (metadataCallback) {
|
||||
metadataCallback(theMetaPathKeys, name_1, prop);
|
||||
}
|
||||
if (processSubKeys && typeof newValue === "object" && !isArray(newValue)) {
|
||||
var newPath = theMetaPathKeys;
|
||||
if (newPath) {
|
||||
newPath = newPath.slice();
|
||||
newPath.push(name_1);
|
||||
}
|
||||
// Make sure we process sub objects as well (for value sanitization and metadata)
|
||||
_processPathKeys(srcValue, newValue, path + "." + name_1, checkReserved, newPath, metadataCallback, processSubKeys);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// Removed Stub for Serializer.prototype.createPayload.
|
||||
// Removed Stub for Serializer.prototype.appendPayload.
|
||||
// Removed Stub for Serializer.prototype.getEventBlob.
|
||||
// Removed Stub for Serializer.prototype.handleField.
|
||||
// Removed Stub for Serializer.prototype.getSanitizer.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
Serializer.__ieDyn=1;
|
||||
|
||||
return Serializer;
|
||||
}());
|
||||
export { Serializer };
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _addJSONPropertyMetaData(json, propKeys, name, propertyValue) {
|
||||
if (propertyValue && json) {
|
||||
var encodedTypeValue = getCommonSchemaMetaData(propertyValue.value, propertyValue.kind, propertyValue.propertyType);
|
||||
if (encodedTypeValue > -1) {
|
||||
// Add the root metadata
|
||||
var metaData = json[metadata];
|
||||
if (!metaData) {
|
||||
// Sets the root 'f'
|
||||
metaData = json[metadata] = { f: {} };
|
||||
}
|
||||
var metaTarget = metaData[f];
|
||||
if (!metaTarget) {
|
||||
// This can occur if someone has manually added an ext.metadata object
|
||||
// Such as ext.metadata.privLevel and ext.metadata.privTags
|
||||
metaTarget = metaData[f] = {};
|
||||
}
|
||||
// Traverse the metadata path and build each object (contains an 'f' key) -- if required
|
||||
if (propKeys) {
|
||||
for (var lp = 0; lp < propKeys.length; lp++) {
|
||||
var key = propKeys[lp];
|
||||
if (!metaTarget[key]) {
|
||||
metaTarget[key] = { f: {} };
|
||||
}
|
||||
var newTarget = metaTarget[key][f];
|
||||
if (!newTarget) {
|
||||
// Not expected, but can occur if the metadata context was pre-created as part of the event
|
||||
newTarget = metaTarget[key][f] = {};
|
||||
}
|
||||
metaTarget = newTarget;
|
||||
}
|
||||
}
|
||||
metaTarget = metaTarget[name] = {};
|
||||
if (isArray(propertyValue.value)) {
|
||||
metaTarget["a"] = {
|
||||
t: encodedTypeValue
|
||||
};
|
||||
}
|
||||
else {
|
||||
metaTarget["t"] = encodedTypeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
27
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/TimeoutOverrideWrapper.js
generated
vendored
Normal file
27
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/TimeoutOverrideWrapper.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
/**
|
||||
* TimeoutOverrideWrapper.ts
|
||||
* @author Nev Wylie (newylie)
|
||||
* @copyright Microsoft 2022
|
||||
* Simple internal timeout wrapper
|
||||
*/
|
||||
export function defaultSetTimeout(callback, ms) {
|
||||
var args = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
args[_i - 2] = arguments[_i];
|
||||
}
|
||||
return setTimeout(callback, ms, args);
|
||||
}
|
||||
export function defaultClearTimeout(timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
export function createTimeoutWrapper(argSetTimeout, argClearTimeout) {
|
||||
return {
|
||||
set: argSetTimeout || defaultSetTimeout,
|
||||
clear: argClearTimeout || defaultClearTimeout
|
||||
};
|
||||
}
|
10
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/typings/XDomainRequest.js
generated
vendored
Normal file
10
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist-esm/src/typings/XDomainRequest.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
* 1DS JS SDK POST plugin, 3.2.13
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
* (Microsoft Internal Only)
|
||||
*/
|
||||
export {};
|
||||
// export declare var XDomainRequest: {
|
||||
// prototype: IXDomainRequest;
|
||||
// new (): IXDomainRequest;
|
||||
// };
|
2143
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist/ms.post.js
generated
vendored
Normal file
2143
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist/ms.post.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist/ms.post.min.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/dist/ms.post.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
45
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/package.json
generated
vendored
Normal file
45
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/package.json
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@microsoft/1ds-post-js",
|
||||
"version": "3.2.13",
|
||||
"description": "Microsoft Application Insights JavaScript SDK - 1ds-post-js extensions",
|
||||
"author": "Microsoft Application Insights Team",
|
||||
"homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"ai-min": "grunt post-min",
|
||||
"ai-restore": "grunt post-restore",
|
||||
"publishPackage": "npm publish",
|
||||
"sri": "node ../../tools/subResourceIntegrity/generateIntegrityFile.js",
|
||||
"npm-pack": "npm pack"
|
||||
},
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/applicationinsights-shims": "^2.0.2",
|
||||
"@microsoft/dynamicproto-js": "^1.1.7",
|
||||
"@microsoft/1ds-core-js": "3.2.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "^1.4.1",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/microsoft/ApplicationInsights-JS"
|
||||
},
|
||||
"main": "dist/ms.post.js",
|
||||
"module": "dist-esm/src/Index.js",
|
||||
"keywords": [
|
||||
"1ds",
|
||||
"azure",
|
||||
"cloud",
|
||||
"script errors",
|
||||
"microsoft",
|
||||
"application insights",
|
||||
"Js",
|
||||
"SDK"
|
||||
],
|
||||
"types": "dist-esm/src/Index.d.ts"
|
||||
}
|
24
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/tsconfig.json
generated
vendored
Normal file
24
vscode-server-linux-x64-web/node_modules/@microsoft/1ds-post-js/tsconfig.json
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"module": "es6",
|
||||
"moduleResolution": "Node",
|
||||
"target": "es3",
|
||||
"alwaysStrict": true,
|
||||
"strictNullChecks": false,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"importHelpers": true,
|
||||
"noEmitHelpers": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"outDir": "dist-esm/src/"
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules/"
|
||||
]
|
||||
}
|
21
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/LICENSE
generated
vendored
Normal file
21
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
17
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/NOTICE
generated
vendored
Normal file
17
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/NOTICE
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
NOTICES AND INFORMATION
|
||||
Do Not Translate or Localize
|
||||
|
||||
This software incorporates material from third parties. Microsoft makes certain
|
||||
open source code available at https://3rdpartysource.microsoft.com, or you may
|
||||
send a check or money order for US $5.00, including the product name, the open
|
||||
source component name, and version number, to:
|
||||
|
||||
Source Code Compliance Team
|
||||
Microsoft Corporation
|
||||
One Microsoft Way
|
||||
Redmond, WA 98052
|
||||
USA
|
||||
|
||||
Notwithstanding any other terms, you may reverse engineer this software to the
|
||||
extent required to debug changes to any libraries licensed under the GNU Lesser
|
||||
General Public License.
|
3
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/PRIVACY
generated
vendored
Normal file
3
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/PRIVACY
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Data Collection
|
||||
|
||||
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
|
26
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.integrity.json
generated
vendored
Normal file
26
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.integrity.json
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "applicationinsights-core-js",
|
||||
"version": "2.8.15",
|
||||
"ext": {
|
||||
"@js": {
|
||||
"file": "applicationinsights-core-js.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-VpB8AeaGXxGep7XcWSpIV5g/djdpwJHI5qemIvAA5Ls= sha384-G26swjnl9Iqy8E4tyYDI5o5wrv49USxFmhTAbH0O6hIME5SNliKsBDsU9ev23phM sha512-BvYVbKTsJRF9p8cQ6zX1l0AmETW97Jy8T8EoxR/L9a+2VwIfAKWpOV1WG3CysFF+ger942vU9T1O7H1Yi57iMg==",
|
||||
"hashes": {
|
||||
"sha256": "VpB8AeaGXxGep7XcWSpIV5g/djdpwJHI5qemIvAA5Ls=",
|
||||
"sha384": "G26swjnl9Iqy8E4tyYDI5o5wrv49USxFmhTAbH0O6hIME5SNliKsBDsU9ev23phM",
|
||||
"sha512": "BvYVbKTsJRF9p8cQ6zX1l0AmETW97Jy8T8EoxR/L9a+2VwIfAKWpOV1WG3CysFF+ger942vU9T1O7H1Yi57iMg=="
|
||||
}
|
||||
},
|
||||
"@min.js": {
|
||||
"file": "applicationinsights-core-js.min.js",
|
||||
"type": "text/javascript; charset=utf-8",
|
||||
"integrity": "sha256-vCTPei5EOVyLWqp52b4mbfiC68bv/JSyc9qmSeZgEM0= sha384-IgSDiGUXysG9kL5oLLiAxrpqKyuWF4zdtmAkFxYqw7QkxAA2wvwKV40TMzD0MY0r sha512-gDjJl2/SSF3gNjYOhq1//XGn3wRI4wGwpxKC+uKBOGVYQGF+o9y9afOoDu42K44R/ukG6KALYtKqOIt5lSmBDw==",
|
||||
"hashes": {
|
||||
"sha256": "vCTPei5EOVyLWqp52b4mbfiC68bv/JSyc9qmSeZgEM0=",
|
||||
"sha384": "IgSDiGUXysG9kL5oLLiAxrpqKyuWF4zdtmAkFxYqw7QkxAA2wvwKV40TMzD0MY0r",
|
||||
"sha512": "gDjJl2/SSF3gNjYOhq1//XGn3wRI4wGwpxKC+uKBOGVYQGF+o9y9afOoDu42K44R/ukG6KALYtKqOIt5lSmBDw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
4625
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.js
generated
vendored
Normal file
4625
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.min.js
generated
vendored
Normal file
5
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/browser/applicationinsights-core-js.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
50
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js
generated
vendored
Normal file
50
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
import { deepFreeze, objForEachKey } from "../JavaScriptSDK/HelperFuncs";
|
||||
/**
|
||||
* Create an enum style object which has both the key => value and value => key mappings
|
||||
* @param values - The values to populate on the new object
|
||||
* @returns
|
||||
*/
|
||||
export function createEnumStyle(values) {
|
||||
var enumClass = {};
|
||||
objForEachKey(values, function (field, value) {
|
||||
enumClass[field] = value;
|
||||
enumClass[value] = field;
|
||||
});
|
||||
return deepFreeze(enumClass);
|
||||
}
|
||||
/**
|
||||
* Create a 2 index map that maps an enum's key as both the key and value, X["key"] => "key" and X[0] => "keyof 0".
|
||||
* @param values - The values to populate on the new object
|
||||
* @returns
|
||||
*/
|
||||
export function createEnumMap(values) {
|
||||
var mapClass = {};
|
||||
objForEachKey(values, function (field, value) {
|
||||
mapClass[field] = field;
|
||||
mapClass[value] = field;
|
||||
});
|
||||
return deepFreeze(mapClass);
|
||||
}
|
||||
/**
|
||||
* Create a 2 index map that maps an enum's key and value to the defined map value, X["key"] => mapValue and X[0] => mapValue.
|
||||
* Generic values
|
||||
* - E = the const enum type (typeof eRequestHeaders);
|
||||
* - V = Identifies the valid values for the keys, this should include both the enum numeric and string key of the type. The
|
||||
* resulting "Value" of each entry identifies the valid values withing the assignments.
|
||||
* @param values - The values to populate on the new object
|
||||
* @returns
|
||||
*/
|
||||
export function createValueMap(values) {
|
||||
var mapClass = {};
|
||||
objForEachKey(values, function (field, value) {
|
||||
mapClass[field] = value[1];
|
||||
mapClass[value[0]] = value[1];
|
||||
});
|
||||
return deepFreeze(mapClass);
|
||||
}
|
36
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js
generated
vendored
Normal file
36
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
import { createEnumStyle } from "../JavaScriptSDK.Enums/EnumHelperFuncs";
|
||||
/**
|
||||
* The EventsDiscardedReason enumeration contains a set of values that specify the reason for discarding an event.
|
||||
*/
|
||||
export var EventsDiscardedReason = createEnumStyle({
|
||||
/**
|
||||
* Unknown.
|
||||
*/
|
||||
Unknown: 0 /* eEventsDiscardedReason.Unknown */,
|
||||
/**
|
||||
* Status set to non-retryable.
|
||||
*/
|
||||
NonRetryableStatus: 1 /* eEventsDiscardedReason.NonRetryableStatus */,
|
||||
/**
|
||||
* The event is invalid.
|
||||
*/
|
||||
InvalidEvent: 2 /* eEventsDiscardedReason.InvalidEvent */,
|
||||
/**
|
||||
* The size of the event is too large.
|
||||
*/
|
||||
SizeLimitExceeded: 3 /* eEventsDiscardedReason.SizeLimitExceeded */,
|
||||
/**
|
||||
* The server is not accepting events from this instrumentation key.
|
||||
*/
|
||||
KillSwitch: 4 /* eEventsDiscardedReason.KillSwitch */,
|
||||
/**
|
||||
* The event queue is full.
|
||||
*/
|
||||
QueueFull: 5 /* eEventsDiscardedReason.QueueFull */
|
||||
});
|
118
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js
generated
vendored
Normal file
118
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
// @skip-file-minify
|
||||
var _a;
|
||||
import { createEnumStyle } from "../JavaScriptSDK.Enums/EnumHelperFuncs";
|
||||
var FAILED = "Failed";
|
||||
var FAILED_MONITOR_AJAX = FAILED + "MonitorAjax";
|
||||
var TRACK = "Track";
|
||||
var START = "Start";
|
||||
var STOP = "Stop";
|
||||
var EVENT = "Event";
|
||||
var AUTH_CONTEXT = "AuthContext";
|
||||
var EXCEPTION = "Exception";
|
||||
var LOCAL = "Local";
|
||||
var SESSION = "Session";
|
||||
var STORAGE = "Storage";
|
||||
var BROWSER = "Browser";
|
||||
var CANNOT = "Cannot";
|
||||
var BUFFER = "Buffer";
|
||||
var INSTRUMENTATION_KEY = "InstrumentationKey";
|
||||
export var LoggingSeverity = createEnumStyle({
|
||||
CRITICAL: 1 /* eLoggingSeverity.CRITICAL */,
|
||||
WARNING: 2 /* eLoggingSeverity.WARNING */
|
||||
});
|
||||
/**
|
||||
* Internal message ID. Please create a new one for every conceptually different message. Please keep alphabetically ordered
|
||||
*/
|
||||
export var _InternalMessageId = createEnumStyle((_a = {},
|
||||
// Non user actionable
|
||||
_a[BROWSER + "DoesNotSupport" + LOCAL + STORAGE] = 0 /* _eInternalMessageId.BrowserDoesNotSupportLocalStorage */,
|
||||
_a[BROWSER + CANNOT + "Read" + LOCAL + STORAGE] = 1 /* _eInternalMessageId.BrowserCannotReadLocalStorage */,
|
||||
_a[BROWSER + CANNOT + "Read" + SESSION + STORAGE] = 2 /* _eInternalMessageId.BrowserCannotReadSessionStorage */,
|
||||
_a[BROWSER + CANNOT + "Write" + LOCAL + STORAGE] = 3 /* _eInternalMessageId.BrowserCannotWriteLocalStorage */,
|
||||
_a[BROWSER + CANNOT + "Write" + SESSION + STORAGE] = 4 /* _eInternalMessageId.BrowserCannotWriteSessionStorage */,
|
||||
_a[BROWSER + FAILED + "RemovalFrom" + LOCAL + STORAGE] = 5 /* _eInternalMessageId.BrowserFailedRemovalFromLocalStorage */,
|
||||
_a[BROWSER + FAILED + "RemovalFrom" + SESSION + STORAGE] = 6 /* _eInternalMessageId.BrowserFailedRemovalFromSessionStorage */,
|
||||
_a[CANNOT + "SendEmptyTelemetry"] = 7 /* _eInternalMessageId.CannotSendEmptyTelemetry */,
|
||||
_a.ClientPerformanceMathError = 8 /* _eInternalMessageId.ClientPerformanceMathError */,
|
||||
_a["ErrorParsingAI" + SESSION + "Cookie"] = 9 /* _eInternalMessageId.ErrorParsingAISessionCookie */,
|
||||
_a.ErrorPVCalc = 10 /* _eInternalMessageId.ErrorPVCalc */,
|
||||
_a[EXCEPTION + "WhileLoggingError"] = 11 /* _eInternalMessageId.ExceptionWhileLoggingError */,
|
||||
_a[FAILED + "AddingTelemetryTo" + BUFFER] = 12 /* _eInternalMessageId.FailedAddingTelemetryToBuffer */,
|
||||
_a[FAILED_MONITOR_AJAX + "Abort"] = 13 /* _eInternalMessageId.FailedMonitorAjaxAbort */,
|
||||
_a[FAILED_MONITOR_AJAX + "Dur"] = 14 /* _eInternalMessageId.FailedMonitorAjaxDur */,
|
||||
_a[FAILED_MONITOR_AJAX + "Open"] = 15 /* _eInternalMessageId.FailedMonitorAjaxOpen */,
|
||||
_a[FAILED_MONITOR_AJAX + "RSC"] = 16 /* _eInternalMessageId.FailedMonitorAjaxRSC */,
|
||||
_a[FAILED_MONITOR_AJAX + "Send"] = 17 /* _eInternalMessageId.FailedMonitorAjaxSend */,
|
||||
_a[FAILED_MONITOR_AJAX + "GetCorrelationHeader"] = 18 /* _eInternalMessageId.FailedMonitorAjaxGetCorrelationHeader */,
|
||||
_a[FAILED + "ToAddHandlerForOnBeforeUnload"] = 19 /* _eInternalMessageId.FailedToAddHandlerForOnBeforeUnload */,
|
||||
_a[FAILED + "ToSendQueuedTelemetry"] = 20 /* _eInternalMessageId.FailedToSendQueuedTelemetry */,
|
||||
_a[FAILED + "ToReportDataLoss"] = 21 /* _eInternalMessageId.FailedToReportDataLoss */,
|
||||
_a["Flush" + FAILED] = 22 /* _eInternalMessageId.FlushFailed */,
|
||||
_a.MessageLimitPerPVExceeded = 23 /* _eInternalMessageId.MessageLimitPerPVExceeded */,
|
||||
_a.MissingRequiredFieldSpecification = 24 /* _eInternalMessageId.MissingRequiredFieldSpecification */,
|
||||
_a.NavigationTimingNotSupported = 25 /* _eInternalMessageId.NavigationTimingNotSupported */,
|
||||
_a.OnError = 26 /* _eInternalMessageId.OnError */,
|
||||
_a[SESSION + "RenewalDateIsZero"] = 27 /* _eInternalMessageId.SessionRenewalDateIsZero */,
|
||||
_a.SenderNotInitialized = 28 /* _eInternalMessageId.SenderNotInitialized */,
|
||||
_a[START + TRACK + EVENT + FAILED] = 29 /* _eInternalMessageId.StartTrackEventFailed */,
|
||||
_a[STOP + TRACK + EVENT + FAILED] = 30 /* _eInternalMessageId.StopTrackEventFailed */,
|
||||
_a[START + TRACK + FAILED] = 31 /* _eInternalMessageId.StartTrackFailed */,
|
||||
_a[STOP + TRACK + FAILED] = 32 /* _eInternalMessageId.StopTrackFailed */,
|
||||
_a.TelemetrySampledAndNotSent = 33 /* _eInternalMessageId.TelemetrySampledAndNotSent */,
|
||||
_a[TRACK + EVENT + FAILED] = 34 /* _eInternalMessageId.TrackEventFailed */,
|
||||
_a[TRACK + EXCEPTION + FAILED] = 35 /* _eInternalMessageId.TrackExceptionFailed */,
|
||||
_a[TRACK + "Metric" + FAILED] = 36 /* _eInternalMessageId.TrackMetricFailed */,
|
||||
_a[TRACK + "PV" + FAILED] = 37 /* _eInternalMessageId.TrackPVFailed */,
|
||||
_a[TRACK + "PV" + FAILED + "Calc"] = 38 /* _eInternalMessageId.TrackPVFailedCalc */,
|
||||
_a[TRACK + "Trace" + FAILED] = 39 /* _eInternalMessageId.TrackTraceFailed */,
|
||||
_a["Transmission" + FAILED] = 40 /* _eInternalMessageId.TransmissionFailed */,
|
||||
_a[FAILED + "ToSet" + STORAGE + BUFFER] = 41 /* _eInternalMessageId.FailedToSetStorageBuffer */,
|
||||
_a[FAILED + "ToRestore" + STORAGE + BUFFER] = 42 /* _eInternalMessageId.FailedToRestoreStorageBuffer */,
|
||||
_a.InvalidBackendResponse = 43 /* _eInternalMessageId.InvalidBackendResponse */,
|
||||
_a[FAILED + "ToFixDepricatedValues"] = 44 /* _eInternalMessageId.FailedToFixDepricatedValues */,
|
||||
_a.InvalidDurationValue = 45 /* _eInternalMessageId.InvalidDurationValue */,
|
||||
_a.TelemetryEnvelopeInvalid = 46 /* _eInternalMessageId.TelemetryEnvelopeInvalid */,
|
||||
_a.CreateEnvelopeError = 47 /* _eInternalMessageId.CreateEnvelopeError */,
|
||||
// User actionable
|
||||
_a[CANNOT + "SerializeObject"] = 48 /* _eInternalMessageId.CannotSerializeObject */,
|
||||
_a[CANNOT + "SerializeObjectNonSerializable"] = 49 /* _eInternalMessageId.CannotSerializeObjectNonSerializable */,
|
||||
_a.CircularReferenceDetected = 50 /* _eInternalMessageId.CircularReferenceDetected */,
|
||||
_a["Clear" + AUTH_CONTEXT + FAILED] = 51 /* _eInternalMessageId.ClearAuthContextFailed */,
|
||||
_a[EXCEPTION + "Truncated"] = 52 /* _eInternalMessageId.ExceptionTruncated */,
|
||||
_a.IllegalCharsInName = 53 /* _eInternalMessageId.IllegalCharsInName */,
|
||||
_a.ItemNotInArray = 54 /* _eInternalMessageId.ItemNotInArray */,
|
||||
_a.MaxAjaxPerPVExceeded = 55 /* _eInternalMessageId.MaxAjaxPerPVExceeded */,
|
||||
_a.MessageTruncated = 56 /* _eInternalMessageId.MessageTruncated */,
|
||||
_a.NameTooLong = 57 /* _eInternalMessageId.NameTooLong */,
|
||||
_a.SampleRateOutOfRange = 58 /* _eInternalMessageId.SampleRateOutOfRange */,
|
||||
_a["Set" + AUTH_CONTEXT + FAILED] = 59 /* _eInternalMessageId.SetAuthContextFailed */,
|
||||
_a["Set" + AUTH_CONTEXT + FAILED + "AccountName"] = 60 /* _eInternalMessageId.SetAuthContextFailedAccountName */,
|
||||
_a.StringValueTooLong = 61 /* _eInternalMessageId.StringValueTooLong */,
|
||||
_a.StartCalledMoreThanOnce = 62 /* _eInternalMessageId.StartCalledMoreThanOnce */,
|
||||
_a.StopCalledWithoutStart = 63 /* _eInternalMessageId.StopCalledWithoutStart */,
|
||||
_a["TelemetryInitializer" + FAILED] = 64 /* _eInternalMessageId.TelemetryInitializerFailed */,
|
||||
_a.TrackArgumentsNotSpecified = 65 /* _eInternalMessageId.TrackArgumentsNotSpecified */,
|
||||
_a.UrlTooLong = 66 /* _eInternalMessageId.UrlTooLong */,
|
||||
_a[SESSION + STORAGE + BUFFER + "Full"] = 67 /* _eInternalMessageId.SessionStorageBufferFull */,
|
||||
_a[CANNOT + "AccessCookie"] = 68 /* _eInternalMessageId.CannotAccessCookie */,
|
||||
_a.IdTooLong = 69 /* _eInternalMessageId.IdTooLong */,
|
||||
_a.InvalidEvent = 70 /* _eInternalMessageId.InvalidEvent */,
|
||||
_a[FAILED_MONITOR_AJAX + "SetRequestHeader"] = 71 /* _eInternalMessageId.FailedMonitorAjaxSetRequestHeader */,
|
||||
_a["Send" + BROWSER + "InfoOnUserInit"] = 72 /* _eInternalMessageId.SendBrowserInfoOnUserInit */,
|
||||
_a["Plugin" + EXCEPTION] = 73 /* _eInternalMessageId.PluginException */,
|
||||
_a["Notification" + EXCEPTION] = 74 /* _eInternalMessageId.NotificationException */,
|
||||
_a.SnippetScriptLoadFailure = 99 /* _eInternalMessageId.SnippetScriptLoadFailure */,
|
||||
_a["Invalid" + INSTRUMENTATION_KEY] = 100 /* _eInternalMessageId.InvalidInstrumentationKey */,
|
||||
_a[CANNOT + "ParseAiBlobValue"] = 101 /* _eInternalMessageId.CannotParseAiBlobValue */,
|
||||
_a.InvalidContentBlob = 102 /* _eInternalMessageId.InvalidContentBlob */,
|
||||
_a[TRACK + "PageAction" + EVENT + FAILED] = 103 /* _eInternalMessageId.TrackPageActionEventFailed */,
|
||||
_a[FAILED + "AddingCustomDefinedRequestContext"] = 104 /* _eInternalMessageId.FailedAddingCustomDefinedRequestContext */,
|
||||
_a["InMemory" + STORAGE + BUFFER + "Full"] = 105 /* _eInternalMessageId.InMemoryStorageBufferFull */,
|
||||
_a[INSTRUMENTATION_KEY + "Deprecation"] = 106 /* _eInternalMessageId.InstrumentationKeyDeprecation */,
|
||||
_a));
|
5
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js
generated
vendored
Normal file
5
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
export {};
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
export {};
|
@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
"use strict";
|
||||
export var MinChannelPriorty = 100;
|
6
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js
generated
vendored
Normal file
6
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
"use strict";
|
||||
export {};
|
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js
generated
vendored
Normal file
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js
generated
vendored
Normal file
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,6 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
"use strict";
|
||||
export {};
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
export {};
|
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
export {};
|
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js
generated
vendored
Normal file
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
5
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js
generated
vendored
Normal file
5
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
export {};
|
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
export {};
|
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
export {};
|
8
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js
generated
vendored
Normal file
8
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
export {};
|
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
export {};
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js
generated
vendored
Normal file
7
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
export {};
|
@ -0,0 +1,5 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
export {};
|
60
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js
generated
vendored
Normal file
60
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
import { __extendsFn as __extends } from "@microsoft/applicationinsights-shims";
|
||||
|
||||
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { _DYN_GET_NOTIFY_MGR, _DYN_INITIALIZE, _DYN_NAME } from "../__DynamicConstants";
|
||||
import { BaseCore } from "./BaseCore";
|
||||
import { DiagnosticLogger } from "./DiagnosticLogger";
|
||||
import { isNullOrUndefined, throwError } from "./HelperFuncs";
|
||||
import { STR_EVENTS_DISCARDED, STR_GET_PERF_MGR } from "./InternalConstants";
|
||||
import { NotificationManager } from "./NotificationManager";
|
||||
import { doPerf } from "./PerfManager";
|
||||
var AppInsightsCore = /** @class */ (function (_super) {
|
||||
__extends(AppInsightsCore, _super);
|
||||
function AppInsightsCore() {
|
||||
var _this = _super.call(this) || this;
|
||||
dynamicProto(AppInsightsCore, _this, function (_self, _base) {
|
||||
_self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, extensions, logger, notificationManager) {
|
||||
_base[_DYN_INITIALIZE /* @min:%2einitialize */](config, extensions, logger || new DiagnosticLogger(config), notificationManager || new NotificationManager(config));
|
||||
};
|
||||
_self.track = function (telemetryItem) {
|
||||
doPerf(_self[STR_GET_PERF_MGR /* @min:%2egetPerfMgr */](), function () { return "AppInsightsCore:track"; }, function () {
|
||||
if (telemetryItem === null) {
|
||||
_notifyInvalidEvent(telemetryItem);
|
||||
// throw error
|
||||
throwError("Invalid telemetry item");
|
||||
}
|
||||
// do basic validation before sending it through the pipeline
|
||||
_validateTelemetryItem(telemetryItem);
|
||||
_base.track(telemetryItem);
|
||||
}, function () { return ({ item: telemetryItem }); }, !(telemetryItem.sync));
|
||||
};
|
||||
function _validateTelemetryItem(telemetryItem) {
|
||||
if (isNullOrUndefined(telemetryItem[_DYN_NAME /* @min:%2ename */])) {
|
||||
_notifyInvalidEvent(telemetryItem);
|
||||
throwError("telemetry name required");
|
||||
}
|
||||
}
|
||||
function _notifyInvalidEvent(telemetryItem) {
|
||||
var manager = _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]();
|
||||
if (manager) {
|
||||
manager[STR_EVENTS_DISCARDED /* @min:%2eeventsDiscarded */]([telemetryItem], 2 /* eEventsDiscardedReason.InvalidEvent */);
|
||||
}
|
||||
}
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
// Removed Stub for AppInsightsCore.prototype.initialize.
|
||||
// Removed Stub for AppInsightsCore.prototype.track.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
AppInsightsCore.__ieDyn=1;
|
||||
|
||||
return AppInsightsCore;
|
||||
}(BaseCore));
|
||||
export { AppInsightsCore };
|
670
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js
generated
vendored
Normal file
670
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js
generated
vendored
Normal file
@ -0,0 +1,670 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
import { __spreadArrayFn as __spreadArray } from "@microsoft/applicationinsights-shims";
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { objCreateFn } from "@microsoft/applicationinsights-shims";
|
||||
import { _DYN_ADD_NOTIFICATION_LIS1, _DYN_CONFIG, _DYN_FLUSH, _DYN_GET_NOTIFY_MGR, _DYN_GET_PLUGIN, _DYN_GET_PROCESS_TEL_CONT0, _DYN_IDENTIFIER, _DYN_INITIALIZE, _DYN_INSTRUMENTATION_KEY, _DYN_IS_ASYNC, _DYN_IS_INITIALIZED, _DYN_LENGTH, _DYN_LOGGER, _DYN_MESSAGE, _DYN_MESSAGE_ID, _DYN_NAME, _DYN_ON_COMPLETE, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_REMOVE_NOTIFICATION_2, _DYN_SET_ENABLED, _DYN_SPLICE, _DYN_STOP_POLLING_INTERNA3, _DYN_TEARDOWN, _DYN_TIME, _DYN__EXTENSIONS } from "../__DynamicConstants";
|
||||
import { ChannelControllerPriority, createChannelControllerPlugin, createChannelQueues } from "./ChannelController";
|
||||
import { createCookieMgr } from "./CookieMgr";
|
||||
import { createUniqueNamespace } from "./DataCacheHelper";
|
||||
import { getDebugListener } from "./DbgExtensionUtils";
|
||||
import { DiagnosticLogger, _InternalLogMessage, _throwInternal, _warnToConsole } from "./DiagnosticLogger";
|
||||
import { arrForEach, arrIndexOf, getCfgValue, getSetValue, isFunction, isNullOrUndefined, objExtend, objFreeze, proxyFunctionAs, proxyFunctions, throwError, toISOString } from "./HelperFuncs";
|
||||
import { STR_CHANNELS, STR_CORE, STR_CREATE_PERF_MGR, STR_DISABLED, STR_EVENTS_DISCARDED, STR_EVENTS_SEND_REQUEST, STR_EVENTS_SENT, STR_EXTENSIONS, STR_EXTENSION_CONFIG, STR_GET_PERF_MGR, STR_PRIORITY } from "./InternalConstants";
|
||||
import { PerfManager, getGblPerfMgr } from "./PerfManager";
|
||||
import { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext, createTelemetryProxyChain } from "./ProcessTelemetryContext";
|
||||
import { _getPluginState, createDistributedTraceContext, initializePlugins, sortPlugins } from "./TelemetryHelpers";
|
||||
import { TelemetryInitializerPlugin } from "./TelemetryInitializerPlugin";
|
||||
import { createUnloadHandlerContainer } from "./UnloadHandlerContainer";
|
||||
var strValidationError = "Plugins must provide initialize method";
|
||||
var strNotificationManager = "_notificationManager";
|
||||
var strSdkUnloadingError = "SDK is still unloading...";
|
||||
var strSdkNotInitialized = "SDK is not initialized";
|
||||
// const strPluginUnloadFailed = "Failed to unload plugin";
|
||||
var defaultInitConfig = {
|
||||
// Have the Diagnostic Logger default to log critical errors to the console
|
||||
loggingLevelConsole: 1 /* eLoggingSeverity.CRITICAL */
|
||||
};
|
||||
/**
|
||||
* Helper to create the default performance manager
|
||||
* @param core
|
||||
* @param notificationMgr
|
||||
*/
|
||||
function _createPerfManager(core, notificationMgr) {
|
||||
return new PerfManager(notificationMgr);
|
||||
}
|
||||
function _validateExtensions(logger, channelPriority, allExtensions) {
|
||||
var _a;
|
||||
// Concat all available extensions
|
||||
var coreExtensions = [];
|
||||
// Check if any two extensions have the same priority, then warn to console
|
||||
// And extract the local extensions from the
|
||||
var extPriorities = {};
|
||||
// Extension validation
|
||||
arrForEach(allExtensions, function (ext) {
|
||||
// Check for ext.initialize
|
||||
if (isNullOrUndefined(ext) || isNullOrUndefined(ext[_DYN_INITIALIZE /* @min:%2einitialize */])) {
|
||||
throwError(strValidationError);
|
||||
}
|
||||
var extPriority = ext[STR_PRIORITY /* @min:%2epriority */];
|
||||
var identifier = ext[_DYN_IDENTIFIER /* @min:%2eidentifier */];
|
||||
if (ext && extPriority) {
|
||||
if (!isNullOrUndefined(extPriorities[extPriority])) {
|
||||
_warnToConsole(logger, "Two extensions have same priority #" + extPriority + " - " + extPriorities[extPriority] + ", " + identifier);
|
||||
}
|
||||
else {
|
||||
// set a value
|
||||
extPriorities[extPriority] = identifier;
|
||||
}
|
||||
}
|
||||
// Split extensions to core and channelController
|
||||
if (!extPriority || extPriority < channelPriority) {
|
||||
// Add to core extension that will be managed by BaseCore
|
||||
coreExtensions[_DYN_PUSH /* @min:%2epush */](ext);
|
||||
}
|
||||
});
|
||||
return _a = {
|
||||
all: allExtensions
|
||||
},
|
||||
_a[STR_CORE /* @min:core */] = coreExtensions,
|
||||
_a;
|
||||
}
|
||||
function _isPluginPresent(thePlugin, plugins) {
|
||||
var exists = false;
|
||||
arrForEach(plugins, function (plugin) {
|
||||
if (plugin === thePlugin) {
|
||||
exists = true;
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
return exists;
|
||||
}
|
||||
function _createDummyNotificationManager() {
|
||||
var _a;
|
||||
return objCreateFn((_a = {},
|
||||
_a[_DYN_ADD_NOTIFICATION_LIS1 /* @min:addNotificationListener */] = function (listener) { },
|
||||
_a[_DYN_REMOVE_NOTIFICATION_2 /* @min:removeNotificationListener */] = function (listener) { },
|
||||
_a[STR_EVENTS_SENT /* @min:eventsSent */] = function (events) { },
|
||||
_a[STR_EVENTS_DISCARDED /* @min:eventsDiscarded */] = function (events, reason) { },
|
||||
_a[STR_EVENTS_SEND_REQUEST /* @min:eventsSendRequest */] = function (sendReason, isAsync) { },
|
||||
_a));
|
||||
}
|
||||
var BaseCore = /** @class */ (function () {
|
||||
function BaseCore() {
|
||||
// NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()
|
||||
var _config;
|
||||
var _isInitialized;
|
||||
var _eventQueue;
|
||||
var _notificationManager;
|
||||
var _perfManager;
|
||||
var _cfgPerfManager;
|
||||
var _cookieManager;
|
||||
var _pluginChain;
|
||||
var _configExtensions;
|
||||
var _coreExtensions;
|
||||
var _channelControl;
|
||||
var _channelConfig;
|
||||
var _channelQueue;
|
||||
var _isUnloading;
|
||||
var _telemetryInitializerPlugin;
|
||||
var _internalLogsEventName;
|
||||
var _evtNamespace;
|
||||
var _unloadHandlers;
|
||||
var _debugListener;
|
||||
var _traceCtx;
|
||||
/**
|
||||
* Internal log poller
|
||||
*/
|
||||
var _internalLogPoller = 0;
|
||||
var _forceStopInternalLogPoller = false;
|
||||
dynamicProto(BaseCore, this, function (_self) {
|
||||
// Set the default values (also called during teardown)
|
||||
_initDefaults();
|
||||
_self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = function () { return _isInitialized; };
|
||||
// Creating the self.initialize = ()
|
||||
_self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, extensions, logger, notificationManager) {
|
||||
if (_isUnloading) {
|
||||
throwError(strSdkUnloadingError);
|
||||
}
|
||||
// Make sure core is only initialized once
|
||||
if (_self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]()) {
|
||||
throwError("Core should not be initialized more than once");
|
||||
}
|
||||
_config = config || {};
|
||||
_self[_DYN_CONFIG /* @min:%2econfig */] = _config;
|
||||
if (isNullOrUndefined(config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */])) {
|
||||
throwError("Please provide instrumentation key");
|
||||
}
|
||||
_notificationManager = notificationManager;
|
||||
// For backward compatibility only
|
||||
_self[strNotificationManager] = notificationManager;
|
||||
_initDebugListener();
|
||||
_initPerfManager();
|
||||
// add notification to the extensions in the config so other plugins can access it
|
||||
_initExtConfig();
|
||||
if (logger) {
|
||||
_self[_DYN_LOGGER /* @min:%2elogger */] = logger;
|
||||
}
|
||||
var cfgExtensions = getSetValue(_config, STR_EXTENSIONS, []);
|
||||
// Extension validation
|
||||
_configExtensions = [];
|
||||
_configExtensions[_DYN_PUSH /* @min:%2epush */].apply(_configExtensions, __spreadArray(__spreadArray([], extensions, false), cfgExtensions, false));
|
||||
_channelConfig = getSetValue(_config, STR_CHANNELS, []);
|
||||
_initPluginChain(null);
|
||||
if (!_channelQueue || _channelQueue[_DYN_LENGTH /* @min:%2elength */] === 0) {
|
||||
throwError("No " + STR_CHANNELS + " available");
|
||||
}
|
||||
_isInitialized = true;
|
||||
_self.releaseQueue();
|
||||
};
|
||||
_self.getTransmissionControls = function () {
|
||||
var controls = [];
|
||||
if (_channelQueue) {
|
||||
arrForEach(_channelQueue, function (channels) {
|
||||
controls[_DYN_PUSH /* @min:%2epush */](channels.queue);
|
||||
});
|
||||
}
|
||||
return objFreeze(controls);
|
||||
};
|
||||
_self.track = function (telemetryItem) {
|
||||
// setup default iKey if not passed in
|
||||
telemetryItem.iKey = telemetryItem.iKey || _config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */];
|
||||
// add default timestamp if not passed in
|
||||
telemetryItem[_DYN_TIME /* @min:%2etime */] = telemetryItem[_DYN_TIME /* @min:%2etime */] || toISOString(new Date());
|
||||
// Common Schema 4.0
|
||||
telemetryItem.ver = telemetryItem.ver || "4.0";
|
||||
if (!_isUnloading && _self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */]()) {
|
||||
// Process the telemetry plugin chain
|
||||
_createTelCtx()[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](telemetryItem);
|
||||
}
|
||||
else {
|
||||
// Queue events until all extensions are initialized
|
||||
_eventQueue[_DYN_PUSH /* @min:%2epush */](telemetryItem);
|
||||
}
|
||||
};
|
||||
_self[_DYN_GET_PROCESS_TEL_CONT0 /* @min:%2egetProcessTelContext */] = _createTelCtx;
|
||||
_self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */] = function () {
|
||||
if (!_notificationManager) {
|
||||
// Create Dummy notification manager
|
||||
_notificationManager = _createDummyNotificationManager();
|
||||
// For backward compatibility only
|
||||
_self[strNotificationManager] = _notificationManager;
|
||||
}
|
||||
return _notificationManager;
|
||||
};
|
||||
/**
|
||||
* Adds a notification listener. The SDK calls methods on the listener when an appropriate notification is raised.
|
||||
* The added plugins must raise notifications. If the plugins do not implement the notifications, then no methods will be
|
||||
* called.
|
||||
* @param {INotificationListener} listener - An INotificationListener object.
|
||||
*/
|
||||
_self[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */] = function (listener) {
|
||||
if (_notificationManager) {
|
||||
_notificationManager[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](listener);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Removes all instances of the listener.
|
||||
* @param {INotificationListener} listener - INotificationListener to remove.
|
||||
*/
|
||||
_self[_DYN_REMOVE_NOTIFICATION_2 /* @min:%2eremoveNotificationListener */] = function (listener) {
|
||||
if (_notificationManager) {
|
||||
_notificationManager[_DYN_REMOVE_NOTIFICATION_2 /* @min:%2eremoveNotificationListener */](listener);
|
||||
}
|
||||
};
|
||||
_self.getCookieMgr = function () {
|
||||
if (!_cookieManager) {
|
||||
_cookieManager = createCookieMgr(_config, _self[_DYN_LOGGER /* @min:%2elogger */]);
|
||||
}
|
||||
return _cookieManager;
|
||||
};
|
||||
_self.setCookieMgr = function (cookieMgr) {
|
||||
_cookieManager = cookieMgr;
|
||||
};
|
||||
_self[STR_GET_PERF_MGR /* @min:%2egetPerfMgr */] = function () {
|
||||
if (!_perfManager && !_cfgPerfManager) {
|
||||
if (getCfgValue(_config.enablePerfMgr)) {
|
||||
var createPerfMgr = getCfgValue(_config[STR_CREATE_PERF_MGR /* @min:%2ecreatePerfMgr */]);
|
||||
if (isFunction(createPerfMgr)) {
|
||||
_cfgPerfManager = createPerfMgr(_self, _self[_DYN_GET_NOTIFY_MGR /* @min:%2egetNotifyMgr */]());
|
||||
}
|
||||
}
|
||||
}
|
||||
return _perfManager || _cfgPerfManager || getGblPerfMgr();
|
||||
};
|
||||
_self.setPerfMgr = function (perfMgr) {
|
||||
_perfManager = perfMgr;
|
||||
};
|
||||
_self.eventCnt = function () {
|
||||
return _eventQueue[_DYN_LENGTH /* @min:%2elength */];
|
||||
};
|
||||
_self.releaseQueue = function () {
|
||||
if (_isInitialized && _eventQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
||||
var eventQueue = _eventQueue;
|
||||
_eventQueue = [];
|
||||
arrForEach(eventQueue, function (event) {
|
||||
_createTelCtx()[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](event);
|
||||
});
|
||||
}
|
||||
};
|
||||
_self.pollInternalLogs = function (eventName) {
|
||||
_internalLogsEventName = eventName || null;
|
||||
_forceStopInternalLogPoller = false;
|
||||
if (_internalLogPoller) {
|
||||
clearInterval(_internalLogPoller);
|
||||
_internalLogPoller = null;
|
||||
}
|
||||
return _startInternalLogTimer(true);
|
||||
};
|
||||
function _startInternalLogTimer(alwaysStart) {
|
||||
if (!_internalLogPoller && !_forceStopInternalLogPoller) {
|
||||
var shouldStart = alwaysStart || (_self[_DYN_LOGGER /* @min:%2elogger */] && _self[_DYN_LOGGER /* @min:%2elogger */].queue[_DYN_LENGTH /* @min:%2elength */] > 0);
|
||||
if (shouldStart) {
|
||||
var interval = getCfgValue(_config.diagnosticLogInterval);
|
||||
if (!interval || !(interval > 0)) {
|
||||
interval = 10000;
|
||||
}
|
||||
// Keeping as an interval timer for backward compatibility as it returns the result
|
||||
_internalLogPoller = setInterval(function () {
|
||||
clearInterval(_internalLogPoller);
|
||||
_internalLogPoller = 0;
|
||||
_flushInternalLogs();
|
||||
}, interval);
|
||||
}
|
||||
}
|
||||
return _internalLogPoller;
|
||||
}
|
||||
_self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */] = function () {
|
||||
_forceStopInternalLogPoller = true;
|
||||
if (_internalLogPoller) {
|
||||
clearInterval(_internalLogPoller);
|
||||
_internalLogPoller = 0;
|
||||
_flushInternalLogs();
|
||||
}
|
||||
};
|
||||
// Add addTelemetryInitializer
|
||||
proxyFunctions(_self, function () { return _telemetryInitializerPlugin; }, ["addTelemetryInitializer"]);
|
||||
_self.unload = function (isAsync, unloadComplete, cbTimeout) {
|
||||
var _a;
|
||||
if (isAsync === void 0) { isAsync = true; }
|
||||
if (!_isInitialized) {
|
||||
// The SDK is not initialized
|
||||
throwError(strSdkNotInitialized);
|
||||
}
|
||||
// Check if the SDK still unloading so throw
|
||||
if (_isUnloading) {
|
||||
// The SDK is already unloading
|
||||
throwError(strSdkUnloadingError);
|
||||
}
|
||||
var unloadState = (_a = {
|
||||
reason: 50 /* TelemetryUnloadReason.SdkUnload */
|
||||
},
|
||||
_a[_DYN_IS_ASYNC /* @min:isAsync */] = isAsync,
|
||||
_a.flushComplete = false,
|
||||
_a);
|
||||
var processUnloadCtx = createProcessTelemetryUnloadContext(_getPluginChain(), _self);
|
||||
processUnloadCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](function () {
|
||||
_initDefaults();
|
||||
unloadComplete && unloadComplete(unloadState);
|
||||
}, _self);
|
||||
function _doUnload(flushComplete) {
|
||||
unloadState.flushComplete = flushComplete;
|
||||
_isUnloading = true;
|
||||
// Run all of the unload handlers first (before unloading the plugins)
|
||||
_unloadHandlers.run(processUnloadCtx, unloadState);
|
||||
// Stop polling the internal logs
|
||||
_self[_DYN_STOP_POLLING_INTERNA3 /* @min:%2estopPollingInternalLogs */]();
|
||||
// Start unloading the components, from this point onwards the SDK should be considered to be in an unstable state
|
||||
processUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);
|
||||
}
|
||||
_flushInternalLogs();
|
||||
if (!_flushChannels(isAsync, _doUnload, 6 /* SendRequestReason.SdkUnload */, cbTimeout)) {
|
||||
_doUnload(false);
|
||||
}
|
||||
};
|
||||
_self[_DYN_GET_PLUGIN /* @min:%2egetPlugin */] = _getPlugin;
|
||||
_self.addPlugin = function (plugin, replaceExisting, isAsync, addCb) {
|
||||
if (!plugin) {
|
||||
addCb && addCb(false);
|
||||
_logOrThrowError(strValidationError);
|
||||
return;
|
||||
}
|
||||
var existingPlugin = _getPlugin(plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */]);
|
||||
if (existingPlugin && !replaceExisting) {
|
||||
addCb && addCb(false);
|
||||
_logOrThrowError("Plugin [" + plugin[_DYN_IDENTIFIER /* @min:%2eidentifier */] + "] is already loaded!");
|
||||
return;
|
||||
}
|
||||
var updateState = {
|
||||
reason: 16 /* TelemetryUpdateReason.PluginAdded */
|
||||
};
|
||||
function _addPlugin(removed) {
|
||||
_configExtensions[_DYN_PUSH /* @min:%2epush */](plugin);
|
||||
updateState.added = [plugin];
|
||||
// Re-Initialize the plugin chain
|
||||
_initPluginChain(updateState);
|
||||
addCb && addCb(true);
|
||||
}
|
||||
if (existingPlugin) {
|
||||
var removedPlugins_1 = [existingPlugin.plugin];
|
||||
var unloadState = {
|
||||
reason: 2 /* TelemetryUnloadReason.PluginReplace */,
|
||||
isAsync: !!isAsync
|
||||
};
|
||||
_removePlugins(removedPlugins_1, unloadState, function (removed) {
|
||||
if (!removed) {
|
||||
// Previous plugin was successfully removed or was not installed
|
||||
addCb && addCb(false);
|
||||
}
|
||||
else {
|
||||
updateState.removed = removedPlugins_1;
|
||||
updateState.reason |= 32 /* TelemetryUpdateReason.PluginRemoved */;
|
||||
_addPlugin(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
_addPlugin(false);
|
||||
}
|
||||
};
|
||||
_self.evtNamespace = function () {
|
||||
return _evtNamespace;
|
||||
};
|
||||
_self[_DYN_FLUSH /* @min:%2eflush */] = _flushChannels;
|
||||
_self.getTraceCtx = function (createNew) {
|
||||
if (!_traceCtx) {
|
||||
_traceCtx = createDistributedTraceContext();
|
||||
}
|
||||
return _traceCtx;
|
||||
};
|
||||
_self.setTraceCtx = function (traceCtx) {
|
||||
_traceCtx = traceCtx || null;
|
||||
};
|
||||
// Create the addUnloadCb
|
||||
proxyFunctionAs(_self, "addUnloadCb", function () { return _unloadHandlers; }, "add");
|
||||
function _initDefaults() {
|
||||
_isInitialized = false;
|
||||
// Use a default logger so initialization errors are not dropped on the floor with full logging
|
||||
_config = objExtend(true, {}, defaultInitConfig);
|
||||
_self[_DYN_CONFIG /* @min:%2econfig */] = _config;
|
||||
_self[_DYN_LOGGER /* @min:%2elogger */] = new DiagnosticLogger(_config);
|
||||
_self[_DYN__EXTENSIONS /* @min:%2e_extensions */] = [];
|
||||
_telemetryInitializerPlugin = new TelemetryInitializerPlugin();
|
||||
_eventQueue = [];
|
||||
_notificationManager = null;
|
||||
_perfManager = null;
|
||||
_cfgPerfManager = null;
|
||||
_cookieManager = null;
|
||||
_pluginChain = null;
|
||||
_coreExtensions = null;
|
||||
_configExtensions = [];
|
||||
_channelControl = null;
|
||||
_channelConfig = null;
|
||||
_channelQueue = null;
|
||||
_isUnloading = false;
|
||||
_internalLogsEventName = null;
|
||||
_evtNamespace = createUniqueNamespace("AIBaseCore", true);
|
||||
_unloadHandlers = createUnloadHandlerContainer();
|
||||
_traceCtx = null;
|
||||
}
|
||||
function _createTelCtx() {
|
||||
var theCtx = createProcessTelemetryContext(_getPluginChain(), _config, _self);
|
||||
theCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](_startInternalLogTimer);
|
||||
return theCtx;
|
||||
}
|
||||
// Initialize or Re-initialize the plugins
|
||||
function _initPluginChain(updateState) {
|
||||
// Extension validation
|
||||
var theExtensions = _validateExtensions(_self[_DYN_LOGGER /* @min:%2elogger */], ChannelControllerPriority, _configExtensions);
|
||||
_coreExtensions = theExtensions[STR_CORE /* @min:%2ecore */];
|
||||
_pluginChain = null;
|
||||
// Sort the complete set of extensions by priority
|
||||
var allExtensions = theExtensions.all;
|
||||
// Initialize the Channel Queues and the channel plugins first
|
||||
_channelQueue = objFreeze(createChannelQueues(_channelConfig, allExtensions, _self));
|
||||
if (_channelControl) {
|
||||
// During add / remove of a plugin this may get called again, so don't re-add if already present
|
||||
// But we also want the controller as the last, so remove if already present
|
||||
// And reusing the existing instance, just in case an installed plugin has a reference and
|
||||
// is using it.
|
||||
var idx = arrIndexOf(allExtensions, _channelControl);
|
||||
if (idx !== -1) {
|
||||
allExtensions[_DYN_SPLICE /* @min:%2esplice */](idx, 1);
|
||||
}
|
||||
idx = arrIndexOf(_coreExtensions, _channelControl);
|
||||
if (idx !== -1) {
|
||||
_coreExtensions[_DYN_SPLICE /* @min:%2esplice */](idx, 1);
|
||||
}
|
||||
_channelControl._setQueue(_channelQueue);
|
||||
}
|
||||
else {
|
||||
_channelControl = createChannelControllerPlugin(_channelQueue, _self);
|
||||
}
|
||||
// Add on "channelController" as the last "plugin"
|
||||
allExtensions[_DYN_PUSH /* @min:%2epush */](_channelControl);
|
||||
_coreExtensions[_DYN_PUSH /* @min:%2epush */](_channelControl);
|
||||
// Required to allow plugins to call core.getPlugin() during their own initialization
|
||||
_self[_DYN__EXTENSIONS /* @min:%2e_extensions */] = sortPlugins(allExtensions);
|
||||
// Initialize the controls
|
||||
_channelControl[_DYN_INITIALIZE /* @min:%2einitialize */](_config, _self, allExtensions);
|
||||
var initCtx = _createTelCtx();
|
||||
initializePlugins(initCtx, allExtensions);
|
||||
// Now reset the extensions to just those being managed by Basecore
|
||||
_self[_DYN__EXTENSIONS /* @min:%2e_extensions */] = objFreeze(sortPlugins(_coreExtensions || [])).slice();
|
||||
if (updateState) {
|
||||
_doUpdate(updateState);
|
||||
}
|
||||
}
|
||||
function _getPlugin(pluginIdentifier) {
|
||||
var _a;
|
||||
var theExt = null;
|
||||
var thePlugin = null;
|
||||
arrForEach(_self[_DYN__EXTENSIONS /* @min:%2e_extensions */], function (ext) {
|
||||
if (ext[_DYN_IDENTIFIER /* @min:%2eidentifier */] === pluginIdentifier && ext !== _channelControl && ext !== _telemetryInitializerPlugin) {
|
||||
thePlugin = ext;
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
if (!thePlugin && _channelControl) {
|
||||
// Check the channel Controller
|
||||
thePlugin = _channelControl.getChannel(pluginIdentifier);
|
||||
}
|
||||
if (thePlugin) {
|
||||
theExt = (_a = {
|
||||
plugin: thePlugin
|
||||
},
|
||||
_a[_DYN_SET_ENABLED /* @min:setEnabled */] = function (enabled) {
|
||||
_getPluginState(thePlugin)[STR_DISABLED] = !enabled;
|
||||
},
|
||||
_a.isEnabled = function () {
|
||||
var pluginState = _getPluginState(thePlugin);
|
||||
return !pluginState[_DYN_TEARDOWN /* @min:%2eteardown */] && !pluginState[STR_DISABLED];
|
||||
},
|
||||
_a.remove = function (isAsync, removeCb) {
|
||||
var _a;
|
||||
if (isAsync === void 0) { isAsync = true; }
|
||||
var pluginsToRemove = [thePlugin];
|
||||
var unloadState = (_a = {
|
||||
reason: 1 /* TelemetryUnloadReason.PluginUnload */
|
||||
},
|
||||
_a[_DYN_IS_ASYNC /* @min:isAsync */] = isAsync,
|
||||
_a);
|
||||
_removePlugins(pluginsToRemove, unloadState, function (removed) {
|
||||
if (removed) {
|
||||
// Re-Initialize the plugin chain
|
||||
_initPluginChain({
|
||||
reason: 32 /* TelemetryUpdateReason.PluginRemoved */,
|
||||
removed: pluginsToRemove
|
||||
});
|
||||
}
|
||||
removeCb && removeCb(removed);
|
||||
});
|
||||
},
|
||||
_a);
|
||||
}
|
||||
return theExt;
|
||||
}
|
||||
function _getPluginChain() {
|
||||
if (!_pluginChain) {
|
||||
// copy the collection of extensions
|
||||
var extensions = (_coreExtensions || []).slice();
|
||||
// During add / remove this may get called again, so don't readd if already present
|
||||
if (arrIndexOf(extensions, _telemetryInitializerPlugin) === -1) {
|
||||
extensions[_DYN_PUSH /* @min:%2epush */](_telemetryInitializerPlugin);
|
||||
}
|
||||
_pluginChain = createTelemetryProxyChain(sortPlugins(extensions), _config, _self);
|
||||
}
|
||||
return _pluginChain;
|
||||
}
|
||||
function _removePlugins(thePlugins, unloadState, removeComplete) {
|
||||
if (thePlugins && thePlugins[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
||||
var unloadChain = createTelemetryProxyChain(thePlugins, _config, _self);
|
||||
var unloadCtx = createProcessTelemetryUnloadContext(unloadChain, _self);
|
||||
unloadCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](function () {
|
||||
var removed = false;
|
||||
// Remove the listed config extensions
|
||||
var newConfigExtensions = [];
|
||||
arrForEach(_configExtensions, function (plugin, idx) {
|
||||
if (!_isPluginPresent(plugin, thePlugins)) {
|
||||
newConfigExtensions[_DYN_PUSH /* @min:%2epush */](plugin);
|
||||
}
|
||||
else {
|
||||
removed = true;
|
||||
}
|
||||
});
|
||||
_configExtensions = newConfigExtensions;
|
||||
// Re-Create the channel config
|
||||
var newChannelConfig = [];
|
||||
if (_channelConfig) {
|
||||
arrForEach(_channelConfig, function (queue, idx) {
|
||||
var newQueue = [];
|
||||
arrForEach(queue, function (channel) {
|
||||
if (!_isPluginPresent(channel, thePlugins)) {
|
||||
newQueue[_DYN_PUSH /* @min:%2epush */](channel);
|
||||
}
|
||||
else {
|
||||
removed = true;
|
||||
}
|
||||
});
|
||||
newChannelConfig[_DYN_PUSH /* @min:%2epush */](newQueue);
|
||||
});
|
||||
_channelConfig = newChannelConfig;
|
||||
}
|
||||
removeComplete && removeComplete(removed);
|
||||
_startInternalLogTimer();
|
||||
});
|
||||
unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](unloadState);
|
||||
}
|
||||
else {
|
||||
removeComplete(false);
|
||||
}
|
||||
}
|
||||
function _flushInternalLogs() {
|
||||
if (_self[_DYN_LOGGER /* @min:%2elogger */] && _self[_DYN_LOGGER /* @min:%2elogger */].queue) {
|
||||
var queue = _self[_DYN_LOGGER /* @min:%2elogger */].queue.slice(0);
|
||||
_self[_DYN_LOGGER /* @min:%2elogger */].queue[_DYN_LENGTH /* @min:%2elength */] = 0;
|
||||
arrForEach(queue, function (logMessage) {
|
||||
var _a;
|
||||
var item = (_a = {},
|
||||
_a[_DYN_NAME /* @min:name */] = _internalLogsEventName ? _internalLogsEventName : "InternalMessageId: " + logMessage[_DYN_MESSAGE_ID /* @min:%2emessageId */],
|
||||
_a.iKey = getCfgValue(_config[_DYN_INSTRUMENTATION_KEY /* @min:%2einstrumentationKey */]),
|
||||
_a.time = toISOString(new Date()),
|
||||
_a.baseType = _InternalLogMessage.dataType,
|
||||
_a.baseData = { message: logMessage[_DYN_MESSAGE /* @min:%2emessage */] },
|
||||
_a);
|
||||
_self.track(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
function _flushChannels(isAsync, callBack, sendReason, cbTimeout) {
|
||||
if (_channelControl) {
|
||||
return _channelControl[_DYN_FLUSH /* @min:%2eflush */](isAsync, callBack, sendReason || 6 /* SendRequestReason.SdkUnload */, cbTimeout);
|
||||
}
|
||||
callBack && callBack(false);
|
||||
return true;
|
||||
}
|
||||
function _initDebugListener() {
|
||||
var disableDbgExt = getCfgValue(_config.disableDbgExt);
|
||||
if (disableDbgExt === true && _debugListener) {
|
||||
// Remove any previously loaded debug listener
|
||||
_notificationManager[_DYN_REMOVE_NOTIFICATION_2 /* @min:%2eremoveNotificationListener */](_debugListener);
|
||||
_debugListener = null;
|
||||
}
|
||||
if (_notificationManager && !_debugListener && disableDbgExt !== true) {
|
||||
_debugListener = getDebugListener(_config);
|
||||
_notificationManager[_DYN_ADD_NOTIFICATION_LIS1 /* @min:%2eaddNotificationListener */](_debugListener);
|
||||
}
|
||||
}
|
||||
function _initPerfManager() {
|
||||
var enablePerfMgr = getCfgValue(_config.enablePerfMgr);
|
||||
if (!enablePerfMgr && _cfgPerfManager) {
|
||||
// Remove any existing config based performance manager
|
||||
_cfgPerfManager = null;
|
||||
}
|
||||
if (enablePerfMgr) {
|
||||
// Set the performance manager creation function if not defined
|
||||
getSetValue(_config, STR_CREATE_PERF_MGR, _createPerfManager);
|
||||
}
|
||||
}
|
||||
function _initExtConfig() {
|
||||
var extConfig = getSetValue(_config, STR_EXTENSION_CONFIG, {});
|
||||
extConfig.NotificationManager = _notificationManager;
|
||||
}
|
||||
function _doUpdate(updateState) {
|
||||
var updateCtx = createProcessTelemetryUpdateContext(_getPluginChain(), _self);
|
||||
updateCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](_startInternalLogTimer);
|
||||
if (!_self._updateHook || _self._updateHook(updateCtx, updateState) !== true) {
|
||||
updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](updateState);
|
||||
}
|
||||
}
|
||||
function _logOrThrowError(message) {
|
||||
var logger = _self[_DYN_LOGGER /* @min:%2elogger */];
|
||||
if (logger) {
|
||||
// there should always be a logger
|
||||
_throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 73 /* _eInternalMessageId.PluginException */, message);
|
||||
_startInternalLogTimer();
|
||||
}
|
||||
else {
|
||||
throwError(message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// Removed Stub for BaseCore.prototype.initialize.
|
||||
// Removed Stub for BaseCore.prototype.getTransmissionControls.
|
||||
// Removed Stub for BaseCore.prototype.track.
|
||||
// Removed Stub for BaseCore.prototype.getProcessTelContext.
|
||||
// Removed Stub for BaseCore.prototype.getNotifyMgr.
|
||||
// Removed Stub for BaseCore.prototype.addNotificationListener.
|
||||
// Removed Stub for BaseCore.prototype.removeNotificationListener.
|
||||
// Removed Stub for BaseCore.prototype.getCookieMgr.
|
||||
// Removed Stub for BaseCore.prototype.setCookieMgr.
|
||||
// Removed Stub for BaseCore.prototype.getPerfMgr.
|
||||
// Removed Stub for BaseCore.prototype.setPerfMgr.
|
||||
// Removed Stub for BaseCore.prototype.eventCnt.
|
||||
// Removed Stub for BaseCore.prototype.pollInternalLogs.
|
||||
// Removed Stub for BaseCore.prototype.stopPollingInternalLogs.
|
||||
// Removed Stub for BaseCore.prototype.addTelemetryInitializer.
|
||||
// Removed Stub for BaseCore.prototype.unload.
|
||||
// Removed Stub for BaseCore.prototype.getPlugin.
|
||||
// Removed Stub for BaseCore.prototype.addPlugin.
|
||||
// Removed Stub for BaseCore.prototype.evtNamespace.
|
||||
// Removed Stub for BaseCore.prototype.addUnloadCb.
|
||||
// Removed Stub for BaseCore.prototype.flush.
|
||||
// Removed Stub for BaseCore.prototype.getTraceCtx.
|
||||
// Removed Stub for BaseCore.prototype.setTraceCtx.
|
||||
// Removed Stub for BaseCore.prototype.releaseQueue.
|
||||
// Removed Stub for BaseCore.prototype._updateHook.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
BaseCore.__ieDyn=1;
|
||||
|
||||
return BaseCore;
|
||||
}());
|
||||
export { BaseCore };
|
201
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js
generated
vendored
Normal file
201
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js
generated
vendored
Normal file
@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
import dynamicProto from "@microsoft/dynamicproto-js";
|
||||
import { _DYN_CREATE_NEW, _DYN_DIAG_LOG, _DYN_GET_NEXT, _DYN_GET_PROCESS_TEL_CONT0, _DYN_INITIALIZE, _DYN_IS_ASYNC, _DYN_IS_INITIALIZED, _DYN_PROCESS_NEXT, _DYN_PUSH, _DYN_SET_NEXT_PLUGIN, _DYN_TEARDOWN, _DYN_UPDATE, _DYN__DO_TEARDOWN } from "../__DynamicConstants";
|
||||
import { arrForEach, isArray, isFunction, isNullOrUndefined, proxyFunctionAs, setValue } from "./HelperFuncs";
|
||||
import { STR_CORE, STR_EXTENSION_CONFIG, STR_PROCESS_TELEMETRY } from "./InternalConstants";
|
||||
import { createProcessTelemetryContext, createProcessTelemetryUnloadContext, createProcessTelemetryUpdateContext } from "./ProcessTelemetryContext";
|
||||
import { createUnloadHandlerContainer } from "./UnloadHandlerContainer";
|
||||
var strGetPlugin = "getPlugin";
|
||||
/**
|
||||
* BaseTelemetryPlugin provides a basic implementation of the ITelemetryPlugin interface so that plugins
|
||||
* can avoid implementation the same set of boiler plate code as well as provide a base
|
||||
* implementation so that new default implementations can be added without breaking all plugins.
|
||||
*/
|
||||
var BaseTelemetryPlugin = /** @class */ (function () {
|
||||
function BaseTelemetryPlugin() {
|
||||
var _self = this; // Setting _self here as it's used outside of the dynamicProto as well
|
||||
// NOTE!: DON'T set default values here, instead set them in the _initDefaults() function as it is also called during teardown()
|
||||
var _isinitialized;
|
||||
var _rootCtx; // Used as the root context, holding the current config and initialized core
|
||||
var _nextPlugin; // Used for backward compatibility where plugins don't call the main pipeline
|
||||
var _unloadHandlerContainer;
|
||||
var _hooks;
|
||||
_initDefaults();
|
||||
dynamicProto(BaseTelemetryPlugin, _self, function (_self) {
|
||||
_self[_DYN_INITIALIZE /* @min:%2einitialize */] = function (config, core, extensions, pluginChain) {
|
||||
_setDefaults(config, core, pluginChain);
|
||||
_isinitialized = true;
|
||||
};
|
||||
_self[_DYN_TEARDOWN /* @min:%2eteardown */] = function (unloadCtx, unloadState) {
|
||||
var _a;
|
||||
// If this plugin has already been torn down (not operational) or is not initialized (core is not set)
|
||||
// or the core being used for unload was not the same core used for initialization.
|
||||
var core = _self[STR_CORE /* @min:%2ecore */];
|
||||
if (!core || (unloadCtx && core !== unloadCtx[STR_CORE /* @min:%2ecore */]())) {
|
||||
// Do Nothing as either the plugin is not initialized or was not initialized by the current core
|
||||
return;
|
||||
}
|
||||
var result;
|
||||
var unloadDone = false;
|
||||
var theUnloadCtx = unloadCtx || createProcessTelemetryUnloadContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
||||
var theUnloadState = unloadState || (_a = {
|
||||
reason: 0 /* TelemetryUnloadReason.ManualTeardown */
|
||||
},
|
||||
_a[_DYN_IS_ASYNC /* @min:isAsync */] = false,
|
||||
_a);
|
||||
function _unloadCallback() {
|
||||
if (!unloadDone) {
|
||||
unloadDone = true;
|
||||
_unloadHandlerContainer.run(theUnloadCtx, unloadState);
|
||||
var oldHooks = _hooks;
|
||||
_hooks = [];
|
||||
// Remove all instrumentation hooks
|
||||
arrForEach(oldHooks, function (fn) {
|
||||
fn.rm();
|
||||
});
|
||||
if (result === true) {
|
||||
theUnloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);
|
||||
}
|
||||
_initDefaults();
|
||||
}
|
||||
}
|
||||
if (!_self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */] || _self[_DYN__DO_TEARDOWN /* @min:%2e_doTeardown */](theUnloadCtx, theUnloadState, _unloadCallback) !== true) {
|
||||
_unloadCallback();
|
||||
}
|
||||
else {
|
||||
// Tell the caller that we will be calling processNext()
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
_self[_DYN_UPDATE /* @min:%2eupdate */] = function (updateCtx, updateState) {
|
||||
// If this plugin has already been torn down (not operational) or is not initialized (core is not set)
|
||||
// or the core being used for unload was not the same core used for initialization.
|
||||
var core = _self[STR_CORE /* @min:%2ecore */];
|
||||
if (!core || (updateCtx && core !== updateCtx[STR_CORE /* @min:%2ecore */]())) {
|
||||
// Do Nothing
|
||||
return;
|
||||
}
|
||||
var result;
|
||||
var updateDone = false;
|
||||
var theUpdateCtx = updateCtx || createProcessTelemetryUpdateContext(null, core, _nextPlugin && _nextPlugin[strGetPlugin] ? _nextPlugin[strGetPlugin]() : _nextPlugin);
|
||||
var theUpdateState = updateState || {
|
||||
reason: 0 /* TelemetryUpdateReason.Unknown */
|
||||
};
|
||||
function _updateCallback() {
|
||||
if (!updateDone) {
|
||||
updateDone = true;
|
||||
_setDefaults(theUpdateCtx.getCfg(), theUpdateCtx.core(), theUpdateCtx[_DYN_GET_NEXT /* @min:%2egetNext */]());
|
||||
}
|
||||
}
|
||||
if (!_self._doUpdate || _self._doUpdate(theUpdateCtx, theUpdateState, _updateCallback) !== true) {
|
||||
_updateCallback();
|
||||
}
|
||||
else {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
_self._addHook = function (hooks) {
|
||||
if (hooks) {
|
||||
if (isArray(hooks)) {
|
||||
_hooks = _hooks.concat(hooks);
|
||||
}
|
||||
else {
|
||||
_hooks[_DYN_PUSH /* @min:%2epush */](hooks);
|
||||
}
|
||||
}
|
||||
};
|
||||
proxyFunctionAs(_self, "_addUnloadCb", function () { return _unloadHandlerContainer; }, "add");
|
||||
});
|
||||
// These are added after the dynamicProto so that are not moved to the prototype
|
||||
_self[_DYN_DIAG_LOG /* @min:%2ediagLog */] = function (itemCtx) {
|
||||
return _getTelCtx(itemCtx)[_DYN_DIAG_LOG /* @min:%2ediagLog */]();
|
||||
};
|
||||
_self[_DYN_IS_INITIALIZED /* @min:%2eisInitialized */] = function () {
|
||||
return _isinitialized;
|
||||
};
|
||||
_self.setInitialized = function (isInitialized) {
|
||||
_isinitialized = isInitialized;
|
||||
};
|
||||
// _self.getNextPlugin = () => DO NOT IMPLEMENT
|
||||
// Sub-classes of this base class *should* not be relying on this value and instead
|
||||
// should use processNext() function. If you require access to the plugin use the
|
||||
// IProcessTelemetryContext.getNext().getPlugin() while in the pipeline, Note getNext() may return null.
|
||||
_self[_DYN_SET_NEXT_PLUGIN /* @min:%2esetNextPlugin */] = function (next) {
|
||||
_nextPlugin = next;
|
||||
};
|
||||
_self[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */] = function (env, itemCtx) {
|
||||
if (itemCtx) {
|
||||
// Normal core execution sequence
|
||||
itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](env);
|
||||
}
|
||||
else if (_nextPlugin && isFunction(_nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */])) {
|
||||
// Looks like backward compatibility or out of band processing. And as it looks
|
||||
// like a ITelemetryPlugin or ITelemetryPluginChain, just call processTelemetry
|
||||
_nextPlugin[STR_PROCESS_TELEMETRY /* @min:%2eprocessTelemetry */](env, null);
|
||||
}
|
||||
};
|
||||
_self._getTelCtx = _getTelCtx;
|
||||
function _getTelCtx(currentCtx) {
|
||||
if (currentCtx === void 0) { currentCtx = null; }
|
||||
var itemCtx = currentCtx;
|
||||
if (!itemCtx) {
|
||||
var rootCtx = _rootCtx || createProcessTelemetryContext(null, {}, _self[STR_CORE /* @min:%2ecore */]);
|
||||
// tslint:disable-next-line: prefer-conditional-expression
|
||||
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
||||
// Looks like a chain object
|
||||
itemCtx = rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin[strGetPlugin]);
|
||||
}
|
||||
else {
|
||||
itemCtx = rootCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](null, _nextPlugin);
|
||||
}
|
||||
}
|
||||
return itemCtx;
|
||||
}
|
||||
function _setDefaults(config, core, pluginChain) {
|
||||
if (config) {
|
||||
// Make sure the extensionConfig exists
|
||||
setValue(config, STR_EXTENSION_CONFIG, [], null, isNullOrUndefined);
|
||||
}
|
||||
if (!pluginChain && core) {
|
||||
// Get the first plugin from the core
|
||||
pluginChain = core[_DYN_GET_PROCESS_TEL_CONT0 /* @min:%2egetProcessTelContext */]()[_DYN_GET_NEXT /* @min:%2egetNext */]();
|
||||
}
|
||||
var nextPlugin = _nextPlugin;
|
||||
if (_nextPlugin && _nextPlugin[strGetPlugin]) {
|
||||
// If it looks like a proxy/chain then get the plugin
|
||||
nextPlugin = _nextPlugin[strGetPlugin]();
|
||||
}
|
||||
// Support legacy plugins where core was defined as a property
|
||||
_self[STR_CORE /* @min:%2ecore */] = core;
|
||||
_rootCtx = createProcessTelemetryContext(pluginChain, config, core, nextPlugin);
|
||||
}
|
||||
function _initDefaults() {
|
||||
_isinitialized = false;
|
||||
_self[STR_CORE /* @min:%2ecore */] = null;
|
||||
_rootCtx = null;
|
||||
_nextPlugin = null;
|
||||
_hooks = [];
|
||||
_unloadHandlerContainer = createUnloadHandlerContainer();
|
||||
}
|
||||
}
|
||||
// Removed Stub for BaseTelemetryPlugin.prototype.initialize.
|
||||
// Removed Stub for BaseTelemetryPlugin.prototype.teardown.
|
||||
// Removed Stub for BaseTelemetryPlugin.prototype.update.
|
||||
// Removed Stub for BaseTelemetryPlugin.prototype._addUnloadCb.
|
||||
// Removed Stub for BaseTelemetryPlugin.prototype._addHook.
|
||||
// This is a workaround for an IE8 bug when using dynamicProto() with classes that don't have any
|
||||
// non-dynamic functions or static properties/functions when using uglify-js to minify the resulting code.
|
||||
// this will be removed when ES3 support is dropped.
|
||||
BaseTelemetryPlugin.__ieDyn=1;
|
||||
|
||||
return BaseTelemetryPlugin;
|
||||
}());
|
||||
export { BaseTelemetryPlugin };
|
218
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js
generated
vendored
Normal file
218
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js
generated
vendored
Normal file
@ -0,0 +1,218 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
//
|
||||
import { _DYN_CONFIG, _DYN_CREATE_NEW, _DYN_FLUSH, _DYN_IDENTIFIER, _DYN_LENGTH, _DYN_ON_COMPLETE, _DYN_PROCESS_NEXT, _DYN_PUSH } from "../__DynamicConstants";
|
||||
import { arrForEach, isArray, objFreeze, throwError } from "./HelperFuncs";
|
||||
import { STR_PRIORITY } from "./InternalConstants";
|
||||
import { createProcessTelemetryContext, createTelemetryProxyChain } from "./ProcessTelemetryContext";
|
||||
import { initializePlugins } from "./TelemetryHelpers";
|
||||
export var ChannelControllerPriority = 500;
|
||||
var ChannelValidationMessage = "Channel has invalid priority - ";
|
||||
function _addChannelQueue(channelQueue, queue, core) {
|
||||
if (queue && isArray(queue) && queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
||||
queue = queue.sort(function (a, b) {
|
||||
return a[STR_PRIORITY /* @min:%2epriority */] - b[STR_PRIORITY /* @min:%2epriority */];
|
||||
});
|
||||
arrForEach(queue, function (queueItem) {
|
||||
if (queueItem[STR_PRIORITY /* @min:%2epriority */] < ChannelControllerPriority) {
|
||||
throwError(ChannelValidationMessage + queueItem[_DYN_IDENTIFIER /* @min:%2eidentifier */]);
|
||||
}
|
||||
});
|
||||
channelQueue[_DYN_PUSH /* @min:%2epush */]({
|
||||
queue: objFreeze(queue),
|
||||
chain: createTelemetryProxyChain(queue, core[_DYN_CONFIG /* @min:%2econfig */], core)
|
||||
});
|
||||
}
|
||||
}
|
||||
export function createChannelControllerPlugin(channelQueue, core) {
|
||||
function _getTelCtx() {
|
||||
return createProcessTelemetryContext(null, core[_DYN_CONFIG /* @min:%2econfig */], core, null);
|
||||
}
|
||||
function _processChannelQueue(theChannels, itemCtx, processFn, onComplete) {
|
||||
var waiting = theChannels ? (theChannels[_DYN_LENGTH /* @min:%2elength */] + 1) : 1;
|
||||
function _runChainOnComplete() {
|
||||
waiting--;
|
||||
if (waiting === 0) {
|
||||
onComplete && onComplete();
|
||||
onComplete = null;
|
||||
}
|
||||
}
|
||||
if (waiting > 0) {
|
||||
arrForEach(theChannels, function (channels) {
|
||||
// pass on to first item in queue
|
||||
if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
||||
var channelChain = channels.chain;
|
||||
var chainCtx = itemCtx[_DYN_CREATE_NEW /* @min:%2ecreateNew */](channelChain);
|
||||
chainCtx[_DYN_ON_COMPLETE /* @min:%2eonComplete */](_runChainOnComplete);
|
||||
// Cause this chain to start processing
|
||||
processFn(chainCtx);
|
||||
}
|
||||
else {
|
||||
waiting--;
|
||||
}
|
||||
});
|
||||
}
|
||||
_runChainOnComplete();
|
||||
}
|
||||
function _doUpdate(updateCtx, updateState) {
|
||||
var theUpdateState = updateState || {
|
||||
reason: 0 /* TelemetryUpdateReason.Unknown */
|
||||
};
|
||||
_processChannelQueue(channelQueue, updateCtx, function (chainCtx) {
|
||||
chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);
|
||||
}, function () {
|
||||
updateCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUpdateState);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
function _doTeardown(unloadCtx, unloadState) {
|
||||
var theUnloadState = unloadState || {
|
||||
reason: 0 /* TelemetryUnloadReason.ManualTeardown */,
|
||||
isAsync: false
|
||||
};
|
||||
_processChannelQueue(channelQueue, unloadCtx, function (chainCtx) {
|
||||
chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);
|
||||
}, function () {
|
||||
unloadCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](theUnloadState);
|
||||
isInitialized = false;
|
||||
});
|
||||
return true;
|
||||
}
|
||||
function _getChannel(pluginIdentifier) {
|
||||
var thePlugin = null;
|
||||
if (channelQueue && channelQueue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
||||
arrForEach(channelQueue, function (channels) {
|
||||
// pass on to first item in queue
|
||||
if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
||||
arrForEach(channels.queue, function (ext) {
|
||||
if (ext[_DYN_IDENTIFIER /* @min:%2eidentifier */] === pluginIdentifier) {
|
||||
thePlugin = ext;
|
||||
// Cause arrForEach to stop iterating
|
||||
return -1;
|
||||
}
|
||||
});
|
||||
if (thePlugin) {
|
||||
// Cause arrForEach to stop iterating
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return thePlugin;
|
||||
}
|
||||
var isInitialized = false;
|
||||
var channelController = {
|
||||
identifier: "ChannelControllerPlugin",
|
||||
priority: ChannelControllerPriority,
|
||||
initialize: function (config, core, extensions, pluginChain) {
|
||||
isInitialized = true;
|
||||
arrForEach(channelQueue, function (channels) {
|
||||
if (channels && channels.queue[_DYN_LENGTH /* @min:%2elength */] > 0) {
|
||||
initializePlugins(createProcessTelemetryContext(channels.chain, config, core), extensions);
|
||||
}
|
||||
});
|
||||
},
|
||||
isInitialized: function () {
|
||||
return isInitialized;
|
||||
},
|
||||
processTelemetry: function (item, itemCtx) {
|
||||
_processChannelQueue(channelQueue, itemCtx || _getTelCtx(), function (chainCtx) {
|
||||
chainCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);
|
||||
}, function () {
|
||||
itemCtx[_DYN_PROCESS_NEXT /* @min:%2eprocessNext */](item);
|
||||
});
|
||||
},
|
||||
update: _doUpdate,
|
||||
pause: function () {
|
||||
_processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) {
|
||||
chainCtx.iterate(function (plugin) {
|
||||
plugin.pause && plugin.pause();
|
||||
});
|
||||
}, null);
|
||||
},
|
||||
resume: function () {
|
||||
_processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) {
|
||||
chainCtx.iterate(function (plugin) {
|
||||
plugin.resume && plugin.resume();
|
||||
});
|
||||
}, null);
|
||||
},
|
||||
teardown: _doTeardown,
|
||||
getChannel: _getChannel,
|
||||
flush: function (isAsync, callBack, sendReason, cbTimeout) {
|
||||
// Setting waiting to one so that we don't call the callBack until we finish iterating
|
||||
var waiting = 1;
|
||||
var doneIterating = false;
|
||||
var cbTimer = null;
|
||||
cbTimeout = cbTimeout || 5000;
|
||||
function doCallback() {
|
||||
waiting--;
|
||||
if (doneIterating && waiting === 0) {
|
||||
if (cbTimer) {
|
||||
clearTimeout(cbTimer);
|
||||
cbTimer = null;
|
||||
}
|
||||
callBack && callBack(doneIterating);
|
||||
callBack = null;
|
||||
}
|
||||
}
|
||||
_processChannelQueue(channelQueue, _getTelCtx(), function (chainCtx) {
|
||||
chainCtx.iterate(function (plugin) {
|
||||
if (plugin[_DYN_FLUSH /* @min:%2eflush */]) {
|
||||
waiting++;
|
||||
var handled_1 = false;
|
||||
// Not all channels will call this callback for every scenario
|
||||
if (!plugin[_DYN_FLUSH /* @min:%2eflush */](isAsync, function () {
|
||||
handled_1 = true;
|
||||
doCallback();
|
||||
}, sendReason)) {
|
||||
if (!handled_1) {
|
||||
// If any channel doesn't return true and it didn't call the callback, then we should assume that the callback
|
||||
// will never be called, so use a timeout to allow the channel(s) some time to "finish" before triggering any
|
||||
// followup function (such as unloading)
|
||||
if (isAsync && cbTimer == null) {
|
||||
cbTimer = setTimeout(function () {
|
||||
cbTimer = null;
|
||||
doCallback();
|
||||
}, cbTimeout);
|
||||
}
|
||||
else {
|
||||
doCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
doneIterating = true;
|
||||
doCallback();
|
||||
});
|
||||
return true;
|
||||
},
|
||||
_setQueue: function (queue) {
|
||||
channelQueue = queue;
|
||||
}
|
||||
};
|
||||
return channelController;
|
||||
}
|
||||
export function createChannelQueues(channels, extensions, core) {
|
||||
var channelQueue = [];
|
||||
if (channels) {
|
||||
// Add and sort the configuration channel queues
|
||||
arrForEach(channels, function (queue) { return _addChannelQueue(channelQueue, queue, core); });
|
||||
}
|
||||
if (extensions) {
|
||||
// Create a new channel queue for any extensions with a priority > the ChannelControllerPriority
|
||||
var extensionQueue_1 = [];
|
||||
arrForEach(extensions, function (plugin) {
|
||||
if (plugin[STR_PRIORITY /* @min:%2epriority */] > ChannelControllerPriority) {
|
||||
extensionQueue_1[_DYN_PUSH /* @min:%2epush */](plugin);
|
||||
}
|
||||
});
|
||||
_addChannelQueue(channelQueue, extensionQueue_1, core);
|
||||
}
|
||||
return channelQueue;
|
||||
}
|
337
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CookieMgr.js
generated
vendored
Normal file
337
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CookieMgr.js
generated
vendored
Normal file
@ -0,0 +1,337 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
import { _DYN_COOKIE_CFG, _DYN_INDEX_OF, _DYN_LENGTH, _DYN_LOGGER, _DYN_SET_ENABLED, _DYN_SPLIT, _DYN_SUBSTRING, _DYN_USER_AGENT } from "../__DynamicConstants";
|
||||
import { _throwInternal } from "./DiagnosticLogger";
|
||||
import { dumpObj, getDocument, getLocation, getNavigator, isIE } from "./EnvUtils";
|
||||
import { arrForEach, dateNow, getExceptionName, isArray, isFunction, isNotNullOrUndefined, isNullOrUndefined, isString, isTruthy, isUndefined, objForEachKey, setValue, strContains, strEndsWith, strTrim } from "./HelperFuncs";
|
||||
import { STR_EMPTY } from "./InternalConstants";
|
||||
var strToGMTString = "toGMTString";
|
||||
var strToUTCString = "toUTCString";
|
||||
var strCookie = "cookie";
|
||||
var strExpires = "expires";
|
||||
var strEnabled = "enabled";
|
||||
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
||||
var strDisableCookiesUsage = "disableCookiesUsage";
|
||||
var strConfigCookieMgr = "_ckMgr";
|
||||
var _supportsCookies = null;
|
||||
var _allowUaSameSite = null;
|
||||
var _parsedCookieValue = null;
|
||||
var _doc = getDocument();
|
||||
var _cookieCache = {};
|
||||
var _globalCookieConfig = {};
|
||||
/**
|
||||
* @ignore
|
||||
* DO NOT USE or export from the module, this is exposed as public to support backward compatibility of previous static utility methods only.
|
||||
* If you want to manager cookies either use the ICookieMgr available from the core instance via getCookieMgr() or create
|
||||
* your own instance of the CookieMgr and use that.
|
||||
* Using this directly for enabling / disabling cookie handling will not only affect your usage but EVERY user of cookies.
|
||||
* Example, if you are using a shared component that is also using Application Insights you will affect their cookie handling.
|
||||
* @param logger - The DiagnosticLogger to use for reporting errors.
|
||||
*/
|
||||
export function _gblCookieMgr(config, logger) {
|
||||
// Stash the global instance against the BaseCookieMgr class
|
||||
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
||||
if (!inst) {
|
||||
// Note: not using the getSetValue() helper as that would require always creating a temporary cookieMgr
|
||||
// that ultimately is never used
|
||||
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
||||
_globalCookieConfig[strConfigCookieMgr] = inst;
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
function _isMgrEnabled(cookieMgr) {
|
||||
if (cookieMgr) {
|
||||
return cookieMgr.isEnabled();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function _createCookieMgrConfig(rootConfig) {
|
||||
var cookieMgrCfg = rootConfig[_DYN_COOKIE_CFG /* @min:%2ecookieCfg */] = rootConfig[_DYN_COOKIE_CFG /* @min:%2ecookieCfg */] || {};
|
||||
// Sets the values from the root config if not already present on the cookieMgrCfg
|
||||
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
||||
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
||||
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
||||
// Set the enabled from the provided setting or the legacy root values
|
||||
var cookieEnabled = void 0;
|
||||
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
||||
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
||||
}
|
||||
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
||||
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
||||
}
|
||||
cookieMgrCfg[strEnabled] = cookieEnabled;
|
||||
}
|
||||
return cookieMgrCfg;
|
||||
}
|
||||
function _isIgnoredCookie(cookieMgrCfg, name) {
|
||||
if (name && cookieMgrCfg && isArray(cookieMgrCfg.ignoreCookies)) {
|
||||
return cookieMgrCfg.ignoreCookies[_DYN_INDEX_OF /* @min:%2eindexOf */](name) !== -1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function _isBlockedCookie(cookieMgrCfg, name) {
|
||||
if (name && cookieMgrCfg && isArray(cookieMgrCfg.blockedCookies)) {
|
||||
if (cookieMgrCfg.blockedCookies[_DYN_INDEX_OF /* @min:%2eindexOf */](name) !== -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return _isIgnoredCookie(cookieMgrCfg, name);
|
||||
}
|
||||
/**
|
||||
* Helper to return the ICookieMgr from the core (if not null/undefined) or a default implementation
|
||||
* associated with the configuration or a legacy default.
|
||||
* @param core
|
||||
* @param config
|
||||
* @returns
|
||||
*/
|
||||
export function safeGetCookieMgr(core, config) {
|
||||
var cookieMgr;
|
||||
if (core) {
|
||||
// Always returns an instance
|
||||
cookieMgr = core.getCookieMgr();
|
||||
}
|
||||
else if (config) {
|
||||
var cookieCfg = config[_DYN_COOKIE_CFG /* @min:%2ecookieCfg */];
|
||||
if (cookieCfg[strConfigCookieMgr]) {
|
||||
cookieMgr = cookieCfg[strConfigCookieMgr];
|
||||
}
|
||||
else {
|
||||
cookieMgr = createCookieMgr(config);
|
||||
}
|
||||
}
|
||||
if (!cookieMgr) {
|
||||
// Get or initialize the default global (legacy) cookie manager if we couldn't find one
|
||||
cookieMgr = _gblCookieMgr(config, (core || {})[_DYN_LOGGER /* @min:%2elogger */]);
|
||||
}
|
||||
return cookieMgr;
|
||||
}
|
||||
export function createCookieMgr(rootConfig, logger) {
|
||||
var _a;
|
||||
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
||||
var _path = cookieMgrConfig.path || "/";
|
||||
var _domain = cookieMgrConfig.domain;
|
||||
// Explicitly checking against false, so that setting to undefined will === true
|
||||
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
||||
var cookieMgr = (_a = {
|
||||
isEnabled: function () {
|
||||
var enabled = _enabled && areCookiesSupported(logger);
|
||||
// Using an indirect lookup for any global cookie manager to support tree shaking for SDK's
|
||||
// that don't use the "applicationinsights-core" version of the default cookie function
|
||||
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
||||
if (enabled && gblManager && cookieMgr !== gblManager) {
|
||||
// Make sure the GlobalCookie Manager instance (if not this instance) is also enabled.
|
||||
// As the global (deprecated) functions may have been called (for backward compatibility)
|
||||
enabled = _isMgrEnabled(gblManager);
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
},
|
||||
_a[_DYN_SET_ENABLED /* @min:setEnabled */] = function (value) {
|
||||
// Explicitly checking against false, so that setting to undefined will === true
|
||||
_enabled = value !== false;
|
||||
},
|
||||
_a.set = function (name, value, maxAgeSec, domain, path) {
|
||||
var result = false;
|
||||
if (_isMgrEnabled(cookieMgr) && !_isBlockedCookie(cookieMgrConfig, name)) {
|
||||
var values = {};
|
||||
var theValue = strTrim(value || STR_EMPTY);
|
||||
var idx = theValue[_DYN_INDEX_OF /* @min:%2eindexOf */](";");
|
||||
if (idx !== -1) {
|
||||
theValue = strTrim(value[_DYN_SUBSTRING /* @min:%2esubstring */](0, idx));
|
||||
values = _extractParts(value[_DYN_SUBSTRING /* @min:%2esubstring */](idx + 1));
|
||||
}
|
||||
// Only update domain if not already present (isUndefined) and the value is truthy (not null, undefined or empty string)
|
||||
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
||||
if (!isNullOrUndefined(maxAgeSec)) {
|
||||
var _isIE = isIE();
|
||||
if (isUndefined(values[strExpires])) {
|
||||
var nowMs = dateNow();
|
||||
// Only add expires if not already present
|
||||
var expireMs = nowMs + (maxAgeSec * 1000);
|
||||
// Sanity check, if zero or -ve then ignore
|
||||
if (expireMs > 0) {
|
||||
var expiry = new Date();
|
||||
expiry.setTime(expireMs);
|
||||
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || STR_EMPTY, isTruthy);
|
||||
}
|
||||
}
|
||||
if (!_isIE) {
|
||||
// Only replace if not already present
|
||||
setValue(values, "max-age", STR_EMPTY + maxAgeSec, null, isUndefined);
|
||||
}
|
||||
}
|
||||
var location_1 = getLocation();
|
||||
if (location_1 && location_1.protocol === "https:") {
|
||||
setValue(values, "secure", null, null, isUndefined);
|
||||
// Only set same site if not also secure
|
||||
if (_allowUaSameSite === null) {
|
||||
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {})[_DYN_USER_AGENT /* @min:%2euserAgent */]);
|
||||
}
|
||||
if (_allowUaSameSite) {
|
||||
setValue(values, "SameSite", "None", null, isUndefined);
|
||||
}
|
||||
}
|
||||
setValue(values, "path", path || _path, null, isUndefined);
|
||||
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
||||
setCookieFn(name, _formatCookieValue(theValue, values));
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
_a.get = function (name) {
|
||||
var value = STR_EMPTY;
|
||||
if (_isMgrEnabled(cookieMgr) && !_isIgnoredCookie(cookieMgrConfig, name)) {
|
||||
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
||||
}
|
||||
return value;
|
||||
},
|
||||
_a.del = function (name, path) {
|
||||
var result = false;
|
||||
if (_isMgrEnabled(cookieMgr)) {
|
||||
// Only remove the cookie if the manager and cookie support has not been disabled
|
||||
result = cookieMgr.purge(name, path);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
_a.purge = function (name, path) {
|
||||
var _a;
|
||||
var result = false;
|
||||
if (areCookiesSupported(logger)) {
|
||||
// Setting the expiration date in the past immediately removes the cookie
|
||||
var values = (_a = {},
|
||||
_a["path"] = path ? path : "/",
|
||||
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
||||
_a);
|
||||
if (!isIE()) {
|
||||
// Set max age to expire now
|
||||
values["max-age"] = "0";
|
||||
}
|
||||
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
||||
delCookie(name, _formatCookieValue(STR_EMPTY, values));
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
_a);
|
||||
// Associated this cookie manager with the config
|
||||
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
||||
return cookieMgr;
|
||||
}
|
||||
/*
|
||||
* Helper method to tell if document.cookie object is supported by the runtime
|
||||
*/
|
||||
export function areCookiesSupported(logger) {
|
||||
if (_supportsCookies === null) {
|
||||
_supportsCookies = false;
|
||||
try {
|
||||
var doc = _doc || {};
|
||||
_supportsCookies = doc[strCookie] !== undefined;
|
||||
}
|
||||
catch (e) {
|
||||
_throwInternal(logger, 2 /* eLoggingSeverity.WARNING */, 68 /* _eInternalMessageId.CannotAccessCookie */, "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
||||
}
|
||||
}
|
||||
return _supportsCookies;
|
||||
}
|
||||
function _extractParts(theValue) {
|
||||
var values = {};
|
||||
if (theValue && theValue[_DYN_LENGTH /* @min:%2elength */]) {
|
||||
var parts = strTrim(theValue)[_DYN_SPLIT /* @min:%2esplit */](";");
|
||||
arrForEach(parts, function (thePart) {
|
||||
thePart = strTrim(thePart || STR_EMPTY);
|
||||
if (thePart) {
|
||||
var idx = thePart[_DYN_INDEX_OF /* @min:%2eindexOf */]("=");
|
||||
if (idx === -1) {
|
||||
values[thePart] = null;
|
||||
}
|
||||
else {
|
||||
values[strTrim(thePart[_DYN_SUBSTRING /* @min:%2esubstring */](0, idx))] = strTrim(thePart[_DYN_SUBSTRING /* @min:%2esubstring */](idx + 1));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return values;
|
||||
}
|
||||
function _formatDate(theDate, func) {
|
||||
if (isFunction(theDate[func])) {
|
||||
return theDate[func]();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function _formatCookieValue(value, values) {
|
||||
var cookieValue = value || STR_EMPTY;
|
||||
objForEachKey(values, function (name, theValue) {
|
||||
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : STR_EMPTY);
|
||||
});
|
||||
return cookieValue;
|
||||
}
|
||||
function _getCookieValue(name) {
|
||||
var cookieValue = STR_EMPTY;
|
||||
if (_doc) {
|
||||
var theCookie = _doc[strCookie] || STR_EMPTY;
|
||||
if (_parsedCookieValue !== theCookie) {
|
||||
_cookieCache = _extractParts(theCookie);
|
||||
_parsedCookieValue = theCookie;
|
||||
}
|
||||
cookieValue = strTrim(_cookieCache[name] || STR_EMPTY);
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
function _setCookieValue(name, cookieValue) {
|
||||
if (_doc) {
|
||||
_doc[strCookie] = name + "=" + cookieValue;
|
||||
}
|
||||
}
|
||||
export function uaDisallowsSameSiteNone(userAgent) {
|
||||
if (!isString(userAgent)) {
|
||||
return false;
|
||||
}
|
||||
// Cover all iOS based browsers here. This includes:
|
||||
// - Safari on iOS 12 for iPhone, iPod Touch, iPad
|
||||
// - WkWebview on iOS 12 for iPhone, iPod Touch, iPad
|
||||
// - Chrome on iOS 12 for iPhone, iPod Touch, iPad
|
||||
// All of which are broken by SameSite=None, because they use the iOS networking stack
|
||||
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
||||
return true;
|
||||
}
|
||||
// Cover Mac OS X based browsers that use the Mac OS networking stack. This includes:
|
||||
// - Safari on Mac OS X
|
||||
// This does not include:
|
||||
// - Internal browser on Mac OS X
|
||||
// - Chrome on Mac OS X
|
||||
// - Chromium on Mac OS X
|
||||
// Because they do not use the Mac OS networking stack.
|
||||
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
||||
return true;
|
||||
}
|
||||
// Cover Mac OS X internal browsers that use the Mac OS networking stack. This includes:
|
||||
// - Internal browser on Mac OS X
|
||||
// This does not include:
|
||||
// - Safari on Mac OS X
|
||||
// - Chrome on Mac OS X
|
||||
// - Chromium on Mac OS X
|
||||
// Because they do not use the Mac OS networking stack.
|
||||
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
||||
return true;
|
||||
}
|
||||
// Cover Chrome 50-69, because some versions are broken by SameSite=None, and none in this range require it.
|
||||
// Note: this covers some pre-Chromium Edge versions, but pre-Chromim Edge does not require SameSite=None, so this is fine.
|
||||
// Note: this regex applies to Windows, Mac OS X, and Linux, deliberately.
|
||||
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
||||
return true;
|
||||
}
|
||||
// Unreal Engine runs Chromium 59, but does not advertise as Chrome until 4.23. Treat versions of Unreal
|
||||
// that don't specify their Chrome version as lacking support for SameSite=None.
|
||||
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
||||
return true;
|
||||
}
|
||||
// UCBrowser < 12.13.2 ignores Set-Cookie headers with SameSite=None
|
||||
// NB: this rule isn't complete - you need regex to make a complete rule.
|
||||
// See: https://www.chromium.org/updates/same-site/incompatible-clients
|
||||
if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
194
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js
generated
vendored
Normal file
194
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js
generated
vendored
Normal file
@ -0,0 +1,194 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
"use strict";
|
||||
import { objCreateFn, strShimUndefined } from "@microsoft/applicationinsights-shims";
|
||||
import { _DYN_LENGTH, _DYN_PUSH, _DYN_SET_ENABLED, _DYN_SUBSTR, _DYN_SUBSTRING } from "../__DynamicConstants";
|
||||
import { _gblCookieMgr } from "./CookieMgr";
|
||||
import { getPerformance, isIE } from "./EnvUtils";
|
||||
import { addEventHandler, attachEvent, detachEvent } from "./EventHelpers";
|
||||
import { arrForEach, arrIndexOf, arrMap, arrReduce, dateNow, hasOwnProperty, isArray, isBoolean, isDate, isError, isFunction, isNullOrUndefined, isNumber, isObject, isString, isTypeof, isUndefined, objDefineAccessors, objKeys, strTrim, toISOString } from "./HelperFuncs";
|
||||
import { STR_EMPTY } from "./InternalConstants";
|
||||
import { mwcRandom32, mwcRandomSeed, newId, random32, randomValue } from "./RandomHelper";
|
||||
var _cookieMgrs = null;
|
||||
var _canUseCookies; // legacy supported config
|
||||
// Added to help with minfication
|
||||
export var Undefined = strShimUndefined;
|
||||
export function newGuid() {
|
||||
var uuid = generateW3CId();
|
||||
return uuid[_DYN_SUBSTRING /* @min:%2esubstring */](0, 8) + "-" + uuid[_DYN_SUBSTRING /* @min:%2esubstring */](8, 12) + "-" + uuid[_DYN_SUBSTRING /* @min:%2esubstring */](12, 16) + "-" + uuid[_DYN_SUBSTRING /* @min:%2esubstring */](16, 20) + "-" + uuid[_DYN_SUBSTRING /* @min:%2esubstring */](20);
|
||||
}
|
||||
/**
|
||||
* Return the current value of the Performance Api now() function (if available) and fallback to dateNow() if it is unavailable (IE9 or less)
|
||||
* https://caniuse.com/#search=performance.now
|
||||
*/
|
||||
export function perfNow() {
|
||||
var perf = getPerformance();
|
||||
if (perf && perf.now) {
|
||||
return perf.now();
|
||||
}
|
||||
return dateNow();
|
||||
}
|
||||
/**
|
||||
* The strEndsWith() method determines whether a string ends with the characters of a specified string, returning true or false as appropriate.
|
||||
* @param value - The value to check whether it ends with the search value.
|
||||
* @param search - The characters to be searched for at the end of the value.
|
||||
* @returns true if the given search value is found at the end of the string, otherwise false.
|
||||
*/
|
||||
export function strEndsWith(value, search) {
|
||||
if (value && search) {
|
||||
var len = value[_DYN_LENGTH /* @min:%2elength */];
|
||||
var start = len - search[_DYN_LENGTH /* @min:%2elength */];
|
||||
return value[_DYN_SUBSTRING /* @min:%2esubstring */](start >= 0 ? start : 0, len) === search;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* generate W3C trace id
|
||||
*/
|
||||
export function generateW3CId() {
|
||||
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
||||
// rfc4122 version 4 UUID without dashes and with lowercase letters
|
||||
var oct = STR_EMPTY, tmp;
|
||||
for (var a = 0; a < 4; a++) {
|
||||
tmp = random32();
|
||||
oct +=
|
||||
hexValues[tmp & 0xF] +
|
||||
hexValues[tmp >> 4 & 0xF] +
|
||||
hexValues[tmp >> 8 & 0xF] +
|
||||
hexValues[tmp >> 12 & 0xF] +
|
||||
hexValues[tmp >> 16 & 0xF] +
|
||||
hexValues[tmp >> 20 & 0xF] +
|
||||
hexValues[tmp >> 24 & 0xF] +
|
||||
hexValues[tmp >> 28 & 0xF];
|
||||
}
|
||||
// "Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively"
|
||||
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
||||
return oct[_DYN_SUBSTR /* @min:%2esubstr */](0, 8) + oct[_DYN_SUBSTR /* @min:%2esubstr */](9, 4) + "4" + oct[_DYN_SUBSTR /* @min:%2esubstr */](13, 3) + clockSequenceHi + oct[_DYN_SUBSTR /* @min:%2esubstr */](16, 3) + oct[_DYN_SUBSTR /* @min:%2esubstr */](19, 12);
|
||||
}
|
||||
/**
|
||||
* Provides a collection of utility functions, included for backward compatibility with previous releases.
|
||||
* @deprecated Marking this instance as deprecated in favor of direct usage of the helper functions
|
||||
* as direct usage provides better tree-shaking and minification by avoiding the inclusion of the unused items
|
||||
* in your resulting code.
|
||||
*/
|
||||
export var CoreUtils = {
|
||||
_canUseCookies: undefined,
|
||||
isTypeof: isTypeof,
|
||||
isUndefined: isUndefined,
|
||||
isNullOrUndefined: isNullOrUndefined,
|
||||
hasOwnProperty: hasOwnProperty,
|
||||
isFunction: isFunction,
|
||||
isObject: isObject,
|
||||
isDate: isDate,
|
||||
isArray: isArray,
|
||||
isError: isError,
|
||||
isString: isString,
|
||||
isNumber: isNumber,
|
||||
isBoolean: isBoolean,
|
||||
toISOString: toISOString,
|
||||
arrForEach: arrForEach,
|
||||
arrIndexOf: arrIndexOf,
|
||||
arrMap: arrMap,
|
||||
arrReduce: arrReduce,
|
||||
strTrim: strTrim,
|
||||
objCreate: objCreateFn,
|
||||
objKeys: objKeys,
|
||||
objDefineAccessors: objDefineAccessors,
|
||||
addEventHandler: addEventHandler,
|
||||
dateNow: dateNow,
|
||||
isIE: isIE,
|
||||
disableCookies: disableCookies,
|
||||
newGuid: newGuid,
|
||||
perfNow: perfNow,
|
||||
newId: newId,
|
||||
randomValue: randomValue,
|
||||
random32: random32,
|
||||
mwcRandomSeed: mwcRandomSeed,
|
||||
mwcRandom32: mwcRandom32,
|
||||
generateW3CId: generateW3CId
|
||||
};
|
||||
var GuidRegex = /[xy]/g;
|
||||
export var EventHelper = {
|
||||
Attach: attachEvent,
|
||||
AttachEvent: attachEvent,
|
||||
Detach: detachEvent,
|
||||
DetachEvent: detachEvent
|
||||
};
|
||||
/**
|
||||
* Helper to support backward compatibility for users that use the legacy cookie handling functions and the use the internal
|
||||
* CoreUtils._canUseCookies global flag to enable/disable cookies usage.
|
||||
* Note: This has the following deliberate side-effects
|
||||
* - Creates the global (legacy) cookie manager if it does not already exist
|
||||
* - Attempts to add "listeners" to the CoreUtils._canUseCookies property to support the legacy usage
|
||||
* @param config
|
||||
* @param logger
|
||||
* @returns
|
||||
*/
|
||||
export function _legacyCookieMgr(config, logger) {
|
||||
var cookieMgr = _gblCookieMgr(config, logger);
|
||||
var legacyCanUseCookies = CoreUtils._canUseCookies;
|
||||
if (_cookieMgrs === null) {
|
||||
_cookieMgrs = [];
|
||||
_canUseCookies = legacyCanUseCookies;
|
||||
// Dynamically create get/set property accessors for backward compatibility for enabling / disabling cookies
|
||||
// this WILL NOT work for ES3 browsers (< IE8)
|
||||
objDefineAccessors(CoreUtils, "_canUseCookies", function () {
|
||||
return _canUseCookies;
|
||||
}, function (value) {
|
||||
_canUseCookies = value;
|
||||
arrForEach(_cookieMgrs, function (mgr) {
|
||||
mgr[_DYN_SET_ENABLED /* @min:%2esetEnabled */](value);
|
||||
});
|
||||
});
|
||||
}
|
||||
if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) {
|
||||
_cookieMgrs[_DYN_PUSH /* @min:%2epush */](cookieMgr);
|
||||
}
|
||||
if (isBoolean(legacyCanUseCookies)) {
|
||||
cookieMgr[_DYN_SET_ENABLED /* @min:%2esetEnabled */](legacyCanUseCookies);
|
||||
}
|
||||
if (isBoolean(_canUseCookies)) {
|
||||
cookieMgr[_DYN_SET_ENABLED /* @min:%2esetEnabled */](_canUseCookies);
|
||||
}
|
||||
return cookieMgr;
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the core.getCookieMgr().disable()
|
||||
* Force the SDK not to store and read any data from cookies.
|
||||
*/
|
||||
export function disableCookies() {
|
||||
_legacyCookieMgr()[_DYN_SET_ENABLED /* @min:%2esetEnabled */](false);
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the core.getCookieMgr().isEnabled()
|
||||
* Helper method to tell if document.cookie object is available and whether it can be used.
|
||||
*/
|
||||
export function canUseCookies(logger) {
|
||||
return _legacyCookieMgr(null, logger).isEnabled();
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the core.getCookieMgr().get()
|
||||
* helper method to access userId and sessionId cookie
|
||||
*/
|
||||
export function getCookie(logger, name) {
|
||||
return _legacyCookieMgr(null, logger).get(name);
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the core.getCookieMgr().set()
|
||||
* helper method to set userId and sessionId cookie
|
||||
*/
|
||||
export function setCookie(logger, name, value, domain) {
|
||||
_legacyCookieMgr(null, logger).set(name, value, null, domain);
|
||||
}
|
||||
/**
|
||||
* @deprecated - Use the core.getCookieMgr().del()
|
||||
* Deletes a cookie by setting it's expiration time in the past.
|
||||
* @param name - The name of the cookie to delete.
|
||||
*/
|
||||
export function deleteCookie(logger, name) {
|
||||
return _legacyCookieMgr(null, logger).del(name);
|
||||
}
|
94
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DataCacheHelper.js
generated
vendored
Normal file
94
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DataCacheHelper.js
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
import { ObjDefineProperty } from "@microsoft/applicationinsights-shims";
|
||||
import { _DYN_NODE_TYPE } from "../__DynamicConstants";
|
||||
import { normalizeJsName } from "./HelperFuncs";
|
||||
import { STR_EMPTY } from "./InternalConstants";
|
||||
import { newId } from "./RandomHelper";
|
||||
var _objDefineProperty = ObjDefineProperty;
|
||||
var version = '2.8.15';
|
||||
var instanceName = "." + newId(6);
|
||||
var _dataUid = 0;
|
||||
function _createAccessor(target, prop, value) {
|
||||
if (_objDefineProperty) {
|
||||
try {
|
||||
_objDefineProperty(target, prop, {
|
||||
value: value,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return true;
|
||||
}
|
||||
catch (e) {
|
||||
// IE8 Defines a defineProperty on Object but it's only supported for DOM elements so it will throw
|
||||
// We will just ignore this here.
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Accepts only:
|
||||
// - Node
|
||||
// - Node.ELEMENT_NODE
|
||||
// - Node.DOCUMENT_NODE
|
||||
// - Object
|
||||
// - Any
|
||||
function _canAcceptData(target) {
|
||||
return target[_DYN_NODE_TYPE /* @min:%2enodeType */] === 1 || target[_DYN_NODE_TYPE /* @min:%2enodeType */] === 9 || !(+target[_DYN_NODE_TYPE /* @min:%2enodeType */]);
|
||||
}
|
||||
function _getCache(data, target) {
|
||||
var theCache = target[data.id];
|
||||
if (!theCache) {
|
||||
theCache = {};
|
||||
try {
|
||||
if (_canAcceptData(target)) {
|
||||
if (!_createAccessor(target, data.id, theCache)) {
|
||||
// Environment doesn't support accessor, so just use direct assignment
|
||||
target[data.id] = theCache;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// Not all environments allow extending all objects, so just ignore the cache in those cases
|
||||
}
|
||||
}
|
||||
return theCache;
|
||||
}
|
||||
export function createUniqueNamespace(name, includeVersion) {
|
||||
if (includeVersion === void 0) { includeVersion = false; }
|
||||
return normalizeJsName(name + (_dataUid++) + (includeVersion ? "." + version : STR_EMPTY) + instanceName);
|
||||
}
|
||||
export function createElmNodeData(name) {
|
||||
var data = {
|
||||
id: createUniqueNamespace("_aiData-" + (name || STR_EMPTY) + "." + version),
|
||||
accept: function (target) {
|
||||
return _canAcceptData(target);
|
||||
},
|
||||
get: function (target, name, defValue, addDefault) {
|
||||
var theCache = target[data.id];
|
||||
if (!theCache) {
|
||||
if (addDefault) {
|
||||
// Side effect is adds the cache
|
||||
theCache = _getCache(data, target);
|
||||
theCache[normalizeJsName(name)] = defValue;
|
||||
}
|
||||
return defValue;
|
||||
}
|
||||
return theCache[normalizeJsName(name)];
|
||||
},
|
||||
kill: function (target, name) {
|
||||
if (target && target[name]) {
|
||||
try {
|
||||
delete target[name];
|
||||
}
|
||||
catch (e) {
|
||||
// Just cleaning up, so if this fails -- ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return data;
|
||||
}
|
47
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DbgExtensionUtils.js
generated
vendored
Normal file
47
vscode-server-linux-x64-web/node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DbgExtensionUtils.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Application Insights JavaScript SDK - Core, 2.8.15
|
||||
* Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
import { _DYN_APPLY, _DYN_LENGTH } from "../__DynamicConstants";
|
||||
import { getGlobalInst } from "./EnvUtils";
|
||||
var listenerFuncs = ["eventsSent", "eventsDiscarded", "eventsSendRequest", "perfEvent"];
|
||||
var _aiNamespace = null;
|
||||
var _debugListener;
|
||||
function _listenerProxyFunc(name, config) {
|
||||
return function () {
|
||||
var args = arguments;
|
||||
var dbgExt = getDebugExt(config);
|
||||
if (dbgExt) {
|
||||
var listener = dbgExt.listener;
|
||||
if (listener && listener[name]) {
|
||||
listener[name][_DYN_APPLY /* @min:%2eapply */](listener, args);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
function _getExtensionNamespace() {
|
||||
// Cache the lookup of the global namespace object
|
||||
var target = getGlobalInst("Microsoft");
|
||||
if (target) {
|
||||
_aiNamespace = target["ApplicationInsights"];
|
||||
}
|
||||
return _aiNamespace;
|
||||
}
|
||||
export function getDebugExt(config) {
|
||||
var ns = _aiNamespace;
|
||||
if (!ns && config.disableDbgExt !== true) {
|
||||
ns = _aiNamespace || _getExtensionNamespace();
|
||||
}
|
||||
return ns ? ns["ChromeDbgExt"] : null;
|
||||
}
|
||||
export function getDebugListener(config) {
|
||||
if (!_debugListener) {
|
||||
_debugListener = {};
|
||||
for (var lp = 0; lp < listenerFuncs[_DYN_LENGTH /* @min:%2elength */]; lp++) {
|
||||
_debugListener[listenerFuncs[lp]] = _listenerProxyFunc(listenerFuncs[lp], config);
|
||||
}
|
||||
}
|
||||
return _debugListener;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user