@base44-preview/cli 0.0.15-pr.100.7c491cf → 0.0.15-pr.102.d2fdfed

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.
Files changed (3) hide show
  1. package/README.md +93 -1
  2. package/dist/cli/index.js +562 -546
  3. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
  import { createRequire } from "node:module";
3
3
  import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
4
4
  import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
5
- import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
5
+ import path, { basename, dirname, join, posix, relative, resolve, win32 } from "node:path";
6
6
  import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
7
- import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
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$3 = __require("node: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$3.stdout.write(str),
949
- writeErr: (str) => process$3.stderr.write(str),
950
- getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
951
- getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
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$3.exit(exitCode);
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$3.versions?.electron) parseOptions.from = "electron";
1645
- const execArgv$1 = process$3.execArgv ?? [];
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$3.argv;
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$3.defaultApp) {
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$3.platform !== "win32") if (launchWithNode) {
1772
+ if (process$4.platform !== "win32") if (launchWithNode) {
1773
1773
  args.unshift(executableFile);
1774
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
1775
- proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
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$3.execArgv).concat(args);
1780
- proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
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$3.on(signal, () => {
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$3.exit(code$1);
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$3.exit(1);
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$3.env) {
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$3.env[option.envVar]);
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$3.exitCode || 0;
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$2) {
2716
- if (!y$2) return `${CSI}${x$2 + 1}G`;
2717
- return `${CSI}${y$2 + 1};${x$2 + 1}H`;
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$2) {
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$2 < 0) ret += `${CSI}${-y$2}A`;
2724
- else if (y$2 > 0) ret += `${CSI}${y$2}B`;
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$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) => {
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$1 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
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$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
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 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";
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,7 +4547,6 @@ 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;
4551
4550
  const lowercase = /^[^A-Z]*$/;
4552
4551
  const uppercase = /^[^a-z]*$/;
4553
4552
 
@@ -5326,24 +5325,6 @@ const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst,
5326
5325
  $ZodCheckNumberFormat.init(inst, def);
5327
5326
  $ZodNumber.init(inst, def);
5328
5327
  });
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
- });
5347
5328
  const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
5348
5329
  $ZodType.init(inst, def);
5349
5330
  inst._zod.parse = (payload) => payload;
@@ -5819,6 +5800,97 @@ function handleTupleResult(result, final, index) {
5819
5800
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
5820
5801
  final.value[index] = result.value;
5821
5802
  }
5803
+ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
5804
+ $ZodType.init(inst, def);
5805
+ inst._zod.parse = (payload, ctx) => {
5806
+ const input = payload.value;
5807
+ if (!isPlainObject$1(input)) {
5808
+ payload.issues.push({
5809
+ expected: "record",
5810
+ code: "invalid_type",
5811
+ input,
5812
+ inst
5813
+ });
5814
+ return payload;
5815
+ }
5816
+ const proms = [];
5817
+ const values = def.keyType._zod.values;
5818
+ if (values) {
5819
+ payload.value = {};
5820
+ const recordKeys = /* @__PURE__ */ new Set();
5821
+ for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
5822
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
5823
+ const result = def.valueType._zod.run({
5824
+ value: input[key],
5825
+ issues: []
5826
+ }, ctx);
5827
+ if (result instanceof Promise) proms.push(result.then((result$1) => {
5828
+ if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
5829
+ payload.value[key] = result$1.value;
5830
+ }));
5831
+ else {
5832
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
5833
+ payload.value[key] = result.value;
5834
+ }
5835
+ }
5836
+ let unrecognized;
5837
+ for (const key in input) if (!recordKeys.has(key)) {
5838
+ unrecognized = unrecognized ?? [];
5839
+ unrecognized.push(key);
5840
+ }
5841
+ if (unrecognized && unrecognized.length > 0) payload.issues.push({
5842
+ code: "unrecognized_keys",
5843
+ input,
5844
+ inst,
5845
+ keys: unrecognized
5846
+ });
5847
+ } else {
5848
+ payload.value = {};
5849
+ for (const key of Reflect.ownKeys(input)) {
5850
+ if (key === "__proto__") continue;
5851
+ let keyResult = def.keyType._zod.run({
5852
+ value: key,
5853
+ issues: []
5854
+ }, ctx);
5855
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
5856
+ if (typeof key === "string" && number$1.test(key) && keyResult.issues.length && keyResult.issues.some((iss) => iss.code === "invalid_type" && iss.expected === "number")) {
5857
+ const retryResult = def.keyType._zod.run({
5858
+ value: Number(key),
5859
+ issues: []
5860
+ }, ctx);
5861
+ if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
5862
+ if (retryResult.issues.length === 0) keyResult = retryResult;
5863
+ }
5864
+ if (keyResult.issues.length) {
5865
+ if (def.mode === "loose") payload.value[key] = input[key];
5866
+ else payload.issues.push({
5867
+ code: "invalid_key",
5868
+ origin: "record",
5869
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
5870
+ input: key,
5871
+ path: [key],
5872
+ inst
5873
+ });
5874
+ continue;
5875
+ }
5876
+ const result = def.valueType._zod.run({
5877
+ value: input[key],
5878
+ issues: []
5879
+ }, ctx);
5880
+ if (result instanceof Promise) proms.push(result.then((result$1) => {
5881
+ if (result$1.issues.length) payload.issues.push(...prefixIssues(key, result$1.issues));
5882
+ payload.value[keyResult.value] = result$1.value;
5883
+ }));
5884
+ else {
5885
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
5886
+ payload.value[keyResult.value] = result.value;
5887
+ }
5888
+ }
5889
+ }
5890
+ if (proms.length) return Promise.all(proms).then(() => payload);
5891
+ return payload;
5892
+ };
5893
+ });
5822
5894
  const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
5823
5895
  $ZodType.init(inst, def);
5824
5896
  const values = getEnumValues(def.entries);
@@ -5837,6 +5909,24 @@ const $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
5837
5909
  return payload;
5838
5910
  };
5839
5911
  });
5912
+ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
5913
+ $ZodType.init(inst, def);
5914
+ if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
5915
+ const values = new Set(def.values);
5916
+ inst._zod.values = values;
5917
+ inst._zod.pattern = /* @__PURE__ */ new RegExp(`^(${def.values.map((o$2) => typeof o$2 === "string" ? escapeRegex(o$2) : o$2 ? escapeRegex(o$2.toString()) : String(o$2)).join("|")})$`);
5918
+ inst._zod.parse = (payload, _ctx) => {
5919
+ const input = payload.value;
5920
+ if (values.has(input)) return payload;
5921
+ payload.issues.push({
5922
+ code: "invalid_value",
5923
+ values: def.values,
5924
+ input,
5925
+ inst
5926
+ });
5927
+ return payload;
5928
+ };
5929
+ });
5840
5930
  const $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
5841
5931
  $ZodType.init(inst, def);
5842
5932
  inst._zod.parse = (payload, ctx) => {
@@ -6398,13 +6488,6 @@ function _int(Class, params) {
6398
6488
  });
6399
6489
  }
6400
6490
  /* @__NO_SIDE_EFFECTS__ */
6401
- function _boolean(Class, params) {
6402
- return new Class({
6403
- type: "boolean",
6404
- ...normalizeParams(params)
6405
- });
6406
- }
6407
- /* @__NO_SIDE_EFFECTS__ */
6408
6491
  function _unknown(Class) {
6409
6492
  return new Class({ type: "unknown" });
6410
6493
  }
@@ -6654,7 +6737,7 @@ function initializeContext(params) {
6654
6737
  external: params?.external ?? void 0
6655
6738
  };
6656
6739
  }
6657
- function process$2(schema, ctx, _params = {
6740
+ function process$3(schema, ctx, _params = {
6658
6741
  path: [],
6659
6742
  schemaPath: []
6660
6743
  }) {
@@ -6691,7 +6774,7 @@ function process$2(schema, ctx, _params = {
6691
6774
  const parent = schema._zod.parent;
6692
6775
  if (parent) {
6693
6776
  if (!result.ref) result.ref = parent;
6694
- process$2(parent, ctx, params);
6777
+ process$3(parent, ctx, params);
6695
6778
  ctx.seen.get(parent).isParent = true;
6696
6779
  }
6697
6780
  }
@@ -6903,7 +6986,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6903
6986
  ...params,
6904
6987
  processors
6905
6988
  });
6906
- process$2(schema, ctx);
6989
+ process$3(schema, ctx);
6907
6990
  extractDefs(ctx, schema);
6908
6991
  return finalize(ctx, schema);
6909
6992
  };
@@ -6915,7 +6998,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6915
6998
  io,
6916
6999
  processors
6917
7000
  });
