@datadog/datadog-ci-plugin-synthetics 5.18.0 → 5.20.0
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/bundle.d.ts +57 -22
- package/dist/bundle.js +787 -454
- package/dist/bundle.js.map +1 -1
- package/package.json +6 -3
package/dist/bundle.js
CHANGED
|
@@ -5761,11 +5761,12 @@ var require_glob = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5761
5761
|
var require_package$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5762
5762
|
module.exports = {
|
|
5763
5763
|
"name": "@datadog/datadog-ci-base",
|
|
5764
|
-
"version": "5.
|
|
5764
|
+
"version": "5.20.0",
|
|
5765
5765
|
"description": "Base package for Datadog CI",
|
|
5766
5766
|
"license": "Apache-2.0",
|
|
5767
5767
|
"keywords": ["datadog", "datadog-ci"],
|
|
5768
5768
|
"homepage": "https://github.com/DataDog/datadog-ci/tree/master/packages/base",
|
|
5769
|
+
"bugs": { "url": "https://github.com/DataDog/datadog-ci/issues" },
|
|
5769
5770
|
"repository": {
|
|
5770
5771
|
"type": "git",
|
|
5771
5772
|
"url": "https://github.com/DataDog/datadog-ci.git",
|
|
@@ -5857,12 +5858,12 @@ var require_package$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5857
5858
|
"debug": "^4.4.1",
|
|
5858
5859
|
"deep-extend": "^0.6.0",
|
|
5859
5860
|
"fast-xml-parser": "^5.7.2",
|
|
5860
|
-
"form-data": "^4.0.
|
|
5861
|
+
"form-data": "^4.0.6",
|
|
5861
5862
|
"glob": "^13.0.6",
|
|
5862
5863
|
"inquirer": "^8.2.7",
|
|
5863
5864
|
"is-docker": "^4.0.0",
|
|
5864
5865
|
"jest-diff": "^30.2.0",
|
|
5865
|
-
"js-yaml": "^4.
|
|
5866
|
+
"js-yaml": "^4.2.0",
|
|
5866
5867
|
"jszip": "^3.10.1",
|
|
5867
5868
|
"proxy-agent": "^6.4.0",
|
|
5868
5869
|
"semver": "^7.6.3",
|
|
@@ -5870,7 +5871,7 @@ var require_package$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5870
5871
|
"terminal-link": "^2.1.1",
|
|
5871
5872
|
"tiny-async-pool": "^2.1.0",
|
|
5872
5873
|
"typanion": "^3.14.0",
|
|
5873
|
-
"undici": "^7.
|
|
5874
|
+
"undici": "^7.28.0",
|
|
5874
5875
|
"upath": "^2.0.1"
|
|
5875
5876
|
},
|
|
5876
5877
|
"devDependencies": {
|
|
@@ -5885,6 +5886,71 @@ var require_package$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
5885
5886
|
};
|
|
5886
5887
|
}));
|
|
5887
5888
|
//#endregion
|
|
5889
|
+
//#region ../base/dist/constants.js
|
|
5890
|
+
var require_constants$12 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5891
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5892
|
+
exports.METHOD_POST = exports.CONTENT_TYPE_VALUE_JSON = exports.CONTENT_TYPE_VALUE_PROTOBUF = exports.CONTENT_TYPE_HEADER = exports.SKIP_VERSION_BANNER_ENV_VAR = exports.LOG_FORMAT_ENV_VAR = exports.FIPS_IGNORE_ERROR_ENV_VAR = exports.FIPS_ENV_VAR = exports.DATADOG_SITES = exports.DATADOG_SITE_US2_GOV = exports.DATADOG_SITE_GOV = exports.DATADOG_SITE_AP2 = exports.DATADOG_SITE_AP1 = exports.DATADOG_SITE_US5 = exports.DATADOG_SITE_US3 = exports.DATADOG_SITE_EU1 = exports.DATADOG_SITE_US1 = void 0;
|
|
5893
|
+
exports.DATADOG_SITE_US1 = "datadoghq.com";
|
|
5894
|
+
exports.DATADOG_SITE_EU1 = "datadoghq.eu";
|
|
5895
|
+
exports.DATADOG_SITE_US3 = "us3.datadoghq.com";
|
|
5896
|
+
exports.DATADOG_SITE_US5 = "us5.datadoghq.com";
|
|
5897
|
+
exports.DATADOG_SITE_AP1 = "ap1.datadoghq.com";
|
|
5898
|
+
exports.DATADOG_SITE_AP2 = "ap2.datadoghq.com";
|
|
5899
|
+
exports.DATADOG_SITE_GOV = "ddog-gov.com";
|
|
5900
|
+
exports.DATADOG_SITE_US2_GOV = "us2.ddog-gov.com";
|
|
5901
|
+
exports.DATADOG_SITES = [
|
|
5902
|
+
exports.DATADOG_SITE_US1,
|
|
5903
|
+
exports.DATADOG_SITE_EU1,
|
|
5904
|
+
exports.DATADOG_SITE_US3,
|
|
5905
|
+
exports.DATADOG_SITE_US5,
|
|
5906
|
+
exports.DATADOG_SITE_AP1,
|
|
5907
|
+
exports.DATADOG_SITE_AP2,
|
|
5908
|
+
exports.DATADOG_SITE_GOV,
|
|
5909
|
+
exports.DATADOG_SITE_US2_GOV
|
|
5910
|
+
];
|
|
5911
|
+
exports.FIPS_ENV_VAR = "DATADOG_FIPS";
|
|
5912
|
+
exports.FIPS_IGNORE_ERROR_ENV_VAR = "DATADOG_FIPS_IGNORE_ERROR";
|
|
5913
|
+
exports.LOG_FORMAT_ENV_VAR = "DD_LOG_FORMAT";
|
|
5914
|
+
exports.SKIP_VERSION_BANNER_ENV_VAR = "DD_CI_SKIP_VERSION_BANNER";
|
|
5915
|
+
exports.CONTENT_TYPE_HEADER = "Content-Type";
|
|
5916
|
+
exports.CONTENT_TYPE_VALUE_PROTOBUF = "application/x-protobuf";
|
|
5917
|
+
exports.CONTENT_TYPE_VALUE_JSON = "application/json";
|
|
5918
|
+
exports.METHOD_POST = "post";
|
|
5919
|
+
}));
|
|
5920
|
+
//#endregion
|
|
5921
|
+
//#region ../base/dist/helpers/env.js
|
|
5922
|
+
var require_env = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5923
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5924
|
+
exports.toStringMap = exports.toNumber = exports.toBoolean = void 0;
|
|
5925
|
+
const toBoolean = (env) => {
|
|
5926
|
+
if (env === void 0) return;
|
|
5927
|
+
if (env.toLowerCase() === "true" || env === "1") return true;
|
|
5928
|
+
if (env.toLowerCase() === "false" || env === "0") return false;
|
|
5929
|
+
};
|
|
5930
|
+
exports.toBoolean = toBoolean;
|
|
5931
|
+
const toNumber = (env) => {
|
|
5932
|
+
if (env === void 0 || env.trim() === "") return;
|
|
5933
|
+
const number = Number(env);
|
|
5934
|
+
if (isNaN(number)) return;
|
|
5935
|
+
return number;
|
|
5936
|
+
};
|
|
5937
|
+
exports.toNumber = toNumber;
|
|
5938
|
+
const toStringMap = (env) => {
|
|
5939
|
+
if (env === void 0) return;
|
|
5940
|
+
const cleanedEnv = env.replace(/'/g, "\"");
|
|
5941
|
+
try {
|
|
5942
|
+
const parsed = JSON.parse(cleanedEnv);
|
|
5943
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
5944
|
+
for (const key in parsed) if (typeof parsed[key] !== "string") return;
|
|
5945
|
+
return parsed;
|
|
5946
|
+
}
|
|
5947
|
+
} catch (error) {
|
|
5948
|
+
return;
|
|
5949
|
+
}
|
|
5950
|
+
};
|
|
5951
|
+
exports.toStringMap = toStringMap;
|
|
5952
|
+
}));
|
|
5953
|
+
//#endregion
|
|
5888
5954
|
//#region ../base/dist/version.js
|
|
5889
5955
|
var require_version$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5890
5956
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
@@ -5893,12 +5959,23 @@ var require_version$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5893
5959
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5894
5960
|
exports.printVersion = exports.cliVersion = void 0;
|
|
5895
5961
|
const chalk_1 = __importDefault(require_source$3());
|
|
5896
|
-
|
|
5962
|
+
const package_json_1 = require_package$2();
|
|
5963
|
+
const constants_1 = require_constants$12();
|
|
5964
|
+
const env_1 = require_env();
|
|
5965
|
+
exports.cliVersion = package_json_1.version;
|
|
5897
5966
|
/**
|
|
5898
|
-
*
|
|
5967
|
+
* Logs the version in all commands, except version commands. Routed through the
|
|
5968
|
+
* logger so it respects `--log-format` (a JSON line in JSON mode, dim text otherwise).
|
|
5969
|
+
*
|
|
5970
|
+
* Suppressed entirely when `DD_CI_SKIP_VERSION_BANNER` is `1`/`true`, for callers
|
|
5971
|
+
* that find the per-invocation banner too noisy.
|
|
5899
5972
|
*/
|
|
5900
|
-
const printVersion = () => {
|
|
5901
|
-
if (
|
|
5973
|
+
const printVersion = (logger) => {
|
|
5974
|
+
if ((0, env_1.toBoolean)(process.env[constants_1.SKIP_VERSION_BANNER_ENV_VAR])) return;
|
|
5975
|
+
const lastArg = process.argv.at(-1);
|
|
5976
|
+
if (lastArg === "--version" || lastArg === "version" || lastArg === "--help") return;
|
|
5977
|
+
const banner = `datadog-ci v${exports.cliVersion}`;
|
|
5978
|
+
logger.info(logger.isJsonOutput() ? banner : chalk_1.default.dim(banner));
|
|
5902
5979
|
};
|
|
5903
5980
|
exports.printVersion = printVersion;
|
|
5904
5981
|
}));
|
|
@@ -11067,7 +11144,7 @@ var require_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11067
11144
|
}));
|
|
11068
11145
|
//#endregion
|
|
11069
11146
|
//#region ../../node_modules/clipanion/lib/constants.js
|
|
11070
|
-
var require_constants$
|
|
11147
|
+
var require_constants$11 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
11071
11148
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11072
11149
|
const NODE_INITIAL = 0;
|
|
11073
11150
|
const NODE_SUCCESS = 1;
|
|
@@ -11096,7 +11173,7 @@ var require_constants$12 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
11096
11173
|
//#region ../../node_modules/clipanion/lib/errors.js
|
|
11097
11174
|
var require_errors$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
11098
11175
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11099
|
-
var constants = require_constants$
|
|
11176
|
+
var constants = require_constants$11();
|
|
11100
11177
|
/**
|
|
11101
11178
|
* A generic usage error with the name `UsageError`.
|
|
11102
11179
|
*
|
|
@@ -12384,7 +12461,7 @@ var require_Command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
12384
12461
|
//#region ../../node_modules/clipanion/lib/core.js
|
|
12385
12462
|
var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
12386
12463
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12387
|
-
var constants = require_constants$
|
|
12464
|
+
var constants = require_constants$11();
|
|
12388
12465
|
var errors = require_errors$5();
|
|
12389
12466
|
function debug(str) {
|
|
12390
12467
|
if (constants.DEBUG) console.log(str);
|
|
@@ -13281,7 +13358,7 @@ var require_HelpCommand = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13281
13358
|
//#region ../../node_modules/clipanion/lib/advanced/Cli.js
|
|
13282
13359
|
var require_Cli = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13283
13360
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13284
|
-
var constants = require_constants$
|
|
13361
|
+
var constants = require_constants$11();
|
|
13285
13362
|
var core = require_core$1();
|
|
13286
13363
|
var format = require_format();
|
|
13287
13364
|
var platform = require_node$4();
|
|
@@ -14968,7 +15045,7 @@ var require_dist$11 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14968
15045
|
};
|
|
14969
15046
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14970
15047
|
exports.Agent = void 0;
|
|
14971
|
-
const net$
|
|
15048
|
+
const net$12 = __importStar(require("net"));
|
|
14972
15049
|
const http$6 = __importStar(require("http"));
|
|
14973
15050
|
const https_1$2 = require("https");
|
|
14974
15051
|
__exportStar(require_helpers$2(), exports);
|
|
@@ -14993,7 +15070,7 @@ var require_dist$11 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14993
15070
|
incrementSockets(name) {
|
|
14994
15071
|
if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) return null;
|
|
14995
15072
|
if (!this.sockets[name]) this.sockets[name] = [];
|
|
14996
|
-
const fakeSocket = new net$
|
|
15073
|
+
const fakeSocket = new net$12.Socket({ writable: false });
|
|
14997
15074
|
this.sockets[name].push(fakeSocket);
|
|
14998
15075
|
this.totalSocketCount++;
|
|
14999
15076
|
return fakeSocket;
|
|
@@ -15162,7 +15239,7 @@ var require_dist$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15162
15239
|
};
|
|
15163
15240
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15164
15241
|
exports.HttpProxyAgent = void 0;
|
|
15165
|
-
const net$
|
|
15242
|
+
const net$11 = __importStar(require("net"));
|
|
15166
15243
|
const tls$4 = __importStar(require("tls"));
|
|
15167
15244
|
const debug_1 = __importDefault(require_src$2());
|
|
15168
15245
|
const events_1$3 = require("events");
|
|
@@ -15229,7 +15306,7 @@ var require_dist$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15229
15306
|
socket = tls$4.connect(this.connectOpts);
|
|
15230
15307
|
} else {
|
|
15231
15308
|
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
15232
|
-
socket = net$
|
|
15309
|
+
socket = net$11.connect(this.connectOpts);
|
|
15233
15310
|
}
|
|
15234
15311
|
await (0, events_1$3.once)(socket, "connect");
|
|
15235
15312
|
return socket;
|
|
@@ -15368,7 +15445,7 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15368
15445
|
};
|
|
15369
15446
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15370
15447
|
exports.HttpsProxyAgent = void 0;
|
|
15371
|
-
const net$
|
|
15448
|
+
const net$10 = __importStar(require("net"));
|
|
15372
15449
|
const tls$3 = __importStar(require("tls"));
|
|
15373
15450
|
const assert_1 = __importDefault(require("assert"));
|
|
15374
15451
|
const debug_1 = __importDefault(require_src$2());
|
|
@@ -15377,7 +15454,7 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15377
15454
|
const parse_proxy_response_1 = require_parse_proxy_response();
|
|
15378
15455
|
const debug = (0, debug_1.default)("https-proxy-agent");
|
|
15379
15456
|
const setServernameFromNonIpHost = (options) => {
|
|
15380
|
-
if (options.servername === void 0 && options.host && !net$
|
|
15457
|
+
if (options.servername === void 0 && options.host && !net$10.isIP(options.host)) return {
|
|
15381
15458
|
...options,
|
|
15382
15459
|
servername: options.host
|
|
15383
15460
|
};
|
|
@@ -15424,10 +15501,10 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15424
15501
|
socket = tls$3.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
15425
15502
|
} else {
|
|
15426
15503
|
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
15427
|
-
socket = net$
|
|
15504
|
+
socket = net$10.connect(this.connectOpts);
|
|
15428
15505
|
}
|
|
15429
15506
|
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
15430
|
-
const host = net$
|
|
15507
|
+
const host = net$10.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
15431
15508
|
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
|
|
15432
15509
|
if (proxy.username || proxy.password) {
|
|
15433
15510
|
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
@@ -15453,7 +15530,7 @@ var require_dist$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
15453
15530
|
return socket;
|
|
15454
15531
|
}
|
|
15455
15532
|
socket.destroy();
|
|
15456
|
-
const fakeSocket = new net$
|
|
15533
|
+
const fakeSocket = new net$10.Socket({ writable: false });
|
|
15457
15534
|
fakeSocket.readable = true;
|
|
15458
15535
|
req.once("socket", (s) => {
|
|
15459
15536
|
debug("Replaying proxy buffer for failed request");
|
|
@@ -16662,7 +16739,7 @@ var require_smartbuffer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
16662
16739
|
}));
|
|
16663
16740
|
//#endregion
|
|
16664
16741
|
//#region ../../node_modules/socks/build/common/constants.js
|
|
16665
|
-
var require_constants$
|
|
16742
|
+
var require_constants$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
16666
16743
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16667
16744
|
exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0;
|
|
16668
16745
|
exports.DEFAULT_TIMEOUT = 3e4;
|
|
@@ -16810,7 +16887,7 @@ var require_common$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
16810
16887
|
}));
|
|
16811
16888
|
//#endregion
|
|
16812
16889
|
//#region ../../node_modules/ip-address/dist/v4/constants.js
|
|
16813
|
-
var require_constants$
|
|
16890
|
+
var require_constants$9 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
16814
16891
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16815
16892
|
exports.RE_SUBNET_STRING = exports.RE_ADDRESS = exports.GROUPS = exports.BITS = void 0;
|
|
16816
16893
|
exports.BITS = 32;
|
|
@@ -18447,7 +18524,7 @@ var require_ipv4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18447
18524
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18448
18525
|
exports.Address4 = void 0;
|
|
18449
18526
|
const common = __importStar(require_common$2());
|
|
18450
|
-
const constants = __importStar(require_constants$
|
|
18527
|
+
const constants = __importStar(require_constants$9());
|
|
18451
18528
|
const address_error_1 = require_address_error();
|
|
18452
18529
|
const jsbn_1 = require_jsbn$1();
|
|
18453
18530
|
const sprintf_js_1 = require_sprintf();
|
|
@@ -18723,7 +18800,7 @@ var require_ipv4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18723
18800
|
}));
|
|
18724
18801
|
//#endregion
|
|
18725
18802
|
//#region ../../node_modules/ip-address/dist/v6/constants.js
|
|
18726
|
-
var require_constants$
|
|
18803
|
+
var require_constants$8 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
18727
18804
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18728
18805
|
exports.RE_URL_WITH_PORT = exports.RE_URL = exports.RE_ZONE_STRING = exports.RE_SUBNET_STRING = exports.RE_BAD_ADDRESS = exports.RE_BAD_CHARACTERS = exports.TYPES = exports.SCOPES = exports.GROUPS = exports.BITS = void 0;
|
|
18729
18806
|
exports.BITS = 128;
|
|
@@ -18877,7 +18954,7 @@ var require_regular_expressions = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18877
18954
|
};
|
|
18878
18955
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18879
18956
|
exports.possibleElisions = exports.simpleRegularExpression = exports.ADDRESS_BOUNDARY = exports.padGroup = exports.groupPossibilities = void 0;
|
|
18880
|
-
const v6 = __importStar(require_constants$
|
|
18957
|
+
const v6 = __importStar(require_constants$8());
|
|
18881
18958
|
const sprintf_js_1 = require_sprintf();
|
|
18882
18959
|
function groupPossibilities(possibilities) {
|
|
18883
18960
|
return (0, sprintf_js_1.sprintf)("(%s)", possibilities.join("|"));
|
|
@@ -18957,8 +19034,8 @@ var require_ipv6 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
18957
19034
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18958
19035
|
exports.Address6 = void 0;
|
|
18959
19036
|
const common = __importStar(require_common$2());
|
|
18960
|
-
const constants4 = __importStar(require_constants$
|
|
18961
|
-
const constants6 = __importStar(require_constants$
|
|
19037
|
+
const constants4 = __importStar(require_constants$9());
|
|
19038
|
+
const constants6 = __importStar(require_constants$8());
|
|
18962
19039
|
const helpers = __importStar(require_helpers$1());
|
|
18963
19040
|
const ipv4_1 = require_ipv4();
|
|
18964
19041
|
const regular_expressions_1 = require_regular_expressions();
|
|
@@ -19776,10 +19853,10 @@ var require_helpers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19776
19853
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19777
19854
|
exports.ipToBuffer = exports.int32ToIpv4 = exports.ipv4ToInt32 = exports.validateSocksClientChainOptions = exports.validateSocksClientOptions = void 0;
|
|
19778
19855
|
const util_1 = require_util$11();
|
|
19779
|
-
const constants_1 = require_constants$
|
|
19856
|
+
const constants_1 = require_constants$10();
|
|
19780
19857
|
const stream$3 = require("stream");
|
|
19781
19858
|
const ip_address_1 = require_ip_address();
|
|
19782
|
-
const net$
|
|
19859
|
+
const net$9 = require("net");
|
|
19783
19860
|
/**
|
|
19784
19861
|
* Validates the provided SocksClientOptions
|
|
19785
19862
|
* @param options { SocksClientOptions }
|
|
@@ -19857,10 +19934,10 @@ var require_helpers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19857
19934
|
}
|
|
19858
19935
|
exports.int32ToIpv4 = int32ToIpv4;
|
|
19859
19936
|
function ipToBuffer(ip) {
|
|
19860
|
-
if (net$
|
|
19937
|
+
if (net$9.isIPv4(ip)) {
|
|
19861
19938
|
const address = new ip_address_1.Address4(ip);
|
|
19862
19939
|
return Buffer.from(address.toArray());
|
|
19863
|
-
} else if (net$
|
|
19940
|
+
} else if (net$9.isIPv6(ip)) {
|
|
19864
19941
|
const address = new ip_address_1.Address6(ip);
|
|
19865
19942
|
return Buffer.from(address.canonicalForm().split(":").map((segment) => segment.padStart(4, "0")).join(""), "hex");
|
|
19866
19943
|
} else throw new Error("Invalid IP address format");
|
|
@@ -19939,9 +20016,9 @@ var require_socksclient = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
19939
20016
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19940
20017
|
exports.SocksClientError = exports.SocksClient = void 0;
|
|
19941
20018
|
const events_1$2 = require("events");
|
|
19942
|
-
const net$
|
|
20019
|
+
const net$8 = require("net");
|
|
19943
20020
|
const smart_buffer_1 = require_smartbuffer();
|
|
19944
|
-
const constants_1 = require_constants$
|
|
20021
|
+
const constants_1 = require_constants$10();
|
|
19945
20022
|
const helpers_1 = require_helpers();
|
|
19946
20023
|
const receivebuffer_1 = require_receivebuffer();
|
|
19947
20024
|
const util_1 = require_util$11();
|
|
@@ -20051,10 +20128,10 @@ var require_socksclient = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20051
20128
|
const buff = new smart_buffer_1.SmartBuffer();
|
|
20052
20129
|
buff.writeUInt16BE(0);
|
|
20053
20130
|
buff.writeUInt8(options.frameNumber || 0);
|
|
20054
|
-
if (net$
|
|
20131
|
+
if (net$8.isIPv4(options.remoteHost.host)) {
|
|
20055
20132
|
buff.writeUInt8(constants_1.Socks5HostType.IPv4);
|
|
20056
20133
|
buff.writeUInt32BE((0, helpers_1.ipv4ToInt32)(options.remoteHost.host));
|
|
20057
|
-
} else if (net$
|
|
20134
|
+
} else if (net$8.isIPv6(options.remoteHost.host)) {
|
|
20058
20135
|
buff.writeUInt8(constants_1.Socks5HostType.IPv6);
|
|
20059
20136
|
buff.writeBuffer((0, helpers_1.ipToBuffer)(options.remoteHost.host));
|
|
20060
20137
|
} else {
|
|
@@ -20107,7 +20184,7 @@ var require_socksclient = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20107
20184
|
const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT);
|
|
20108
20185
|
if (timer.unref && typeof timer.unref === "function") timer.unref();
|
|
20109
20186
|
if (existingSocket) this.socket = existingSocket;
|
|
20110
|
-
else this.socket = new net$
|
|
20187
|
+
else this.socket = new net$8.Socket();
|
|
20111
20188
|
this.socket.once("close", this.onClose);
|
|
20112
20189
|
this.socket.once("error", this.onError);
|
|
20113
20190
|
this.socket.once("connect", this.onConnect);
|
|
@@ -20219,7 +20296,7 @@ var require_socksclient = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20219
20296
|
buff.writeUInt8(4);
|
|
20220
20297
|
buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
|
|
20221
20298
|
buff.writeUInt16BE(this.options.destination.port);
|
|
20222
|
-
if (net$
|
|
20299
|
+
if (net$8.isIPv4(this.options.destination.host)) {
|
|
20223
20300
|
buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
|
|
20224
20301
|
buff.writeStringNT(userId);
|
|
20225
20302
|
} else {
|
|
@@ -20378,10 +20455,10 @@ var require_socksclient = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20378
20455
|
buff.writeUInt8(5);
|
|
20379
20456
|
buff.writeUInt8(constants_1.SocksCommand[this.options.command]);
|
|
20380
20457
|
buff.writeUInt8(0);
|
|
20381
|
-
if (net$
|
|
20458
|
+
if (net$8.isIPv4(this.options.destination.host)) {
|
|
20382
20459
|
buff.writeUInt8(constants_1.Socks5HostType.IPv4);
|
|
20383
20460
|
buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
|
|
20384
|
-
} else if (net$
|
|
20461
|
+
} else if (net$8.isIPv6(this.options.destination.host)) {
|
|
20385
20462
|
buff.writeUInt8(constants_1.Socks5HostType.IPv6);
|
|
20386
20463
|
buff.writeBuffer((0, helpers_1.ipToBuffer)(this.options.destination.host));
|
|
20387
20464
|
} else {
|
|
@@ -20591,12 +20668,12 @@ var require_dist$8 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
20591
20668
|
const agent_base_1 = require_dist$11();
|
|
20592
20669
|
const debug_1 = __importDefault(require_src$2());
|
|
20593
20670
|
const dns = __importStar(require("dns"));
|
|
20594
|
-
const net$
|
|
20671
|
+
const net$7 = __importStar(require("net"));
|
|
20595
20672
|
const tls$2 = __importStar(require("tls"));
|
|
20596
20673
|
const url_1$4 = require("url");
|
|
20597
20674
|
const debug = (0, debug_1.default)("socks-proxy-agent");
|
|
20598
20675
|
const setServernameFromNonIpHost = (options) => {
|
|
20599
|
-
if (options.servername === void 0 && options.host && !net$
|
|
20676
|
+
if (options.servername === void 0 && options.host && !net$7.isIP(options.host)) return {
|
|
20600
20677
|
...options,
|
|
20601
20678
|
servername: options.host
|
|
20602
20679
|
};
|
|
@@ -22856,6 +22933,7 @@ var require_FtpContext = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22856
22933
|
function doNothing() {
|
|
22857
22934
|
/** Do nothing */
|
|
22858
22935
|
}
|
|
22936
|
+
const maxControlResponseLength = 2 ** 16;
|
|
22859
22937
|
/**
|
|
22860
22938
|
* FTPContext holds the control and data sockets of an FTP connection and provides a
|
|
22861
22939
|
* simplified way to interact with an FTP server, handle responses, errors and timeouts.
|
|
@@ -22982,6 +23060,7 @@ var require_FtpContext = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
22982
23060
|
* Send an FTP command without waiting for or handling the result.
|
|
22983
23061
|
*/
|
|
22984
23062
|
send(command) {
|
|
23063
|
+
if (/[\r\n\0]/.test(command)) throw new Error(`Invalid command: Contains control characters. (${command})`);
|
|
22985
23064
|
const message = command.startsWith("PASS") ? "> PASS ###" : `> ${command}`;
|
|
22986
23065
|
this.log(message);
|
|
22987
23066
|
this._socket.write(command + "\r\n", this.encoding);
|
|
@@ -23060,6 +23139,10 @@ var require_FtpContext = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
23060
23139
|
*/
|
|
23061
23140
|
_onControlSocketData(chunk) {
|
|
23062
23141
|
this.log(`< ${chunk}`);
|
|
23142
|
+
if (this._partialResponse.length + chunk.length > maxControlResponseLength) {
|
|
23143
|
+
this.closeWithError(/* @__PURE__ */ new Error("FTP control response exceeded maximum allowed size"));
|
|
23144
|
+
return;
|
|
23145
|
+
}
|
|
23063
23146
|
const completeResponse = this._partialResponse + chunk;
|
|
23064
23147
|
const parsed = (0, parseControlResponse_1.parseControlResponse)(completeResponse);
|
|
23065
23148
|
this._partialResponse = parsed.rest;
|
|
@@ -23143,6 +23226,61 @@ var require_FtpContext = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
23143
23226
|
exports.FTPContext = FTPContext;
|
|
23144
23227
|
}));
|
|
23145
23228
|
//#endregion
|
|
23229
|
+
//#region ../../node_modules/basic-ftp/dist/netUtils.js
|
|
23230
|
+
var require_netUtils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
23231
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23232
|
+
exports.describeTLS = describeTLS;
|
|
23233
|
+
exports.describeAddress = describeAddress;
|
|
23234
|
+
exports.upgradeSocket = upgradeSocket;
|
|
23235
|
+
exports.ipIsPrivateV4Address = ipIsPrivateV4Address;
|
|
23236
|
+
const tls_1$2 = require("tls");
|
|
23237
|
+
/**
|
|
23238
|
+
* Returns a string describing the encryption on a given socket instance.
|
|
23239
|
+
*/
|
|
23240
|
+
function describeTLS(socket) {
|
|
23241
|
+
if (socket instanceof tls_1$2.TLSSocket) {
|
|
23242
|
+
const protocol = socket.getProtocol();
|
|
23243
|
+
return protocol ? protocol : "Server socket or disconnected client socket";
|
|
23244
|
+
}
|
|
23245
|
+
return "No encryption";
|
|
23246
|
+
}
|
|
23247
|
+
/**
|
|
23248
|
+
* Returns a string describing the remote address of a socket.
|
|
23249
|
+
*/
|
|
23250
|
+
function describeAddress(socket) {
|
|
23251
|
+
if (socket.remoteFamily === "IPv6") return `[${socket.remoteAddress}]:${socket.remotePort}`;
|
|
23252
|
+
return `${socket.remoteAddress}:${socket.remotePort}`;
|
|
23253
|
+
}
|
|
23254
|
+
/**
|
|
23255
|
+
* Upgrade a socket connection with TLS.
|
|
23256
|
+
*/
|
|
23257
|
+
function upgradeSocket(socket, options) {
|
|
23258
|
+
return new Promise((resolve, reject) => {
|
|
23259
|
+
const tlsOptions = Object.assign({}, options, { socket });
|
|
23260
|
+
const tlsSocket = (0, tls_1$2.connect)(tlsOptions, () => {
|
|
23261
|
+
if (tlsOptions.rejectUnauthorized !== false && !tlsSocket.authorized) reject(tlsSocket.authorizationError);
|
|
23262
|
+
else {
|
|
23263
|
+
tlsSocket.removeAllListeners("error");
|
|
23264
|
+
resolve(tlsSocket);
|
|
23265
|
+
}
|
|
23266
|
+
}).once("error", (error) => {
|
|
23267
|
+
reject(error);
|
|
23268
|
+
});
|
|
23269
|
+
});
|
|
23270
|
+
}
|
|
23271
|
+
/**
|
|
23272
|
+
* Returns true if an IP is a private address according to https://tools.ietf.org/html/rfc1918#section-3.
|
|
23273
|
+
* This will handle IPv4-mapped IPv6 addresses correctly but return false for all other IPv6 addresses.
|
|
23274
|
+
*
|
|
23275
|
+
* @param ip The IP as a string, e.g. "192.168.0.1"
|
|
23276
|
+
*/
|
|
23277
|
+
function ipIsPrivateV4Address(ip = "") {
|
|
23278
|
+
if (ip.startsWith("::ffff:")) ip = ip.substr(7);
|
|
23279
|
+
const octets = ip.split(".").map((o) => parseInt(o, 10));
|
|
23280
|
+
return octets[0] === 10 || octets[0] === 172 && octets[1] >= 16 && octets[1] <= 31 || octets[0] === 192 && octets[1] === 168 || ip === "127.0.0.1";
|
|
23281
|
+
}
|
|
23282
|
+
}));
|
|
23283
|
+
//#endregion
|
|
23146
23284
|
//#region ../../node_modules/basic-ftp/dist/FileInfo.js
|
|
23147
23285
|
var require_FileInfo = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
23148
23286
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -23678,78 +23816,32 @@ var require_StringWriter = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
23678
23816
|
exports.StringWriter = void 0;
|
|
23679
23817
|
const stream_1$5 = require("stream");
|
|
23680
23818
|
var StringWriter = class extends stream_1$5.Writable {
|
|
23681
|
-
constructor() {
|
|
23682
|
-
super(
|
|
23683
|
-
this.
|
|
23819
|
+
constructor(maxByteLength = 1 * 1024 * 1024) {
|
|
23820
|
+
super();
|
|
23821
|
+
this.maxByteLength = maxByteLength;
|
|
23822
|
+
this.byteLength = 0;
|
|
23823
|
+
this.bufs = [];
|
|
23684
23824
|
}
|
|
23685
23825
|
_write(chunk, _, callback) {
|
|
23686
|
-
if (chunk instanceof Buffer) {
|
|
23687
|
-
|
|
23688
|
-
|
|
23689
|
-
}
|
|
23826
|
+
if (!(chunk instanceof Buffer)) {
|
|
23827
|
+
callback(/* @__PURE__ */ new Error("StringWriter: expects chunks of type 'Buffer'."));
|
|
23828
|
+
return;
|
|
23829
|
+
}
|
|
23830
|
+
if (this.byteLength + chunk.byteLength > this.maxByteLength) {
|
|
23831
|
+
callback(/* @__PURE__ */ new Error(`StringWriter: Maximum bytes exceeded, maxByteLength=${this.maxByteLength}.`));
|
|
23832
|
+
return;
|
|
23833
|
+
}
|
|
23834
|
+
this.byteLength += chunk.byteLength;
|
|
23835
|
+
this.bufs.push(chunk);
|
|
23836
|
+
callback(null);
|
|
23690
23837
|
}
|
|
23691
23838
|
getText(encoding) {
|
|
23692
|
-
return this.
|
|
23839
|
+
return Buffer.concat(this.bufs).toString(encoding);
|
|
23693
23840
|
}
|
|
23694
23841
|
};
|
|
23695
23842
|
exports.StringWriter = StringWriter;
|
|
23696
23843
|
}));
|
|
23697
23844
|
//#endregion
|
|
23698
|
-
//#region ../../node_modules/basic-ftp/dist/netUtils.js
|
|
23699
|
-
var require_netUtils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
23700
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23701
|
-
exports.describeTLS = describeTLS;
|
|
23702
|
-
exports.describeAddress = describeAddress;
|
|
23703
|
-
exports.upgradeSocket = upgradeSocket;
|
|
23704
|
-
exports.ipIsPrivateV4Address = ipIsPrivateV4Address;
|
|
23705
|
-
const tls_1$2 = require("tls");
|
|
23706
|
-
/**
|
|
23707
|
-
* Returns a string describing the encryption on a given socket instance.
|
|
23708
|
-
*/
|
|
23709
|
-
function describeTLS(socket) {
|
|
23710
|
-
if (socket instanceof tls_1$2.TLSSocket) {
|
|
23711
|
-
const protocol = socket.getProtocol();
|
|
23712
|
-
return protocol ? protocol : "Server socket or disconnected client socket";
|
|
23713
|
-
}
|
|
23714
|
-
return "No encryption";
|
|
23715
|
-
}
|
|
23716
|
-
/**
|
|
23717
|
-
* Returns a string describing the remote address of a socket.
|
|
23718
|
-
*/
|
|
23719
|
-
function describeAddress(socket) {
|
|
23720
|
-
if (socket.remoteFamily === "IPv6") return `[${socket.remoteAddress}]:${socket.remotePort}`;
|
|
23721
|
-
return `${socket.remoteAddress}:${socket.remotePort}`;
|
|
23722
|
-
}
|
|
23723
|
-
/**
|
|
23724
|
-
* Upgrade a socket connection with TLS.
|
|
23725
|
-
*/
|
|
23726
|
-
function upgradeSocket(socket, options) {
|
|
23727
|
-
return new Promise((resolve, reject) => {
|
|
23728
|
-
const tlsOptions = Object.assign({}, options, { socket });
|
|
23729
|
-
const tlsSocket = (0, tls_1$2.connect)(tlsOptions, () => {
|
|
23730
|
-
if (tlsOptions.rejectUnauthorized !== false && !tlsSocket.authorized) reject(tlsSocket.authorizationError);
|
|
23731
|
-
else {
|
|
23732
|
-
tlsSocket.removeAllListeners("error");
|
|
23733
|
-
resolve(tlsSocket);
|
|
23734
|
-
}
|
|
23735
|
-
}).once("error", (error) => {
|
|
23736
|
-
reject(error);
|
|
23737
|
-
});
|
|
23738
|
-
});
|
|
23739
|
-
}
|
|
23740
|
-
/**
|
|
23741
|
-
* Returns true if an IP is a private address according to https://tools.ietf.org/html/rfc1918#section-3.
|
|
23742
|
-
* This will handle IPv4-mapped IPv6 addresses correctly but return false for all other IPv6 addresses.
|
|
23743
|
-
*
|
|
23744
|
-
* @param ip The IP as a string, e.g. "192.168.0.1"
|
|
23745
|
-
*/
|
|
23746
|
-
function ipIsPrivateV4Address(ip = "") {
|
|
23747
|
-
if (ip.startsWith("::ffff:")) ip = ip.substr(7);
|
|
23748
|
-
const octets = ip.split(".").map((o) => parseInt(o, 10));
|
|
23749
|
-
return octets[0] === 10 || octets[0] === 172 && octets[1] >= 16 && octets[1] <= 31 || octets[0] === 192 && octets[1] === 168 || ip === "127.0.0.1";
|
|
23750
|
-
}
|
|
23751
|
-
}));
|
|
23752
|
-
//#endregion
|
|
23753
23845
|
//#region ../../node_modules/basic-ftp/dist/transfer.js
|
|
23754
23846
|
var require_transfer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
23755
23847
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -23995,20 +24087,23 @@ var require_Client = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
23995
24087
|
const tls_1 = require("tls");
|
|
23996
24088
|
const util_1$3 = require("util");
|
|
23997
24089
|
const FtpContext_1 = require_FtpContext();
|
|
24090
|
+
const netUtils_1 = require_netUtils();
|
|
24091
|
+
const parseControlResponse_1 = require_parseControlResponse();
|
|
23998
24092
|
const parseList_1 = require_parseList();
|
|
24093
|
+
const parseListMLSD_1 = require_parseListMLSD();
|
|
23999
24094
|
const ProgressTracker_1 = require_ProgressTracker();
|
|
24000
24095
|
const StringWriter_1 = require_StringWriter();
|
|
24001
|
-
const parseListMLSD_1 = require_parseListMLSD();
|
|
24002
|
-
const netUtils_1 = require_netUtils();
|
|
24003
24096
|
const transfer_1 = require_transfer();
|
|
24004
|
-
const parseControlResponse_1 = require_parseControlResponse();
|
|
24005
24097
|
const fsReadDir = (0, util_1$3.promisify)(fs_1$5.readdir);
|
|
24006
24098
|
const fsMkDir = (0, util_1$3.promisify)(fs_1$5.mkdir);
|
|
24007
24099
|
const fsStat = (0, util_1$3.promisify)(fs_1$5.stat);
|
|
24008
24100
|
const fsOpen = (0, util_1$3.promisify)(fs_1$5.open);
|
|
24009
24101
|
const fsClose = (0, util_1$3.promisify)(fs_1$5.close);
|
|
24010
24102
|
const fsUnlink = (0, util_1$3.promisify)(fs_1$5.unlink);
|
|
24011
|
-
const defaultClientOptions = {
|
|
24103
|
+
const defaultClientOptions = {
|
|
24104
|
+
allowSeparateTransferHost: true,
|
|
24105
|
+
maxListingBytes: 40 * 1024 * 1024
|
|
24106
|
+
};
|
|
24012
24107
|
const LIST_COMMANDS_DEFAULT = () => ["LIST -a", "LIST"];
|
|
24013
24108
|
const LIST_COMMANDS_MLSD = () => [
|
|
24014
24109
|
"MLSD",
|
|
@@ -24024,10 +24119,15 @@ var require_Client = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
24024
24119
|
*
|
|
24025
24120
|
* @param timeout Timeout in milliseconds, use 0 for no timeout. Optional, default is 30 seconds.
|
|
24026
24121
|
*/
|
|
24027
|
-
constructor(timeout = 3e4,
|
|
24122
|
+
constructor(timeout = 3e4, userOptions = defaultClientOptions) {
|
|
24028
24123
|
this.availableListCommands = LIST_COMMANDS_DEFAULT();
|
|
24124
|
+
const options = {
|
|
24125
|
+
...defaultClientOptions,
|
|
24126
|
+
...userOptions
|
|
24127
|
+
};
|
|
24029
24128
|
this.ftp = new FtpContext_1.FTPContext(timeout);
|
|
24030
24129
|
this.prepareTransfer = this._enterFirstCompatibleMode([transfer_1.enterPassiveModeIPv6, options.allowSeparateTransferHost ? transfer_1.enterPassiveModeIPv4 : transfer_1.enterPassiveModeIPv4_forceControlHostIP]);
|
|
24130
|
+
this.options = options;
|
|
24031
24131
|
this.parseList = parseList_1.parseList;
|
|
24032
24132
|
this._progressTracker = new ProgressTracker_1.ProgressTracker();
|
|
24033
24133
|
}
|
|
@@ -24427,7 +24527,7 @@ var require_Client = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
24427
24527
|
* @protected
|
|
24428
24528
|
*/
|
|
24429
24529
|
async _requestListWithCommand(command) {
|
|
24430
|
-
const buffer = new StringWriter_1.StringWriter();
|
|
24530
|
+
const buffer = new StringWriter_1.StringWriter(this.options.maxListingBytes);
|
|
24431
24531
|
await (0, transfer_1.downloadTo)(buffer, {
|
|
24432
24532
|
ftp: this.ftp,
|
|
24433
24533
|
tracker: this._progressTracker,
|
|
@@ -41730,7 +41830,7 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
41730
41830
|
};
|
|
41731
41831
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41732
41832
|
exports.PacProxyAgent = void 0;
|
|
41733
|
-
const net$
|
|
41833
|
+
const net$6 = __importStar(require("net"));
|
|
41734
41834
|
const tls$1 = __importStar(require("tls"));
|
|
41735
41835
|
const crypto$14 = __importStar(require("crypto"));
|
|
41736
41836
|
const events_1 = require("events");
|
|
@@ -41742,7 +41842,7 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
41742
41842
|
const quickjs_emscripten_1 = require_dist$3();
|
|
41743
41843
|
const debug = (0, debug_1.default)("pac-proxy-agent");
|
|
41744
41844
|
const setServernameFromNonIpHost = (options) => {
|
|
41745
|
-
if (options.servername === void 0 && options.host && !net$
|
|
41845
|
+
if (options.servername === void 0 && options.host && !net$6.isIP(options.host)) return {
|
|
41746
41846
|
...options,
|
|
41747
41847
|
servername: options.host
|
|
41748
41848
|
};
|
|
@@ -41832,7 +41932,7 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
41832
41932
|
const isWebSocket = req.getHeader("upgrade") === "websocket";
|
|
41833
41933
|
const resolver = await this.getResolver();
|
|
41834
41934
|
const protocol = secureEndpoint ? "https:" : "http:";
|
|
41835
|
-
const host = opts.host && net$
|
|
41935
|
+
const host = opts.host && net$6.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
41836
41936
|
const defaultPort = secureEndpoint ? 443 : 80;
|
|
41837
41937
|
const url = Object.assign(new url_1$2.URL(req.path, `${protocol}//${host}`), defaultPort ? void 0 : { port: opts.port });
|
|
41838
41938
|
debug("url: %s", url);
|
|
@@ -41846,7 +41946,7 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
41846
41946
|
const [type, target] = proxy.split(/\s+/);
|
|
41847
41947
|
debug("Attempting to use proxy: %o", proxy);
|
|
41848
41948
|
if (type === "DIRECT") if (secureEndpoint) socket = tls$1.connect(setServernameFromNonIpHost(opts));
|
|
41849
|
-
else socket = net$
|
|
41949
|
+
else socket = net$6.connect(opts);
|
|
41850
41950
|
else if (type === "SOCKS" || type === "SOCKS5") {
|
|
41851
41951
|
const { SocksProxyAgent } = await Promise.resolve().then(() => __importStar(require_dist$8()));
|
|
41852
41952
|
agent = new SocksProxyAgent(`socks://${target}`, this.opts);
|
|
@@ -41874,7 +41974,7 @@ var require_dist$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
41874
41974
|
}
|
|
41875
41975
|
if (agent) {
|
|
41876
41976
|
const s = await agent.connect(req, opts);
|
|
41877
|
-
if (!(s instanceof net$
|
|
41977
|
+
if (!(s instanceof net$6.Socket)) throw new Error("Expected a `net.Socket` to be returned from agent");
|
|
41878
41978
|
req.emit("proxy", {
|
|
41879
41979
|
proxy,
|
|
41880
41980
|
socket: s
|
|
@@ -42802,7 +42902,7 @@ var require_errors$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
42802
42902
|
}));
|
|
42803
42903
|
//#endregion
|
|
42804
42904
|
//#region ../../node_modules/undici/lib/core/constants.js
|
|
42805
|
-
var require_constants$
|
|
42905
|
+
var require_constants$7 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
42806
42906
|
/**
|
|
42807
42907
|
* @see https://developer.mozilla.org/docs/Web/HTTP/Headers
|
|
42808
42908
|
*/
|
|
@@ -42934,7 +43034,7 @@ var require_constants$8 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
42934
43034
|
//#endregion
|
|
42935
43035
|
//#region ../../node_modules/undici/lib/core/tree.js
|
|
42936
43036
|
var require_tree = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
42937
|
-
const { wellknownHeaderNames, headerNameLowerCasedRecord } = require_constants$
|
|
43037
|
+
const { wellknownHeaderNames, headerNameLowerCasedRecord } = require_constants$7();
|
|
42938
43038
|
var TstNode = class TstNode {
|
|
42939
43039
|
/** @type {any} */
|
|
42940
43040
|
value = null;
|
|
@@ -43056,12 +43156,12 @@ var require_util$8 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
43056
43156
|
const { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
|
|
43057
43157
|
const { IncomingMessage } = require("node:http");
|
|
43058
43158
|
const stream$2 = require("node:stream");
|
|
43059
|
-
const net$
|
|
43159
|
+
const net$5 = require("node:net");
|
|
43060
43160
|
const { stringify: stringify$1 } = require("node:querystring");
|
|
43061
43161
|
const { EventEmitter: EE$3 } = require("node:events");
|
|
43062
43162
|
const timers = require_timers();
|
|
43063
43163
|
const { InvalidArgumentError, ConnectTimeoutError } = require_errors$3();
|
|
43064
|
-
const { headerNameLowerCasedRecord } = require_constants$
|
|
43164
|
+
const { headerNameLowerCasedRecord } = require_constants$7();
|
|
43065
43165
|
const { tree } = require_tree();
|
|
43066
43166
|
const [nodeMajor, nodeMinor] = process.versions.node.split(".", 2).map((v) => Number(v));
|
|
43067
43167
|
var BodyAsyncIterable = class {
|
|
@@ -43217,7 +43317,7 @@ var require_util$8 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
43217
43317
|
if (!host) return null;
|
|
43218
43318
|
assert$38(typeof host === "string");
|
|
43219
43319
|
const servername = getHostname(host);
|
|
43220
|
-
if (net$
|
|
43320
|
+
if (net$5.isIP(servername)) return "";
|
|
43221
43321
|
return servername;
|
|
43222
43322
|
}
|
|
43223
43323
|
/**
|
|
@@ -44125,8 +44225,16 @@ var require_request$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
44125
44225
|
const assert$37 = require("node:assert");
|
|
44126
44226
|
const { isValidHTTPToken, isValidHeaderValue, isStream, destroy, isBuffer, isFormDataLike, isIterable, hasSafeIterator, isBlobLike, serializePathWithQuery, assertRequestHandler, getServerName, normalizedMethodRecords, getProtocolFromUrlString } = require_util$8();
|
|
44127
44227
|
const { channels } = require_diagnostics();
|
|
44128
|
-
const { headerNameLowerCasedRecord } = require_constants$
|
|
44228
|
+
const { headerNameLowerCasedRecord } = require_constants$7();
|
|
44129
44229
|
const invalidPathRegex = /[^\u0021-\u00ff]/;
|
|
44230
|
+
function isValidContentLengthHeaderValue(val) {
|
|
44231
|
+
if (typeof val !== "string" || val.length === 0) return false;
|
|
44232
|
+
for (let i = 0; i < val.length; i++) {
|
|
44233
|
+
const charCode = val.charCodeAt(i);
|
|
44234
|
+
if (charCode < 48 || charCode > 57) return false;
|
|
44235
|
+
}
|
|
44236
|
+
return true;
|
|
44237
|
+
}
|
|
44130
44238
|
const kHandler = Symbol("handler");
|
|
44131
44239
|
var Request = class {
|
|
44132
44240
|
constructor(origin, { path, method, body, headers, query, idempotent, blocking, upgrade, headersTimeout, bodyTimeout, reset, expectContinue, servername, throwOnError, maxRedirections, typeOfService }, handler) {
|
|
@@ -44335,8 +44443,8 @@ var require_request$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
44335
44443
|
request.host = val;
|
|
44336
44444
|
} else if (headerName === "content-length") {
|
|
44337
44445
|
if (request.contentLength !== null) throw new InvalidArgumentError("duplicate content-length header");
|
|
44446
|
+
if (!isValidContentLengthHeaderValue(val)) throw new InvalidArgumentError("invalid content-length header");
|
|
44338
44447
|
request.contentLength = parseInt(val, 10);
|
|
44339
|
-
if (!Number.isFinite(request.contentLength)) throw new InvalidArgumentError("invalid content-length header");
|
|
44340
44448
|
} else if (request.contentType === null && headerName === "content-type") {
|
|
44341
44449
|
request.contentType = val;
|
|
44342
44450
|
request.headers.push(key, val);
|
|
@@ -44461,6 +44569,8 @@ var require_unwrap_handler = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
44461
44569
|
#aborted = false;
|
|
44462
44570
|
#abort;
|
|
44463
44571
|
[kResume] = null;
|
|
44572
|
+
rawHeaders = null;
|
|
44573
|
+
rawTrailers = null;
|
|
44464
44574
|
constructor(abort) {
|
|
44465
44575
|
this.#abort = abort;
|
|
44466
44576
|
}
|
|
@@ -44507,10 +44617,12 @@ var require_unwrap_handler = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
44507
44617
|
return this.#handler.onResponseStarted?.();
|
|
44508
44618
|
}
|
|
44509
44619
|
onUpgrade(statusCode, rawHeaders, socket) {
|
|
44620
|
+
this.#controller.rawHeaders = rawHeaders;
|
|
44510
44621
|
this.#handler.onRequestUpgrade?.(this.#controller, statusCode, parseHeaders(rawHeaders), socket);
|
|
44511
44622
|
}
|
|
44512
44623
|
onHeaders(statusCode, rawHeaders, resume, statusMessage) {
|
|
44513
44624
|
this.#controller[kResume] = resume;
|
|
44625
|
+
this.#controller.rawHeaders = rawHeaders;
|
|
44514
44626
|
this.#handler.onResponseStart?.(this.#controller, statusCode, parseHeaders(rawHeaders), statusMessage);
|
|
44515
44627
|
return !this.#controller.paused;
|
|
44516
44628
|
}
|
|
@@ -44519,6 +44631,7 @@ var require_unwrap_handler = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
44519
44631
|
return !this.#controller.paused;
|
|
44520
44632
|
}
|
|
44521
44633
|
onComplete(rawTrailers) {
|
|
44634
|
+
this.#controller.rawTrailers = rawTrailers;
|
|
44522
44635
|
this.#handler.onResponseEnd?.(this.#controller, parseHeaders(rawTrailers));
|
|
44523
44636
|
}
|
|
44524
44637
|
onError(err) {
|
|
@@ -44536,6 +44649,7 @@ var require_dispatcher_base = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
44536
44649
|
const { kDestroy, kClose, kClosed, kDestroyed, kDispatch } = require_symbols();
|
|
44537
44650
|
const kOnDestroyed = Symbol("onDestroyed");
|
|
44538
44651
|
const kOnClosed = Symbol("onClosed");
|
|
44652
|
+
const kWebSocketOptions = Symbol("webSocketOptions");
|
|
44539
44653
|
var DispatcherBase = class extends Dispatcher {
|
|
44540
44654
|
/** @type {boolean} */
|
|
44541
44655
|
[kDestroyed] = false;
|
|
@@ -44545,6 +44659,22 @@ var require_dispatcher_base = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
44545
44659
|
[kClosed] = false;
|
|
44546
44660
|
/** @type {Array<Function>|null} */
|
|
44547
44661
|
[kOnClosed] = null;
|
|
44662
|
+
/**
|
|
44663
|
+
* @param {import('../../types/dispatcher').DispatcherOptions} [opts]
|
|
44664
|
+
*/
|
|
44665
|
+
constructor(opts) {
|
|
44666
|
+
super();
|
|
44667
|
+
this[kWebSocketOptions] = opts?.webSocket ?? {};
|
|
44668
|
+
}
|
|
44669
|
+
/**
|
|
44670
|
+
* @returns {import('../../types/dispatcher').WebSocketOptions}
|
|
44671
|
+
*/
|
|
44672
|
+
get webSocketOptions() {
|
|
44673
|
+
return {
|
|
44674
|
+
maxFragments: this[kWebSocketOptions].maxFragments ?? 131072,
|
|
44675
|
+
maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024
|
|
44676
|
+
};
|
|
44677
|
+
}
|
|
44548
44678
|
/** @returns {boolean} */
|
|
44549
44679
|
get destroyed() {
|
|
44550
44680
|
return this[kDestroyed];
|
|
@@ -44627,7 +44757,7 @@ var require_dispatcher_base = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
44627
44757
|
//#endregion
|
|
44628
44758
|
//#region ../../node_modules/undici/lib/core/connect.js
|
|
44629
44759
|
var require_connect$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
44630
|
-
const net$
|
|
44760
|
+
const net$4 = require("node:net");
|
|
44631
44761
|
const assert$36 = require("node:assert");
|
|
44632
44762
|
const util = require_util$8();
|
|
44633
44763
|
const { InvalidArgumentError } = require_errors$3();
|
|
@@ -44648,6 +44778,15 @@ var require_connect$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
44648
44778
|
}
|
|
44649
44779
|
set(sessionKey, session) {
|
|
44650
44780
|
if (this._maxCachedSessions === 0) return;
|
|
44781
|
+
if (this._sessionCache.has(sessionKey)) this._sessionCache.delete(sessionKey);
|
|
44782
|
+
else if (this._sessionCache.size >= this._maxCachedSessions) {
|
|
44783
|
+
for (const [key, ref] of this._sessionCache) if (ref.deref() === void 0) {
|
|
44784
|
+
this._sessionCache.delete(key);
|
|
44785
|
+
return;
|
|
44786
|
+
}
|
|
44787
|
+
const oldest = this._sessionCache.keys().next();
|
|
44788
|
+
if (!oldest.done) this._sessionCache.delete(oldest.value);
|
|
44789
|
+
}
|
|
44651
44790
|
this._sessionCache.set(sessionKey, new WeakRef(session));
|
|
44652
44791
|
this._sessionRegistry.register(session, sessionKey);
|
|
44653
44792
|
}
|
|
@@ -44687,7 +44826,7 @@ var require_connect$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
44687
44826
|
} else {
|
|
44688
44827
|
assert$36(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
44689
44828
|
port = port || 80;
|
|
44690
|
-
socket = net$
|
|
44829
|
+
socket = net$4.connect({
|
|
44691
44830
|
highWaterMark: 64 * 1024,
|
|
44692
44831
|
...options,
|
|
44693
44832
|
localAddress,
|
|
@@ -44740,7 +44879,7 @@ var require_utils$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
44740
44879
|
}));
|
|
44741
44880
|
//#endregion
|
|
44742
44881
|
//#region ../../node_modules/undici/lib/llhttp/constants.js
|
|
44743
|
-
var require_constants$
|
|
44882
|
+
var require_constants$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
44744
44883
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44745
44884
|
exports.SPECIAL_HEADERS = exports.MINOR = exports.MAJOR = exports.HTAB_SP_VCHAR_OBS_TEXT = exports.QUOTED_STRING = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.HEX = exports.URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.STATUSES_HTTP = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.HEADER_STATE = exports.FINISH = exports.STATUSES = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;
|
|
44746
44885
|
const utils_1 = require_utils$6();
|
|
@@ -45346,7 +45485,7 @@ var require_llhttp_simd_wasm = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
45346
45485
|
}));
|
|
45347
45486
|
//#endregion
|
|
45348
45487
|
//#region ../../node_modules/undici/lib/web/fetch/constants.js
|
|
45349
|
-
var require_constants$
|
|
45488
|
+
var require_constants$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
45350
45489
|
const corsSafeListedMethods = [
|
|
45351
45490
|
"GET",
|
|
45352
45491
|
"HEAD",
|
|
@@ -46245,7 +46384,7 @@ var require_webidl = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46245
46384
|
lowerBound = 0;
|
|
46246
46385
|
upperBound = Math.pow(2, bitLength) - 1;
|
|
46247
46386
|
} else {
|
|
46248
|
-
lowerBound = Math.pow(
|
|
46387
|
+
lowerBound = -Math.pow(2, bitLength - 1);
|
|
46249
46388
|
upperBound = Math.pow(2, bitLength - 1) - 1;
|
|
46250
46389
|
}
|
|
46251
46390
|
let x = Number(V);
|
|
@@ -46271,7 +46410,7 @@ var require_webidl = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46271
46410
|
if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) return 0;
|
|
46272
46411
|
x = webidl.util.IntegerPart(x);
|
|
46273
46412
|
x = x % Math.pow(2, bitLength);
|
|
46274
|
-
if (signedness === "signed" && x >= Math.pow(2, bitLength
|
|
46413
|
+
if (signedness === "signed" && x >= Math.pow(2, bitLength - 1)) return x - Math.pow(2, bitLength);
|
|
46275
46414
|
return x;
|
|
46276
46415
|
};
|
|
46277
46416
|
webidl.util.IntegerPart = function(n) {
|
|
@@ -46606,7 +46745,7 @@ var require_webidl = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46606
46745
|
var require_util$7 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
46607
46746
|
const { Transform: Transform$2 } = require("node:stream");
|
|
46608
46747
|
const zlib$2 = require("node:zlib");
|
|
46609
|
-
const { redirectStatusSet, referrerPolicyTokens, badPortsSet } = require_constants$
|
|
46748
|
+
const { redirectStatusSet, referrerPolicyTokens, badPortsSet } = require_constants$5();
|
|
46610
46749
|
const { getGlobalOrigin } = require_global$1();
|
|
46611
46750
|
const { collectAnHTTPQuotedString, parseMIMEType } = require_data_url();
|
|
46612
46751
|
const { performance: performance$1 } = require("node:perf_hooks");
|
|
@@ -47616,7 +47755,7 @@ var require_formdata_parser = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
47616
47755
|
* Parses content-disposition attributes (e.g., name="value" or filename*=utf-8''encoded)
|
|
47617
47756
|
* @param {Buffer} input
|
|
47618
47757
|
* @param {{ position: number }} position
|
|
47619
|
-
* @returns {{ name: string, value: string }}
|
|
47758
|
+
* @returns {{ name: string, value: string, extended: boolean } | null}
|
|
47620
47759
|
*/
|
|
47621
47760
|
function parseContentDispositionAttribute(input, position) {
|
|
47622
47761
|
if (input[position.position] === 59) position.position++;
|
|
@@ -47646,7 +47785,8 @@ var require_formdata_parser = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
47646
47785
|
}
|
|
47647
47786
|
return {
|
|
47648
47787
|
name: attrNameStr,
|
|
47649
|
-
value
|
|
47788
|
+
value,
|
|
47789
|
+
extended: isExtended
|
|
47650
47790
|
};
|
|
47651
47791
|
}
|
|
47652
47792
|
/**
|
|
@@ -47676,17 +47816,24 @@ var require_formdata_parser = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
47676
47816
|
position.position++;
|
|
47677
47817
|
collectASequenceOfBytes((char) => char === 32 || char === 9, input, position);
|
|
47678
47818
|
switch (bufferToLowerCasedHeaderName(headerName)) {
|
|
47679
|
-
case "content-disposition":
|
|
47819
|
+
case "content-disposition": {
|
|
47680
47820
|
name = filename = null;
|
|
47821
|
+
let filenameIsExtended = false;
|
|
47681
47822
|
if (collectASequenceOfBytes((char) => isToken(char), input, position).toString("ascii").toLowerCase() !== "form-data") throw parsingError("expected form-data for content-disposition header");
|
|
47682
|
-
while (position.position < input.length && input[position.position] !== 13
|
|
47823
|
+
while (position.position < input.length && (input[position.position] !== 13 || input[position.position + 1] !== 10)) {
|
|
47683
47824
|
const attribute = parseContentDispositionAttribute(input, position);
|
|
47684
47825
|
if (!attribute) break;
|
|
47685
47826
|
if (attribute.name === "name") name = attribute.value;
|
|
47686
|
-
else if (attribute.name === "filename")
|
|
47827
|
+
else if (attribute.name === "filename") {
|
|
47828
|
+
if (attribute.extended) {
|
|
47829
|
+
filename = attribute.value;
|
|
47830
|
+
filenameIsExtended = true;
|
|
47831
|
+
} else if (!filenameIsExtended) filename = attribute.value;
|
|
47832
|
+
}
|
|
47687
47833
|
}
|
|
47688
47834
|
if (name === null) throw parsingError("name attribute is required in content-disposition header");
|
|
47689
47835
|
break;
|
|
47836
|
+
}
|
|
47690
47837
|
case "content-type": {
|
|
47691
47838
|
let headerValue = collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position);
|
|
47692
47839
|
headerValue = removeChars(headerValue, false, true, (char) => char === 9 || char === 32);
|
|
@@ -47701,7 +47848,7 @@ var require_formdata_parser = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
47701
47848
|
}
|
|
47702
47849
|
default: collectASequenceOfBytes((char) => char !== 10 && char !== 13, input, position);
|
|
47703
47850
|
}
|
|
47704
|
-
if (input[position.position] !== 13
|
|
47851
|
+
if (input[position.position] !== 13 || input[position.position + 1] !== 10) throw parsingError("expected CRLF");
|
|
47705
47852
|
else position.position += 2;
|
|
47706
47853
|
}
|
|
47707
47854
|
}
|
|
@@ -48069,17 +48216,20 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48069
48216
|
const timers = require_timers();
|
|
48070
48217
|
const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, RequestAbortedError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError } = require_errors$3();
|
|
48071
48218
|
const { kUrl, kReset, kClient, kParser, kBlocking, kRunning, kPending, kSize, kWriting, kQueue, kNoRef, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kSocket, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kMaxRequests, kCounter, kMaxResponseSize, kOnError, kResume, kHTTPContext, kClosed } = require_symbols();
|
|
48072
|
-
const constants = require_constants$
|
|
48219
|
+
const constants = require_constants$6();
|
|
48073
48220
|
const EMPTY_BUF = Buffer.alloc(0);
|
|
48074
48221
|
const FastBuffer = Buffer[Symbol.species];
|
|
48075
48222
|
const removeAllListeners = util.removeAllListeners;
|
|
48223
|
+
const kIdleSocketValidation = Symbol("kIdleSocketValidation");
|
|
48224
|
+
const kIdleSocketValidationTimeout = Symbol("kIdleSocketValidationTimeout");
|
|
48225
|
+
const kSocketUsed = Symbol("kSocketUsed");
|
|
48076
48226
|
let extractBody;
|
|
48077
48227
|
function lazyllhttp() {
|
|
48078
48228
|
const llhttpWasmData = process.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0;
|
|
48079
48229
|
let mod;
|
|
48080
48230
|
let useWasmSIMD = process.arch !== "ppc64";
|
|
48081
|
-
if (process.env.UNDICI_NO_WASM_SIMD === "1") useWasmSIMD =
|
|
48082
|
-
else if (process.env.UNDICI_NO_WASM_SIMD === "0") useWasmSIMD =
|
|
48231
|
+
if (process.env.UNDICI_NO_WASM_SIMD === "1") useWasmSIMD = false;
|
|
48232
|
+
else if (process.env.UNDICI_NO_WASM_SIMD === "0") useWasmSIMD = true;
|
|
48083
48233
|
if (useWasmSIMD) try {
|
|
48084
48234
|
mod = new WebAssembly.Module(require_llhttp_simd_wasm());
|
|
48085
48235
|
} catch {}
|
|
@@ -48153,6 +48303,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48153
48303
|
*/
|
|
48154
48304
|
this.socket = socket;
|
|
48155
48305
|
this.timeout = null;
|
|
48306
|
+
this.timeoutWeakRef = new WeakRef(this);
|
|
48156
48307
|
this.timeoutValue = null;
|
|
48157
48308
|
this.timeoutType = null;
|
|
48158
48309
|
this.statusCode = 0;
|
|
@@ -48176,9 +48327,9 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48176
48327
|
timers.clearTimeout(this.timeout);
|
|
48177
48328
|
this.timeout = null;
|
|
48178
48329
|
}
|
|
48179
|
-
if (delay) if (type & USE_FAST_TIMER) this.timeout = timers.setFastTimeout(onParserTimeout, delay,
|
|
48330
|
+
if (delay) if (type & USE_FAST_TIMER) this.timeout = timers.setFastTimeout(onParserTimeout, delay, this.timeoutWeakRef);
|
|
48180
48331
|
else {
|
|
48181
|
-
this.timeout = setTimeout(onParserTimeout, delay,
|
|
48332
|
+
this.timeout = setTimeout(onParserTimeout, delay, this.timeoutWeakRef);
|
|
48182
48333
|
this.timeout?.unref();
|
|
48183
48334
|
}
|
|
48184
48335
|
this.timeoutValue = delay;
|
|
@@ -48237,20 +48388,42 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48237
48388
|
else if (ret === constants.ERROR.PAUSED) {
|
|
48238
48389
|
this.paused = true;
|
|
48239
48390
|
socket.unshift(data);
|
|
48240
|
-
} else
|
|
48241
|
-
const ptr = llhttp.llhttp_get_error_reason(this.ptr);
|
|
48242
|
-
let message = "";
|
|
48243
|
-
if (ptr) {
|
|
48244
|
-
const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
|
|
48245
|
-
message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
|
|
48246
|
-
}
|
|
48247
|
-
throw new HTTPParserError(message, constants.ERROR[ret], data);
|
|
48248
|
-
}
|
|
48391
|
+
} else throw this.createError(ret, data);
|
|
48249
48392
|
}
|
|
48250
48393
|
} catch (err) {
|
|
48251
48394
|
util.destroy(socket, err);
|
|
48252
48395
|
}
|
|
48253
48396
|
}
|
|
48397
|
+
finish() {
|
|
48398
|
+
assert$29(currentParser === null);
|
|
48399
|
+
assert$29(this.ptr != null);
|
|
48400
|
+
assert$29(!this.paused);
|
|
48401
|
+
const { llhttp } = this;
|
|
48402
|
+
let ret;
|
|
48403
|
+
try {
|
|
48404
|
+
currentParser = this;
|
|
48405
|
+
ret = llhttp.llhttp_finish(this.ptr);
|
|
48406
|
+
} finally {
|
|
48407
|
+
currentParser = null;
|
|
48408
|
+
}
|
|
48409
|
+
if (ret === constants.ERROR.OK) return null;
|
|
48410
|
+
if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) {
|
|
48411
|
+
this.paused = true;
|
|
48412
|
+
return null;
|
|
48413
|
+
}
|
|
48414
|
+
return this.createError(ret, EMPTY_BUF);
|
|
48415
|
+
}
|
|
48416
|
+
createError(ret, data) {
|
|
48417
|
+
const { llhttp, contentLength, bytesRead } = this;
|
|
48418
|
+
if (contentLength && bytesRead !== parseInt(contentLength, 10)) return new ResponseContentLengthMismatchError();
|
|
48419
|
+
const ptr = llhttp.llhttp_get_error_reason(this.ptr);
|
|
48420
|
+
let message = "";
|
|
48421
|
+
if (ptr) {
|
|
48422
|
+
const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);
|
|
48423
|
+
message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";
|
|
48424
|
+
}
|
|
48425
|
+
return new HTTPParserError(message, constants.ERROR[ret], data);
|
|
48426
|
+
}
|
|
48254
48427
|
destroy() {
|
|
48255
48428
|
assert$29(currentParser === null);
|
|
48256
48429
|
assert$29(this.ptr != null);
|
|
@@ -48276,6 +48449,10 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48276
48449
|
onMessageBegin() {
|
|
48277
48450
|
const { socket, client } = this;
|
|
48278
48451
|
if (socket.destroyed) return -1;
|
|
48452
|
+
if (client[kRunning] === 0) {
|
|
48453
|
+
util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));
|
|
48454
|
+
return -1;
|
|
48455
|
+
}
|
|
48279
48456
|
const request = client[kQueue][client[kRunningIdx]];
|
|
48280
48457
|
if (!request) return -1;
|
|
48281
48458
|
request.onResponseStarted();
|
|
@@ -48362,6 +48539,10 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48362
48539
|
onHeadersComplete(statusCode, upgrade, shouldKeepAlive) {
|
|
48363
48540
|
const { client, socket, headers, statusText } = this;
|
|
48364
48541
|
if (socket.destroyed) return -1;
|
|
48542
|
+
if (client[kRunning] === 0) {
|
|
48543
|
+
util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));
|
|
48544
|
+
return -1;
|
|
48545
|
+
}
|
|
48365
48546
|
const request = client[kQueue][client[kRunningIdx]];
|
|
48366
48547
|
if (!request) return -1;
|
|
48367
48548
|
assert$29(!this.upgrade);
|
|
@@ -48462,6 +48643,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48462
48643
|
}
|
|
48463
48644
|
request.onComplete(headers);
|
|
48464
48645
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
48646
|
+
socket[kSocketUsed] = client[kPending] === 0;
|
|
48465
48647
|
if (socket[kWriting]) {
|
|
48466
48648
|
assert$29(client[kRunning] === 0);
|
|
48467
48649
|
util.destroy(socket, new InformationalError("reset"));
|
|
@@ -48507,6 +48689,9 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48507
48689
|
socket[kWriting] = false;
|
|
48508
48690
|
socket[kReset] = false;
|
|
48509
48691
|
socket[kBlocking] = false;
|
|
48692
|
+
socket[kIdleSocketValidation] = 0;
|
|
48693
|
+
socket[kIdleSocketValidationTimeout] = null;
|
|
48694
|
+
socket[kSocketUsed] = false;
|
|
48510
48695
|
socket[kParser] = new Parser(client, socket, llhttpInstance);
|
|
48511
48696
|
util.addListener(socket, "error", onHttpSocketError);
|
|
48512
48697
|
util.addListener(socket, "readable", onHttpSocketReadable);
|
|
@@ -48534,7 +48719,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48534
48719
|
return socket.destroyed;
|
|
48535
48720
|
},
|
|
48536
48721
|
busy(request) {
|
|
48537
|
-
if (socket[kWriting] || socket[kReset] || socket[kBlocking]) return true;
|
|
48722
|
+
if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) return true;
|
|
48538
48723
|
if (request) {
|
|
48539
48724
|
if (client[kRunning] > 0 && !request.idempotent) return true;
|
|
48540
48725
|
if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) return true;
|
|
@@ -48548,7 +48733,11 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48548
48733
|
assert$29(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
|
|
48549
48734
|
const parser = this[kParser];
|
|
48550
48735
|
if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) {
|
|
48551
|
-
parser.
|
|
48736
|
+
const parserErr = parser.finish();
|
|
48737
|
+
if (parserErr) {
|
|
48738
|
+
this[kError] = parserErr;
|
|
48739
|
+
this[kClient][kOnError](parserErr);
|
|
48740
|
+
}
|
|
48552
48741
|
return;
|
|
48553
48742
|
}
|
|
48554
48743
|
this[kError] = err;
|
|
@@ -48560,15 +48749,17 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48560
48749
|
function onHttpSocketEnd() {
|
|
48561
48750
|
const parser = this[kParser];
|
|
48562
48751
|
if (parser.statusCode && !parser.shouldKeepAlive) {
|
|
48563
|
-
parser.
|
|
48752
|
+
const parserErr = parser.finish();
|
|
48753
|
+
if (parserErr) util.destroy(this, parserErr);
|
|
48564
48754
|
return;
|
|
48565
48755
|
}
|
|
48566
48756
|
util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this)));
|
|
48567
48757
|
}
|
|
48568
48758
|
function onHttpSocketClose() {
|
|
48569
48759
|
const parser = this[kParser];
|
|
48760
|
+
clearIdleSocketValidation(this);
|
|
48570
48761
|
if (parser) {
|
|
48571
|
-
if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) parser.
|
|
48762
|
+
if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) this[kError] = parser.finish() || this[kError];
|
|
48572
48763
|
this[kParser].destroy();
|
|
48573
48764
|
this[kParser] = null;
|
|
48574
48765
|
}
|
|
@@ -48596,6 +48787,22 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48596
48787
|
function onSocketClose() {
|
|
48597
48788
|
this[kClosed] = true;
|
|
48598
48789
|
}
|
|
48790
|
+
function clearIdleSocketValidation(socket) {
|
|
48791
|
+
if (socket[kIdleSocketValidationTimeout]) {
|
|
48792
|
+
clearTimeout(socket[kIdleSocketValidationTimeout]);
|
|
48793
|
+
socket[kIdleSocketValidationTimeout] = null;
|
|
48794
|
+
}
|
|
48795
|
+
socket[kIdleSocketValidation] = 0;
|
|
48796
|
+
}
|
|
48797
|
+
function scheduleIdleSocketValidation(client, socket) {
|
|
48798
|
+
socket[kIdleSocketValidation] = 1;
|
|
48799
|
+
socket[kIdleSocketValidationTimeout] = setTimeout(() => {
|
|
48800
|
+
socket[kIdleSocketValidationTimeout] = null;
|
|
48801
|
+
socket[kIdleSocketValidation] = 2;
|
|
48802
|
+
if (client[kSocket] === socket && !socket.destroyed) client[kResume]();
|
|
48803
|
+
}, 0);
|
|
48804
|
+
socket[kIdleSocketValidationTimeout].unref?.();
|
|
48805
|
+
}
|
|
48599
48806
|
/**
|
|
48600
48807
|
* @param {import('./client.js')} client
|
|
48601
48808
|
*/
|
|
@@ -48611,6 +48818,23 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48611
48818
|
socket.ref();
|
|
48612
48819
|
socket[kNoRef] = false;
|
|
48613
48820
|
}
|
|
48821
|
+
if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) {
|
|
48822
|
+
if (socket[kIdleSocketValidation] === 0) {
|
|
48823
|
+
scheduleIdleSocketValidation(client, socket);
|
|
48824
|
+
socket[kParser].readMore();
|
|
48825
|
+
if (socket.destroyed) return;
|
|
48826
|
+
return;
|
|
48827
|
+
}
|
|
48828
|
+
if (socket[kIdleSocketValidation] === 1) {
|
|
48829
|
+
socket[kParser].readMore();
|
|
48830
|
+
if (socket.destroyed) return;
|
|
48831
|
+
return;
|
|
48832
|
+
}
|
|
48833
|
+
}
|
|
48834
|
+
if (client[kRunning] === 0) {
|
|
48835
|
+
socket[kParser].readMore();
|
|
48836
|
+
if (socket.destroyed) return;
|
|
48837
|
+
}
|
|
48614
48838
|
if (client[kSize] === 0) {
|
|
48615
48839
|
if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE);
|
|
48616
48840
|
} else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {
|
|
@@ -48654,6 +48878,7 @@ var require_client_h1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48654
48878
|
process.emitWarning(new RequestContentLengthMismatchError());
|
|
48655
48879
|
}
|
|
48656
48880
|
const socket = client[kSocket];
|
|
48881
|
+
clearIdleSocketValidation(socket);
|
|
48657
48882
|
/**
|
|
48658
48883
|
* @param {Error} [err]
|
|
48659
48884
|
* @returns {void}
|
|
@@ -49518,7 +49743,7 @@ var require_client_h2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
49518
49743
|
//#region ../../node_modules/undici/lib/dispatcher/client.js
|
|
49519
49744
|
var require_client$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49520
49745
|
const assert$27 = require("node:assert");
|
|
49521
|
-
const net$
|
|
49746
|
+
const net$3 = require("node:net");
|
|
49522
49747
|
const http$4 = require("node:http");
|
|
49523
49748
|
const util = require_util$8();
|
|
49524
49749
|
const { ClientStats } = require_stats();
|
|
@@ -49547,7 +49772,7 @@ var require_client$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
49547
49772
|
* @param {string|URL} url
|
|
49548
49773
|
* @param {import('../../types/client.js').Client.Options} options
|
|
49549
49774
|
*/
|
|
49550
|
-
constructor(url, { maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, connect, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, maxConcurrentStreams, allowH2, useH2c, initialWindowSize, connectionWindowSize, pingInterval } = {}) {
|
|
49775
|
+
constructor(url, { maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, connect, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, maxConcurrentStreams, allowH2, useH2c, initialWindowSize, connectionWindowSize, pingInterval, webSocket } = {}) {
|
|
49551
49776
|
if (keepAlive !== void 0) throw new InvalidArgumentError("unsupported keepAlive, use pipelining=0 instead");
|
|
49552
49777
|
if (socketTimeout !== void 0) throw new InvalidArgumentError("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");
|
|
49553
49778
|
if (requestTimeout !== void 0) throw new InvalidArgumentError("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");
|
|
@@ -49565,7 +49790,7 @@ var require_client$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
49565
49790
|
if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero");
|
|
49566
49791
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") throw new InvalidArgumentError("connect must be a function or an object");
|
|
49567
49792
|
if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) throw new InvalidArgumentError("maxRequestsPerClient must be a positive number");
|
|
49568
|
-
if (localAddress != null && (typeof localAddress !== "string" || net$
|
|
49793
|
+
if (localAddress != null && (typeof localAddress !== "string" || net$3.isIP(localAddress) === 0)) throw new InvalidArgumentError("localAddress must be valid string IP address");
|
|
49569
49794
|
if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) throw new InvalidArgumentError("maxResponseSize must be a positive number");
|
|
49570
49795
|
if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) throw new InvalidArgumentError("autoSelectFamilyAttemptTimeout must be a positive number");
|
|
49571
49796
|
if (allowH2 != null && typeof allowH2 !== "boolean") throw new InvalidArgumentError("allowH2 must be a valid boolean value");
|
|
@@ -49574,7 +49799,7 @@ var require_client$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
49574
49799
|
if (initialWindowSize != null && (!Number.isInteger(initialWindowSize) || initialWindowSize < 1)) throw new InvalidArgumentError("initialWindowSize must be a positive integer, greater than 0");
|
|
49575
49800
|
if (connectionWindowSize != null && (!Number.isInteger(connectionWindowSize) || connectionWindowSize < 1)) throw new InvalidArgumentError("connectionWindowSize must be a positive integer, greater than 0");
|
|
49576
49801
|
if (pingInterval != null && (typeof pingInterval !== "number" || !Number.isInteger(pingInterval) || pingInterval < 0)) throw new InvalidArgumentError("pingInterval must be a positive integer, greater or equal to 0");
|
|
49577
|
-
super();
|
|
49802
|
+
super({ webSocket });
|
|
49578
49803
|
if (typeof connect !== "function") connect = buildConnector({
|
|
49579
49804
|
...tls,
|
|
49580
49805
|
maxCachedSessions,
|
|
@@ -49588,11 +49813,12 @@ var require_client$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
49588
49813
|
} : void 0,
|
|
49589
49814
|
...connect
|
|
49590
49815
|
});
|
|
49591
|
-
else
|
|
49816
|
+
else {
|
|
49592
49817
|
const customConnect = connect;
|
|
49593
49818
|
connect = (opts, callback) => customConnect({
|
|
49594
49819
|
...opts,
|
|
49595
|
-
socketPath
|
|
49820
|
+
...socketPath != null ? { socketPath } : null,
|
|
49821
|
+
...allowH2 != null ? { allowH2 } : null
|
|
49596
49822
|
}, callback);
|
|
49597
49823
|
}
|
|
49598
49824
|
this[kUrl] = util.parseOrigin(url);
|
|
@@ -49715,7 +49941,7 @@ var require_client$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
49715
49941
|
const idx = hostname.indexOf("]");
|
|
49716
49942
|
assert$27(idx !== -1);
|
|
49717
49943
|
const ip = hostname.substring(1, idx);
|
|
49718
|
-
assert$27(net$
|
|
49944
|
+
assert$27(net$3.isIPv6(ip));
|
|
49719
49945
|
hostname = ip;
|
|
49720
49946
|
}
|
|
49721
49947
|
client[kConnecting] = true;
|
|
@@ -50137,7 +50363,7 @@ var require_pool = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
50137
50363
|
} : void 0,
|
|
50138
50364
|
...connect
|
|
50139
50365
|
});
|
|
50140
|
-
super();
|
|
50366
|
+
super(options);
|
|
50141
50367
|
this[kConnections] = connections || null;
|
|
50142
50368
|
this[kUrl] = util.parseOrigin(origin);
|
|
50143
50369
|
this[kOptions] = {
|
|
@@ -50211,7 +50437,7 @@ var require_balanced_pool = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50211
50437
|
var BalancedPool = class extends PoolBase {
|
|
50212
50438
|
constructor(upstreams = [], { factory = defaultFactory, ...opts } = {}) {
|
|
50213
50439
|
if (typeof factory !== "function") throw new InvalidArgumentError("factory must be a function.");
|
|
50214
|
-
super();
|
|
50440
|
+
super(opts);
|
|
50215
50441
|
this[kOptions] = { ...util.deepClone(opts) };
|
|
50216
50442
|
this[kOptions].interceptors = opts.interceptors ? { ...opts.interceptors } : void 0;
|
|
50217
50443
|
this[kIndex] = -1;
|
|
@@ -50396,7 +50622,7 @@ var require_agent$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
50396
50622
|
if (typeof factory !== "function") throw new InvalidArgumentError("factory must be a function.");
|
|
50397
50623
|
if (connect != null && typeof connect !== "function" && typeof connect !== "object") throw new InvalidArgumentError("connect must be a function or an object");
|
|
50398
50624
|
if (typeof maxOrigins !== "number" || Number.isNaN(maxOrigins) || maxOrigins <= 0) throw new InvalidArgumentError("maxOrigins must be a number greater than 0");
|
|
50399
|
-
super();
|
|
50625
|
+
super(options);
|
|
50400
50626
|
if (connect && typeof connect !== "function") connect = { ...connect };
|
|
50401
50627
|
this[kOptions] = {
|
|
50402
50628
|
...util.deepClone(options),
|
|
@@ -50486,7 +50712,7 @@ var require_agent$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
50486
50712
|
//#region ../../node_modules/undici/lib/core/socks5-utils.js
|
|
50487
50713
|
var require_socks5_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
50488
50714
|
const { Buffer: Buffer$6 } = require("node:buffer");
|
|
50489
|
-
const net$
|
|
50715
|
+
const net$2 = require("node:net");
|
|
50490
50716
|
const { InvalidArgumentError } = require_errors$3();
|
|
50491
50717
|
/**
|
|
50492
50718
|
* Parse an address and determine its type
|
|
@@ -50494,14 +50720,14 @@ var require_socks5_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
50494
50720
|
* @returns {{type: number, buffer: Buffer}} Address type and buffer
|
|
50495
50721
|
*/
|
|
50496
50722
|
function parseAddress(address) {
|
|
50497
|
-
if (net$
|
|
50723
|
+
if (net$2.isIPv4(address)) {
|
|
50498
50724
|
const parts = address.split(".").map(Number);
|
|
50499
50725
|
return {
|
|
50500
50726
|
type: 1,
|
|
50501
50727
|
buffer: Buffer$6.from(parts)
|
|
50502
50728
|
};
|
|
50503
50729
|
}
|
|
50504
|
-
if (net$
|
|
50730
|
+
if (net$2.isIPv6(address)) return {
|
|
50505
50731
|
type: 4,
|
|
50506
50732
|
buffer: parseIPv6(address)
|
|
50507
50733
|
};
|
|
@@ -50519,23 +50745,36 @@ var require_socks5_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
50519
50745
|
*/
|
|
50520
50746
|
function parseIPv6(address) {
|
|
50521
50747
|
const buffer = Buffer$6.alloc(16);
|
|
50522
|
-
|
|
50523
|
-
|
|
50524
|
-
|
|
50525
|
-
|
|
50748
|
+
let normalizedAddress = address;
|
|
50749
|
+
if (address.includes(".")) {
|
|
50750
|
+
const lastColonIndex = address.lastIndexOf(":");
|
|
50751
|
+
const ipv4Part = address.slice(lastColonIndex + 1);
|
|
50752
|
+
if (net$2.isIPv4(ipv4Part)) {
|
|
50753
|
+
const octets = ipv4Part.split(".").map(Number);
|
|
50754
|
+
const high = (octets[0] << 8 | octets[1]).toString(16);
|
|
50755
|
+
const low = (octets[2] << 8 | octets[3]).toString(16);
|
|
50756
|
+
normalizedAddress = `${address.slice(0, lastColonIndex)}:${high}:${low}`;
|
|
50757
|
+
}
|
|
50758
|
+
}
|
|
50759
|
+
const doubleColonIndex = normalizedAddress.indexOf("::");
|
|
50526
50760
|
if (doubleColonIndex !== -1) {
|
|
50527
|
-
const
|
|
50528
|
-
|
|
50529
|
-
|
|
50530
|
-
|
|
50531
|
-
|
|
50761
|
+
const before = normalizedAddress.slice(0, doubleColonIndex);
|
|
50762
|
+
const after = normalizedAddress.slice(doubleColonIndex + 2);
|
|
50763
|
+
const beforeParts = before === "" ? [] : before.split(":");
|
|
50764
|
+
const afterParts = after === "" ? [] : after.split(":");
|
|
50765
|
+
let bufferIndex = 0;
|
|
50766
|
+
for (const part of beforeParts) {
|
|
50767
|
+
buffer.writeUInt16BE(parseInt(part, 16), bufferIndex);
|
|
50532
50768
|
bufferIndex += 2;
|
|
50533
50769
|
}
|
|
50534
|
-
|
|
50535
|
-
|
|
50536
|
-
|
|
50537
|
-
|
|
50538
|
-
|
|
50770
|
+
bufferIndex = 16 - afterParts.length * 2;
|
|
50771
|
+
for (const part of afterParts) {
|
|
50772
|
+
buffer.writeUInt16BE(parseInt(part, 16), bufferIndex);
|
|
50773
|
+
bufferIndex += 2;
|
|
50774
|
+
}
|
|
50775
|
+
} else {
|
|
50776
|
+
const parts = normalizedAddress.split(":");
|
|
50777
|
+
for (let i = 0; i < parts.length; i++) buffer.writeUInt16BE(parseInt(parts[i], 16), i * 2);
|
|
50539
50778
|
}
|
|
50540
50779
|
return buffer;
|
|
50541
50780
|
}
|
|
@@ -50640,6 +50879,7 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50640
50879
|
const { debuglog: debuglog$1 } = require("node:util");
|
|
50641
50880
|
const { parseAddress } = require_socks5_utils();
|
|
50642
50881
|
const debug = debuglog$1("undici:socks5");
|
|
50882
|
+
const EMPTY_BUFFER = Buffer$5.alloc(0);
|
|
50643
50883
|
const SOCKS_VERSION = 5;
|
|
50644
50884
|
const AUTH_METHODS = {
|
|
50645
50885
|
NO_AUTH: 0,
|
|
@@ -50672,6 +50912,7 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50672
50912
|
INITIAL: "initial",
|
|
50673
50913
|
HANDSHAKING: "handshaking",
|
|
50674
50914
|
AUTHENTICATING: "authenticating",
|
|
50915
|
+
AUTHENTICATED: "authenticated",
|
|
50675
50916
|
CONNECTING: "connecting",
|
|
50676
50917
|
CONNECTED: "connected",
|
|
50677
50918
|
ERROR: "error",
|
|
@@ -50688,13 +50929,16 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50688
50929
|
this.socket = socket;
|
|
50689
50930
|
this.options = options;
|
|
50690
50931
|
this.state = STATES.INITIAL;
|
|
50691
|
-
this.buffer =
|
|
50932
|
+
this.buffer = EMPTY_BUFFER;
|
|
50933
|
+
this.onSocketData = this.onData.bind(this);
|
|
50934
|
+
this.onSocketError = this.onError.bind(this);
|
|
50935
|
+
this.onSocketClose = this.onClose.bind(this);
|
|
50692
50936
|
this.authMethods = [];
|
|
50693
50937
|
if (options.username && options.password) this.authMethods.push(AUTH_METHODS.USERNAME_PASSWORD);
|
|
50694
50938
|
this.authMethods.push(AUTH_METHODS.NO_AUTH);
|
|
50695
|
-
this.socket.on("data", this.
|
|
50696
|
-
this.socket.on("error", this.
|
|
50697
|
-
this.socket.on("close", this.
|
|
50939
|
+
this.socket.on("data", this.onSocketData);
|
|
50940
|
+
this.socket.on("error", this.onSocketError);
|
|
50941
|
+
this.socket.on("close", this.onSocketClose);
|
|
50698
50942
|
}
|
|
50699
50943
|
/**
|
|
50700
50944
|
* Handle incoming data from the socket
|
|
@@ -50741,6 +50985,10 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50741
50985
|
destroy() {
|
|
50742
50986
|
if (this.socket && !this.socket.destroyed) this.socket.destroy();
|
|
50743
50987
|
}
|
|
50988
|
+
markAuthenticated() {
|
|
50989
|
+
this.state = STATES.AUTHENTICATED;
|
|
50990
|
+
this.emit("authenticated");
|
|
50991
|
+
}
|
|
50744
50992
|
/**
|
|
50745
50993
|
* Start the SOCKS5 handshake
|
|
50746
50994
|
*/
|
|
@@ -50767,7 +51015,7 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50767
51015
|
if (method === AUTH_METHODS.NO_ACCEPTABLE) throw new Socks5ProxyError("No acceptable authentication method", "UND_ERR_SOCKS5_AUTH_REJECTED");
|
|
50768
51016
|
this.buffer = this.buffer.subarray(2);
|
|
50769
51017
|
debug("server selected auth method", method);
|
|
50770
|
-
if (method === AUTH_METHODS.NO_AUTH) this.
|
|
51018
|
+
if (method === AUTH_METHODS.NO_AUTH) this.markAuthenticated();
|
|
50771
51019
|
else if (method === AUTH_METHODS.USERNAME_PASSWORD) {
|
|
50772
51020
|
this.state = STATES.AUTHENTICATING;
|
|
50773
51021
|
this.sendAuthRequest();
|
|
@@ -50802,7 +51050,7 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50802
51050
|
if (status !== 0) throw new Socks5ProxyError("Authentication failed", "UND_ERR_SOCKS5_AUTH_FAILED");
|
|
50803
51051
|
this.buffer = this.buffer.subarray(2);
|
|
50804
51052
|
debug("authentication successful");
|
|
50805
|
-
this.
|
|
51053
|
+
this.markAuthenticated();
|
|
50806
51054
|
}
|
|
50807
51055
|
/**
|
|
50808
51056
|
* Send CONNECT command
|
|
@@ -50810,7 +51058,8 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50810
51058
|
* @param {number} port - Target port
|
|
50811
51059
|
*/
|
|
50812
51060
|
connect(address, port) {
|
|
50813
|
-
if (this.state === STATES.CONNECTED) throw new InvalidArgumentError("
|
|
51061
|
+
if (this.state === STATES.CONNECTING || this.state === STATES.CONNECTED) throw new InvalidArgumentError("Connection already in progress");
|
|
51062
|
+
if (this.state !== STATES.AUTHENTICATED) throw new InvalidArgumentError("Client must be authenticated before CONNECT");
|
|
50814
51063
|
debug("connecting to", address, port);
|
|
50815
51064
|
this.state = STATES.CONNECTING;
|
|
50816
51065
|
const request = this.buildConnectRequest(COMMANDS.CONNECT, address, port);
|
|
@@ -50868,8 +51117,9 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50868
51117
|
offset += 16;
|
|
50869
51118
|
}
|
|
50870
51119
|
const boundPort = this.buffer.readUInt16BE(offset);
|
|
50871
|
-
this.buffer =
|
|
51120
|
+
this.buffer = EMPTY_BUFFER;
|
|
50872
51121
|
this.state = STATES.CONNECTED;
|
|
51122
|
+
this.socket.removeListener("data", this.onSocketData);
|
|
50873
51123
|
debug("connected, bound address:", boundAddress, "port:", boundPort);
|
|
50874
51124
|
this.emit("connected", {
|
|
50875
51125
|
address: boundAddress,
|
|
@@ -50905,12 +51155,11 @@ var require_socks5_client = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
50905
51155
|
//#endregion
|
|
50906
51156
|
//#region ../../node_modules/undici/lib/dispatcher/socks5-proxy-agent.js
|
|
50907
51157
|
var require_socks5_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
50908
|
-
const net$2 = require("node:net");
|
|
50909
51158
|
const { URL: URL$2 } = require("node:url");
|
|
50910
51159
|
let tls;
|
|
50911
51160
|
const DispatcherBase = require_dispatcher_base();
|
|
50912
51161
|
const { InvalidArgumentError } = require_errors$3();
|
|
50913
|
-
const { Socks5Client } = require_socks5_client();
|
|
51162
|
+
const { Socks5Client, STATES } = require_socks5_client();
|
|
50914
51163
|
const { kDispatch, kClose, kDestroy } = require_symbols();
|
|
50915
51164
|
const Pool = require_pool();
|
|
50916
51165
|
const buildConnector = require_connect$1();
|
|
@@ -50919,8 +51168,10 @@ var require_socks5_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
50919
51168
|
const kProxyUrl = Symbol("proxy url");
|
|
50920
51169
|
const kProxyHeaders = Symbol("proxy headers");
|
|
50921
51170
|
const kProxyAuth = Symbol("proxy auth");
|
|
50922
|
-
const
|
|
51171
|
+
const kProxyProtocol = Symbol("proxy protocol");
|
|
51172
|
+
const kPools = Symbol("pools");
|
|
50923
51173
|
const kConnector = Symbol("connector");
|
|
51174
|
+
const kRequestTls = Symbol("request tls settings");
|
|
50924
51175
|
let experimentalWarningEmitted = false;
|
|
50925
51176
|
/**
|
|
50926
51177
|
* SOCKS5 proxy agent for dispatching requests through a SOCKS5 proxy
|
|
@@ -50937,6 +51188,8 @@ var require_socks5_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
50937
51188
|
if (url.protocol !== "socks5:" && url.protocol !== "socks:") throw new InvalidArgumentError("Proxy URL must use socks5:// or socks:// protocol");
|
|
50938
51189
|
this[kProxyUrl] = url;
|
|
50939
51190
|
this[kProxyHeaders] = options.headers || {};
|
|
51191
|
+
this[kProxyProtocol] = options.proxyTls ? "https:" : "http:";
|
|
51192
|
+
this[kRequestTls] = options.requestTls;
|
|
50940
51193
|
this[kProxyAuth] = {
|
|
50941
51194
|
username: options.username || (url.username ? decodeURIComponent(url.username) : null),
|
|
50942
51195
|
password: options.password || (url.password ? decodeURIComponent(url.password) : null)
|
|
@@ -50945,7 +51198,7 @@ var require_socks5_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
50945
51198
|
...options.proxyTls,
|
|
50946
51199
|
servername: options.proxyTls?.servername || url.hostname
|
|
50947
51200
|
});
|
|
50948
|
-
this[
|
|
51201
|
+
this[kPools] = /* @__PURE__ */ new Map();
|
|
50949
51202
|
}
|
|
50950
51203
|
/**
|
|
50951
51204
|
* Create a SOCKS5 connection to the proxy
|
|
@@ -50955,20 +51208,15 @@ var require_socks5_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
50955
51208
|
const proxyPort = parseInt(this[kProxyUrl].port) || 1080;
|
|
50956
51209
|
debug("creating SOCKS5 connection to", proxyHost, proxyPort);
|
|
50957
51210
|
const socket = await new Promise((resolve, reject) => {
|
|
50958
|
-
|
|
50959
|
-
|
|
50960
|
-
resolve(socket);
|
|
50961
|
-
};
|
|
50962
|
-
const onError = (err) => {
|
|
50963
|
-
socket.removeListener("connect", onConnect);
|
|
50964
|
-
reject(err);
|
|
50965
|
-
};
|
|
50966
|
-
const socket = net$2.connect({
|
|
51211
|
+
this[kConnector]({
|
|
51212
|
+
hostname: proxyHost,
|
|
50967
51213
|
host: proxyHost,
|
|
50968
|
-
port: proxyPort
|
|
51214
|
+
port: proxyPort,
|
|
51215
|
+
protocol: this[kProxyProtocol]
|
|
51216
|
+
}, (err, socket) => {
|
|
51217
|
+
if (err) reject(err);
|
|
51218
|
+
else resolve(socket);
|
|
50969
51219
|
});
|
|
50970
|
-
socket.once("connect", onConnect);
|
|
50971
|
-
socket.once("error", onError);
|
|
50972
51220
|
});
|
|
50973
51221
|
const socks5Client = new Socks5Client(socket, this[kProxyAuth]);
|
|
50974
51222
|
socks5Client.on("error", (err) => {
|
|
@@ -50990,7 +51238,7 @@ var require_socks5_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
50990
51238
|
socks5Client.removeListener("authenticated", onAuthenticated);
|
|
50991
51239
|
reject(err);
|
|
50992
51240
|
};
|
|
50993
|
-
if (socks5Client.state ===
|
|
51241
|
+
if (socks5Client.state === STATES.AUTHENTICATED) {
|
|
50994
51242
|
clearTimeout(timeout);
|
|
50995
51243
|
resolve();
|
|
50996
51244
|
} else {
|
|
@@ -51022,53 +51270,69 @@ var require_socks5_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
51022
51270
|
/**
|
|
51023
51271
|
* Dispatch a request through the SOCKS5 proxy
|
|
51024
51272
|
*/
|
|
51025
|
-
|
|
51273
|
+
[kDispatch](opts, handler) {
|
|
51026
51274
|
const { origin } = opts;
|
|
51027
51275
|
debug("dispatching request to", origin, "via SOCKS5");
|
|
51028
51276
|
try {
|
|
51029
|
-
|
|
51030
|
-
|
|
51031
|
-
|
|
51032
|
-
|
|
51033
|
-
|
|
51034
|
-
|
|
51035
|
-
|
|
51036
|
-
|
|
51037
|
-
|
|
51038
|
-
|
|
51039
|
-
|
|
51040
|
-
|
|
51041
|
-
|
|
51042
|
-
|
|
51043
|
-
|
|
51044
|
-
|
|
51045
|
-
|
|
51046
|
-
|
|
51047
|
-
|
|
51048
|
-
|
|
51049
|
-
|
|
51050
|
-
|
|
51051
|
-
|
|
51277
|
+
const originKey = String(origin);
|
|
51278
|
+
let pool = this[kPools].get(originKey);
|
|
51279
|
+
if (!pool || pool.destroyed || pool.closed) {
|
|
51280
|
+
pool = new Pool(origin, {
|
|
51281
|
+
pipelining: opts.pipelining,
|
|
51282
|
+
connections: opts.connections,
|
|
51283
|
+
connect: async (connectOpts, callback) => {
|
|
51284
|
+
try {
|
|
51285
|
+
const url = new URL$2(origin);
|
|
51286
|
+
const targetHost = url.hostname;
|
|
51287
|
+
const targetPort = parseInt(url.port) || (url.protocol === "https:" ? 443 : 80);
|
|
51288
|
+
debug("establishing SOCKS5 connection to", targetHost, targetPort);
|
|
51289
|
+
const socket = await this.createSocks5Connection(targetHost, targetPort);
|
|
51290
|
+
let finalSocket = socket;
|
|
51291
|
+
if (url.protocol === "https:") {
|
|
51292
|
+
if (!tls) tls = require("node:tls");
|
|
51293
|
+
debug("upgrading to TLS");
|
|
51294
|
+
finalSocket = tls.connect({
|
|
51295
|
+
...this[kRequestTls],
|
|
51296
|
+
socket,
|
|
51297
|
+
servername: this[kRequestTls]?.servername || targetHost
|
|
51298
|
+
});
|
|
51299
|
+
await new Promise((resolve, reject) => {
|
|
51300
|
+
finalSocket.once("secureConnect", resolve);
|
|
51301
|
+
finalSocket.once("error", reject);
|
|
51302
|
+
});
|
|
51303
|
+
}
|
|
51304
|
+
callback(null, finalSocket);
|
|
51305
|
+
} catch (err) {
|
|
51306
|
+
debug("SOCKS5 connection error:", err);
|
|
51307
|
+
callback(err);
|
|
51052
51308
|
}
|
|
51053
|
-
callback(null, finalSocket);
|
|
51054
|
-
} catch (err) {
|
|
51055
|
-
debug("SOCKS5 connection error:", err);
|
|
51056
|
-
callback(err);
|
|
51057
51309
|
}
|
|
51058
|
-
}
|
|
51059
|
-
|
|
51060
|
-
|
|
51310
|
+
});
|
|
51311
|
+
this[kPools].set(originKey, pool);
|
|
51312
|
+
}
|
|
51313
|
+
return pool[kDispatch](opts, handler);
|
|
51061
51314
|
} catch (err) {
|
|
51062
51315
|
debug("dispatch error:", err);
|
|
51063
|
-
if (typeof handler.
|
|
51064
|
-
|
|
51316
|
+
if (typeof handler.onResponseError === "function") {
|
|
51317
|
+
handler.onResponseError(null, err);
|
|
51318
|
+
return false;
|
|
51319
|
+
} else if (typeof handler.onError === "function") {
|
|
51320
|
+
handler.onError(err);
|
|
51321
|
+
return false;
|
|
51322
|
+
} else throw err;
|
|
51065
51323
|
}
|
|
51066
51324
|
}
|
|
51067
51325
|
async [kClose]() {
|
|
51068
|
-
|
|
51326
|
+
const closePromises = [];
|
|
51327
|
+
for (const pool of this[kPools].values()) closePromises.push(pool.close());
|
|
51328
|
+
this[kPools].clear();
|
|
51329
|
+
await Promise.all(closePromises);
|
|
51069
51330
|
}
|
|
51070
51331
|
async [kDestroy](err) {
|
|
51071
|
-
|
|
51332
|
+
const destroyPromises = [];
|
|
51333
|
+
for (const pool of this[kPools].values()) destroyPromises.push(pool.destroy(err));
|
|
51334
|
+
this[kPools].clear();
|
|
51335
|
+
await Promise.all(destroyPromises);
|
|
51072
51336
|
}
|
|
51073
51337
|
};
|
|
51074
51338
|
module.exports = Socks5ProxyAgent;
|
|
@@ -51172,7 +51436,8 @@ var require_proxy_agent = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
51172
51436
|
factory: agentFactory,
|
|
51173
51437
|
username: opts.username || username,
|
|
51174
51438
|
password: opts.password || password,
|
|
51175
|
-
proxyTls: opts.proxyTls
|
|
51439
|
+
proxyTls: opts.proxyTls,
|
|
51440
|
+
requestTls: opts.requestTls
|
|
51176
51441
|
});
|
|
51177
51442
|
if (!this[kTunnelProxy] && protocol === "http:" && this[kProxy].protocol === "http:") return new Http1ProxyWrapper(this[kProxy].uri, {
|
|
51178
51443
|
headers: this[kProxyHeaders],
|
|
@@ -51680,7 +51945,7 @@ var require_h2c_client = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
51680
51945
|
constructor(origin, clientOpts) {
|
|
51681
51946
|
if (typeof origin === "string") origin = new URL(origin);
|
|
51682
51947
|
if (origin.protocol !== "http:") throw new InvalidArgumentError("h2c-client: Only h2c protocol is supported");
|
|
51683
|
-
const {
|
|
51948
|
+
const { maxConcurrentStreams, pipelining, ...opts } = clientOpts ?? {};
|
|
51684
51949
|
let defaultMaxConcurrentStreams = 100;
|
|
51685
51950
|
let defaultPipelining = 100;
|
|
51686
51951
|
if (maxConcurrentStreams != null && Number.isInteger(maxConcurrentStreams) && maxConcurrentStreams > 0) defaultMaxConcurrentStreams = maxConcurrentStreams;
|
|
@@ -52125,7 +52390,7 @@ var require_api_request = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
52125
52390
|
const { signal, method, opaque, body, onInfo, responseHeaders, highWaterMark } = opts;
|
|
52126
52391
|
try {
|
|
52127
52392
|
if (typeof callback !== "function") throw new InvalidArgumentError("invalid callback");
|
|
52128
|
-
if (highWaterMark && (
|
|
52393
|
+
if (highWaterMark != null && (!Number.isFinite(highWaterMark) || highWaterMark < 0)) throw new InvalidArgumentError("invalid highWaterMark");
|
|
52129
52394
|
if (signal && typeof signal.on !== "function" && typeof signal.addEventListener !== "function") throw new InvalidArgumentError("signal must be an EventEmitter or EventTarget");
|
|
52130
52395
|
if (method === "CONNECT") throw new InvalidArgumentError("invalid method");
|
|
52131
52396
|
if (onInfo && typeof onInfo !== "function") throw new InvalidArgumentError("invalid onInfo callback");
|
|
@@ -53311,12 +53576,12 @@ var require_mock_client = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
53311
53576
|
var require_mock_call_history = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
53312
53577
|
const { kMockCallHistoryAddLog } = require_mock_symbols();
|
|
53313
53578
|
const { InvalidArgumentError } = require_errors$3();
|
|
53314
|
-
function handleFilterCallsWithOptions(criteria, options, handler, store) {
|
|
53579
|
+
function handleFilterCallsWithOptions(criteria, options, handler, store, allLogs) {
|
|
53315
53580
|
switch (options.operator) {
|
|
53316
53581
|
case "OR":
|
|
53317
|
-
store.push(...handler(criteria));
|
|
53582
|
+
store.push(...handler(criteria, allLogs));
|
|
53318
53583
|
return store;
|
|
53319
|
-
case "AND": return handler
|
|
53584
|
+
case "AND": return handler(criteria, store);
|
|
53320
53585
|
default: throw new InvalidArgumentError("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");
|
|
53321
53586
|
}
|
|
53322
53587
|
}
|
|
@@ -53332,11 +53597,11 @@ var require_mock_call_history = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
53332
53597
|
return finalOptions;
|
|
53333
53598
|
}
|
|
53334
53599
|
function makeFilterCalls(parameterName) {
|
|
53335
|
-
return (parameterValue) => {
|
|
53336
|
-
if (typeof parameterValue === "string" || parameterValue == null) return
|
|
53600
|
+
return (parameterValue, logs) => {
|
|
53601
|
+
if (typeof parameterValue === "string" || parameterValue == null) return logs.filter((log) => {
|
|
53337
53602
|
return log[parameterName] === parameterValue;
|
|
53338
53603
|
});
|
|
53339
|
-
if (parameterValue instanceof RegExp) return
|
|
53604
|
+
if (parameterValue instanceof RegExp) return logs.filter((log) => {
|
|
53340
53605
|
return parameterValue.test(log[parameterName]);
|
|
53341
53606
|
});
|
|
53342
53607
|
throw new InvalidArgumentError(`${parameterName} parameter should be one of string, regexp, undefined or null`);
|
|
@@ -53424,15 +53689,15 @@ var require_mock_call_history = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
53424
53689
|
operator: "OR",
|
|
53425
53690
|
...buildAndValidateFilterCallsOptions(options)
|
|
53426
53691
|
};
|
|
53427
|
-
let maybeDuplicatedLogsFiltered = [];
|
|
53428
|
-
if ("protocol" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered);
|
|
53429
|
-
if ("host" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered);
|
|
53430
|
-
if ("port" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered);
|
|
53431
|
-
if ("origin" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered);
|
|
53432
|
-
if ("path" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered);
|
|
53433
|
-
if ("hash" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered);
|
|
53434
|
-
if ("fullUrl" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered);
|
|
53435
|
-
if ("method" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered);
|
|
53692
|
+
let maybeDuplicatedLogsFiltered = finalOptions.operator === "AND" ? this.logs : [];
|
|
53693
|
+
if ("protocol" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.protocol, finalOptions, this.filterCallsByProtocol, maybeDuplicatedLogsFiltered, this.logs);
|
|
53694
|
+
if ("host" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.host, finalOptions, this.filterCallsByHost, maybeDuplicatedLogsFiltered, this.logs);
|
|
53695
|
+
if ("port" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.port, finalOptions, this.filterCallsByPort, maybeDuplicatedLogsFiltered, this.logs);
|
|
53696
|
+
if ("origin" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.origin, finalOptions, this.filterCallsByOrigin, maybeDuplicatedLogsFiltered, this.logs);
|
|
53697
|
+
if ("path" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.path, finalOptions, this.filterCallsByPath, maybeDuplicatedLogsFiltered, this.logs);
|
|
53698
|
+
if ("hash" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.hash, finalOptions, this.filterCallsByHash, maybeDuplicatedLogsFiltered, this.logs);
|
|
53699
|
+
if ("fullUrl" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.fullUrl, finalOptions, this.filterCallsByFullUrl, maybeDuplicatedLogsFiltered, this.logs);
|
|
53700
|
+
if ("method" in criteria) maybeDuplicatedLogsFiltered = handleFilterCallsWithOptions(criteria.method, finalOptions, this.filterCallsByMethod, maybeDuplicatedLogsFiltered, this.logs);
|
|
53436
53701
|
return [...new Set(maybeDuplicatedLogsFiltered)];
|
|
53437
53702
|
}
|
|
53438
53703
|
throw new InvalidArgumentError("criteria parameter should be one of function, regexp, or object");
|
|
@@ -54481,7 +54746,8 @@ var require_snapshot_agent = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
54481
54746
|
//#endregion
|
|
54482
54747
|
//#region ../../node_modules/undici/lib/global.js
|
|
54483
54748
|
var require_global = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
54484
|
-
const globalDispatcher = Symbol.for("undici.globalDispatcher.
|
|
54749
|
+
const globalDispatcher = Symbol.for("undici.globalDispatcher.2");
|
|
54750
|
+
const legacyGlobalDispatcher = Symbol.for("undici.globalDispatcher.1");
|
|
54485
54751
|
const { InvalidArgumentError } = require_errors$3();
|
|
54486
54752
|
const Agent = require_agent$1();
|
|
54487
54753
|
if (getGlobalDispatcher() === void 0) setGlobalDispatcher(new Agent());
|
|
@@ -54493,9 +54759,15 @@ var require_global = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
54493
54759
|
enumerable: false,
|
|
54494
54760
|
configurable: false
|
|
54495
54761
|
});
|
|
54762
|
+
Object.defineProperty(globalThis, legacyGlobalDispatcher, {
|
|
54763
|
+
value: agent,
|
|
54764
|
+
writable: true,
|
|
54765
|
+
enumerable: false,
|
|
54766
|
+
configurable: false
|
|
54767
|
+
});
|
|
54496
54768
|
}
|
|
54497
54769
|
function getGlobalDispatcher() {
|
|
54498
|
-
return globalThis[
|
|
54770
|
+
return globalThis[legacyGlobalDispatcher];
|
|
54499
54771
|
}
|
|
54500
54772
|
module.exports = {
|
|
54501
54773
|
setGlobalDispatcher,
|
|
@@ -55194,7 +55466,7 @@ var require_cache$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
55194
55466
|
function makeCacheKey(opts) {
|
|
55195
55467
|
if (!opts.origin) throw new Error("opts.origin is undefined");
|
|
55196
55468
|
let fullPath = opts.path || "/";
|
|
55197
|
-
if (opts.query && !pathHasQueryOrFragment(
|
|
55469
|
+
if (opts.query && !pathHasQueryOrFragment(fullPath)) fullPath = serializePathWithQuery(fullPath, opts.query);
|
|
55198
55470
|
return {
|
|
55199
55471
|
origin: opts.origin.toString(),
|
|
55200
55472
|
method: opts.method,
|
|
@@ -55310,11 +55582,15 @@ var require_cache$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
55310
55582
|
lastHeader = lastHeader.substring(0, lastHeader.length - 1);
|
|
55311
55583
|
headers[headers.length - 1] = lastHeader;
|
|
55312
55584
|
}
|
|
55585
|
+
for (let j = 0; j < headers.length; j++) headers[j] = headers[j].trim();
|
|
55313
55586
|
if (key in output) output[key] = output[key].concat(headers);
|
|
55314
55587
|
else output[key] = headers;
|
|
55315
55588
|
}
|
|
55316
|
-
} else
|
|
55317
|
-
|
|
55589
|
+
} else {
|
|
55590
|
+
const fieldName = value.trim();
|
|
55591
|
+
if (key in output) output[key] = output[key].concat(fieldName);
|
|
55592
|
+
else output[key] = [fieldName];
|
|
55593
|
+
}
|
|
55318
55594
|
break;
|
|
55319
55595
|
}
|
|
55320
55596
|
case "public":
|
|
@@ -55392,16 +55668,20 @@ var require_cache$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
55392
55668
|
* @returns {string}
|
|
55393
55669
|
*/
|
|
55394
55670
|
function makeDeduplicationKey(cacheKey, excludeHeaders) {
|
|
55395
|
-
|
|
55671
|
+
const headers = {};
|
|
55396
55672
|
if (cacheKey.headers) {
|
|
55397
55673
|
const sortedHeaders = Object.keys(cacheKey.headers).sort();
|
|
55398
55674
|
for (const header of sortedHeaders) {
|
|
55399
55675
|
if (excludeHeaders?.has(header.toLowerCase())) continue;
|
|
55400
|
-
|
|
55401
|
-
key += `:${header}=${Array.isArray(value) ? value.join(",") : value}`;
|
|
55676
|
+
headers[header] = cacheKey.headers[header];
|
|
55402
55677
|
}
|
|
55403
55678
|
}
|
|
55404
|
-
return
|
|
55679
|
+
return JSON.stringify([
|
|
55680
|
+
cacheKey.origin,
|
|
55681
|
+
cacheKey.method,
|
|
55682
|
+
cacheKey.path,
|
|
55683
|
+
headers
|
|
55684
|
+
]);
|
|
55405
55685
|
}
|
|
55406
55686
|
module.exports = {
|
|
55407
55687
|
makeCacheKey,
|
|
@@ -57340,7 +57620,7 @@ var require_sqlite_cache_store = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
57340
57620
|
SELECT
|
|
57341
57621
|
id
|
|
57342
57622
|
FROM cacheInterceptorV${VERSION}
|
|
57343
|
-
ORDER BY cachedAt
|
|
57623
|
+
ORDER BY cachedAt ASC
|
|
57344
57624
|
LIMIT ?
|
|
57345
57625
|
)
|
|
57346
57626
|
`);
|
|
@@ -57381,8 +57661,8 @@ var require_sqlite_cache_store = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
57381
57661
|
const existingValue = this.#findValue(key, true);
|
|
57382
57662
|
if (existingValue) this.#updateValueQuery.run(body, value.deleteAt, value.statusCode, value.statusMessage, value.headers ? JSON.stringify(value.headers) : null, value.etag ? value.etag : null, value.cacheControlDirectives ? JSON.stringify(value.cacheControlDirectives) : null, value.cachedAt, value.staleAt, existingValue.id);
|
|
57383
57663
|
else {
|
|
57384
|
-
this.#prune();
|
|
57385
57664
|
this.#insertValueQuery.run(url, key.method, body, value.deleteAt, value.statusCode, value.statusMessage, value.headers ? JSON.stringify(value.headers) : null, value.etag ? value.etag : null, value.cacheControlDirectives ? JSON.stringify(value.cacheControlDirectives) : null, value.vary ? JSON.stringify(value.vary) : null, value.cachedAt, value.staleAt);
|
|
57665
|
+
this.#prune();
|
|
57386
57666
|
}
|
|
57387
57667
|
}
|
|
57388
57668
|
/**
|
|
@@ -57465,7 +57745,7 @@ var require_sqlite_cache_store = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
57465
57745
|
if (values.length === 0) return;
|
|
57466
57746
|
const now = Date.now();
|
|
57467
57747
|
for (const value of values) {
|
|
57468
|
-
if (now >= value.deleteAt && !canBeExpired)
|
|
57748
|
+
if (now >= value.deleteAt && !canBeExpired) continue;
|
|
57469
57749
|
let matches = true;
|
|
57470
57750
|
if (value.vary) {
|
|
57471
57751
|
const vary = JSON.parse(value.vary);
|
|
@@ -57895,7 +58175,7 @@ var require_response = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
57895
58175
|
const nodeUtil$1 = require("node:util");
|
|
57896
58176
|
const { kEnumerableProperty } = util;
|
|
57897
58177
|
const { isValidReasonPhrase, isCancelled, isAborted, isErrorLike, environmentSettingsObject: relevantRealm } = require_util$7();
|
|
57898
|
-
const { redirectStatusSet, nullBodyStatus } = require_constants$
|
|
58178
|
+
const { redirectStatusSet, nullBodyStatus } = require_constants$5();
|
|
57899
58179
|
const { webidl } = require_webidl();
|
|
57900
58180
|
const { URLSerializer } = require_data_url();
|
|
57901
58181
|
const { kConstruct } = require_symbols();
|
|
@@ -58239,7 +58519,7 @@ var require_request$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
58239
58519
|
const util = require_util$8();
|
|
58240
58520
|
const nodeUtil = require("node:util");
|
|
58241
58521
|
const { isValidHTTPToken, sameOrigin, environmentSettingsObject } = require_util$7();
|
|
58242
|
-
const { forbiddenMethodsSet, corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, requestDuplex } = require_constants$
|
|
58522
|
+
const { forbiddenMethodsSet, corsSafeListedMethodsSet, referrerPolicy, requestRedirect, requestMode, requestCredentials, requestCache, requestDuplex } = require_constants$5();
|
|
58243
58523
|
const { kEnumerableProperty, normalizedMethodRecordsBase, normalizedMethodRecords } = util;
|
|
58244
58524
|
const { webidl } = require_webidl();
|
|
58245
58525
|
const { URLSerializer } = require_data_url();
|
|
@@ -58996,7 +59276,7 @@ var require_fetch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
58996
59276
|
const { makePolicyContainer, clonePolicyContainer, requestBadPort, TAOCheck, appendRequestOriginHeader, responseLocationURL, requestCurrentURL, setRequestReferrerPolicyOnRedirect, tryUpgradeRequestToAPotentiallyTrustworthyURL, createOpaqueTimingInfo, appendFetchMetadata, corsCheck, crossOriginResourcePolicyCheck, determineRequestsReferrer, coarsenedSharedCurrentTime, sameOrigin, isCancelled, isAborted, isErrorLike, fullyReadBody, readableStreamClose, urlIsLocal, urlIsHttpHttpsScheme, urlHasHttpsScheme, clampAndCoarsenConnectionTimingInfo, simpleRangeHeaderValue, buildContentRange, createInflate, extractMimeType, hasAuthenticationEntry, includesCredentials, isTraversableNavigable } = require_util$7();
|
|
58997
59277
|
const assert$11 = require("node:assert");
|
|
58998
59278
|
const { safelyExtractBody, extractBody } = require_body();
|
|
58999
|
-
const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet } = require_constants$
|
|
59279
|
+
const { redirectStatusSet, nullBodyStatus, safeMethodsSet, requestBodyHeader, subresourceSet } = require_constants$5();
|
|
59000
59280
|
const EE$1 = require("node:events");
|
|
59001
59281
|
const { Readable: Readable$1, pipeline: pipeline$2, finished, isErrored, isReadable } = require("node:stream");
|
|
59002
59282
|
const { addAbortListener, bufferToLowerCasedHeaderName } = require_util$8();
|
|
@@ -59295,7 +59575,7 @@ var require_fetch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
59295
59575
|
cacheState = "";
|
|
59296
59576
|
}
|
|
59297
59577
|
let responseStatus = 0;
|
|
59298
|
-
if (fetchParams.request.mode !== "
|
|
59578
|
+
if (fetchParams.request.mode !== "navigate" || !response.hasCrossOriginRedirects) {
|
|
59299
59579
|
responseStatus = response.status;
|
|
59300
59580
|
const mimeType = extractMimeType(response.headersList);
|
|
59301
59581
|
if (mimeType !== "failure") bodyInfo.contentType = minimizeSupportedMimeType(mimeType);
|
|
@@ -59399,7 +59679,7 @@ var require_fetch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
59399
59679
|
let contentLengthHeaderValue = null;
|
|
59400
59680
|
if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) contentLengthHeaderValue = "0";
|
|
59401
59681
|
if (contentLength != null) contentLengthHeaderValue = isomorphicEncode(`${contentLength}`);
|
|
59402
|
-
if (contentLengthHeaderValue != null) httpRequest.headersList.append("content-length", contentLengthHeaderValue, true);
|
|
59682
|
+
if (contentLengthHeaderValue != null && !httpRequest.headersList.contains("content-length", true)) httpRequest.headersList.append("content-length", contentLengthHeaderValue, true);
|
|
59403
59683
|
if (contentLength != null && httpRequest.keepalive) {}
|
|
59404
59684
|
if (webidl.is.URL(httpRequest.referrer)) httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href), true);
|
|
59405
59685
|
appendRequestOriginHeader(httpRequest);
|
|
@@ -60312,7 +60592,7 @@ var require_cachestorage = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60312
60592
|
}));
|
|
60313
60593
|
//#endregion
|
|
60314
60594
|
//#region ../../node_modules/undici/lib/web/cookies/constants.js
|
|
60315
|
-
var require_constants$
|
|
60595
|
+
var require_constants$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
60316
60596
|
module.exports = {
|
|
60317
60597
|
maxAttributeValueSize: 1024,
|
|
60318
60598
|
maxNameValuePairSize: 4096
|
|
@@ -60516,10 +60796,9 @@ var require_util$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60516
60796
|
//#region ../../node_modules/undici/lib/web/cookies/parse.js
|
|
60517
60797
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
60518
60798
|
const { collectASequenceOfCodePointsFast } = require_infra();
|
|
60519
|
-
const { maxNameValuePairSize, maxAttributeValueSize } = require_constants$
|
|
60799
|
+
const { maxNameValuePairSize, maxAttributeValueSize } = require_constants$4();
|
|
60520
60800
|
const { isCTLExcludingHtab } = require_util$5();
|
|
60521
60801
|
const assert$8 = require("node:assert");
|
|
60522
|
-
const { unescape: qsUnescape } = require("node:querystring");
|
|
60523
60802
|
/**
|
|
60524
60803
|
* @description Parses the field-value attributes of a set-cookie header string.
|
|
60525
60804
|
* @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4
|
|
@@ -60548,7 +60827,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60548
60827
|
if (name.length + value.length > maxNameValuePairSize) return null;
|
|
60549
60828
|
return {
|
|
60550
60829
|
name,
|
|
60551
|
-
value
|
|
60830
|
+
value,
|
|
60552
60831
|
...parseUnparsedAttributes(unparsedAttributes)
|
|
60553
60832
|
};
|
|
60554
60833
|
}
|
|
@@ -60600,12 +60879,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60600
60879
|
} else if (attributeNameLowercase === "secure") cookieAttributeList.secure = true;
|
|
60601
60880
|
else if (attributeNameLowercase === "httponly") cookieAttributeList.httpOnly = true;
|
|
60602
60881
|
else if (attributeNameLowercase === "samesite") {
|
|
60603
|
-
let enforcement = "Default";
|
|
60604
60882
|
const attributeValueLowercase = attributeValue.toLowerCase();
|
|
60605
|
-
if (attributeValueLowercase
|
|
60606
|
-
if (attributeValueLowercase
|
|
60607
|
-
if (attributeValueLowercase
|
|
60608
|
-
cookieAttributeList.sameSite = enforcement;
|
|
60883
|
+
if (attributeValueLowercase === "none") cookieAttributeList.sameSite = "None";
|
|
60884
|
+
else if (attributeValueLowercase === "strict") cookieAttributeList.sameSite = "Strict";
|
|
60885
|
+
else if (attributeValueLowercase === "lax") cookieAttributeList.sameSite = "Lax";
|
|
60609
60886
|
} else {
|
|
60610
60887
|
cookieAttributeList.unparsed ??= [];
|
|
60611
60888
|
cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`);
|
|
@@ -61043,7 +61320,7 @@ var require_events$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61043
61320
|
}));
|
|
61044
61321
|
//#endregion
|
|
61045
61322
|
//#region ../../node_modules/undici/lib/web/websocket/constants.js
|
|
61046
|
-
var require_constants$
|
|
61323
|
+
var require_constants$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
61047
61324
|
module.exports = {
|
|
61048
61325
|
uid: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
|
|
61049
61326
|
sentCloseFrameState: {
|
|
@@ -61088,7 +61365,7 @@ var require_constants$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61088
61365
|
//#endregion
|
|
61089
61366
|
//#region ../../node_modules/undici/lib/web/websocket/util.js
|
|
61090
61367
|
var require_util$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
61091
|
-
const { states, opcodes } = require_constants$
|
|
61368
|
+
const { states, opcodes } = require_constants$3();
|
|
61092
61369
|
const { isUtf8 } = require("node:buffer");
|
|
61093
61370
|
const { removeHTTPWhitespace } = require_data_url();
|
|
61094
61371
|
const { collectASequenceOfCodePointsFast } = require_infra();
|
|
@@ -61295,7 +61572,7 @@ var require_util$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61295
61572
|
//#region ../../node_modules/undici/lib/web/websocket/frame.js
|
|
61296
61573
|
var require_frame = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
61297
61574
|
const { runtimeFeatures } = require_runtime_features();
|
|
61298
|
-
const { maxUnsigned16Bit, opcodes } = require_constants$
|
|
61575
|
+
const { maxUnsigned16Bit, opcodes } = require_constants$3();
|
|
61299
61576
|
const BUFFER_SIZE = 8 * 1024;
|
|
61300
61577
|
let buffer = null;
|
|
61301
61578
|
let bufIdx = BUFFER_SIZE;
|
|
@@ -61393,7 +61670,7 @@ var require_frame = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61393
61670
|
//#endregion
|
|
61394
61671
|
//#region ../../node_modules/undici/lib/web/websocket/connection.js
|
|
61395
61672
|
var require_connection = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
61396
|
-
const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require_constants$
|
|
61673
|
+
const { uid, states, sentCloseFrameState, emptyBuffer, opcodes } = require_constants$3();
|
|
61397
61674
|
const { parseExtensions, isClosed, isClosing, isEstablished, isConnecting, validateCloseCodeAndReason } = require_util$4();
|
|
61398
61675
|
const { makeRequest } = require_request$1();
|
|
61399
61676
|
const { fetching } = require_fetch();
|
|
@@ -61554,27 +61831,26 @@ var require_permessage_deflate$1 = /* @__PURE__ */ __commonJSMin(((exports, modu
|
|
|
61554
61831
|
]);
|
|
61555
61832
|
const kBuffer = Symbol("kBuffer");
|
|
61556
61833
|
const kLength = Symbol("kLength");
|
|
61557
|
-
const kDefaultMaxDecompressedSize = 4 * 1024 * 1024;
|
|
61558
61834
|
var PerMessageDeflate = class {
|
|
61559
61835
|
/** @type {import('node:zlib').InflateRaw} */
|
|
61560
61836
|
#inflate;
|
|
61561
61837
|
#options = {};
|
|
61562
|
-
|
|
61563
|
-
#aborted = false;
|
|
61564
|
-
/** @type {Function|null} */
|
|
61565
|
-
#currentCallback = null;
|
|
61838
|
+
#maxPayloadSize = 0;
|
|
61566
61839
|
/**
|
|
61567
61840
|
* @param {Map<string, string>} extensions
|
|
61568
61841
|
*/
|
|
61569
|
-
constructor(extensions) {
|
|
61842
|
+
constructor(extensions, options) {
|
|
61570
61843
|
this.#options.serverNoContextTakeover = extensions.has("server_no_context_takeover");
|
|
61571
61844
|
this.#options.serverMaxWindowBits = extensions.get("server_max_window_bits");
|
|
61845
|
+
this.#maxPayloadSize = options.maxPayloadSize;
|
|
61572
61846
|
}
|
|
61847
|
+
/**
|
|
61848
|
+
* Decompress a compressed payload.
|
|
61849
|
+
* @param {Buffer} chunk Compressed data
|
|
61850
|
+
* @param {boolean} fin Final fragment flag
|
|
61851
|
+
* @param {Function} callback Callback function
|
|
61852
|
+
*/
|
|
61573
61853
|
decompress(chunk, fin, callback) {
|
|
61574
|
-
if (this.#aborted) {
|
|
61575
|
-
callback(new MessageSizeExceededError());
|
|
61576
|
-
return;
|
|
61577
|
-
}
|
|
61578
61854
|
if (!this.#inflate) {
|
|
61579
61855
|
let windowBits = Z_DEFAULT_WINDOWBITS$1;
|
|
61580
61856
|
if (this.#options.serverMaxWindowBits) {
|
|
@@ -61593,18 +61869,11 @@ var require_permessage_deflate$1 = /* @__PURE__ */ __commonJSMin(((exports, modu
|
|
|
61593
61869
|
this.#inflate[kBuffer] = [];
|
|
61594
61870
|
this.#inflate[kLength] = 0;
|
|
61595
61871
|
this.#inflate.on("data", (data) => {
|
|
61596
|
-
if (this.#aborted) return;
|
|
61597
61872
|
this.#inflate[kLength] += data.length;
|
|
61598
|
-
if (this.#inflate[kLength] >
|
|
61599
|
-
|
|
61873
|
+
if (this.#maxPayloadSize > 0 && this.#inflate[kLength] > this.#maxPayloadSize) {
|
|
61874
|
+
callback(new MessageSizeExceededError());
|
|
61600
61875
|
this.#inflate.removeAllListeners();
|
|
61601
|
-
this.#inflate.destroy();
|
|
61602
61876
|
this.#inflate = null;
|
|
61603
|
-
if (this.#currentCallback) {
|
|
61604
|
-
const cb = this.#currentCallback;
|
|
61605
|
-
this.#currentCallback = null;
|
|
61606
|
-
cb(new MessageSizeExceededError());
|
|
61607
|
-
}
|
|
61608
61877
|
return;
|
|
61609
61878
|
}
|
|
61610
61879
|
this.#inflate[kBuffer].push(data);
|
|
@@ -61614,15 +61883,13 @@ var require_permessage_deflate$1 = /* @__PURE__ */ __commonJSMin(((exports, modu
|
|
|
61614
61883
|
callback(err);
|
|
61615
61884
|
});
|
|
61616
61885
|
}
|
|
61617
|
-
this.#currentCallback = callback;
|
|
61618
61886
|
this.#inflate.write(chunk);
|
|
61619
61887
|
if (fin) this.#inflate.write(tail);
|
|
61620
61888
|
this.#inflate.flush(() => {
|
|
61621
|
-
if (
|
|
61889
|
+
if (!this.#inflate) return;
|
|
61622
61890
|
const full = Buffer.concat(this.#inflate[kBuffer], this.#inflate[kLength]);
|
|
61623
61891
|
this.#inflate[kBuffer].length = 0;
|
|
61624
61892
|
this.#inflate[kLength] = 0;
|
|
61625
|
-
this.#currentCallback = null;
|
|
61626
61893
|
callback(null, full);
|
|
61627
61894
|
});
|
|
61628
61895
|
}
|
|
@@ -61634,7 +61901,7 @@ var require_permessage_deflate$1 = /* @__PURE__ */ __commonJSMin(((exports, modu
|
|
|
61634
61901
|
var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
61635
61902
|
const { Writable: Writable$1 } = require("node:stream");
|
|
61636
61903
|
const assert$6 = require("node:assert");
|
|
61637
|
-
const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants$
|
|
61904
|
+
const { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants$3();
|
|
61638
61905
|
const { isValidStatusCode, isValidOpcode, websocketMessageReceived, utf8Decode, isControlFrame, isTextBinaryFrame, isContinuationFrame } = require_util$4();
|
|
61639
61906
|
const { failWebsocketConnection } = require_connection();
|
|
61640
61907
|
const { WebsocketFrameSend } = require_frame();
|
|
@@ -61652,15 +61919,22 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61652
61919
|
#extensions;
|
|
61653
61920
|
/** @type {import('./websocket').Handler} */
|
|
61654
61921
|
#handler;
|
|
61922
|
+
/** @type {number} */
|
|
61923
|
+
#maxFragments;
|
|
61924
|
+
/** @type {number} */
|
|
61925
|
+
#maxPayloadSize;
|
|
61655
61926
|
/**
|
|
61656
61927
|
* @param {import('./websocket').Handler} handler
|
|
61657
61928
|
* @param {Map<string, string>|null} extensions
|
|
61929
|
+
* @param {{ maxFragments?: number, maxPayloadSize?: number }} [options]
|
|
61658
61930
|
*/
|
|
61659
|
-
constructor(handler, extensions) {
|
|
61931
|
+
constructor(handler, extensions, options = {}) {
|
|
61660
61932
|
super();
|
|
61661
61933
|
this.#handler = handler;
|
|
61662
61934
|
this.#extensions = extensions == null ? /* @__PURE__ */ new Map() : extensions;
|
|
61663
|
-
|
|
61935
|
+
this.#maxFragments = options.maxFragments ?? 0;
|
|
61936
|
+
this.#maxPayloadSize = options.maxPayloadSize ?? 0;
|
|
61937
|
+
if (this.#extensions.has("permessage-deflate")) this.#extensions.set("permessage-deflate", new PerMessageDeflate(extensions, options));
|
|
61664
61938
|
}
|
|
61665
61939
|
/**
|
|
61666
61940
|
* @param {Buffer} chunk
|
|
@@ -61672,6 +61946,13 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61672
61946
|
this.#loop = true;
|
|
61673
61947
|
this.run(callback);
|
|
61674
61948
|
}
|
|
61949
|
+
#validatePayloadLength() {
|
|
61950
|
+
if (this.#maxPayloadSize > 0 && !isControlFrame(this.#info.opcode) && this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize) {
|
|
61951
|
+
failWebsocketConnection(this.#handler, 1009, "Payload size exceeds maximum allowed size");
|
|
61952
|
+
return false;
|
|
61953
|
+
}
|
|
61954
|
+
return true;
|
|
61955
|
+
}
|
|
61675
61956
|
/**
|
|
61676
61957
|
* Runs whenever a new chunk is received.
|
|
61677
61958
|
* Callback is called whenever there are no more chunks buffering,
|
|
@@ -61728,6 +62009,7 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61728
62009
|
if (payloadLength <= 125) {
|
|
61729
62010
|
this.#info.payloadLength = payloadLength;
|
|
61730
62011
|
this.#state = parserStates.READ_DATA;
|
|
62012
|
+
if (!this.#validatePayloadLength()) return;
|
|
61731
62013
|
} else if (payloadLength === 126) this.#state = parserStates.PAYLOADLENGTH_16;
|
|
61732
62014
|
else if (payloadLength === 127) this.#state = parserStates.PAYLOADLENGTH_64;
|
|
61733
62015
|
if (isTextBinaryFrame(opcode)) {
|
|
@@ -61743,6 +62025,7 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61743
62025
|
const buffer = this.consume(2);
|
|
61744
62026
|
this.#info.payloadLength = buffer.readUInt16BE(0);
|
|
61745
62027
|
this.#state = parserStates.READ_DATA;
|
|
62028
|
+
if (!this.#validatePayloadLength()) return;
|
|
61746
62029
|
} else if (this.#state === parserStates.PAYLOADLENGTH_64) {
|
|
61747
62030
|
if (this.#byteOffset < 8) return callback();
|
|
61748
62031
|
const buffer = this.consume(8);
|
|
@@ -61754,6 +62037,7 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61754
62037
|
}
|
|
61755
62038
|
this.#info.payloadLength = lower;
|
|
61756
62039
|
this.#state = parserStates.READ_DATA;
|
|
62040
|
+
if (!this.#validatePayloadLength()) return;
|
|
61757
62041
|
} else if (this.#state === parserStates.READ_DATA) {
|
|
61758
62042
|
if (this.#byteOffset < this.#info.payloadLength) return callback();
|
|
61759
62043
|
const body = this.consume(this.#info.payloadLength);
|
|
@@ -61761,7 +62045,7 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61761
62045
|
this.#loop = this.parseControlFrame(body);
|
|
61762
62046
|
this.#state = parserStates.INFO;
|
|
61763
62047
|
} else if (!this.#info.compressed) {
|
|
61764
|
-
this.writeFragments(body);
|
|
62048
|
+
if (!this.writeFragments(body)) return;
|
|
61765
62049
|
if (!this.#info.fragmented && this.#info.fin) websocketMessageReceived(this.#handler, this.#info.binaryType, this.consumeFragments());
|
|
61766
62050
|
this.#state = parserStates.INFO;
|
|
61767
62051
|
} else {
|
|
@@ -61771,7 +62055,11 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61771
62055
|
failWebsocketConnection(this.#handler, code, error.message);
|
|
61772
62056
|
return;
|
|
61773
62057
|
}
|
|
61774
|
-
this.writeFragments(data);
|
|
62058
|
+
if (!this.writeFragments(data)) return;
|
|
62059
|
+
if (this.#maxPayloadSize > 0 && this.#fragmentsBytes > this.#maxPayloadSize) {
|
|
62060
|
+
failWebsocketConnection(this.#handler, 1009, new MessageSizeExceededError().message);
|
|
62061
|
+
return;
|
|
62062
|
+
}
|
|
61775
62063
|
if (!this.#info.fin) {
|
|
61776
62064
|
this.#state = parserStates.INFO;
|
|
61777
62065
|
this.#loop = true;
|
|
@@ -61782,7 +62070,7 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61782
62070
|
this.#loop = true;
|
|
61783
62071
|
this.#state = parserStates.INFO;
|
|
61784
62072
|
this.run(callback);
|
|
61785
|
-
});
|
|
62073
|
+
}, this.#fragmentsBytes);
|
|
61786
62074
|
this.#loop = false;
|
|
61787
62075
|
break;
|
|
61788
62076
|
}
|
|
@@ -61824,8 +62112,13 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61824
62112
|
}
|
|
61825
62113
|
}
|
|
61826
62114
|
writeFragments(fragment) {
|
|
62115
|
+
if (this.#maxFragments > 0 && this.#fragments.length === this.#maxFragments) {
|
|
62116
|
+
failWebsocketConnection(this.#handler, 1008, "Too many message fragments");
|
|
62117
|
+
return false;
|
|
62118
|
+
}
|
|
61827
62119
|
this.#fragmentsBytes += fragment.length;
|
|
61828
62120
|
this.#fragments.push(fragment);
|
|
62121
|
+
return true;
|
|
61829
62122
|
}
|
|
61830
62123
|
consumeFragments() {
|
|
61831
62124
|
const fragments = this.#fragments;
|
|
@@ -61921,7 +62214,7 @@ var require_receiver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61921
62214
|
//#region ../../node_modules/undici/lib/web/websocket/sender.js
|
|
61922
62215
|
var require_sender$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
61923
62216
|
const { WebsocketFrameSend } = require_frame();
|
|
61924
|
-
const { opcodes, sendHints } = require_constants$
|
|
62217
|
+
const { opcodes, sendHints } = require_constants$3();
|
|
61925
62218
|
const FixedQueue = require_fixed_queue();
|
|
61926
62219
|
/**
|
|
61927
62220
|
* @typedef {object} SendQueueNode
|
|
@@ -62007,7 +62300,7 @@ var require_websocket$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
62007
62300
|
const { webidl } = require_webidl();
|
|
62008
62301
|
const { URLSerializer } = require_data_url();
|
|
62009
62302
|
const { environmentSettingsObject } = require_util$7();
|
|
62010
|
-
const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints, opcodes } = require_constants$
|
|
62303
|
+
const { staticPropertyDescriptors, states, sentCloseFrameState, sendHints, opcodes } = require_constants$3();
|
|
62011
62304
|
const { isConnecting, isEstablished, isClosing, isClosed, isValidSubprotocol, fireEvent, utf8Decode, toArrayBuffer, getURLRecord } = require_util$4();
|
|
62012
62305
|
const { establishWebSocketConnection, closeWebSocketConnection, failWebsocketConnection } = require_connection();
|
|
62013
62306
|
const { ByteParser } = require_receiver$1();
|
|
@@ -62246,7 +62539,13 @@ var require_websocket$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
62246
62539
|
*/
|
|
62247
62540
|
#onConnectionEstablished(response, parsedExtensions) {
|
|
62248
62541
|
this.#handler.socket = response.socket;
|
|
62249
|
-
const
|
|
62542
|
+
const webSocketOptions = this.#handler.controller.dispatcher?.webSocketOptions;
|
|
62543
|
+
const maxFragments = webSocketOptions?.maxFragments;
|
|
62544
|
+
const maxPayloadSize = webSocketOptions?.maxPayloadSize;
|
|
62545
|
+
const parser = new ByteParser(this.#handler, parsedExtensions, {
|
|
62546
|
+
maxFragments,
|
|
62547
|
+
maxPayloadSize
|
|
62548
|
+
});
|
|
62250
62549
|
parser.on("drain", () => this.#handler.onParserDrain());
|
|
62251
62550
|
parser.on("error", (err) => this.#handler.onParserError(err));
|
|
62252
62551
|
this.#parser = parser;
|
|
@@ -62484,7 +62783,7 @@ var require_websocketerror = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
62484
62783
|
var require_websocketstream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
62485
62784
|
const { createDeferredPromise } = require_promise();
|
|
62486
62785
|
const { environmentSettingsObject } = require_util$7();
|
|
62487
|
-
const { states, opcodes, sentCloseFrameState } = require_constants$
|
|
62786
|
+
const { states, opcodes, sentCloseFrameState } = require_constants$3();
|
|
62488
62787
|
const { webidl } = require_webidl();
|
|
62489
62788
|
const { getURLRecord, isValidSubprotocol, isEstablished, utf8Decode } = require_util$4();
|
|
62490
62789
|
const { establishWebSocketConnection, failWebsocketConnection, closeWebSocketConnection } = require_connection();
|
|
@@ -62615,7 +62914,12 @@ var require_websocketstream = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
62615
62914
|
/** @type {import('../websocket').Handler['onConnectionEstablished']} */
|
|
62616
62915
|
#onConnectionEstablished(response, parsedExtensions) {
|
|
62617
62916
|
this.#handler.socket = response.socket;
|
|
62618
|
-
const
|
|
62917
|
+
const maxFragments = this.#handler.controller.dispatcher?.webSocketOptions?.maxFragments;
|
|
62918
|
+
const maxPayloadSize = this.#handler.controller.dispatcher?.webSocketOptions?.maxPayloadSize;
|
|
62919
|
+
const parser = new ByteParser(this.#handler, parsedExtensions, {
|
|
62920
|
+
maxFragments,
|
|
62921
|
+
maxPayloadSize
|
|
62922
|
+
});
|
|
62619
62923
|
parser.on("drain", () => this.#handler.onParserDrain());
|
|
62620
62924
|
parser.on("error", (err) => this.#handler.onParserError(err));
|
|
62621
62925
|
this.#parser = parser;
|
|
@@ -62626,10 +62930,6 @@ var require_websocketstream = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
62626
62930
|
start: (controller) => {
|
|
62627
62931
|
this.#readableStreamController = controller;
|
|
62628
62932
|
},
|
|
62629
|
-
pull(controller) {
|
|
62630
|
-
let chunk;
|
|
62631
|
-
while (controller.desiredSize > 0 && (chunk = response.socket.read()) !== null) controller.enqueue(chunk);
|
|
62632
|
-
},
|
|
62633
62933
|
cancel: (reason) => this.#cancel(reason)
|
|
62634
62934
|
});
|
|
62635
62935
|
const writable = new WritableStream({
|
|
@@ -62653,7 +62953,7 @@ var require_websocketstream = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
62653
62953
|
if (type === opcodes.TEXT) try {
|
|
62654
62954
|
chunk = utf8Decode(data);
|
|
62655
62955
|
} catch {
|
|
62656
|
-
failWebsocketConnection(this.#handler, "Received invalid UTF-8 in text frame.");
|
|
62956
|
+
failWebsocketConnection(this.#handler, 1007, "Received invalid UTF-8 in text frame.");
|
|
62657
62957
|
return;
|
|
62658
62958
|
}
|
|
62659
62959
|
else if (type === opcodes.BINARY) chunk = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
@@ -71191,74 +71491,11 @@ var AppUploadReporter = class {
|
|
|
71191
71491
|
}
|
|
71192
71492
|
};
|
|
71193
71493
|
//#endregion
|
|
71194
|
-
//#region ../base/dist/helpers/env.js
|
|
71195
|
-
var require_env = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
71196
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71197
|
-
exports.toStringMap = exports.toNumber = exports.toBoolean = void 0;
|
|
71198
|
-
const toBoolean = (env) => {
|
|
71199
|
-
if (env === void 0) return;
|
|
71200
|
-
if (env.toLowerCase() === "true" || env === "1") return true;
|
|
71201
|
-
if (env.toLowerCase() === "false" || env === "0") return false;
|
|
71202
|
-
};
|
|
71203
|
-
exports.toBoolean = toBoolean;
|
|
71204
|
-
const toNumber = (env) => {
|
|
71205
|
-
if (env === void 0 || env.trim() === "") return;
|
|
71206
|
-
const number = Number(env);
|
|
71207
|
-
if (isNaN(number)) return;
|
|
71208
|
-
return number;
|
|
71209
|
-
};
|
|
71210
|
-
exports.toNumber = toNumber;
|
|
71211
|
-
const toStringMap = (env) => {
|
|
71212
|
-
if (env === void 0) return;
|
|
71213
|
-
const cleanedEnv = env.replace(/'/g, "\"");
|
|
71214
|
-
try {
|
|
71215
|
-
const parsed = JSON.parse(cleanedEnv);
|
|
71216
|
-
if (typeof parsed === "object" && parsed !== null) {
|
|
71217
|
-
for (const key in parsed) if (typeof parsed[key] !== "string") return;
|
|
71218
|
-
return parsed;
|
|
71219
|
-
}
|
|
71220
|
-
} catch (error) {
|
|
71221
|
-
return;
|
|
71222
|
-
}
|
|
71223
|
-
};
|
|
71224
|
-
exports.toStringMap = toStringMap;
|
|
71225
|
-
}));
|
|
71226
|
-
//#endregion
|
|
71227
|
-
//#region ../base/dist/constants.js
|
|
71228
|
-
var require_constants$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
71229
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71230
|
-
exports.METHOD_POST = exports.CONTENT_TYPE_VALUE_JSON = exports.CONTENT_TYPE_VALUE_PROTOBUF = exports.CONTENT_TYPE_HEADER = exports.FIPS_IGNORE_ERROR_ENV_VAR = exports.FIPS_ENV_VAR = exports.DATADOG_SITES = exports.DATADOG_SITE_US2_GOV = exports.DATADOG_SITE_GOV = exports.DATADOG_SITE_AP2 = exports.DATADOG_SITE_AP1 = exports.DATADOG_SITE_US5 = exports.DATADOG_SITE_US3 = exports.DATADOG_SITE_EU1 = exports.DATADOG_SITE_US1 = void 0;
|
|
71231
|
-
exports.DATADOG_SITE_US1 = "datadoghq.com";
|
|
71232
|
-
exports.DATADOG_SITE_EU1 = "datadoghq.eu";
|
|
71233
|
-
exports.DATADOG_SITE_US3 = "us3.datadoghq.com";
|
|
71234
|
-
exports.DATADOG_SITE_US5 = "us5.datadoghq.com";
|
|
71235
|
-
exports.DATADOG_SITE_AP1 = "ap1.datadoghq.com";
|
|
71236
|
-
exports.DATADOG_SITE_AP2 = "ap2.datadoghq.com";
|
|
71237
|
-
exports.DATADOG_SITE_GOV = "ddog-gov.com";
|
|
71238
|
-
exports.DATADOG_SITE_US2_GOV = "us2.ddog-gov.com";
|
|
71239
|
-
exports.DATADOG_SITES = [
|
|
71240
|
-
exports.DATADOG_SITE_US1,
|
|
71241
|
-
exports.DATADOG_SITE_EU1,
|
|
71242
|
-
exports.DATADOG_SITE_US3,
|
|
71243
|
-
exports.DATADOG_SITE_US5,
|
|
71244
|
-
exports.DATADOG_SITE_AP1,
|
|
71245
|
-
exports.DATADOG_SITE_AP2,
|
|
71246
|
-
exports.DATADOG_SITE_GOV,
|
|
71247
|
-
exports.DATADOG_SITE_US2_GOV
|
|
71248
|
-
];
|
|
71249
|
-
exports.FIPS_ENV_VAR = "DATADOG_FIPS";
|
|
71250
|
-
exports.FIPS_IGNORE_ERROR_ENV_VAR = "DATADOG_FIPS_IGNORE_ERROR";
|
|
71251
|
-
exports.CONTENT_TYPE_HEADER = "Content-Type";
|
|
71252
|
-
exports.CONTENT_TYPE_VALUE_PROTOBUF = "application/x-protobuf";
|
|
71253
|
-
exports.CONTENT_TYPE_VALUE_JSON = "application/json";
|
|
71254
|
-
exports.METHOD_POST = "post";
|
|
71255
|
-
}));
|
|
71256
|
-
//#endregion
|
|
71257
71494
|
//#region ../base/dist/helpers/api.js
|
|
71258
71495
|
var require_api = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
71259
71496
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71260
71497
|
exports.getBaseIntakeUrl = exports.getApiUrl = exports.getIntakeUrl = exports.getDatadogSite = exports.getDatadogSiteFromEnv = void 0;
|
|
71261
|
-
const constants_1 = require_constants$
|
|
71498
|
+
const constants_1 = require_constants$12();
|
|
71262
71499
|
/**
|
|
71263
71500
|
* Read the Datadog site from `DATADOG_SITE` / `DD_SITE` env vars.
|
|
71264
71501
|
* Returns `undefined` when neither is set.
|
|
@@ -133902,13 +134139,19 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
133902
134139
|
* @param {Boolean} [isServer=false] Specifies whether to operate in client or
|
|
133903
134140
|
* server mode
|
|
133904
134141
|
* @param {Number} [maxPayload=0] The maximum allowed message length
|
|
134142
|
+
* @param {Number} [maxBufferedChunks=0] The maximum number of
|
|
134143
|
+
* buffered data chunks
|
|
134144
|
+
* @param {Number} [maxFragments=0] The maximum number of message
|
|
134145
|
+
* fragments
|
|
133905
134146
|
*/
|
|
133906
|
-
constructor(binaryType, extensions, isServer, maxPayload) {
|
|
134147
|
+
constructor(binaryType, extensions, isServer, maxPayload, maxBufferedChunks, maxFragments) {
|
|
133907
134148
|
super();
|
|
133908
134149
|
this._binaryType = binaryType || BINARY_TYPES[0];
|
|
133909
134150
|
this[kWebSocket] = void 0;
|
|
133910
134151
|
this._extensions = extensions || {};
|
|
133911
134152
|
this._isServer = !!isServer;
|
|
134153
|
+
this._maxBufferedChunks = maxBufferedChunks | 0;
|
|
134154
|
+
this._maxFragments = maxFragments | 0;
|
|
133912
134155
|
this._maxPayload = maxPayload | 0;
|
|
133913
134156
|
this._bufferedBytes = 0;
|
|
133914
134157
|
this._buffers = [];
|
|
@@ -133935,6 +134178,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
133935
134178
|
*/
|
|
133936
134179
|
_write(chunk, encoding, cb) {
|
|
133937
134180
|
if (this._opcode === 8 && this._state == GET_INFO) return cb();
|
|
134181
|
+
if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) return cb(error(RangeError, "Too many buffered chunks", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
|
|
133938
134182
|
this._bufferedBytes += chunk.length;
|
|
133939
134183
|
this._buffers.push(chunk);
|
|
133940
134184
|
this.startLoop(cb);
|
|
@@ -134160,6 +134404,10 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134160
134404
|
return;
|
|
134161
134405
|
}
|
|
134162
134406
|
if (data.length) {
|
|
134407
|
+
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) {
|
|
134408
|
+
this._loop = false;
|
|
134409
|
+
return error(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS");
|
|
134410
|
+
}
|
|
134163
134411
|
this._messageLength = this._totalPayloadLength;
|
|
134164
134412
|
this._fragments.push(data);
|
|
134165
134413
|
}
|
|
@@ -134178,6 +134426,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
134178
134426
|
if (buf.length) {
|
|
134179
134427
|
this._messageLength += buf.length;
|
|
134180
134428
|
if (this._messageLength > this._maxPayload && this._maxPayload > 0) return cb(error(RangeError, "Max payload size exceeded", false, 1009, "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));
|
|
134429
|
+
if (this._maxFragments > 0 && this._fragments.length >= this._maxFragments) return cb(error(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
|
|
134181
134430
|
this._fragments.push(buf);
|
|
134182
134431
|
}
|
|
134183
134432
|
const er = this.dataMessage();
|
|
@@ -135158,10 +135407,14 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
135158
135407
|
* server and client
|
|
135159
135408
|
* @param {Buffer} head The first packet of the upgraded stream
|
|
135160
135409
|
* @param {Number} [maxPayload=0] The maximum allowed message size
|
|
135410
|
+
* @param {Number} [maxBufferedChunks=0] The maximum number of
|
|
135411
|
+
* buffered data chunks
|
|
135412
|
+
* @param {Number} [maxFragments=0] The maximum number of message
|
|
135413
|
+
* fragments
|
|
135161
135414
|
* @private
|
|
135162
135415
|
*/
|
|
135163
|
-
setSocket(socket, head, maxPayload) {
|
|
135164
|
-
const receiver = new Receiver(this.binaryType, this._extensions, this._isServer, maxPayload);
|
|
135416
|
+
setSocket(socket, head, maxPayload, maxBufferedChunks, maxFragments) {
|
|
135417
|
+
const receiver = new Receiver(this.binaryType, this._extensions, this._isServer, maxPayload, maxBufferedChunks, maxFragments);
|
|
135165
135418
|
this._sender = new Sender(socket, this._extensions);
|
|
135166
135419
|
this._receiver = receiver;
|
|
135167
135420
|
this._socket = socket;
|
|
@@ -135444,6 +135697,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
135444
135697
|
* `Sec-WebSocket-Version` header
|
|
135445
135698
|
* @param {String} [options.origin] Value of the `Origin` or
|
|
135446
135699
|
* `Sec-WebSocket-Origin` header
|
|
135700
|
+
* @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
|
|
135701
|
+
* buffered data chunks
|
|
135702
|
+
* @param {Number} [options.maxFragments=131072] The maximum number of message
|
|
135703
|
+
* fragments
|
|
135447
135704
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
135448
135705
|
* size
|
|
135449
135706
|
* @param {Boolean} [options.followRedirects=false] Whether or not to follow
|
|
@@ -135455,6 +135712,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
135455
135712
|
function initAsClient(websocket, address, protocols, options) {
|
|
135456
135713
|
const opts = {
|
|
135457
135714
|
protocolVersion: protocolVersions[1],
|
|
135715
|
+
maxBufferedChunks: 1024 * 1024,
|
|
135716
|
+
maxFragments: 128 * 1024,
|
|
135458
135717
|
maxPayload: 100 * 1024 * 1024,
|
|
135459
135718
|
perMessageDeflate: true,
|
|
135460
135719
|
followRedirects: false,
|
|
@@ -135622,7 +135881,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
135622
135881
|
websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
|
|
135623
135882
|
}
|
|
135624
135883
|
}
|
|
135625
|
-
websocket.setSocket(socket, head, opts.maxPayload);
|
|
135884
|
+
websocket.setSocket(socket, head, opts.maxPayload, opts.maxBufferedChunks, opts.maxFragments);
|
|
135626
135885
|
});
|
|
135627
135886
|
}
|
|
135628
135887
|
/**
|
|
@@ -136010,6 +136269,10 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
136010
136269
|
* track clients
|
|
136011
136270
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
136012
136271
|
* @param {String} [options.host] The hostname where to bind the server
|
|
136272
|
+
* @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
|
|
136273
|
+
* buffered data chunks
|
|
136274
|
+
* @param {Number} [options.maxFragments=131072] The maximum number of message
|
|
136275
|
+
* fragments
|
|
136013
136276
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
136014
136277
|
* size
|
|
136015
136278
|
* @param {Boolean} [options.noServer=false] Enable no server mode
|
|
@@ -136025,6 +136288,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
136025
136288
|
constructor(options, callback) {
|
|
136026
136289
|
super();
|
|
136027
136290
|
options = {
|
|
136291
|
+
maxBufferedChunks: 1024 * 1024,
|
|
136292
|
+
maxFragments: 128 * 1024,
|
|
136028
136293
|
maxPayload: 100 * 1024 * 1024,
|
|
136029
136294
|
perMessageDeflate: false,
|
|
136030
136295
|
handleProtocols: null,
|
|
@@ -136208,7 +136473,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
136208
136473
|
this.emit("headers", headers, req);
|
|
136209
136474
|
socket.write(headers.concat("\r\n").join("\r\n"));
|
|
136210
136475
|
socket.removeListener("error", socketOnError);
|
|
136211
|
-
ws.setSocket(socket, head, this.options.maxPayload);
|
|
136476
|
+
ws.setSocket(socket, head, this.options.maxPayload, this.options.maxBufferedChunks, this.options.maxFragments);
|
|
136212
136477
|
if (this.clients) {
|
|
136213
136478
|
this.clients.add(ws);
|
|
136214
136479
|
ws.on("close", () => this.clients.delete(ws));
|
|
@@ -138815,15 +139080,135 @@ var require_terminal_link = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
138815
139080
|
exports.makeTerminalLink = makeTerminalLink;
|
|
138816
139081
|
}));
|
|
138817
139082
|
//#endregion
|
|
139083
|
+
//#region ../base/dist/helpers/logger.js
|
|
139084
|
+
var require_logger = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
139085
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
139086
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
139087
|
+
};
|
|
139088
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
139089
|
+
exports.Logger = exports.LogLevel = void 0;
|
|
139090
|
+
const chalk_1 = __importDefault(require_source$3());
|
|
139091
|
+
var LogLevel;
|
|
139092
|
+
(function(LogLevel) {
|
|
139093
|
+
LogLevel[LogLevel["DEBUG"] = 1] = "DEBUG";
|
|
139094
|
+
LogLevel[LogLevel["INFO"] = 2] = "INFO";
|
|
139095
|
+
LogLevel[LogLevel["WARN"] = 3] = "WARN";
|
|
139096
|
+
LogLevel[LogLevel["ERROR"] = 4] = "ERROR";
|
|
139097
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
139098
|
+
const LEVEL_NAMES = {
|
|
139099
|
+
[LogLevel.DEBUG]: "debug",
|
|
139100
|
+
[LogLevel.INFO]: "info",
|
|
139101
|
+
[LogLevel.WARN]: "warn",
|
|
139102
|
+
[LogLevel.ERROR]: "error"
|
|
139103
|
+
};
|
|
139104
|
+
var Logger = class {
|
|
139105
|
+
constructor(writeMessage, loglevel, shouldIncludeTimestampOrOptions) {
|
|
139106
|
+
var _a, _b;
|
|
139107
|
+
const options = typeof shouldIncludeTimestampOrOptions === "boolean" ? { shouldIncludeTimestamp: shouldIncludeTimestampOrOptions } : shouldIncludeTimestampOrOptions !== null && shouldIncludeTimestampOrOptions !== void 0 ? shouldIncludeTimestampOrOptions : {};
|
|
139108
|
+
this.rawWriteMessage = writeMessage;
|
|
139109
|
+
this.shouldIncludeTimestamp = (_a = options.shouldIncludeTimestamp) !== null && _a !== void 0 ? _a : false;
|
|
139110
|
+
this.jsonOutput = (_b = options.jsonOutput) !== null && _b !== void 0 ? _b : false;
|
|
139111
|
+
this.loglevel = loglevel;
|
|
139112
|
+
}
|
|
139113
|
+
setLogLevel(newLogLevel) {
|
|
139114
|
+
this.loglevel = newLogLevel;
|
|
139115
|
+
}
|
|
139116
|
+
setShouldIncludeTime(newShouldIncludeTimestamp) {
|
|
139117
|
+
this.shouldIncludeTimestamp = newShouldIncludeTimestamp;
|
|
139118
|
+
}
|
|
139119
|
+
setJsonOutput(newJsonOutput) {
|
|
139120
|
+
this.jsonOutput = newJsonOutput;
|
|
139121
|
+
}
|
|
139122
|
+
isJsonOutput() {
|
|
139123
|
+
return this.jsonOutput;
|
|
139124
|
+
}
|
|
139125
|
+
error(s) {
|
|
139126
|
+
if (this.loglevel <= LogLevel.ERROR) this.emit(LogLevel.ERROR, s, chalk_1.default.red);
|
|
139127
|
+
}
|
|
139128
|
+
warn(s) {
|
|
139129
|
+
if (this.loglevel <= LogLevel.WARN) this.emit(LogLevel.WARN, s, chalk_1.default.yellow);
|
|
139130
|
+
}
|
|
139131
|
+
info(s) {
|
|
139132
|
+
if (this.loglevel <= LogLevel.INFO) this.emit(LogLevel.INFO, s);
|
|
139133
|
+
}
|
|
139134
|
+
debug(s) {
|
|
139135
|
+
if (this.loglevel <= LogLevel.DEBUG) this.emit(LogLevel.DEBUG, s);
|
|
139136
|
+
}
|
|
139137
|
+
emit(level, message, colorize) {
|
|
139138
|
+
if (this.jsonOutput) {
|
|
139139
|
+
const payload = {
|
|
139140
|
+
level: LEVEL_NAMES[level],
|
|
139141
|
+
message
|
|
139142
|
+
};
|
|
139143
|
+
if (this.shouldIncludeTimestamp) payload.timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
139144
|
+
this.rawWriteMessage(JSON.stringify(payload) + "\n");
|
|
139145
|
+
return;
|
|
139146
|
+
}
|
|
139147
|
+
const prefix = this.shouldIncludeTimestamp ? `${(/* @__PURE__ */ new Date()).toISOString()}: ` : "";
|
|
139148
|
+
const body = colorize ? colorize(message) : message;
|
|
139149
|
+
this.rawWriteMessage(prefix + body + "\n");
|
|
139150
|
+
}
|
|
139151
|
+
};
|
|
139152
|
+
exports.Logger = Logger;
|
|
139153
|
+
}));
|
|
139154
|
+
//#endregion
|
|
138818
139155
|
//#region ../base/dist/index.js
|
|
138819
139156
|
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
139157
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
139158
|
+
if (k2 === void 0) k2 = k;
|
|
139159
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
139160
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
139161
|
+
enumerable: true,
|
|
139162
|
+
get: function() {
|
|
139163
|
+
return m[k];
|
|
139164
|
+
}
|
|
139165
|
+
};
|
|
139166
|
+
Object.defineProperty(o, k2, desc);
|
|
139167
|
+
}) : (function(o, m, k, k2) {
|
|
139168
|
+
if (k2 === void 0) k2 = k;
|
|
139169
|
+
o[k2] = m[k];
|
|
139170
|
+
}));
|
|
139171
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
139172
|
+
Object.defineProperty(o, "default", {
|
|
139173
|
+
enumerable: true,
|
|
139174
|
+
value: v
|
|
139175
|
+
});
|
|
139176
|
+
}) : function(o, v) {
|
|
139177
|
+
o["default"] = v;
|
|
139178
|
+
});
|
|
139179
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
|
139180
|
+
if (mod && mod.__esModule) return mod;
|
|
139181
|
+
var result = {};
|
|
139182
|
+
if (mod != null) {
|
|
139183
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
139184
|
+
}
|
|
139185
|
+
__setModuleDefault(result, mod);
|
|
139186
|
+
return result;
|
|
139187
|
+
};
|
|
138820
139188
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
138821
139189
|
exports.BaseCommand = void 0;
|
|
138822
139190
|
const clipanion_1 = require_advanced();
|
|
139191
|
+
const t = __importStar(require_lib$8());
|
|
139192
|
+
const constants_1 = require_constants$12();
|
|
139193
|
+
const logger_1 = require_logger();
|
|
138823
139194
|
/**
|
|
138824
139195
|
* This command should be extended by **every** command in the monorepo.
|
|
138825
139196
|
*/
|
|
138826
|
-
var BaseCommand = class extends clipanion_1.Command {
|
|
139197
|
+
var BaseCommand = class extends clipanion_1.Command {
|
|
139198
|
+
constructor() {
|
|
139199
|
+
super(...arguments);
|
|
139200
|
+
this.logFormat = clipanion_1.Option.String("--log-format", "text", {
|
|
139201
|
+
env: constants_1.LOG_FORMAT_ENV_VAR,
|
|
139202
|
+
hidden: true,
|
|
139203
|
+
description: "Output format for logs: 'text' (default) or 'json' (one JSON object per line).",
|
|
139204
|
+
validator: t.isEnum(["text", "json"])
|
|
139205
|
+
});
|
|
139206
|
+
}
|
|
139207
|
+
get logger() {
|
|
139208
|
+
if (!this._logger) this._logger = new logger_1.Logger((s) => this.context.stdout.write(s), logger_1.LogLevel.INFO, { jsonOutput: this.logFormat === "json" });
|
|
139209
|
+
return this._logger;
|
|
139210
|
+
}
|
|
139211
|
+
};
|
|
138827
139212
|
exports.BaseCommand = BaseCommand;
|
|
138828
139213
|
}));
|
|
138829
139214
|
//#endregion
|
|
@@ -138918,7 +139303,7 @@ var require_fips = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
138918
139303
|
}));
|
|
138919
139304
|
//#endregion
|
|
138920
139305
|
//#region ../../node_modules/get-value/dist/index.mjs
|
|
138921
|
-
var import_constants = require_constants$
|
|
139306
|
+
var import_constants = require_constants$12();
|
|
138922
139307
|
var import_api = require_api();
|
|
138923
139308
|
var import_deploy_tests = require_deploy_tests();
|
|
138924
139309
|
var import_fips = require_fips();
|
|
@@ -139472,7 +139857,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
139472
139857
|
exports.isInteger = exports.checkAPIKeyOverride = exports.isValidDatadogSite = exports.checkFile = void 0;
|
|
139473
139858
|
const fs_1 = __importDefault(require("fs"));
|
|
139474
139859
|
const t = __importStar(require_lib$8());
|
|
139475
|
-
const constants_1 = require_constants$
|
|
139860
|
+
const constants_1 = require_constants$12();
|
|
139476
139861
|
const checkFile = (path) => {
|
|
139477
139862
|
try {
|
|
139478
139863
|
if (fs_1.default.statSync(path).size === 0) return {
|
|
@@ -140036,8 +140421,8 @@ var PluginCommand$1 = class extends import_run_tests.SyntheticsRunTestsCommand {
|
|
|
140036
140421
|
}
|
|
140037
140422
|
};
|
|
140038
140423
|
//#endregion
|
|
140039
|
-
//#region
|
|
140040
|
-
var
|
|
140424
|
+
//#region src/commands/upload-application.ts
|
|
140425
|
+
var import_upload_application = (/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
140041
140426
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
140042
140427
|
function adopt(value) {
|
|
140043
140428
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -140106,56 +140491,7 @@ var require_upload_application = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
140106
140491
|
`,
|
|
140107
140492
|
examples: [["Upload version `example 1.0` and mark it as latest", "datadog-ci synthetics upload-application --mobileApplicationId '123-123-123' --mobileApplicationVersionFilePath example/test.apk --versionName 'example 1.0' --latest"]]
|
|
140108
140493
|
});
|
|
140109
|
-
}));
|
|
140110
|
-
//#endregion
|
|
140111
|
-
//#region ../base/dist/helpers/logger.js
|
|
140112
|
-
var require_logger = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
140113
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
140114
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
140115
|
-
};
|
|
140116
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
140117
|
-
exports.Logger = exports.LogLevel = void 0;
|
|
140118
|
-
const chalk_1 = __importDefault(require_source$3());
|
|
140119
|
-
var LogLevel;
|
|
140120
|
-
(function(LogLevel) {
|
|
140121
|
-
LogLevel[LogLevel["DEBUG"] = 1] = "DEBUG";
|
|
140122
|
-
LogLevel[LogLevel["INFO"] = 2] = "INFO";
|
|
140123
|
-
LogLevel[LogLevel["WARN"] = 3] = "WARN";
|
|
140124
|
-
LogLevel[LogLevel["ERROR"] = 4] = "ERROR";
|
|
140125
|
-
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
140126
|
-
var Logger = class {
|
|
140127
|
-
constructor(writeMessage, loglevel, shouldIncludeTimestamp) {
|
|
140128
|
-
this.shouldIncludeTimestamp = shouldIncludeTimestamp !== null && shouldIncludeTimestamp !== void 0 ? shouldIncludeTimestamp : false;
|
|
140129
|
-
this.writeMessage = (s) => {
|
|
140130
|
-
return writeMessage(this.shouldIncludeTimestamp ? `${(/* @__PURE__ */ new Date()).toISOString()}: ${s}` : s);
|
|
140131
|
-
};
|
|
140132
|
-
this.loglevel = loglevel;
|
|
140133
|
-
}
|
|
140134
|
-
setLogLevel(newLogLevel) {
|
|
140135
|
-
this.loglevel = newLogLevel;
|
|
140136
|
-
}
|
|
140137
|
-
setShouldIncludeTime(newShouldIncludeTimestamp) {
|
|
140138
|
-
this.shouldIncludeTimestamp = newShouldIncludeTimestamp;
|
|
140139
|
-
}
|
|
140140
|
-
error(s) {
|
|
140141
|
-
if (this.loglevel <= LogLevel.ERROR) this.writeMessage(chalk_1.default.red(s) + "\n");
|
|
140142
|
-
}
|
|
140143
|
-
warn(s) {
|
|
140144
|
-
if (this.loglevel <= LogLevel.WARN) this.writeMessage(chalk_1.default.yellow(s) + "\n");
|
|
140145
|
-
}
|
|
140146
|
-
info(s) {
|
|
140147
|
-
if (this.loglevel <= LogLevel.INFO) this.writeMessage(s + "\n");
|
|
140148
|
-
}
|
|
140149
|
-
debug(s) {
|
|
140150
|
-
if (this.loglevel <= LogLevel.DEBUG) this.writeMessage(s + "\n");
|
|
140151
|
-
}
|
|
140152
|
-
};
|
|
140153
|
-
exports.Logger = Logger;
|
|
140154
|
-
}));
|
|
140155
|
-
//#endregion
|
|
140156
|
-
//#region src/commands/upload-application.ts
|
|
140157
|
-
var import_upload_application = require_upload_application();
|
|
140158
|
-
var import_logger = require_logger();
|
|
140494
|
+
})))();
|
|
140159
140495
|
var PluginCommand = class PluginCommand extends import_upload_application.SyntheticsUploadApplicationCommand {
|
|
140160
140496
|
constructor(..._args) {
|
|
140161
140497
|
super(..._args);
|
|
@@ -140164,9 +140500,6 @@ var PluginCommand = class PluginCommand extends import_upload_application.Synthe
|
|
|
140164
140500
|
fips: (0, import_env.toBoolean)(process.env[import_constants.FIPS_ENV_VAR]) ?? false,
|
|
140165
140501
|
fipsIgnoreError: (0, import_env.toBoolean)(process.env[import_constants.FIPS_IGNORE_ERROR_ENV_VAR]) ?? false
|
|
140166
140502
|
};
|
|
140167
|
-
this.logger = new import_logger.Logger((s) => {
|
|
140168
|
-
this.context.stdout.write(s);
|
|
140169
|
-
}, import_logger.LogLevel.INFO);
|
|
140170
140503
|
}
|
|
140171
140504
|
static getDefaultConfig() {
|
|
140172
140505
|
return {
|