@base44-preview/cli 0.0.15-pr.98.72adf3c → 0.0.15-pr.99.00fd4f5
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/cli/index.js +556 -96
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:
|
|
|
4
4
|
import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
5
5
|
import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
|
|
6
6
|
import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
7
|
-
import
|
|
7
|
+
import process$1, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
8
8
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
9
9
|
import * as g from "node:readline";
|
|
10
10
|
import O from "node:readline";
|
|
@@ -894,7 +894,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
894
894
|
const childProcess$1 = __require("node:child_process");
|
|
895
895
|
const path$15 = __require("node:path");
|
|
896
896
|
const fs$10 = __require("node:fs");
|
|
897
|
-
const process$
|
|
897
|
+
const process$4 = __require("node:process");
|
|
898
898
|
const { Argument, humanReadableArgName } = require_argument();
|
|
899
899
|
const { CommanderError } = require_error$1();
|
|
900
900
|
const { Help } = require_help();
|
|
@@ -945,10 +945,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
945
945
|
this._showHelpAfterError = false;
|
|
946
946
|
this._showSuggestionAfterError = true;
|
|
947
947
|
this._outputConfiguration = {
|
|
948
|
-
writeOut: (str) => process$
|
|
949
|
-
writeErr: (str) => process$
|
|
950
|
-
getOutHelpWidth: () => process$
|
|
951
|
-
getErrHelpWidth: () => process$
|
|
948
|
+
writeOut: (str) => process$4.stdout.write(str),
|
|
949
|
+
writeErr: (str) => process$4.stderr.write(str),
|
|
950
|
+
getOutHelpWidth: () => process$4.stdout.isTTY ? process$4.stdout.columns : void 0,
|
|
951
|
+
getErrHelpWidth: () => process$4.stderr.isTTY ? process$4.stderr.columns : void 0,
|
|
952
952
|
outputError: (str, write) => write(str)
|
|
953
953
|
};
|
|
954
954
|
this._hidden = false;
|
|
@@ -1302,7 +1302,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1302
1302
|
*/
|
|
1303
1303
|
_exit(exitCode, code$1, message) {
|
|
1304
1304
|
if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
|
|
1305
|
-
process$
|
|
1305
|
+
process$4.exit(exitCode);
|
|
1306
1306
|
}
|
|
1307
1307
|
/**
|
|
1308
1308
|
* Register callback `fn` for the command.
|
|
@@ -1641,11 +1641,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1641
1641
|
if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
|
|
1642
1642
|
parseOptions = parseOptions || {};
|
|
1643
1643
|
if (argv === void 0 && parseOptions.from === void 0) {
|
|
1644
|
-
if (process$
|
|
1645
|
-
const execArgv$1 = process$
|
|
1644
|
+
if (process$4.versions?.electron) parseOptions.from = "electron";
|
|
1645
|
+
const execArgv$1 = process$4.execArgv ?? [];
|
|
1646
1646
|
if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
|
|
1647
1647
|
}
|
|
1648
|
-
if (argv === void 0) argv = process$
|
|
1648
|
+
if (argv === void 0) argv = process$4.argv;
|
|
1649
1649
|
this.rawArgs = argv.slice();
|
|
1650
1650
|
let userArgs;
|
|
1651
1651
|
switch (parseOptions.from) {
|
|
@@ -1655,7 +1655,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1655
1655
|
userArgs = argv.slice(2);
|
|
1656
1656
|
break;
|
|
1657
1657
|
case "electron":
|
|
1658
|
-
if (process$
|
|
1658
|
+
if (process$4.defaultApp) {
|
|
1659
1659
|
this._scriptPath = argv[1];
|
|
1660
1660
|
userArgs = argv.slice(2);
|
|
1661
1661
|
} else userArgs = argv.slice(1);
|
|
@@ -1769,15 +1769,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1769
1769
|
}
|
|
1770
1770
|
launchWithNode = sourceExt.includes(path$15.extname(executableFile));
|
|
1771
1771
|
let proc$1;
|
|
1772
|
-
if (process$
|
|
1772
|
+
if (process$4.platform !== "win32") if (launchWithNode) {
|
|
1773
1773
|
args.unshift(executableFile);
|
|
1774
|
-
args = incrementNodeInspectorPort(process$
|
|
1775
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1774
|
+
args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
|
|
1775
|
+
proc$1 = childProcess$1.spawn(process$4.argv[0], args, { stdio: "inherit" });
|
|
1776
1776
|
} else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
|
|
1777
1777
|
else {
|
|
1778
1778
|
args.unshift(executableFile);
|
|
1779
|
-
args = incrementNodeInspectorPort(process$
|
|
1780
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1779
|
+
args = incrementNodeInspectorPort(process$4.execArgv).concat(args);
|
|
1780
|
+
proc$1 = childProcess$1.spawn(process$4.execPath, args, { stdio: "inherit" });
|
|
1781
1781
|
}
|
|
1782
1782
|
if (!proc$1.killed) [
|
|
1783
1783
|
"SIGUSR1",
|
|
@@ -1786,14 +1786,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1786
1786
|
"SIGINT",
|
|
1787
1787
|
"SIGHUP"
|
|
1788
1788
|
].forEach((signal) => {
|
|
1789
|
-
process$
|
|
1789
|
+
process$4.on(signal, () => {
|
|
1790
1790
|
if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
|
|
1791
1791
|
});
|
|
1792
1792
|
});
|
|
1793
1793
|
const exitCallback = this._exitCallback;
|
|
1794
1794
|
proc$1.on("close", (code$1) => {
|
|
1795
1795
|
code$1 = code$1 ?? 1;
|
|
1796
|
-
if (!exitCallback) process$
|
|
1796
|
+
if (!exitCallback) process$4.exit(code$1);
|
|
1797
1797
|
else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
|
|
1798
1798
|
});
|
|
1799
1799
|
proc$1.on("error", (err) => {
|
|
@@ -1805,7 +1805,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1805
1805
|
- ${executableDirMessage}`;
|
|
1806
1806
|
throw new Error(executableMissing);
|
|
1807
1807
|
} else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
|
|
1808
|
-
if (!exitCallback) process$
|
|
1808
|
+
if (!exitCallback) process$4.exit(1);
|
|
1809
1809
|
else {
|
|
1810
1810
|
const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
|
|
1811
1811
|
wrappedError.nestedError = err;
|
|
@@ -2211,13 +2211,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2211
2211
|
*/
|
|
2212
2212
|
_parseOptionsEnv() {
|
|
2213
2213
|
this.options.forEach((option) => {
|
|
2214
|
-
if (option.envVar && option.envVar in process$
|
|
2214
|
+
if (option.envVar && option.envVar in process$4.env) {
|
|
2215
2215
|
const optionKey = option.attributeName();
|
|
2216
2216
|
if (this.getOptionValue(optionKey) === void 0 || [
|
|
2217
2217
|
"default",
|
|
2218
2218
|
"config",
|
|
2219
2219
|
"env"
|
|
2220
|
-
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$
|
|
2220
|
+
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$4.env[option.envVar]);
|
|
2221
2221
|
else this.emit(`optionEnv:${option.name()}`);
|
|
2222
2222
|
}
|
|
2223
2223
|
});
|
|
@@ -2596,7 +2596,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2596
2596
|
*/
|
|
2597
2597
|
help(contextOptions) {
|
|
2598
2598
|
this.outputHelp(contextOptions);
|
|
2599
|
-
let exitCode = process$
|
|
2599
|
+
let exitCode = process$4.exitCode || 0;
|
|
2600
2600
|
if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
|
|
2601
2601
|
this._exit(exitCode, "commander.help", "(outputHelp)");
|
|
2602
2602
|
}
|
|
@@ -2712,16 +2712,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2712
2712
|
const CSI = `${ESC}[`;
|
|
2713
2713
|
const beep = "\x07";
|
|
2714
2714
|
const cursor = {
|
|
2715
|
-
to(x$2, y$
|
|
2716
|
-
if (!y$
|
|
2717
|
-
return `${CSI}${y$
|
|
2715
|
+
to(x$2, y$1) {
|
|
2716
|
+
if (!y$1) return `${CSI}${x$2 + 1}G`;
|
|
2717
|
+
return `${CSI}${y$1 + 1};${x$2 + 1}H`;
|
|
2718
2718
|
},
|
|
2719
|
-
move(x$2, y$
|
|
2719
|
+
move(x$2, y$1) {
|
|
2720
2720
|
let ret = "";
|
|
2721
2721
|
if (x$2 < 0) ret += `${CSI}${-x$2}D`;
|
|
2722
2722
|
else if (x$2 > 0) ret += `${CSI}${x$2}C`;
|
|
2723
|
-
if (y$
|
|
2724
|
-
else if (y$
|
|
2723
|
+
if (y$1 < 0) ret += `${CSI}${-y$1}A`;
|
|
2724
|
+
else if (y$1 > 0) ret += `${CSI}${y$1}B`;
|
|
2725
2725
|
return ret;
|
|
2726
2726
|
},
|
|
2727
2727
|
up: (count$1 = 1) => `${CSI}${count$1}A`,
|
|
@@ -3031,13 +3031,13 @@ function rD() {
|
|
|
3031
3031
|
}
|
|
3032
3032
|
}), r;
|
|
3033
3033
|
}
|
|
3034
|
-
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y
|
|
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) => {
|
|
3035
3035
|
const F$1 = [...u$2];
|
|
3036
3036
|
let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
|
|
3037
3037
|
for (const [C$1, n$1] of F$1.entries()) {
|
|
3038
3038
|
const E = p(n$1);
|
|
3039
3039
|
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
|
|
3040
|
+
i$1 ? n$1 === y && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
|
|
3041
3041
|
continue;
|
|
3042
3042
|
}
|
|
3043
3043
|
D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
|
|
@@ -3079,7 +3079,7 @@ const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y$1 = "\x07", V$1 = "["
|
|
|
3079
3079
|
`)];
|
|
3080
3080
|
for (const [E, a$1] of n$1.entries()) {
|
|
3081
3081
|
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
|
|
3082
|
+
const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y})`)).exec(n$1.slice(E).join("")) || { groups: {} };
|
|
3083
3083
|
if (c$1.code !== void 0) {
|
|
3084
3084
|
const f = Number.parseFloat(c$1.code);
|
|
3085
3085
|
s = f === oD ? void 0 : f;
|
|
@@ -3480,7 +3480,7 @@ var RD = class extends x$1 {
|
|
|
3480
3480
|
//#endregion
|
|
3481
3481
|
//#region node_modules/@clack/prompts/dist/index.mjs
|
|
3482
3482
|
function ce() {
|
|
3483
|
-
return
|
|
3483
|
+
return process$1.platform !== "win32" ? process$1.env.TERM !== "linux" : !!process$1.env.CI || !!process$1.env.WT_SESSION || !!process$1.env.TERMINUS_SUBLIME || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
3484
3484
|
}
|
|
3485
3485
|
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
3486
|
switch (t) {
|
|
@@ -4547,6 +4547,7 @@ const string$1 = (params) => {
|
|
|
4547
4547
|
};
|
|
4548
4548
|
const integer = /^-?\d+$/;
|
|
4549
4549
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
4550
|
+
const boolean$1 = /^(?:true|false)$/i;
|
|
4550
4551
|
const lowercase = /^[^A-Z]*$/;
|
|
4551
4552
|
const uppercase = /^[^a-z]*$/;
|
|
4552
4553
|
|
|
@@ -5325,6 +5326,24 @@ const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst,
|
|
|
5325
5326
|
$ZodCheckNumberFormat.init(inst, def);
|
|
5326
5327
|
$ZodNumber.init(inst, def);
|
|
5327
5328
|
});
|
|
5329
|
+
const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
5330
|
+
$ZodType.init(inst, def);
|
|
5331
|
+
inst._zod.pattern = boolean$1;
|
|
5332
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
5333
|
+
if (def.coerce) try {
|
|
5334
|
+
payload.value = Boolean(payload.value);
|
|
5335
|
+
} catch (_$2) {}
|
|
5336
|
+
const input = payload.value;
|
|
5337
|
+
if (typeof input === "boolean") return payload;
|
|
5338
|
+
payload.issues.push({
|
|
5339
|
+
expected: "boolean",
|
|
5340
|
+
code: "invalid_type",
|
|
5341
|
+
input,
|
|
5342
|
+
inst
|
|
5343
|
+
});
|
|
5344
|
+
return payload;
|
|
5345
|
+
};
|
|
5346
|
+
});
|
|
5328
5347
|
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
5329
5348
|
$ZodType.init(inst, def);
|
|
5330
5349
|
inst._zod.parse = (payload) => payload;
|
|
@@ -6379,6 +6398,13 @@ function _int(Class, params) {
|
|
|
6379
6398
|
});
|
|
6380
6399
|
}
|
|
6381
6400
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6401
|
+
function _boolean(Class, params) {
|
|
6402
|
+
return new Class({
|
|
6403
|
+
type: "boolean",
|
|
6404
|
+
...normalizeParams(params)
|
|
6405
|
+
});
|
|
6406
|
+
}
|
|
6407
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
6382
6408
|
function _unknown(Class) {
|
|
6383
6409
|
return new Class({ type: "unknown" });
|
|
6384
6410
|
}
|
|
@@ -6628,7 +6654,7 @@ function initializeContext(params) {
|
|
|
6628
6654
|
external: params?.external ?? void 0
|
|
6629
6655
|
};
|
|
6630
6656
|
}
|
|
6631
|
-
function process$
|
|
6657
|
+
function process$3(schema, ctx, _params = {
|
|
6632
6658
|
path: [],
|
|
6633
6659
|
schemaPath: []
|
|
6634
6660
|
}) {
|
|
@@ -6665,7 +6691,7 @@ function process$2(schema, ctx, _params = {
|
|
|
6665
6691
|
const parent = schema._zod.parent;
|
|
6666
6692
|
if (parent) {
|
|
6667
6693
|
if (!result.ref) result.ref = parent;
|
|
6668
|
-
process$
|
|
6694
|
+
process$3(parent, ctx, params);
|
|
6669
6695
|
ctx.seen.get(parent).isParent = true;
|
|
6670
6696
|
}
|
|
6671
6697
|
}
|
|
@@ -6877,7 +6903,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
6877
6903
|
...params,
|
|
6878
6904
|
processors
|
|
6879
6905
|
});
|
|
6880
|
-
process$
|
|
6906
|
+
process$3(schema, ctx);
|
|
6881
6907
|
extractDefs(ctx, schema);
|
|
6882
6908
|
return finalize(ctx, schema);
|
|
6883
6909
|
};
|
|
@@ -6889,7 +6915,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
6889
6915
|
io,
|
|
6890
6916
|
processors
|
|
6891
6917
|
});
|
|
6892
|
-
process$
|
|
6918
|
+
process$3(schema, ctx);
|
|
6893
6919
|
extractDefs(ctx, schema);
|
|
6894
6920
|
return finalize(ctx, schema);
|
|
6895
6921
|
};
|
|
@@ -6949,6 +6975,9 @@ const numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
6949
6975
|
}
|
|
6950
6976
|
if (typeof multipleOf === "number") json.multipleOf = multipleOf;
|
|
6951
6977
|
};
|
|
6978
|
+
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
6979
|
+
json.type = "boolean";
|
|
6980
|
+
};
|
|
6952
6981
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
6953
6982
|
json.not = {};
|
|
6954
6983
|
};
|
|
@@ -6973,7 +7002,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
6973
7002
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
6974
7003
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
6975
7004
|
json.type = "array";
|
|
6976
|
-
json.items = process$
|
|
7005
|
+
json.items = process$3(def.element, ctx, {
|
|
6977
7006
|
...params,
|
|
6978
7007
|
path: [...params.path, "items"]
|
|
6979
7008
|
});
|
|
@@ -6984,7 +7013,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
6984
7013
|
json.type = "object";
|
|
6985
7014
|
json.properties = {};
|
|
6986
7015
|
const shape = def.shape;
|
|
6987
|
-
for (const key in shape) json.properties[key] = process$
|
|
7016
|
+
for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
|
|
6988
7017
|
...params,
|
|
6989
7018
|
path: [
|
|
6990
7019
|
...params.path,
|
|
@@ -7002,7 +7031,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7002
7031
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
7003
7032
|
else if (!def.catchall) {
|
|
7004
7033
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
7005
|
-
} else if (def.catchall) json.additionalProperties = process$
|
|
7034
|
+
} else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
|
|
7006
7035
|
...params,
|
|
7007
7036
|
path: [...params.path, "additionalProperties"]
|
|
7008
7037
|
});
|
|
@@ -7010,7 +7039,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7010
7039
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
7011
7040
|
const def = schema._zod.def;
|
|
7012
7041
|
const isExclusive = def.inclusive === false;
|
|
7013
|
-
const options = def.options.map((x$2, i$1) => process$
|
|
7042
|
+
const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
|
|
7014
7043
|
...params,
|
|
7015
7044
|
path: [
|
|
7016
7045
|
...params.path,
|
|
@@ -7023,7 +7052,7 @@ const unionProcessor = (schema, ctx, json, params) => {
|
|
|
7023
7052
|
};
|
|
7024
7053
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
7025
7054
|
const def = schema._zod.def;
|
|
7026
|
-
const a$1 = process$
|
|
7055
|
+
const a$1 = process$3(def.left, ctx, {
|
|
7027
7056
|
...params,
|
|
7028
7057
|
path: [
|
|
7029
7058
|
...params.path,
|
|
@@ -7031,7 +7060,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
7031
7060
|
0
|
|
7032
7061
|
]
|
|
7033
7062
|
});
|
|
7034
|
-
const b$2 = process$
|
|
7063
|
+
const b$2 = process$3(def.right, ctx, {
|
|
7035
7064
|
...params,
|
|
7036
7065
|
path: [
|
|
7037
7066
|
...params.path,
|
|
@@ -7048,7 +7077,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7048
7077
|
json.type = "array";
|
|
7049
7078
|
const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
7050
7079
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
7051
|
-
const prefixItems = def.items.map((x$2, i$1) => process$
|
|
7080
|
+
const prefixItems = def.items.map((x$2, i$1) => process$3(x$2, ctx, {
|
|
7052
7081
|
...params,
|
|
7053
7082
|
path: [
|
|
7054
7083
|
...params.path,
|
|
@@ -7056,7 +7085,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7056
7085
|
i$1
|
|
7057
7086
|
]
|
|
7058
7087
|
}));
|
|
7059
|
-
const rest = def.rest ? process$
|
|
7088
|
+
const rest = def.rest ? process$3(def.rest, ctx, {
|
|
7060
7089
|
...params,
|
|
7061
7090
|
path: [
|
|
7062
7091
|
...params.path,
|
|
@@ -7082,7 +7111,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7082
7111
|
};
|
|
7083
7112
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
7084
7113
|
const def = schema._zod.def;
|
|
7085
|
-
const inner = process$
|
|
7114
|
+
const inner = process$3(def.innerType, ctx, params);
|
|
7086
7115
|
const seen = ctx.seen.get(schema);
|
|
7087
7116
|
if (ctx.target === "openapi-3.0") {
|
|
7088
7117
|
seen.ref = def.innerType;
|
|
@@ -7091,27 +7120,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
|
|
|
7091
7120
|
};
|
|
7092
7121
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
7093
7122
|
const def = schema._zod.def;
|
|
7094
|
-
process$
|
|
7123
|
+
process$3(def.innerType, ctx, params);
|
|
7095
7124
|
const seen = ctx.seen.get(schema);
|
|
7096
7125
|
seen.ref = def.innerType;
|
|
7097
7126
|
};
|
|
7098
7127
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
7099
7128
|
const def = schema._zod.def;
|
|
7100
|
-
process$
|
|
7129
|
+
process$3(def.innerType, ctx, params);
|
|
7101
7130
|
const seen = ctx.seen.get(schema);
|
|
7102
7131
|
seen.ref = def.innerType;
|
|
7103
7132
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7104
7133
|
};
|
|
7105
7134
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
7106
7135
|
const def = schema._zod.def;
|
|
7107
|
-
process$
|
|
7136
|
+
process$3(def.innerType, ctx, params);
|
|
7108
7137
|
const seen = ctx.seen.get(schema);
|
|
7109
7138
|
seen.ref = def.innerType;
|
|
7110
7139
|
if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7111
7140
|
};
|
|
7112
7141
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
7113
7142
|
const def = schema._zod.def;
|
|
7114
|
-
process$
|
|
7143
|
+
process$3(def.innerType, ctx, params);
|
|
7115
7144
|
const seen = ctx.seen.get(schema);
|
|
7116
7145
|
seen.ref = def.innerType;
|
|
7117
7146
|
let catchValue;
|
|
@@ -7125,20 +7154,20 @@ const catchProcessor = (schema, ctx, json, params) => {
|
|
|
7125
7154
|
const pipeProcessor = (schema, ctx, _json, params) => {
|
|
7126
7155
|
const def = schema._zod.def;
|
|
7127
7156
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
7128
|
-
process$
|
|
7157
|
+
process$3(innerType, ctx, params);
|
|
7129
7158
|
const seen = ctx.seen.get(schema);
|
|
7130
7159
|
seen.ref = innerType;
|
|
7131
7160
|
};
|
|
7132
7161
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
7133
7162
|
const def = schema._zod.def;
|
|
7134
|
-
process$
|
|
7163
|
+
process$3(def.innerType, ctx, params);
|
|
7135
7164
|
const seen = ctx.seen.get(schema);
|
|
7136
7165
|
seen.ref = def.innerType;
|
|
7137
7166
|
json.readOnly = true;
|
|
7138
7167
|
};
|
|
7139
7168
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
7140
7169
|
const def = schema._zod.def;
|
|
7141
|
-
process$
|
|
7170
|
+
process$3(def.innerType, ctx, params);
|
|
7142
7171
|
const seen = ctx.seen.get(schema);
|
|
7143
7172
|
seen.ref = def.innerType;
|
|
7144
7173
|
};
|
|
@@ -7472,6 +7501,14 @@ const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, d
|
|
|
7472
7501
|
function int(params) {
|
|
7473
7502
|
return _int(ZodNumberFormat, params);
|
|
7474
7503
|
}
|
|
7504
|
+
const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
7505
|
+
$ZodBoolean.init(inst, def);
|
|
7506
|
+
ZodType.init(inst, def);
|
|
7507
|
+
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
7508
|
+
});
|
|
7509
|
+
function boolean(params) {
|
|
7510
|
+
return _boolean(ZodBoolean, params);
|
|
7511
|
+
}
|
|
7475
7512
|
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
7476
7513
|
$ZodUnknown.init(inst, def);
|
|
7477
7514
|
ZodType.init(inst, def);
|
|
@@ -7863,6 +7900,19 @@ var AuthValidationError = class extends Error {
|
|
|
7863
7900
|
this.name = "AuthValidationError";
|
|
7864
7901
|
}
|
|
7865
7902
|
};
|
|
7903
|
+
var ConnectorApiError = class extends Error {
|
|
7904
|
+
constructor(message, cause) {
|
|
7905
|
+
super(message);
|
|
7906
|
+
this.cause = cause;
|
|
7907
|
+
this.name = "ConnectorApiError";
|
|
7908
|
+
}
|
|
7909
|
+
};
|
|
7910
|
+
var ConnectorValidationError = class extends Error {
|
|
7911
|
+
constructor(message) {
|
|
7912
|
+
super(message);
|
|
7913
|
+
this.name = "ConnectorValidationError";
|
|
7914
|
+
}
|
|
7915
|
+
};
|
|
7866
7916
|
|
|
7867
7917
|
//#endregion
|
|
7868
7918
|
//#region src/core/consts.ts
|
|
@@ -16156,7 +16206,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
|
|
|
16156
16206
|
};
|
|
16157
16207
|
const normalizeOptions$2 = (options = {}) => {
|
|
16158
16208
|
const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
|
|
16159
|
-
const cwd = toPath$1(options.cwd) ??
|
|
16209
|
+
const cwd = toPath$1(options.cwd) ?? process$1.cwd();
|
|
16160
16210
|
const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
|
|
16161
16211
|
return {
|
|
16162
16212
|
cwd,
|
|
@@ -16253,7 +16303,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
|
16253
16303
|
const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
|
|
16254
16304
|
return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
|
|
16255
16305
|
};
|
|
16256
|
-
const directoryToGlob = async (directoryPaths, { cwd =
|
|
16306
|
+
const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
|
|
16257
16307
|
return (await Promise.all(directoryPaths.map(async (directoryPath) => {
|
|
16258
16308
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16259
16309
|
directoryPath,
|
|
@@ -16267,7 +16317,7 @@ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extension
|
|
|
16267
16317
|
}) : directoryPath;
|
|
16268
16318
|
}))).flat();
|
|
16269
16319
|
};
|
|
16270
|
-
const directoryToGlobSync = (directoryPaths, { cwd =
|
|
16320
|
+
const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
|
|
16271
16321
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16272
16322
|
directoryPath,
|
|
16273
16323
|
files,
|
|
@@ -16363,7 +16413,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
|
|
|
16363
16413
|
};
|
|
16364
16414
|
const createFilterFunction = (isIgnored, cwd) => {
|
|
16365
16415
|
const seen = /* @__PURE__ */ new Set();
|
|
16366
|
-
const basePath = cwd ||
|
|
16416
|
+
const basePath = cwd || process$1.cwd();
|
|
16367
16417
|
const pathCache = /* @__PURE__ */ new Map();
|
|
16368
16418
|
return (fastGlobResult) => {
|
|
16369
16419
|
const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
|
|
@@ -30703,13 +30753,13 @@ var ansi_styles_default = ansiStyles;
|
|
|
30703
30753
|
|
|
30704
30754
|
//#endregion
|
|
30705
30755
|
//#region node_modules/chalk/source/vendor/supports-color/index.js
|
|
30706
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
30756
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
|
|
30707
30757
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
30708
30758
|
const position = argv.indexOf(prefix + flag);
|
|
30709
30759
|
const terminatorPosition = argv.indexOf("--");
|
|
30710
30760
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
30711
30761
|
}
|
|
30712
|
-
const { env } =
|
|
30762
|
+
const { env } = process$1;
|
|
30713
30763
|
let flagForceColor;
|
|
30714
30764
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
30715
30765
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
@@ -30742,7 +30792,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
30742
30792
|
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
30743
30793
|
const min = forceColor || 0;
|
|
30744
30794
|
if (env.TERM === "dumb") return min;
|
|
30745
|
-
if (
|
|
30795
|
+
if (process$1.platform === "win32") {
|
|
30746
30796
|
const osRelease = os.release().split(".");
|
|
30747
30797
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
30748
30798
|
return 1;
|
|
@@ -30955,7 +31005,10 @@ const theme = {
|
|
|
30955
31005
|
base44OrangeBackground: source_default.bgHex("#E86B3C"),
|
|
30956
31006
|
shinyOrange: source_default.hex("#FFD700"),
|
|
30957
31007
|
links: source_default.hex("#00D4FF"),
|
|
30958
|
-
white: source_default.white
|
|
31008
|
+
white: source_default.white,
|
|
31009
|
+
success: source_default.green,
|
|
31010
|
+
warning: source_default.yellow,
|
|
31011
|
+
error: source_default.red
|
|
30959
31012
|
},
|
|
30960
31013
|
styles: {
|
|
30961
31014
|
header: source_default.dim,
|
|
@@ -31481,9 +31534,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
|
|
|
31481
31534
|
//#region node_modules/execa/lib/utils/standard-stream.js
|
|
31482
31535
|
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
31483
31536
|
const STANDARD_STREAMS = [
|
|
31484
|
-
|
|
31485
|
-
|
|
31486
|
-
|
|
31537
|
+
process$1.stdin,
|
|
31538
|
+
process$1.stdout,
|
|
31539
|
+
process$1.stderr
|
|
31487
31540
|
];
|
|
31488
31541
|
const STANDARD_STREAMS_ALIASES = [
|
|
31489
31542
|
"stdin",
|
|
@@ -31608,9 +31661,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
31608
31661
|
//#endregion
|
|
31609
31662
|
//#region node_modules/is-unicode-supported/index.js
|
|
31610
31663
|
function isUnicodeSupported() {
|
|
31611
|
-
const { env: env$1 } =
|
|
31664
|
+
const { env: env$1 } = process$1;
|
|
31612
31665
|
const { TERM, TERM_PROGRAM } = env$1;
|
|
31613
|
-
if (
|
|
31666
|
+
if (process$1.platform !== "win32") return TERM !== "linux";
|
|
31614
31667
|
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";
|
|
31615
31668
|
}
|
|
31616
31669
|
|
|
@@ -32537,7 +32590,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
32537
32590
|
|
|
32538
32591
|
//#endregion
|
|
32539
32592
|
//#region node_modules/npm-run-path/index.js
|
|
32540
|
-
const npmRunPath = ({ cwd =
|
|
32593
|
+
const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
|
|
32541
32594
|
const cwdPath = path.resolve(toPath(cwd));
|
|
32542
32595
|
const result = [];
|
|
32543
32596
|
const pathParts = pathOption.split(path.delimiter);
|
|
@@ -32555,7 +32608,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
|
32555
32608
|
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
32556
32609
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
32557
32610
|
};
|
|
32558
|
-
const npmRunPathEnv = ({ env: env$1 =
|
|
32611
|
+
const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
|
|
32559
32612
|
env$1 = { ...env$1 };
|
|
32560
32613
|
const pathName = pathKey({ env: env$1 });
|
|
32561
32614
|
options.path = env$1[pathName];
|
|
@@ -33690,7 +33743,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
|
33690
33743
|
};
|
|
33691
33744
|
const getDefaultCwd = () => {
|
|
33692
33745
|
try {
|
|
33693
|
-
return
|
|
33746
|
+
return process$1.cwd();
|
|
33694
33747
|
} catch (error) {
|
|
33695
33748
|
error.message = `The current directory does not exist.\n${error.message}`;
|
|
33696
33749
|
throw error;
|
|
@@ -33725,7 +33778,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
33725
33778
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
33726
33779
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
33727
33780
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
33728
|
-
if (
|
|
33781
|
+
if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
33729
33782
|
return {
|
|
33730
33783
|
file,
|
|
33731
33784
|
commandArguments,
|
|
@@ -33752,7 +33805,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
|
|
|
33752
33805
|
});
|
|
33753
33806
|
const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
33754
33807
|
const env$1 = extendEnv ? {
|
|
33755
|
-
...
|
|
33808
|
+
...process$1.env,
|
|
33756
33809
|
...envOption
|
|
33757
33810
|
} : envOption;
|
|
33758
33811
|
if (preferLocal || node) return npmRunPathEnv({
|
|
@@ -34752,12 +34805,12 @@ const guessStreamDirection = {
|
|
|
34752
34805
|
}
|
|
34753
34806
|
};
|
|
34754
34807
|
const getStandardStreamDirection = (value) => {
|
|
34755
|
-
if ([0,
|
|
34808
|
+
if ([0, process$1.stdin].includes(value)) return "input";
|
|
34756
34809
|
if ([
|
|
34757
34810
|
1,
|
|
34758
34811
|
2,
|
|
34759
|
-
|
|
34760
|
-
|
|
34812
|
+
process$1.stdout,
|
|
34813
|
+
process$1.stderr
|
|
34761
34814
|
].includes(value)) return "output";
|
|
34762
34815
|
};
|
|
34763
34816
|
const DEFAULT_DIRECTION = "output";
|
|
@@ -35821,9 +35874,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
|
|
|
35821
35874
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
35822
35875
|
};
|
|
35823
35876
|
const getIpcExport = () => {
|
|
35824
|
-
const anyProcess =
|
|
35877
|
+
const anyProcess = process$1;
|
|
35825
35878
|
const isSubprocess = true;
|
|
35826
|
-
const ipc =
|
|
35879
|
+
const ipc = process$1.channel !== void 0;
|
|
35827
35880
|
return {
|
|
35828
35881
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
35829
35882
|
getCancelSignal: getCancelSignal$1.bind(void 0, {
|
|
@@ -36065,7 +36118,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
|
|
|
36065
36118
|
|
|
36066
36119
|
//#endregion
|
|
36067
36120
|
//#region node_modules/signal-exit/dist/mjs/index.js
|
|
36068
|
-
const processOk = (process$
|
|
36121
|
+
const processOk = (process$5) => !!process$5 && typeof process$5 === "object" && typeof process$5.removeListener === "function" && typeof process$5.emit === "function" && typeof process$5.reallyExit === "function" && typeof process$5.listeners === "function" && typeof process$5.kill === "function" && typeof process$5.pid === "number" && typeof process$5.on === "function";
|
|
36069
36122
|
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
36070
36123
|
const global$1 = globalThis;
|
|
36071
36124
|
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -36133,7 +36186,7 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
36133
36186
|
};
|
|
36134
36187
|
var SignalExit = class extends SignalExitBase {
|
|
36135
36188
|
/* c8 ignore start */
|
|
36136
|
-
#hupSig = process$
|
|
36189
|
+
#hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
36137
36190
|
/* c8 ignore stop */
|
|
36138
36191
|
#emitter = new Emitter();
|
|
36139
36192
|
#process;
|
|
@@ -36141,15 +36194,15 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36141
36194
|
#originalProcessReallyExit;
|
|
36142
36195
|
#sigListeners = {};
|
|
36143
36196
|
#loaded = false;
|
|
36144
|
-
constructor(process$
|
|
36197
|
+
constructor(process$5) {
|
|
36145
36198
|
super();
|
|
36146
|
-
this.#process = process$
|
|
36199
|
+
this.#process = process$5;
|
|
36147
36200
|
this.#sigListeners = {};
|
|
36148
36201
|
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
36149
36202
|
const listeners = this.#process.listeners(sig);
|
|
36150
36203
|
let { count: count$1 } = this.#emitter;
|
|
36151
36204
|
/* c8 ignore start */
|
|
36152
|
-
const p$1 = process$
|
|
36205
|
+
const p$1 = process$5;
|
|
36153
36206
|
if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
|
|
36154
36207
|
/* c8 ignore stop */
|
|
36155
36208
|
if (listeners.length === count$1) {
|
|
@@ -36157,11 +36210,11 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36157
36210
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
36158
36211
|
/* c8 ignore start */
|
|
36159
36212
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
36160
|
-
if (!ret) process$
|
|
36213
|
+
if (!ret) process$5.kill(process$5.pid, s);
|
|
36161
36214
|
}
|
|
36162
36215
|
};
|
|
36163
|
-
this.#originalProcessReallyExit = process$
|
|
36164
|
-
this.#originalProcessEmit = process$
|
|
36216
|
+
this.#originalProcessReallyExit = process$5.reallyExit;
|
|
36217
|
+
this.#originalProcessEmit = process$5.emit;
|
|
36165
36218
|
}
|
|
36166
36219
|
onExit(cb, opts) {
|
|
36167
36220
|
/* c8 ignore start */
|
|
@@ -36228,8 +36281,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36228
36281
|
} else return og.call(this.#process, ev, ...args);
|
|
36229
36282
|
}
|
|
36230
36283
|
};
|
|
36231
|
-
const process$
|
|
36232
|
-
const { onExit, load, unload } = signalExitWrap(processOk(process$
|
|
36284
|
+
const process$2 = globalThis.process;
|
|
36285
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
|
|
36233
36286
|
|
|
36234
36287
|
//#endregion
|
|
36235
36288
|
//#region node_modules/execa/lib/terminate/cleanup.js
|
|
@@ -38166,7 +38219,7 @@ function isInsideContainer() {
|
|
|
38166
38219
|
//#endregion
|
|
38167
38220
|
//#region node_modules/is-wsl/index.js
|
|
38168
38221
|
const isWsl = () => {
|
|
38169
|
-
if (
|
|
38222
|
+
if (process$1.platform !== "linux") return false;
|
|
38170
38223
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
38171
38224
|
if (isInsideContainer()) return false;
|
|
38172
38225
|
return true;
|
|
@@ -38177,12 +38230,12 @@ const isWsl = () => {
|
|
|
38177
38230
|
return false;
|
|
38178
38231
|
}
|
|
38179
38232
|
};
|
|
38180
|
-
var is_wsl_default =
|
|
38233
|
+
var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
38181
38234
|
|
|
38182
38235
|
//#endregion
|
|
38183
38236
|
//#region node_modules/powershell-utils/index.js
|
|
38184
38237
|
const execFile$2 = promisify(childProcess.execFile);
|
|
38185
|
-
const powerShellPath$1 = () => `${
|
|
38238
|
+
const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
38186
38239
|
const executePowerShell = async (command, options = {}) => {
|
|
38187
38240
|
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
38188
38241
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -38293,7 +38346,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
|
|
|
38293
38346
|
//#region node_modules/default-browser-id/index.js
|
|
38294
38347
|
const execFileAsync$3 = promisify(execFile);
|
|
38295
38348
|
async function defaultBrowserId() {
|
|
38296
|
-
if (
|
|
38349
|
+
if (process$1.platform !== "darwin") throw new Error("macOS only");
|
|
38297
38350
|
const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
|
|
38298
38351
|
"read",
|
|
38299
38352
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -38308,7 +38361,7 @@ async function defaultBrowserId() {
|
|
|
38308
38361
|
//#region node_modules/run-applescript/index.js
|
|
38309
38362
|
const execFileAsync$2 = promisify(execFile);
|
|
38310
38363
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
38311
|
-
if (
|
|
38364
|
+
if (process$1.platform !== "darwin") throw new Error("macOS only");
|
|
38312
38365
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
38313
38366
|
const execOptions = {};
|
|
38314
38367
|
if (signal) execOptions.signal = signal;
|
|
@@ -38417,14 +38470,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
|
38417
38470
|
const execFileAsync = promisify(execFile);
|
|
38418
38471
|
const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
|
|
38419
38472
|
async function defaultBrowser() {
|
|
38420
|
-
if (
|
|
38473
|
+
if (process$1.platform === "darwin") {
|
|
38421
38474
|
const id = await defaultBrowserId();
|
|
38422
38475
|
return {
|
|
38423
38476
|
name: await bundleName(id),
|
|
38424
38477
|
id
|
|
38425
38478
|
};
|
|
38426
38479
|
}
|
|
38427
|
-
if (
|
|
38480
|
+
if (process$1.platform === "linux") {
|
|
38428
38481
|
const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
|
|
38429
38482
|
"query",
|
|
38430
38483
|
"default",
|
|
@@ -38436,13 +38489,13 @@ async function defaultBrowser() {
|
|
|
38436
38489
|
id
|
|
38437
38490
|
};
|
|
38438
38491
|
}
|
|
38439
|
-
if (
|
|
38492
|
+
if (process$1.platform === "win32") return defaultBrowser$1();
|
|
38440
38493
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
38441
38494
|
}
|
|
38442
38495
|
|
|
38443
38496
|
//#endregion
|
|
38444
38497
|
//#region node_modules/is-in-ssh/index.js
|
|
38445
|
-
const isInSsh = Boolean(
|
|
38498
|
+
const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
|
|
38446
38499
|
var is_in_ssh_default = isInSsh;
|
|
38447
38500
|
|
|
38448
38501
|
//#endregion
|
|
@@ -38450,7 +38503,7 @@ var is_in_ssh_default = isInSsh;
|
|
|
38450
38503
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
38451
38504
|
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
38452
38505
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
38453
|
-
const { platform: platform$1, arch } =
|
|
38506
|
+
const { platform: platform$1, arch } = process$1;
|
|
38454
38507
|
const tryEachApp = async (apps$1, opener) => {
|
|
38455
38508
|
if (apps$1.length === 0) return;
|
|
38456
38509
|
const errors = [];
|
|
@@ -38563,7 +38616,7 @@ const baseOpen = async (options) => {
|
|
|
38563
38616
|
await fs$1.access(localXdgOpenPath, constants$1.X_OK);
|
|
38564
38617
|
exeLocalXdgOpen = true;
|
|
38565
38618
|
} catch {}
|
|
38566
|
-
command =
|
|
38619
|
+
command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
38567
38620
|
}
|
|
38568
38621
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
38569
38622
|
if (!options.wait) {
|
|
@@ -38789,6 +38842,410 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
|
|
|
38789
38842
|
await runCommand(() => deployAction(options), { requireAuth: true });
|
|
38790
38843
|
}));
|
|
38791
38844
|
|
|
38845
|
+
//#endregion
|
|
38846
|
+
//#region src/core/connectors/schema.ts
|
|
38847
|
+
/**
|
|
38848
|
+
* Response from POST /api/apps/{app_id}/external-auth/initiate
|
|
38849
|
+
*/
|
|
38850
|
+
const InitiateResponseSchema = object({
|
|
38851
|
+
redirect_url: string().optional(),
|
|
38852
|
+
connection_id: string().optional(),
|
|
38853
|
+
already_authorized: boolean().optional(),
|
|
38854
|
+
other_user_email: string().optional(),
|
|
38855
|
+
error: string().optional()
|
|
38856
|
+
});
|
|
38857
|
+
/**
|
|
38858
|
+
* Response from GET /api/apps/{app_id}/external-auth/status
|
|
38859
|
+
*/
|
|
38860
|
+
const StatusResponseSchema = object({
|
|
38861
|
+
status: _enum([
|
|
38862
|
+
"ACTIVE",
|
|
38863
|
+
"PENDING",
|
|
38864
|
+
"FAILED"
|
|
38865
|
+
]),
|
|
38866
|
+
account_email: string().optional(),
|
|
38867
|
+
error: string().optional()
|
|
38868
|
+
}).transform((data) => ({
|
|
38869
|
+
status: data.status,
|
|
38870
|
+
accountEmail: data.account_email,
|
|
38871
|
+
error: data.error
|
|
38872
|
+
}));
|
|
38873
|
+
/**
|
|
38874
|
+
* A connected integration from the list endpoint
|
|
38875
|
+
*/
|
|
38876
|
+
const ConnectorSchema = object({
|
|
38877
|
+
integration_type: string(),
|
|
38878
|
+
status: string(),
|
|
38879
|
+
connected_at: string().optional(),
|
|
38880
|
+
account_info: object({
|
|
38881
|
+
email: string().optional(),
|
|
38882
|
+
name: string().optional()
|
|
38883
|
+
}).optional()
|
|
38884
|
+
}).transform((data) => ({
|
|
38885
|
+
integrationType: data.integration_type,
|
|
38886
|
+
status: data.status,
|
|
38887
|
+
connectedAt: data.connected_at,
|
|
38888
|
+
accountInfo: data.account_info
|
|
38889
|
+
}));
|
|
38890
|
+
/**
|
|
38891
|
+
* Response from GET /api/apps/{app_id}/external-auth/list
|
|
38892
|
+
*/
|
|
38893
|
+
const ListResponseSchema = object({ integrations: array(ConnectorSchema) });
|
|
38894
|
+
/**
|
|
38895
|
+
* Generic API error response
|
|
38896
|
+
*/
|
|
38897
|
+
const ApiErrorSchema = object({
|
|
38898
|
+
error: string(),
|
|
38899
|
+
detail: string().optional()
|
|
38900
|
+
});
|
|
38901
|
+
|
|
38902
|
+
//#endregion
|
|
38903
|
+
//#region src/core/connectors/api.ts
|
|
38904
|
+
/**
|
|
38905
|
+
* Initiates OAuth flow for a connector integration.
|
|
38906
|
+
* Returns a redirect URL to open in the browser.
|
|
38907
|
+
*/
|
|
38908
|
+
async function initiateOAuth(integrationType, scopes = null) {
|
|
38909
|
+
const response = await getAppClient().post("external-auth/initiate", {
|
|
38910
|
+
json: {
|
|
38911
|
+
integration_type: integrationType,
|
|
38912
|
+
scopes
|
|
38913
|
+
},
|
|
38914
|
+
throwHttpErrors: false
|
|
38915
|
+
});
|
|
38916
|
+
const json = await response.json();
|
|
38917
|
+
if (!response.ok) {
|
|
38918
|
+
const errorResult = ApiErrorSchema.safeParse(json);
|
|
38919
|
+
if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
|
|
38920
|
+
throw new ConnectorApiError(`Failed to initiate OAuth: ${response.status} ${response.statusText}`);
|
|
38921
|
+
}
|
|
38922
|
+
const result = InitiateResponseSchema.safeParse(json);
|
|
38923
|
+
if (!result.success) throw new ConnectorValidationError(`Invalid initiate response from server: ${result.error.message}`);
|
|
38924
|
+
return result.data;
|
|
38925
|
+
}
|
|
38926
|
+
/**
|
|
38927
|
+
* Checks the status of an OAuth connection attempt.
|
|
38928
|
+
*/
|
|
38929
|
+
async function checkOAuthStatus(integrationType, connectionId) {
|
|
38930
|
+
const response = await getAppClient().get("external-auth/status", {
|
|
38931
|
+
searchParams: {
|
|
38932
|
+
integration_type: integrationType,
|
|
38933
|
+
connection_id: connectionId
|
|
38934
|
+
},
|
|
38935
|
+
throwHttpErrors: false
|
|
38936
|
+
});
|
|
38937
|
+
const json = await response.json();
|
|
38938
|
+
if (!response.ok) {
|
|
38939
|
+
const errorResult = ApiErrorSchema.safeParse(json);
|
|
38940
|
+
if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
|
|
38941
|
+
throw new ConnectorApiError(`Failed to check OAuth status: ${response.status} ${response.statusText}`);
|
|
38942
|
+
}
|
|
38943
|
+
const result = StatusResponseSchema.safeParse(json);
|
|
38944
|
+
if (!result.success) throw new ConnectorValidationError(`Invalid status response from server: ${result.error.message}`);
|
|
38945
|
+
return result.data;
|
|
38946
|
+
}
|
|
38947
|
+
/**
|
|
38948
|
+
* Lists all connected integrations for the current app.
|
|
38949
|
+
*/
|
|
38950
|
+
async function listConnectors() {
|
|
38951
|
+
const response = await getAppClient().get("external-auth/list", { throwHttpErrors: false });
|
|
38952
|
+
const json = await response.json();
|
|
38953
|
+
if (!response.ok) {
|
|
38954
|
+
const errorResult = ApiErrorSchema.safeParse(json);
|
|
38955
|
+
if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
|
|
38956
|
+
throw new ConnectorApiError(`Failed to list connectors: ${response.status} ${response.statusText}`);
|
|
38957
|
+
}
|
|
38958
|
+
const result = ListResponseSchema.safeParse(json);
|
|
38959
|
+
if (!result.success) throw new ConnectorValidationError(`Invalid list response from server: ${result.error.message}`);
|
|
38960
|
+
return result.data.integrations;
|
|
38961
|
+
}
|
|
38962
|
+
/**
|
|
38963
|
+
* Disconnects (soft delete) a connector integration.
|
|
38964
|
+
*/
|
|
38965
|
+
async function disconnectConnector(integrationType) {
|
|
38966
|
+
const response = await getAppClient().delete(`external-auth/integrations/${integrationType}`, { throwHttpErrors: false });
|
|
38967
|
+
if (!response.ok) {
|
|
38968
|
+
const json = await response.json();
|
|
38969
|
+
const errorResult = ApiErrorSchema.safeParse(json);
|
|
38970
|
+
if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
|
|
38971
|
+
throw new ConnectorApiError(`Failed to disconnect connector: ${response.status} ${response.statusText}`);
|
|
38972
|
+
}
|
|
38973
|
+
}
|
|
38974
|
+
/**
|
|
38975
|
+
* Removes (hard delete) a connector integration.
|
|
38976
|
+
* This permanently removes the connector and cannot be undone.
|
|
38977
|
+
*/
|
|
38978
|
+
async function removeConnector(integrationType) {
|
|
38979
|
+
const response = await getAppClient().delete(`external-auth/integrations/${integrationType}/remove`, { throwHttpErrors: false });
|
|
38980
|
+
if (!response.ok) {
|
|
38981
|
+
const json = await response.json();
|
|
38982
|
+
const errorResult = ApiErrorSchema.safeParse(json);
|
|
38983
|
+
if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
|
|
38984
|
+
throw new ConnectorApiError(`Failed to remove connector: ${response.status} ${response.statusText}`);
|
|
38985
|
+
}
|
|
38986
|
+
}
|
|
38987
|
+
|
|
38988
|
+
//#endregion
|
|
38989
|
+
//#region src/core/connectors/constants.ts
|
|
38990
|
+
/**
|
|
38991
|
+
* Supported OAuth connector integrations.
|
|
38992
|
+
* Based on apper/backend/app/external_auth/models/constants.py
|
|
38993
|
+
*/
|
|
38994
|
+
const SUPPORTED_INTEGRATIONS = [
|
|
38995
|
+
"googlecalendar",
|
|
38996
|
+
"googledrive",
|
|
38997
|
+
"gmail",
|
|
38998
|
+
"googlesheets",
|
|
38999
|
+
"googledocs",
|
|
39000
|
+
"googleslides",
|
|
39001
|
+
"slack",
|
|
39002
|
+
"notion",
|
|
39003
|
+
"salesforce",
|
|
39004
|
+
"hubspot",
|
|
39005
|
+
"linkedin",
|
|
39006
|
+
"tiktok"
|
|
39007
|
+
];
|
|
39008
|
+
/**
|
|
39009
|
+
* Display names for integrations (for CLI output)
|
|
39010
|
+
*/
|
|
39011
|
+
const INTEGRATION_DISPLAY_NAMES = {
|
|
39012
|
+
googlecalendar: "Google Calendar",
|
|
39013
|
+
googledrive: "Google Drive",
|
|
39014
|
+
gmail: "Gmail",
|
|
39015
|
+
googlesheets: "Google Sheets",
|
|
39016
|
+
googledocs: "Google Docs",
|
|
39017
|
+
googleslides: "Google Slides",
|
|
39018
|
+
slack: "Slack",
|
|
39019
|
+
notion: "Notion",
|
|
39020
|
+
salesforce: "Salesforce",
|
|
39021
|
+
hubspot: "HubSpot",
|
|
39022
|
+
linkedin: "LinkedIn",
|
|
39023
|
+
tiktok: "TikTok"
|
|
39024
|
+
};
|
|
39025
|
+
function isValidIntegration(type) {
|
|
39026
|
+
return SUPPORTED_INTEGRATIONS.includes(type);
|
|
39027
|
+
}
|
|
39028
|
+
function getIntegrationDisplayName(type) {
|
|
39029
|
+
if (isValidIntegration(type)) return INTEGRATION_DISPLAY_NAMES[type];
|
|
39030
|
+
return type;
|
|
39031
|
+
}
|
|
39032
|
+
|
|
39033
|
+
//#endregion
|
|
39034
|
+
//#region src/cli/commands/connectors/add.ts
|
|
39035
|
+
const POLL_INTERVAL_MS = 2e3;
|
|
39036
|
+
const POLL_TIMEOUT_MS = 300 * 1e3;
|
|
39037
|
+
async function promptForIntegrationType() {
|
|
39038
|
+
const selected = await ve({
|
|
39039
|
+
message: "Select an integration to connect:",
|
|
39040
|
+
options: SUPPORTED_INTEGRATIONS.map((type) => ({
|
|
39041
|
+
value: type,
|
|
39042
|
+
label: getIntegrationDisplayName(type)
|
|
39043
|
+
}))
|
|
39044
|
+
});
|
|
39045
|
+
if (pD(selected)) return null;
|
|
39046
|
+
return selected;
|
|
39047
|
+
}
|
|
39048
|
+
async function waitForOAuthCompletion(integrationType, connectionId) {
|
|
39049
|
+
let accountEmail;
|
|
39050
|
+
let error;
|
|
39051
|
+
try {
|
|
39052
|
+
await runTask("Waiting for authorization...", async (updateMessage) => {
|
|
39053
|
+
await pWaitFor(async () => {
|
|
39054
|
+
const status = await checkOAuthStatus(integrationType, connectionId);
|
|
39055
|
+
if (status.status === "ACTIVE") {
|
|
39056
|
+
accountEmail = status.accountEmail;
|
|
39057
|
+
return true;
|
|
39058
|
+
}
|
|
39059
|
+
if (status.status === "FAILED") {
|
|
39060
|
+
error = status.error || "Authorization failed";
|
|
39061
|
+
throw new Error(error);
|
|
39062
|
+
}
|
|
39063
|
+
updateMessage("Waiting for authorization in browser...");
|
|
39064
|
+
return false;
|
|
39065
|
+
}, {
|
|
39066
|
+
interval: POLL_INTERVAL_MS,
|
|
39067
|
+
timeout: POLL_TIMEOUT_MS
|
|
39068
|
+
});
|
|
39069
|
+
}, {
|
|
39070
|
+
successMessage: "Authorization completed!",
|
|
39071
|
+
errorMessage: "Authorization failed"
|
|
39072
|
+
});
|
|
39073
|
+
return {
|
|
39074
|
+
success: true,
|
|
39075
|
+
accountEmail
|
|
39076
|
+
};
|
|
39077
|
+
} catch (err) {
|
|
39078
|
+
if (err instanceof Error && err.message.includes("timed out")) return {
|
|
39079
|
+
success: false,
|
|
39080
|
+
error: "Authorization timed out. Please try again."
|
|
39081
|
+
};
|
|
39082
|
+
return {
|
|
39083
|
+
success: false,
|
|
39084
|
+
error: error || (err instanceof Error ? err.message : "Unknown error")
|
|
39085
|
+
};
|
|
39086
|
+
}
|
|
39087
|
+
}
|
|
39088
|
+
async function addConnector(integrationType) {
|
|
39089
|
+
let selectedType;
|
|
39090
|
+
if (!integrationType) {
|
|
39091
|
+
const prompted = await promptForIntegrationType();
|
|
39092
|
+
if (!prompted) return { outroMessage: "Cancelled" };
|
|
39093
|
+
selectedType = prompted;
|
|
39094
|
+
} else {
|
|
39095
|
+
if (!isValidIntegration(integrationType)) {
|
|
39096
|
+
const supportedList = SUPPORTED_INTEGRATIONS.join(", ");
|
|
39097
|
+
throw new Error(`Unsupported connector: ${integrationType}\nSupported connectors: ${supportedList}`);
|
|
39098
|
+
}
|
|
39099
|
+
selectedType = integrationType;
|
|
39100
|
+
}
|
|
39101
|
+
const displayName = getIntegrationDisplayName(selectedType);
|
|
39102
|
+
const initiateResponse = await runTask(`Initiating ${displayName} connection...`, async () => {
|
|
39103
|
+
return await initiateOAuth(selectedType);
|
|
39104
|
+
}, {
|
|
39105
|
+
successMessage: `${displayName} OAuth initiated`,
|
|
39106
|
+
errorMessage: `Failed to initiate ${displayName} connection`
|
|
39107
|
+
});
|
|
39108
|
+
if (initiateResponse.already_authorized) return { outroMessage: `Already connected to ${theme.styles.bold(displayName)}` };
|
|
39109
|
+
if (initiateResponse.error === "different_user" && initiateResponse.other_user_email) throw new Error(`This app is already connected to ${displayName} by ${initiateResponse.other_user_email}`);
|
|
39110
|
+
if (!initiateResponse.redirect_url || !initiateResponse.connection_id) throw new Error("Invalid response from server: missing redirect URL or connection ID");
|
|
39111
|
+
M.info(`Opening browser for ${displayName} authorization...`);
|
|
39112
|
+
await open_default(initiateResponse.redirect_url);
|
|
39113
|
+
const result = await waitForOAuthCompletion(selectedType, initiateResponse.connection_id);
|
|
39114
|
+
if (!result.success) throw new Error(result.error || "Authorization failed");
|
|
39115
|
+
const accountInfo = result.accountEmail ? ` as ${theme.styles.bold(result.accountEmail)}` : "";
|
|
39116
|
+
return { outroMessage: `Successfully connected to ${theme.styles.bold(displayName)}${accountInfo}` };
|
|
39117
|
+
}
|
|
39118
|
+
const connectorsAddCommand = new Command("connectors:add").argument("[type]", "Integration type (e.g., slack, notion, googlecalendar)").description("Connect an OAuth integration").action(async (type) => {
|
|
39119
|
+
await runCommand(() => addConnector(type), {
|
|
39120
|
+
requireAuth: true,
|
|
39121
|
+
requireAppConfig: true
|
|
39122
|
+
});
|
|
39123
|
+
});
|
|
39124
|
+
|
|
39125
|
+
//#endregion
|
|
39126
|
+
//#region src/cli/commands/connectors/list.ts
|
|
39127
|
+
function formatDate(dateString) {
|
|
39128
|
+
if (!dateString) return "-";
|
|
39129
|
+
try {
|
|
39130
|
+
return new Date(dateString).toLocaleDateString("en-US", {
|
|
39131
|
+
year: "numeric",
|
|
39132
|
+
month: "short",
|
|
39133
|
+
day: "numeric"
|
|
39134
|
+
});
|
|
39135
|
+
} catch {
|
|
39136
|
+
return dateString;
|
|
39137
|
+
}
|
|
39138
|
+
}
|
|
39139
|
+
function formatStatus(status) {
|
|
39140
|
+
const normalized = status.toLowerCase();
|
|
39141
|
+
if (normalized === "active" || normalized === "connected") return theme.colors.success("● active");
|
|
39142
|
+
if (normalized === "expired") return theme.colors.warning("● expired");
|
|
39143
|
+
if (normalized === "failed" || normalized === "disconnected") return theme.colors.error("● disconnected");
|
|
39144
|
+
return status;
|
|
39145
|
+
}
|
|
39146
|
+
async function listConnectorsCommand() {
|
|
39147
|
+
const connectors = await runTask("Fetching connectors...", async () => {
|
|
39148
|
+
return await listConnectors();
|
|
39149
|
+
}, {
|
|
39150
|
+
successMessage: "Connectors loaded",
|
|
39151
|
+
errorMessage: "Failed to fetch connectors"
|
|
39152
|
+
});
|
|
39153
|
+
if (connectors.length === 0) {
|
|
39154
|
+
M.info("No connectors configured for this app.");
|
|
39155
|
+
M.info(`Run ${theme.styles.bold("base44 connectors:add")} to connect an integration.`);
|
|
39156
|
+
return { outroMessage: "" };
|
|
39157
|
+
}
|
|
39158
|
+
console.log();
|
|
39159
|
+
console.log(theme.styles.bold("Connected Integrations:"));
|
|
39160
|
+
console.log();
|
|
39161
|
+
const headers = [
|
|
39162
|
+
"Type",
|
|
39163
|
+
"Account",
|
|
39164
|
+
"Status",
|
|
39165
|
+
"Connected"
|
|
39166
|
+
];
|
|
39167
|
+
const colWidths = [
|
|
39168
|
+
20,
|
|
39169
|
+
30,
|
|
39170
|
+
15,
|
|
39171
|
+
15
|
|
39172
|
+
];
|
|
39173
|
+
const headerRow = headers.map((h$2, i$1) => h$2.padEnd(colWidths[i$1])).join(" ");
|
|
39174
|
+
console.log(theme.styles.dim(headerRow));
|
|
39175
|
+
console.log(theme.styles.dim("─".repeat(headerRow.length)));
|
|
39176
|
+
for (const connector of connectors) {
|
|
39177
|
+
const type = getIntegrationDisplayName(connector.integrationType).padEnd(colWidths[0]);
|
|
39178
|
+
const account = (connector.accountInfo?.email || connector.accountInfo?.name || "-").padEnd(colWidths[1]);
|
|
39179
|
+
const status = formatStatus(connector.status);
|
|
39180
|
+
const connected = formatDate(connector.connectedAt).padEnd(colWidths[3]);
|
|
39181
|
+
console.log(`${type} ${account} ${status.padEnd(colWidths[2] + 10)} ${connected}`);
|
|
39182
|
+
}
|
|
39183
|
+
console.log();
|
|
39184
|
+
return { outroMessage: `${connectors.length} connector${connectors.length === 1 ? "" : "s"} configured` };
|
|
39185
|
+
}
|
|
39186
|
+
const connectorsListCommand = new Command("connectors:list").description("List all connected OAuth integrations").action(async () => {
|
|
39187
|
+
await runCommand(listConnectorsCommand, {
|
|
39188
|
+
requireAuth: true,
|
|
39189
|
+
requireAppConfig: true
|
|
39190
|
+
});
|
|
39191
|
+
});
|
|
39192
|
+
|
|
39193
|
+
//#endregion
|
|
39194
|
+
//#region src/cli/commands/connectors/remove.ts
|
|
39195
|
+
async function promptForConnectorToRemove(connectors) {
|
|
39196
|
+
const selected = await ve({
|
|
39197
|
+
message: "Select a connector to remove:",
|
|
39198
|
+
options: connectors.map((c$1) => ({
|
|
39199
|
+
value: c$1.integrationType,
|
|
39200
|
+
label: `${getIntegrationDisplayName(c$1.integrationType)}${c$1.accountInfo?.email ? ` (${c$1.accountInfo.email})` : ""}`
|
|
39201
|
+
}))
|
|
39202
|
+
});
|
|
39203
|
+
if (pD(selected)) return null;
|
|
39204
|
+
return selected;
|
|
39205
|
+
}
|
|
39206
|
+
async function removeConnectorCommand(integrationType, options = {}) {
|
|
39207
|
+
const isHardDelete = options.hard === true;
|
|
39208
|
+
const connectors = await runTask("Fetching connectors...", async () => {
|
|
39209
|
+
return await listConnectors();
|
|
39210
|
+
}, {
|
|
39211
|
+
successMessage: "Connectors loaded",
|
|
39212
|
+
errorMessage: "Failed to fetch connectors"
|
|
39213
|
+
});
|
|
39214
|
+
if (connectors.length === 0) return { outroMessage: "No connectors to remove" };
|
|
39215
|
+
let selectedType;
|
|
39216
|
+
if (!integrationType) {
|
|
39217
|
+
const prompted = await promptForConnectorToRemove(connectors);
|
|
39218
|
+
if (!prompted) return { outroMessage: "Cancelled" };
|
|
39219
|
+
selectedType = prompted;
|
|
39220
|
+
} else {
|
|
39221
|
+
if (!isValidIntegration(integrationType)) throw new Error(`Invalid connector type: ${integrationType}`);
|
|
39222
|
+
if (!connectors.some((c$1) => c$1.integrationType === integrationType)) throw new Error(`No ${getIntegrationDisplayName(integrationType)} connector found for this app`);
|
|
39223
|
+
selectedType = integrationType;
|
|
39224
|
+
}
|
|
39225
|
+
const displayName = getIntegrationDisplayName(selectedType);
|
|
39226
|
+
const connector = connectors.find((c$1) => c$1.integrationType === selectedType);
|
|
39227
|
+
const accountInfo = connector?.accountInfo?.email ? ` (${connector.accountInfo.email})` : "";
|
|
39228
|
+
const shouldRemove = await ye({
|
|
39229
|
+
message: `${isHardDelete ? "Permanently remove" : "Disconnect"} ${displayName}${accountInfo}?`,
|
|
39230
|
+
initialValue: false
|
|
39231
|
+
});
|
|
39232
|
+
if (pD(shouldRemove) || !shouldRemove) return { outroMessage: "Cancelled" };
|
|
39233
|
+
await runTask(isHardDelete ? `Removing ${displayName}...` : `Disconnecting ${displayName}...`, async () => {
|
|
39234
|
+
if (isHardDelete) await removeConnector(selectedType);
|
|
39235
|
+
else await disconnectConnector(selectedType);
|
|
39236
|
+
}, {
|
|
39237
|
+
successMessage: isHardDelete ? `${displayName} removed` : `${displayName} disconnected`,
|
|
39238
|
+
errorMessage: isHardDelete ? `Failed to remove ${displayName}` : `Failed to disconnect ${displayName}`
|
|
39239
|
+
});
|
|
39240
|
+
return { outroMessage: `Successfully ${isHardDelete ? "removed" : "disconnected"} ${theme.styles.bold(displayName)}` };
|
|
39241
|
+
}
|
|
39242
|
+
const connectorsRemoveCommand = new Command("connectors:remove").argument("[type]", "Integration type to remove (e.g., slack, notion)").option("--hard", "Permanently remove the connector (cannot be undone)").description("Disconnect an OAuth integration").action(async (type, options) => {
|
|
39243
|
+
await runCommand(() => removeConnectorCommand(type, options), {
|
|
39244
|
+
requireAuth: true,
|
|
39245
|
+
requireAppConfig: true
|
|
39246
|
+
});
|
|
39247
|
+
});
|
|
39248
|
+
|
|
38792
39249
|
//#endregion
|
|
38793
39250
|
//#region package.json
|
|
38794
39251
|
var version = "0.0.15";
|
|
@@ -38808,6 +39265,9 @@ program.addCommand(linkCommand);
|
|
|
38808
39265
|
program.addCommand(entitiesPushCommand);
|
|
38809
39266
|
program.addCommand(functionsDeployCommand);
|
|
38810
39267
|
program.addCommand(siteDeployCommand);
|
|
39268
|
+
program.addCommand(connectorsAddCommand);
|
|
39269
|
+
program.addCommand(connectorsListCommand);
|
|
39270
|
+
program.addCommand(connectorsRemoveCommand);
|
|
38811
39271
|
program.parse();
|
|
38812
39272
|
|
|
38813
39273
|
//#endregion
|
package/package.json
CHANGED