6918
- process$2(schema, ctx);
7001
+ process$3(schema, ctx);
6919
7002
  extractDefs(ctx, schema);
6920
7003
  return finalize(ctx, schema);
6921
7004
  };
@@ -6975,9 +7058,6 @@ const numberProcessor = (schema, ctx, _json, _params) => {
6975
7058
  }
6976
7059
  if (typeof multipleOf === "number") json.multipleOf = multipleOf;
6977
7060
  };
6978
- const booleanProcessor = (_schema, _ctx, json, _params) => {
6979
- json.type = "boolean";
6980
- };
6981
7061
  const neverProcessor = (_schema, _ctx, json, _params) => {
6982
7062
  json.not = {};
6983
7063
  };
@@ -6989,6 +7069,27 @@ const enumProcessor = (schema, _ctx, json, _params) => {
6989
7069
  if (values.every((v$1) => typeof v$1 === "string")) json.type = "string";
6990
7070
  json.enum = values;
6991
7071
  };
7072
+ const literalProcessor = (schema, ctx, json, _params) => {
7073
+ const def = schema._zod.def;
7074
+ const vals = [];
7075
+ for (const val of def.values) if (val === void 0) {
7076
+ if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
7077
+ } else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
7078
+ else vals.push(Number(val));
7079
+ else vals.push(val);
7080
+ if (vals.length === 0) {} else if (vals.length === 1) {
7081
+ const val = vals[0];
7082
+ json.type = val === null ? "null" : typeof val;
7083
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
7084
+ else json.const = val;
7085
+ } else {
7086
+ if (vals.every((v$1) => typeof v$1 === "number")) json.type = "number";
7087
+ if (vals.every((v$1) => typeof v$1 === "string")) json.type = "string";
7088
+ if (vals.every((v$1) => typeof v$1 === "boolean")) json.type = "boolean";
7089
+ if (vals.every((v$1) => v$1 === null)) json.type = "null";
7090
+ json.enum = vals;
7091
+ }
7092
+ };
6992
7093
  const customProcessor = (_schema, ctx, _json, _params) => {
6993
7094
  if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
6994
7095
  };
@@ -7002,7 +7103,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
7002
7103
  if (typeof minimum === "number") json.minItems = minimum;
7003
7104
  if (typeof maximum === "number") json.maxItems = maximum;
7004
7105
  json.type = "array";
