@base44-preview/cli 0.0.35-pr.328.b98b32e → 0.0.35-pr.332.152a3fd
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/README.md +3 -0
- package/dist/cli/index.js +1183 -618
- package/dist/cli/index.js.map +13 -5
- package/package.json +2 -1
package/dist/cli/index.js
CHANGED
|
@@ -12345,6 +12345,398 @@ var require_front_matter = __commonJS((exports, module) => {
|
|
|
12345
12345
|
}
|
|
12346
12346
|
});
|
|
12347
12347
|
|
|
12348
|
+
// node_modules/dotenv/package.json
|
|
12349
|
+
var require_package2 = __commonJS((exports, module) => {
|
|
12350
|
+
module.exports = {
|
|
12351
|
+
name: "dotenv",
|
|
12352
|
+
version: "17.3.1",
|
|
12353
|
+
description: "Loads environment variables from .env file",
|
|
12354
|
+
main: "lib/main.js",
|
|
12355
|
+
types: "lib/main.d.ts",
|
|
12356
|
+
exports: {
|
|
12357
|
+
".": {
|
|
12358
|
+
types: "./lib/main.d.ts",
|
|
12359
|
+
require: "./lib/main.js",
|
|
12360
|
+
default: "./lib/main.js"
|
|
12361
|
+
},
|
|
12362
|
+
"./config": "./config.js",
|
|
12363
|
+
"./config.js": "./config.js",
|
|
12364
|
+
"./lib/env-options": "./lib/env-options.js",
|
|
12365
|
+
"./lib/env-options.js": "./lib/env-options.js",
|
|
12366
|
+
"./lib/cli-options": "./lib/cli-options.js",
|
|
12367
|
+
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
12368
|
+
"./package.json": "./package.json"
|
|
12369
|
+
},
|
|
12370
|
+
scripts: {
|
|
12371
|
+
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
12372
|
+
lint: "standard",
|
|
12373
|
+
pretest: "npm run lint && npm run dts-check",
|
|
12374
|
+
test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
12375
|
+
"test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
|
12376
|
+
prerelease: "npm test",
|
|
12377
|
+
release: "standard-version"
|
|
12378
|
+
},
|
|
12379
|
+
repository: {
|
|
12380
|
+
type: "git",
|
|
12381
|
+
url: "git://github.com/motdotla/dotenv.git"
|
|
12382
|
+
},
|
|
12383
|
+
homepage: "https://github.com/motdotla/dotenv#readme",
|
|
12384
|
+
funding: "https://dotenvx.com",
|
|
12385
|
+
keywords: [
|
|
12386
|
+
"dotenv",
|
|
12387
|
+
"env",
|
|
12388
|
+
".env",
|
|
12389
|
+
"environment",
|
|
12390
|
+
"variables",
|
|
12391
|
+
"config",
|
|
12392
|
+
"settings"
|
|
12393
|
+
],
|
|
12394
|
+
readmeFilename: "README.md",
|
|
12395
|
+
license: "BSD-2-Clause",
|
|
12396
|
+
devDependencies: {
|
|
12397
|
+
"@types/node": "^18.11.3",
|
|
12398
|
+
decache: "^4.6.2",
|
|
12399
|
+
sinon: "^14.0.1",
|
|
12400
|
+
standard: "^17.0.0",
|
|
12401
|
+
"standard-version": "^9.5.0",
|
|
12402
|
+
tap: "^19.2.0",
|
|
12403
|
+
typescript: "^4.8.4"
|
|
12404
|
+
},
|
|
12405
|
+
engines: {
|
|
12406
|
+
node: ">=12"
|
|
12407
|
+
},
|
|
12408
|
+
browser: {
|
|
12409
|
+
fs: false
|
|
12410
|
+
}
|
|
12411
|
+
};
|
|
12412
|
+
});
|
|
12413
|
+
|
|
12414
|
+
// node_modules/dotenv/lib/main.js
|
|
12415
|
+
var require_main = __commonJS((exports, module) => {
|
|
12416
|
+
var fs14 = __require("fs");
|
|
12417
|
+
var path11 = __require("path");
|
|
12418
|
+
var os = __require("os");
|
|
12419
|
+
var crypto = __require("crypto");
|
|
12420
|
+
var packageJson = require_package2();
|
|
12421
|
+
var version2 = packageJson.version;
|
|
12422
|
+
var TIPS = [
|
|
12423
|
+
"\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com",
|
|
12424
|
+
"\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit",
|
|
12425
|
+
"\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild",
|
|
12426
|
+
"\uD83E\uDD16 agentic secret storage: https://dotenvx.com/as2",
|
|
12427
|
+
"⚡️ secrets for agents: https://dotenvx.com/as2",
|
|
12428
|
+
"\uD83D\uDEE1️ auth for agents: https://vestauth.com",
|
|
12429
|
+
"\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`",
|
|
12430
|
+
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
|
12431
|
+
"⚙️ enable debug logging with { debug: true }",
|
|
12432
|
+
"⚙️ override existing env vars with { override: true }",
|
|
12433
|
+
"⚙️ suppress all logs with { quiet: true }",
|
|
12434
|
+
"⚙️ write to custom object with { processEnv: myObject }",
|
|
12435
|
+
"⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
|
|
12436
|
+
];
|
|
12437
|
+
function _getRandomTip() {
|
|
12438
|
+
return TIPS[Math.floor(Math.random() * TIPS.length)];
|
|
12439
|
+
}
|
|
12440
|
+
function parseBoolean(value) {
|
|
12441
|
+
if (typeof value === "string") {
|
|
12442
|
+
return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
|
|
12443
|
+
}
|
|
12444
|
+
return Boolean(value);
|
|
12445
|
+
}
|
|
12446
|
+
function supportsAnsi() {
|
|
12447
|
+
return process.stdout.isTTY;
|
|
12448
|
+
}
|
|
12449
|
+
function dim(text) {
|
|
12450
|
+
return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
|
|
12451
|
+
}
|
|
12452
|
+
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
12453
|
+
function parse9(src) {
|
|
12454
|
+
const obj = {};
|
|
12455
|
+
let lines = src.toString();
|
|
12456
|
+
lines = lines.replace(/\r\n?/mg, `
|
|
12457
|
+
`);
|
|
12458
|
+
let match;
|
|
12459
|
+
while ((match = LINE.exec(lines)) != null) {
|
|
12460
|
+
const key = match[1];
|
|
12461
|
+
let value = match[2] || "";
|
|
12462
|
+
value = value.trim();
|
|
12463
|
+
const maybeQuote = value[0];
|
|
12464
|
+
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
12465
|
+
if (maybeQuote === '"') {
|
|
12466
|
+
value = value.replace(/\\n/g, `
|
|
12467
|
+
`);
|
|
12468
|
+
value = value.replace(/\\r/g, "\r");
|
|
12469
|
+
}
|
|
12470
|
+
obj[key] = value;
|
|
12471
|
+
}
|
|
12472
|
+
return obj;
|
|
12473
|
+
}
|
|
12474
|
+
function _parseVault(options) {
|
|
12475
|
+
options = options || {};
|
|
12476
|
+
const vaultPath = _vaultPath(options);
|
|
12477
|
+
options.path = vaultPath;
|
|
12478
|
+
const result = DotenvModule.configDotenv(options);
|
|
12479
|
+
if (!result.parsed) {
|
|
12480
|
+
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
12481
|
+
err.code = "MISSING_DATA";
|
|
12482
|
+
throw err;
|
|
12483
|
+
}
|
|
12484
|
+
const keys = _dotenvKey(options).split(",");
|
|
12485
|
+
const length = keys.length;
|
|
12486
|
+
let decrypted;
|
|
12487
|
+
for (let i = 0;i < length; i++) {
|
|
12488
|
+
try {
|
|
12489
|
+
const key = keys[i].trim();
|
|
12490
|
+
const attrs = _instructions(result, key);
|
|
12491
|
+
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
12492
|
+
break;
|
|
12493
|
+
} catch (error48) {
|
|
12494
|
+
if (i + 1 >= length) {
|
|
12495
|
+
throw error48;
|
|
12496
|
+
}
|
|
12497
|
+
}
|
|
12498
|
+
}
|
|
12499
|
+
return DotenvModule.parse(decrypted);
|
|
12500
|
+
}
|
|
12501
|
+
function _warn(message) {
|
|
12502
|
+
console.error(`[dotenv@${version2}][WARN] ${message}`);
|
|
12503
|
+
}
|
|
12504
|
+
function _debug(message) {
|
|
12505
|
+
console.log(`[dotenv@${version2}][DEBUG] ${message}`);
|
|
12506
|
+
}
|
|
12507
|
+
function _log(message) {
|
|
12508
|
+
console.log(`[dotenv@${version2}] ${message}`);
|
|
12509
|
+
}
|
|
12510
|
+
function _dotenvKey(options) {
|
|
12511
|
+
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
12512
|
+
return options.DOTENV_KEY;
|
|
12513
|
+
}
|
|
12514
|
+
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
12515
|
+
return process.env.DOTENV_KEY;
|
|
12516
|
+
}
|
|
12517
|
+
return "";
|
|
12518
|
+
}
|
|
12519
|
+
function _instructions(result, dotenvKey) {
|
|
12520
|
+
let uri;
|
|
12521
|
+
try {
|
|
12522
|
+
uri = new URL(dotenvKey);
|
|
12523
|
+
} catch (error48) {
|
|
12524
|
+
if (error48.code === "ERR_INVALID_URL") {
|
|
12525
|
+
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
12526
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
12527
|
+
throw err;
|
|
12528
|
+
}
|
|
12529
|
+
throw error48;
|
|
12530
|
+
}
|
|
12531
|
+
const key = uri.password;
|
|
12532
|
+
if (!key) {
|
|
12533
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
12534
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
12535
|
+
throw err;
|
|
12536
|
+
}
|
|
12537
|
+
const environment = uri.searchParams.get("environment");
|
|
12538
|
+
if (!environment) {
|
|
12539
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
12540
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
12541
|
+
throw err;
|
|
12542
|
+
}
|
|
12543
|
+
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
12544
|
+
const ciphertext = result.parsed[environmentKey];
|
|
12545
|
+
if (!ciphertext) {
|
|
12546
|
+
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
12547
|
+
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
12548
|
+
throw err;
|
|
12549
|
+
}
|
|
12550
|
+
return { ciphertext, key };
|
|
12551
|
+
}
|
|
12552
|
+
function _vaultPath(options) {
|
|
12553
|
+
let possibleVaultPath = null;
|
|
12554
|
+
if (options && options.path && options.path.length > 0) {
|
|
12555
|
+
if (Array.isArray(options.path)) {
|
|
12556
|
+
for (const filepath of options.path) {
|
|
12557
|
+
if (fs14.existsSync(filepath)) {
|
|
12558
|
+
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
12559
|
+
}
|
|
12560
|
+
}
|
|
12561
|
+
} else {
|
|
12562
|
+
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
12563
|
+
}
|
|
12564
|
+
} else {
|
|
12565
|
+
possibleVaultPath = path11.resolve(process.cwd(), ".env.vault");
|
|
12566
|
+
}
|
|
12567
|
+
if (fs14.existsSync(possibleVaultPath)) {
|
|
12568
|
+
return possibleVaultPath;
|
|
12569
|
+
}
|
|
12570
|
+
return null;
|
|
12571
|
+
}
|
|
12572
|
+
function _resolveHome(envPath) {
|
|
12573
|
+
return envPath[0] === "~" ? path11.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
12574
|
+
}
|
|
12575
|
+
function _configVault(options) {
|
|
12576
|
+
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
12577
|
+
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
12578
|
+
if (debug || !quiet) {
|
|
12579
|
+
_log("Loading env from encrypted .env.vault");
|
|
12580
|
+
}
|
|
12581
|
+
const parsed = DotenvModule._parseVault(options);
|
|
12582
|
+
let processEnv = process.env;
|
|
12583
|
+
if (options && options.processEnv != null) {
|
|
12584
|
+
processEnv = options.processEnv;
|
|
12585
|
+
}
|
|
12586
|
+
DotenvModule.populate(processEnv, parsed, options);
|
|
12587
|
+
return { parsed };
|
|
12588
|
+
}
|
|
12589
|
+
function configDotenv(options) {
|
|
12590
|
+
const dotenvPath = path11.resolve(process.cwd(), ".env");
|
|
12591
|
+
let encoding = "utf8";
|
|
12592
|
+
let processEnv = process.env;
|
|
12593
|
+
if (options && options.processEnv != null) {
|
|
12594
|
+
processEnv = options.processEnv;
|
|
12595
|
+
}
|
|
12596
|
+
let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
12597
|
+
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
12598
|
+
if (options && options.encoding) {
|
|
12599
|
+
encoding = options.encoding;
|
|
12600
|
+
} else {
|
|
12601
|
+
if (debug) {
|
|
12602
|
+
_debug("No encoding is specified. UTF-8 is used by default");
|
|
12603
|
+
}
|
|
12604
|
+
}
|
|
12605
|
+
let optionPaths = [dotenvPath];
|
|
12606
|
+
if (options && options.path) {
|
|
12607
|
+
if (!Array.isArray(options.path)) {
|
|
12608
|
+
optionPaths = [_resolveHome(options.path)];
|
|
12609
|
+
} else {
|
|
12610
|
+
optionPaths = [];
|
|
12611
|
+
for (const filepath of options.path) {
|
|
12612
|
+
optionPaths.push(_resolveHome(filepath));
|
|
12613
|
+
}
|
|
12614
|
+
}
|
|
12615
|
+
}
|
|
12616
|
+
let lastError;
|
|
12617
|
+
const parsedAll = {};
|
|
12618
|
+
for (const path12 of optionPaths) {
|
|
12619
|
+
try {
|
|
12620
|
+
const parsed = DotenvModule.parse(fs14.readFileSync(path12, { encoding }));
|
|
12621
|
+
DotenvModule.populate(parsedAll, parsed, options);
|
|
12622
|
+
} catch (e2) {
|
|
12623
|
+
if (debug) {
|
|
12624
|
+
_debug(`Failed to load ${path12} ${e2.message}`);
|
|
12625
|
+
}
|
|
12626
|
+
lastError = e2;
|
|
12627
|
+
}
|
|
12628
|
+
}
|
|
12629
|
+
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
12630
|
+
debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
|
|
12631
|
+
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
|
|
12632
|
+
if (debug || !quiet) {
|
|
12633
|
+
const keysCount = Object.keys(populated).length;
|
|
12634
|
+
const shortPaths = [];
|
|
12635
|
+
for (const filePath of optionPaths) {
|
|
12636
|
+
try {
|
|
12637
|
+
const relative = path11.relative(process.cwd(), filePath);
|
|
12638
|
+
shortPaths.push(relative);
|
|
12639
|
+
} catch (e2) {
|
|
12640
|
+
if (debug) {
|
|
12641
|
+
_debug(`Failed to load ${filePath} ${e2.message}`);
|
|
12642
|
+
}
|
|
12643
|
+
lastError = e2;
|
|
12644
|
+
}
|
|
12645
|
+
}
|
|
12646
|
+
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
|
|
12647
|
+
}
|
|
12648
|
+
if (lastError) {
|
|
12649
|
+
return { parsed: parsedAll, error: lastError };
|
|
12650
|
+
} else {
|
|
12651
|
+
return { parsed: parsedAll };
|
|
12652
|
+
}
|
|
12653
|
+
}
|
|
12654
|
+
function config9(options) {
|
|
12655
|
+
if (_dotenvKey(options).length === 0) {
|
|
12656
|
+
return DotenvModule.configDotenv(options);
|
|
12657
|
+
}
|
|
12658
|
+
const vaultPath = _vaultPath(options);
|
|
12659
|
+
if (!vaultPath) {
|
|
12660
|
+
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
12661
|
+
return DotenvModule.configDotenv(options);
|
|
12662
|
+
}
|
|
12663
|
+
return DotenvModule._configVault(options);
|
|
12664
|
+
}
|
|
12665
|
+
function decrypt(encrypted, keyStr) {
|
|
12666
|
+
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
12667
|
+
let ciphertext = Buffer.from(encrypted, "base64");
|
|
12668
|
+
const nonce = ciphertext.subarray(0, 12);
|
|
12669
|
+
const authTag = ciphertext.subarray(-16);
|
|
12670
|
+
ciphertext = ciphertext.subarray(12, -16);
|
|
12671
|
+
try {
|
|
12672
|
+
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
12673
|
+
aesgcm.setAuthTag(authTag);
|
|
12674
|
+
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
12675
|
+
} catch (error48) {
|
|
12676
|
+
const isRange = error48 instanceof RangeError;
|
|
12677
|
+
const invalidKeyLength = error48.message === "Invalid key length";
|
|
12678
|
+
const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
|
|
12679
|
+
if (isRange || invalidKeyLength) {
|
|
12680
|
+
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
12681
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
12682
|
+
throw err;
|
|
12683
|
+
} else if (decryptionFailed) {
|
|
12684
|
+
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
12685
|
+
err.code = "DECRYPTION_FAILED";
|
|
12686
|
+
throw err;
|
|
12687
|
+
} else {
|
|
12688
|
+
throw error48;
|
|
12689
|
+
}
|
|
12690
|
+
}
|
|
12691
|
+
}
|
|
12692
|
+
function populate(processEnv, parsed, options = {}) {
|
|
12693
|
+
const debug = Boolean(options && options.debug);
|
|
12694
|
+
const override = Boolean(options && options.override);
|
|
12695
|
+
const populated = {};
|
|
12696
|
+
if (typeof parsed !== "object") {
|
|
12697
|
+
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
12698
|
+
err.code = "OBJECT_REQUIRED";
|
|
12699
|
+
throw err;
|
|
12700
|
+
}
|
|
12701
|
+
for (const key of Object.keys(parsed)) {
|
|
12702
|
+
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
12703
|
+
if (override === true) {
|
|
12704
|
+
processEnv[key] = parsed[key];
|
|
12705
|
+
populated[key] = parsed[key];
|
|
12706
|
+
}
|
|
12707
|
+
if (debug) {
|
|
12708
|
+
if (override === true) {
|
|
12709
|
+
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
12710
|
+
} else {
|
|
12711
|
+
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
12712
|
+
}
|
|
12713
|
+
}
|
|
12714
|
+
} else {
|
|
12715
|
+
processEnv[key] = parsed[key];
|
|
12716
|
+
populated[key] = parsed[key];
|
|
12717
|
+
}
|
|
12718
|
+
}
|
|
12719
|
+
return populated;
|
|
12720
|
+
}
|
|
12721
|
+
var DotenvModule = {
|
|
12722
|
+
configDotenv,
|
|
12723
|
+
_configVault,
|
|
12724
|
+
_parseVault,
|
|
12725
|
+
config: config9,
|
|
12726
|
+
decrypt,
|
|
12727
|
+
parse: parse9,
|
|
12728
|
+
populate
|
|
12729
|
+
};
|
|
12730
|
+
exports.configDotenv = DotenvModule.configDotenv;
|
|
12731
|
+
exports._configVault = DotenvModule._configVault;
|
|
12732
|
+
exports._parseVault = DotenvModule._parseVault;
|
|
12733
|
+
exports.config = DotenvModule.config;
|
|
12734
|
+
exports.decrypt = DotenvModule.decrypt;
|
|
12735
|
+
exports.parse = DotenvModule.parse;
|
|
12736
|
+
exports.populate = DotenvModule.populate;
|
|
12737
|
+
module.exports = DotenvModule;
|
|
12738
|
+
});
|
|
12739
|
+
|
|
12348
12740
|
// node_modules/isexe/windows.js
|
|
12349
12741
|
var require_windows = __commonJS((exports, module) => {
|
|
12350
12742
|
module.exports = isexe;
|
|
@@ -12578,7 +12970,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
12578
12970
|
var which = require_which();
|
|
12579
12971
|
var getPathKey = require_path_key();
|
|
12580
12972
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
12581
|
-
const
|
|
12973
|
+
const env3 = parsed.options.env || process.env;
|
|
12582
12974
|
const cwd = process.cwd();
|
|
12583
12975
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
12584
12976
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
|
|
@@ -12590,7 +12982,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
12590
12982
|
let resolved;
|
|
12591
12983
|
try {
|
|
12592
12984
|
resolved = which.sync(parsed.command, {
|
|
12593
|
-
path:
|
|
12985
|
+
path: env3[getPathKey({ env: env3 })],
|
|
12594
12986
|
pathExt: withoutPathExt ? path11.delimiter : undefined
|
|
12595
12987
|
});
|
|
12596
12988
|
} catch (e2) {} finally {
|
|
@@ -12708,7 +13100,7 @@ var require_parse4 = __commonJS((exports, module) => {
|
|
|
12708
13100
|
}
|
|
12709
13101
|
return parsed;
|
|
12710
13102
|
}
|
|
12711
|
-
function
|
|
13103
|
+
function parse10(command, args, options) {
|
|
12712
13104
|
if (args && !Array.isArray(args)) {
|
|
12713
13105
|
options = args;
|
|
12714
13106
|
args = null;
|
|
@@ -12727,7 +13119,7 @@ var require_parse4 = __commonJS((exports, module) => {
|
|
|
12727
13119
|
};
|
|
12728
13120
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
12729
13121
|
}
|
|
12730
|
-
module.exports =
|
|
13122
|
+
module.exports = parse10;
|
|
12731
13123
|
});
|
|
12732
13124
|
|
|
12733
13125
|
// node_modules/cross-spawn/lib/enoent.js
|
|
@@ -12780,16 +13172,16 @@ var require_enoent = __commonJS((exports, module) => {
|
|
|
12780
13172
|
// node_modules/cross-spawn/index.js
|
|
12781
13173
|
var require_cross_spawn = __commonJS((exports, module) => {
|
|
12782
13174
|
var cp = __require("child_process");
|
|
12783
|
-
var
|
|
13175
|
+
var parse10 = require_parse4();
|
|
12784
13176
|
var enoent = require_enoent();
|
|
12785
13177
|
function spawn(command, args, options) {
|
|
12786
|
-
const parsed =
|
|
13178
|
+
const parsed = parse10(command, args, options);
|
|
12787
13179
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
12788
13180
|
enoent.hookChildProcess(spawned, parsed);
|
|
12789
13181
|
return spawned;
|
|
12790
13182
|
}
|
|
12791
13183
|
function spawnSync(command, args, options) {
|
|
12792
|
-
const parsed =
|
|
13184
|
+
const parsed = parse10(command, args, options);
|
|
12793
13185
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
12794
13186
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
12795
13187
|
return result;
|
|
@@ -12797,7 +13189,7 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
12797
13189
|
module.exports = spawn;
|
|
12798
13190
|
module.exports.spawn = spawn;
|
|
12799
13191
|
module.exports.sync = spawnSync;
|
|
12800
|
-
module.exports._parse =
|
|
13192
|
+
module.exports._parse = parse10;
|
|
12801
13193
|
module.exports._enoent = enoent;
|
|
12802
13194
|
});
|
|
12803
13195
|
|
|
@@ -108409,11 +108801,11 @@ function chooseDescription(descriptions, printWidth) {
|
|
|
108409
108801
|
return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
|
|
108410
108802
|
}
|
|
108411
108803
|
function createSchema(SchemaConstructor, parameters) {
|
|
108412
|
-
const
|
|
108413
|
-
const subSchema = Object.create(
|
|
108804
|
+
const schema9 = new SchemaConstructor(parameters);
|
|
108805
|
+
const subSchema = Object.create(schema9);
|
|
108414
108806
|
for (const handlerKey of HANDLER_KEYS) {
|
|
108415
108807
|
if (handlerKey in parameters) {
|
|
108416
|
-
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey],
|
|
108808
|
+
subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema9, Schema.prototype[handlerKey].length);
|
|
108417
108809
|
}
|
|
108418
108810
|
}
|
|
108419
108811
|
return subSchema;
|
|
@@ -111753,9 +112145,9 @@ function optionInfoToSchema(optionInfo, {
|
|
|
111753
112145
|
throw new Error(`Unexpected type ${optionInfo.type}`);
|
|
111754
112146
|
}
|
|
111755
112147
|
if (optionInfo.exception) {
|
|
111756
|
-
parameters.validate = (value,
|
|
112148
|
+
parameters.validate = (value, schema9, utils3) => optionInfo.exception(value) || schema9.validate(value, utils3);
|
|
111757
112149
|
} else {
|
|
111758
|
-
parameters.validate = (value,
|
|
112150
|
+
parameters.validate = (value, schema9, utils3) => value === undefined || schema9.validate(value, utils3);
|
|
111759
112151
|
}
|
|
111760
112152
|
if (optionInfo.redirect) {
|
|
111761
112153
|
handlers.redirect = (value) => !value ? undefined : {
|
|
@@ -111770,7 +112162,7 @@ function optionInfoToSchema(optionInfo, {
|
|
|
111770
112162
|
}
|
|
111771
112163
|
if (isCLI && !optionInfo.array) {
|
|
111772
112164
|
const originalPreprocess = parameters.preprocess || ((x10) => x10);
|
|
111773
|
-
parameters.preprocess = (value,
|
|
112165
|
+
parameters.preprocess = (value, schema9, utils3) => schema9.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
|
|
111774
112166
|
}
|
|
111775
112167
|
return optionInfo.array ? ArraySchema.create({
|
|
111776
112168
|
...isCLI ? {
|
|
@@ -113048,7 +113440,7 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113048
113440
|
__defProp3(to5, key2, { get: () => from[key2], enumerable: !(desc2 = __getOwnPropDesc(from, key2)) || desc2.enumerable });
|
|
113049
113441
|
}
|
|
113050
113442
|
return to5;
|
|
113051
|
-
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target, mod)), require_array2, require_errno2, require_fs5, require_path2, require_is_extglob2, require_is_glob2, require_glob_parent2, require_utils6, require_stringify3, require_is_number2, require_to_regex_range2, require_fill_range2, require_compile2, require_expand2, require_constants4, require_parse5, require_braces2, require_constants22, require_utils22, require_scan2, require_parse22, require_picomatch2, require_picomatch22, require_micromatch2, require_pattern2, require_merge22, require_stream5, require_string2, require_utils32, require_tasks2, require_async7, require_sync7, require_fs22, require_settings5, require_out5, require_queue_microtask2, require_run_parallel2, require_constants32, require_fs32, require_utils42, require_common4, require_async22, require_sync22, require_fs42, require_settings22, require_out22, require_reusify2, require_queue2, require_common22, require_reader3, require_async32, require_async42, require_stream22, require_sync32, require_sync42, require_settings32, require_out32, require_reader22, require_stream32, require_async52, require_matcher2, require_partial2, require_deep2, require_entry3, require_error3, require_entry22, require_provider2, require_async62, require_stream42, require_sync52, require_sync62, require_settings42, require_out42, require_picocolors2, require_debug, require_constants42, require_re, require_parse_options, require_identifiers, require_semver, require_compare, require_gte, require_pseudomap, require_map2, require_yallist, require_lru_cache, require_sigmund, require_fnmatch, require_ini,
|
|
113443
|
+
}, __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target, mod)), require_array2, require_errno2, require_fs5, require_path2, require_is_extglob2, require_is_glob2, require_glob_parent2, require_utils6, require_stringify3, require_is_number2, require_to_regex_range2, require_fill_range2, require_compile2, require_expand2, require_constants4, require_parse5, require_braces2, require_constants22, require_utils22, require_scan2, require_parse22, require_picomatch2, require_picomatch22, require_micromatch2, require_pattern2, require_merge22, require_stream5, require_string2, require_utils32, require_tasks2, require_async7, require_sync7, require_fs22, require_settings5, require_out5, require_queue_microtask2, require_run_parallel2, require_constants32, require_fs32, require_utils42, require_common4, require_async22, require_sync22, require_fs42, require_settings22, require_out22, require_reusify2, require_queue2, require_common22, require_reader3, require_async32, require_async42, require_stream22, require_sync32, require_sync42, require_settings32, require_out32, require_reader22, require_stream32, require_async52, require_matcher2, require_partial2, require_deep2, require_entry3, require_error3, require_entry22, require_provider2, require_async62, require_stream42, require_sync52, require_sync62, require_settings42, require_out42, require_picocolors2, require_debug, require_constants42, require_re, require_parse_options, require_identifiers, require_semver, require_compare, require_gte, require_pseudomap, require_map2, require_yallist, require_lru_cache, require_sigmund, require_fnmatch, require_ini, require_package3, require_src2, require_js_tokens, require_readlines, require_ignore2, index_exports, Diff = class {
|
|
113052
113444
|
diff(oldStr, newStr, options8 = {}) {
|
|
113053
113445
|
let callback;
|
|
113054
113446
|
if (typeof options8 === "function") {
|
|
@@ -113347,9 +113739,9 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113347
113739
|
};
|
|
113348
113740
|
applyNormalization();
|
|
113349
113741
|
for (const key2 of Object.keys(this._utils.schemas)) {
|
|
113350
|
-
const
|
|
113742
|
+
const schema9 = this._utils.schemas[key2];
|
|
113351
113743
|
if (!(key2 in newOptions)) {
|
|
113352
|
-
const defaultResult = normalizeDefaultResult(
|
|
113744
|
+
const defaultResult = normalizeDefaultResult(schema9.default(this._utils));
|
|
113353
113745
|
if ("value" in defaultResult) {
|
|
113354
113746
|
restOptionsArray.push({ [key2]: defaultResult.value });
|
|
113355
113747
|
}
|
|
@@ -113360,13 +113752,13 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113360
113752
|
if (!(key2 in newOptions)) {
|
|
113361
113753
|
continue;
|
|
113362
113754
|
}
|
|
113363
|
-
const
|
|
113755
|
+
const schema9 = this._utils.schemas[key2];
|
|
113364
113756
|
const value = newOptions[key2];
|
|
113365
|
-
const newValue =
|
|
113757
|
+
const newValue = schema9.postprocess(value, this._utils);
|
|
113366
113758
|
if (newValue === VALUE_UNCHANGED) {
|
|
113367
113759
|
continue;
|
|
113368
113760
|
}
|
|
113369
|
-
this._applyValidation(newValue, key2,
|
|
113761
|
+
this._applyValidation(newValue, key2, schema9);
|
|
113370
113762
|
newOptions[key2] = newValue;
|
|
113371
113763
|
}
|
|
113372
113764
|
this._applyPostprocess(newOptions);
|
|
@@ -113377,14 +113769,14 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113377
113769
|
const transferredOptionsArray = [];
|
|
113378
113770
|
const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
|
|
113379
113771
|
for (const key2 of knownKeys) {
|
|
113380
|
-
const
|
|
113381
|
-
const value =
|
|
113382
|
-
this._applyValidation(value, key2,
|
|
113772
|
+
const schema9 = this._utils.schemas[key2];
|
|
113773
|
+
const value = schema9.preprocess(options8[key2], this._utils);
|
|
113774
|
+
this._applyValidation(value, key2, schema9);
|
|
113383
113775
|
const appendTransferredOptions = ({ from, to: to5 }) => {
|
|
113384
113776
|
transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
|
|
113385
113777
|
};
|
|
113386
113778
|
const warnDeprecated = ({ value: currentValue, redirectTo }) => {
|
|
113387
|
-
const deprecatedResult = normalizeDeprecatedResult(
|
|
113779
|
+
const deprecatedResult = normalizeDeprecatedResult(schema9.deprecated(currentValue, this._utils), value, true);
|
|
113388
113780
|
if (deprecatedResult === false) {
|
|
113389
113781
|
return;
|
|
113390
113782
|
}
|
|
@@ -113402,13 +113794,13 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113402
113794
|
}
|
|
113403
113795
|
}
|
|
113404
113796
|
};
|
|
113405
|
-
const forwardResult = normalizeForwardResult(
|
|
113797
|
+
const forwardResult = normalizeForwardResult(schema9.forward(value, this._utils), value);
|
|
113406
113798
|
forwardResult.forEach(appendTransferredOptions);
|
|
113407
|
-
const redirectResult = normalizeRedirectResult(
|
|
113799
|
+
const redirectResult = normalizeRedirectResult(schema9.redirect(value, this._utils), value);
|
|
113408
113800
|
redirectResult.redirect.forEach(appendTransferredOptions);
|
|
113409
113801
|
if ("remain" in redirectResult) {
|
|
113410
113802
|
const remainingValue = redirectResult.remain;
|
|
113411
|
-
newOptions[key2] = key2 in newOptions ?
|
|
113803
|
+
newOptions[key2] = key2 in newOptions ? schema9.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
|
|
113412
113804
|
warnDeprecated({ value: remainingValue });
|
|
113413
113805
|
}
|
|
113414
113806
|
for (const { from, to: to5 } of redirectResult.redirect) {
|
|
@@ -113436,8 +113828,8 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113436
113828
|
const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
|
|
113437
113829
|
return { knownKeys, unknownKeys };
|
|
113438
113830
|
}
|
|
113439
|
-
_applyValidation(value, key2,
|
|
113440
|
-
const validateResult = normalizeValidateResult(
|
|
113831
|
+
_applyValidation(value, key2, schema9) {
|
|
113832
|
+
const validateResult = normalizeValidateResult(schema9.validate(value, this._utils), value);
|
|
113441
113833
|
if (validateResult !== true) {
|
|
113442
113834
|
throw this._invalidHandler(key2, validateResult.value, this._utils);
|
|
113443
113835
|
}
|
|
@@ -113479,8 +113871,8 @@ var require2, __filename2, __dirname4, __create2, __defProp3, __getOwnPropDesc,
|
|
|
113479
113871
|
for (const key2 of unknownKeys) {
|
|
113480
113872
|
const value = postprocessed.override[key2];
|
|
113481
113873
|
this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
|
|
113482
|
-
const
|
|
113483
|
-
this._applyValidation(knownResultValue, knownResultKey,
|
|
113874
|
+
const schema9 = this._utils.schemas[knownResultKey];
|
|
113875
|
+
this._applyValidation(knownResultValue, knownResultKey, schema9);
|
|
113484
113876
|
options8[knownResultKey] = knownResultValue;
|
|
113485
113877
|
});
|
|
113486
113878
|
}
|
|
@@ -118988,8 +119380,8 @@ var init_prettier = __esm(() => {
|
|
|
118988
119380
|
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
118989
119381
|
var p4 = process || {};
|
|
118990
119382
|
var argv = p4.argv || [];
|
|
118991
|
-
var
|
|
118992
|
-
var isColorSupported2 = !(!!
|
|
119383
|
+
var env3 = p4.env || {};
|
|
119384
|
+
var isColorSupported2 = !(!!env3.NO_COLOR || argv.includes("--no-color")) && (!!env3.FORCE_COLOR || argv.includes("--color") || p4.platform === "win32" || (p4.stdout || {}).isTTY && env3.TERM !== "dumb" || !!env3.CI);
|
|
118993
119385
|
var formatter = (open2, close, replace3 = open2) => (input) => {
|
|
118994
119386
|
let string4 = "" + input, index = string4.indexOf(close, open2.length);
|
|
118995
119387
|
return ~index ? open2 + replaceClose(string4, close, replace3, index) + close : open2 + string4 + close;
|
|
@@ -121151,7 +121543,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
121151
121543
|
exports.parseString = parseString2;
|
|
121152
121544
|
}
|
|
121153
121545
|
});
|
|
121154
|
-
|
|
121546
|
+
require_package3 = __commonJS2({
|
|
121155
121547
|
"node_modules/editorconfig/package.json"(exports, module) {
|
|
121156
121548
|
module.exports = {
|
|
121157
121549
|
name: "editorconfig",
|
|
@@ -121340,7 +121732,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
121340
121732
|
var fnmatch_1 = __importDefault(require_fnmatch());
|
|
121341
121733
|
var ini_1 = require_ini();
|
|
121342
121734
|
exports.parseString = ini_1.parseString;
|
|
121343
|
-
var package_json_1 = __importDefault(
|
|
121735
|
+
var package_json_1 = __importDefault(require_package3());
|
|
121344
121736
|
var knownProps = {
|
|
121345
121737
|
end_of_line: true,
|
|
121346
121738
|
indent_style: true,
|
|
@@ -127118,11 +127510,11 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
127118
127510
|
var require_formatter = __commonJS((exports) => {
|
|
127119
127511
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
127120
127512
|
function adopt(value) {
|
|
127121
|
-
return value instanceof P9 ? value : new P9(function(
|
|
127122
|
-
|
|
127513
|
+
return value instanceof P9 ? value : new P9(function(resolve6) {
|
|
127514
|
+
resolve6(value);
|
|
127123
127515
|
});
|
|
127124
127516
|
}
|
|
127125
|
-
return new (P9 || (P9 = Promise))(function(
|
|
127517
|
+
return new (P9 || (P9 = Promise))(function(resolve6, reject) {
|
|
127126
127518
|
function fulfilled(value) {
|
|
127127
127519
|
try {
|
|
127128
127520
|
step(generator.next(value));
|
|
@@ -127138,7 +127530,7 @@ var require_formatter = __commonJS((exports) => {
|
|
|
127138
127530
|
}
|
|
127139
127531
|
}
|
|
127140
127532
|
function step(result) {
|
|
127141
|
-
result.done ?
|
|
127533
|
+
result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
127142
127534
|
}
|
|
127143
127535
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
127144
127536
|
});
|
|
@@ -127193,23 +127585,23 @@ var require_JSONSchema = __commonJS((exports) => {
|
|
|
127193
127585
|
exports.Parent = Symbol("Parent");
|
|
127194
127586
|
exports.Types = Symbol("Types");
|
|
127195
127587
|
exports.Intersection = Symbol("Intersection");
|
|
127196
|
-
exports.getRootSchema = (0, lodash_1.memoize)((
|
|
127197
|
-
const parent =
|
|
127588
|
+
exports.getRootSchema = (0, lodash_1.memoize)((schema9) => {
|
|
127589
|
+
const parent = schema9[exports.Parent];
|
|
127198
127590
|
if (!parent) {
|
|
127199
|
-
return
|
|
127591
|
+
return schema9;
|
|
127200
127592
|
}
|
|
127201
127593
|
return (0, exports.getRootSchema)(parent);
|
|
127202
127594
|
});
|
|
127203
|
-
function isBoolean(
|
|
127204
|
-
return
|
|
127595
|
+
function isBoolean(schema9) {
|
|
127596
|
+
return schema9 === true || schema9 === false;
|
|
127205
127597
|
}
|
|
127206
127598
|
exports.isBoolean = isBoolean;
|
|
127207
|
-
function isPrimitive(
|
|
127208
|
-
return !(0, lodash_1.isPlainObject)(
|
|
127599
|
+
function isPrimitive(schema9) {
|
|
127600
|
+
return !(0, lodash_1.isPlainObject)(schema9);
|
|
127209
127601
|
}
|
|
127210
127602
|
exports.isPrimitive = isPrimitive;
|
|
127211
|
-
function isCompound(
|
|
127212
|
-
return Array.isArray(
|
|
127603
|
+
function isCompound(schema9) {
|
|
127604
|
+
return Array.isArray(schema9.type) || "anyOf" in schema9 || "oneOf" in schema9;
|
|
127213
127605
|
}
|
|
127214
127606
|
exports.isCompound = isCompound;
|
|
127215
127607
|
});
|
|
@@ -127436,9 +127828,9 @@ var require_type2 = __commonJS((exports, module) => {
|
|
|
127436
127828
|
var require_schema2 = __commonJS((exports, module) => {
|
|
127437
127829
|
var YAMLException = require_exception2();
|
|
127438
127830
|
var Type = require_type2();
|
|
127439
|
-
function compileList(
|
|
127831
|
+
function compileList(schema9, name2) {
|
|
127440
127832
|
var result = [];
|
|
127441
|
-
|
|
127833
|
+
schema9[name2].forEach(function(currentType) {
|
|
127442
127834
|
var newIndex = result.length;
|
|
127443
127835
|
result.forEach(function(previousType, previousIndex) {
|
|
127444
127836
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -129383,7 +129775,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
129383
129775
|
"OFF"
|
|
129384
129776
|
];
|
|
129385
129777
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
129386
|
-
function compileStyleMap(
|
|
129778
|
+
function compileStyleMap(schema9, map2) {
|
|
129387
129779
|
var result, keys, index, length, tag, style, type;
|
|
129388
129780
|
if (map2 === null)
|
|
129389
129781
|
return {};
|
|
@@ -129395,7 +129787,7 @@ var require_dumper2 = __commonJS((exports, module) => {
|
|
|
129395
129787
|
if (tag.slice(0, 2) === "!!") {
|
|
129396
129788
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
129397
129789
|
}
|
|
129398
|
-
type =
|
|
129790
|
+
type = schema9.compiledTypeMap["fallback"][tag];
|
|
129399
129791
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
129400
129792
|
style = type.styleAliases[style];
|
|
129401
129793
|
}
|
|
@@ -130054,11 +130446,11 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130054
130446
|
function traverseArray(arr, callback, processed) {
|
|
130055
130447
|
arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
|
|
130056
130448
|
}
|
|
130057
|
-
function traverseIntersection(
|
|
130058
|
-
if (typeof
|
|
130449
|
+
function traverseIntersection(schema9, callback, processed) {
|
|
130450
|
+
if (typeof schema9 !== "object" || !schema9) {
|
|
130059
130451
|
return;
|
|
130060
130452
|
}
|
|
130061
|
-
const r5 =
|
|
130453
|
+
const r5 = schema9;
|
|
130062
130454
|
const intersection2 = r5[JSONSchema_1.Intersection];
|
|
130063
130455
|
if (!intersection2) {
|
|
130064
130456
|
return;
|
|
@@ -130067,60 +130459,60 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130067
130459
|
traverseArray(intersection2.allOf, callback, processed);
|
|
130068
130460
|
}
|
|
130069
130461
|
}
|
|
130070
|
-
function traverse(
|
|
130071
|
-
if (processed.has(
|
|
130462
|
+
function traverse(schema9, callback, processed = new Set, key2) {
|
|
130463
|
+
if (processed.has(schema9)) {
|
|
130072
130464
|
return;
|
|
130073
130465
|
}
|
|
130074
|
-
processed.add(
|
|
130075
|
-
callback(
|
|
130076
|
-
if (
|
|
130077
|
-
traverseArray(
|
|
130466
|
+
processed.add(schema9);
|
|
130467
|
+
callback(schema9, key2 !== null && key2 !== undefined ? key2 : null);
|
|
130468
|
+
if (schema9.anyOf) {
|
|
130469
|
+
traverseArray(schema9.anyOf, callback, processed);
|
|
130078
130470
|
}
|
|
130079
|
-
if (
|
|
130080
|
-
traverseArray(
|
|
130471
|
+
if (schema9.allOf) {
|
|
130472
|
+
traverseArray(schema9.allOf, callback, processed);
|
|
130081
130473
|
}
|
|
130082
|
-
if (
|
|
130083
|
-
traverseArray(
|
|
130474
|
+
if (schema9.oneOf) {
|
|
130475
|
+
traverseArray(schema9.oneOf, callback, processed);
|
|
130084
130476
|
}
|
|
130085
|
-
if (
|
|
130086
|
-
traverseObjectKeys(
|
|
130477
|
+
if (schema9.properties) {
|
|
130478
|
+
traverseObjectKeys(schema9.properties, callback, processed);
|
|
130087
130479
|
}
|
|
130088
|
-
if (
|
|
130089
|
-
traverseObjectKeys(
|
|
130480
|
+
if (schema9.patternProperties) {
|
|
130481
|
+
traverseObjectKeys(schema9.patternProperties, callback, processed);
|
|
130090
130482
|
}
|
|
130091
|
-
if (
|
|
130092
|
-
traverse(
|
|
130483
|
+
if (schema9.additionalProperties && typeof schema9.additionalProperties === "object") {
|
|
130484
|
+
traverse(schema9.additionalProperties, callback, processed);
|
|
130093
130485
|
}
|
|
130094
|
-
if (
|
|
130095
|
-
const { items } =
|
|
130486
|
+
if (schema9.items) {
|
|
130487
|
+
const { items } = schema9;
|
|
130096
130488
|
if (Array.isArray(items)) {
|
|
130097
130489
|
traverseArray(items, callback, processed);
|
|
130098
130490
|
} else {
|
|
130099
130491
|
traverse(items, callback, processed);
|
|
130100
130492
|
}
|
|
130101
130493
|
}
|
|
130102
|
-
if (
|
|
130103
|
-
traverse(
|
|
130494
|
+
if (schema9.additionalItems && typeof schema9.additionalItems === "object") {
|
|
130495
|
+
traverse(schema9.additionalItems, callback, processed);
|
|
130104
130496
|
}
|
|
130105
|
-
if (
|
|
130106
|
-
if (Array.isArray(
|
|
130107
|
-
traverseArray(
|
|
130497
|
+
if (schema9.dependencies) {
|
|
130498
|
+
if (Array.isArray(schema9.dependencies)) {
|
|
130499
|
+
traverseArray(schema9.dependencies, callback, processed);
|
|
130108
130500
|
} else {
|
|
130109
|
-
traverseObjectKeys(
|
|
130501
|
+
traverseObjectKeys(schema9.dependencies, callback, processed);
|
|
130110
130502
|
}
|
|
130111
130503
|
}
|
|
130112
|
-
if (
|
|
130113
|
-
traverseObjectKeys(
|
|
130504
|
+
if (schema9.definitions) {
|
|
130505
|
+
traverseObjectKeys(schema9.definitions, callback, processed);
|
|
130114
130506
|
}
|
|
130115
|
-
if (
|
|
130116
|
-
traverseObjectKeys(
|
|
130507
|
+
if (schema9.$defs) {
|
|
130508
|
+
traverseObjectKeys(schema9.$defs, callback, processed);
|
|
130117
130509
|
}
|
|
130118
|
-
if (
|
|
130119
|
-
traverse(
|
|
130510
|
+
if (schema9.not) {
|
|
130511
|
+
traverse(schema9.not, callback, processed);
|
|
130120
130512
|
}
|
|
130121
|
-
traverseIntersection(
|
|
130122
|
-
Object.keys(
|
|
130123
|
-
const child =
|
|
130513
|
+
traverseIntersection(schema9, callback, processed);
|
|
130514
|
+
Object.keys(schema9).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
|
|
130515
|
+
const child = schema9[key3];
|
|
130124
130516
|
if (child && typeof child === "object") {
|
|
130125
130517
|
traverseObjectKeys(child, callback, processed);
|
|
130126
130518
|
}
|
|
@@ -130202,14 +130594,14 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130202
130594
|
return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
|
|
130203
130595
|
}
|
|
130204
130596
|
}
|
|
130205
|
-
function escapeBlockComment(
|
|
130597
|
+
function escapeBlockComment(schema9) {
|
|
130206
130598
|
const replacer = "* /";
|
|
130207
|
-
if (
|
|
130599
|
+
if (schema9 === null || typeof schema9 !== "object") {
|
|
130208
130600
|
return;
|
|
130209
130601
|
}
|
|
130210
|
-
for (const key2 of Object.keys(
|
|
130211
|
-
if (key2 === "description" && typeof
|
|
130212
|
-
|
|
130602
|
+
for (const key2 of Object.keys(schema9)) {
|
|
130603
|
+
if (key2 === "description" && typeof schema9[key2] === "string") {
|
|
130604
|
+
schema9[key2] = schema9[key2].replace(/\*\//g, replacer);
|
|
130213
130605
|
}
|
|
130214
130606
|
}
|
|
130215
130607
|
}
|
|
@@ -130221,45 +130613,45 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130221
130613
|
return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
|
|
130222
130614
|
}
|
|
130223
130615
|
exports.pathTransform = pathTransform;
|
|
130224
|
-
function maybeStripDefault(
|
|
130225
|
-
if (!("default" in
|
|
130226
|
-
return
|
|
130616
|
+
function maybeStripDefault(schema9) {
|
|
130617
|
+
if (!("default" in schema9)) {
|
|
130618
|
+
return schema9;
|
|
130227
130619
|
}
|
|
130228
|
-
switch (
|
|
130620
|
+
switch (schema9.type) {
|
|
130229
130621
|
case "array":
|
|
130230
|
-
if (Array.isArray(
|
|
130231
|
-
return
|
|
130622
|
+
if (Array.isArray(schema9.default)) {
|
|
130623
|
+
return schema9;
|
|
130232
130624
|
}
|
|
130233
130625
|
break;
|
|
130234
130626
|
case "boolean":
|
|
130235
|
-
if (typeof
|
|
130236
|
-
return
|
|
130627
|
+
if (typeof schema9.default === "boolean") {
|
|
130628
|
+
return schema9;
|
|
130237
130629
|
}
|
|
130238
130630
|
break;
|
|
130239
130631
|
case "integer":
|
|
130240
130632
|
case "number":
|
|
130241
|
-
if (typeof
|
|
130242
|
-
return
|
|
130633
|
+
if (typeof schema9.default === "number") {
|
|
130634
|
+
return schema9;
|
|
130243
130635
|
}
|
|
130244
130636
|
break;
|
|
130245
130637
|
case "string":
|
|
130246
|
-
if (typeof
|
|
130247
|
-
return
|
|
130638
|
+
if (typeof schema9.default === "string") {
|
|
130639
|
+
return schema9;
|
|
130248
130640
|
}
|
|
130249
130641
|
break;
|
|
130250
130642
|
case "null":
|
|
130251
|
-
if (
|
|
130252
|
-
return
|
|
130643
|
+
if (schema9.default === null) {
|
|
130644
|
+
return schema9;
|
|
130253
130645
|
}
|
|
130254
130646
|
break;
|
|
130255
130647
|
case "object":
|
|
130256
|
-
if ((0, lodash_1.isPlainObject)(
|
|
130257
|
-
return
|
|
130648
|
+
if ((0, lodash_1.isPlainObject)(schema9.default)) {
|
|
130649
|
+
return schema9;
|
|
130258
130650
|
}
|
|
130259
130651
|
break;
|
|
130260
130652
|
}
|
|
130261
|
-
delete
|
|
130262
|
-
return
|
|
130653
|
+
delete schema9.default;
|
|
130654
|
+
return schema9;
|
|
130263
130655
|
}
|
|
130264
130656
|
exports.maybeStripDefault = maybeStripDefault;
|
|
130265
130657
|
function appendToDescription(existingDescription, ...values) {
|
|
@@ -130273,11 +130665,11 @@ ${values.join(`
|
|
|
130273
130665
|
`);
|
|
130274
130666
|
}
|
|
130275
130667
|
exports.appendToDescription = appendToDescription;
|
|
130276
|
-
function isSchemaLike(
|
|
130277
|
-
if (!(0, lodash_1.isPlainObject)(
|
|
130668
|
+
function isSchemaLike(schema9) {
|
|
130669
|
+
if (!(0, lodash_1.isPlainObject)(schema9)) {
|
|
130278
130670
|
return false;
|
|
130279
130671
|
}
|
|
130280
|
-
const parent =
|
|
130672
|
+
const parent = schema9[JSONSchema_1.Parent];
|
|
130281
130673
|
if (parent === null) {
|
|
130282
130674
|
return true;
|
|
130283
130675
|
}
|
|
@@ -130294,7 +130686,7 @@ ${values.join(`
|
|
|
130294
130686
|
"properties",
|
|
130295
130687
|
"required"
|
|
130296
130688
|
];
|
|
130297
|
-
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] ===
|
|
130689
|
+
if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema9)) {
|
|
130298
130690
|
return false;
|
|
130299
130691
|
}
|
|
130300
130692
|
return true;
|
|
@@ -130592,13 +130984,13 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
130592
130984
|
exports.typesOfSchema = undefined;
|
|
130593
130985
|
var lodash_1 = require_lodash2();
|
|
130594
130986
|
var JSONSchema_1 = require_JSONSchema();
|
|
130595
|
-
function typesOfSchema(
|
|
130596
|
-
if (
|
|
130987
|
+
function typesOfSchema(schema9) {
|
|
130988
|
+
if (schema9.tsType) {
|
|
130597
130989
|
return new Set(["CUSTOM_TYPE"]);
|
|
130598
130990
|
}
|
|
130599
130991
|
const matchedTypes = new Set;
|
|
130600
130992
|
for (const [schemaType, f7] of Object.entries(matchers)) {
|
|
130601
|
-
if (f7(
|
|
130993
|
+
if (f7(schema9)) {
|
|
130602
130994
|
matchedTypes.add(schemaType);
|
|
130603
130995
|
}
|
|
130604
130996
|
}
|
|
@@ -130609,26 +131001,26 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
130609
131001
|
}
|
|
130610
131002
|
exports.typesOfSchema = typesOfSchema;
|
|
130611
131003
|
var matchers = {
|
|
130612
|
-
ALL_OF(
|
|
130613
|
-
return "allOf" in
|
|
131004
|
+
ALL_OF(schema9) {
|
|
131005
|
+
return "allOf" in schema9;
|
|
130614
131006
|
},
|
|
130615
|
-
ANY(
|
|
130616
|
-
if (Object.keys(
|
|
131007
|
+
ANY(schema9) {
|
|
131008
|
+
if (Object.keys(schema9).length === 0) {
|
|
130617
131009
|
return true;
|
|
130618
131010
|
}
|
|
130619
|
-
return
|
|
131011
|
+
return schema9.type === "any";
|
|
130620
131012
|
},
|
|
130621
|
-
ANY_OF(
|
|
130622
|
-
return "anyOf" in
|
|
131013
|
+
ANY_OF(schema9) {
|
|
131014
|
+
return "anyOf" in schema9;
|
|
130623
131015
|
},
|
|
130624
|
-
BOOLEAN(
|
|
130625
|
-
if ("enum" in
|
|
131016
|
+
BOOLEAN(schema9) {
|
|
131017
|
+
if ("enum" in schema9) {
|
|
130626
131018
|
return false;
|
|
130627
131019
|
}
|
|
130628
|
-
if (
|
|
131020
|
+
if (schema9.type === "boolean") {
|
|
130629
131021
|
return true;
|
|
130630
131022
|
}
|
|
130631
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
131023
|
+
if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "boolean") {
|
|
130632
131024
|
return true;
|
|
130633
131025
|
}
|
|
130634
131026
|
return false;
|
|
@@ -130636,74 +131028,74 @@ var require_typesOfSchema = __commonJS((exports) => {
|
|
|
130636
131028
|
CUSTOM_TYPE() {
|
|
130637
131029
|
return false;
|
|
130638
131030
|
},
|
|
130639
|
-
NAMED_ENUM(
|
|
130640
|
-
return "enum" in
|
|
131031
|
+
NAMED_ENUM(schema9) {
|
|
131032
|
+
return "enum" in schema9 && "tsEnumNames" in schema9;
|
|
130641
131033
|
},
|
|
130642
|
-
NAMED_SCHEMA(
|
|
130643
|
-
return "$id" in
|
|
131034
|
+
NAMED_SCHEMA(schema9) {
|
|
131035
|
+
return "$id" in schema9 && (("patternProperties" in schema9) || ("properties" in schema9));
|
|
130644
131036
|
},
|
|
130645
|
-
NEVER(
|
|
130646
|
-
return
|
|
131037
|
+
NEVER(schema9) {
|
|
131038
|
+
return schema9 === false;
|
|
130647
131039
|
},
|
|
130648
|
-
NULL(
|
|
130649
|
-
return
|
|
131040
|
+
NULL(schema9) {
|
|
131041
|
+
return schema9.type === "null";
|
|
130650
131042
|
},
|
|
130651
|
-
NUMBER(
|
|
130652
|
-
if ("enum" in
|
|
131043
|
+
NUMBER(schema9) {
|
|
131044
|
+
if ("enum" in schema9) {
|
|
130653
131045
|
return false;
|
|
130654
131046
|
}
|
|
130655
|
-
if (
|
|
131047
|
+
if (schema9.type === "integer" || schema9.type === "number") {
|
|
130656
131048
|
return true;
|
|
130657
131049
|
}
|
|
130658
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
131050
|
+
if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "number") {
|
|
130659
131051
|
return true;
|
|
130660
131052
|
}
|
|
130661
131053
|
return false;
|
|
130662
131054
|
},
|
|
130663
|
-
OBJECT(
|
|
130664
|
-
return
|
|
131055
|
+
OBJECT(schema9) {
|
|
131056
|
+
return schema9.type === "object" && !(0, lodash_1.isPlainObject)(schema9.additionalProperties) && !schema9.allOf && !schema9.anyOf && !schema9.oneOf && !schema9.patternProperties && !schema9.properties && !schema9.required;
|
|
130665
131057
|
},
|
|
130666
|
-
ONE_OF(
|
|
130667
|
-
return "oneOf" in
|
|
131058
|
+
ONE_OF(schema9) {
|
|
131059
|
+
return "oneOf" in schema9;
|
|
130668
131060
|
},
|
|
130669
|
-
REFERENCE(
|
|
130670
|
-
return "$ref" in
|
|
131061
|
+
REFERENCE(schema9) {
|
|
131062
|
+
return "$ref" in schema9;
|
|
130671
131063
|
},
|
|
130672
|
-
STRING(
|
|
130673
|
-
if ("enum" in
|
|
131064
|
+
STRING(schema9) {
|
|
131065
|
+
if ("enum" in schema9) {
|
|
130674
131066
|
return false;
|
|
130675
131067
|
}
|
|
130676
|
-
if (
|
|
131068
|
+
if (schema9.type === "string") {
|
|
130677
131069
|
return true;
|
|
130678
131070
|
}
|
|
130679
|
-
if (!(0, JSONSchema_1.isCompound)(
|
|
131071
|
+
if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "string") {
|
|
130680
131072
|
return true;
|
|
130681
131073
|
}
|
|
130682
131074
|
return false;
|
|
130683
131075
|
},
|
|
130684
|
-
TYPED_ARRAY(
|
|
130685
|
-
if (
|
|
131076
|
+
TYPED_ARRAY(schema9) {
|
|
131077
|
+
if (schema9.type && schema9.type !== "array") {
|
|
130686
131078
|
return false;
|
|
130687
131079
|
}
|
|
130688
|
-
return "items" in
|
|
131080
|
+
return "items" in schema9;
|
|
130689
131081
|
},
|
|
130690
|
-
UNION(
|
|
130691
|
-
return Array.isArray(
|
|
131082
|
+
UNION(schema9) {
|
|
131083
|
+
return Array.isArray(schema9.type);
|
|
130692
131084
|
},
|
|
130693
|
-
UNNAMED_ENUM(
|
|
130694
|
-
if ("tsEnumNames" in
|
|
131085
|
+
UNNAMED_ENUM(schema9) {
|
|
131086
|
+
if ("tsEnumNames" in schema9) {
|
|
130695
131087
|
return false;
|
|
130696
131088
|
}
|
|
130697
|
-
if (
|
|
131089
|
+
if (schema9.type && schema9.type !== "boolean" && schema9.type !== "integer" && schema9.type !== "number" && schema9.type !== "string") {
|
|
130698
131090
|
return false;
|
|
130699
131091
|
}
|
|
130700
|
-
return "enum" in
|
|
131092
|
+
return "enum" in schema9;
|
|
130701
131093
|
},
|
|
130702
131094
|
UNNAMED_SCHEMA() {
|
|
130703
131095
|
return false;
|
|
130704
131096
|
},
|
|
130705
|
-
UNTYPED_ARRAY(
|
|
130706
|
-
return
|
|
131097
|
+
UNTYPED_ARRAY(schema9) {
|
|
131098
|
+
return schema9.type === "array" && !("items" in schema9);
|
|
130707
131099
|
}
|
|
130708
131100
|
};
|
|
130709
131101
|
});
|
|
@@ -130714,10 +131106,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
130714
131106
|
exports.applySchemaTyping = undefined;
|
|
130715
131107
|
var JSONSchema_1 = require_JSONSchema();
|
|
130716
131108
|
var typesOfSchema_1 = require_typesOfSchema();
|
|
130717
|
-
function applySchemaTyping(
|
|
131109
|
+
function applySchemaTyping(schema9) {
|
|
130718
131110
|
var _a7;
|
|
130719
|
-
const types = (0, typesOfSchema_1.typesOfSchema)(
|
|
130720
|
-
Object.defineProperty(
|
|
131111
|
+
const types = (0, typesOfSchema_1.typesOfSchema)(schema9);
|
|
131112
|
+
Object.defineProperty(schema9, JSONSchema_1.Types, {
|
|
130721
131113
|
enumerable: false,
|
|
130722
131114
|
value: types,
|
|
130723
131115
|
writable: false
|
|
@@ -130726,23 +131118,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
|
|
|
130726
131118
|
return;
|
|
130727
131119
|
}
|
|
130728
131120
|
const intersection2 = {
|
|
130729
|
-
[JSONSchema_1.Parent]:
|
|
131121
|
+
[JSONSchema_1.Parent]: schema9,
|
|
130730
131122
|
[JSONSchema_1.Types]: new Set(["ALL_OF"]),
|
|
130731
|
-
$id:
|
|
130732
|
-
description:
|
|
130733
|
-
name:
|
|
130734
|
-
title:
|
|
130735
|
-
allOf: (_a7 =
|
|
131123
|
+
$id: schema9.$id,
|
|
131124
|
+
description: schema9.description,
|
|
131125
|
+
name: schema9.name,
|
|
131126
|
+
title: schema9.title,
|
|
131127
|
+
allOf: (_a7 = schema9.allOf) !== null && _a7 !== undefined ? _a7 : [],
|
|
130736
131128
|
required: [],
|
|
130737
131129
|
additionalProperties: false
|
|
130738
131130
|
};
|
|
130739
131131
|
types.delete("ALL_OF");
|
|
130740
|
-
delete
|
|
130741
|
-
delete
|
|
130742
|
-
delete
|
|
130743
|
-
delete
|
|
130744
|
-
delete
|
|
130745
|
-
Object.defineProperty(
|
|
131132
|
+
delete schema9.allOf;
|
|
131133
|
+
delete schema9.$id;
|
|
131134
|
+
delete schema9.description;
|
|
131135
|
+
delete schema9.name;
|
|
131136
|
+
delete schema9.title;
|
|
131137
|
+
Object.defineProperty(schema9, JSONSchema_1.Intersection, {
|
|
130746
131138
|
enumerable: false,
|
|
130747
131139
|
value: intersection2,
|
|
130748
131140
|
writable: false
|
|
@@ -130760,186 +131152,186 @@ var require_normalizer = __commonJS((exports) => {
|
|
|
130760
131152
|
var applySchemaTyping_1 = require_applySchemaTyping();
|
|
130761
131153
|
var util_1 = __require("util");
|
|
130762
131154
|
var rules = new Map;
|
|
130763
|
-
function hasType(
|
|
130764
|
-
return
|
|
131155
|
+
function hasType(schema9, type) {
|
|
131156
|
+
return schema9.type === type || Array.isArray(schema9.type) && schema9.type.includes(type);
|
|
130765
131157
|
}
|
|
130766
|
-
function isObjectType(
|
|
130767
|
-
return
|
|
131158
|
+
function isObjectType(schema9) {
|
|
131159
|
+
return schema9.properties !== undefined || hasType(schema9, "object") || hasType(schema9, "any");
|
|
130768
131160
|
}
|
|
130769
|
-
function isArrayType(
|
|
130770
|
-
return
|
|
131161
|
+
function isArrayType(schema9) {
|
|
131162
|
+
return schema9.items !== undefined || hasType(schema9, "array") || hasType(schema9, "any");
|
|
130771
131163
|
}
|
|
130772
|
-
function isEnumTypeWithoutTsEnumNames(
|
|
130773
|
-
return
|
|
131164
|
+
function isEnumTypeWithoutTsEnumNames(schema9) {
|
|
131165
|
+
return schema9.type === "string" && schema9.enum !== undefined && schema9.tsEnumNames === undefined;
|
|
130774
131166
|
}
|
|
130775
|
-
rules.set('Remove `type=["null"]` if `enum=[null]`', (
|
|
130776
|
-
if (Array.isArray(
|
|
130777
|
-
|
|
131167
|
+
rules.set('Remove `type=["null"]` if `enum=[null]`', (schema9) => {
|
|
131168
|
+
if (Array.isArray(schema9.enum) && schema9.enum.some((e8) => e8 === null) && Array.isArray(schema9.type) && schema9.type.includes("null")) {
|
|
131169
|
+
schema9.type = schema9.type.filter((type) => type !== "null");
|
|
130778
131170
|
}
|
|
130779
131171
|
});
|
|
130780
|
-
rules.set("Destructure unary types", (
|
|
130781
|
-
if (
|
|
130782
|
-
|
|
131172
|
+
rules.set("Destructure unary types", (schema9) => {
|
|
131173
|
+
if (schema9.type && Array.isArray(schema9.type) && schema9.type.length === 1) {
|
|
131174
|
+
schema9.type = schema9.type[0];
|
|
130783
131175
|
}
|
|
130784
131176
|
});
|
|
130785
|
-
rules.set("Add empty `required` property if none is defined", (
|
|
130786
|
-
if (isObjectType(
|
|
130787
|
-
|
|
131177
|
+
rules.set("Add empty `required` property if none is defined", (schema9) => {
|
|
131178
|
+
if (isObjectType(schema9) && !("required" in schema9)) {
|
|
131179
|
+
schema9.required = [];
|
|
130788
131180
|
}
|
|
130789
131181
|
});
|
|
130790
|
-
rules.set("Transform `required`=false to `required`=[]", (
|
|
130791
|
-
if (
|
|
130792
|
-
|
|
131182
|
+
rules.set("Transform `required`=false to `required`=[]", (schema9) => {
|
|
131183
|
+
if (schema9.required === false) {
|
|
131184
|
+
schema9.required = [];
|
|
130793
131185
|
}
|
|
130794
131186
|
});
|
|
130795
|
-
rules.set("Default additionalProperties", (
|
|
130796
|
-
if (isObjectType(
|
|
130797
|
-
|
|
131187
|
+
rules.set("Default additionalProperties", (schema9, _10, options8) => {
|
|
131188
|
+
if (isObjectType(schema9) && !("additionalProperties" in schema9) && schema9.patternProperties === undefined) {
|
|
131189
|
+
schema9.additionalProperties = options8.additionalProperties;
|
|
130798
131190
|
}
|
|
130799
131191
|
});
|
|
130800
|
-
rules.set("Transform id to $id", (
|
|
130801
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
131192
|
+
rules.set("Transform id to $id", (schema9, fileName) => {
|
|
131193
|
+
if (!(0, utils_1.isSchemaLike)(schema9)) {
|
|
130802
131194
|
return;
|
|
130803
131195
|
}
|
|
130804
|
-
if (
|
|
130805
|
-
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${
|
|
131196
|
+
if (schema9.id && schema9.$id && schema9.id !== schema9.$id) {
|
|
131197
|
+
throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema9.id}, $id=${schema9.$id} in ${fileName}`);
|
|
130806
131198
|
}
|
|
130807
|
-
if (
|
|
130808
|
-
|
|
130809
|
-
delete
|
|
131199
|
+
if (schema9.id) {
|
|
131200
|
+
schema9.$id = schema9.id;
|
|
131201
|
+
delete schema9.id;
|
|
130810
131202
|
}
|
|
130811
131203
|
});
|
|
130812
|
-
rules.set("Add an $id to anything that needs it", (
|
|
130813
|
-
if (!(0, utils_1.isSchemaLike)(
|
|
131204
|
+
rules.set("Add an $id to anything that needs it", (schema9, fileName, _options, _key, dereferencedPaths) => {
|
|
131205
|
+
if (!(0, utils_1.isSchemaLike)(schema9)) {
|
|
130814
131206
|
return;
|
|
130815
131207
|
}
|
|
130816
|
-
if (!
|
|
130817
|
-
|
|
131208
|
+
if (!schema9.$id && !schema9[JSONSchema_1.Parent]) {
|
|
131209
|
+
schema9.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
|
|
130818
131210
|
return;
|
|
130819
131211
|
}
|
|
130820
|
-
if (!isArrayType(
|
|
131212
|
+
if (!isArrayType(schema9) && !isObjectType(schema9)) {
|
|
130821
131213
|
return;
|
|
130822
131214
|
}
|
|
130823
|
-
const dereferencedName = dereferencedPaths.get(
|
|
130824
|
-
if (!
|
|
130825
|
-
|
|
131215
|
+
const dereferencedName = dereferencedPaths.get(schema9);
|
|
131216
|
+
if (!schema9.$id && !schema9.title && dereferencedName) {
|
|
131217
|
+
schema9.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
|
|
130826
131218
|
}
|
|
130827
131219
|
if (dereferencedName) {
|
|
130828
|
-
dereferencedPaths.delete(
|
|
131220
|
+
dereferencedPaths.delete(schema9);
|
|
130829
131221
|
}
|
|
130830
131222
|
});
|
|
130831
|
-
rules.set("Escape closing JSDoc comment", (
|
|
130832
|
-
(0, utils_1.escapeBlockComment)(
|
|
131223
|
+
rules.set("Escape closing JSDoc comment", (schema9) => {
|
|
131224
|
+
(0, utils_1.escapeBlockComment)(schema9);
|
|
130833
131225
|
});
|
|
130834
|
-
rules.set("Add JSDoc comments for minItems and maxItems", (
|
|
130835
|
-
if (!isArrayType(
|
|
131226
|
+
rules.set("Add JSDoc comments for minItems and maxItems", (schema9) => {
|
|
131227
|
+
if (!isArrayType(schema9)) {
|
|
130836
131228
|
return;
|
|
130837
131229
|
}
|
|
130838
131230
|
const commentsToAppend = [
|
|
130839
|
-
"minItems" in
|
|
130840
|
-
"maxItems" in
|
|
131231
|
+
"minItems" in schema9 ? `@minItems ${schema9.minItems}` : "",
|
|
131232
|
+
"maxItems" in schema9 ? `@maxItems ${schema9.maxItems}` : ""
|
|
130841
131233
|
].filter(Boolean);
|
|
130842
131234
|
if (commentsToAppend.length) {
|
|
130843
|
-
|
|
131235
|
+
schema9.description = (0, utils_1.appendToDescription)(schema9.description, ...commentsToAppend);
|
|
130844
131236
|
}
|
|
130845
131237
|
});
|
|
130846
|
-
rules.set("Optionally remove maxItems and minItems", (
|
|
130847
|
-
if (!isArrayType(
|
|
131238
|
+
rules.set("Optionally remove maxItems and minItems", (schema9, _fileName, options8) => {
|
|
131239
|
+
if (!isArrayType(schema9)) {
|
|
130848
131240
|
return;
|
|
130849
131241
|
}
|
|
130850
|
-
if ("minItems" in
|
|
130851
|
-
delete
|
|
131242
|
+
if ("minItems" in schema9 && options8.ignoreMinAndMaxItems) {
|
|
131243
|
+
delete schema9.minItems;
|
|
130852
131244
|
}
|
|
130853
|
-
if ("maxItems" in
|
|
130854
|
-
delete
|
|
131245
|
+
if ("maxItems" in schema9 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
|
|
131246
|
+
delete schema9.maxItems;
|
|
130855
131247
|
}
|
|
130856
131248
|
});
|
|
130857
|
-
rules.set("Normalize schema.minItems", (
|
|
131249
|
+
rules.set("Normalize schema.minItems", (schema9, _fileName, options8) => {
|
|
130858
131250
|
if (options8.ignoreMinAndMaxItems) {
|
|
130859
131251
|
return;
|
|
130860
131252
|
}
|
|
130861
|
-
if (!isArrayType(
|
|
131253
|
+
if (!isArrayType(schema9)) {
|
|
130862
131254
|
return;
|
|
130863
131255
|
}
|
|
130864
|
-
const { minItems } =
|
|
130865
|
-
|
|
131256
|
+
const { minItems } = schema9;
|
|
131257
|
+
schema9.minItems = typeof minItems === "number" ? minItems : 0;
|
|
130866
131258
|
});
|
|
130867
|
-
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (
|
|
131259
|
+
rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema9, _fileName, options8) => {
|
|
130868
131260
|
if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
|
|
130869
131261
|
return;
|
|
130870
131262
|
}
|
|
130871
|
-
if (!isArrayType(
|
|
131263
|
+
if (!isArrayType(schema9)) {
|
|
130872
131264
|
return;
|
|
130873
131265
|
}
|
|
130874
|
-
const { maxItems, minItems } =
|
|
131266
|
+
const { maxItems, minItems } = schema9;
|
|
130875
131267
|
if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
|
|
130876
|
-
delete
|
|
131268
|
+
delete schema9.maxItems;
|
|
130877
131269
|
}
|
|
130878
131270
|
});
|
|
130879
|
-
rules.set("Normalize schema.items", (
|
|
131271
|
+
rules.set("Normalize schema.items", (schema9, _fileName, options8) => {
|
|
130880
131272
|
if (options8.ignoreMinAndMaxItems) {
|
|
130881
131273
|
return;
|
|
130882
131274
|
}
|
|
130883
|
-
const { maxItems, minItems } =
|
|
131275
|
+
const { maxItems, minItems } = schema9;
|
|
130884
131276
|
const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
|
|
130885
131277
|
const hasMinItems = typeof minItems === "number" && minItems > 0;
|
|
130886
|
-
if (
|
|
130887
|
-
const items =
|
|
131278
|
+
if (schema9.items && !Array.isArray(schema9.items) && (hasMaxItems || hasMinItems)) {
|
|
131279
|
+
const items = schema9.items;
|
|
130888
131280
|
const newItems = Array(maxItems || minItems || 0).fill(items);
|
|
130889
131281
|
if (!hasMaxItems) {
|
|
130890
|
-
|
|
131282
|
+
schema9.additionalItems = items;
|
|
130891
131283
|
}
|
|
130892
|
-
|
|
131284
|
+
schema9.items = newItems;
|
|
130893
131285
|
}
|
|
130894
|
-
if (Array.isArray(
|
|
130895
|
-
|
|
131286
|
+
if (Array.isArray(schema9.items) && hasMaxItems && maxItems < schema9.items.length) {
|
|
131287
|
+
schema9.items = schema9.items.slice(0, maxItems);
|
|
130896
131288
|
}
|
|
130897
|
-
return
|
|
131289
|
+
return schema9;
|
|
130898
131290
|
});
|
|
130899
|
-
rules.set("Remove extends, if it is empty", (
|
|
130900
|
-
if (!
|
|
131291
|
+
rules.set("Remove extends, if it is empty", (schema9) => {
|
|
131292
|
+
if (!schema9.hasOwnProperty("extends")) {
|
|
130901
131293
|
return;
|
|
130902
131294
|
}
|
|
130903
|
-
if (
|
|
130904
|
-
delete
|
|
131295
|
+
if (schema9.extends == null || Array.isArray(schema9.extends) && schema9.extends.length === 0) {
|
|
131296
|
+
delete schema9.extends;
|
|
130905
131297
|
}
|
|
130906
131298
|
});
|
|
130907
|
-
rules.set("Make extends always an array, if it is defined", (
|
|
130908
|
-
if (
|
|
131299
|
+
rules.set("Make extends always an array, if it is defined", (schema9) => {
|
|
131300
|
+
if (schema9.extends == null) {
|
|
130909
131301
|
return;
|
|
130910
131302
|
}
|
|
130911
|
-
if (!Array.isArray(
|
|
130912
|
-
|
|
131303
|
+
if (!Array.isArray(schema9.extends)) {
|
|
131304
|
+
schema9.extends = [schema9.extends];
|
|
130913
131305
|
}
|
|
130914
131306
|
});
|
|
130915
|
-
rules.set("Transform definitions to $defs", (
|
|
130916
|
-
if (
|
|
130917
|
-
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${
|
|
131307
|
+
rules.set("Transform definitions to $defs", (schema9, fileName) => {
|
|
131308
|
+
if (schema9.definitions && schema9.$defs && !(0, util_1.isDeepStrictEqual)(schema9.definitions, schema9.$defs)) {
|
|
131309
|
+
throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema9.id} in ${fileName}`);
|
|
130918
131310
|
}
|
|
130919
|
-
if (
|
|
130920
|
-
|
|
130921
|
-
delete
|
|
131311
|
+
if (schema9.definitions) {
|
|
131312
|
+
schema9.$defs = schema9.definitions;
|
|
131313
|
+
delete schema9.definitions;
|
|
130922
131314
|
}
|
|
130923
131315
|
});
|
|
130924
|
-
rules.set("Transform const to singleton enum", (
|
|
130925
|
-
if (
|
|
130926
|
-
|
|
130927
|
-
delete
|
|
131316
|
+
rules.set("Transform const to singleton enum", (schema9) => {
|
|
131317
|
+
if (schema9.const !== undefined) {
|
|
131318
|
+
schema9.enum = [schema9.const];
|
|
131319
|
+
delete schema9.const;
|
|
130928
131320
|
}
|
|
130929
131321
|
});
|
|
130930
|
-
rules.set("Add tsEnumNames to enum types", (
|
|
131322
|
+
rules.set("Add tsEnumNames to enum types", (schema9, _10, options8) => {
|
|
130931
131323
|
var _a7;
|
|
130932
|
-
if (isEnumTypeWithoutTsEnumNames(
|
|
130933
|
-
|
|
131324
|
+
if (isEnumTypeWithoutTsEnumNames(schema9) && options8.inferStringEnumKeysFromValues) {
|
|
131325
|
+
schema9.tsEnumNames = (_a7 = schema9.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
|
|
130934
131326
|
}
|
|
130935
131327
|
});
|
|
130936
|
-
rules.set("Pre-calculate schema types and intersections", (
|
|
130937
|
-
if (
|
|
130938
|
-
(0, applySchemaTyping_1.applySchemaTyping)(
|
|
131328
|
+
rules.set("Pre-calculate schema types and intersections", (schema9) => {
|
|
131329
|
+
if (schema9 !== null && typeof schema9 === "object") {
|
|
131330
|
+
(0, applySchemaTyping_1.applySchemaTyping)(schema9);
|
|
130939
131331
|
}
|
|
130940
131332
|
});
|
|
130941
131333
|
function normalize(rootSchema, dereferencedPaths, filename, options8) {
|
|
130942
|
-
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (
|
|
131334
|
+
rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema9, key2) => rule(schema9, filename, options8, key2, dereferencedPaths)));
|
|
130943
131335
|
return rootSchema;
|
|
130944
131336
|
}
|
|
130945
131337
|
exports.normalize = normalize;
|
|
@@ -131021,37 +131413,37 @@ var require_parser = __commonJS((exports) => {
|
|
|
131021
131413
|
var AST_1 = require_AST();
|
|
131022
131414
|
var JSONSchema_1 = require_JSONSchema();
|
|
131023
131415
|
var utils_1 = require_utils7();
|
|
131024
|
-
function
|
|
131025
|
-
if ((0, JSONSchema_1.isPrimitive)(
|
|
131026
|
-
if ((0, JSONSchema_1.isBoolean)(
|
|
131027
|
-
return parseBooleanSchema(
|
|
131416
|
+
function parse11(schema9, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
131417
|
+
if ((0, JSONSchema_1.isPrimitive)(schema9)) {
|
|
131418
|
+
if ((0, JSONSchema_1.isBoolean)(schema9)) {
|
|
131419
|
+
return parseBooleanSchema(schema9, keyName, options8);
|
|
131028
131420
|
}
|
|
131029
|
-
return parseLiteral(
|
|
131421
|
+
return parseLiteral(schema9, keyName);
|
|
131030
131422
|
}
|
|
131031
|
-
const intersection2 =
|
|
131032
|
-
const types =
|
|
131423
|
+
const intersection2 = schema9[JSONSchema_1.Intersection];
|
|
131424
|
+
const types = schema9[JSONSchema_1.Types];
|
|
131033
131425
|
if (intersection2) {
|
|
131034
131426
|
const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
|
|
131035
131427
|
types.forEach((type) => {
|
|
131036
|
-
ast.params.push(parseAsTypeWithCache(
|
|
131428
|
+
ast.params.push(parseAsTypeWithCache(schema9, type, options8, keyName, processed, usedNames));
|
|
131037
131429
|
});
|
|
131038
|
-
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:",
|
|
131430
|
+
(0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema9, "Output:", ast);
|
|
131039
131431
|
return ast;
|
|
131040
131432
|
}
|
|
131041
131433
|
if (types.size === 1) {
|
|
131042
131434
|
const type = [...types][0];
|
|
131043
|
-
const ast = parseAsTypeWithCache(
|
|
131044
|
-
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:",
|
|
131435
|
+
const ast = parseAsTypeWithCache(schema9, type, options8, keyName, processed, usedNames);
|
|
131436
|
+
(0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema9, "Output:", ast);
|
|
131045
131437
|
return ast;
|
|
131046
131438
|
}
|
|
131047
131439
|
throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
|
|
131048
131440
|
}
|
|
131049
|
-
exports.parse =
|
|
131050
|
-
function parseAsTypeWithCache(
|
|
131051
|
-
let cachedTypeMap = processed.get(
|
|
131441
|
+
exports.parse = parse11;
|
|
131442
|
+
function parseAsTypeWithCache(schema9, type, options8, keyName, processed = new Map, usedNames = new Set) {
|
|
131443
|
+
let cachedTypeMap = processed.get(schema9);
|
|
131052
131444
|
if (!cachedTypeMap) {
|
|
131053
131445
|
cachedTypeMap = new Map;
|
|
131054
|
-
processed.set(
|
|
131446
|
+
processed.set(schema9, cachedTypeMap);
|
|
131055
131447
|
}
|
|
131056
131448
|
const cachedAST = cachedTypeMap.get(type);
|
|
131057
131449
|
if (cachedAST) {
|
|
@@ -131059,10 +131451,10 @@ var require_parser = __commonJS((exports) => {
|
|
|
131059
131451
|
}
|
|
131060
131452
|
const ast = {};
|
|
131061
131453
|
cachedTypeMap.set(type, ast);
|
|
131062
|
-
return Object.assign(ast, parseNonLiteral(
|
|
131454
|
+
return Object.assign(ast, parseNonLiteral(schema9, type, options8, keyName, processed, usedNames));
|
|
131063
131455
|
}
|
|
131064
|
-
function parseBooleanSchema(
|
|
131065
|
-
if (
|
|
131456
|
+
function parseBooleanSchema(schema9, keyName, options8) {
|
|
131457
|
+
if (schema9) {
|
|
131066
131458
|
return {
|
|
131067
131459
|
keyName,
|
|
131068
131460
|
type: options8.unknownAny ? "UNKNOWN" : "ANY"
|
|
@@ -131073,240 +131465,240 @@ var require_parser = __commonJS((exports) => {
|
|
|
131073
131465
|
type: "NEVER"
|
|
131074
131466
|
};
|
|
131075
131467
|
}
|
|
131076
|
-
function parseLiteral(
|
|
131468
|
+
function parseLiteral(schema9, keyName) {
|
|
131077
131469
|
return {
|
|
131078
131470
|
keyName,
|
|
131079
|
-
params:
|
|
131471
|
+
params: schema9,
|
|
131080
131472
|
type: "LITERAL"
|
|
131081
131473
|
};
|
|
131082
131474
|
}
|
|
131083
|
-
function parseNonLiteral(
|
|
131084
|
-
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(
|
|
131085
|
-
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 ===
|
|
131475
|
+
function parseNonLiteral(schema9, type, options8, keyName, processed, usedNames) {
|
|
131476
|
+
const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema9));
|
|
131477
|
+
const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema9);
|
|
131086
131478
|
switch (type) {
|
|
131087
131479
|
case "ALL_OF":
|
|
131088
131480
|
return {
|
|
131089
|
-
comment:
|
|
131090
|
-
deprecated:
|
|
131481
|
+
comment: schema9.description,
|
|
131482
|
+
deprecated: schema9.deprecated,
|
|
131091
131483
|
keyName,
|
|
131092
|
-
standaloneName: standaloneName(
|
|
131093
|
-
params:
|
|
131484
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131485
|
+
params: schema9.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
131094
131486
|
type: "INTERSECTION"
|
|
131095
131487
|
};
|
|
131096
131488
|
case "ANY":
|
|
131097
|
-
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment:
|
|
131489
|
+
return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema9.description, deprecated: schema9.deprecated, keyName, standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8) });
|
|
131098
131490
|
case "ANY_OF":
|
|
131099
131491
|
return {
|
|
131100
|
-
comment:
|
|
131101
|
-
deprecated:
|
|
131492
|
+
comment: schema9.description,
|
|
131493
|
+
deprecated: schema9.deprecated,
|
|
131102
131494
|
keyName,
|
|
131103
|
-
standaloneName: standaloneName(
|
|
131104
|
-
params:
|
|
131495
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131496
|
+
params: schema9.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
131105
131497
|
type: "UNION"
|
|
131106
131498
|
};
|
|
131107
131499
|
case "BOOLEAN":
|
|
131108
131500
|
return {
|
|
131109
|
-
comment:
|
|
131110
|
-
deprecated:
|
|
131501
|
+
comment: schema9.description,
|
|
131502
|
+
deprecated: schema9.deprecated,
|
|
131111
131503
|
keyName,
|
|
131112
|
-
standaloneName: standaloneName(
|
|
131504
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131113
131505
|
type: "BOOLEAN"
|
|
131114
131506
|
};
|
|
131115
131507
|
case "CUSTOM_TYPE":
|
|
131116
131508
|
return {
|
|
131117
|
-
comment:
|
|
131118
|
-
deprecated:
|
|
131509
|
+
comment: schema9.description,
|
|
131510
|
+
deprecated: schema9.deprecated,
|
|
131119
131511
|
keyName,
|
|
131120
|
-
params:
|
|
131121
|
-
standaloneName: standaloneName(
|
|
131512
|
+
params: schema9.tsType,
|
|
131513
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131122
131514
|
type: "CUSTOM_TYPE"
|
|
131123
131515
|
};
|
|
131124
131516
|
case "NAMED_ENUM":
|
|
131125
131517
|
return {
|
|
131126
|
-
comment:
|
|
131127
|
-
deprecated:
|
|
131518
|
+
comment: schema9.description,
|
|
131519
|
+
deprecated: schema9.deprecated,
|
|
131128
131520
|
keyName,
|
|
131129
|
-
standaloneName: standaloneName(
|
|
131130
|
-
params:
|
|
131521
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
|
|
131522
|
+
params: schema9.enum.map((_10, n5) => ({
|
|
131131
131523
|
ast: parseLiteral(_10, undefined),
|
|
131132
|
-
keyName:
|
|
131524
|
+
keyName: schema9.tsEnumNames[n5]
|
|
131133
131525
|
})),
|
|
131134
131526
|
type: "ENUM"
|
|
131135
131527
|
};
|
|
131136
131528
|
case "NAMED_SCHEMA":
|
|
131137
|
-
return newInterface(
|
|
131529
|
+
return newInterface(schema9, options8, processed, usedNames, keyName);
|
|
131138
131530
|
case "NEVER":
|
|
131139
131531
|
return {
|
|
131140
|
-
comment:
|
|
131141
|
-
deprecated:
|
|
131532
|
+
comment: schema9.description,
|
|
131533
|
+
deprecated: schema9.deprecated,
|
|
131142
131534
|
keyName,
|
|
131143
|
-
standaloneName: standaloneName(
|
|
131535
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131144
131536
|
type: "NEVER"
|
|
131145
131537
|
};
|
|
131146
131538
|
case "NULL":
|
|
131147
131539
|
return {
|
|
131148
|
-
comment:
|
|
131149
|
-
deprecated:
|
|
131540
|
+
comment: schema9.description,
|
|
131541
|
+
deprecated: schema9.deprecated,
|
|
131150
131542
|
keyName,
|
|
131151
|
-
standaloneName: standaloneName(
|
|
131543
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131152
131544
|
type: "NULL"
|
|
131153
131545
|
};
|
|
131154
131546
|
case "NUMBER":
|
|
131155
131547
|
return {
|
|
131156
|
-
comment:
|
|
131157
|
-
deprecated:
|
|
131548
|
+
comment: schema9.description,
|
|
131549
|
+
deprecated: schema9.deprecated,
|
|
131158
131550
|
keyName,
|
|
131159
|
-
standaloneName: standaloneName(
|
|
131551
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131160
131552
|
type: "NUMBER"
|
|
131161
131553
|
};
|
|
131162
131554
|
case "OBJECT":
|
|
131163
131555
|
return {
|
|
131164
|
-
comment:
|
|
131556
|
+
comment: schema9.description,
|
|
131165
131557
|
keyName,
|
|
131166
|
-
standaloneName: standaloneName(
|
|
131558
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131167
131559
|
type: "OBJECT",
|
|
131168
|
-
deprecated:
|
|
131560
|
+
deprecated: schema9.deprecated
|
|
131169
131561
|
};
|
|
131170
131562
|
case "ONE_OF":
|
|
131171
131563
|
return {
|
|
131172
|
-
comment:
|
|
131173
|
-
deprecated:
|
|
131564
|
+
comment: schema9.description,
|
|
131565
|
+
deprecated: schema9.deprecated,
|
|
131174
131566
|
keyName,
|
|
131175
|
-
standaloneName: standaloneName(
|
|
131176
|
-
params:
|
|
131567
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131568
|
+
params: schema9.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
131177
131569
|
type: "UNION"
|
|
131178
131570
|
};
|
|
131179
131571
|
case "REFERENCE":
|
|
131180
|
-
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!",
|
|
131572
|
+
throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema9));
|
|
131181
131573
|
case "STRING":
|
|
131182
131574
|
return {
|
|
131183
|
-
comment:
|
|
131184
|
-
deprecated:
|
|
131575
|
+
comment: schema9.description,
|
|
131576
|
+
deprecated: schema9.deprecated,
|
|
131185
131577
|
keyName,
|
|
131186
|
-
standaloneName: standaloneName(
|
|
131578
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131187
131579
|
type: "STRING"
|
|
131188
131580
|
};
|
|
131189
131581
|
case "TYPED_ARRAY":
|
|
131190
|
-
if (Array.isArray(
|
|
131191
|
-
const minItems2 =
|
|
131192
|
-
const maxItems2 =
|
|
131582
|
+
if (Array.isArray(schema9.items)) {
|
|
131583
|
+
const minItems2 = schema9.minItems;
|
|
131584
|
+
const maxItems2 = schema9.maxItems;
|
|
131193
131585
|
const arrayType = {
|
|
131194
|
-
comment:
|
|
131195
|
-
deprecated:
|
|
131586
|
+
comment: schema9.description,
|
|
131587
|
+
deprecated: schema9.deprecated,
|
|
131196
131588
|
keyName,
|
|
131197
131589
|
maxItems: maxItems2,
|
|
131198
131590
|
minItems: minItems2,
|
|
131199
|
-
standaloneName: standaloneName(
|
|
131200
|
-
params:
|
|
131591
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131592
|
+
params: schema9.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
|
|
131201
131593
|
type: "TUPLE"
|
|
131202
131594
|
};
|
|
131203
|
-
if (
|
|
131595
|
+
if (schema9.additionalItems === true) {
|
|
131204
131596
|
arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
131205
|
-
} else if (
|
|
131206
|
-
arrayType.spreadParam =
|
|
131597
|
+
} else if (schema9.additionalItems) {
|
|
131598
|
+
arrayType.spreadParam = parse11(schema9.additionalItems, options8, undefined, processed, usedNames);
|
|
131207
131599
|
}
|
|
131208
131600
|
return arrayType;
|
|
131209
131601
|
} else {
|
|
131210
131602
|
return {
|
|
131211
|
-
comment:
|
|
131212
|
-
deprecated:
|
|
131603
|
+
comment: schema9.description,
|
|
131604
|
+
deprecated: schema9.deprecated,
|
|
131213
131605
|
keyName,
|
|
131214
|
-
standaloneName: standaloneName(
|
|
131215
|
-
params:
|
|
131606
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131607
|
+
params: parse11(schema9.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
|
|
131216
131608
|
type: "ARRAY"
|
|
131217
131609
|
};
|
|
131218
131610
|
}
|
|
131219
131611
|
case "UNION":
|
|
131220
131612
|
return {
|
|
131221
|
-
comment:
|
|
131222
|
-
deprecated:
|
|
131613
|
+
comment: schema9.description,
|
|
131614
|
+
deprecated: schema9.deprecated,
|
|
131223
131615
|
keyName,
|
|
131224
|
-
standaloneName: standaloneName(
|
|
131225
|
-
params:
|
|
131226
|
-
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(
|
|
131616
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131617
|
+
params: schema9.type.map((type2) => {
|
|
131618
|
+
const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema9, "$id", "description", "title")), { type: type2 });
|
|
131227
131619
|
(0, utils_1.maybeStripDefault)(member);
|
|
131228
131620
|
(0, applySchemaTyping_1.applySchemaTyping)(member);
|
|
131229
|
-
return
|
|
131621
|
+
return parse11(member, options8, undefined, processed, usedNames);
|
|
131230
131622
|
}),
|
|
131231
131623
|
type: "UNION"
|
|
131232
131624
|
};
|
|
131233
131625
|
case "UNNAMED_ENUM":
|
|
131234
131626
|
return {
|
|
131235
|
-
comment:
|
|
131236
|
-
deprecated:
|
|
131627
|
+
comment: schema9.description,
|
|
131628
|
+
deprecated: schema9.deprecated,
|
|
131237
131629
|
keyName,
|
|
131238
|
-
standaloneName: standaloneName(
|
|
131239
|
-
params:
|
|
131630
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131631
|
+
params: schema9.enum.map((_10) => parseLiteral(_10, undefined)),
|
|
131240
131632
|
type: "UNION"
|
|
131241
131633
|
};
|
|
131242
131634
|
case "UNNAMED_SCHEMA":
|
|
131243
|
-
return newInterface(
|
|
131635
|
+
return newInterface(schema9, options8, processed, usedNames, keyName, keyNameFromDefinition);
|
|
131244
131636
|
case "UNTYPED_ARRAY":
|
|
131245
|
-
const minItems =
|
|
131246
|
-
const maxItems = typeof
|
|
131637
|
+
const minItems = schema9.minItems;
|
|
131638
|
+
const maxItems = typeof schema9.maxItems === "number" ? schema9.maxItems : -1;
|
|
131247
131639
|
const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
|
|
131248
131640
|
if (minItems > 0 || maxItems >= 0) {
|
|
131249
131641
|
return {
|
|
131250
|
-
comment:
|
|
131251
|
-
deprecated:
|
|
131642
|
+
comment: schema9.description,
|
|
131643
|
+
deprecated: schema9.deprecated,
|
|
131252
131644
|
keyName,
|
|
131253
|
-
maxItems:
|
|
131645
|
+
maxItems: schema9.maxItems,
|
|
131254
131646
|
minItems,
|
|
131255
131647
|
params: Array(Math.max(maxItems, minItems) || 0).fill(params),
|
|
131256
131648
|
spreadParam: maxItems >= 0 ? undefined : params,
|
|
131257
|
-
standaloneName: standaloneName(
|
|
131649
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131258
131650
|
type: "TUPLE"
|
|
131259
131651
|
};
|
|
131260
131652
|
}
|
|
131261
131653
|
return {
|
|
131262
|
-
comment:
|
|
131263
|
-
deprecated:
|
|
131654
|
+
comment: schema9.description,
|
|
131655
|
+
deprecated: schema9.deprecated,
|
|
131264
131656
|
keyName,
|
|
131265
131657
|
params,
|
|
131266
|
-
standaloneName: standaloneName(
|
|
131658
|
+
standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
|
|
131267
131659
|
type: "ARRAY"
|
|
131268
131660
|
};
|
|
131269
131661
|
}
|
|
131270
131662
|
}
|
|
131271
|
-
function standaloneName(
|
|
131663
|
+
function standaloneName(schema9, keyNameFromDefinition, usedNames, options8) {
|
|
131272
131664
|
var _a7;
|
|
131273
|
-
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8,
|
|
131665
|
+
const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema9, keyNameFromDefinition)) || schema9.title || schema9.$id || keyNameFromDefinition;
|
|
131274
131666
|
if (name2) {
|
|
131275
131667
|
return (0, utils_1.generateName)(name2, usedNames);
|
|
131276
131668
|
}
|
|
131277
131669
|
}
|
|
131278
|
-
function newInterface(
|
|
131279
|
-
const name2 = standaloneName(
|
|
131670
|
+
function newInterface(schema9, options8, processed, usedNames, keyName, keyNameFromDefinition) {
|
|
131671
|
+
const name2 = standaloneName(schema9, keyNameFromDefinition, usedNames, options8);
|
|
131280
131672
|
return {
|
|
131281
|
-
comment:
|
|
131282
|
-
deprecated:
|
|
131673
|
+
comment: schema9.description,
|
|
131674
|
+
deprecated: schema9.deprecated,
|
|
131283
131675
|
keyName,
|
|
131284
|
-
params: parseSchema(
|
|
131676
|
+
params: parseSchema(schema9, options8, processed, usedNames, name2),
|
|
131285
131677
|
standaloneName: name2,
|
|
131286
|
-
superTypes: parseSuperTypes(
|
|
131678
|
+
superTypes: parseSuperTypes(schema9, options8, processed, usedNames),
|
|
131287
131679
|
type: "INTERFACE"
|
|
131288
131680
|
};
|
|
131289
131681
|
}
|
|
131290
|
-
function parseSuperTypes(
|
|
131291
|
-
const superTypes =
|
|
131682
|
+
function parseSuperTypes(schema9, options8, processed, usedNames) {
|
|
131683
|
+
const superTypes = schema9.extends;
|
|
131292
131684
|
if (!superTypes) {
|
|
131293
131685
|
return [];
|
|
131294
131686
|
}
|
|
131295
|
-
return superTypes.map((_10) =>
|
|
131687
|
+
return superTypes.map((_10) => parse11(_10, options8, undefined, processed, usedNames));
|
|
131296
131688
|
}
|
|
131297
|
-
function parseSchema(
|
|
131298
|
-
let asts = (0, lodash_1.map)(
|
|
131299
|
-
ast:
|
|
131689
|
+
function parseSchema(schema9, options8, processed, usedNames, parentSchemaName) {
|
|
131690
|
+
let asts = (0, lodash_1.map)(schema9.properties, (value, key2) => ({
|
|
131691
|
+
ast: parse11(value, options8, key2, processed, usedNames),
|
|
131300
131692
|
isPatternProperty: false,
|
|
131301
|
-
isRequired: (0, lodash_1.includes)(
|
|
131693
|
+
isRequired: (0, lodash_1.includes)(schema9.required || [], key2),
|
|
131302
131694
|
isUnreachableDefinition: false,
|
|
131303
131695
|
keyName: key2
|
|
131304
131696
|
}));
|
|
131305
131697
|
let singlePatternProperty = false;
|
|
131306
|
-
if (
|
|
131307
|
-
singlePatternProperty = !
|
|
131308
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
131309
|
-
const ast =
|
|
131698
|
+
if (schema9.patternProperties) {
|
|
131699
|
+
singlePatternProperty = !schema9.additionalProperties && Object.keys(schema9.patternProperties).length === 1;
|
|
131700
|
+
asts = asts.concat((0, lodash_1.map)(schema9.patternProperties, (value, key2) => {
|
|
131701
|
+
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
131310
131702
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
|
|
131311
131703
|
via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
|
|
131312
131704
|
ast.comment = ast.comment ? `${ast.comment}
|
|
@@ -131315,15 +131707,15 @@ ${comment}` : comment;
|
|
|
131315
131707
|
return {
|
|
131316
131708
|
ast,
|
|
131317
131709
|
isPatternProperty: !singlePatternProperty,
|
|
131318
|
-
isRequired: singlePatternProperty || (0, lodash_1.includes)(
|
|
131710
|
+
isRequired: singlePatternProperty || (0, lodash_1.includes)(schema9.required || [], key2),
|
|
131319
131711
|
isUnreachableDefinition: false,
|
|
131320
131712
|
keyName: singlePatternProperty ? "[k: string]" : key2
|
|
131321
131713
|
};
|
|
131322
131714
|
}));
|
|
131323
131715
|
}
|
|
131324
131716
|
if (options8.unreachableDefinitions) {
|
|
131325
|
-
asts = asts.concat((0, lodash_1.map)(
|
|
131326
|
-
const ast =
|
|
131717
|
+
asts = asts.concat((0, lodash_1.map)(schema9.$defs, (value, key2) => {
|
|
131718
|
+
const ast = parse11(value, options8, key2, processed, usedNames);
|
|
131327
131719
|
const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
|
|
131328
131720
|
via the \`definition\` "${key2}".`;
|
|
131329
131721
|
ast.comment = ast.comment ? `${ast.comment}
|
|
@@ -131332,13 +131724,13 @@ ${comment}` : comment;
|
|
|
131332
131724
|
return {
|
|
131333
131725
|
ast,
|
|
131334
131726
|
isPatternProperty: false,
|
|
131335
|
-
isRequired: (0, lodash_1.includes)(
|
|
131727
|
+
isRequired: (0, lodash_1.includes)(schema9.required || [], key2),
|
|
131336
131728
|
isUnreachableDefinition: true,
|
|
131337
131729
|
keyName: key2
|
|
131338
131730
|
};
|
|
131339
131731
|
}));
|
|
131340
131732
|
}
|
|
131341
|
-
switch (
|
|
131733
|
+
switch (schema9.additionalProperties) {
|
|
131342
131734
|
case undefined:
|
|
131343
131735
|
case true:
|
|
131344
131736
|
if (singlePatternProperty) {
|
|
@@ -131355,7 +131747,7 @@ ${comment}` : comment;
|
|
|
131355
131747
|
return asts;
|
|
131356
131748
|
default:
|
|
131357
131749
|
return asts.concat({
|
|
131358
|
-
ast:
|
|
131750
|
+
ast: parse11(schema9.additionalProperties, options8, "[k: string]", processed, usedNames),
|
|
131359
131751
|
isPatternProperty: false,
|
|
131360
131752
|
isRequired: true,
|
|
131361
131753
|
isUnreachableDefinition: false,
|
|
@@ -131363,22 +131755,22 @@ ${comment}` : comment;
|
|
|
131363
131755
|
});
|
|
131364
131756
|
}
|
|
131365
131757
|
}
|
|
131366
|
-
function getDefinitions(
|
|
131367
|
-
if (processed.has(
|
|
131758
|
+
function getDefinitions(schema9, isSchema = true, processed = new Set) {
|
|
131759
|
+
if (processed.has(schema9)) {
|
|
131368
131760
|
return {};
|
|
131369
131761
|
}
|
|
131370
|
-
processed.add(
|
|
131371
|
-
if (Array.isArray(
|
|
131372
|
-
return
|
|
131762
|
+
processed.add(schema9);
|
|
131763
|
+
if (Array.isArray(schema9)) {
|
|
131764
|
+
return schema9.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
|
|
131373
131765
|
}
|
|
131374
|
-
if ((0, lodash_1.isPlainObject)(
|
|
131375
|
-
return Object.assign(Object.assign({}, isSchema && hasDefinitions(
|
|
131766
|
+
if ((0, lodash_1.isPlainObject)(schema9)) {
|
|
131767
|
+
return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema9) ? schema9.$defs : {}), Object.keys(schema9).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema9[cur], false, processed)), {}));
|
|
131376
131768
|
}
|
|
131377
131769
|
return {};
|
|
131378
131770
|
}
|
|
131379
131771
|
var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
|
|
131380
|
-
function hasDefinitions(
|
|
131381
|
-
return "$defs" in
|
|
131772
|
+
function hasDefinitions(schema9) {
|
|
131773
|
+
return "$defs" in schema9;
|
|
131382
131774
|
}
|
|
131383
131775
|
});
|
|
131384
131776
|
|
|
@@ -131791,7 +132183,7 @@ var require_url = __commonJS((exports) => {
|
|
|
131791
132183
|
};
|
|
131792
132184
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
131793
132185
|
exports.parse = undefined;
|
|
131794
|
-
exports.resolve =
|
|
132186
|
+
exports.resolve = resolve6;
|
|
131795
132187
|
exports.cwd = cwd;
|
|
131796
132188
|
exports.getProtocol = getProtocol;
|
|
131797
132189
|
exports.getExtension = getExtension;
|
|
@@ -131817,9 +132209,9 @@ var require_url = __commonJS((exports) => {
|
|
|
131817
132209
|
[/#/g, "%23"]
|
|
131818
132210
|
];
|
|
131819
132211
|
var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
|
|
131820
|
-
var
|
|
131821
|
-
exports.parse =
|
|
131822
|
-
function
|
|
132212
|
+
var parse11 = (u4) => new URL(u4);
|
|
132213
|
+
exports.parse = parse11;
|
|
132214
|
+
function resolve6(from, to5) {
|
|
131823
132215
|
const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
|
|
131824
132216
|
const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
|
|
131825
132217
|
const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
|
|
@@ -131955,7 +132347,7 @@ var require_url = __commonJS((exports) => {
|
|
|
131955
132347
|
}
|
|
131956
132348
|
function relative2(from, to5) {
|
|
131957
132349
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
131958
|
-
return
|
|
132350
|
+
return resolve6(from, to5);
|
|
131959
132351
|
}
|
|
131960
132352
|
const fromDir = path_1.default.dirname(stripHash(from));
|
|
131961
132353
|
const toPath4 = stripHash(to5);
|
|
@@ -132631,7 +133023,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
132631
133023
|
let plugin;
|
|
132632
133024
|
let lastError;
|
|
132633
133025
|
let index = 0;
|
|
132634
|
-
return new Promise((
|
|
133026
|
+
return new Promise((resolve6, reject) => {
|
|
132635
133027
|
runNextPlugin();
|
|
132636
133028
|
function runNextPlugin() {
|
|
132637
133029
|
plugin = plugins[index++];
|
|
@@ -132659,7 +133051,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
132659
133051
|
}
|
|
132660
133052
|
}
|
|
132661
133053
|
function onSuccess(result) {
|
|
132662
|
-
|
|
133054
|
+
resolve6({
|
|
132663
133055
|
plugin,
|
|
132664
133056
|
result
|
|
132665
133057
|
});
|
|
@@ -132742,7 +133134,7 @@ var require_parse6 = __commonJS((exports) => {
|
|
|
132742
133134
|
var url3 = __importStar(require_url());
|
|
132743
133135
|
var plugins = __importStar(require_plugins());
|
|
132744
133136
|
var errors_js_1 = require_errors();
|
|
132745
|
-
async function
|
|
133137
|
+
async function parse11(path18, $refs, options8) {
|
|
132746
133138
|
const hashIndex = path18.indexOf("#");
|
|
132747
133139
|
let hash2 = "";
|
|
132748
133140
|
if (hashIndex >= 0) {
|
|
@@ -132818,7 +133210,7 @@ Parsed value is empty`);
|
|
|
132818
133210
|
function isEmpty(value) {
|
|
132819
133211
|
return value === undefined || typeof value === "object" && Object.keys(value).length === 0 || typeof value === "string" && value.trim().length === 0 || Buffer.isBuffer(value) && value.length === 0;
|
|
132820
133212
|
}
|
|
132821
|
-
exports.default =
|
|
133213
|
+
exports.default = parse11;
|
|
132822
133214
|
});
|
|
132823
133215
|
|
|
132824
133216
|
// node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js
|
|
@@ -133083,9 +133475,9 @@ var require_type3 = __commonJS((exports, module) => {
|
|
|
133083
133475
|
var require_schema3 = __commonJS((exports, module) => {
|
|
133084
133476
|
var YAMLException = require_exception3();
|
|
133085
133477
|
var Type = require_type3();
|
|
133086
|
-
function compileList(
|
|
133478
|
+
function compileList(schema9, name2) {
|
|
133087
133479
|
var result = [];
|
|
133088
|
-
|
|
133480
|
+
schema9[name2].forEach(function(currentType) {
|
|
133089
133481
|
var newIndex = result.length;
|
|
133090
133482
|
result.forEach(function(previousType, previousIndex) {
|
|
133091
133483
|
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
|
|
@@ -135030,7 +135422,7 @@ var require_dumper3 = __commonJS((exports, module) => {
|
|
|
135030
135422
|
"OFF"
|
|
135031
135423
|
];
|
|
135032
135424
|
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
|
|
135033
|
-
function compileStyleMap(
|
|
135425
|
+
function compileStyleMap(schema9, map2) {
|
|
135034
135426
|
var result, keys, index, length, tag, style, type;
|
|
135035
135427
|
if (map2 === null)
|
|
135036
135428
|
return {};
|
|
@@ -135042,7 +135434,7 @@ var require_dumper3 = __commonJS((exports, module) => {
|
|
|
135042
135434
|
if (tag.slice(0, 2) === "!!") {
|
|
135043
135435
|
tag = "tag:yaml.org,2002:" + tag.slice(2);
|
|
135044
135436
|
}
|
|
135045
|
-
type =
|
|
135437
|
+
type = schema9.compiledTypeMap["fallback"][tag];
|
|
135046
135438
|
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
|
135047
135439
|
style = type.styleAliases[style];
|
|
135048
135440
|
}
|
|
@@ -135977,7 +136369,7 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
135977
136369
|
var options_js_1 = require_options();
|
|
135978
136370
|
function normalizeArgs(_args) {
|
|
135979
136371
|
let path18;
|
|
135980
|
-
let
|
|
136372
|
+
let schema9;
|
|
135981
136373
|
let options8;
|
|
135982
136374
|
let callback;
|
|
135983
136375
|
const args = Array.prototype.slice.call(_args);
|
|
@@ -135987,15 +136379,15 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
135987
136379
|
if (typeof args[0] === "string") {
|
|
135988
136380
|
path18 = args[0];
|
|
135989
136381
|
if (typeof args[2] === "object") {
|
|
135990
|
-
|
|
136382
|
+
schema9 = args[1];
|
|
135991
136383
|
options8 = args[2];
|
|
135992
136384
|
} else {
|
|
135993
|
-
|
|
136385
|
+
schema9 = undefined;
|
|
135994
136386
|
options8 = args[1];
|
|
135995
136387
|
}
|
|
135996
136388
|
} else {
|
|
135997
136389
|
path18 = "";
|
|
135998
|
-
|
|
136390
|
+
schema9 = args[0];
|
|
135999
136391
|
options8 = args[1];
|
|
136000
136392
|
}
|
|
136001
136393
|
try {
|
|
@@ -136003,12 +136395,12 @@ var require_normalize_args = __commonJS((exports) => {
|
|
|
136003
136395
|
} catch (e8) {
|
|
136004
136396
|
console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
|
|
136005
136397
|
}
|
|
136006
|
-
if (!options8.mutateInputSchema && typeof
|
|
136007
|
-
|
|
136398
|
+
if (!options8.mutateInputSchema && typeof schema9 === "object") {
|
|
136399
|
+
schema9 = JSON.parse(JSON.stringify(schema9));
|
|
136008
136400
|
}
|
|
136009
136401
|
return {
|
|
136010
136402
|
path: path18,
|
|
136011
|
-
schema:
|
|
136403
|
+
schema: schema9,
|
|
136012
136404
|
options: options8,
|
|
136013
136405
|
callback
|
|
136014
136406
|
};
|
|
@@ -136767,11 +137159,11 @@ var require_lib3 = __commonJS((exports) => {
|
|
|
136767
137159
|
var require_resolver = __commonJS((exports) => {
|
|
136768
137160
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
136769
137161
|
function adopt(value) {
|
|
136770
|
-
return value instanceof P9 ? value : new P9(function(
|
|
136771
|
-
|
|
137162
|
+
return value instanceof P9 ? value : new P9(function(resolve6) {
|
|
137163
|
+
resolve6(value);
|
|
136772
137164
|
});
|
|
136773
137165
|
}
|
|
136774
|
-
return new (P9 || (P9 = Promise))(function(
|
|
137166
|
+
return new (P9 || (P9 = Promise))(function(resolve6, reject) {
|
|
136775
137167
|
function fulfilled(value) {
|
|
136776
137168
|
try {
|
|
136777
137169
|
step(generator.next(value));
|
|
@@ -136787,7 +137179,7 @@ var require_resolver = __commonJS((exports) => {
|
|
|
136787
137179
|
}
|
|
136788
137180
|
}
|
|
136789
137181
|
function step(result) {
|
|
136790
|
-
result.done ?
|
|
137182
|
+
result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
136791
137183
|
}
|
|
136792
137184
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
136793
137185
|
});
|
|
@@ -136797,12 +137189,12 @@ var require_resolver = __commonJS((exports) => {
|
|
|
136797
137189
|
var json_schema_ref_parser_1 = require_lib3();
|
|
136798
137190
|
var utils_1 = require_utils7();
|
|
136799
137191
|
function dereference(schema_1, _a7) {
|
|
136800
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
136801
|
-
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd,
|
|
137192
|
+
return __awaiter(this, arguments, undefined, function* (schema9, { cwd, $refOptions }) {
|
|
137193
|
+
(0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema9);
|
|
136802
137194
|
const parser = new json_schema_ref_parser_1.$RefParser;
|
|
136803
137195
|
const dereferencedPaths = new WeakMap;
|
|
136804
|
-
const dereferencedSchema = yield parser.dereference(cwd,
|
|
136805
|
-
dereferencedPaths.set(
|
|
137196
|
+
const dereferencedSchema = yield parser.dereference(cwd, schema9, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema10) {
|
|
137197
|
+
dereferencedPaths.set(schema10, $ref);
|
|
136806
137198
|
} }) }));
|
|
136807
137199
|
return { dereferencedPaths, dereferencedSchema };
|
|
136808
137200
|
});
|
|
@@ -136816,46 +137208,46 @@ var require_validator = __commonJS((exports) => {
|
|
|
136816
137208
|
exports.validate = undefined;
|
|
136817
137209
|
var utils_1 = require_utils7();
|
|
136818
137210
|
var rules = new Map;
|
|
136819
|
-
rules.set("Enum members and tsEnumNames must be of the same length", (
|
|
136820
|
-
if (
|
|
137211
|
+
rules.set("Enum members and tsEnumNames must be of the same length", (schema9) => {
|
|
137212
|
+
if (schema9.enum && schema9.tsEnumNames && schema9.enum.length !== schema9.tsEnumNames.length) {
|
|
136821
137213
|
return false;
|
|
136822
137214
|
}
|
|
136823
137215
|
});
|
|
136824
|
-
rules.set("tsEnumNames must be an array of strings", (
|
|
136825
|
-
if (
|
|
137216
|
+
rules.set("tsEnumNames must be an array of strings", (schema9) => {
|
|
137217
|
+
if (schema9.tsEnumNames && schema9.tsEnumNames.some((_10) => typeof _10 !== "string")) {
|
|
136826
137218
|
return false;
|
|
136827
137219
|
}
|
|
136828
137220
|
});
|
|
136829
|
-
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (
|
|
136830
|
-
const { maxItems, minItems } =
|
|
137221
|
+
rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema9) => {
|
|
137222
|
+
const { maxItems, minItems } = schema9;
|
|
136831
137223
|
if (typeof maxItems === "number" && typeof minItems === "number") {
|
|
136832
137224
|
return maxItems >= minItems;
|
|
136833
137225
|
}
|
|
136834
137226
|
});
|
|
136835
|
-
rules.set("When maxItems exists, maxItems >= 0", (
|
|
136836
|
-
const { maxItems } =
|
|
137227
|
+
rules.set("When maxItems exists, maxItems >= 0", (schema9) => {
|
|
137228
|
+
const { maxItems } = schema9;
|
|
136837
137229
|
if (typeof maxItems === "number") {
|
|
136838
137230
|
return maxItems >= 0;
|
|
136839
137231
|
}
|
|
136840
137232
|
});
|
|
136841
|
-
rules.set("When minItems exists, minItems >= 0", (
|
|
136842
|
-
const { minItems } =
|
|
137233
|
+
rules.set("When minItems exists, minItems >= 0", (schema9) => {
|
|
137234
|
+
const { minItems } = schema9;
|
|
136843
137235
|
if (typeof minItems === "number") {
|
|
136844
137236
|
return minItems >= 0;
|
|
136845
137237
|
}
|
|
136846
137238
|
});
|
|
136847
|
-
rules.set("deprecated must be a boolean", (
|
|
136848
|
-
const typeOfDeprecated = typeof
|
|
137239
|
+
rules.set("deprecated must be a boolean", (schema9) => {
|
|
137240
|
+
const typeOfDeprecated = typeof schema9.deprecated;
|
|
136849
137241
|
return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
|
|
136850
137242
|
});
|
|
136851
|
-
function validate2(
|
|
137243
|
+
function validate2(schema9, filename) {
|
|
136852
137244
|
const errors4 = [];
|
|
136853
137245
|
rules.forEach((rule, ruleName) => {
|
|
136854
|
-
(0, utils_1.traverse)(
|
|
136855
|
-
if (rule(
|
|
137246
|
+
(0, utils_1.traverse)(schema9, (schema10, key2) => {
|
|
137247
|
+
if (rule(schema10) === false) {
|
|
136856
137248
|
errors4.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
|
|
136857
137249
|
}
|
|
136858
|
-
return
|
|
137250
|
+
return schema10;
|
|
136859
137251
|
});
|
|
136860
137252
|
});
|
|
136861
137253
|
return errors4;
|
|
@@ -136869,25 +137261,25 @@ var require_linker = __commonJS((exports) => {
|
|
|
136869
137261
|
exports.link = undefined;
|
|
136870
137262
|
var JSONSchema_1 = require_JSONSchema();
|
|
136871
137263
|
var lodash_1 = require_lodash2();
|
|
136872
|
-
function link2(
|
|
136873
|
-
if (!Array.isArray(
|
|
136874
|
-
return
|
|
137264
|
+
function link2(schema9, parent = null) {
|
|
137265
|
+
if (!Array.isArray(schema9) && !(0, lodash_1.isPlainObject)(schema9)) {
|
|
137266
|
+
return schema9;
|
|
136875
137267
|
}
|
|
136876
|
-
if (
|
|
136877
|
-
return
|
|
137268
|
+
if (schema9.hasOwnProperty(JSONSchema_1.Parent)) {
|
|
137269
|
+
return schema9;
|
|
136878
137270
|
}
|
|
136879
|
-
Object.defineProperty(
|
|
137271
|
+
Object.defineProperty(schema9, JSONSchema_1.Parent, {
|
|
136880
137272
|
enumerable: false,
|
|
136881
137273
|
value: parent,
|
|
136882
137274
|
writable: false
|
|
136883
137275
|
});
|
|
136884
|
-
if (Array.isArray(
|
|
136885
|
-
|
|
137276
|
+
if (Array.isArray(schema9)) {
|
|
137277
|
+
schema9.forEach((child) => link2(child, schema9));
|
|
136886
137278
|
}
|
|
136887
|
-
for (const key2 in
|
|
136888
|
-
link2(
|
|
137279
|
+
for (const key2 in schema9) {
|
|
137280
|
+
link2(schema9[key2], schema9);
|
|
136889
137281
|
}
|
|
136890
|
-
return
|
|
137282
|
+
return schema9;
|
|
136891
137283
|
}
|
|
136892
137284
|
exports.link = link2;
|
|
136893
137285
|
});
|
|
@@ -136908,11 +137300,11 @@ var require_optionValidator = __commonJS((exports) => {
|
|
|
136908
137300
|
var require_src3 = __commonJS((exports) => {
|
|
136909
137301
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
136910
137302
|
function adopt(value) {
|
|
136911
|
-
return value instanceof P9 ? value : new P9(function(
|
|
136912
|
-
|
|
137303
|
+
return value instanceof P9 ? value : new P9(function(resolve6) {
|
|
137304
|
+
resolve6(value);
|
|
136913
137305
|
});
|
|
136914
137306
|
}
|
|
136915
|
-
return new (P9 || (P9 = Promise))(function(
|
|
137307
|
+
return new (P9 || (P9 = Promise))(function(resolve6, reject) {
|
|
136916
137308
|
function fulfilled(value) {
|
|
136917
137309
|
try {
|
|
136918
137310
|
step(generator.next(value));
|
|
@@ -136928,7 +137320,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
136928
137320
|
}
|
|
136929
137321
|
}
|
|
136930
137322
|
function step(result) {
|
|
136931
|
-
result.done ?
|
|
137323
|
+
result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
136932
137324
|
}
|
|
136933
137325
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
136934
137326
|
});
|
|
@@ -136979,8 +137371,8 @@ var require_src3 = __commonJS((exports) => {
|
|
|
136979
137371
|
unknownAny: true
|
|
136980
137372
|
};
|
|
136981
137373
|
function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
|
|
136982
|
-
const
|
|
136983
|
-
return compile(
|
|
137374
|
+
const schema9 = parseAsJSONSchema(filename);
|
|
137375
|
+
return compile(schema9, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
|
|
136984
137376
|
}
|
|
136985
137377
|
exports.compileFromFile = compileFromFile;
|
|
136986
137378
|
function parseAsJSONSchema(filename) {
|
|
@@ -136990,7 +137382,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
136990
137382
|
return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
|
|
136991
137383
|
}
|
|
136992
137384
|
function compile(schema_1, name_1) {
|
|
136993
|
-
return __awaiter(this, arguments, undefined, function* (
|
|
137385
|
+
return __awaiter(this, arguments, undefined, function* (schema9, name2, options8 = {}) {
|
|
136994
137386
|
(0, optionValidator_1.validateOptions)(options8);
|
|
136995
137387
|
const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
|
|
136996
137388
|
const start = Date.now();
|
|
@@ -137000,7 +137392,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
137000
137392
|
if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
|
|
137001
137393
|
_options.cwd += "/";
|
|
137002
137394
|
}
|
|
137003
|
-
const _schema = (0, lodash_1.cloneDeep)(
|
|
137395
|
+
const _schema = (0, lodash_1.cloneDeep)(schema9);
|
|
137004
137396
|
const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
|
|
137005
137397
|
if (process.env.VERBOSE) {
|
|
137006
137398
|
if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
|
|
@@ -137125,7 +137517,7 @@ var require_vary = __commonJS((exports, module) => {
|
|
|
137125
137517
|
if (!field) {
|
|
137126
137518
|
throw new TypeError("field argument is required");
|
|
137127
137519
|
}
|
|
137128
|
-
var fields = !Array.isArray(field) ?
|
|
137520
|
+
var fields = !Array.isArray(field) ? parse11(String(field)) : field;
|
|
137129
137521
|
for (var j10 = 0;j10 < fields.length; j10++) {
|
|
137130
137522
|
if (!FIELD_NAME_REGEXP.test(fields[j10])) {
|
|
137131
137523
|
throw new TypeError("field argument contains an invalid header name");
|
|
@@ -137135,7 +137527,7 @@ var require_vary = __commonJS((exports, module) => {
|
|
|
137135
137527
|
return header2;
|
|
137136
137528
|
}
|
|
137137
137529
|
var val = header2;
|
|
137138
|
-
var vals =
|
|
137530
|
+
var vals = parse11(header2.toLowerCase());
|
|
137139
137531
|
if (fields.indexOf("*") !== -1 || vals.indexOf("*") !== -1) {
|
|
137140
137532
|
return "*";
|
|
137141
137533
|
}
|
|
@@ -137148,7 +137540,7 @@ var require_vary = __commonJS((exports, module) => {
|
|
|
137148
137540
|
}
|
|
137149
137541
|
return val;
|
|
137150
137542
|
}
|
|
137151
|
-
function
|
|
137543
|
+
function parse11(header2) {
|
|
137152
137544
|
var end = 0;
|
|
137153
137545
|
var list3 = [];
|
|
137154
137546
|
var start = 0;
|
|
@@ -137400,13 +137792,13 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
137400
137792
|
options8 = options8 || {};
|
|
137401
137793
|
var type = typeof val;
|
|
137402
137794
|
if (type === "string" && val.length > 0) {
|
|
137403
|
-
return
|
|
137795
|
+
return parse11(val);
|
|
137404
137796
|
} else if (type === "number" && isFinite(val)) {
|
|
137405
137797
|
return options8.long ? fmtLong(val) : fmtShort(val);
|
|
137406
137798
|
}
|
|
137407
137799
|
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
|
137408
137800
|
};
|
|
137409
|
-
function
|
|
137801
|
+
function parse11(str) {
|
|
137410
137802
|
str = String(str);
|
|
137411
137803
|
if (str.length > 100) {
|
|
137412
137804
|
return;
|
|
@@ -137500,7 +137892,7 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
137500
137892
|
|
|
137501
137893
|
// node_modules/debug/src/common.js
|
|
137502
137894
|
var require_common7 = __commonJS((exports, module) => {
|
|
137503
|
-
function setup(
|
|
137895
|
+
function setup(env3) {
|
|
137504
137896
|
createDebug.debug = createDebug;
|
|
137505
137897
|
createDebug.default = createDebug;
|
|
137506
137898
|
createDebug.coerce = coerce;
|
|
@@ -137509,8 +137901,8 @@ var require_common7 = __commonJS((exports, module) => {
|
|
|
137509
137901
|
createDebug.enabled = enabled;
|
|
137510
137902
|
createDebug.humanize = require_ms();
|
|
137511
137903
|
createDebug.destroy = destroy;
|
|
137512
|
-
Object.keys(
|
|
137513
|
-
createDebug[key2] =
|
|
137904
|
+
Object.keys(env3).forEach((key2) => {
|
|
137905
|
+
createDebug[key2] = env3[key2];
|
|
137514
137906
|
});
|
|
137515
137907
|
createDebug.names = [];
|
|
137516
137908
|
createDebug.skips = [];
|
|
@@ -138716,7 +139108,7 @@ var require_bytes = __commonJS((exports, module) => {
|
|
|
138716
139108
|
*/
|
|
138717
139109
|
module.exports = bytes;
|
|
138718
139110
|
module.exports.format = format3;
|
|
138719
|
-
module.exports.parse =
|
|
139111
|
+
module.exports.parse = parse11;
|
|
138720
139112
|
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
|
138721
139113
|
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
|
138722
139114
|
var map2 = {
|
|
@@ -138730,7 +139122,7 @@ var require_bytes = __commonJS((exports, module) => {
|
|
|
138730
139122
|
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
|
|
138731
139123
|
function bytes(value, options8) {
|
|
138732
139124
|
if (typeof value === "string") {
|
|
138733
|
-
return
|
|
139125
|
+
return parse11(value);
|
|
138734
139126
|
}
|
|
138735
139127
|
if (typeof value === "number") {
|
|
138736
139128
|
return format3(value, options8);
|
|
@@ -138774,7 +139166,7 @@ var require_bytes = __commonJS((exports, module) => {
|
|
|
138774
139166
|
}
|
|
138775
139167
|
return str + unitSeparator + unit;
|
|
138776
139168
|
}
|
|
138777
|
-
function
|
|
139169
|
+
function parse11(val) {
|
|
138778
139170
|
if (typeof val === "number" && !isNaN(val)) {
|
|
138779
139171
|
return val;
|
|
138780
139172
|
}
|
|
@@ -142553,11 +142945,11 @@ var require_raw_body = __commonJS((exports, module) => {
|
|
|
142553
142945
|
if (done) {
|
|
142554
142946
|
return readStream(stream, encoding, length, limit, wrap(done));
|
|
142555
142947
|
}
|
|
142556
|
-
return new Promise(function executor(
|
|
142948
|
+
return new Promise(function executor(resolve6, reject) {
|
|
142557
142949
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
142558
142950
|
if (err)
|
|
142559
142951
|
return reject(err);
|
|
142560
|
-
|
|
142952
|
+
resolve6(buf);
|
|
142561
142953
|
});
|
|
142562
142954
|
});
|
|
142563
142955
|
}
|
|
@@ -142878,7 +143270,7 @@ var require_content_type = __commonJS((exports) => {
|
|
|
142878
143270
|
var QUOTE_REGEXP = /([\\"])/g;
|
|
142879
143271
|
var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
|
|
142880
143272
|
exports.format = format3;
|
|
142881
|
-
exports.parse =
|
|
143273
|
+
exports.parse = parse11;
|
|
142882
143274
|
function format3(obj) {
|
|
142883
143275
|
if (!obj || typeof obj !== "object") {
|
|
142884
143276
|
throw new TypeError("argument obj is required");
|
|
@@ -142902,7 +143294,7 @@ var require_content_type = __commonJS((exports) => {
|
|
|
142902
143294
|
}
|
|
142903
143295
|
return string4;
|
|
142904
143296
|
}
|
|
142905
|
-
function
|
|
143297
|
+
function parse11(string4) {
|
|
142906
143298
|
if (!string4) {
|
|
142907
143299
|
throw new TypeError("argument string is required");
|
|
142908
143300
|
}
|
|
@@ -152469,7 +152861,7 @@ var require_media_typer = __commonJS((exports) => {
|
|
|
152469
152861
|
var TYPE_NAME_REGEXP = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/;
|
|
152470
152862
|
var TYPE_REGEXP = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
|
|
152471
152863
|
exports.format = format3;
|
|
152472
|
-
exports.parse =
|
|
152864
|
+
exports.parse = parse11;
|
|
152473
152865
|
exports.test = test;
|
|
152474
152866
|
function format3(obj) {
|
|
152475
152867
|
if (!obj || typeof obj !== "object") {
|
|
@@ -152502,7 +152894,7 @@ var require_media_typer = __commonJS((exports) => {
|
|
|
152502
152894
|
}
|
|
152503
152895
|
return TYPE_REGEXP.test(string4.toLowerCase());
|
|
152504
152896
|
}
|
|
152505
|
-
function
|
|
152897
|
+
function parse11(string4) {
|
|
152506
152898
|
if (!string4) {
|
|
152507
152899
|
throw new TypeError("argument string is required");
|
|
152508
152900
|
}
|
|
@@ -152691,7 +153083,7 @@ var require_read = __commonJS((exports, module) => {
|
|
|
152691
153083
|
var hasBody = require_type_is().hasBody;
|
|
152692
153084
|
var { getCharset } = require_utils8();
|
|
152693
153085
|
module.exports = read3;
|
|
152694
|
-
function read3(req, res, next,
|
|
153086
|
+
function read3(req, res, next, parse11, debug, options8) {
|
|
152695
153087
|
if (onFinished.isFinished(req)) {
|
|
152696
153088
|
debug("body already parsed");
|
|
152697
153089
|
next();
|
|
@@ -152779,7 +153171,7 @@ var require_read = __commonJS((exports, module) => {
|
|
|
152779
153171
|
try {
|
|
152780
153172
|
debug("parse body");
|
|
152781
153173
|
str = typeof body !== "string" && encoding !== null ? iconv.decode(body, encoding) : body;
|
|
152782
|
-
req.body =
|
|
153174
|
+
req.body = parse11(str, encoding);
|
|
152783
153175
|
} catch (err) {
|
|
152784
153176
|
next(createError2(400, err, {
|
|
152785
153177
|
body: str,
|
|
@@ -152855,7 +153247,7 @@ var require_json5 = __commonJS((exports, module) => {
|
|
|
152855
153247
|
const normalizedOptions = normalizeOptions5(options8, "application/json");
|
|
152856
153248
|
var reviver = options8?.reviver;
|
|
152857
153249
|
var strict = options8?.strict !== false;
|
|
152858
|
-
function
|
|
153250
|
+
function parse11(body) {
|
|
152859
153251
|
if (body.length === 0) {
|
|
152860
153252
|
return {};
|
|
152861
153253
|
}
|
|
@@ -152881,7 +153273,7 @@ var require_json5 = __commonJS((exports, module) => {
|
|
|
152881
153273
|
isValidCharset: (charset) => charset.slice(0, 4) === "utf-"
|
|
152882
153274
|
};
|
|
152883
153275
|
return function jsonParser(req, res, next) {
|
|
152884
|
-
read3(req, res, next,
|
|
153276
|
+
read3(req, res, next, parse11, debug, readOptions);
|
|
152885
153277
|
};
|
|
152886
153278
|
}
|
|
152887
153279
|
function createStrictSyntaxError(str, char) {
|
|
@@ -155224,11 +155616,11 @@ var require_parse7 = __commonJS((exports, module) => {
|
|
|
155224
155616
|
// node_modules/qs/lib/index.js
|
|
155225
155617
|
var require_lib6 = __commonJS((exports, module) => {
|
|
155226
155618
|
var stringify = require_stringify4();
|
|
155227
|
-
var
|
|
155619
|
+
var parse11 = require_parse7();
|
|
155228
155620
|
var formats = require_formats();
|
|
155229
155621
|
module.exports = {
|
|
155230
155622
|
formats,
|
|
155231
|
-
parse:
|
|
155623
|
+
parse: parse11,
|
|
155232
155624
|
stringify
|
|
155233
155625
|
};
|
|
155234
155626
|
});
|
|
@@ -155253,7 +155645,7 @@ var require_urlencoded = __commonJS((exports, module) => {
|
|
|
155253
155645
|
throw new TypeError("option defaultCharset must be either utf-8 or iso-8859-1");
|
|
155254
155646
|
}
|
|
155255
155647
|
var queryparse = createQueryParser(options8);
|
|
155256
|
-
function
|
|
155648
|
+
function parse11(body, encoding) {
|
|
155257
155649
|
return body.length ? queryparse(body, encoding) : {};
|
|
155258
155650
|
}
|
|
155259
155651
|
const readOptions = {
|
|
@@ -155261,7 +155653,7 @@ var require_urlencoded = __commonJS((exports, module) => {
|
|
|
155261
155653
|
isValidCharset: (charset) => charset === "utf-8" || charset === "iso-8859-1"
|
|
155262
155654
|
};
|
|
155263
155655
|
return function urlencodedParser(req, res, next) {
|
|
155264
|
-
read3(req, res, next,
|
|
155656
|
+
read3(req, res, next, parse11, debug, readOptions);
|
|
155265
155657
|
};
|
|
155266
155658
|
}
|
|
155267
155659
|
function createQueryParser(options8) {
|
|
@@ -155454,7 +155846,7 @@ var require_parseurl = __commonJS((exports, module) => {
|
|
|
155454
155846
|
* MIT Licensed
|
|
155455
155847
|
*/
|
|
155456
155848
|
var url3 = __require("url");
|
|
155457
|
-
var
|
|
155849
|
+
var parse11 = url3.parse;
|
|
155458
155850
|
var Url = url3.Url;
|
|
155459
155851
|
module.exports = parseurl;
|
|
155460
155852
|
module.exports.original = originalurl;
|
|
@@ -155486,7 +155878,7 @@ var require_parseurl = __commonJS((exports, module) => {
|
|
|
155486
155878
|
}
|
|
155487
155879
|
function fastparse(str) {
|
|
155488
155880
|
if (typeof str !== "string" || str.charCodeAt(0) !== 47) {
|
|
155489
|
-
return
|
|
155881
|
+
return parse11(str);
|
|
155490
155882
|
}
|
|
155491
155883
|
var pathname = str;
|
|
155492
155884
|
var query = null;
|
|
@@ -155508,7 +155900,7 @@ var require_parseurl = __commonJS((exports, module) => {
|
|
|
155508
155900
|
case 35:
|
|
155509
155901
|
case 160:
|
|
155510
155902
|
case 65279:
|
|
155511
|
-
return
|
|
155903
|
+
return parse11(str);
|
|
155512
155904
|
}
|
|
155513
155905
|
}
|
|
155514
155906
|
var url4 = Url !== undefined ? new Url : {};
|
|
@@ -155558,7 +155950,7 @@ var require_finalhandler = __commonJS((exports, module) => {
|
|
|
155558
155950
|
module.exports = finalhandler;
|
|
155559
155951
|
function finalhandler(req, res, options8) {
|
|
155560
155952
|
var opts = options8 || {};
|
|
155561
|
-
var
|
|
155953
|
+
var env3 = opts.env || "development";
|
|
155562
155954
|
var onerror = opts.onerror;
|
|
155563
155955
|
return function(err) {
|
|
155564
155956
|
var headers;
|
|
@@ -155575,7 +155967,7 @@ var require_finalhandler = __commonJS((exports, module) => {
|
|
|
155575
155967
|
} else {
|
|
155576
155968
|
headers = getErrorHeaders(err);
|
|
155577
155969
|
}
|
|
155578
|
-
msg = getErrorMessage(err, status,
|
|
155970
|
+
msg = getErrorMessage(err, status, env3);
|
|
155579
155971
|
} else {
|
|
155580
155972
|
status = 404;
|
|
155581
155973
|
msg = "Cannot " + req.method + " " + encodeUrl(getResourceName(req));
|
|
@@ -155600,9 +155992,9 @@ var require_finalhandler = __commonJS((exports, module) => {
|
|
|
155600
155992
|
}
|
|
155601
155993
|
return { ...err.headers };
|
|
155602
155994
|
}
|
|
155603
|
-
function getErrorMessage(err, status,
|
|
155995
|
+
function getErrorMessage(err, status, env3) {
|
|
155604
155996
|
var msg;
|
|
155605
|
-
if (
|
|
155997
|
+
if (env3 !== "production") {
|
|
155606
155998
|
msg = err.stack;
|
|
155607
155999
|
if (!msg && typeof err.toString === "function") {
|
|
155608
156000
|
msg = err.toString();
|
|
@@ -155682,7 +156074,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155682
156074
|
var basename4 = path18.basename;
|
|
155683
156075
|
var extname2 = path18.extname;
|
|
155684
156076
|
var join15 = path18.join;
|
|
155685
|
-
var
|
|
156077
|
+
var resolve6 = path18.resolve;
|
|
155686
156078
|
module.exports = View;
|
|
155687
156079
|
function View(name2, options8) {
|
|
155688
156080
|
var opts = options8 || {};
|
|
@@ -155716,7 +156108,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155716
156108
|
debug('lookup "%s"', name2);
|
|
155717
156109
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
155718
156110
|
var root2 = roots[i5];
|
|
155719
|
-
var loc =
|
|
156111
|
+
var loc = resolve6(root2, name2);
|
|
155720
156112
|
var dir = dirname11(loc);
|
|
155721
156113
|
var file2 = basename4(loc);
|
|
155722
156114
|
path19 = this.resolve(dir, file2);
|
|
@@ -155741,7 +156133,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
155741
156133
|
});
|
|
155742
156134
|
sync = false;
|
|
155743
156135
|
};
|
|
155744
|
-
View.prototype.resolve = function
|
|
156136
|
+
View.prototype.resolve = function resolve7(dir, file2) {
|
|
155745
156137
|
var ext = this.ext;
|
|
155746
156138
|
var path19 = join15(dir, file2);
|
|
155747
156139
|
var stat2 = tryStat(path19);
|
|
@@ -155820,7 +156212,7 @@ var require_forwarded = __commonJS((exports, module) => {
|
|
|
155820
156212
|
if (!req) {
|
|
155821
156213
|
throw new TypeError("argument req is required");
|
|
155822
156214
|
}
|
|
155823
|
-
var proxyAddrs =
|
|
156215
|
+
var proxyAddrs = parse11(req.headers["x-forwarded-for"] || "");
|
|
155824
156216
|
var socketAddr = getSocketAddr(req);
|
|
155825
156217
|
var addrs = [socketAddr].concat(proxyAddrs);
|
|
155826
156218
|
return addrs;
|
|
@@ -155828,7 +156220,7 @@ var require_forwarded = __commonJS((exports, module) => {
|
|
|
155828
156220
|
function getSocketAddr(req) {
|
|
155829
156221
|
return req.socket ? req.socket.remoteAddress : req.connection.remoteAddress;
|
|
155830
156222
|
}
|
|
155831
|
-
function
|
|
156223
|
+
function parse11(header2) {
|
|
155832
156224
|
var end = header2.length;
|
|
155833
156225
|
var list3 = [];
|
|
155834
156226
|
var start = header2.length;
|
|
@@ -156858,7 +157250,7 @@ var require_is_promise = __commonJS((exports, module) => {
|
|
|
156858
157250
|
var require_dist = __commonJS((exports) => {
|
|
156859
157251
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
156860
157252
|
exports.PathError = exports.TokenData = undefined;
|
|
156861
|
-
exports.parse =
|
|
157253
|
+
exports.parse = parse11;
|
|
156862
157254
|
exports.compile = compile2;
|
|
156863
157255
|
exports.match = match;
|
|
156864
157256
|
exports.pathToRegexp = pathToRegexp;
|
|
@@ -156904,7 +157296,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
156904
157296
|
}
|
|
156905
157297
|
}
|
|
156906
157298
|
exports.PathError = PathError;
|
|
156907
|
-
function
|
|
157299
|
+
function parse11(str, options8 = {}) {
|
|
156908
157300
|
const { encodePath = NOOP_VALUE } = options8;
|
|
156909
157301
|
const chars = [...str];
|
|
156910
157302
|
const tokens = [];
|
|
@@ -156994,7 +157386,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
156994
157386
|
}
|
|
156995
157387
|
function compile2(path18, options8 = {}) {
|
|
156996
157388
|
const { encode: encode5 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options8;
|
|
156997
|
-
const data = typeof path18 === "object" ? path18 :
|
|
157389
|
+
const data = typeof path18 === "object" ? path18 : parse11(path18, options8);
|
|
156998
157390
|
const fn9 = tokensToFunction(data.tokens, delimiter, encode5);
|
|
156999
157391
|
return function path19(params = {}) {
|
|
157000
157392
|
const [path20, ...missing] = fn9(params);
|
|
@@ -157089,7 +157481,7 @@ var require_dist = __commonJS((exports) => {
|
|
|
157089
157481
|
const flags = sensitive ? "" : "i";
|
|
157090
157482
|
const sources = [];
|
|
157091
157483
|
for (const input of pathsToArray(path18, [])) {
|
|
157092
|
-
const data = typeof input === "object" ? input :
|
|
157484
|
+
const data = typeof input === "object" ? input : parse11(input, options8);
|
|
157093
157485
|
for (const tokens of flatten(data.tokens, 0, [])) {
|
|
157094
157486
|
sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));
|
|
157095
157487
|
}
|
|
@@ -157900,7 +158292,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
157900
158292
|
var compileETag = require_utils10().compileETag;
|
|
157901
158293
|
var compileQueryParser = require_utils10().compileQueryParser;
|
|
157902
158294
|
var compileTrust = require_utils10().compileTrust;
|
|
157903
|
-
var
|
|
158295
|
+
var resolve6 = __require("node:path").resolve;
|
|
157904
158296
|
var once9 = require_once();
|
|
157905
158297
|
var Router = require_router();
|
|
157906
158298
|
var slice = Array.prototype.slice;
|
|
@@ -157928,10 +158320,10 @@ var require_application = __commonJS((exports, module) => {
|
|
|
157928
158320
|
});
|
|
157929
158321
|
};
|
|
157930
158322
|
app.defaultConfiguration = function defaultConfiguration() {
|
|
157931
|
-
var
|
|
158323
|
+
var env3 = "development";
|
|
157932
158324
|
this.enable("x-powered-by");
|
|
157933
158325
|
this.set("etag", "weak");
|
|
157934
|
-
this.set("env",
|
|
158326
|
+
this.set("env", env3);
|
|
157935
158327
|
this.set("query parser", "simple");
|
|
157936
158328
|
this.set("subdomain offset", 2);
|
|
157937
158329
|
this.set("trust proxy", false);
|
|
@@ -157939,7 +158331,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
157939
158331
|
configurable: true,
|
|
157940
158332
|
value: true
|
|
157941
158333
|
});
|
|
157942
|
-
debug("booting in %s mode",
|
|
158334
|
+
debug("booting in %s mode", env3);
|
|
157943
158335
|
this.on("mount", function onmount(parent) {
|
|
157944
158336
|
if (this.settings[trustProxyDefaultSymbol] === true && typeof parent.settings["trust proxy fn"] === "function") {
|
|
157945
158337
|
delete this.settings["trust proxy"];
|
|
@@ -157954,9 +158346,9 @@ var require_application = __commonJS((exports, module) => {
|
|
|
157954
158346
|
this.mountpath = "/";
|
|
157955
158347
|
this.locals.settings = this.settings;
|
|
157956
158348
|
this.set("view", View);
|
|
157957
|
-
this.set("views",
|
|
158349
|
+
this.set("views", resolve6("views"));
|
|
157958
158350
|
this.set("jsonp callback name", "callback");
|
|
157959
|
-
if (
|
|
158351
|
+
if (env3 === "production") {
|
|
157960
158352
|
this.enable("view cache");
|
|
157961
158353
|
}
|
|
157962
158354
|
};
|
|
@@ -158919,7 +159311,7 @@ var require_request = __commonJS((exports, module) => {
|
|
|
158919
159311
|
var http = __require("node:http");
|
|
158920
159312
|
var fresh = require_fresh();
|
|
158921
159313
|
var parseRange = require_range_parser();
|
|
158922
|
-
var
|
|
159314
|
+
var parse11 = require_parseurl();
|
|
158923
159315
|
var proxyaddr = require_proxy_addr();
|
|
158924
159316
|
var req = Object.create(http.IncomingMessage.prototype);
|
|
158925
159317
|
module.exports = req;
|
|
@@ -158965,7 +159357,7 @@ var require_request = __commonJS((exports, module) => {
|
|
|
158965
159357
|
if (!queryparse) {
|
|
158966
159358
|
return Object.create(null);
|
|
158967
159359
|
}
|
|
158968
|
-
var querystring =
|
|
159360
|
+
var querystring = parse11(this).query;
|
|
158969
159361
|
return queryparse(querystring);
|
|
158970
159362
|
});
|
|
158971
159363
|
req.is = function is8(types) {
|
|
@@ -159010,7 +159402,7 @@ var require_request = __commonJS((exports, module) => {
|
|
|
159010
159402
|
return subdomains2.slice(offset);
|
|
159011
159403
|
});
|
|
159012
159404
|
defineGetter(req, "path", function path18() {
|
|
159013
|
-
return
|
|
159405
|
+
return parse11(this).pathname;
|
|
159014
159406
|
});
|
|
159015
159407
|
defineGetter(req, "host", function host() {
|
|
159016
159408
|
var trust = this.app.get("trust proxy fn");
|
|
@@ -159068,7 +159460,7 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159068
159460
|
* MIT Licensed
|
|
159069
159461
|
*/
|
|
159070
159462
|
module.exports = contentDisposition;
|
|
159071
|
-
module.exports.parse =
|
|
159463
|
+
module.exports.parse = parse11;
|
|
159072
159464
|
var basename4 = __require("path").basename;
|
|
159073
159465
|
var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
|
|
159074
159466
|
var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
|
|
@@ -159159,7 +159551,7 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159159
159551
|
function getlatin1(val) {
|
|
159160
159552
|
return String(val).replace(NON_LATIN1_REGEXP, "?");
|
|
159161
159553
|
}
|
|
159162
|
-
function
|
|
159554
|
+
function parse11(string4) {
|
|
159163
159555
|
if (!string4 || typeof string4 !== "string") {
|
|
159164
159556
|
throw new TypeError("argument string is required");
|
|
159165
159557
|
}
|
|
@@ -159228,19 +159620,19 @@ var require_content_disposition = __commonJS((exports, module) => {
|
|
|
159228
159620
|
// node_modules/cookie-signature/index.js
|
|
159229
159621
|
var require_cookie_signature = __commonJS((exports) => {
|
|
159230
159622
|
var crypto = __require("crypto");
|
|
159231
|
-
exports.sign = function(val,
|
|
159623
|
+
exports.sign = function(val, secret2) {
|
|
159232
159624
|
if (typeof val != "string")
|
|
159233
159625
|
throw new TypeError("Cookie value must be provided as a string.");
|
|
159234
|
-
if (
|
|
159626
|
+
if (secret2 == null)
|
|
159235
159627
|
throw new TypeError("Secret key must be provided.");
|
|
159236
|
-
return val + "." + crypto.createHmac("sha256",
|
|
159628
|
+
return val + "." + crypto.createHmac("sha256", secret2).update(val).digest("base64").replace(/\=+$/, "");
|
|
159237
159629
|
};
|
|
159238
|
-
exports.unsign = function(input,
|
|
159630
|
+
exports.unsign = function(input, secret2) {
|
|
159239
159631
|
if (typeof input != "string")
|
|
159240
159632
|
throw new TypeError("Signed cookie string must be provided.");
|
|
159241
|
-
if (
|
|
159633
|
+
if (secret2 == null)
|
|
159242
159634
|
throw new TypeError("Secret key must be provided.");
|
|
159243
|
-
var tentativeValue = input.slice(0, input.lastIndexOf(".")), expectedInput = exports.sign(tentativeValue,
|
|
159635
|
+
var tentativeValue = input.slice(0, input.lastIndexOf(".")), expectedInput = exports.sign(tentativeValue, secret2), expectedBuffer = Buffer.from(expectedInput), inputBuffer = Buffer.from(input);
|
|
159244
159636
|
return expectedBuffer.length === inputBuffer.length && crypto.timingSafeEqual(expectedBuffer, inputBuffer) ? tentativeValue : false;
|
|
159245
159637
|
};
|
|
159246
159638
|
});
|
|
@@ -159253,7 +159645,7 @@ var require_cookie = __commonJS((exports) => {
|
|
|
159253
159645
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
159254
159646
|
* MIT Licensed
|
|
159255
159647
|
*/
|
|
159256
|
-
exports.parse =
|
|
159648
|
+
exports.parse = parse11;
|
|
159257
159649
|
exports.serialize = serialize2;
|
|
159258
159650
|
var __toString = Object.prototype.toString;
|
|
159259
159651
|
var __hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
@@ -159261,7 +159653,7 @@ var require_cookie = __commonJS((exports) => {
|
|
|
159261
159653
|
var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
|
|
159262
159654
|
var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
|
|
159263
159655
|
var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
|
|
159264
|
-
function
|
|
159656
|
+
function parse11(str, opt) {
|
|
159265
159657
|
if (typeof str !== "string") {
|
|
159266
159658
|
throw new TypeError("argument str must be a string");
|
|
159267
159659
|
}
|
|
@@ -159445,7 +159837,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
159445
159837
|
var extname2 = path18.extname;
|
|
159446
159838
|
var join15 = path18.join;
|
|
159447
159839
|
var normalize = path18.normalize;
|
|
159448
|
-
var
|
|
159840
|
+
var resolve6 = path18.resolve;
|
|
159449
159841
|
var sep = path18.sep;
|
|
159450
159842
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
159451
159843
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
|
|
@@ -159474,7 +159866,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
159474
159866
|
this._maxage = opts.maxAge || opts.maxage;
|
|
159475
159867
|
this._maxage = typeof this._maxage === "string" ? ms8(this._maxage) : Number(this._maxage);
|
|
159476
159868
|
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
159477
|
-
this._root = opts.root ?
|
|
159869
|
+
this._root = opts.root ? resolve6(opts.root) : null;
|
|
159478
159870
|
}
|
|
159479
159871
|
util2.inherits(SendStream, Stream2);
|
|
159480
159872
|
SendStream.prototype.error = function error48(status, err) {
|
|
@@ -159623,7 +160015,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
159623
160015
|
return res;
|
|
159624
160016
|
}
|
|
159625
160017
|
parts = normalize(path19).split(sep);
|
|
159626
|
-
path19 =
|
|
160018
|
+
path19 = resolve6(path19);
|
|
159627
160019
|
}
|
|
159628
160020
|
if (containsDotFile(parts)) {
|
|
159629
160021
|
debug('%s dotfile "%s"', this._dotfiles, path19);
|
|
@@ -159951,7 +160343,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
159951
160343
|
var cookie = require_cookie();
|
|
159952
160344
|
var send = require_send();
|
|
159953
160345
|
var extname2 = path18.extname;
|
|
159954
|
-
var
|
|
160346
|
+
var resolve6 = path18.resolve;
|
|
159955
160347
|
var vary = require_vary();
|
|
159956
160348
|
var { Buffer: Buffer7 } = __require("node:buffer");
|
|
159957
160349
|
var res = Object.create(http.ServerResponse.prototype);
|
|
@@ -160160,7 +160552,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
160160
160552
|
}
|
|
160161
160553
|
opts = Object.create(opts);
|
|
160162
160554
|
opts.headers = headers;
|
|
160163
|
-
var fullPath = !opts.root ?
|
|
160555
|
+
var fullPath = !opts.root ? resolve6(path19) : path19;
|
|
160164
160556
|
return this.sendFile(fullPath, opts, done);
|
|
160165
160557
|
};
|
|
160166
160558
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -160231,14 +160623,14 @@ var require_response = __commonJS((exports, module) => {
|
|
|
160231
160623
|
};
|
|
160232
160624
|
res.cookie = function(name2, value, options8) {
|
|
160233
160625
|
var opts = { ...options8 };
|
|
160234
|
-
var
|
|
160626
|
+
var secret2 = this.req.secret;
|
|
160235
160627
|
var signed = opts.signed;
|
|
160236
|
-
if (signed && !
|
|
160628
|
+
if (signed && !secret2) {
|
|
160237
160629
|
throw new Error('cookieParser("secret") required for signed cookies');
|
|
160238
160630
|
}
|
|
160239
160631
|
var val = typeof value === "object" ? "j:" + JSON.stringify(value) : String(value);
|
|
160240
160632
|
if (signed) {
|
|
160241
|
-
val = "s:" + sign2(val,
|
|
160633
|
+
val = "s:" + sign2(val, secret2);
|
|
160242
160634
|
}
|
|
160243
160635
|
if (opts.maxAge != null) {
|
|
160244
160636
|
var maxAge = opts.maxAge - 0;
|
|
@@ -160421,7 +160813,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
160421
160813
|
var encodeUrl = require_encodeurl();
|
|
160422
160814
|
var escapeHtml = require_escape_html();
|
|
160423
160815
|
var parseUrl = require_parseurl();
|
|
160424
|
-
var
|
|
160816
|
+
var resolve6 = __require("path").resolve;
|
|
160425
160817
|
var send = require_send();
|
|
160426
160818
|
var url3 = __require("url");
|
|
160427
160819
|
module.exports = serveStatic;
|
|
@@ -160440,7 +160832,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
160440
160832
|
throw new TypeError("option setHeaders must be function");
|
|
160441
160833
|
}
|
|
160442
160834
|
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
160443
|
-
opts.root =
|
|
160835
|
+
opts.root = resolve6(root2);
|
|
160444
160836
|
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
160445
160837
|
return function serveStatic2(req, res, next) {
|
|
160446
160838
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
@@ -163431,8 +163823,8 @@ var require_executor = __commonJS((exports, module) => {
|
|
|
163431
163823
|
}
|
|
163432
163824
|
resetBuffer() {
|
|
163433
163825
|
this.buffer = new Waterfall;
|
|
163434
|
-
this.buffer.chain(new Promise((
|
|
163435
|
-
this._triggerBuffer =
|
|
163826
|
+
this.buffer.chain(new Promise((resolve6) => {
|
|
163827
|
+
this._triggerBuffer = resolve6;
|
|
163436
163828
|
}));
|
|
163437
163829
|
if (this.ready)
|
|
163438
163830
|
this._triggerBuffer();
|
|
@@ -164452,7 +164844,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
164452
164844
|
throw e8;
|
|
164453
164845
|
}
|
|
164454
164846
|
};
|
|
164455
|
-
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((
|
|
164847
|
+
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve6, reject) => {
|
|
164456
164848
|
try {
|
|
164457
164849
|
const stream = writeFileStream(filename, { mode });
|
|
164458
164850
|
const readable2 = Readable6.from(lines);
|
|
@@ -164469,7 +164861,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
164469
164861
|
if (err)
|
|
164470
164862
|
reject(err);
|
|
164471
164863
|
else
|
|
164472
|
-
|
|
164864
|
+
resolve6();
|
|
164473
164865
|
});
|
|
164474
164866
|
});
|
|
164475
164867
|
readable2.on("error", (err) => {
|
|
@@ -164640,7 +165032,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
164640
165032
|
return { data: tdata, indexes };
|
|
164641
165033
|
}
|
|
164642
165034
|
treatRawStreamAsync(rawStream) {
|
|
164643
|
-
return new Promise((
|
|
165035
|
+
return new Promise((resolve6, reject) => {
|
|
164644
165036
|
const dataById = {};
|
|
164645
165037
|
const indexes = {};
|
|
164646
165038
|
let corruptItems = 0;
|
|
@@ -164683,7 +165075,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
164683
165075
|
}
|
|
164684
165076
|
}
|
|
164685
165077
|
const data = Object.values(dataById);
|
|
164686
|
-
|
|
165078
|
+
resolve6({ data, indexes });
|
|
164687
165079
|
});
|
|
164688
165080
|
lineStream.on("error", function(err) {
|
|
164689
165081
|
reject(err, null);
|
|
@@ -186678,7 +187070,7 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
186678
187070
|
else
|
|
186679
187071
|
dest[name2].push(elem);
|
|
186680
187072
|
}
|
|
186681
|
-
function
|
|
187073
|
+
function parse11(header2) {
|
|
186682
187074
|
const offers = Object.create(null);
|
|
186683
187075
|
let params = Object.create(null);
|
|
186684
187076
|
let mustUnescape = false;
|
|
@@ -186831,7 +187223,7 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
186831
187223
|
}).join(", ");
|
|
186832
187224
|
}).join(", ");
|
|
186833
187225
|
}
|
|
186834
|
-
module.exports = { format: format3, parse:
|
|
187226
|
+
module.exports = { format: format3, parse: parse11 };
|
|
186835
187227
|
});
|
|
186836
187228
|
|
|
186837
187229
|
// node_modules/ws/lib/websocket.js
|
|
@@ -186861,7 +187253,7 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
186861
187253
|
var {
|
|
186862
187254
|
EventTarget: { addEventListener, removeEventListener }
|
|
186863
187255
|
} = require_event_target();
|
|
186864
|
-
var { format: format3, parse:
|
|
187256
|
+
var { format: format3, parse: parse11 } = require_extension();
|
|
186865
187257
|
var { toBuffer } = require_buffer_util();
|
|
186866
187258
|
var closeTimeout = 30 * 1000;
|
|
186867
187259
|
var kAborted = Symbol("kAborted");
|
|
@@ -187404,7 +187796,7 @@ var require_websocket2 = __commonJS((exports, module) => {
|
|
|
187404
187796
|
}
|
|
187405
187797
|
let extensions;
|
|
187406
187798
|
try {
|
|
187407
|
-
extensions =
|
|
187799
|
+
extensions = parse11(secWebSocketExtensions);
|
|
187408
187800
|
} catch (err) {
|
|
187409
187801
|
const message = "Invalid Sec-WebSocket-Extensions header";
|
|
187410
187802
|
abortHandshake(websocket, socket, message);
|
|
@@ -187699,7 +188091,7 @@ var require_stream6 = __commonJS((exports, module) => {
|
|
|
187699
188091
|
// node_modules/ws/lib/subprotocol.js
|
|
187700
188092
|
var require_subprotocol = __commonJS((exports, module) => {
|
|
187701
188093
|
var { tokenChars } = require_validation();
|
|
187702
|
-
function
|
|
188094
|
+
function parse11(header2) {
|
|
187703
188095
|
const protocols = new Set;
|
|
187704
188096
|
let start = -1;
|
|
187705
188097
|
let end = -1;
|
|
@@ -187738,7 +188130,7 @@ var require_subprotocol = __commonJS((exports, module) => {
|
|
|
187738
188130
|
protocols.add(protocol);
|
|
187739
188131
|
return protocols;
|
|
187740
188132
|
}
|
|
187741
|
-
module.exports = { parse:
|
|
188133
|
+
module.exports = { parse: parse11 };
|
|
187742
188134
|
});
|
|
187743
188135
|
|
|
187744
188136
|
// node_modules/ws/lib/websocket-server.js
|
|
@@ -190294,13 +190686,13 @@ var require_broadcast_operator = __commonJS((exports) => {
|
|
|
190294
190686
|
return true;
|
|
190295
190687
|
}
|
|
190296
190688
|
emitWithAck(ev2, ...args) {
|
|
190297
|
-
return new Promise((
|
|
190689
|
+
return new Promise((resolve6, reject) => {
|
|
190298
190690
|
args.push((err, responses) => {
|
|
190299
190691
|
if (err) {
|
|
190300
190692
|
err.responses = responses;
|
|
190301
190693
|
return reject(err);
|
|
190302
190694
|
} else {
|
|
190303
|
-
return
|
|
190695
|
+
return resolve6(responses);
|
|
190304
190696
|
}
|
|
190305
190697
|
});
|
|
190306
190698
|
this.emit(ev2, ...args);
|
|
@@ -190488,12 +190880,12 @@ var require_socket2 = __commonJS((exports) => {
|
|
|
190488
190880
|
}
|
|
190489
190881
|
emitWithAck(ev2, ...args) {
|
|
190490
190882
|
const withErr = this.flags.timeout !== undefined;
|
|
190491
|
-
return new Promise((
|
|
190883
|
+
return new Promise((resolve6, reject) => {
|
|
190492
190884
|
args.push((arg1, arg2) => {
|
|
190493
190885
|
if (withErr) {
|
|
190494
|
-
return arg1 ? reject(arg1) :
|
|
190886
|
+
return arg1 ? reject(arg1) : resolve6(arg2);
|
|
190495
190887
|
} else {
|
|
190496
|
-
return
|
|
190888
|
+
return resolve6(arg1);
|
|
190497
190889
|
}
|
|
190498
190890
|
});
|
|
190499
190891
|
this.emit(ev2, ...args);
|
|
@@ -190948,13 +191340,13 @@ var require_namespace = __commonJS((exports) => {
|
|
|
190948
191340
|
return true;
|
|
190949
191341
|
}
|
|
190950
191342
|
serverSideEmitWithAck(ev2, ...args) {
|
|
190951
|
-
return new Promise((
|
|
191343
|
+
return new Promise((resolve6, reject) => {
|
|
190952
191344
|
args.push((err, responses) => {
|
|
190953
191345
|
if (err) {
|
|
190954
191346
|
err.responses = responses;
|
|
190955
191347
|
return reject(err);
|
|
190956
191348
|
} else {
|
|
190957
|
-
return
|
|
191349
|
+
return resolve6(responses);
|
|
190958
191350
|
}
|
|
190959
191351
|
});
|
|
190960
191352
|
this.serverSideEmit(ev2, ...args);
|
|
@@ -191638,7 +192030,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
191638
192030
|
return localSockets;
|
|
191639
192031
|
}
|
|
191640
192032
|
const requestId = randomId();
|
|
191641
|
-
return new Promise((
|
|
192033
|
+
return new Promise((resolve6, reject) => {
|
|
191642
192034
|
const timeout3 = setTimeout(() => {
|
|
191643
192035
|
const storedRequest2 = this.requests.get(requestId);
|
|
191644
192036
|
if (storedRequest2) {
|
|
@@ -191648,7 +192040,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
191648
192040
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
191649
192041
|
const storedRequest = {
|
|
191650
192042
|
type: MessageType.FETCH_SOCKETS,
|
|
191651
|
-
resolve:
|
|
192043
|
+
resolve: resolve6,
|
|
191652
192044
|
timeout: timeout3,
|
|
191653
192045
|
current: 0,
|
|
191654
192046
|
expected: expectedResponseCount,
|
|
@@ -191858,7 +192250,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
191858
192250
|
return localSockets;
|
|
191859
192251
|
}
|
|
191860
192252
|
const requestId = randomId();
|
|
191861
|
-
return new Promise((
|
|
192253
|
+
return new Promise((resolve6, reject) => {
|
|
191862
192254
|
const timeout3 = setTimeout(() => {
|
|
191863
192255
|
const storedRequest2 = this.customRequests.get(requestId);
|
|
191864
192256
|
if (storedRequest2) {
|
|
@@ -191868,7 +192260,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
191868
192260
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
191869
192261
|
const storedRequest = {
|
|
191870
192262
|
type: MessageType.FETCH_SOCKETS,
|
|
191871
|
-
resolve:
|
|
192263
|
+
resolve: resolve6,
|
|
191872
192264
|
timeout: timeout3,
|
|
191873
192265
|
missingUids: new Set([...this.nodesMap.keys()]),
|
|
191874
192266
|
responses: localSockets
|
|
@@ -192153,7 +192545,7 @@ var require_uws = __commonJS((exports) => {
|
|
|
192153
192545
|
});
|
|
192154
192546
|
|
|
192155
192547
|
// node_modules/socket.io/package.json
|
|
192156
|
-
var
|
|
192548
|
+
var require_package4 = __commonJS((exports, module) => {
|
|
192157
192549
|
module.exports = {
|
|
192158
192550
|
name: "socket.io",
|
|
192159
192551
|
version: "4.8.3",
|
|
@@ -192309,7 +192701,7 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
192309
192701
|
var uws_1 = require_uws();
|
|
192310
192702
|
var cors_1 = __importDefault(require_lib4());
|
|
192311
192703
|
var debug = (0, debug_1.default)("socket.io:server");
|
|
192312
|
-
var clientVersion =
|
|
192704
|
+
var clientVersion = require_package4().version;
|
|
192313
192705
|
var dotMapRegex = /\.map/;
|
|
192314
192706
|
|
|
192315
192707
|
class Server extends typed_events_1.StrictEventEmitter {
|
|
@@ -192597,13 +192989,13 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
192597
192989
|
this.engine.close();
|
|
192598
192990
|
(0, uws_1.restoreAdapter)();
|
|
192599
192991
|
if (this.httpServer) {
|
|
192600
|
-
return new Promise((
|
|
192992
|
+
return new Promise((resolve6) => {
|
|
192601
192993
|
this.httpServer.close((err) => {
|
|
192602
192994
|
fn9 && fn9(err);
|
|
192603
192995
|
if (err) {
|
|
192604
192996
|
debug("server was not running");
|
|
192605
192997
|
}
|
|
192606
|
-
|
|
192998
|
+
resolve6();
|
|
192607
192999
|
});
|
|
192608
193000
|
});
|
|
192609
193001
|
} else {
|
|
@@ -216626,6 +217018,68 @@ async function getUserInfo(accessToken) {
|
|
|
216626
217018
|
}
|
|
216627
217019
|
return result.data;
|
|
216628
217020
|
}
|
|
217021
|
+
// src/core/resources/secret/schema.ts
|
|
217022
|
+
var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
|
|
217023
|
+
var SetSecretsResponseSchema = exports_external.object({
|
|
217024
|
+
success: exports_external.boolean()
|
|
217025
|
+
});
|
|
217026
|
+
var DeleteSecretResponseSchema = exports_external.object({
|
|
217027
|
+
success: exports_external.boolean()
|
|
217028
|
+
});
|
|
217029
|
+
|
|
217030
|
+
// src/core/resources/secret/api.ts
|
|
217031
|
+
async function listSecrets() {
|
|
217032
|
+
const appClient = getAppClient();
|
|
217033
|
+
let response;
|
|
217034
|
+
try {
|
|
217035
|
+
response = await appClient.get("secrets");
|
|
217036
|
+
} catch (error48) {
|
|
217037
|
+
throw await ApiError.fromHttpError(error48, "listing secrets");
|
|
217038
|
+
}
|
|
217039
|
+
const result = ListSecretsResponseSchema.safeParse(await response.json());
|
|
217040
|
+
if (!result.success) {
|
|
217041
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
217042
|
+
}
|
|
217043
|
+
return result.data;
|
|
217044
|
+
}
|
|
217045
|
+
async function setSecrets(secrets) {
|
|
217046
|
+
const appClient = getAppClient();
|
|
217047
|
+
let response;
|
|
217048
|
+
try {
|
|
217049
|
+
response = await appClient.post("secrets", {
|
|
217050
|
+
json: secrets
|
|
217051
|
+
});
|
|
217052
|
+
} catch (error48) {
|
|
217053
|
+
throw await ApiError.fromHttpError(error48, "setting secrets");
|
|
217054
|
+
}
|
|
217055
|
+
const result = SetSecretsResponseSchema.safeParse(await response.json());
|
|
217056
|
+
if (!result.success) {
|
|
217057
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
217058
|
+
}
|
|
217059
|
+
return result.data;
|
|
217060
|
+
}
|
|
217061
|
+
async function deleteSecret(name2) {
|
|
217062
|
+
const appClient = getAppClient();
|
|
217063
|
+
let response;
|
|
217064
|
+
try {
|
|
217065
|
+
response = await appClient.delete("secrets", {
|
|
217066
|
+
searchParams: { secret_name: name2 }
|
|
217067
|
+
});
|
|
217068
|
+
} catch (error48) {
|
|
217069
|
+
throw await ApiError.fromHttpError(error48, "deleting secret");
|
|
217070
|
+
}
|
|
217071
|
+
const result = DeleteSecretResponseSchema.safeParse(await response.json());
|
|
217072
|
+
if (!result.success) {
|
|
217073
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
217074
|
+
}
|
|
217075
|
+
return result.data;
|
|
217076
|
+
}
|
|
217077
|
+
// src/core/utils/env.ts
|
|
217078
|
+
var import_dotenv = __toESM(require_main(), 1);
|
|
217079
|
+
async function parseEnvFile(filePath) {
|
|
217080
|
+
const content = await readTextFile(filePath);
|
|
217081
|
+
return import_dotenv.parse(content);
|
|
217082
|
+
}
|
|
216629
217083
|
// node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
216630
217084
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
216631
217085
|
var wrapAnsi16 = (offset = 0) => (code2) => `\x1B[${code2 + offset}m`;
|
|
@@ -216813,7 +217267,7 @@ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process5.
|
|
|
216813
217267
|
const terminatorPosition = argv.indexOf("--");
|
|
216814
217268
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
216815
217269
|
}
|
|
216816
|
-
var { env } = process5;
|
|
217270
|
+
var { env: env2 } = process5;
|
|
216817
217271
|
var flagForceColor;
|
|
216818
217272
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
216819
217273
|
flagForceColor = 0;
|
|
@@ -216821,14 +217275,14 @@ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || has
|
|
|
216821
217275
|
flagForceColor = 1;
|
|
216822
217276
|
}
|
|
216823
217277
|
function envForceColor() {
|
|
216824
|
-
if ("FORCE_COLOR" in
|
|
216825
|
-
if (
|
|
217278
|
+
if ("FORCE_COLOR" in env2) {
|
|
217279
|
+
if (env2.FORCE_COLOR === "true") {
|
|
216826
217280
|
return 1;
|
|
216827
217281
|
}
|
|
216828
|
-
if (
|
|
217282
|
+
if (env2.FORCE_COLOR === "false") {
|
|
216829
217283
|
return 0;
|
|
216830
217284
|
}
|
|
216831
|
-
return
|
|
217285
|
+
return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
|
|
216832
217286
|
}
|
|
216833
217287
|
}
|
|
216834
217288
|
function translateLevel(level) {
|
|
@@ -216859,14 +217313,14 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
216859
217313
|
return 2;
|
|
216860
217314
|
}
|
|
216861
217315
|
}
|
|
216862
|
-
if ("TF_BUILD" in
|
|
217316
|
+
if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
|
|
216863
217317
|
return 1;
|
|
216864
217318
|
}
|
|
216865
217319
|
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
216866
217320
|
return 0;
|
|
216867
217321
|
}
|
|
216868
217322
|
const min = forceColor || 0;
|
|
216869
|
-
if (
|
|
217323
|
+
if (env2.TERM === "dumb") {
|
|
216870
217324
|
return min;
|
|
216871
217325
|
}
|
|
216872
217326
|
if (process5.platform === "win32") {
|
|
@@ -216876,33 +217330,33 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
216876
217330
|
}
|
|
216877
217331
|
return 1;
|
|
216878
217332
|
}
|
|
216879
|
-
if ("CI" in
|
|
216880
|
-
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in
|
|
217333
|
+
if ("CI" in env2) {
|
|
217334
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env2))) {
|
|
216881
217335
|
return 3;
|
|
216882
217336
|
}
|
|
216883
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in
|
|
217337
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env2)) || env2.CI_NAME === "codeship") {
|
|
216884
217338
|
return 1;
|
|
216885
217339
|
}
|
|
216886
217340
|
return min;
|
|
216887
217341
|
}
|
|
216888
|
-
if ("TEAMCITY_VERSION" in
|
|
216889
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(
|
|
217342
|
+
if ("TEAMCITY_VERSION" in env2) {
|
|
217343
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
216890
217344
|
}
|
|
216891
|
-
if (
|
|
217345
|
+
if (env2.COLORTERM === "truecolor") {
|
|
216892
217346
|
return 3;
|
|
216893
217347
|
}
|
|
216894
|
-
if (
|
|
217348
|
+
if (env2.TERM === "xterm-kitty") {
|
|
216895
217349
|
return 3;
|
|
216896
217350
|
}
|
|
216897
|
-
if (
|
|
217351
|
+
if (env2.TERM === "xterm-ghostty") {
|
|
216898
217352
|
return 3;
|
|
216899
217353
|
}
|
|
216900
|
-
if (
|
|
217354
|
+
if (env2.TERM === "wezterm") {
|
|
216901
217355
|
return 3;
|
|
216902
217356
|
}
|
|
216903
|
-
if ("TERM_PROGRAM" in
|
|
216904
|
-
const version2 = Number.parseInt((
|
|
216905
|
-
switch (
|
|
217357
|
+
if ("TERM_PROGRAM" in env2) {
|
|
217358
|
+
const version2 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
217359
|
+
switch (env2.TERM_PROGRAM) {
|
|
216906
217360
|
case "iTerm.app": {
|
|
216907
217361
|
return version2 >= 3 ? 3 : 2;
|
|
216908
217362
|
}
|
|
@@ -216911,13 +217365,13 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
216911
217365
|
}
|
|
216912
217366
|
}
|
|
216913
217367
|
}
|
|
216914
|
-
if (/-256(color)?$/i.test(
|
|
217368
|
+
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
216915
217369
|
return 2;
|
|
216916
217370
|
}
|
|
216917
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(
|
|
217371
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
216918
217372
|
return 1;
|
|
216919
217373
|
}
|
|
216920
|
-
if ("COLORTERM" in
|
|
217374
|
+
if ("COLORTERM" in env2) {
|
|
216921
217375
|
return 1;
|
|
216922
217376
|
}
|
|
216923
217377
|
return min;
|
|
@@ -217756,12 +218210,12 @@ var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
217756
218210
|
// node_modules/is-unicode-supported/index.js
|
|
217757
218211
|
import process7 from "node:process";
|
|
217758
218212
|
function isUnicodeSupported() {
|
|
217759
|
-
const { env:
|
|
217760
|
-
const { TERM, TERM_PROGRAM } =
|
|
218213
|
+
const { env: env3 } = process7;
|
|
218214
|
+
const { TERM, TERM_PROGRAM } = env3;
|
|
217761
218215
|
if (process7.platform !== "win32") {
|
|
217762
218216
|
return TERM !== "linux";
|
|
217763
218217
|
}
|
|
217764
|
-
return Boolean(
|
|
218218
|
+
return Boolean(env3.WT_SESSION) || Boolean(env3.TERMINUS_SUBLIME) || env3.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env3.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
217765
218219
|
}
|
|
217766
218220
|
|
|
217767
218221
|
// node_modules/figures/index.js
|
|
@@ -218274,13 +218728,13 @@ import path12 from "node:path";
|
|
|
218274
218728
|
// node_modules/npm-run-path/node_modules/path-key/index.js
|
|
218275
218729
|
function pathKey(options = {}) {
|
|
218276
218730
|
const {
|
|
218277
|
-
env:
|
|
218731
|
+
env: env3 = process.env,
|
|
218278
218732
|
platform: platform6 = process.platform
|
|
218279
218733
|
} = options;
|
|
218280
218734
|
if (platform6 !== "win32") {
|
|
218281
218735
|
return "PATH";
|
|
218282
218736
|
}
|
|
218283
|
-
return Object.keys(
|
|
218737
|
+
return Object.keys(env3).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
218284
218738
|
}
|
|
218285
218739
|
|
|
218286
218740
|
// node_modules/npm-run-path/node_modules/unicorn-magic/node.js
|
|
@@ -218340,12 +218794,12 @@ var applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
|
218340
218794
|
result.push(pathPart);
|
|
218341
218795
|
}
|
|
218342
218796
|
};
|
|
218343
|
-
var npmRunPathEnv = ({ env:
|
|
218344
|
-
|
|
218345
|
-
const pathName = pathKey({ env:
|
|
218346
|
-
options.path =
|
|
218347
|
-
|
|
218348
|
-
return
|
|
218797
|
+
var npmRunPathEnv = ({ env: env3 = process8.env, ...options } = {}) => {
|
|
218798
|
+
env3 = { ...env3 };
|
|
218799
|
+
const pathName = pathKey({ env: env3 });
|
|
218800
|
+
options.path = env3[pathName];
|
|
218801
|
+
env3[pathName] = npmRunPath(options);
|
|
218802
|
+
return env3;
|
|
218349
218803
|
};
|
|
218350
218804
|
|
|
218351
218805
|
// node_modules/execa/lib/terminate/kill.js
|
|
@@ -219694,17 +220148,17 @@ var addDefaultOptions = ({
|
|
|
219694
220148
|
serialization
|
|
219695
220149
|
});
|
|
219696
220150
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath: nodePath2 }) => {
|
|
219697
|
-
const
|
|
220151
|
+
const env3 = extendEnv ? { ...process10.env, ...envOption } : envOption;
|
|
219698
220152
|
if (preferLocal || node) {
|
|
219699
220153
|
return npmRunPathEnv({
|
|
219700
|
-
env:
|
|
220154
|
+
env: env3,
|
|
219701
220155
|
cwd: localDirectory,
|
|
219702
220156
|
execPath: nodePath2,
|
|
219703
220157
|
preferLocal,
|
|
219704
220158
|
addExecPath: node
|
|
219705
220159
|
});
|
|
219706
220160
|
}
|
|
219707
|
-
return
|
|
220161
|
+
return env3;
|
|
219708
220162
|
};
|
|
219709
220163
|
|
|
219710
220164
|
// node_modules/execa/lib/arguments/shell.js
|
|
@@ -223964,6 +224418,7 @@ var package_default = {
|
|
|
223964
224418
|
commander: "^12.1.0",
|
|
223965
224419
|
"common-tags": "^1.8.2",
|
|
223966
224420
|
cors: "^2.8.5",
|
|
224421
|
+
dotenv: "17.3.1",
|
|
223967
224422
|
ejs: "^3.1.10",
|
|
223968
224423
|
execa: "^9.6.1",
|
|
223969
224424
|
express: "^5.0.1",
|
|
@@ -225610,8 +226065,114 @@ function getLogsCommand(context) {
|
|
|
225610
226065
|
});
|
|
225611
226066
|
}
|
|
225612
226067
|
|
|
225613
|
-
// src/cli/commands/
|
|
226068
|
+
// src/cli/commands/secrets/delete.ts
|
|
226069
|
+
async function deleteSecretAction(key) {
|
|
226070
|
+
await runTask(`Deleting secret "${key}"`, async () => {
|
|
226071
|
+
return await deleteSecret(key);
|
|
226072
|
+
}, {
|
|
226073
|
+
successMessage: `Secret "${key}" deleted`,
|
|
226074
|
+
errorMessage: `Failed to delete secret "${key}"`
|
|
226075
|
+
});
|
|
226076
|
+
return {
|
|
226077
|
+
outroMessage: "Secret deleted successfully."
|
|
226078
|
+
};
|
|
226079
|
+
}
|
|
226080
|
+
function getSecretsDeleteCommand(context) {
|
|
226081
|
+
return new Command("delete").description("Delete a secret").argument("<key>", "Secret name to delete").action(async (key) => {
|
|
226082
|
+
await runCommand(() => deleteSecretAction(key), { requireAuth: true }, context);
|
|
226083
|
+
});
|
|
226084
|
+
}
|
|
226085
|
+
|
|
226086
|
+
// src/cli/commands/secrets/list.ts
|
|
226087
|
+
async function listSecretsAction() {
|
|
226088
|
+
const secrets = await runTask("Fetching secrets from Base44", async () => {
|
|
226089
|
+
return await listSecrets();
|
|
226090
|
+
}, {
|
|
226091
|
+
successMessage: "Secrets fetched successfully",
|
|
226092
|
+
errorMessage: "Failed to fetch secrets"
|
|
226093
|
+
});
|
|
226094
|
+
const names = Object.keys(secrets);
|
|
226095
|
+
if (names.length === 0) {
|
|
226096
|
+
return { outroMessage: "No secrets configured." };
|
|
226097
|
+
}
|
|
226098
|
+
for (const name2 of names) {
|
|
226099
|
+
R2.info(name2);
|
|
226100
|
+
}
|
|
226101
|
+
return {
|
|
226102
|
+
outroMessage: `Found ${names.length} secrets.`
|
|
226103
|
+
};
|
|
226104
|
+
}
|
|
226105
|
+
function getSecretsListCommand(context) {
|
|
226106
|
+
return new Command("list").description("List secret names").action(async () => {
|
|
226107
|
+
await runCommand(listSecretsAction, { requireAuth: true }, context);
|
|
226108
|
+
});
|
|
226109
|
+
}
|
|
226110
|
+
|
|
226111
|
+
// src/cli/commands/secrets/set.ts
|
|
225614
226112
|
import { resolve as resolve3 } from "node:path";
|
|
226113
|
+
function parseEntries(entries) {
|
|
226114
|
+
const secrets = {};
|
|
226115
|
+
for (const entry of entries) {
|
|
226116
|
+
const eqIndex = entry.indexOf("=");
|
|
226117
|
+
if (eqIndex === -1) {
|
|
226118
|
+
throw new InvalidInputError(`Invalid format: "${entry}". Expected KEY=VALUE.`);
|
|
226119
|
+
}
|
|
226120
|
+
const key = entry.slice(0, eqIndex);
|
|
226121
|
+
const value = entry.slice(eqIndex + 1);
|
|
226122
|
+
if (!key) {
|
|
226123
|
+
throw new InvalidInputError(`Invalid format: "${entry}". Key cannot be empty.`);
|
|
226124
|
+
}
|
|
226125
|
+
secrets[key] = value;
|
|
226126
|
+
}
|
|
226127
|
+
return secrets;
|
|
226128
|
+
}
|
|
226129
|
+
function validateInput(command) {
|
|
226130
|
+
const entries = command.args;
|
|
226131
|
+
const { envFile } = command.opts();
|
|
226132
|
+
const hasEntries = entries.length > 0;
|
|
226133
|
+
const hasEnvFile = Boolean(envFile);
|
|
226134
|
+
if (!hasEntries && !hasEnvFile) {
|
|
226135
|
+
throw new InvalidInputError("Provide KEY=VALUE pairs or use --env-file. Example: base44 secrets set KEY1=VALUE1 KEY2=VALUE2");
|
|
226136
|
+
}
|
|
226137
|
+
if (hasEntries && hasEnvFile) {
|
|
226138
|
+
throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
|
|
226139
|
+
}
|
|
226140
|
+
}
|
|
226141
|
+
async function setSecretsAction(entries, options) {
|
|
226142
|
+
let secrets;
|
|
226143
|
+
if (options.envFile) {
|
|
226144
|
+
secrets = await parseEnvFile(resolve3(options.envFile));
|
|
226145
|
+
if (Object.keys(secrets).length === 0) {
|
|
226146
|
+
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
226147
|
+
}
|
|
226148
|
+
} else {
|
|
226149
|
+
secrets = parseEntries(entries);
|
|
226150
|
+
}
|
|
226151
|
+
const names = Object.keys(secrets);
|
|
226152
|
+
await runTask(`Setting ${names.length} secrets`, async () => {
|
|
226153
|
+
return await setSecrets(secrets);
|
|
226154
|
+
}, {
|
|
226155
|
+
successMessage: `${names.length} secrets set successfully`,
|
|
226156
|
+
errorMessage: "Failed to set secrets"
|
|
226157
|
+
});
|
|
226158
|
+
R2.info(`Set: ${names.join(", ")}`);
|
|
226159
|
+
return {
|
|
226160
|
+
outroMessage: "Secrets set successfully."
|
|
226161
|
+
};
|
|
226162
|
+
}
|
|
226163
|
+
function getSecretsSetCommand(context) {
|
|
226164
|
+
return new Command("set").description("Set one or more secrets (KEY=VALUE format)").argument("[entries...]", "KEY=VALUE pairs (e.g. KEY1=VALUE1 KEY2=VALUE2)").option("--env-file <path>", "Path to .env file").hook("preAction", validateInput).action(async (entries, options) => {
|
|
226165
|
+
await runCommand(() => setSecretsAction(entries, options), { requireAuth: true }, context);
|
|
226166
|
+
});
|
|
226167
|
+
}
|
|
226168
|
+
|
|
226169
|
+
// src/cli/commands/secrets/index.ts
|
|
226170
|
+
function getSecretsCommand(context) {
|
|
226171
|
+
return new Command("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand(context)).addCommand(getSecretsSetCommand(context)).addCommand(getSecretsDeleteCommand(context));
|
|
226172
|
+
}
|
|
226173
|
+
|
|
226174
|
+
// src/cli/commands/site/deploy.ts
|
|
226175
|
+
import { resolve as resolve4 } from "node:path";
|
|
225615
226176
|
async function deployAction2(options) {
|
|
225616
226177
|
const { project: project2 } = await readProjectConfig();
|
|
225617
226178
|
if (!project2.site?.outputDirectory) {
|
|
@@ -225623,7 +226184,7 @@ async function deployAction2(options) {
|
|
|
225623
226184
|
]
|
|
225624
226185
|
});
|
|
225625
226186
|
}
|
|
225626
|
-
const outputDir =
|
|
226187
|
+
const outputDir = resolve4(project2.root, project2.site.outputDirectory);
|
|
225627
226188
|
if (!options.yes) {
|
|
225628
226189
|
const shouldDeploy = await Re({
|
|
225629
226190
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -225725,9 +226286,9 @@ async function generateContent(input) {
|
|
|
225725
226286
|
`);
|
|
225726
226287
|
}
|
|
225727
226288
|
async function compileEntity(entity2) {
|
|
225728
|
-
const { name: name2, ...
|
|
226289
|
+
const { name: name2, ...schema9 } = entity2;
|
|
225729
226290
|
const jsonSchema = {
|
|
225730
|
-
...
|
|
226291
|
+
...schema9,
|
|
225731
226292
|
title: name2,
|
|
225732
226293
|
additionalProperties: false
|
|
225733
226294
|
};
|
|
@@ -225831,14 +226392,14 @@ var getLocalHosts = () => {
|
|
|
225831
226392
|
}
|
|
225832
226393
|
return results;
|
|
225833
226394
|
};
|
|
225834
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
226395
|
+
var checkAvailablePort = (options8) => new Promise((resolve6, reject) => {
|
|
225835
226396
|
const server = net.createServer();
|
|
225836
226397
|
server.unref();
|
|
225837
226398
|
server.on("error", reject);
|
|
225838
226399
|
server.listen(options8, () => {
|
|
225839
226400
|
const { port } = server.address();
|
|
225840
226401
|
server.close(() => {
|
|
225841
|
-
|
|
226402
|
+
resolve6(port);
|
|
225842
226403
|
});
|
|
225843
226404
|
});
|
|
225844
226405
|
});
|
|
@@ -226062,7 +226623,7 @@ class FunctionManager {
|
|
|
226062
226623
|
});
|
|
226063
226624
|
}
|
|
226064
226625
|
waitForReady(name2, runningFunc) {
|
|
226065
|
-
return new Promise((
|
|
226626
|
+
return new Promise((resolve6, reject) => {
|
|
226066
226627
|
runningFunc.process.on("exit", (code2) => {
|
|
226067
226628
|
if (!runningFunc.ready) {
|
|
226068
226629
|
clearTimeout(timeout3);
|
|
@@ -226085,7 +226646,7 @@ class FunctionManager {
|
|
|
226085
226646
|
runningFunc.ready = true;
|
|
226086
226647
|
clearTimeout(timeout3);
|
|
226087
226648
|
runningFunc.process.stdout?.off("data", onData);
|
|
226088
|
-
|
|
226649
|
+
resolve6(runningFunc.port);
|
|
226089
226650
|
}
|
|
226090
226651
|
};
|
|
226091
226652
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -226474,7 +227035,7 @@ async function createDevServer(options8) {
|
|
|
226474
227035
|
app.use((req, res, next) => {
|
|
226475
227036
|
return remoteProxy(req, res, next);
|
|
226476
227037
|
});
|
|
226477
|
-
return new Promise((
|
|
227038
|
+
return new Promise((resolve6, reject) => {
|
|
226478
227039
|
const server = app.listen(port, "127.0.0.1", (err) => {
|
|
226479
227040
|
if (err) {
|
|
226480
227041
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -226494,7 +227055,7 @@ async function createDevServer(options8) {
|
|
|
226494
227055
|
};
|
|
226495
227056
|
process.on("SIGINT", shutdown);
|
|
226496
227057
|
process.on("SIGTERM", shutdown);
|
|
226497
|
-
|
|
227058
|
+
resolve6({
|
|
226498
227059
|
port,
|
|
226499
227060
|
server
|
|
226500
227061
|
});
|
|
@@ -226529,7 +227090,7 @@ function getDevCommand(context) {
|
|
|
226529
227090
|
}
|
|
226530
227091
|
|
|
226531
227092
|
// src/cli/commands/project/eject.ts
|
|
226532
|
-
import { resolve as
|
|
227093
|
+
import { resolve as resolve6 } from "node:path";
|
|
226533
227094
|
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
226534
227095
|
async function eject(options8) {
|
|
226535
227096
|
const projects = await listProjects();
|
|
@@ -226549,6 +227110,9 @@ async function eject(options8) {
|
|
|
226549
227110
|
selectedProject = foundProject;
|
|
226550
227111
|
R2.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
|
|
226551
227112
|
} else {
|
|
227113
|
+
if (ejectableProjects.length === 0) {
|
|
227114
|
+
return { outroMessage: "No projects available to eject." };
|
|
227115
|
+
}
|
|
226552
227116
|
const projectOptions = ejectableProjects.map((p4) => ({
|
|
226553
227117
|
value: p4,
|
|
226554
227118
|
label: p4.name,
|
|
@@ -226575,7 +227139,7 @@ async function eject(options8) {
|
|
|
226575
227139
|
Ne("Operation cancelled.");
|
|
226576
227140
|
throw new CLIExitError(0);
|
|
226577
227141
|
}
|
|
226578
|
-
const resolvedPath =
|
|
227142
|
+
const resolvedPath = resolve6(selectedPath);
|
|
226579
227143
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
226580
227144
|
await createProjectFilesForExistingProject({
|
|
226581
227145
|
projectId,
|
|
@@ -226638,6 +227202,7 @@ function createProgram(context) {
|
|
|
226638
227202
|
program2.addCommand(getAgentsCommand(context));
|
|
226639
227203
|
program2.addCommand(getConnectorsCommand(context));
|
|
226640
227204
|
program2.addCommand(getFunctionsDeployCommand(context));
|
|
227205
|
+
program2.addCommand(getSecretsCommand(context));
|
|
226641
227206
|
program2.addCommand(getSiteCommand(context));
|
|
226642
227207
|
program2.addCommand(getTypesCommand(context));
|
|
226643
227208
|
program2.addCommand(getDevCommand(context), { hidden: true });
|
|
@@ -228937,14 +229502,14 @@ async function addSourceContext(frames) {
|
|
|
228937
229502
|
return frames;
|
|
228938
229503
|
}
|
|
228939
229504
|
function getContextLinesFromFile(path18, ranges, output) {
|
|
228940
|
-
return new Promise((
|
|
229505
|
+
return new Promise((resolve7) => {
|
|
228941
229506
|
const stream = createReadStream2(path18);
|
|
228942
229507
|
const lineReaded = createInterface2({
|
|
228943
229508
|
input: stream
|
|
228944
229509
|
});
|
|
228945
229510
|
function destroyStreamAndResolve() {
|
|
228946
229511
|
stream.destroy();
|
|
228947
|
-
|
|
229512
|
+
resolve7();
|
|
228948
229513
|
}
|
|
228949
229514
|
let lineNumber = 0;
|
|
228950
229515
|
let currentRangeIndex = 0;
|
|
@@ -230056,15 +230621,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
230056
230621
|
return true;
|
|
230057
230622
|
if (this.featureFlagsPoller === undefined)
|
|
230058
230623
|
return false;
|
|
230059
|
-
return new Promise((
|
|
230624
|
+
return new Promise((resolve7) => {
|
|
230060
230625
|
const timeout3 = setTimeout(() => {
|
|
230061
230626
|
cleanup();
|
|
230062
|
-
|
|
230627
|
+
resolve7(false);
|
|
230063
230628
|
}, timeoutMs);
|
|
230064
230629
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
230065
230630
|
clearTimeout(timeout3);
|
|
230066
230631
|
cleanup();
|
|
230067
|
-
|
|
230632
|
+
resolve7(count2 > 0);
|
|
230068
230633
|
});
|
|
230069
230634
|
});
|
|
230070
230635
|
}
|
|
@@ -230876,4 +231441,4 @@ export {
|
|
|
230876
231441
|
CLIExitError
|
|
230877
231442
|
};
|
|
230878
231443
|
|
|
230879
|
-
//# debugId=
|
|
231444
|
+
//# debugId=1F6461CDF975117264756E2164756E21
|