@base44-preview/cli 0.0.45-pr.406.ed52e60 → 0.0.45-pr.420.1329187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/deno-runtime/main.ts +72 -0
- package/dist/cli/index.js +1732 -1731
- package/dist/cli/index.js.map +62 -63
- package/package.json +1 -1
- package/dist/assets/deno-runtime/main.js +0 -31
- package/dist/assets/deno-runtime/main.js.map +0 -10
package/dist/cli/index.js
CHANGED
|
@@ -3188,9 +3188,9 @@ var require_fs = __commonJS((exports) => {
|
|
|
3188
3188
|
var require_path = __commonJS((exports) => {
|
|
3189
3189
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3190
3190
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = undefined;
|
|
3191
|
-
var
|
|
3191
|
+
var os2 = __require("os");
|
|
3192
3192
|
var path8 = __require("path");
|
|
3193
|
-
var IS_WINDOWS_PLATFORM =
|
|
3193
|
+
var IS_WINDOWS_PLATFORM = os2.platform() === "win32";
|
|
3194
3194
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
3195
3195
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
3196
3196
|
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
@@ -8243,8 +8243,8 @@ var require_settings4 = __commonJS((exports) => {
|
|
|
8243
8243
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8244
8244
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = undefined;
|
|
8245
8245
|
var fs11 = __require("fs");
|
|
8246
|
-
var
|
|
8247
|
-
var CPU_COUNT = Math.max(
|
|
8246
|
+
var os2 = __require("os");
|
|
8247
|
+
var CPU_COUNT = Math.max(os2.cpus().length, 1);
|
|
8248
8248
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
8249
8249
|
lstat: fs11.lstat,
|
|
8250
8250
|
lstatSync: fs11.lstatSync,
|
|
@@ -12363,403 +12363,11 @@ var require_front_matter = __commonJS((exports, module) => {
|
|
|
12363
12363
|
}
|
|
12364
12364
|
});
|
|
12365
12365
|
|
|
12366
|
-
// ../../node_modules/dotenv/package.json
|
|
12367
|
-
var require_package2 = __commonJS((exports, module) => {
|
|
12368
|
-
module.exports = {
|
|
12369
|
-
name: "dotenv",
|
|
12370
|
-
version: "17.3.1",
|
|
12371
|
-
description: "Loads environment variables from .env file",
|
|
12372
|
-
main: "lib/main.js",
|
|
12373
|
-
types: "lib/main.d.ts",
|
|
12374
|
-
exports: {
|
|
12375
|
-
".": {
|
|
12376
|
-
types: "./lib/main.d.ts",
|
|
12377
|
-
require: "./lib/main.js",
|
|
12378
|
-
default: "./lib/main.js"
|
|
12379
|
-
},
|
|
12380
|
-
"./config": "./config.js",
|
|
12381
|
-
"./config.js": "./config.js",
|
|
12382
|
-
"./lib/env-options": "./lib/env-options.js",
|
|
12383
|
-
"./lib/env-options.js": "./lib/env-options.js",
|
|
12384
|
-
"./lib/cli-options": "./lib/cli-options.js",
|
|
12385
|
-
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
12386
|
-
"./package.json": "./package.json"
|
|
12387
|
-
},
|
|
12388
|
-
scripts: {
|
|
12389
|
-
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
12390
|
-
lint: "standard",
|
|
12391
|
-
pretest: "npm run lint && npm run dts-check",
|
|
12392
|
-
test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
12393
|
-
"test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
|
12394
|
-
prerelease: "npm test",
|
|
12395
|
-
release: "standard-version"
|
|
12396
|
-
},
|
|
12397
|
-
repository: {
|
|
12398
|
-
type: "git",
|
|
12399
|
-
url: "git://github.com/motdotla/dotenv.git"
|
|
12400
|
-
},
|
|
12401
|
-
homepage: "https://github.com/motdotla/dotenv#readme",
|
|
12402
|
-
funding: "https://dotenvx.com",
|
|
12403
|
-
keywords: [
|
|
12404
|
-
"dotenv",
|
|
12405
|
-
"env",
|
|
12406
|
-
".env",
|
|
12407
|
-
"environment",
|
|
12408
|
-
"variables",
|
|
12409
|
-
"config",
|
|
12410
|
-
"settings"
|
|
12411
|
-
],
|
|
12412
|
-
readmeFilename: "README.md",
|
|
12413
|
-
license: "BSD-2-Clause",
|
|
12414
|
-
devDependencies: {
|
|
12415
|
-
"@types/node": "^18.11.3",
|
|
12416
|
-
decache: "^4.6.2",
|
|
12417
|
-
sinon: "^14.0.1",
|
|
12418
|
-
standard: "^17.0.0",
|
|
12419
|
-
"standard-version": "^9.5.0",
|
|
12420
|
-
tap: "^19.2.0",
|
|
12421
|
-
typescript: "^4.8.4"
|
|
12422
|
-
},
|
|
12423
|
-
engines: {
|
|
12424
|
-
node: ">=12"
|
|
12425
|
-
},
|
|
12426
|
-
browser: {
|
|
12427
|
-
fs: false
|
|
12428
|
-
}
|
|
12429
|
-
};
|
|
12430
|
-
});
|
|
12431
|
-
|
|
12432
|
-
// ../../node_modules/dotenv/lib/main.js
|
|
12433
|
-
var require_main = __commonJS((exports, module) => {
|
|
12434
|
-
var fs14 = __require("fs");
|
|
12435
|
-
var path11 = __require("path");
|
|
12436
|
-
var os = __require("os");
|
|
12437
|
-
var crypto = __require("crypto");
|
|
12438
|
-
var packageJson = require_package2();
|
|
12439
|
-
var version2 = packageJson.version;
|
|
12440
|
-
var TIPS = [
|
|
12441
|
-
"\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com",
|
|
12442
|
-
"\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit",
|
|
12443
|
-
"\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild",
|
|
12444
|
-
"\uD83E\uDD16 agentic secret storage: https://dotenvx.com/as2",
|
|
12445
|
-
"⚡️ secrets for agents: https://dotenvx.com/as2",
|
|
12446
|
-
"\uD83D\uDEE1️ auth for agents: https://vestauth.com",
|
|
12447
|
-
"\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`",
|
|
12448
|
-
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
|
12449
|
-
"⚙️ enable debug logging with { debug: true }",
|
|
12450
|
-
"⚙️ override existing env vars with { override: true }",
|
|
12451
|
-
"⚙️ suppress all logs with { quiet: true }",
|
|
12452
|
-
"⚙️ write to custom object with { processEnv: myObject }",
|
|
12453
|
-
"⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
|
|
12454
|
-
];
|
|
12455
|
-
function _getRandomTip() {
|
|
12456
|
-
return TIPS[Math.floor(Math.random() * TIPS.length)];
|
|
12457
|
-
}
|
|
12458
|
-
function parseBoolean(value) {
|
|
12459
|
-
if (typeof value === "string") {
|
|
12460
|
-
return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
|
|
12461
|
-
}
|
|
12462
|
-
return Boolean(value);
|
|
12463
|
-
}
|
|
12464
|
-
function supportsAnsi() {
|
|
12465
|
-
return process.stdout.isTTY;
|
|
12466
|
-
}
|
|
12467
|
-
function dim(text) {
|
|
12468
|
-
return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
|
|
12469
|
-
}
|
|
12470
|
-
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
12471
|
-
function parse9(src) {
|
|
12472
|
-
const obj = {};
|
|
12473
|
-
let lines = src.toString();
|
|
12474
|
-
lines = lines.replace(/\r\n?/mg, `
|
|
12475
|
-
`);
|
|
12476
|
-
let match;
|
|
12477
|
-
while ((match = LINE.exec(lines)) != null) {
|
|
12478
|
-
const key = match[1];
|
|
12479
|
-
let value = match[2] || "";
|
|
12480
|
-
value = value.trim();
|
|
12481
|
-
const maybeQuote = value[0];
|
|
12482
|
-
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
12483
|
-
if (maybeQuote === '"') {
|
|
12484
|
-
value = value.replace(/\\n/g, `
|
|
12485
|
-
`);
|
|
12486
|
-
value = value.replace(/\\r/g, "\r");
|
|
12487
|
-
}
|
|
12488
|
-
obj[key] = value;
|
|
12489
|
-
}
|
|
12490
|
-
return obj;
|
|
12491
|
-
}
|
|
12492
|
-
function _parseVault(options) {
|
|
12493
|
-
options = options || {};
|
|
12494
|
-
const vaultPath = _vaultPath(options);
|
|
12495
|
-
options.path = vaultPath;
|
|
12496
|
-
const result = DotenvModule.configDotenv(options);
|
|
12497
|
-
if (!result.parsed) {
|
|
12498
|
-
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
12499
|
-
err.code = "MISSING_DATA";
|
|
12500
|
-
throw err;
|
|
12501
|
-
}
|
|
12502
|
-
const keys = _dotenvKey(options).split(",");
|
|
12503
|
-
const length = keys.length;
|
|
12504
|
-
let decrypted;
|
|
12505
|
-
for (let i = 0;i < length; i++) {
|
|
12506
|
-
try {
|
|
12507
|
-
const key = keys[i].trim();
|
|
12508
|
-
const attrs = _instructions(result, key);
|
|
12509
|
-
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
12510
|
-
break;
|
|
12511
|
-
} catch (error48) {
|
|
12512
|
-
if (i + 1 >= length) {
|
|
12513
|
-
throw error48;
|
|
12514
|
-
}
|
|
12515
|
-
}
|
|
12516
|
-
}
|
|
12517
|
-
return DotenvModule.parse(decrypted);
|
|
12518
|
-
}
|
|
12519
|
-
function _warn(message) {
|
|
12520
|
-
console.error(`[dotenv@${version2}][WARN] ${message}`);
|
|
12521
|
-
}
|
|
12522
|
-
function _debug(message) {
|
|
12523
|
-
console.log(`[dotenv@${version2}][DEBUG] ${message}`);
|
|
12524
|
-
}
|
|
12525
|
-
function _log(message) {
|
|
12526
|
-
console.log(`[dotenv@${version2}] ${message}`);
|
|
12527
|
-
}
|
|
12528
|
-
function _dotenvKey(options) {
|
|
12529
|
-
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
12530
|
-
return options.DOTENV_KEY;
|
|
12531
|
-
}
|
|
12532
|
-
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
12533
|
-
return process.env.DOTENV_KEY;
|
|
12534
|
-
}
|
|
12535
|
-
return "";
|
|
12536
|
-
}
|
|
12537
|
-
function _instructions(result, dotenvKey) {
|
|
12538
|
-
let uri;
|
|
12539
|
-
try {
|
|
12540
|
-
uri = new URL(dotenvKey);
|
|
12541
|
-
} catch (error48) {
|
|
12542
|
-
if (error48.code === "ERR_INVALID_URL") {
|
|
12543
|
-
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");
|
|
12544
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
12545
|
-
throw err;
|
|
12546
|
-
}
|
|
12547
|
-
throw error48;
|
|
12548
|
-
}
|
|
12549
|
-
const key = uri.password;
|
|
12550
|
-
if (!key) {
|
|
12551
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
12552
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
12553
|
-
throw err;
|
|
12554
|
-
}
|
|
12555
|
-
const environment = uri.searchParams.get("environment");
|
|
12556
|
-
if (!environment) {
|
|
12557
|
-
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
12558
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
12559
|
-
throw err;
|
|
12560
|
-
}
|
|
12561
|
-
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
12562
|
-
const ciphertext = result.parsed[environmentKey];
|
|
12563
|
-
if (!ciphertext) {
|
|
12564
|
-
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
12565
|
-
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
12566
|
-
throw err;
|
|
12567
|
-
}
|
|
12568
|
-
return { ciphertext, key };
|
|
12569
|
-
}
|
|
12570
|
-
function _vaultPath(options) {
|
|
12571
|
-
let possibleVaultPath = null;
|
|
12572
|
-
if (options && options.path && options.path.length > 0) {
|
|
12573
|
-
if (Array.isArray(options.path)) {
|
|
12574
|
-
for (const filepath of options.path) {
|
|
12575
|
-
if (fs14.existsSync(filepath)) {
|
|
12576
|
-
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
12577
|
-
}
|
|
12578
|
-
}
|
|
12579
|
-
} else {
|
|
12580
|
-
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
12581
|
-
}
|
|
12582
|
-
} else {
|
|
12583
|
-
possibleVaultPath = path11.resolve(process.cwd(), ".env.vault");
|
|
12584
|
-
}
|
|
12585
|
-
if (fs14.existsSync(possibleVaultPath)) {
|
|
12586
|
-
return possibleVaultPath;
|
|
12587
|
-
}
|
|
12588
|
-
return null;
|
|
12589
|
-
}
|
|
12590
|
-
function _resolveHome(envPath) {
|
|
12591
|
-
return envPath[0] === "~" ? path11.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
12592
|
-
}
|
|
12593
|
-
function _configVault(options) {
|
|
12594
|
-
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
12595
|
-
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
12596
|
-
if (debug || !quiet) {
|
|
12597
|
-
_log("Loading env from encrypted .env.vault");
|
|
12598
|
-
}
|
|
12599
|
-
const parsed = DotenvModule._parseVault(options);
|
|
12600
|
-
let processEnv = process.env;
|
|
12601
|
-
if (options && options.processEnv != null) {
|
|
12602
|
-
processEnv = options.processEnv;
|
|
12603
|
-
}
|
|
12604
|
-
DotenvModule.populate(processEnv, parsed, options);
|
|
12605
|
-
return { parsed };
|
|
12606
|
-
}
|
|
12607
|
-
function configDotenv(options) {
|
|
12608
|
-
const dotenvPath = path11.resolve(process.cwd(), ".env");
|
|
12609
|
-
let encoding = "utf8";
|
|
12610
|
-
let processEnv = process.env;
|
|
12611
|
-
if (options && options.processEnv != null) {
|
|
12612
|
-
processEnv = options.processEnv;
|
|
12613
|
-
}
|
|
12614
|
-
let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
12615
|
-
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
12616
|
-
if (options && options.encoding) {
|
|
12617
|
-
encoding = options.encoding;
|
|
12618
|
-
} else {
|
|
12619
|
-
if (debug) {
|
|
12620
|
-
_debug("No encoding is specified. UTF-8 is used by default");
|
|
12621
|
-
}
|
|
12622
|
-
}
|
|
12623
|
-
let optionPaths = [dotenvPath];
|
|
12624
|
-
if (options && options.path) {
|
|
12625
|
-
if (!Array.isArray(options.path)) {
|
|
12626
|
-
optionPaths = [_resolveHome(options.path)];
|
|
12627
|
-
} else {
|
|
12628
|
-
optionPaths = [];
|
|
12629
|
-
for (const filepath of options.path) {
|
|
12630
|
-
optionPaths.push(_resolveHome(filepath));
|
|
12631
|
-
}
|
|
12632
|
-
}
|
|
12633
|
-
}
|
|
12634
|
-
let lastError;
|
|
12635
|
-
const parsedAll = {};
|
|
12636
|
-
for (const path12 of optionPaths) {
|
|
12637
|
-
try {
|
|
12638
|
-
const parsed = DotenvModule.parse(fs14.readFileSync(path12, { encoding }));
|
|
12639
|
-
DotenvModule.populate(parsedAll, parsed, options);
|
|
12640
|
-
} catch (e2) {
|
|
12641
|
-
if (debug) {
|
|
12642
|
-
_debug(`Failed to load ${path12} ${e2.message}`);
|
|
12643
|
-
}
|
|
12644
|
-
lastError = e2;
|
|
12645
|
-
}
|
|
12646
|
-
}
|
|
12647
|
-
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
12648
|
-
debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
|
|
12649
|
-
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
|
|
12650
|
-
if (debug || !quiet) {
|
|
12651
|
-
const keysCount = Object.keys(populated).length;
|
|
12652
|
-
const shortPaths = [];
|
|
12653
|
-
for (const filePath of optionPaths) {
|
|
12654
|
-
try {
|
|
12655
|
-
const relative3 = path11.relative(process.cwd(), filePath);
|
|
12656
|
-
shortPaths.push(relative3);
|
|
12657
|
-
} catch (e2) {
|
|
12658
|
-
if (debug) {
|
|
12659
|
-
_debug(`Failed to load ${filePath} ${e2.message}`);
|
|
12660
|
-
}
|
|
12661
|
-
lastError = e2;
|
|
12662
|
-
}
|
|
12663
|
-
}
|
|
12664
|
-
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim(`-- tip: ${_getRandomTip()}`)}`);
|
|
12665
|
-
}
|
|
12666
|
-
if (lastError) {
|
|
12667
|
-
return { parsed: parsedAll, error: lastError };
|
|
12668
|
-
} else {
|
|
12669
|
-
return { parsed: parsedAll };
|
|
12670
|
-
}
|
|
12671
|
-
}
|
|
12672
|
-
function config9(options) {
|
|
12673
|
-
if (_dotenvKey(options).length === 0) {
|
|
12674
|
-
return DotenvModule.configDotenv(options);
|
|
12675
|
-
}
|
|
12676
|
-
const vaultPath = _vaultPath(options);
|
|
12677
|
-
if (!vaultPath) {
|
|
12678
|
-
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
12679
|
-
return DotenvModule.configDotenv(options);
|
|
12680
|
-
}
|
|
12681
|
-
return DotenvModule._configVault(options);
|
|
12682
|
-
}
|
|
12683
|
-
function decrypt(encrypted, keyStr) {
|
|
12684
|
-
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
12685
|
-
let ciphertext = Buffer.from(encrypted, "base64");
|
|
12686
|
-
const nonce = ciphertext.subarray(0, 12);
|
|
12687
|
-
const authTag = ciphertext.subarray(-16);
|
|
12688
|
-
ciphertext = ciphertext.subarray(12, -16);
|
|
12689
|
-
try {
|
|
12690
|
-
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
12691
|
-
aesgcm.setAuthTag(authTag);
|
|
12692
|
-
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
12693
|
-
} catch (error48) {
|
|
12694
|
-
const isRange = error48 instanceof RangeError;
|
|
12695
|
-
const invalidKeyLength = error48.message === "Invalid key length";
|
|
12696
|
-
const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
|
|
12697
|
-
if (isRange || invalidKeyLength) {
|
|
12698
|
-
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
12699
|
-
err.code = "INVALID_DOTENV_KEY";
|
|
12700
|
-
throw err;
|
|
12701
|
-
} else if (decryptionFailed) {
|
|
12702
|
-
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
12703
|
-
err.code = "DECRYPTION_FAILED";
|
|
12704
|
-
throw err;
|
|
12705
|
-
} else {
|
|
12706
|
-
throw error48;
|
|
12707
|
-
}
|
|
12708
|
-
}
|
|
12709
|
-
}
|
|
12710
|
-
function populate(processEnv, parsed, options = {}) {
|
|
12711
|
-
const debug = Boolean(options && options.debug);
|
|
12712
|
-
const override = Boolean(options && options.override);
|
|
12713
|
-
const populated = {};
|
|
12714
|
-
if (typeof parsed !== "object") {
|
|
12715
|
-
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
12716
|
-
err.code = "OBJECT_REQUIRED";
|
|
12717
|
-
throw err;
|
|
12718
|
-
}
|
|
12719
|
-
for (const key of Object.keys(parsed)) {
|
|
12720
|
-
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
12721
|
-
if (override === true) {
|
|
12722
|
-
processEnv[key] = parsed[key];
|
|
12723
|
-
populated[key] = parsed[key];
|
|
12724
|
-
}
|
|
12725
|
-
if (debug) {
|
|
12726
|
-
if (override === true) {
|
|
12727
|
-
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
12728
|
-
} else {
|
|
12729
|
-
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
12730
|
-
}
|
|
12731
|
-
}
|
|
12732
|
-
} else {
|
|
12733
|
-
processEnv[key] = parsed[key];
|
|
12734
|
-
populated[key] = parsed[key];
|
|
12735
|
-
}
|
|
12736
|
-
}
|
|
12737
|
-
return populated;
|
|
12738
|
-
}
|
|
12739
|
-
var DotenvModule = {
|
|
12740
|
-
configDotenv,
|
|
12741
|
-
_configVault,
|
|
12742
|
-
_parseVault,
|
|
12743
|
-
config: config9,
|
|
12744
|
-
decrypt,
|
|
12745
|
-
parse: parse9,
|
|
12746
|
-
populate
|
|
12747
|
-
};
|
|
12748
|
-
exports.configDotenv = DotenvModule.configDotenv;
|
|
12749
|
-
exports._configVault = DotenvModule._configVault;
|
|
12750
|
-
exports._parseVault = DotenvModule._parseVault;
|
|
12751
|
-
exports.config = DotenvModule.config;
|
|
12752
|
-
exports.decrypt = DotenvModule.decrypt;
|
|
12753
|
-
exports.parse = DotenvModule.parse;
|
|
12754
|
-
exports.populate = DotenvModule.populate;
|
|
12755
|
-
module.exports = DotenvModule;
|
|
12756
|
-
});
|
|
12757
|
-
|
|
12758
12366
|
// ../../node_modules/isexe/windows.js
|
|
12759
12367
|
var require_windows = __commonJS((exports, module) => {
|
|
12760
12368
|
module.exports = isexe;
|
|
12761
12369
|
isexe.sync = sync;
|
|
12762
|
-
var
|
|
12370
|
+
var fs14 = __require("fs");
|
|
12763
12371
|
function checkPathExt(path11, options) {
|
|
12764
12372
|
var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT;
|
|
12765
12373
|
if (!pathext) {
|
|
@@ -12784,12 +12392,12 @@ var require_windows = __commonJS((exports, module) => {
|
|
|
12784
12392
|
return checkPathExt(path11, options);
|
|
12785
12393
|
}
|
|
12786
12394
|
function isexe(path11, options, cb) {
|
|
12787
|
-
|
|
12395
|
+
fs14.stat(path11, function(er, stat) {
|
|
12788
12396
|
cb(er, er ? false : checkStat(stat, path11, options));
|
|
12789
12397
|
});
|
|
12790
12398
|
}
|
|
12791
12399
|
function sync(path11, options) {
|
|
12792
|
-
return checkStat(
|
|
12400
|
+
return checkStat(fs14.statSync(path11), path11, options);
|
|
12793
12401
|
}
|
|
12794
12402
|
});
|
|
12795
12403
|
|
|
@@ -12797,14 +12405,14 @@ var require_windows = __commonJS((exports, module) => {
|
|
|
12797
12405
|
var require_mode = __commonJS((exports, module) => {
|
|
12798
12406
|
module.exports = isexe;
|
|
12799
12407
|
isexe.sync = sync;
|
|
12800
|
-
var
|
|
12408
|
+
var fs14 = __require("fs");
|
|
12801
12409
|
function isexe(path11, options, cb) {
|
|
12802
|
-
|
|
12410
|
+
fs14.stat(path11, function(er, stat) {
|
|
12803
12411
|
cb(er, er ? false : checkStat(stat, options));
|
|
12804
12412
|
});
|
|
12805
12413
|
}
|
|
12806
12414
|
function sync(path11, options) {
|
|
12807
|
-
return checkStat(
|
|
12415
|
+
return checkStat(fs14.statSync(path11), options);
|
|
12808
12416
|
}
|
|
12809
12417
|
function checkStat(stat, options) {
|
|
12810
12418
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -12826,7 +12434,7 @@ var require_mode = __commonJS((exports, module) => {
|
|
|
12826
12434
|
|
|
12827
12435
|
// ../../node_modules/isexe/index.js
|
|
12828
12436
|
var require_isexe = __commonJS((exports, module) => {
|
|
12829
|
-
var
|
|
12437
|
+
var fs14 = __require("fs");
|
|
12830
12438
|
var core2;
|
|
12831
12439
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
12832
12440
|
core2 = require_windows();
|
|
@@ -12988,7 +12596,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
12988
12596
|
var which = require_which();
|
|
12989
12597
|
var getPathKey = require_path_key();
|
|
12990
12598
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
12991
|
-
const
|
|
12599
|
+
const env2 = parsed.options.env || process.env;
|
|
12992
12600
|
const cwd = process.cwd();
|
|
12993
12601
|
const hasCustomCwd = parsed.options.cwd != null;
|
|
12994
12602
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;
|
|
@@ -13000,7 +12608,7 @@ var require_resolveCommand = __commonJS((exports, module) => {
|
|
|
13000
12608
|
let resolved;
|
|
13001
12609
|
try {
|
|
13002
12610
|
resolved = which.sync(parsed.command, {
|
|
13003
|
-
path:
|
|
12611
|
+
path: env2[getPathKey({ env: env2 })],
|
|
13004
12612
|
pathExt: withoutPathExt ? path11.delimiter : undefined
|
|
13005
12613
|
});
|
|
13006
12614
|
} catch (e2) {} finally {
|
|
@@ -13065,16 +12673,16 @@ var require_shebang_command = __commonJS((exports, module) => {
|
|
|
13065
12673
|
|
|
13066
12674
|
// ../../node_modules/cross-spawn/lib/util/readShebang.js
|
|
13067
12675
|
var require_readShebang = __commonJS((exports, module) => {
|
|
13068
|
-
var
|
|
12676
|
+
var fs14 = __require("fs");
|
|
13069
12677
|
var shebangCommand = require_shebang_command();
|
|
13070
12678
|
function readShebang(command) {
|
|
13071
12679
|
const size = 150;
|
|
13072
12680
|
const buffer = Buffer.alloc(size);
|
|
13073
12681
|
let fd;
|
|
13074
12682
|
try {
|
|
13075
|
-
fd =
|
|
13076
|
-
|
|
13077
|
-
|
|
12683
|
+
fd = fs14.openSync(command, "r");
|
|
12684
|
+
fs14.readSync(fd, buffer, 0, size, 0);
|
|
12685
|
+
fs14.closeSync(fd);
|
|
13078
12686
|
} catch (e2) {}
|
|
13079
12687
|
return shebangCommand(buffer.toString());
|
|
13080
12688
|
}
|
|
@@ -13118,7 +12726,7 @@ var require_parse4 = __commonJS((exports, module) => {
|
|
|
13118
12726
|
}
|
|
13119
12727
|
return parsed;
|
|
13120
12728
|
}
|
|
13121
|
-
function
|
|
12729
|
+
function parse9(command, args, options) {
|
|
13122
12730
|
if (args && !Array.isArray(args)) {
|
|
13123
12731
|
options = args;
|
|
13124
12732
|
args = null;
|
|
@@ -13137,7 +12745,7 @@ var require_parse4 = __commonJS((exports, module) => {
|
|
|
13137
12745
|
};
|
|
13138
12746
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
13139
12747
|
}
|
|
13140
|
-
module.exports =
|
|
12748
|
+
module.exports = parse9;
|
|
13141
12749
|
});
|
|
13142
12750
|
|
|
13143
12751
|
// ../../node_modules/cross-spawn/lib/enoent.js
|
|
@@ -13190,16 +12798,16 @@ var require_enoent = __commonJS((exports, module) => {
|
|
|
13190
12798
|
// ../../node_modules/cross-spawn/index.js
|
|
13191
12799
|
var require_cross_spawn = __commonJS((exports, module) => {
|
|
13192
12800
|
var cp = __require("child_process");
|
|
13193
|
-
var
|
|
12801
|
+
var parse9 = require_parse4();
|
|
13194
12802
|
var enoent = require_enoent();
|
|
13195
12803
|
function spawn(command, args, options) {
|
|
13196
|
-
const parsed =
|
|
12804
|
+
const parsed = parse9(command, args, options);
|
|
13197
12805
|
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
13198
12806
|
enoent.hookChildProcess(spawned, parsed);
|
|
13199
12807
|
return spawned;
|
|
13200
12808
|
}
|
|
13201
12809
|
function spawnSync(command, args, options) {
|
|
13202
|
-
const parsed =
|
|
12810
|
+
const parsed = parse9(command, args, options);
|
|
13203
12811
|
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
13204
12812
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
13205
12813
|
return result;
|
|
@@ -13207,7 +12815,7 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
13207
12815
|
module.exports = spawn;
|
|
13208
12816
|
module.exports.spawn = spawn;
|
|
13209
12817
|
module.exports.sync = spawnSync;
|
|
13210
|
-
module.exports._parse =
|
|
12818
|
+
module.exports._parse = parse9;
|
|
13211
12819
|
module.exports._enoent = enoent;
|
|
13212
12820
|
});
|
|
13213
12821
|
|
|
@@ -19346,7 +18954,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
19346
18954
|
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
19347
18955
|
value = value.valueOf();
|
|
19348
18956
|
}
|
|
19349
|
-
const { aliasDuplicateObjects, onAnchor, onTagObj, schema:
|
|
18957
|
+
const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema8, sourceObjects } = ctx;
|
|
19350
18958
|
let ref = undefined;
|
|
19351
18959
|
if (aliasDuplicateObjects && value && typeof value === "object") {
|
|
19352
18960
|
ref = sourceObjects.get(value);
|
|
@@ -19360,7 +18968,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
19360
18968
|
}
|
|
19361
18969
|
if (tagName?.startsWith("!!"))
|
|
19362
18970
|
tagName = defaultTagPrefix + tagName.slice(2);
|
|
19363
|
-
let tagObj = findTagObject(value, tagName,
|
|
18971
|
+
let tagObj = findTagObject(value, tagName, schema8.tags);
|
|
19364
18972
|
if (!tagObj) {
|
|
19365
18973
|
if (value && typeof value.toJSON === "function") {
|
|
19366
18974
|
value = value.toJSON();
|
|
@@ -19371,7 +18979,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
19371
18979
|
ref.node = node2;
|
|
19372
18980
|
return node2;
|
|
19373
18981
|
}
|
|
19374
|
-
tagObj = value instanceof Map ?
|
|
18982
|
+
tagObj = value instanceof Map ? schema8[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema8[identity3.SEQ] : schema8[identity3.MAP];
|
|
19375
18983
|
}
|
|
19376
18984
|
if (onTagObj) {
|
|
19377
18985
|
onTagObj(tagObj);
|
|
@@ -19394,7 +19002,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
19394
19002
|
var createNode = require_createNode();
|
|
19395
19003
|
var identity3 = require_identity();
|
|
19396
19004
|
var Node2 = require_Node();
|
|
19397
|
-
function collectionFromPath(
|
|
19005
|
+
function collectionFromPath(schema8, path16, value) {
|
|
19398
19006
|
let v = value;
|
|
19399
19007
|
for (let i2 = path16.length - 1;i2 >= 0; --i2) {
|
|
19400
19008
|
const k2 = path16[i2];
|
|
@@ -19412,27 +19020,27 @@ var require_Collection = __commonJS((exports) => {
|
|
|
19412
19020
|
onAnchor: () => {
|
|
19413
19021
|
throw new Error("This should not happen, please report a bug.");
|
|
19414
19022
|
},
|
|
19415
|
-
schema:
|
|
19023
|
+
schema: schema8,
|
|
19416
19024
|
sourceObjects: new Map
|
|
19417
19025
|
});
|
|
19418
19026
|
}
|
|
19419
19027
|
var isEmptyPath = (path16) => path16 == null || typeof path16 === "object" && !!path16[Symbol.iterator]().next().done;
|
|
19420
19028
|
|
|
19421
19029
|
class Collection extends Node2.NodeBase {
|
|
19422
|
-
constructor(type,
|
|
19030
|
+
constructor(type, schema8) {
|
|
19423
19031
|
super(type);
|
|
19424
19032
|
Object.defineProperty(this, "schema", {
|
|
19425
|
-
value:
|
|
19033
|
+
value: schema8,
|
|
19426
19034
|
configurable: true,
|
|
19427
19035
|
enumerable: false,
|
|
19428
19036
|
writable: true
|
|
19429
19037
|
});
|
|
19430
19038
|
}
|
|
19431
|
-
clone(
|
|
19039
|
+
clone(schema8) {
|
|
19432
19040
|
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
|
|
19433
|
-
if (
|
|
19434
|
-
copy.schema =
|
|
19435
|
-
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(
|
|
19041
|
+
if (schema8)
|
|
19042
|
+
copy.schema = schema8;
|
|
19043
|
+
copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema8) : it3);
|
|
19436
19044
|
if (this.range)
|
|
19437
19045
|
copy.range = this.range.slice();
|
|
19438
19046
|
return copy;
|
|
@@ -20364,12 +19972,12 @@ var require_Pair = __commonJS((exports) => {
|
|
|
20364
19972
|
this.key = key;
|
|
20365
19973
|
this.value = value;
|
|
20366
19974
|
}
|
|
20367
|
-
clone(
|
|
19975
|
+
clone(schema8) {
|
|
20368
19976
|
let { key, value } = this;
|
|
20369
19977
|
if (identity3.isNode(key))
|
|
20370
|
-
key = key.clone(
|
|
19978
|
+
key = key.clone(schema8);
|
|
20371
19979
|
if (identity3.isNode(value))
|
|
20372
|
-
value = value.clone(
|
|
19980
|
+
value = value.clone(schema8);
|
|
20373
19981
|
return new Pair(key, value);
|
|
20374
19982
|
}
|
|
20375
19983
|
toJSON(_2, ctx) {
|
|
@@ -20554,13 +20162,13 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
20554
20162
|
static get tagName() {
|
|
20555
20163
|
return "tag:yaml.org,2002:map";
|
|
20556
20164
|
}
|
|
20557
|
-
constructor(
|
|
20558
|
-
super(identity3.MAP,
|
|
20165
|
+
constructor(schema8) {
|
|
20166
|
+
super(identity3.MAP, schema8);
|
|
20559
20167
|
this.items = [];
|
|
20560
20168
|
}
|
|
20561
|
-
static from(
|
|
20169
|
+
static from(schema8, obj, ctx) {
|
|
20562
20170
|
const { keepUndefined, replacer } = ctx;
|
|
20563
|
-
const map2 = new this(
|
|
20171
|
+
const map2 = new this(schema8);
|
|
20564
20172
|
const add = (key, value) => {
|
|
20565
20173
|
if (typeof replacer === "function")
|
|
20566
20174
|
value = replacer.call(obj, key, value);
|
|
@@ -20576,8 +20184,8 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
20576
20184
|
for (const key of Object.keys(obj))
|
|
20577
20185
|
add(key, obj[key]);
|
|
20578
20186
|
}
|
|
20579
|
-
if (typeof
|
|
20580
|
-
map2.items.sort(
|
|
20187
|
+
if (typeof schema8.sortMapEntries === "function") {
|
|
20188
|
+
map2.items.sort(schema8.sortMapEntries);
|
|
20581
20189
|
}
|
|
20582
20190
|
return map2;
|
|
20583
20191
|
}
|
|
@@ -20670,7 +20278,7 @@ var require_map2 = __commonJS((exports) => {
|
|
|
20670
20278
|
onError("Expected a mapping for this tag");
|
|
20671
20279
|
return map3;
|
|
20672
20280
|
},
|
|
20673
|
-
createNode: (
|
|
20281
|
+
createNode: (schema8, obj, ctx) => YAMLMap.YAMLMap.from(schema8, obj, ctx)
|
|
20674
20282
|
};
|
|
20675
20283
|
exports.map = map2;
|
|
20676
20284
|
});
|
|
@@ -20688,8 +20296,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
20688
20296
|
static get tagName() {
|
|
20689
20297
|
return "tag:yaml.org,2002:seq";
|
|
20690
20298
|
}
|
|
20691
|
-
constructor(
|
|
20692
|
-
super(identity3.SEQ,
|
|
20299
|
+
constructor(schema8) {
|
|
20300
|
+
super(identity3.SEQ, schema8);
|
|
20693
20301
|
this.items = [];
|
|
20694
20302
|
}
|
|
20695
20303
|
add(value) {
|
|
@@ -20743,9 +20351,9 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
20743
20351
|
onComment
|
|
20744
20352
|
});
|
|
20745
20353
|
}
|
|
20746
|
-
static from(
|
|
20354
|
+
static from(schema8, obj, ctx) {
|
|
20747
20355
|
const { replacer } = ctx;
|
|
20748
|
-
const seq = new this(
|
|
20356
|
+
const seq = new this(schema8);
|
|
20749
20357
|
if (obj && Symbol.iterator in Object(obj)) {
|
|
20750
20358
|
let i2 = 0;
|
|
20751
20359
|
for (let it3 of obj) {
|
|
@@ -20782,7 +20390,7 @@ var require_seq2 = __commonJS((exports) => {
|
|
|
20782
20390
|
onError("Expected a sequence for this tag");
|
|
20783
20391
|
return seq2;
|
|
20784
20392
|
},
|
|
20785
|
-
createNode: (
|
|
20393
|
+
createNode: (schema8, obj, ctx) => YAMLSeq.YAMLSeq.from(schema8, obj, ctx)
|
|
20786
20394
|
};
|
|
20787
20395
|
exports.seq = seq;
|
|
20788
20396
|
});
|
|
@@ -20957,7 +20565,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
20957
20565
|
var bool = require_bool2();
|
|
20958
20566
|
var float = require_float2();
|
|
20959
20567
|
var int2 = require_int2();
|
|
20960
|
-
var
|
|
20568
|
+
var schema8 = [
|
|
20961
20569
|
map2.map,
|
|
20962
20570
|
seq.seq,
|
|
20963
20571
|
string4.string,
|
|
@@ -20970,7 +20578,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
20970
20578
|
float.floatExp,
|
|
20971
20579
|
float.float
|
|
20972
20580
|
];
|
|
20973
|
-
exports.schema =
|
|
20581
|
+
exports.schema = schema8;
|
|
20974
20582
|
});
|
|
20975
20583
|
|
|
20976
20584
|
// ../../node_modules/yaml/dist/schema/json/schema.js
|
|
@@ -21033,8 +20641,8 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
21033
20641
|
return str;
|
|
21034
20642
|
}
|
|
21035
20643
|
};
|
|
21036
|
-
var
|
|
21037
|
-
exports.schema =
|
|
20644
|
+
var schema8 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
|
|
20645
|
+
exports.schema = schema8;
|
|
21038
20646
|
});
|
|
21039
20647
|
|
|
21040
20648
|
// ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
@@ -21124,9 +20732,9 @@ ${cn.comment}` : item.comment;
|
|
|
21124
20732
|
onError("Expected a sequence for this tag");
|
|
21125
20733
|
return seq;
|
|
21126
20734
|
}
|
|
21127
|
-
function createPairs(
|
|
20735
|
+
function createPairs(schema8, iterable, ctx) {
|
|
21128
20736
|
const { replacer } = ctx;
|
|
21129
|
-
const pairs2 = new YAMLSeq.YAMLSeq(
|
|
20737
|
+
const pairs2 = new YAMLSeq.YAMLSeq(schema8);
|
|
21130
20738
|
pairs2.tag = "tag:yaml.org,2002:pairs";
|
|
21131
20739
|
let i2 = 0;
|
|
21132
20740
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
@@ -21205,8 +20813,8 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
21205
20813
|
}
|
|
21206
20814
|
return map2;
|
|
21207
20815
|
}
|
|
21208
|
-
static from(
|
|
21209
|
-
const pairs$1 = pairs.createPairs(
|
|
20816
|
+
static from(schema8, iterable, ctx) {
|
|
20817
|
+
const pairs$1 = pairs.createPairs(schema8, iterable, ctx);
|
|
21210
20818
|
const omap2 = new this;
|
|
21211
20819
|
omap2.items = pairs$1.items;
|
|
21212
20820
|
return omap2;
|
|
@@ -21233,7 +20841,7 @@ var require_omap2 = __commonJS((exports) => {
|
|
|
21233
20841
|
}
|
|
21234
20842
|
return Object.assign(new YAMLOMap, pairs$1);
|
|
21235
20843
|
},
|
|
21236
|
-
createNode: (
|
|
20844
|
+
createNode: (schema8, iterable, ctx) => YAMLOMap.from(schema8, iterable, ctx)
|
|
21237
20845
|
};
|
|
21238
20846
|
exports.YAMLOMap = YAMLOMap;
|
|
21239
20847
|
exports.omap = omap;
|
|
@@ -21397,8 +21005,8 @@ var require_set2 = __commonJS((exports) => {
|
|
|
21397
21005
|
var YAMLMap = require_YAMLMap();
|
|
21398
21006
|
|
|
21399
21007
|
class YAMLSet extends YAMLMap.YAMLMap {
|
|
21400
|
-
constructor(
|
|
21401
|
-
super(
|
|
21008
|
+
constructor(schema8) {
|
|
21009
|
+
super(schema8);
|
|
21402
21010
|
this.tag = YAMLSet.tag;
|
|
21403
21011
|
}
|
|
21404
21012
|
add(key) {
|
|
@@ -21438,9 +21046,9 @@ var require_set2 = __commonJS((exports) => {
|
|
|
21438
21046
|
else
|
|
21439
21047
|
throw new Error("Set items must all have null values");
|
|
21440
21048
|
}
|
|
21441
|
-
static from(
|
|
21049
|
+
static from(schema8, iterable, ctx) {
|
|
21442
21050
|
const { replacer } = ctx;
|
|
21443
|
-
const set3 = new this(
|
|
21051
|
+
const set3 = new this(schema8);
|
|
21444
21052
|
if (iterable && Symbol.iterator in Object(iterable))
|
|
21445
21053
|
for (let value of iterable) {
|
|
21446
21054
|
if (typeof replacer === "function")
|
|
@@ -21457,7 +21065,7 @@ var require_set2 = __commonJS((exports) => {
|
|
|
21457
21065
|
nodeClass: YAMLSet,
|
|
21458
21066
|
default: false,
|
|
21459
21067
|
tag: "tag:yaml.org,2002:set",
|
|
21460
|
-
createNode: (
|
|
21068
|
+
createNode: (schema8, iterable, ctx) => YAMLSet.from(schema8, iterable, ctx),
|
|
21461
21069
|
resolve(map2, onError) {
|
|
21462
21070
|
if (identity3.isMap(map2)) {
|
|
21463
21071
|
if (map2.hasAllNullValues(true))
|
|
@@ -21570,7 +21178,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
21570
21178
|
var pairs = require_pairs2();
|
|
21571
21179
|
var set2 = require_set2();
|
|
21572
21180
|
var timestamp = require_timestamp2();
|
|
21573
|
-
var
|
|
21181
|
+
var schema8 = [
|
|
21574
21182
|
map2.map,
|
|
21575
21183
|
seq.seq,
|
|
21576
21184
|
string4.string,
|
|
@@ -21593,7 +21201,7 @@ var require_schema4 = __commonJS((exports) => {
|
|
|
21593
21201
|
timestamp.floatTime,
|
|
21594
21202
|
timestamp.timestamp
|
|
21595
21203
|
];
|
|
21596
|
-
exports.schema =
|
|
21204
|
+
exports.schema = schema8;
|
|
21597
21205
|
});
|
|
21598
21206
|
|
|
21599
21207
|
// ../../node_modules/yaml/dist/schema/tags.js
|
|
@@ -21605,7 +21213,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
21605
21213
|
var bool = require_bool2();
|
|
21606
21214
|
var float = require_float2();
|
|
21607
21215
|
var int2 = require_int2();
|
|
21608
|
-
var
|
|
21216
|
+
var schema8 = require_schema2();
|
|
21609
21217
|
var schema$1 = require_schema3();
|
|
21610
21218
|
var binary = require_binary2();
|
|
21611
21219
|
var merge3 = require_merge3();
|
|
@@ -21615,7 +21223,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
21615
21223
|
var set2 = require_set2();
|
|
21616
21224
|
var timestamp = require_timestamp2();
|
|
21617
21225
|
var schemas3 = new Map([
|
|
21618
|
-
["core",
|
|
21226
|
+
["core", schema8.schema],
|
|
21619
21227
|
["failsafe", [map2.map, seq.seq, string4.string]],
|
|
21620
21228
|
["json", schema$1.schema],
|
|
21621
21229
|
["yaml11", schema$2.schema],
|
|
@@ -21697,9 +21305,9 @@ var require_Schema = __commonJS((exports) => {
|
|
|
21697
21305
|
var sortMapEntriesByKey = (a2, b) => a2.key < b.key ? -1 : a2.key > b.key ? 1 : 0;
|
|
21698
21306
|
|
|
21699
21307
|
class Schema {
|
|
21700
|
-
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema:
|
|
21308
|
+
constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema8, sortMapEntries, toStringDefaults }) {
|
|
21701
21309
|
this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
|
|
21702
|
-
this.name = typeof
|
|
21310
|
+
this.name = typeof schema8 === "string" && schema8 || "core";
|
|
21703
21311
|
this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
|
|
21704
21312
|
this.tags = tags.getTags(customTags, this.name, merge3);
|
|
21705
21313
|
this.toStringOptions = toStringDefaults ?? null;
|
|
@@ -23191,11 +22799,11 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
23191
22799
|
scalar.comment = comment;
|
|
23192
22800
|
return scalar;
|
|
23193
22801
|
}
|
|
23194
|
-
function findScalarTagByName(
|
|
22802
|
+
function findScalarTagByName(schema8, value, tagName, tagToken, onError) {
|
|
23195
22803
|
if (tagName === "!")
|
|
23196
|
-
return
|
|
22804
|
+
return schema8[identity3.SCALAR];
|
|
23197
22805
|
const matchWithTest = [];
|
|
23198
|
-
for (const tag of
|
|
22806
|
+
for (const tag of schema8.tags) {
|
|
23199
22807
|
if (!tag.collection && tag.tag === tagName) {
|
|
23200
22808
|
if (tag.default && tag.test)
|
|
23201
22809
|
matchWithTest.push(tag);
|
|
@@ -23206,18 +22814,18 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
23206
22814
|
for (const tag of matchWithTest)
|
|
23207
22815
|
if (tag.test?.test(value))
|
|
23208
22816
|
return tag;
|
|
23209
|
-
const kt3 =
|
|
22817
|
+
const kt3 = schema8.knownTags[tagName];
|
|
23210
22818
|
if (kt3 && !kt3.collection) {
|
|
23211
|
-
|
|
22819
|
+
schema8.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
|
|
23212
22820
|
return kt3;
|
|
23213
22821
|
}
|
|
23214
22822
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
23215
|
-
return
|
|
22823
|
+
return schema8[identity3.SCALAR];
|
|
23216
22824
|
}
|
|
23217
|
-
function findScalarTagByTest({ atKey, directives, schema:
|
|
23218
|
-
const tag =
|
|
23219
|
-
if (
|
|
23220
|
-
const compat2 =
|
|
22825
|
+
function findScalarTagByTest({ atKey, directives, schema: schema8 }, value, token, onError) {
|
|
22826
|
+
const tag = schema8.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema8[identity3.SCALAR];
|
|
22827
|
+
if (schema8.compat) {
|
|
22828
|
+
const compat2 = schema8.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema8[identity3.SCALAR];
|
|
23221
22829
|
if (tag.tag !== compat2.tag) {
|
|
23222
22830
|
const ts = directives.tagString(tag.tag);
|
|
23223
22831
|
const cs = directives.tagString(compat2.tag);
|
|
@@ -23400,7 +23008,7 @@ var require_composer = __commonJS((exports) => {
|
|
|
23400
23008
|
var node_process = __require("process");
|
|
23401
23009
|
var directives = require_directives();
|
|
23402
23010
|
var Document = require_Document();
|
|
23403
|
-
var
|
|
23011
|
+
var errors3 = require_errors();
|
|
23404
23012
|
var identity3 = require_identity();
|
|
23405
23013
|
var composeDoc = require_compose_doc();
|
|
23406
23014
|
var resolveEnd = require_resolve_end();
|
|
@@ -23451,9 +23059,9 @@ var require_composer = __commonJS((exports) => {
|
|
|
23451
23059
|
this.onError = (source, code2, message, warning) => {
|
|
23452
23060
|
const pos2 = getErrorPos(source);
|
|
23453
23061
|
if (warning)
|
|
23454
|
-
this.warnings.push(new
|
|
23062
|
+
this.warnings.push(new errors3.YAMLWarning(pos2, code2, message));
|
|
23455
23063
|
else
|
|
23456
|
-
this.errors.push(new
|
|
23064
|
+
this.errors.push(new errors3.YAMLParseError(pos2, code2, message));
|
|
23457
23065
|
};
|
|
23458
23066
|
this.directives = new directives.Directives({ version: options.version || "1.2" });
|
|
23459
23067
|
this.options = options;
|
|
@@ -23537,7 +23145,7 @@ ${cb}` : comment;
|
|
|
23537
23145
|
break;
|
|
23538
23146
|
case "error": {
|
|
23539
23147
|
const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
|
|
23540
|
-
const error48 = new
|
|
23148
|
+
const error48 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
|
|
23541
23149
|
if (this.atDirectives || !this.doc)
|
|
23542
23150
|
this.errors.push(error48);
|
|
23543
23151
|
else
|
|
@@ -23547,7 +23155,7 @@ ${cb}` : comment;
|
|
|
23547
23155
|
case "doc-end": {
|
|
23548
23156
|
if (!this.doc) {
|
|
23549
23157
|
const msg = "Unexpected doc-end without preceding document";
|
|
23550
|
-
this.errors.push(new
|
|
23158
|
+
this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
|
|
23551
23159
|
break;
|
|
23552
23160
|
}
|
|
23553
23161
|
this.doc.directives.docEnd = true;
|
|
@@ -23562,7 +23170,7 @@ ${end.comment}` : end.comment;
|
|
|
23562
23170
|
break;
|
|
23563
23171
|
}
|
|
23564
23172
|
default:
|
|
23565
|
-
this.errors.push(new
|
|
23173
|
+
this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
|
|
23566
23174
|
}
|
|
23567
23175
|
}
|
|
23568
23176
|
*end(forceDoc = false, endOffset = -1) {
|
|
@@ -23588,7 +23196,7 @@ ${end.comment}` : end.comment;
|
|
|
23588
23196
|
var require_cst_scalar = __commonJS((exports) => {
|
|
23589
23197
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
23590
23198
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
23591
|
-
var
|
|
23199
|
+
var errors3 = require_errors();
|
|
23592
23200
|
var stringifyString = require_stringifyString();
|
|
23593
23201
|
function resolveAsScalar(token, strict = true, onError) {
|
|
23594
23202
|
if (token) {
|
|
@@ -23597,7 +23205,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
23597
23205
|
if (onError)
|
|
23598
23206
|
onError(offset, code2, message);
|
|
23599
23207
|
else
|
|
23600
|
-
throw new
|
|
23208
|
+
throw new errors3.YAMLParseError([offset, offset + 1], code2, message);
|
|
23601
23209
|
};
|
|
23602
23210
|
switch (token.type) {
|
|
23603
23211
|
case "scalar":
|
|
@@ -25155,14 +24763,14 @@ var require_parser = __commonJS((exports) => {
|
|
|
25155
24763
|
case "scalar":
|
|
25156
24764
|
case "single-quoted-scalar":
|
|
25157
24765
|
case "double-quoted-scalar": {
|
|
25158
|
-
const
|
|
24766
|
+
const fs14 = this.flowScalar(this.type);
|
|
25159
24767
|
if (atNextItem || it3.value) {
|
|
25160
|
-
map2.items.push({ start, key:
|
|
24768
|
+
map2.items.push({ start, key: fs14, sep: [] });
|
|
25161
24769
|
this.onKeyLine = true;
|
|
25162
24770
|
} else if (it3.sep) {
|
|
25163
|
-
this.stack.push(
|
|
24771
|
+
this.stack.push(fs14);
|
|
25164
24772
|
} else {
|
|
25165
|
-
Object.assign(it3, { key:
|
|
24773
|
+
Object.assign(it3, { key: fs14, sep: [] });
|
|
25166
24774
|
this.onKeyLine = true;
|
|
25167
24775
|
}
|
|
25168
24776
|
return;
|
|
@@ -25290,13 +24898,13 @@ var require_parser = __commonJS((exports) => {
|
|
|
25290
24898
|
case "scalar":
|
|
25291
24899
|
case "single-quoted-scalar":
|
|
25292
24900
|
case "double-quoted-scalar": {
|
|
25293
|
-
const
|
|
24901
|
+
const fs14 = this.flowScalar(this.type);
|
|
25294
24902
|
if (!it3 || it3.value)
|
|
25295
|
-
fc.items.push({ start: [], key:
|
|
24903
|
+
fc.items.push({ start: [], key: fs14, sep: [] });
|
|
25296
24904
|
else if (it3.sep)
|
|
25297
|
-
this.stack.push(
|
|
24905
|
+
this.stack.push(fs14);
|
|
25298
24906
|
else
|
|
25299
|
-
Object.assign(it3, { key:
|
|
24907
|
+
Object.assign(it3, { key: fs14, sep: [] });
|
|
25300
24908
|
return;
|
|
25301
24909
|
}
|
|
25302
24910
|
case "flow-map-end":
|
|
@@ -25459,7 +25067,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
25459
25067
|
var require_public_api = __commonJS((exports) => {
|
|
25460
25068
|
var composer = require_composer();
|
|
25461
25069
|
var Document = require_Document();
|
|
25462
|
-
var
|
|
25070
|
+
var errors3 = require_errors();
|
|
25463
25071
|
var log = require_log();
|
|
25464
25072
|
var identity3 = require_identity();
|
|
25465
25073
|
var lineCounter = require_line_counter();
|
|
@@ -25476,8 +25084,8 @@ var require_public_api = __commonJS((exports) => {
|
|
|
25476
25084
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
|
25477
25085
|
if (prettyErrors && lineCounter2)
|
|
25478
25086
|
for (const doc2 of docs) {
|
|
25479
|
-
doc2.errors.forEach(
|
|
25480
|
-
doc2.warnings.forEach(
|
|
25087
|
+
doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
|
|
25088
|
+
doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
|
|
25481
25089
|
}
|
|
25482
25090
|
if (docs.length > 0)
|
|
25483
25091
|
return docs;
|
|
@@ -25492,17 +25100,17 @@ var require_public_api = __commonJS((exports) => {
|
|
|
25492
25100
|
if (!doc2)
|
|
25493
25101
|
doc2 = _doc;
|
|
25494
25102
|
else if (doc2.options.logLevel !== "silent") {
|
|
25495
|
-
doc2.errors.push(new
|
|
25103
|
+
doc2.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
25496
25104
|
break;
|
|
25497
25105
|
}
|
|
25498
25106
|
}
|
|
25499
25107
|
if (prettyErrors && lineCounter2) {
|
|
25500
|
-
doc2.errors.forEach(
|
|
25501
|
-
doc2.warnings.forEach(
|
|
25108
|
+
doc2.errors.forEach(errors3.prettifyError(source, lineCounter2));
|
|
25109
|
+
doc2.warnings.forEach(errors3.prettifyError(source, lineCounter2));
|
|
25502
25110
|
}
|
|
25503
25111
|
return doc2;
|
|
25504
25112
|
}
|
|
25505
|
-
function
|
|
25113
|
+
function parse9(src, reviver, options) {
|
|
25506
25114
|
let _reviver = undefined;
|
|
25507
25115
|
if (typeof reviver === "function") {
|
|
25508
25116
|
_reviver = reviver;
|
|
@@ -25543,12 +25151,404 @@ var require_public_api = __commonJS((exports) => {
|
|
|
25543
25151
|
return value.toString(options);
|
|
25544
25152
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
25545
25153
|
}
|
|
25546
|
-
exports.parse =
|
|
25154
|
+
exports.parse = parse9;
|
|
25547
25155
|
exports.parseAllDocuments = parseAllDocuments;
|
|
25548
25156
|
exports.parseDocument = parseDocument;
|
|
25549
25157
|
exports.stringify = stringify;
|
|
25550
25158
|
});
|
|
25551
25159
|
|
|
25160
|
+
// ../../node_modules/dotenv/package.json
|
|
25161
|
+
var require_package2 = __commonJS((exports, module) => {
|
|
25162
|
+
module.exports = {
|
|
25163
|
+
name: "dotenv",
|
|
25164
|
+
version: "17.3.1",
|
|
25165
|
+
description: "Loads environment variables from .env file",
|
|
25166
|
+
main: "lib/main.js",
|
|
25167
|
+
types: "lib/main.d.ts",
|
|
25168
|
+
exports: {
|
|
25169
|
+
".": {
|
|
25170
|
+
types: "./lib/main.d.ts",
|
|
25171
|
+
require: "./lib/main.js",
|
|
25172
|
+
default: "./lib/main.js"
|
|
25173
|
+
},
|
|
25174
|
+
"./config": "./config.js",
|
|
25175
|
+
"./config.js": "./config.js",
|
|
25176
|
+
"./lib/env-options": "./lib/env-options.js",
|
|
25177
|
+
"./lib/env-options.js": "./lib/env-options.js",
|
|
25178
|
+
"./lib/cli-options": "./lib/cli-options.js",
|
|
25179
|
+
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
25180
|
+
"./package.json": "./package.json"
|
|
25181
|
+
},
|
|
25182
|
+
scripts: {
|
|
25183
|
+
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
25184
|
+
lint: "standard",
|
|
25185
|
+
pretest: "npm run lint && npm run dts-check",
|
|
25186
|
+
test: "tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000",
|
|
25187
|
+
"test:coverage": "tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
|
|
25188
|
+
prerelease: "npm test",
|
|
25189
|
+
release: "standard-version"
|
|
25190
|
+
},
|
|
25191
|
+
repository: {
|
|
25192
|
+
type: "git",
|
|
25193
|
+
url: "git://github.com/motdotla/dotenv.git"
|
|
25194
|
+
},
|
|
25195
|
+
homepage: "https://github.com/motdotla/dotenv#readme",
|
|
25196
|
+
funding: "https://dotenvx.com",
|
|
25197
|
+
keywords: [
|
|
25198
|
+
"dotenv",
|
|
25199
|
+
"env",
|
|
25200
|
+
".env",
|
|
25201
|
+
"environment",
|
|
25202
|
+
"variables",
|
|
25203
|
+
"config",
|
|
25204
|
+
"settings"
|
|
25205
|
+
],
|
|
25206
|
+
readmeFilename: "README.md",
|
|
25207
|
+
license: "BSD-2-Clause",
|
|
25208
|
+
devDependencies: {
|
|
25209
|
+
"@types/node": "^18.11.3",
|
|
25210
|
+
decache: "^4.6.2",
|
|
25211
|
+
sinon: "^14.0.1",
|
|
25212
|
+
standard: "^17.0.0",
|
|
25213
|
+
"standard-version": "^9.5.0",
|
|
25214
|
+
tap: "^19.2.0",
|
|
25215
|
+
typescript: "^4.8.4"
|
|
25216
|
+
},
|
|
25217
|
+
engines: {
|
|
25218
|
+
node: ">=12"
|
|
25219
|
+
},
|
|
25220
|
+
browser: {
|
|
25221
|
+
fs: false
|
|
25222
|
+
}
|
|
25223
|
+
};
|
|
25224
|
+
});
|
|
25225
|
+
|
|
25226
|
+
// ../../node_modules/dotenv/lib/main.js
|
|
25227
|
+
var require_main = __commonJS((exports, module) => {
|
|
25228
|
+
var fs14 = __require("fs");
|
|
25229
|
+
var path16 = __require("path");
|
|
25230
|
+
var os2 = __require("os");
|
|
25231
|
+
var crypto = __require("crypto");
|
|
25232
|
+
var packageJson = require_package2();
|
|
25233
|
+
var version2 = packageJson.version;
|
|
25234
|
+
var TIPS = [
|
|
25235
|
+
"\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com",
|
|
25236
|
+
"\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit",
|
|
25237
|
+
"\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild",
|
|
25238
|
+
"\uD83E\uDD16 agentic secret storage: https://dotenvx.com/as2",
|
|
25239
|
+
"⚡️ secrets for agents: https://dotenvx.com/as2",
|
|
25240
|
+
"\uD83D\uDEE1️ auth for agents: https://vestauth.com",
|
|
25241
|
+
"\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`",
|
|
25242
|
+
"⚙️ specify custom .env file path with { path: '/custom/path/.env' }",
|
|
25243
|
+
"⚙️ enable debug logging with { debug: true }",
|
|
25244
|
+
"⚙️ override existing env vars with { override: true }",
|
|
25245
|
+
"⚙️ suppress all logs with { quiet: true }",
|
|
25246
|
+
"⚙️ write to custom object with { processEnv: myObject }",
|
|
25247
|
+
"⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"
|
|
25248
|
+
];
|
|
25249
|
+
function _getRandomTip() {
|
|
25250
|
+
return TIPS[Math.floor(Math.random() * TIPS.length)];
|
|
25251
|
+
}
|
|
25252
|
+
function parseBoolean(value) {
|
|
25253
|
+
if (typeof value === "string") {
|
|
25254
|
+
return !["false", "0", "no", "off", ""].includes(value.toLowerCase());
|
|
25255
|
+
}
|
|
25256
|
+
return Boolean(value);
|
|
25257
|
+
}
|
|
25258
|
+
function supportsAnsi() {
|
|
25259
|
+
return process.stdout.isTTY;
|
|
25260
|
+
}
|
|
25261
|
+
function dim2(text) {
|
|
25262
|
+
return supportsAnsi() ? `\x1B[2m${text}\x1B[0m` : text;
|
|
25263
|
+
}
|
|
25264
|
+
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
25265
|
+
function parse9(src) {
|
|
25266
|
+
const obj = {};
|
|
25267
|
+
let lines = src.toString();
|
|
25268
|
+
lines = lines.replace(/\r\n?/mg, `
|
|
25269
|
+
`);
|
|
25270
|
+
let match;
|
|
25271
|
+
while ((match = LINE.exec(lines)) != null) {
|
|
25272
|
+
const key = match[1];
|
|
25273
|
+
let value = match[2] || "";
|
|
25274
|
+
value = value.trim();
|
|
25275
|
+
const maybeQuote = value[0];
|
|
25276
|
+
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
25277
|
+
if (maybeQuote === '"') {
|
|
25278
|
+
value = value.replace(/\\n/g, `
|
|
25279
|
+
`);
|
|
25280
|
+
value = value.replace(/\\r/g, "\r");
|
|
25281
|
+
}
|
|
25282
|
+
obj[key] = value;
|
|
25283
|
+
}
|
|
25284
|
+
return obj;
|
|
25285
|
+
}
|
|
25286
|
+
function _parseVault(options) {
|
|
25287
|
+
options = options || {};
|
|
25288
|
+
const vaultPath = _vaultPath(options);
|
|
25289
|
+
options.path = vaultPath;
|
|
25290
|
+
const result = DotenvModule.configDotenv(options);
|
|
25291
|
+
if (!result.parsed) {
|
|
25292
|
+
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
25293
|
+
err.code = "MISSING_DATA";
|
|
25294
|
+
throw err;
|
|
25295
|
+
}
|
|
25296
|
+
const keys = _dotenvKey(options).split(",");
|
|
25297
|
+
const length = keys.length;
|
|
25298
|
+
let decrypted;
|
|
25299
|
+
for (let i2 = 0;i2 < length; i2++) {
|
|
25300
|
+
try {
|
|
25301
|
+
const key = keys[i2].trim();
|
|
25302
|
+
const attrs = _instructions(result, key);
|
|
25303
|
+
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
25304
|
+
break;
|
|
25305
|
+
} catch (error48) {
|
|
25306
|
+
if (i2 + 1 >= length) {
|
|
25307
|
+
throw error48;
|
|
25308
|
+
}
|
|
25309
|
+
}
|
|
25310
|
+
}
|
|
25311
|
+
return DotenvModule.parse(decrypted);
|
|
25312
|
+
}
|
|
25313
|
+
function _warn(message) {
|
|
25314
|
+
console.error(`[dotenv@${version2}][WARN] ${message}`);
|
|
25315
|
+
}
|
|
25316
|
+
function _debug(message) {
|
|
25317
|
+
console.log(`[dotenv@${version2}][DEBUG] ${message}`);
|
|
25318
|
+
}
|
|
25319
|
+
function _log(message) {
|
|
25320
|
+
console.log(`[dotenv@${version2}] ${message}`);
|
|
25321
|
+
}
|
|
25322
|
+
function _dotenvKey(options) {
|
|
25323
|
+
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
25324
|
+
return options.DOTENV_KEY;
|
|
25325
|
+
}
|
|
25326
|
+
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
25327
|
+
return process.env.DOTENV_KEY;
|
|
25328
|
+
}
|
|
25329
|
+
return "";
|
|
25330
|
+
}
|
|
25331
|
+
function _instructions(result, dotenvKey) {
|
|
25332
|
+
let uri;
|
|
25333
|
+
try {
|
|
25334
|
+
uri = new URL(dotenvKey);
|
|
25335
|
+
} catch (error48) {
|
|
25336
|
+
if (error48.code === "ERR_INVALID_URL") {
|
|
25337
|
+
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");
|
|
25338
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
25339
|
+
throw err;
|
|
25340
|
+
}
|
|
25341
|
+
throw error48;
|
|
25342
|
+
}
|
|
25343
|
+
const key = uri.password;
|
|
25344
|
+
if (!key) {
|
|
25345
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
25346
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
25347
|
+
throw err;
|
|
25348
|
+
}
|
|
25349
|
+
const environment = uri.searchParams.get("environment");
|
|
25350
|
+
if (!environment) {
|
|
25351
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
25352
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
25353
|
+
throw err;
|
|
25354
|
+
}
|
|
25355
|
+
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
25356
|
+
const ciphertext = result.parsed[environmentKey];
|
|
25357
|
+
if (!ciphertext) {
|
|
25358
|
+
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
25359
|
+
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
25360
|
+
throw err;
|
|
25361
|
+
}
|
|
25362
|
+
return { ciphertext, key };
|
|
25363
|
+
}
|
|
25364
|
+
function _vaultPath(options) {
|
|
25365
|
+
let possibleVaultPath = null;
|
|
25366
|
+
if (options && options.path && options.path.length > 0) {
|
|
25367
|
+
if (Array.isArray(options.path)) {
|
|
25368
|
+
for (const filepath of options.path) {
|
|
25369
|
+
if (fs14.existsSync(filepath)) {
|
|
25370
|
+
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
25371
|
+
}
|
|
25372
|
+
}
|
|
25373
|
+
} else {
|
|
25374
|
+
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
25375
|
+
}
|
|
25376
|
+
} else {
|
|
25377
|
+
possibleVaultPath = path16.resolve(process.cwd(), ".env.vault");
|
|
25378
|
+
}
|
|
25379
|
+
if (fs14.existsSync(possibleVaultPath)) {
|
|
25380
|
+
return possibleVaultPath;
|
|
25381
|
+
}
|
|
25382
|
+
return null;
|
|
25383
|
+
}
|
|
25384
|
+
function _resolveHome(envPath) {
|
|
25385
|
+
return envPath[0] === "~" ? path16.join(os2.homedir(), envPath.slice(1)) : envPath;
|
|
25386
|
+
}
|
|
25387
|
+
function _configVault(options) {
|
|
25388
|
+
const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
25389
|
+
const quiet = parseBoolean(process.env.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
25390
|
+
if (debug || !quiet) {
|
|
25391
|
+
_log("Loading env from encrypted .env.vault");
|
|
25392
|
+
}
|
|
25393
|
+
const parsed = DotenvModule._parseVault(options);
|
|
25394
|
+
let processEnv = process.env;
|
|
25395
|
+
if (options && options.processEnv != null) {
|
|
25396
|
+
processEnv = options.processEnv;
|
|
25397
|
+
}
|
|
25398
|
+
DotenvModule.populate(processEnv, parsed, options);
|
|
25399
|
+
return { parsed };
|
|
25400
|
+
}
|
|
25401
|
+
function configDotenv(options) {
|
|
25402
|
+
const dotenvPath = path16.resolve(process.cwd(), ".env");
|
|
25403
|
+
let encoding = "utf8";
|
|
25404
|
+
let processEnv = process.env;
|
|
25405
|
+
if (options && options.processEnv != null) {
|
|
25406
|
+
processEnv = options.processEnv;
|
|
25407
|
+
}
|
|
25408
|
+
let debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || options && options.debug);
|
|
25409
|
+
let quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || options && options.quiet);
|
|
25410
|
+
if (options && options.encoding) {
|
|
25411
|
+
encoding = options.encoding;
|
|
25412
|
+
} else {
|
|
25413
|
+
if (debug) {
|
|
25414
|
+
_debug("No encoding is specified. UTF-8 is used by default");
|
|
25415
|
+
}
|
|
25416
|
+
}
|
|
25417
|
+
let optionPaths = [dotenvPath];
|
|
25418
|
+
if (options && options.path) {
|
|
25419
|
+
if (!Array.isArray(options.path)) {
|
|
25420
|
+
optionPaths = [_resolveHome(options.path)];
|
|
25421
|
+
} else {
|
|
25422
|
+
optionPaths = [];
|
|
25423
|
+
for (const filepath of options.path) {
|
|
25424
|
+
optionPaths.push(_resolveHome(filepath));
|
|
25425
|
+
}
|
|
25426
|
+
}
|
|
25427
|
+
}
|
|
25428
|
+
let lastError;
|
|
25429
|
+
const parsedAll = {};
|
|
25430
|
+
for (const path17 of optionPaths) {
|
|
25431
|
+
try {
|
|
25432
|
+
const parsed = DotenvModule.parse(fs14.readFileSync(path17, { encoding }));
|
|
25433
|
+
DotenvModule.populate(parsedAll, parsed, options);
|
|
25434
|
+
} catch (e2) {
|
|
25435
|
+
if (debug) {
|
|
25436
|
+
_debug(`Failed to load ${path17} ${e2.message}`);
|
|
25437
|
+
}
|
|
25438
|
+
lastError = e2;
|
|
25439
|
+
}
|
|
25440
|
+
}
|
|
25441
|
+
const populated = DotenvModule.populate(processEnv, parsedAll, options);
|
|
25442
|
+
debug = parseBoolean(processEnv.DOTENV_CONFIG_DEBUG || debug);
|
|
25443
|
+
quiet = parseBoolean(processEnv.DOTENV_CONFIG_QUIET || quiet);
|
|
25444
|
+
if (debug || !quiet) {
|
|
25445
|
+
const keysCount = Object.keys(populated).length;
|
|
25446
|
+
const shortPaths = [];
|
|
25447
|
+
for (const filePath of optionPaths) {
|
|
25448
|
+
try {
|
|
25449
|
+
const relative3 = path16.relative(process.cwd(), filePath);
|
|
25450
|
+
shortPaths.push(relative3);
|
|
25451
|
+
} catch (e2) {
|
|
25452
|
+
if (debug) {
|
|
25453
|
+
_debug(`Failed to load ${filePath} ${e2.message}`);
|
|
25454
|
+
}
|
|
25455
|
+
lastError = e2;
|
|
25456
|
+
}
|
|
25457
|
+
}
|
|
25458
|
+
_log(`injecting env (${keysCount}) from ${shortPaths.join(",")} ${dim2(`-- tip: ${_getRandomTip()}`)}`);
|
|
25459
|
+
}
|
|
25460
|
+
if (lastError) {
|
|
25461
|
+
return { parsed: parsedAll, error: lastError };
|
|
25462
|
+
} else {
|
|
25463
|
+
return { parsed: parsedAll };
|
|
25464
|
+
}
|
|
25465
|
+
}
|
|
25466
|
+
function config9(options) {
|
|
25467
|
+
if (_dotenvKey(options).length === 0) {
|
|
25468
|
+
return DotenvModule.configDotenv(options);
|
|
25469
|
+
}
|
|
25470
|
+
const vaultPath = _vaultPath(options);
|
|
25471
|
+
if (!vaultPath) {
|
|
25472
|
+
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
25473
|
+
return DotenvModule.configDotenv(options);
|
|
25474
|
+
}
|
|
25475
|
+
return DotenvModule._configVault(options);
|
|
25476
|
+
}
|
|
25477
|
+
function decrypt(encrypted, keyStr) {
|
|
25478
|
+
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
25479
|
+
let ciphertext = Buffer.from(encrypted, "base64");
|
|
25480
|
+
const nonce = ciphertext.subarray(0, 12);
|
|
25481
|
+
const authTag = ciphertext.subarray(-16);
|
|
25482
|
+
ciphertext = ciphertext.subarray(12, -16);
|
|
25483
|
+
try {
|
|
25484
|
+
const aesgcm = crypto.createDecipheriv("aes-256-gcm", key, nonce);
|
|
25485
|
+
aesgcm.setAuthTag(authTag);
|
|
25486
|
+
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
25487
|
+
} catch (error48) {
|
|
25488
|
+
const isRange = error48 instanceof RangeError;
|
|
25489
|
+
const invalidKeyLength = error48.message === "Invalid key length";
|
|
25490
|
+
const decryptionFailed = error48.message === "Unsupported state or unable to authenticate data";
|
|
25491
|
+
if (isRange || invalidKeyLength) {
|
|
25492
|
+
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
25493
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
25494
|
+
throw err;
|
|
25495
|
+
} else if (decryptionFailed) {
|
|
25496
|
+
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
25497
|
+
err.code = "DECRYPTION_FAILED";
|
|
25498
|
+
throw err;
|
|
25499
|
+
} else {
|
|
25500
|
+
throw error48;
|
|
25501
|
+
}
|
|
25502
|
+
}
|
|
25503
|
+
}
|
|
25504
|
+
function populate(processEnv, parsed, options = {}) {
|
|
25505
|
+
const debug = Boolean(options && options.debug);
|
|
25506
|
+
const override = Boolean(options && options.override);
|
|
25507
|
+
const populated = {};
|
|
25508
|
+
if (typeof parsed !== "object") {
|
|
25509
|
+
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
25510
|
+
err.code = "OBJECT_REQUIRED";
|
|
25511
|
+
throw err;
|
|
25512
|
+
}
|
|
25513
|
+
for (const key of Object.keys(parsed)) {
|
|
25514
|
+
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
25515
|
+
if (override === true) {
|
|
25516
|
+
processEnv[key] = parsed[key];
|
|
25517
|
+
populated[key] = parsed[key];
|
|
25518
|
+
}
|
|
25519
|
+
if (debug) {
|
|
25520
|
+
if (override === true) {
|
|
25521
|
+
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
25522
|
+
} else {
|
|
25523
|
+
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
25524
|
+
}
|
|
25525
|
+
}
|
|
25526
|
+
} else {
|
|
25527
|
+
processEnv[key] = parsed[key];
|
|
25528
|
+
populated[key] = parsed[key];
|
|
25529
|
+
}
|
|
25530
|
+
}
|
|
25531
|
+
return populated;
|
|
25532
|
+
}
|
|
25533
|
+
var DotenvModule = {
|
|
25534
|
+
configDotenv,
|
|
25535
|
+
_configVault,
|
|
25536
|
+
_parseVault,
|
|
25537
|
+
config: config9,
|
|
25538
|
+
decrypt,
|
|
25539
|
+
parse: parse9,
|
|
25540
|
+
populate
|
|
25541
|
+
};
|
|
25542
|
+
exports.configDotenv = DotenvModule.configDotenv;
|
|
25543
|
+
exports._configVault = DotenvModule._configVault;
|
|
25544
|
+
exports._parseVault = DotenvModule._parseVault;
|
|
25545
|
+
exports.config = DotenvModule.config;
|
|
25546
|
+
exports.decrypt = DotenvModule.decrypt;
|
|
25547
|
+
exports.parse = DotenvModule.parse;
|
|
25548
|
+
exports.populate = DotenvModule.populate;
|
|
25549
|
+
module.exports = DotenvModule;
|
|
25550
|
+
});
|
|
25551
|
+
|
|
25552
25552
|
// ../../node_modules/lodash/_arrayReduce.js
|
|
25553
25553
|
var require__arrayReduce = __commonJS((exports, module) => {
|
|
25554
25554
|
function arrayReduce(array2, iteratee, accumulator, initAccum) {
|
|
@@ -27636,14 +27636,14 @@ function getStringWidth(text) {
|
|
|
27636
27636
|
}
|
|
27637
27637
|
return width;
|
|
27638
27638
|
}
|
|
27639
|
-
function generateIndent(indent2,
|
|
27640
|
-
const queue =
|
|
27639
|
+
function generateIndent(indent2, command2, options) {
|
|
27640
|
+
const queue = command2.type === INDENT_COMMAND_TYPE_DEDENT ? indent2.queue.slice(0, -1) : [...indent2.queue, command2];
|
|
27641
27641
|
let value = "";
|
|
27642
27642
|
let length = 0;
|
|
27643
27643
|
let lastTabs = 0;
|
|
27644
27644
|
let lastSpaces = 0;
|
|
27645
|
-
for (const
|
|
27646
|
-
switch (
|
|
27645
|
+
for (const command22 of queue) {
|
|
27646
|
+
switch (command22.type) {
|
|
27647
27647
|
case INDENT_COMMAND_TYPE_INDENT:
|
|
27648
27648
|
flush();
|
|
27649
27649
|
if (options.useTabs) {
|
|
@@ -27653,20 +27653,20 @@ function generateIndent(indent2, command, options) {
|
|
|
27653
27653
|
}
|
|
27654
27654
|
break;
|
|
27655
27655
|
case INDENT_COMMAND_TYPE_STRING: {
|
|
27656
|
-
const { string: string4 } =
|
|
27656
|
+
const { string: string4 } = command22;
|
|
27657
27657
|
flush();
|
|
27658
27658
|
value += string4;
|
|
27659
27659
|
length += string4.length;
|
|
27660
27660
|
break;
|
|
27661
27661
|
}
|
|
27662
27662
|
case INDENT_COMMAND_TYPE_WIDTH: {
|
|
27663
|
-
const { width } =
|
|
27663
|
+
const { width } = command22;
|
|
27664
27664
|
lastTabs += 1;
|
|
27665
27665
|
lastSpaces += width;
|
|
27666
27666
|
break;
|
|
27667
27667
|
}
|
|
27668
27668
|
default:
|
|
27669
|
-
throw new Error(`Unexpected indent comment '${
|
|
27669
|
+
throw new Error(`Unexpected indent comment '${command22.type}'.`);
|
|
27670
27670
|
}
|
|
27671
27671
|
}
|
|
27672
27672
|
flushSpaces();
|
|
@@ -27713,17 +27713,17 @@ function makeAlign(indent2, indentOptions, options) {
|
|
|
27713
27713
|
if (indentOptions === Number.NEGATIVE_INFINITY) {
|
|
27714
27714
|
return indent2.root;
|
|
27715
27715
|
}
|
|
27716
|
-
let
|
|
27716
|
+
let command2;
|
|
27717
27717
|
if (typeof indentOptions === "number") {
|
|
27718
27718
|
if (indentOptions < 0) {
|
|
27719
|
-
|
|
27719
|
+
command2 = INDENT_COMMAND_DEDENT;
|
|
27720
27720
|
} else {
|
|
27721
|
-
|
|
27721
|
+
command2 = { type: INDENT_COMMAND_TYPE_WIDTH, width: indentOptions };
|
|
27722
27722
|
}
|
|
27723
27723
|
} else {
|
|
27724
|
-
|
|
27724
|
+
command2 = { type: INDENT_COMMAND_TYPE_STRING, string: indentOptions };
|
|
27725
27725
|
}
|
|
27726
|
-
return generateIndent(indent2,
|
|
27726
|
+
return generateIndent(indent2, command2, options);
|
|
27727
27727
|
}
|
|
27728
27728
|
function makeIndent(indent2, options) {
|
|
27729
27729
|
return generateIndent(indent2, INDENT_COMMAND_INDENT, options);
|
|
@@ -133400,14 +133400,14 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133400
133400
|
return ROOT_INDENT2;
|
|
133401
133401
|
}
|
|
133402
133402
|
};
|
|
133403
|
-
function generateIndent2(indent22,
|
|
133404
|
-
const queue =
|
|
133403
|
+
function generateIndent2(indent22, command2, options8) {
|
|
133404
|
+
const queue = command2.type === INDENT_COMMAND_TYPE_DEDENT2 ? indent22.queue.slice(0, -1) : [...indent22.queue, command2];
|
|
133405
133405
|
let value = "";
|
|
133406
133406
|
let length = 0;
|
|
133407
133407
|
let lastTabs = 0;
|
|
133408
133408
|
let lastSpaces = 0;
|
|
133409
|
-
for (const
|
|
133410
|
-
switch (
|
|
133409
|
+
for (const command22 of queue) {
|
|
133410
|
+
switch (command22.type) {
|
|
133411
133411
|
case INDENT_COMMAND_TYPE_INDENT2:
|
|
133412
133412
|
flush();
|
|
133413
133413
|
if (options8.useTabs) {
|
|
@@ -133417,20 +133417,20 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133417
133417
|
}
|
|
133418
133418
|
break;
|
|
133419
133419
|
case INDENT_COMMAND_TYPE_STRING2: {
|
|
133420
|
-
const { string: string4 } =
|
|
133420
|
+
const { string: string4 } = command22;
|
|
133421
133421
|
flush();
|
|
133422
133422
|
value += string4;
|
|
133423
133423
|
length += string4.length;
|
|
133424
133424
|
break;
|
|
133425
133425
|
}
|
|
133426
133426
|
case INDENT_COMMAND_TYPE_WIDTH2: {
|
|
133427
|
-
const { width } =
|
|
133427
|
+
const { width } = command22;
|
|
133428
133428
|
lastTabs += 1;
|
|
133429
133429
|
lastSpaces += width;
|
|
133430
133430
|
break;
|
|
133431
133431
|
}
|
|
133432
133432
|
default:
|
|
133433
|
-
throw new Error(`Unexpected indent comment '${
|
|
133433
|
+
throw new Error(`Unexpected indent comment '${command22.type}'.`);
|
|
133434
133434
|
}
|
|
133435
133435
|
}
|
|
133436
133436
|
flushSpaces();
|
|
@@ -133477,17 +133477,17 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133477
133477
|
if (indentOptions === Number.NEGATIVE_INFINITY) {
|
|
133478
133478
|
return indent22.root;
|
|
133479
133479
|
}
|
|
133480
|
-
let
|
|
133480
|
+
let command2;
|
|
133481
133481
|
if (typeof indentOptions === "number") {
|
|
133482
133482
|
if (indentOptions < 0) {
|
|
133483
|
-
|
|
133483
|
+
command2 = INDENT_COMMAND_DEDENT2;
|
|
133484
133484
|
} else {
|
|
133485
|
-
|
|
133485
|
+
command2 = { type: INDENT_COMMAND_TYPE_WIDTH2, width: indentOptions };
|
|
133486
133486
|
}
|
|
133487
133487
|
} else {
|
|
133488
|
-
|
|
133488
|
+
command2 = { type: INDENT_COMMAND_TYPE_STRING2, string: indentOptions };
|
|
133489
133489
|
}
|
|
133490
|
-
return generateIndent2(indent22,
|
|
133490
|
+
return generateIndent2(indent22, command2, options8);
|
|
133491
133491
|
}
|
|
133492
133492
|
function makeIndent2(indent22, options8) {
|
|
133493
133493
|
return generateIndent2(indent22, INDENT_COMMAND_INDENT2, options8);
|
|
@@ -179494,19 +179494,19 @@ var require_base64id = __commonJS((exports, module) => {
|
|
|
179494
179494
|
/*!
|
|
179495
179495
|
* base64id v0.1.0
|
|
179496
179496
|
*/
|
|
179497
|
-
var
|
|
179497
|
+
var crypto = __require("crypto");
|
|
179498
179498
|
var Base64Id = function() {};
|
|
179499
179499
|
Base64Id.prototype.getRandomBytes = function(bytes) {
|
|
179500
179500
|
var BUFFER_SIZE = 4096;
|
|
179501
179501
|
var self2 = this;
|
|
179502
179502
|
bytes = bytes || 12;
|
|
179503
179503
|
if (bytes > BUFFER_SIZE) {
|
|
179504
|
-
return
|
|
179504
|
+
return crypto.randomBytes(bytes);
|
|
179505
179505
|
}
|
|
179506
179506
|
var bytesInBuffer = parseInt(BUFFER_SIZE / bytes);
|
|
179507
179507
|
var threshold = parseInt(bytesInBuffer * 0.85);
|
|
179508
179508
|
if (!threshold) {
|
|
179509
|
-
return
|
|
179509
|
+
return crypto.randomBytes(bytes);
|
|
179510
179510
|
}
|
|
179511
179511
|
if (this.bytesBufferIndex == null) {
|
|
179512
179512
|
this.bytesBufferIndex = -1;
|
|
@@ -179518,14 +179518,14 @@ var require_base64id = __commonJS((exports, module) => {
|
|
|
179518
179518
|
if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) {
|
|
179519
179519
|
if (!this.isGeneratingBytes) {
|
|
179520
179520
|
this.isGeneratingBytes = true;
|
|
179521
|
-
|
|
179521
|
+
crypto.randomBytes(BUFFER_SIZE, function(err, bytes2) {
|
|
179522
179522
|
self2.bytesBuffer = bytes2;
|
|
179523
179523
|
self2.bytesBufferIndex = 0;
|
|
179524
179524
|
self2.isGeneratingBytes = false;
|
|
179525
179525
|
});
|
|
179526
179526
|
}
|
|
179527
179527
|
if (this.bytesBufferIndex == -1) {
|
|
179528
|
-
return
|
|
179528
|
+
return crypto.randomBytes(bytes);
|
|
179529
179529
|
}
|
|
179530
179530
|
}
|
|
179531
179531
|
var result = this.bytesBuffer.slice(bytes * this.bytesBufferIndex, bytes * (this.bytesBufferIndex + 1));
|
|
@@ -179539,7 +179539,7 @@ var require_base64id = __commonJS((exports, module) => {
|
|
|
179539
179539
|
}
|
|
179540
179540
|
this.sequenceNumber = this.sequenceNumber + 1 | 0;
|
|
179541
179541
|
rand.writeInt32BE(this.sequenceNumber, 11);
|
|
179542
|
-
if (
|
|
179542
|
+
if (crypto.randomBytes) {
|
|
179543
179543
|
this.getRandomBytes(12).copy(rand);
|
|
179544
179544
|
} else {
|
|
179545
179545
|
[0, 4, 8].forEach(function(i5) {
|
|
@@ -215888,6 +215888,715 @@ ${l}
|
|
|
215888
215888
|
}
|
|
215889
215889
|
} }).prompt();
|
|
215890
215890
|
|
|
215891
|
+
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
215892
|
+
var ANSI_BACKGROUND_OFFSET = 10;
|
|
215893
|
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
215894
|
+
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
215895
|
+
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
215896
|
+
var styles = {
|
|
215897
|
+
modifier: {
|
|
215898
|
+
reset: [0, 0],
|
|
215899
|
+
bold: [1, 22],
|
|
215900
|
+
dim: [2, 22],
|
|
215901
|
+
italic: [3, 23],
|
|
215902
|
+
underline: [4, 24],
|
|
215903
|
+
overline: [53, 55],
|
|
215904
|
+
inverse: [7, 27],
|
|
215905
|
+
hidden: [8, 28],
|
|
215906
|
+
strikethrough: [9, 29]
|
|
215907
|
+
},
|
|
215908
|
+
color: {
|
|
215909
|
+
black: [30, 39],
|
|
215910
|
+
red: [31, 39],
|
|
215911
|
+
green: [32, 39],
|
|
215912
|
+
yellow: [33, 39],
|
|
215913
|
+
blue: [34, 39],
|
|
215914
|
+
magenta: [35, 39],
|
|
215915
|
+
cyan: [36, 39],
|
|
215916
|
+
white: [37, 39],
|
|
215917
|
+
blackBright: [90, 39],
|
|
215918
|
+
gray: [90, 39],
|
|
215919
|
+
grey: [90, 39],
|
|
215920
|
+
redBright: [91, 39],
|
|
215921
|
+
greenBright: [92, 39],
|
|
215922
|
+
yellowBright: [93, 39],
|
|
215923
|
+
blueBright: [94, 39],
|
|
215924
|
+
magentaBright: [95, 39],
|
|
215925
|
+
cyanBright: [96, 39],
|
|
215926
|
+
whiteBright: [97, 39]
|
|
215927
|
+
},
|
|
215928
|
+
bgColor: {
|
|
215929
|
+
bgBlack: [40, 49],
|
|
215930
|
+
bgRed: [41, 49],
|
|
215931
|
+
bgGreen: [42, 49],
|
|
215932
|
+
bgYellow: [43, 49],
|
|
215933
|
+
bgBlue: [44, 49],
|
|
215934
|
+
bgMagenta: [45, 49],
|
|
215935
|
+
bgCyan: [46, 49],
|
|
215936
|
+
bgWhite: [47, 49],
|
|
215937
|
+
bgBlackBright: [100, 49],
|
|
215938
|
+
bgGray: [100, 49],
|
|
215939
|
+
bgGrey: [100, 49],
|
|
215940
|
+
bgRedBright: [101, 49],
|
|
215941
|
+
bgGreenBright: [102, 49],
|
|
215942
|
+
bgYellowBright: [103, 49],
|
|
215943
|
+
bgBlueBright: [104, 49],
|
|
215944
|
+
bgMagentaBright: [105, 49],
|
|
215945
|
+
bgCyanBright: [106, 49],
|
|
215946
|
+
bgWhiteBright: [107, 49]
|
|
215947
|
+
}
|
|
215948
|
+
};
|
|
215949
|
+
var modifierNames = Object.keys(styles.modifier);
|
|
215950
|
+
var foregroundColorNames = Object.keys(styles.color);
|
|
215951
|
+
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
215952
|
+
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
215953
|
+
function assembleStyles() {
|
|
215954
|
+
const codes = new Map;
|
|
215955
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
215956
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
215957
|
+
styles[styleName] = {
|
|
215958
|
+
open: `\x1B[${style[0]}m`,
|
|
215959
|
+
close: `\x1B[${style[1]}m`
|
|
215960
|
+
};
|
|
215961
|
+
group[styleName] = styles[styleName];
|
|
215962
|
+
codes.set(style[0], style[1]);
|
|
215963
|
+
}
|
|
215964
|
+
Object.defineProperty(styles, groupName, {
|
|
215965
|
+
value: group,
|
|
215966
|
+
enumerable: false
|
|
215967
|
+
});
|
|
215968
|
+
}
|
|
215969
|
+
Object.defineProperty(styles, "codes", {
|
|
215970
|
+
value: codes,
|
|
215971
|
+
enumerable: false
|
|
215972
|
+
});
|
|
215973
|
+
styles.color.close = "\x1B[39m";
|
|
215974
|
+
styles.bgColor.close = "\x1B[49m";
|
|
215975
|
+
styles.color.ansi = wrapAnsi16();
|
|
215976
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
215977
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
215978
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
215979
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
215980
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
215981
|
+
Object.defineProperties(styles, {
|
|
215982
|
+
rgbToAnsi256: {
|
|
215983
|
+
value(red, green, blue) {
|
|
215984
|
+
if (red === green && green === blue) {
|
|
215985
|
+
if (red < 8) {
|
|
215986
|
+
return 16;
|
|
215987
|
+
}
|
|
215988
|
+
if (red > 248) {
|
|
215989
|
+
return 231;
|
|
215990
|
+
}
|
|
215991
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
215992
|
+
}
|
|
215993
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
215994
|
+
},
|
|
215995
|
+
enumerable: false
|
|
215996
|
+
},
|
|
215997
|
+
hexToRgb: {
|
|
215998
|
+
value(hex) {
|
|
215999
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
216000
|
+
if (!matches) {
|
|
216001
|
+
return [0, 0, 0];
|
|
216002
|
+
}
|
|
216003
|
+
let [colorString] = matches;
|
|
216004
|
+
if (colorString.length === 3) {
|
|
216005
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
216006
|
+
}
|
|
216007
|
+
const integer = Number.parseInt(colorString, 16);
|
|
216008
|
+
return [
|
|
216009
|
+
integer >> 16 & 255,
|
|
216010
|
+
integer >> 8 & 255,
|
|
216011
|
+
integer & 255
|
|
216012
|
+
];
|
|
216013
|
+
},
|
|
216014
|
+
enumerable: false
|
|
216015
|
+
},
|
|
216016
|
+
hexToAnsi256: {
|
|
216017
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
216018
|
+
enumerable: false
|
|
216019
|
+
},
|
|
216020
|
+
ansi256ToAnsi: {
|
|
216021
|
+
value(code) {
|
|
216022
|
+
if (code < 8) {
|
|
216023
|
+
return 30 + code;
|
|
216024
|
+
}
|
|
216025
|
+
if (code < 16) {
|
|
216026
|
+
return 90 + (code - 8);
|
|
216027
|
+
}
|
|
216028
|
+
let red;
|
|
216029
|
+
let green;
|
|
216030
|
+
let blue;
|
|
216031
|
+
if (code >= 232) {
|
|
216032
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
216033
|
+
green = red;
|
|
216034
|
+
blue = red;
|
|
216035
|
+
} else {
|
|
216036
|
+
code -= 16;
|
|
216037
|
+
const remainder = code % 36;
|
|
216038
|
+
red = Math.floor(code / 36) / 5;
|
|
216039
|
+
green = Math.floor(remainder / 6) / 5;
|
|
216040
|
+
blue = remainder % 6 / 5;
|
|
216041
|
+
}
|
|
216042
|
+
const value = Math.max(red, green, blue) * 2;
|
|
216043
|
+
if (value === 0) {
|
|
216044
|
+
return 30;
|
|
216045
|
+
}
|
|
216046
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
216047
|
+
if (value === 2) {
|
|
216048
|
+
result += 60;
|
|
216049
|
+
}
|
|
216050
|
+
return result;
|
|
216051
|
+
},
|
|
216052
|
+
enumerable: false
|
|
216053
|
+
},
|
|
216054
|
+
rgbToAnsi: {
|
|
216055
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
216056
|
+
enumerable: false
|
|
216057
|
+
},
|
|
216058
|
+
hexToAnsi: {
|
|
216059
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
216060
|
+
enumerable: false
|
|
216061
|
+
}
|
|
216062
|
+
});
|
|
216063
|
+
return styles;
|
|
216064
|
+
}
|
|
216065
|
+
var ansiStyles = assembleStyles();
|
|
216066
|
+
var ansi_styles_default = ansiStyles;
|
|
216067
|
+
|
|
216068
|
+
// ../../node_modules/chalk/source/vendor/supports-color/index.js
|
|
216069
|
+
import process2 from "node:process";
|
|
216070
|
+
import os from "node:os";
|
|
216071
|
+
import tty from "node:tty";
|
|
216072
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
216073
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
216074
|
+
const position = argv.indexOf(prefix + flag);
|
|
216075
|
+
const terminatorPosition = argv.indexOf("--");
|
|
216076
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
216077
|
+
}
|
|
216078
|
+
var { env } = process2;
|
|
216079
|
+
var flagForceColor;
|
|
216080
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
216081
|
+
flagForceColor = 0;
|
|
216082
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
216083
|
+
flagForceColor = 1;
|
|
216084
|
+
}
|
|
216085
|
+
function envForceColor() {
|
|
216086
|
+
if ("FORCE_COLOR" in env) {
|
|
216087
|
+
if (env.FORCE_COLOR === "true") {
|
|
216088
|
+
return 1;
|
|
216089
|
+
}
|
|
216090
|
+
if (env.FORCE_COLOR === "false") {
|
|
216091
|
+
return 0;
|
|
216092
|
+
}
|
|
216093
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
216094
|
+
}
|
|
216095
|
+
}
|
|
216096
|
+
function translateLevel(level) {
|
|
216097
|
+
if (level === 0) {
|
|
216098
|
+
return false;
|
|
216099
|
+
}
|
|
216100
|
+
return {
|
|
216101
|
+
level,
|
|
216102
|
+
hasBasic: true,
|
|
216103
|
+
has256: level >= 2,
|
|
216104
|
+
has16m: level >= 3
|
|
216105
|
+
};
|
|
216106
|
+
}
|
|
216107
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
216108
|
+
const noFlagForceColor = envForceColor();
|
|
216109
|
+
if (noFlagForceColor !== undefined) {
|
|
216110
|
+
flagForceColor = noFlagForceColor;
|
|
216111
|
+
}
|
|
216112
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
216113
|
+
if (forceColor === 0) {
|
|
216114
|
+
return 0;
|
|
216115
|
+
}
|
|
216116
|
+
if (sniffFlags) {
|
|
216117
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
216118
|
+
return 3;
|
|
216119
|
+
}
|
|
216120
|
+
if (hasFlag("color=256")) {
|
|
216121
|
+
return 2;
|
|
216122
|
+
}
|
|
216123
|
+
}
|
|
216124
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
216125
|
+
return 1;
|
|
216126
|
+
}
|
|
216127
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
216128
|
+
return 0;
|
|
216129
|
+
}
|
|
216130
|
+
const min = forceColor || 0;
|
|
216131
|
+
if (env.TERM === "dumb") {
|
|
216132
|
+
return min;
|
|
216133
|
+
}
|
|
216134
|
+
if (process2.platform === "win32") {
|
|
216135
|
+
const osRelease = os.release().split(".");
|
|
216136
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
216137
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
216138
|
+
}
|
|
216139
|
+
return 1;
|
|
216140
|
+
}
|
|
216141
|
+
if ("CI" in env) {
|
|
216142
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env))) {
|
|
216143
|
+
return 3;
|
|
216144
|
+
}
|
|
216145
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
|
|
216146
|
+
return 1;
|
|
216147
|
+
}
|
|
216148
|
+
return min;
|
|
216149
|
+
}
|
|
216150
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
216151
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
216152
|
+
}
|
|
216153
|
+
if (env.COLORTERM === "truecolor") {
|
|
216154
|
+
return 3;
|
|
216155
|
+
}
|
|
216156
|
+
if (env.TERM === "xterm-kitty") {
|
|
216157
|
+
return 3;
|
|
216158
|
+
}
|
|
216159
|
+
if (env.TERM === "xterm-ghostty") {
|
|
216160
|
+
return 3;
|
|
216161
|
+
}
|
|
216162
|
+
if (env.TERM === "wezterm") {
|
|
216163
|
+
return 3;
|
|
216164
|
+
}
|
|
216165
|
+
if ("TERM_PROGRAM" in env) {
|
|
216166
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
216167
|
+
switch (env.TERM_PROGRAM) {
|
|
216168
|
+
case "iTerm.app": {
|
|
216169
|
+
return version >= 3 ? 3 : 2;
|
|
216170
|
+
}
|
|
216171
|
+
case "Apple_Terminal": {
|
|
216172
|
+
return 2;
|
|
216173
|
+
}
|
|
216174
|
+
}
|
|
216175
|
+
}
|
|
216176
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
216177
|
+
return 2;
|
|
216178
|
+
}
|
|
216179
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
216180
|
+
return 1;
|
|
216181
|
+
}
|
|
216182
|
+
if ("COLORTERM" in env) {
|
|
216183
|
+
return 1;
|
|
216184
|
+
}
|
|
216185
|
+
return min;
|
|
216186
|
+
}
|
|
216187
|
+
function createSupportsColor(stream, options = {}) {
|
|
216188
|
+
const level = _supportsColor(stream, {
|
|
216189
|
+
streamIsTTY: stream && stream.isTTY,
|
|
216190
|
+
...options
|
|
216191
|
+
});
|
|
216192
|
+
return translateLevel(level);
|
|
216193
|
+
}
|
|
216194
|
+
var supportsColor = {
|
|
216195
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
216196
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
216197
|
+
};
|
|
216198
|
+
var supports_color_default = supportsColor;
|
|
216199
|
+
|
|
216200
|
+
// ../../node_modules/chalk/source/utilities.js
|
|
216201
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
216202
|
+
let index = string.indexOf(substring);
|
|
216203
|
+
if (index === -1) {
|
|
216204
|
+
return string;
|
|
216205
|
+
}
|
|
216206
|
+
const substringLength = substring.length;
|
|
216207
|
+
let endIndex = 0;
|
|
216208
|
+
let returnValue = "";
|
|
216209
|
+
do {
|
|
216210
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
216211
|
+
endIndex = index + substringLength;
|
|
216212
|
+
index = string.indexOf(substring, endIndex);
|
|
216213
|
+
} while (index !== -1);
|
|
216214
|
+
returnValue += string.slice(endIndex);
|
|
216215
|
+
return returnValue;
|
|
216216
|
+
}
|
|
216217
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
216218
|
+
let endIndex = 0;
|
|
216219
|
+
let returnValue = "";
|
|
216220
|
+
do {
|
|
216221
|
+
const gotCR = string[index - 1] === "\r";
|
|
216222
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
|
216223
|
+
` : `
|
|
216224
|
+
`) + postfix;
|
|
216225
|
+
endIndex = index + 1;
|
|
216226
|
+
index = string.indexOf(`
|
|
216227
|
+
`, endIndex);
|
|
216228
|
+
} while (index !== -1);
|
|
216229
|
+
returnValue += string.slice(endIndex);
|
|
216230
|
+
return returnValue;
|
|
216231
|
+
}
|
|
216232
|
+
|
|
216233
|
+
// ../../node_modules/chalk/source/index.js
|
|
216234
|
+
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
216235
|
+
var GENERATOR = Symbol("GENERATOR");
|
|
216236
|
+
var STYLER = Symbol("STYLER");
|
|
216237
|
+
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
216238
|
+
var levelMapping = [
|
|
216239
|
+
"ansi",
|
|
216240
|
+
"ansi",
|
|
216241
|
+
"ansi256",
|
|
216242
|
+
"ansi16m"
|
|
216243
|
+
];
|
|
216244
|
+
var styles2 = Object.create(null);
|
|
216245
|
+
var applyOptions = (object, options = {}) => {
|
|
216246
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
216247
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
216248
|
+
}
|
|
216249
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
216250
|
+
object.level = options.level === undefined ? colorLevel : options.level;
|
|
216251
|
+
};
|
|
216252
|
+
var chalkFactory = (options) => {
|
|
216253
|
+
const chalk = (...strings) => strings.join(" ");
|
|
216254
|
+
applyOptions(chalk, options);
|
|
216255
|
+
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
216256
|
+
return chalk;
|
|
216257
|
+
};
|
|
216258
|
+
function createChalk(options) {
|
|
216259
|
+
return chalkFactory(options);
|
|
216260
|
+
}
|
|
216261
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
216262
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
216263
|
+
styles2[styleName] = {
|
|
216264
|
+
get() {
|
|
216265
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
216266
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
216267
|
+
return builder;
|
|
216268
|
+
}
|
|
216269
|
+
};
|
|
216270
|
+
}
|
|
216271
|
+
styles2.visible = {
|
|
216272
|
+
get() {
|
|
216273
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
216274
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
216275
|
+
return builder;
|
|
216276
|
+
}
|
|
216277
|
+
};
|
|
216278
|
+
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
216279
|
+
if (model === "rgb") {
|
|
216280
|
+
if (level === "ansi16m") {
|
|
216281
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
216282
|
+
}
|
|
216283
|
+
if (level === "ansi256") {
|
|
216284
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
216285
|
+
}
|
|
216286
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
216287
|
+
}
|
|
216288
|
+
if (model === "hex") {
|
|
216289
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
216290
|
+
}
|
|
216291
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
216292
|
+
};
|
|
216293
|
+
var usedModels = ["rgb", "hex", "ansi256"];
|
|
216294
|
+
for (const model of usedModels) {
|
|
216295
|
+
styles2[model] = {
|
|
216296
|
+
get() {
|
|
216297
|
+
const { level } = this;
|
|
216298
|
+
return function(...arguments_) {
|
|
216299
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
216300
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
216301
|
+
};
|
|
216302
|
+
}
|
|
216303
|
+
};
|
|
216304
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
216305
|
+
styles2[bgModel] = {
|
|
216306
|
+
get() {
|
|
216307
|
+
const { level } = this;
|
|
216308
|
+
return function(...arguments_) {
|
|
216309
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
216310
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
216311
|
+
};
|
|
216312
|
+
}
|
|
216313
|
+
};
|
|
216314
|
+
}
|
|
216315
|
+
var proto = Object.defineProperties(() => {}, {
|
|
216316
|
+
...styles2,
|
|
216317
|
+
level: {
|
|
216318
|
+
enumerable: true,
|
|
216319
|
+
get() {
|
|
216320
|
+
return this[GENERATOR].level;
|
|
216321
|
+
},
|
|
216322
|
+
set(level) {
|
|
216323
|
+
this[GENERATOR].level = level;
|
|
216324
|
+
}
|
|
216325
|
+
}
|
|
216326
|
+
});
|
|
216327
|
+
var createStyler = (open, close, parent) => {
|
|
216328
|
+
let openAll;
|
|
216329
|
+
let closeAll;
|
|
216330
|
+
if (parent === undefined) {
|
|
216331
|
+
openAll = open;
|
|
216332
|
+
closeAll = close;
|
|
216333
|
+
} else {
|
|
216334
|
+
openAll = parent.openAll + open;
|
|
216335
|
+
closeAll = close + parent.closeAll;
|
|
216336
|
+
}
|
|
216337
|
+
return {
|
|
216338
|
+
open,
|
|
216339
|
+
close,
|
|
216340
|
+
openAll,
|
|
216341
|
+
closeAll,
|
|
216342
|
+
parent
|
|
216343
|
+
};
|
|
216344
|
+
};
|
|
216345
|
+
var createBuilder = (self2, _styler, _isEmpty) => {
|
|
216346
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
216347
|
+
Object.setPrototypeOf(builder, proto);
|
|
216348
|
+
builder[GENERATOR] = self2;
|
|
216349
|
+
builder[STYLER] = _styler;
|
|
216350
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
216351
|
+
return builder;
|
|
216352
|
+
};
|
|
216353
|
+
var applyStyle = (self2, string) => {
|
|
216354
|
+
if (self2.level <= 0 || !string) {
|
|
216355
|
+
return self2[IS_EMPTY] ? "" : string;
|
|
216356
|
+
}
|
|
216357
|
+
let styler = self2[STYLER];
|
|
216358
|
+
if (styler === undefined) {
|
|
216359
|
+
return string;
|
|
216360
|
+
}
|
|
216361
|
+
const { openAll, closeAll } = styler;
|
|
216362
|
+
if (string.includes("\x1B")) {
|
|
216363
|
+
while (styler !== undefined) {
|
|
216364
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
216365
|
+
styler = styler.parent;
|
|
216366
|
+
}
|
|
216367
|
+
}
|
|
216368
|
+
const lfIndex = string.indexOf(`
|
|
216369
|
+
`);
|
|
216370
|
+
if (lfIndex !== -1) {
|
|
216371
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
216372
|
+
}
|
|
216373
|
+
return openAll + string + closeAll;
|
|
216374
|
+
};
|
|
216375
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
216376
|
+
var chalk = createChalk();
|
|
216377
|
+
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
216378
|
+
var source_default = chalk;
|
|
216379
|
+
|
|
216380
|
+
// src/cli/utils/theme.ts
|
|
216381
|
+
var theme = {
|
|
216382
|
+
colors: {
|
|
216383
|
+
base44Orange: source_default.hex("#E86B3C"),
|
|
216384
|
+
base44OrangeBackground: source_default.bgHex("#E86B3C"),
|
|
216385
|
+
shinyOrange: source_default.hex("#FFD700"),
|
|
216386
|
+
links: source_default.hex("#00D4FF"),
|
|
216387
|
+
white: source_default.white
|
|
216388
|
+
},
|
|
216389
|
+
styles: {
|
|
216390
|
+
header: source_default.dim,
|
|
216391
|
+
bold: source_default.bold,
|
|
216392
|
+
dim: source_default.dim,
|
|
216393
|
+
error: source_default.red,
|
|
216394
|
+
warn: source_default.yellow
|
|
216395
|
+
},
|
|
216396
|
+
format: {
|
|
216397
|
+
errorContext(ctx) {
|
|
216398
|
+
const parts = [
|
|
216399
|
+
ctx.sessionId ? `Session: ${ctx.sessionId}` : null,
|
|
216400
|
+
ctx.appId ? `App: ${ctx.appId}` : null,
|
|
216401
|
+
new Date().toISOString()
|
|
216402
|
+
].filter(Boolean);
|
|
216403
|
+
return source_default.dim(parts.join(" | "));
|
|
216404
|
+
},
|
|
216405
|
+
details(lines) {
|
|
216406
|
+
return lines.map((line) => ` • ${line}`).join(`
|
|
216407
|
+
`);
|
|
216408
|
+
},
|
|
216409
|
+
agentHints(hints) {
|
|
216410
|
+
if (hints.length === 0) {
|
|
216411
|
+
return null;
|
|
216412
|
+
}
|
|
216413
|
+
const hintLines = hints.map((hint) => {
|
|
216414
|
+
if (hint.command) {
|
|
216415
|
+
return ` Run: ${hint.command}`;
|
|
216416
|
+
}
|
|
216417
|
+
return ` ${hint.message}`;
|
|
216418
|
+
});
|
|
216419
|
+
return ["[Agent Hints]", ...hintLines].join(`
|
|
216420
|
+
`);
|
|
216421
|
+
}
|
|
216422
|
+
}
|
|
216423
|
+
};
|
|
216424
|
+
|
|
216425
|
+
// src/cli/utils/animate.ts
|
|
216426
|
+
function sleep(ms) {
|
|
216427
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
216428
|
+
}
|
|
216429
|
+
async function animateLineReveal(line, duration) {
|
|
216430
|
+
const steps = 8;
|
|
216431
|
+
const stepDuration = duration / steps;
|
|
216432
|
+
for (let step = 0;step <= steps; step++) {
|
|
216433
|
+
const progress = step / steps;
|
|
216434
|
+
const revealIndex = Math.floor(progress * line.length);
|
|
216435
|
+
let output = "";
|
|
216436
|
+
for (let i = 0;i < line.length; i++) {
|
|
216437
|
+
if (i < revealIndex) {
|
|
216438
|
+
output += theme.colors.base44Orange(line[i]);
|
|
216439
|
+
} else if (i === revealIndex) {
|
|
216440
|
+
output += theme.colors.shinyOrange(line[i]);
|
|
216441
|
+
} else {
|
|
216442
|
+
output += theme.styles.dim(line[i]);
|
|
216443
|
+
}
|
|
216444
|
+
}
|
|
216445
|
+
process.stdout.write(`\r${output}`);
|
|
216446
|
+
await sleep(stepDuration);
|
|
216447
|
+
}
|
|
216448
|
+
process.stdout.write(`\r${theme.colors.base44Orange(line)}
|
|
216449
|
+
`);
|
|
216450
|
+
}
|
|
216451
|
+
async function shimmerPass(lines, duration) {
|
|
216452
|
+
const moveUp = `\x1B[${lines.length}A`;
|
|
216453
|
+
const steps = 12;
|
|
216454
|
+
const stepDuration = duration / steps;
|
|
216455
|
+
const maxWidth = Math.max(...lines.map((l) => l.length));
|
|
216456
|
+
for (let step = 0;step <= steps; step++) {
|
|
216457
|
+
const shimmerPos = Math.floor(step / steps * (maxWidth + 6));
|
|
216458
|
+
process.stdout.write(moveUp);
|
|
216459
|
+
for (const line of lines) {
|
|
216460
|
+
let output = "";
|
|
216461
|
+
for (let i = 0;i < line.length; i++) {
|
|
216462
|
+
const dist = Math.abs(i - shimmerPos);
|
|
216463
|
+
if (dist < 3) {
|
|
216464
|
+
output += dist === 0 ? theme.colors.white(line[i]) : theme.colors.shinyOrange(line[i]);
|
|
216465
|
+
} else {
|
|
216466
|
+
output += theme.colors.base44Orange(line[i]);
|
|
216467
|
+
}
|
|
216468
|
+
}
|
|
216469
|
+
console.log(output);
|
|
216470
|
+
}
|
|
216471
|
+
await sleep(stepDuration);
|
|
216472
|
+
}
|
|
216473
|
+
process.stdout.write(moveUp);
|
|
216474
|
+
for (const line of lines) {
|
|
216475
|
+
console.log(theme.colors.base44Orange(line));
|
|
216476
|
+
}
|
|
216477
|
+
}
|
|
216478
|
+
async function printAnimatedLines(lines) {
|
|
216479
|
+
const totalDuration = 1000;
|
|
216480
|
+
const lineDelay = totalDuration / lines.length;
|
|
216481
|
+
for (let i = 0;i < lines.length; i++) {
|
|
216482
|
+
const line = lines[i];
|
|
216483
|
+
await animateLineReveal(line, 100);
|
|
216484
|
+
if (i < lines.length - 1) {
|
|
216485
|
+
await sleep(lineDelay - 100);
|
|
216486
|
+
}
|
|
216487
|
+
}
|
|
216488
|
+
await shimmerPass(lines, 200);
|
|
216489
|
+
}
|
|
216490
|
+
|
|
216491
|
+
// src/cli/utils/banner.ts
|
|
216492
|
+
var BANNER_LINES = [
|
|
216493
|
+
"██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
|
|
216494
|
+
"██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
|
|
216495
|
+
"██████╔╝███████║███████╗█████╗ ███████║███████║",
|
|
216496
|
+
"██╔══██╗██╔══██║╚════██║██╔══╝ ╚════██║╚════██║",
|
|
216497
|
+
"██████╔╝██║ ██║███████║███████╗ ██║ ██║",
|
|
216498
|
+
"╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝"
|
|
216499
|
+
];
|
|
216500
|
+
async function printBanner() {
|
|
216501
|
+
await printAnimatedLines(BANNER_LINES);
|
|
216502
|
+
}
|
|
216503
|
+
// ../../node_modules/p-wait-for/index.js
|
|
216504
|
+
var resolveValue = Symbol("resolveValue");
|
|
216505
|
+
var sleep2 = (ms, signal) => new Promise((resolve, reject) => {
|
|
216506
|
+
if (signal?.aborted) {
|
|
216507
|
+
reject(signal.reason);
|
|
216508
|
+
return;
|
|
216509
|
+
}
|
|
216510
|
+
const timeout = setTimeout(resolve, ms);
|
|
216511
|
+
if (signal) {
|
|
216512
|
+
signal.addEventListener("abort", () => {
|
|
216513
|
+
clearTimeout(timeout);
|
|
216514
|
+
reject(signal.reason);
|
|
216515
|
+
}, { once: true });
|
|
216516
|
+
}
|
|
216517
|
+
});
|
|
216518
|
+
var validateOptions = (interval, timeout) => {
|
|
216519
|
+
if (typeof interval !== "number" || !Number.isFinite(interval) || interval < 0) {
|
|
216520
|
+
throw new TypeError("Expected interval to be a finite non-negative number");
|
|
216521
|
+
}
|
|
216522
|
+
if (typeof timeout === "object" && timeout !== null) {
|
|
216523
|
+
if (typeof timeout.milliseconds !== "number" || Number.isNaN(timeout.milliseconds) || timeout.milliseconds < 0) {
|
|
216524
|
+
throw new TypeError("Expected timeout.milliseconds to be a finite non-negative number");
|
|
216525
|
+
}
|
|
216526
|
+
} else if (typeof timeout === "number" && (Number.isNaN(timeout) || timeout < 0)) {
|
|
216527
|
+
throw new TypeError("Expected timeout to be a finite non-negative number");
|
|
216528
|
+
}
|
|
216529
|
+
};
|
|
216530
|
+
var createTimeoutError = (timeout) => {
|
|
216531
|
+
if (timeout.message instanceof Error) {
|
|
216532
|
+
return timeout.message;
|
|
216533
|
+
}
|
|
216534
|
+
const message = timeout.message ?? `Promise timed out after ${timeout.milliseconds} milliseconds`;
|
|
216535
|
+
return new TimeoutError(message);
|
|
216536
|
+
};
|
|
216537
|
+
var handleFallback = (timeout) => {
|
|
216538
|
+
if (timeout.fallback) {
|
|
216539
|
+
return timeout.fallback();
|
|
216540
|
+
}
|
|
216541
|
+
throw createTimeoutError(timeout);
|
|
216542
|
+
};
|
|
216543
|
+
var handleAbortError = (timeoutSignal, timeout, signal) => {
|
|
216544
|
+
if (timeoutSignal?.aborted) {
|
|
216545
|
+
if (typeof timeout === "object") {
|
|
216546
|
+
return handleFallback(timeout);
|
|
216547
|
+
}
|
|
216548
|
+
throw new TimeoutError;
|
|
216549
|
+
}
|
|
216550
|
+
throw signal.reason;
|
|
216551
|
+
};
|
|
216552
|
+
async function pWaitFor(condition, options = {}) {
|
|
216553
|
+
const {
|
|
216554
|
+
interval = 20,
|
|
216555
|
+
timeout = Number.POSITIVE_INFINITY,
|
|
216556
|
+
before = true,
|
|
216557
|
+
signal
|
|
216558
|
+
} = options;
|
|
216559
|
+
validateOptions(interval, timeout);
|
|
216560
|
+
const timeoutMs = typeof timeout === "number" ? timeout : timeout?.milliseconds ?? Number.POSITIVE_INFINITY;
|
|
216561
|
+
const timeoutSignal = timeoutMs === Number.POSITIVE_INFINITY ? undefined : AbortSignal.timeout(timeoutMs);
|
|
216562
|
+
const combinedSignal = timeoutSignal && signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal ?? signal;
|
|
216563
|
+
if (!before) {
|
|
216564
|
+
await sleep2(interval, combinedSignal);
|
|
216565
|
+
}
|
|
216566
|
+
if (combinedSignal?.aborted) {
|
|
216567
|
+
return handleAbortError(timeoutSignal, timeout, signal);
|
|
216568
|
+
}
|
|
216569
|
+
while (true) {
|
|
216570
|
+
try {
|
|
216571
|
+
const value = await condition();
|
|
216572
|
+
if (typeof value === "object" && value !== null && resolveValue in value) {
|
|
216573
|
+
return value[resolveValue];
|
|
216574
|
+
}
|
|
216575
|
+
if (value === true) {
|
|
216576
|
+
return;
|
|
216577
|
+
}
|
|
216578
|
+
if (value === false) {
|
|
216579
|
+
await sleep2(interval, combinedSignal);
|
|
216580
|
+
continue;
|
|
216581
|
+
}
|
|
216582
|
+
throw new TypeError("Expected condition to return a boolean");
|
|
216583
|
+
} catch (error) {
|
|
216584
|
+
if (error === combinedSignal?.reason) {
|
|
216585
|
+
return handleAbortError(timeoutSignal, timeout, signal);
|
|
216586
|
+
}
|
|
216587
|
+
throw error;
|
|
216588
|
+
}
|
|
216589
|
+
}
|
|
216590
|
+
}
|
|
216591
|
+
pWaitFor.resolveWith = (value) => ({ [resolveValue]: value });
|
|
216592
|
+
|
|
216593
|
+
class TimeoutError extends Error {
|
|
216594
|
+
constructor(message = "Promise timed out") {
|
|
216595
|
+
super(message);
|
|
216596
|
+
this.name = "TimeoutError";
|
|
216597
|
+
}
|
|
216598
|
+
}
|
|
216599
|
+
|
|
215891
216600
|
// ../../node_modules/zod/v4/classic/external.js
|
|
215892
216601
|
var exports_external = {};
|
|
215893
216602
|
__export(exports_external, {
|
|
@@ -216145,7 +216854,7 @@ __export(exports_core2, {
|
|
|
216145
216854
|
safeDecode: () => safeDecode,
|
|
216146
216855
|
registry: () => registry,
|
|
216147
216856
|
regexes: () => exports_regexes,
|
|
216148
|
-
process: () =>
|
|
216857
|
+
process: () => process3,
|
|
216149
216858
|
prettifyError: () => prettifyError,
|
|
216150
216859
|
parseAsync: () => parseAsync,
|
|
216151
216860
|
parse: () => parse,
|
|
@@ -216428,12 +217137,12 @@ function $constructor(name, initializer, params) {
|
|
|
216428
217137
|
}
|
|
216429
217138
|
inst._zod.traits.add(name);
|
|
216430
217139
|
initializer(inst, def);
|
|
216431
|
-
const
|
|
216432
|
-
const keys = Object.keys(
|
|
217140
|
+
const proto2 = _2.prototype;
|
|
217141
|
+
const keys = Object.keys(proto2);
|
|
216433
217142
|
for (let i = 0;i < keys.length; i++) {
|
|
216434
217143
|
const k2 = keys[i];
|
|
216435
217144
|
if (!(k2 in inst)) {
|
|
216436
|
-
inst[k2] =
|
|
217145
|
+
inst[k2] = proto2[k2].bind(inst);
|
|
216437
217146
|
}
|
|
216438
217147
|
}
|
|
216439
217148
|
}
|
|
@@ -226609,7 +227318,7 @@ function initializeContext(params) {
|
|
|
226609
227318
|
external: params?.external ?? undefined
|
|
226610
227319
|
};
|
|
226611
227320
|
}
|
|
226612
|
-
function
|
|
227321
|
+
function process3(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
226613
227322
|
var _a2;
|
|
226614
227323
|
const def = schema._zod.def;
|
|
226615
227324
|
const seen = ctx.seen.get(schema);
|
|
@@ -226646,7 +227355,7 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
226646
227355
|
if (parent) {
|
|
226647
227356
|
if (!result.ref)
|
|
226648
227357
|
result.ref = parent;
|
|
226649
|
-
|
|
227358
|
+
process3(parent, ctx, params);
|
|
226650
227359
|
ctx.seen.get(parent).isParent = true;
|
|
226651
227360
|
}
|
|
226652
227361
|
}
|
|
@@ -226922,14 +227631,14 @@ function isTransforming(_schema, _ctx) {
|
|
|
226922
227631
|
}
|
|
226923
227632
|
var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
226924
227633
|
const ctx = initializeContext({ ...params, processors });
|
|
226925
|
-
|
|
227634
|
+
process3(schema, ctx);
|
|
226926
227635
|
extractDefs(ctx, schema);
|
|
226927
227636
|
return finalize(ctx, schema);
|
|
226928
227637
|
};
|
|
226929
227638
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
226930
227639
|
const { libraryOptions, target } = params ?? {};
|
|
226931
227640
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
226932
|
-
|
|
227641
|
+
process3(schema, ctx);
|
|
226933
227642
|
extractDefs(ctx, schema);
|
|
226934
227643
|
return finalize(ctx, schema);
|
|
226935
227644
|
};
|
|
@@ -227180,7 +227889,7 @@ var arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
227180
227889
|
if (typeof maximum === "number")
|
|
227181
227890
|
json.maxItems = maximum;
|
|
227182
227891
|
json.type = "array";
|
|
227183
|
-
json.items =
|
|
227892
|
+
json.items = process3(def.element, ctx, { ...params, path: [...params.path, "items"] });
|
|
227184
227893
|
};
|
|
227185
227894
|
var objectProcessor = (schema, ctx, _json, params) => {
|
|
227186
227895
|
const json = _json;
|
|
@@ -227189,7 +227898,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
227189
227898
|
json.properties = {};
|
|
227190
227899
|
const shape = def.shape;
|
|
227191
227900
|
for (const key in shape) {
|
|
227192
|
-
json.properties[key] =
|
|
227901
|
+
json.properties[key] = process3(shape[key], ctx, {
|
|
227193
227902
|
...params,
|
|
227194
227903
|
path: [...params.path, "properties", key]
|
|
227195
227904
|
});
|
|
@@ -227212,7 +227921,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
227212
227921
|
if (ctx.io === "output")
|
|
227213
227922
|
json.additionalProperties = false;
|
|
227214
227923
|
} else if (def.catchall) {
|
|
227215
|
-
json.additionalProperties =
|
|
227924
|
+
json.additionalProperties = process3(def.catchall, ctx, {
|
|
227216
227925
|
...params,
|
|
227217
227926
|
path: [...params.path, "additionalProperties"]
|
|
227218
227927
|
});
|
|
@@ -227221,7 +227930,7 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
227221
227930
|
var unionProcessor = (schema, ctx, json, params) => {
|
|
227222
227931
|
const def = schema._zod.def;
|
|
227223
227932
|
const isExclusive = def.inclusive === false;
|
|
227224
|
-
const options = def.options.map((x3, i) =>
|
|
227933
|
+
const options = def.options.map((x3, i) => process3(x3, ctx, {
|
|
227225
227934
|
...params,
|
|
227226
227935
|
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
227227
227936
|
}));
|
|
@@ -227233,11 +227942,11 @@ var unionProcessor = (schema, ctx, json, params) => {
|
|
|
227233
227942
|
};
|
|
227234
227943
|
var intersectionProcessor = (schema, ctx, json, params) => {
|
|
227235
227944
|
const def = schema._zod.def;
|
|
227236
|
-
const a =
|
|
227945
|
+
const a = process3(def.left, ctx, {
|
|
227237
227946
|
...params,
|
|
227238
227947
|
path: [...params.path, "allOf", 0]
|
|
227239
227948
|
});
|
|
227240
|
-
const b =
|
|
227949
|
+
const b = process3(def.right, ctx, {
|
|
227241
227950
|
...params,
|
|
227242
227951
|
path: [...params.path, "allOf", 1]
|
|
227243
227952
|
});
|
|
@@ -227254,11 +227963,11 @@ var tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
227254
227963
|
json.type = "array";
|
|
227255
227964
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
227256
227965
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
227257
|
-
const prefixItems = def.items.map((x3, i) =>
|
|
227966
|
+
const prefixItems = def.items.map((x3, i) => process3(x3, ctx, {
|
|
227258
227967
|
...params,
|
|
227259
227968
|
path: [...params.path, prefixPath, i]
|
|
227260
227969
|
}));
|
|
227261
|
-
const rest = def.rest ?
|
|
227970
|
+
const rest = def.rest ? process3(def.rest, ctx, {
|
|
227262
227971
|
...params,
|
|
227263
227972
|
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
227264
227973
|
}) : null;
|
|
@@ -227298,7 +228007,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
227298
228007
|
const keyBag = keyType._zod.bag;
|
|
227299
228008
|
const patterns = keyBag?.patterns;
|
|
227300
228009
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
227301
|
-
const valueSchema =
|
|
228010
|
+
const valueSchema = process3(def.valueType, ctx, {
|
|
227302
228011
|
...params,
|
|
227303
228012
|
path: [...params.path, "patternProperties", "*"]
|
|
227304
228013
|
});
|
|
@@ -227308,12 +228017,12 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
227308
228017
|
}
|
|
227309
228018
|
} else {
|
|
227310
228019
|
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
227311
|
-
json.propertyNames =
|
|
228020
|
+
json.propertyNames = process3(def.keyType, ctx, {
|
|
227312
228021
|
...params,
|
|
227313
228022
|
path: [...params.path, "propertyNames"]
|
|
227314
228023
|
});
|
|
227315
228024
|
}
|
|
227316
|
-
json.additionalProperties =
|
|
228025
|
+
json.additionalProperties = process3(def.valueType, ctx, {
|
|
227317
228026
|
...params,
|
|
227318
228027
|
path: [...params.path, "additionalProperties"]
|
|
227319
228028
|
});
|
|
@@ -227328,7 +228037,7 @@ var recordProcessor = (schema, ctx, _json, params) => {
|
|
|
227328
228037
|
};
|
|
227329
228038
|
var nullableProcessor = (schema, ctx, json, params) => {
|
|
227330
228039
|
const def = schema._zod.def;
|
|
227331
|
-
const inner =
|
|
228040
|
+
const inner = process3(def.innerType, ctx, params);
|
|
227332
228041
|
const seen = ctx.seen.get(schema);
|
|
227333
228042
|
if (ctx.target === "openapi-3.0") {
|
|
227334
228043
|
seen.ref = def.innerType;
|
|
@@ -227339,20 +228048,20 @@ var nullableProcessor = (schema, ctx, json, params) => {
|
|
|
227339
228048
|
};
|
|
227340
228049
|
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
227341
228050
|
const def = schema._zod.def;
|
|
227342
|
-
|
|
228051
|
+
process3(def.innerType, ctx, params);
|
|
227343
228052
|
const seen = ctx.seen.get(schema);
|
|
227344
228053
|
seen.ref = def.innerType;
|
|
227345
228054
|
};
|
|
227346
228055
|
var defaultProcessor = (schema, ctx, json, params) => {
|
|
227347
228056
|
const def = schema._zod.def;
|
|
227348
|
-
|
|
228057
|
+
process3(def.innerType, ctx, params);
|
|
227349
228058
|
const seen = ctx.seen.get(schema);
|
|
227350
228059
|
seen.ref = def.innerType;
|
|
227351
228060
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
227352
228061
|
};
|
|
227353
228062
|
var prefaultProcessor = (schema, ctx, json, params) => {
|
|
227354
228063
|
const def = schema._zod.def;
|
|
227355
|
-
|
|
228064
|
+
process3(def.innerType, ctx, params);
|
|
227356
228065
|
const seen = ctx.seen.get(schema);
|
|
227357
228066
|
seen.ref = def.innerType;
|
|
227358
228067
|
if (ctx.io === "input")
|
|
@@ -227360,7 +228069,7 @@ var prefaultProcessor = (schema, ctx, json, params) => {
|
|
|
227360
228069
|
};
|
|
227361
228070
|
var catchProcessor = (schema, ctx, json, params) => {
|
|
227362
228071
|
const def = schema._zod.def;
|
|
227363
|
-
|
|
228072
|
+
process3(def.innerType, ctx, params);
|
|
227364
228073
|
const seen = ctx.seen.get(schema);
|
|
227365
228074
|
seen.ref = def.innerType;
|
|
227366
228075
|
let catchValue;
|
|
@@ -227374,32 +228083,32 @@ var catchProcessor = (schema, ctx, json, params) => {
|
|
|
227374
228083
|
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
227375
228084
|
const def = schema._zod.def;
|
|
227376
228085
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
227377
|
-
|
|
228086
|
+
process3(innerType, ctx, params);
|
|
227378
228087
|
const seen = ctx.seen.get(schema);
|
|
227379
228088
|
seen.ref = innerType;
|
|
227380
228089
|
};
|
|
227381
228090
|
var readonlyProcessor = (schema, ctx, json, params) => {
|
|
227382
228091
|
const def = schema._zod.def;
|
|
227383
|
-
|
|
228092
|
+
process3(def.innerType, ctx, params);
|
|
227384
228093
|
const seen = ctx.seen.get(schema);
|
|
227385
228094
|
seen.ref = def.innerType;
|
|
227386
228095
|
json.readOnly = true;
|
|
227387
228096
|
};
|
|
227388
228097
|
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
227389
228098
|
const def = schema._zod.def;
|
|
227390
|
-
|
|
228099
|
+
process3(def.innerType, ctx, params);
|
|
227391
228100
|
const seen = ctx.seen.get(schema);
|
|
227392
228101
|
seen.ref = def.innerType;
|
|
227393
228102
|
};
|
|
227394
228103
|
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
227395
228104
|
const def = schema._zod.def;
|
|
227396
|
-
|
|
228105
|
+
process3(def.innerType, ctx, params);
|
|
227397
228106
|
const seen = ctx.seen.get(schema);
|
|
227398
228107
|
seen.ref = def.innerType;
|
|
227399
228108
|
};
|
|
227400
228109
|
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
227401
228110
|
const innerType = schema._zod.innerType;
|
|
227402
|
-
|
|
228111
|
+
process3(innerType, ctx, params);
|
|
227403
228112
|
const seen = ctx.seen.get(schema);
|
|
227404
228113
|
seen.ref = innerType;
|
|
227405
228114
|
};
|
|
@@ -227451,7 +228160,7 @@ function toJSONSchema(input, params) {
|
|
|
227451
228160
|
const defs = {};
|
|
227452
228161
|
for (const entry of registry2._idmap.entries()) {
|
|
227453
228162
|
const [_2, schema] = entry;
|
|
227454
|
-
|
|
228163
|
+
process3(schema, ctx2);
|
|
227455
228164
|
}
|
|
227456
228165
|
const schemas = {};
|
|
227457
228166
|
const external = {
|
|
@@ -227474,7 +228183,7 @@ function toJSONSchema(input, params) {
|
|
|
227474
228183
|
return { schemas };
|
|
227475
228184
|
}
|
|
227476
228185
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
227477
|
-
|
|
228186
|
+
process3(input, ctx);
|
|
227478
228187
|
extractDefs(ctx, input);
|
|
227479
228188
|
return finalize(ctx, input);
|
|
227480
228189
|
}
|
|
@@ -227520,7 +228229,7 @@ class JSONSchemaGenerator {
|
|
|
227520
228229
|
});
|
|
227521
228230
|
}
|
|
227522
228231
|
process(schema, _params = { path: [], schemaPath: [] }) {
|
|
227523
|
-
return
|
|
228232
|
+
return process3(schema, this.ctx, _params);
|
|
227524
228233
|
}
|
|
227525
228234
|
emit(schema, _params) {
|
|
227526
228235
|
if (_params) {
|
|
@@ -229867,7 +230576,7 @@ var normalizeRetryOptions = (retry2 = {}) => {
|
|
|
229867
230576
|
};
|
|
229868
230577
|
|
|
229869
230578
|
// ../../node_modules/ky/distribution/errors/TimeoutError.js
|
|
229870
|
-
class
|
|
230579
|
+
class TimeoutError2 extends Error {
|
|
229871
230580
|
request;
|
|
229872
230581
|
constructor(request) {
|
|
229873
230582
|
super(`Request timed out: ${request.method} ${request.url}`);
|
|
@@ -229883,7 +230592,7 @@ async function timeout(request, init, abortController, options) {
|
|
|
229883
230592
|
if (abortController) {
|
|
229884
230593
|
abortController.abort();
|
|
229885
230594
|
}
|
|
229886
|
-
reject(new
|
|
230595
|
+
reject(new TimeoutError2(request));
|
|
229887
230596
|
}, options.timeout);
|
|
229888
230597
|
options.fetch(request, init).then(resolve).catch(reject).then(() => {
|
|
229889
230598
|
clearTimeout(timeoutId);
|
|
@@ -229946,7 +230655,7 @@ function isHTTPError(error48) {
|
|
|
229946
230655
|
return error48 instanceof HTTPError || error48?.name === HTTPError.name;
|
|
229947
230656
|
}
|
|
229948
230657
|
function isTimeoutError(error48) {
|
|
229949
|
-
return error48 instanceof
|
|
230658
|
+
return error48 instanceof TimeoutError2 || error48?.name === TimeoutError2.name;
|
|
229950
230659
|
}
|
|
229951
230660
|
|
|
229952
230661
|
// ../../node_modules/ky/distribution/core/Ky.js
|
|
@@ -236412,7 +237121,7 @@ async function downloadProject(projectId, projectPath) {
|
|
|
236412
237121
|
await pipeline(nodeStream, extract({ cwd: projectPath }));
|
|
236413
237122
|
}
|
|
236414
237123
|
// ../../node_modules/globby/index.js
|
|
236415
|
-
import
|
|
237124
|
+
import process5 from "node:process";
|
|
236416
237125
|
import fs13 from "node:fs";
|
|
236417
237126
|
import nodePath from "node:path";
|
|
236418
237127
|
import { Readable as Readable2 } from "node:stream";
|
|
@@ -236650,7 +237359,7 @@ var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
236650
237359
|
// ../../node_modules/globby/ignore.js
|
|
236651
237360
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
236652
237361
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
236653
|
-
import
|
|
237362
|
+
import process4 from "node:process";
|
|
236654
237363
|
import fs12 from "node:fs";
|
|
236655
237364
|
import fsPromises from "node:fs/promises";
|
|
236656
237365
|
import path10 from "node:path";
|
|
@@ -236984,7 +237693,7 @@ var createIgnorePredicate = (patterns, cwd, baseDir) => {
|
|
|
236984
237693
|
};
|
|
236985
237694
|
var normalizeOptions = (options = {}) => {
|
|
236986
237695
|
const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
|
|
236987
|
-
const cwd = toPath(options.cwd) ??
|
|
237696
|
+
const cwd = toPath(options.cwd) ?? process4.cwd();
|
|
236988
237697
|
const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
|
|
236989
237698
|
return {
|
|
236990
237699
|
cwd,
|
|
@@ -237068,7 +237777,7 @@ var getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
|
237068
237777
|
return files ? files.map((file2) => nodePath.posix.join(directoryPath, `**/${nodePath.extname(file2) ? file2 : `${file2}${extensionGlob}`}`)) : [nodePath.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
|
|
237069
237778
|
};
|
|
237070
237779
|
var directoryToGlob = async (directoryPaths, {
|
|
237071
|
-
cwd =
|
|
237780
|
+
cwd = process5.cwd(),
|
|
237072
237781
|
files,
|
|
237073
237782
|
extensions,
|
|
237074
237783
|
fs: fsImplementation
|
|
@@ -237084,7 +237793,7 @@ var directoryToGlob = async (directoryPaths, {
|
|
|
237084
237793
|
return globs.flat();
|
|
237085
237794
|
};
|
|
237086
237795
|
var directoryToGlobSync = (directoryPaths, {
|
|
237087
|
-
cwd =
|
|
237796
|
+
cwd = process5.cwd(),
|
|
237088
237797
|
files,
|
|
237089
237798
|
extensions,
|
|
237090
237799
|
fs: fsImplementation
|
|
@@ -237178,7 +237887,7 @@ var applyIgnoreFilesAndGetFilterSync = (options) => {
|
|
|
237178
237887
|
};
|
|
237179
237888
|
var createFilterFunction = (isIgnored, cwd) => {
|
|
237180
237889
|
const seen = new Set;
|
|
237181
|
-
const basePath = cwd ||
|
|
237890
|
+
const basePath = cwd || process5.cwd();
|
|
237182
237891
|
const pathCache = new Map;
|
|
237183
237892
|
return (fastGlobResult) => {
|
|
237184
237893
|
const pathKey = nodePath.normalize(fastGlobResult.path ?? fastGlobResult);
|
|
@@ -238807,7 +239516,7 @@ function getTemplatesIndexPath() {
|
|
|
238807
239516
|
return join8(ASSETS_DIR, "templates", "templates.json");
|
|
238808
239517
|
}
|
|
238809
239518
|
function getDenoWrapperPath() {
|
|
238810
|
-
return join8(ASSETS_DIR, "deno-runtime", "main.
|
|
239519
|
+
return join8(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
238811
239520
|
}
|
|
238812
239521
|
function ensureNpmAssets(sourceDir) {
|
|
238813
239522
|
if (existsSync(ASSETS_DIR))
|
|
@@ -239178,799 +239887,6 @@ async function getUserInfo(accessToken) {
|
|
|
239178
239887
|
}
|
|
239179
239888
|
return result.data;
|
|
239180
239889
|
}
|
|
239181
|
-
// src/core/resources/secret/schema.ts
|
|
239182
|
-
var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
|
|
239183
|
-
var SetSecretsResponseSchema = exports_external.object({
|
|
239184
|
-
success: exports_external.boolean()
|
|
239185
|
-
});
|
|
239186
|
-
var DeleteSecretResponseSchema = exports_external.object({
|
|
239187
|
-
success: exports_external.boolean()
|
|
239188
|
-
});
|
|
239189
|
-
|
|
239190
|
-
// src/core/resources/secret/api.ts
|
|
239191
|
-
async function listSecrets() {
|
|
239192
|
-
const appClient = getAppClient();
|
|
239193
|
-
let response;
|
|
239194
|
-
try {
|
|
239195
|
-
response = await appClient.get("secrets");
|
|
239196
|
-
} catch (error48) {
|
|
239197
|
-
throw await ApiError.fromHttpError(error48, "listing secrets");
|
|
239198
|
-
}
|
|
239199
|
-
const result = ListSecretsResponseSchema.safeParse(await response.json());
|
|
239200
|
-
if (!result.success) {
|
|
239201
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
239202
|
-
}
|
|
239203
|
-
return result.data;
|
|
239204
|
-
}
|
|
239205
|
-
async function setSecrets(secrets) {
|
|
239206
|
-
const appClient = getAppClient();
|
|
239207
|
-
let response;
|
|
239208
|
-
try {
|
|
239209
|
-
response = await appClient.post("secrets", {
|
|
239210
|
-
json: secrets,
|
|
239211
|
-
timeout: false
|
|
239212
|
-
});
|
|
239213
|
-
} catch (error48) {
|
|
239214
|
-
throw await ApiError.fromHttpError(error48, "setting secrets");
|
|
239215
|
-
}
|
|
239216
|
-
const result = SetSecretsResponseSchema.safeParse(await response.json());
|
|
239217
|
-
if (!result.success) {
|
|
239218
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
239219
|
-
}
|
|
239220
|
-
return result.data;
|
|
239221
|
-
}
|
|
239222
|
-
async function deleteSecret(name2) {
|
|
239223
|
-
const appClient = getAppClient();
|
|
239224
|
-
let response;
|
|
239225
|
-
try {
|
|
239226
|
-
response = await appClient.delete("secrets", {
|
|
239227
|
-
searchParams: { secret_name: name2 },
|
|
239228
|
-
timeout: false
|
|
239229
|
-
});
|
|
239230
|
-
} catch (error48) {
|
|
239231
|
-
throw await ApiError.fromHttpError(error48, "deleting secret");
|
|
239232
|
-
}
|
|
239233
|
-
const result = DeleteSecretResponseSchema.safeParse(await response.json());
|
|
239234
|
-
if (!result.success) {
|
|
239235
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
239236
|
-
}
|
|
239237
|
-
return result.data;
|
|
239238
|
-
}
|
|
239239
|
-
// src/core/utils/env.ts
|
|
239240
|
-
var import_dotenv = __toESM(require_main(), 1);
|
|
239241
|
-
async function parseEnvFile(filePath) {
|
|
239242
|
-
const content = await readTextFile(filePath);
|
|
239243
|
-
return import_dotenv.parse(content);
|
|
239244
|
-
}
|
|
239245
|
-
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
239246
|
-
var ANSI_BACKGROUND_OFFSET = 10;
|
|
239247
|
-
var wrapAnsi16 = (offset = 0) => (code2) => `\x1B[${code2 + offset}m`;
|
|
239248
|
-
var wrapAnsi256 = (offset = 0) => (code2) => `\x1B[${38 + offset};5;${code2}m`;
|
|
239249
|
-
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
239250
|
-
var styles = {
|
|
239251
|
-
modifier: {
|
|
239252
|
-
reset: [0, 0],
|
|
239253
|
-
bold: [1, 22],
|
|
239254
|
-
dim: [2, 22],
|
|
239255
|
-
italic: [3, 23],
|
|
239256
|
-
underline: [4, 24],
|
|
239257
|
-
overline: [53, 55],
|
|
239258
|
-
inverse: [7, 27],
|
|
239259
|
-
hidden: [8, 28],
|
|
239260
|
-
strikethrough: [9, 29]
|
|
239261
|
-
},
|
|
239262
|
-
color: {
|
|
239263
|
-
black: [30, 39],
|
|
239264
|
-
red: [31, 39],
|
|
239265
|
-
green: [32, 39],
|
|
239266
|
-
yellow: [33, 39],
|
|
239267
|
-
blue: [34, 39],
|
|
239268
|
-
magenta: [35, 39],
|
|
239269
|
-
cyan: [36, 39],
|
|
239270
|
-
white: [37, 39],
|
|
239271
|
-
blackBright: [90, 39],
|
|
239272
|
-
gray: [90, 39],
|
|
239273
|
-
grey: [90, 39],
|
|
239274
|
-
redBright: [91, 39],
|
|
239275
|
-
greenBright: [92, 39],
|
|
239276
|
-
yellowBright: [93, 39],
|
|
239277
|
-
blueBright: [94, 39],
|
|
239278
|
-
magentaBright: [95, 39],
|
|
239279
|
-
cyanBright: [96, 39],
|
|
239280
|
-
whiteBright: [97, 39]
|
|
239281
|
-
},
|
|
239282
|
-
bgColor: {
|
|
239283
|
-
bgBlack: [40, 49],
|
|
239284
|
-
bgRed: [41, 49],
|
|
239285
|
-
bgGreen: [42, 49],
|
|
239286
|
-
bgYellow: [43, 49],
|
|
239287
|
-
bgBlue: [44, 49],
|
|
239288
|
-
bgMagenta: [45, 49],
|
|
239289
|
-
bgCyan: [46, 49],
|
|
239290
|
-
bgWhite: [47, 49],
|
|
239291
|
-
bgBlackBright: [100, 49],
|
|
239292
|
-
bgGray: [100, 49],
|
|
239293
|
-
bgGrey: [100, 49],
|
|
239294
|
-
bgRedBright: [101, 49],
|
|
239295
|
-
bgGreenBright: [102, 49],
|
|
239296
|
-
bgYellowBright: [103, 49],
|
|
239297
|
-
bgBlueBright: [104, 49],
|
|
239298
|
-
bgMagentaBright: [105, 49],
|
|
239299
|
-
bgCyanBright: [106, 49],
|
|
239300
|
-
bgWhiteBright: [107, 49]
|
|
239301
|
-
}
|
|
239302
|
-
};
|
|
239303
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
239304
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
239305
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
239306
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
239307
|
-
function assembleStyles() {
|
|
239308
|
-
const codes = new Map;
|
|
239309
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
239310
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
239311
|
-
styles[styleName] = {
|
|
239312
|
-
open: `\x1B[${style[0]}m`,
|
|
239313
|
-
close: `\x1B[${style[1]}m`
|
|
239314
|
-
};
|
|
239315
|
-
group[styleName] = styles[styleName];
|
|
239316
|
-
codes.set(style[0], style[1]);
|
|
239317
|
-
}
|
|
239318
|
-
Object.defineProperty(styles, groupName, {
|
|
239319
|
-
value: group,
|
|
239320
|
-
enumerable: false
|
|
239321
|
-
});
|
|
239322
|
-
}
|
|
239323
|
-
Object.defineProperty(styles, "codes", {
|
|
239324
|
-
value: codes,
|
|
239325
|
-
enumerable: false
|
|
239326
|
-
});
|
|
239327
|
-
styles.color.close = "\x1B[39m";
|
|
239328
|
-
styles.bgColor.close = "\x1B[49m";
|
|
239329
|
-
styles.color.ansi = wrapAnsi16();
|
|
239330
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
239331
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
239332
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
239333
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
239334
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
239335
|
-
Object.defineProperties(styles, {
|
|
239336
|
-
rgbToAnsi256: {
|
|
239337
|
-
value(red, green, blue) {
|
|
239338
|
-
if (red === green && green === blue) {
|
|
239339
|
-
if (red < 8) {
|
|
239340
|
-
return 16;
|
|
239341
|
-
}
|
|
239342
|
-
if (red > 248) {
|
|
239343
|
-
return 231;
|
|
239344
|
-
}
|
|
239345
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
239346
|
-
}
|
|
239347
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
239348
|
-
},
|
|
239349
|
-
enumerable: false
|
|
239350
|
-
},
|
|
239351
|
-
hexToRgb: {
|
|
239352
|
-
value(hex3) {
|
|
239353
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex3.toString(16));
|
|
239354
|
-
if (!matches) {
|
|
239355
|
-
return [0, 0, 0];
|
|
239356
|
-
}
|
|
239357
|
-
let [colorString] = matches;
|
|
239358
|
-
if (colorString.length === 3) {
|
|
239359
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
239360
|
-
}
|
|
239361
|
-
const integer2 = Number.parseInt(colorString, 16);
|
|
239362
|
-
return [
|
|
239363
|
-
integer2 >> 16 & 255,
|
|
239364
|
-
integer2 >> 8 & 255,
|
|
239365
|
-
integer2 & 255
|
|
239366
|
-
];
|
|
239367
|
-
},
|
|
239368
|
-
enumerable: false
|
|
239369
|
-
},
|
|
239370
|
-
hexToAnsi256: {
|
|
239371
|
-
value: (hex3) => styles.rgbToAnsi256(...styles.hexToRgb(hex3)),
|
|
239372
|
-
enumerable: false
|
|
239373
|
-
},
|
|
239374
|
-
ansi256ToAnsi: {
|
|
239375
|
-
value(code2) {
|
|
239376
|
-
if (code2 < 8) {
|
|
239377
|
-
return 30 + code2;
|
|
239378
|
-
}
|
|
239379
|
-
if (code2 < 16) {
|
|
239380
|
-
return 90 + (code2 - 8);
|
|
239381
|
-
}
|
|
239382
|
-
let red;
|
|
239383
|
-
let green;
|
|
239384
|
-
let blue;
|
|
239385
|
-
if (code2 >= 232) {
|
|
239386
|
-
red = ((code2 - 232) * 10 + 8) / 255;
|
|
239387
|
-
green = red;
|
|
239388
|
-
blue = red;
|
|
239389
|
-
} else {
|
|
239390
|
-
code2 -= 16;
|
|
239391
|
-
const remainder = code2 % 36;
|
|
239392
|
-
red = Math.floor(code2 / 36) / 5;
|
|
239393
|
-
green = Math.floor(remainder / 6) / 5;
|
|
239394
|
-
blue = remainder % 6 / 5;
|
|
239395
|
-
}
|
|
239396
|
-
const value = Math.max(red, green, blue) * 2;
|
|
239397
|
-
if (value === 0) {
|
|
239398
|
-
return 30;
|
|
239399
|
-
}
|
|
239400
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
239401
|
-
if (value === 2) {
|
|
239402
|
-
result += 60;
|
|
239403
|
-
}
|
|
239404
|
-
return result;
|
|
239405
|
-
},
|
|
239406
|
-
enumerable: false
|
|
239407
|
-
},
|
|
239408
|
-
rgbToAnsi: {
|
|
239409
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
239410
|
-
enumerable: false
|
|
239411
|
-
},
|
|
239412
|
-
hexToAnsi: {
|
|
239413
|
-
value: (hex3) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex3)),
|
|
239414
|
-
enumerable: false
|
|
239415
|
-
}
|
|
239416
|
-
});
|
|
239417
|
-
return styles;
|
|
239418
|
-
}
|
|
239419
|
-
var ansiStyles = assembleStyles();
|
|
239420
|
-
var ansi_styles_default = ansiStyles;
|
|
239421
|
-
|
|
239422
|
-
// ../../node_modules/chalk/source/vendor/supports-color/index.js
|
|
239423
|
-
import process5 from "node:process";
|
|
239424
|
-
import os from "node:os";
|
|
239425
|
-
import tty from "node:tty";
|
|
239426
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process5.argv) {
|
|
239427
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
239428
|
-
const position = argv.indexOf(prefix + flag);
|
|
239429
|
-
const terminatorPosition = argv.indexOf("--");
|
|
239430
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
239431
|
-
}
|
|
239432
|
-
var { env: env2 } = process5;
|
|
239433
|
-
var flagForceColor;
|
|
239434
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
239435
|
-
flagForceColor = 0;
|
|
239436
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
239437
|
-
flagForceColor = 1;
|
|
239438
|
-
}
|
|
239439
|
-
function envForceColor() {
|
|
239440
|
-
if ("FORCE_COLOR" in env2) {
|
|
239441
|
-
if (env2.FORCE_COLOR === "true") {
|
|
239442
|
-
return 1;
|
|
239443
|
-
}
|
|
239444
|
-
if (env2.FORCE_COLOR === "false") {
|
|
239445
|
-
return 0;
|
|
239446
|
-
}
|
|
239447
|
-
return env2.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env2.FORCE_COLOR, 10), 3);
|
|
239448
|
-
}
|
|
239449
|
-
}
|
|
239450
|
-
function translateLevel(level) {
|
|
239451
|
-
if (level === 0) {
|
|
239452
|
-
return false;
|
|
239453
|
-
}
|
|
239454
|
-
return {
|
|
239455
|
-
level,
|
|
239456
|
-
hasBasic: true,
|
|
239457
|
-
has256: level >= 2,
|
|
239458
|
-
has16m: level >= 3
|
|
239459
|
-
};
|
|
239460
|
-
}
|
|
239461
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
239462
|
-
const noFlagForceColor = envForceColor();
|
|
239463
|
-
if (noFlagForceColor !== undefined) {
|
|
239464
|
-
flagForceColor = noFlagForceColor;
|
|
239465
|
-
}
|
|
239466
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
239467
|
-
if (forceColor === 0) {
|
|
239468
|
-
return 0;
|
|
239469
|
-
}
|
|
239470
|
-
if (sniffFlags) {
|
|
239471
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
239472
|
-
return 3;
|
|
239473
|
-
}
|
|
239474
|
-
if (hasFlag("color=256")) {
|
|
239475
|
-
return 2;
|
|
239476
|
-
}
|
|
239477
|
-
}
|
|
239478
|
-
if ("TF_BUILD" in env2 && "AGENT_NAME" in env2) {
|
|
239479
|
-
return 1;
|
|
239480
|
-
}
|
|
239481
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
239482
|
-
return 0;
|
|
239483
|
-
}
|
|
239484
|
-
const min = forceColor || 0;
|
|
239485
|
-
if (env2.TERM === "dumb") {
|
|
239486
|
-
return min;
|
|
239487
|
-
}
|
|
239488
|
-
if (process5.platform === "win32") {
|
|
239489
|
-
const osRelease = os.release().split(".");
|
|
239490
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
239491
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
239492
|
-
}
|
|
239493
|
-
return 1;
|
|
239494
|
-
}
|
|
239495
|
-
if ("CI" in env2) {
|
|
239496
|
-
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env2))) {
|
|
239497
|
-
return 3;
|
|
239498
|
-
}
|
|
239499
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env2)) || env2.CI_NAME === "codeship") {
|
|
239500
|
-
return 1;
|
|
239501
|
-
}
|
|
239502
|
-
return min;
|
|
239503
|
-
}
|
|
239504
|
-
if ("TEAMCITY_VERSION" in env2) {
|
|
239505
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
239506
|
-
}
|
|
239507
|
-
if (env2.COLORTERM === "truecolor") {
|
|
239508
|
-
return 3;
|
|
239509
|
-
}
|
|
239510
|
-
if (env2.TERM === "xterm-kitty") {
|
|
239511
|
-
return 3;
|
|
239512
|
-
}
|
|
239513
|
-
if (env2.TERM === "xterm-ghostty") {
|
|
239514
|
-
return 3;
|
|
239515
|
-
}
|
|
239516
|
-
if (env2.TERM === "wezterm") {
|
|
239517
|
-
return 3;
|
|
239518
|
-
}
|
|
239519
|
-
if ("TERM_PROGRAM" in env2) {
|
|
239520
|
-
const version2 = Number.parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
239521
|
-
switch (env2.TERM_PROGRAM) {
|
|
239522
|
-
case "iTerm.app": {
|
|
239523
|
-
return version2 >= 3 ? 3 : 2;
|
|
239524
|
-
}
|
|
239525
|
-
case "Apple_Terminal": {
|
|
239526
|
-
return 2;
|
|
239527
|
-
}
|
|
239528
|
-
}
|
|
239529
|
-
}
|
|
239530
|
-
if (/-256(color)?$/i.test(env2.TERM)) {
|
|
239531
|
-
return 2;
|
|
239532
|
-
}
|
|
239533
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env2.TERM)) {
|
|
239534
|
-
return 1;
|
|
239535
|
-
}
|
|
239536
|
-
if ("COLORTERM" in env2) {
|
|
239537
|
-
return 1;
|
|
239538
|
-
}
|
|
239539
|
-
return min;
|
|
239540
|
-
}
|
|
239541
|
-
function createSupportsColor(stream, options = {}) {
|
|
239542
|
-
const level = _supportsColor(stream, {
|
|
239543
|
-
streamIsTTY: stream && stream.isTTY,
|
|
239544
|
-
...options
|
|
239545
|
-
});
|
|
239546
|
-
return translateLevel(level);
|
|
239547
|
-
}
|
|
239548
|
-
var supportsColor = {
|
|
239549
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
239550
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
239551
|
-
};
|
|
239552
|
-
var supports_color_default = supportsColor;
|
|
239553
|
-
|
|
239554
|
-
// ../../node_modules/chalk/source/utilities.js
|
|
239555
|
-
function stringReplaceAll(string4, substring, replacer) {
|
|
239556
|
-
let index = string4.indexOf(substring);
|
|
239557
|
-
if (index === -1) {
|
|
239558
|
-
return string4;
|
|
239559
|
-
}
|
|
239560
|
-
const substringLength = substring.length;
|
|
239561
|
-
let endIndex = 0;
|
|
239562
|
-
let returnValue = "";
|
|
239563
|
-
do {
|
|
239564
|
-
returnValue += string4.slice(endIndex, index) + substring + replacer;
|
|
239565
|
-
endIndex = index + substringLength;
|
|
239566
|
-
index = string4.indexOf(substring, endIndex);
|
|
239567
|
-
} while (index !== -1);
|
|
239568
|
-
returnValue += string4.slice(endIndex);
|
|
239569
|
-
return returnValue;
|
|
239570
|
-
}
|
|
239571
|
-
function stringEncaseCRLFWithFirstIndex(string4, prefix, postfix, index) {
|
|
239572
|
-
let endIndex = 0;
|
|
239573
|
-
let returnValue = "";
|
|
239574
|
-
do {
|
|
239575
|
-
const gotCR = string4[index - 1] === "\r";
|
|
239576
|
-
returnValue += string4.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
|
239577
|
-
` : `
|
|
239578
|
-
`) + postfix;
|
|
239579
|
-
endIndex = index + 1;
|
|
239580
|
-
index = string4.indexOf(`
|
|
239581
|
-
`, endIndex);
|
|
239582
|
-
} while (index !== -1);
|
|
239583
|
-
returnValue += string4.slice(endIndex);
|
|
239584
|
-
return returnValue;
|
|
239585
|
-
}
|
|
239586
|
-
|
|
239587
|
-
// ../../node_modules/chalk/source/index.js
|
|
239588
|
-
var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
|
|
239589
|
-
var GENERATOR = Symbol("GENERATOR");
|
|
239590
|
-
var STYLER = Symbol("STYLER");
|
|
239591
|
-
var IS_EMPTY = Symbol("IS_EMPTY");
|
|
239592
|
-
var levelMapping = [
|
|
239593
|
-
"ansi",
|
|
239594
|
-
"ansi",
|
|
239595
|
-
"ansi256",
|
|
239596
|
-
"ansi16m"
|
|
239597
|
-
];
|
|
239598
|
-
var styles2 = Object.create(null);
|
|
239599
|
-
var applyOptions = (object2, options = {}) => {
|
|
239600
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
239601
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
239602
|
-
}
|
|
239603
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
239604
|
-
object2.level = options.level === undefined ? colorLevel : options.level;
|
|
239605
|
-
};
|
|
239606
|
-
var chalkFactory = (options) => {
|
|
239607
|
-
const chalk = (...strings) => strings.join(" ");
|
|
239608
|
-
applyOptions(chalk, options);
|
|
239609
|
-
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
239610
|
-
return chalk;
|
|
239611
|
-
};
|
|
239612
|
-
function createChalk(options) {
|
|
239613
|
-
return chalkFactory(options);
|
|
239614
|
-
}
|
|
239615
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
239616
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
239617
|
-
styles2[styleName] = {
|
|
239618
|
-
get() {
|
|
239619
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
239620
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
239621
|
-
return builder;
|
|
239622
|
-
}
|
|
239623
|
-
};
|
|
239624
|
-
}
|
|
239625
|
-
styles2.visible = {
|
|
239626
|
-
get() {
|
|
239627
|
-
const builder = createBuilder(this, this[STYLER], true);
|
|
239628
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
239629
|
-
return builder;
|
|
239630
|
-
}
|
|
239631
|
-
};
|
|
239632
|
-
var getModelAnsi = (model, level, type, ...arguments_) => {
|
|
239633
|
-
if (model === "rgb") {
|
|
239634
|
-
if (level === "ansi16m") {
|
|
239635
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
239636
|
-
}
|
|
239637
|
-
if (level === "ansi256") {
|
|
239638
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
239639
|
-
}
|
|
239640
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
239641
|
-
}
|
|
239642
|
-
if (model === "hex") {
|
|
239643
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
239644
|
-
}
|
|
239645
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
239646
|
-
};
|
|
239647
|
-
var usedModels = ["rgb", "hex", "ansi256"];
|
|
239648
|
-
for (const model of usedModels) {
|
|
239649
|
-
styles2[model] = {
|
|
239650
|
-
get() {
|
|
239651
|
-
const { level } = this;
|
|
239652
|
-
return function(...arguments_) {
|
|
239653
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
239654
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
239655
|
-
};
|
|
239656
|
-
}
|
|
239657
|
-
};
|
|
239658
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
239659
|
-
styles2[bgModel] = {
|
|
239660
|
-
get() {
|
|
239661
|
-
const { level } = this;
|
|
239662
|
-
return function(...arguments_) {
|
|
239663
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
239664
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
239665
|
-
};
|
|
239666
|
-
}
|
|
239667
|
-
};
|
|
239668
|
-
}
|
|
239669
|
-
var proto = Object.defineProperties(() => {}, {
|
|
239670
|
-
...styles2,
|
|
239671
|
-
level: {
|
|
239672
|
-
enumerable: true,
|
|
239673
|
-
get() {
|
|
239674
|
-
return this[GENERATOR].level;
|
|
239675
|
-
},
|
|
239676
|
-
set(level) {
|
|
239677
|
-
this[GENERATOR].level = level;
|
|
239678
|
-
}
|
|
239679
|
-
}
|
|
239680
|
-
});
|
|
239681
|
-
var createStyler = (open, close, parent) => {
|
|
239682
|
-
let openAll;
|
|
239683
|
-
let closeAll;
|
|
239684
|
-
if (parent === undefined) {
|
|
239685
|
-
openAll = open;
|
|
239686
|
-
closeAll = close;
|
|
239687
|
-
} else {
|
|
239688
|
-
openAll = parent.openAll + open;
|
|
239689
|
-
closeAll = close + parent.closeAll;
|
|
239690
|
-
}
|
|
239691
|
-
return {
|
|
239692
|
-
open,
|
|
239693
|
-
close,
|
|
239694
|
-
openAll,
|
|
239695
|
-
closeAll,
|
|
239696
|
-
parent
|
|
239697
|
-
};
|
|
239698
|
-
};
|
|
239699
|
-
var createBuilder = (self2, _styler, _isEmpty) => {
|
|
239700
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
239701
|
-
Object.setPrototypeOf(builder, proto);
|
|
239702
|
-
builder[GENERATOR] = self2;
|
|
239703
|
-
builder[STYLER] = _styler;
|
|
239704
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
239705
|
-
return builder;
|
|
239706
|
-
};
|
|
239707
|
-
var applyStyle = (self2, string4) => {
|
|
239708
|
-
if (self2.level <= 0 || !string4) {
|
|
239709
|
-
return self2[IS_EMPTY] ? "" : string4;
|
|
239710
|
-
}
|
|
239711
|
-
let styler = self2[STYLER];
|
|
239712
|
-
if (styler === undefined) {
|
|
239713
|
-
return string4;
|
|
239714
|
-
}
|
|
239715
|
-
const { openAll, closeAll } = styler;
|
|
239716
|
-
if (string4.includes("\x1B")) {
|
|
239717
|
-
while (styler !== undefined) {
|
|
239718
|
-
string4 = stringReplaceAll(string4, styler.close, styler.open);
|
|
239719
|
-
styler = styler.parent;
|
|
239720
|
-
}
|
|
239721
|
-
}
|
|
239722
|
-
const lfIndex = string4.indexOf(`
|
|
239723
|
-
`);
|
|
239724
|
-
if (lfIndex !== -1) {
|
|
239725
|
-
string4 = stringEncaseCRLFWithFirstIndex(string4, closeAll, openAll, lfIndex);
|
|
239726
|
-
}
|
|
239727
|
-
return openAll + string4 + closeAll;
|
|
239728
|
-
};
|
|
239729
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
|
239730
|
-
var chalk = createChalk();
|
|
239731
|
-
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
239732
|
-
var source_default = chalk;
|
|
239733
|
-
|
|
239734
|
-
// src/cli/utils/theme.ts
|
|
239735
|
-
var theme = {
|
|
239736
|
-
colors: {
|
|
239737
|
-
base44Orange: source_default.hex("#E86B3C"),
|
|
239738
|
-
base44OrangeBackground: source_default.bgHex("#E86B3C"),
|
|
239739
|
-
shinyOrange: source_default.hex("#FFD700"),
|
|
239740
|
-
links: source_default.hex("#00D4FF"),
|
|
239741
|
-
white: source_default.white
|
|
239742
|
-
},
|
|
239743
|
-
styles: {
|
|
239744
|
-
header: source_default.dim,
|
|
239745
|
-
bold: source_default.bold,
|
|
239746
|
-
dim: source_default.dim,
|
|
239747
|
-
error: source_default.red,
|
|
239748
|
-
warn: source_default.yellow
|
|
239749
|
-
},
|
|
239750
|
-
format: {
|
|
239751
|
-
errorContext(ctx) {
|
|
239752
|
-
const parts = [
|
|
239753
|
-
ctx.sessionId ? `Session: ${ctx.sessionId}` : null,
|
|
239754
|
-
ctx.appId ? `App: ${ctx.appId}` : null,
|
|
239755
|
-
new Date().toISOString()
|
|
239756
|
-
].filter(Boolean);
|
|
239757
|
-
return source_default.dim(parts.join(" | "));
|
|
239758
|
-
},
|
|
239759
|
-
details(lines) {
|
|
239760
|
-
return lines.map((line) => ` • ${line}`).join(`
|
|
239761
|
-
`);
|
|
239762
|
-
},
|
|
239763
|
-
agentHints(hints) {
|
|
239764
|
-
if (hints.length === 0) {
|
|
239765
|
-
return null;
|
|
239766
|
-
}
|
|
239767
|
-
const hintLines = hints.map((hint) => {
|
|
239768
|
-
if (hint.command) {
|
|
239769
|
-
return ` Run: ${hint.command}`;
|
|
239770
|
-
}
|
|
239771
|
-
return ` ${hint.message}`;
|
|
239772
|
-
});
|
|
239773
|
-
return ["[Agent Hints]", ...hintLines].join(`
|
|
239774
|
-
`);
|
|
239775
|
-
}
|
|
239776
|
-
}
|
|
239777
|
-
};
|
|
239778
|
-
|
|
239779
|
-
// src/cli/utils/animate.ts
|
|
239780
|
-
function sleep(ms) {
|
|
239781
|
-
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
239782
|
-
}
|
|
239783
|
-
async function animateLineReveal(line, duration3) {
|
|
239784
|
-
const steps = 8;
|
|
239785
|
-
const stepDuration = duration3 / steps;
|
|
239786
|
-
for (let step = 0;step <= steps; step++) {
|
|
239787
|
-
const progress = step / steps;
|
|
239788
|
-
const revealIndex = Math.floor(progress * line.length);
|
|
239789
|
-
let output = "";
|
|
239790
|
-
for (let i = 0;i < line.length; i++) {
|
|
239791
|
-
if (i < revealIndex) {
|
|
239792
|
-
output += theme.colors.base44Orange(line[i]);
|
|
239793
|
-
} else if (i === revealIndex) {
|
|
239794
|
-
output += theme.colors.shinyOrange(line[i]);
|
|
239795
|
-
} else {
|
|
239796
|
-
output += theme.styles.dim(line[i]);
|
|
239797
|
-
}
|
|
239798
|
-
}
|
|
239799
|
-
process.stdout.write(`\r${output}`);
|
|
239800
|
-
await sleep(stepDuration);
|
|
239801
|
-
}
|
|
239802
|
-
process.stdout.write(`\r${theme.colors.base44Orange(line)}
|
|
239803
|
-
`);
|
|
239804
|
-
}
|
|
239805
|
-
async function shimmerPass(lines, duration3) {
|
|
239806
|
-
const moveUp = `\x1B[${lines.length}A`;
|
|
239807
|
-
const steps = 12;
|
|
239808
|
-
const stepDuration = duration3 / steps;
|
|
239809
|
-
const maxWidth = Math.max(...lines.map((l) => l.length));
|
|
239810
|
-
for (let step = 0;step <= steps; step++) {
|
|
239811
|
-
const shimmerPos = Math.floor(step / steps * (maxWidth + 6));
|
|
239812
|
-
process.stdout.write(moveUp);
|
|
239813
|
-
for (const line of lines) {
|
|
239814
|
-
let output = "";
|
|
239815
|
-
for (let i = 0;i < line.length; i++) {
|
|
239816
|
-
const dist = Math.abs(i - shimmerPos);
|
|
239817
|
-
if (dist < 3) {
|
|
239818
|
-
output += dist === 0 ? theme.colors.white(line[i]) : theme.colors.shinyOrange(line[i]);
|
|
239819
|
-
} else {
|
|
239820
|
-
output += theme.colors.base44Orange(line[i]);
|
|
239821
|
-
}
|
|
239822
|
-
}
|
|
239823
|
-
console.log(output);
|
|
239824
|
-
}
|
|
239825
|
-
await sleep(stepDuration);
|
|
239826
|
-
}
|
|
239827
|
-
process.stdout.write(moveUp);
|
|
239828
|
-
for (const line of lines) {
|
|
239829
|
-
console.log(theme.colors.base44Orange(line));
|
|
239830
|
-
}
|
|
239831
|
-
}
|
|
239832
|
-
async function printAnimatedLines(lines) {
|
|
239833
|
-
const totalDuration = 1000;
|
|
239834
|
-
const lineDelay = totalDuration / lines.length;
|
|
239835
|
-
for (let i = 0;i < lines.length; i++) {
|
|
239836
|
-
const line = lines[i];
|
|
239837
|
-
await animateLineReveal(line, 100);
|
|
239838
|
-
if (i < lines.length - 1) {
|
|
239839
|
-
await sleep(lineDelay - 100);
|
|
239840
|
-
}
|
|
239841
|
-
}
|
|
239842
|
-
await shimmerPass(lines, 200);
|
|
239843
|
-
}
|
|
239844
|
-
|
|
239845
|
-
// src/cli/utils/banner.ts
|
|
239846
|
-
var BANNER_LINES = [
|
|
239847
|
-
"██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
|
|
239848
|
-
"██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
|
|
239849
|
-
"██████╔╝███████║███████╗█████╗ ███████║███████║",
|
|
239850
|
-
"██╔══██╗██╔══██║╚════██║██╔══╝ ╚════██║╚════██║",
|
|
239851
|
-
"██████╔╝██║ ██║███████║███████╗ ██║ ██║",
|
|
239852
|
-
"╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝"
|
|
239853
|
-
];
|
|
239854
|
-
async function printBanner(isNonInteractive) {
|
|
239855
|
-
if (isNonInteractive) {
|
|
239856
|
-
console.log(theme.colors.base44Orange(BANNER_LINES.join(`
|
|
239857
|
-
`)));
|
|
239858
|
-
} else {
|
|
239859
|
-
await printAnimatedLines(BANNER_LINES);
|
|
239860
|
-
}
|
|
239861
|
-
}
|
|
239862
|
-
// src/cli/errors.ts
|
|
239863
|
-
class CLIExitError extends Error {
|
|
239864
|
-
code;
|
|
239865
|
-
constructor(code2) {
|
|
239866
|
-
super(`CLI exited with code ${code2}`);
|
|
239867
|
-
this.code = code2;
|
|
239868
|
-
this.name = "CLIExitError";
|
|
239869
|
-
}
|
|
239870
|
-
}
|
|
239871
|
-
|
|
239872
|
-
// src/cli/utils/prompts.ts
|
|
239873
|
-
var onPromptCancel = () => {
|
|
239874
|
-
Ne("Operation cancelled.");
|
|
239875
|
-
throw new CLIExitError(0);
|
|
239876
|
-
};
|
|
239877
|
-
// ../../node_modules/p-wait-for/index.js
|
|
239878
|
-
var resolveValue = Symbol("resolveValue");
|
|
239879
|
-
var sleep2 = (ms, signal) => new Promise((resolve2, reject) => {
|
|
239880
|
-
if (signal?.aborted) {
|
|
239881
|
-
reject(signal.reason);
|
|
239882
|
-
return;
|
|
239883
|
-
}
|
|
239884
|
-
const timeout2 = setTimeout(resolve2, ms);
|
|
239885
|
-
if (signal) {
|
|
239886
|
-
signal.addEventListener("abort", () => {
|
|
239887
|
-
clearTimeout(timeout2);
|
|
239888
|
-
reject(signal.reason);
|
|
239889
|
-
}, { once: true });
|
|
239890
|
-
}
|
|
239891
|
-
});
|
|
239892
|
-
var validateOptions = (interval, timeout2) => {
|
|
239893
|
-
if (typeof interval !== "number" || !Number.isFinite(interval) || interval < 0) {
|
|
239894
|
-
throw new TypeError("Expected interval to be a finite non-negative number");
|
|
239895
|
-
}
|
|
239896
|
-
if (typeof timeout2 === "object" && timeout2 !== null) {
|
|
239897
|
-
if (typeof timeout2.milliseconds !== "number" || Number.isNaN(timeout2.milliseconds) || timeout2.milliseconds < 0) {
|
|
239898
|
-
throw new TypeError("Expected timeout.milliseconds to be a finite non-negative number");
|
|
239899
|
-
}
|
|
239900
|
-
} else if (typeof timeout2 === "number" && (Number.isNaN(timeout2) || timeout2 < 0)) {
|
|
239901
|
-
throw new TypeError("Expected timeout to be a finite non-negative number");
|
|
239902
|
-
}
|
|
239903
|
-
};
|
|
239904
|
-
var createTimeoutError = (timeout2) => {
|
|
239905
|
-
if (timeout2.message instanceof Error) {
|
|
239906
|
-
return timeout2.message;
|
|
239907
|
-
}
|
|
239908
|
-
const message = timeout2.message ?? `Promise timed out after ${timeout2.milliseconds} milliseconds`;
|
|
239909
|
-
return new TimeoutError2(message);
|
|
239910
|
-
};
|
|
239911
|
-
var handleFallback = (timeout2) => {
|
|
239912
|
-
if (timeout2.fallback) {
|
|
239913
|
-
return timeout2.fallback();
|
|
239914
|
-
}
|
|
239915
|
-
throw createTimeoutError(timeout2);
|
|
239916
|
-
};
|
|
239917
|
-
var handleAbortError = (timeoutSignal, timeout2, signal) => {
|
|
239918
|
-
if (timeoutSignal?.aborted) {
|
|
239919
|
-
if (typeof timeout2 === "object") {
|
|
239920
|
-
return handleFallback(timeout2);
|
|
239921
|
-
}
|
|
239922
|
-
throw new TimeoutError2;
|
|
239923
|
-
}
|
|
239924
|
-
throw signal.reason;
|
|
239925
|
-
};
|
|
239926
|
-
async function pWaitFor(condition, options = {}) {
|
|
239927
|
-
const {
|
|
239928
|
-
interval = 20,
|
|
239929
|
-
timeout: timeout2 = Number.POSITIVE_INFINITY,
|
|
239930
|
-
before = true,
|
|
239931
|
-
signal
|
|
239932
|
-
} = options;
|
|
239933
|
-
validateOptions(interval, timeout2);
|
|
239934
|
-
const timeoutMs = typeof timeout2 === "number" ? timeout2 : timeout2?.milliseconds ?? Number.POSITIVE_INFINITY;
|
|
239935
|
-
const timeoutSignal = timeoutMs === Number.POSITIVE_INFINITY ? undefined : AbortSignal.timeout(timeoutMs);
|
|
239936
|
-
const combinedSignal = timeoutSignal && signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal ?? signal;
|
|
239937
|
-
if (!before) {
|
|
239938
|
-
await sleep2(interval, combinedSignal);
|
|
239939
|
-
}
|
|
239940
|
-
if (combinedSignal?.aborted) {
|
|
239941
|
-
return handleAbortError(timeoutSignal, timeout2, signal);
|
|
239942
|
-
}
|
|
239943
|
-
while (true) {
|
|
239944
|
-
try {
|
|
239945
|
-
const value = await condition();
|
|
239946
|
-
if (typeof value === "object" && value !== null && resolveValue in value) {
|
|
239947
|
-
return value[resolveValue];
|
|
239948
|
-
}
|
|
239949
|
-
if (value === true) {
|
|
239950
|
-
return;
|
|
239951
|
-
}
|
|
239952
|
-
if (value === false) {
|
|
239953
|
-
await sleep2(interval, combinedSignal);
|
|
239954
|
-
continue;
|
|
239955
|
-
}
|
|
239956
|
-
throw new TypeError("Expected condition to return a boolean");
|
|
239957
|
-
} catch (error48) {
|
|
239958
|
-
if (error48 === combinedSignal?.reason) {
|
|
239959
|
-
return handleAbortError(timeoutSignal, timeout2, signal);
|
|
239960
|
-
}
|
|
239961
|
-
throw error48;
|
|
239962
|
-
}
|
|
239963
|
-
}
|
|
239964
|
-
}
|
|
239965
|
-
pWaitFor.resolveWith = (value) => ({ [resolveValue]: value });
|
|
239966
|
-
|
|
239967
|
-
class TimeoutError2 extends Error {
|
|
239968
|
-
constructor(message = "Promise timed out") {
|
|
239969
|
-
super(message);
|
|
239970
|
-
this.name = "TimeoutError";
|
|
239971
|
-
}
|
|
239972
|
-
}
|
|
239973
|
-
|
|
239974
239890
|
// src/cli/commands/auth/login-flow.ts
|
|
239975
239891
|
async function generateAndDisplayDeviceCode() {
|
|
239976
239892
|
const deviceCodeResponse = await runTask("Generating device code...", async () => {
|
|
@@ -240033,6 +239949,25 @@ async function login() {
|
|
|
240033
239949
|
};
|
|
240034
239950
|
}
|
|
240035
239951
|
|
|
239952
|
+
// src/cli/utils/command/middleware.ts
|
|
239953
|
+
async function ensureAuth(errorReporter) {
|
|
239954
|
+
const loggedIn = await isLoggedIn();
|
|
239955
|
+
if (!loggedIn) {
|
|
239956
|
+
R2.info("You need to login first to continue.");
|
|
239957
|
+
await login();
|
|
239958
|
+
}
|
|
239959
|
+
try {
|
|
239960
|
+
const userInfo = await readAuth();
|
|
239961
|
+
errorReporter.setContext({
|
|
239962
|
+
user: { email: userInfo.email, name: userInfo.name }
|
|
239963
|
+
});
|
|
239964
|
+
} catch {}
|
|
239965
|
+
}
|
|
239966
|
+
async function ensureAppConfig(errorReporter) {
|
|
239967
|
+
const appConfig = await initAppConfig();
|
|
239968
|
+
errorReporter.setContext({ appId: appConfig.id });
|
|
239969
|
+
}
|
|
239970
|
+
|
|
240036
239971
|
// ../../node_modules/is-plain-obj/index.js
|
|
240037
239972
|
function isPlainObject2(value) {
|
|
240038
239973
|
if (typeof value !== "object" || value === null) {
|
|
@@ -240376,12 +240311,12 @@ var NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
240376
240311
|
// ../../node_modules/is-unicode-supported/index.js
|
|
240377
240312
|
import process7 from "node:process";
|
|
240378
240313
|
function isUnicodeSupported() {
|
|
240379
|
-
const { env:
|
|
240380
|
-
const { TERM, TERM_PROGRAM } =
|
|
240314
|
+
const { env: env2 } = process7;
|
|
240315
|
+
const { TERM, TERM_PROGRAM } = env2;
|
|
240381
240316
|
if (process7.platform !== "win32") {
|
|
240382
240317
|
return TERM !== "linux";
|
|
240383
240318
|
}
|
|
240384
|
-
return Boolean(
|
|
240319
|
+
return Boolean(env2.WT_SESSION) || Boolean(env2.TERMINUS_SUBLIME) || env2.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env2.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
240385
240320
|
}
|
|
240386
240321
|
|
|
240387
240322
|
// ../../node_modules/figures/index.js
|
|
@@ -240894,13 +240829,13 @@ import path12 from "node:path";
|
|
|
240894
240829
|
// ../../node_modules/npm-run-path/node_modules/path-key/index.js
|
|
240895
240830
|
function pathKey(options = {}) {
|
|
240896
240831
|
const {
|
|
240897
|
-
env:
|
|
240832
|
+
env: env2 = process.env,
|
|
240898
240833
|
platform: platform6 = process.platform
|
|
240899
240834
|
} = options;
|
|
240900
240835
|
if (platform6 !== "win32") {
|
|
240901
240836
|
return "PATH";
|
|
240902
240837
|
}
|
|
240903
|
-
return Object.keys(
|
|
240838
|
+
return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
240904
240839
|
}
|
|
240905
240840
|
|
|
240906
240841
|
// ../../node_modules/npm-run-path/node_modules/unicorn-magic/node.js
|
|
@@ -240960,12 +240895,12 @@ var applyExecPath = (result, pathParts, execPath, cwdPath) => {
|
|
|
240960
240895
|
result.push(pathPart);
|
|
240961
240896
|
}
|
|
240962
240897
|
};
|
|
240963
|
-
var npmRunPathEnv = ({ env:
|
|
240964
|
-
|
|
240965
|
-
const pathName = pathKey({ env:
|
|
240966
|
-
options.path =
|
|
240967
|
-
|
|
240968
|
-
return
|
|
240898
|
+
var npmRunPathEnv = ({ env: env2 = process8.env, ...options } = {}) => {
|
|
240899
|
+
env2 = { ...env2 };
|
|
240900
|
+
const pathName = pathKey({ env: env2 });
|
|
240901
|
+
options.path = env2[pathName];
|
|
240902
|
+
env2[pathName] = npmRunPath(options);
|
|
240903
|
+
return env2;
|
|
240969
240904
|
};
|
|
240970
240905
|
|
|
240971
240906
|
// ../../node_modules/execa/lib/terminate/kill.js
|
|
@@ -242314,17 +242249,17 @@ var addDefaultOptions = ({
|
|
|
242314
242249
|
serialization
|
|
242315
242250
|
});
|
|
242316
242251
|
var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath: nodePath2 }) => {
|
|
242317
|
-
const
|
|
242252
|
+
const env2 = extendEnv ? { ...process10.env, ...envOption } : envOption;
|
|
242318
242253
|
if (preferLocal || node) {
|
|
242319
242254
|
return npmRunPathEnv({
|
|
242320
|
-
env:
|
|
242255
|
+
env: env2,
|
|
242321
242256
|
cwd: localDirectory,
|
|
242322
242257
|
execPath: nodePath2,
|
|
242323
242258
|
preferLocal,
|
|
242324
242259
|
addExecPath: node
|
|
242325
242260
|
});
|
|
242326
242261
|
}
|
|
242327
|
-
return
|
|
242262
|
+
return env2;
|
|
242328
242263
|
};
|
|
242329
242264
|
|
|
242330
242265
|
// ../../node_modules/execa/lib/arguments/shell.js
|
|
@@ -246593,6 +246528,10 @@ function formatUpgradeMessage(info, distribution) {
|
|
|
246593
246528
|
].join(`
|
|
246594
246529
|
`);
|
|
246595
246530
|
}
|
|
246531
|
+
function formatPlainUpgradeMessage(info, distribution) {
|
|
246532
|
+
const instruction = getUpgradeInstruction(detectInstallMethod(distribution));
|
|
246533
|
+
return `Update available: ${info.currentVersion} → ${info.latestVersion}. ${instruction}`;
|
|
246534
|
+
}
|
|
246596
246535
|
async function printUpgradeNotification(upgradeCheckPromise, distribution) {
|
|
246597
246536
|
try {
|
|
246598
246537
|
const upgradeInfo = await upgradeCheckPromise;
|
|
@@ -246602,47 +246541,23 @@ async function printUpgradeNotification(upgradeCheckPromise, distribution) {
|
|
|
246602
246541
|
} catch {}
|
|
246603
246542
|
}
|
|
246604
246543
|
|
|
246605
|
-
// src/cli/utils/
|
|
246606
|
-
async function
|
|
246607
|
-
if (
|
|
246608
|
-
await printBanner(
|
|
246544
|
+
// src/cli/utils/command/render.ts
|
|
246545
|
+
async function showCommandStart(fullBanner) {
|
|
246546
|
+
if (fullBanner) {
|
|
246547
|
+
await printBanner();
|
|
246609
246548
|
We("");
|
|
246610
246549
|
} else {
|
|
246611
246550
|
We(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
246612
246551
|
}
|
|
246613
|
-
|
|
246614
|
-
|
|
246615
|
-
|
|
246616
|
-
|
|
246617
|
-
|
|
246618
|
-
|
|
246619
|
-
await login();
|
|
246620
|
-
}
|
|
246621
|
-
try {
|
|
246622
|
-
const userInfo = await readAuth();
|
|
246623
|
-
context.errorReporter.setContext({
|
|
246624
|
-
user: { email: userInfo.email, name: userInfo.name }
|
|
246625
|
-
});
|
|
246626
|
-
} catch {}
|
|
246627
|
-
}
|
|
246628
|
-
if (options?.requireAppConfig !== false) {
|
|
246629
|
-
const appConfig = await initAppConfig();
|
|
246630
|
-
context.errorReporter.setContext({ appId: appConfig.id });
|
|
246631
|
-
}
|
|
246632
|
-
const result = await commandFn();
|
|
246633
|
-
await printUpgradeNotification(upgradeCheckPromise, context.distribution);
|
|
246634
|
-
Le(result.outroMessage || "");
|
|
246635
|
-
if (result.stdout) {
|
|
246636
|
-
process.stdout.write(result.stdout);
|
|
246637
|
-
}
|
|
246638
|
-
} catch (error48) {
|
|
246639
|
-
displayError(error48);
|
|
246640
|
-
const errorContext = context.errorReporter.getErrorContext();
|
|
246641
|
-
Le(theme.format.errorContext(errorContext));
|
|
246642
|
-
throw error48;
|
|
246552
|
+
}
|
|
246553
|
+
async function showCommandEnd(result, upgradeCheckPromise, distribution) {
|
|
246554
|
+
await printUpgradeNotification(upgradeCheckPromise, distribution);
|
|
246555
|
+
Le(result.outroMessage || "");
|
|
246556
|
+
if (result.stdout) {
|
|
246557
|
+
process.stdout.write(result.stdout);
|
|
246643
246558
|
}
|
|
246644
246559
|
}
|
|
246645
|
-
function
|
|
246560
|
+
function showThemedError(error48, context) {
|
|
246646
246561
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
246647
246562
|
R2.error(errorMessage);
|
|
246648
246563
|
if (isCLIError(error48)) {
|
|
@@ -246657,7 +246572,111 @@ function displayError(error48) {
|
|
|
246657
246572
|
if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
|
|
246658
246573
|
R2.error(theme.styles.dim(error48.stack));
|
|
246659
246574
|
}
|
|
246575
|
+
const errorContext = context.errorReporter.getErrorContext();
|
|
246576
|
+
Le(theme.format.errorContext(errorContext));
|
|
246577
|
+
}
|
|
246578
|
+
function showPlainError(error48) {
|
|
246579
|
+
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
246580
|
+
process.stderr.write(`Error: ${errorMessage}
|
|
246581
|
+
`);
|
|
246582
|
+
if (isCLIError(error48)) {
|
|
246583
|
+
for (const detail of error48.details) {
|
|
246584
|
+
process.stderr.write(` ${detail}
|
|
246585
|
+
`);
|
|
246586
|
+
}
|
|
246587
|
+
for (const hint of error48.hints) {
|
|
246588
|
+
const cmd = hint.command ? ` (${hint.command})` : "";
|
|
246589
|
+
process.stderr.write(` Hint: ${hint.message}${cmd}
|
|
246590
|
+
`);
|
|
246591
|
+
}
|
|
246592
|
+
}
|
|
246593
|
+
if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
|
|
246594
|
+
process.stderr.write(`${error48.stack}
|
|
246595
|
+
`);
|
|
246596
|
+
}
|
|
246660
246597
|
}
|
|
246598
|
+
|
|
246599
|
+
// src/cli/utils/command/Base44Command.ts
|
|
246600
|
+
class Base44Command extends Command {
|
|
246601
|
+
_context;
|
|
246602
|
+
_commandOptions;
|
|
246603
|
+
constructor(name2, options) {
|
|
246604
|
+
super(name2);
|
|
246605
|
+
this._commandOptions = {
|
|
246606
|
+
requireAuth: options?.requireAuth ?? true,
|
|
246607
|
+
requireAppConfig: options?.requireAppConfig ?? true,
|
|
246608
|
+
fullBanner: options?.fullBanner ?? false
|
|
246609
|
+
};
|
|
246610
|
+
}
|
|
246611
|
+
setContext(context) {
|
|
246612
|
+
this._context = context;
|
|
246613
|
+
}
|
|
246614
|
+
get isNonInteractive() {
|
|
246615
|
+
return this._context?.isNonInteractive ?? false;
|
|
246616
|
+
}
|
|
246617
|
+
get context() {
|
|
246618
|
+
if (!this._context) {
|
|
246619
|
+
throw new Error("Base44Command context not set. Ensure the command is registered via createProgram().");
|
|
246620
|
+
}
|
|
246621
|
+
return this._context;
|
|
246622
|
+
}
|
|
246623
|
+
action(fn) {
|
|
246624
|
+
return super.action(async (...args) => {
|
|
246625
|
+
const quiet = this.context.isNonInteractive;
|
|
246626
|
+
if (!quiet) {
|
|
246627
|
+
await showCommandStart(this._commandOptions.fullBanner);
|
|
246628
|
+
}
|
|
246629
|
+
const upgradeCheckPromise = startUpgradeCheck();
|
|
246630
|
+
try {
|
|
246631
|
+
if (this._commandOptions.requireAuth) {
|
|
246632
|
+
await ensureAuth(this.context.errorReporter);
|
|
246633
|
+
}
|
|
246634
|
+
if (this._commandOptions.requireAppConfig) {
|
|
246635
|
+
await ensureAppConfig(this.context.errorReporter);
|
|
246636
|
+
}
|
|
246637
|
+
const result = await fn(...args) ?? {};
|
|
246638
|
+
if (!quiet) {
|
|
246639
|
+
await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
|
|
246640
|
+
} else {
|
|
246641
|
+
if (result.outroMessage) {
|
|
246642
|
+
process.stdout.write(`${result.outroMessage}
|
|
246643
|
+
`);
|
|
246644
|
+
}
|
|
246645
|
+
if (result.stdout) {
|
|
246646
|
+
process.stdout.write(result.stdout);
|
|
246647
|
+
}
|
|
246648
|
+
const upgradeInfo = await upgradeCheckPromise;
|
|
246649
|
+
if (upgradeInfo) {
|
|
246650
|
+
process.stderr.write(`${formatPlainUpgradeMessage(upgradeInfo, this.context.distribution)}
|
|
246651
|
+
`);
|
|
246652
|
+
}
|
|
246653
|
+
}
|
|
246654
|
+
} catch (error48) {
|
|
246655
|
+
if (quiet) {
|
|
246656
|
+
showPlainError(error48);
|
|
246657
|
+
} else {
|
|
246658
|
+
showThemedError(error48, this.context);
|
|
246659
|
+
}
|
|
246660
|
+
throw error48;
|
|
246661
|
+
}
|
|
246662
|
+
});
|
|
246663
|
+
}
|
|
246664
|
+
}
|
|
246665
|
+
// src/cli/errors.ts
|
|
246666
|
+
class CLIExitError extends Error {
|
|
246667
|
+
code;
|
|
246668
|
+
constructor(code2) {
|
|
246669
|
+
super(`CLI exited with code ${code2}`);
|
|
246670
|
+
this.code = code2;
|
|
246671
|
+
this.name = "CLIExitError";
|
|
246672
|
+
}
|
|
246673
|
+
}
|
|
246674
|
+
|
|
246675
|
+
// src/cli/utils/prompts.ts
|
|
246676
|
+
var onPromptCancel = () => {
|
|
246677
|
+
Ne("Operation cancelled.");
|
|
246678
|
+
throw new CLIExitError(0);
|
|
246679
|
+
};
|
|
246661
246680
|
// src/cli/utils/runTask.ts
|
|
246662
246681
|
async function runTask(startMessage, operation, options) {
|
|
246663
246682
|
const s = bt2();
|
|
@@ -246688,7 +246707,7 @@ var import_lodash = __toESM(require_lodash(), 1);
|
|
|
246688
246707
|
var composer = require_composer();
|
|
246689
246708
|
var Document = require_Document();
|
|
246690
246709
|
var Schema = require_Schema();
|
|
246691
|
-
var
|
|
246710
|
+
var errors3 = require_errors();
|
|
246692
246711
|
var Alias = require_Alias();
|
|
246693
246712
|
var identity3 = require_identity();
|
|
246694
246713
|
var Pair = require_Pair();
|
|
@@ -246704,9 +246723,9 @@ var visit = require_visit();
|
|
|
246704
246723
|
var $Composer = composer.Composer;
|
|
246705
246724
|
var $Document = Document.Document;
|
|
246706
246725
|
var $Schema = Schema.Schema;
|
|
246707
|
-
var $YAMLError =
|
|
246708
|
-
var $YAMLParseError =
|
|
246709
|
-
var $YAMLWarning =
|
|
246726
|
+
var $YAMLError = errors3.YAMLError;
|
|
246727
|
+
var $YAMLParseError = errors3.YAMLParseError;
|
|
246728
|
+
var $YAMLWarning = errors3.YAMLWarning;
|
|
246710
246729
|
var $Alias = Alias.Alias;
|
|
246711
246730
|
var $isAlias = identity3.isAlias;
|
|
246712
246731
|
var $isCollection = identity3.isCollection;
|
|
@@ -246744,6 +246763,70 @@ function formatYaml(data, options = {}) {
|
|
|
246744
246763
|
const replacer = stripEmpty ? stripEmptyReplacer : undefined;
|
|
246745
246764
|
return $stringify(data, replacer, { indent: YAML_INDENT }).trimEnd();
|
|
246746
246765
|
}
|
|
246766
|
+
// src/core/resources/secret/schema.ts
|
|
246767
|
+
var ListSecretsResponseSchema = exports_external.record(exports_external.string(), exports_external.string());
|
|
246768
|
+
var SetSecretsResponseSchema = exports_external.object({
|
|
246769
|
+
success: exports_external.boolean()
|
|
246770
|
+
});
|
|
246771
|
+
var DeleteSecretResponseSchema = exports_external.object({
|
|
246772
|
+
success: exports_external.boolean()
|
|
246773
|
+
});
|
|
246774
|
+
|
|
246775
|
+
// src/core/resources/secret/api.ts
|
|
246776
|
+
async function listSecrets() {
|
|
246777
|
+
const appClient = getAppClient();
|
|
246778
|
+
let response;
|
|
246779
|
+
try {
|
|
246780
|
+
response = await appClient.get("secrets");
|
|
246781
|
+
} catch (error48) {
|
|
246782
|
+
throw await ApiError.fromHttpError(error48, "listing secrets");
|
|
246783
|
+
}
|
|
246784
|
+
const result = ListSecretsResponseSchema.safeParse(await response.json());
|
|
246785
|
+
if (!result.success) {
|
|
246786
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
246787
|
+
}
|
|
246788
|
+
return result.data;
|
|
246789
|
+
}
|
|
246790
|
+
async function setSecrets(secrets) {
|
|
246791
|
+
const appClient = getAppClient();
|
|
246792
|
+
let response;
|
|
246793
|
+
try {
|
|
246794
|
+
response = await appClient.post("secrets", {
|
|
246795
|
+
json: secrets,
|
|
246796
|
+
timeout: false
|
|
246797
|
+
});
|
|
246798
|
+
} catch (error48) {
|
|
246799
|
+
throw await ApiError.fromHttpError(error48, "setting secrets");
|
|
246800
|
+
}
|
|
246801
|
+
const result = SetSecretsResponseSchema.safeParse(await response.json());
|
|
246802
|
+
if (!result.success) {
|
|
246803
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
246804
|
+
}
|
|
246805
|
+
return result.data;
|
|
246806
|
+
}
|
|
246807
|
+
async function deleteSecret(name2) {
|
|
246808
|
+
const appClient = getAppClient();
|
|
246809
|
+
let response;
|
|
246810
|
+
try {
|
|
246811
|
+
response = await appClient.delete("secrets", {
|
|
246812
|
+
searchParams: { secret_name: name2 },
|
|
246813
|
+
timeout: false
|
|
246814
|
+
});
|
|
246815
|
+
} catch (error48) {
|
|
246816
|
+
throw await ApiError.fromHttpError(error48, "deleting secret");
|
|
246817
|
+
}
|
|
246818
|
+
const result = DeleteSecretResponseSchema.safeParse(await response.json());
|
|
246819
|
+
if (!result.success) {
|
|
246820
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
246821
|
+
}
|
|
246822
|
+
return result.data;
|
|
246823
|
+
}
|
|
246824
|
+
// src/core/utils/env.ts
|
|
246825
|
+
var import_dotenv = __toESM(require_main(), 1);
|
|
246826
|
+
async function parseEnvFile(filePath) {
|
|
246827
|
+
const content = await readTextFile(filePath);
|
|
246828
|
+
return import_dotenv.parse(content);
|
|
246829
|
+
}
|
|
246747
246830
|
// src/cli/commands/agents/pull.ts
|
|
246748
246831
|
async function pullAgentsAction() {
|
|
246749
246832
|
const { project: project2 } = await readProjectConfig();
|
|
@@ -246774,10 +246857,8 @@ async function pullAgentsAction() {
|
|
|
246774
246857
|
outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}`
|
|
246775
246858
|
};
|
|
246776
246859
|
}
|
|
246777
|
-
function getAgentsPullCommand(
|
|
246778
|
-
return new
|
|
246779
|
-
await runCommand(pullAgentsAction, { requireAuth: true }, context);
|
|
246780
|
-
});
|
|
246860
|
+
function getAgentsPullCommand() {
|
|
246861
|
+
return new Base44Command("pull").description("Pull agents from Base44 to local files (replaces all local agent configs)").action(pullAgentsAction);
|
|
246781
246862
|
}
|
|
246782
246863
|
|
|
246783
246864
|
// src/cli/commands/agents/push.ts
|
|
@@ -246801,22 +246882,21 @@ async function pushAgentsAction() {
|
|
|
246801
246882
|
}
|
|
246802
246883
|
return { outroMessage: "Agents pushed to Base44" };
|
|
246803
246884
|
}
|
|
246804
|
-
function getAgentsPushCommand(
|
|
246805
|
-
return new
|
|
246806
|
-
await runCommand(pushAgentsAction, { requireAuth: true }, context);
|
|
246807
|
-
});
|
|
246885
|
+
function getAgentsPushCommand() {
|
|
246886
|
+
return new Base44Command("push").description("Push local agents to Base44 (replaces all remote agent configs)").action(pushAgentsAction);
|
|
246808
246887
|
}
|
|
246809
246888
|
|
|
246810
246889
|
// src/cli/commands/agents/index.ts
|
|
246811
|
-
function getAgentsCommand(
|
|
246812
|
-
return new Command("agents").description("Manage project agents").addCommand(getAgentsPushCommand(
|
|
246890
|
+
function getAgentsCommand() {
|
|
246891
|
+
return new Command("agents").description("Manage project agents").addCommand(getAgentsPushCommand()).addCommand(getAgentsPullCommand());
|
|
246813
246892
|
}
|
|
246814
246893
|
|
|
246815
246894
|
// src/cli/commands/auth/login.ts
|
|
246816
|
-
function getLoginCommand(
|
|
246817
|
-
return new
|
|
246818
|
-
|
|
246819
|
-
|
|
246895
|
+
function getLoginCommand() {
|
|
246896
|
+
return new Base44Command("login", {
|
|
246897
|
+
requireAuth: false,
|
|
246898
|
+
requireAppConfig: false
|
|
246899
|
+
}).description("Authenticate with Base44").action(login);
|
|
246820
246900
|
}
|
|
246821
246901
|
|
|
246822
246902
|
// src/cli/commands/auth/logout.ts
|
|
@@ -246824,10 +246904,11 @@ async function logout() {
|
|
|
246824
246904
|
await deleteAuth();
|
|
246825
246905
|
return { outroMessage: "Logged out successfully" };
|
|
246826
246906
|
}
|
|
246827
|
-
function getLogoutCommand(
|
|
246828
|
-
return new
|
|
246829
|
-
|
|
246830
|
-
|
|
246907
|
+
function getLogoutCommand() {
|
|
246908
|
+
return new Base44Command("logout", {
|
|
246909
|
+
requireAuth: false,
|
|
246910
|
+
requireAppConfig: false
|
|
246911
|
+
}).description("Logout from current device").action(logout);
|
|
246831
246912
|
}
|
|
246832
246913
|
|
|
246833
246914
|
// src/cli/commands/auth/whoami.ts
|
|
@@ -246835,10 +246916,8 @@ async function whoami() {
|
|
|
246835
246916
|
const auth2 = await readAuth();
|
|
246836
246917
|
return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
|
|
246837
246918
|
}
|
|
246838
|
-
function getWhoamiCommand(
|
|
246839
|
-
return new
|
|
246840
|
-
await runCommand(whoami, { requireAuth: true, requireAppConfig: false }, context);
|
|
246841
|
-
});
|
|
246919
|
+
function getWhoamiCommand() {
|
|
246920
|
+
return new Base44Command("whoami", { requireAppConfig: false }).description("Display current authenticated user").action(whoami);
|
|
246842
246921
|
}
|
|
246843
246922
|
|
|
246844
246923
|
// src/cli/commands/connectors/list-available.ts
|
|
@@ -246863,10 +246942,8 @@ ${pad}`)}`);
|
|
|
246863
246942
|
outroMessage: `Found ${integrations.length} available integrations.`
|
|
246864
246943
|
};
|
|
246865
246944
|
}
|
|
246866
|
-
function getConnectorsListAvailableCommand(
|
|
246867
|
-
return new
|
|
246868
|
-
await runCommand(listAvailableAction, { requireAuth: true }, context);
|
|
246869
|
-
});
|
|
246945
|
+
function getConnectorsListAvailableCommand() {
|
|
246946
|
+
return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
|
|
246870
246947
|
}
|
|
246871
246948
|
|
|
246872
246949
|
// src/cli/commands/connectors/pull.ts
|
|
@@ -246900,10 +246977,8 @@ async function pullConnectorsAction() {
|
|
|
246900
246977
|
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
246901
246978
|
};
|
|
246902
246979
|
}
|
|
246903
|
-
function getConnectorsPullCommand(
|
|
246904
|
-
return new
|
|
246905
|
-
await runCommand(pullConnectorsAction, { requireAuth: true }, context);
|
|
246906
|
-
});
|
|
246980
|
+
function getConnectorsPullCommand() {
|
|
246981
|
+
return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(pullConnectorsAction);
|
|
246907
246982
|
}
|
|
246908
246983
|
|
|
246909
246984
|
// ../../node_modules/open/index.js
|
|
@@ -246994,12 +247069,12 @@ import { promisify as promisify5 } from "node:util";
|
|
|
246994
247069
|
import childProcess from "node:child_process";
|
|
246995
247070
|
var execFile = promisify5(childProcess.execFile);
|
|
246996
247071
|
var powerShellPath = () => `${process15.env.SYSTEMROOT || process15.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
246997
|
-
var executePowerShell = async (
|
|
247072
|
+
var executePowerShell = async (command2, options = {}) => {
|
|
246998
247073
|
const {
|
|
246999
247074
|
powerShellPath: psPath,
|
|
247000
247075
|
...execFileOptions
|
|
247001
247076
|
} = options;
|
|
247002
|
-
const encodedCommand = executePowerShell.encodeCommand(
|
|
247077
|
+
const encodedCommand = executePowerShell.encodeCommand(command2);
|
|
247003
247078
|
return execFile(psPath ?? powerShellPath(), [
|
|
247004
247079
|
...executePowerShell.argumentsPrefix,
|
|
247005
247080
|
encodedCommand
|
|
@@ -247015,7 +247090,7 @@ executePowerShell.argumentsPrefix = [
|
|
|
247015
247090
|
"Bypass",
|
|
247016
247091
|
"-EncodedCommand"
|
|
247017
247092
|
];
|
|
247018
|
-
executePowerShell.encodeCommand = (
|
|
247093
|
+
executePowerShell.encodeCommand = (command2) => Buffer6.from(command2, "utf16le").toString("base64");
|
|
247019
247094
|
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
247020
247095
|
|
|
247021
247096
|
// ../../node_modules/wsl-utils/utilities.js
|
|
@@ -247081,8 +247156,8 @@ var canAccessPowerShell = async () => {
|
|
|
247081
247156
|
};
|
|
247082
247157
|
var wslDefaultBrowser = async () => {
|
|
247083
247158
|
const psPath = await powerShellPath2();
|
|
247084
|
-
const
|
|
247085
|
-
const { stdout } = await executePowerShell(
|
|
247159
|
+
const command2 = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
247160
|
+
const { stdout } = await executePowerShell(command2, { powerShellPath: psPath });
|
|
247086
247161
|
return stdout.trim();
|
|
247087
247162
|
};
|
|
247088
247163
|
var convertWslPathToWindows = async (path16) => {
|
|
@@ -247326,7 +247401,7 @@ var baseOpen = async (options) => {
|
|
|
247326
247401
|
}
|
|
247327
247402
|
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
247328
247403
|
}
|
|
247329
|
-
let
|
|
247404
|
+
let command2;
|
|
247330
247405
|
const cliArguments = [];
|
|
247331
247406
|
const childProcessOptions = {};
|
|
247332
247407
|
let shouldUseWindowsInWsl = false;
|
|
@@ -247334,7 +247409,7 @@ var baseOpen = async (options) => {
|
|
|
247334
247409
|
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
247335
247410
|
}
|
|
247336
247411
|
if (platform6 === "darwin") {
|
|
247337
|
-
|
|
247412
|
+
command2 = "open";
|
|
247338
247413
|
if (options.wait) {
|
|
247339
247414
|
cliArguments.push("--wait-apps");
|
|
247340
247415
|
}
|
|
@@ -247348,7 +247423,7 @@ var baseOpen = async (options) => {
|
|
|
247348
247423
|
cliArguments.push("-a", app);
|
|
247349
247424
|
}
|
|
247350
247425
|
} else if (platform6 === "win32" || shouldUseWindowsInWsl) {
|
|
247351
|
-
|
|
247426
|
+
command2 = await powerShellPath2();
|
|
247352
247427
|
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
247353
247428
|
if (!is_wsl_default) {
|
|
247354
247429
|
childProcessOptions.windowsVerbatimArguments = true;
|
|
@@ -247378,7 +247453,7 @@ var baseOpen = async (options) => {
|
|
|
247378
247453
|
}
|
|
247379
247454
|
} else {
|
|
247380
247455
|
if (app) {
|
|
247381
|
-
|
|
247456
|
+
command2 = app;
|
|
247382
247457
|
} else {
|
|
247383
247458
|
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
247384
247459
|
let exeLocalXdgOpen = false;
|
|
@@ -247387,7 +247462,7 @@ var baseOpen = async (options) => {
|
|
|
247387
247462
|
exeLocalXdgOpen = true;
|
|
247388
247463
|
} catch {}
|
|
247389
247464
|
const useSystemXdgOpen = process20.versions.electron ?? (platform6 === "android" || isBundled || !exeLocalXdgOpen);
|
|
247390
|
-
|
|
247465
|
+
command2 = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
247391
247466
|
}
|
|
247392
247467
|
if (appArguments.length > 0) {
|
|
247393
247468
|
cliArguments.push(...appArguments);
|
|
@@ -247403,7 +247478,7 @@ var baseOpen = async (options) => {
|
|
|
247403
247478
|
if (options.target) {
|
|
247404
247479
|
cliArguments.push(options.target);
|
|
247405
247480
|
}
|
|
247406
|
-
const subprocess = childProcess3.spawn(
|
|
247481
|
+
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
247407
247482
|
if (options.wait) {
|
|
247408
247483
|
return new Promise((resolve2, reject) => {
|
|
247409
247484
|
subprocess.once("error", reject);
|
|
@@ -247546,7 +247621,7 @@ async function runOAuthFlowWithSkip(connector2) {
|
|
|
247546
247621
|
timeout: POLL_TIMEOUT_MS
|
|
247547
247622
|
});
|
|
247548
247623
|
} catch (err) {
|
|
247549
|
-
if (err instanceof
|
|
247624
|
+
if (err instanceof TimeoutError) {
|
|
247550
247625
|
finalStatus = "PENDING";
|
|
247551
247626
|
} else {
|
|
247552
247627
|
throw err;
|
|
@@ -247682,15 +247757,15 @@ async function pushConnectorsAction(isNonInteractive) {
|
|
|
247682
247757
|
printSummary(results, oauthOutcomes);
|
|
247683
247758
|
return { outroMessage };
|
|
247684
247759
|
}
|
|
247685
|
-
function getConnectorsPushCommand(
|
|
247686
|
-
return new
|
|
247687
|
-
await
|
|
247760
|
+
function getConnectorsPushCommand() {
|
|
247761
|
+
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(async (_options, command2) => {
|
|
247762
|
+
return await pushConnectorsAction(command2.isNonInteractive);
|
|
247688
247763
|
});
|
|
247689
247764
|
}
|
|
247690
247765
|
|
|
247691
247766
|
// src/cli/commands/connectors/index.ts
|
|
247692
|
-
function getConnectorsCommand(
|
|
247693
|
-
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand(
|
|
247767
|
+
function getConnectorsCommand() {
|
|
247768
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(getConnectorsPullCommand()).addCommand(getConnectorsPushCommand());
|
|
247694
247769
|
}
|
|
247695
247770
|
|
|
247696
247771
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -247701,15 +247776,15 @@ async function openDashboard(isNonInteractive) {
|
|
|
247701
247776
|
}
|
|
247702
247777
|
return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
|
|
247703
247778
|
}
|
|
247704
|
-
function getDashboardOpenCommand(
|
|
247705
|
-
return new
|
|
247706
|
-
await
|
|
247779
|
+
function getDashboardOpenCommand() {
|
|
247780
|
+
return new Base44Command("open").description("Open the app dashboard in your browser").action(async (_options, command2) => {
|
|
247781
|
+
return await openDashboard(command2.isNonInteractive);
|
|
247707
247782
|
});
|
|
247708
247783
|
}
|
|
247709
247784
|
|
|
247710
247785
|
// src/cli/commands/dashboard/index.ts
|
|
247711
|
-
function getDashboardCommand(
|
|
247712
|
-
return new Command("dashboard").description("Manage app dashboard").addCommand(getDashboardOpenCommand(
|
|
247786
|
+
function getDashboardCommand() {
|
|
247787
|
+
return new Command("dashboard").description("Manage app dashboard").addCommand(getDashboardOpenCommand());
|
|
247713
247788
|
}
|
|
247714
247789
|
|
|
247715
247790
|
// src/cli/commands/entities/push.ts
|
|
@@ -247737,10 +247812,8 @@ async function pushEntitiesAction() {
|
|
|
247737
247812
|
}
|
|
247738
247813
|
return { outroMessage: "Entities pushed to Base44" };
|
|
247739
247814
|
}
|
|
247740
|
-
function getEntitiesPushCommand(
|
|
247741
|
-
return new Command("entities").description("Manage project entities").addCommand(new
|
|
247742
|
-
await runCommand(pushEntitiesAction, { requireAuth: true }, context);
|
|
247743
|
-
}));
|
|
247815
|
+
function getEntitiesPushCommand() {
|
|
247816
|
+
return new Command("entities").description("Manage project entities").addCommand(new Base44Command("push").description("Push local entities to Base44").action(pushEntitiesAction));
|
|
247744
247817
|
}
|
|
247745
247818
|
|
|
247746
247819
|
// src/cli/commands/functions/delete.ts
|
|
@@ -247783,16 +247856,16 @@ async function deleteFunctionsAction(names) {
|
|
|
247783
247856
|
function parseNames(args) {
|
|
247784
247857
|
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
247785
247858
|
}
|
|
247786
|
-
function validateNames(
|
|
247787
|
-
const names = parseNames(
|
|
247859
|
+
function validateNames(command2) {
|
|
247860
|
+
const names = parseNames(command2.args);
|
|
247788
247861
|
if (names.length === 0) {
|
|
247789
|
-
|
|
247862
|
+
command2.error("At least one function name is required");
|
|
247790
247863
|
}
|
|
247791
247864
|
}
|
|
247792
|
-
function getDeleteCommand(
|
|
247793
|
-
return new
|
|
247865
|
+
function getDeleteCommand() {
|
|
247866
|
+
return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (rawNames) => {
|
|
247794
247867
|
const names = parseNames(rawNames);
|
|
247795
|
-
|
|
247868
|
+
return deleteFunctionsAction(names);
|
|
247796
247869
|
});
|
|
247797
247870
|
}
|
|
247798
247871
|
|
|
@@ -247898,12 +247971,10 @@ async function deployFunctionsAction(names, options) {
|
|
|
247898
247971
|
}
|
|
247899
247972
|
return { outroMessage: buildDeploySummary(results) };
|
|
247900
247973
|
}
|
|
247901
|
-
function getDeployCommand(
|
|
247902
|
-
return new
|
|
247903
|
-
|
|
247904
|
-
|
|
247905
|
-
return deployFunctionsAction(names, options);
|
|
247906
|
-
}, { requireAuth: true }, context);
|
|
247974
|
+
function getDeployCommand() {
|
|
247975
|
+
return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options) => {
|
|
247976
|
+
const names = parseNames2(rawNames);
|
|
247977
|
+
return deployFunctionsAction(names, options);
|
|
247907
247978
|
});
|
|
247908
247979
|
}
|
|
247909
247980
|
|
|
@@ -247922,10 +247993,8 @@ async function listFunctionsAction() {
|
|
|
247922
247993
|
outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
|
|
247923
247994
|
};
|
|
247924
247995
|
}
|
|
247925
|
-
function getListCommand(
|
|
247926
|
-
return new
|
|
247927
|
-
await runCommand(listFunctionsAction, { requireAuth: true }, context);
|
|
247928
|
-
});
|
|
247996
|
+
function getListCommand() {
|
|
247997
|
+
return new Base44Command("list").description("List all deployed functions").action(listFunctionsAction);
|
|
247929
247998
|
}
|
|
247930
247999
|
|
|
247931
248000
|
// src/cli/commands/functions/pull.ts
|
|
@@ -247966,15 +248035,13 @@ async function pullFunctionsAction(name2) {
|
|
|
247966
248035
|
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
247967
248036
|
};
|
|
247968
248037
|
}
|
|
247969
|
-
function getPullCommand(
|
|
247970
|
-
return new
|
|
247971
|
-
await runCommand(() => pullFunctionsAction(name2), { requireAuth: true }, context);
|
|
247972
|
-
});
|
|
248038
|
+
function getPullCommand() {
|
|
248039
|
+
return new Base44Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Function name to pull (pulls all if omitted)").action(pullFunctionsAction);
|
|
247973
248040
|
}
|
|
247974
248041
|
|
|
247975
248042
|
// src/cli/commands/functions/index.ts
|
|
247976
|
-
function getFunctionsCommand(
|
|
247977
|
-
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(
|
|
248043
|
+
function getFunctionsCommand() {
|
|
248044
|
+
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand()).addCommand(getDeleteCommand()).addCommand(getListCommand()).addCommand(getPullCommand());
|
|
247978
248045
|
}
|
|
247979
248046
|
|
|
247980
248047
|
// src/cli/commands/project/create.ts
|
|
@@ -247992,10 +248059,10 @@ async function getTemplateById(templateId) {
|
|
|
247992
248059
|
}
|
|
247993
248060
|
return template2;
|
|
247994
248061
|
}
|
|
247995
|
-
function validateNonInteractiveFlags(
|
|
247996
|
-
const { path: path17 } =
|
|
247997
|
-
if (path17 && !
|
|
247998
|
-
|
|
248062
|
+
function validateNonInteractiveFlags(command2) {
|
|
248063
|
+
const { path: path17 } = command2.opts();
|
|
248064
|
+
if (path17 && !command2.args.length) {
|
|
248065
|
+
command2.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
|
|
247999
248066
|
}
|
|
248000
248067
|
}
|
|
248001
248068
|
async function createInteractive(options) {
|
|
@@ -248144,21 +248211,35 @@ async function executeCreate({
|
|
|
248144
248211
|
}
|
|
248145
248212
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
248146
248213
|
}
|
|
248147
|
-
function getCreateCommand(
|
|
248148
|
-
return new
|
|
248214
|
+
function getCreateCommand() {
|
|
248215
|
+
return new Base44Command("create", {
|
|
248216
|
+
requireAppConfig: false,
|
|
248217
|
+
fullBanner: true
|
|
248218
|
+
}).description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").addHelpText("after", `
|
|
248149
248219
|
Examples:
|
|
248150
248220
|
$ base44 create my-app Creates a base44 project at ./my-app
|
|
248151
248221
|
$ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
|
|
248152
|
-
$ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options) => {
|
|
248222
|
+
$ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options, command2) => {
|
|
248153
248223
|
if (name2 && !options.path) {
|
|
248154
248224
|
options.path = `./${import_kebabCase.default(name2)}`;
|
|
248155
248225
|
}
|
|
248156
|
-
const
|
|
248157
|
-
if (isNonInteractive) {
|
|
248158
|
-
|
|
248159
|
-
|
|
248160
|
-
|
|
248226
|
+
const skipPrompts = !!(options.name ?? name2) && !!options.path;
|
|
248227
|
+
if (!skipPrompts && command2.isNonInteractive) {
|
|
248228
|
+
throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
|
|
248229
|
+
hints: [
|
|
248230
|
+
{
|
|
248231
|
+
message: "Usage: base44 create <name> --path <path>"
|
|
248232
|
+
}
|
|
248233
|
+
]
|
|
248234
|
+
});
|
|
248235
|
+
}
|
|
248236
|
+
if (skipPrompts) {
|
|
248237
|
+
return await createNonInteractive({
|
|
248238
|
+
name: options.name ?? name2,
|
|
248239
|
+
...options
|
|
248240
|
+
});
|
|
248161
248241
|
}
|
|
248242
|
+
return await createInteractive({ name: name2, ...options });
|
|
248162
248243
|
});
|
|
248163
248244
|
}
|
|
248164
248245
|
|
|
@@ -248226,12 +248307,15 @@ ${summaryLines.join(`
|
|
|
248226
248307
|
}
|
|
248227
248308
|
return { outroMessage: "App deployed successfully" };
|
|
248228
248309
|
}
|
|
248229
|
-
function getDeployCommand2(
|
|
248230
|
-
return new
|
|
248231
|
-
|
|
248310
|
+
function getDeployCommand2() {
|
|
248311
|
+
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
|
|
248312
|
+
if (command2.isNonInteractive && !options.yes) {
|
|
248313
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248314
|
+
}
|
|
248315
|
+
return await deployAction({
|
|
248232
248316
|
...options,
|
|
248233
|
-
isNonInteractive:
|
|
248234
|
-
})
|
|
248317
|
+
isNonInteractive: command2.isNonInteractive
|
|
248318
|
+
});
|
|
248235
248319
|
});
|
|
248236
248320
|
}
|
|
248237
248321
|
async function handleOAuthConnectors(connectorResults, options) {
|
|
@@ -248255,13 +248339,13 @@ function printStripeResult(r) {
|
|
|
248255
248339
|
}
|
|
248256
248340
|
|
|
248257
248341
|
// src/cli/commands/project/link.ts
|
|
248258
|
-
function validateNonInteractiveFlags2(
|
|
248259
|
-
const { create: create4, name: name2, projectId } =
|
|
248342
|
+
function validateNonInteractiveFlags2(command2) {
|
|
248343
|
+
const { create: create4, name: name2, projectId } = command2.opts();
|
|
248260
248344
|
if (create4 && projectId) {
|
|
248261
|
-
|
|
248345
|
+
command2.error("--create and --projectId cannot be used together");
|
|
248262
248346
|
}
|
|
248263
248347
|
if (create4 && !name2) {
|
|
248264
|
-
|
|
248348
|
+
command2.error("--name is required when using --create");
|
|
248265
248349
|
}
|
|
248266
248350
|
}
|
|
248267
248351
|
async function promptForLinkAction() {
|
|
@@ -248394,9 +248478,13 @@ async function link(options) {
|
|
|
248394
248478
|
R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
|
|
248395
248479
|
return { outroMessage: "Project linked" };
|
|
248396
248480
|
}
|
|
248397
|
-
function getLinkCommand(
|
|
248398
|
-
return new
|
|
248399
|
-
|
|
248481
|
+
function getLinkCommand() {
|
|
248482
|
+
return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options, command2) => {
|
|
248483
|
+
const skipPrompts = !!options.create || !!options.projectId;
|
|
248484
|
+
if (!skipPrompts && command2.isNonInteractive) {
|
|
248485
|
+
throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
|
|
248486
|
+
}
|
|
248487
|
+
return await link(options);
|
|
248400
248488
|
});
|
|
248401
248489
|
}
|
|
248402
248490
|
|
|
@@ -248516,10 +248604,8 @@ async function logsAction(options) {
|
|
|
248516
248604
|
` : formatLogs(entries);
|
|
248517
248605
|
return { outroMessage: "Fetched logs", stdout: logsOutput };
|
|
248518
248606
|
}
|
|
248519
|
-
function getLogsCommand(
|
|
248520
|
-
return new
|
|
248521
|
-
await runCommand(() => logsAction(options), { requireAuth: true }, context);
|
|
248522
|
-
});
|
|
248607
|
+
function getLogsCommand() {
|
|
248608
|
+
return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time (ISO format)", normalizeDatetime).option("--until <datetime>", "Show logs until this time (ISO format)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).action(logsAction);
|
|
248523
248609
|
}
|
|
248524
248610
|
|
|
248525
248611
|
// src/cli/commands/secrets/delete.ts
|
|
@@ -248534,10 +248620,8 @@ async function deleteSecretAction(key) {
|
|
|
248534
248620
|
outroMessage: "Secret deleted successfully."
|
|
248535
248621
|
};
|
|
248536
248622
|
}
|
|
248537
|
-
function getSecretsDeleteCommand(
|
|
248538
|
-
return new
|
|
248539
|
-
await runCommand(() => deleteSecretAction(key), { requireAuth: true }, context);
|
|
248540
|
-
});
|
|
248623
|
+
function getSecretsDeleteCommand() {
|
|
248624
|
+
return new Base44Command("delete").description("Delete a secret").argument("<key>", "Secret name to delete").action(deleteSecretAction);
|
|
248541
248625
|
}
|
|
248542
248626
|
|
|
248543
248627
|
// src/cli/commands/secrets/list.ts
|
|
@@ -248559,10 +248643,8 @@ async function listSecretsAction() {
|
|
|
248559
248643
|
outroMessage: `Found ${names.length} secrets.`
|
|
248560
248644
|
};
|
|
248561
248645
|
}
|
|
248562
|
-
function getSecretsListCommand(
|
|
248563
|
-
return new
|
|
248564
|
-
await runCommand(listSecretsAction, { requireAuth: true }, context);
|
|
248565
|
-
});
|
|
248646
|
+
function getSecretsListCommand() {
|
|
248647
|
+
return new Base44Command("list").description("List secret names").action(listSecretsAction);
|
|
248566
248648
|
}
|
|
248567
248649
|
|
|
248568
248650
|
// src/cli/commands/secrets/set.ts
|
|
@@ -248616,15 +248698,13 @@ async function setSecretsAction(entries, options) {
|
|
|
248616
248698
|
outroMessage: "Secrets set successfully."
|
|
248617
248699
|
};
|
|
248618
248700
|
}
|
|
248619
|
-
function getSecretsSetCommand(
|
|
248620
|
-
return new
|
|
248621
|
-
await runCommand(() => setSecretsAction(entries, options), { requireAuth: true }, context);
|
|
248622
|
-
});
|
|
248701
|
+
function getSecretsSetCommand() {
|
|
248702
|
+
return new Base44Command("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").action(setSecretsAction);
|
|
248623
248703
|
}
|
|
248624
248704
|
|
|
248625
248705
|
// src/cli/commands/secrets/index.ts
|
|
248626
|
-
function getSecretsCommand(
|
|
248627
|
-
return new Command("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand(
|
|
248706
|
+
function getSecretsCommand() {
|
|
248707
|
+
return new Command("secrets").description("Manage project secrets (environment variables)").addCommand(getSecretsListCommand()).addCommand(getSecretsSetCommand()).addCommand(getSecretsDeleteCommand());
|
|
248628
248708
|
}
|
|
248629
248709
|
|
|
248630
248710
|
// src/cli/commands/site/deploy.ts
|
|
@@ -248657,12 +248737,15 @@ async function deployAction2(options) {
|
|
|
248657
248737
|
});
|
|
248658
248738
|
return { outroMessage: `Visit your site at: ${result.appUrl}` };
|
|
248659
248739
|
}
|
|
248660
|
-
function getSiteDeployCommand(
|
|
248661
|
-
return new
|
|
248662
|
-
|
|
248740
|
+
function getSiteDeployCommand() {
|
|
248741
|
+
return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
|
|
248742
|
+
if (command2.isNonInteractive && !options.yes) {
|
|
248743
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248744
|
+
}
|
|
248745
|
+
return await deployAction2({
|
|
248663
248746
|
...options,
|
|
248664
|
-
isNonInteractive:
|
|
248665
|
-
})
|
|
248747
|
+
isNonInteractive: command2.isNonInteractive
|
|
248748
|
+
});
|
|
248666
248749
|
});
|
|
248667
248750
|
}
|
|
248668
248751
|
|
|
@@ -248674,15 +248757,15 @@ async function openAction(isNonInteractive) {
|
|
|
248674
248757
|
}
|
|
248675
248758
|
return { outroMessage: `Site opened at ${siteUrl}` };
|
|
248676
248759
|
}
|
|
248677
|
-
function getSiteOpenCommand(
|
|
248678
|
-
return new
|
|
248679
|
-
await
|
|
248760
|
+
function getSiteOpenCommand() {
|
|
248761
|
+
return new Base44Command("open").description("Open the published site in your browser").action(async (_options, command2) => {
|
|
248762
|
+
return await openAction(command2.isNonInteractive);
|
|
248680
248763
|
});
|
|
248681
248764
|
}
|
|
248682
248765
|
|
|
248683
248766
|
// src/cli/commands/site/index.ts
|
|
248684
|
-
function getSiteCommand(
|
|
248685
|
-
return new Command("site").description("Manage app site (frontend app)").addCommand(getSiteDeployCommand(
|
|
248767
|
+
function getSiteCommand() {
|
|
248768
|
+
return new Command("site").description("Manage app site (frontend app)").addCommand(getSiteDeployCommand()).addCommand(getSiteOpenCommand());
|
|
248686
248769
|
}
|
|
248687
248770
|
|
|
248688
248771
|
// src/core/types/generator.ts
|
|
@@ -248805,21 +248888,19 @@ async function generateTypesAction() {
|
|
|
248805
248888
|
outroMessage: tsconfigUpdated ? `Generated ${TYPES_FILE_PATH} and updated tsconfig.json` : `Generated ${TYPES_FILE_PATH}`
|
|
248806
248889
|
};
|
|
248807
248890
|
}
|
|
248808
|
-
function getTypesGenerateCommand(
|
|
248809
|
-
return new
|
|
248810
|
-
await runCommand(() => generateTypesAction(), { requireAuth: false }, context);
|
|
248811
|
-
});
|
|
248891
|
+
function getTypesGenerateCommand() {
|
|
248892
|
+
return new Base44Command("generate", { requireAuth: false }).description("Generate TypeScript declaration file (types.d.ts) from project resources").action(generateTypesAction);
|
|
248812
248893
|
}
|
|
248813
248894
|
|
|
248814
248895
|
// src/cli/commands/types/index.ts
|
|
248815
|
-
function getTypesCommand(
|
|
248816
|
-
return new Command("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand(
|
|
248896
|
+
function getTypesCommand() {
|
|
248897
|
+
return new Command("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand());
|
|
248817
248898
|
}
|
|
248818
248899
|
|
|
248819
248900
|
// src/cli/dev/dev-server/main.ts
|
|
248820
248901
|
import { dirname as dirname14, join as join20 } from "node:path";
|
|
248821
248902
|
var import_cors = __toESM(require_lib4(), 1);
|
|
248822
|
-
var
|
|
248903
|
+
var import_express4 = __toESM(require_express(), 1);
|
|
248823
248904
|
|
|
248824
248905
|
// ../../node_modules/get-port/index.js
|
|
248825
248906
|
import net from "node:net";
|
|
@@ -249177,36 +249258,6 @@ function createFunctionRouter(manager, logger) {
|
|
|
249177
249258
|
// src/cli/dev/dev-server/db/database.ts
|
|
249178
249259
|
var import_nedb = __toESM(require_nedb(), 1);
|
|
249179
249260
|
|
|
249180
|
-
// ../../node_modules/nanoid/index.js
|
|
249181
|
-
import { webcrypto as crypto } from "node:crypto";
|
|
249182
|
-
|
|
249183
|
-
// ../../node_modules/nanoid/url-alphabet/index.js
|
|
249184
|
-
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
249185
|
-
|
|
249186
|
-
// ../../node_modules/nanoid/index.js
|
|
249187
|
-
var POOL_SIZE_MULTIPLIER = 128;
|
|
249188
|
-
var pool;
|
|
249189
|
-
var poolOffset;
|
|
249190
|
-
function fillPool(bytes) {
|
|
249191
|
-
if (!pool || pool.length < bytes) {
|
|
249192
|
-
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
249193
|
-
crypto.getRandomValues(pool);
|
|
249194
|
-
poolOffset = 0;
|
|
249195
|
-
} else if (poolOffset + bytes > pool.length) {
|
|
249196
|
-
crypto.getRandomValues(pool);
|
|
249197
|
-
poolOffset = 0;
|
|
249198
|
-
}
|
|
249199
|
-
poolOffset += bytes;
|
|
249200
|
-
}
|
|
249201
|
-
function nanoid3(size = 21) {
|
|
249202
|
-
fillPool(size |= 0);
|
|
249203
|
-
let id2 = "";
|
|
249204
|
-
for (let i5 = poolOffset - size;i5 < poolOffset; i5++) {
|
|
249205
|
-
id2 += urlAlphabet[pool[i5] & 63];
|
|
249206
|
-
}
|
|
249207
|
-
return id2;
|
|
249208
|
-
}
|
|
249209
|
-
|
|
249210
249261
|
// src/cli/dev/dev-server/db/validator.ts
|
|
249211
249262
|
var fieldTypes = [
|
|
249212
249263
|
"string",
|
|
@@ -249353,63 +249404,18 @@ class Validator {
|
|
|
249353
249404
|
}
|
|
249354
249405
|
|
|
249355
249406
|
// src/cli/dev/dev-server/db/database.ts
|
|
249356
|
-
var USER_COLLECTION = "user";
|
|
249357
|
-
|
|
249358
249407
|
class Database {
|
|
249359
249408
|
collections = new Map;
|
|
249360
249409
|
schemas = new Map;
|
|
249361
249410
|
validator = new Validator;
|
|
249362
|
-
|
|
249363
|
-
const userDataStore = new import_nedb.default;
|
|
249364
|
-
this.collections.set(USER_COLLECTION, userDataStore);
|
|
249365
|
-
const userInfo = await readAuth();
|
|
249366
|
-
const now = new Date().toISOString().replace("Z", "000");
|
|
249367
|
-
await userDataStore.insertAsync({
|
|
249368
|
-
id: nanoid3(),
|
|
249369
|
-
email: userInfo.email,
|
|
249370
|
-
full_name: userInfo.name,
|
|
249371
|
-
is_service: false,
|
|
249372
|
-
is_verified: true,
|
|
249373
|
-
disabled: null,
|
|
249374
|
-
role: "admin",
|
|
249375
|
-
collaborator_role: "editor",
|
|
249376
|
-
created_date: now,
|
|
249377
|
-
updated_date: now
|
|
249378
|
-
});
|
|
249411
|
+
load(entities) {
|
|
249379
249412
|
for (const entity2 of entities) {
|
|
249380
|
-
|
|
249381
|
-
|
|
249382
|
-
if (entityName === USER_COLLECTION) {
|
|
249383
|
-
["full_name", "email"].forEach((predefinedField) => {
|
|
249384
|
-
if (predefinedField in clonedEntity.properties) {
|
|
249385
|
-
throw new Error(`Error syncing entities: Invalid User schema: User schema cannot contain base fields: ${predefinedField}. These fields are built-in and managed by the system.`);
|
|
249386
|
-
}
|
|
249387
|
-
});
|
|
249388
|
-
clonedEntity.properties.full_name = { type: "string" };
|
|
249389
|
-
clonedEntity.properties.email = { type: "string" };
|
|
249390
|
-
clonedEntity.properties.role = { type: "string" };
|
|
249391
|
-
} else {
|
|
249392
|
-
this.collections.set(entityName, new import_nedb.default);
|
|
249393
|
-
}
|
|
249394
|
-
this.schemas.set(entityName, clonedEntity);
|
|
249395
|
-
}
|
|
249396
|
-
if (!this.schemas.has(USER_COLLECTION)) {
|
|
249397
|
-
this.schemas.set(USER_COLLECTION, {
|
|
249398
|
-
name: "User",
|
|
249399
|
-
type: "object",
|
|
249400
|
-
properties: {
|
|
249401
|
-
full_name: { type: "string" },
|
|
249402
|
-
email: { type: "string" },
|
|
249403
|
-
role: { type: "string" }
|
|
249404
|
-
}
|
|
249405
|
-
});
|
|
249413
|
+
this.collections.set(entity2.name, new import_nedb.default);
|
|
249414
|
+
this.schemas.set(entity2.name, entity2);
|
|
249406
249415
|
}
|
|
249407
249416
|
}
|
|
249408
|
-
hasCollection(name2) {
|
|
249409
|
-
return this.collections.has(this.normalizeName(name2));
|
|
249410
|
-
}
|
|
249411
249417
|
getCollection(name2) {
|
|
249412
|
-
return this.collections.get(
|
|
249418
|
+
return this.collections.get(name2);
|
|
249413
249419
|
}
|
|
249414
249420
|
getCollectionNames() {
|
|
249415
249421
|
return Array.from(this.collections.keys());
|
|
@@ -249422,14 +249428,14 @@ class Database {
|
|
|
249422
249428
|
this.schemas.clear();
|
|
249423
249429
|
}
|
|
249424
249430
|
validate(entityName, record2, partial2 = false) {
|
|
249425
|
-
const schema9 = this.schemas.get(
|
|
249431
|
+
const schema9 = this.schemas.get(entityName);
|
|
249426
249432
|
if (!schema9) {
|
|
249427
249433
|
throw new Error(`Entity "${entityName}" not found`);
|
|
249428
249434
|
}
|
|
249429
249435
|
return this.validator.validate(record2, schema9, partial2);
|
|
249430
249436
|
}
|
|
249431
249437
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
249432
|
-
const schema9 = this.schemas.get(
|
|
249438
|
+
const schema9 = this.schemas.get(entityName);
|
|
249433
249439
|
if (!schema9) {
|
|
249434
249440
|
throw new Error(`Entity "${entityName}" not found`);
|
|
249435
249441
|
}
|
|
@@ -249439,9 +249445,6 @@ class Database {
|
|
|
249439
249445
|
}
|
|
249440
249446
|
return this.validator.applyDefaults(filteredRecord, schema9);
|
|
249441
249447
|
}
|
|
249442
|
-
normalizeName(entityName) {
|
|
249443
|
-
return entityName.toLowerCase();
|
|
249444
|
-
}
|
|
249445
249448
|
}
|
|
249446
249449
|
|
|
249447
249450
|
// ../../node_modules/socket.io/wrapper.mjs
|
|
@@ -249476,42 +249479,40 @@ function broadcastEntityEvent(io6, appId, entityName, event) {
|
|
|
249476
249479
|
});
|
|
249477
249480
|
}
|
|
249478
249481
|
|
|
249479
|
-
// src/cli/dev/dev-server/routes/entities
|
|
249480
|
-
var import_express3 = __toESM(require_express(), 1);
|
|
249481
|
-
|
|
249482
|
-
// src/cli/dev/dev-server/routes/entities/entities-user-router.ts
|
|
249482
|
+
// src/cli/dev/dev-server/routes/entities.ts
|
|
249483
249483
|
var import_express2 = __toESM(require_express(), 1);
|
|
249484
249484
|
|
|
249485
|
-
//
|
|
249486
|
-
|
|
249487
|
-
|
|
249488
|
-
|
|
249485
|
+
// ../../node_modules/nanoid/index.js
|
|
249486
|
+
import { webcrypto as crypto } from "node:crypto";
|
|
249487
|
+
|
|
249488
|
+
// ../../node_modules/nanoid/url-alphabet/index.js
|
|
249489
|
+
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
249490
|
+
|
|
249491
|
+
// ../../node_modules/nanoid/index.js
|
|
249492
|
+
var POOL_SIZE_MULTIPLIER = 128;
|
|
249493
|
+
var pool;
|
|
249494
|
+
var poolOffset;
|
|
249495
|
+
function fillPool(bytes) {
|
|
249496
|
+
if (!pool || pool.length < bytes) {
|
|
249497
|
+
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
249498
|
+
crypto.getRandomValues(pool);
|
|
249499
|
+
poolOffset = 0;
|
|
249500
|
+
} else if (poolOffset + bytes > pool.length) {
|
|
249501
|
+
crypto.getRandomValues(pool);
|
|
249502
|
+
poolOffset = 0;
|
|
249489
249503
|
}
|
|
249490
|
-
|
|
249491
|
-
return rest;
|
|
249504
|
+
poolOffset += bytes;
|
|
249492
249505
|
}
|
|
249493
|
-
|
|
249494
|
-
|
|
249495
|
-
|
|
249496
|
-
|
|
249497
|
-
|
|
249498
|
-
|
|
249499
|
-
|
|
249500
|
-
const userInfo = await readAuth();
|
|
249501
|
-
result = await db2.getCollection("User")?.findOneAsync({ email: userInfo.email });
|
|
249502
|
-
} else {
|
|
249503
|
-
result = await db2.getCollection("User")?.findOneAsync({ id: req.params.id });
|
|
249504
|
-
}
|
|
249505
|
-
if (!result) {
|
|
249506
|
-
res.status(404).json({ error: `User with id "${req.params.id}" not found` });
|
|
249507
|
-
return;
|
|
249508
|
-
}
|
|
249509
|
-
res.json(stripInternalFields(result));
|
|
249510
|
-
});
|
|
249511
|
-
return router;
|
|
249506
|
+
function nanoid3(size = 21) {
|
|
249507
|
+
fillPool(size |= 0);
|
|
249508
|
+
let id2 = "";
|
|
249509
|
+
for (let i5 = poolOffset - size;i5 < poolOffset; i5++) {
|
|
249510
|
+
id2 += urlAlphabet[pool[i5] & 63];
|
|
249511
|
+
}
|
|
249512
|
+
return id2;
|
|
249512
249513
|
}
|
|
249513
249514
|
|
|
249514
|
-
// src/cli/dev/dev-server/routes/entities
|
|
249515
|
+
// src/cli/dev/dev-server/routes/entities.ts
|
|
249515
249516
|
function parseSort(sort) {
|
|
249516
249517
|
if (!sort) {
|
|
249517
249518
|
return;
|
|
@@ -249534,9 +249535,16 @@ function parseFields(fields) {
|
|
|
249534
249535
|
}
|
|
249535
249536
|
return Object.keys(projection).length > 0 ? projection : undefined;
|
|
249536
249537
|
}
|
|
249537
|
-
|
|
249538
|
-
|
|
249539
|
-
|
|
249538
|
+
function stripInternalFields(doc2) {
|
|
249539
|
+
if (Array.isArray(doc2)) {
|
|
249540
|
+
return doc2.map((d5) => stripInternalFields(d5));
|
|
249541
|
+
}
|
|
249542
|
+
const { _id, ...rest } = doc2;
|
|
249543
|
+
return rest;
|
|
249544
|
+
}
|
|
249545
|
+
function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
249546
|
+
const router = import_express2.Router({ mergeParams: true });
|
|
249547
|
+
const parseBody = import_express2.json();
|
|
249540
249548
|
function withCollection(handler) {
|
|
249541
249549
|
return async (req, res) => {
|
|
249542
249550
|
const collection = db2.getCollection(req.params.entityName);
|
|
@@ -249562,8 +249570,11 @@ async function createEntityRoutes(db2, logger, broadcast) {
|
|
|
249562
249570
|
}
|
|
249563
249571
|
broadcast(appId, entityName, createData(data));
|
|
249564
249572
|
}
|
|
249565
|
-
|
|
249566
|
-
|
|
249573
|
+
router.get("/User/:id", (req, res, next) => {
|
|
249574
|
+
logger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
|
|
249575
|
+
req.url = req.originalUrl;
|
|
249576
|
+
remoteProxy(req, res, next);
|
|
249577
|
+
});
|
|
249567
249578
|
router.get("/:entityName/:id", withCollection(async (req, res, collection) => {
|
|
249568
249579
|
const { entityName, id: id2 } = req.params;
|
|
249569
249580
|
try {
|
|
@@ -249735,7 +249746,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
|
|
|
249735
249746
|
}
|
|
249736
249747
|
|
|
249737
249748
|
// src/cli/dev/dev-server/routes/integrations.ts
|
|
249738
|
-
var
|
|
249749
|
+
var import_express3 = __toESM(require_express(), 1);
|
|
249739
249750
|
var import_multer = __toESM(require_multer(), 1);
|
|
249740
249751
|
import { createHash, randomUUID as randomUUID4 } from "node:crypto";
|
|
249741
249752
|
import fs28 from "node:fs";
|
|
@@ -249744,8 +249755,8 @@ function createFileToken(fileUri) {
|
|
|
249744
249755
|
return createHash("sha256").update(fileUri).digest("hex");
|
|
249745
249756
|
}
|
|
249746
249757
|
function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
249747
|
-
const router =
|
|
249748
|
-
const parseBody =
|
|
249758
|
+
const router = import_express3.Router({ mergeParams: true });
|
|
249759
|
+
const parseBody = import_express3.json();
|
|
249749
249760
|
const privateFilesDir = path18.join(mediaFilesDir, "private");
|
|
249750
249761
|
fs28.mkdirSync(mediaFilesDir, { recursive: true });
|
|
249751
249762
|
fs28.mkdirSync(privateFilesDir, { recursive: true });
|
|
@@ -249815,7 +249826,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
249815
249826
|
return router;
|
|
249816
249827
|
}
|
|
249817
249828
|
function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
249818
|
-
const router =
|
|
249829
|
+
const router = import_express3.Router({ mergeParams: true });
|
|
249819
249830
|
router.post("/:slug/:operationId", (req, res, next) => {
|
|
249820
249831
|
logger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
|
|
249821
249832
|
req.url = req.originalUrl;
|
|
@@ -249824,18 +249835,6 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
249824
249835
|
return router;
|
|
249825
249836
|
}
|
|
249826
249837
|
|
|
249827
|
-
// src/cli/dev/dev-server/routes/users.ts
|
|
249828
|
-
var import_express5 = __toESM(require_express(), 1);
|
|
249829
|
-
function createUsersRoutes() {
|
|
249830
|
-
const router = import_express5.Router({ mergeParams: true });
|
|
249831
|
-
const parseBody = import_express5.json();
|
|
249832
|
-
router.post("/invite-user", parseBody, (req, _res, next) => {
|
|
249833
|
-
console.log("invite-user", req.body);
|
|
249834
|
-
next();
|
|
249835
|
-
});
|
|
249836
|
-
return router;
|
|
249837
|
-
}
|
|
249838
|
-
|
|
249839
249838
|
// src/cli/dev/dev-server/watcher.ts
|
|
249840
249839
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
249841
249840
|
import { relative as relative6 } from "node:path";
|
|
@@ -251540,7 +251539,7 @@ async function createDevServer(options8) {
|
|
|
251540
251539
|
const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
|
|
251541
251540
|
const baseUrl = `http://localhost:${port}`;
|
|
251542
251541
|
const { functions, entities, project: project2 } = await options8.loadResources();
|
|
251543
|
-
const app =
|
|
251542
|
+
const app = import_express4.default();
|
|
251544
251543
|
const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
|
|
251545
251544
|
target: BASE44_APP_URL,
|
|
251546
251545
|
changeOrigin: true
|
|
@@ -251557,17 +251556,7 @@ async function createDevServer(options8) {
|
|
|
251557
251556
|
}
|
|
251558
251557
|
next();
|
|
251559
251558
|
});
|
|
251560
|
-
app.use((req, res, next) => {
|
|
251561
|
-
const auth2 = req.headers.authorization;
|
|
251562
|
-
if (!auth2 || !auth2.startsWith("Bearer ")) {
|
|
251563
|
-
res.status(401).json({ error: "Unauthorized" });
|
|
251564
|
-
return;
|
|
251565
|
-
}
|
|
251566
|
-
next();
|
|
251567
|
-
});
|
|
251568
251559
|
const devLogger = createDevLogger();
|
|
251569
|
-
const usersRoutes = createUsersRoutes();
|
|
251570
|
-
app.use("/api/apps/:appId/users", usersRoutes);
|
|
251571
251560
|
const functionManager = new FunctionManager(functions, devLogger, options8.denoWrapperPath);
|
|
251572
251561
|
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
251573
251562
|
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
@@ -251575,12 +251564,12 @@ async function createDevServer(options8) {
|
|
|
251575
251564
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
251576
251565
|
}
|
|
251577
251566
|
const db2 = new Database;
|
|
251578
|
-
|
|
251567
|
+
db2.load(entities);
|
|
251579
251568
|
if (db2.getCollectionNames().length > 0) {
|
|
251580
251569
|
R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
251581
251570
|
}
|
|
251582
251571
|
let emitEntityEvent = () => {};
|
|
251583
|
-
const entityRoutes =
|
|
251572
|
+
const entityRoutes = createEntityRoutes(db2, devLogger, remoteProxy, (...args) => emitEntityEvent(...args));
|
|
251584
251573
|
app.use("/api/apps/:appId/entities", entityRoutes);
|
|
251585
251574
|
const { path: mediaFilesDir } = await $dir();
|
|
251586
251575
|
app.use("/media/private/:fileUri", (req, res, next) => {
|
|
@@ -251601,7 +251590,7 @@ async function createDevServer(options8) {
|
|
|
251601
251590
|
}
|
|
251602
251591
|
next();
|
|
251603
251592
|
});
|
|
251604
|
-
app.use("/media",
|
|
251593
|
+
app.use("/media", import_express4.default.static(mediaFilesDir));
|
|
251605
251594
|
const integrationRoutes = createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, devLogger);
|
|
251606
251595
|
app.use("/api/apps/:appId/integration-endpoints", integrationRoutes);
|
|
251607
251596
|
const customIntegrationRoutes = createCustomIntegrationRoutes(remoteProxy, devLogger);
|
|
@@ -251650,7 +251639,7 @@ async function createDevServer(options8) {
|
|
|
251650
251639
|
if (previousEntityCount > 0) {
|
|
251651
251640
|
devLogger.log("Entities directory changed, clearing data...");
|
|
251652
251641
|
}
|
|
251653
|
-
|
|
251642
|
+
db2.load(entities2);
|
|
251654
251643
|
if (db2.getCollectionNames().length > 0) {
|
|
251655
251644
|
devLogger.log(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
251656
251645
|
}
|
|
@@ -251687,10 +251676,8 @@ async function devAction(options8) {
|
|
|
251687
251676
|
outroMessage: `Dev server is available at ${theme.colors.links(`http://localhost:${resolvedPort}`)}`
|
|
251688
251677
|
};
|
|
251689
251678
|
}
|
|
251690
|
-
function getDevCommand(
|
|
251691
|
-
return new
|
|
251692
|
-
await runCommand(() => devAction(options8), { requireAuth: true }, context);
|
|
251693
|
-
});
|
|
251679
|
+
function getDevCommand() {
|
|
251680
|
+
return new Base44Command("dev").description("Start the development server").option("-p, --port <number>", "Port for the development server").action(devAction);
|
|
251694
251681
|
}
|
|
251695
251682
|
|
|
251696
251683
|
// src/cli/commands/project/eject.ts
|
|
@@ -251781,9 +251768,18 @@ async function eject(options8) {
|
|
|
251781
251768
|
}
|
|
251782
251769
|
return { outroMessage: "Your new project is set and ready to use" };
|
|
251783
251770
|
}
|
|
251784
|
-
function getEjectCommand(
|
|
251785
|
-
return new
|
|
251786
|
-
|
|
251771
|
+
function getEjectCommand() {
|
|
251772
|
+
return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8, command2) => {
|
|
251773
|
+
if (command2.isNonInteractive && !options8.projectId) {
|
|
251774
|
+
throw new InvalidInputError("--project-id is required in non-interactive mode");
|
|
251775
|
+
}
|
|
251776
|
+
if (command2.isNonInteractive && !options8.path) {
|
|
251777
|
+
throw new InvalidInputError("--path is required in non-interactive mode");
|
|
251778
|
+
}
|
|
251779
|
+
return await eject({
|
|
251780
|
+
...options8,
|
|
251781
|
+
isNonInteractive: command2.isNonInteractive
|
|
251782
|
+
});
|
|
251787
251783
|
});
|
|
251788
251784
|
}
|
|
251789
251785
|
|
|
@@ -251794,23 +251790,28 @@ function createProgram(context) {
|
|
|
251794
251790
|
program2.configureHelp({
|
|
251795
251791
|
sortSubcommands: true
|
|
251796
251792
|
});
|
|
251797
|
-
program2.
|
|
251798
|
-
|
|
251799
|
-
|
|
251800
|
-
|
|
251801
|
-
|
|
251802
|
-
program2.addCommand(
|
|
251803
|
-
program2.addCommand(
|
|
251804
|
-
program2.addCommand(
|
|
251805
|
-
program2.addCommand(
|
|
251806
|
-
program2.addCommand(
|
|
251807
|
-
program2.addCommand(
|
|
251808
|
-
program2.addCommand(
|
|
251809
|
-
program2.addCommand(
|
|
251810
|
-
program2.addCommand(
|
|
251811
|
-
program2.addCommand(
|
|
251812
|
-
program2.addCommand(
|
|
251813
|
-
program2.addCommand(
|
|
251793
|
+
program2.hook("preAction", (_10, actionCommand) => {
|
|
251794
|
+
if (actionCommand instanceof Base44Command) {
|
|
251795
|
+
actionCommand.setContext(context);
|
|
251796
|
+
}
|
|
251797
|
+
});
|
|
251798
|
+
program2.addCommand(getLoginCommand());
|
|
251799
|
+
program2.addCommand(getWhoamiCommand());
|
|
251800
|
+
program2.addCommand(getLogoutCommand());
|
|
251801
|
+
program2.addCommand(getCreateCommand());
|
|
251802
|
+
program2.addCommand(getDashboardCommand());
|
|
251803
|
+
program2.addCommand(getDeployCommand2());
|
|
251804
|
+
program2.addCommand(getLinkCommand());
|
|
251805
|
+
program2.addCommand(getEjectCommand());
|
|
251806
|
+
program2.addCommand(getEntitiesPushCommand());
|
|
251807
|
+
program2.addCommand(getAgentsCommand());
|
|
251808
|
+
program2.addCommand(getConnectorsCommand());
|
|
251809
|
+
program2.addCommand(getFunctionsCommand());
|
|
251810
|
+
program2.addCommand(getSecretsCommand());
|
|
251811
|
+
program2.addCommand(getSiteCommand());
|
|
251812
|
+
program2.addCommand(getTypesCommand());
|
|
251813
|
+
program2.addCommand(getDevCommand(), { hidden: true });
|
|
251814
|
+
program2.addCommand(getLogsCommand(), { hidden: true });
|
|
251814
251815
|
return program2;
|
|
251815
251816
|
}
|
|
251816
251817
|
|
|
@@ -255926,7 +255927,7 @@ class ErrorReporter {
|
|
|
255926
255927
|
return this.context.user?.email ?? `anon-${this.sessionId}`;
|
|
255927
255928
|
}
|
|
255928
255929
|
buildProperties(error48) {
|
|
255929
|
-
const { user, command, appId } = this.context;
|
|
255930
|
+
const { user, command: command2, appId } = this.context;
|
|
255930
255931
|
const errorCode = error48 && isCLIError(error48) ? error48.code : undefined;
|
|
255931
255932
|
const userError = error48 ? isUserError(error48) : undefined;
|
|
255932
255933
|
const apiProps = error48 instanceof ApiError ? {
|
|
@@ -255942,9 +255943,9 @@ class ErrorReporter {
|
|
|
255942
255943
|
session_started_at: this.sessionStartedAt.toISOString(),
|
|
255943
255944
|
execution_duration_ms: Date.now() - this.sessionStartedAt.getTime(),
|
|
255944
255945
|
...user && { $set: { email: user.email, name: user.name } },
|
|
255945
|
-
command_name:
|
|
255946
|
-
command_args:
|
|
255947
|
-
command_options:
|
|
255946
|
+
command_name: command2?.name,
|
|
255947
|
+
command_args: command2?.args,
|
|
255948
|
+
command_options: command2?.options,
|
|
255948
255949
|
app_id: appId,
|
|
255949
255950
|
...errorCode !== undefined && {
|
|
255950
255951
|
error_code: errorCode,
|
|
@@ -255992,9 +255993,9 @@ class ErrorReporter {
|
|
|
255992
255993
|
}
|
|
255993
255994
|
|
|
255994
255995
|
// src/cli/telemetry/commander-hooks.ts
|
|
255995
|
-
function getFullCommandName(
|
|
255996
|
+
function getFullCommandName(command2) {
|
|
255996
255997
|
const parts = [];
|
|
255997
|
-
let current =
|
|
255998
|
+
let current = command2;
|
|
255998
255999
|
while (current) {
|
|
255999
256000
|
const name2 = current.name();
|
|
256000
256001
|
if (current.parent) {
|
|
@@ -256052,4 +256053,4 @@ export {
|
|
|
256052
256053
|
CLIExitError
|
|
256053
256054
|
};
|
|
256054
256055
|
|
|
256055
|
-
//# debugId=
|
|
256056
|
+
//# debugId=7C07ED97097C7A7364756E2164756E21
|