7005
- json.items = process$2(def.element, ctx, {
7106
+ json.items = process$3(def.element, ctx, {
7006
7107
  ...params,
7007
7108
  path: [...params.path, "items"]
7008
7109
  });
@@ -7013,7 +7114,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7013
7114
  json.type = "object";
7014
7115
  json.properties = {};
7015
7116
  const shape = def.shape;
7016
- for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
7117
+ for (const key in shape) json.properties[key] = process$3(shape[key], ctx, {
7017
7118
  ...params,
7018
7119
  path: [
7019
7120
  ...params.path,
@@ -7031,7 +7132,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7031
7132
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
7032
7133
  else if (!def.catchall) {
7033
7134
  if (ctx.io === "output") json.additionalProperties = false;
7034
- } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
7135
+ } else if (def.catchall) json.additionalProperties = process$3(def.catchall, ctx, {
7035
7136
  ...params,
7036
7137
  path: [...params.path, "additionalProperties"]
7037
7138
  });
@@ -7039,7 +7140,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
7039
7140
  const unionProcessor = (schema, ctx, json, params) => {
7040
7141
  const def = schema._zod.def;
7041
7142
  const isExclusive = def.inclusive === false;
7042
- const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
7143
+ const options = def.options.map((x$2, i$1) => process$3(x$2, ctx, {
7043
7144
  ...params,
7044
7145
  path: [
7045
7146
  ...params.path,
@@ -7052,7 +7153,7 @@ const unionProcessor = (schema, ctx, json, params) => {
7052
7153
  };
7053
7154
  const intersectionProcessor = (schema, ctx, json, params) => {
7054
7155
  const def = schema._zod.def;
7055
- const a$1 = process$2(def.left, ctx, {
7156
+ const a$1 = process$3(def.left, ctx, {
7056
7157
  ...params,
7057
7158
  path: [
7058
7159
  ...params.path,
@@ -7060,7 +7161,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
7060
7161
  0
7061
7162
  ]
7062
7163
  });
7063
- const b$2 = process$2(def.right, ctx, {
7164
+ const b$2 = process$3(def.right, ctx, {
7064
7165
  ...params,
7065
7166
  path: [
7066
7167
  ...params.path,
@@ -7077,7 +7178,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7077
7178
  json.type = "array";
7078
7179
  const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
7079
7180
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
7080
- const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
7181
+ const prefixItems = def.items.map((x$2, i$1) => process$3(x$2, ctx, {
7081
7182
  ...params,
7082
7183
  path: [
7083
7184
  ...params.path,
@@ -7085,7 +7186,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7085
7186
  i$1
7086
7187
  ]
7087
7188
  }));
7088
- const rest = def.rest ? process$2(def.rest, ctx, {
7189
+ const rest = def.rest ? process$3(def.rest, ctx, {
7089
7190
  ...params,
7090
7191
  path: [
7091
7192
  ...params.path,
@@ -7109,9 +7210,42 @@ const tupleProcessor = (schema, ctx, _json, params) => {
7109
7210
  if (typeof minimum === "number") json.minItems = minimum;
7110
7211
  if (typeof maximum === "number") json.maxItems = maximum;
7111
7212
  };
7213
+ const recordProcessor = (schema, ctx, _json, params) => {
7214
+ const json = _json;
7215
+ const def = schema._zod.def;
7216
+ json.type = "object";
7217
+ const keyType = def.keyType;
7218
+ const patterns = keyType._zod.bag?.patterns;
7219
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
7220
+ const valueSchema = process$3(def.valueType, ctx, {
7221
+ ...params,
7222
+ path: [
7223
+ ...params.path,
7224
+ "patternProperties",
7225
+ "*"
7226
+ ]
7227
+ });
7228
+ json.patternProperties = {};
7229
+ for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
7230
+ } else {
7231
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$3(def.keyType, ctx, {
7232
+ ...params,
7233
+ path: [...params.path, "propertyNames"]
7234
+ });
7235
+ json.additionalProperties = process$3(def.valueType, ctx, {
7236
+ ...params,
7237
+ path: [...params.path, "additionalProperties"]
7238
+ });
7239
+ }
7240
+ const keyValues = keyType._zod.values;
7241
+ if (keyValues) {
7242
+ const validKeyValues = [...keyValues].filter((v$1) => typeof v$1 === "string" || typeof v$1 === "number");
7243
+ if (validKeyValues.length > 0) json.required = validKeyValues;
7244
+ }
7245
+ };
7112
7246
  const nullableProcessor = (schema, ctx, json, params) => {
7113
7247
  const def = schema._zod.def;
7114
- const inner = process$2(def.innerType, ctx, params);
7248
+ const inner = process$3(def.innerType, ctx, params);
7115
7249
  const seen = ctx.seen.get(schema);
7116
7250
  if (ctx.target === "openapi-3.0") {
7117
7251
  seen.ref = def.innerType;
@@ -7120,27 +7254,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
7120
7254
  };
7121
7255
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
7122
7256
  const def = schema._zod.def;
7123
- process$2(def.innerType, ctx, params);
7257
+ process$3(def.innerType, ctx, params);
7124
7258
  const seen = ctx.seen.get(schema);
7125
7259
  seen.ref = def.innerType;
7126
7260
  };
7127
7261
  const defaultProcessor = (schema, ctx, json, params) => {
7128
7262
  const def = schema._zod.def;
7129
- process$2(def.innerType, ctx, params);
7263
+ process$3(def.innerType, ctx, params);
7130
7264
  const seen = ctx.seen.get(schema);
7131
7265
  seen.ref = def.innerType;
7132
7266
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7133
7267
  };
7134
7268
  const prefaultProcessor = (schema, ctx, json, params) => {
7135
7269
  const def = schema._zod.def;
7136
- process$2(def.innerType, ctx, params);
7270
+ process$3(def.innerType, ctx, params);
7137
7271
  const seen = ctx.seen.get(schema);
7138
7272
  seen.ref = def.innerType;
7139
7273
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7140
7274
  };
7141
7275
  const catchProcessor = (schema, ctx, json, params) => {
7142
7276
  const def = schema._zod.def;
7143
- process$2(def.innerType, ctx, params);
7277
+ process$3(def.innerType, ctx, params);
7144
7278
  const seen = ctx.seen.get(schema);
7145
7279
  seen.ref = def.innerType;
7146
7280
  let catchValue;
@@ -7154,20 +7288,20 @@ const catchProcessor = (schema, ctx, json, params) => {
7154
7288
  const pipeProcessor = (schema, ctx, _json, params) => {
7155
7289
  const def = schema._zod.def;
7156
7290
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7157
- process$2(innerType, ctx, params);
7291
+ process$3(innerType, ctx, params);
7158
7292
  const seen = ctx.seen.get(schema);
7159
7293
  seen.ref = innerType;
7160
7294
  };
7161
7295
  const readonlyProcessor = (schema, ctx, json, params) => {
7162
7296
  const def = schema._zod.def;
7163
- process$2(def.innerType, ctx, params);
7297
+ process$3(def.innerType, ctx, params);
7164
7298
  const seen = ctx.seen.get(schema);
7165
7299
  seen.ref = def.innerType;
7166
7300
  json.readOnly = true;
7167
7301
  };
7168
7302
  const optionalProcessor = (schema, ctx, _json, params) => {
7169
7303
  const def = schema._zod.def;
7170
- process$2(def.innerType, ctx, params);
7304
+ process$3(def.innerType, ctx, params);
7171
7305
  const seen = ctx.seen.get(schema);
7172
7306
  seen.ref = def.innerType;
7173
7307
  };
@@ -7501,14 +7635,6 @@ const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, d
7501
7635
  function int(params) {
7502
7636
  return _int(ZodNumberFormat, params);
7503
7637
  }
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
- }
7512
7638
  const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
7513
7639
  $ZodUnknown.init(inst, def);
7514
7640
  ZodType.init(inst, def);
@@ -7638,6 +7764,21 @@ function tuple(items, _paramsOrRest, _params) {
7638
7764
  ...normalizeParams(params)
7639
7765
  });
7640
7766
  }
7767
+ const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
7768
+ $ZodRecord.init(inst, def);
7769
+ ZodType.init(inst, def);
7770
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
7771
+ inst.keyType = def.keyType;
7772
+ inst.valueType = def.valueType;
7773
+ });
7774
+ function record(keyType, valueType, params) {
7775
+ return new ZodRecord({
7776
+ type: "record",
7777
+ keyType,
7778
+ valueType,
7779
+ ...normalizeParams(params)
7780
+ });
7781
+ }
7641
7782
  const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
7642
7783
  $ZodEnum.init(inst, def);
7643
7784
  ZodType.init(inst, def);
@@ -7675,6 +7816,23 @@ function _enum(values, params) {
7675
7816
  ...normalizeParams(params)
7676
7817
  });
7677
7818
  }
7819
+ const ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
7820
+ $ZodLiteral.init(inst, def);
7821
+ ZodType.init(inst, def);
7822
+ inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
7823
+ inst.values = new Set(def.values);
7824
+ Object.defineProperty(inst, "value", { get() {
7825
+ if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
7826
+ return def.values[0];
7827
+ } });
7828
+ });
7829
+ function literal(value, params) {
7830
+ return new ZodLiteral({
7831
+ type: "literal",
7832
+ values: Array.isArray(value) ? value : [value],
7833
+ ...normalizeParams(params)
7834
+ });
7835
+ }
7678
7836
  const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
7679
7837
  $ZodTransform.init(inst, def);
7680
7838
  ZodType.init(inst, def);
@@ -7900,19 +8058,6 @@ var AuthValidationError = class extends Error {
7900
8058
  this.name = "AuthValidationError";
7901
8059
  }
7902
8060
  };
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
- };
7916
8061
 
7917
8062
  //#endregion
7918
8063
  //#region src/core/consts.ts
@@ -13637,10 +13782,10 @@ var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
13637
13782
  exports.removeDuplicateSlashes = removeDuplicateSlashes;
13638
13783
  function partitionAbsoluteAndRelative(patterns) {
13639
13784
  const absolute = [];
13640
- const relative = [];
13785
+ const relative$1 = [];
13641
13786
  for (const pattern of patterns) if (isAbsolute(pattern)) absolute.push(pattern);
13642
- else relative.push(pattern);
13643
- return [absolute, relative];
13787
+ else relative$1.push(pattern);
13788
+ return [absolute, relative$1];
13644
13789
  }
13645
13790
  exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
13646
13791
  function isAbsolute(pattern) {
@@ -16206,7 +16351,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
16206
16351
  };
16207
16352
  const normalizeOptions$2 = (options = {}) => {
16208
16353
  const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
16209
- const cwd = toPath$1(options.cwd) ?? y.cwd();
16354
+ const cwd = toPath$1(options.cwd) ?? process$1.cwd();
16210
16355
  const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
16211
16356
  return {
16212
16357
  cwd,
@@ -16303,7 +16448,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
16303
16448
  const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
16304
16449
  return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
16305
16450
  };
16306
- const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16451
+ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => {
16307
16452
  return (await Promise.all(directoryPaths.map(async (directoryPath) => {
16308
16453
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16309
16454
  directoryPath,
@@ -16317,7 +16462,7 @@ const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extension
16317
16462
  }) : directoryPath;
16318
16463
  }))).flat();
16319
16464
  };
16320
- const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16465
+ const directoryToGlobSync = (directoryPaths, { cwd = process$1.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
16321
16466
  if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
16322
16467
  directoryPath,
16323
16468
  files,
@@ -16413,7 +16558,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
16413
16558
  };
16414
16559
  const createFilterFunction = (isIgnored, cwd) => {
16415
16560
  const seen = /* @__PURE__ */ new Set();
16416
- const basePath = cwd || y.cwd();
16561
+ const basePath = cwd || process$1.cwd();
16417
16562
  const pathCache = /* @__PURE__ */ new Map();
16418
16563
  return (fastGlobResult) => {
16419
16564
  const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
@@ -28065,7 +28210,7 @@ const FILE$1 = Symbol("file");
28065
28210
  const DIRECTORY$1 = Symbol("directory");
28066
28211
  const SYMLINK$1 = Symbol("symlink");
28067
28212
  const HARDLINK$1 = Symbol("hardlink");
28068
- const HEADER = Symbol("header");
28213
+ const HEADER$1 = Symbol("header");
28069
28214
  const READ = Symbol("read");
28070
28215
  const LSTAT = Symbol("lstat");
28071
28216
  const ONLSTAT = Symbol("onlstat");
@@ -28184,7 +28329,7 @@ var WriteEntry = class extends Minipass {
28184
28329
  [PREFIX](path$16) {
28185
28330
  return prefixPath(path$16, this.prefix);
28186
28331
  }
28187
- [HEADER]() {
28332
+ [HEADER$1]() {
28188
28333
  /* c8 ignore start */
28189
28334
  if (!this.stat) throw new Error("cannot write header before stat");
28190
28335
  /* c8 ignore stop */
@@ -28229,7 +28374,7 @@ var WriteEntry = class extends Minipass {
28229
28374
  /* c8 ignore stop */
28230
28375
  if (this.path.slice(-1) !== "/") this.path += "/";
28231
28376
  this.stat.size = 0;
28232
- this[HEADER]();
28377
+ this[HEADER$1]();
28233
28378
  this.end();
28234
28379
  }
28235
28380
  [SYMLINK$1]() {
@@ -28240,7 +28385,7 @@ var WriteEntry = class extends Minipass {
28240
28385
  }
28241
28386
  [ONREADLINK](linkpath) {
28242
28387
  this.linkpath = normalizeWindowsPath(linkpath);
28243
- this[HEADER]();
28388
+ this[HEADER$1]();
28244
28389
  this.end();
28245
28390
  }
28246
28391
  [HARDLINK$1](linkpath) {
@@ -28250,7 +28395,7 @@ var WriteEntry = class extends Minipass {
28250
28395
  this.type = "Link";
28251
28396
  this.linkpath = normalizeWindowsPath(path$1.relative(this.cwd, linkpath));
28252
28397
  this.stat.size = 0;
28253
- this[HEADER]();
28398
+ this[HEADER$1]();
28254
28399
  this.end();
28255
28400
  }
28256
28401
  [FILE$1]() {
@@ -28263,7 +28408,7 @@ var WriteEntry = class extends Minipass {
28263
28408
  if (linkpath?.indexOf(this.cwd) === 0) return this[HARDLINK$1](linkpath);
28264
28409
  this.linkCache.set(linkKey, this.absolute);
28265
28410
  }
28266
- this[HEADER]();
28411
+ this[HEADER$1]();
28267
28412
  if (this.stat.size === 0) return this.end();
28268
28413
  this[OPENFILE]();
28269
28414
  }
@@ -30753,13 +30898,13 @@ var ansi_styles_default = ansiStyles;
30753
30898
 
30754
30899
  //#endregion
30755
30900
  //#region node_modules/chalk/source/vendor/supports-color/index.js
30756
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
30901
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process$1.argv) {
30757
30902
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
30758
30903
  const position = argv.indexOf(prefix + flag);
30759
30904
  const terminatorPosition = argv.indexOf("--");
30760
30905
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
30761
30906
  }
30762
- const { env } = y;
30907
+ const { env } = process$1;
30763
30908
  let flagForceColor;
30764
30909
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
30765
30910
  else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
@@ -30792,7 +30937,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
30792
30937
  if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
30793
30938
  const min = forceColor || 0;
30794
30939
  if (env.TERM === "dumb") return min;
30795
- if (y.platform === "win32") {
30940
+ if (process$1.platform === "win32") {
30796
30941
  const osRelease = os.release().split(".");
30797
30942
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
30798
30943
  return 1;
@@ -31005,10 +31150,7 @@ const theme = {
31005
31150
  base44OrangeBackground: source_default.bgHex("#E86B3C"),
31006
31151
  shinyOrange: source_default.hex("#FFD700"),
31007
31152
  links: source_default.hex("#00D4FF"),
31008
- white: source_default.white,
31009
- success: source_default.green,
31010
- warning: source_default.yellow,
31011
- error: source_default.red
31153
+ white: source_default.white
31012
31154
  },
31013
31155
  styles: {
31014
31156
  header: source_default.dim,
@@ -31319,6 +31461,237 @@ const logoutCommand = new Command("logout").description("Logout from current dev
31319
31461
  await runCommand(logout, { requireAppConfig: false });
31320
31462
  });
31321
31463
 
31464
+ //#endregion
31465
+ //#region src/core/generate/schema.ts
31466
+ /**
31467
+ * Schema for a full entity definition
31468
+ * Uses loose validation to allow JSON Schema flexibility
31469
+ */
31470
+ const EntityDefinitionSchema = object({
31471
+ name: string().min(1, "Entity name cannot be empty"),
31472
+ type: literal("object").optional(),
31473
+ properties: record(string(), unknown()).optional(),
31474
+ required: array(string()).optional()
31475
+ }).passthrough();
31476
+
31477
+ //#endregion
31478
+ //#region src/core/generate/generator.ts
31479
+ const HEADER = `// Auto-generated by Base44 CLI - DO NOT EDIT
31480
+ // Regenerate with: base44 types
31481
+ `;
31482
+ /**
31483
+ * Convert a JSON Schema type to TypeScript type
31484
+ */
31485
+ function fieldToTypeScript(field, required$1) {
31486
+ let tsType;
31487
+ if (field.enum && field.enum.length > 0) tsType = field.enum.map((v$1) => `'${v$1}'`).join(" | ");
31488
+ else switch (field.type) {
31489
+ case "string":
31490
+ tsType = "string";
31491
+ break;
31492
+ case "number":
31493
+ tsType = "number";
31494
+ break;
31495
+ case "boolean":
31496
+ tsType = "boolean";
31497
+ break;
31498
+ case "array":
31499
+ if (field.items) tsType = `${fieldToTypeScript(field.items, true)}[]`;
31500
+ else tsType = "unknown[]";
31501
+ break;
31502
+ case "object":
31503
+ if (field.properties) tsType = `{ ${Object.entries(field.properties).map(([name$1, prop]) => {
31504
+ const isRequired = field.required?.includes(name$1) ?? false;
31505
+ const propType = fieldToTypeScript(prop, isRequired);
31506
+ return `${name$1}${isRequired ? "" : "?"}: ${propType}`;
31507
+ }).join("; ")} }`;
31508
+ else tsType = "Record<string, unknown>";
31509
+ break;
31510
+ default: tsType = "unknown";
31511
+ }
31512
+ return tsType;
31513
+ }
31514
+ /**
31515
+ * Generate interface fields for an entity
31516
+ */
31517
+ function generateInterfaceFields(entity, options = {}) {
31518
+ if (!entity.properties) return "";
31519
+ const requiredFields = new Set(entity.required ?? []);
31520
+ return Object.entries(entity.properties).map(([fieldName, field]) => {
31521
+ const isRequired = options.allOptional ? false : requiredFields.has(fieldName);
31522
+ const tsType = fieldToTypeScript(field, isRequired);
31523
+ const optional$1 = isRequired ? "" : "?";
31524
+ return `${field.description ? ` /** ${field.description} */\n` : ""} ${fieldName}${optional$1}: ${tsType};`;
31525
+ }).join("\n");
31526
+ }
31527
+ /**
31528
+ * Generate TypeScript interfaces for a single entity
31529
+ */
31530
+ function generateEntityTypes(entity) {
31531
+ const name$1 = entity.name;
31532
+ return `
31533
+ /** ${name$1} entity */
31534
+ export interface ${name$1} extends BaseEntity {
31535
+ ${generateInterfaceFields(entity)}
31536
+ }
31537
+
31538
+ /** Input for creating a ${name$1} */
31539
+ export interface ${name$1}CreateInput {
31540
+ ${generateInterfaceFields(entity)}
31541
+ }
31542
+
31543
+ /** Input for updating a ${name$1} (all fields optional) */
31544
+ export interface ${name$1}UpdateInput {
31545
+ ${generateInterfaceFields(entity, { allOptional: true })}
31546
+ }
31547
+
31548
+ /** Filter query for ${name$1} */
31549
+ export interface ${name$1}Filter {
31550
+ ${generateInterfaceFields(entity, { allOptional: true })}
31551
+ }
31552
+ `;
31553
+ }
31554
+ /**
31555
+ * Generate the entities.ts file content
31556
+ */
31557
+ function generateEntitiesFile(entities) {
31558
+ const baseEntity = `
31559
+ /** System fields present on all entities */
31560
+ export interface BaseEntity {
31561
+ id: string;
31562
+ created_date: string;
31563
+ updated_date: string;
31564
+ }
31565
+ `;
31566
+ const entityTypes = entities.map(generateEntityTypes).join("\n");
31567
+ const entityNames = entities.map((e$1) => `'${e$1.name}'`).join(" | ");
31568
+ const entityNamesType = entities.length > 0 ? `\n/** All entity names in this project */\nexport type EntityName = ${entityNames};\n` : "";
31569
+ return HEADER + baseEntity + entityTypes + entityNamesType;
31570
+ }
31571
+ /**
31572
+ * Generate the client.ts file content with typed SDK wrapper
31573
+ */
31574
+ function generateClientFile(entities) {
31575
+ if (entities.length === 0) return HEADER + "\n// No entities found\nexport {};\n";
31576
+ return `${HEADER}
31577
+ import type {
31578
+ ${entities.map((e$1) => `${e$1.name}, ${e$1.name}CreateInput, ${e$1.name}UpdateInput, ${e$1.name}Filter`).join(",\n ")}
31579
+ } from './entities.js';
31580
+
31581
+ /** Response for list/filter operations */
31582
+ export interface ListResponse<T> {
31583
+ items: T[];
31584
+ total: number;
31585
+ }
31586
+
31587
+ /** Real-time subscription event */
31588
+ export interface RealtimeEvent<T> {
31589
+ type: 'create' | 'update' | 'delete';
31590
+ data: T;
31591
+ id: string;
31592
+ timestamp: string;
31593
+ }
31594
+
31595
+ /** Entity handler with CRUD operations */
31596
+ export interface EntityHandler<T, TCreate, TUpdate, TFilter> {
31597
+ /** Get all records with optional pagination */
31598
+ list(sort?: string, limit?: number, skip?: number, fields?: (keyof T)[]): Promise<ListResponse<T>>;
31599
+ /** Get records matching filter criteria */
31600
+ filter(query: TFilter, sort?: string, limit?: number, skip?: number, fields?: (keyof T)[]): Promise<ListResponse<T>>;
31601
+ /** Get a single record by ID */
31602
+ get(id: string): Promise<T>;
31603
+ /** Create a new record */
31604
+ create(data: TCreate): Promise<T>;
31605
+ /** Update an existing record */
31606
+ update(id: string, data: TUpdate): Promise<T>;
31607
+ /** Delete a record */
31608
+ delete(id: string): Promise<void>;
31609
+ /** Delete multiple records matching filter */
31610
+ deleteMany(query: TFilter): Promise<void>;
31611
+ /** Create multiple records at once */
31612
+ bulkCreate(data: TCreate[]): Promise<T[]>;
31613
+ /** Subscribe to real-time updates */
31614
+ subscribe(callback: (event: RealtimeEvent<T>) => void): () => void;
31615
+ }
31616
+
31617
+ /** Typed entities interface for Base44 SDK */
31618
+ export interface TypedEntities {
31619
+ ${entities.map((e$1) => ` ${e$1.name}: EntityHandler<${e$1.name}, ${e$1.name}CreateInput, ${e$1.name}UpdateInput, ${e$1.name}Filter>;`).join("\n")}
31620
+ }
31621
+
31622
+ /**
31623
+ * Typed Base44 client interface.
31624
+ * Use with the Base44 SDK for type-safe entity access.
31625
+ *
31626
+ * @example
31627
+ * import { createClient } from '@base44/sdk';
31628
+ * import type { TypedBase44Client } from './base44/client';
31629
+ *
31630
+ * const base44 = createClient({ appId: 'your-app-id' }) as TypedBase44Client;
31631
+ * const tasks = await base44.entities.Task.list();
31632
+ */
31633
+ export interface TypedBase44Client {
31634
+ entities: TypedEntities;
31635
+ }
31636
+ `;
31637
+ }
31638
+ /**
31639
+ * Generate the index.ts barrel file
31640
+ */
31641
+ function generateIndexFile() {
31642
+ return `${HEADER}
31643
+ export * from './entities.js';
31644
+ export * from './client.js';
31645
+ `;
31646
+ }
31647
+
31648
+ //#endregion
31649
+ //#region src/core/generate/types.ts
31650
+ /**
31651
+ * Parse entities into EntityDefinition format for type generation
31652
+ */
31653
+ function parseEntities(entities) {
31654
+ return entities.map((entity) => {
31655
+ const result = EntityDefinitionSchema.safeParse(entity);
31656
+ if (result.success) return result.data;
31657
+ const entityName = entity.name ?? "unknown";
31658
+ console.warn(`Skipping invalid entity "${entityName}": ${result.error.issues.map((i$1) => `${i$1.path.join(".")}: ${i$1.message}`).join(", ")}`);
31659
+ return null;
31660
+ }).filter((e$1) => e$1 !== null);
31661
+ }
31662
+ /**
31663
+ * Generate TypeScript types from local entity schemas
31664
+ */
31665
+ async function generateTypes(options = {}) {
31666
+ const { output = "src/base44", entitiesOnly = false } = options;
31667
+ const projectRoot = await findProjectRoot();
31668
+ if (!projectRoot) throw new Error("Project root not found. Please run this command from within a Base44 project.");
31669
+ const { entities } = await readProjectConfig(projectRoot.root);
31670
+ const parsedEntities = parseEntities(entities);
31671
+ const outputDir = join(projectRoot.root, output);
31672
+ await mkdir(outputDir, { recursive: true });
31673
+ const files = [];
31674
+ const entitiesContent = generateEntitiesFile(parsedEntities);
31675
+ const entitiesPath = join(outputDir, "entities.ts");
31676
+ await writeFile(entitiesPath, entitiesContent, "utf-8");
31677
+ files.push(entitiesPath);
31678
+ if (!entitiesOnly) {
31679
+ const clientContent = generateClientFile(parsedEntities);
31680
+ const clientPath = join(outputDir, "client.ts");
31681
+ await writeFile(clientPath, clientContent, "utf-8");
31682
+ files.push(clientPath);
31683
+ const indexContent = generateIndexFile();
31684
+ const indexPath = join(outputDir, "index.ts");
31685
+ await writeFile(indexPath, indexContent, "utf-8");
31686
+ files.push(indexPath);
31687
+ }
31688
+ return {
31689
+ entityCount: parsedEntities.length,
31690
+ files,
31691
+ outputDir
31692
+ };
31693
+ }
31694
+
31322
31695
  //#endregion
31323
31696
  //#region src/cli/commands/entities/push.ts
31324
31697
  async function pushEntitiesAction() {
@@ -31364,6 +31737,35 @@ const functionsDeployCommand = new Command("functions").description("Manage proj
31364
31737
  await runCommand(deployFunctionsAction, { requireAuth: true });
31365
31738
  }));
31366
31739
 
31740
+ //#endregion
31741
+ //#region src/cli/commands/types/generate.ts
31742
+ async function generateTypesAction(options) {
31743
+ const result = await runTask("Generating TypeScript types", async () => {
31744
+ return await generateTypes({
31745
+ output: options.output,
31746
+ entitiesOnly: options.entitiesOnly
31747
+ });
31748
+ }, {
31749
+ successMessage: "Types generated successfully",
31750
+ errorMessage: "Failed to generate types"
31751
+ });
31752
+ if (result.entityCount === 0) {
31753
+ M.warn("No entities found in project");
31754
+ return { outroMessage: "No types generated" };
31755
+ }
31756
+ M.info(`Generated types for ${result.entityCount} entities`);
31757
+ M.info(`Output directory: ${result.outputDir}`);
31758
+ const fileList = result.files.map((f) => ` - ${relative(process.cwd(), f)}`).join("\n");
31759
+ M.info(`Files:\n${fileList}`);
31760
+ return { outroMessage: "Types generated successfully!" };
31761
+ }
31762
+ const typesGenerateCommand = new Command("types").description("Generate TypeScript types from entity schemas").option("-o, --output <dir>", "Output directory", "src/base44").option("--entities-only", "Only generate entity types, skip client types").action(async (options) => {
31763
+ await runCommand(() => generateTypesAction(options), {
31764
+ requireAuth: false,
31765
+ requireAppConfig: false
31766
+ });
31767
+ });
31768
+
31367
31769
  //#endregion
31368
31770
  //#region node_modules/is-plain-obj/index.js
31369
31771
  function isPlainObject(value) {
@@ -31534,9 +31936,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
31534
31936
  //#region node_modules/execa/lib/utils/standard-stream.js
31535
31937
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
31536
31938
  const STANDARD_STREAMS = [
31537
- y.stdin,
31538
- y.stdout,
31539
- y.stderr
31939
+ process$1.stdin,
31940
+ process$1.stdout,
31941
+ process$1.stderr
31540
31942
  ];
31541
31943
  const STANDARD_STREAMS_ALIASES = [
31542
31944
  "stdin",
@@ -31661,9 +32063,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
31661
32063
  //#endregion
31662
32064
  //#region node_modules/is-unicode-supported/index.js
31663
32065
  function isUnicodeSupported() {
31664
- const { env: env$1 } = y;
32066
+ const { env: env$1 } = process$1;
31665
32067
  const { TERM, TERM_PROGRAM } = env$1;
31666
- if (y.platform !== "win32") return TERM !== "linux";
32068
+ if (process$1.platform !== "win32") return TERM !== "linux";
31667
32069
  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";
31668
32070
  }
31669
32071
 
@@ -32590,7 +32992,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
32590
32992
 
32591
32993
  //#endregion
32592
32994
  //#region node_modules/npm-run-path/index.js
32593
- const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
32995
+ const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath: execPath$1 = process$1.execPath, addExecPath = true } = {}) => {
32594
32996
  const cwdPath = path.resolve(toPath(cwd));
32595
32997
  const result = [];
32596
32998
  const pathParts = pathOption.split(path.delimiter);
@@ -32608,7 +33010,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
32608
33010
  const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
32609
33011
  if (!pathParts.includes(pathPart)) result.push(pathPart);
32610
33012
  };
32611
- const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
33013
+ const npmRunPathEnv = ({ env: env$1 = process$1.env, ...options } = {}) => {
32612
33014
  env$1 = { ...env$1 };
32613
33015
  const pathName = pathKey({ env: env$1 });
32614
33016
  options.path = env$1[pathName];
@@ -33743,7 +34145,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
33743
34145
  };
33744
34146
  const getDefaultCwd = () => {
33745
34147
  try {
33746
- return y.cwd();
34148
+ return process$1.cwd();
33747
34149
  } catch (error) {
33748
34150
  error.message = `The current directory does not exist.\n${error.message}`;
33749
34151
  throw error;
@@ -33778,7 +34180,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
33778
34180
  options.killSignal = normalizeKillSignal(options.killSignal);
33779
34181
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
33780
34182
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
33781
- if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
34183
+ if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
33782
34184
  return {
33783
34185
  file,
33784
34186
  commandArguments,
@@ -33805,7 +34207,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
33805
34207
  });
33806
34208
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
33807
34209
  const env$1 = extendEnv ? {
33808
- ...y.env,
34210
+ ...process$1.env,
33809
34211
  ...envOption
33810
34212
  } : envOption;
33811
34213
  if (preferLocal || node) return npmRunPathEnv({
@@ -34805,12 +35207,12 @@ const guessStreamDirection = {
34805
35207
  }
34806
35208
  };
34807
35209
  const getStandardStreamDirection = (value) => {
34808
- if ([0, y.stdin].includes(value)) return "input";
35210
+ if ([0, process$1.stdin].includes(value)) return "input";
34809
35211
  if ([
34810
35212
  1,
34811
35213
  2,
34812
- y.stdout,
34813
- y.stderr
35214
+ process$1.stdout,
35215
+ process$1.stderr
34814
35216
  ].includes(value)) return "output";
34815
35217
  };
34816
35218
  const DEFAULT_DIRECTION = "output";
@@ -35874,9 +36276,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
35874
36276
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
35875
36277
  };
35876
36278
  const getIpcExport = () => {
35877
- const anyProcess = y;
36279
+ const anyProcess = process$1;
35878
36280
  const isSubprocess = true;
35879
- const ipc = y.channel !== void 0;
36281
+ const ipc = process$1.channel !== void 0;
35880
36282
  return {
35881
36283
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
35882
36284
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -36118,7 +36520,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
36118
36520
 
36119
36521
  //#endregion
36120
36522
  //#region node_modules/signal-exit/dist/mjs/index.js
36121
- 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";
36523
+ 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";
36122
36524
  const kExitEmitter = Symbol.for("signal-exit emitter");
36123
36525
  const global$1 = globalThis;
36124
36526
  const ObjectDefineProperty = Object.defineProperty.bind(Object);
@@ -36186,7 +36588,7 @@ var SignalExitFallback = class extends SignalExitBase {
36186
36588
  };
36187
36589
  var SignalExit = class extends SignalExitBase {
36188
36590
  /* c8 ignore start */
36189
- #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
36591
+ #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
36190
36592
  /* c8 ignore stop */
36191
36593
  #emitter = new Emitter();
36192
36594
  #process;
@@ -36194,15 +36596,15 @@ var SignalExit = class extends SignalExitBase {
36194
36596
  #originalProcessReallyExit;
36195
36597
  #sigListeners = {};
36196
36598
  #loaded = false;
36197
- constructor(process$4) {
36599
+ constructor(process$5) {
36198
36600
  super();
36199
- this.#process = process$4;
36601
+ this.#process = process$5;
36200
36602
  this.#sigListeners = {};
36201
36603
  for (const sig of signals) this.#sigListeners[sig] = () => {
36202
36604
  const listeners = this.#process.listeners(sig);
36203
36605
  let { count: count$1 } = this.#emitter;
36204
36606
  /* c8 ignore start */
36205
- const p$1 = process$4;
36607
+ const p$1 = process$5;
36206
36608
  if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
36207
36609
  /* c8 ignore stop */
36208
36610
  if (listeners.length === count$1) {
@@ -36210,11 +36612,11 @@ var SignalExit = class extends SignalExitBase {
36210
36612
  const ret = this.#emitter.emit("exit", null, sig);
36211
36613
  /* c8 ignore start */
36212
36614
  const s = sig === "SIGHUP" ? this.#hupSig : sig;
36213
- if (!ret) process$4.kill(process$4.pid, s);
36615
+ if (!ret) process$5.kill(process$5.pid, s);
36214
36616
  }
36215
36617
  };
36216
- this.#originalProcessReallyExit = process$4.reallyExit;
36217
- this.#originalProcessEmit = process$4.emit;
36618
+ this.#originalProcessReallyExit = process$5.reallyExit;
36619
+ this.#originalProcessEmit = process$5.emit;
36218
36620
  }
36219
36621
  onExit(cb, opts) {
36220
36622
  /* c8 ignore start */
@@ -36281,8 +36683,8 @@ var SignalExit = class extends SignalExitBase {
36281
36683
  } else return og.call(this.#process, ev, ...args);
36282
36684
  }
36283
36685
  };
36284
- const process$1 = globalThis.process;
36285
- const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
36686
+ const process$2 = globalThis.process;
36687
+ const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
36286
36688
 
36287
36689
  //#endregion
36288
36690
  //#region node_modules/execa/lib/terminate/cleanup.js
@@ -38219,7 +38621,7 @@ function isInsideContainer() {
38219
38621
  //#endregion
38220
38622
  //#region node_modules/is-wsl/index.js
38221
38623
  const isWsl = () => {
38222
- if (y.platform !== "linux") return false;
38624
+ if (process$1.platform !== "linux") return false;
38223
38625
  if (os.release().toLowerCase().includes("microsoft")) {
38224
38626
  if (isInsideContainer()) return false;
38225
38627
  return true;
@@ -38230,12 +38632,12 @@ const isWsl = () => {
38230
38632
  return false;
38231
38633
  }
38232
38634
  };
38233
- var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38635
+ var is_wsl_default = process$1.env.__IS_WSL_TEST__ ? isWsl : isWsl();
38234
38636
 
38235
38637
  //#endregion
38236
38638
  //#region node_modules/powershell-utils/index.js
38237
38639
  const execFile$2 = promisify(childProcess.execFile);
38238
- const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38640
+ const powerShellPath$1 = () => `${process$1.env.SYSTEMROOT || process$1.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
38239
38641
  const executePowerShell = async (command, options = {}) => {
38240
38642
  const { powerShellPath: psPath, ...execFileOptions } = options;
38241
38643
  const encodedCommand = executePowerShell.encodeCommand(command);
@@ -38346,7 +38748,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
38346
38748
  //#region node_modules/default-browser-id/index.js
38347
38749
  const execFileAsync$3 = promisify(execFile);
38348
38750
  async function defaultBrowserId() {
38349
- if (y.platform !== "darwin") throw new Error("macOS only");
38751
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
38350
38752
  const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
38351
38753
  "read",
38352
38754
  "com.apple.LaunchServices/com.apple.launchservices.secure",
@@ -38361,7 +38763,7 @@ async function defaultBrowserId() {
38361
38763
  //#region node_modules/run-applescript/index.js
38362
38764
  const execFileAsync$2 = promisify(execFile);
38363
38765
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
38364
- if (y.platform !== "darwin") throw new Error("macOS only");
38766
+ if (process$1.platform !== "darwin") throw new Error("macOS only");
38365
38767
  const outputArguments = humanReadableOutput ? [] : ["-ss"];
38366
38768
  const execOptions = {};
38367
38769
  if (signal) execOptions.signal = signal;
@@ -38470,14 +38872,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
38470
38872
  const execFileAsync = promisify(execFile);
38471
38873
  const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
38472
38874
  async function defaultBrowser() {
38473
- if (y.platform === "darwin") {
38875
+ if (process$1.platform === "darwin") {
38474
38876
  const id = await defaultBrowserId();
38475
38877
  return {
38476
38878
  name: await bundleName(id),
38477
38879
  id
38478
38880
  };
38479
38881
  }
38480
- if (y.platform === "linux") {
38882
+ if (process$1.platform === "linux") {
38481
38883
  const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
38482
38884
  "query",
38483
38885
  "default",
@@ -38489,13 +38891,13 @@ async function defaultBrowser() {
38489
38891
  id
38490
38892
  };
38491
38893
  }
38492
- if (y.platform === "win32") return defaultBrowser$1();
38894
+ if (process$1.platform === "win32") return defaultBrowser$1();
38493
38895
  throw new Error("Only macOS, Linux, and Windows are supported");
38494
38896
  }
38495
38897
 
38496
38898
  //#endregion
38497
38899
  //#region node_modules/is-in-ssh/index.js
38498
- const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
38900
+ const isInSsh = Boolean(process$1.env.SSH_CONNECTION || process$1.env.SSH_CLIENT || process$1.env.SSH_TTY);
38499
38901
  var is_in_ssh_default = isInSsh;
38500
38902
 
38501
38903
  //#endregion
@@ -38503,7 +38905,7 @@ var is_in_ssh_default = isInSsh;
38503
38905
  const fallbackAttemptSymbol = Symbol("fallbackAttempt");
38504
38906
  const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
38505
38907
  const localXdgOpenPath = path.join(__dirname, "xdg-open");
38506
- const { platform: platform$1, arch } = y;
38908
+ const { platform: platform$1, arch } = process$1;
38507
38909
  const tryEachApp = async (apps$1, opener) => {
38508
38910
  if (apps$1.length === 0) return;
38509
38911
  const errors = [];
@@ -38616,7 +39018,7 @@ const baseOpen = async (options) => {
38616
39018
  await fs$1.access(localXdgOpenPath, constants$1.X_OK);
38617
39019
  exeLocalXdgOpen = true;
38618
39020
  } catch {}
38619
- command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
39021
+ command = process$1.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
38620
39022
  }
38621
39023
  if (appArguments.length > 0) cliArguments.push(...appArguments);
38622
39024
  if (!options.wait) {
@@ -38842,390 +39244,6 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
38842
39244
  await runCommand(() => deployAction(options), { requireAuth: true });
38843
39245
  }));
38844
39246
 
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
- });
38869
- /**
38870
- * A connected integration from the list endpoint
38871
- */
38872
- const ConnectorSchema = object({
38873
- integration_type: string(),
38874
- status: string(),
38875
- connected_at: string().optional(),
38876
- account_info: object({
38877
- email: string().optional(),
38878
- name: string().optional()
38879
- }).optional()
38880
- }).transform((data) => ({
38881
- integrationType: data.integration_type,
38882
- status: data.status,
38883
- connectedAt: data.connected_at,
38884
- accountInfo: data.account_info
38885
- }));
38886
- /**
38887
- * Response from GET /api/apps/{app_id}/external-auth/list
38888
- */
38889
- const ListResponseSchema = object({ integrations: array(ConnectorSchema) });
38890
- /**
38891
- * Generic API error response
38892
- */
38893
- const ApiErrorSchema = object({
38894
- error: string(),
38895
- detail: string().optional()
38896
- });
38897
-
38898
- //#endregion
38899
- //#region src/core/connectors/api.ts
38900
- /**
38901
- * Initiates OAuth flow for a connector integration.
38902
- * Returns a redirect URL to open in the browser.
38903
- */
38904
- async function initiateOAuth(integrationType, scopes = null) {
38905
- const response = await getAppClient().post("external-auth/initiate", {
38906
- json: {
38907
- integration_type: integrationType,
38908
- scopes
38909
- },
38910
- throwHttpErrors: false
38911
- });
38912
- const json = await response.json();
38913
- if (!response.ok) {
38914
- const errorResult = ApiErrorSchema.safeParse(json);
38915
- if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
38916
- throw new ConnectorApiError(`Failed to initiate OAuth: ${response.status} ${response.statusText}`);
38917
- }
38918
- const result = InitiateResponseSchema.safeParse(json);
38919
- if (!result.success) throw new ConnectorValidationError(`Invalid initiate response from server: ${result.error.message}`);
38920
- return result.data;
38921
- }
38922
- /**
38923
- * Checks the status of an OAuth connection attempt.
38924
- */
38925
- async function checkOAuthStatus(integrationType, connectionId) {
38926
- const response = await getAppClient().get("external-auth/status", {
38927
- searchParams: {
38928
- integration_type: integrationType,
38929
- connection_id: connectionId
38930
- },
38931
- throwHttpErrors: false
38932
- });
38933
- const json = await response.json();
38934
- if (!response.ok) {
38935
- const errorResult = ApiErrorSchema.safeParse(json);
38936
- if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
38937
- throw new ConnectorApiError(`Failed to check OAuth status: ${response.status} ${response.statusText}`);
38938
- }
38939
- const result = StatusResponseSchema.safeParse(json);
38940
- if (!result.success) throw new ConnectorValidationError(`Invalid status response from server: ${result.error.message}`);
38941
- return result.data;
38942
- }
38943
- /**
38944
- * Lists all connected integrations for the current app.
38945
- */
38946
- async function listConnectors() {
38947
- const response = await getAppClient().get("external-auth/list", { throwHttpErrors: false });
38948
- const json = await response.json();
38949
- if (!response.ok) {
38950
- const errorResult = ApiErrorSchema.safeParse(json);
38951
- if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
38952
- throw new ConnectorApiError(`Failed to list connectors: ${response.status} ${response.statusText}`);
38953
- }
38954
- const result = ListResponseSchema.safeParse(json);
38955
- if (!result.success) throw new ConnectorValidationError(`Invalid list response from server: ${result.error.message}`);
38956
- return result.data.integrations;
38957
- }
38958
- /**
38959
- * Disconnects (soft delete) a connector integration.
38960
- */
38961
- async function disconnectConnector(integrationType) {
38962
- const response = await getAppClient().delete(`external-auth/integrations/${integrationType}`, { throwHttpErrors: false });
38963
- if (!response.ok) {
38964
- const json = await response.json();
38965
- const errorResult = ApiErrorSchema.safeParse(json);
38966
- if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
38967
- throw new ConnectorApiError(`Failed to disconnect connector: ${response.status} ${response.statusText}`);
38968
- }
38969
- }
38970
-
38971
- //#endregion
38972
- //#region src/core/connectors/constants.ts
38973
- /**
38974
- * Supported OAuth connector integrations.
38975
- * Based on apper/backend/app/external_auth/models/constants.py
38976
- */
38977
- const SUPPORTED_INTEGRATIONS = [
38978
- "googlecalendar",
38979
- "googledrive",
38980
- "gmail",
38981
- "googlesheets",
38982
- "googledocs",
38983
- "googleslides",
38984
- "slack",
38985
- "notion",
38986
- "salesforce",
38987
- "hubspot",
38988
- "linkedin",
38989
- "tiktok"
38990
- ];
38991
- /**
38992
- * Display names for integrations (for CLI output)
38993
- */
38994
- const INTEGRATION_DISPLAY_NAMES = {
38995
- googlecalendar: "Google Calendar",
38996
- googledrive: "Google Drive",
38997
- gmail: "Gmail",
38998
- googlesheets: "Google Sheets",
38999
- googledocs: "Google Docs",
39000
- googleslides: "Google Slides",
39001
- slack: "Slack",
39002
- notion: "Notion",
39003
- salesforce: "Salesforce",
39004
- hubspot: "HubSpot",
39005
- linkedin: "LinkedIn",
39006
- tiktok: "TikTok"
39007
- };
39008
- function isValidIntegration(type) {
39009
- return SUPPORTED_INTEGRATIONS.includes(type);
39010
- }
39011
- function getIntegrationDisplayName(type) {
39012
- if (isValidIntegration(type)) return INTEGRATION_DISPLAY_NAMES[type];
39013
- return type;
39014
- }
39015
-
39016
- //#endregion
39017
- //#region src/cli/commands/connectors/add.ts
39018
- const POLL_INTERVAL_MS = 2e3;
39019
- const POLL_TIMEOUT_MS = 300 * 1e3;
39020
- async function promptForIntegrationType() {
39021
- const selected = await ve({
39022
- message: "Select an integration to connect:",
39023
- options: SUPPORTED_INTEGRATIONS.map((type) => ({
39024
- value: type,
39025
- label: getIntegrationDisplayName(type)
39026
- }))
39027
- });
39028
- if (pD(selected)) return null;
39029
- return selected;
39030
- }
39031
- async function waitForOAuthCompletion(integrationType, connectionId) {
39032
- let accountEmail;
39033
- let error;
39034
- try {
39035
- await runTask("Waiting for authorization...", async (updateMessage) => {
39036
- await pWaitFor(async () => {
39037
- const status = await checkOAuthStatus(integrationType, connectionId);
39038
- if (status.status === "ACTIVE") {
39039
- accountEmail = status.account_email;
39040
- return true;
39041
- }
39042
- if (status.status === "FAILED") {
39043
- error = status.error || "Authorization failed";
39044
- throw new Error(error);
39045
- }
39046
- updateMessage("Waiting for authorization in browser...");
39047
- return false;
39048
- }, {
39049
- interval: POLL_INTERVAL_MS,
39050
- timeout: POLL_TIMEOUT_MS
39051
- });
39052
- }, {
39053
- successMessage: "Authorization completed!",
39054
- errorMessage: "Authorization failed"
39055
- });
39056
- return {
39057
- success: true,
39058
- accountEmail
39059
- };
39060
- } catch (err) {
39061
- if (err instanceof Error && err.message.includes("timed out")) return {
39062
- success: false,
39063
- error: "Authorization timed out. Please try again."
39064
- };
39065
- return {
39066
- success: false,
39067
- error: error || (err instanceof Error ? err.message : "Unknown error")
39068
- };
39069
- }
39070
- }
39071
- async function addConnector(integrationType) {
39072
- let selectedType;
39073
- if (!integrationType) {
39074
- const prompted = await promptForIntegrationType();
39075
- if (!prompted) return { outroMessage: "Cancelled" };
39076
- selectedType = prompted;
39077
- } else {
39078
- if (!isValidIntegration(integrationType)) {
39079
- const supportedList = SUPPORTED_INTEGRATIONS.join(", ");
39080
- throw new Error(`Unsupported connector: ${integrationType}\nSupported connectors: ${supportedList}`);
39081
- }
39082
- selectedType = integrationType;
39083
- }
39084
- const displayName = getIntegrationDisplayName(selectedType);
39085
- const initiateResponse = await runTask(`Initiating ${displayName} connection...`, async () => {
39086
- return await initiateOAuth(selectedType);
39087
- }, {
39088
- successMessage: `${displayName} OAuth initiated`,
39089
- errorMessage: `Failed to initiate ${displayName} connection`
39090
- });
39091
- if (initiateResponse.already_authorized) return { outroMessage: `Already connected to ${theme.styles.bold(displayName)}` };
39092
- if (initiateResponse.error === "different_user" && initiateResponse.other_user_email) throw new Error(`This app is already connected to ${displayName} by ${initiateResponse.other_user_email}`);
39093
- if (!initiateResponse.redirect_url || !initiateResponse.connection_id) throw new Error("Invalid response from server: missing redirect URL or connection ID");
39094
- M.info(`Opening browser for ${displayName} authorization...`);
39095
- await open_default(initiateResponse.redirect_url);
39096
- const result = await waitForOAuthCompletion(selectedType, initiateResponse.connection_id);
39097
- if (!result.success) throw new Error(result.error || "Authorization failed");
39098
- const accountInfo = result.accountEmail ? ` as ${theme.styles.bold(result.accountEmail)}` : "";
39099
- return { outroMessage: `Successfully connected to ${theme.styles.bold(displayName)}${accountInfo}` };
39100
- }
39101
- const connectorsAddCommand = new Command("connectors:add").argument("[type]", "Integration type (e.g., slack, notion, googlecalendar)").description("Connect an OAuth integration").action(async (type) => {
39102
- await runCommand(() => addConnector(type), {
39103
- requireAuth: true,
39104
- requireAppConfig: true
39105
- });
39106
- });
39107
-
39108
- //#endregion
39109
- //#region src/cli/commands/connectors/list.ts
39110
- function formatDate(dateString) {
39111
- if (!dateString) return "-";
39112
- try {
39113
- return new Date(dateString).toLocaleDateString("en-US", {
39114
- year: "numeric",
39115
- month: "short",
39116
- day: "numeric"
39117
- });
39118
- } catch {
39119
- return dateString;
39120
- }
39121
- }
39122
- function formatStatus(status) {
39123
- const normalized = status.toLowerCase();
39124
- if (normalized === "active" || normalized === "connected") return theme.colors.success("● active");
39125
- if (normalized === "expired") return theme.colors.warning("● expired");
39126
- if (normalized === "failed" || normalized === "disconnected") return theme.colors.error("● disconnected");
39127
- return status;
39128
- }
39129
- async function listConnectorsCommand() {
39130
- const connectors = await runTask("Fetching connectors...", async () => {
39131
- return await listConnectors();
39132
- }, {
39133
- successMessage: "Connectors loaded",
39134
- errorMessage: "Failed to fetch connectors"
39135
- });
39136
- if (connectors.length === 0) {
39137
- M.info("No connectors configured for this app.");
39138
- M.info(`Run ${theme.styles.bold("base44 connectors:add")} to connect an integration.`);
39139
- return { outroMessage: "" };
39140
- }
39141
- console.log();
39142
- console.log(theme.styles.bold("Connected Integrations:"));
39143
- console.log();
39144
- const headers = [
39145
- "Type",
39146
- "Account",
39147
- "Status",
39148
- "Connected"
39149
- ];
39150
- const colWidths = [
39151
- 20,
39152
- 30,
39153
- 15,
39154
- 15
39155
- ];
39156
- const headerRow = headers.map((h$2, i$1) => h$2.padEnd(colWidths[i$1])).join(" ");
39157
- console.log(theme.styles.dim(headerRow));
39158
- console.log(theme.styles.dim("─".repeat(headerRow.length)));
39159
- for (const connector of connectors) {
39160
- const type = getIntegrationDisplayName(connector.integrationType).padEnd(colWidths[0]);
39161
- const account = (connector.accountInfo?.email || connector.accountInfo?.name || "-").padEnd(colWidths[1]);
39162
- const status = formatStatus(connector.status);
39163
- const connected = formatDate(connector.connectedAt).padEnd(colWidths[3]);
39164
- console.log(`${type} ${account} ${status.padEnd(colWidths[2] + 10)} ${connected}`);
39165
- }
39166
- console.log();
39167
- return { outroMessage: `${connectors.length} connector${connectors.length === 1 ? "" : "s"} configured` };
39168
- }
39169
- const connectorsListCommand = new Command("connectors:list").description("List all connected OAuth integrations").action(async () => {
39170
- await runCommand(listConnectorsCommand, {
39171
- requireAuth: true,
39172
- requireAppConfig: true
39173
- });
39174
- });
39175
-
39176
- //#endregion
39177
- //#region src/cli/commands/connectors/remove.ts
39178
- async function promptForConnectorToRemove(connectors) {
39179
- const selected = await ve({
39180
- message: "Select a connector to remove:",
39181
- options: connectors.map((c$1) => ({
39182
- value: c$1.integrationType,
39183
- label: `${getIntegrationDisplayName(c$1.integrationType)}${c$1.accountInfo?.email ? ` (${c$1.accountInfo.email})` : ""}`
39184
- }))
39185
- });
39186
- if (pD(selected)) return null;
39187
- return selected;
39188
- }
39189
- async function removeConnectorCommand(integrationType) {
39190
- const connectors = await runTask("Fetching connectors...", async () => {
39191
- return await listConnectors();
39192
- }, {
39193
- successMessage: "Connectors loaded",
39194
- errorMessage: "Failed to fetch connectors"
39195
- });
39196
- if (connectors.length === 0) return { outroMessage: "No connectors to remove" };
39197
- let selectedType;
39198
- if (!integrationType) {
39199
- const prompted = await promptForConnectorToRemove(connectors);
39200
- if (!prompted) return { outroMessage: "Cancelled" };
39201
- selectedType = prompted;
39202
- } else {
39203
- if (!isValidIntegration(integrationType)) throw new Error(`Invalid connector type: ${integrationType}`);
39204
- if (!connectors.some((c$1) => c$1.integrationType === integrationType)) throw new Error(`No ${getIntegrationDisplayName(integrationType)} connector found for this app`);
39205
- selectedType = integrationType;
39206
- }
39207
- const displayName = getIntegrationDisplayName(selectedType);
39208
- const connector = connectors.find((c$1) => c$1.integrationType === selectedType);
39209
- const shouldRemove = await ye({
39210
- message: `Disconnect ${displayName}${connector?.accountInfo?.email ? ` (${connector.accountInfo.email})` : ""}?`,
39211
- initialValue: false
39212
- });
39213
- if (pD(shouldRemove) || !shouldRemove) return { outroMessage: "Cancelled" };
39214
- await runTask(`Disconnecting ${displayName}...`, async () => {
39215
- await disconnectConnector(selectedType);
39216
- }, {
39217
- successMessage: `${displayName} disconnected`,
39218
- errorMessage: `Failed to disconnect ${displayName}`
39219
- });
39220
- return { outroMessage: `Successfully disconnected ${theme.styles.bold(displayName)}` };
39221
- }
39222
- const connectorsRemoveCommand = new Command("connectors:remove").argument("[type]", "Integration type to remove (e.g., slack, notion)").description("Disconnect an OAuth integration").action(async (type) => {
39223
- await runCommand(() => removeConnectorCommand(type), {
39224
- requireAuth: true,
39225
- requireAppConfig: true
39226
- });
39227
- });
39228
-
39229
39247
  //#endregion
39230
39248
  //#region package.json
39231
39249
  var version = "0.0.15";
@@ -39244,10 +39262,8 @@ program.addCommand(deployCommand);
39244
39262
  program.addCommand(linkCommand);
39245
39263
  program.addCommand(entitiesPushCommand);
39246
39264
  program.addCommand(functionsDeployCommand);
39265
+ program.addCommand(typesGenerateCommand);
39247
39266
  program.addCommand(siteDeployCommand);
39248
- program.addCommand(connectorsAddCommand);
39249
- program.addCommand(connectorsListCommand);
39250
- program.addCommand(connectorsRemoveCommand);
39251
39267
  program.parse();
39252
39268
 
39253
39269
  //#endregion