Bump tough-cookie and @azure/ms-rest-js (#1763)

* Bump tough-cookie and @azure/ms-rest-js

Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) and [@azure/ms-rest-js](https://github.com/Azure/ms-rest-js). These dependencies needed to be updated together.

Updates `tough-cookie` from 4.0.0 to 4.1.3
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3)

Updates `@azure/ms-rest-js` from 2.6.2 to 2.7.0
- [Changelog](https://github.com/Azure/ms-rest-js/blob/master/Changelog.md)
- [Commits](https://github.com/Azure/ms-rest-js/commits)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
- dependency-name: "@azure/ms-rest-js"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update checked-in dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2023-07-10 01:41:51 -07:00 committed by GitHub
parent 85c77f1dfc
commit 8f80d7761c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 4194 additions and 4573 deletions

View file

@ -262,7 +262,7 @@
* @const
* @type {string}
*/
msRestVersion: "2.6.2",
msRestVersion: "2.7.0",
/**
* Specifies HTTP.
*
@ -1906,10 +1906,15 @@
// according to the spec. There are no HTML/XSS security concerns on the usage of
// parseFromString() here.
var ttPolicy;
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: function (s) { return s; },
});
try {
if (typeof self.trustedTypes !== "undefined") {
ttPolicy = self.trustedTypes.createPolicy("@azure/ms-rest-js#xml.browser", {
createHTML: function (s) { return s; },
});
}
}
catch (e) {
console.warn('Could not create trusted types policy "@azure/ms-rest-js#xml.browser"');
}
function parseXML(str) {
var _a;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -10,7 +10,6 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
var uuid = require('uuid');
var tslib = require('tslib');
var tough = require('tough-cookie');
var http = require('http');
var https = require('https');
var node_fetch = _interopDefault(require('node-fetch'));
@ -194,7 +193,7 @@ var Constants = {
* @const
* @type {string}
*/
msRestVersion: "2.6.2",
msRestVersion: "2.7.0",
/**
* Specifies HTTP.
*
@ -3331,9 +3330,7 @@ function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) {
var NodeFetchHttpClient = /** @class */ (function (_super) {
tslib.__extends(NodeFetchHttpClient, _super);
function NodeFetchHttpClient() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.cookieJar = new tough.CookieJar(undefined, { looseMode: true });
return _this;
return _super !== null && _super.apply(this, arguments) || this;
}
NodeFetchHttpClient.prototype.fetch = function (input, init) {
return tslib.__awaiter(this, void 0, void 0, function () {
@ -3344,83 +3341,43 @@ var NodeFetchHttpClient = /** @class */ (function (_super) {
};
NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) {
return tslib.__awaiter(this, void 0, void 0, function () {
var requestInit, cookieString, _a, httpAgent, httpsAgent, tunnel, options, agent;
var _this = this;
var requestInit, _a, httpAgent, httpsAgent, tunnel, options, agent;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
requestInit = {};
if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) {
if (err) {
reject(err);
}
else {
resolve(cookie);
}
});
})];
case 1:
cookieString = _b.sent();
httpRequest.headers.set("Cookie", cookieString);
_b.label = 2;
case 2:
if (httpRequest.agentSettings) {
_a = httpRequest.agentSettings, httpAgent = _a.http, httpsAgent = _a.https;
if (httpsAgent && httpRequest.url.startsWith("https")) {
requestInit.agent = httpsAgent;
}
else if (httpAgent) {
requestInit.agent = httpAgent;
}
}
else if (httpRequest.proxySettings) {
tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);
requestInit.agent = tunnel.agent;
}
if (httpRequest.keepAlive === true) {
if (requestInit.agent) {
requestInit.agent.keepAlive = true;
}
else {
options = { keepAlive: true };
agent = httpRequest.url.startsWith("https")
? new https.Agent(options)
: new http.Agent(options);
requestInit.agent = agent;
}
}
return [2 /*return*/, requestInit];
requestInit = {};
if (httpRequest.agentSettings) {
_a = httpRequest.agentSettings, httpAgent = _a.http, httpsAgent = _a.https;
if (httpsAgent && httpRequest.url.startsWith("https")) {
requestInit.agent = httpsAgent;
}
else if (httpAgent) {
requestInit.agent = httpAgent;
}
}
else if (httpRequest.proxySettings) {
tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);
requestInit.agent = tunnel.agent;
}
if (httpRequest.keepAlive === true) {
if (requestInit.agent) {
requestInit.agent.keepAlive = true;
}
else {
options = { keepAlive: true };
agent = httpRequest.url.startsWith("https")
? new https.Agent(options)
: new http.Agent(options);
requestInit.agent = agent;
}
}
return [2 /*return*/, requestInit];
});
});
};
NodeFetchHttpClient.prototype.processRequest = function (operationResponse) {
NodeFetchHttpClient.prototype.processRequest = function (_operationResponse) {
return tslib.__awaiter(this, void 0, void 0, function () {
var setCookieHeader_1;
var _this = this;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.cookieJar) return [3 /*break*/, 2];
setCookieHeader_1 = operationResponse.headers.get("Set-Cookie");
if (!(setCookieHeader_1 != undefined)) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) {
if (err) {
reject(err);
}
else {
resolve();
}
});
})];
case 1:
_a.sent();
_a.label = 2;
case 2: return [2 /*return*/];
}
/* no_op */
return [2 /*return*/];
});
});
};

File diff suppressed because one or more lines are too long