claude-code-wakatime 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +975 -978
- package/dist/install-hooks.js +71 -0
- package/hooks/hooks.json +1 -12
- package/package.json +6 -5
- package/src/index.ts +16 -17
- package/src/install-hooks.ts +1 -10
- package/src/logger.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1222,9 +1222,9 @@ var require_zipEntry = __commonJS({
|
|
|
1222
1222
|
var Headers = require_headers();
|
|
1223
1223
|
var Constants = Utils2.Constants;
|
|
1224
1224
|
var Methods = require_methods();
|
|
1225
|
-
module2.exports = function(
|
|
1225
|
+
module2.exports = function(options2, input) {
|
|
1226
1226
|
var _centralHeader = new Headers.EntryHeader(), _entryName = Buffer.alloc(0), _comment = Buffer.alloc(0), _isDirectory = false, uncompressedData = null, _extra = Buffer.alloc(0), _extralocal = Buffer.alloc(0), _efs = true;
|
|
1227
|
-
const opts =
|
|
1227
|
+
const opts = options2;
|
|
1228
1228
|
const decoder = typeof opts.decoder === "object" ? opts.decoder : Utils2.decoder;
|
|
1229
1229
|
_efs = decoder.hasOwnProperty("efs") ? decoder.efs : false;
|
|
1230
1230
|
function getCompressedDataFromZip() {
|
|
@@ -1552,11 +1552,11 @@ var require_zipFile = __commonJS({
|
|
|
1552
1552
|
var ZipEntry = require_zipEntry();
|
|
1553
1553
|
var Headers = require_headers();
|
|
1554
1554
|
var Utils2 = require_util();
|
|
1555
|
-
module2.exports = function(inBuffer,
|
|
1555
|
+
module2.exports = function(inBuffer, options2) {
|
|
1556
1556
|
var entryList = [], entryTable = {}, _comment = Buffer.alloc(0), mainHeader = new Headers.MainHeader(), loadedEntries = false;
|
|
1557
1557
|
var password = null;
|
|
1558
1558
|
const temporary = /* @__PURE__ */ new Set();
|
|
1559
|
-
const opts =
|
|
1559
|
+
const opts = options2;
|
|
1560
1560
|
const { noSort, decoder } = opts;
|
|
1561
1561
|
if (inBuffer) {
|
|
1562
1562
|
readMainHeader(opts.readEntries);
|
|
@@ -1912,7 +1912,7 @@ var require_adm_zip = __commonJS({
|
|
|
1912
1912
|
// file system
|
|
1913
1913
|
fs: null
|
|
1914
1914
|
};
|
|
1915
|
-
module2.exports = function(input,
|
|
1915
|
+
module2.exports = function(input, options2) {
|
|
1916
1916
|
let inBuffer = null;
|
|
1917
1917
|
const opts = Object.assign(/* @__PURE__ */ Object.create(null), defaultOptions);
|
|
1918
1918
|
if (input && "object" === typeof input) {
|
|
@@ -1927,7 +1927,7 @@ var require_adm_zip = __commonJS({
|
|
|
1927
1927
|
input = void 0;
|
|
1928
1928
|
}
|
|
1929
1929
|
}
|
|
1930
|
-
Object.assign(opts,
|
|
1930
|
+
Object.assign(opts, options2);
|
|
1931
1931
|
const filetools = new Utils2(opts);
|
|
1932
1932
|
if (typeof opts.decoder !== "object" || typeof opts.decoder.encode !== "function" || typeof opts.decoder.decode !== "function") {
|
|
1933
1933
|
opts.decoder = Utils2.decoder;
|
|
@@ -2171,11 +2171,11 @@ var require_adm_zip = __commonJS({
|
|
|
2171
2171
|
* @param {string} [options.zipName] - Optional name for the file
|
|
2172
2172
|
* @param {doneCallback} callback - The callback that handles the response.
|
|
2173
2173
|
*/
|
|
2174
|
-
addLocalFileAsync: function(
|
|
2175
|
-
|
|
2176
|
-
const localPath2 = pth.resolve(
|
|
2177
|
-
const { comment } =
|
|
2178
|
-
let { zipPath, zipName } =
|
|
2174
|
+
addLocalFileAsync: function(options3, callback) {
|
|
2175
|
+
options3 = typeof options3 === "object" ? options3 : { localPath: options3 };
|
|
2176
|
+
const localPath2 = pth.resolve(options3.localPath);
|
|
2177
|
+
const { comment } = options3;
|
|
2178
|
+
let { zipPath, zipName } = options3;
|
|
2179
2179
|
const self2 = this;
|
|
2180
2180
|
filetools.fs.stat(localPath2, function(err, stats) {
|
|
2181
2181
|
if (err) return callback(err, false);
|
|
@@ -2289,11 +2289,11 @@ var require_adm_zip = __commonJS({
|
|
|
2289
2289
|
* @param {doneCallback} callback - The callback that handles the response.
|
|
2290
2290
|
*
|
|
2291
2291
|
*/
|
|
2292
|
-
addLocalFolderAsync2: function(
|
|
2292
|
+
addLocalFolderAsync2: function(options3, callback) {
|
|
2293
2293
|
const self2 = this;
|
|
2294
|
-
|
|
2295
|
-
localPath = pth.resolve(fixPath(
|
|
2296
|
-
let { zipPath, filter, namefix } =
|
|
2294
|
+
options3 = typeof options3 === "object" ? options3 : { localPath: options3 };
|
|
2295
|
+
localPath = pth.resolve(fixPath(options3.localPath));
|
|
2296
|
+
let { zipPath, filter, namefix } = options3;
|
|
2297
2297
|
if (filter instanceof RegExp) {
|
|
2298
2298
|
filter = /* @__PURE__ */ (function(rx) {
|
|
2299
2299
|
return function(filename) {
|
|
@@ -2710,16 +2710,16 @@ var require_extend = __commonJS({
|
|
|
2710
2710
|
}
|
|
2711
2711
|
return typeof key === "undefined" || hasOwn.call(obj, key);
|
|
2712
2712
|
};
|
|
2713
|
-
var setProperty = function setProperty2(target,
|
|
2714
|
-
if (defineProperty &&
|
|
2715
|
-
defineProperty(target,
|
|
2713
|
+
var setProperty = function setProperty2(target, options2) {
|
|
2714
|
+
if (defineProperty && options2.name === "__proto__") {
|
|
2715
|
+
defineProperty(target, options2.name, {
|
|
2716
2716
|
enumerable: true,
|
|
2717
2717
|
configurable: true,
|
|
2718
|
-
value:
|
|
2718
|
+
value: options2.newValue,
|
|
2719
2719
|
writable: true
|
|
2720
2720
|
});
|
|
2721
2721
|
} else {
|
|
2722
|
-
target[
|
|
2722
|
+
target[options2.name] = options2.newValue;
|
|
2723
2723
|
}
|
|
2724
2724
|
};
|
|
2725
2725
|
var getProperty = function getProperty2(obj, name) {
|
|
@@ -2733,7 +2733,7 @@ var require_extend = __commonJS({
|
|
|
2733
2733
|
return obj[name];
|
|
2734
2734
|
};
|
|
2735
2735
|
module2.exports = function extend() {
|
|
2736
|
-
var
|
|
2736
|
+
var options2, name, src, copy, copyIsArray, clone;
|
|
2737
2737
|
var target = arguments[0];
|
|
2738
2738
|
var i = 1;
|
|
2739
2739
|
var length = arguments.length;
|
|
@@ -2747,11 +2747,11 @@ var require_extend = __commonJS({
|
|
|
2747
2747
|
target = {};
|
|
2748
2748
|
}
|
|
2749
2749
|
for (; i < length; ++i) {
|
|
2750
|
-
|
|
2751
|
-
if (
|
|
2752
|
-
for (name in
|
|
2750
|
+
options2 = arguments[i];
|
|
2751
|
+
if (options2 != null) {
|
|
2752
|
+
for (name in options2) {
|
|
2753
2753
|
src = getProperty(target, name);
|
|
2754
|
-
copy = getProperty(
|
|
2754
|
+
copy = getProperty(options2, name);
|
|
2755
2755
|
if (target !== copy) {
|
|
2756
2756
|
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
|
|
2757
2757
|
if (copyIsArray) {
|
|
@@ -3427,14 +3427,14 @@ var require_cookie = __commonJS({
|
|
|
3427
3427
|
c.value = cookieValue;
|
|
3428
3428
|
return c;
|
|
3429
3429
|
}
|
|
3430
|
-
function parse(str,
|
|
3431
|
-
if (!
|
|
3432
|
-
|
|
3430
|
+
function parse(str, options2) {
|
|
3431
|
+
if (!options2 || typeof options2 !== "object") {
|
|
3432
|
+
options2 = {};
|
|
3433
3433
|
}
|
|
3434
3434
|
str = str.trim();
|
|
3435
3435
|
var firstSemi = str.indexOf(";");
|
|
3436
3436
|
var cookiePair = firstSemi === -1 ? str : str.substr(0, firstSemi);
|
|
3437
|
-
var c = parseCookiePair(cookiePair, !!
|
|
3437
|
+
var c = parseCookiePair(cookiePair, !!options2.loose);
|
|
3438
3438
|
if (!c) {
|
|
3439
3439
|
return;
|
|
3440
3440
|
}
|
|
@@ -3592,11 +3592,11 @@ var require_cookie = __commonJS({
|
|
|
3592
3592
|
}
|
|
3593
3593
|
return urlParse(url);
|
|
3594
3594
|
}
|
|
3595
|
-
function Cookie(
|
|
3596
|
-
|
|
3597
|
-
Object.keys(
|
|
3598
|
-
if (Cookie.prototype.hasOwnProperty(prop) && Cookie.prototype[prop] !==
|
|
3599
|
-
this[prop] =
|
|
3595
|
+
function Cookie(options2) {
|
|
3596
|
+
options2 = options2 || {};
|
|
3597
|
+
Object.keys(options2).forEach(function(prop) {
|
|
3598
|
+
if (Cookie.prototype.hasOwnProperty(prop) && Cookie.prototype[prop] !== options2[prop] && prop.substr(0, 1) !== "_") {
|
|
3599
|
+
this[prop] = options2[prop];
|
|
3600
3600
|
}
|
|
3601
3601
|
}, this);
|
|
3602
3602
|
this.creation = this.creation || /* @__PURE__ */ new Date();
|
|
@@ -3798,17 +3798,17 @@ var require_cookie = __commonJS({
|
|
|
3798
3798
|
}
|
|
3799
3799
|
return canonicalDomain(this.domain);
|
|
3800
3800
|
};
|
|
3801
|
-
function CookieJar(store,
|
|
3802
|
-
if (typeof
|
|
3803
|
-
|
|
3804
|
-
} else if (
|
|
3805
|
-
|
|
3801
|
+
function CookieJar(store, options2) {
|
|
3802
|
+
if (typeof options2 === "boolean") {
|
|
3803
|
+
options2 = { rejectPublicSuffixes: options2 };
|
|
3804
|
+
} else if (options2 == null) {
|
|
3805
|
+
options2 = {};
|
|
3806
3806
|
}
|
|
3807
|
-
if (
|
|
3808
|
-
this.rejectPublicSuffixes =
|
|
3807
|
+
if (options2.rejectPublicSuffixes != null) {
|
|
3808
|
+
this.rejectPublicSuffixes = options2.rejectPublicSuffixes;
|
|
3809
3809
|
}
|
|
3810
|
-
if (
|
|
3811
|
-
this.enableLooseMode =
|
|
3810
|
+
if (options2.looseMode != null) {
|
|
3811
|
+
this.enableLooseMode = options2.looseMode;
|
|
3812
3812
|
}
|
|
3813
3813
|
if (!store) {
|
|
3814
3814
|
store = new MemoryCookieStore();
|
|
@@ -3820,37 +3820,37 @@ var require_cookie = __commonJS({
|
|
|
3820
3820
|
CookieJar.prototype.enableLooseMode = false;
|
|
3821
3821
|
var CAN_BE_SYNC = [];
|
|
3822
3822
|
CAN_BE_SYNC.push("setCookie");
|
|
3823
|
-
CookieJar.prototype.setCookie = function(cookie, url,
|
|
3823
|
+
CookieJar.prototype.setCookie = function(cookie, url, options2, cb) {
|
|
3824
3824
|
var err;
|
|
3825
3825
|
var context = getCookieContext(url);
|
|
3826
|
-
if (
|
|
3827
|
-
cb =
|
|
3828
|
-
|
|
3826
|
+
if (options2 instanceof Function) {
|
|
3827
|
+
cb = options2;
|
|
3828
|
+
options2 = {};
|
|
3829
3829
|
}
|
|
3830
3830
|
var host = canonicalDomain(context.hostname);
|
|
3831
3831
|
var loose = this.enableLooseMode;
|
|
3832
|
-
if (
|
|
3833
|
-
loose =
|
|
3832
|
+
if (options2.loose != null) {
|
|
3833
|
+
loose = options2.loose;
|
|
3834
3834
|
}
|
|
3835
3835
|
if (!(cookie instanceof Cookie)) {
|
|
3836
3836
|
cookie = Cookie.parse(cookie, { loose });
|
|
3837
3837
|
}
|
|
3838
3838
|
if (!cookie) {
|
|
3839
3839
|
err = new Error("Cookie failed to parse");
|
|
3840
|
-
return cb(
|
|
3840
|
+
return cb(options2.ignoreError ? null : err);
|
|
3841
3841
|
}
|
|
3842
|
-
var now =
|
|
3842
|
+
var now = options2.now || /* @__PURE__ */ new Date();
|
|
3843
3843
|
if (this.rejectPublicSuffixes && cookie.domain) {
|
|
3844
3844
|
var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
|
|
3845
3845
|
if (suffix == null) {
|
|
3846
3846
|
err = new Error("Cookie has domain set to a public suffix");
|
|
3847
|
-
return cb(
|
|
3847
|
+
return cb(options2.ignoreError ? null : err);
|
|
3848
3848
|
}
|
|
3849
3849
|
}
|
|
3850
3850
|
if (cookie.domain) {
|
|
3851
3851
|
if (!domainMatch(host, cookie.cdomain(), false)) {
|
|
3852
3852
|
err = new Error("Cookie not in this host's domain. Cookie:" + cookie.cdomain() + " Request:" + host);
|
|
3853
|
-
return cb(
|
|
3853
|
+
return cb(options2.ignoreError ? null : err);
|
|
3854
3854
|
}
|
|
3855
3855
|
if (cookie.hostOnly == null) {
|
|
3856
3856
|
cookie.hostOnly = false;
|
|
@@ -3863,9 +3863,9 @@ var require_cookie = __commonJS({
|
|
|
3863
3863
|
cookie.path = defaultPath(context.pathname);
|
|
3864
3864
|
cookie.pathIsDefault = true;
|
|
3865
3865
|
}
|
|
3866
|
-
if (
|
|
3866
|
+
if (options2.http === false && cookie.httpOnly) {
|
|
3867
3867
|
err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
|
|
3868
|
-
return cb(
|
|
3868
|
+
return cb(options2.ignoreError ? null : err);
|
|
3869
3869
|
}
|
|
3870
3870
|
var store = this.store;
|
|
3871
3871
|
if (!store.updateCookie) {
|
|
@@ -3885,9 +3885,9 @@ var require_cookie = __commonJS({
|
|
|
3885
3885
|
}
|
|
3886
3886
|
};
|
|
3887
3887
|
if (oldCookie) {
|
|
3888
|
-
if (
|
|
3888
|
+
if (options2.http === false && oldCookie.httpOnly) {
|
|
3889
3889
|
err2 = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
|
|
3890
|
-
return cb(
|
|
3890
|
+
return cb(options2.ignoreError ? null : err2);
|
|
3891
3891
|
}
|
|
3892
3892
|
cookie.creation = oldCookie.creation;
|
|
3893
3893
|
cookie.creationIndex = oldCookie.creationIndex;
|
|
@@ -3901,25 +3901,25 @@ var require_cookie = __commonJS({
|
|
|
3901
3901
|
store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
|
|
3902
3902
|
};
|
|
3903
3903
|
CAN_BE_SYNC.push("getCookies");
|
|
3904
|
-
CookieJar.prototype.getCookies = function(url,
|
|
3904
|
+
CookieJar.prototype.getCookies = function(url, options2, cb) {
|
|
3905
3905
|
var context = getCookieContext(url);
|
|
3906
|
-
if (
|
|
3907
|
-
cb =
|
|
3908
|
-
|
|
3906
|
+
if (options2 instanceof Function) {
|
|
3907
|
+
cb = options2;
|
|
3908
|
+
options2 = {};
|
|
3909
3909
|
}
|
|
3910
3910
|
var host = canonicalDomain(context.hostname);
|
|
3911
3911
|
var path5 = context.pathname || "/";
|
|
3912
|
-
var secure =
|
|
3912
|
+
var secure = options2.secure;
|
|
3913
3913
|
if (secure == null && context.protocol && (context.protocol == "https:" || context.protocol == "wss:")) {
|
|
3914
3914
|
secure = true;
|
|
3915
3915
|
}
|
|
3916
|
-
var http =
|
|
3916
|
+
var http = options2.http;
|
|
3917
3917
|
if (http == null) {
|
|
3918
3918
|
http = true;
|
|
3919
3919
|
}
|
|
3920
|
-
var now =
|
|
3921
|
-
var expireCheck =
|
|
3922
|
-
var allPaths = !!
|
|
3920
|
+
var now = options2.now || Date.now();
|
|
3921
|
+
var expireCheck = options2.expire !== false;
|
|
3922
|
+
var allPaths = !!options2.allPaths;
|
|
3923
3923
|
var store = this.store;
|
|
3924
3924
|
function matchingCookie(c) {
|
|
3925
3925
|
if (c.hostOnly) {
|
|
@@ -3952,7 +3952,7 @@ var require_cookie = __commonJS({
|
|
|
3952
3952
|
return cb(err);
|
|
3953
3953
|
}
|
|
3954
3954
|
cookies = cookies.filter(matchingCookie);
|
|
3955
|
-
if (
|
|
3955
|
+
if (options2.sort !== false) {
|
|
3956
3956
|
cookies = cookies.sort(cookieCompare);
|
|
3957
3957
|
}
|
|
3958
3958
|
var now2 = /* @__PURE__ */ new Date();
|
|
@@ -4199,9 +4199,9 @@ var require_cookies = __commonJS({
|
|
|
4199
4199
|
var self2 = this;
|
|
4200
4200
|
self2._jar = new CookieJar(store, { looseMode: true });
|
|
4201
4201
|
}
|
|
4202
|
-
RequestJar.prototype.setCookie = function(cookieOrStr, uri,
|
|
4202
|
+
RequestJar.prototype.setCookie = function(cookieOrStr, uri, options2) {
|
|
4203
4203
|
var self2 = this;
|
|
4204
|
-
return self2._jar.setCookieSync(cookieOrStr, uri,
|
|
4204
|
+
return self2._jar.setCookieSync(cookieOrStr, uri, options2 || {});
|
|
4205
4205
|
};
|
|
4206
4206
|
RequestJar.prototype.getCookieString = function(uri) {
|
|
4207
4207
|
var self2 = this;
|
|
@@ -4378,40 +4378,40 @@ var require_aws_sign2 = __commonJS({
|
|
|
4378
4378
|
"versions",
|
|
4379
4379
|
"website"
|
|
4380
4380
|
];
|
|
4381
|
-
function authorization(
|
|
4382
|
-
return "AWS " +
|
|
4381
|
+
function authorization(options2) {
|
|
4382
|
+
return "AWS " + options2.key + ":" + sign(options2);
|
|
4383
4383
|
}
|
|
4384
4384
|
module2.exports = authorization;
|
|
4385
4385
|
module2.exports.authorization = authorization;
|
|
4386
|
-
function hmacSha1(
|
|
4387
|
-
return crypto.createHmac("sha1",
|
|
4386
|
+
function hmacSha1(options2) {
|
|
4387
|
+
return crypto.createHmac("sha1", options2.secret).update(options2.message).digest("base64");
|
|
4388
4388
|
}
|
|
4389
4389
|
module2.exports.hmacSha1 = hmacSha1;
|
|
4390
|
-
function sign(
|
|
4391
|
-
|
|
4392
|
-
return hmacSha1(
|
|
4390
|
+
function sign(options2) {
|
|
4391
|
+
options2.message = stringToSign(options2);
|
|
4392
|
+
return hmacSha1(options2);
|
|
4393
4393
|
}
|
|
4394
4394
|
module2.exports.sign = sign;
|
|
4395
|
-
function signQuery(
|
|
4396
|
-
|
|
4397
|
-
return hmacSha1(
|
|
4395
|
+
function signQuery(options2) {
|
|
4396
|
+
options2.message = queryStringToSign(options2);
|
|
4397
|
+
return hmacSha1(options2);
|
|
4398
4398
|
}
|
|
4399
4399
|
module2.exports.signQuery = signQuery;
|
|
4400
|
-
function stringToSign(
|
|
4401
|
-
var headers =
|
|
4400
|
+
function stringToSign(options2) {
|
|
4401
|
+
var headers = options2.amazonHeaders || "";
|
|
4402
4402
|
if (headers) headers += "\n";
|
|
4403
4403
|
var r = [
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
headers +
|
|
4404
|
+
options2.verb,
|
|
4405
|
+
options2.md5,
|
|
4406
|
+
options2.contentType,
|
|
4407
|
+
options2.date ? options2.date.toUTCString() : "",
|
|
4408
|
+
headers + options2.resource
|
|
4409
4409
|
];
|
|
4410
4410
|
return r.join("\n");
|
|
4411
4411
|
}
|
|
4412
4412
|
module2.exports.stringToSign = stringToSign;
|
|
4413
|
-
function queryStringToSign(
|
|
4414
|
-
return "GET\n\n\n" +
|
|
4413
|
+
function queryStringToSign(options2) {
|
|
4414
|
+
return "GET\n\n\n" + options2.date + "\n" + options2.resource;
|
|
4415
4415
|
}
|
|
4416
4416
|
module2.exports.queryStringToSign = queryStringToSign;
|
|
4417
4417
|
function canonicalizeHeaders(headers) {
|
|
@@ -5475,12 +5475,12 @@ var require_writer = __commonJS({
|
|
|
5475
5475
|
});
|
|
5476
5476
|
return to;
|
|
5477
5477
|
}
|
|
5478
|
-
function Writer(
|
|
5479
|
-
|
|
5480
|
-
this._buf = Buffer2.alloc(
|
|
5478
|
+
function Writer(options2) {
|
|
5479
|
+
options2 = merge(DEFAULT_OPTS, options2 || {});
|
|
5480
|
+
this._buf = Buffer2.alloc(options2.size || 1024);
|
|
5481
5481
|
this._size = this._buf.length;
|
|
5482
5482
|
this._offset = 0;
|
|
5483
|
-
this._options =
|
|
5483
|
+
this._options = options2;
|
|
5484
5484
|
this._seq = [];
|
|
5485
5485
|
}
|
|
5486
5486
|
Object.defineProperty(Writer.prototype, "buffer", {
|
|
@@ -10989,11 +10989,11 @@ var require_pkcs8 = __commonJS({
|
|
|
10989
10989
|
var Key = require_key();
|
|
10990
10990
|
var PrivateKey = require_private_key();
|
|
10991
10991
|
var pem = require_pem();
|
|
10992
|
-
function read(buf,
|
|
10993
|
-
return pem.read(buf,
|
|
10992
|
+
function read(buf, options2) {
|
|
10993
|
+
return pem.read(buf, options2, "pkcs8");
|
|
10994
10994
|
}
|
|
10995
|
-
function write(key,
|
|
10996
|
-
return pem.write(key,
|
|
10995
|
+
function write(key, options2) {
|
|
10996
|
+
return pem.write(key, options2, "pkcs8");
|
|
10997
10997
|
}
|
|
10998
10998
|
function readMPInt(der, nm) {
|
|
10999
10999
|
assert.strictEqual(
|
|
@@ -11518,11 +11518,11 @@ var require_pkcs1 = __commonJS({
|
|
|
11518
11518
|
var pem = require_pem();
|
|
11519
11519
|
var pkcs8 = require_pkcs8();
|
|
11520
11520
|
var readECDSACurve = pkcs8.readECDSACurve;
|
|
11521
|
-
function read(buf,
|
|
11522
|
-
return pem.read(buf,
|
|
11521
|
+
function read(buf, options2) {
|
|
11522
|
+
return pem.read(buf, options2, "pkcs1");
|
|
11523
11523
|
}
|
|
11524
|
-
function write(key,
|
|
11525
|
-
return pem.write(key,
|
|
11524
|
+
function write(key, options2) {
|
|
11525
|
+
return pem.write(key, options2, "pkcs1");
|
|
11526
11526
|
}
|
|
11527
11527
|
function readMPInt(der, nm) {
|
|
11528
11528
|
assert.strictEqual(
|
|
@@ -11860,7 +11860,7 @@ var require_rfc4253 = __commonJS({
|
|
|
11860
11860
|
else
|
|
11861
11861
|
throw new Error("Unknown key type " + key.type);
|
|
11862
11862
|
}
|
|
11863
|
-
function read(partial, type, buf,
|
|
11863
|
+
function read(partial, type, buf, options2) {
|
|
11864
11864
|
if (typeof buf === "string")
|
|
11865
11865
|
buf = Buffer2.from(buf);
|
|
11866
11866
|
assert.buffer(buf, "buf");
|
|
@@ -11924,7 +11924,7 @@ var require_rfc4253 = __commonJS({
|
|
|
11924
11924
|
}
|
|
11925
11925
|
return new Constructor(key);
|
|
11926
11926
|
}
|
|
11927
|
-
function write(key,
|
|
11927
|
+
function write(key, options2) {
|
|
11928
11928
|
assert.object(key);
|
|
11929
11929
|
var alg = keyTypeToAlg(key);
|
|
11930
11930
|
var i;
|
|
@@ -13225,11 +13225,11 @@ var require_ssh_private = __commonJS({
|
|
|
13225
13225
|
var SSHBuffer = require_ssh_buffer();
|
|
13226
13226
|
var errors = require_errors2();
|
|
13227
13227
|
var bcrypt;
|
|
13228
|
-
function read(buf,
|
|
13229
|
-
return pem.read(buf,
|
|
13228
|
+
function read(buf, options2) {
|
|
13229
|
+
return pem.read(buf, options2);
|
|
13230
13230
|
}
|
|
13231
13231
|
var MAGIC = "openssh-key-v1";
|
|
13232
|
-
function readSSHPrivate(type, buf,
|
|
13232
|
+
function readSSHPrivate(type, buf, options2) {
|
|
13233
13233
|
buf = new SSHBuffer({ buffer: buf });
|
|
13234
13234
|
var magic = buf.readCString();
|
|
13235
13235
|
assert.strictEqual(magic, MAGIC, "bad magic string");
|
|
@@ -13261,19 +13261,19 @@ var require_ssh_private = __commonJS({
|
|
|
13261
13261
|
if (bcrypt === void 0) {
|
|
13262
13262
|
bcrypt = require_bcrypt_pbkdf();
|
|
13263
13263
|
}
|
|
13264
|
-
if (typeof
|
|
13265
|
-
|
|
13266
|
-
|
|
13264
|
+
if (typeof options2.passphrase === "string") {
|
|
13265
|
+
options2.passphrase = Buffer2.from(
|
|
13266
|
+
options2.passphrase,
|
|
13267
13267
|
"utf-8"
|
|
13268
13268
|
);
|
|
13269
13269
|
}
|
|
13270
|
-
if (!Buffer2.isBuffer(
|
|
13270
|
+
if (!Buffer2.isBuffer(options2.passphrase)) {
|
|
13271
13271
|
throw new errors.KeyEncryptedError(
|
|
13272
|
-
|
|
13272
|
+
options2.filename,
|
|
13273
13273
|
"OpenSSH"
|
|
13274
13274
|
);
|
|
13275
13275
|
}
|
|
13276
|
-
var pass = new Uint8Array(
|
|
13276
|
+
var pass = new Uint8Array(options2.passphrase);
|
|
13277
13277
|
var salti = new Uint8Array(salt);
|
|
13278
13278
|
var out = new Uint8Array(cinf.keySize + cinf.blockSize);
|
|
13279
13279
|
var res = bcrypt.pbkdf(
|
|
@@ -13328,7 +13328,7 @@ var require_ssh_private = __commonJS({
|
|
|
13328
13328
|
key.comment = comment;
|
|
13329
13329
|
return key;
|
|
13330
13330
|
}
|
|
13331
|
-
function write(key,
|
|
13331
|
+
function write(key, options2) {
|
|
13332
13332
|
var pubKey;
|
|
13333
13333
|
if (PrivateKey.isPrivateKey(key))
|
|
13334
13334
|
pubKey = key.toPublic();
|
|
@@ -13339,14 +13339,14 @@ var require_ssh_private = __commonJS({
|
|
|
13339
13339
|
var kdfopts = Buffer2.alloc(0);
|
|
13340
13340
|
var cinf = { blockSize: 8 };
|
|
13341
13341
|
var passphrase;
|
|
13342
|
-
if (
|
|
13343
|
-
passphrase =
|
|
13342
|
+
if (options2 !== void 0) {
|
|
13343
|
+
passphrase = options2.passphrase;
|
|
13344
13344
|
if (typeof passphrase === "string")
|
|
13345
13345
|
passphrase = Buffer2.from(passphrase, "utf-8");
|
|
13346
13346
|
if (passphrase !== void 0) {
|
|
13347
13347
|
assert.buffer(passphrase, "options.passphrase");
|
|
13348
|
-
assert.optionalString(
|
|
13349
|
-
cipher =
|
|
13348
|
+
assert.optionalString(options2.cipher, "options.cipher");
|
|
13349
|
+
cipher = options2.cipher;
|
|
13350
13350
|
if (cipher === void 0)
|
|
13351
13351
|
cipher = "aes128-ctr";
|
|
13352
13352
|
cinf = utils.opensshCipherInfo(cipher);
|
|
@@ -13490,7 +13490,7 @@ var require_pem = __commonJS({
|
|
|
13490
13490
|
Object.keys(OID_TO_HASH).forEach(function(k) {
|
|
13491
13491
|
HASH_TO_OID[OID_TO_HASH[k]] = k;
|
|
13492
13492
|
});
|
|
13493
|
-
function read(buf,
|
|
13493
|
+
function read(buf, options2, forceType) {
|
|
13494
13494
|
var input = buf;
|
|
13495
13495
|
if (typeof buf !== "string") {
|
|
13496
13496
|
assert.buffer(buf, "buf");
|
|
@@ -13540,15 +13540,15 @@ var require_pem = __commonJS({
|
|
|
13540
13540
|
if (headers["proc-type"]) {
|
|
13541
13541
|
var parts = headers["proc-type"].split(",");
|
|
13542
13542
|
if (parts[0] === "4" && parts[1] === "ENCRYPTED") {
|
|
13543
|
-
if (typeof
|
|
13544
|
-
|
|
13545
|
-
|
|
13543
|
+
if (typeof options2.passphrase === "string") {
|
|
13544
|
+
options2.passphrase = Buffer2.from(
|
|
13545
|
+
options2.passphrase,
|
|
13546
13546
|
"utf-8"
|
|
13547
13547
|
);
|
|
13548
13548
|
}
|
|
13549
|
-
if (!Buffer2.isBuffer(
|
|
13549
|
+
if (!Buffer2.isBuffer(options2.passphrase)) {
|
|
13550
13550
|
throw new errors.KeyEncryptedError(
|
|
13551
|
-
|
|
13551
|
+
options2.filename,
|
|
13552
13552
|
"PEM"
|
|
13553
13553
|
);
|
|
13554
13554
|
} else {
|
|
@@ -13559,7 +13559,7 @@ var require_pem = __commonJS({
|
|
|
13559
13559
|
key = utils.opensslKeyDeriv(
|
|
13560
13560
|
cipher,
|
|
13561
13561
|
iv,
|
|
13562
|
-
|
|
13562
|
+
options2.passphrase,
|
|
13563
13563
|
1
|
|
13564
13564
|
).key;
|
|
13565
13565
|
}
|
|
@@ -13603,15 +13603,15 @@ var require_pem = __commonJS({
|
|
|
13603
13603
|
iv = eder.readString(asn1.Ber.OctetString, true);
|
|
13604
13604
|
eder._offset = pbesEnd;
|
|
13605
13605
|
buf = eder.readString(asn1.Ber.OctetString, true);
|
|
13606
|
-
if (typeof
|
|
13607
|
-
|
|
13608
|
-
|
|
13606
|
+
if (typeof options2.passphrase === "string") {
|
|
13607
|
+
options2.passphrase = Buffer2.from(
|
|
13608
|
+
options2.passphrase,
|
|
13609
13609
|
"utf-8"
|
|
13610
13610
|
);
|
|
13611
13611
|
}
|
|
13612
|
-
if (!Buffer2.isBuffer(
|
|
13612
|
+
if (!Buffer2.isBuffer(options2.passphrase)) {
|
|
13613
13613
|
throw new errors.KeyEncryptedError(
|
|
13614
|
-
|
|
13614
|
+
options2.filename,
|
|
13615
13615
|
"PEM"
|
|
13616
13616
|
);
|
|
13617
13617
|
}
|
|
@@ -13622,7 +13622,7 @@ var require_pem = __commonJS({
|
|
|
13622
13622
|
salt,
|
|
13623
13623
|
iterations,
|
|
13624
13624
|
cinfo.keySize,
|
|
13625
|
-
|
|
13625
|
+
options2.passphrase
|
|
13626
13626
|
);
|
|
13627
13627
|
alg = void 0;
|
|
13628
13628
|
}
|
|
@@ -13642,9 +13642,9 @@ var require_pem = __commonJS({
|
|
|
13642
13642
|
buf = Buffer2.concat(chunks);
|
|
13643
13643
|
}
|
|
13644
13644
|
if (alg && alg.toLowerCase() === "openssh")
|
|
13645
|
-
return sshpriv.readSSHPrivate(type, buf,
|
|
13645
|
+
return sshpriv.readSSHPrivate(type, buf, options2);
|
|
13646
13646
|
if (alg && alg.toLowerCase() === "ssh2")
|
|
13647
|
-
return rfc4253.readType(type, buf,
|
|
13647
|
+
return rfc4253.readType(type, buf, options2);
|
|
13648
13648
|
var der = new asn1.BerReader(buf);
|
|
13649
13649
|
der.originalInput = input;
|
|
13650
13650
|
der.readSequence();
|
|
@@ -13658,7 +13658,7 @@ var require_pem = __commonJS({
|
|
|
13658
13658
|
return pkcs8.readPkcs8(alg, type, der);
|
|
13659
13659
|
}
|
|
13660
13660
|
}
|
|
13661
|
-
function write(key,
|
|
13661
|
+
function write(key, options2, type) {
|
|
13662
13662
|
assert.object(key);
|
|
13663
13663
|
var alg = {
|
|
13664
13664
|
"ecdsa": "EC",
|
|
@@ -13726,7 +13726,7 @@ var require_ssh = __commonJS({
|
|
|
13726
13726
|
var sshpriv = require_ssh_private();
|
|
13727
13727
|
var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/;
|
|
13728
13728
|
var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/;
|
|
13729
|
-
function read(buf,
|
|
13729
|
+
function read(buf, options2) {
|
|
13730
13730
|
if (typeof buf !== "string") {
|
|
13731
13731
|
assert.buffer(buf, "buf");
|
|
13732
13732
|
buf = buf.toString("ascii");
|
|
@@ -13771,7 +13771,7 @@ var require_ssh = __commonJS({
|
|
|
13771
13771
|
}
|
|
13772
13772
|
return key;
|
|
13773
13773
|
}
|
|
13774
|
-
function write(key,
|
|
13774
|
+
function write(key, options2) {
|
|
13775
13775
|
assert.object(key);
|
|
13776
13776
|
if (!Key.isKey(key))
|
|
13777
13777
|
throw new Error("Must be a public key");
|
|
@@ -13817,7 +13817,7 @@ var require_dnssec = __commonJS({
|
|
|
13817
13817
|
Object.keys(supportedAlgos).forEach(function(k) {
|
|
13818
13818
|
supportedAlgosById[supportedAlgos[k]] = k.toUpperCase();
|
|
13819
13819
|
});
|
|
13820
|
-
function read(buf,
|
|
13820
|
+
function read(buf, options2) {
|
|
13821
13821
|
if (typeof buf !== "string") {
|
|
13822
13822
|
assert.buffer(buf, "buf");
|
|
13823
13823
|
buf = buf.toString("ascii");
|
|
@@ -13975,13 +13975,13 @@ var require_dnssec = __commonJS({
|
|
|
13975
13975
|
else
|
|
13976
13976
|
throw new Error("Unknown or unsupported hash: " + opts.hashAlgo);
|
|
13977
13977
|
}
|
|
13978
|
-
function writeRSA(key,
|
|
13978
|
+
function writeRSA(key, options2) {
|
|
13979
13979
|
if (!key.part.dmodp || !key.part.dmodq) {
|
|
13980
13980
|
utils.addRSAMissing(key);
|
|
13981
13981
|
}
|
|
13982
13982
|
var out = "";
|
|
13983
13983
|
out += "Private-key-format: v1.3\n";
|
|
13984
|
-
out += "Algorithm: " + rsaAlgFromOptions(
|
|
13984
|
+
out += "Algorithm: " + rsaAlgFromOptions(options2) + "\n";
|
|
13985
13985
|
var n = utils.mpDenormalize(key.part["n"].data);
|
|
13986
13986
|
out += "Modulus: " + n.toString("base64") + "\n";
|
|
13987
13987
|
var e = utils.mpDenormalize(key.part["e"].data);
|
|
@@ -14004,7 +14004,7 @@ var require_dnssec = __commonJS({
|
|
|
14004
14004
|
out += "Activate: " + dnssecTimestamp(timestamp) + "\n";
|
|
14005
14005
|
return Buffer2.from(out, "ascii");
|
|
14006
14006
|
}
|
|
14007
|
-
function writeECDSA(key,
|
|
14007
|
+
function writeECDSA(key, options2) {
|
|
14008
14008
|
var out = "";
|
|
14009
14009
|
out += "Private-key-format: v1.3\n";
|
|
14010
14010
|
if (key.curve === "nistp256") {
|
|
@@ -14022,12 +14022,12 @@ var require_dnssec = __commonJS({
|
|
|
14022
14022
|
out += "Activate: " + dnssecTimestamp(timestamp) + "\n";
|
|
14023
14023
|
return Buffer2.from(out, "ascii");
|
|
14024
14024
|
}
|
|
14025
|
-
function write(key,
|
|
14025
|
+
function write(key, options2) {
|
|
14026
14026
|
if (PrivateKey.isPrivateKey(key)) {
|
|
14027
14027
|
if (key.type === "rsa") {
|
|
14028
|
-
return writeRSA(key,
|
|
14028
|
+
return writeRSA(key, options2);
|
|
14029
14029
|
} else if (key.type === "ecdsa") {
|
|
14030
|
-
return writeECDSA(key,
|
|
14030
|
+
return writeECDSA(key, options2);
|
|
14031
14031
|
} else {
|
|
14032
14032
|
throw new Error("Unsupported algorithm: " + key.type);
|
|
14033
14033
|
}
|
|
@@ -14055,7 +14055,7 @@ var require_putty = __commonJS({
|
|
|
14055
14055
|
var crypto = require("crypto");
|
|
14056
14056
|
var PrivateKey = require_private_key();
|
|
14057
14057
|
var errors = require_errors2();
|
|
14058
|
-
function read(buf,
|
|
14058
|
+
function read(buf, options2) {
|
|
14059
14059
|
var lines = buf.toString("ascii").split(/[\r\n]+/);
|
|
14060
14060
|
var found = false;
|
|
14061
14061
|
var parts;
|
|
@@ -14115,16 +14115,16 @@ var require_putty = __commonJS({
|
|
|
14115
14115
|
throw new Error("Encrypted keys arenot supported for PuTTY format version 3");
|
|
14116
14116
|
}
|
|
14117
14117
|
if (encryption === "aes256-cbc") {
|
|
14118
|
-
if (!
|
|
14118
|
+
if (!options2.passphrase) {
|
|
14119
14119
|
throw new errors.KeyEncryptedError(
|
|
14120
|
-
|
|
14120
|
+
options2.filename,
|
|
14121
14121
|
"PEM"
|
|
14122
14122
|
);
|
|
14123
14123
|
}
|
|
14124
14124
|
var iv = Buffer2.alloc(16, 0);
|
|
14125
14125
|
var decipher = crypto.createDecipheriv(
|
|
14126
14126
|
"aes-256-cbc",
|
|
14127
|
-
derivePPK2EncryptionKey(
|
|
14127
|
+
derivePPK2EncryptionKey(options2.passphrase),
|
|
14128
14128
|
iv
|
|
14129
14129
|
);
|
|
14130
14130
|
decipher.setAutoPadding(false);
|
|
@@ -14194,7 +14194,7 @@ var require_putty = __commonJS({
|
|
|
14194
14194
|
var rest = line.slice(idx);
|
|
14195
14195
|
return [header, rest];
|
|
14196
14196
|
}
|
|
14197
|
-
function write(key,
|
|
14197
|
+
function write(key, options2) {
|
|
14198
14198
|
assert.object(key);
|
|
14199
14199
|
if (!Key.isKey(key))
|
|
14200
14200
|
throw new Error("Must be a public key");
|
|
@@ -14239,32 +14239,32 @@ var require_auto = __commonJS({
|
|
|
14239
14239
|
var dnssec = require_dnssec();
|
|
14240
14240
|
var putty = require_putty();
|
|
14241
14241
|
var DNSSEC_PRIVKEY_HEADER_PREFIX = "Private-key-format: v1";
|
|
14242
|
-
function read(buf,
|
|
14242
|
+
function read(buf, options2) {
|
|
14243
14243
|
if (typeof buf === "string") {
|
|
14244
14244
|
if (buf.trim().match(/^[-]+[ ]*BEGIN/))
|
|
14245
|
-
return pem.read(buf,
|
|
14245
|
+
return pem.read(buf, options2);
|
|
14246
14246
|
if (buf.match(/^\s*ssh-[a-z]/))
|
|
14247
|
-
return ssh.read(buf,
|
|
14247
|
+
return ssh.read(buf, options2);
|
|
14248
14248
|
if (buf.match(/^\s*ecdsa-/))
|
|
14249
|
-
return ssh.read(buf,
|
|
14249
|
+
return ssh.read(buf, options2);
|
|
14250
14250
|
if (buf.match(/^putty-user-key-file-2:/i))
|
|
14251
|
-
return putty.read(buf,
|
|
14251
|
+
return putty.read(buf, options2);
|
|
14252
14252
|
if (findDNSSECHeader(buf))
|
|
14253
|
-
return dnssec.read(buf,
|
|
14253
|
+
return dnssec.read(buf, options2);
|
|
14254
14254
|
buf = Buffer2.from(buf, "binary");
|
|
14255
14255
|
} else {
|
|
14256
14256
|
assert.buffer(buf);
|
|
14257
14257
|
if (findPEMHeader(buf))
|
|
14258
|
-
return pem.read(buf,
|
|
14258
|
+
return pem.read(buf, options2);
|
|
14259
14259
|
if (findSSHHeader(buf))
|
|
14260
|
-
return ssh.read(buf,
|
|
14260
|
+
return ssh.read(buf, options2);
|
|
14261
14261
|
if (findPuTTYHeader(buf))
|
|
14262
|
-
return putty.read(buf,
|
|
14262
|
+
return putty.read(buf, options2);
|
|
14263
14263
|
if (findDNSSECHeader(buf))
|
|
14264
|
-
return dnssec.read(buf,
|
|
14264
|
+
return dnssec.read(buf, options2);
|
|
14265
14265
|
}
|
|
14266
14266
|
if (buf.readUInt32BE(0) < buf.length)
|
|
14267
|
-
return rfc4253.read(buf,
|
|
14267
|
+
return rfc4253.read(buf, options2);
|
|
14268
14268
|
throw new Error("Failed to auto-detect format of key");
|
|
14269
14269
|
}
|
|
14270
14270
|
function findPuTTYHeader(buf) {
|
|
@@ -14318,7 +14318,7 @@ var require_auto = __commonJS({
|
|
|
14318
14318
|
return true;
|
|
14319
14319
|
return false;
|
|
14320
14320
|
}
|
|
14321
|
-
function write(key,
|
|
14321
|
+
function write(key, options2) {
|
|
14322
14322
|
throw new Error('"auto" format cannot be used for writing');
|
|
14323
14323
|
}
|
|
14324
14324
|
}
|
|
@@ -14364,13 +14364,13 @@ var require_private_key = __commonJS({
|
|
|
14364
14364
|
}
|
|
14365
14365
|
util.inherits(PrivateKey, Key);
|
|
14366
14366
|
PrivateKey.formats = formats;
|
|
14367
|
-
PrivateKey.prototype.toBuffer = function(format,
|
|
14367
|
+
PrivateKey.prototype.toBuffer = function(format, options2) {
|
|
14368
14368
|
if (format === void 0)
|
|
14369
14369
|
format = "pkcs1";
|
|
14370
14370
|
assert.string(format, "format");
|
|
14371
14371
|
assert.object(formats[format], "formats[format]");
|
|
14372
|
-
assert.optionalObject(
|
|
14373
|
-
return formats[format].write(this,
|
|
14372
|
+
assert.optionalObject(options2, "options");
|
|
14373
|
+
return formats[format].write(this, options2);
|
|
14374
14374
|
};
|
|
14375
14375
|
PrivateKey.prototype.hash = function(algo, type) {
|
|
14376
14376
|
return this.toPublic().hash(algo, type);
|
|
@@ -14467,46 +14467,46 @@ var require_private_key = __commonJS({
|
|
|
14467
14467
|
};
|
|
14468
14468
|
return v;
|
|
14469
14469
|
};
|
|
14470
|
-
PrivateKey.parse = function(data, format,
|
|
14470
|
+
PrivateKey.parse = function(data, format, options2) {
|
|
14471
14471
|
if (typeof data !== "string")
|
|
14472
14472
|
assert.buffer(data, "data");
|
|
14473
14473
|
if (format === void 0)
|
|
14474
14474
|
format = "auto";
|
|
14475
14475
|
assert.string(format, "format");
|
|
14476
|
-
if (typeof
|
|
14477
|
-
|
|
14478
|
-
assert.optionalObject(
|
|
14479
|
-
if (
|
|
14480
|
-
|
|
14481
|
-
assert.optionalString(
|
|
14482
|
-
if (
|
|
14483
|
-
|
|
14476
|
+
if (typeof options2 === "string")
|
|
14477
|
+
options2 = { filename: options2 };
|
|
14478
|
+
assert.optionalObject(options2, "options");
|
|
14479
|
+
if (options2 === void 0)
|
|
14480
|
+
options2 = {};
|
|
14481
|
+
assert.optionalString(options2.filename, "options.filename");
|
|
14482
|
+
if (options2.filename === void 0)
|
|
14483
|
+
options2.filename = "(unnamed)";
|
|
14484
14484
|
assert.object(formats[format], "formats[format]");
|
|
14485
14485
|
try {
|
|
14486
|
-
var k = formats[format].read(data,
|
|
14486
|
+
var k = formats[format].read(data, options2);
|
|
14487
14487
|
assert.ok(k instanceof PrivateKey, "key is not a private key");
|
|
14488
14488
|
if (!k.comment)
|
|
14489
|
-
k.comment =
|
|
14489
|
+
k.comment = options2.filename;
|
|
14490
14490
|
return k;
|
|
14491
14491
|
} catch (e) {
|
|
14492
14492
|
if (e.name === "KeyEncryptedError")
|
|
14493
14493
|
throw e;
|
|
14494
|
-
throw new KeyParseError(
|
|
14494
|
+
throw new KeyParseError(options2.filename, format, e);
|
|
14495
14495
|
}
|
|
14496
14496
|
};
|
|
14497
14497
|
PrivateKey.isPrivateKey = function(obj, ver) {
|
|
14498
14498
|
return utils.isCompatible(obj, PrivateKey, ver);
|
|
14499
14499
|
};
|
|
14500
|
-
PrivateKey.generate = function(type,
|
|
14501
|
-
if (
|
|
14502
|
-
|
|
14503
|
-
assert.object(
|
|
14500
|
+
PrivateKey.generate = function(type, options2) {
|
|
14501
|
+
if (options2 === void 0)
|
|
14502
|
+
options2 = {};
|
|
14503
|
+
assert.object(options2, "options");
|
|
14504
14504
|
switch (type) {
|
|
14505
14505
|
case "ecdsa":
|
|
14506
|
-
if (
|
|
14507
|
-
|
|
14508
|
-
assert.string(
|
|
14509
|
-
return generateECDSA(
|
|
14506
|
+
if (options2.curve === void 0)
|
|
14507
|
+
options2.curve = "nistp256";
|
|
14508
|
+
assert.string(options2.curve, "options.curve");
|
|
14509
|
+
return generateECDSA(options2.curve);
|
|
14510
14510
|
case "ed25519":
|
|
14511
14511
|
return generateED25519();
|
|
14512
14512
|
default:
|
|
@@ -14872,7 +14872,7 @@ var require_openssh_cert = __commonJS({
|
|
|
14872
14872
|
TYPES[TYPES[k]] = k;
|
|
14873
14873
|
});
|
|
14874
14874
|
var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;
|
|
14875
|
-
function read(buf,
|
|
14875
|
+
function read(buf, options2) {
|
|
14876
14876
|
if (Buffer2.isBuffer(buf))
|
|
14877
14877
|
buf = buf.toString("ascii");
|
|
14878
14878
|
var parts = buf.trim().split(/[ \t\n]+/g);
|
|
@@ -15027,13 +15027,13 @@ var require_openssh_cert = __commonJS({
|
|
|
15027
15027
|
done();
|
|
15028
15028
|
});
|
|
15029
15029
|
}
|
|
15030
|
-
function write(cert,
|
|
15031
|
-
if (
|
|
15032
|
-
|
|
15030
|
+
function write(cert, options2) {
|
|
15031
|
+
if (options2 === void 0)
|
|
15032
|
+
options2 = {};
|
|
15033
15033
|
var blob = toBuffer(cert);
|
|
15034
15034
|
var out = getCertType(cert.subjectKey) + " " + blob.toString("base64");
|
|
15035
|
-
if (
|
|
15036
|
-
out = out + " " +
|
|
15035
|
+
if (options2.comment)
|
|
15036
|
+
out = out + " " + options2.comment;
|
|
15037
15037
|
return out;
|
|
15038
15038
|
}
|
|
15039
15039
|
function toBuffer(cert, noSig) {
|
|
@@ -15200,7 +15200,7 @@ var require_x509 = __commonJS({
|
|
|
15200
15200
|
"keyUsage": "2.5.29.15",
|
|
15201
15201
|
"extKeyUsage": "2.5.29.37"
|
|
15202
15202
|
};
|
|
15203
|
-
function read(buf,
|
|
15203
|
+
function read(buf, options2) {
|
|
15204
15204
|
if (typeof buf === "string") {
|
|
15205
15205
|
buf = Buffer2.from(buf, "binary");
|
|
15206
15206
|
}
|
|
@@ -15550,7 +15550,7 @@ var require_x509 = __commonJS({
|
|
|
15550
15550
|
done();
|
|
15551
15551
|
});
|
|
15552
15552
|
}
|
|
15553
|
-
function write(cert,
|
|
15553
|
+
function write(cert, options2) {
|
|
15554
15554
|
var sig = cert.signatures.x509;
|
|
15555
15555
|
assert.object(sig, "x509 signature");
|
|
15556
15556
|
var der = new asn1.BerWriter();
|
|
@@ -15774,7 +15774,7 @@ var require_x509_pem = __commonJS({
|
|
|
15774
15774
|
var Identity = require_identity();
|
|
15775
15775
|
var Signature = require_signature();
|
|
15776
15776
|
var Certificate = require_certificate();
|
|
15777
|
-
function read(buf,
|
|
15777
|
+
function read(buf, options2) {
|
|
15778
15778
|
if (typeof buf !== "string") {
|
|
15779
15779
|
assert.buffer(buf, "buf");
|
|
15780
15780
|
buf = buf.toString("ascii");
|
|
@@ -15812,10 +15812,10 @@ var require_x509_pem = __commonJS({
|
|
|
15812
15812
|
}
|
|
15813
15813
|
lines = lines.slice(0, -1).join("");
|
|
15814
15814
|
buf = Buffer2.from(lines, "base64");
|
|
15815
|
-
return x509.read(buf,
|
|
15815
|
+
return x509.read(buf, options2);
|
|
15816
15816
|
}
|
|
15817
|
-
function write(cert,
|
|
15818
|
-
var dbuf = x509.write(cert,
|
|
15817
|
+
function write(cert, options2) {
|
|
15818
|
+
var dbuf = x509.write(cert, options2);
|
|
15819
15819
|
var header = "CERTIFICATE";
|
|
15820
15820
|
var tmp = dbuf.toString("base64");
|
|
15821
15821
|
var len = tmp.length + tmp.length / 64 + 18 + 16 + header.length * 2 + 10;
|
|
@@ -15899,18 +15899,18 @@ var require_certificate = __commonJS({
|
|
|
15899
15899
|
this.purposes = opts.purposes;
|
|
15900
15900
|
}
|
|
15901
15901
|
Certificate.formats = formats;
|
|
15902
|
-
Certificate.prototype.toBuffer = function(format,
|
|
15902
|
+
Certificate.prototype.toBuffer = function(format, options2) {
|
|
15903
15903
|
if (format === void 0)
|
|
15904
15904
|
format = "x509";
|
|
15905
15905
|
assert.string(format, "format");
|
|
15906
15906
|
assert.object(formats[format], "formats[format]");
|
|
15907
|
-
assert.optionalObject(
|
|
15908
|
-
return formats[format].write(this,
|
|
15907
|
+
assert.optionalObject(options2, "options");
|
|
15908
|
+
return formats[format].write(this, options2);
|
|
15909
15909
|
};
|
|
15910
|
-
Certificate.prototype.toString = function(format,
|
|
15910
|
+
Certificate.prototype.toString = function(format, options2) {
|
|
15911
15911
|
if (format === void 0)
|
|
15912
15912
|
format = "pem";
|
|
15913
|
-
return this.toBuffer(format,
|
|
15913
|
+
return this.toBuffer(format, options2).toString();
|
|
15914
15914
|
};
|
|
15915
15915
|
Certificate.prototype.fingerprint = function(algo) {
|
|
15916
15916
|
if (algo === void 0)
|
|
@@ -16003,7 +16003,7 @@ var require_certificate = __commonJS({
|
|
|
16003
16003
|
throw new Error("Failed to sign the certificate for any available certificate formats");
|
|
16004
16004
|
}
|
|
16005
16005
|
};
|
|
16006
|
-
Certificate.createSelfSigned = function(subjectOrSubjects, key,
|
|
16006
|
+
Certificate.createSelfSigned = function(subjectOrSubjects, key, options2) {
|
|
16007
16007
|
var subjects;
|
|
16008
16008
|
if (Array.isArray(subjectOrSubjects))
|
|
16009
16009
|
subjects = subjectOrSubjects;
|
|
@@ -16014,28 +16014,28 @@ var require_certificate = __commonJS({
|
|
|
16014
16014
|
utils.assertCompatible(subject, Identity, [1, 0], "subject");
|
|
16015
16015
|
});
|
|
16016
16016
|
utils.assertCompatible(key, PrivateKey, [1, 2], "private key");
|
|
16017
|
-
assert.optionalObject(
|
|
16018
|
-
if (
|
|
16019
|
-
|
|
16020
|
-
assert.optionalObject(
|
|
16021
|
-
assert.optionalObject(
|
|
16022
|
-
var validFrom =
|
|
16023
|
-
var validUntil =
|
|
16017
|
+
assert.optionalObject(options2, "options");
|
|
16018
|
+
if (options2 === void 0)
|
|
16019
|
+
options2 = {};
|
|
16020
|
+
assert.optionalObject(options2.validFrom, "options.validFrom");
|
|
16021
|
+
assert.optionalObject(options2.validUntil, "options.validUntil");
|
|
16022
|
+
var validFrom = options2.validFrom;
|
|
16023
|
+
var validUntil = options2.validUntil;
|
|
16024
16024
|
if (validFrom === void 0)
|
|
16025
16025
|
validFrom = /* @__PURE__ */ new Date();
|
|
16026
16026
|
if (validUntil === void 0) {
|
|
16027
|
-
assert.optionalNumber(
|
|
16028
|
-
var lifetime =
|
|
16027
|
+
assert.optionalNumber(options2.lifetime, "options.lifetime");
|
|
16028
|
+
var lifetime = options2.lifetime;
|
|
16029
16029
|
if (lifetime === void 0)
|
|
16030
16030
|
lifetime = 10 * 365 * 24 * 3600;
|
|
16031
16031
|
validUntil = /* @__PURE__ */ new Date();
|
|
16032
16032
|
validUntil.setTime(validUntil.getTime() + lifetime * 1e3);
|
|
16033
16033
|
}
|
|
16034
|
-
assert.optionalBuffer(
|
|
16035
|
-
var serial =
|
|
16034
|
+
assert.optionalBuffer(options2.serial, "options.serial");
|
|
16035
|
+
var serial = options2.serial;
|
|
16036
16036
|
if (serial === void 0)
|
|
16037
16037
|
serial = Buffer2.from("0000000000000001", "hex");
|
|
16038
|
-
var purposes =
|
|
16038
|
+
var purposes = options2.purposes;
|
|
16039
16039
|
if (purposes === void 0)
|
|
16040
16040
|
purposes = [];
|
|
16041
16041
|
if (purposes.indexOf("signature") === -1)
|
|
@@ -16080,7 +16080,7 @@ var require_certificate = __commonJS({
|
|
|
16080
16080
|
cert.signWith(key);
|
|
16081
16081
|
return cert;
|
|
16082
16082
|
};
|
|
16083
|
-
Certificate.create = function(subjectOrSubjects, key, issuer, issuerKey,
|
|
16083
|
+
Certificate.create = function(subjectOrSubjects, key, issuer, issuerKey, options2) {
|
|
16084
16084
|
var subjects;
|
|
16085
16085
|
if (Array.isArray(subjectOrSubjects))
|
|
16086
16086
|
subjects = subjectOrSubjects;
|
|
@@ -16095,33 +16095,33 @@ var require_certificate = __commonJS({
|
|
|
16095
16095
|
key = key.toPublic();
|
|
16096
16096
|
utils.assertCompatible(issuer, Identity, [1, 0], "issuer");
|
|
16097
16097
|
utils.assertCompatible(issuerKey, PrivateKey, [1, 2], "issuer key");
|
|
16098
|
-
assert.optionalObject(
|
|
16099
|
-
if (
|
|
16100
|
-
|
|
16101
|
-
assert.optionalObject(
|
|
16102
|
-
assert.optionalObject(
|
|
16103
|
-
var validFrom =
|
|
16104
|
-
var validUntil =
|
|
16098
|
+
assert.optionalObject(options2, "options");
|
|
16099
|
+
if (options2 === void 0)
|
|
16100
|
+
options2 = {};
|
|
16101
|
+
assert.optionalObject(options2.validFrom, "options.validFrom");
|
|
16102
|
+
assert.optionalObject(options2.validUntil, "options.validUntil");
|
|
16103
|
+
var validFrom = options2.validFrom;
|
|
16104
|
+
var validUntil = options2.validUntil;
|
|
16105
16105
|
if (validFrom === void 0)
|
|
16106
16106
|
validFrom = /* @__PURE__ */ new Date();
|
|
16107
16107
|
if (validUntil === void 0) {
|
|
16108
|
-
assert.optionalNumber(
|
|
16109
|
-
var lifetime =
|
|
16108
|
+
assert.optionalNumber(options2.lifetime, "options.lifetime");
|
|
16109
|
+
var lifetime = options2.lifetime;
|
|
16110
16110
|
if (lifetime === void 0)
|
|
16111
16111
|
lifetime = 10 * 365 * 24 * 3600;
|
|
16112
16112
|
validUntil = /* @__PURE__ */ new Date();
|
|
16113
16113
|
validUntil.setTime(validUntil.getTime() + lifetime * 1e3);
|
|
16114
16114
|
}
|
|
16115
|
-
assert.optionalBuffer(
|
|
16116
|
-
var serial =
|
|
16115
|
+
assert.optionalBuffer(options2.serial, "options.serial");
|
|
16116
|
+
var serial = options2.serial;
|
|
16117
16117
|
if (serial === void 0)
|
|
16118
16118
|
serial = Buffer2.from("0000000000000001", "hex");
|
|
16119
|
-
var purposes =
|
|
16119
|
+
var purposes = options2.purposes;
|
|
16120
16120
|
if (purposes === void 0)
|
|
16121
16121
|
purposes = [];
|
|
16122
16122
|
if (purposes.indexOf("signature") === -1)
|
|
16123
16123
|
purposes.push("signature");
|
|
16124
|
-
if (
|
|
16124
|
+
if (options2.ca === true) {
|
|
16125
16125
|
if (purposes.indexOf("ca") === -1)
|
|
16126
16126
|
purposes.push("ca");
|
|
16127
16127
|
if (purposes.indexOf("crl") === -1)
|
|
@@ -16161,26 +16161,26 @@ var require_certificate = __commonJS({
|
|
|
16161
16161
|
cert.signWith(issuerKey);
|
|
16162
16162
|
return cert;
|
|
16163
16163
|
};
|
|
16164
|
-
Certificate.parse = function(data, format,
|
|
16164
|
+
Certificate.parse = function(data, format, options2) {
|
|
16165
16165
|
if (typeof data !== "string")
|
|
16166
16166
|
assert.buffer(data, "data");
|
|
16167
16167
|
if (format === void 0)
|
|
16168
16168
|
format = "auto";
|
|
16169
16169
|
assert.string(format, "format");
|
|
16170
|
-
if (typeof
|
|
16171
|
-
|
|
16172
|
-
assert.optionalObject(
|
|
16173
|
-
if (
|
|
16174
|
-
|
|
16175
|
-
assert.optionalString(
|
|
16176
|
-
if (
|
|
16177
|
-
|
|
16170
|
+
if (typeof options2 === "string")
|
|
16171
|
+
options2 = { filename: options2 };
|
|
16172
|
+
assert.optionalObject(options2, "options");
|
|
16173
|
+
if (options2 === void 0)
|
|
16174
|
+
options2 = {};
|
|
16175
|
+
assert.optionalString(options2.filename, "options.filename");
|
|
16176
|
+
if (options2.filename === void 0)
|
|
16177
|
+
options2.filename = "(unnamed)";
|
|
16178
16178
|
assert.object(formats[format], "formats[format]");
|
|
16179
16179
|
try {
|
|
16180
|
-
var k = formats[format].read(data,
|
|
16180
|
+
var k = formats[format].read(data, options2);
|
|
16181
16181
|
return k;
|
|
16182
16182
|
} catch (e) {
|
|
16183
|
-
throw new CertificateParseError(
|
|
16183
|
+
throw new CertificateParseError(options2.filename, format, e);
|
|
16184
16184
|
}
|
|
16185
16185
|
};
|
|
16186
16186
|
Certificate.isCertificate = function(obj, ver) {
|
|
@@ -16274,24 +16274,24 @@ var require_fingerprint = __commonJS({
|
|
|
16274
16274
|
};
|
|
16275
16275
|
var base64RE = /^[A-Za-z0-9+\/=]+$/;
|
|
16276
16276
|
var hexRE = /^[a-fA-F0-9]+$/;
|
|
16277
|
-
Fingerprint.parse = function(fp,
|
|
16277
|
+
Fingerprint.parse = function(fp, options2) {
|
|
16278
16278
|
assert.string(fp, "fingerprint");
|
|
16279
16279
|
var alg, hash, enAlgs;
|
|
16280
|
-
if (Array.isArray(
|
|
16281
|
-
enAlgs =
|
|
16282
|
-
|
|
16283
|
-
}
|
|
16284
|
-
assert.optionalObject(
|
|
16285
|
-
if (
|
|
16286
|
-
|
|
16287
|
-
if (
|
|
16288
|
-
enAlgs =
|
|
16289
|
-
if (
|
|
16290
|
-
enAlgs =
|
|
16280
|
+
if (Array.isArray(options2)) {
|
|
16281
|
+
enAlgs = options2;
|
|
16282
|
+
options2 = {};
|
|
16283
|
+
}
|
|
16284
|
+
assert.optionalObject(options2, "options");
|
|
16285
|
+
if (options2 === void 0)
|
|
16286
|
+
options2 = {};
|
|
16287
|
+
if (options2.enAlgs !== void 0)
|
|
16288
|
+
enAlgs = options2.enAlgs;
|
|
16289
|
+
if (options2.algorithms !== void 0)
|
|
16290
|
+
enAlgs = options2.algorithms;
|
|
16291
16291
|
assert.optionalArrayOfString(enAlgs, "algorithms");
|
|
16292
16292
|
var hashType = "ssh";
|
|
16293
|
-
if (
|
|
16294
|
-
hashType =
|
|
16293
|
+
if (options2.hashType !== void 0)
|
|
16294
|
+
hashType = options2.hashType;
|
|
16295
16295
|
assert.string(hashType, "options.hashType");
|
|
16296
16296
|
var parts = fp.split(":");
|
|
16297
16297
|
if (parts.length == 2) {
|
|
@@ -16346,7 +16346,7 @@ var require_fingerprint = __commonJS({
|
|
|
16346
16346
|
default:
|
|
16347
16347
|
throw new FingerprintFormatError(fp);
|
|
16348
16348
|
}
|
|
16349
|
-
if (
|
|
16349
|
+
if (options2.hashType === void 0)
|
|
16350
16350
|
hashType = "spki";
|
|
16351
16351
|
}
|
|
16352
16352
|
if (alg === void 0)
|
|
@@ -16363,7 +16363,7 @@ var require_fingerprint = __commonJS({
|
|
|
16363
16363
|
return new Fingerprint({
|
|
16364
16364
|
algorithm: alg,
|
|
16365
16365
|
hash,
|
|
16366
|
-
type:
|
|
16366
|
+
type: options2.type || "key",
|
|
16367
16367
|
hashType
|
|
16368
16368
|
});
|
|
16369
16369
|
};
|
|
@@ -16457,21 +16457,21 @@ var require_key = __commonJS({
|
|
|
16457
16457
|
this.size = sz;
|
|
16458
16458
|
}
|
|
16459
16459
|
Key.formats = formats;
|
|
16460
|
-
Key.prototype.toBuffer = function(format,
|
|
16460
|
+
Key.prototype.toBuffer = function(format, options2) {
|
|
16461
16461
|
if (format === void 0)
|
|
16462
16462
|
format = "ssh";
|
|
16463
16463
|
assert.string(format, "format");
|
|
16464
16464
|
assert.object(formats[format], "formats[format]");
|
|
16465
|
-
assert.optionalObject(
|
|
16465
|
+
assert.optionalObject(options2, "options");
|
|
16466
16466
|
if (format === "rfc4253") {
|
|
16467
16467
|
if (this._rfc4253Cache === void 0)
|
|
16468
16468
|
this._rfc4253Cache = formats["rfc4253"].write(this);
|
|
16469
16469
|
return this._rfc4253Cache;
|
|
16470
16470
|
}
|
|
16471
|
-
return formats[format].write(this,
|
|
16471
|
+
return formats[format].write(this, options2);
|
|
16472
16472
|
};
|
|
16473
|
-
Key.prototype.toString = function(format,
|
|
16474
|
-
return this.toBuffer(format,
|
|
16473
|
+
Key.prototype.toString = function(format, options2) {
|
|
16474
|
+
return this.toBuffer(format, options2).toString();
|
|
16475
16475
|
};
|
|
16476
16476
|
Key.prototype.hash = function(algo, type) {
|
|
16477
16477
|
assert.string(algo, "algorithm");
|
|
@@ -16579,32 +16579,32 @@ var require_key = __commonJS({
|
|
|
16579
16579
|
return new DiffieHellman(this);
|
|
16580
16580
|
};
|
|
16581
16581
|
Key.prototype.createDH = Key.prototype.createDiffieHellman;
|
|
16582
|
-
Key.parse = function(data, format,
|
|
16582
|
+
Key.parse = function(data, format, options2) {
|
|
16583
16583
|
if (typeof data !== "string")
|
|
16584
16584
|
assert.buffer(data, "data");
|
|
16585
16585
|
if (format === void 0)
|
|
16586
16586
|
format = "auto";
|
|
16587
16587
|
assert.string(format, "format");
|
|
16588
|
-
if (typeof
|
|
16589
|
-
|
|
16590
|
-
assert.optionalObject(
|
|
16591
|
-
if (
|
|
16592
|
-
|
|
16593
|
-
assert.optionalString(
|
|
16594
|
-
if (
|
|
16595
|
-
|
|
16588
|
+
if (typeof options2 === "string")
|
|
16589
|
+
options2 = { filename: options2 };
|
|
16590
|
+
assert.optionalObject(options2, "options");
|
|
16591
|
+
if (options2 === void 0)
|
|
16592
|
+
options2 = {};
|
|
16593
|
+
assert.optionalString(options2.filename, "options.filename");
|
|
16594
|
+
if (options2.filename === void 0)
|
|
16595
|
+
options2.filename = "(unnamed)";
|
|
16596
16596
|
assert.object(formats[format], "formats[format]");
|
|
16597
16597
|
try {
|
|
16598
|
-
var k = formats[format].read(data,
|
|
16598
|
+
var k = formats[format].read(data, options2);
|
|
16599
16599
|
if (k instanceof PrivateKey)
|
|
16600
16600
|
k = k.toPublic();
|
|
16601
16601
|
if (!k.comment)
|
|
16602
|
-
k.comment =
|
|
16602
|
+
k.comment = options2.filename;
|
|
16603
16603
|
return k;
|
|
16604
16604
|
} catch (e) {
|
|
16605
16605
|
if (e.name === "KeyEncryptedError")
|
|
16606
16606
|
throw e;
|
|
16607
|
-
throw new KeyParseError(
|
|
16607
|
+
throw new KeyParseError(options2.filename, format, e);
|
|
16608
16608
|
}
|
|
16609
16609
|
};
|
|
16610
16610
|
Key.isKey = function(obj, ver) {
|
|
@@ -16844,23 +16844,23 @@ var require_parser = __commonJS({
|
|
|
16844
16844
|
* mode.
|
|
16845
16845
|
* @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
|
|
16846
16846
|
*/
|
|
16847
|
-
parseRequest: function parseRequest(request2,
|
|
16847
|
+
parseRequest: function parseRequest(request2, options2) {
|
|
16848
16848
|
assert.object(request2, "request");
|
|
16849
16849
|
assert.object(request2.headers, "request.headers");
|
|
16850
|
-
if (
|
|
16851
|
-
|
|
16850
|
+
if (options2 === void 0) {
|
|
16851
|
+
options2 = {};
|
|
16852
16852
|
}
|
|
16853
|
-
if (
|
|
16854
|
-
|
|
16853
|
+
if (options2.headers === void 0) {
|
|
16854
|
+
options2.headers = [request2.headers["x-date"] ? "x-date" : "date"];
|
|
16855
16855
|
}
|
|
16856
|
-
assert.object(
|
|
16857
|
-
assert.arrayOfString(
|
|
16858
|
-
assert.optionalFinite(
|
|
16859
|
-
var authzHeaderName =
|
|
16856
|
+
assert.object(options2, "options");
|
|
16857
|
+
assert.arrayOfString(options2.headers, "options.headers");
|
|
16858
|
+
assert.optionalFinite(options2.clockSkew, "options.clockSkew");
|
|
16859
|
+
var authzHeaderName = options2.authorizationHeaderName || "authorization";
|
|
16860
16860
|
if (!request2.headers[authzHeaderName]) {
|
|
16861
16861
|
throw new MissingHeaderError("no " + authzHeaderName + " header present in the request");
|
|
16862
16862
|
}
|
|
16863
|
-
|
|
16863
|
+
options2.clockSkew = options2.clockSkew || 300;
|
|
16864
16864
|
var i = 0;
|
|
16865
16865
|
var state = State.New;
|
|
16866
16866
|
var substate = ParamsState.Name;
|
|
@@ -16956,7 +16956,7 @@ var require_parser = __commonJS({
|
|
|
16956
16956
|
var h = parsed.params.headers[i].toLowerCase();
|
|
16957
16957
|
parsed.params.headers[i] = h;
|
|
16958
16958
|
if (h === "request-line") {
|
|
16959
|
-
if (!
|
|
16959
|
+
if (!options2.strict) {
|
|
16960
16960
|
parsed.signingString += request2.method + " " + request2.url + " HTTP/" + request2.httpVersion;
|
|
16961
16961
|
} else {
|
|
16962
16962
|
throw new StrictParsingError("request-line is not a valid header with strict parsing enabled.");
|
|
@@ -16981,16 +16981,16 @@ var require_parser = __commonJS({
|
|
|
16981
16981
|
}
|
|
16982
16982
|
var now = /* @__PURE__ */ new Date();
|
|
16983
16983
|
var skew = Math.abs(now.getTime() - date.getTime());
|
|
16984
|
-
if (skew >
|
|
16985
|
-
throw new ExpiredRequestError("clock skew of " + skew / 1e3 + "s was greater than " +
|
|
16984
|
+
if (skew > options2.clockSkew * 1e3) {
|
|
16985
|
+
throw new ExpiredRequestError("clock skew of " + skew / 1e3 + "s was greater than " + options2.clockSkew + "s");
|
|
16986
16986
|
}
|
|
16987
16987
|
}
|
|
16988
|
-
|
|
16988
|
+
options2.headers.forEach(function(hdr) {
|
|
16989
16989
|
if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0)
|
|
16990
16990
|
throw new MissingHeaderError(hdr + " was not a signed header");
|
|
16991
16991
|
});
|
|
16992
|
-
if (
|
|
16993
|
-
if (
|
|
16992
|
+
if (options2.algorithms) {
|
|
16993
|
+
if (options2.algorithms.indexOf(parsed.params.algorithm) === -1)
|
|
16994
16994
|
throw new InvalidParamsError(parsed.params.algorithm + " is not a supported algorithm");
|
|
16995
16995
|
}
|
|
16996
16996
|
parsed.algorithm = parsed.params.algorithm.toUpperCase();
|
|
@@ -17220,21 +17220,21 @@ var require_verror = __commonJS({
|
|
|
17220
17220
|
VError.WError = WError;
|
|
17221
17221
|
VError.MultiError = MultiError;
|
|
17222
17222
|
function parseConstructorArguments(args) {
|
|
17223
|
-
var argv,
|
|
17223
|
+
var argv, options2, sprintf_args, shortmessage, k;
|
|
17224
17224
|
mod_assertplus.object(args, "args");
|
|
17225
17225
|
mod_assertplus.bool(args.strict, "args.strict");
|
|
17226
17226
|
mod_assertplus.array(args.argv, "args.argv");
|
|
17227
17227
|
argv = args.argv;
|
|
17228
17228
|
if (argv.length === 0) {
|
|
17229
|
-
|
|
17229
|
+
options2 = {};
|
|
17230
17230
|
sprintf_args = [];
|
|
17231
17231
|
} else if (mod_isError(argv[0])) {
|
|
17232
|
-
|
|
17232
|
+
options2 = { "cause": argv[0] };
|
|
17233
17233
|
sprintf_args = argv.slice(1);
|
|
17234
17234
|
} else if (typeof argv[0] === "object") {
|
|
17235
|
-
|
|
17235
|
+
options2 = {};
|
|
17236
17236
|
for (k in argv[0]) {
|
|
17237
|
-
|
|
17237
|
+
options2[k] = argv[0][k];
|
|
17238
17238
|
}
|
|
17239
17239
|
sprintf_args = argv.slice(1);
|
|
17240
17240
|
} else {
|
|
@@ -17242,11 +17242,11 @@ var require_verror = __commonJS({
|
|
|
17242
17242
|
argv[0],
|
|
17243
17243
|
"first argument to VError, SError, or WError constructor must be a string, object, or Error"
|
|
17244
17244
|
);
|
|
17245
|
-
|
|
17245
|
+
options2 = {};
|
|
17246
17246
|
sprintf_args = argv;
|
|
17247
17247
|
}
|
|
17248
|
-
mod_assertplus.object(
|
|
17249
|
-
if (!
|
|
17248
|
+
mod_assertplus.object(options2);
|
|
17249
|
+
if (!options2.strict && !args.strict) {
|
|
17250
17250
|
sprintf_args = sprintf_args.map(function(a) {
|
|
17251
17251
|
return a === null ? "null" : a === void 0 ? "undefined" : a;
|
|
17252
17252
|
});
|
|
@@ -17257,7 +17257,7 @@ var require_verror = __commonJS({
|
|
|
17257
17257
|
shortmessage = sprintf.apply(null, sprintf_args);
|
|
17258
17258
|
}
|
|
17259
17259
|
return {
|
|
17260
|
-
"options":
|
|
17260
|
+
"options": options2,
|
|
17261
17261
|
"shortmessage": shortmessage
|
|
17262
17262
|
};
|
|
17263
17263
|
}
|
|
@@ -17385,7 +17385,7 @@ var require_verror = __commonJS({
|
|
|
17385
17385
|
}
|
|
17386
17386
|
};
|
|
17387
17387
|
function SError() {
|
|
17388
|
-
var args, obj, parsed,
|
|
17388
|
+
var args, obj, parsed, options2;
|
|
17389
17389
|
args = Array.prototype.slice.call(arguments, 0);
|
|
17390
17390
|
if (!(this instanceof SError)) {
|
|
17391
17391
|
obj = Object.create(SError.prototype);
|
|
@@ -17396,8 +17396,8 @@ var require_verror = __commonJS({
|
|
|
17396
17396
|
"argv": args,
|
|
17397
17397
|
"strict": true
|
|
17398
17398
|
});
|
|
17399
|
-
|
|
17400
|
-
VError.call(this,
|
|
17399
|
+
options2 = parsed.options;
|
|
17400
|
+
VError.call(this, options2, "%s", parsed.shortmessage);
|
|
17401
17401
|
return this;
|
|
17402
17402
|
}
|
|
17403
17403
|
mod_util.inherits(SError, VError);
|
|
@@ -17415,7 +17415,7 @@ var require_verror = __commonJS({
|
|
|
17415
17415
|
return this.ase_errors.slice(0);
|
|
17416
17416
|
};
|
|
17417
17417
|
function WError() {
|
|
17418
|
-
var args, obj, parsed,
|
|
17418
|
+
var args, obj, parsed, options2;
|
|
17419
17419
|
args = Array.prototype.slice.call(arguments, 0);
|
|
17420
17420
|
if (!(this instanceof WError)) {
|
|
17421
17421
|
obj = Object.create(WError.prototype);
|
|
@@ -17426,9 +17426,9 @@ var require_verror = __commonJS({
|
|
|
17426
17426
|
"argv": args,
|
|
17427
17427
|
"strict": false
|
|
17428
17428
|
});
|
|
17429
|
-
|
|
17430
|
-
|
|
17431
|
-
VError.call(this,
|
|
17429
|
+
options2 = parsed.options;
|
|
17430
|
+
options2["skipCauseMessage"] = true;
|
|
17431
|
+
VError.call(this, options2, "%s", parsed.shortmessage);
|
|
17432
17432
|
return this;
|
|
17433
17433
|
}
|
|
17434
17434
|
mod_util.inherits(WError, VError);
|
|
@@ -17481,9 +17481,9 @@ var require_validate = __commonJS({
|
|
|
17481
17481
|
exports3.checkPropertyChange = function(value, schema, property) {
|
|
17482
17482
|
return validate(value, schema, { changing: property || "property" });
|
|
17483
17483
|
};
|
|
17484
|
-
var validate = exports3._validate = function(instance, schema,
|
|
17485
|
-
if (!
|
|
17486
|
-
var _changing =
|
|
17484
|
+
var validate = exports3._validate = function(instance, schema, options2) {
|
|
17485
|
+
if (!options2) options2 = {};
|
|
17486
|
+
var _changing = options2.changing;
|
|
17487
17487
|
function getType(schema2) {
|
|
17488
17488
|
return schema2.type || primitiveConstructors[schema2.name] == schema2 && schema2.name.toLowerCase();
|
|
17489
17489
|
}
|
|
@@ -17553,8 +17553,8 @@ var require_validate = __commonJS({
|
|
|
17553
17553
|
for (i = 0, l = value.length; i < l; i += 1) {
|
|
17554
17554
|
if (itemsIsArray)
|
|
17555
17555
|
propDef = schema2.items[i];
|
|
17556
|
-
if (
|
|
17557
|
-
value[i] =
|
|
17556
|
+
if (options2.coerce)
|
|
17557
|
+
value[i] = options2.coerce(value[i], propDef);
|
|
17558
17558
|
errors.concat(checkProp(value[i], propDef, path5, i));
|
|
17559
17559
|
}
|
|
17560
17560
|
}
|
|
@@ -17611,13 +17611,13 @@ var require_validate = __commonJS({
|
|
|
17611
17611
|
for (var i in objTypeDef) {
|
|
17612
17612
|
if (objTypeDef.hasOwnProperty(i) && i != "__proto__" && i != "constructor") {
|
|
17613
17613
|
var value = instance2.hasOwnProperty(i) ? instance2[i] : void 0;
|
|
17614
|
-
if (value === void 0 &&
|
|
17614
|
+
if (value === void 0 && options2.existingOnly) continue;
|
|
17615
17615
|
var propDef = objTypeDef[i];
|
|
17616
17616
|
if (value === void 0 && propDef["default"]) {
|
|
17617
17617
|
value = instance2[i] = propDef["default"];
|
|
17618
17618
|
}
|
|
17619
|
-
if (
|
|
17620
|
-
value = instance2[i] =
|
|
17619
|
+
if (options2.coerce && i in instance2) {
|
|
17620
|
+
value = instance2[i] = options2.coerce(value, propDef);
|
|
17621
17621
|
}
|
|
17622
17622
|
checkProp(value, propDef, path5, i);
|
|
17623
17623
|
}
|
|
@@ -17625,7 +17625,7 @@ var require_validate = __commonJS({
|
|
|
17625
17625
|
}
|
|
17626
17626
|
for (i in instance2) {
|
|
17627
17627
|
if (instance2.hasOwnProperty(i) && !(i.charAt(0) == "_" && i.charAt(1) == "_") && objTypeDef && !objTypeDef[i] && additionalProp === false) {
|
|
17628
|
-
if (
|
|
17628
|
+
if (options2.filter) {
|
|
17629
17629
|
delete instance2[i];
|
|
17630
17630
|
continue;
|
|
17631
17631
|
} else {
|
|
@@ -17638,8 +17638,8 @@ var require_validate = __commonJS({
|
|
|
17638
17638
|
}
|
|
17639
17639
|
value = instance2[i];
|
|
17640
17640
|
if (additionalProp && (!(objTypeDef && typeof objTypeDef == "object") || !(i in objTypeDef))) {
|
|
17641
|
-
if (
|
|
17642
|
-
value = instance2[i] =
|
|
17641
|
+
if (options2.coerce) {
|
|
17642
|
+
value = instance2[i] = options2.coerce(value, additionalProp);
|
|
17643
17643
|
}
|
|
17644
17644
|
checkProp(value, additionalProp, path5, i);
|
|
17645
17645
|
}
|
|
@@ -17920,32 +17920,32 @@ var require_jsprim = __commonJS({
|
|
|
17920
17920
|
mod_assert.string(str, "str");
|
|
17921
17921
|
mod_assert.optionalObject(uopts, "options");
|
|
17922
17922
|
var baseOverride = false;
|
|
17923
|
-
var
|
|
17923
|
+
var options2 = PI_DEFAULTS;
|
|
17924
17924
|
if (uopts) {
|
|
17925
17925
|
baseOverride = hasKey(uopts, "base");
|
|
17926
|
-
|
|
17927
|
-
mod_assert.number(
|
|
17928
|
-
mod_assert.ok(
|
|
17929
|
-
mod_assert.ok(
|
|
17930
|
-
mod_assert.bool(
|
|
17931
|
-
mod_assert.bool(
|
|
17926
|
+
options2 = mergeObjects(options2, uopts);
|
|
17927
|
+
mod_assert.number(options2.base, "options.base");
|
|
17928
|
+
mod_assert.ok(options2.base >= 2, "options.base >= 2");
|
|
17929
|
+
mod_assert.ok(options2.base <= 36, "options.base <= 36");
|
|
17930
|
+
mod_assert.bool(options2.allowSign, "options.allowSign");
|
|
17931
|
+
mod_assert.bool(options2.allowPrefix, "options.allowPrefix");
|
|
17932
17932
|
mod_assert.bool(
|
|
17933
|
-
|
|
17933
|
+
options2.allowTrailing,
|
|
17934
17934
|
"options.allowTrailing"
|
|
17935
17935
|
);
|
|
17936
17936
|
mod_assert.bool(
|
|
17937
|
-
|
|
17937
|
+
options2.allowImprecise,
|
|
17938
17938
|
"options.allowImprecise"
|
|
17939
17939
|
);
|
|
17940
17940
|
mod_assert.bool(
|
|
17941
|
-
|
|
17941
|
+
options2.trimWhitespace,
|
|
17942
17942
|
"options.trimWhitespace"
|
|
17943
17943
|
);
|
|
17944
17944
|
mod_assert.bool(
|
|
17945
|
-
|
|
17945
|
+
options2.leadingZeroIsOctal,
|
|
17946
17946
|
"options.leadingZeroIsOctal"
|
|
17947
17947
|
);
|
|
17948
|
-
if (
|
|
17948
|
+
if (options2.leadingZeroIsOctal) {
|
|
17949
17949
|
mod_assert.ok(
|
|
17950
17950
|
!baseOverride,
|
|
17951
17951
|
'"base" and "leadingZeroIsOctal" are mutually exclusive'
|
|
@@ -17954,18 +17954,18 @@ var require_jsprim = __commonJS({
|
|
|
17954
17954
|
}
|
|
17955
17955
|
var c;
|
|
17956
17956
|
var pbase = -1;
|
|
17957
|
-
var base =
|
|
17957
|
+
var base = options2.base;
|
|
17958
17958
|
var start;
|
|
17959
17959
|
var mult = 1;
|
|
17960
17960
|
var value = 0;
|
|
17961
17961
|
var idx = 0;
|
|
17962
17962
|
var len = str.length;
|
|
17963
|
-
if (
|
|
17963
|
+
if (options2.trimWhitespace) {
|
|
17964
17964
|
while (idx < len && isSpace(str.charCodeAt(idx))) {
|
|
17965
17965
|
++idx;
|
|
17966
17966
|
}
|
|
17967
17967
|
}
|
|
17968
|
-
if (
|
|
17968
|
+
if (options2.allowSign) {
|
|
17969
17969
|
if (str[idx] === "-") {
|
|
17970
17970
|
idx += 1;
|
|
17971
17971
|
mult = -1;
|
|
@@ -17974,14 +17974,14 @@ var require_jsprim = __commonJS({
|
|
|
17974
17974
|
}
|
|
17975
17975
|
}
|
|
17976
17976
|
if (str[idx] === "0") {
|
|
17977
|
-
if (
|
|
17977
|
+
if (options2.allowPrefix) {
|
|
17978
17978
|
pbase = prefixToBase(str.charCodeAt(idx + 1));
|
|
17979
17979
|
if (pbase !== -1 && (!baseOverride || pbase === base)) {
|
|
17980
17980
|
base = pbase;
|
|
17981
17981
|
idx += 2;
|
|
17982
17982
|
}
|
|
17983
17983
|
}
|
|
17984
|
-
if (pbase === -1 &&
|
|
17984
|
+
if (pbase === -1 && options2.leadingZeroIsOctal) {
|
|
17985
17985
|
base = 8;
|
|
17986
17986
|
}
|
|
17987
17987
|
}
|
|
@@ -17997,19 +17997,19 @@ var require_jsprim = __commonJS({
|
|
|
17997
17997
|
if (start === idx) {
|
|
17998
17998
|
return new Error("invalid number: " + JSON.stringify(str));
|
|
17999
17999
|
}
|
|
18000
|
-
if (
|
|
18000
|
+
if (options2.trimWhitespace) {
|
|
18001
18001
|
while (idx < len && isSpace(str.charCodeAt(idx))) {
|
|
18002
18002
|
++idx;
|
|
18003
18003
|
}
|
|
18004
18004
|
}
|
|
18005
|
-
if (idx < len && !
|
|
18005
|
+
if (idx < len && !options2.allowTrailing) {
|
|
18006
18006
|
return new Error("trailing characters after number: " + JSON.stringify(str.slice(idx)));
|
|
18007
18007
|
}
|
|
18008
18008
|
if (value === 0) {
|
|
18009
18009
|
return 0;
|
|
18010
18010
|
}
|
|
18011
18011
|
var result = value * mult;
|
|
18012
|
-
if (!
|
|
18012
|
+
if (!options2.allowImprecise && (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {
|
|
18013
18013
|
return new Error("number is outside of the supported range: " + JSON.stringify(str.slice(start, idx)));
|
|
18014
18014
|
}
|
|
18015
18015
|
return result;
|
|
@@ -18183,23 +18183,23 @@ var require_signer = __commonJS({
|
|
|
18183
18183
|
HttpSignatureError.call(this, message, StrictParsingError);
|
|
18184
18184
|
}
|
|
18185
18185
|
util.inherits(StrictParsingError, HttpSignatureError);
|
|
18186
|
-
function RequestSigner(
|
|
18187
|
-
assert.object(
|
|
18186
|
+
function RequestSigner(options2) {
|
|
18187
|
+
assert.object(options2, "options");
|
|
18188
18188
|
var alg = [];
|
|
18189
|
-
if (
|
|
18190
|
-
assert.string(
|
|
18191
|
-
alg = validateAlgorithm(
|
|
18189
|
+
if (options2.algorithm !== void 0) {
|
|
18190
|
+
assert.string(options2.algorithm, "options.algorithm");
|
|
18191
|
+
alg = validateAlgorithm(options2.algorithm);
|
|
18192
18192
|
}
|
|
18193
18193
|
this.rs_alg = alg;
|
|
18194
|
-
if (
|
|
18195
|
-
assert.func(
|
|
18196
|
-
this.rs_signFunc =
|
|
18197
|
-
} else if (alg[0] === "hmac" &&
|
|
18198
|
-
assert.string(
|
|
18199
|
-
this.rs_keyId =
|
|
18200
|
-
if (typeof
|
|
18194
|
+
if (options2.sign !== void 0) {
|
|
18195
|
+
assert.func(options2.sign, "options.sign");
|
|
18196
|
+
this.rs_signFunc = options2.sign;
|
|
18197
|
+
} else if (alg[0] === "hmac" && options2.key !== void 0) {
|
|
18198
|
+
assert.string(options2.keyId, "options.keyId");
|
|
18199
|
+
this.rs_keyId = options2.keyId;
|
|
18200
|
+
if (typeof options2.key !== "string" && !Buffer.isBuffer(options2.key))
|
|
18201
18201
|
throw new TypeError("options.key for HMAC must be a string or Buffer");
|
|
18202
|
-
this.rs_signer = crypto.createHmac(alg[1].toUpperCase(),
|
|
18202
|
+
this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options2.key);
|
|
18203
18203
|
this.rs_signer.sign = function() {
|
|
18204
18204
|
var digest = this.digest("base64");
|
|
18205
18205
|
return {
|
|
@@ -18209,8 +18209,8 @@ var require_signer = __commonJS({
|
|
|
18209
18209
|
}
|
|
18210
18210
|
};
|
|
18211
18211
|
};
|
|
18212
|
-
} else if (
|
|
18213
|
-
var key =
|
|
18212
|
+
} else if (options2.key !== void 0) {
|
|
18213
|
+
var key = options2.key;
|
|
18214
18214
|
if (typeof key === "string" || Buffer.isBuffer(key))
|
|
18215
18215
|
key = sshpk.parsePrivateKey(key);
|
|
18216
18216
|
assert.ok(
|
|
@@ -18218,8 +18218,8 @@ var require_signer = __commonJS({
|
|
|
18218
18218
|
"options.key must be a sshpk.PrivateKey"
|
|
18219
18219
|
);
|
|
18220
18220
|
this.rs_key = key;
|
|
18221
|
-
assert.string(
|
|
18222
|
-
this.rs_keyId =
|
|
18221
|
+
assert.string(options2.keyId, "options.keyId");
|
|
18222
|
+
this.rs_keyId = options2.keyId;
|
|
18223
18223
|
if (!PK_ALGOS[key.type]) {
|
|
18224
18224
|
throw new InvalidAlgorithmError(key.type.toUpperCase() + " type keys are not supported");
|
|
18225
18225
|
}
|
|
@@ -18332,8 +18332,8 @@ var require_signer = __commonJS({
|
|
|
18332
18332
|
* - {Func} sign (data, cb)
|
|
18333
18333
|
* @return {RequestSigner}
|
|
18334
18334
|
*/
|
|
18335
|
-
createSigner: function createSigner(
|
|
18336
|
-
return new RequestSigner(
|
|
18335
|
+
createSigner: function createSigner(options2) {
|
|
18336
|
+
return new RequestSigner(options2);
|
|
18337
18337
|
},
|
|
18338
18338
|
/**
|
|
18339
18339
|
* Adds an 'Authorization' header to an http.ClientRequest object.
|
|
@@ -18368,33 +18368,33 @@ var require_signer = __commonJS({
|
|
|
18368
18368
|
* @throws {MissingHeaderError} if a header to be signed was specified but
|
|
18369
18369
|
* was not present.
|
|
18370
18370
|
*/
|
|
18371
|
-
signRequest: function signRequest(request2,
|
|
18371
|
+
signRequest: function signRequest(request2, options2) {
|
|
18372
18372
|
assert.object(request2, "request");
|
|
18373
|
-
assert.object(
|
|
18374
|
-
assert.optionalString(
|
|
18375
|
-
assert.string(
|
|
18376
|
-
assert.optionalArrayOfString(
|
|
18377
|
-
assert.optionalString(
|
|
18373
|
+
assert.object(options2, "options");
|
|
18374
|
+
assert.optionalString(options2.algorithm, "options.algorithm");
|
|
18375
|
+
assert.string(options2.keyId, "options.keyId");
|
|
18376
|
+
assert.optionalArrayOfString(options2.headers, "options.headers");
|
|
18377
|
+
assert.optionalString(options2.httpVersion, "options.httpVersion");
|
|
18378
18378
|
if (!request2.getHeader("Date"))
|
|
18379
18379
|
request2.setHeader("Date", jsprim.rfc1123(/* @__PURE__ */ new Date()));
|
|
18380
|
-
if (!
|
|
18381
|
-
|
|
18382
|
-
if (!
|
|
18383
|
-
|
|
18380
|
+
if (!options2.headers)
|
|
18381
|
+
options2.headers = ["date"];
|
|
18382
|
+
if (!options2.httpVersion)
|
|
18383
|
+
options2.httpVersion = "1.1";
|
|
18384
18384
|
var alg = [];
|
|
18385
|
-
if (
|
|
18386
|
-
|
|
18387
|
-
alg = validateAlgorithm(
|
|
18385
|
+
if (options2.algorithm) {
|
|
18386
|
+
options2.algorithm = options2.algorithm.toLowerCase();
|
|
18387
|
+
alg = validateAlgorithm(options2.algorithm);
|
|
18388
18388
|
}
|
|
18389
18389
|
var i;
|
|
18390
18390
|
var stringToSign = "";
|
|
18391
|
-
for (i = 0; i <
|
|
18392
|
-
if (typeof
|
|
18391
|
+
for (i = 0; i < options2.headers.length; i++) {
|
|
18392
|
+
if (typeof options2.headers[i] !== "string")
|
|
18393
18393
|
throw new TypeError("options.headers must be an array of Strings");
|
|
18394
|
-
var h =
|
|
18394
|
+
var h = options2.headers[i].toLowerCase();
|
|
18395
18395
|
if (h === "request-line") {
|
|
18396
|
-
if (!
|
|
18397
|
-
stringToSign += request2.method + " " + request2.path + " HTTP/" +
|
|
18396
|
+
if (!options2.strict) {
|
|
18397
|
+
stringToSign += request2.method + " " + request2.path + " HTTP/" + options2.httpVersion;
|
|
18398
18398
|
} else {
|
|
18399
18399
|
throw new StrictParsingError("request-line is not a valid header with strict parsing enabled.");
|
|
18400
18400
|
}
|
|
@@ -18407,7 +18407,7 @@ var require_signer = __commonJS({
|
|
|
18407
18407
|
}
|
|
18408
18408
|
stringToSign += h + ": " + value;
|
|
18409
18409
|
}
|
|
18410
|
-
if (i + 1 <
|
|
18410
|
+
if (i + 1 < options2.headers.length)
|
|
18411
18411
|
stringToSign += "\n";
|
|
18412
18412
|
}
|
|
18413
18413
|
if (request2.hasOwnProperty("_stringToSign")) {
|
|
@@ -18415,15 +18415,15 @@ var require_signer = __commonJS({
|
|
|
18415
18415
|
}
|
|
18416
18416
|
var signature;
|
|
18417
18417
|
if (alg[0] === "hmac") {
|
|
18418
|
-
if (typeof
|
|
18418
|
+
if (typeof options2.key !== "string" && !Buffer.isBuffer(options2.key))
|
|
18419
18419
|
throw new TypeError("options.key must be a string or Buffer");
|
|
18420
|
-
var hmac = crypto.createHmac(alg[1].toUpperCase(),
|
|
18420
|
+
var hmac = crypto.createHmac(alg[1].toUpperCase(), options2.key);
|
|
18421
18421
|
hmac.update(stringToSign);
|
|
18422
18422
|
signature = hmac.digest("base64");
|
|
18423
18423
|
} else {
|
|
18424
|
-
var key =
|
|
18424
|
+
var key = options2.key;
|
|
18425
18425
|
if (typeof key === "string" || Buffer.isBuffer(key))
|
|
18426
|
-
key = sshpk.parsePrivateKey(
|
|
18426
|
+
key = sshpk.parsePrivateKey(options2.key);
|
|
18427
18427
|
assert.ok(
|
|
18428
18428
|
sshpk.PrivateKey.isPrivateKey(key, [1, 2]),
|
|
18429
18429
|
"options.key must be a sshpk.PrivateKey"
|
|
@@ -18440,16 +18440,16 @@ var require_signer = __commonJS({
|
|
|
18440
18440
|
if (!HASH_ALGOS[sigObj.hashAlgorithm]) {
|
|
18441
18441
|
throw new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() + " is not a supported hash algorithm");
|
|
18442
18442
|
}
|
|
18443
|
-
|
|
18443
|
+
options2.algorithm = key.type + "-" + sigObj.hashAlgorithm;
|
|
18444
18444
|
signature = sigObj.toString();
|
|
18445
18445
|
assert.notStrictEqual(signature, "", "empty signature produced");
|
|
18446
18446
|
}
|
|
18447
|
-
var authzHeaderName =
|
|
18447
|
+
var authzHeaderName = options2.authorizationHeaderName || "Authorization";
|
|
18448
18448
|
request2.setHeader(authzHeaderName, sprintf(
|
|
18449
18449
|
AUTHZ_FMT,
|
|
18450
|
-
|
|
18451
|
-
|
|
18452
|
-
|
|
18450
|
+
options2.keyId,
|
|
18451
|
+
options2.algorithm,
|
|
18452
|
+
options2.headers.join(" "),
|
|
18453
18453
|
signature
|
|
18454
18454
|
));
|
|
18455
18455
|
return true;
|
|
@@ -27264,9 +27264,9 @@ var require_forever_agent = __commonJS({
|
|
|
27264
27264
|
}
|
|
27265
27265
|
return name;
|
|
27266
27266
|
}
|
|
27267
|
-
function ForeverAgent(
|
|
27267
|
+
function ForeverAgent(options2) {
|
|
27268
27268
|
var self2 = this;
|
|
27269
|
-
self2.options =
|
|
27269
|
+
self2.options = options2 || {};
|
|
27270
27270
|
self2.requests = {};
|
|
27271
27271
|
self2.sockets = {};
|
|
27272
27272
|
self2.freeSockets = {};
|
|
@@ -27296,9 +27296,9 @@ var require_forever_agent = __commonJS({
|
|
|
27296
27296
|
ForeverAgent.prototype.addRequest = function(req, host, port) {
|
|
27297
27297
|
var name = getConnectionName(host, port);
|
|
27298
27298
|
if (typeof host !== "string") {
|
|
27299
|
-
var
|
|
27300
|
-
port =
|
|
27301
|
-
host =
|
|
27299
|
+
var options2 = host;
|
|
27300
|
+
port = options2.port;
|
|
27301
|
+
host = options2.host;
|
|
27302
27302
|
}
|
|
27303
27303
|
if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
|
|
27304
27304
|
var idleSocket = this.freeSockets[name].pop();
|
|
@@ -27333,29 +27333,29 @@ var require_forever_agent = __commonJS({
|
|
|
27333
27333
|
this.createSocket(name, host, port).emit("free");
|
|
27334
27334
|
}
|
|
27335
27335
|
};
|
|
27336
|
-
function ForeverAgentSSL(
|
|
27337
|
-
ForeverAgent.call(this,
|
|
27336
|
+
function ForeverAgentSSL(options2) {
|
|
27337
|
+
ForeverAgent.call(this, options2);
|
|
27338
27338
|
}
|
|
27339
27339
|
util.inherits(ForeverAgentSSL, ForeverAgent);
|
|
27340
27340
|
ForeverAgentSSL.prototype.createConnection = createConnectionSSL;
|
|
27341
27341
|
ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest;
|
|
27342
|
-
function createConnectionSSL(port, host,
|
|
27342
|
+
function createConnectionSSL(port, host, options2) {
|
|
27343
27343
|
if (typeof port === "object") {
|
|
27344
|
-
|
|
27344
|
+
options2 = port;
|
|
27345
27345
|
} else if (typeof host === "object") {
|
|
27346
|
-
|
|
27347
|
-
} else if (typeof
|
|
27348
|
-
|
|
27346
|
+
options2 = host;
|
|
27347
|
+
} else if (typeof options2 === "object") {
|
|
27348
|
+
options2 = options2;
|
|
27349
27349
|
} else {
|
|
27350
|
-
|
|
27350
|
+
options2 = {};
|
|
27351
27351
|
}
|
|
27352
27352
|
if (typeof port === "number") {
|
|
27353
|
-
|
|
27353
|
+
options2.port = port;
|
|
27354
27354
|
}
|
|
27355
27355
|
if (typeof host === "string") {
|
|
27356
|
-
|
|
27356
|
+
options2.host = host;
|
|
27357
27357
|
}
|
|
27358
|
-
return tls.connect(
|
|
27358
|
+
return tls.connect(options2);
|
|
27359
27359
|
}
|
|
27360
27360
|
}
|
|
27361
27361
|
});
|
|
@@ -27376,11 +27376,11 @@ var require_delayed_stream = __commonJS({
|
|
|
27376
27376
|
this._bufferedEvents = [];
|
|
27377
27377
|
}
|
|
27378
27378
|
util.inherits(DelayedStream, Stream);
|
|
27379
|
-
DelayedStream.create = function(source,
|
|
27379
|
+
DelayedStream.create = function(source, options2) {
|
|
27380
27380
|
var delayedStream = new this();
|
|
27381
|
-
|
|
27382
|
-
for (var option in
|
|
27383
|
-
delayedStream[option] =
|
|
27381
|
+
options2 = options2 || {};
|
|
27382
|
+
for (var option in options2) {
|
|
27383
|
+
delayedStream[option] = options2[option];
|
|
27384
27384
|
}
|
|
27385
27385
|
delayedStream.source = source;
|
|
27386
27386
|
var realEmit = source.emit;
|
|
@@ -27471,11 +27471,11 @@ var require_combined_stream = __commonJS({
|
|
|
27471
27471
|
this._pendingNext = false;
|
|
27472
27472
|
}
|
|
27473
27473
|
util.inherits(CombinedStream, Stream);
|
|
27474
|
-
CombinedStream.create = function(
|
|
27474
|
+
CombinedStream.create = function(options2) {
|
|
27475
27475
|
var combinedStream = new this();
|
|
27476
|
-
|
|
27477
|
-
for (var option in
|
|
27478
|
-
combinedStream[option] =
|
|
27476
|
+
options2 = options2 || {};
|
|
27477
|
+
for (var option in options2) {
|
|
27478
|
+
combinedStream[option] = options2[option];
|
|
27479
27479
|
}
|
|
27480
27480
|
return combinedStream;
|
|
27481
27481
|
};
|
|
@@ -27501,8 +27501,8 @@ var require_combined_stream = __commonJS({
|
|
|
27501
27501
|
this._streams.push(stream);
|
|
27502
27502
|
return this;
|
|
27503
27503
|
};
|
|
27504
|
-
CombinedStream.prototype.pipe = function(dest,
|
|
27505
|
-
Stream.prototype.pipe.call(this, dest,
|
|
27504
|
+
CombinedStream.prototype.pipe = function(dest, options2) {
|
|
27505
|
+
Stream.prototype.pipe.call(this, dest, options2);
|
|
27506
27506
|
this.resume();
|
|
27507
27507
|
return dest;
|
|
27508
27508
|
};
|
|
@@ -27856,7 +27856,7 @@ var require_form_data = __commonJS({
|
|
|
27856
27856
|
var populate = require_populate();
|
|
27857
27857
|
module2.exports = FormData;
|
|
27858
27858
|
util.inherits(FormData, CombinedStream);
|
|
27859
|
-
function FormData(
|
|
27859
|
+
function FormData(options2) {
|
|
27860
27860
|
if (!(this instanceof FormData)) {
|
|
27861
27861
|
return new FormData();
|
|
27862
27862
|
}
|
|
@@ -27864,17 +27864,17 @@ var require_form_data = __commonJS({
|
|
|
27864
27864
|
this._valueLength = 0;
|
|
27865
27865
|
this._valuesToMeasure = [];
|
|
27866
27866
|
CombinedStream.call(this);
|
|
27867
|
-
|
|
27868
|
-
for (var option in
|
|
27869
|
-
this[option] =
|
|
27867
|
+
options2 = options2 || {};
|
|
27868
|
+
for (var option in options2) {
|
|
27869
|
+
this[option] = options2[option];
|
|
27870
27870
|
}
|
|
27871
27871
|
}
|
|
27872
27872
|
FormData.LINE_BREAK = "\r\n";
|
|
27873
27873
|
FormData.DEFAULT_CONTENT_TYPE = "application/octet-stream";
|
|
27874
|
-
FormData.prototype.append = function(field, value,
|
|
27875
|
-
|
|
27876
|
-
if (typeof
|
|
27877
|
-
|
|
27874
|
+
FormData.prototype.append = function(field, value, options2) {
|
|
27875
|
+
options2 = options2 || {};
|
|
27876
|
+
if (typeof options2 == "string") {
|
|
27877
|
+
options2 = { filename: options2 };
|
|
27878
27878
|
}
|
|
27879
27879
|
var append = CombinedStream.prototype.append.bind(this);
|
|
27880
27880
|
if (typeof value == "number") {
|
|
@@ -27884,17 +27884,17 @@ var require_form_data = __commonJS({
|
|
|
27884
27884
|
this._error(new Error("Arrays are not supported."));
|
|
27885
27885
|
return;
|
|
27886
27886
|
}
|
|
27887
|
-
var header = this._multiPartHeader(field, value,
|
|
27887
|
+
var header = this._multiPartHeader(field, value, options2);
|
|
27888
27888
|
var footer = this._multiPartFooter();
|
|
27889
27889
|
append(header);
|
|
27890
27890
|
append(value);
|
|
27891
27891
|
append(footer);
|
|
27892
|
-
this._trackLength(header, value,
|
|
27892
|
+
this._trackLength(header, value, options2);
|
|
27893
27893
|
};
|
|
27894
|
-
FormData.prototype._trackLength = function(header, value,
|
|
27894
|
+
FormData.prototype._trackLength = function(header, value, options2) {
|
|
27895
27895
|
var valueLength = 0;
|
|
27896
|
-
if (
|
|
27897
|
-
valueLength += +
|
|
27896
|
+
if (options2.knownLength != null) {
|
|
27897
|
+
valueLength += +options2.knownLength;
|
|
27898
27898
|
} else if (Buffer.isBuffer(value)) {
|
|
27899
27899
|
valueLength = value.length;
|
|
27900
27900
|
} else if (typeof value === "string") {
|
|
@@ -27905,7 +27905,7 @@ var require_form_data = __commonJS({
|
|
|
27905
27905
|
if (!value || !value.path && !(value.readable && value.hasOwnProperty("httpVersion"))) {
|
|
27906
27906
|
return;
|
|
27907
27907
|
}
|
|
27908
|
-
if (!
|
|
27908
|
+
if (!options2.knownLength) {
|
|
27909
27909
|
this._valuesToMeasure.push(value);
|
|
27910
27910
|
}
|
|
27911
27911
|
};
|
|
@@ -27936,12 +27936,12 @@ var require_form_data = __commonJS({
|
|
|
27936
27936
|
callback("Unknown stream");
|
|
27937
27937
|
}
|
|
27938
27938
|
};
|
|
27939
|
-
FormData.prototype._multiPartHeader = function(field, value,
|
|
27940
|
-
if (typeof
|
|
27941
|
-
return
|
|
27939
|
+
FormData.prototype._multiPartHeader = function(field, value, options2) {
|
|
27940
|
+
if (typeof options2.header == "string") {
|
|
27941
|
+
return options2.header;
|
|
27942
27942
|
}
|
|
27943
|
-
var contentDisposition = this._getContentDisposition(value,
|
|
27944
|
-
var contentType = this._getContentType(value,
|
|
27943
|
+
var contentDisposition = this._getContentDisposition(value, options2);
|
|
27944
|
+
var contentType = this._getContentType(value, options2);
|
|
27945
27945
|
var contents = "";
|
|
27946
27946
|
var headers = {
|
|
27947
27947
|
// add custom disposition as third element or keep it two elements if not
|
|
@@ -27949,8 +27949,8 @@ var require_form_data = __commonJS({
|
|
|
27949
27949
|
// if no content type. allow it to be empty array
|
|
27950
27950
|
"Content-Type": [].concat(contentType || [])
|
|
27951
27951
|
};
|
|
27952
|
-
if (typeof
|
|
27953
|
-
populate(headers,
|
|
27952
|
+
if (typeof options2.header == "object") {
|
|
27953
|
+
populate(headers, options2.header);
|
|
27954
27954
|
}
|
|
27955
27955
|
var header;
|
|
27956
27956
|
for (var prop in headers) {
|
|
@@ -27968,12 +27968,12 @@ var require_form_data = __commonJS({
|
|
|
27968
27968
|
}
|
|
27969
27969
|
return "--" + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
|
|
27970
27970
|
};
|
|
27971
|
-
FormData.prototype._getContentDisposition = function(value,
|
|
27971
|
+
FormData.prototype._getContentDisposition = function(value, options2) {
|
|
27972
27972
|
var filename, contentDisposition;
|
|
27973
|
-
if (typeof
|
|
27974
|
-
filename = path5.normalize(
|
|
27975
|
-
} else if (
|
|
27976
|
-
filename = path5.basename(
|
|
27973
|
+
if (typeof options2.filepath === "string") {
|
|
27974
|
+
filename = path5.normalize(options2.filepath).replace(/\\/g, "/");
|
|
27975
|
+
} else if (options2.filename || value.name || value.path) {
|
|
27976
|
+
filename = path5.basename(options2.filename || value.name || value.path);
|
|
27977
27977
|
} else if (value.readable && value.hasOwnProperty("httpVersion")) {
|
|
27978
27978
|
filename = path5.basename(value.client._httpMessage.path);
|
|
27979
27979
|
}
|
|
@@ -27982,8 +27982,8 @@ var require_form_data = __commonJS({
|
|
|
27982
27982
|
}
|
|
27983
27983
|
return contentDisposition;
|
|
27984
27984
|
};
|
|
27985
|
-
FormData.prototype._getContentType = function(value,
|
|
27986
|
-
var contentType =
|
|
27985
|
+
FormData.prototype._getContentType = function(value, options2) {
|
|
27986
|
+
var contentType = options2.contentType;
|
|
27987
27987
|
if (!contentType && value.name) {
|
|
27988
27988
|
contentType = mime.lookup(value.name);
|
|
27989
27989
|
}
|
|
@@ -27993,8 +27993,8 @@ var require_form_data = __commonJS({
|
|
|
27993
27993
|
if (!contentType && value.readable && value.hasOwnProperty("httpVersion")) {
|
|
27994
27994
|
contentType = value.headers["content-type"];
|
|
27995
27995
|
}
|
|
27996
|
-
if (!contentType && (
|
|
27997
|
-
contentType = mime.lookup(
|
|
27996
|
+
if (!contentType && (options2.filepath || options2.filename)) {
|
|
27997
|
+
contentType = mime.lookup(options2.filepath || options2.filename);
|
|
27998
27998
|
}
|
|
27999
27999
|
if (!contentType && typeof value == "object") {
|
|
28000
28000
|
contentType = FormData.DEFAULT_CONTENT_TYPE;
|
|
@@ -28077,26 +28077,26 @@ var require_form_data = __commonJS({
|
|
|
28077
28077
|
});
|
|
28078
28078
|
};
|
|
28079
28079
|
FormData.prototype.submit = function(params, cb) {
|
|
28080
|
-
var request2,
|
|
28080
|
+
var request2, options2, defaults = { method: "post" };
|
|
28081
28081
|
if (typeof params == "string") {
|
|
28082
28082
|
params = parseUrl(params);
|
|
28083
|
-
|
|
28083
|
+
options2 = populate({
|
|
28084
28084
|
port: params.port,
|
|
28085
28085
|
path: params.pathname,
|
|
28086
28086
|
host: params.hostname,
|
|
28087
28087
|
protocol: params.protocol
|
|
28088
28088
|
}, defaults);
|
|
28089
28089
|
} else {
|
|
28090
|
-
|
|
28091
|
-
if (!
|
|
28092
|
-
|
|
28090
|
+
options2 = populate(params, defaults);
|
|
28091
|
+
if (!options2.port) {
|
|
28092
|
+
options2.port = options2.protocol == "https:" ? 443 : 80;
|
|
28093
28093
|
}
|
|
28094
28094
|
}
|
|
28095
|
-
|
|
28096
|
-
if (
|
|
28097
|
-
request2 = https.request(
|
|
28095
|
+
options2.headers = this.getHeaders(params.headers);
|
|
28096
|
+
if (options2.protocol == "https:") {
|
|
28097
|
+
request2 = https.request(options2);
|
|
28098
28098
|
} else {
|
|
28099
|
-
request2 = http.request(
|
|
28099
|
+
request2 = http.request(options2);
|
|
28100
28100
|
}
|
|
28101
28101
|
this.getLength(function(err, length) {
|
|
28102
28102
|
if (err) {
|
|
@@ -28255,8 +28255,8 @@ var require_utils4 = __commonJS({
|
|
|
28255
28255
|
}
|
|
28256
28256
|
return obj;
|
|
28257
28257
|
};
|
|
28258
|
-
var arrayToObject = function arrayToObject2(source,
|
|
28259
|
-
var obj =
|
|
28258
|
+
var arrayToObject = function arrayToObject2(source, options2) {
|
|
28259
|
+
var obj = options2 && options2.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
28260
28260
|
for (var i = 0; i < source.length; ++i) {
|
|
28261
28261
|
if (typeof source[i] !== "undefined") {
|
|
28262
28262
|
obj[i] = source[i];
|
|
@@ -28264,7 +28264,7 @@ var require_utils4 = __commonJS({
|
|
|
28264
28264
|
}
|
|
28265
28265
|
return obj;
|
|
28266
28266
|
};
|
|
28267
|
-
var merge = function merge2(target, source,
|
|
28267
|
+
var merge = function merge2(target, source, options2) {
|
|
28268
28268
|
if (!source) {
|
|
28269
28269
|
return target;
|
|
28270
28270
|
}
|
|
@@ -28272,7 +28272,7 @@ var require_utils4 = __commonJS({
|
|
|
28272
28272
|
if (Array.isArray(target)) {
|
|
28273
28273
|
target.push(source);
|
|
28274
28274
|
} else if (target && typeof target === "object") {
|
|
28275
|
-
if (
|
|
28275
|
+
if (options2 && (options2.plainObjects || options2.allowPrototypes) || !has.call(Object.prototype, source)) {
|
|
28276
28276
|
target[source] = true;
|
|
28277
28277
|
}
|
|
28278
28278
|
} else {
|
|
@@ -28285,14 +28285,14 @@ var require_utils4 = __commonJS({
|
|
|
28285
28285
|
}
|
|
28286
28286
|
var mergeTarget = target;
|
|
28287
28287
|
if (Array.isArray(target) && !Array.isArray(source)) {
|
|
28288
|
-
mergeTarget = arrayToObject(target,
|
|
28288
|
+
mergeTarget = arrayToObject(target, options2);
|
|
28289
28289
|
}
|
|
28290
28290
|
if (Array.isArray(target) && Array.isArray(source)) {
|
|
28291
28291
|
source.forEach(function(item, i) {
|
|
28292
28292
|
if (has.call(target, i)) {
|
|
28293
28293
|
var targetItem = target[i];
|
|
28294
28294
|
if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
|
|
28295
|
-
target[i] = merge2(targetItem, item,
|
|
28295
|
+
target[i] = merge2(targetItem, item, options2);
|
|
28296
28296
|
} else {
|
|
28297
28297
|
target.push(item);
|
|
28298
28298
|
}
|
|
@@ -28305,7 +28305,7 @@ var require_utils4 = __commonJS({
|
|
|
28305
28305
|
return Object.keys(source).reduce(function(acc, key) {
|
|
28306
28306
|
var value = source[key];
|
|
28307
28307
|
if (has.call(acc, key)) {
|
|
28308
|
-
acc[key] = merge2(acc[key], value,
|
|
28308
|
+
acc[key] = merge2(acc[key], value, options2);
|
|
28309
28309
|
} else {
|
|
28310
28310
|
acc[key] = value;
|
|
28311
28311
|
}
|
|
@@ -28523,32 +28523,32 @@ var require_stringify2 = __commonJS({
|
|
|
28523
28523
|
};
|
|
28524
28524
|
module2.exports = function(object, opts) {
|
|
28525
28525
|
var obj = object;
|
|
28526
|
-
var
|
|
28527
|
-
if (
|
|
28526
|
+
var options2 = opts ? utils.assign({}, opts) : {};
|
|
28527
|
+
if (options2.encoder !== null && typeof options2.encoder !== "undefined" && typeof options2.encoder !== "function") {
|
|
28528
28528
|
throw new TypeError("Encoder has to be a function.");
|
|
28529
28529
|
}
|
|
28530
|
-
var delimiter = typeof
|
|
28531
|
-
var strictNullHandling = typeof
|
|
28532
|
-
var skipNulls = typeof
|
|
28533
|
-
var encode = typeof
|
|
28534
|
-
var encoder = typeof
|
|
28535
|
-
var sort = typeof
|
|
28536
|
-
var allowDots = typeof
|
|
28537
|
-
var serializeDate = typeof
|
|
28538
|
-
var encodeValuesOnly = typeof
|
|
28539
|
-
if (typeof
|
|
28540
|
-
|
|
28541
|
-
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters,
|
|
28530
|
+
var delimiter = typeof options2.delimiter === "undefined" ? defaults.delimiter : options2.delimiter;
|
|
28531
|
+
var strictNullHandling = typeof options2.strictNullHandling === "boolean" ? options2.strictNullHandling : defaults.strictNullHandling;
|
|
28532
|
+
var skipNulls = typeof options2.skipNulls === "boolean" ? options2.skipNulls : defaults.skipNulls;
|
|
28533
|
+
var encode = typeof options2.encode === "boolean" ? options2.encode : defaults.encode;
|
|
28534
|
+
var encoder = typeof options2.encoder === "function" ? options2.encoder : defaults.encoder;
|
|
28535
|
+
var sort = typeof options2.sort === "function" ? options2.sort : null;
|
|
28536
|
+
var allowDots = typeof options2.allowDots === "undefined" ? false : options2.allowDots;
|
|
28537
|
+
var serializeDate = typeof options2.serializeDate === "function" ? options2.serializeDate : defaults.serializeDate;
|
|
28538
|
+
var encodeValuesOnly = typeof options2.encodeValuesOnly === "boolean" ? options2.encodeValuesOnly : defaults.encodeValuesOnly;
|
|
28539
|
+
if (typeof options2.format === "undefined") {
|
|
28540
|
+
options2.format = formats["default"];
|
|
28541
|
+
} else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options2.format)) {
|
|
28542
28542
|
throw new TypeError("Unknown format option provided.");
|
|
28543
28543
|
}
|
|
28544
|
-
var formatter = formats.formatters[
|
|
28544
|
+
var formatter = formats.formatters[options2.format];
|
|
28545
28545
|
var objKeys;
|
|
28546
28546
|
var filter;
|
|
28547
|
-
if (typeof
|
|
28548
|
-
filter =
|
|
28547
|
+
if (typeof options2.filter === "function") {
|
|
28548
|
+
filter = options2.filter;
|
|
28549
28549
|
obj = filter("", obj);
|
|
28550
|
-
} else if (isArray(
|
|
28551
|
-
filter =
|
|
28550
|
+
} else if (isArray(options2.filter)) {
|
|
28551
|
+
filter = options2.filter;
|
|
28552
28552
|
objKeys = filter;
|
|
28553
28553
|
}
|
|
28554
28554
|
var keys = [];
|
|
@@ -28556,10 +28556,10 @@ var require_stringify2 = __commonJS({
|
|
|
28556
28556
|
return "";
|
|
28557
28557
|
}
|
|
28558
28558
|
var arrayFormat;
|
|
28559
|
-
if (
|
|
28560
|
-
arrayFormat =
|
|
28561
|
-
} else if ("indices" in
|
|
28562
|
-
arrayFormat =
|
|
28559
|
+
if (options2.arrayFormat in arrayPrefixGenerators) {
|
|
28560
|
+
arrayFormat = options2.arrayFormat;
|
|
28561
|
+
} else if ("indices" in options2) {
|
|
28562
|
+
arrayFormat = options2.indices ? "indices" : "repeat";
|
|
28563
28563
|
} else {
|
|
28564
28564
|
arrayFormat = "indices";
|
|
28565
28565
|
}
|
|
@@ -28591,7 +28591,7 @@ var require_stringify2 = __commonJS({
|
|
|
28591
28591
|
));
|
|
28592
28592
|
}
|
|
28593
28593
|
var joined = keys.join(delimiter);
|
|
28594
|
-
var prefix =
|
|
28594
|
+
var prefix = options2.addQueryPrefix === true ? "?" : "";
|
|
28595
28595
|
return joined.length > 0 ? prefix + joined : "";
|
|
28596
28596
|
};
|
|
28597
28597
|
}
|
|
@@ -28614,22 +28614,22 @@ var require_parse = __commonJS({
|
|
|
28614
28614
|
plainObjects: false,
|
|
28615
28615
|
strictNullHandling: false
|
|
28616
28616
|
};
|
|
28617
|
-
var parseValues = function parseQueryStringValues(str,
|
|
28617
|
+
var parseValues = function parseQueryStringValues(str, options2) {
|
|
28618
28618
|
var obj = {};
|
|
28619
|
-
var cleanStr =
|
|
28620
|
-
var limit =
|
|
28621
|
-
var parts = cleanStr.split(
|
|
28619
|
+
var cleanStr = options2.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
28620
|
+
var limit = options2.parameterLimit === Infinity ? void 0 : options2.parameterLimit;
|
|
28621
|
+
var parts = cleanStr.split(options2.delimiter, limit);
|
|
28622
28622
|
for (var i = 0; i < parts.length; ++i) {
|
|
28623
28623
|
var part = parts[i];
|
|
28624
28624
|
var bracketEqualsPos = part.indexOf("]=");
|
|
28625
28625
|
var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
|
|
28626
28626
|
var key, val;
|
|
28627
28627
|
if (pos === -1) {
|
|
28628
|
-
key =
|
|
28629
|
-
val =
|
|
28628
|
+
key = options2.decoder(part, defaults.decoder);
|
|
28629
|
+
val = options2.strictNullHandling ? null : "";
|
|
28630
28630
|
} else {
|
|
28631
|
-
key =
|
|
28632
|
-
val =
|
|
28631
|
+
key = options2.decoder(part.slice(0, pos), defaults.decoder);
|
|
28632
|
+
val = options2.decoder(part.slice(pos + 1), defaults.decoder);
|
|
28633
28633
|
}
|
|
28634
28634
|
if (has.call(obj, key)) {
|
|
28635
28635
|
obj[key] = [].concat(obj[key]).concat(val);
|
|
@@ -28639,20 +28639,20 @@ var require_parse = __commonJS({
|
|
|
28639
28639
|
}
|
|
28640
28640
|
return obj;
|
|
28641
28641
|
};
|
|
28642
|
-
var parseObject = function(chain, val,
|
|
28642
|
+
var parseObject = function(chain, val, options2) {
|
|
28643
28643
|
var leaf = val;
|
|
28644
28644
|
for (var i = chain.length - 1; i >= 0; --i) {
|
|
28645
28645
|
var obj;
|
|
28646
28646
|
var root = chain[i];
|
|
28647
|
-
if (root === "[]" &&
|
|
28647
|
+
if (root === "[]" && options2.parseArrays) {
|
|
28648
28648
|
obj = [].concat(leaf);
|
|
28649
28649
|
} else {
|
|
28650
|
-
obj =
|
|
28650
|
+
obj = options2.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
28651
28651
|
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
28652
28652
|
var index = parseInt(cleanRoot, 10);
|
|
28653
|
-
if (!
|
|
28653
|
+
if (!options2.parseArrays && cleanRoot === "") {
|
|
28654
28654
|
obj = { 0: leaf };
|
|
28655
|
-
} else if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (
|
|
28655
|
+
} else if (!isNaN(index) && root !== cleanRoot && String(index) === cleanRoot && index >= 0 && (options2.parseArrays && index <= options2.arrayLimit)) {
|
|
28656
28656
|
obj = [];
|
|
28657
28657
|
obj[index] = leaf;
|
|
28658
28658
|
} else if (cleanRoot !== "__proto__") {
|
|
@@ -28663,29 +28663,29 @@ var require_parse = __commonJS({
|
|
|
28663
28663
|
}
|
|
28664
28664
|
return leaf;
|
|
28665
28665
|
};
|
|
28666
|
-
var parseKeys = function parseQueryStringKeys(givenKey, val,
|
|
28666
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options2) {
|
|
28667
28667
|
if (!givenKey) {
|
|
28668
28668
|
return;
|
|
28669
28669
|
}
|
|
28670
|
-
var key =
|
|
28670
|
+
var key = options2.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
|
|
28671
28671
|
var brackets = /(\[[^[\]]*])/;
|
|
28672
28672
|
var child = /(\[[^[\]]*])/g;
|
|
28673
28673
|
var segment = brackets.exec(key);
|
|
28674
28674
|
var parent = segment ? key.slice(0, segment.index) : key;
|
|
28675
28675
|
var keys = [];
|
|
28676
28676
|
if (parent) {
|
|
28677
|
-
if (!
|
|
28678
|
-
if (!
|
|
28677
|
+
if (!options2.plainObjects && has.call(Object.prototype, parent)) {
|
|
28678
|
+
if (!options2.allowPrototypes) {
|
|
28679
28679
|
return;
|
|
28680
28680
|
}
|
|
28681
28681
|
}
|
|
28682
28682
|
keys.push(parent);
|
|
28683
28683
|
}
|
|
28684
28684
|
var i = 0;
|
|
28685
|
-
while ((segment = child.exec(key)) !== null && i <
|
|
28685
|
+
while ((segment = child.exec(key)) !== null && i < options2.depth) {
|
|
28686
28686
|
i += 1;
|
|
28687
|
-
if (!
|
|
28688
|
-
if (!
|
|
28687
|
+
if (!options2.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
28688
|
+
if (!options2.allowPrototypes) {
|
|
28689
28689
|
return;
|
|
28690
28690
|
}
|
|
28691
28691
|
}
|
|
@@ -28694,34 +28694,34 @@ var require_parse = __commonJS({
|
|
|
28694
28694
|
if (segment) {
|
|
28695
28695
|
keys.push("[" + key.slice(segment.index) + "]");
|
|
28696
28696
|
}
|
|
28697
|
-
return parseObject(keys, val,
|
|
28697
|
+
return parseObject(keys, val, options2);
|
|
28698
28698
|
};
|
|
28699
28699
|
module2.exports = function(str, opts) {
|
|
28700
|
-
var
|
|
28701
|
-
if (
|
|
28700
|
+
var options2 = opts ? utils.assign({}, opts) : {};
|
|
28701
|
+
if (options2.decoder !== null && options2.decoder !== void 0 && typeof options2.decoder !== "function") {
|
|
28702
28702
|
throw new TypeError("Decoder has to be a function.");
|
|
28703
28703
|
}
|
|
28704
|
-
|
|
28705
|
-
|
|
28706
|
-
|
|
28707
|
-
|
|
28708
|
-
|
|
28709
|
-
|
|
28710
|
-
|
|
28711
|
-
|
|
28712
|
-
|
|
28713
|
-
|
|
28714
|
-
|
|
28704
|
+
options2.ignoreQueryPrefix = options2.ignoreQueryPrefix === true;
|
|
28705
|
+
options2.delimiter = typeof options2.delimiter === "string" || utils.isRegExp(options2.delimiter) ? options2.delimiter : defaults.delimiter;
|
|
28706
|
+
options2.depth = typeof options2.depth === "number" ? options2.depth : defaults.depth;
|
|
28707
|
+
options2.arrayLimit = typeof options2.arrayLimit === "number" ? options2.arrayLimit : defaults.arrayLimit;
|
|
28708
|
+
options2.parseArrays = options2.parseArrays !== false;
|
|
28709
|
+
options2.decoder = typeof options2.decoder === "function" ? options2.decoder : defaults.decoder;
|
|
28710
|
+
options2.allowDots = typeof options2.allowDots === "boolean" ? options2.allowDots : defaults.allowDots;
|
|
28711
|
+
options2.plainObjects = typeof options2.plainObjects === "boolean" ? options2.plainObjects : defaults.plainObjects;
|
|
28712
|
+
options2.allowPrototypes = typeof options2.allowPrototypes === "boolean" ? options2.allowPrototypes : defaults.allowPrototypes;
|
|
28713
|
+
options2.parameterLimit = typeof options2.parameterLimit === "number" ? options2.parameterLimit : defaults.parameterLimit;
|
|
28714
|
+
options2.strictNullHandling = typeof options2.strictNullHandling === "boolean" ? options2.strictNullHandling : defaults.strictNullHandling;
|
|
28715
28715
|
if (str === "" || str === null || typeof str === "undefined") {
|
|
28716
|
-
return
|
|
28716
|
+
return options2.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
28717
28717
|
}
|
|
28718
|
-
var tempObj = typeof str === "string" ? parseValues(str,
|
|
28719
|
-
var obj =
|
|
28718
|
+
var tempObj = typeof str === "string" ? parseValues(str, options2) : str;
|
|
28719
|
+
var obj = options2.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
28720
28720
|
var keys = Object.keys(tempObj);
|
|
28721
28721
|
for (var i = 0; i < keys.length; ++i) {
|
|
28722
28722
|
var key = keys[i];
|
|
28723
|
-
var newObj = parseKeys(key, tempObj[key],
|
|
28724
|
-
obj = utils.merge(obj, newObj,
|
|
28723
|
+
var newObj = parseKeys(key, tempObj[key], options2);
|
|
28724
|
+
obj = utils.merge(obj, newObj, options2);
|
|
28725
28725
|
}
|
|
28726
28726
|
return utils.compact(obj);
|
|
28727
28727
|
};
|
|
@@ -28756,14 +28756,14 @@ var require_querystring = __commonJS({
|
|
|
28756
28756
|
this.parseOptions = null;
|
|
28757
28757
|
this.stringifyOptions = null;
|
|
28758
28758
|
}
|
|
28759
|
-
Querystring.prototype.init = function(
|
|
28759
|
+
Querystring.prototype.init = function(options2) {
|
|
28760
28760
|
if (this.lib) {
|
|
28761
28761
|
return;
|
|
28762
28762
|
}
|
|
28763
|
-
this.useQuerystring =
|
|
28763
|
+
this.useQuerystring = options2.useQuerystring;
|
|
28764
28764
|
this.lib = this.useQuerystring ? querystring : qs;
|
|
28765
|
-
this.parseOptions =
|
|
28766
|
-
this.stringifyOptions =
|
|
28765
|
+
this.parseOptions = options2.qsParseOptions || {};
|
|
28766
|
+
this.stringifyOptions = options2.qsStringifyOptions || {};
|
|
28767
28767
|
};
|
|
28768
28768
|
Querystring.prototype.stringify = function(obj) {
|
|
28769
28769
|
return this.useQuerystring ? this.rfc3986(this.lib.stringify(
|
|
@@ -29315,10 +29315,10 @@ var require_uri_all = __commonJS({
|
|
|
29315
29315
|
var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
|
|
29316
29316
|
var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === void 0;
|
|
29317
29317
|
function parse(uriString) {
|
|
29318
|
-
var
|
|
29318
|
+
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
29319
29319
|
var components = {};
|
|
29320
|
-
var protocol =
|
|
29321
|
-
if (
|
|
29320
|
+
var protocol = options2.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
29321
|
+
if (options2.reference === "suffix") uriString = (options2.scheme ? options2.scheme + ":" : "") + "//" + uriString;
|
|
29322
29322
|
var matches = uriString.match(URI_PARSE);
|
|
29323
29323
|
if (matches) {
|
|
29324
29324
|
if (NO_MATCH_IS_UNDEFINED) {
|
|
@@ -29356,12 +29356,12 @@ var require_uri_all = __commonJS({
|
|
|
29356
29356
|
} else {
|
|
29357
29357
|
components.reference = "uri";
|
|
29358
29358
|
}
|
|
29359
|
-
if (
|
|
29360
|
-
components.error = components.error || "URI is not a " +
|
|
29359
|
+
if (options2.reference && options2.reference !== "suffix" && options2.reference !== components.reference) {
|
|
29360
|
+
components.error = components.error || "URI is not a " + options2.reference + " reference.";
|
|
29361
29361
|
}
|
|
29362
|
-
var schemeHandler = SCHEMES[(
|
|
29363
|
-
if (!
|
|
29364
|
-
if (components.host && (
|
|
29362
|
+
var schemeHandler = SCHEMES[(options2.scheme || components.scheme || "").toLowerCase()];
|
|
29363
|
+
if (!options2.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
29364
|
+
if (components.host && (options2.domainHost || schemeHandler && schemeHandler.domainHost)) {
|
|
29365
29365
|
try {
|
|
29366
29366
|
components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
|
|
29367
29367
|
} catch (e) {
|
|
@@ -29373,15 +29373,15 @@ var require_uri_all = __commonJS({
|
|
|
29373
29373
|
_normalizeComponentEncoding(components, protocol);
|
|
29374
29374
|
}
|
|
29375
29375
|
if (schemeHandler && schemeHandler.parse) {
|
|
29376
|
-
schemeHandler.parse(components,
|
|
29376
|
+
schemeHandler.parse(components, options2);
|
|
29377
29377
|
}
|
|
29378
29378
|
} else {
|
|
29379
29379
|
components.error = components.error || "URI can not be parsed.";
|
|
29380
29380
|
}
|
|
29381
29381
|
return components;
|
|
29382
29382
|
}
|
|
29383
|
-
function _recomposeAuthority(components,
|
|
29384
|
-
var protocol =
|
|
29383
|
+
function _recomposeAuthority(components, options2) {
|
|
29384
|
+
var protocol = options2.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
29385
29385
|
var uriTokens = [];
|
|
29386
29386
|
if (components.userinfo !== void 0) {
|
|
29387
29387
|
uriTokens.push(components.userinfo);
|
|
@@ -29428,29 +29428,29 @@ var require_uri_all = __commonJS({
|
|
|
29428
29428
|
return output.join("");
|
|
29429
29429
|
}
|
|
29430
29430
|
function serialize(components) {
|
|
29431
|
-
var
|
|
29432
|
-
var protocol =
|
|
29431
|
+
var options2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
29432
|
+
var protocol = options2.iri ? IRI_PROTOCOL : URI_PROTOCOL;
|
|
29433
29433
|
var uriTokens = [];
|
|
29434
|
-
var schemeHandler = SCHEMES[(
|
|
29435
|
-
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components,
|
|
29434
|
+
var schemeHandler = SCHEMES[(options2.scheme || components.scheme || "").toLowerCase()];
|
|
29435
|
+
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options2);
|
|
29436
29436
|
if (components.host) {
|
|
29437
29437
|
if (protocol.IPV6ADDRESS.test(components.host)) {
|
|
29438
|
-
} else if (
|
|
29438
|
+
} else if (options2.domainHost || schemeHandler && schemeHandler.domainHost) {
|
|
29439
29439
|
try {
|
|
29440
|
-
components.host = !
|
|
29440
|
+
components.host = !options2.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
|
|
29441
29441
|
} catch (e) {
|
|
29442
|
-
components.error = components.error || "Host's domain name can not be converted to " + (!
|
|
29442
|
+
components.error = components.error || "Host's domain name can not be converted to " + (!options2.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
29443
29443
|
}
|
|
29444
29444
|
}
|
|
29445
29445
|
}
|
|
29446
29446
|
_normalizeComponentEncoding(components, protocol);
|
|
29447
|
-
if (
|
|
29447
|
+
if (options2.reference !== "suffix" && components.scheme) {
|
|
29448
29448
|
uriTokens.push(components.scheme);
|
|
29449
29449
|
uriTokens.push(":");
|
|
29450
29450
|
}
|
|
29451
|
-
var authority = _recomposeAuthority(components,
|
|
29451
|
+
var authority = _recomposeAuthority(components, options2);
|
|
29452
29452
|
if (authority !== void 0) {
|
|
29453
|
-
if (
|
|
29453
|
+
if (options2.reference !== "suffix") {
|
|
29454
29454
|
uriTokens.push("//");
|
|
29455
29455
|
}
|
|
29456
29456
|
uriTokens.push(authority);
|
|
@@ -29460,7 +29460,7 @@ var require_uri_all = __commonJS({
|
|
|
29460
29460
|
}
|
|
29461
29461
|
if (components.path !== void 0) {
|
|
29462
29462
|
var s = components.path;
|
|
29463
|
-
if (!
|
|
29463
|
+
if (!options2.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
29464
29464
|
s = removeDotSegments(s);
|
|
29465
29465
|
}
|
|
29466
29466
|
if (authority === void 0) {
|
|
@@ -29479,15 +29479,15 @@ var require_uri_all = __commonJS({
|
|
|
29479
29479
|
return uriTokens.join("");
|
|
29480
29480
|
}
|
|
29481
29481
|
function resolveComponents(base2, relative) {
|
|
29482
|
-
var
|
|
29482
|
+
var options2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
29483
29483
|
var skipNormalization = arguments[3];
|
|
29484
29484
|
var target = {};
|
|
29485
29485
|
if (!skipNormalization) {
|
|
29486
|
-
base2 = parse(serialize(base2,
|
|
29487
|
-
relative = parse(serialize(relative,
|
|
29486
|
+
base2 = parse(serialize(base2, options2), options2);
|
|
29487
|
+
relative = parse(serialize(relative, options2), options2);
|
|
29488
29488
|
}
|
|
29489
|
-
|
|
29490
|
-
if (!
|
|
29489
|
+
options2 = options2 || {};
|
|
29490
|
+
if (!options2.tolerant && relative.scheme) {
|
|
29491
29491
|
target.scheme = relative.scheme;
|
|
29492
29492
|
target.userinfo = relative.userinfo;
|
|
29493
29493
|
target.host = relative.host;
|
|
@@ -29533,47 +29533,47 @@ var require_uri_all = __commonJS({
|
|
|
29533
29533
|
target.fragment = relative.fragment;
|
|
29534
29534
|
return target;
|
|
29535
29535
|
}
|
|
29536
|
-
function resolve(baseURI, relativeURI,
|
|
29537
|
-
var schemelessOptions = assign({ scheme: "null" },
|
|
29536
|
+
function resolve(baseURI, relativeURI, options2) {
|
|
29537
|
+
var schemelessOptions = assign({ scheme: "null" }, options2);
|
|
29538
29538
|
return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
|
|
29539
29539
|
}
|
|
29540
|
-
function normalize(uri,
|
|
29540
|
+
function normalize(uri, options2) {
|
|
29541
29541
|
if (typeof uri === "string") {
|
|
29542
|
-
uri = serialize(parse(uri,
|
|
29542
|
+
uri = serialize(parse(uri, options2), options2);
|
|
29543
29543
|
} else if (typeOf(uri) === "object") {
|
|
29544
|
-
uri = parse(serialize(uri,
|
|
29544
|
+
uri = parse(serialize(uri, options2), options2);
|
|
29545
29545
|
}
|
|
29546
29546
|
return uri;
|
|
29547
29547
|
}
|
|
29548
|
-
function equal(uriA, uriB,
|
|
29548
|
+
function equal(uriA, uriB, options2) {
|
|
29549
29549
|
if (typeof uriA === "string") {
|
|
29550
|
-
uriA = serialize(parse(uriA,
|
|
29550
|
+
uriA = serialize(parse(uriA, options2), options2);
|
|
29551
29551
|
} else if (typeOf(uriA) === "object") {
|
|
29552
|
-
uriA = serialize(uriA,
|
|
29552
|
+
uriA = serialize(uriA, options2);
|
|
29553
29553
|
}
|
|
29554
29554
|
if (typeof uriB === "string") {
|
|
29555
|
-
uriB = serialize(parse(uriB,
|
|
29555
|
+
uriB = serialize(parse(uriB, options2), options2);
|
|
29556
29556
|
} else if (typeOf(uriB) === "object") {
|
|
29557
|
-
uriB = serialize(uriB,
|
|
29557
|
+
uriB = serialize(uriB, options2);
|
|
29558
29558
|
}
|
|
29559
29559
|
return uriA === uriB;
|
|
29560
29560
|
}
|
|
29561
|
-
function escapeComponent(str,
|
|
29562
|
-
return str && str.toString().replace(!
|
|
29561
|
+
function escapeComponent(str, options2) {
|
|
29562
|
+
return str && str.toString().replace(!options2 || !options2.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
|
|
29563
29563
|
}
|
|
29564
|
-
function unescapeComponent(str,
|
|
29565
|
-
return str && str.toString().replace(!
|
|
29564
|
+
function unescapeComponent(str, options2) {
|
|
29565
|
+
return str && str.toString().replace(!options2 || !options2.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
|
|
29566
29566
|
}
|
|
29567
29567
|
var handler = {
|
|
29568
29568
|
scheme: "http",
|
|
29569
29569
|
domainHost: true,
|
|
29570
|
-
parse: function parse2(components,
|
|
29570
|
+
parse: function parse2(components, options2) {
|
|
29571
29571
|
if (!components.host) {
|
|
29572
29572
|
components.error = components.error || "HTTP URIs must have a host.";
|
|
29573
29573
|
}
|
|
29574
29574
|
return components;
|
|
29575
29575
|
},
|
|
29576
|
-
serialize: function serialize2(components,
|
|
29576
|
+
serialize: function serialize2(components, options2) {
|
|
29577
29577
|
var secure = String(components.scheme).toLowerCase() === "https";
|
|
29578
29578
|
if (components.port === (secure ? 443 : 80) || components.port === "") {
|
|
29579
29579
|
components.port = void 0;
|
|
@@ -29596,7 +29596,7 @@ var require_uri_all = __commonJS({
|
|
|
29596
29596
|
var handler$2 = {
|
|
29597
29597
|
scheme: "ws",
|
|
29598
29598
|
domainHost: true,
|
|
29599
|
-
parse: function parse2(components,
|
|
29599
|
+
parse: function parse2(components, options2) {
|
|
29600
29600
|
var wsComponents = components;
|
|
29601
29601
|
wsComponents.secure = isSecure(wsComponents);
|
|
29602
29602
|
wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
|
|
@@ -29604,7 +29604,7 @@ var require_uri_all = __commonJS({
|
|
|
29604
29604
|
wsComponents.query = void 0;
|
|
29605
29605
|
return wsComponents;
|
|
29606
29606
|
},
|
|
29607
|
-
serialize: function serialize2(wsComponents,
|
|
29607
|
+
serialize: function serialize2(wsComponents, options2) {
|
|
29608
29608
|
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
|
|
29609
29609
|
wsComponents.port = void 0;
|
|
29610
29610
|
}
|
|
@@ -29648,7 +29648,7 @@ var require_uri_all = __commonJS({
|
|
|
29648
29648
|
}
|
|
29649
29649
|
var handler$4 = {
|
|
29650
29650
|
scheme: "mailto",
|
|
29651
|
-
parse: function parse$$1(components,
|
|
29651
|
+
parse: function parse$$1(components, options2) {
|
|
29652
29652
|
var mailtoComponents = components;
|
|
29653
29653
|
var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
|
|
29654
29654
|
mailtoComponents.path = void 0;
|
|
@@ -29666,14 +29666,14 @@ var require_uri_all = __commonJS({
|
|
|
29666
29666
|
}
|
|
29667
29667
|
break;
|
|
29668
29668
|
case "subject":
|
|
29669
|
-
mailtoComponents.subject = unescapeComponent(hfield[1],
|
|
29669
|
+
mailtoComponents.subject = unescapeComponent(hfield[1], options2);
|
|
29670
29670
|
break;
|
|
29671
29671
|
case "body":
|
|
29672
|
-
mailtoComponents.body = unescapeComponent(hfield[1],
|
|
29672
|
+
mailtoComponents.body = unescapeComponent(hfield[1], options2);
|
|
29673
29673
|
break;
|
|
29674
29674
|
default:
|
|
29675
29675
|
unknownHeaders = true;
|
|
29676
|
-
headers[unescapeComponent(hfield[0],
|
|
29676
|
+
headers[unescapeComponent(hfield[0], options2)] = unescapeComponent(hfield[1], options2);
|
|
29677
29677
|
break;
|
|
29678
29678
|
}
|
|
29679
29679
|
}
|
|
@@ -29683,20 +29683,20 @@ var require_uri_all = __commonJS({
|
|
|
29683
29683
|
for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
|
|
29684
29684
|
var addr = to[_x2].split("@");
|
|
29685
29685
|
addr[0] = unescapeComponent(addr[0]);
|
|
29686
|
-
if (!
|
|
29686
|
+
if (!options2.unicodeSupport) {
|
|
29687
29687
|
try {
|
|
29688
|
-
addr[1] = punycode.toASCII(unescapeComponent(addr[1],
|
|
29688
|
+
addr[1] = punycode.toASCII(unescapeComponent(addr[1], options2).toLowerCase());
|
|
29689
29689
|
} catch (e) {
|
|
29690
29690
|
mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
|
|
29691
29691
|
}
|
|
29692
29692
|
} else {
|
|
29693
|
-
addr[1] = unescapeComponent(addr[1],
|
|
29693
|
+
addr[1] = unescapeComponent(addr[1], options2).toLowerCase();
|
|
29694
29694
|
}
|
|
29695
29695
|
to[_x2] = addr.join("@");
|
|
29696
29696
|
}
|
|
29697
29697
|
return mailtoComponents;
|
|
29698
29698
|
},
|
|
29699
|
-
serialize: function serialize$$1(mailtoComponents,
|
|
29699
|
+
serialize: function serialize$$1(mailtoComponents, options2) {
|
|
29700
29700
|
var components = mailtoComponents;
|
|
29701
29701
|
var to = toArray(mailtoComponents.to);
|
|
29702
29702
|
if (to) {
|
|
@@ -29706,9 +29706,9 @@ var require_uri_all = __commonJS({
|
|
|
29706
29706
|
var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
|
|
29707
29707
|
var domain = toAddr.slice(atIdx + 1);
|
|
29708
29708
|
try {
|
|
29709
|
-
domain = !
|
|
29709
|
+
domain = !options2.iri ? punycode.toASCII(unescapeComponent(domain, options2).toLowerCase()) : punycode.toUnicode(domain);
|
|
29710
29710
|
} catch (e) {
|
|
29711
|
-
components.error = components.error || "Email address's domain name can not be converted to " + (!
|
|
29711
|
+
components.error = components.error || "Email address's domain name can not be converted to " + (!options2.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
|
|
29712
29712
|
}
|
|
29713
29713
|
to[x] = localPart + "@" + domain;
|
|
29714
29714
|
}
|
|
@@ -29732,53 +29732,53 @@ var require_uri_all = __commonJS({
|
|
|
29732
29732
|
var URN_PARSE = /^([^\:]+)\:(.*)/;
|
|
29733
29733
|
var handler$5 = {
|
|
29734
29734
|
scheme: "urn",
|
|
29735
|
-
parse: function parse$$1(components,
|
|
29735
|
+
parse: function parse$$1(components, options2) {
|
|
29736
29736
|
var matches = components.path && components.path.match(URN_PARSE);
|
|
29737
29737
|
var urnComponents = components;
|
|
29738
29738
|
if (matches) {
|
|
29739
|
-
var scheme =
|
|
29739
|
+
var scheme = options2.scheme || urnComponents.scheme || "urn";
|
|
29740
29740
|
var nid = matches[1].toLowerCase();
|
|
29741
29741
|
var nss = matches[2];
|
|
29742
|
-
var urnScheme = scheme + ":" + (
|
|
29742
|
+
var urnScheme = scheme + ":" + (options2.nid || nid);
|
|
29743
29743
|
var schemeHandler = SCHEMES[urnScheme];
|
|
29744
29744
|
urnComponents.nid = nid;
|
|
29745
29745
|
urnComponents.nss = nss;
|
|
29746
29746
|
urnComponents.path = void 0;
|
|
29747
29747
|
if (schemeHandler) {
|
|
29748
|
-
urnComponents = schemeHandler.parse(urnComponents,
|
|
29748
|
+
urnComponents = schemeHandler.parse(urnComponents, options2);
|
|
29749
29749
|
}
|
|
29750
29750
|
} else {
|
|
29751
29751
|
urnComponents.error = urnComponents.error || "URN can not be parsed.";
|
|
29752
29752
|
}
|
|
29753
29753
|
return urnComponents;
|
|
29754
29754
|
},
|
|
29755
|
-
serialize: function serialize$$1(urnComponents,
|
|
29756
|
-
var scheme =
|
|
29755
|
+
serialize: function serialize$$1(urnComponents, options2) {
|
|
29756
|
+
var scheme = options2.scheme || urnComponents.scheme || "urn";
|
|
29757
29757
|
var nid = urnComponents.nid;
|
|
29758
|
-
var urnScheme = scheme + ":" + (
|
|
29758
|
+
var urnScheme = scheme + ":" + (options2.nid || nid);
|
|
29759
29759
|
var schemeHandler = SCHEMES[urnScheme];
|
|
29760
29760
|
if (schemeHandler) {
|
|
29761
|
-
urnComponents = schemeHandler.serialize(urnComponents,
|
|
29761
|
+
urnComponents = schemeHandler.serialize(urnComponents, options2);
|
|
29762
29762
|
}
|
|
29763
29763
|
var uriComponents = urnComponents;
|
|
29764
29764
|
var nss = urnComponents.nss;
|
|
29765
|
-
uriComponents.path = (nid ||
|
|
29765
|
+
uriComponents.path = (nid || options2.nid) + ":" + nss;
|
|
29766
29766
|
return uriComponents;
|
|
29767
29767
|
}
|
|
29768
29768
|
};
|
|
29769
29769
|
var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
|
|
29770
29770
|
var handler$6 = {
|
|
29771
29771
|
scheme: "urn:uuid",
|
|
29772
|
-
parse: function parse2(urnComponents,
|
|
29772
|
+
parse: function parse2(urnComponents, options2) {
|
|
29773
29773
|
var uuidComponents = urnComponents;
|
|
29774
29774
|
uuidComponents.uuid = uuidComponents.nss;
|
|
29775
29775
|
uuidComponents.nss = void 0;
|
|
29776
|
-
if (!
|
|
29776
|
+
if (!options2.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
|
|
29777
29777
|
uuidComponents.error = uuidComponents.error || "UUID is not valid.";
|
|
29778
29778
|
}
|
|
29779
29779
|
return uuidComponents;
|
|
29780
29780
|
},
|
|
29781
|
-
serialize: function serialize2(uuidComponents,
|
|
29781
|
+
serialize: function serialize2(uuidComponents, options2) {
|
|
29782
29782
|
var urnComponents = uuidComponents;
|
|
29783
29783
|
urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
|
|
29784
29784
|
return urnComponents;
|
|
@@ -31104,11 +31104,11 @@ var require_compile = __commonJS({
|
|
|
31104
31104
|
}
|
|
31105
31105
|
function useCustomRule(rule, schema2, parentSchema, it) {
|
|
31106
31106
|
if (self2._opts.validateSchema !== false) {
|
|
31107
|
-
var
|
|
31108
|
-
if (
|
|
31107
|
+
var deps2 = rule.definition.dependencies;
|
|
31108
|
+
if (deps2 && !deps2.every(function(keyword) {
|
|
31109
31109
|
return Object.prototype.hasOwnProperty.call(parentSchema, keyword);
|
|
31110
31110
|
}))
|
|
31111
|
-
throw new Error("parent schema must have all required keywords: " +
|
|
31111
|
+
throw new Error("parent schema must have all required keywords: " + deps2.join(","));
|
|
31112
31112
|
var validateSchema = rule.definition.validateSchema;
|
|
31113
31113
|
if (validateSchema) {
|
|
31114
31114
|
var valid = validateSchema(schema2);
|
|
@@ -34933,12 +34933,12 @@ var require_ajv = __commonJS({
|
|
|
34933
34933
|
throw new Error("schema $id is different from id");
|
|
34934
34934
|
return schema.$id || schema.id;
|
|
34935
34935
|
}
|
|
34936
|
-
function errorsText(errors,
|
|
34936
|
+
function errorsText(errors, options2) {
|
|
34937
34937
|
errors = errors || this.errors;
|
|
34938
34938
|
if (!errors) return "No errors";
|
|
34939
|
-
|
|
34940
|
-
var separator =
|
|
34941
|
-
var dataVar =
|
|
34939
|
+
options2 = options2 || {};
|
|
34940
|
+
var separator = options2.separator === void 0 ? ", " : options2.separator;
|
|
34941
|
+
var dataVar = options2.dataVar === void 0 ? "data" : options2.dataVar;
|
|
34942
34942
|
var text = "";
|
|
34943
34943
|
for (var i = 0; i < errors.length; i++) {
|
|
34944
34944
|
var e = errors[i];
|
|
@@ -36060,16 +36060,16 @@ var require_har2 = __commonJS({
|
|
|
36060
36060
|
}
|
|
36061
36061
|
return data;
|
|
36062
36062
|
};
|
|
36063
|
-
Har.prototype.options = function(
|
|
36064
|
-
if (!
|
|
36065
|
-
return
|
|
36063
|
+
Har.prototype.options = function(options2) {
|
|
36064
|
+
if (!options2.har) {
|
|
36065
|
+
return options2;
|
|
36066
36066
|
}
|
|
36067
36067
|
var har = {};
|
|
36068
|
-
extend(har,
|
|
36068
|
+
extend(har, options2.har);
|
|
36069
36069
|
if (har.log && har.log.entries) {
|
|
36070
36070
|
har = har.log.entries[0];
|
|
36071
36071
|
}
|
|
36072
|
-
har.url = har.url ||
|
|
36072
|
+
har.url = har.url || options2.url || options2.uri || options2.baseUrl || "/";
|
|
36073
36073
|
har.httpVersion = har.httpVersion || "HTTP/1.1";
|
|
36074
36074
|
har.queryString = har.queryString || [];
|
|
36075
36075
|
har.headers = har.headers || [];
|
|
@@ -36080,37 +36080,37 @@ var require_har2 = __commonJS({
|
|
|
36080
36080
|
har.headersSize = 0;
|
|
36081
36081
|
har.postData.size = 0;
|
|
36082
36082
|
if (!validate.request(har)) {
|
|
36083
|
-
return
|
|
36083
|
+
return options2;
|
|
36084
36084
|
}
|
|
36085
36085
|
var req = this.prep(har);
|
|
36086
36086
|
if (req.url) {
|
|
36087
|
-
|
|
36087
|
+
options2.url = req.url;
|
|
36088
36088
|
}
|
|
36089
36089
|
if (req.method) {
|
|
36090
|
-
|
|
36090
|
+
options2.method = req.method;
|
|
36091
36091
|
}
|
|
36092
36092
|
if (Object.keys(req.queryObj).length) {
|
|
36093
|
-
|
|
36093
|
+
options2.qs = req.queryObj;
|
|
36094
36094
|
}
|
|
36095
36095
|
if (Object.keys(req.headersObj).length) {
|
|
36096
|
-
|
|
36096
|
+
options2.headers = req.headersObj;
|
|
36097
36097
|
}
|
|
36098
36098
|
function test(type) {
|
|
36099
36099
|
return req.postData.mimeType.indexOf(type) === 0;
|
|
36100
36100
|
}
|
|
36101
36101
|
if (test("application/x-www-form-urlencoded")) {
|
|
36102
|
-
|
|
36102
|
+
options2.form = req.postData.paramsObj;
|
|
36103
36103
|
} else if (test("application/json")) {
|
|
36104
36104
|
if (req.postData.jsonObj) {
|
|
36105
|
-
|
|
36106
|
-
|
|
36105
|
+
options2.body = req.postData.jsonObj;
|
|
36106
|
+
options2.json = true;
|
|
36107
36107
|
}
|
|
36108
36108
|
} else if (test("multipart/form-data")) {
|
|
36109
|
-
|
|
36109
|
+
options2.formData = {};
|
|
36110
36110
|
req.postData.params.forEach(function(param) {
|
|
36111
36111
|
var attachment = {};
|
|
36112
36112
|
if (!param.fileName && !param.contentType) {
|
|
36113
|
-
|
|
36113
|
+
options2.formData[param.name] = param.value;
|
|
36114
36114
|
return;
|
|
36115
36115
|
}
|
|
36116
36116
|
if (param.fileName && !param.value) {
|
|
@@ -36124,14 +36124,14 @@ var require_har2 = __commonJS({
|
|
|
36124
36124
|
contentType: param.contentType ? param.contentType : null
|
|
36125
36125
|
};
|
|
36126
36126
|
}
|
|
36127
|
-
|
|
36127
|
+
options2.formData[param.name] = attachment;
|
|
36128
36128
|
});
|
|
36129
36129
|
} else {
|
|
36130
36130
|
if (req.postData.text) {
|
|
36131
|
-
|
|
36131
|
+
options2.body = req.postData.text;
|
|
36132
36132
|
}
|
|
36133
36133
|
}
|
|
36134
|
-
return
|
|
36134
|
+
return options2;
|
|
36135
36135
|
};
|
|
36136
36136
|
exports2.Har = Har;
|
|
36137
36137
|
}
|
|
@@ -36190,14 +36190,14 @@ var require_v4 = __commonJS({
|
|
|
36190
36190
|
"node_modules/uuid/v4.js"(exports2, module2) {
|
|
36191
36191
|
var rng = require_rng();
|
|
36192
36192
|
var bytesToUuid = require_bytesToUuid();
|
|
36193
|
-
function v4(
|
|
36193
|
+
function v4(options2, buf, offset) {
|
|
36194
36194
|
var i = buf && offset || 0;
|
|
36195
|
-
if (typeof
|
|
36196
|
-
buf =
|
|
36197
|
-
|
|
36195
|
+
if (typeof options2 == "string") {
|
|
36196
|
+
buf = options2 === "binary" ? new Array(16) : null;
|
|
36197
|
+
options2 = null;
|
|
36198
36198
|
}
|
|
36199
|
-
|
|
36200
|
-
var rnds =
|
|
36199
|
+
options2 = options2 || {};
|
|
36200
|
+
var rnds = options2.random || (options2.rng || rng)();
|
|
36201
36201
|
rnds[6] = rnds[6] & 15 | 64;
|
|
36202
36202
|
rnds[8] = rnds[8] & 63 | 128;
|
|
36203
36203
|
if (buf) {
|
|
@@ -36658,15 +36658,15 @@ var require_multipart = __commonJS({
|
|
|
36658
36658
|
this.chunked = false;
|
|
36659
36659
|
this.body = null;
|
|
36660
36660
|
}
|
|
36661
|
-
Multipart.prototype.isChunked = function(
|
|
36661
|
+
Multipart.prototype.isChunked = function(options2) {
|
|
36662
36662
|
var self2 = this;
|
|
36663
36663
|
var chunked = false;
|
|
36664
|
-
var parts =
|
|
36664
|
+
var parts = options2.data || options2;
|
|
36665
36665
|
if (!parts.forEach) {
|
|
36666
36666
|
self2.request.emit("error", new Error("Argument error, options.multipart."));
|
|
36667
36667
|
}
|
|
36668
|
-
if (
|
|
36669
|
-
chunked =
|
|
36668
|
+
if (options2.chunked !== void 0) {
|
|
36669
|
+
chunked = options2.chunked;
|
|
36670
36670
|
}
|
|
36671
36671
|
if (self2.request.getHeader("transfer-encoding") === "chunked") {
|
|
36672
36672
|
chunked = true;
|
|
@@ -36730,10 +36730,10 @@ var require_multipart = __commonJS({
|
|
|
36730
36730
|
}
|
|
36731
36731
|
return body;
|
|
36732
36732
|
};
|
|
36733
|
-
Multipart.prototype.onRequest = function(
|
|
36733
|
+
Multipart.prototype.onRequest = function(options2) {
|
|
36734
36734
|
var self2 = this;
|
|
36735
|
-
var chunked = self2.isChunked(
|
|
36736
|
-
var parts =
|
|
36735
|
+
var chunked = self2.isChunked(options2);
|
|
36736
|
+
var parts = options2.data || options2;
|
|
36737
36737
|
self2.setHeaders(chunked);
|
|
36738
36738
|
self2.chunked = chunked;
|
|
36739
36739
|
self2.body = self2.build(parts, chunked);
|
|
@@ -36762,28 +36762,28 @@ var require_redirect = __commonJS({
|
|
|
36762
36762
|
this.redirectsFollowed = 0;
|
|
36763
36763
|
this.removeRefererHeader = false;
|
|
36764
36764
|
}
|
|
36765
|
-
Redirect.prototype.onRequest = function(
|
|
36765
|
+
Redirect.prototype.onRequest = function(options2) {
|
|
36766
36766
|
var self2 = this;
|
|
36767
|
-
if (
|
|
36768
|
-
self2.maxRedirects =
|
|
36767
|
+
if (options2.maxRedirects !== void 0) {
|
|
36768
|
+
self2.maxRedirects = options2.maxRedirects;
|
|
36769
36769
|
}
|
|
36770
|
-
if (typeof
|
|
36771
|
-
self2.allowRedirect =
|
|
36770
|
+
if (typeof options2.followRedirect === "function") {
|
|
36771
|
+
self2.allowRedirect = options2.followRedirect;
|
|
36772
36772
|
}
|
|
36773
|
-
if (
|
|
36774
|
-
self2.followRedirects = !!
|
|
36773
|
+
if (options2.followRedirect !== void 0) {
|
|
36774
|
+
self2.followRedirects = !!options2.followRedirect;
|
|
36775
36775
|
}
|
|
36776
|
-
if (
|
|
36777
|
-
self2.followAllRedirects =
|
|
36776
|
+
if (options2.followAllRedirects !== void 0) {
|
|
36777
|
+
self2.followAllRedirects = options2.followAllRedirects;
|
|
36778
36778
|
}
|
|
36779
36779
|
if (self2.followRedirects || self2.followAllRedirects) {
|
|
36780
36780
|
self2.redirects = self2.redirects || [];
|
|
36781
36781
|
}
|
|
36782
|
-
if (
|
|
36783
|
-
self2.removeRefererHeader =
|
|
36782
|
+
if (options2.removeRefererHeader !== void 0) {
|
|
36783
|
+
self2.removeRefererHeader = options2.removeRefererHeader;
|
|
36784
36784
|
}
|
|
36785
|
-
if (
|
|
36786
|
-
self2.followOriginalHttpMethod =
|
|
36785
|
+
if (options2.followOriginalHttpMethod !== void 0) {
|
|
36786
|
+
self2.followOriginalHttpMethod = options2.followOriginalHttpMethod;
|
|
36787
36787
|
}
|
|
36788
36788
|
};
|
|
36789
36789
|
Redirect.prototype.redirectTo = function(response) {
|
|
@@ -36886,33 +36886,33 @@ var require_tunnel_agent = __commonJS({
|
|
|
36886
36886
|
exports2.httpsOverHttp = httpsOverHttp;
|
|
36887
36887
|
exports2.httpOverHttps = httpOverHttps;
|
|
36888
36888
|
exports2.httpsOverHttps = httpsOverHttps;
|
|
36889
|
-
function httpOverHttp(
|
|
36890
|
-
var agent = new TunnelingAgent(
|
|
36889
|
+
function httpOverHttp(options2) {
|
|
36890
|
+
var agent = new TunnelingAgent(options2);
|
|
36891
36891
|
agent.request = http.request;
|
|
36892
36892
|
return agent;
|
|
36893
36893
|
}
|
|
36894
|
-
function httpsOverHttp(
|
|
36895
|
-
var agent = new TunnelingAgent(
|
|
36894
|
+
function httpsOverHttp(options2) {
|
|
36895
|
+
var agent = new TunnelingAgent(options2);
|
|
36896
36896
|
agent.request = http.request;
|
|
36897
36897
|
agent.createSocket = createSecureSocket;
|
|
36898
36898
|
agent.defaultPort = 443;
|
|
36899
36899
|
return agent;
|
|
36900
36900
|
}
|
|
36901
|
-
function httpOverHttps(
|
|
36902
|
-
var agent = new TunnelingAgent(
|
|
36901
|
+
function httpOverHttps(options2) {
|
|
36902
|
+
var agent = new TunnelingAgent(options2);
|
|
36903
36903
|
agent.request = https.request;
|
|
36904
36904
|
return agent;
|
|
36905
36905
|
}
|
|
36906
|
-
function httpsOverHttps(
|
|
36907
|
-
var agent = new TunnelingAgent(
|
|
36906
|
+
function httpsOverHttps(options2) {
|
|
36907
|
+
var agent = new TunnelingAgent(options2);
|
|
36908
36908
|
agent.request = https.request;
|
|
36909
36909
|
agent.createSocket = createSecureSocket;
|
|
36910
36910
|
agent.defaultPort = 443;
|
|
36911
36911
|
return agent;
|
|
36912
36912
|
}
|
|
36913
|
-
function TunnelingAgent(
|
|
36913
|
+
function TunnelingAgent(options2) {
|
|
36914
36914
|
var self2 = this;
|
|
36915
|
-
self2.options =
|
|
36915
|
+
self2.options = options2 || {};
|
|
36916
36916
|
self2.proxyOptions = self2.options.proxy || {};
|
|
36917
36917
|
self2.maxSockets = self2.options.maxSockets || http.Agent.defaultMaxSockets;
|
|
36918
36918
|
self2.requests = [];
|
|
@@ -36931,20 +36931,20 @@ var require_tunnel_agent = __commonJS({
|
|
|
36931
36931
|
});
|
|
36932
36932
|
}
|
|
36933
36933
|
util.inherits(TunnelingAgent, events.EventEmitter);
|
|
36934
|
-
TunnelingAgent.prototype.addRequest = function addRequest(req,
|
|
36934
|
+
TunnelingAgent.prototype.addRequest = function addRequest(req, options2) {
|
|
36935
36935
|
var self2 = this;
|
|
36936
|
-
if (typeof
|
|
36937
|
-
|
|
36938
|
-
host:
|
|
36936
|
+
if (typeof options2 === "string") {
|
|
36937
|
+
options2 = {
|
|
36938
|
+
host: options2,
|
|
36939
36939
|
port: arguments[2],
|
|
36940
36940
|
path: arguments[3]
|
|
36941
36941
|
};
|
|
36942
36942
|
}
|
|
36943
36943
|
if (self2.sockets.length >= this.maxSockets) {
|
|
36944
|
-
self2.requests.push({ host:
|
|
36944
|
+
self2.requests.push({ host: options2.host, port: options2.port, request: req });
|
|
36945
36945
|
return;
|
|
36946
36946
|
}
|
|
36947
|
-
self2.createConnection({ host:
|
|
36947
|
+
self2.createConnection({ host: options2.host, port: options2.port, request: req });
|
|
36948
36948
|
};
|
|
36949
36949
|
TunnelingAgent.prototype.createConnection = function createConnection(pending) {
|
|
36950
36950
|
var self2 = this;
|
|
@@ -36964,7 +36964,7 @@ var require_tunnel_agent = __commonJS({
|
|
|
36964
36964
|
}
|
|
36965
36965
|
});
|
|
36966
36966
|
};
|
|
36967
|
-
TunnelingAgent.prototype.createSocket = function createSocket(
|
|
36967
|
+
TunnelingAgent.prototype.createSocket = function createSocket(options2, cb) {
|
|
36968
36968
|
var self2 = this;
|
|
36969
36969
|
var placeholder = {};
|
|
36970
36970
|
self2.sockets.push(placeholder);
|
|
@@ -36973,7 +36973,7 @@ var require_tunnel_agent = __commonJS({
|
|
|
36973
36973
|
self2.proxyOptions,
|
|
36974
36974
|
{
|
|
36975
36975
|
method: "CONNECT",
|
|
36976
|
-
path:
|
|
36976
|
+
path: options2.host + ":" + options2.port,
|
|
36977
36977
|
agent: false
|
|
36978
36978
|
}
|
|
36979
36979
|
);
|
|
@@ -37009,7 +37009,7 @@ var require_tunnel_agent = __commonJS({
|
|
|
37009
37009
|
debug("tunneling socket could not be established, statusCode=%d", res.statusCode);
|
|
37010
37010
|
var error = new Error("tunneling socket could not be established, statusCode=" + res.statusCode);
|
|
37011
37011
|
error.code = "ECONNRESET";
|
|
37012
|
-
|
|
37012
|
+
options2.request.emit("error", error);
|
|
37013
37013
|
self2.removeSocket(placeholder);
|
|
37014
37014
|
}
|
|
37015
37015
|
}
|
|
@@ -37018,7 +37018,7 @@ var require_tunnel_agent = __commonJS({
|
|
|
37018
37018
|
debug("tunneling socket could not be established, cause=%s\n", cause.message, cause.stack);
|
|
37019
37019
|
var error = new Error("tunneling socket could not be established, cause=" + cause.message);
|
|
37020
37020
|
error.code = "ECONNRESET";
|
|
37021
|
-
|
|
37021
|
+
options2.request.emit("error", error);
|
|
37022
37022
|
self2.removeSocket(placeholder);
|
|
37023
37023
|
}
|
|
37024
37024
|
};
|
|
@@ -37031,14 +37031,14 @@ var require_tunnel_agent = __commonJS({
|
|
|
37031
37031
|
this.createConnection(pending);
|
|
37032
37032
|
}
|
|
37033
37033
|
};
|
|
37034
|
-
function createSecureSocket(
|
|
37034
|
+
function createSecureSocket(options2, cb) {
|
|
37035
37035
|
var self2 = this;
|
|
37036
|
-
TunnelingAgent.prototype.createSocket.call(self2,
|
|
37036
|
+
TunnelingAgent.prototype.createSocket.call(self2, options2, function(socket) {
|
|
37037
37037
|
var secureSocket = tls.connect(0, mergeOptions(
|
|
37038
37038
|
{},
|
|
37039
37039
|
self2.options,
|
|
37040
37040
|
{
|
|
37041
|
-
servername:
|
|
37041
|
+
servername: options2.host,
|
|
37042
37042
|
socket
|
|
37043
37043
|
}
|
|
37044
37044
|
));
|
|
@@ -37189,21 +37189,21 @@ var require_tunnel = __commonJS({
|
|
|
37189
37189
|
}
|
|
37190
37190
|
return false;
|
|
37191
37191
|
};
|
|
37192
|
-
Tunnel.prototype.setup = function(
|
|
37192
|
+
Tunnel.prototype.setup = function(options2) {
|
|
37193
37193
|
var self2 = this;
|
|
37194
37194
|
var request2 = self2.request;
|
|
37195
|
-
|
|
37195
|
+
options2 = options2 || {};
|
|
37196
37196
|
if (typeof request2.proxy === "string") {
|
|
37197
37197
|
request2.proxy = url.parse(request2.proxy);
|
|
37198
37198
|
}
|
|
37199
37199
|
if (!request2.proxy || !request2.tunnel) {
|
|
37200
37200
|
return false;
|
|
37201
37201
|
}
|
|
37202
|
-
if (
|
|
37203
|
-
self2.proxyHeaderWhiteList =
|
|
37202
|
+
if (options2.proxyHeaderWhiteList) {
|
|
37203
|
+
self2.proxyHeaderWhiteList = options2.proxyHeaderWhiteList;
|
|
37204
37204
|
}
|
|
37205
|
-
if (
|
|
37206
|
-
self2.proxyHeaderExclusiveList =
|
|
37205
|
+
if (options2.proxyHeaderExclusiveList) {
|
|
37206
|
+
self2.proxyHeaderExclusiveList = options2.proxyHeaderExclusiveList;
|
|
37207
37207
|
}
|
|
37208
37208
|
var proxyHeaderExclusiveList = self2.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList);
|
|
37209
37209
|
var proxyHeaderWhiteList = self2.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList);
|
|
@@ -37299,23 +37299,23 @@ var require_request2 = __commonJS({
|
|
|
37299
37299
|
var version = helpers.version;
|
|
37300
37300
|
var globalCookieJar = cookies.jar();
|
|
37301
37301
|
var globalPool = {};
|
|
37302
|
-
function filterForNonReserved(reserved,
|
|
37302
|
+
function filterForNonReserved(reserved, options2) {
|
|
37303
37303
|
var object = {};
|
|
37304
|
-
for (var i in
|
|
37304
|
+
for (var i in options2) {
|
|
37305
37305
|
var notReserved = reserved.indexOf(i) === -1;
|
|
37306
37306
|
if (notReserved) {
|
|
37307
|
-
object[i] =
|
|
37307
|
+
object[i] = options2[i];
|
|
37308
37308
|
}
|
|
37309
37309
|
}
|
|
37310
37310
|
return object;
|
|
37311
37311
|
}
|
|
37312
|
-
function filterOutReservedFunctions(reserved,
|
|
37312
|
+
function filterOutReservedFunctions(reserved, options2) {
|
|
37313
37313
|
var object = {};
|
|
37314
|
-
for (var i in
|
|
37314
|
+
for (var i in options2) {
|
|
37315
37315
|
var isReserved = !(reserved.indexOf(i) === -1);
|
|
37316
|
-
var isFunction = typeof
|
|
37316
|
+
var isFunction = typeof options2[i] === "function";
|
|
37317
37317
|
if (!(isReserved && isFunction)) {
|
|
37318
|
-
object[i] =
|
|
37318
|
+
object[i] = options2[i];
|
|
37319
37319
|
}
|
|
37320
37320
|
}
|
|
37321
37321
|
return object;
|
|
@@ -37337,20 +37337,20 @@ var require_request2 = __commonJS({
|
|
|
37337
37337
|
request: requestToJSON.call(self2.request)
|
|
37338
37338
|
};
|
|
37339
37339
|
}
|
|
37340
|
-
function Request(
|
|
37340
|
+
function Request(options2) {
|
|
37341
37341
|
var self2 = this;
|
|
37342
|
-
if (
|
|
37342
|
+
if (options2.har) {
|
|
37343
37343
|
self2._har = new Har(self2);
|
|
37344
|
-
|
|
37344
|
+
options2 = self2._har.options(options2);
|
|
37345
37345
|
}
|
|
37346
37346
|
stream.Stream.call(self2);
|
|
37347
37347
|
var reserved = Object.keys(Request.prototype);
|
|
37348
|
-
var nonReserved = filterForNonReserved(reserved,
|
|
37348
|
+
var nonReserved = filterForNonReserved(reserved, options2);
|
|
37349
37349
|
extend(self2, nonReserved);
|
|
37350
|
-
|
|
37350
|
+
options2 = filterOutReservedFunctions(reserved, options2);
|
|
37351
37351
|
self2.readable = true;
|
|
37352
37352
|
self2.writable = true;
|
|
37353
|
-
if (
|
|
37353
|
+
if (options2.method) {
|
|
37354
37354
|
self2.explicitMethod = true;
|
|
37355
37355
|
}
|
|
37356
37356
|
self2._qs = new Querystring(self2);
|
|
@@ -37359,7 +37359,7 @@ var require_request2 = __commonJS({
|
|
|
37359
37359
|
self2._multipart = new Multipart(self2);
|
|
37360
37360
|
self2._redirect = new Redirect(self2);
|
|
37361
37361
|
self2._tunnel = new Tunnel(self2);
|
|
37362
|
-
self2.init(
|
|
37362
|
+
self2.init(options2);
|
|
37363
37363
|
}
|
|
37364
37364
|
util.inherits(Request, stream.Stream);
|
|
37365
37365
|
Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG);
|
|
@@ -37369,10 +37369,10 @@ var require_request2 = __commonJS({
|
|
|
37369
37369
|
}
|
|
37370
37370
|
}
|
|
37371
37371
|
Request.prototype.debug = debug;
|
|
37372
|
-
Request.prototype.init = function(
|
|
37372
|
+
Request.prototype.init = function(options2) {
|
|
37373
37373
|
var self2 = this;
|
|
37374
|
-
if (!
|
|
37375
|
-
|
|
37374
|
+
if (!options2) {
|
|
37375
|
+
options2 = {};
|
|
37376
37376
|
}
|
|
37377
37377
|
self2.headers = self2.headers ? copy(self2.headers) : {};
|
|
37378
37378
|
for (var headerName in self2.headers) {
|
|
@@ -37382,13 +37382,13 @@ var require_request2 = __commonJS({
|
|
|
37382
37382
|
}
|
|
37383
37383
|
caseless.httpify(self2, self2.headers);
|
|
37384
37384
|
if (!self2.method) {
|
|
37385
|
-
self2.method =
|
|
37385
|
+
self2.method = options2.method || "GET";
|
|
37386
37386
|
}
|
|
37387
37387
|
if (!self2.localAddress) {
|
|
37388
|
-
self2.localAddress =
|
|
37388
|
+
self2.localAddress = options2.localAddress;
|
|
37389
37389
|
}
|
|
37390
|
-
self2._qs.init(
|
|
37391
|
-
debug(
|
|
37390
|
+
self2._qs.init(options2);
|
|
37391
|
+
debug(options2);
|
|
37392
37392
|
if (!self2.pool && self2.pool !== false) {
|
|
37393
37393
|
self2.pool = globalPool;
|
|
37394
37394
|
}
|
|
@@ -37457,7 +37457,7 @@ var require_request2 = __commonJS({
|
|
|
37457
37457
|
if (!(self2.uri.host || self2.uri.hostname && self2.uri.port) && !self2.uri.isUnix) {
|
|
37458
37458
|
var faultyUri = url.format(self2.uri);
|
|
37459
37459
|
var message = 'Invalid URI "' + faultyUri + '"';
|
|
37460
|
-
if (Object.keys(
|
|
37460
|
+
if (Object.keys(options2).length === 0) {
|
|
37461
37461
|
message += ". This can be caused by a crappy redirection.";
|
|
37462
37462
|
}
|
|
37463
37463
|
self2.abort();
|
|
@@ -37468,9 +37468,9 @@ var require_request2 = __commonJS({
|
|
|
37468
37468
|
}
|
|
37469
37469
|
self2.tunnel = self2._tunnel.isEnabled();
|
|
37470
37470
|
if (self2.proxy) {
|
|
37471
|
-
self2._tunnel.setup(
|
|
37471
|
+
self2._tunnel.setup(options2);
|
|
37472
37472
|
}
|
|
37473
|
-
self2._redirect.onRequest(
|
|
37473
|
+
self2._redirect.onRequest(options2);
|
|
37474
37474
|
self2.setHost = false;
|
|
37475
37475
|
if (!self2.hasHeader("host")) {
|
|
37476
37476
|
var hostHeaderName = self2.originalHostHeaderName || "host";
|
|
@@ -37482,7 +37482,7 @@ var require_request2 = __commonJS({
|
|
|
37482
37482
|
}
|
|
37483
37483
|
self2.setHost = true;
|
|
37484
37484
|
}
|
|
37485
|
-
self2.jar(self2._jar ||
|
|
37485
|
+
self2.jar(self2._jar || options2.jar);
|
|
37486
37486
|
if (!self2.uri.port) {
|
|
37487
37487
|
if (self2.uri.protocol === "http:") {
|
|
37488
37488
|
self2.uri.port = 80;
|
|
@@ -37497,11 +37497,11 @@ var require_request2 = __commonJS({
|
|
|
37497
37497
|
self2.port = self2.uri.port;
|
|
37498
37498
|
self2.host = self2.uri.hostname;
|
|
37499
37499
|
}
|
|
37500
|
-
if (
|
|
37501
|
-
self2.form(
|
|
37500
|
+
if (options2.form) {
|
|
37501
|
+
self2.form(options2.form);
|
|
37502
37502
|
}
|
|
37503
|
-
if (
|
|
37504
|
-
var formData =
|
|
37503
|
+
if (options2.formData) {
|
|
37504
|
+
var formData = options2.formData;
|
|
37505
37505
|
var requestForm = self2.form();
|
|
37506
37506
|
var appendFormValue = function(key, value) {
|
|
37507
37507
|
if (value && value.hasOwnProperty("value") && value.hasOwnProperty("options")) {
|
|
@@ -37523,8 +37523,8 @@ var require_request2 = __commonJS({
|
|
|
37523
37523
|
}
|
|
37524
37524
|
}
|
|
37525
37525
|
}
|
|
37526
|
-
if (
|
|
37527
|
-
self2.qs(
|
|
37526
|
+
if (options2.qs) {
|
|
37527
|
+
self2.qs(options2.qs);
|
|
37528
37528
|
}
|
|
37529
37529
|
if (self2.uri.path) {
|
|
37530
37530
|
self2.path = self2.uri.path;
|
|
@@ -37534,27 +37534,27 @@ var require_request2 = __commonJS({
|
|
|
37534
37534
|
if (self2.path.length === 0) {
|
|
37535
37535
|
self2.path = "/";
|
|
37536
37536
|
}
|
|
37537
|
-
if (
|
|
37538
|
-
self2.aws(
|
|
37537
|
+
if (options2.aws) {
|
|
37538
|
+
self2.aws(options2.aws);
|
|
37539
37539
|
}
|
|
37540
|
-
if (
|
|
37541
|
-
self2.hawk(
|
|
37540
|
+
if (options2.hawk) {
|
|
37541
|
+
self2.hawk(options2.hawk);
|
|
37542
37542
|
}
|
|
37543
|
-
if (
|
|
37544
|
-
self2.httpSignature(
|
|
37543
|
+
if (options2.httpSignature) {
|
|
37544
|
+
self2.httpSignature(options2.httpSignature);
|
|
37545
37545
|
}
|
|
37546
|
-
if (
|
|
37547
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
37548
|
-
|
|
37546
|
+
if (options2.auth) {
|
|
37547
|
+
if (Object.prototype.hasOwnProperty.call(options2.auth, "username")) {
|
|
37548
|
+
options2.auth.user = options2.auth.username;
|
|
37549
37549
|
}
|
|
37550
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
37551
|
-
|
|
37550
|
+
if (Object.prototype.hasOwnProperty.call(options2.auth, "password")) {
|
|
37551
|
+
options2.auth.pass = options2.auth.password;
|
|
37552
37552
|
}
|
|
37553
37553
|
self2.auth(
|
|
37554
|
-
|
|
37555
|
-
|
|
37556
|
-
|
|
37557
|
-
|
|
37554
|
+
options2.auth.user,
|
|
37555
|
+
options2.auth.pass,
|
|
37556
|
+
options2.auth.sendImmediately,
|
|
37557
|
+
options2.auth.bearer
|
|
37558
37558
|
);
|
|
37559
37559
|
}
|
|
37560
37560
|
if (self2.gzip && !self2.hasHeader("accept-encoding")) {
|
|
@@ -37576,13 +37576,13 @@ var require_request2 = __commonJS({
|
|
|
37576
37576
|
if (self2.proxy && !self2.tunnel) {
|
|
37577
37577
|
self2.path = self2.uri.protocol + "//" + self2.uri.host + self2.path;
|
|
37578
37578
|
}
|
|
37579
|
-
if (
|
|
37580
|
-
self2.json(
|
|
37579
|
+
if (options2.json) {
|
|
37580
|
+
self2.json(options2.json);
|
|
37581
37581
|
}
|
|
37582
|
-
if (
|
|
37583
|
-
self2.multipart(
|
|
37582
|
+
if (options2.multipart) {
|
|
37583
|
+
self2.multipart(options2.multipart);
|
|
37584
37584
|
}
|
|
37585
|
-
if (
|
|
37585
|
+
if (options2.time) {
|
|
37586
37586
|
self2.timing = true;
|
|
37587
37587
|
self2.elapsedTime = self2.elapsedTime || 0;
|
|
37588
37588
|
}
|
|
@@ -37611,8 +37611,8 @@ var require_request2 = __commonJS({
|
|
|
37611
37611
|
if (self2.body && !isstream(self2.body)) {
|
|
37612
37612
|
setContentLength();
|
|
37613
37613
|
}
|
|
37614
|
-
if (
|
|
37615
|
-
self2.oauth(
|
|
37614
|
+
if (options2.oauth) {
|
|
37615
|
+
self2.oauth(options2.oauth);
|
|
37616
37616
|
} else if (self2._oauth.params && self2.hasHeader("authorization")) {
|
|
37617
37617
|
self2.oauth(self2._oauth.params);
|
|
37618
37618
|
}
|
|
@@ -37623,16 +37623,16 @@ var require_request2 = __commonJS({
|
|
|
37623
37623
|
if (!self2.httpModule) {
|
|
37624
37624
|
return self2.emit("error", new Error("Invalid protocol: " + protocol));
|
|
37625
37625
|
}
|
|
37626
|
-
if (
|
|
37627
|
-
self2.ca =
|
|
37626
|
+
if (options2.ca) {
|
|
37627
|
+
self2.ca = options2.ca;
|
|
37628
37628
|
}
|
|
37629
37629
|
if (!self2.agent) {
|
|
37630
|
-
if (
|
|
37631
|
-
self2.agentOptions =
|
|
37630
|
+
if (options2.agentOptions) {
|
|
37631
|
+
self2.agentOptions = options2.agentOptions;
|
|
37632
37632
|
}
|
|
37633
|
-
if (
|
|
37634
|
-
self2.agentClass =
|
|
37635
|
-
} else if (
|
|
37633
|
+
if (options2.agentClass) {
|
|
37634
|
+
self2.agentClass = options2.agentClass;
|
|
37635
|
+
} else if (options2.forever) {
|
|
37636
37636
|
var v = version();
|
|
37637
37637
|
if (v.major === 0 && v.minor <= 10) {
|
|
37638
37638
|
self2.agentClass = protocol === "http:" ? ForeverAgent : ForeverAgent.SSL;
|
|
@@ -37735,36 +37735,36 @@ var require_request2 = __commonJS({
|
|
|
37735
37735
|
Request.prototype.getNewAgent = function() {
|
|
37736
37736
|
var self2 = this;
|
|
37737
37737
|
var Agent = self2.agentClass;
|
|
37738
|
-
var
|
|
37738
|
+
var options2 = {};
|
|
37739
37739
|
if (self2.agentOptions) {
|
|
37740
37740
|
for (var i in self2.agentOptions) {
|
|
37741
|
-
|
|
37741
|
+
options2[i] = self2.agentOptions[i];
|
|
37742
37742
|
}
|
|
37743
37743
|
}
|
|
37744
37744
|
if (self2.ca) {
|
|
37745
|
-
|
|
37745
|
+
options2.ca = self2.ca;
|
|
37746
37746
|
}
|
|
37747
37747
|
if (self2.ciphers) {
|
|
37748
|
-
|
|
37748
|
+
options2.ciphers = self2.ciphers;
|
|
37749
37749
|
}
|
|
37750
37750
|
if (self2.secureProtocol) {
|
|
37751
|
-
|
|
37751
|
+
options2.secureProtocol = self2.secureProtocol;
|
|
37752
37752
|
}
|
|
37753
37753
|
if (self2.secureOptions) {
|
|
37754
|
-
|
|
37754
|
+
options2.secureOptions = self2.secureOptions;
|
|
37755
37755
|
}
|
|
37756
37756
|
if (typeof self2.rejectUnauthorized !== "undefined") {
|
|
37757
|
-
|
|
37757
|
+
options2.rejectUnauthorized = self2.rejectUnauthorized;
|
|
37758
37758
|
}
|
|
37759
37759
|
if (self2.cert && self2.key) {
|
|
37760
|
-
|
|
37761
|
-
|
|
37760
|
+
options2.key = self2.key;
|
|
37761
|
+
options2.cert = self2.cert;
|
|
37762
37762
|
}
|
|
37763
37763
|
if (self2.pfx) {
|
|
37764
|
-
|
|
37764
|
+
options2.pfx = self2.pfx;
|
|
37765
37765
|
}
|
|
37766
37766
|
if (self2.passphrase) {
|
|
37767
|
-
|
|
37767
|
+
options2.passphrase = self2.passphrase;
|
|
37768
37768
|
}
|
|
37769
37769
|
var poolKey = "";
|
|
37770
37770
|
if (Agent !== self2.httpModule.Agent) {
|
|
@@ -37776,55 +37776,55 @@ var require_request2 = __commonJS({
|
|
|
37776
37776
|
}
|
|
37777
37777
|
var isHttps = proxy && proxy.protocol === "https:" || this.uri.protocol === "https:";
|
|
37778
37778
|
if (isHttps) {
|
|
37779
|
-
if (
|
|
37779
|
+
if (options2.ca) {
|
|
37780
37780
|
if (poolKey) {
|
|
37781
37781
|
poolKey += ":";
|
|
37782
37782
|
}
|
|
37783
|
-
poolKey +=
|
|
37783
|
+
poolKey += options2.ca;
|
|
37784
37784
|
}
|
|
37785
|
-
if (typeof
|
|
37785
|
+
if (typeof options2.rejectUnauthorized !== "undefined") {
|
|
37786
37786
|
if (poolKey) {
|
|
37787
37787
|
poolKey += ":";
|
|
37788
37788
|
}
|
|
37789
|
-
poolKey +=
|
|
37789
|
+
poolKey += options2.rejectUnauthorized;
|
|
37790
37790
|
}
|
|
37791
|
-
if (
|
|
37791
|
+
if (options2.cert) {
|
|
37792
37792
|
if (poolKey) {
|
|
37793
37793
|
poolKey += ":";
|
|
37794
37794
|
}
|
|
37795
|
-
poolKey +=
|
|
37795
|
+
poolKey += options2.cert.toString("ascii") + options2.key.toString("ascii");
|
|
37796
37796
|
}
|
|
37797
|
-
if (
|
|
37797
|
+
if (options2.pfx) {
|
|
37798
37798
|
if (poolKey) {
|
|
37799
37799
|
poolKey += ":";
|
|
37800
37800
|
}
|
|
37801
|
-
poolKey +=
|
|
37801
|
+
poolKey += options2.pfx.toString("ascii");
|
|
37802
37802
|
}
|
|
37803
|
-
if (
|
|
37803
|
+
if (options2.ciphers) {
|
|
37804
37804
|
if (poolKey) {
|
|
37805
37805
|
poolKey += ":";
|
|
37806
37806
|
}
|
|
37807
|
-
poolKey +=
|
|
37807
|
+
poolKey += options2.ciphers;
|
|
37808
37808
|
}
|
|
37809
|
-
if (
|
|
37809
|
+
if (options2.secureProtocol) {
|
|
37810
37810
|
if (poolKey) {
|
|
37811
37811
|
poolKey += ":";
|
|
37812
37812
|
}
|
|
37813
|
-
poolKey +=
|
|
37813
|
+
poolKey += options2.secureProtocol;
|
|
37814
37814
|
}
|
|
37815
|
-
if (
|
|
37815
|
+
if (options2.secureOptions) {
|
|
37816
37816
|
if (poolKey) {
|
|
37817
37817
|
poolKey += ":";
|
|
37818
37818
|
}
|
|
37819
|
-
poolKey +=
|
|
37819
|
+
poolKey += options2.secureOptions;
|
|
37820
37820
|
}
|
|
37821
37821
|
}
|
|
37822
|
-
if (self2.pool === globalPool && !poolKey && Object.keys(
|
|
37822
|
+
if (self2.pool === globalPool && !poolKey && Object.keys(options2).length === 0 && self2.httpModule.globalAgent) {
|
|
37823
37823
|
return self2.httpModule.globalAgent;
|
|
37824
37824
|
}
|
|
37825
37825
|
poolKey = self2.uri.protocol + poolKey;
|
|
37826
37826
|
if (!self2.pool[poolKey]) {
|
|
37827
|
-
self2.pool[poolKey] = new Agent(
|
|
37827
|
+
self2.pool[poolKey] = new Agent(options2);
|
|
37828
37828
|
if (self2.pool.maxSockets) {
|
|
37829
37829
|
self2.pool[poolKey].maxSockets = self2.pool.maxSockets;
|
|
37830
37830
|
}
|
|
@@ -38324,7 +38324,7 @@ var require_request2 = __commonJS({
|
|
|
38324
38324
|
return self2;
|
|
38325
38325
|
}
|
|
38326
38326
|
if (opts.sign_version === 4 || opts.sign_version === "4") {
|
|
38327
|
-
var
|
|
38327
|
+
var options2 = {
|
|
38328
38328
|
host: self2.uri.host,
|
|
38329
38329
|
path: self2.uri.path,
|
|
38330
38330
|
method: self2.method,
|
|
@@ -38332,9 +38332,9 @@ var require_request2 = __commonJS({
|
|
|
38332
38332
|
body: self2.body
|
|
38333
38333
|
};
|
|
38334
38334
|
if (opts.service) {
|
|
38335
|
-
|
|
38335
|
+
options2.service = opts.service;
|
|
38336
38336
|
}
|
|
38337
|
-
var signRes = aws4.sign(
|
|
38337
|
+
var signRes = aws4.sign(options2, {
|
|
38338
38338
|
accessKeyId: opts.key,
|
|
38339
38339
|
secretAccessKey: opts.secret,
|
|
38340
38340
|
sessionToken: opts.session
|
|
@@ -38512,13 +38512,13 @@ var require_request3 = __commonJS({
|
|
|
38512
38512
|
var cookies = require_cookies();
|
|
38513
38513
|
var helpers = require_helpers();
|
|
38514
38514
|
var paramsHaveRequestBody = helpers.paramsHaveRequestBody;
|
|
38515
|
-
function initParams(uri,
|
|
38516
|
-
if (typeof
|
|
38517
|
-
callback =
|
|
38515
|
+
function initParams(uri, options2, callback) {
|
|
38516
|
+
if (typeof options2 === "function") {
|
|
38517
|
+
callback = options2;
|
|
38518
38518
|
}
|
|
38519
38519
|
var params = {};
|
|
38520
|
-
if (
|
|
38521
|
-
extend(params,
|
|
38520
|
+
if (options2 !== null && typeof options2 === "object") {
|
|
38521
|
+
extend(params, options2, { uri });
|
|
38522
38522
|
} else if (typeof uri === "string") {
|
|
38523
38523
|
extend(params, { uri });
|
|
38524
38524
|
} else {
|
|
@@ -38527,11 +38527,11 @@ var require_request3 = __commonJS({
|
|
|
38527
38527
|
params.callback = callback || params.callback;
|
|
38528
38528
|
return params;
|
|
38529
38529
|
}
|
|
38530
|
-
function request2(uri,
|
|
38530
|
+
function request2(uri, options2, callback) {
|
|
38531
38531
|
if (typeof uri === "undefined") {
|
|
38532
38532
|
throw new Error("undefined is not a valid uri or options object.");
|
|
38533
38533
|
}
|
|
38534
|
-
var params = initParams(uri,
|
|
38534
|
+
var params = initParams(uri, options2, callback);
|
|
38535
38535
|
if (params.method === "HEAD" && paramsHaveRequestBody(params)) {
|
|
38536
38536
|
throw new Error("HTTP HEAD requests MUST NOT include a request body.");
|
|
38537
38537
|
}
|
|
@@ -38539,8 +38539,8 @@ var require_request3 = __commonJS({
|
|
|
38539
38539
|
}
|
|
38540
38540
|
function verbFunc(verb) {
|
|
38541
38541
|
var method = verb.toUpperCase();
|
|
38542
|
-
return function(uri,
|
|
38543
|
-
var params = initParams(uri,
|
|
38542
|
+
return function(uri, options2, callback) {
|
|
38543
|
+
var params = initParams(uri, options2, callback);
|
|
38544
38544
|
params.method = method;
|
|
38545
38545
|
return request2(params, params.callback);
|
|
38546
38546
|
};
|
|
@@ -38559,12 +38559,12 @@ var require_request3 = __commonJS({
|
|
|
38559
38559
|
request2.cookie = function(str) {
|
|
38560
38560
|
return cookies.parse(str);
|
|
38561
38561
|
};
|
|
38562
|
-
function wrapRequestMethod(method,
|
|
38562
|
+
function wrapRequestMethod(method, options2, requester, verb) {
|
|
38563
38563
|
return function(uri, opts, callback) {
|
|
38564
38564
|
var params = initParams(uri, opts, callback);
|
|
38565
38565
|
var target = {};
|
|
38566
|
-
extend(true, target,
|
|
38567
|
-
target.pool = params.pool ||
|
|
38566
|
+
extend(true, target, options2, params);
|
|
38567
|
+
target.pool = params.pool || options2.pool;
|
|
38568
38568
|
if (verb) {
|
|
38569
38569
|
target.method = verb.toUpperCase();
|
|
38570
38570
|
}
|
|
@@ -38574,33 +38574,33 @@ var require_request3 = __commonJS({
|
|
|
38574
38574
|
return method(target, target.callback);
|
|
38575
38575
|
};
|
|
38576
38576
|
}
|
|
38577
|
-
request2.defaults = function(
|
|
38577
|
+
request2.defaults = function(options2, requester) {
|
|
38578
38578
|
var self2 = this;
|
|
38579
|
-
|
|
38580
|
-
if (typeof
|
|
38581
|
-
requester =
|
|
38582
|
-
|
|
38579
|
+
options2 = options2 || {};
|
|
38580
|
+
if (typeof options2 === "function") {
|
|
38581
|
+
requester = options2;
|
|
38582
|
+
options2 = {};
|
|
38583
38583
|
}
|
|
38584
|
-
var defaults = wrapRequestMethod(self2,
|
|
38584
|
+
var defaults = wrapRequestMethod(self2, options2, requester);
|
|
38585
38585
|
var verbs = ["get", "head", "post", "put", "patch", "del", "delete"];
|
|
38586
38586
|
verbs.forEach(function(verb) {
|
|
38587
|
-
defaults[verb] = wrapRequestMethod(self2[verb],
|
|
38587
|
+
defaults[verb] = wrapRequestMethod(self2[verb], options2, requester, verb);
|
|
38588
38588
|
});
|
|
38589
|
-
defaults.cookie = wrapRequestMethod(self2.cookie,
|
|
38589
|
+
defaults.cookie = wrapRequestMethod(self2.cookie, options2, requester);
|
|
38590
38590
|
defaults.jar = self2.jar;
|
|
38591
38591
|
defaults.defaults = self2.defaults;
|
|
38592
38592
|
return defaults;
|
|
38593
38593
|
};
|
|
38594
38594
|
request2.forever = function(agentOptions, optionsArg) {
|
|
38595
|
-
var
|
|
38595
|
+
var options2 = {};
|
|
38596
38596
|
if (optionsArg) {
|
|
38597
|
-
extend(
|
|
38597
|
+
extend(options2, optionsArg);
|
|
38598
38598
|
}
|
|
38599
38599
|
if (agentOptions) {
|
|
38600
|
-
|
|
38600
|
+
options2.agentOptions = agentOptions;
|
|
38601
38601
|
}
|
|
38602
|
-
|
|
38603
|
-
return request2.defaults(
|
|
38602
|
+
options2.forever = true;
|
|
38603
|
+
return request2.defaults(options2);
|
|
38604
38604
|
};
|
|
38605
38605
|
module2.exports = request2;
|
|
38606
38606
|
request2.Request = require_request2();
|
|
@@ -38753,14 +38753,14 @@ var require_parse_options = __commonJS({
|
|
|
38753
38753
|
"use strict";
|
|
38754
38754
|
var looseOption = Object.freeze({ loose: true });
|
|
38755
38755
|
var emptyOpts = Object.freeze({});
|
|
38756
|
-
var parseOptions = (
|
|
38757
|
-
if (!
|
|
38756
|
+
var parseOptions = (options2) => {
|
|
38757
|
+
if (!options2) {
|
|
38758
38758
|
return emptyOpts;
|
|
38759
38759
|
}
|
|
38760
|
-
if (typeof
|
|
38760
|
+
if (typeof options2 !== "object") {
|
|
38761
38761
|
return looseOption;
|
|
38762
38762
|
}
|
|
38763
|
-
return
|
|
38763
|
+
return options2;
|
|
38764
38764
|
};
|
|
38765
38765
|
module2.exports = parseOptions;
|
|
38766
38766
|
}
|
|
@@ -38798,10 +38798,10 @@ var require_semver = __commonJS({
|
|
|
38798
38798
|
var parseOptions = require_parse_options();
|
|
38799
38799
|
var { compareIdentifiers } = require_identifiers();
|
|
38800
38800
|
var SemVer = class _SemVer {
|
|
38801
|
-
constructor(version,
|
|
38802
|
-
|
|
38801
|
+
constructor(version, options2) {
|
|
38802
|
+
options2 = parseOptions(options2);
|
|
38803
38803
|
if (version instanceof _SemVer) {
|
|
38804
|
-
if (version.loose === !!
|
|
38804
|
+
if (version.loose === !!options2.loose && version.includePrerelease === !!options2.includePrerelease) {
|
|
38805
38805
|
return version;
|
|
38806
38806
|
} else {
|
|
38807
38807
|
version = version.version;
|
|
@@ -38814,11 +38814,11 @@ var require_semver = __commonJS({
|
|
|
38814
38814
|
`version is longer than ${MAX_LENGTH} characters`
|
|
38815
38815
|
);
|
|
38816
38816
|
}
|
|
38817
|
-
debug("SemVer", version,
|
|
38818
|
-
this.options =
|
|
38819
|
-
this.loose = !!
|
|
38820
|
-
this.includePrerelease = !!
|
|
38821
|
-
const m = version.trim().match(
|
|
38817
|
+
debug("SemVer", version, options2);
|
|
38818
|
+
this.options = options2;
|
|
38819
|
+
this.loose = !!options2.loose;
|
|
38820
|
+
this.includePrerelease = !!options2.includePrerelease;
|
|
38821
|
+
const m = version.trim().match(options2.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
38822
38822
|
if (!m) {
|
|
38823
38823
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
38824
38824
|
}
|
|
@@ -39054,12 +39054,12 @@ var require_parse2 = __commonJS({
|
|
|
39054
39054
|
"node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
39055
39055
|
"use strict";
|
|
39056
39056
|
var SemVer = require_semver();
|
|
39057
|
-
var parse = (version,
|
|
39057
|
+
var parse = (version, options2, throwErrors = false) => {
|
|
39058
39058
|
if (version instanceof SemVer) {
|
|
39059
39059
|
return version;
|
|
39060
39060
|
}
|
|
39061
39061
|
try {
|
|
39062
|
-
return new SemVer(version,
|
|
39062
|
+
return new SemVer(version, options2);
|
|
39063
39063
|
} catch (er) {
|
|
39064
39064
|
if (!throwErrors) {
|
|
39065
39065
|
return null;
|
|
@@ -39076,8 +39076,8 @@ var require_valid = __commonJS({
|
|
|
39076
39076
|
"node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
39077
39077
|
"use strict";
|
|
39078
39078
|
var parse = require_parse2();
|
|
39079
|
-
var valid = (version,
|
|
39080
|
-
const v = parse(version,
|
|
39079
|
+
var valid = (version, options2) => {
|
|
39080
|
+
const v = parse(version, options2);
|
|
39081
39081
|
return v ? v.version : null;
|
|
39082
39082
|
};
|
|
39083
39083
|
module2.exports = valid;
|
|
@@ -39089,8 +39089,8 @@ var require_clean = __commonJS({
|
|
|
39089
39089
|
"node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
39090
39090
|
"use strict";
|
|
39091
39091
|
var parse = require_parse2();
|
|
39092
|
-
var clean = (version,
|
|
39093
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""),
|
|
39092
|
+
var clean = (version, options2) => {
|
|
39093
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options2);
|
|
39094
39094
|
return s ? s.version : null;
|
|
39095
39095
|
};
|
|
39096
39096
|
module2.exports = clean;
|
|
@@ -39102,16 +39102,16 @@ var require_inc = __commonJS({
|
|
|
39102
39102
|
"node_modules/semver/functions/inc.js"(exports2, module2) {
|
|
39103
39103
|
"use strict";
|
|
39104
39104
|
var SemVer = require_semver();
|
|
39105
|
-
var inc = (version, release2,
|
|
39106
|
-
if (typeof
|
|
39105
|
+
var inc = (version, release2, options2, identifier, identifierBase) => {
|
|
39106
|
+
if (typeof options2 === "string") {
|
|
39107
39107
|
identifierBase = identifier;
|
|
39108
|
-
identifier =
|
|
39109
|
-
|
|
39108
|
+
identifier = options2;
|
|
39109
|
+
options2 = void 0;
|
|
39110
39110
|
}
|
|
39111
39111
|
try {
|
|
39112
39112
|
return new SemVer(
|
|
39113
39113
|
version instanceof SemVer ? version.version : version,
|
|
39114
|
-
|
|
39114
|
+
options2
|
|
39115
39115
|
).inc(release2, identifier, identifierBase).version;
|
|
39116
39116
|
} catch (er) {
|
|
39117
39117
|
return null;
|
|
@@ -39200,8 +39200,8 @@ var require_prerelease = __commonJS({
|
|
|
39200
39200
|
"node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
39201
39201
|
"use strict";
|
|
39202
39202
|
var parse = require_parse2();
|
|
39203
|
-
var prerelease = (version,
|
|
39204
|
-
const parsed = parse(version,
|
|
39203
|
+
var prerelease = (version, options2) => {
|
|
39204
|
+
const parsed = parse(version, options2);
|
|
39205
39205
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
39206
39206
|
};
|
|
39207
39207
|
module2.exports = prerelease;
|
|
@@ -39389,7 +39389,7 @@ var require_coerce = __commonJS({
|
|
|
39389
39389
|
var SemVer = require_semver();
|
|
39390
39390
|
var parse = require_parse2();
|
|
39391
39391
|
var { safeRe: re, t } = require_re();
|
|
39392
|
-
var coerce = (version,
|
|
39392
|
+
var coerce = (version, options2) => {
|
|
39393
39393
|
if (version instanceof SemVer) {
|
|
39394
39394
|
return version;
|
|
39395
39395
|
}
|
|
@@ -39399,12 +39399,12 @@ var require_coerce = __commonJS({
|
|
|
39399
39399
|
if (typeof version !== "string") {
|
|
39400
39400
|
return null;
|
|
39401
39401
|
}
|
|
39402
|
-
|
|
39402
|
+
options2 = options2 || {};
|
|
39403
39403
|
let match = null;
|
|
39404
|
-
if (!
|
|
39405
|
-
match = version.match(
|
|
39404
|
+
if (!options2.rtl) {
|
|
39405
|
+
match = version.match(options2.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
39406
39406
|
} else {
|
|
39407
|
-
const coerceRtlRegex =
|
|
39407
|
+
const coerceRtlRegex = options2.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
39408
39408
|
let next;
|
|
39409
39409
|
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
39410
39410
|
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
@@ -39420,9 +39420,9 @@ var require_coerce = __commonJS({
|
|
|
39420
39420
|
const major = match[2];
|
|
39421
39421
|
const minor = match[3] || "0";
|
|
39422
39422
|
const patch = match[4] || "0";
|
|
39423
|
-
const prerelease =
|
|
39424
|
-
const build =
|
|
39425
|
-
return parse(`${major}.${minor}.${patch}${prerelease}${build}`,
|
|
39423
|
+
const prerelease = options2.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
39424
|
+
const build = options2.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
39425
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options2);
|
|
39426
39426
|
};
|
|
39427
39427
|
module2.exports = coerce;
|
|
39428
39428
|
}
|
|
@@ -39472,13 +39472,13 @@ var require_range = __commonJS({
|
|
|
39472
39472
|
"use strict";
|
|
39473
39473
|
var SPACE_CHARACTERS = /\s+/g;
|
|
39474
39474
|
var Range = class _Range {
|
|
39475
|
-
constructor(range,
|
|
39476
|
-
|
|
39475
|
+
constructor(range, options2) {
|
|
39476
|
+
options2 = parseOptions(options2);
|
|
39477
39477
|
if (range instanceof _Range) {
|
|
39478
|
-
if (range.loose === !!
|
|
39478
|
+
if (range.loose === !!options2.loose && range.includePrerelease === !!options2.includePrerelease) {
|
|
39479
39479
|
return range;
|
|
39480
39480
|
} else {
|
|
39481
|
-
return new _Range(range.raw,
|
|
39481
|
+
return new _Range(range.raw, options2);
|
|
39482
39482
|
}
|
|
39483
39483
|
}
|
|
39484
39484
|
if (range instanceof Comparator) {
|
|
@@ -39487,9 +39487,9 @@ var require_range = __commonJS({
|
|
|
39487
39487
|
this.formatted = void 0;
|
|
39488
39488
|
return this;
|
|
39489
39489
|
}
|
|
39490
|
-
this.options =
|
|
39491
|
-
this.loose = !!
|
|
39492
|
-
this.includePrerelease = !!
|
|
39490
|
+
this.options = options2;
|
|
39491
|
+
this.loose = !!options2.loose;
|
|
39492
|
+
this.includePrerelease = !!options2.includePrerelease;
|
|
39493
39493
|
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
39494
39494
|
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
39495
39495
|
if (!this.set.length) {
|
|
@@ -39575,15 +39575,15 @@ var require_range = __commonJS({
|
|
|
39575
39575
|
cache.set(memoKey, result);
|
|
39576
39576
|
return result;
|
|
39577
39577
|
}
|
|
39578
|
-
intersects(range,
|
|
39578
|
+
intersects(range, options2) {
|
|
39579
39579
|
if (!(range instanceof _Range)) {
|
|
39580
39580
|
throw new TypeError("a Range is required");
|
|
39581
39581
|
}
|
|
39582
39582
|
return this.set.some((thisComparators) => {
|
|
39583
|
-
return isSatisfiable(thisComparators,
|
|
39584
|
-
return isSatisfiable(rangeComparators,
|
|
39583
|
+
return isSatisfiable(thisComparators, options2) && range.set.some((rangeComparators) => {
|
|
39584
|
+
return isSatisfiable(rangeComparators, options2) && thisComparators.every((thisComparator) => {
|
|
39585
39585
|
return rangeComparators.every((rangeComparator) => {
|
|
39586
|
-
return thisComparator.intersects(rangeComparator,
|
|
39586
|
+
return thisComparator.intersects(rangeComparator, options2);
|
|
39587
39587
|
});
|
|
39588
39588
|
});
|
|
39589
39589
|
});
|
|
@@ -39626,36 +39626,36 @@ var require_range = __commonJS({
|
|
|
39626
39626
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants2();
|
|
39627
39627
|
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
39628
39628
|
var isAny = (c) => c.value === "";
|
|
39629
|
-
var isSatisfiable = (comparators,
|
|
39629
|
+
var isSatisfiable = (comparators, options2) => {
|
|
39630
39630
|
let result = true;
|
|
39631
39631
|
const remainingComparators = comparators.slice();
|
|
39632
39632
|
let testComparator = remainingComparators.pop();
|
|
39633
39633
|
while (result && remainingComparators.length) {
|
|
39634
39634
|
result = remainingComparators.every((otherComparator) => {
|
|
39635
|
-
return testComparator.intersects(otherComparator,
|
|
39635
|
+
return testComparator.intersects(otherComparator, options2);
|
|
39636
39636
|
});
|
|
39637
39637
|
testComparator = remainingComparators.pop();
|
|
39638
39638
|
}
|
|
39639
39639
|
return result;
|
|
39640
39640
|
};
|
|
39641
|
-
var parseComparator = (comp,
|
|
39642
|
-
debug("comp", comp,
|
|
39643
|
-
comp = replaceCarets(comp,
|
|
39641
|
+
var parseComparator = (comp, options2) => {
|
|
39642
|
+
debug("comp", comp, options2);
|
|
39643
|
+
comp = replaceCarets(comp, options2);
|
|
39644
39644
|
debug("caret", comp);
|
|
39645
|
-
comp = replaceTildes(comp,
|
|
39645
|
+
comp = replaceTildes(comp, options2);
|
|
39646
39646
|
debug("tildes", comp);
|
|
39647
|
-
comp = replaceXRanges(comp,
|
|
39647
|
+
comp = replaceXRanges(comp, options2);
|
|
39648
39648
|
debug("xrange", comp);
|
|
39649
|
-
comp = replaceStars(comp,
|
|
39649
|
+
comp = replaceStars(comp, options2);
|
|
39650
39650
|
debug("stars", comp);
|
|
39651
39651
|
return comp;
|
|
39652
39652
|
};
|
|
39653
39653
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
39654
|
-
var replaceTildes = (comp,
|
|
39655
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c,
|
|
39654
|
+
var replaceTildes = (comp, options2) => {
|
|
39655
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options2)).join(" ");
|
|
39656
39656
|
};
|
|
39657
|
-
var replaceTilde = (comp,
|
|
39658
|
-
const r =
|
|
39657
|
+
var replaceTilde = (comp, options2) => {
|
|
39658
|
+
const r = options2.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
39659
39659
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
39660
39660
|
debug("tilde", comp, _, M, m, p, pr);
|
|
39661
39661
|
let ret;
|
|
@@ -39675,13 +39675,13 @@ var require_range = __commonJS({
|
|
|
39675
39675
|
return ret;
|
|
39676
39676
|
});
|
|
39677
39677
|
};
|
|
39678
|
-
var replaceCarets = (comp,
|
|
39679
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c,
|
|
39678
|
+
var replaceCarets = (comp, options2) => {
|
|
39679
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options2)).join(" ");
|
|
39680
39680
|
};
|
|
39681
|
-
var replaceCaret = (comp,
|
|
39682
|
-
debug("caret", comp,
|
|
39683
|
-
const r =
|
|
39684
|
-
const z =
|
|
39681
|
+
var replaceCaret = (comp, options2) => {
|
|
39682
|
+
debug("caret", comp, options2);
|
|
39683
|
+
const r = options2.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
39684
|
+
const z = options2.includePrerelease ? "-0" : "";
|
|
39685
39685
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
39686
39686
|
debug("caret", comp, _, M, m, p, pr);
|
|
39687
39687
|
let ret;
|
|
@@ -39722,13 +39722,13 @@ var require_range = __commonJS({
|
|
|
39722
39722
|
return ret;
|
|
39723
39723
|
});
|
|
39724
39724
|
};
|
|
39725
|
-
var replaceXRanges = (comp,
|
|
39726
|
-
debug("replaceXRanges", comp,
|
|
39727
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c,
|
|
39725
|
+
var replaceXRanges = (comp, options2) => {
|
|
39726
|
+
debug("replaceXRanges", comp, options2);
|
|
39727
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options2)).join(" ");
|
|
39728
39728
|
};
|
|
39729
|
-
var replaceXRange = (comp,
|
|
39729
|
+
var replaceXRange = (comp, options2) => {
|
|
39730
39730
|
comp = comp.trim();
|
|
39731
|
-
const r =
|
|
39731
|
+
const r = options2.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
39732
39732
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
39733
39733
|
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
39734
39734
|
const xM = isX(M);
|
|
@@ -39738,7 +39738,7 @@ var require_range = __commonJS({
|
|
|
39738
39738
|
if (gtlt === "=" && anyX) {
|
|
39739
39739
|
gtlt = "";
|
|
39740
39740
|
}
|
|
39741
|
-
pr =
|
|
39741
|
+
pr = options2.includePrerelease ? "-0" : "";
|
|
39742
39742
|
if (xM) {
|
|
39743
39743
|
if (gtlt === ">" || gtlt === "<") {
|
|
39744
39744
|
ret = "<0.0.0-0";
|
|
@@ -39781,13 +39781,13 @@ var require_range = __commonJS({
|
|
|
39781
39781
|
return ret;
|
|
39782
39782
|
});
|
|
39783
39783
|
};
|
|
39784
|
-
var replaceStars = (comp,
|
|
39785
|
-
debug("replaceStars", comp,
|
|
39784
|
+
var replaceStars = (comp, options2) => {
|
|
39785
|
+
debug("replaceStars", comp, options2);
|
|
39786
39786
|
return comp.trim().replace(re[t.STAR], "");
|
|
39787
39787
|
};
|
|
39788
|
-
var replaceGTE0 = (comp,
|
|
39789
|
-
debug("replaceGTE0", comp,
|
|
39790
|
-
return comp.trim().replace(re[
|
|
39788
|
+
var replaceGTE0 = (comp, options2) => {
|
|
39789
|
+
debug("replaceGTE0", comp, options2);
|
|
39790
|
+
return comp.trim().replace(re[options2.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
39791
39791
|
};
|
|
39792
39792
|
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
39793
39793
|
if (isX(fM)) {
|
|
@@ -39816,13 +39816,13 @@ var require_range = __commonJS({
|
|
|
39816
39816
|
}
|
|
39817
39817
|
return `${from} ${to}`.trim();
|
|
39818
39818
|
};
|
|
39819
|
-
var testSet = (set, version,
|
|
39819
|
+
var testSet = (set, version, options2) => {
|
|
39820
39820
|
for (let i = 0; i < set.length; i++) {
|
|
39821
39821
|
if (!set[i].test(version)) {
|
|
39822
39822
|
return false;
|
|
39823
39823
|
}
|
|
39824
39824
|
}
|
|
39825
|
-
if (version.prerelease.length && !
|
|
39825
|
+
if (version.prerelease.length && !options2.includePrerelease) {
|
|
39826
39826
|
for (let i = 0; i < set.length; i++) {
|
|
39827
39827
|
debug(set[i].semver);
|
|
39828
39828
|
if (set[i].semver === Comparator.ANY) {
|
|
@@ -39851,19 +39851,19 @@ var require_comparator = __commonJS({
|
|
|
39851
39851
|
static get ANY() {
|
|
39852
39852
|
return ANY;
|
|
39853
39853
|
}
|
|
39854
|
-
constructor(comp,
|
|
39855
|
-
|
|
39854
|
+
constructor(comp, options2) {
|
|
39855
|
+
options2 = parseOptions(options2);
|
|
39856
39856
|
if (comp instanceof _Comparator) {
|
|
39857
|
-
if (comp.loose === !!
|
|
39857
|
+
if (comp.loose === !!options2.loose) {
|
|
39858
39858
|
return comp;
|
|
39859
39859
|
} else {
|
|
39860
39860
|
comp = comp.value;
|
|
39861
39861
|
}
|
|
39862
39862
|
}
|
|
39863
39863
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
39864
|
-
debug("comparator", comp,
|
|
39865
|
-
this.options =
|
|
39866
|
-
this.loose = !!
|
|
39864
|
+
debug("comparator", comp, options2);
|
|
39865
|
+
this.options = options2;
|
|
39866
|
+
this.loose = !!options2.loose;
|
|
39867
39867
|
this.parse(comp);
|
|
39868
39868
|
if (this.semver === ANY) {
|
|
39869
39869
|
this.value = "";
|
|
@@ -39905,7 +39905,7 @@ var require_comparator = __commonJS({
|
|
|
39905
39905
|
}
|
|
39906
39906
|
return cmp(version, this.operator, this.semver, this.options);
|
|
39907
39907
|
}
|
|
39908
|
-
intersects(comp,
|
|
39908
|
+
intersects(comp, options2) {
|
|
39909
39909
|
if (!(comp instanceof _Comparator)) {
|
|
39910
39910
|
throw new TypeError("a Comparator is required");
|
|
39911
39911
|
}
|
|
@@ -39913,18 +39913,18 @@ var require_comparator = __commonJS({
|
|
|
39913
39913
|
if (this.value === "") {
|
|
39914
39914
|
return true;
|
|
39915
39915
|
}
|
|
39916
|
-
return new Range(comp.value,
|
|
39916
|
+
return new Range(comp.value, options2).test(this.value);
|
|
39917
39917
|
} else if (comp.operator === "") {
|
|
39918
39918
|
if (comp.value === "") {
|
|
39919
39919
|
return true;
|
|
39920
39920
|
}
|
|
39921
|
-
return new Range(this.value,
|
|
39921
|
+
return new Range(this.value, options2).test(comp.semver);
|
|
39922
39922
|
}
|
|
39923
|
-
|
|
39924
|
-
if (
|
|
39923
|
+
options2 = parseOptions(options2);
|
|
39924
|
+
if (options2.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
39925
39925
|
return false;
|
|
39926
39926
|
}
|
|
39927
|
-
if (!
|
|
39927
|
+
if (!options2.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
39928
39928
|
return false;
|
|
39929
39929
|
}
|
|
39930
39930
|
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
@@ -39936,10 +39936,10 @@ var require_comparator = __commonJS({
|
|
|
39936
39936
|
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
39937
39937
|
return true;
|
|
39938
39938
|
}
|
|
39939
|
-
if (cmp(this.semver, "<", comp.semver,
|
|
39939
|
+
if (cmp(this.semver, "<", comp.semver, options2) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
39940
39940
|
return true;
|
|
39941
39941
|
}
|
|
39942
|
-
if (cmp(this.semver, ">", comp.semver,
|
|
39942
|
+
if (cmp(this.semver, ">", comp.semver, options2) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
39943
39943
|
return true;
|
|
39944
39944
|
}
|
|
39945
39945
|
return false;
|
|
@@ -39960,9 +39960,9 @@ var require_satisfies = __commonJS({
|
|
|
39960
39960
|
"node_modules/semver/functions/satisfies.js"(exports2, module2) {
|
|
39961
39961
|
"use strict";
|
|
39962
39962
|
var Range = require_range();
|
|
39963
|
-
var satisfies = (version, range,
|
|
39963
|
+
var satisfies = (version, range, options2) => {
|
|
39964
39964
|
try {
|
|
39965
|
-
range = new Range(range,
|
|
39965
|
+
range = new Range(range, options2);
|
|
39966
39966
|
} catch (er) {
|
|
39967
39967
|
return false;
|
|
39968
39968
|
}
|
|
@@ -39977,7 +39977,7 @@ var require_to_comparators = __commonJS({
|
|
|
39977
39977
|
"node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
|
|
39978
39978
|
"use strict";
|
|
39979
39979
|
var Range = require_range();
|
|
39980
|
-
var toComparators = (range,
|
|
39980
|
+
var toComparators = (range, options2) => new Range(range, options2).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
39981
39981
|
module2.exports = toComparators;
|
|
39982
39982
|
}
|
|
39983
39983
|
});
|
|
@@ -39988,12 +39988,12 @@ var require_max_satisfying = __commonJS({
|
|
|
39988
39988
|
"use strict";
|
|
39989
39989
|
var SemVer = require_semver();
|
|
39990
39990
|
var Range = require_range();
|
|
39991
|
-
var maxSatisfying = (versions, range,
|
|
39991
|
+
var maxSatisfying = (versions, range, options2) => {
|
|
39992
39992
|
let max = null;
|
|
39993
39993
|
let maxSV = null;
|
|
39994
39994
|
let rangeObj = null;
|
|
39995
39995
|
try {
|
|
39996
|
-
rangeObj = new Range(range,
|
|
39996
|
+
rangeObj = new Range(range, options2);
|
|
39997
39997
|
} catch (er) {
|
|
39998
39998
|
return null;
|
|
39999
39999
|
}
|
|
@@ -40001,7 +40001,7 @@ var require_max_satisfying = __commonJS({
|
|
|
40001
40001
|
if (rangeObj.test(v)) {
|
|
40002
40002
|
if (!max || maxSV.compare(v) === -1) {
|
|
40003
40003
|
max = v;
|
|
40004
|
-
maxSV = new SemVer(max,
|
|
40004
|
+
maxSV = new SemVer(max, options2);
|
|
40005
40005
|
}
|
|
40006
40006
|
}
|
|
40007
40007
|
});
|
|
@@ -40017,12 +40017,12 @@ var require_min_satisfying = __commonJS({
|
|
|
40017
40017
|
"use strict";
|
|
40018
40018
|
var SemVer = require_semver();
|
|
40019
40019
|
var Range = require_range();
|
|
40020
|
-
var minSatisfying = (versions, range,
|
|
40020
|
+
var minSatisfying = (versions, range, options2) => {
|
|
40021
40021
|
let min = null;
|
|
40022
40022
|
let minSV = null;
|
|
40023
40023
|
let rangeObj = null;
|
|
40024
40024
|
try {
|
|
40025
|
-
rangeObj = new Range(range,
|
|
40025
|
+
rangeObj = new Range(range, options2);
|
|
40026
40026
|
} catch (er) {
|
|
40027
40027
|
return null;
|
|
40028
40028
|
}
|
|
@@ -40030,7 +40030,7 @@ var require_min_satisfying = __commonJS({
|
|
|
40030
40030
|
if (rangeObj.test(v)) {
|
|
40031
40031
|
if (!min || minSV.compare(v) === 1) {
|
|
40032
40032
|
min = v;
|
|
40033
|
-
minSV = new SemVer(min,
|
|
40033
|
+
minSV = new SemVer(min, options2);
|
|
40034
40034
|
}
|
|
40035
40035
|
}
|
|
40036
40036
|
});
|
|
@@ -40104,9 +40104,9 @@ var require_valid2 = __commonJS({
|
|
|
40104
40104
|
"node_modules/semver/ranges/valid.js"(exports2, module2) {
|
|
40105
40105
|
"use strict";
|
|
40106
40106
|
var Range = require_range();
|
|
40107
|
-
var validRange = (range,
|
|
40107
|
+
var validRange = (range, options2) => {
|
|
40108
40108
|
try {
|
|
40109
|
-
return new Range(range,
|
|
40109
|
+
return new Range(range, options2).range || "*";
|
|
40110
40110
|
} catch (er) {
|
|
40111
40111
|
return null;
|
|
40112
40112
|
}
|
|
@@ -40128,9 +40128,9 @@ var require_outside = __commonJS({
|
|
|
40128
40128
|
var lt2 = require_lt();
|
|
40129
40129
|
var lte = require_lte();
|
|
40130
40130
|
var gte = require_gte();
|
|
40131
|
-
var outside = (version, range, hilo,
|
|
40132
|
-
version = new SemVer(version,
|
|
40133
|
-
range = new Range(range,
|
|
40131
|
+
var outside = (version, range, hilo, options2) => {
|
|
40132
|
+
version = new SemVer(version, options2);
|
|
40133
|
+
range = new Range(range, options2);
|
|
40134
40134
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
40135
40135
|
switch (hilo) {
|
|
40136
40136
|
case ">":
|
|
@@ -40150,7 +40150,7 @@ var require_outside = __commonJS({
|
|
|
40150
40150
|
default:
|
|
40151
40151
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
40152
40152
|
}
|
|
40153
|
-
if (satisfies(version, range,
|
|
40153
|
+
if (satisfies(version, range, options2)) {
|
|
40154
40154
|
return false;
|
|
40155
40155
|
}
|
|
40156
40156
|
for (let i = 0; i < range.set.length; ++i) {
|
|
@@ -40163,9 +40163,9 @@ var require_outside = __commonJS({
|
|
|
40163
40163
|
}
|
|
40164
40164
|
high = high || comparator;
|
|
40165
40165
|
low = low || comparator;
|
|
40166
|
-
if (gtfn(comparator.semver, high.semver,
|
|
40166
|
+
if (gtfn(comparator.semver, high.semver, options2)) {
|
|
40167
40167
|
high = comparator;
|
|
40168
|
-
} else if (ltfn(comparator.semver, low.semver,
|
|
40168
|
+
} else if (ltfn(comparator.semver, low.semver, options2)) {
|
|
40169
40169
|
low = comparator;
|
|
40170
40170
|
}
|
|
40171
40171
|
});
|
|
@@ -40189,7 +40189,7 @@ var require_gtr = __commonJS({
|
|
|
40189
40189
|
"node_modules/semver/ranges/gtr.js"(exports2, module2) {
|
|
40190
40190
|
"use strict";
|
|
40191
40191
|
var outside = require_outside();
|
|
40192
|
-
var gtr = (version, range,
|
|
40192
|
+
var gtr = (version, range, options2) => outside(version, range, ">", options2);
|
|
40193
40193
|
module2.exports = gtr;
|
|
40194
40194
|
}
|
|
40195
40195
|
});
|
|
@@ -40199,7 +40199,7 @@ var require_ltr = __commonJS({
|
|
|
40199
40199
|
"node_modules/semver/ranges/ltr.js"(exports2, module2) {
|
|
40200
40200
|
"use strict";
|
|
40201
40201
|
var outside = require_outside();
|
|
40202
|
-
var ltr = (version, range,
|
|
40202
|
+
var ltr = (version, range, options2) => outside(version, range, "<", options2);
|
|
40203
40203
|
module2.exports = ltr;
|
|
40204
40204
|
}
|
|
40205
40205
|
});
|
|
@@ -40209,10 +40209,10 @@ var require_intersects = __commonJS({
|
|
|
40209
40209
|
"node_modules/semver/ranges/intersects.js"(exports2, module2) {
|
|
40210
40210
|
"use strict";
|
|
40211
40211
|
var Range = require_range();
|
|
40212
|
-
var intersects = (r1, r2,
|
|
40213
|
-
r1 = new Range(r1,
|
|
40214
|
-
r2 = new Range(r2,
|
|
40215
|
-
return r1.intersects(r2,
|
|
40212
|
+
var intersects = (r1, r2, options2) => {
|
|
40213
|
+
r1 = new Range(r1, options2);
|
|
40214
|
+
r2 = new Range(r2, options2);
|
|
40215
|
+
return r1.intersects(r2, options2);
|
|
40216
40216
|
};
|
|
40217
40217
|
module2.exports = intersects;
|
|
40218
40218
|
}
|
|
@@ -40224,13 +40224,13 @@ var require_simplify = __commonJS({
|
|
|
40224
40224
|
"use strict";
|
|
40225
40225
|
var satisfies = require_satisfies();
|
|
40226
40226
|
var compare = require_compare();
|
|
40227
|
-
module2.exports = (versions, range,
|
|
40227
|
+
module2.exports = (versions, range, options2) => {
|
|
40228
40228
|
const set = [];
|
|
40229
40229
|
let first = null;
|
|
40230
40230
|
let prev = null;
|
|
40231
|
-
const v = versions.sort((a, b) => compare(a, b,
|
|
40231
|
+
const v = versions.sort((a, b) => compare(a, b, options2));
|
|
40232
40232
|
for (const version of v) {
|
|
40233
|
-
const included = satisfies(version, range,
|
|
40233
|
+
const included = satisfies(version, range, options2);
|
|
40234
40234
|
if (included) {
|
|
40235
40235
|
prev = version;
|
|
40236
40236
|
if (!first) {
|
|
@@ -40277,16 +40277,16 @@ var require_subset = __commonJS({
|
|
|
40277
40277
|
var { ANY } = Comparator;
|
|
40278
40278
|
var satisfies = require_satisfies();
|
|
40279
40279
|
var compare = require_compare();
|
|
40280
|
-
var subset = (sub, dom,
|
|
40280
|
+
var subset = (sub, dom, options2 = {}) => {
|
|
40281
40281
|
if (sub === dom) {
|
|
40282
40282
|
return true;
|
|
40283
40283
|
}
|
|
40284
|
-
sub = new Range(sub,
|
|
40285
|
-
dom = new Range(dom,
|
|
40284
|
+
sub = new Range(sub, options2);
|
|
40285
|
+
dom = new Range(dom, options2);
|
|
40286
40286
|
let sawNonNull = false;
|
|
40287
40287
|
OUTER: for (const simpleSub of sub.set) {
|
|
40288
40288
|
for (const simpleDom of dom.set) {
|
|
40289
|
-
const isSub = simpleSubset(simpleSub, simpleDom,
|
|
40289
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options2);
|
|
40290
40290
|
sawNonNull = sawNonNull || isSub !== null;
|
|
40291
40291
|
if (isSub) {
|
|
40292
40292
|
continue OUTER;
|
|
@@ -40300,21 +40300,21 @@ var require_subset = __commonJS({
|
|
|
40300
40300
|
};
|
|
40301
40301
|
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
40302
40302
|
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
40303
|
-
var simpleSubset = (sub, dom,
|
|
40303
|
+
var simpleSubset = (sub, dom, options2) => {
|
|
40304
40304
|
if (sub === dom) {
|
|
40305
40305
|
return true;
|
|
40306
40306
|
}
|
|
40307
40307
|
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
40308
40308
|
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
40309
40309
|
return true;
|
|
40310
|
-
} else if (
|
|
40310
|
+
} else if (options2.includePrerelease) {
|
|
40311
40311
|
sub = minimumVersionWithPreRelease;
|
|
40312
40312
|
} else {
|
|
40313
40313
|
sub = minimumVersion;
|
|
40314
40314
|
}
|
|
40315
40315
|
}
|
|
40316
40316
|
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
40317
|
-
if (
|
|
40317
|
+
if (options2.includePrerelease) {
|
|
40318
40318
|
return true;
|
|
40319
40319
|
} else {
|
|
40320
40320
|
dom = minimumVersion;
|
|
@@ -40324,9 +40324,9 @@ var require_subset = __commonJS({
|
|
|
40324
40324
|
let gt, lt2;
|
|
40325
40325
|
for (const c of sub) {
|
|
40326
40326
|
if (c.operator === ">" || c.operator === ">=") {
|
|
40327
|
-
gt = higherGT(gt, c,
|
|
40327
|
+
gt = higherGT(gt, c, options2);
|
|
40328
40328
|
} else if (c.operator === "<" || c.operator === "<=") {
|
|
40329
|
-
lt2 = lowerLT(lt2, c,
|
|
40329
|
+
lt2 = lowerLT(lt2, c, options2);
|
|
40330
40330
|
} else {
|
|
40331
40331
|
eqSet.add(c.semver);
|
|
40332
40332
|
}
|
|
@@ -40336,7 +40336,7 @@ var require_subset = __commonJS({
|
|
|
40336
40336
|
}
|
|
40337
40337
|
let gtltComp;
|
|
40338
40338
|
if (gt && lt2) {
|
|
40339
|
-
gtltComp = compare(gt.semver, lt2.semver,
|
|
40339
|
+
gtltComp = compare(gt.semver, lt2.semver, options2);
|
|
40340
40340
|
if (gtltComp > 0) {
|
|
40341
40341
|
return null;
|
|
40342
40342
|
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt2.operator !== "<=")) {
|
|
@@ -40344,14 +40344,14 @@ var require_subset = __commonJS({
|
|
|
40344
40344
|
}
|
|
40345
40345
|
}
|
|
40346
40346
|
for (const eq of eqSet) {
|
|
40347
|
-
if (gt && !satisfies(eq, String(gt),
|
|
40347
|
+
if (gt && !satisfies(eq, String(gt), options2)) {
|
|
40348
40348
|
return null;
|
|
40349
40349
|
}
|
|
40350
|
-
if (lt2 && !satisfies(eq, String(lt2),
|
|
40350
|
+
if (lt2 && !satisfies(eq, String(lt2), options2)) {
|
|
40351
40351
|
return null;
|
|
40352
40352
|
}
|
|
40353
40353
|
for (const c of dom) {
|
|
40354
|
-
if (!satisfies(eq, String(c),
|
|
40354
|
+
if (!satisfies(eq, String(c), options2)) {
|
|
40355
40355
|
return false;
|
|
40356
40356
|
}
|
|
40357
40357
|
}
|
|
@@ -40359,8 +40359,8 @@ var require_subset = __commonJS({
|
|
|
40359
40359
|
}
|
|
40360
40360
|
let higher, lower;
|
|
40361
40361
|
let hasDomLT, hasDomGT;
|
|
40362
|
-
let needDomLTPre = lt2 && !
|
|
40363
|
-
let needDomGTPre = gt && !
|
|
40362
|
+
let needDomLTPre = lt2 && !options2.includePrerelease && lt2.semver.prerelease.length ? lt2.semver : false;
|
|
40363
|
+
let needDomGTPre = gt && !options2.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
40364
40364
|
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt2.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
40365
40365
|
needDomLTPre = false;
|
|
40366
40366
|
}
|
|
@@ -40374,11 +40374,11 @@ var require_subset = __commonJS({
|
|
|
40374
40374
|
}
|
|
40375
40375
|
}
|
|
40376
40376
|
if (c.operator === ">" || c.operator === ">=") {
|
|
40377
|
-
higher = higherGT(gt, c,
|
|
40377
|
+
higher = higherGT(gt, c, options2);
|
|
40378
40378
|
if (higher === c && higher !== gt) {
|
|
40379
40379
|
return false;
|
|
40380
40380
|
}
|
|
40381
|
-
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c),
|
|
40381
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options2)) {
|
|
40382
40382
|
return false;
|
|
40383
40383
|
}
|
|
40384
40384
|
}
|
|
@@ -40389,11 +40389,11 @@ var require_subset = __commonJS({
|
|
|
40389
40389
|
}
|
|
40390
40390
|
}
|
|
40391
40391
|
if (c.operator === "<" || c.operator === "<=") {
|
|
40392
|
-
lower = lowerLT(lt2, c,
|
|
40392
|
+
lower = lowerLT(lt2, c, options2);
|
|
40393
40393
|
if (lower === c && lower !== lt2) {
|
|
40394
40394
|
return false;
|
|
40395
40395
|
}
|
|
40396
|
-
} else if (lt2.operator === "<=" && !satisfies(lt2.semver, String(c),
|
|
40396
|
+
} else if (lt2.operator === "<=" && !satisfies(lt2.semver, String(c), options2)) {
|
|
40397
40397
|
return false;
|
|
40398
40398
|
}
|
|
40399
40399
|
}
|
|
@@ -40412,18 +40412,18 @@ var require_subset = __commonJS({
|
|
|
40412
40412
|
}
|
|
40413
40413
|
return true;
|
|
40414
40414
|
};
|
|
40415
|
-
var higherGT = (a, b,
|
|
40415
|
+
var higherGT = (a, b, options2) => {
|
|
40416
40416
|
if (!a) {
|
|
40417
40417
|
return b;
|
|
40418
40418
|
}
|
|
40419
|
-
const comp = compare(a.semver, b.semver,
|
|
40419
|
+
const comp = compare(a.semver, b.semver, options2);
|
|
40420
40420
|
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
40421
40421
|
};
|
|
40422
|
-
var lowerLT = (a, b,
|
|
40422
|
+
var lowerLT = (a, b, options2) => {
|
|
40423
40423
|
if (!a) {
|
|
40424
40424
|
return b;
|
|
40425
40425
|
}
|
|
40426
|
-
const comp = compare(a.semver, b.semver,
|
|
40426
|
+
const comp = compare(a.semver, b.semver, options2);
|
|
40427
40427
|
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
40428
40428
|
};
|
|
40429
40429
|
module2.exports = subset;
|
|
@@ -40533,10 +40533,10 @@ var require_posix = __commonJS({
|
|
|
40533
40533
|
exports2.sync = exports2.isexe = void 0;
|
|
40534
40534
|
var fs_1 = require("fs");
|
|
40535
40535
|
var promises_1 = require("fs/promises");
|
|
40536
|
-
var isexe = async (path5,
|
|
40537
|
-
const { ignoreErrors = false } =
|
|
40536
|
+
var isexe = async (path5, options2 = {}) => {
|
|
40537
|
+
const { ignoreErrors = false } = options2;
|
|
40538
40538
|
try {
|
|
40539
|
-
return checkStat(await (0, promises_1.stat)(path5),
|
|
40539
|
+
return checkStat(await (0, promises_1.stat)(path5), options2);
|
|
40540
40540
|
} catch (e) {
|
|
40541
40541
|
const er = e;
|
|
40542
40542
|
if (ignoreErrors || er.code === "EACCES")
|
|
@@ -40545,10 +40545,10 @@ var require_posix = __commonJS({
|
|
|
40545
40545
|
}
|
|
40546
40546
|
};
|
|
40547
40547
|
exports2.isexe = isexe;
|
|
40548
|
-
var sync2 = (path5,
|
|
40549
|
-
const { ignoreErrors = false } =
|
|
40548
|
+
var sync2 = (path5, options2 = {}) => {
|
|
40549
|
+
const { ignoreErrors = false } = options2;
|
|
40550
40550
|
try {
|
|
40551
|
-
return checkStat((0, fs_1.statSync)(path5),
|
|
40551
|
+
return checkStat((0, fs_1.statSync)(path5), options2);
|
|
40552
40552
|
} catch (e) {
|
|
40553
40553
|
const er = e;
|
|
40554
40554
|
if (ignoreErrors || er.code === "EACCES")
|
|
@@ -40557,11 +40557,11 @@ var require_posix = __commonJS({
|
|
|
40557
40557
|
}
|
|
40558
40558
|
};
|
|
40559
40559
|
exports2.sync = sync2;
|
|
40560
|
-
var checkStat = (stat,
|
|
40561
|
-
var checkMode = (stat,
|
|
40562
|
-
const myUid =
|
|
40563
|
-
const myGroups =
|
|
40564
|
-
const myGid =
|
|
40560
|
+
var checkStat = (stat, options2) => stat.isFile() && checkMode(stat, options2);
|
|
40561
|
+
var checkMode = (stat, options2) => {
|
|
40562
|
+
const myUid = options2.uid ?? process.getuid?.();
|
|
40563
|
+
const myGroups = options2.groups ?? process.getgroups?.() ?? [];
|
|
40564
|
+
const myGid = options2.gid ?? process.getgid?.() ?? myGroups[0];
|
|
40565
40565
|
if (myUid === void 0 || myGid === void 0) {
|
|
40566
40566
|
throw new Error("cannot get uid or gid");
|
|
40567
40567
|
}
|
|
@@ -40586,10 +40586,10 @@ var require_win32 = __commonJS({
|
|
|
40586
40586
|
exports2.sync = exports2.isexe = void 0;
|
|
40587
40587
|
var fs_1 = require("fs");
|
|
40588
40588
|
var promises_1 = require("fs/promises");
|
|
40589
|
-
var isexe = async (path5,
|
|
40590
|
-
const { ignoreErrors = false } =
|
|
40589
|
+
var isexe = async (path5, options2 = {}) => {
|
|
40590
|
+
const { ignoreErrors = false } = options2;
|
|
40591
40591
|
try {
|
|
40592
|
-
return checkStat(await (0, promises_1.stat)(path5), path5,
|
|
40592
|
+
return checkStat(await (0, promises_1.stat)(path5), path5, options2);
|
|
40593
40593
|
} catch (e) {
|
|
40594
40594
|
const er = e;
|
|
40595
40595
|
if (ignoreErrors || er.code === "EACCES")
|
|
@@ -40598,10 +40598,10 @@ var require_win32 = __commonJS({
|
|
|
40598
40598
|
}
|
|
40599
40599
|
};
|
|
40600
40600
|
exports2.isexe = isexe;
|
|
40601
|
-
var sync2 = (path5,
|
|
40602
|
-
const { ignoreErrors = false } =
|
|
40601
|
+
var sync2 = (path5, options2 = {}) => {
|
|
40602
|
+
const { ignoreErrors = false } = options2;
|
|
40603
40603
|
try {
|
|
40604
|
-
return checkStat((0, fs_1.statSync)(path5), path5,
|
|
40604
|
+
return checkStat((0, fs_1.statSync)(path5), path5, options2);
|
|
40605
40605
|
} catch (e) {
|
|
40606
40606
|
const er = e;
|
|
40607
40607
|
if (ignoreErrors || er.code === "EACCES")
|
|
@@ -40610,8 +40610,8 @@ var require_win32 = __commonJS({
|
|
|
40610
40610
|
}
|
|
40611
40611
|
};
|
|
40612
40612
|
exports2.sync = sync2;
|
|
40613
|
-
var checkPathExt = (path5,
|
|
40614
|
-
const { pathExt = process.env.PATHEXT || "" } =
|
|
40613
|
+
var checkPathExt = (path5, options2) => {
|
|
40614
|
+
const { pathExt = process.env.PATHEXT || "" } = options2;
|
|
40615
40615
|
const peSplit = pathExt.split(";");
|
|
40616
40616
|
if (peSplit.indexOf("") !== -1) {
|
|
40617
40617
|
return true;
|
|
@@ -40625,7 +40625,7 @@ var require_win32 = __commonJS({
|
|
|
40625
40625
|
}
|
|
40626
40626
|
return false;
|
|
40627
40627
|
};
|
|
40628
|
-
var checkStat = (stat, path5,
|
|
40628
|
+
var checkStat = (stat, path5, options2) => stat.isFile() && checkPathExt(path5, options2);
|
|
40629
40629
|
}
|
|
40630
40630
|
});
|
|
40631
40631
|
|
|
@@ -40849,16 +40849,16 @@ var Utils = class {
|
|
|
40849
40849
|
return process.env[this.isWindows() ? "USERPROFILE" : "HOME"] || process.cwd();
|
|
40850
40850
|
}
|
|
40851
40851
|
static buildOptions(stdin) {
|
|
40852
|
-
const
|
|
40852
|
+
const options2 = {
|
|
40853
40853
|
windowsHide: true
|
|
40854
40854
|
};
|
|
40855
40855
|
if (stdin) {
|
|
40856
|
-
|
|
40856
|
+
options2.stdio = ["pipe", "pipe", "pipe"];
|
|
40857
40857
|
}
|
|
40858
40858
|
if (!this.isWindows() && !process.env.WAKATIME_HOME && !process.env.HOME) {
|
|
40859
|
-
|
|
40859
|
+
options2["env"] = { ...process.env, WAKATIME_HOME: this.getHomeDirectory() };
|
|
40860
40860
|
}
|
|
40861
|
-
return
|
|
40861
|
+
return options2;
|
|
40862
40862
|
}
|
|
40863
40863
|
static timestamp() {
|
|
40864
40864
|
return Date.now() / 1e3;
|
|
@@ -41020,7 +41020,7 @@ var Options = class {
|
|
|
41020
41020
|
};
|
|
41021
41021
|
|
|
41022
41022
|
// src/version.ts
|
|
41023
|
-
var VERSION = "
|
|
41023
|
+
var VERSION = "3.0.1";
|
|
41024
41024
|
|
|
41025
41025
|
// src/dependencies.ts
|
|
41026
41026
|
var import_adm_zip = __toESM(require_adm_zip());
|
|
@@ -41032,7 +41032,7 @@ var request = __toESM(require_request3());
|
|
|
41032
41032
|
var semver = __toESM(require_semver2());
|
|
41033
41033
|
var which = __toESM(require_lib6());
|
|
41034
41034
|
var Dependencies = class {
|
|
41035
|
-
constructor(
|
|
41035
|
+
constructor(options2, logger2) {
|
|
41036
41036
|
this.cliLocation = void 0;
|
|
41037
41037
|
this.cliLocationGlobal = void 0;
|
|
41038
41038
|
this.cliInstalled = false;
|
|
@@ -41041,9 +41041,9 @@ var Dependencies = class {
|
|
|
41041
41041
|
this.legacyOperatingSystems = {
|
|
41042
41042
|
["darwin" /* darwin */]: [{ kernelLessThan: "17.0.0", tag: "v1.39.1-alpha.1" }]
|
|
41043
41043
|
};
|
|
41044
|
-
this.options =
|
|
41044
|
+
this.options = options2;
|
|
41045
41045
|
this.logger = logger2;
|
|
41046
|
-
this.resourcesLocation =
|
|
41046
|
+
this.resourcesLocation = options2.resourcesLocation;
|
|
41047
41047
|
}
|
|
41048
41048
|
getCliLocation() {
|
|
41049
41049
|
if (this.cliLocation) return this.cliLocation;
|
|
@@ -41092,9 +41092,9 @@ var Dependencies = class {
|
|
|
41092
41092
|
return;
|
|
41093
41093
|
}
|
|
41094
41094
|
let args = ["--version"];
|
|
41095
|
-
const
|
|
41095
|
+
const options2 = Utils.buildOptions();
|
|
41096
41096
|
try {
|
|
41097
|
-
child_process.execFile(this.getCliLocation(), args,
|
|
41097
|
+
child_process.execFile(this.getCliLocation(), args, options2, (error, _stdout, stderr) => {
|
|
41098
41098
|
if (!(error != null)) {
|
|
41099
41099
|
let currentVersion = _stdout.toString().trim() + stderr.toString().trim();
|
|
41100
41100
|
this.logger.debug(`Current wakatime-cli version is ${currentVersion}`);
|
|
@@ -41140,21 +41140,21 @@ var Dependencies = class {
|
|
|
41140
41140
|
getLatestCliVersion(callback) {
|
|
41141
41141
|
const proxy = this.options.getSetting("settings", "proxy");
|
|
41142
41142
|
const noSSLVerify = this.options.getSetting("settings", "no_ssl_verify");
|
|
41143
|
-
let
|
|
41143
|
+
let options2 = {
|
|
41144
41144
|
url: this.githubReleasesUrl,
|
|
41145
41145
|
json: true,
|
|
41146
41146
|
headers: {
|
|
41147
41147
|
"User-Agent": "github.com/wakatime/claude-code-wakatime"
|
|
41148
41148
|
}
|
|
41149
41149
|
};
|
|
41150
|
-
this.logger.debug(`Fetching latest wakatime-cli version from GitHub API: ${
|
|
41150
|
+
this.logger.debug(`Fetching latest wakatime-cli version from GitHub API: ${options2.url}`);
|
|
41151
41151
|
if (proxy) {
|
|
41152
41152
|
this.logger.debug(`Using Proxy: ${proxy}`);
|
|
41153
|
-
|
|
41153
|
+
options2["proxy"] = proxy;
|
|
41154
41154
|
}
|
|
41155
|
-
if (noSSLVerify === "true")
|
|
41155
|
+
if (noSSLVerify === "true") options2["strictSSL"] = false;
|
|
41156
41156
|
try {
|
|
41157
|
-
request.get(
|
|
41157
|
+
request.get(options2, (error, response, json) => {
|
|
41158
41158
|
if (!error && response && response.statusCode == 200) {
|
|
41159
41159
|
this.logger.debug(`GitHub API Response ${response.statusCode}`);
|
|
41160
41160
|
const latestCliVersion = json["tag_name"];
|
|
@@ -41251,14 +41251,14 @@ var Dependencies = class {
|
|
|
41251
41251
|
downloadFile(url, outputFile, callback, error) {
|
|
41252
41252
|
const proxy = this.options.getSetting("settings", "proxy");
|
|
41253
41253
|
const noSSLVerify = this.options.getSetting("settings", "no_ssl_verify");
|
|
41254
|
-
let
|
|
41254
|
+
let options2 = { url };
|
|
41255
41255
|
if (proxy) {
|
|
41256
41256
|
this.logger.debug(`Using Proxy: ${proxy}`);
|
|
41257
|
-
|
|
41257
|
+
options2["proxy"] = proxy;
|
|
41258
41258
|
}
|
|
41259
|
-
if (noSSLVerify === "true")
|
|
41259
|
+
if (noSSLVerify === "true") options2["strictSSL"] = false;
|
|
41260
41260
|
try {
|
|
41261
|
-
let r = request.get(
|
|
41261
|
+
let r = request.get(options2);
|
|
41262
41262
|
r.on("error", (e) => {
|
|
41263
41263
|
this.logger.warn(`Failed to download ${url}`);
|
|
41264
41264
|
this.logger.warn(e.toString());
|
|
@@ -41356,11 +41356,11 @@ var Dependencies = class {
|
|
|
41356
41356
|
const url = `https://api.wakatime.com/api/v1/cli-missing?osname=${osname}&architecture=${architecture}&plugin=claude-code`;
|
|
41357
41357
|
const proxy = this.options.getSetting("settings", "proxy");
|
|
41358
41358
|
const noSSLVerify = this.options.getSetting("settings", "no_ssl_verify");
|
|
41359
|
-
let
|
|
41360
|
-
if (proxy)
|
|
41361
|
-
if (noSSLVerify === "true")
|
|
41359
|
+
let options2 = { url };
|
|
41360
|
+
if (proxy) options2["proxy"] = proxy;
|
|
41361
|
+
if (noSSLVerify === "true") options2["strictSSL"] = false;
|
|
41362
41362
|
try {
|
|
41363
|
-
request.get(
|
|
41363
|
+
request.get(options2);
|
|
41364
41364
|
} catch (e) {
|
|
41365
41365
|
}
|
|
41366
41366
|
}
|
|
@@ -41437,8 +41437,9 @@ var Logger = class {
|
|
|
41437
41437
|
|
|
41438
41438
|
// src/index.ts
|
|
41439
41439
|
var STATE_FILE = import_path2.default.join(import_os2.default.homedir(), ".wakatime", "claude-code.json");
|
|
41440
|
-
var WAKATIME_CLI = import_path2.default.join(import_os2.default.homedir(), ".wakatime", "wakatime-cli");
|
|
41441
41440
|
var logger = new Logger();
|
|
41441
|
+
var options = new Options();
|
|
41442
|
+
var deps = new Dependencies(options, logger);
|
|
41442
41443
|
function shouldSendHeartbeat(inp) {
|
|
41443
41444
|
if (inp?.hook_event_name === "Stop") {
|
|
41444
41445
|
return true;
|
|
@@ -41566,21 +41567,21 @@ function updateState() {
|
|
|
41566
41567
|
import_fs2.default.mkdirSync(import_path2.default.dirname(STATE_FILE), { recursive: true });
|
|
41567
41568
|
import_fs2.default.writeFileSync(STATE_FILE, JSON.stringify({ lastHeartbeatAt: Utils.timestamp() }, null, 2));
|
|
41568
41569
|
}
|
|
41570
|
+
function getEntityFile(inp) {
|
|
41571
|
+
if (!inp?.transcript_path) return;
|
|
41572
|
+
return getModifiedFile(inp.transcript_path);
|
|
41573
|
+
}
|
|
41569
41574
|
function sendHeartbeat(inp) {
|
|
41570
41575
|
const projectFolder = inp?.cwd;
|
|
41571
41576
|
try {
|
|
41572
|
-
|
|
41573
|
-
if (
|
|
41574
|
-
|
|
41575
|
-
if (modifiedFile) {
|
|
41576
|
-
entity = modifiedFile;
|
|
41577
|
-
}
|
|
41578
|
-
}
|
|
41577
|
+
const entity = getEntityFile(inp);
|
|
41578
|
+
if (!entity) return;
|
|
41579
|
+
const wakatime_cli = deps.getCliLocation();
|
|
41579
41580
|
const args = [
|
|
41580
41581
|
"--entity",
|
|
41581
41582
|
entity,
|
|
41582
41583
|
"--entity-type",
|
|
41583
|
-
|
|
41584
|
+
"file",
|
|
41584
41585
|
"--category",
|
|
41585
41586
|
"ai coding",
|
|
41586
41587
|
"--plugin",
|
|
@@ -41597,9 +41598,9 @@ function sendHeartbeat(inp) {
|
|
|
41597
41598
|
args.push(lineChanges.toString());
|
|
41598
41599
|
}
|
|
41599
41600
|
}
|
|
41600
|
-
logger.debug(`Sending heartbeat: ${args}`);
|
|
41601
|
-
const
|
|
41602
|
-
(0, import_child_process.execFile)(
|
|
41601
|
+
logger.debug(`Sending heartbeat: ${wakatime_cli} ${args}`);
|
|
41602
|
+
const execOptions = Utils.buildOptions();
|
|
41603
|
+
(0, import_child_process.execFile)(wakatime_cli, args, execOptions, (error, stdout, stderr) => {
|
|
41603
41604
|
const output = stdout.toString().trim() + stderr.toString().trim();
|
|
41604
41605
|
if (output) logger.error(output);
|
|
41605
41606
|
if (error) logger.error(error.toString());
|
|
@@ -41610,19 +41611,15 @@ function sendHeartbeat(inp) {
|
|
|
41610
41611
|
}
|
|
41611
41612
|
function main() {
|
|
41612
41613
|
const inp = parseInput();
|
|
41613
|
-
const options = new Options();
|
|
41614
41614
|
const debug = options.getSetting("settings", "debug");
|
|
41615
41615
|
logger.setLevel(debug === "true" ? 0 /* DEBUG */ : 1 /* INFO */);
|
|
41616
|
-
const deps = new Dependencies(options, logger);
|
|
41617
41616
|
if (inp) {
|
|
41618
41617
|
try {
|
|
41619
41618
|
logger.debug(JSON.stringify(inp, null, 2));
|
|
41620
41619
|
} catch (err) {
|
|
41621
41620
|
}
|
|
41622
41621
|
}
|
|
41623
|
-
|
|
41624
|
-
deps.checkAndInstallCli();
|
|
41625
|
-
}
|
|
41622
|
+
deps.checkAndInstallCli();
|
|
41626
41623
|
if (shouldSendHeartbeat(inp)) {
|
|
41627
41624
|
sendHeartbeat(inp);
|
|
41628
41625
|
updateState();
|