@base44-preview/cli 0.0.17-pr.104.ad47aa8 → 0.0.17-pr.104.e7dd3a1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -194
- package/bin/dev.js +12 -0
- package/bin/run.js +12 -0
- package/dist/{cli/index.js → index.js} +253 -212
- package/package.json +7 -8
- /package/dist/{cli/templates → templates}/backend-and-client/.nvmrc +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/README.md +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/base44/app.jsonc.ejs +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/base44/config.jsonc.ejs +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/base44/entities/task.jsonc +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/components.json +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/index.html +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/jsconfig.json +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/package.json +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/postcss.config.js +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/App.jsx +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/api/base44Client.js.ejs +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/components/Base44Logo.jsx +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/components/ui/button.jsx +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/components/ui/checkbox.jsx +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/components/ui/input.jsx +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/index.css +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/src/main.jsx +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/tailwind.config.js +0 -0
- /package/dist/{cli/templates → templates}/backend-and-client/vite.config.js +0 -0
- /package/dist/{cli/templates → templates}/backend-only/base44/app.jsonc.ejs +0 -0
- /package/dist/{cli/templates → templates}/backend-only/base44/config.jsonc.ejs +0 -0
- /package/dist/{cli/templates → templates}/templates.json +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import { createRequire } from "node:module";
|
|
3
2
|
import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
4
3
|
import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
5
4
|
import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
|
|
6
5
|
import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
7
|
-
import
|
|
6
|
+
import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
8
7
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
9
8
|
import * as g from "node:readline";
|
|
10
9
|
import O from "node:readline";
|
|
@@ -894,7 +893,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
894
893
|
const childProcess$1 = __require("node:child_process");
|
|
895
894
|
const path$15 = __require("node:path");
|
|
896
895
|
const fs$10 = __require("node:fs");
|
|
897
|
-
const process$
|
|
896
|
+
const process$3 = __require("node:process");
|
|
898
897
|
const { Argument, humanReadableArgName } = require_argument();
|
|
899
898
|
const { CommanderError } = require_error$1();
|
|
900
899
|
const { Help } = require_help();
|
|
@@ -945,10 +944,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
945
944
|
this._showHelpAfterError = false;
|
|
946
945
|
this._showSuggestionAfterError = true;
|
|
947
946
|
this._outputConfiguration = {
|
|
948
|
-
writeOut: (str) => process$
|
|
949
|
-
writeErr: (str) => process$
|
|
950
|
-
getOutHelpWidth: () => process$
|
|
951
|
-
getErrHelpWidth: () => process$
|
|
947
|
+
writeOut: (str) => process$3.stdout.write(str),
|
|
948
|
+
writeErr: (str) => process$3.stderr.write(str),
|
|
949
|
+
getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
|
|
950
|
+
getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
|
|
952
951
|
outputError: (str, write) => write(str)
|
|
953
952
|
};
|
|
954
953
|
this._hidden = false;
|
|
@@ -1302,7 +1301,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1302
1301
|
*/
|
|
1303
1302
|
_exit(exitCode, code$1, message) {
|
|
1304
1303
|
if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
|
|
1305
|
-
process$
|
|
1304
|
+
process$3.exit(exitCode);
|
|
1306
1305
|
}
|
|
1307
1306
|
/**
|
|
1308
1307
|
* Register callback `fn` for the command.
|
|
@@ -1641,11 +1640,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1641
1640
|
if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
|
|
1642
1641
|
parseOptions = parseOptions || {};
|
|
1643
1642
|
if (argv === void 0 && parseOptions.from === void 0) {
|
|
1644
|
-
if (process$
|
|
1645
|
-
const execArgv$1 = process$
|
|
1643
|
+
if (process$3.versions?.electron) parseOptions.from = "electron";
|
|
1644
|
+
const execArgv$1 = process$3.execArgv ?? [];
|
|
1646
1645
|
if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
|
|
1647
1646
|
}
|
|
1648
|
-
if (argv === void 0) argv = process$
|
|
1647
|
+
if (argv === void 0) argv = process$3.argv;
|
|
1649
1648
|
this.rawArgs = argv.slice();
|
|
1650
1649
|
let userArgs;
|
|
1651
1650
|
switch (parseOptions.from) {
|
|
@@ -1655,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1655
1654
|
userArgs = argv.slice(2);
|
|
1656
1655
|
break;
|
|
1657
1656
|
case "electron":
|
|
1658
|
-
if (process$
|
|
1657
|
+
if (process$3.defaultApp) {
|
|
1659
1658
|
this._scriptPath = argv[1];
|
|
1660
1659
|
userArgs = argv.slice(2);
|
|
1661
1660
|
} else userArgs = argv.slice(1);
|
|
@@ -1769,15 +1768,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1769
1768
|
}
|
|
1770
1769
|
launchWithNode = sourceExt.includes(path$15.extname(executableFile));
|
|
1771
1770
|
let proc$1;
|
|
1772
|
-
if (process$
|
|
1771
|
+
if (process$3.platform !== "win32") if (launchWithNode) {
|
|
1773
1772
|
args.unshift(executableFile);
|
|
1774
|
-
args = incrementNodeInspectorPort(process$
|
|
1775
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1773
|
+
args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
|
|
1774
|
+
proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
|
|
1776
1775
|
} else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
|
|
1777
1776
|
else {
|
|
1778
1777
|
args.unshift(executableFile);
|
|
1779
|
-
args = incrementNodeInspectorPort(process$
|
|
1780
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1778
|
+
args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
|
|
1779
|
+
proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
|
|
1781
1780
|
}
|
|
1782
1781
|
if (!proc$1.killed) [
|
|
1783
1782
|
"SIGUSR1",
|
|
@@ -1786,14 +1785,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1786
1785
|
"SIGINT",
|
|
1787
1786
|
"SIGHUP"
|
|
1788
1787
|
].forEach((signal) => {
|
|
1789
|
-
process$
|
|
1788
|
+
process$3.on(signal, () => {
|
|
1790
1789
|
if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
|
|
1791
1790
|
});
|
|
1792
1791
|
});
|
|
1793
1792
|
const exitCallback = this._exitCallback;
|
|
1794
1793
|
proc$1.on("close", (code$1) => {
|
|
1795
1794
|
code$1 = code$1 ?? 1;
|
|
1796
|
-
if (!exitCallback) process$
|
|
1795
|
+
if (!exitCallback) process$3.exit(code$1);
|
|
1797
1796
|
else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
|
|
1798
1797
|
});
|
|
1799
1798
|
proc$1.on("error", (err) => {
|
|
@@ -1805,7 +1804,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1805
1804
|
- ${executableDirMessage}`;
|
|
1806
1805
|
throw new Error(executableMissing);
|
|
1807
1806
|
} else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
|
|
1808
|
-
if (!exitCallback) process$
|
|
1807
|
+
if (!exitCallback) process$3.exit(1);
|
|
1809
1808
|
else {
|
|
1810
1809
|
const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
|
|
1811
1810
|
wrappedError.nestedError = err;
|
|
@@ -2211,13 +2210,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2211
2210
|
*/
|
|
2212
2211
|
_parseOptionsEnv() {
|
|
2213
2212
|
this.options.forEach((option) => {
|
|
2214
|
-
if (option.envVar && option.envVar in process$
|
|
2213
|
+
if (option.envVar && option.envVar in process$3.env) {
|
|
2215
2214
|
const optionKey = option.attributeName();
|
|
2216
2215
|
if (this.getOptionValue(optionKey) === void 0 || [
|
|
2217
2216
|
"default",
|
|
2218
2217
|
"config",
|
|
2219
2218
|
"env"
|
|
2220
|
-
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$
|
|
2219
|
+
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
|
|
2221
2220
|
else this.emit(`optionEnv:${option.name()}`);
|
|
2222
2221
|
}
|
|
2223
2222
|
});
|
|
@@ -2596,7 +2595,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2596
2595
|
*/
|
|
2597
2596
|
help(contextOptions) {
|
|
2598
2597
|
this.outputHelp(contextOptions);
|
|
2599
|
-
let exitCode = process$
|
|
2598
|
+
let exitCode = process$3.exitCode || 0;
|
|
2600
2599
|
if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
|
|
2601
2600
|
this._exit(exitCode, "commander.help", "(outputHelp)");
|
|
2602
2601
|
}
|
|
@@ -2712,16 +2711,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2712
2711
|
const CSI = `${ESC}[`;
|
|
2713
2712
|
const beep = "\x07";
|
|
2714
2713
|
const cursor = {
|
|
2715
|
-
to(x$2, y$
|
|
2716
|
-
if (!y$
|
|
2717
|
-
return `${CSI}${y$
|
|
2714
|
+
to(x$2, y$2) {
|
|
2715
|
+
if (!y$2) return `${CSI}${x$2 + 1}G`;
|
|
2716
|
+
return `${CSI}${y$2 + 1};${x$2 + 1}H`;
|
|
2718
2717
|
},
|
|
2719
|
-
move(x$2, y$
|
|
2718
|
+
move(x$2, y$2) {
|
|
2720
2719
|
let ret = "";
|
|
2721
2720
|
if (x$2 < 0) ret += `${CSI}${-x$2}D`;
|
|
2722
2721
|
else if (x$2 > 0) ret += `${CSI}${x$2}C`;
|
|
2723
|
-
if (y$
|
|
2724
|
-
else if (y$
|
|
2722
|
+
if (y$2 < 0) ret += `${CSI}${-y$2}A`;
|
|
2723
|
+
else if (y$2 > 0) ret += `${CSI}${y$2}B`;
|
|
2725
2724
|
return ret;
|
|
2726
2725
|
},
|
|
2727
2726
|
up: (count$1 = 1) => `${CSI}${count$1}A`,
|
|
@@ -3031,13 +3030,13 @@ function rD() {
|
|
|
3031
3030
|
}
|
|
3032
3031
|
}), r;
|
|
3033
3032
|
}
|
|
3034
|
-
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
|
|
3033
|
+
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y$1}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
|
|
3035
3034
|
const F$1 = [...u$2];
|
|
3036
3035
|
let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
|
|
3037
3036
|
for (const [C$1, n$1] of F$1.entries()) {
|
|
3038
3037
|
const E = p(n$1);
|
|
3039
3038
|
if (D$1 + E <= t ? e$1[e$1.length - 1] += n$1 : (e$1.push(n$1), D$1 = 0), d$1.has(n$1) && (s = !0, i$1 = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
|
|
3040
|
-
i$1 ? n$1 === y && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
|
|
3039
|
+
i$1 ? n$1 === y$1 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
|
|
3041
3040
|
continue;
|
|
3042
3041
|
}
|
|
3043
3042
|
D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
|
|
@@ -3079,7 +3078,7 @@ const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y = "\x07", V$1 = "[",
|
|
|
3079
3078
|
`)];
|
|
3080
3079
|
for (const [E, a$1] of n$1.entries()) {
|
|
3081
3080
|
if (F$1 += a$1, d$1.has(a$1)) {
|
|
3082
|
-
const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y})`)).exec(n$1.slice(E).join("")) || { groups: {} };
|
|
3081
|
+
const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
|
|
3083
3082
|
if (c$1.code !== void 0) {
|
|
3084
3083
|
const f = Number.parseFloat(c$1.code);
|
|
3085
3084
|
s = f === oD ? void 0 : f;
|
|
@@ -3480,7 +3479,7 @@ var RD = class extends x$1 {
|
|
|
3480
3479
|
//#endregion
|
|
3481
3480
|
//#region node_modules/@clack/prompts/dist/index.mjs
|
|
3482
3481
|
function ce() {
|
|
3483
|
-
return
|
|
3482
|
+
return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
3484
3483
|
}
|
|
3485
3484
|
const V = ce(), u$1 = (t, n$1) => V ? t : n$1, le = u$1("◆", "*"), L = u$1("■", "x"), W = u$1("▲", "x"), C = u$1("◇", "o"), ue = u$1("┌", "T"), o$1 = u$1("│", "|"), d = u$1("└", "—"), k = u$1("●", ">"), P = u$1("○", " "), A = u$1("◻", "[•]"), T = u$1("◼", "[+]"), F = u$1("◻", "[ ]"), $e = u$1("▪", "•"), _ = u$1("─", "-"), me = u$1("╮", "+"), de = u$1("├", "+"), pe = u$1("╯", "+"), q = u$1("●", "•"), D = u$1("◆", "*"), U = u$1("▲", "!"), K = u$1("■", "x"), b = (t) => {
|
|
3486
3485
|
switch (t) {
|
|
@@ -6745,7 +6744,7 @@ function initializeContext(params) {
|
|
|
6745
6744
|
external: params?.external ?? void 0
|
|
6746
6745
|
};
|
|
6747
6746
|
}
|
|
6748
|
-
function process$
|
|
6747
|
+
function process$2(schema, ctx, _params = {
|
|
6749
6748
|
path: [],
|
|
6750
6749
|
schemaPath: []
|
|
6751
6750
|
}) {
|
|
@@ -6782,7 +6781,7 @@ function process$3(schema, ctx, _params = {
|
|
|
6782
6781
|
const parent = schema._zod.parent;
|
|
6783
6782
|
if (parent) {
|
|
6784
6783
|
if (!result.ref) result.ref = parent;
|
|
6785
|
-
process$
|
|
6784
|
+
process$2(parent, ctx, params);
|
|
6786
6785
|
ctx.seen.get(parent).isParent = true;
|
|
6787
6786
|
}
|
|
6788
6787
|
}
|
|
@@ -6994,7 +6993,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
6994
6993
|
...params,
|
|
6995
6994
|
processors
|
|
6996
6995
|
});
|
|
6997
|
-
process$
|
|
6996
|
+
process$2(schema, ctx);
|
|
6998
6997
|
extractDefs(ctx, schema);
|
|
6999
6998
|
return finalize(ctx, schema);
|
|
7000
6999
|
};
|
|
@@ -7006,7 +7005,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
7006
7005
|
io,
|
|
7007
7006
|
processors
|
|
7008
7007
|
});
|
|
7009
|
-
process$
|
|
7008
|
+
process$2(schema, ctx);
|
|
7010
7009
|
extractDefs(ctx, schema);
|
|
7011
7010
|
return finalize(ctx, schema);
|
|
7012
7011
|
};
|
|
@@ -7093,7 +7092,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
7093
7092
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
7094
7093
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
7095
7094
|
json.type = "array";
|
|
7096
|
-
json.items = process$
|
|
7095
|
+
json.items = process$2(def.element, ctx, {
|
|
7097
7096
|
...params,
|
|
7098
7097
|
path: [...params.path, "items"]
|
|
7099
7098
|
});
|
|
@@ -7104,7 +7103,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7104
7103
|
json.type = "object";
|
|
7105
7104
|
json.properties = {};
|
|
7106
7105
|
const shape = def.shape;
|
|
7107
|
-
for (const key in shape) json.properties[key] = process$
|
|
7106
|
+
for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
|
|
7108
7107
|
...params,
|
|
7109
7108
|
path: [
|
|
7110
7109
|
...params.path,
|
|
@@ -7122,7 +7121,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7122
7121
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
7123
7122
|
else if (!def.catchall) {
|
|
7124
7123
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
7125
|
-
} else if (def.catchall) json.additionalProperties = process$
|
|
7124
|
+
} else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
|
|
7126
7125
|
...params,
|
|
7127
7126
|
path: [...params.path, "additionalProperties"]
|
|
7128
7127
|
});
|
|
@@ -7130,7 +7129,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7130
7129
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
7131
7130
|
const def = schema._zod.def;
|
|
7132
7131
|
const isExclusive = def.inclusive === false;
|
|
7133
|
-
const options = def.options.map((x$2, i$1) => process$
|
|
7132
|
+
const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
|
|
7134
7133
|
...params,
|
|
7135
7134
|
path: [
|
|
7136
7135
|
...params.path,
|
|
@@ -7143,7 +7142,7 @@ const unionProcessor = (schema, ctx, json, params) => {
|
|
|
7143
7142
|
};
|
|
7144
7143
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
7145
7144
|
const def = schema._zod.def;
|
|
7146
|
-
const a$1 = process$
|
|
7145
|
+
const a$1 = process$2(def.left, ctx, {
|
|
7147
7146
|
...params,
|
|
7148
7147
|
path: [
|
|
7149
7148
|
...params.path,
|
|
@@ -7151,7 +7150,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
7151
7150
|
0
|
|
7152
7151
|
]
|
|
7153
7152
|
});
|
|
7154
|
-
const b$2 = process$
|
|
7153
|
+
const b$2 = process$2(def.right, ctx, {
|
|
7155
7154
|
...params,
|
|
7156
7155
|
path: [
|
|
7157
7156
|
...params.path,
|
|
@@ -7168,7 +7167,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7168
7167
|
json.type = "array";
|
|
7169
7168
|
const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
7170
7169
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
7171
|
-
const prefixItems = def.items.map((x$2, i$1) => process$
|
|
7170
|
+
const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
|
|
7172
7171
|
...params,
|
|
7173
7172
|
path: [
|
|
7174
7173
|
...params.path,
|
|
@@ -7176,7 +7175,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7176
7175
|
i$1
|
|
7177
7176
|
]
|
|
7178
7177
|
}));
|
|
7179
|
-
const rest = def.rest ? process$
|
|
7178
|
+
const rest = def.rest ? process$2(def.rest, ctx, {
|
|
7180
7179
|
...params,
|
|
7181
7180
|
path: [
|
|
7182
7181
|
...params.path,
|
|
@@ -7207,7 +7206,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
7207
7206
|
const keyType = def.keyType;
|
|
7208
7207
|
const patterns = keyType._zod.bag?.patterns;
|
|
7209
7208
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
7210
|
-
const valueSchema = process$
|
|
7209
|
+
const valueSchema = process$2(def.valueType, ctx, {
|
|
7211
7210
|
...params,
|
|
7212
7211
|
path: [
|
|
7213
7212
|
...params.path,
|
|
@@ -7218,11 +7217,11 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
7218
7217
|
json.patternProperties = {};
|
|
7219
7218
|
for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
|
|
7220
7219
|
} else {
|
|
7221
|
-
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$
|
|
7220
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$2(def.keyType, ctx, {
|
|
7222
7221
|
...params,
|
|
7223
7222
|
path: [...params.path, "propertyNames"]
|
|
7224
7223
|
});
|
|
7225
|
-
json.additionalProperties = process$
|
|
7224
|
+
json.additionalProperties = process$2(def.valueType, ctx, {
|
|
7226
7225
|
...params,
|
|
7227
7226
|
path: [...params.path, "additionalProperties"]
|
|
7228
7227
|
});
|
|
@@ -7235,7 +7234,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
7235
7234
|
};
|
|
7236
7235
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
7237
7236
|
const def = schema._zod.def;
|
|
7238
|
-
const inner = process$
|
|
7237
|
+
const inner = process$2(def.innerType, ctx, params);
|
|
7239
7238
|
const seen = ctx.seen.get(schema);
|
|
7240
7239
|
if (ctx.target === "openapi-3.0") {
|
|
7241
7240
|
seen.ref = def.innerType;
|
|
@@ -7244,27 +7243,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
|
|
|
7244
7243
|
};
|
|
7245
7244
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
7246
7245
|
const def = schema._zod.def;
|
|
7247
|
-
process$
|
|
7246
|
+
process$2(def.innerType, ctx, params);
|
|
7248
7247
|
const seen = ctx.seen.get(schema);
|
|
7249
7248
|
seen.ref = def.innerType;
|
|
7250
7249
|
};
|
|
7251
7250
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
7252
7251
|
const def = schema._zod.def;
|
|
7253
|
-
process$
|
|
7252
|
+
process$2(def.innerType, ctx, params);
|
|
7254
7253
|
const seen = ctx.seen.get(schema);
|
|
7255
7254
|
seen.ref = def.innerType;
|
|
7256
7255
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7257
7256
|
};
|
|
7258
7257
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
7259
7258
|
const def = schema._zod.def;
|
|
7260
|
-
process$
|
|
7259
|
+
process$2(def.innerType, ctx, params);
|
|
7261
7260
|
const seen = ctx.seen.get(schema);
|
|
7262
7261
|
seen.ref = def.innerType;
|
|
7263
7262
|
if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7264
7263
|
};
|
|
7265
7264
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
7266
7265
|
const def = schema._zod.def;
|
|
7267
|
-
process$
|
|
7266
|
+
process$2(def.innerType, ctx, params);
|
|
7268
7267
|
const seen = ctx.seen.get(schema);
|
|
7269
7268
|
seen.ref = def.innerType;
|
|
7270
7269
|
let catchValue;
|
|
@@ -7278,20 +7277,20 @@ const catchProcessor = (schema, ctx, json, params) => {
|
|
|
7278
7277
|
const pipeProcessor = (schema, ctx, _json, params) => {
|
|
7279
7278
|
const def = schema._zod.def;
|
|
7280
7279
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
7281
|
-
process$
|
|
7280
|
+
process$2(innerType, ctx, params);
|
|
7282
7281
|
const seen = ctx.seen.get(schema);
|
|
7283
7282
|
seen.ref = innerType;
|
|
7284
7283
|
};
|
|
7285
7284
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
7286
7285
|
const def = schema._zod.def;
|
|
7287
|
-
process$
|
|
7286
|
+
process$2(def.innerType, ctx, params);
|
|
7288
7287
|
const seen = ctx.seen.get(schema);
|
|
7289
7288
|
seen.ref = def.innerType;
|
|
7290
7289
|
json.readOnly = true;
|
|
7291
7290
|
};
|
|
7292
7291
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
7293
7292
|
const def = schema._zod.def;
|
|
7294
|
-
process$
|
|
7293
|
+
process$2(def.innerType, ctx, params);
|
|
7295
7294
|
const seen = ctx.seen.get(schema);
|
|
7296
7295
|
seen.ref = def.innerType;
|
|
7297
7296
|
};
|
|
@@ -16345,7 +16344,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
|
|
|
16345
16344
|
};
|
|
16346
16345
|
const normalizeOptions$2 = (options = {}) => {
|
|
16347
16346
|
const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
|
|
16348
|
-
const cwd = toPath$1(options.cwd) ??
|
|
16347
|
+
const cwd = toPath$1(options.cwd) ?? y.cwd();
|
|
16349
16348
|
const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
|
|
16350
16349
|
return {
|
|
16351
16350
|
cwd,
|
|
@@ -16442,7 +16441,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
|
16442
16441
|
const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
|
|
16443
16442
|
return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
|
|
16444
16443
|
};
|
|
16445
|
-
const directoryToGlob = async (directoryPaths, { cwd =
|
|
16444
|
+
const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
|
|
16446
16445
|
return (await Promise.all(directoryPaths.map(async (directoryPath) => {
|
|
16447
16446
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16448
16447
|
directoryPath,
|
|
@@ -16456,7 +16455,7 @@ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, e
|
|
|
16456
16455
|
}) : directoryPath;
|
|
16457
16456
|
}))).flat();
|
|
16458
16457
|
};
|
|
16459
|
-
const directoryToGlobSync = (directoryPaths, { cwd =
|
|
16458
|
+
const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
|
|
16460
16459
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16461
16460
|
directoryPath,
|
|
16462
16461
|
files,
|
|
@@ -16552,7 +16551,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
|
|
|
16552
16551
|
};
|
|
16553
16552
|
const createFilterFunction = (isIgnored, cwd) => {
|
|
16554
16553
|
const seen = /* @__PURE__ */ new Set();
|
|
16555
|
-
const basePath = cwd ||
|
|
16554
|
+
const basePath = cwd || y.cwd();
|
|
16556
16555
|
const pathCache = /* @__PURE__ */ new Map();
|
|
16557
16556
|
return (fastGlobResult) => {
|
|
16558
16557
|
const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
|
|
@@ -30741,6 +30740,21 @@ async function getUserInfo(accessToken) {
|
|
|
30741
30740
|
return result.data;
|
|
30742
30741
|
}
|
|
30743
30742
|
|
|
30743
|
+
//#endregion
|
|
30744
|
+
//#region src/cli/errors.ts
|
|
30745
|
+
/**
|
|
30746
|
+
* Error thrown to signal a controlled CLI exit with a specific exit code.
|
|
30747
|
+
* This allows proper error propagation without calling process.exit() directly,
|
|
30748
|
+
* making the code more testable and maintaining a single exit point.
|
|
30749
|
+
*/
|
|
30750
|
+
var CLIExitError = class extends Error {
|
|
30751
|
+
constructor(code$1) {
|
|
30752
|
+
super(`CLI exited with code ${code$1}`);
|
|
30753
|
+
this.code = code$1;
|
|
30754
|
+
this.name = "CLIExitError";
|
|
30755
|
+
}
|
|
30756
|
+
};
|
|
30757
|
+
|
|
30744
30758
|
//#endregion
|
|
30745
30759
|
//#region node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
30746
30760
|
const ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -30909,13 +30923,13 @@ var ansi_styles_default = ansiStyles;
|
|
|
30909
30923
|
|
|
30910
30924
|
//#endregion
|
|
30911
30925
|
//#region node_modules/chalk/source/vendor/supports-color/index.js
|
|
30912
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
30926
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
|
|
30913
30927
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
30914
30928
|
const position = argv.indexOf(prefix + flag);
|
|
30915
30929
|
const terminatorPosition = argv.indexOf("--");
|
|
30916
30930
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
30917
30931
|
}
|
|
30918
|
-
const { env } =
|
|
30932
|
+
const { env } = y;
|
|
30919
30933
|
let flagForceColor;
|
|
30920
30934
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
30921
30935
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
@@ -30948,7 +30962,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
30948
30962
|
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
30949
30963
|
const min = forceColor || 0;
|
|
30950
30964
|
if (env.TERM === "dumb") return min;
|
|
30951
|
-
if (
|
|
30965
|
+
if (y.platform === "win32") {
|
|
30952
30966
|
const osRelease = os.release().split(".");
|
|
30953
30967
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
30954
30968
|
return 1;
|
|
@@ -31310,7 +31324,7 @@ async function runCommand(commandFn, options) {
|
|
|
31310
31324
|
} catch (e$1) {
|
|
31311
31325
|
if (e$1 instanceof Error) M.error(e$1.stack ?? e$1.message);
|
|
31312
31326
|
else M.error(String(e$1));
|
|
31313
|
-
|
|
31327
|
+
throw new CLIExitError(1);
|
|
31314
31328
|
}
|
|
31315
31329
|
}
|
|
31316
31330
|
|
|
@@ -31690,9 +31704,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
|
|
|
31690
31704
|
//#region node_modules/execa/lib/utils/standard-stream.js
|
|
31691
31705
|
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
31692
31706
|
const STANDARD_STREAMS = [
|
|
31693
|
-
|
|
31694
|
-
|
|
31695
|
-
|
|
31707
|
+
y.stdin,
|
|
31708
|
+
y.stdout,
|
|
31709
|
+
y.stderr
|
|
31696
31710
|
];
|
|
31697
31711
|
const STANDARD_STREAMS_ALIASES = [
|
|
31698
31712
|
"stdin",
|
|
@@ -31817,9 +31831,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
31817
31831
|
//#endregion
|
|
31818
31832
|
//#region node_modules/is-unicode-supported/index.js
|
|
31819
31833
|
function isUnicodeSupported() {
|
|
31820
|
-
const { env: env$1 } =
|
|
31834
|
+
const { env: env$1 } = y;
|
|
31821
31835
|
const { TERM, TERM_PROGRAM } = env$1;
|
|
31822
|
-
if (
|
|
31836
|
+
if (y.platform !== "win32") return TERM !== "linux";
|
|
31823
31837
|
return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
31824
31838
|
}
|
|
31825
31839
|
|
|
@@ -32746,7 +32760,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
32746
32760
|
|
|
32747
32761
|
//#endregion
|
|
32748
32762
|
//#region node_modules/npm-run-path/index.js
|
|
32749
|
-
const npmRunPath = ({ cwd =
|
|
32763
|
+
const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
|
|
32750
32764
|
const cwdPath = path.resolve(toPath(cwd));
|
|
32751
32765
|
const result = [];
|
|
32752
32766
|
const pathParts = pathOption.split(path.delimiter);
|
|
@@ -32764,7 +32778,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
|
32764
32778
|
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
32765
32779
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
32766
32780
|
};
|
|
32767
|
-
const npmRunPathEnv = ({ env: env$1 =
|
|
32781
|
+
const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
|
|
32768
32782
|
env$1 = { ...env$1 };
|
|
32769
32783
|
const pathName = pathKey({ env: env$1 });
|
|
32770
32784
|
options.path = env$1[pathName];
|
|
@@ -33899,7 +33913,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
|
33899
33913
|
};
|
|
33900
33914
|
const getDefaultCwd = () => {
|
|
33901
33915
|
try {
|
|
33902
|
-
return
|
|
33916
|
+
return y.cwd();
|
|
33903
33917
|
} catch (error) {
|
|
33904
33918
|
error.message = `The current directory does not exist.\n${error.message}`;
|
|
33905
33919
|
throw error;
|
|
@@ -33934,7 +33948,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
33934
33948
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
33935
33949
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
33936
33950
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
33937
|
-
if (
|
|
33951
|
+
if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
33938
33952
|
return {
|
|
33939
33953
|
file,
|
|
33940
33954
|
commandArguments,
|
|
@@ -33961,7 +33975,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
|
|
|
33961
33975
|
});
|
|
33962
33976
|
const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
33963
33977
|
const env$1 = extendEnv ? {
|
|
33964
|
-
...
|
|
33978
|
+
...y.env,
|
|
33965
33979
|
...envOption
|
|
33966
33980
|
} : envOption;
|
|
33967
33981
|
if (preferLocal || node) return npmRunPathEnv({
|
|
@@ -34961,12 +34975,12 @@ const guessStreamDirection = {
|
|
|
34961
34975
|
}
|
|
34962
34976
|
};
|
|
34963
34977
|
const getStandardStreamDirection = (value) => {
|
|
34964
|
-
if ([0,
|
|
34978
|
+
if ([0, y.stdin].includes(value)) return "input";
|
|
34965
34979
|
if ([
|
|
34966
34980
|
1,
|
|
34967
34981
|
2,
|
|
34968
|
-
|
|
34969
|
-
|
|
34982
|
+
y.stdout,
|
|
34983
|
+
y.stderr
|
|
34970
34984
|
].includes(value)) return "output";
|
|
34971
34985
|
};
|
|
34972
34986
|
const DEFAULT_DIRECTION = "output";
|
|
@@ -36030,9 +36044,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
|
|
|
36030
36044
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
36031
36045
|
};
|
|
36032
36046
|
const getIpcExport = () => {
|
|
36033
|
-
const anyProcess =
|
|
36047
|
+
const anyProcess = y;
|
|
36034
36048
|
const isSubprocess = true;
|
|
36035
|
-
const ipc =
|
|
36049
|
+
const ipc = y.channel !== void 0;
|
|
36036
36050
|
return {
|
|
36037
36051
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
36038
36052
|
getCancelSignal: getCancelSignal$1.bind(void 0, {
|
|
@@ -36274,7 +36288,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
|
|
|
36274
36288
|
|
|
36275
36289
|
//#endregion
|
|
36276
36290
|
//#region node_modules/signal-exit/dist/mjs/index.js
|
|
36277
|
-
const processOk = (process$
|
|
36291
|
+
const processOk = (process$4) => !!process$4 && typeof process$4 === "object" && typeof process$4.removeListener === "function" && typeof process$4.emit === "function" && typeof process$4.reallyExit === "function" && typeof process$4.listeners === "function" && typeof process$4.kill === "function" && typeof process$4.pid === "number" && typeof process$4.on === "function";
|
|
36278
36292
|
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
36279
36293
|
const global$1 = globalThis;
|
|
36280
36294
|
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -36342,7 +36356,7 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
36342
36356
|
};
|
|
36343
36357
|
var SignalExit = class extends SignalExitBase {
|
|
36344
36358
|
/* c8 ignore start */
|
|
36345
|
-
#hupSig = process$
|
|
36359
|
+
#hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
36346
36360
|
/* c8 ignore stop */
|
|
36347
36361
|
#emitter = new Emitter();
|
|
36348
36362
|
#process;
|
|
@@ -36350,15 +36364,15 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36350
36364
|
#originalProcessReallyExit;
|
|
36351
36365
|
#sigListeners = {};
|
|
36352
36366
|
#loaded = false;
|
|
36353
|
-
constructor(process$
|
|
36367
|
+
constructor(process$4) {
|
|
36354
36368
|
super();
|
|
36355
|
-
this.#process = process$
|
|
36369
|
+
this.#process = process$4;
|
|
36356
36370
|
this.#sigListeners = {};
|
|
36357
36371
|
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
36358
36372
|
const listeners = this.#process.listeners(sig);
|
|
36359
36373
|
let { count: count$1 } = this.#emitter;
|
|
36360
36374
|
/* c8 ignore start */
|
|
36361
|
-
const p$1 = process$
|
|
36375
|
+
const p$1 = process$4;
|
|
36362
36376
|
if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
|
|
36363
36377
|
/* c8 ignore stop */
|
|
36364
36378
|
if (listeners.length === count$1) {
|
|
@@ -36366,11 +36380,11 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36366
36380
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
36367
36381
|
/* c8 ignore start */
|
|
36368
36382
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
36369
|
-
if (!ret) process$
|
|
36383
|
+
if (!ret) process$4.kill(process$4.pid, s);
|
|
36370
36384
|
}
|
|
36371
36385
|
};
|
|
36372
|
-
this.#originalProcessReallyExit = process$
|
|
36373
|
-
this.#originalProcessEmit = process$
|
|
36386
|
+
this.#originalProcessReallyExit = process$4.reallyExit;
|
|
36387
|
+
this.#originalProcessEmit = process$4.emit;
|
|
36374
36388
|
}
|
|
36375
36389
|
onExit(cb, opts) {
|
|
36376
36390
|
/* c8 ignore start */
|
|
@@ -36437,8 +36451,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36437
36451
|
} else return og.call(this.#process, ev, ...args);
|
|
36438
36452
|
}
|
|
36439
36453
|
};
|
|
36440
|
-
const process$
|
|
36441
|
-
const { onExit, load, unload } = signalExitWrap(processOk(process$
|
|
36454
|
+
const process$1 = globalThis.process;
|
|
36455
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
|
|
36442
36456
|
|
|
36443
36457
|
//#endregion
|
|
36444
36458
|
//#region node_modules/execa/lib/terminate/cleanup.js
|
|
@@ -38189,6 +38203,13 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38189
38203
|
//#region src/cli/commands/project/create.ts
|
|
38190
38204
|
var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
|
|
38191
38205
|
const DEFAULT_TEMPLATE_ID = "backend-only";
|
|
38206
|
+
const SUPPORTED_AGENTS = [{
|
|
38207
|
+
value: "cursor",
|
|
38208
|
+
label: "Cursor"
|
|
38209
|
+
}, {
|
|
38210
|
+
value: "claude-code",
|
|
38211
|
+
label: "Claude Code"
|
|
38212
|
+
}];
|
|
38192
38213
|
async function getTemplateById(templateId) {
|
|
38193
38214
|
const templates = await listTemplates();
|
|
38194
38215
|
const template = templates.find((t) => t.id === templateId);
|
|
@@ -38251,6 +38272,7 @@ async function createInteractive(options) {
|
|
|
38251
38272
|
description: result.description || void 0,
|
|
38252
38273
|
projectPath: result.projectPath,
|
|
38253
38274
|
deploy: options.deploy,
|
|
38275
|
+
skills: options.skills,
|
|
38254
38276
|
isInteractive: true
|
|
38255
38277
|
});
|
|
38256
38278
|
}
|
|
@@ -38261,10 +38283,11 @@ async function createNonInteractive(options) {
|
|
|
38261
38283
|
description: options.description,
|
|
38262
38284
|
projectPath: options.path,
|
|
38263
38285
|
deploy: options.deploy,
|
|
38286
|
+
skills: options.skills,
|
|
38264
38287
|
isInteractive: false
|
|
38265
38288
|
});
|
|
38266
38289
|
}
|
|
38267
|
-
async function executeCreate({ template, name: rawName, description, projectPath, deploy, isInteractive }) {
|
|
38290
|
+
async function executeCreate({ template, name: rawName, description, projectPath, deploy, skills, isInteractive }) {
|
|
38268
38291
|
const name$1 = rawName.trim();
|
|
38269
38292
|
const resolvedPath = resolve(projectPath);
|
|
38270
38293
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -38324,12 +38347,45 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38324
38347
|
finalAppUrl = appUrl;
|
|
38325
38348
|
}
|
|
38326
38349
|
}
|
|
38350
|
+
let selectedAgents = [];
|
|
38351
|
+
if (isInteractive) {
|
|
38352
|
+
const result = await fe({
|
|
38353
|
+
message: "Add AI agent skills? (Select agents to configure)",
|
|
38354
|
+
options: SUPPORTED_AGENTS,
|
|
38355
|
+
initialValues: SUPPORTED_AGENTS.map((agent) => agent.value),
|
|
38356
|
+
required: false
|
|
38357
|
+
});
|
|
38358
|
+
if (!pD(result)) selectedAgents = result;
|
|
38359
|
+
} else if (skills) selectedAgents = SUPPORTED_AGENTS.map((agent) => agent.value);
|
|
38360
|
+
if (selectedAgents.length > 0) {
|
|
38361
|
+
const agentArgs = selectedAgents.flatMap((agent) => ["-a", agent]);
|
|
38362
|
+
M.step(`Installing skills for: ${selectedAgents.join(", ")}`);
|
|
38363
|
+
await runTask(`Installing skills for: ${selectedAgents.join(", ")}`, async () => {
|
|
38364
|
+
await execa("npx", [
|
|
38365
|
+
"-y",
|
|
38366
|
+
"add-skill",
|
|
38367
|
+
"base44/skills",
|
|
38368
|
+
"-y",
|
|
38369
|
+
"-s",
|
|
38370
|
+
"base44-cli",
|
|
38371
|
+
"-s",
|
|
38372
|
+
"base44-sdk",
|
|
38373
|
+
...agentArgs
|
|
38374
|
+
], {
|
|
38375
|
+
cwd: resolvedPath,
|
|
38376
|
+
stdio: "inherit"
|
|
38377
|
+
});
|
|
38378
|
+
}, {
|
|
38379
|
+
successMessage: theme.colors.base44Orange("AI agent skills added successfully"),
|
|
38380
|
+
errorMessage: "Failed to add AI agent skills - you can add them later with: npx add-skill base44/skills"
|
|
38381
|
+
});
|
|
38382
|
+
}
|
|
38327
38383
|
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38328
38384
|
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
|
|
38329
38385
|
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38330
38386
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
38331
38387
|
}
|
|
38332
|
-
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").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").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
|
|
38388
|
+
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").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("--skills", "Add AI agent skills (Cursor, Claude Code)").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
|
|
38333
38389
|
await chooseCreate(options);
|
|
38334
38390
|
});
|
|
38335
38391
|
|
|
@@ -38375,7 +38431,7 @@ function isInsideContainer() {
|
|
|
38375
38431
|
//#endregion
|
|
38376
38432
|
//#region node_modules/is-wsl/index.js
|
|
38377
38433
|
const isWsl = () => {
|
|
38378
|
-
if (
|
|
38434
|
+
if (y.platform !== "linux") return false;
|
|
38379
38435
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
38380
38436
|
if (isInsideContainer()) return false;
|
|
38381
38437
|
return true;
|
|
@@ -38386,12 +38442,12 @@ const isWsl = () => {
|
|
|
38386
38442
|
return false;
|
|
38387
38443
|
}
|
|
38388
38444
|
};
|
|
38389
|
-
var is_wsl_default =
|
|
38445
|
+
var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
38390
38446
|
|
|
38391
38447
|
//#endregion
|
|
38392
38448
|
//#region node_modules/powershell-utils/index.js
|
|
38393
38449
|
const execFile$2 = promisify(childProcess.execFile);
|
|
38394
|
-
const powerShellPath$1 = () => `${
|
|
38450
|
+
const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
38395
38451
|
const executePowerShell = async (command, options = {}) => {
|
|
38396
38452
|
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
38397
38453
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -38502,7 +38558,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
|
|
|
38502
38558
|
//#region node_modules/default-browser-id/index.js
|
|
38503
38559
|
const execFileAsync$3 = promisify(execFile);
|
|
38504
38560
|
async function defaultBrowserId() {
|
|
38505
|
-
if (
|
|
38561
|
+
if (y.platform !== "darwin") throw new Error("macOS only");
|
|
38506
38562
|
const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
|
|
38507
38563
|
"read",
|
|
38508
38564
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -38517,7 +38573,7 @@ async function defaultBrowserId() {
|
|
|
38517
38573
|
//#region node_modules/run-applescript/index.js
|
|
38518
38574
|
const execFileAsync$2 = promisify(execFile);
|
|
38519
38575
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
38520
|
-
if (
|
|
38576
|
+
if (y.platform !== "darwin") throw new Error("macOS only");
|
|
38521
38577
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
38522
38578
|
const execOptions = {};
|
|
38523
38579
|
if (signal) execOptions.signal = signal;
|
|
@@ -38626,14 +38682,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
|
38626
38682
|
const execFileAsync = promisify(execFile);
|
|
38627
38683
|
const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
|
|
38628
38684
|
async function defaultBrowser() {
|
|
38629
|
-
if (
|
|
38685
|
+
if (y.platform === "darwin") {
|
|
38630
38686
|
const id = await defaultBrowserId();
|
|
38631
38687
|
return {
|
|
38632
38688
|
name: await bundleName(id),
|
|
38633
38689
|
id
|
|
38634
38690
|
};
|
|
38635
38691
|
}
|
|
38636
|
-
if (
|
|
38692
|
+
if (y.platform === "linux") {
|
|
38637
38693
|
const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
|
|
38638
38694
|
"query",
|
|
38639
38695
|
"default",
|
|
@@ -38645,13 +38701,13 @@ async function defaultBrowser() {
|
|
|
38645
38701
|
id
|
|
38646
38702
|
};
|
|
38647
38703
|
}
|
|
38648
|
-
if (
|
|
38704
|
+
if (y.platform === "win32") return defaultBrowser$1();
|
|
38649
38705
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
38650
38706
|
}
|
|
38651
38707
|
|
|
38652
38708
|
//#endregion
|
|
38653
38709
|
//#region node_modules/is-in-ssh/index.js
|
|
38654
|
-
const isInSsh = Boolean(
|
|
38710
|
+
const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
|
|
38655
38711
|
var is_in_ssh_default = isInSsh;
|
|
38656
38712
|
|
|
38657
38713
|
//#endregion
|
|
@@ -38659,7 +38715,7 @@ var is_in_ssh_default = isInSsh;
|
|
|
38659
38715
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
38660
38716
|
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
38661
38717
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
38662
|
-
const { platform: platform$1, arch } =
|
|
38718
|
+
const { platform: platform$1, arch } = y;
|
|
38663
38719
|
const tryEachApp = async (apps$1, opener) => {
|
|
38664
38720
|
if (apps$1.length === 0) return;
|
|
38665
38721
|
const errors = [];
|
|
@@ -38772,7 +38828,7 @@ const baseOpen = async (options) => {
|
|
|
38772
38828
|
await fs$1.access(localXdgOpenPath, constants$1.X_OK);
|
|
38773
38829
|
exeLocalXdgOpen = true;
|
|
38774
38830
|
} catch {}
|
|
38775
|
-
command =
|
|
38831
|
+
command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
38776
38832
|
}
|
|
38777
38833
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
38778
38834
|
if (!options.wait) {
|
|
@@ -39246,6 +39302,48 @@ function getIntegrationDisplayName(type) {
|
|
|
39246
39302
|
return type;
|
|
39247
39303
|
}
|
|
39248
39304
|
|
|
39305
|
+
//#endregion
|
|
39306
|
+
//#region src/core/connectors/oauth.ts
|
|
39307
|
+
/**
|
|
39308
|
+
* Polls for OAuth completion status.
|
|
39309
|
+
* Returns when status becomes ACTIVE or FAILED, or times out.
|
|
39310
|
+
*/
|
|
39311
|
+
async function waitForOAuthCompletion(integrationType, connectionId, options) {
|
|
39312
|
+
let accountEmail;
|
|
39313
|
+
let error;
|
|
39314
|
+
try {
|
|
39315
|
+
await pWaitFor(async () => {
|
|
39316
|
+
const status = await checkOAuthStatus(integrationType, connectionId);
|
|
39317
|
+
if (status.status === "ACTIVE") {
|
|
39318
|
+
accountEmail = status.accountEmail ?? void 0;
|
|
39319
|
+
return true;
|
|
39320
|
+
}
|
|
39321
|
+
if (status.status === "FAILED") {
|
|
39322
|
+
error = status.error || "Authorization failed";
|
|
39323
|
+
throw new Error(error);
|
|
39324
|
+
}
|
|
39325
|
+
options?.onPending?.();
|
|
39326
|
+
return false;
|
|
39327
|
+
}, {
|
|
39328
|
+
interval: OAUTH_POLL_INTERVAL_MS,
|
|
39329
|
+
timeout: OAUTH_POLL_TIMEOUT_MS
|
|
39330
|
+
});
|
|
39331
|
+
return {
|
|
39332
|
+
success: true,
|
|
39333
|
+
accountEmail
|
|
39334
|
+
};
|
|
39335
|
+
} catch (err) {
|
|
39336
|
+
if (err instanceof Error && err.message.includes("timed out")) return {
|
|
39337
|
+
success: false,
|
|
39338
|
+
error: "Authorization timed out. Please try again."
|
|
39339
|
+
};
|
|
39340
|
+
return {
|
|
39341
|
+
success: false,
|
|
39342
|
+
error: error || (err instanceof Error ? err.message : "Unknown error")
|
|
39343
|
+
};
|
|
39344
|
+
}
|
|
39345
|
+
}
|
|
39346
|
+
|
|
39249
39347
|
//#endregion
|
|
39250
39348
|
//#region src/core/connectors/config.ts
|
|
39251
39349
|
/**
|
|
@@ -39307,6 +39405,20 @@ async function removeLocalConnector(type, projectRoot) {
|
|
|
39307
39405
|
return await writeLocalConnectors(filtered, projectRoot);
|
|
39308
39406
|
}
|
|
39309
39407
|
|
|
39408
|
+
//#endregion
|
|
39409
|
+
//#region src/core/connectors/state.ts
|
|
39410
|
+
/**
|
|
39411
|
+
* Fetches both local config and backend connectors in parallel.
|
|
39412
|
+
* Gracefully handles failures by returning empty arrays.
|
|
39413
|
+
*/
|
|
39414
|
+
async function fetchConnectorState() {
|
|
39415
|
+
const [local, backend] = await Promise.all([readLocalConnectors().catch(() => []), listConnectors().catch(() => [])]);
|
|
39416
|
+
return {
|
|
39417
|
+
local,
|
|
39418
|
+
backend
|
|
39419
|
+
};
|
|
39420
|
+
}
|
|
39421
|
+
|
|
39310
39422
|
//#endregion
|
|
39311
39423
|
//#region src/cli/commands/connectors/add.ts
|
|
39312
39424
|
function validateIntegrationType(type) {
|
|
@@ -39330,65 +39442,31 @@ async function promptForIntegrationType() {
|
|
|
39330
39442
|
}
|
|
39331
39443
|
return selected;
|
|
39332
39444
|
}
|
|
39333
|
-
async function waitForOAuthCompletion(integrationType, connectionId) {
|
|
39334
|
-
let accountEmail;
|
|
39335
|
-
let error;
|
|
39336
|
-
try {
|
|
39337
|
-
await runTask("Waiting for authorization...", async (updateMessage) => {
|
|
39338
|
-
await pWaitFor(async () => {
|
|
39339
|
-
const status = await checkOAuthStatus(integrationType, connectionId);
|
|
39340
|
-
if (status.status === "ACTIVE") {
|
|
39341
|
-
accountEmail = status.accountEmail ?? void 0;
|
|
39342
|
-
return true;
|
|
39343
|
-
}
|
|
39344
|
-
if (status.status === "FAILED") {
|
|
39345
|
-
error = status.error || "Authorization failed";
|
|
39346
|
-
throw new Error(error);
|
|
39347
|
-
}
|
|
39348
|
-
updateMessage("Waiting for authorization in browser...");
|
|
39349
|
-
return false;
|
|
39350
|
-
}, {
|
|
39351
|
-
interval: OAUTH_POLL_INTERVAL_MS,
|
|
39352
|
-
timeout: OAUTH_POLL_TIMEOUT_MS
|
|
39353
|
-
});
|
|
39354
|
-
}, {
|
|
39355
|
-
successMessage: "Authorization completed!",
|
|
39356
|
-
errorMessage: "Authorization failed"
|
|
39357
|
-
});
|
|
39358
|
-
return {
|
|
39359
|
-
success: true,
|
|
39360
|
-
accountEmail
|
|
39361
|
-
};
|
|
39362
|
-
} catch (err) {
|
|
39363
|
-
if (err instanceof Error && err.message.includes("timed out")) return {
|
|
39364
|
-
success: false,
|
|
39365
|
-
error: "Authorization timed out. Please try again."
|
|
39366
|
-
};
|
|
39367
|
-
return {
|
|
39368
|
-
success: false,
|
|
39369
|
-
error: error || (err instanceof Error ? err.message : "Unknown error")
|
|
39370
|
-
};
|
|
39371
|
-
}
|
|
39372
|
-
}
|
|
39373
39445
|
async function addConnector(integrationType) {
|
|
39374
39446
|
const selectedType = integrationType ? validateIntegrationType(integrationType) : await promptForIntegrationType();
|
|
39375
39447
|
const displayName = getIntegrationDisplayName(selectedType);
|
|
39376
|
-
const
|
|
39377
|
-
|
|
39448
|
+
const result = await runTask(`Initiating ${displayName} connection...`, async (updateMessage) => {
|
|
39449
|
+
const initiateResponse = await initiateOAuth(selectedType);
|
|
39450
|
+
if (initiateResponse.already_authorized) {
|
|
39451
|
+
await addLocalConnector(selectedType);
|
|
39452
|
+
return { alreadyAuthorized: true };
|
|
39453
|
+
}
|
|
39454
|
+
if (initiateResponse.error === "different_user" && initiateResponse.other_user_email) throw new Error(`This app is already connected to ${displayName} by ${initiateResponse.other_user_email}`);
|
|
39455
|
+
if (!initiateResponse.redirect_url || !initiateResponse.connection_id) throw new Error("Invalid response from server: missing redirect URL or connection ID");
|
|
39456
|
+
M.info(`Please authorize ${displayName} at:\n${theme.colors.links(initiateResponse.redirect_url)}`);
|
|
39457
|
+
updateMessage("Waiting for authorization...");
|
|
39458
|
+
const oauthResult = await waitForOAuthCompletion(selectedType, initiateResponse.connection_id);
|
|
39459
|
+
if (!oauthResult.success) throw new Error(oauthResult.error || "Authorization failed");
|
|
39460
|
+
await addLocalConnector(selectedType);
|
|
39461
|
+
return {
|
|
39462
|
+
alreadyAuthorized: false,
|
|
39463
|
+
accountEmail: oauthResult.accountEmail
|
|
39464
|
+
};
|
|
39378
39465
|
}, {
|
|
39379
|
-
successMessage:
|
|
39380
|
-
errorMessage: `Failed to
|
|
39466
|
+
successMessage: "Authorization completed!",
|
|
39467
|
+
errorMessage: `Failed to connect ${displayName}`
|
|
39381
39468
|
});
|
|
39382
|
-
if (
|
|
39383
|
-
await addLocalConnector(selectedType);
|
|
39384
|
-
return { outroMessage: `Already connected to ${theme.styles.bold(displayName)} (added to config)` };
|
|
39385
|
-
}
|
|
39386
|
-
if (initiateResponse.error === "different_user" && initiateResponse.other_user_email) throw new Error(`This app is already connected to ${displayName} by ${initiateResponse.other_user_email}`);
|
|
39387
|
-
if (!initiateResponse.redirect_url || !initiateResponse.connection_id) throw new Error("Invalid response from server: missing redirect URL or connection ID");
|
|
39388
|
-
M.info(`Please authorize ${displayName} at:\n${theme.colors.links(initiateResponse.redirect_url)}`);
|
|
39389
|
-
const result = await waitForOAuthCompletion(selectedType, initiateResponse.connection_id);
|
|
39390
|
-
if (!result.success) throw new Error(result.error || "Authorization failed");
|
|
39391
|
-
await addLocalConnector(selectedType);
|
|
39469
|
+
if (result.alreadyAuthorized) return { outroMessage: `Already connected to ${theme.styles.bold(displayName)} (added to config)` };
|
|
39392
39470
|
const accountInfo = result.accountEmail ? ` as ${theme.styles.bold(result.accountEmail)}` : "";
|
|
39393
39471
|
return { outroMessage: `Successfully connected to ${theme.styles.bold(displayName)}${accountInfo}` };
|
|
39394
39472
|
}
|
|
@@ -39450,10 +39528,7 @@ function formatConnectorLine(connector) {
|
|
|
39450
39528
|
return `${bullet} ${displayName}${statusText}`;
|
|
39451
39529
|
}
|
|
39452
39530
|
async function listConnectorsCommand() {
|
|
39453
|
-
const
|
|
39454
|
-
const [local, backend] = await Promise.all([readLocalConnectors().catch(() => []), listConnectors().catch(() => [])]);
|
|
39455
|
-
return [local, backend];
|
|
39456
|
-
}, {
|
|
39531
|
+
const { local: localConnectors, backend: backendConnectors } = await runTask("Fetching connectors...", fetchConnectorState, {
|
|
39457
39532
|
successMessage: "Connectors loaded",
|
|
39458
39533
|
errorMessage: "Failed to fetch connectors"
|
|
39459
39534
|
});
|
|
@@ -39502,56 +39577,27 @@ function findOrphanedConnectors(local, backend) {
|
|
|
39502
39577
|
}
|
|
39503
39578
|
async function connectSingleConnector(connector) {
|
|
39504
39579
|
const { type, displayName, scopes } = connector;
|
|
39505
|
-
|
|
39506
|
-
|
|
39507
|
-
|
|
39508
|
-
|
|
39509
|
-
error: `Already connected by ${initiateResponse.other_user_email}`
|
|
39510
|
-
};
|
|
39511
|
-
if (!initiateResponse.redirect_url || !initiateResponse.connection_id) return {
|
|
39512
|
-
success: false,
|
|
39513
|
-
error: "Invalid response from server"
|
|
39514
|
-
};
|
|
39515
|
-
M.info(`Please authorize ${displayName} at:\n${theme.colors.links(initiateResponse.redirect_url)}`);
|
|
39516
|
-
let accountEmail;
|
|
39517
|
-
try {
|
|
39518
|
-
await runTask("Waiting for authorization...", async () => {
|
|
39519
|
-
await pWaitFor(async () => {
|
|
39520
|
-
const status = await checkOAuthStatus(type, initiateResponse.connection_id);
|
|
39521
|
-
if (status.status === "ACTIVE") {
|
|
39522
|
-
accountEmail = status.accountEmail ?? void 0;
|
|
39523
|
-
return true;
|
|
39524
|
-
}
|
|
39525
|
-
if (status.status === "FAILED") throw new Error(status.error || "Authorization failed");
|
|
39526
|
-
return false;
|
|
39527
|
-
}, {
|
|
39528
|
-
interval: OAUTH_POLL_INTERVAL_MS,
|
|
39529
|
-
timeout: OAUTH_POLL_TIMEOUT_MS
|
|
39530
|
-
});
|
|
39531
|
-
}, {
|
|
39532
|
-
successMessage: "Authorization completed!",
|
|
39533
|
-
errorMessage: "Authorization failed"
|
|
39534
|
-
});
|
|
39535
|
-
return {
|
|
39536
|
-
success: true,
|
|
39537
|
-
accountEmail
|
|
39538
|
-
};
|
|
39539
|
-
} catch (err) {
|
|
39540
|
-
if (err instanceof Error && err.message.includes("timed out")) return {
|
|
39580
|
+
return await runTask(`Initiating ${displayName} connection...`, async (updateMessage) => {
|
|
39581
|
+
const initiateResponse = await initiateOAuth(type, scopes || null);
|
|
39582
|
+
if (initiateResponse.already_authorized) return { success: true };
|
|
39583
|
+
if (initiateResponse.error === "different_user") return {
|
|
39541
39584
|
success: false,
|
|
39542
|
-
error:
|
|
39585
|
+
error: `Already connected by ${initiateResponse.other_user_email}`
|
|
39543
39586
|
};
|
|
39544
|
-
return {
|
|
39587
|
+
if (!initiateResponse.redirect_url || !initiateResponse.connection_id) return {
|
|
39545
39588
|
success: false,
|
|
39546
|
-
error:
|
|
39589
|
+
error: "Invalid response from server"
|
|
39547
39590
|
};
|
|
39548
|
-
|
|
39591
|
+
M.info(`Please authorize ${displayName} at:\n${theme.colors.links(initiateResponse.redirect_url)}`);
|
|
39592
|
+
updateMessage("Waiting for authorization...");
|
|
39593
|
+
return await waitForOAuthCompletion(type, initiateResponse.connection_id);
|
|
39594
|
+
}, {
|
|
39595
|
+
successMessage: "Authorization completed!",
|
|
39596
|
+
errorMessage: "Authorization failed"
|
|
39597
|
+
});
|
|
39549
39598
|
}
|
|
39550
39599
|
async function pushConnectorsCommand() {
|
|
39551
|
-
const
|
|
39552
|
-
const [local, backend] = await Promise.all([readLocalConnectors(), listConnectors().catch(() => [])]);
|
|
39553
|
-
return [local, backend];
|
|
39554
|
-
}, {
|
|
39600
|
+
const { local: localConnectors, backend: backendConnectors } = await runTask("Checking connector status...", fetchConnectorState, {
|
|
39555
39601
|
successMessage: "Status checked",
|
|
39556
39602
|
errorMessage: "Failed to check status"
|
|
39557
39603
|
});
|
|
@@ -39590,7 +39636,6 @@ async function pushConnectorsCommand() {
|
|
|
39590
39636
|
}
|
|
39591
39637
|
for (const connector of pending) {
|
|
39592
39638
|
console.log();
|
|
39593
|
-
M.info(`Connecting ${theme.styles.bold(connector.displayName)}...`);
|
|
39594
39639
|
const result = await connectSingleConnector(connector);
|
|
39595
39640
|
if (result.success) {
|
|
39596
39641
|
const accountInfo = result.accountEmail ? ` as ${result.accountEmail}` : "";
|
|
@@ -39675,10 +39720,7 @@ async function promptForConnectorToRemove(connectors) {
|
|
|
39675
39720
|
}
|
|
39676
39721
|
async function removeConnectorCommand(integrationType, options = {}) {
|
|
39677
39722
|
const isHardDelete = options.hard === true;
|
|
39678
|
-
const
|
|
39679
|
-
const [local, backend] = await Promise.all([readLocalConnectors().catch(() => []), listConnectors().catch(() => [])]);
|
|
39680
|
-
return [local, backend];
|
|
39681
|
-
}, {
|
|
39723
|
+
const { local: localConnectors, backend: backendConnectors } = await runTask("Fetching connectors...", fetchConnectorState, {
|
|
39682
39724
|
successMessage: "Connectors loaded",
|
|
39683
39725
|
errorMessage: "Failed to fetch connectors"
|
|
39684
39726
|
});
|
|
@@ -39723,7 +39765,7 @@ const connectorsCommand = new Command("connectors").description("Manage OAuth co
|
|
|
39723
39765
|
var version = "0.0.17";
|
|
39724
39766
|
|
|
39725
39767
|
//#endregion
|
|
39726
|
-
//#region src/cli/
|
|
39768
|
+
//#region src/cli/program.ts
|
|
39727
39769
|
const program = new Command();
|
|
39728
39770
|
program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(version);
|
|
39729
39771
|
program.configureHelp({ sortSubcommands: true });
|
|
@@ -39738,7 +39780,6 @@ program.addCommand(entitiesPushCommand);
|
|
|
39738
39780
|
program.addCommand(functionsDeployCommand);
|
|
39739
39781
|
program.addCommand(siteDeployCommand);
|
|
39740
39782
|
program.addCommand(connectorsCommand);
|
|
39741
|
-
program.parse();
|
|
39742
39783
|
|
|
39743
39784
|
//#endregion
|
|
39744
|
-
export {
|
|
39785
|
+
export { CLIExitError, program };
|