@base44-preview/cli 0.0.47-pr.439.4472b1f → 0.0.47-pr.439.fabf635

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 CHANGED
@@ -46,6 +46,134 @@ var __export = (target, all) => {
46
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
47
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
48
48
 
49
+ // ../../node_modules/picocolors/picocolors.js
50
+ var require_picocolors = __commonJS((exports, module) => {
51
+ var p = process || {};
52
+ var argv = p.argv || [];
53
+ var env = p.env || {};
54
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
55
+ var formatter = (open, close, replace = open) => (input) => {
56
+ let string = "" + input, index = string.indexOf(close, open.length);
57
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
58
+ };
59
+ var replaceClose = (string, close, replace, index) => {
60
+ let result = "", cursor = 0;
61
+ do {
62
+ result += string.substring(cursor, index) + replace;
63
+ cursor = index + close.length;
64
+ index = string.indexOf(close, cursor);
65
+ } while (~index);
66
+ return result + string.substring(cursor);
67
+ };
68
+ var createColors = (enabled = isColorSupported) => {
69
+ let f = enabled ? formatter : () => String;
70
+ return {
71
+ isColorSupported: enabled,
72
+ reset: f("\x1B[0m", "\x1B[0m"),
73
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
74
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
75
+ italic: f("\x1B[3m", "\x1B[23m"),
76
+ underline: f("\x1B[4m", "\x1B[24m"),
77
+ inverse: f("\x1B[7m", "\x1B[27m"),
78
+ hidden: f("\x1B[8m", "\x1B[28m"),
79
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
80
+ black: f("\x1B[30m", "\x1B[39m"),
81
+ red: f("\x1B[31m", "\x1B[39m"),
82
+ green: f("\x1B[32m", "\x1B[39m"),
83
+ yellow: f("\x1B[33m", "\x1B[39m"),
84
+ blue: f("\x1B[34m", "\x1B[39m"),
85
+ magenta: f("\x1B[35m", "\x1B[39m"),
86
+ cyan: f("\x1B[36m", "\x1B[39m"),
87
+ white: f("\x1B[37m", "\x1B[39m"),
88
+ gray: f("\x1B[90m", "\x1B[39m"),
89
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
90
+ bgRed: f("\x1B[41m", "\x1B[49m"),
91
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
92
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
93
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
94
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
95
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
96
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
97
+ blackBright: f("\x1B[90m", "\x1B[39m"),
98
+ redBright: f("\x1B[91m", "\x1B[39m"),
99
+ greenBright: f("\x1B[92m", "\x1B[39m"),
100
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
101
+ blueBright: f("\x1B[94m", "\x1B[39m"),
102
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
103
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
104
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
105
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
106
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
107
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
108
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
109
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
110
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
111
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
112
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
113
+ };
114
+ };
115
+ module.exports = createColors();
116
+ module.exports.createColors = createColors;
117
+ });
118
+
119
+ // ../../node_modules/sisteransi/src/index.js
120
+ var require_src = __commonJS((exports, module) => {
121
+ var ESC = "\x1B";
122
+ var CSI = `${ESC}[`;
123
+ var beep = "\x07";
124
+ var cursor = {
125
+ to(x, y) {
126
+ if (!y)
127
+ return `${CSI}${x + 1}G`;
128
+ return `${CSI}${y + 1};${x + 1}H`;
129
+ },
130
+ move(x, y) {
131
+ let ret = "";
132
+ if (x < 0)
133
+ ret += `${CSI}${-x}D`;
134
+ else if (x > 0)
135
+ ret += `${CSI}${x}C`;
136
+ if (y < 0)
137
+ ret += `${CSI}${-y}A`;
138
+ else if (y > 0)
139
+ ret += `${CSI}${y}B`;
140
+ return ret;
141
+ },
142
+ up: (count = 1) => `${CSI}${count}A`,
143
+ down: (count = 1) => `${CSI}${count}B`,
144
+ forward: (count = 1) => `${CSI}${count}C`,
145
+ backward: (count = 1) => `${CSI}${count}D`,
146
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
147
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
148
+ left: `${CSI}G`,
149
+ hide: `${CSI}?25l`,
150
+ show: `${CSI}?25h`,
151
+ save: `${ESC}7`,
152
+ restore: `${ESC}8`
153
+ };
154
+ var scroll = {
155
+ up: (count = 1) => `${CSI}S`.repeat(count),
156
+ down: (count = 1) => `${CSI}T`.repeat(count)
157
+ };
158
+ var erase = {
159
+ screen: `${CSI}2J`,
160
+ up: (count = 1) => `${CSI}1J`.repeat(count),
161
+ down: (count = 1) => `${CSI}J`.repeat(count),
162
+ line: `${CSI}2K`,
163
+ lineEnd: `${CSI}K`,
164
+ lineStart: `${CSI}1K`,
165
+ lines(count) {
166
+ let clear = "";
167
+ for (let i = 0;i < count; i++)
168
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
169
+ if (count)
170
+ clear += cursor.left;
171
+ return clear;
172
+ }
173
+ };
174
+ module.exports = { cursor, scroll, erase, beep };
175
+ });
176
+
49
177
  // ../../node_modules/commander/lib/error.js
50
178
  var require_error = __commonJS((exports) => {
51
179
  class CommanderError extends Error {
@@ -555,28 +683,28 @@ var require_suggestSimilar = __commonJS((exports) => {
555
683
  function editDistance(a, b) {
556
684
  if (Math.abs(a.length - b.length) > maxDistance)
557
685
  return Math.max(a.length, b.length);
558
- const d = [];
686
+ const d2 = [];
559
687
  for (let i = 0;i <= a.length; i++) {
560
- d[i] = [i];
688
+ d2[i] = [i];
561
689
  }
562
- for (let j = 0;j <= b.length; j++) {
563
- d[0][j] = j;
690
+ for (let j2 = 0;j2 <= b.length; j2++) {
691
+ d2[0][j2] = j2;
564
692
  }
565
- for (let j = 1;j <= b.length; j++) {
693
+ for (let j2 = 1;j2 <= b.length; j2++) {
566
694
  for (let i = 1;i <= a.length; i++) {
567
695
  let cost = 1;
568
- if (a[i - 1] === b[j - 1]) {
696
+ if (a[i - 1] === b[j2 - 1]) {
569
697
  cost = 0;
570
698
  } else {
571
699
  cost = 1;
572
700
  }
573
- d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
574
- if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
575
- d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
701
+ d2[i][j2] = Math.min(d2[i - 1][j2] + 1, d2[i][j2 - 1] + 1, d2[i - 1][j2 - 1] + cost);
702
+ if (i > 1 && j2 > 1 && a[i - 1] === b[j2 - 2] && a[i - 2] === b[j2 - 1]) {
703
+ d2[i][j2] = Math.min(d2[i][j2], d2[i - 2][j2 - 2] + 1);
576
704
  }
577
705
  }
578
706
  }
579
- return d[a.length][b.length];
707
+ return d2[a.length][b.length];
580
708
  }
581
709
  function suggestSimilar(word, candidates) {
582
710
  if (!candidates || candidates.length === 0)
@@ -1885,134 +2013,6 @@ var require_commander = __commonJS((exports) => {
1885
2013
  exports.InvalidOptionArgumentError = InvalidArgumentError;
1886
2014
  });
1887
2015
 
1888
- // ../../node_modules/picocolors/picocolors.js
1889
- var require_picocolors = __commonJS((exports, module) => {
1890
- var p = process || {};
1891
- var argv = p.argv || [];
1892
- var env = p.env || {};
1893
- var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
1894
- var formatter = (open, close, replace = open) => (input) => {
1895
- let string = "" + input, index = string.indexOf(close, open.length);
1896
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
1897
- };
1898
- var replaceClose = (string, close, replace, index) => {
1899
- let result = "", cursor = 0;
1900
- do {
1901
- result += string.substring(cursor, index) + replace;
1902
- cursor = index + close.length;
1903
- index = string.indexOf(close, cursor);
1904
- } while (~index);
1905
- return result + string.substring(cursor);
1906
- };
1907
- var createColors = (enabled = isColorSupported) => {
1908
- let f = enabled ? formatter : () => String;
1909
- return {
1910
- isColorSupported: enabled,
1911
- reset: f("\x1B[0m", "\x1B[0m"),
1912
- bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
1913
- dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
1914
- italic: f("\x1B[3m", "\x1B[23m"),
1915
- underline: f("\x1B[4m", "\x1B[24m"),
1916
- inverse: f("\x1B[7m", "\x1B[27m"),
1917
- hidden: f("\x1B[8m", "\x1B[28m"),
1918
- strikethrough: f("\x1B[9m", "\x1B[29m"),
1919
- black: f("\x1B[30m", "\x1B[39m"),
1920
- red: f("\x1B[31m", "\x1B[39m"),
1921
- green: f("\x1B[32m", "\x1B[39m"),
1922
- yellow: f("\x1B[33m", "\x1B[39m"),
1923
- blue: f("\x1B[34m", "\x1B[39m"),
1924
- magenta: f("\x1B[35m", "\x1B[39m"),
1925
- cyan: f("\x1B[36m", "\x1B[39m"),
1926
- white: f("\x1B[37m", "\x1B[39m"),
1927
- gray: f("\x1B[90m", "\x1B[39m"),
1928
- bgBlack: f("\x1B[40m", "\x1B[49m"),
1929
- bgRed: f("\x1B[41m", "\x1B[49m"),
1930
- bgGreen: f("\x1B[42m", "\x1B[49m"),
1931
- bgYellow: f("\x1B[43m", "\x1B[49m"),
1932
- bgBlue: f("\x1B[44m", "\x1B[49m"),
1933
- bgMagenta: f("\x1B[45m", "\x1B[49m"),
1934
- bgCyan: f("\x1B[46m", "\x1B[49m"),
1935
- bgWhite: f("\x1B[47m", "\x1B[49m"),
1936
- blackBright: f("\x1B[90m", "\x1B[39m"),
1937
- redBright: f("\x1B[91m", "\x1B[39m"),
1938
- greenBright: f("\x1B[92m", "\x1B[39m"),
1939
- yellowBright: f("\x1B[93m", "\x1B[39m"),
1940
- blueBright: f("\x1B[94m", "\x1B[39m"),
1941
- magentaBright: f("\x1B[95m", "\x1B[39m"),
1942
- cyanBright: f("\x1B[96m", "\x1B[39m"),
1943
- whiteBright: f("\x1B[97m", "\x1B[39m"),
1944
- bgBlackBright: f("\x1B[100m", "\x1B[49m"),
1945
- bgRedBright: f("\x1B[101m", "\x1B[49m"),
1946
- bgGreenBright: f("\x1B[102m", "\x1B[49m"),
1947
- bgYellowBright: f("\x1B[103m", "\x1B[49m"),
1948
- bgBlueBright: f("\x1B[104m", "\x1B[49m"),
1949
- bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
1950
- bgCyanBright: f("\x1B[106m", "\x1B[49m"),
1951
- bgWhiteBright: f("\x1B[107m", "\x1B[49m")
1952
- };
1953
- };
1954
- module.exports = createColors();
1955
- module.exports.createColors = createColors;
1956
- });
1957
-
1958
- // ../../node_modules/sisteransi/src/index.js
1959
- var require_src = __commonJS((exports, module) => {
1960
- var ESC = "\x1B";
1961
- var CSI = `${ESC}[`;
1962
- var beep = "\x07";
1963
- var cursor = {
1964
- to(x, y) {
1965
- if (!y)
1966
- return `${CSI}${x + 1}G`;
1967
- return `${CSI}${y + 1};${x + 1}H`;
1968
- },
1969
- move(x, y) {
1970
- let ret = "";
1971
- if (x < 0)
1972
- ret += `${CSI}${-x}D`;
1973
- else if (x > 0)
1974
- ret += `${CSI}${x}C`;
1975
- if (y < 0)
1976
- ret += `${CSI}${-y}A`;
1977
- else if (y > 0)
1978
- ret += `${CSI}${y}B`;
1979
- return ret;
1980
- },
1981
- up: (count = 1) => `${CSI}${count}A`,
1982
- down: (count = 1) => `${CSI}${count}B`,
1983
- forward: (count = 1) => `${CSI}${count}C`,
1984
- backward: (count = 1) => `${CSI}${count}D`,
1985
- nextLine: (count = 1) => `${CSI}E`.repeat(count),
1986
- prevLine: (count = 1) => `${CSI}F`.repeat(count),
1987
- left: `${CSI}G`,
1988
- hide: `${CSI}?25l`,
1989
- show: `${CSI}?25h`,
1990
- save: `${ESC}7`,
1991
- restore: `${ESC}8`
1992
- };
1993
- var scroll = {
1994
- up: (count = 1) => `${CSI}S`.repeat(count),
1995
- down: (count = 1) => `${CSI}T`.repeat(count)
1996
- };
1997
- var erase = {
1998
- screen: `${CSI}2J`,
1999
- up: (count = 1) => `${CSI}1J`.repeat(count),
2000
- down: (count = 1) => `${CSI}J`.repeat(count),
2001
- line: `${CSI}2K`,
2002
- lineEnd: `${CSI}K`,
2003
- lineStart: `${CSI}1K`,
2004
- lines(count) {
2005
- let clear = "";
2006
- for (let i = 0;i < count; i++)
2007
- clear += this.line + (i < count - 1 ? cursor.up() : "");
2008
- if (count)
2009
- clear += cursor.left;
2010
- return clear;
2011
- }
2012
- };
2013
- module.exports = { cursor, scroll, erase, beep };
2014
- });
2015
-
2016
2016
  // ../../node_modules/json5/lib/unicode.js
2017
2017
  var require_unicode = __commonJS((exports, module) => {
2018
2018
  exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
@@ -9671,12 +9671,12 @@ var require_schema = __commonJS((exports, module) => {
9671
9671
  var common = require_common3();
9672
9672
  var YAMLException = require_exception();
9673
9673
  var Type = require_type();
9674
- function compileList(schema5, name2, result) {
9674
+ function compileList(schema6, name2, result) {
9675
9675
  var exclude = [];
9676
- schema5.include.forEach(function(includedSchema) {
9676
+ schema6.include.forEach(function(includedSchema) {
9677
9677
  result = compileList(includedSchema, name2, result);
9678
9678
  });
9679
- schema5[name2].forEach(function(currentType) {
9679
+ schema6[name2].forEach(function(currentType) {
9680
9680
  result.forEach(function(previousType, previousIndex) {
9681
9681
  if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
9682
9682
  exclude.push(previousIndex);
@@ -9733,8 +9733,8 @@ var require_schema = __commonJS((exports, module) => {
9733
9733
  }
9734
9734
  schemas3 = common.toArray(schemas3);
9735
9735
  types = common.toArray(types);
9736
- if (!schemas3.every(function(schema5) {
9737
- return schema5 instanceof Schema;
9736
+ if (!schemas3.every(function(schema6) {
9737
+ return schema6 instanceof Schema;
9738
9738
  })) {
9739
9739
  throw new YAMLException("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");
9740
9740
  }
@@ -11755,7 +11755,7 @@ var require_dumper = __commonJS((exports, module) => {
11755
11755
  "Off",
11756
11756
  "OFF"
11757
11757
  ];
11758
- function compileStyleMap(schema5, map2) {
11758
+ function compileStyleMap(schema6, map2) {
11759
11759
  var result, keys, index, length, tag, style, type;
11760
11760
  if (map2 === null)
11761
11761
  return {};
@@ -11767,7 +11767,7 @@ var require_dumper = __commonJS((exports, module) => {
11767
11767
  if (tag.slice(0, 2) === "!!") {
11768
11768
  tag = "tag:yaml.org,2002:" + tag.slice(2);
11769
11769
  }
11770
- type = schema5.compiledTypeMap["fallback"][tag];
11770
+ type = schema6.compiledTypeMap["fallback"][tag];
11771
11771
  if (type && _hasOwnProperty.call(type.styleAliases, style)) {
11772
11772
  style = type.styleAliases[style];
11773
11773
  }
@@ -16067,7 +16067,7 @@ var require_lodash = __commonJS((exports, module) => {
16067
16067
  }
16068
16068
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
16069
16069
  });
16070
- function join11(array2, separator) {
16070
+ function join12(array2, separator) {
16071
16071
  return array2 == null ? "" : nativeJoin.call(array2, separator);
16072
16072
  }
16073
16073
  function last(array2) {
@@ -16089,7 +16089,7 @@ var require_lodash = __commonJS((exports, module) => {
16089
16089
  function nth(array2, n2) {
16090
16090
  return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
16091
16091
  }
16092
- var pull3 = baseRest(pullAll);
16092
+ var pull4 = baseRest(pullAll);
16093
16093
  function pullAll(array2, values2) {
16094
16094
  return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
16095
16095
  }
@@ -17854,7 +17854,7 @@ __p += '`;
17854
17854
  lodash.pickBy = pickBy;
17855
17855
  lodash.property = property;
17856
17856
  lodash.propertyOf = propertyOf;
17857
- lodash.pull = pull3;
17857
+ lodash.pull = pull4;
17858
17858
  lodash.pullAll = pullAll;
17859
17859
  lodash.pullAllBy = pullAllBy;
17860
17860
  lodash.pullAllWith = pullAllWith;
@@ -17999,7 +17999,7 @@ __p += '`;
17999
17999
  lodash.isUndefined = isUndefined;
18000
18000
  lodash.isWeakMap = isWeakMap;
18001
18001
  lodash.isWeakSet = isWeakSet;
18002
- lodash.join = join11;
18002
+ lodash.join = join12;
18003
18003
  lodash.kebabCase = kebabCase;
18004
18004
  lodash.last = last;
18005
18005
  lodash.lastIndexOf = lastIndexOf;
@@ -18954,7 +18954,7 @@ var require_createNode = __commonJS((exports) => {
18954
18954
  if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
18955
18955
  value = value.valueOf();
18956
18956
  }
18957
- const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema8, sourceObjects } = ctx;
18957
+ const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema9, sourceObjects } = ctx;
18958
18958
  let ref = undefined;
18959
18959
  if (aliasDuplicateObjects && value && typeof value === "object") {
18960
18960
  ref = sourceObjects.get(value);
@@ -18968,7 +18968,7 @@ var require_createNode = __commonJS((exports) => {
18968
18968
  }
18969
18969
  if (tagName?.startsWith("!!"))
18970
18970
  tagName = defaultTagPrefix + tagName.slice(2);
18971
- let tagObj = findTagObject(value, tagName, schema8.tags);
18971
+ let tagObj = findTagObject(value, tagName, schema9.tags);
18972
18972
  if (!tagObj) {
18973
18973
  if (value && typeof value.toJSON === "function") {
18974
18974
  value = value.toJSON();
@@ -18979,7 +18979,7 @@ var require_createNode = __commonJS((exports) => {
18979
18979
  ref.node = node2;
18980
18980
  return node2;
18981
18981
  }
18982
- tagObj = value instanceof Map ? schema8[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema8[identity3.SEQ] : schema8[identity3.MAP];
18982
+ tagObj = value instanceof Map ? schema9[identity3.MAP] : (Symbol.iterator in Object(value)) ? schema9[identity3.SEQ] : schema9[identity3.MAP];
18983
18983
  }
18984
18984
  if (onTagObj) {
18985
18985
  onTagObj(tagObj);
@@ -19002,7 +19002,7 @@ var require_Collection = __commonJS((exports) => {
19002
19002
  var createNode = require_createNode();
19003
19003
  var identity3 = require_identity();
19004
19004
  var Node2 = require_Node();
19005
- function collectionFromPath(schema8, path16, value) {
19005
+ function collectionFromPath(schema9, path16, value) {
19006
19006
  let v = value;
19007
19007
  for (let i2 = path16.length - 1;i2 >= 0; --i2) {
19008
19008
  const k2 = path16[i2];
@@ -19020,27 +19020,27 @@ var require_Collection = __commonJS((exports) => {
19020
19020
  onAnchor: () => {
19021
19021
  throw new Error("This should not happen, please report a bug.");
19022
19022
  },
19023
- schema: schema8,
19023
+ schema: schema9,
19024
19024
  sourceObjects: new Map
19025
19025
  });
19026
19026
  }
19027
19027
  var isEmptyPath = (path16) => path16 == null || typeof path16 === "object" && !!path16[Symbol.iterator]().next().done;
19028
19028
 
19029
19029
  class Collection extends Node2.NodeBase {
19030
- constructor(type, schema8) {
19030
+ constructor(type, schema9) {
19031
19031
  super(type);
19032
19032
  Object.defineProperty(this, "schema", {
19033
- value: schema8,
19033
+ value: schema9,
19034
19034
  configurable: true,
19035
19035
  enumerable: false,
19036
19036
  writable: true
19037
19037
  });
19038
19038
  }
19039
- clone(schema8) {
19039
+ clone(schema9) {
19040
19040
  const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
19041
- if (schema8)
19042
- copy.schema = schema8;
19043
- copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema8) : it3);
19041
+ if (schema9)
19042
+ copy.schema = schema9;
19043
+ copy.items = copy.items.map((it3) => identity3.isNode(it3) || identity3.isPair(it3) ? it3.clone(schema9) : it3);
19044
19044
  if (this.range)
19045
19045
  copy.range = this.range.slice();
19046
19046
  return copy;
@@ -19972,12 +19972,12 @@ var require_Pair = __commonJS((exports) => {
19972
19972
  this.key = key;
19973
19973
  this.value = value;
19974
19974
  }
19975
- clone(schema8) {
19975
+ clone(schema9) {
19976
19976
  let { key, value } = this;
19977
19977
  if (identity3.isNode(key))
19978
- key = key.clone(schema8);
19978
+ key = key.clone(schema9);
19979
19979
  if (identity3.isNode(value))
19980
- value = value.clone(schema8);
19980
+ value = value.clone(schema9);
19981
19981
  return new Pair(key, value);
19982
19982
  }
19983
19983
  toJSON(_2, ctx) {
@@ -20162,13 +20162,13 @@ var require_YAMLMap = __commonJS((exports) => {
20162
20162
  static get tagName() {
20163
20163
  return "tag:yaml.org,2002:map";
20164
20164
  }
20165
- constructor(schema8) {
20166
- super(identity3.MAP, schema8);
20165
+ constructor(schema9) {
20166
+ super(identity3.MAP, schema9);
20167
20167
  this.items = [];
20168
20168
  }
20169
- static from(schema8, obj, ctx) {
20169
+ static from(schema9, obj, ctx) {
20170
20170
  const { keepUndefined, replacer } = ctx;
20171
- const map2 = new this(schema8);
20171
+ const map2 = new this(schema9);
20172
20172
  const add = (key, value) => {
20173
20173
  if (typeof replacer === "function")
20174
20174
  value = replacer.call(obj, key, value);
@@ -20184,8 +20184,8 @@ var require_YAMLMap = __commonJS((exports) => {
20184
20184
  for (const key of Object.keys(obj))
20185
20185
  add(key, obj[key]);
20186
20186
  }
20187
- if (typeof schema8.sortMapEntries === "function") {
20188
- map2.items.sort(schema8.sortMapEntries);
20187
+ if (typeof schema9.sortMapEntries === "function") {
20188
+ map2.items.sort(schema9.sortMapEntries);
20189
20189
  }
20190
20190
  return map2;
20191
20191
  }
@@ -20278,7 +20278,7 @@ var require_map2 = __commonJS((exports) => {
20278
20278
  onError("Expected a mapping for this tag");
20279
20279
  return map3;
20280
20280
  },
20281
- createNode: (schema8, obj, ctx) => YAMLMap.YAMLMap.from(schema8, obj, ctx)
20281
+ createNode: (schema9, obj, ctx) => YAMLMap.YAMLMap.from(schema9, obj, ctx)
20282
20282
  };
20283
20283
  exports.map = map2;
20284
20284
  });
@@ -20296,8 +20296,8 @@ var require_YAMLSeq = __commonJS((exports) => {
20296
20296
  static get tagName() {
20297
20297
  return "tag:yaml.org,2002:seq";
20298
20298
  }
20299
- constructor(schema8) {
20300
- super(identity3.SEQ, schema8);
20299
+ constructor(schema9) {
20300
+ super(identity3.SEQ, schema9);
20301
20301
  this.items = [];
20302
20302
  }
20303
20303
  add(value) {
@@ -20351,9 +20351,9 @@ var require_YAMLSeq = __commonJS((exports) => {
20351
20351
  onComment
20352
20352
  });
20353
20353
  }
20354
- static from(schema8, obj, ctx) {
20354
+ static from(schema9, obj, ctx) {
20355
20355
  const { replacer } = ctx;
20356
- const seq = new this(schema8);
20356
+ const seq = new this(schema9);
20357
20357
  if (obj && Symbol.iterator in Object(obj)) {
20358
20358
  let i2 = 0;
20359
20359
  for (let it3 of obj) {
@@ -20390,7 +20390,7 @@ var require_seq2 = __commonJS((exports) => {
20390
20390
  onError("Expected a sequence for this tag");
20391
20391
  return seq2;
20392
20392
  },
20393
- createNode: (schema8, obj, ctx) => YAMLSeq.YAMLSeq.from(schema8, obj, ctx)
20393
+ createNode: (schema9, obj, ctx) => YAMLSeq.YAMLSeq.from(schema9, obj, ctx)
20394
20394
  };
20395
20395
  exports.seq = seq;
20396
20396
  });
@@ -20565,7 +20565,7 @@ var require_schema2 = __commonJS((exports) => {
20565
20565
  var bool = require_bool2();
20566
20566
  var float = require_float2();
20567
20567
  var int2 = require_int2();
20568
- var schema8 = [
20568
+ var schema9 = [
20569
20569
  map2.map,
20570
20570
  seq.seq,
20571
20571
  string4.string,
@@ -20578,7 +20578,7 @@ var require_schema2 = __commonJS((exports) => {
20578
20578
  float.floatExp,
20579
20579
  float.float
20580
20580
  ];
20581
- exports.schema = schema8;
20581
+ exports.schema = schema9;
20582
20582
  });
20583
20583
 
20584
20584
  // ../../node_modules/yaml/dist/schema/json/schema.js
@@ -20641,8 +20641,8 @@ var require_schema3 = __commonJS((exports) => {
20641
20641
  return str;
20642
20642
  }
20643
20643
  };
20644
- var schema8 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
20645
- exports.schema = schema8;
20644
+ var schema9 = [map2.map, seq.seq].concat(jsonScalars, jsonError);
20645
+ exports.schema = schema9;
20646
20646
  });
20647
20647
 
20648
20648
  // ../../node_modules/yaml/dist/schema/yaml-1.1/binary.js
@@ -20732,9 +20732,9 @@ ${cn.comment}` : item.comment;
20732
20732
  onError("Expected a sequence for this tag");
20733
20733
  return seq;
20734
20734
  }
20735
- function createPairs(schema8, iterable, ctx) {
20735
+ function createPairs(schema9, iterable, ctx) {
20736
20736
  const { replacer } = ctx;
20737
- const pairs2 = new YAMLSeq.YAMLSeq(schema8);
20737
+ const pairs2 = new YAMLSeq.YAMLSeq(schema9);
20738
20738
  pairs2.tag = "tag:yaml.org,2002:pairs";
20739
20739
  let i2 = 0;
20740
20740
  if (iterable && Symbol.iterator in Object(iterable))
@@ -20813,8 +20813,8 @@ var require_omap2 = __commonJS((exports) => {
20813
20813
  }
20814
20814
  return map2;
20815
20815
  }
20816
- static from(schema8, iterable, ctx) {
20817
- const pairs$1 = pairs.createPairs(schema8, iterable, ctx);
20816
+ static from(schema9, iterable, ctx) {
20817
+ const pairs$1 = pairs.createPairs(schema9, iterable, ctx);
20818
20818
  const omap2 = new this;
20819
20819
  omap2.items = pairs$1.items;
20820
20820
  return omap2;
@@ -20841,7 +20841,7 @@ var require_omap2 = __commonJS((exports) => {
20841
20841
  }
20842
20842
  return Object.assign(new YAMLOMap, pairs$1);
20843
20843
  },
20844
- createNode: (schema8, iterable, ctx) => YAMLOMap.from(schema8, iterable, ctx)
20844
+ createNode: (schema9, iterable, ctx) => YAMLOMap.from(schema9, iterable, ctx)
20845
20845
  };
20846
20846
  exports.YAMLOMap = YAMLOMap;
20847
20847
  exports.omap = omap;
@@ -21005,8 +21005,8 @@ var require_set2 = __commonJS((exports) => {
21005
21005
  var YAMLMap = require_YAMLMap();
21006
21006
 
21007
21007
  class YAMLSet extends YAMLMap.YAMLMap {
21008
- constructor(schema8) {
21009
- super(schema8);
21008
+ constructor(schema9) {
21009
+ super(schema9);
21010
21010
  this.tag = YAMLSet.tag;
21011
21011
  }
21012
21012
  add(key) {
@@ -21046,9 +21046,9 @@ var require_set2 = __commonJS((exports) => {
21046
21046
  else
21047
21047
  throw new Error("Set items must all have null values");
21048
21048
  }
21049
- static from(schema8, iterable, ctx) {
21049
+ static from(schema9, iterable, ctx) {
21050
21050
  const { replacer } = ctx;
21051
- const set3 = new this(schema8);
21051
+ const set3 = new this(schema9);
21052
21052
  if (iterable && Symbol.iterator in Object(iterable))
21053
21053
  for (let value of iterable) {
21054
21054
  if (typeof replacer === "function")
@@ -21065,7 +21065,7 @@ var require_set2 = __commonJS((exports) => {
21065
21065
  nodeClass: YAMLSet,
21066
21066
  default: false,
21067
21067
  tag: "tag:yaml.org,2002:set",
21068
- createNode: (schema8, iterable, ctx) => YAMLSet.from(schema8, iterable, ctx),
21068
+ createNode: (schema9, iterable, ctx) => YAMLSet.from(schema9, iterable, ctx),
21069
21069
  resolve(map2, onError) {
21070
21070
  if (identity3.isMap(map2)) {
21071
21071
  if (map2.hasAllNullValues(true))
@@ -21178,7 +21178,7 @@ var require_schema4 = __commonJS((exports) => {
21178
21178
  var pairs = require_pairs2();
21179
21179
  var set2 = require_set2();
21180
21180
  var timestamp = require_timestamp2();
21181
- var schema8 = [
21181
+ var schema9 = [
21182
21182
  map2.map,
21183
21183
  seq.seq,
21184
21184
  string4.string,
@@ -21201,7 +21201,7 @@ var require_schema4 = __commonJS((exports) => {
21201
21201
  timestamp.floatTime,
21202
21202
  timestamp.timestamp
21203
21203
  ];
21204
- exports.schema = schema8;
21204
+ exports.schema = schema9;
21205
21205
  });
21206
21206
 
21207
21207
  // ../../node_modules/yaml/dist/schema/tags.js
@@ -21213,7 +21213,7 @@ var require_tags = __commonJS((exports) => {
21213
21213
  var bool = require_bool2();
21214
21214
  var float = require_float2();
21215
21215
  var int2 = require_int2();
21216
- var schema8 = require_schema2();
21216
+ var schema9 = require_schema2();
21217
21217
  var schema$1 = require_schema3();
21218
21218
  var binary = require_binary2();
21219
21219
  var merge3 = require_merge3();
@@ -21223,7 +21223,7 @@ var require_tags = __commonJS((exports) => {
21223
21223
  var set2 = require_set2();
21224
21224
  var timestamp = require_timestamp2();
21225
21225
  var schemas3 = new Map([
21226
- ["core", schema8.schema],
21226
+ ["core", schema9.schema],
21227
21227
  ["failsafe", [map2.map, seq.seq, string4.string]],
21228
21228
  ["json", schema$1.schema],
21229
21229
  ["yaml11", schema$2.schema],
@@ -21305,9 +21305,9 @@ var require_Schema = __commonJS((exports) => {
21305
21305
  var sortMapEntriesByKey = (a2, b) => a2.key < b.key ? -1 : a2.key > b.key ? 1 : 0;
21306
21306
 
21307
21307
  class Schema {
21308
- constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema8, sortMapEntries, toStringDefaults }) {
21308
+ constructor({ compat: compat2, customTags, merge: merge3, resolveKnownTags, schema: schema9, sortMapEntries, toStringDefaults }) {
21309
21309
  this.compat = Array.isArray(compat2) ? tags.getTags(compat2, "compat") : compat2 ? tags.getTags(null, compat2) : null;
21310
- this.name = typeof schema8 === "string" && schema8 || "core";
21310
+ this.name = typeof schema9 === "string" && schema9 || "core";
21311
21311
  this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
21312
21312
  this.tags = tags.getTags(customTags, this.name, merge3);
21313
21313
  this.toStringOptions = toStringDefaults ?? null;
@@ -22799,11 +22799,11 @@ var require_compose_scalar = __commonJS((exports) => {
22799
22799
  scalar.comment = comment;
22800
22800
  return scalar;
22801
22801
  }
22802
- function findScalarTagByName(schema8, value, tagName, tagToken, onError) {
22802
+ function findScalarTagByName(schema9, value, tagName, tagToken, onError) {
22803
22803
  if (tagName === "!")
22804
- return schema8[identity3.SCALAR];
22804
+ return schema9[identity3.SCALAR];
22805
22805
  const matchWithTest = [];
22806
- for (const tag of schema8.tags) {
22806
+ for (const tag of schema9.tags) {
22807
22807
  if (!tag.collection && tag.tag === tagName) {
22808
22808
  if (tag.default && tag.test)
22809
22809
  matchWithTest.push(tag);
@@ -22814,18 +22814,18 @@ var require_compose_scalar = __commonJS((exports) => {
22814
22814
  for (const tag of matchWithTest)
22815
22815
  if (tag.test?.test(value))
22816
22816
  return tag;
22817
- const kt3 = schema8.knownTags[tagName];
22817
+ const kt3 = schema9.knownTags[tagName];
22818
22818
  if (kt3 && !kt3.collection) {
22819
- schema8.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
22819
+ schema9.tags.push(Object.assign({}, kt3, { default: false, test: undefined }));
22820
22820
  return kt3;
22821
22821
  }
22822
22822
  onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
22823
- return schema8[identity3.SCALAR];
22823
+ return schema9[identity3.SCALAR];
22824
22824
  }
22825
- function findScalarTagByTest({ atKey, directives, schema: schema8 }, value, token, onError) {
22826
- const tag = schema8.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema8[identity3.SCALAR];
22827
- if (schema8.compat) {
22828
- const compat2 = schema8.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema8[identity3.SCALAR];
22825
+ function findScalarTagByTest({ atKey, directives, schema: schema9 }, value, token, onError) {
22826
+ const tag = schema9.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema9[identity3.SCALAR];
22827
+ if (schema9.compat) {
22828
+ const compat2 = schema9.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema9[identity3.SCALAR];
22829
22829
  if (tag.tag !== compat2.tag) {
22830
22830
  const ts = directives.tagString(tag.tag);
22831
22831
  const cs = directives.tagString(compat2.tag);
@@ -25463,7 +25463,7 @@ var require_main = __commonJS((exports, module) => {
25463
25463
  return { parsed: parsedAll };
25464
25464
  }
25465
25465
  }
25466
- function config9(options) {
25466
+ function config10(options) {
25467
25467
  if (_dotenvKey(options).length === 0) {
25468
25468
  return DotenvModule.configDotenv(options);
25469
25469
  }
@@ -25534,7 +25534,7 @@ var require_main = __commonJS((exports, module) => {
25534
25534
  configDotenv,
25535
25535
  _configVault,
25536
25536
  _parseVault,
25537
- config: config9,
25537
+ config: config10,
25538
25538
  decrypt,
25539
25539
  parse: parse9,
25540
25540
  populate
@@ -27503,7 +27503,7 @@ function cleanDoc(doc2) {
27503
27503
  return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
27504
27504
  }
27505
27505
  function replaceEndOfLine(doc2, replacement = literalline) {
27506
- return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join15(replacement, currentDoc.split(`
27506
+ return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join18(replacement, currentDoc.split(`
27507
27507
  `)) : currentDoc);
27508
27508
  }
27509
27509
  function canBreakFn(doc2) {
@@ -27583,7 +27583,7 @@ function indentIfBreak(contents, options) {
27583
27583
  negate: options.negate
27584
27584
  };
27585
27585
  }
27586
- function join15(separator, docs) {
27586
+ function join18(separator, docs) {
27587
27587
  assertDoc(separator);
27588
27588
  assertDocArray(docs);
27589
27589
  const parts = [];
@@ -28294,7 +28294,7 @@ var init_doc = __esm(() => {
28294
28294
  MODE_FLAT = Symbol("MODE_FLAT");
28295
28295
  DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
28296
28296
  builders = {
28297
- join: join15,
28297
+ join: join18,
28298
28298
  line,
28299
28299
  softline,
28300
28300
  hardline,
@@ -115905,11 +115905,11 @@ function chooseDescription(descriptions, printWidth) {
115905
115905
  return firstWidth > printWidth && firstWidth > secondWidth ? secondDescription : firstDescription;
115906
115906
  }
115907
115907
  function createSchema(SchemaConstructor, parameters) {
115908
- const schema9 = new SchemaConstructor(parameters);
115909
- const subSchema = Object.create(schema9);
115908
+ const schema10 = new SchemaConstructor(parameters);
115909
+ const subSchema = Object.create(schema10);
115910
115910
  for (const handlerKey of HANDLER_KEYS) {
115911
115911
  if (handlerKey in parameters) {
115912
- subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema9, Schema2.prototype[handlerKey].length);
115912
+ subSchema[handlerKey] = normalizeHandler(parameters[handlerKey], schema10, Schema2.prototype[handlerKey].length);
115913
115913
  }
115914
115914
  }
115915
115915
  return subSchema;
@@ -116166,8 +116166,8 @@ async function loadEditorconfigInternal(file2, { shouldCache }) {
116166
116166
  const directory = path52.dirname(file2);
116167
116167
  const root2 = await findProjectRoot2(directory, { shouldCache });
116168
116168
  const editorConfig = await import_editorconfig.default.parse(file2, { root: root2 });
116169
- const config10 = editorconfig_to_prettier_default(editorConfig);
116170
- return config10;
116169
+ const config11 = editorconfig_to_prettier_default(editorConfig);
116170
+ return config11;
116171
116171
  }
116172
116172
  function loadEditorconfig(file2, { shouldCache }) {
116173
116173
  file2 = path52.resolve(file2);
@@ -116351,7 +116351,7 @@ function unicodeEscape() {
116351
116351
  }
116352
116352
  return String.fromCodePoint(parseInt(buffer2, 16));
116353
116353
  }
116354
- function push3() {
116354
+ function push4() {
116355
116355
  let value;
116356
116356
  switch (token.type) {
116357
116357
  case "punctuator":
@@ -118157,18 +118157,18 @@ async function loadConfig(configFile) {
118157
118157
  if (!load2) {
118158
118158
  throw new Error(`No loader specified for extension "${extension || "noExt"}"`);
118159
118159
  }
118160
- let config10 = await load2(configFile);
118161
- if (!config10) {
118160
+ let config11 = await load2(configFile);
118161
+ if (!config11) {
118162
118162
  return;
118163
118163
  }
118164
- if (typeof config10 === "string") {
118165
- config10 = await load_external_config_default(config10, configFile);
118164
+ if (typeof config11 === "string") {
118165
+ config11 = await load_external_config_default(config11, configFile);
118166
118166
  }
118167
- if (typeof config10 !== "object") {
118168
- throw new TypeError(`Config is only allowed to be an object, but received ${typeof config10} in "${configFile}"`);
118167
+ if (typeof config11 !== "object") {
118168
+ throw new TypeError(`Config is only allowed to be an object, but received ${typeof config11} in "${configFile}"`);
118169
118169
  }
118170
- delete config10.$schema;
118171
- return config10;
118170
+ delete config11.$schema;
118171
+ return config11;
118172
118172
  }
118173
118173
  function clearPrettierConfigCache() {
118174
118174
  loadCache.clear();
@@ -118218,8 +118218,8 @@ async function loadPrettierConfig2(file2, options8) {
118218
118218
  return;
118219
118219
  }
118220
118220
  configFile = toPath3(configFile);
118221
- const config10 = await loadPrettierConfig(configFile, { shouldCache });
118222
- return { config: config10, configFile };
118221
+ const config11 = await loadPrettierConfig(configFile, { shouldCache });
118222
+ return { config: config11, configFile };
118223
118223
  }
118224
118224
  async function resolveConfig(fileUrlOrPath, options8) {
118225
118225
  options8 = { useCache: true, ...options8 };
@@ -118246,8 +118246,8 @@ async function resolveConfigFile(fileUrlOrPath) {
118246
118246
  return result ?? null;
118247
118247
  }
118248
118248
  function mergeOverrides(configResult, filePath) {
118249
- const { config: config10, configFile } = configResult || {};
118250
- const { overrides, ...options8 } = config10 || {};
118249
+ const { config: config11, configFile } = configResult || {};
118250
+ const { overrides, ...options8 } = config11 || {};
118251
118251
  if (filePath && overrides) {
118252
118252
  const relativeFilePath = path102.relative(path102.dirname(configFile), filePath);
118253
118253
  for (const override of overrides) {
@@ -119126,7 +119126,7 @@ function inferParser(options8, fileInfo) {
119126
119126
  return language?.parsers[0];
119127
119127
  }
119128
119128
  function normalizeOptions4(options8, optionInfos, {
119129
- logger = false,
119129
+ logger: logger2 = false,
119130
119130
  isCLI = false,
119131
119131
  passThrough = false,
119132
119132
  FlagSchema,
@@ -119161,11 +119161,11 @@ function normalizeOptions4(options8, optionInfos, {
119161
119161
  FlagSchema
119162
119162
  });
119163
119163
  const normalizer = new Normalizer(schemas3, {
119164
- logger,
119164
+ logger: logger2,
119165
119165
  unknown: unknown2,
119166
119166
  descriptor
119167
119167
  });
119168
- const shouldSuppressDuplicateDeprecationWarnings = logger !== false;
119168
+ const shouldSuppressDuplicateDeprecationWarnings = logger2 !== false;
119169
119169
  if (shouldSuppressDuplicateDeprecationWarnings && hasDeprecationWarned) {
119170
119170
  normalizer._hasDeprecationWarned = hasDeprecationWarned;
119171
119171
  }
@@ -119249,9 +119249,9 @@ function optionInfoToSchema(optionInfo, {
119249
119249
  throw new Error(`Unexpected type ${optionInfo.type}`);
119250
119250
  }
119251
119251
  if (optionInfo.exception) {
119252
- parameters.validate = (value, schema9, utils3) => optionInfo.exception(value) || schema9.validate(value, utils3);
119252
+ parameters.validate = (value, schema10, utils3) => optionInfo.exception(value) || schema10.validate(value, utils3);
119253
119253
  } else {
119254
- parameters.validate = (value, schema9, utils3) => value === undefined || schema9.validate(value, utils3);
119254
+ parameters.validate = (value, schema10, utils3) => value === undefined || schema10.validate(value, utils3);
119255
119255
  }
119256
119256
  if (optionInfo.redirect) {
119257
119257
  handlers.redirect = (value) => !value ? undefined : {
@@ -119266,7 +119266,7 @@ function optionInfoToSchema(optionInfo, {
119266
119266
  }
119267
119267
  if (isCLI && !optionInfo.array) {
119268
119268
  const originalPreprocess = parameters.preprocess || ((x10) => x10);
119269
- parameters.preprocess = (value, schema9, utils3) => schema9.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
119269
+ parameters.preprocess = (value, schema10, utils3) => schema10.preprocess(originalPreprocess(Array.isArray(value) ? method_at_default2(0, value, -1) : value), utils3);
119270
119270
  }
119271
119271
  return optionInfo.array ? ArraySchema.create({
119272
119272
  ...isCLI ? {
@@ -120356,16 +120356,16 @@ async function getFileInfo(file2, options8 = {}) {
120356
120356
  };
120357
120357
  }
120358
120358
  async function getParser(file2, options8) {
120359
- let config10;
120359
+ let config11;
120360
120360
  if (options8.resolveConfig !== false) {
120361
- config10 = await resolveConfig(file2, {
120361
+ config11 = await resolveConfig(file2, {
120362
120362
  editorconfig: false
120363
120363
  });
120364
120364
  }
120365
- if (config10?.parser) {
120366
- return config10.parser;
120365
+ if (config11?.parser) {
120366
+ return config11.parser;
120367
120367
  }
120368
- let plugins = options8.plugins ?? config10?.plugins ?? [];
120368
+ let plugins = options8.plugins ?? config11?.plugins ?? [];
120369
120369
  plugins = (await Promise.all([load_builtin_plugins_default(), load_plugins_default(plugins)])).flat();
120370
120370
  return infer_parser_default({ plugins }, { physicalFile: file2 });
120371
120371
  }
@@ -120760,7 +120760,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120760
120760
  `));
120761
120761
  }
120762
120762
  return chooseDescription(descriptions, utils3.loggerPrintWidth);
120763
- }, import_picocolors32, levenUnknownHandler = (key2, value, { descriptor, logger, schemas: schemas3 }) => {
120763
+ }, import_picocolors32, levenUnknownHandler = (key2, value, { descriptor, logger: logger2, schemas: schemas3 }) => {
120764
120764
  const messages2 = [
120765
120765
  `Ignored unknown option ${import_picocolors32.default.yellow(descriptor.pair({ key: key2, value }))}.`
120766
120766
  ];
@@ -120768,7 +120768,7 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120768
120768
  if (suggestion) {
120769
120769
  messages2.push(`Did you mean ${import_picocolors32.default.blue(descriptor.key(suggestion))}?`);
120770
120770
  }
120771
- logger.warn(messages2.join(" "));
120771
+ logger2.warn(messages2.join(" "));
120772
120772
  }, HANDLER_KEYS, Schema2 = class {
120773
120773
  static create(parameters) {
120774
120774
  return createSchema(this, parameters);
@@ -120805,10 +120805,10 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120805
120805
  }
120806
120806
  }, AliasSchema, AnySchema, ArraySchema, BooleanSchema, ChoiceSchema, NumberSchema, IntegerSchema, StringSchema, defaultDescriptor, defaultUnknownHandler, defaultInvalidHandler, defaultDeprecatedHandler, Normalizer = class {
120807
120807
  constructor(schemas3, opts) {
120808
- const { logger = console, loggerPrintWidth = 80, descriptor = defaultDescriptor, unknown: unknown2 = defaultUnknownHandler, invalid = defaultInvalidHandler, deprecated = defaultDeprecatedHandler, missing = () => false, required: required2 = () => false, preprocess: preprocess2 = (x10) => x10, postprocess = () => VALUE_UNCHANGED } = opts || {};
120808
+ const { logger: logger2 = console, loggerPrintWidth = 80, descriptor = defaultDescriptor, unknown: unknown2 = defaultUnknownHandler, invalid = defaultInvalidHandler, deprecated = defaultDeprecatedHandler, missing = () => false, required: required2 = () => false, preprocess: preprocess2 = (x10) => x10, postprocess = () => VALUE_UNCHANGED } = opts || {};
120809
120809
  this._utils = {
120810
120810
  descriptor,
120811
- logger: logger || { warn: () => {} },
120811
+ logger: logger2 || { warn: () => {} },
120812
120812
  loggerPrintWidth,
120813
120813
  schemas: recordFromArray(schemas3, "name"),
120814
120814
  normalizeDefaultResult,
@@ -120843,9 +120843,9 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120843
120843
  };
120844
120844
  applyNormalization();
120845
120845
  for (const key2 of Object.keys(this._utils.schemas)) {
120846
- const schema9 = this._utils.schemas[key2];
120846
+ const schema10 = this._utils.schemas[key2];
120847
120847
  if (!(key2 in newOptions)) {
120848
- const defaultResult = normalizeDefaultResult(schema9.default(this._utils));
120848
+ const defaultResult = normalizeDefaultResult(schema10.default(this._utils));
120849
120849
  if ("value" in defaultResult) {
120850
120850
  restOptionsArray.push({ [key2]: defaultResult.value });
120851
120851
  }
@@ -120856,13 +120856,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120856
120856
  if (!(key2 in newOptions)) {
120857
120857
  continue;
120858
120858
  }
120859
- const schema9 = this._utils.schemas[key2];
120859
+ const schema10 = this._utils.schemas[key2];
120860
120860
  const value = newOptions[key2];
120861
- const newValue = schema9.postprocess(value, this._utils);
120861
+ const newValue = schema10.postprocess(value, this._utils);
120862
120862
  if (newValue === VALUE_UNCHANGED) {
120863
120863
  continue;
120864
120864
  }
120865
- this._applyValidation(newValue, key2, schema9);
120865
+ this._applyValidation(newValue, key2, schema10);
120866
120866
  newOptions[key2] = newValue;
120867
120867
  }
120868
120868
  this._applyPostprocess(newOptions);
@@ -120873,14 +120873,14 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120873
120873
  const transferredOptionsArray = [];
120874
120874
  const { knownKeys, unknownKeys } = this._partitionOptionKeys(options8);
120875
120875
  for (const key2 of knownKeys) {
120876
- const schema9 = this._utils.schemas[key2];
120877
- const value = schema9.preprocess(options8[key2], this._utils);
120878
- this._applyValidation(value, key2, schema9);
120876
+ const schema10 = this._utils.schemas[key2];
120877
+ const value = schema10.preprocess(options8[key2], this._utils);
120878
+ this._applyValidation(value, key2, schema10);
120879
120879
  const appendTransferredOptions = ({ from, to: to5 }) => {
120880
120880
  transferredOptionsArray.push(typeof to5 === "string" ? { [to5]: from } : { [to5.key]: to5.value });
120881
120881
  };
120882
120882
  const warnDeprecated = ({ value: currentValue, redirectTo }) => {
120883
- const deprecatedResult = normalizeDeprecatedResult(schema9.deprecated(currentValue, this._utils), value, true);
120883
+ const deprecatedResult = normalizeDeprecatedResult(schema10.deprecated(currentValue, this._utils), value, true);
120884
120884
  if (deprecatedResult === false) {
120885
120885
  return;
120886
120886
  }
@@ -120898,13 +120898,13 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120898
120898
  }
120899
120899
  }
120900
120900
  };
120901
- const forwardResult = normalizeForwardResult(schema9.forward(value, this._utils), value);
120901
+ const forwardResult = normalizeForwardResult(schema10.forward(value, this._utils), value);
120902
120902
  forwardResult.forEach(appendTransferredOptions);
120903
- const redirectResult = normalizeRedirectResult(schema9.redirect(value, this._utils), value);
120903
+ const redirectResult = normalizeRedirectResult(schema10.redirect(value, this._utils), value);
120904
120904
  redirectResult.redirect.forEach(appendTransferredOptions);
120905
120905
  if ("remain" in redirectResult) {
120906
120906
  const remainingValue = redirectResult.remain;
120907
- newOptions[key2] = key2 in newOptions ? schema9.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
120907
+ newOptions[key2] = key2 in newOptions ? schema10.overlap(newOptions[key2], remainingValue, this._utils) : remainingValue;
120908
120908
  warnDeprecated({ value: remainingValue });
120909
120909
  }
120910
120910
  for (const { from, to: to5 } of redirectResult.redirect) {
@@ -120932,8 +120932,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120932
120932
  const [knownKeys, unknownKeys] = partition(Object.keys(options8).filter((key2) => !this._identifyMissing(key2, options8)), (key2) => (key2 in this._utils.schemas));
120933
120933
  return { knownKeys, unknownKeys };
120934
120934
  }
120935
- _applyValidation(value, key2, schema9) {
120936
- const validateResult = normalizeValidateResult(schema9.validate(value, this._utils), value);
120935
+ _applyValidation(value, key2, schema10) {
120936
+ const validateResult = normalizeValidateResult(schema10.validate(value, this._utils), value);
120937
120937
  if (validateResult !== true) {
120938
120938
  throw this._invalidHandler(key2, validateResult.value, this._utils);
120939
120939
  }
@@ -120975,8 +120975,8 @@ var require2, __filename2, __dirname3, __create2, __defProp3, __getOwnPropDesc,
120975
120975
  for (const key2 of unknownKeys) {
120976
120976
  const value = postprocessed.override[key2];
120977
120977
  this._applyUnknownHandler(key2, value, options8, (knownResultKey, knownResultValue) => {
120978
- const schema9 = this._utils.schemas[knownResultKey];
120979
- this._applyValidation(knownResultValue, knownResultKey, schema9);
120978
+ const schema10 = this._utils.schemas[knownResultKey];
120979
+ this._applyValidation(knownResultValue, knownResultKey, schema10);
120980
120980
  options8[knownResultKey] = knownResultValue;
120981
120981
  });
120982
120982
  }
@@ -130673,7 +130673,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
130673
130673
  if (token.type === "eof") {
130674
130674
  throw invalidEOF();
130675
130675
  }
130676
- push3();
130676
+ push4();
130677
130677
  },
130678
130678
  beforePropertyName() {
130679
130679
  switch (token.type) {
@@ -130699,7 +130699,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
130699
130699
  if (token.type === "eof") {
130700
130700
  throw invalidEOF();
130701
130701
  }
130702
- push3();
130702
+ push4();
130703
130703
  },
130704
130704
  beforeArrayValue() {
130705
130705
  if (token.type === "eof") {
@@ -130709,7 +130709,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
130709
130709
  pop();
130710
130710
  return;
130711
130711
  }
130712
- push3();
130712
+ push4();
130713
130713
  },
130714
130714
  afterPropertyValue() {
130715
130715
  if (token.type === "eof") {
@@ -133208,7 +133208,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133208
133208
  return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
133209
133209
  }
133210
133210
  function replaceEndOfLine2(doc2, replacement = literalline2) {
133211
- return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join17(replacement, currentDoc.split(`
133211
+ return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join20(replacement, currentDoc.split(`
133212
133212
  `)) : currentDoc);
133213
133213
  }
133214
133214
  function canBreakFn2(doc2) {
@@ -133294,7 +133294,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133294
133294
  negate: options8.negate
133295
133295
  };
133296
133296
  }
133297
- function join17(separator, docs) {
133297
+ function join20(separator, docs) {
133298
133298
  assertDoc2(separator);
133299
133299
  assertDocArray2(docs);
133300
133300
  const parts = [];
@@ -133959,7 +133959,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
133959
133959
  }
133960
133960
  }
133961
133961
  var builders2 = {
133962
- join: join17,
133962
+ join: join20,
133963
133963
  line: line3,
133964
133964
  softline: softline2,
133965
133965
  hardline: hardline4,
@@ -134689,23 +134689,23 @@ var require_JSONSchema = __commonJS((exports) => {
134689
134689
  exports.Parent = Symbol("Parent");
134690
134690
  exports.Types = Symbol("Types");
134691
134691
  exports.Intersection = Symbol("Intersection");
134692
- exports.getRootSchema = (0, lodash_1.memoize)((schema9) => {
134693
- const parent = schema9[exports.Parent];
134692
+ exports.getRootSchema = (0, lodash_1.memoize)((schema10) => {
134693
+ const parent = schema10[exports.Parent];
134694
134694
  if (!parent) {
134695
- return schema9;
134695
+ return schema10;
134696
134696
  }
134697
134697
  return (0, exports.getRootSchema)(parent);
134698
134698
  });
134699
- function isBoolean(schema9) {
134700
- return schema9 === true || schema9 === false;
134699
+ function isBoolean(schema10) {
134700
+ return schema10 === true || schema10 === false;
134701
134701
  }
134702
134702
  exports.isBoolean = isBoolean;
134703
- function isPrimitive(schema9) {
134704
- return !(0, lodash_1.isPlainObject)(schema9);
134703
+ function isPrimitive(schema10) {
134704
+ return !(0, lodash_1.isPlainObject)(schema10);
134705
134705
  }
134706
134706
  exports.isPrimitive = isPrimitive;
134707
- function isCompound(schema9) {
134708
- return Array.isArray(schema9.type) || "anyOf" in schema9 || "oneOf" in schema9;
134707
+ function isCompound(schema10) {
134708
+ return Array.isArray(schema10.type) || "anyOf" in schema10 || "oneOf" in schema10;
134709
134709
  }
134710
134710
  exports.isCompound = isCompound;
134711
134711
  });
@@ -134932,9 +134932,9 @@ var require_type2 = __commonJS((exports, module) => {
134932
134932
  var require_schema5 = __commonJS((exports, module) => {
134933
134933
  var YAMLException = require_exception2();
134934
134934
  var Type = require_type2();
134935
- function compileList(schema9, name2) {
134935
+ function compileList(schema10, name2) {
134936
134936
  var result = [];
134937
- schema9[name2].forEach(function(currentType) {
134937
+ schema10[name2].forEach(function(currentType) {
134938
134938
  var newIndex = result.length;
134939
134939
  result.forEach(function(previousType, previousIndex) {
134940
134940
  if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
@@ -136879,7 +136879,7 @@ var require_dumper2 = __commonJS((exports, module) => {
136879
136879
  "OFF"
136880
136880
  ];
136881
136881
  var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
136882
- function compileStyleMap(schema9, map2) {
136882
+ function compileStyleMap(schema10, map2) {
136883
136883
  var result, keys, index, length, tag, style, type;
136884
136884
  if (map2 === null)
136885
136885
  return {};
@@ -136891,7 +136891,7 @@ var require_dumper2 = __commonJS((exports, module) => {
136891
136891
  if (tag.slice(0, 2) === "!!") {
136892
136892
  tag = "tag:yaml.org,2002:" + tag.slice(2);
136893
136893
  }
136894
- type = schema9.compiledTypeMap["fallback"][tag];
136894
+ type = schema10.compiledTypeMap["fallback"][tag];
136895
136895
  if (type && _hasOwnProperty.call(type.styleAliases, style)) {
136896
136896
  style = type.styleAliases[style];
136897
136897
  }
@@ -137550,11 +137550,11 @@ var require_utils7 = __commonJS((exports) => {
137550
137550
  function traverseArray(arr, callback, processed) {
137551
137551
  arr.forEach((s5, k9) => traverse(s5, callback, processed, k9.toString()));
137552
137552
  }
137553
- function traverseIntersection(schema9, callback, processed) {
137554
- if (typeof schema9 !== "object" || !schema9) {
137553
+ function traverseIntersection(schema10, callback, processed) {
137554
+ if (typeof schema10 !== "object" || !schema10) {
137555
137555
  return;
137556
137556
  }
137557
- const r5 = schema9;
137557
+ const r5 = schema10;
137558
137558
  const intersection2 = r5[JSONSchema_1.Intersection];
137559
137559
  if (!intersection2) {
137560
137560
  return;
@@ -137563,60 +137563,60 @@ var require_utils7 = __commonJS((exports) => {
137563
137563
  traverseArray(intersection2.allOf, callback, processed);
137564
137564
  }
137565
137565
  }
137566
- function traverse(schema9, callback, processed = new Set, key2) {
137567
- if (processed.has(schema9)) {
137566
+ function traverse(schema10, callback, processed = new Set, key2) {
137567
+ if (processed.has(schema10)) {
137568
137568
  return;
137569
137569
  }
137570
- processed.add(schema9);
137571
- callback(schema9, key2 !== null && key2 !== undefined ? key2 : null);
137572
- if (schema9.anyOf) {
137573
- traverseArray(schema9.anyOf, callback, processed);
137570
+ processed.add(schema10);
137571
+ callback(schema10, key2 !== null && key2 !== undefined ? key2 : null);
137572
+ if (schema10.anyOf) {
137573
+ traverseArray(schema10.anyOf, callback, processed);
137574
137574
  }
137575
- if (schema9.allOf) {
137576
- traverseArray(schema9.allOf, callback, processed);
137575
+ if (schema10.allOf) {
137576
+ traverseArray(schema10.allOf, callback, processed);
137577
137577
  }
137578
- if (schema9.oneOf) {
137579
- traverseArray(schema9.oneOf, callback, processed);
137578
+ if (schema10.oneOf) {
137579
+ traverseArray(schema10.oneOf, callback, processed);
137580
137580
  }
137581
- if (schema9.properties) {
137582
- traverseObjectKeys(schema9.properties, callback, processed);
137581
+ if (schema10.properties) {
137582
+ traverseObjectKeys(schema10.properties, callback, processed);
137583
137583
  }
137584
- if (schema9.patternProperties) {
137585
- traverseObjectKeys(schema9.patternProperties, callback, processed);
137584
+ if (schema10.patternProperties) {
137585
+ traverseObjectKeys(schema10.patternProperties, callback, processed);
137586
137586
  }
137587
- if (schema9.additionalProperties && typeof schema9.additionalProperties === "object") {
137588
- traverse(schema9.additionalProperties, callback, processed);
137587
+ if (schema10.additionalProperties && typeof schema10.additionalProperties === "object") {
137588
+ traverse(schema10.additionalProperties, callback, processed);
137589
137589
  }
137590
- if (schema9.items) {
137591
- const { items } = schema9;
137590
+ if (schema10.items) {
137591
+ const { items } = schema10;
137592
137592
  if (Array.isArray(items)) {
137593
137593
  traverseArray(items, callback, processed);
137594
137594
  } else {
137595
137595
  traverse(items, callback, processed);
137596
137596
  }
137597
137597
  }
137598
- if (schema9.additionalItems && typeof schema9.additionalItems === "object") {
137599
- traverse(schema9.additionalItems, callback, processed);
137598
+ if (schema10.additionalItems && typeof schema10.additionalItems === "object") {
137599
+ traverse(schema10.additionalItems, callback, processed);
137600
137600
  }
137601
- if (schema9.dependencies) {
137602
- if (Array.isArray(schema9.dependencies)) {
137603
- traverseArray(schema9.dependencies, callback, processed);
137601
+ if (schema10.dependencies) {
137602
+ if (Array.isArray(schema10.dependencies)) {
137603
+ traverseArray(schema10.dependencies, callback, processed);
137604
137604
  } else {
137605
- traverseObjectKeys(schema9.dependencies, callback, processed);
137605
+ traverseObjectKeys(schema10.dependencies, callback, processed);
137606
137606
  }
137607
137607
  }
137608
- if (schema9.definitions) {
137609
- traverseObjectKeys(schema9.definitions, callback, processed);
137608
+ if (schema10.definitions) {
137609
+ traverseObjectKeys(schema10.definitions, callback, processed);
137610
137610
  }
137611
- if (schema9.$defs) {
137612
- traverseObjectKeys(schema9.$defs, callback, processed);
137611
+ if (schema10.$defs) {
137612
+ traverseObjectKeys(schema10.$defs, callback, processed);
137613
137613
  }
137614
- if (schema9.not) {
137615
- traverse(schema9.not, callback, processed);
137614
+ if (schema10.not) {
137615
+ traverse(schema10.not, callback, processed);
137616
137616
  }
137617
- traverseIntersection(schema9, callback, processed);
137618
- Object.keys(schema9).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
137619
- const child = schema9[key3];
137617
+ traverseIntersection(schema10, callback, processed);
137618
+ Object.keys(schema10).filter((key3) => !BLACKLISTED_KEYS.has(key3)).forEach((key3) => {
137619
+ const child = schema10[key3];
137620
137620
  if (child && typeof child === "object") {
137621
137621
  traverseObjectKeys(child, callback, processed);
137622
137622
  }
@@ -137698,14 +137698,14 @@ var require_utils7 = __commonJS((exports) => {
137698
137698
  return (_g2 = color()) === null || _g2 === undefined ? undefined : _g2.whiteBright.bgYellow;
137699
137699
  }
137700
137700
  }
137701
- function escapeBlockComment(schema9) {
137701
+ function escapeBlockComment(schema10) {
137702
137702
  const replacer = "* /";
137703
- if (schema9 === null || typeof schema9 !== "object") {
137703
+ if (schema10 === null || typeof schema10 !== "object") {
137704
137704
  return;
137705
137705
  }
137706
- for (const key2 of Object.keys(schema9)) {
137707
- if (key2 === "description" && typeof schema9[key2] === "string") {
137708
- schema9[key2] = schema9[key2].replace(/\*\//g, replacer);
137706
+ for (const key2 of Object.keys(schema10)) {
137707
+ if (key2 === "description" && typeof schema10[key2] === "string") {
137708
+ schema10[key2] = schema10[key2].replace(/\*\//g, replacer);
137709
137709
  }
137710
137710
  }
137711
137711
  }
@@ -137717,45 +137717,45 @@ var require_utils7 = __commonJS((exports) => {
137717
137717
  return path_1.posix.join(path_1.posix.normalize(outputPath), ...filePathRel);
137718
137718
  }
137719
137719
  exports.pathTransform = pathTransform;
137720
- function maybeStripDefault(schema9) {
137721
- if (!("default" in schema9)) {
137722
- return schema9;
137720
+ function maybeStripDefault(schema10) {
137721
+ if (!("default" in schema10)) {
137722
+ return schema10;
137723
137723
  }
137724
- switch (schema9.type) {
137724
+ switch (schema10.type) {
137725
137725
  case "array":
137726
- if (Array.isArray(schema9.default)) {
137727
- return schema9;
137726
+ if (Array.isArray(schema10.default)) {
137727
+ return schema10;
137728
137728
  }
137729
137729
  break;
137730
137730
  case "boolean":
137731
- if (typeof schema9.default === "boolean") {
137732
- return schema9;
137731
+ if (typeof schema10.default === "boolean") {
137732
+ return schema10;
137733
137733
  }
137734
137734
  break;
137735
137735
  case "integer":
137736
137736
  case "number":
137737
- if (typeof schema9.default === "number") {
137738
- return schema9;
137737
+ if (typeof schema10.default === "number") {
137738
+ return schema10;
137739
137739
  }
137740
137740
  break;
137741
137741
  case "string":
137742
- if (typeof schema9.default === "string") {
137743
- return schema9;
137742
+ if (typeof schema10.default === "string") {
137743
+ return schema10;
137744
137744
  }
137745
137745
  break;
137746
137746
  case "null":
137747
- if (schema9.default === null) {
137748
- return schema9;
137747
+ if (schema10.default === null) {
137748
+ return schema10;
137749
137749
  }
137750
137750
  break;
137751
137751
  case "object":
137752
- if ((0, lodash_1.isPlainObject)(schema9.default)) {
137753
- return schema9;
137752
+ if ((0, lodash_1.isPlainObject)(schema10.default)) {
137753
+ return schema10;
137754
137754
  }
137755
137755
  break;
137756
137756
  }
137757
- delete schema9.default;
137758
- return schema9;
137757
+ delete schema10.default;
137758
+ return schema10;
137759
137759
  }
137760
137760
  exports.maybeStripDefault = maybeStripDefault;
137761
137761
  function appendToDescription(existingDescription, ...values) {
@@ -137769,11 +137769,11 @@ ${values.join(`
137769
137769
  `);
137770
137770
  }
137771
137771
  exports.appendToDescription = appendToDescription;
137772
- function isSchemaLike(schema9) {
137773
- if (!(0, lodash_1.isPlainObject)(schema9)) {
137772
+ function isSchemaLike(schema10) {
137773
+ if (!(0, lodash_1.isPlainObject)(schema10)) {
137774
137774
  return false;
137775
137775
  }
137776
- const parent = schema9[JSONSchema_1.Parent];
137776
+ const parent = schema10[JSONSchema_1.Parent];
137777
137777
  if (parent === null) {
137778
137778
  return true;
137779
137779
  }
@@ -137790,7 +137790,7 @@ ${values.join(`
137790
137790
  "properties",
137791
137791
  "required"
137792
137792
  ];
137793
- if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema9)) {
137793
+ if (JSON_SCHEMA_KEYWORDS.some((_10) => parent[_10] === schema10)) {
137794
137794
  return false;
137795
137795
  }
137796
137796
  return true;
@@ -138088,13 +138088,13 @@ var require_typesOfSchema = __commonJS((exports) => {
138088
138088
  exports.typesOfSchema = undefined;
138089
138089
  var lodash_1 = require_lodash();
138090
138090
  var JSONSchema_1 = require_JSONSchema();
138091
- function typesOfSchema(schema9) {
138092
- if (schema9.tsType) {
138091
+ function typesOfSchema(schema10) {
138092
+ if (schema10.tsType) {
138093
138093
  return new Set(["CUSTOM_TYPE"]);
138094
138094
  }
138095
138095
  const matchedTypes = new Set;
138096
138096
  for (const [schemaType, f7] of Object.entries(matchers)) {
138097
- if (f7(schema9)) {
138097
+ if (f7(schema10)) {
138098
138098
  matchedTypes.add(schemaType);
138099
138099
  }
138100
138100
  }
@@ -138105,26 +138105,26 @@ var require_typesOfSchema = __commonJS((exports) => {
138105
138105
  }
138106
138106
  exports.typesOfSchema = typesOfSchema;
138107
138107
  var matchers = {
138108
- ALL_OF(schema9) {
138109
- return "allOf" in schema9;
138108
+ ALL_OF(schema10) {
138109
+ return "allOf" in schema10;
138110
138110
  },
138111
- ANY(schema9) {
138112
- if (Object.keys(schema9).length === 0) {
138111
+ ANY(schema10) {
138112
+ if (Object.keys(schema10).length === 0) {
138113
138113
  return true;
138114
138114
  }
138115
- return schema9.type === "any";
138115
+ return schema10.type === "any";
138116
138116
  },
138117
- ANY_OF(schema9) {
138118
- return "anyOf" in schema9;
138117
+ ANY_OF(schema10) {
138118
+ return "anyOf" in schema10;
138119
138119
  },
138120
- BOOLEAN(schema9) {
138121
- if ("enum" in schema9) {
138120
+ BOOLEAN(schema10) {
138121
+ if ("enum" in schema10) {
138122
138122
  return false;
138123
138123
  }
138124
- if (schema9.type === "boolean") {
138124
+ if (schema10.type === "boolean") {
138125
138125
  return true;
138126
138126
  }
138127
- if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "boolean") {
138127
+ if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "boolean") {
138128
138128
  return true;
138129
138129
  }
138130
138130
  return false;
@@ -138132,74 +138132,74 @@ var require_typesOfSchema = __commonJS((exports) => {
138132
138132
  CUSTOM_TYPE() {
138133
138133
  return false;
138134
138134
  },
138135
- NAMED_ENUM(schema9) {
138136
- return "enum" in schema9 && "tsEnumNames" in schema9;
138135
+ NAMED_ENUM(schema10) {
138136
+ return "enum" in schema10 && "tsEnumNames" in schema10;
138137
138137
  },
138138
- NAMED_SCHEMA(schema9) {
138139
- return "$id" in schema9 && (("patternProperties" in schema9) || ("properties" in schema9));
138138
+ NAMED_SCHEMA(schema10) {
138139
+ return "$id" in schema10 && (("patternProperties" in schema10) || ("properties" in schema10));
138140
138140
  },
138141
- NEVER(schema9) {
138142
- return schema9 === false;
138141
+ NEVER(schema10) {
138142
+ return schema10 === false;
138143
138143
  },
138144
- NULL(schema9) {
138145
- return schema9.type === "null";
138144
+ NULL(schema10) {
138145
+ return schema10.type === "null";
138146
138146
  },
138147
- NUMBER(schema9) {
138148
- if ("enum" in schema9) {
138147
+ NUMBER(schema10) {
138148
+ if ("enum" in schema10) {
138149
138149
  return false;
138150
138150
  }
138151
- if (schema9.type === "integer" || schema9.type === "number") {
138151
+ if (schema10.type === "integer" || schema10.type === "number") {
138152
138152
  return true;
138153
138153
  }
138154
- if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "number") {
138154
+ if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "number") {
138155
138155
  return true;
138156
138156
  }
138157
138157
  return false;
138158
138158
  },
138159
- OBJECT(schema9) {
138160
- return schema9.type === "object" && !(0, lodash_1.isPlainObject)(schema9.additionalProperties) && !schema9.allOf && !schema9.anyOf && !schema9.oneOf && !schema9.patternProperties && !schema9.properties && !schema9.required;
138159
+ OBJECT(schema10) {
138160
+ return schema10.type === "object" && !(0, lodash_1.isPlainObject)(schema10.additionalProperties) && !schema10.allOf && !schema10.anyOf && !schema10.oneOf && !schema10.patternProperties && !schema10.properties && !schema10.required;
138161
138161
  },
138162
- ONE_OF(schema9) {
138163
- return "oneOf" in schema9;
138162
+ ONE_OF(schema10) {
138163
+ return "oneOf" in schema10;
138164
138164
  },
138165
- REFERENCE(schema9) {
138166
- return "$ref" in schema9;
138165
+ REFERENCE(schema10) {
138166
+ return "$ref" in schema10;
138167
138167
  },
138168
- STRING(schema9) {
138169
- if ("enum" in schema9) {
138168
+ STRING(schema10) {
138169
+ if ("enum" in schema10) {
138170
138170
  return false;
138171
138171
  }
138172
- if (schema9.type === "string") {
138172
+ if (schema10.type === "string") {
138173
138173
  return true;
138174
138174
  }
138175
- if (!(0, JSONSchema_1.isCompound)(schema9) && typeof schema9.default === "string") {
138175
+ if (!(0, JSONSchema_1.isCompound)(schema10) && typeof schema10.default === "string") {
138176
138176
  return true;
138177
138177
  }
138178
138178
  return false;
138179
138179
  },
138180
- TYPED_ARRAY(schema9) {
138181
- if (schema9.type && schema9.type !== "array") {
138180
+ TYPED_ARRAY(schema10) {
138181
+ if (schema10.type && schema10.type !== "array") {
138182
138182
  return false;
138183
138183
  }
138184
- return "items" in schema9;
138184
+ return "items" in schema10;
138185
138185
  },
138186
- UNION(schema9) {
138187
- return Array.isArray(schema9.type);
138186
+ UNION(schema10) {
138187
+ return Array.isArray(schema10.type);
138188
138188
  },
138189
- UNNAMED_ENUM(schema9) {
138190
- if ("tsEnumNames" in schema9) {
138189
+ UNNAMED_ENUM(schema10) {
138190
+ if ("tsEnumNames" in schema10) {
138191
138191
  return false;
138192
138192
  }
138193
- if (schema9.type && schema9.type !== "boolean" && schema9.type !== "integer" && schema9.type !== "number" && schema9.type !== "string") {
138193
+ if (schema10.type && schema10.type !== "boolean" && schema10.type !== "integer" && schema10.type !== "number" && schema10.type !== "string") {
138194
138194
  return false;
138195
138195
  }
138196
- return "enum" in schema9;
138196
+ return "enum" in schema10;
138197
138197
  },
138198
138198
  UNNAMED_SCHEMA() {
138199
138199
  return false;
138200
138200
  },
138201
- UNTYPED_ARRAY(schema9) {
138202
- return schema9.type === "array" && !("items" in schema9);
138201
+ UNTYPED_ARRAY(schema10) {
138202
+ return schema10.type === "array" && !("items" in schema10);
138203
138203
  }
138204
138204
  };
138205
138205
  });
@@ -138210,10 +138210,10 @@ var require_applySchemaTyping = __commonJS((exports) => {
138210
138210
  exports.applySchemaTyping = undefined;
138211
138211
  var JSONSchema_1 = require_JSONSchema();
138212
138212
  var typesOfSchema_1 = require_typesOfSchema();
138213
- function applySchemaTyping(schema9) {
138213
+ function applySchemaTyping(schema10) {
138214
138214
  var _a7;
138215
- const types = (0, typesOfSchema_1.typesOfSchema)(schema9);
138216
- Object.defineProperty(schema9, JSONSchema_1.Types, {
138215
+ const types = (0, typesOfSchema_1.typesOfSchema)(schema10);
138216
+ Object.defineProperty(schema10, JSONSchema_1.Types, {
138217
138217
  enumerable: false,
138218
138218
  value: types,
138219
138219
  writable: false
@@ -138222,23 +138222,23 @@ var require_applySchemaTyping = __commonJS((exports) => {
138222
138222
  return;
138223
138223
  }
138224
138224
  const intersection2 = {
138225
- [JSONSchema_1.Parent]: schema9,
138225
+ [JSONSchema_1.Parent]: schema10,
138226
138226
  [JSONSchema_1.Types]: new Set(["ALL_OF"]),
138227
- $id: schema9.$id,
138228
- description: schema9.description,
138229
- name: schema9.name,
138230
- title: schema9.title,
138231
- allOf: (_a7 = schema9.allOf) !== null && _a7 !== undefined ? _a7 : [],
138227
+ $id: schema10.$id,
138228
+ description: schema10.description,
138229
+ name: schema10.name,
138230
+ title: schema10.title,
138231
+ allOf: (_a7 = schema10.allOf) !== null && _a7 !== undefined ? _a7 : [],
138232
138232
  required: [],
138233
138233
  additionalProperties: false
138234
138234
  };
138235
138235
  types.delete("ALL_OF");
138236
- delete schema9.allOf;
138237
- delete schema9.$id;
138238
- delete schema9.description;
138239
- delete schema9.name;
138240
- delete schema9.title;
138241
- Object.defineProperty(schema9, JSONSchema_1.Intersection, {
138236
+ delete schema10.allOf;
138237
+ delete schema10.$id;
138238
+ delete schema10.description;
138239
+ delete schema10.name;
138240
+ delete schema10.title;
138241
+ Object.defineProperty(schema10, JSONSchema_1.Intersection, {
138242
138242
  enumerable: false,
138243
138243
  value: intersection2,
138244
138244
  writable: false
@@ -138256,186 +138256,186 @@ var require_normalizer = __commonJS((exports) => {
138256
138256
  var applySchemaTyping_1 = require_applySchemaTyping();
138257
138257
  var util_1 = __require("util");
138258
138258
  var rules = new Map;
138259
- function hasType(schema9, type) {
138260
- return schema9.type === type || Array.isArray(schema9.type) && schema9.type.includes(type);
138259
+ function hasType(schema10, type) {
138260
+ return schema10.type === type || Array.isArray(schema10.type) && schema10.type.includes(type);
138261
138261
  }
138262
- function isObjectType(schema9) {
138263
- return schema9.properties !== undefined || hasType(schema9, "object") || hasType(schema9, "any");
138262
+ function isObjectType(schema10) {
138263
+ return schema10.properties !== undefined || hasType(schema10, "object") || hasType(schema10, "any");
138264
138264
  }
138265
- function isArrayType(schema9) {
138266
- return schema9.items !== undefined || hasType(schema9, "array") || hasType(schema9, "any");
138265
+ function isArrayType(schema10) {
138266
+ return schema10.items !== undefined || hasType(schema10, "array") || hasType(schema10, "any");
138267
138267
  }
138268
- function isEnumTypeWithoutTsEnumNames(schema9) {
138269
- return schema9.type === "string" && schema9.enum !== undefined && schema9.tsEnumNames === undefined;
138268
+ function isEnumTypeWithoutTsEnumNames(schema10) {
138269
+ return schema10.type === "string" && schema10.enum !== undefined && schema10.tsEnumNames === undefined;
138270
138270
  }
138271
- rules.set('Remove `type=["null"]` if `enum=[null]`', (schema9) => {
138272
- if (Array.isArray(schema9.enum) && schema9.enum.some((e8) => e8 === null) && Array.isArray(schema9.type) && schema9.type.includes("null")) {
138273
- schema9.type = schema9.type.filter((type) => type !== "null");
138271
+ rules.set('Remove `type=["null"]` if `enum=[null]`', (schema10) => {
138272
+ if (Array.isArray(schema10.enum) && schema10.enum.some((e8) => e8 === null) && Array.isArray(schema10.type) && schema10.type.includes("null")) {
138273
+ schema10.type = schema10.type.filter((type) => type !== "null");
138274
138274
  }
138275
138275
  });
138276
- rules.set("Destructure unary types", (schema9) => {
138277
- if (schema9.type && Array.isArray(schema9.type) && schema9.type.length === 1) {
138278
- schema9.type = schema9.type[0];
138276
+ rules.set("Destructure unary types", (schema10) => {
138277
+ if (schema10.type && Array.isArray(schema10.type) && schema10.type.length === 1) {
138278
+ schema10.type = schema10.type[0];
138279
138279
  }
138280
138280
  });
138281
- rules.set("Add empty `required` property if none is defined", (schema9) => {
138282
- if (isObjectType(schema9) && !("required" in schema9)) {
138283
- schema9.required = [];
138281
+ rules.set("Add empty `required` property if none is defined", (schema10) => {
138282
+ if (isObjectType(schema10) && !("required" in schema10)) {
138283
+ schema10.required = [];
138284
138284
  }
138285
138285
  });
138286
- rules.set("Transform `required`=false to `required`=[]", (schema9) => {
138287
- if (schema9.required === false) {
138288
- schema9.required = [];
138286
+ rules.set("Transform `required`=false to `required`=[]", (schema10) => {
138287
+ if (schema10.required === false) {
138288
+ schema10.required = [];
138289
138289
  }
138290
138290
  });
138291
- rules.set("Default additionalProperties", (schema9, _10, options8) => {
138292
- if (isObjectType(schema9) && !("additionalProperties" in schema9) && schema9.patternProperties === undefined) {
138293
- schema9.additionalProperties = options8.additionalProperties;
138291
+ rules.set("Default additionalProperties", (schema10, _10, options8) => {
138292
+ if (isObjectType(schema10) && !("additionalProperties" in schema10) && schema10.patternProperties === undefined) {
138293
+ schema10.additionalProperties = options8.additionalProperties;
138294
138294
  }
138295
138295
  });
138296
- rules.set("Transform id to $id", (schema9, fileName) => {
138297
- if (!(0, utils_1.isSchemaLike)(schema9)) {
138296
+ rules.set("Transform id to $id", (schema10, fileName) => {
138297
+ if (!(0, utils_1.isSchemaLike)(schema10)) {
138298
138298
  return;
138299
138299
  }
138300
- if (schema9.id && schema9.$id && schema9.id !== schema9.$id) {
138301
- throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema9.id}, $id=${schema9.$id} in ${fileName}`);
138300
+ if (schema10.id && schema10.$id && schema10.id !== schema10.$id) {
138301
+ throw ReferenceError(`Schema must define either id or $id, not both. Given id=${schema10.id}, $id=${schema10.$id} in ${fileName}`);
138302
138302
  }
138303
- if (schema9.id) {
138304
- schema9.$id = schema9.id;
138305
- delete schema9.id;
138303
+ if (schema10.id) {
138304
+ schema10.$id = schema10.id;
138305
+ delete schema10.id;
138306
138306
  }
138307
138307
  });
138308
- rules.set("Add an $id to anything that needs it", (schema9, fileName, _options, _key, dereferencedPaths) => {
138309
- if (!(0, utils_1.isSchemaLike)(schema9)) {
138308
+ rules.set("Add an $id to anything that needs it", (schema10, fileName, _options, _key, dereferencedPaths) => {
138309
+ if (!(0, utils_1.isSchemaLike)(schema10)) {
138310
138310
  return;
138311
138311
  }
138312
- if (!schema9.$id && !schema9[JSONSchema_1.Parent]) {
138313
- schema9.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
138312
+ if (!schema10.$id && !schema10[JSONSchema_1.Parent]) {
138313
+ schema10.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(fileName));
138314
138314
  return;
138315
138315
  }
138316
- if (!isArrayType(schema9) && !isObjectType(schema9)) {
138316
+ if (!isArrayType(schema10) && !isObjectType(schema10)) {
138317
138317
  return;
138318
138318
  }
138319
- const dereferencedName = dereferencedPaths.get(schema9);
138320
- if (!schema9.$id && !schema9.title && dereferencedName) {
138321
- schema9.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
138319
+ const dereferencedName = dereferencedPaths.get(schema10);
138320
+ if (!schema10.$id && !schema10.title && dereferencedName) {
138321
+ schema10.$id = (0, utils_1.toSafeString)((0, utils_1.justName)(dereferencedName));
138322
138322
  }
138323
138323
  if (dereferencedName) {
138324
- dereferencedPaths.delete(schema9);
138324
+ dereferencedPaths.delete(schema10);
138325
138325
  }
138326
138326
  });
138327
- rules.set("Escape closing JSDoc comment", (schema9) => {
138328
- (0, utils_1.escapeBlockComment)(schema9);
138327
+ rules.set("Escape closing JSDoc comment", (schema10) => {
138328
+ (0, utils_1.escapeBlockComment)(schema10);
138329
138329
  });
138330
- rules.set("Add JSDoc comments for minItems and maxItems", (schema9) => {
138331
- if (!isArrayType(schema9)) {
138330
+ rules.set("Add JSDoc comments for minItems and maxItems", (schema10) => {
138331
+ if (!isArrayType(schema10)) {
138332
138332
  return;
138333
138333
  }
138334
138334
  const commentsToAppend = [
138335
- "minItems" in schema9 ? `@minItems ${schema9.minItems}` : "",
138336
- "maxItems" in schema9 ? `@maxItems ${schema9.maxItems}` : ""
138335
+ "minItems" in schema10 ? `@minItems ${schema10.minItems}` : "",
138336
+ "maxItems" in schema10 ? `@maxItems ${schema10.maxItems}` : ""
138337
138337
  ].filter(Boolean);
138338
138338
  if (commentsToAppend.length) {
138339
- schema9.description = (0, utils_1.appendToDescription)(schema9.description, ...commentsToAppend);
138339
+ schema10.description = (0, utils_1.appendToDescription)(schema10.description, ...commentsToAppend);
138340
138340
  }
138341
138341
  });
138342
- rules.set("Optionally remove maxItems and minItems", (schema9, _fileName, options8) => {
138343
- if (!isArrayType(schema9)) {
138342
+ rules.set("Optionally remove maxItems and minItems", (schema10, _fileName, options8) => {
138343
+ if (!isArrayType(schema10)) {
138344
138344
  return;
138345
138345
  }
138346
- if ("minItems" in schema9 && options8.ignoreMinAndMaxItems) {
138347
- delete schema9.minItems;
138346
+ if ("minItems" in schema10 && options8.ignoreMinAndMaxItems) {
138347
+ delete schema10.minItems;
138348
138348
  }
138349
- if ("maxItems" in schema9 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
138350
- delete schema9.maxItems;
138349
+ if ("maxItems" in schema10 && (options8.ignoreMinAndMaxItems || options8.maxItems === -1)) {
138350
+ delete schema10.maxItems;
138351
138351
  }
138352
138352
  });
138353
- rules.set("Normalize schema.minItems", (schema9, _fileName, options8) => {
138353
+ rules.set("Normalize schema.minItems", (schema10, _fileName, options8) => {
138354
138354
  if (options8.ignoreMinAndMaxItems) {
138355
138355
  return;
138356
138356
  }
138357
- if (!isArrayType(schema9)) {
138357
+ if (!isArrayType(schema10)) {
138358
138358
  return;
138359
138359
  }
138360
- const { minItems } = schema9;
138361
- schema9.minItems = typeof minItems === "number" ? minItems : 0;
138360
+ const { minItems } = schema10;
138361
+ schema10.minItems = typeof minItems === "number" ? minItems : 0;
138362
138362
  });
138363
- rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema9, _fileName, options8) => {
138363
+ rules.set("Remove maxItems if it is big enough to likely cause OOMs", (schema10, _fileName, options8) => {
138364
138364
  if (options8.ignoreMinAndMaxItems || options8.maxItems === -1) {
138365
138365
  return;
138366
138366
  }
138367
- if (!isArrayType(schema9)) {
138367
+ if (!isArrayType(schema10)) {
138368
138368
  return;
138369
138369
  }
138370
- const { maxItems, minItems } = schema9;
138370
+ const { maxItems, minItems } = schema10;
138371
138371
  if (maxItems !== undefined && maxItems - minItems > options8.maxItems) {
138372
- delete schema9.maxItems;
138372
+ delete schema10.maxItems;
138373
138373
  }
138374
138374
  });
138375
- rules.set("Normalize schema.items", (schema9, _fileName, options8) => {
138375
+ rules.set("Normalize schema.items", (schema10, _fileName, options8) => {
138376
138376
  if (options8.ignoreMinAndMaxItems) {
138377
138377
  return;
138378
138378
  }
138379
- const { maxItems, minItems } = schema9;
138379
+ const { maxItems, minItems } = schema10;
138380
138380
  const hasMaxItems = typeof maxItems === "number" && maxItems >= 0;
138381
138381
  const hasMinItems = typeof minItems === "number" && minItems > 0;
138382
- if (schema9.items && !Array.isArray(schema9.items) && (hasMaxItems || hasMinItems)) {
138383
- const items = schema9.items;
138382
+ if (schema10.items && !Array.isArray(schema10.items) && (hasMaxItems || hasMinItems)) {
138383
+ const items = schema10.items;
138384
138384
  const newItems = Array(maxItems || minItems || 0).fill(items);
138385
138385
  if (!hasMaxItems) {
138386
- schema9.additionalItems = items;
138386
+ schema10.additionalItems = items;
138387
138387
  }
138388
- schema9.items = newItems;
138388
+ schema10.items = newItems;
138389
138389
  }
138390
- if (Array.isArray(schema9.items) && hasMaxItems && maxItems < schema9.items.length) {
138391
- schema9.items = schema9.items.slice(0, maxItems);
138390
+ if (Array.isArray(schema10.items) && hasMaxItems && maxItems < schema10.items.length) {
138391
+ schema10.items = schema10.items.slice(0, maxItems);
138392
138392
  }
138393
- return schema9;
138393
+ return schema10;
138394
138394
  });
138395
- rules.set("Remove extends, if it is empty", (schema9) => {
138396
- if (!schema9.hasOwnProperty("extends")) {
138395
+ rules.set("Remove extends, if it is empty", (schema10) => {
138396
+ if (!schema10.hasOwnProperty("extends")) {
138397
138397
  return;
138398
138398
  }
138399
- if (schema9.extends == null || Array.isArray(schema9.extends) && schema9.extends.length === 0) {
138400
- delete schema9.extends;
138399
+ if (schema10.extends == null || Array.isArray(schema10.extends) && schema10.extends.length === 0) {
138400
+ delete schema10.extends;
138401
138401
  }
138402
138402
  });
138403
- rules.set("Make extends always an array, if it is defined", (schema9) => {
138404
- if (schema9.extends == null) {
138403
+ rules.set("Make extends always an array, if it is defined", (schema10) => {
138404
+ if (schema10.extends == null) {
138405
138405
  return;
138406
138406
  }
138407
- if (!Array.isArray(schema9.extends)) {
138408
- schema9.extends = [schema9.extends];
138407
+ if (!Array.isArray(schema10.extends)) {
138408
+ schema10.extends = [schema10.extends];
138409
138409
  }
138410
138410
  });
138411
- rules.set("Transform definitions to $defs", (schema9, fileName) => {
138412
- if (schema9.definitions && schema9.$defs && !(0, util_1.isDeepStrictEqual)(schema9.definitions, schema9.$defs)) {
138413
- throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema9.id} in ${fileName}`);
138411
+ rules.set("Transform definitions to $defs", (schema10, fileName) => {
138412
+ if (schema10.definitions && schema10.$defs && !(0, util_1.isDeepStrictEqual)(schema10.definitions, schema10.$defs)) {
138413
+ throw ReferenceError(`Schema must define either definitions or $defs, not both. Given id=${schema10.id} in ${fileName}`);
138414
138414
  }
138415
- if (schema9.definitions) {
138416
- schema9.$defs = schema9.definitions;
138417
- delete schema9.definitions;
138415
+ if (schema10.definitions) {
138416
+ schema10.$defs = schema10.definitions;
138417
+ delete schema10.definitions;
138418
138418
  }
138419
138419
  });
138420
- rules.set("Transform const to singleton enum", (schema9) => {
138421
- if (schema9.const !== undefined) {
138422
- schema9.enum = [schema9.const];
138423
- delete schema9.const;
138420
+ rules.set("Transform const to singleton enum", (schema10) => {
138421
+ if (schema10.const !== undefined) {
138422
+ schema10.enum = [schema10.const];
138423
+ delete schema10.const;
138424
138424
  }
138425
138425
  });
138426
- rules.set("Add tsEnumNames to enum types", (schema9, _10, options8) => {
138426
+ rules.set("Add tsEnumNames to enum types", (schema10, _10, options8) => {
138427
138427
  var _a7;
138428
- if (isEnumTypeWithoutTsEnumNames(schema9) && options8.inferStringEnumKeysFromValues) {
138429
- schema9.tsEnumNames = (_a7 = schema9.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
138428
+ if (isEnumTypeWithoutTsEnumNames(schema10) && options8.inferStringEnumKeysFromValues) {
138429
+ schema10.tsEnumNames = (_a7 = schema10.enum) === null || _a7 === undefined ? undefined : _a7.map(String);
138430
138430
  }
138431
138431
  });
138432
- rules.set("Pre-calculate schema types and intersections", (schema9) => {
138433
- if (schema9 !== null && typeof schema9 === "object") {
138434
- (0, applySchemaTyping_1.applySchemaTyping)(schema9);
138432
+ rules.set("Pre-calculate schema types and intersections", (schema10) => {
138433
+ if (schema10 !== null && typeof schema10 === "object") {
138434
+ (0, applySchemaTyping_1.applySchemaTyping)(schema10);
138435
138435
  }
138436
138436
  });
138437
138437
  function normalize(rootSchema, dereferencedPaths, filename, options8) {
138438
- rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema9, key2) => rule(schema9, filename, options8, key2, dereferencedPaths)));
138438
+ rules.forEach((rule) => (0, utils_1.traverse)(rootSchema, (schema10, key2) => rule(schema10, filename, options8, key2, dereferencedPaths)));
138439
138439
  return rootSchema;
138440
138440
  }
138441
138441
  exports.normalize = normalize;
@@ -138517,37 +138517,37 @@ var require_parser2 = __commonJS((exports) => {
138517
138517
  var AST_1 = require_AST();
138518
138518
  var JSONSchema_1 = require_JSONSchema();
138519
138519
  var utils_1 = require_utils7();
138520
- function parse11(schema9, options8, keyName, processed = new Map, usedNames = new Set) {
138521
- if ((0, JSONSchema_1.isPrimitive)(schema9)) {
138522
- if ((0, JSONSchema_1.isBoolean)(schema9)) {
138523
- return parseBooleanSchema(schema9, keyName, options8);
138520
+ function parse11(schema10, options8, keyName, processed = new Map, usedNames = new Set) {
138521
+ if ((0, JSONSchema_1.isPrimitive)(schema10)) {
138522
+ if ((0, JSONSchema_1.isBoolean)(schema10)) {
138523
+ return parseBooleanSchema(schema10, keyName, options8);
138524
138524
  }
138525
- return parseLiteral(schema9, keyName);
138525
+ return parseLiteral(schema10, keyName);
138526
138526
  }
138527
- const intersection2 = schema9[JSONSchema_1.Intersection];
138528
- const types = schema9[JSONSchema_1.Types];
138527
+ const intersection2 = schema10[JSONSchema_1.Intersection];
138528
+ const types = schema10[JSONSchema_1.Types];
138529
138529
  if (intersection2) {
138530
138530
  const ast = parseAsTypeWithCache(intersection2, "ALL_OF", options8, keyName, processed, usedNames);
138531
138531
  types.forEach((type) => {
138532
- ast.params.push(parseAsTypeWithCache(schema9, type, options8, keyName, processed, usedNames));
138532
+ ast.params.push(parseAsTypeWithCache(schema10, type, options8, keyName, processed, usedNames));
138533
138533
  });
138534
- (0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema9, "Output:", ast);
138534
+ (0, utils_1.log)("blue", "parser", "Types:", [...types], "Input:", schema10, "Output:", ast);
138535
138535
  return ast;
138536
138536
  }
138537
138537
  if (types.size === 1) {
138538
138538
  const type = [...types][0];
138539
- const ast = parseAsTypeWithCache(schema9, type, options8, keyName, processed, usedNames);
138540
- (0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema9, "Output:", ast);
138539
+ const ast = parseAsTypeWithCache(schema10, type, options8, keyName, processed, usedNames);
138540
+ (0, utils_1.log)("blue", "parser", "Type:", type, "Input:", schema10, "Output:", ast);
138541
138541
  return ast;
138542
138542
  }
138543
138543
  throw new ReferenceError("Expected intersection schema. Please file an issue on GitHub.");
138544
138544
  }
138545
138545
  exports.parse = parse11;
138546
- function parseAsTypeWithCache(schema9, type, options8, keyName, processed = new Map, usedNames = new Set) {
138547
- let cachedTypeMap = processed.get(schema9);
138546
+ function parseAsTypeWithCache(schema10, type, options8, keyName, processed = new Map, usedNames = new Set) {
138547
+ let cachedTypeMap = processed.get(schema10);
138548
138548
  if (!cachedTypeMap) {
138549
138549
  cachedTypeMap = new Map;
138550
- processed.set(schema9, cachedTypeMap);
138550
+ processed.set(schema10, cachedTypeMap);
138551
138551
  }
138552
138552
  const cachedAST = cachedTypeMap.get(type);
138553
138553
  if (cachedAST) {
@@ -138555,10 +138555,10 @@ var require_parser2 = __commonJS((exports) => {
138555
138555
  }
138556
138556
  const ast = {};
138557
138557
  cachedTypeMap.set(type, ast);
138558
- return Object.assign(ast, parseNonLiteral(schema9, type, options8, keyName, processed, usedNames));
138558
+ return Object.assign(ast, parseNonLiteral(schema10, type, options8, keyName, processed, usedNames));
138559
138559
  }
138560
- function parseBooleanSchema(schema9, keyName, options8) {
138561
- if (schema9) {
138560
+ function parseBooleanSchema(schema10, keyName, options8) {
138561
+ if (schema10) {
138562
138562
  return {
138563
138563
  keyName,
138564
138564
  type: options8.unknownAny ? "UNKNOWN" : "ANY"
@@ -138569,157 +138569,157 @@ var require_parser2 = __commonJS((exports) => {
138569
138569
  type: "NEVER"
138570
138570
  };
138571
138571
  }
138572
- function parseLiteral(schema9, keyName) {
138572
+ function parseLiteral(schema10, keyName) {
138573
138573
  return {
138574
138574
  keyName,
138575
- params: schema9,
138575
+ params: schema10,
138576
138576
  type: "LITERAL"
138577
138577
  };
138578
138578
  }
138579
- function parseNonLiteral(schema9, type, options8, keyName, processed, usedNames) {
138580
- const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema9));
138581
- const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema9);
138579
+ function parseNonLiteral(schema10, type, options8, keyName, processed, usedNames) {
138580
+ const definitions = getDefinitionsMemoized((0, JSONSchema_1.getRootSchema)(schema10));
138581
+ const keyNameFromDefinition = (0, lodash_1.findKey)(definitions, (_10) => _10 === schema10);
138582
138582
  switch (type) {
138583
138583
  case "ALL_OF":
138584
138584
  return {
138585
- comment: schema9.description,
138586
- deprecated: schema9.deprecated,
138585
+ comment: schema10.description,
138586
+ deprecated: schema10.deprecated,
138587
138587
  keyName,
138588
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138589
- params: schema9.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138588
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138589
+ params: schema10.allOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138590
138590
  type: "INTERSECTION"
138591
138591
  };
138592
138592
  case "ANY":
138593
- return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema9.description, deprecated: schema9.deprecated, keyName, standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8) });
138593
+ return Object.assign(Object.assign({}, options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY), { comment: schema10.description, deprecated: schema10.deprecated, keyName, standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8) });
138594
138594
  case "ANY_OF":
138595
138595
  return {
138596
- comment: schema9.description,
138597
- deprecated: schema9.deprecated,
138596
+ comment: schema10.description,
138597
+ deprecated: schema10.deprecated,
138598
138598
  keyName,
138599
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138600
- params: schema9.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138599
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138600
+ params: schema10.anyOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138601
138601
  type: "UNION"
138602
138602
  };
138603
138603
  case "BOOLEAN":
138604
138604
  return {
138605
- comment: schema9.description,
138606
- deprecated: schema9.deprecated,
138605
+ comment: schema10.description,
138606
+ deprecated: schema10.deprecated,
138607
138607
  keyName,
138608
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138608
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138609
138609
  type: "BOOLEAN"
138610
138610
  };
138611
138611
  case "CUSTOM_TYPE":
138612
138612
  return {
138613
- comment: schema9.description,
138614
- deprecated: schema9.deprecated,
138613
+ comment: schema10.description,
138614
+ deprecated: schema10.deprecated,
138615
138615
  keyName,
138616
- params: schema9.tsType,
138617
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138616
+ params: schema10.tsType,
138617
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138618
138618
  type: "CUSTOM_TYPE"
138619
138619
  };
138620
138620
  case "NAMED_ENUM":
138621
138621
  return {
138622
- comment: schema9.description,
138623
- deprecated: schema9.deprecated,
138622
+ comment: schema10.description,
138623
+ deprecated: schema10.deprecated,
138624
138624
  keyName,
138625
- standaloneName: standaloneName(schema9, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
138626
- params: schema9.enum.map((_10, n5) => ({
138625
+ standaloneName: standaloneName(schema10, keyNameFromDefinition !== null && keyNameFromDefinition !== undefined ? keyNameFromDefinition : keyName, usedNames, options8),
138626
+ params: schema10.enum.map((_10, n5) => ({
138627
138627
  ast: parseLiteral(_10, undefined),
138628
- keyName: schema9.tsEnumNames[n5]
138628
+ keyName: schema10.tsEnumNames[n5]
138629
138629
  })),
138630
138630
  type: "ENUM"
138631
138631
  };
138632
138632
  case "NAMED_SCHEMA":
138633
- return newInterface(schema9, options8, processed, usedNames, keyName);
138633
+ return newInterface(schema10, options8, processed, usedNames, keyName);
138634
138634
  case "NEVER":
138635
138635
  return {
138636
- comment: schema9.description,
138637
- deprecated: schema9.deprecated,
138636
+ comment: schema10.description,
138637
+ deprecated: schema10.deprecated,
138638
138638
  keyName,
138639
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138639
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138640
138640
  type: "NEVER"
138641
138641
  };
138642
138642
  case "NULL":
138643
138643
  return {
138644
- comment: schema9.description,
138645
- deprecated: schema9.deprecated,
138644
+ comment: schema10.description,
138645
+ deprecated: schema10.deprecated,
138646
138646
  keyName,
138647
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138647
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138648
138648
  type: "NULL"
138649
138649
  };
138650
138650
  case "NUMBER":
138651
138651
  return {
138652
- comment: schema9.description,
138653
- deprecated: schema9.deprecated,
138652
+ comment: schema10.description,
138653
+ deprecated: schema10.deprecated,
138654
138654
  keyName,
138655
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138655
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138656
138656
  type: "NUMBER"
138657
138657
  };
138658
138658
  case "OBJECT":
138659
138659
  return {
138660
- comment: schema9.description,
138660
+ comment: schema10.description,
138661
138661
  keyName,
138662
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138662
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138663
138663
  type: "OBJECT",
138664
- deprecated: schema9.deprecated
138664
+ deprecated: schema10.deprecated
138665
138665
  };
138666
138666
  case "ONE_OF":
138667
138667
  return {
138668
- comment: schema9.description,
138669
- deprecated: schema9.deprecated,
138668
+ comment: schema10.description,
138669
+ deprecated: schema10.deprecated,
138670
138670
  keyName,
138671
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138672
- params: schema9.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138671
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138672
+ params: schema10.oneOf.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138673
138673
  type: "UNION"
138674
138674
  };
138675
138675
  case "REFERENCE":
138676
- throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema9));
138676
+ throw Error((0, util_1.format)("Refs should have been resolved by the resolver!", schema10));
138677
138677
  case "STRING":
138678
138678
  return {
138679
- comment: schema9.description,
138680
- deprecated: schema9.deprecated,
138679
+ comment: schema10.description,
138680
+ deprecated: schema10.deprecated,
138681
138681
  keyName,
138682
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138682
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138683
138683
  type: "STRING"
138684
138684
  };
138685
138685
  case "TYPED_ARRAY":
138686
- if (Array.isArray(schema9.items)) {
138687
- const minItems2 = schema9.minItems;
138688
- const maxItems2 = schema9.maxItems;
138686
+ if (Array.isArray(schema10.items)) {
138687
+ const minItems2 = schema10.minItems;
138688
+ const maxItems2 = schema10.maxItems;
138689
138689
  const arrayType = {
138690
- comment: schema9.description,
138691
- deprecated: schema9.deprecated,
138690
+ comment: schema10.description,
138691
+ deprecated: schema10.deprecated,
138692
138692
  keyName,
138693
138693
  maxItems: maxItems2,
138694
138694
  minItems: minItems2,
138695
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138696
- params: schema9.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138695
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138696
+ params: schema10.items.map((_10) => parse11(_10, options8, undefined, processed, usedNames)),
138697
138697
  type: "TUPLE"
138698
138698
  };
138699
- if (schema9.additionalItems === true) {
138699
+ if (schema10.additionalItems === true) {
138700
138700
  arrayType.spreadParam = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
138701
- } else if (schema9.additionalItems) {
138702
- arrayType.spreadParam = parse11(schema9.additionalItems, options8, undefined, processed, usedNames);
138701
+ } else if (schema10.additionalItems) {
138702
+ arrayType.spreadParam = parse11(schema10.additionalItems, options8, undefined, processed, usedNames);
138703
138703
  }
138704
138704
  return arrayType;
138705
138705
  } else {
138706
138706
  return {
138707
- comment: schema9.description,
138708
- deprecated: schema9.deprecated,
138707
+ comment: schema10.description,
138708
+ deprecated: schema10.deprecated,
138709
138709
  keyName,
138710
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138711
- params: parse11(schema9.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
138710
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138711
+ params: parse11(schema10.items, options8, `{keyNameFromDefinition}Items`, processed, usedNames),
138712
138712
  type: "ARRAY"
138713
138713
  };
138714
138714
  }
138715
138715
  case "UNION":
138716
138716
  return {
138717
- comment: schema9.description,
138718
- deprecated: schema9.deprecated,
138717
+ comment: schema10.description,
138718
+ deprecated: schema10.deprecated,
138719
138719
  keyName,
138720
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138721
- params: schema9.type.map((type2) => {
138722
- const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema9, "$id", "description", "title")), { type: type2 });
138720
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138721
+ params: schema10.type.map((type2) => {
138722
+ const member = Object.assign(Object.assign({}, (0, lodash_1.omit)(schema10, "$id", "description", "title")), { type: type2 });
138723
138723
  (0, utils_1.maybeStripDefault)(member);
138724
138724
  (0, applySchemaTyping_1.applySchemaTyping)(member);
138725
138725
  return parse11(member, options8, undefined, processed, usedNames);
@@ -138728,80 +138728,80 @@ var require_parser2 = __commonJS((exports) => {
138728
138728
  };
138729
138729
  case "UNNAMED_ENUM":
138730
138730
  return {
138731
- comment: schema9.description,
138732
- deprecated: schema9.deprecated,
138731
+ comment: schema10.description,
138732
+ deprecated: schema10.deprecated,
138733
138733
  keyName,
138734
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138735
- params: schema9.enum.map((_10) => parseLiteral(_10, undefined)),
138734
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138735
+ params: schema10.enum.map((_10) => parseLiteral(_10, undefined)),
138736
138736
  type: "UNION"
138737
138737
  };
138738
138738
  case "UNNAMED_SCHEMA":
138739
- return newInterface(schema9, options8, processed, usedNames, keyName, keyNameFromDefinition);
138739
+ return newInterface(schema10, options8, processed, usedNames, keyName, keyNameFromDefinition);
138740
138740
  case "UNTYPED_ARRAY":
138741
- const minItems = schema9.minItems;
138742
- const maxItems = typeof schema9.maxItems === "number" ? schema9.maxItems : -1;
138741
+ const minItems = schema10.minItems;
138742
+ const maxItems = typeof schema10.maxItems === "number" ? schema10.maxItems : -1;
138743
138743
  const params = options8.unknownAny ? AST_1.T_UNKNOWN : AST_1.T_ANY;
138744
138744
  if (minItems > 0 || maxItems >= 0) {
138745
138745
  return {
138746
- comment: schema9.description,
138747
- deprecated: schema9.deprecated,
138746
+ comment: schema10.description,
138747
+ deprecated: schema10.deprecated,
138748
138748
  keyName,
138749
- maxItems: schema9.maxItems,
138749
+ maxItems: schema10.maxItems,
138750
138750
  minItems,
138751
138751
  params: Array(Math.max(maxItems, minItems) || 0).fill(params),
138752
138752
  spreadParam: maxItems >= 0 ? undefined : params,
138753
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138753
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138754
138754
  type: "TUPLE"
138755
138755
  };
138756
138756
  }
138757
138757
  return {
138758
- comment: schema9.description,
138759
- deprecated: schema9.deprecated,
138758
+ comment: schema10.description,
138759
+ deprecated: schema10.deprecated,
138760
138760
  keyName,
138761
138761
  params,
138762
- standaloneName: standaloneName(schema9, keyNameFromDefinition, usedNames, options8),
138762
+ standaloneName: standaloneName(schema10, keyNameFromDefinition, usedNames, options8),
138763
138763
  type: "ARRAY"
138764
138764
  };
138765
138765
  }
138766
138766
  }
138767
- function standaloneName(schema9, keyNameFromDefinition, usedNames, options8) {
138767
+ function standaloneName(schema10, keyNameFromDefinition, usedNames, options8) {
138768
138768
  var _a7;
138769
- const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema9, keyNameFromDefinition)) || schema9.title || schema9.$id || keyNameFromDefinition;
138769
+ const name2 = ((_a7 = options8.customName) === null || _a7 === undefined ? undefined : _a7.call(options8, schema10, keyNameFromDefinition)) || schema10.title || schema10.$id || keyNameFromDefinition;
138770
138770
  if (name2) {
138771
138771
  return (0, utils_1.generateName)(name2, usedNames);
138772
138772
  }
138773
138773
  }
138774
- function newInterface(schema9, options8, processed, usedNames, keyName, keyNameFromDefinition) {
138775
- const name2 = standaloneName(schema9, keyNameFromDefinition, usedNames, options8);
138774
+ function newInterface(schema10, options8, processed, usedNames, keyName, keyNameFromDefinition) {
138775
+ const name2 = standaloneName(schema10, keyNameFromDefinition, usedNames, options8);
138776
138776
  return {
138777
- comment: schema9.description,
138778
- deprecated: schema9.deprecated,
138777
+ comment: schema10.description,
138778
+ deprecated: schema10.deprecated,
138779
138779
  keyName,
138780
- params: parseSchema(schema9, options8, processed, usedNames, name2),
138780
+ params: parseSchema(schema10, options8, processed, usedNames, name2),
138781
138781
  standaloneName: name2,
138782
- superTypes: parseSuperTypes(schema9, options8, processed, usedNames),
138782
+ superTypes: parseSuperTypes(schema10, options8, processed, usedNames),
138783
138783
  type: "INTERFACE"
138784
138784
  };
138785
138785
  }
138786
- function parseSuperTypes(schema9, options8, processed, usedNames) {
138787
- const superTypes = schema9.extends;
138786
+ function parseSuperTypes(schema10, options8, processed, usedNames) {
138787
+ const superTypes = schema10.extends;
138788
138788
  if (!superTypes) {
138789
138789
  return [];
138790
138790
  }
138791
138791
  return superTypes.map((_10) => parse11(_10, options8, undefined, processed, usedNames));
138792
138792
  }
138793
- function parseSchema(schema9, options8, processed, usedNames, parentSchemaName) {
138794
- let asts = (0, lodash_1.map)(schema9.properties, (value, key2) => ({
138793
+ function parseSchema(schema10, options8, processed, usedNames, parentSchemaName) {
138794
+ let asts = (0, lodash_1.map)(schema10.properties, (value, key2) => ({
138795
138795
  ast: parse11(value, options8, key2, processed, usedNames),
138796
138796
  isPatternProperty: false,
138797
- isRequired: (0, lodash_1.includes)(schema9.required || [], key2),
138797
+ isRequired: (0, lodash_1.includes)(schema10.required || [], key2),
138798
138798
  isUnreachableDefinition: false,
138799
138799
  keyName: key2
138800
138800
  }));
138801
138801
  let singlePatternProperty = false;
138802
- if (schema9.patternProperties) {
138803
- singlePatternProperty = !schema9.additionalProperties && Object.keys(schema9.patternProperties).length === 1;
138804
- asts = asts.concat((0, lodash_1.map)(schema9.patternProperties, (value, key2) => {
138802
+ if (schema10.patternProperties) {
138803
+ singlePatternProperty = !schema10.additionalProperties && Object.keys(schema10.patternProperties).length === 1;
138804
+ asts = asts.concat((0, lodash_1.map)(schema10.patternProperties, (value, key2) => {
138805
138805
  const ast = parse11(value, options8, key2, processed, usedNames);
138806
138806
  const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema definition
138807
138807
  via the \`patternProperty\` "${key2.replace("*/", "*\\/")}".`;
@@ -138811,14 +138811,14 @@ ${comment}` : comment;
138811
138811
  return {
138812
138812
  ast,
138813
138813
  isPatternProperty: !singlePatternProperty,
138814
- isRequired: singlePatternProperty || (0, lodash_1.includes)(schema9.required || [], key2),
138814
+ isRequired: singlePatternProperty || (0, lodash_1.includes)(schema10.required || [], key2),
138815
138815
  isUnreachableDefinition: false,
138816
138816
  keyName: singlePatternProperty ? "[k: string]" : key2
138817
138817
  };
138818
138818
  }));
138819
138819
  }
138820
138820
  if (options8.unreachableDefinitions) {
138821
- asts = asts.concat((0, lodash_1.map)(schema9.$defs, (value, key2) => {
138821
+ asts = asts.concat((0, lodash_1.map)(schema10.$defs, (value, key2) => {
138822
138822
  const ast = parse11(value, options8, key2, processed, usedNames);
138823
138823
  const comment = `This interface was referenced by \`${parentSchemaName}\`'s JSON-Schema
138824
138824
  via the \`definition\` "${key2}".`;
@@ -138828,13 +138828,13 @@ ${comment}` : comment;
138828
138828
  return {
138829
138829
  ast,
138830
138830
  isPatternProperty: false,
138831
- isRequired: (0, lodash_1.includes)(schema9.required || [], key2),
138831
+ isRequired: (0, lodash_1.includes)(schema10.required || [], key2),
138832
138832
  isUnreachableDefinition: true,
138833
138833
  keyName: key2
138834
138834
  };
138835
138835
  }));
138836
138836
  }
138837
- switch (schema9.additionalProperties) {
138837
+ switch (schema10.additionalProperties) {
138838
138838
  case undefined:
138839
138839
  case true:
138840
138840
  if (singlePatternProperty) {
@@ -138851,7 +138851,7 @@ ${comment}` : comment;
138851
138851
  return asts;
138852
138852
  default:
138853
138853
  return asts.concat({
138854
- ast: parse11(schema9.additionalProperties, options8, "[k: string]", processed, usedNames),
138854
+ ast: parse11(schema10.additionalProperties, options8, "[k: string]", processed, usedNames),
138855
138855
  isPatternProperty: false,
138856
138856
  isRequired: true,
138857
138857
  isUnreachableDefinition: false,
@@ -138859,22 +138859,22 @@ ${comment}` : comment;
138859
138859
  });
138860
138860
  }
138861
138861
  }
138862
- function getDefinitions(schema9, isSchema = true, processed = new Set) {
138863
- if (processed.has(schema9)) {
138862
+ function getDefinitions(schema10, isSchema = true, processed = new Set) {
138863
+ if (processed.has(schema10)) {
138864
138864
  return {};
138865
138865
  }
138866
- processed.add(schema9);
138867
- if (Array.isArray(schema9)) {
138868
- return schema9.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
138866
+ processed.add(schema10);
138867
+ if (Array.isArray(schema10)) {
138868
+ return schema10.reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(cur, false, processed)), {});
138869
138869
  }
138870
- if ((0, lodash_1.isPlainObject)(schema9)) {
138871
- return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema9) ? schema9.$defs : {}), Object.keys(schema9).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema9[cur], false, processed)), {}));
138870
+ if ((0, lodash_1.isPlainObject)(schema10)) {
138871
+ return Object.assign(Object.assign({}, isSchema && hasDefinitions(schema10) ? schema10.$defs : {}), Object.keys(schema10).reduce((prev, cur) => Object.assign(Object.assign({}, prev), getDefinitions(schema10[cur], false, processed)), {}));
138872
138872
  }
138873
138873
  return {};
138874
138874
  }
138875
138875
  var getDefinitionsMemoized = (0, lodash_1.memoize)(getDefinitions);
138876
- function hasDefinitions(schema9) {
138877
- return "$defs" in schema9;
138876
+ function hasDefinitions(schema10) {
138877
+ return "$defs" in schema10;
138878
138878
  }
138879
138879
  });
138880
138880
 
@@ -140698,7 +140698,7 @@ var require_normalize_args = __commonJS((exports) => {
140698
140698
  var options_js_1 = require_options();
140699
140699
  function normalizeArgs(_args) {
140700
140700
  let path18;
140701
- let schema9;
140701
+ let schema10;
140702
140702
  let options8;
140703
140703
  let callback;
140704
140704
  const args = Array.prototype.slice.call(_args);
@@ -140708,15 +140708,15 @@ var require_normalize_args = __commonJS((exports) => {
140708
140708
  if (typeof args[0] === "string") {
140709
140709
  path18 = args[0];
140710
140710
  if (typeof args[2] === "object") {
140711
- schema9 = args[1];
140711
+ schema10 = args[1];
140712
140712
  options8 = args[2];
140713
140713
  } else {
140714
- schema9 = undefined;
140714
+ schema10 = undefined;
140715
140715
  options8 = args[1];
140716
140716
  }
140717
140717
  } else {
140718
140718
  path18 = "";
140719
- schema9 = args[0];
140719
+ schema10 = args[0];
140720
140720
  options8 = args[1];
140721
140721
  }
140722
140722
  try {
@@ -140724,12 +140724,12 @@ var require_normalize_args = __commonJS((exports) => {
140724
140724
  } catch (e8) {
140725
140725
  console.error(`JSON Schema Ref Parser: Error normalizing options: ${e8}`);
140726
140726
  }
140727
- if (!options8.mutateInputSchema && typeof schema9 === "object") {
140728
- schema9 = JSON.parse(JSON.stringify(schema9));
140727
+ if (!options8.mutateInputSchema && typeof schema10 === "object") {
140728
+ schema10 = JSON.parse(JSON.stringify(schema10));
140729
140729
  }
140730
140730
  return {
140731
140731
  path: path18,
140732
- schema: schema9,
140732
+ schema: schema10,
140733
140733
  options: options8,
140734
140734
  callback
140735
140735
  };
@@ -141518,12 +141518,12 @@ var require_resolver = __commonJS((exports) => {
141518
141518
  var json_schema_ref_parser_1 = require_lib3();
141519
141519
  var utils_1 = require_utils7();
141520
141520
  function dereference(schema_1, _a7) {
141521
- return __awaiter(this, arguments, undefined, function* (schema9, { cwd, $refOptions }) {
141522
- (0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema9);
141521
+ return __awaiter(this, arguments, undefined, function* (schema10, { cwd, $refOptions }) {
141522
+ (0, utils_1.log)("green", "dereferencer", "Dereferencing input schema:", cwd, schema10);
141523
141523
  const parser2 = new json_schema_ref_parser_1.$RefParser;
141524
141524
  const dereferencedPaths = new WeakMap;
141525
- const dereferencedSchema = yield parser2.dereference(cwd, schema9, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema10) {
141526
- dereferencedPaths.set(schema10, $ref);
141525
+ const dereferencedSchema = yield parser2.dereference(cwd, schema10, Object.assign(Object.assign({}, $refOptions), { dereference: Object.assign(Object.assign({}, $refOptions.dereference), { onDereference($ref, schema11) {
141526
+ dereferencedPaths.set(schema11, $ref);
141527
141527
  } }) }));
141528
141528
  return { dereferencedPaths, dereferencedSchema };
141529
141529
  });
@@ -141537,46 +141537,46 @@ var require_validator = __commonJS((exports) => {
141537
141537
  exports.validate = undefined;
141538
141538
  var utils_1 = require_utils7();
141539
141539
  var rules = new Map;
141540
- rules.set("Enum members and tsEnumNames must be of the same length", (schema9) => {
141541
- if (schema9.enum && schema9.tsEnumNames && schema9.enum.length !== schema9.tsEnumNames.length) {
141540
+ rules.set("Enum members and tsEnumNames must be of the same length", (schema10) => {
141541
+ if (schema10.enum && schema10.tsEnumNames && schema10.enum.length !== schema10.tsEnumNames.length) {
141542
141542
  return false;
141543
141543
  }
141544
141544
  });
141545
- rules.set("tsEnumNames must be an array of strings", (schema9) => {
141546
- if (schema9.tsEnumNames && schema9.tsEnumNames.some((_10) => typeof _10 !== "string")) {
141545
+ rules.set("tsEnumNames must be an array of strings", (schema10) => {
141546
+ if (schema10.tsEnumNames && schema10.tsEnumNames.some((_10) => typeof _10 !== "string")) {
141547
141547
  return false;
141548
141548
  }
141549
141549
  });
141550
- rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema9) => {
141551
- const { maxItems, minItems } = schema9;
141550
+ rules.set("When both maxItems and minItems are present, maxItems >= minItems", (schema10) => {
141551
+ const { maxItems, minItems } = schema10;
141552
141552
  if (typeof maxItems === "number" && typeof minItems === "number") {
141553
141553
  return maxItems >= minItems;
141554
141554
  }
141555
141555
  });
141556
- rules.set("When maxItems exists, maxItems >= 0", (schema9) => {
141557
- const { maxItems } = schema9;
141556
+ rules.set("When maxItems exists, maxItems >= 0", (schema10) => {
141557
+ const { maxItems } = schema10;
141558
141558
  if (typeof maxItems === "number") {
141559
141559
  return maxItems >= 0;
141560
141560
  }
141561
141561
  });
141562
- rules.set("When minItems exists, minItems >= 0", (schema9) => {
141563
- const { minItems } = schema9;
141562
+ rules.set("When minItems exists, minItems >= 0", (schema10) => {
141563
+ const { minItems } = schema10;
141564
141564
  if (typeof minItems === "number") {
141565
141565
  return minItems >= 0;
141566
141566
  }
141567
141567
  });
141568
- rules.set("deprecated must be a boolean", (schema9) => {
141569
- const typeOfDeprecated = typeof schema9.deprecated;
141568
+ rules.set("deprecated must be a boolean", (schema10) => {
141569
+ const typeOfDeprecated = typeof schema10.deprecated;
141570
141570
  return typeOfDeprecated === "boolean" || typeOfDeprecated === "undefined";
141571
141571
  });
141572
- function validate2(schema9, filename) {
141572
+ function validate2(schema10, filename) {
141573
141573
  const errors5 = [];
141574
141574
  rules.forEach((rule, ruleName) => {
141575
- (0, utils_1.traverse)(schema9, (schema10, key2) => {
141576
- if (rule(schema10) === false) {
141575
+ (0, utils_1.traverse)(schema10, (schema11, key2) => {
141576
+ if (rule(schema11) === false) {
141577
141577
  errors5.push(`Error at key "${key2}" in file "${filename}": ${ruleName}`);
141578
141578
  }
141579
- return schema10;
141579
+ return schema11;
141580
141580
  });
141581
141581
  });
141582
141582
  return errors5;
@@ -141590,25 +141590,25 @@ var require_linker = __commonJS((exports) => {
141590
141590
  exports.link = undefined;
141591
141591
  var JSONSchema_1 = require_JSONSchema();
141592
141592
  var lodash_1 = require_lodash();
141593
- function link2(schema9, parent = null) {
141594
- if (!Array.isArray(schema9) && !(0, lodash_1.isPlainObject)(schema9)) {
141595
- return schema9;
141593
+ function link2(schema10, parent = null) {
141594
+ if (!Array.isArray(schema10) && !(0, lodash_1.isPlainObject)(schema10)) {
141595
+ return schema10;
141596
141596
  }
141597
- if (schema9.hasOwnProperty(JSONSchema_1.Parent)) {
141598
- return schema9;
141597
+ if (schema10.hasOwnProperty(JSONSchema_1.Parent)) {
141598
+ return schema10;
141599
141599
  }
141600
- Object.defineProperty(schema9, JSONSchema_1.Parent, {
141600
+ Object.defineProperty(schema10, JSONSchema_1.Parent, {
141601
141601
  enumerable: false,
141602
141602
  value: parent,
141603
141603
  writable: false
141604
141604
  });
141605
- if (Array.isArray(schema9)) {
141606
- schema9.forEach((child) => link2(child, schema9));
141605
+ if (Array.isArray(schema10)) {
141606
+ schema10.forEach((child) => link2(child, schema10));
141607
141607
  }
141608
- for (const key2 in schema9) {
141609
- link2(schema9[key2], schema9);
141608
+ for (const key2 in schema10) {
141609
+ link2(schema10[key2], schema10);
141610
141610
  }
141611
- return schema9;
141611
+ return schema10;
141612
141612
  }
141613
141613
  exports.link = link2;
141614
141614
  });
@@ -141700,8 +141700,8 @@ var require_src3 = __commonJS((exports) => {
141700
141700
  unknownAny: true
141701
141701
  };
141702
141702
  function compileFromFile(filename, options8 = exports.DEFAULT_OPTIONS) {
141703
- const schema9 = parseAsJSONSchema(filename);
141704
- return compile(schema9, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
141703
+ const schema10 = parseAsJSONSchema(filename);
141704
+ return compile(schema10, (0, utils_1.stripExtension)(filename), Object.assign({ cwd: (0, path_1.dirname)(filename) }, options8));
141705
141705
  }
141706
141706
  exports.compileFromFile = compileFromFile;
141707
141707
  function parseAsJSONSchema(filename) {
@@ -141711,7 +141711,7 @@ var require_src3 = __commonJS((exports) => {
141711
141711
  return (0, utils_1.parseFileAsJSONSchema)(filename, contents.toString());
141712
141712
  }
141713
141713
  function compile(schema_1, name_1) {
141714
- return __awaiter(this, arguments, undefined, function* (schema9, name2, options8 = {}) {
141714
+ return __awaiter(this, arguments, undefined, function* (schema10, name2, options8 = {}) {
141715
141715
  (0, optionValidator_1.validateOptions)(options8);
141716
141716
  const _options = (0, lodash_1.merge)({}, exports.DEFAULT_OPTIONS, options8);
141717
141717
  const start = Date.now();
@@ -141721,7 +141721,7 @@ var require_src3 = __commonJS((exports) => {
141721
141721
  if (!(0, lodash_1.endsWith)(_options.cwd, "/")) {
141722
141722
  _options.cwd += "/";
141723
141723
  }
141724
- const _schema = (0, lodash_1.cloneDeep)(schema9);
141724
+ const _schema = (0, lodash_1.cloneDeep)(schema10);
141725
141725
  const { dereferencedPaths, dereferencedSchema } = yield (0, resolver_1.dereference)(_schema, _options);
141726
141726
  if (process.env.VERBOSE) {
141727
141727
  if ((0, util_1.isDeepStrictEqual)(_schema, dereferencedSchema)) {
@@ -159447,9 +159447,9 @@ var require_stringify5 = __commonJS((exports, module) => {
159447
159447
  }
159448
159448
  };
159449
159449
  var isArray = Array.isArray;
159450
- var push4 = Array.prototype.push;
159450
+ var push5 = Array.prototype.push;
159451
159451
  var pushToArray = function(arr, valueOrArray) {
159452
- push4.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
159452
+ push5.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
159453
159453
  };
159454
159454
  var toISO = Date.prototype.toISOString;
159455
159455
  var defaultFormat = formats["default"];
@@ -160399,10 +160399,10 @@ var require_view = __commonJS((exports, module) => {
160399
160399
  var debug = require_src4()("express:view");
160400
160400
  var path18 = __require("node:path");
160401
160401
  var fs28 = __require("node:fs");
160402
- var dirname12 = path18.dirname;
160402
+ var dirname14 = path18.dirname;
160403
160403
  var basename4 = path18.basename;
160404
160404
  var extname2 = path18.extname;
160405
- var join18 = path18.join;
160405
+ var join21 = path18.join;
160406
160406
  var resolve6 = path18.resolve;
160407
160407
  module.exports = View;
160408
160408
  function View(name2, options8) {
@@ -160438,7 +160438,7 @@ var require_view = __commonJS((exports, module) => {
160438
160438
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
160439
160439
  var root2 = roots[i5];
160440
160440
  var loc = resolve6(root2, name2);
160441
- var dir = dirname12(loc);
160441
+ var dir = dirname14(loc);
160442
160442
  var file2 = basename4(loc);
160443
160443
  path19 = this.resolve(dir, file2);
160444
160444
  }
@@ -160464,12 +160464,12 @@ var require_view = __commonJS((exports, module) => {
160464
160464
  };
160465
160465
  View.prototype.resolve = function resolve7(dir, file2) {
160466
160466
  var ext = this.ext;
160467
- var path19 = join18(dir, file2);
160467
+ var path19 = join21(dir, file2);
160468
160468
  var stat2 = tryStat(path19);
160469
160469
  if (stat2 && stat2.isFile()) {
160470
160470
  return path19;
160471
160471
  }
160472
- path19 = join18(dir, basename4(file2, ext), "index" + ext);
160472
+ path19 = join21(dir, basename4(file2, ext), "index" + ext);
160473
160473
  stat2 = tryStat(path19);
160474
160474
  if (stat2 && stat2.isFile()) {
160475
160475
  return path19;
@@ -164164,7 +164164,7 @@ var require_send = __commonJS((exports, module) => {
164164
164164
  var Stream2 = __require("stream");
164165
164165
  var util2 = __require("util");
164166
164166
  var extname2 = path18.extname;
164167
- var join18 = path18.join;
164167
+ var join21 = path18.join;
164168
164168
  var normalize = path18.normalize;
164169
164169
  var resolve6 = path18.resolve;
164170
164170
  var sep = path18.sep;
@@ -164336,7 +164336,7 @@ var require_send = __commonJS((exports, module) => {
164336
164336
  return res;
164337
164337
  }
164338
164338
  parts = path19.split(sep);
164339
- path19 = normalize(join18(root2, path19));
164339
+ path19 = normalize(join21(root2, path19));
164340
164340
  } else {
164341
164341
  if (UP_PATH_REGEXP.test(path19)) {
164342
164342
  debug('malicious path "%s"', path19);
@@ -164476,7 +164476,7 @@ var require_send = __commonJS((exports, module) => {
164476
164476
  return self2.onStatError(err);
164477
164477
  return self2.error(404);
164478
164478
  }
164479
- var p4 = join18(path19, self2._index[i5]);
164479
+ var p4 = join21(path19, self2._index[i5]);
164480
164480
  debug('stat "%s"', p4);
164481
164481
  fs28.stat(p4, function(err2, stat2) {
164482
164482
  if (err2)
@@ -165574,18 +165574,18 @@ var require_common7 = __commonJS((exports) => {
165574
165574
  retSegs.push.apply(retSegs, lastSegs);
165575
165575
  return retSegs.join("?");
165576
165576
  };
165577
- common2.rewriteCookieProperty = function rewriteCookieProperty(header2, config10, property) {
165577
+ common2.rewriteCookieProperty = function rewriteCookieProperty(header2, config11, property) {
165578
165578
  if (Array.isArray(header2)) {
165579
165579
  return header2.map(function(headerElement) {
165580
- return rewriteCookieProperty(headerElement, config10, property);
165580
+ return rewriteCookieProperty(headerElement, config11, property);
165581
165581
  });
165582
165582
  }
165583
165583
  return header2.replace(new RegExp("(;\\s*" + property + "=)([^;]+)", "i"), function(match, prefix, previousValue) {
165584
165584
  var newValue;
165585
- if (previousValue in config10) {
165586
- newValue = config10[previousValue];
165587
- } else if ("*" in config10) {
165588
- newValue = config10["*"];
165585
+ if (previousValue in config11) {
165586
+ newValue = config11[previousValue];
165587
+ } else if ("*" in config11) {
165588
+ newValue = config11["*"];
165589
165589
  } else {
165590
165590
  return match;
165591
165591
  }
@@ -166684,14 +166684,14 @@ var require_logger_plugin2 = __commonJS((exports) => {
166684
166684
  var logger_1 = require_logger();
166685
166685
  var logger_plugin_1 = require_logger_plugin();
166686
166686
  var loggerPlugin = (proxyServer, options8) => {
166687
- const logger = (0, logger_1.getLogger)(options8);
166687
+ const logger2 = (0, logger_1.getLogger)(options8);
166688
166688
  proxyServer.on("error", (err, req, res, target) => {
166689
166689
  const hostname3 = req?.headers?.host;
166690
166690
  const requestHref = `${hostname3}${req?.url}`;
166691
166691
  const targetHref = `${target?.href}`;
166692
166692
  const errorMessage = "[HPM] Error occurred while proxying request %s to %s [%s] (%s)";
166693
166693
  const errReference = "https://nodejs.org/api/errors.html#errors_common_system_errors";
166694
- logger.error(errorMessage, requestHref, targetHref, err.code || err, errReference);
166694
+ logger2.error(errorMessage, requestHref, targetHref, err.code || err, errReference);
166695
166695
  });
166696
166696
  proxyServer.on("proxyRes", (proxyRes, req, res) => {
166697
166697
  const originalUrl = req.originalUrl ?? `${req.baseUrl || ""}${req.url}`;
@@ -166713,13 +166713,13 @@ var require_logger_plugin2 = __commonJS((exports) => {
166713
166713
  }
166714
166714
  const targetUrl = target.toString();
166715
166715
  const exchange = `[HPM] ${req.method} ${originalUrl} -> ${targetUrl} [${proxyRes.statusCode}]`;
166716
- logger.info(exchange);
166716
+ logger2.info(exchange);
166717
166717
  });
166718
166718
  proxyServer.on("open", (socket) => {
166719
- logger.info("[HPM] Client connected: %o", socket.address());
166719
+ logger2.info("[HPM] Client connected: %o", socket.address());
166720
166720
  });
166721
166721
  proxyServer.on("close", (req, proxySocket, proxyHead) => {
166722
- logger.info("[HPM] Client disconnected: %o", proxySocket.address());
166722
+ logger2.info("[HPM] Client disconnected: %o", proxySocket.address());
166723
166723
  });
166724
166724
  };
166725
166725
  exports.loggerPlugin = loggerPlugin;
@@ -166950,9 +166950,9 @@ var require_router2 = __commonJS((exports) => {
166950
166950
  var is_plain_object_1 = require_is_plain_object();
166951
166951
  var debug_1 = require_debug3();
166952
166952
  var debug = debug_1.Debug.extend("router");
166953
- async function getTarget(req, config10) {
166953
+ async function getTarget(req, config11) {
166954
166954
  let newTarget;
166955
- const router = config10.router;
166955
+ const router = config11.router;
166956
166956
  if ((0, is_plain_object_1.isPlainObject)(router)) {
166957
166957
  newTarget = getTargetFromProxyTable(req, router);
166958
166958
  } else if (typeof router === "function") {
@@ -167296,7 +167296,7 @@ var require_options_adapter = __commonJS((exports) => {
167296
167296
  };
167297
167297
  function legacyOptionsAdapter(legacyContext, legacyOptions) {
167298
167298
  let options8 = {};
167299
- let logger;
167299
+ let logger2;
167300
167300
  if (typeof legacyContext === "string" && !!url3.parse(legacyContext).host) {
167301
167301
  throw new Error(`Shorthand syntax is removed from legacyCreateProxyMiddleware().
167302
167302
  Please use "legacyCreateProxyMiddleware({ target: 'http://www.example.org' })" instead.
@@ -167307,8 +167307,8 @@ var require_options_adapter = __commonJS((exports) => {
167307
167307
  if (legacyContext && legacyOptions) {
167308
167308
  debug("map legacy context/filter to options.pathFilter");
167309
167309
  options8 = { ...legacyOptions, pathFilter: legacyContext };
167310
- logger = getLegacyLogger(options8);
167311
- logger.warn(`[http-proxy-middleware] Legacy "context" argument is deprecated. Migrate your "context" to "options.pathFilter":
167310
+ logger2 = getLegacyLogger(options8);
167311
+ logger2.warn(`[http-proxy-middleware] Legacy "context" argument is deprecated. Migrate your "context" to "options.pathFilter":
167312
167312
 
167313
167313
  const options = {
167314
167314
  pathFilter: '${legacyContext}',
@@ -167318,16 +167318,16 @@ var require_options_adapter = __commonJS((exports) => {
167318
167318
  `);
167319
167319
  } else if (legacyContext && !legacyOptions) {
167320
167320
  options8 = { ...legacyContext };
167321
- logger = getLegacyLogger(options8);
167321
+ logger2 = getLegacyLogger(options8);
167322
167322
  } else {
167323
- logger = getLegacyLogger({});
167323
+ logger2 = getLegacyLogger({});
167324
167324
  }
167325
167325
  Object.entries(proxyEventMap).forEach(([legacyEventName, proxyEventName]) => {
167326
167326
  if (options8[legacyEventName]) {
167327
167327
  options8.on = { ...options8.on };
167328
167328
  options8.on[proxyEventName] = options8[legacyEventName];
167329
167329
  debug('map legacy event "%s" to "on.%s"', legacyEventName, proxyEventName);
167330
- logger.warn(`[http-proxy-middleware] Legacy "${legacyEventName}" is deprecated. Migrate to "options.on.${proxyEventName}":
167330
+ logger2.warn(`[http-proxy-middleware] Legacy "${legacyEventName}" is deprecated. Migrate to "options.on.${proxyEventName}":
167331
167331
 
167332
167332
  const options = {
167333
167333
  on: {
@@ -167345,7 +167345,7 @@ var require_options_adapter = __commonJS((exports) => {
167345
167345
  debug("legacy logProvider: %O", logProvider);
167346
167346
  if (typeof logLevel === "string" && logLevel !== "silent") {
167347
167347
  debug('map "logProvider" to "logger"');
167348
- logger.warn(`[http-proxy-middleware] Legacy "logLevel" and "logProvider" are deprecated. Migrate to "options.logger":
167348
+ logger2.warn(`[http-proxy-middleware] Legacy "logLevel" and "logProvider" are deprecated. Migrate to "options.logger":
167349
167349
 
167350
167350
  const options = {
167351
167351
  logger: console,
@@ -191776,7 +191776,7 @@ var require_event_target = __commonJS((exports, module) => {
191776
191776
  // ../../node_modules/ws/lib/extension.js
191777
191777
  var require_extension = __commonJS((exports, module) => {
191778
191778
  var { tokenChars } = require_validation();
191779
- function push4(dest, name2, elem) {
191779
+ function push5(dest, name2, elem) {
191780
191780
  if (dest[name2] === undefined)
191781
191781
  dest[name2] = [elem];
191782
191782
  else
@@ -191811,7 +191811,7 @@ var require_extension = __commonJS((exports, module) => {
191811
191811
  end = i5;
191812
191812
  const name2 = header2.slice(start, end);
191813
191813
  if (code2 === 44) {
191814
- push4(offers, name2, params);
191814
+ push5(offers, name2, params);
191815
191815
  params = Object.create(null);
191816
191816
  } else {
191817
191817
  extensionName = name2;
@@ -191833,9 +191833,9 @@ var require_extension = __commonJS((exports, module) => {
191833
191833
  }
191834
191834
  if (end === -1)
191835
191835
  end = i5;
191836
- push4(params, header2.slice(start, end), true);
191836
+ push5(params, header2.slice(start, end), true);
191837
191837
  if (code2 === 44) {
191838
- push4(offers, extensionName, params);
191838
+ push5(offers, extensionName, params);
191839
191839
  params = Object.create(null);
191840
191840
  extensionName = undefined;
191841
191841
  }
@@ -191887,9 +191887,9 @@ var require_extension = __commonJS((exports, module) => {
191887
191887
  value = value.replace(/\\/g, "");
191888
191888
  mustUnescape = false;
191889
191889
  }
191890
- push4(params, paramName, value);
191890
+ push5(params, paramName, value);
191891
191891
  if (code2 === 44) {
191892
- push4(offers, extensionName, params);
191892
+ push5(offers, extensionName, params);
191893
191893
  params = Object.create(null);
191894
191894
  extensionName = undefined;
191895
191895
  }
@@ -191907,16 +191907,16 @@ var require_extension = __commonJS((exports, module) => {
191907
191907
  end = i5;
191908
191908
  const token2 = header2.slice(start, end);
191909
191909
  if (extensionName === undefined) {
191910
- push4(offers, token2, params);
191910
+ push5(offers, token2, params);
191911
191911
  } else {
191912
191912
  if (paramName === undefined) {
191913
- push4(params, token2, true);
191913
+ push5(params, token2, true);
191914
191914
  } else if (mustUnescape) {
191915
- push4(params, paramName, token2.replace(/\\/g, ""));
191915
+ push5(params, paramName, token2.replace(/\\/g, ""));
191916
191916
  } else {
191917
- push4(params, paramName, token2);
191917
+ push5(params, paramName, token2);
191918
191918
  }
191919
- push4(offers, extensionName, params);
191919
+ push5(offers, extensionName, params);
191920
191920
  }
191921
191921
  return offers;
191922
191922
  }
@@ -201140,12 +201140,12 @@ var require_sign2 = __commonJS((exports, module) => {
201140
201140
  exp: { isValid: isNumber, message: '"exp" should be a number of seconds' },
201141
201141
  nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' }
201142
201142
  };
201143
- function validate2(schema9, allowUnknown, object2, parameterName) {
201143
+ function validate2(schema10, allowUnknown, object2, parameterName) {
201144
201144
  if (!isPlainObject3(object2)) {
201145
201145
  throw new Error('Expected "' + parameterName + '" to be a plain object.');
201146
201146
  }
201147
201147
  Object.keys(object2).forEach(function(key2) {
201148
- const validator = schema9[key2];
201148
+ const validator = schema10[key2];
201149
201149
  if (!validator) {
201150
201150
  if (!allowUnknown) {
201151
201151
  throw new Error('"' + key2 + '" is not allowed in "' + parameterName + '"');
@@ -214571,7 +214571,7 @@ var require_buffer_list = __commonJS((exports, module) => {
214571
214571
  }
214572
214572
  _createClass(BufferList, [{
214573
214573
  key: "push",
214574
- value: function push4(v10) {
214574
+ value: function push5(v10) {
214575
214575
  var entry = {
214576
214576
  data: v10,
214577
214577
  next: null
@@ -214616,7 +214616,7 @@ var require_buffer_list = __commonJS((exports, module) => {
214616
214616
  }
214617
214617
  }, {
214618
214618
  key: "join",
214619
- value: function join18(s5) {
214619
+ value: function join21(s5) {
214620
214620
  if (this.length === 0)
214621
214621
  return "";
214622
214622
  var p4 = this.head;
@@ -218270,28 +218270,9 @@ var require_dist5 = __commonJS((exports, module) => {
218270
218270
  });
218271
218271
 
218272
218272
  // src/cli/index.ts
218273
- import { dirname as dirname16, join as join21 } from "node:path";
218273
+ import { dirname as dirname18, join as join24 } from "node:path";
218274
218274
  import { fileURLToPath as fileURLToPath6 } from "node:url";
218275
218275
 
218276
- // ../../node_modules/commander/esm.mjs
218277
- var import__ = __toESM(require_commander(), 1);
218278
- var {
218279
- program,
218280
- createCommand,
218281
- createArgument,
218282
- createOption,
218283
- CommanderError,
218284
- InvalidArgumentError,
218285
- InvalidOptionArgumentError,
218286
- Command,
218287
- Argument,
218288
- Option,
218289
- Help
218290
- } = import__.default;
218291
-
218292
- // src/cli/commands/agents/pull.ts
218293
- import { dirname as dirname7, join as join11 } from "node:path";
218294
-
218295
218276
  // ../../node_modules/@clack/core/dist/index.mjs
218296
218277
  var import_picocolors = __toESM(require_picocolors(), 1);
218297
218278
  var import_sisteransi = __toESM(require_src(), 1);
@@ -219376,6 +219357,72 @@ ${l}
219376
219357
  }
219377
219358
  } }).prompt();
219378
219359
 
219360
+ // ../logger/src/ClackLogger.ts
219361
+ class ClackLogger {
219362
+ info(message) {
219363
+ R2.info(message);
219364
+ }
219365
+ success(message) {
219366
+ R2.success(message);
219367
+ }
219368
+ warn(message) {
219369
+ R2.warn(message);
219370
+ }
219371
+ error(message) {
219372
+ R2.error(message);
219373
+ }
219374
+ step(message) {
219375
+ R2.step(message);
219376
+ }
219377
+ message(message) {
219378
+ R2.message(message);
219379
+ }
219380
+ }
219381
+ // ../logger/src/SimpleLogger.ts
219382
+ class SimpleLogger {
219383
+ info(message) {
219384
+ process.stderr.write(`${message}
219385
+ `);
219386
+ }
219387
+ success(message) {
219388
+ process.stderr.write(`${message}
219389
+ `);
219390
+ }
219391
+ warn(message) {
219392
+ process.stderr.write(`Warning: ${message}
219393
+ `);
219394
+ }
219395
+ error(message) {
219396
+ process.stderr.write(`Error: ${message}
219397
+ `);
219398
+ }
219399
+ step(message) {
219400
+ process.stderr.write(`${message}
219401
+ `);
219402
+ }
219403
+ message(message) {
219404
+ process.stderr.write(`${message}
219405
+ `);
219406
+ }
219407
+ }
219408
+ // ../../node_modules/commander/esm.mjs
219409
+ var import__ = __toESM(require_commander(), 1);
219410
+ var {
219411
+ program,
219412
+ createCommand,
219413
+ createArgument,
219414
+ createOption,
219415
+ CommanderError,
219416
+ InvalidArgumentError,
219417
+ InvalidOptionArgumentError,
219418
+ Command,
219419
+ Argument,
219420
+ Option,
219421
+ Help
219422
+ } = import__.default;
219423
+
219424
+ // src/cli/commands/agents/pull.ts
219425
+ import { dirname as dirname7, join as join12 } from "node:path";
219379
219426
  // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
219380
219427
  var ANSI_BACKGROUND_OFFSET = 10;
219381
219428
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
@@ -234527,7 +234574,8 @@ var ProjectConfigSchema = exports_external.object({
234527
234574
  entitiesDir: exports_external.string().optional().default("entities"),
234528
234575
  functionsDir: exports_external.string().optional().default("functions"),
234529
234576
  agentsDir: exports_external.string().optional().default("agents"),
234530
- connectorsDir: exports_external.string().optional().default("connectors")
234577
+ connectorsDir: exports_external.string().optional().default("connectors"),
234578
+ authDir: exports_external.string().optional().default("auth")
234531
234579
  });
234532
234580
  var AppConfigSchema = exports_external.object({
234533
234581
  id: exports_external.string().min(1, "id cannot be empty")
@@ -241459,7 +241507,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
241459
241507
  var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
241460
241508
 
241461
241509
  // src/core/project/config.ts
241462
- import { dirname as dirname5, join as join7 } from "node:path";
241510
+ import { dirname as dirname5, join as join8 } from "node:path";
241463
241511
 
241464
241512
  // src/core/resources/agent/schema.ts
241465
241513
  var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
@@ -241622,6 +241670,161 @@ var agentResource = {
241622
241670
  readAll: readAllAgents,
241623
241671
  push: pushAgents
241624
241672
  };
241673
+ // src/core/resources/auth-config/schema.ts
241674
+ var GoogleOAuthMode = exports_external.enum(["default", "custom"]);
241675
+ var AuthConfigSchema = exports_external.object({
241676
+ enable_username_password: exports_external.boolean(),
241677
+ enable_google_login: exports_external.boolean(),
241678
+ enable_microsoft_login: exports_external.boolean(),
241679
+ enable_facebook_login: exports_external.boolean(),
241680
+ enable_apple_login: exports_external.boolean(),
241681
+ sso_provider_name: exports_external.string().nullable(),
241682
+ enable_sso_login: exports_external.boolean(),
241683
+ google_oauth_mode: GoogleOAuthMode,
241684
+ google_oauth_client_id: exports_external.string().nullable(),
241685
+ use_workspace_sso: exports_external.boolean()
241686
+ }).transform((data) => ({
241687
+ enableUsernamePassword: data.enable_username_password,
241688
+ enableGoogleLogin: data.enable_google_login,
241689
+ enableMicrosoftLogin: data.enable_microsoft_login,
241690
+ enableFacebookLogin: data.enable_facebook_login,
241691
+ enableAppleLogin: data.enable_apple_login,
241692
+ ssoProviderName: data.sso_provider_name,
241693
+ enableSSOLogin: data.enable_sso_login,
241694
+ googleOAuthMode: data.google_oauth_mode,
241695
+ googleOAuthClientId: data.google_oauth_client_id,
241696
+ useWorkspaceSSO: data.use_workspace_sso
241697
+ }));
241698
+ var AuthConfigFileSchema = exports_external.object({
241699
+ enableUsernamePassword: exports_external.boolean(),
241700
+ enableGoogleLogin: exports_external.boolean(),
241701
+ enableMicrosoftLogin: exports_external.boolean(),
241702
+ enableFacebookLogin: exports_external.boolean(),
241703
+ enableAppleLogin: exports_external.boolean(),
241704
+ ssoProviderName: exports_external.string().nullable(),
241705
+ enableSSOLogin: exports_external.boolean(),
241706
+ googleOAuthMode: GoogleOAuthMode,
241707
+ googleOAuthClientId: exports_external.string().nullable(),
241708
+ useWorkspaceSSO: exports_external.boolean()
241709
+ });
241710
+ var AppAuthConfigResponseSchema = exports_external.object({
241711
+ auth_config: AuthConfigSchema
241712
+ }).transform((data) => ({
241713
+ authConfig: data.auth_config
241714
+ }));
241715
+ function hasAnyLoginMethod(config3) {
241716
+ return config3.enableUsernamePassword || config3.enableGoogleLogin || config3.enableMicrosoftLogin || config3.enableFacebookLogin || config3.enableAppleLogin || config3.enableSSOLogin;
241717
+ }
241718
+ function toAuthConfigPayload(config3) {
241719
+ return {
241720
+ enable_username_password: config3.enableUsernamePassword,
241721
+ enable_google_login: config3.enableGoogleLogin,
241722
+ enable_microsoft_login: config3.enableMicrosoftLogin,
241723
+ enable_facebook_login: config3.enableFacebookLogin,
241724
+ enable_apple_login: config3.enableAppleLogin,
241725
+ sso_provider_name: config3.ssoProviderName,
241726
+ enable_sso_login: config3.enableSSOLogin,
241727
+ google_oauth_mode: config3.googleOAuthMode,
241728
+ google_oauth_client_id: config3.googleOAuthClientId,
241729
+ use_workspace_sso: config3.useWorkspaceSSO
241730
+ };
241731
+ }
241732
+
241733
+ // src/core/resources/auth-config/api.ts
241734
+ async function getAuthConfig() {
241735
+ const { id } = getAppConfig();
241736
+ let response;
241737
+ try {
241738
+ response = await base44Client.get(`api/apps/${id}`);
241739
+ } catch (error48) {
241740
+ throw await ApiError.fromHttpError(error48, "fetching auth config");
241741
+ }
241742
+ const result = AppAuthConfigResponseSchema.safeParse(await response.json());
241743
+ if (!result.success) {
241744
+ throw new SchemaValidationError("Invalid response from server", result.error);
241745
+ }
241746
+ return result.data.authConfig;
241747
+ }
241748
+ async function pushAuthConfigToApi(config3) {
241749
+ const { id } = getAppConfig();
241750
+ let response;
241751
+ try {
241752
+ response = await base44Client.put(`api/apps/${id}`, {
241753
+ json: { auth_config: toAuthConfigPayload(config3) }
241754
+ });
241755
+ } catch (error48) {
241756
+ throw await ApiError.fromHttpError(error48, "updating auth config");
241757
+ }
241758
+ const result = AppAuthConfigResponseSchema.safeParse(await response.json());
241759
+ if (!result.success) {
241760
+ throw new SchemaValidationError("Invalid response from server", result.error);
241761
+ }
241762
+ return result.data.authConfig;
241763
+ }
241764
+ // src/core/resources/auth-config/config.ts
241765
+ import { join as join4 } from "node:path";
241766
+ import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
241767
+ var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
241768
+ var DEFAULT_AUTH_CONFIG = {
241769
+ enableUsernamePassword: false,
241770
+ enableGoogleLogin: false,
241771
+ enableMicrosoftLogin: false,
241772
+ enableFacebookLogin: false,
241773
+ enableAppleLogin: false,
241774
+ ssoProviderName: null,
241775
+ enableSSOLogin: false,
241776
+ googleOAuthMode: "default",
241777
+ googleOAuthClientId: null,
241778
+ useWorkspaceSSO: false
241779
+ };
241780
+ function getAuthConfigPath(authDir) {
241781
+ return join4(authDir, AUTH_CONFIG_FILENAME);
241782
+ }
241783
+ async function readAuthConfig(authDir) {
241784
+ const filePath = getAuthConfigPath(authDir);
241785
+ if (!await pathExists(filePath)) {
241786
+ return null;
241787
+ }
241788
+ const parsed = await readJsonFile(filePath);
241789
+ const result = AuthConfigFileSchema.safeParse(parsed);
241790
+ if (!result.success) {
241791
+ throw new SchemaValidationError("Invalid auth config file", result.error, filePath);
241792
+ }
241793
+ return result.data;
241794
+ }
241795
+ async function writeAuthConfig(authDir, config3) {
241796
+ const filePath = getAuthConfigPath(authDir);
241797
+ if (await pathExists(filePath)) {
241798
+ const existing = await readJsonFile(filePath);
241799
+ const existingResult = AuthConfigFileSchema.safeParse(existing);
241800
+ if (existingResult.success && isDeepStrictEqual2(existingResult.data, config3)) {
241801
+ return { written: false };
241802
+ }
241803
+ }
241804
+ await writeJsonFile(filePath, config3);
241805
+ return { written: true };
241806
+ }
241807
+ // src/core/resources/auth-config/pull.ts
241808
+ async function pullAuthConfig() {
241809
+ return await getAuthConfig();
241810
+ }
241811
+ // src/core/resources/auth-config/push.ts
241812
+ async function pushAuthConfig(config3) {
241813
+ if (!config3) {
241814
+ return;
241815
+ }
241816
+ await pushAuthConfigToApi(config3);
241817
+ }
241818
+ // src/core/resources/auth-config/resource.ts
241819
+ var authConfigResource = {
241820
+ readAll: async (dir) => {
241821
+ const config3 = await readAuthConfig(dir);
241822
+ return config3 ? [config3] : [];
241823
+ },
241824
+ push: async (items) => {
241825
+ await pushAuthConfig(items[0] ?? null);
241826
+ }
241827
+ };
241625
241828
  // src/core/resources/connector/schema.ts
241626
241829
  var GoogleCalendarConnectorSchema = exports_external.object({
241627
241830
  type: exports_external.literal("googlecalendar"),
@@ -241949,8 +242152,8 @@ async function removeStripe() {
241949
242152
  return result.data;
241950
242153
  }
241951
242154
  // src/core/resources/connector/config.ts
241952
- import { join as join4 } from "node:path";
241953
- import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
242155
+ import { join as join5 } from "node:path";
242156
+ import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
241954
242157
  async function readConnectorFile(connectorPath) {
241955
242158
  const parsed = await readJsonFile(connectorPath);
241956
242159
  const result = ConnectorResourceSchema.safeParse(parsed);
@@ -242007,10 +242210,10 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
242007
242210
  const written = [];
242008
242211
  for (const connector of remoteConnectors) {
242009
242212
  const existing = typeToEntry.get(connector.type);
242010
- if (existing && isDeepStrictEqual2(existing.data, connector)) {
242213
+ if (existing && isDeepStrictEqual3(existing.data, connector)) {
242011
242214
  continue;
242012
242215
  }
242013
- const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
242216
+ const filePath = existing?.filePath ?? join5(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
242014
242217
  await writeJsonFile(filePath, connector);
242015
242218
  written.push(connector.type);
242016
242219
  }
@@ -242494,7 +242697,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
242494
242697
  return result.data;
242495
242698
  }
242496
242699
  // src/core/resources/function/config.ts
242497
- import { basename as basename2, dirname as dirname3, join as join5, relative } from "node:path";
242700
+ import { basename as basename2, dirname as dirname3, join as join6, relative } from "node:path";
242498
242701
  async function readFunctionConfig(configPath) {
242499
242702
  const parsed = await readJsonFile(configPath);
242500
242703
  const result = FunctionConfigSchema.safeParse(parsed);
@@ -242504,9 +242707,9 @@ async function readFunctionConfig(configPath) {
242504
242707
  return result.data;
242505
242708
  }
242506
242709
  async function readFunction(configPath) {
242507
- const config5 = await readFunctionConfig(configPath);
242710
+ const config6 = await readFunctionConfig(configPath);
242508
242711
  const functionDir = dirname3(configPath);
242509
- const entryPath = join5(functionDir, config5.entry);
242712
+ const entryPath = join6(functionDir, config6.entry);
242510
242713
  if (!await pathExists(entryPath)) {
242511
242714
  throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
242512
242715
  hints: [{ message: "Check the 'entry' field in your function config" }]
@@ -242516,7 +242719,7 @@ async function readFunction(configPath) {
242516
242719
  cwd: functionDir,
242517
242720
  absolute: true
242518
242721
  });
242519
- const functionData = { ...config5, entryPath, filePaths };
242722
+ const functionData = { ...config6, entryPath, filePaths };
242520
242723
  return functionData;
242521
242724
  }
242522
242725
  async function readAllFunctions(functionsDir) {
@@ -242640,28 +242843,28 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
242640
242843
  return results;
242641
242844
  }
242642
242845
  // src/core/resources/function/pull.ts
242643
- import { join as join6 } from "node:path";
242644
- import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
242846
+ import { join as join7 } from "node:path";
242847
+ import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
242645
242848
  async function writeFunctions(functionsDir, functions) {
242646
242849
  const written = [];
242647
242850
  const skipped = [];
242648
242851
  for (const fn of functions) {
242649
- const functionDir = join6(functionsDir, fn.name);
242650
- const configPath = join6(functionDir, "function.jsonc");
242852
+ const functionDir = join7(functionsDir, fn.name);
242853
+ const configPath = join7(functionDir, "function.jsonc");
242651
242854
  if (await isFunctionUnchanged(functionDir, fn)) {
242652
242855
  skipped.push(fn.name);
242653
242856
  continue;
242654
242857
  }
242655
- const config5 = {
242858
+ const config6 = {
242656
242859
  name: fn.name,
242657
242860
  entry: fn.entry
242658
242861
  };
242659
242862
  if (fn.automations.length > 0) {
242660
- config5.automations = fn.automations;
242863
+ config6.automations = fn.automations;
242661
242864
  }
242662
- await writeJsonFile(configPath, config5);
242865
+ await writeJsonFile(configPath, config6);
242663
242866
  for (const file2 of fn.files) {
242664
- await writeFile(join6(functionDir, file2.path), file2.content);
242867
+ await writeFile(join7(functionDir, file2.path), file2.content);
242665
242868
  }
242666
242869
  written.push(fn.name);
242667
242870
  }
@@ -242671,20 +242874,20 @@ async function isFunctionUnchanged(functionDir, fn) {
242671
242874
  if (!await pathExists(functionDir)) {
242672
242875
  return false;
242673
242876
  }
242674
- const configPath = join6(functionDir, "function.jsonc");
242877
+ const configPath = join7(functionDir, "function.jsonc");
242675
242878
  try {
242676
242879
  const localConfig = await readJsonFile(configPath);
242677
242880
  if (localConfig.entry !== fn.entry) {
242678
242881
  return false;
242679
242882
  }
242680
- if (!isDeepStrictEqual3(localConfig.automations ?? [], fn.automations)) {
242883
+ if (!isDeepStrictEqual4(localConfig.automations ?? [], fn.automations)) {
242681
242884
  return false;
242682
242885
  }
242683
242886
  } catch {
242684
242887
  return false;
242685
242888
  }
242686
242889
  for (const file2 of fn.files) {
242687
- const filePath = join6(functionDir, file2.path);
242890
+ const filePath = join7(functionDir, file2.path);
242688
242891
  if (!await pathExists(filePath)) {
242689
242892
  return false;
242690
242893
  }
@@ -242742,18 +242945,20 @@ async function readProjectConfig(projectRoot) {
242742
242945
  }
242743
242946
  const project = result.data;
242744
242947
  const configDir = dirname5(configPath);
242745
- const [entities, functions, agents, connectors] = await Promise.all([
242746
- entityResource.readAll(join7(configDir, project.entitiesDir)),
242747
- functionResource.readAll(join7(configDir, project.functionsDir)),
242748
- agentResource.readAll(join7(configDir, project.agentsDir)),
242749
- connectorResource.readAll(join7(configDir, project.connectorsDir))
242948
+ const [entities, functions, agents, connectors, authConfig] = await Promise.all([
242949
+ entityResource.readAll(join8(configDir, project.entitiesDir)),
242950
+ functionResource.readAll(join8(configDir, project.functionsDir)),
242951
+ agentResource.readAll(join8(configDir, project.agentsDir)),
242952
+ connectorResource.readAll(join8(configDir, project.connectorsDir)),
242953
+ authConfigResource.readAll(join8(configDir, project.authDir))
242750
242954
  ]);
242751
242955
  return {
242752
242956
  project: { ...project, root, configPath },
242753
242957
  entities,
242754
242958
  functions,
242755
242959
  agents,
242756
- connectors
242960
+ connectors,
242961
+ authConfig
242757
242962
  };
242758
242963
  }
242759
242964
 
@@ -242778,9 +242983,9 @@ async function initAppConfig() {
242778
242983
  if (!projectRoot) {
242779
242984
  throw new ConfigNotFoundError("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
242780
242985
  }
242781
- const config6 = await readAppConfig(projectRoot.root);
242986
+ const config7 = await readAppConfig(projectRoot.root);
242782
242987
  const appConfigPath = await findAppConfigPath(projectRoot.root);
242783
- if (!config6?.id) {
242988
+ if (!config7?.id) {
242784
242989
  throw new ConfigInvalidError("App not configured. Create a .app.jsonc file or run 'base44 link' to link this project.", appConfigPath, {
242785
242990
  hints: [
242786
242991
  {
@@ -242790,7 +242995,7 @@ async function initAppConfig() {
242790
242995
  ]
242791
242996
  });
242792
242997
  }
242793
- cache2 = { projectRoot: projectRoot.root, id: config6.id };
242998
+ cache2 = { projectRoot: projectRoot.root, id: config7.id };
242794
242999
  return cache2;
242795
243000
  }
242796
243001
  function getAppConfig() {
@@ -242799,8 +243004,8 @@ function getAppConfig() {
242799
243004
  }
242800
243005
  return cache2;
242801
243006
  }
242802
- function setAppConfig(config6) {
242803
- cache2 = config6;
243007
+ function setAppConfig(config7) {
243008
+ cache2 = config7;
242804
243009
  }
242805
243010
  function generateAppConfigContent(id) {
242806
243011
  return `// Base44 App Configuration
@@ -242931,12 +243136,12 @@ async function getSiteUrl(projectId) {
242931
243136
  // src/core/project/template.ts
242932
243137
  var import_ejs = __toESM(require_ejs(), 1);
242933
243138
  var import_front_matter = __toESM(require_front_matter(), 1);
242934
- import { dirname as dirname6, join as join9 } from "node:path";
243139
+ import { dirname as dirname6, join as join10 } from "node:path";
242935
243140
 
242936
243141
  // src/core/assets.ts
242937
243142
  import { cpSync, existsSync } from "node:fs";
242938
243143
  import { homedir as homedir2 } from "node:os";
242939
- import { join as join8 } from "node:path";
243144
+ import { join as join9 } from "node:path";
242940
243145
  // package.json
242941
243146
  var package_default = {
242942
243147
  name: "base44",
@@ -242979,6 +243184,8 @@ var package_default = {
242979
243184
  url: "https://github.com/base44/cli"
242980
243185
  },
242981
243186
  devDependencies: {
243187
+ "@base44-cli/logger": "workspace:*",
243188
+ "@base44/sdk": "^0.8.23",
242982
243189
  "@clack/prompts": "^1.0.1",
242983
243190
  "@seald-io/nedb": "^4.1.2",
242984
243191
  "@types/bun": "^1.2.15",
@@ -243029,18 +243236,18 @@ var package_default = {
243029
243236
  };
243030
243237
 
243031
243238
  // src/core/assets.ts
243032
- var ASSETS_DIR = join8(homedir2(), ".base44", "assets", package_default.version);
243239
+ var ASSETS_DIR = join9(homedir2(), ".base44", "assets", package_default.version);
243033
243240
  function getTemplatesDir() {
243034
- return join8(ASSETS_DIR, "templates");
243241
+ return join9(ASSETS_DIR, "templates");
243035
243242
  }
243036
243243
  function getTemplatesIndexPath() {
243037
- return join8(ASSETS_DIR, "templates", "templates.json");
243244
+ return join9(ASSETS_DIR, "templates", "templates.json");
243038
243245
  }
243039
243246
  function getDenoWrapperPath() {
243040
- return join8(ASSETS_DIR, "deno-runtime", "main.ts");
243247
+ return join9(ASSETS_DIR, "deno-runtime", "main.ts");
243041
243248
  }
243042
243249
  function getExecWrapperPath() {
243043
- return join8(ASSETS_DIR, "deno-runtime", "exec.ts");
243250
+ return join9(ASSETS_DIR, "deno-runtime", "exec.ts");
243044
243251
  }
243045
243252
  function ensureNpmAssets(sourceDir) {
243046
243253
  if (existsSync(ASSETS_DIR))
@@ -243061,23 +243268,23 @@ async function listTemplates() {
243061
243268
  return result.data.templates;
243062
243269
  }
243063
243270
  async function renderTemplate(template, destPath, data) {
243064
- const templateDir = join9(getTemplatesDir(), template.path);
243271
+ const templateDir = join10(getTemplatesDir(), template.path);
243065
243272
  const files = await globby("**/*", {
243066
243273
  cwd: templateDir,
243067
243274
  dot: true,
243068
243275
  onlyFiles: true
243069
243276
  });
243070
243277
  for (const file2 of files) {
243071
- const srcPath = join9(templateDir, file2);
243278
+ const srcPath = join10(templateDir, file2);
243072
243279
  try {
243073
243280
  if (file2.endsWith(".ejs")) {
243074
243281
  const rendered = await import_ejs.default.renderFile(srcPath, data);
243075
243282
  const { attributes, body } = import_front_matter.default(rendered);
243076
- const destFile = attributes.outputFileName ? join9(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
243077
- const destFilePath = join9(destPath, destFile);
243283
+ const destFile = attributes.outputFileName ? join10(dirname6(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
243284
+ const destFilePath = join10(destPath, destFile);
243078
243285
  await writeFile(destFilePath, body);
243079
243286
  } else {
243080
- const destFilePath = join9(destPath, file2);
243287
+ const destFilePath = join10(destPath, file2);
243081
243288
  await copyFile(srcPath, destFilePath);
243082
243289
  }
243083
243290
  } catch (error48) {
@@ -243152,7 +243359,7 @@ async function getSiteFilePaths(outputDir) {
243152
243359
  // src/core/site/deploy.ts
243153
243360
  import { randomUUID } from "node:crypto";
243154
243361
  import { tmpdir } from "node:os";
243155
- import { join as join10 } from "node:path";
243362
+ import { join as join11 } from "node:path";
243156
243363
  async function deploySite(siteOutputDir) {
243157
243364
  if (!await pathExists(siteOutputDir)) {
243158
243365
  throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
@@ -243169,7 +243376,7 @@ async function deploySite(siteOutputDir) {
243169
243376
  ]
243170
243377
  });
243171
243378
  }
243172
- const archivePath = join10(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
243379
+ const archivePath = join11(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
243173
243380
  try {
243174
243381
  await createArchive(siteOutputDir, archivePath);
243175
243382
  return await uploadSite(archivePath);
@@ -243186,22 +243393,24 @@ async function createArchive(pathToArchive, targetArchivePath) {
243186
243393
  }
243187
243394
  // src/core/project/deploy.ts
243188
243395
  function hasResourcesToDeploy(projectData) {
243189
- const { project, entities, functions, agents, connectors } = projectData;
243396
+ const { project, entities, functions, agents, connectors, authConfig } = projectData;
243190
243397
  const hasSite = Boolean(project.site?.outputDirectory);
243191
243398
  const hasEntities = entities.length > 0;
243192
243399
  const hasFunctions = functions.length > 0;
243193
243400
  const hasAgents = agents.length > 0;
243194
243401
  const hasConnectors = connectors.length > 0;
243195
- return hasEntities || hasFunctions || hasAgents || hasConnectors || hasSite;
243402
+ const hasAuthConfig = authConfig.length > 0;
243403
+ return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasSite;
243196
243404
  }
243197
243405
  async function deployAll(projectData, options) {
243198
- const { project, entities, functions, agents, connectors } = projectData;
243406
+ const { project, entities, functions, agents, connectors, authConfig } = projectData;
243199
243407
  await entityResource.push(entities);
243200
243408
  await deployFunctionsSequentially(functions, {
243201
243409
  onStart: options?.onFunctionStart,
243202
243410
  onResult: options?.onFunctionResult
243203
243411
  });
243204
243412
  await agentResource.push(agents);
243413
+ await authConfigResource.push(authConfig);
243205
243414
  const { results: connectorResults } = await pushConnectors(connectors);
243206
243415
  if (project.site?.outputDirectory) {
243207
243416
  const outputDir = resolve(project.root, project.site.outputDirectory);
@@ -243388,14 +243597,14 @@ async function getUserInfo(accessToken) {
243388
243597
  return result.data;
243389
243598
  }
243390
243599
  // src/cli/commands/auth/login-flow.ts
243391
- async function generateAndDisplayDeviceCode() {
243600
+ async function generateAndDisplayDeviceCode(log) {
243392
243601
  const deviceCodeResponse = await runTask("Generating device code...", async () => {
243393
243602
  return await generateDeviceCode();
243394
243603
  }, {
243395
243604
  successMessage: "Device code generated",
243396
243605
  errorMessage: "Failed to generate device code"
243397
243606
  });
243398
- R2.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}` + `
243607
+ log.info(`Verification code: ${theme.styles.bold(deviceCodeResponse.userCode)}` + `
243399
243608
  Please confirm this code at: ${deviceCodeResponse.verificationUri}`);
243400
243609
  return deviceCodeResponse;
243401
243610
  }
@@ -243439,8 +243648,8 @@ async function saveAuthData(response, userInfo) {
243439
243648
  name: userInfo.name
243440
243649
  });
243441
243650
  }
243442
- async function login() {
243443
- const deviceCodeResponse = await generateAndDisplayDeviceCode();
243651
+ async function login({ log }) {
243652
+ const deviceCodeResponse = await generateAndDisplayDeviceCode(log);
243444
243653
  const token = await waitForAuthentication(deviceCodeResponse.deviceCode, deviceCodeResponse.expiresIn, deviceCodeResponse.interval);
243445
243654
  const userInfo = await getUserInfo(token.accessToken);
243446
243655
  await saveAuthData(token, userInfo);
@@ -243450,22 +243659,22 @@ async function login() {
243450
243659
  }
243451
243660
 
243452
243661
  // src/cli/utils/command/middleware.ts
243453
- async function ensureAuth(errorReporter) {
243662
+ async function ensureAuth(ctx) {
243454
243663
  const loggedIn = await isLoggedIn();
243455
243664
  if (!loggedIn) {
243456
- R2.info("You need to login first to continue.");
243457
- await login();
243665
+ ctx.log.info("You need to login first to continue.");
243666
+ await login(ctx);
243458
243667
  }
243459
243668
  try {
243460
243669
  const userInfo = await readAuth();
243461
- errorReporter.setContext({
243670
+ ctx.errorReporter.setContext({
243462
243671
  user: { email: userInfo.email, name: userInfo.name }
243463
243672
  });
243464
243673
  } catch {}
243465
243674
  }
243466
- async function ensureAppConfig(errorReporter) {
243675
+ async function ensureAppConfig(ctx) {
243467
243676
  const appConfig = await initAppConfig();
243468
- errorReporter.setContext({ appId: appConfig.id });
243677
+ ctx.errorReporter.setContext({ appId: appConfig.id });
243469
243678
  }
243470
243679
 
243471
243680
  // ../../node_modules/is-plain-obj/index.js
@@ -250111,9 +250320,6 @@ class Base44Command extends Command {
250111
250320
  setContext(context) {
250112
250321
  this._context = context;
250113
250322
  }
250114
- get isNonInteractive() {
250115
- return this._context?.isNonInteractive ?? false;
250116
- }
250117
250323
  get context() {
250118
250324
  if (!this._context) {
250119
250325
  throw new Error("Base44Command context not set. Ensure the command is registered via createProgram().");
@@ -250129,12 +250335,12 @@ class Base44Command extends Command {
250129
250335
  const upgradeCheckPromise = startUpgradeCheck();
250130
250336
  try {
250131
250337
  if (this._commandOptions.requireAuth) {
250132
- await ensureAuth(this.context.errorReporter);
250338
+ await ensureAuth(this.context);
250133
250339
  }
250134
250340
  if (this._commandOptions.requireAppConfig) {
250135
- await ensureAppConfig(this.context.errorReporter);
250341
+ await ensureAppConfig(this.context);
250136
250342
  }
250137
- const result = await fn(...args) ?? {};
250343
+ const result = await fn(this.context, ...args) ?? {};
250138
250344
  if (!quiet) {
250139
250345
  await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
250140
250346
  } else {
@@ -250342,10 +250548,12 @@ async function parseEnvFile(filePath) {
250342
250548
  return import_dotenv.parse(content);
250343
250549
  }
250344
250550
  // src/cli/commands/agents/pull.ts
250345
- async function pullAgentsAction() {
250551
+ async function pullAgentsAction({
250552
+ log
250553
+ }) {
250346
250554
  const { project: project2 } = await readProjectConfig();
250347
250555
  const configDir = dirname7(project2.configPath);
250348
- const agentsDir = join11(configDir, project2.agentsDir);
250556
+ const agentsDir = join12(configDir, project2.agentsDir);
250349
250557
  const remoteAgents = await runTask("Fetching agents from Base44", async () => {
250350
250558
  return await fetchAgents();
250351
250559
  }, {
@@ -250359,13 +250567,13 @@ async function pullAgentsAction() {
250359
250567
  errorMessage: "Failed to sync agent files"
250360
250568
  });
250361
250569
  if (written.length > 0) {
250362
- R2.success(`Written: ${written.join(", ")}`);
250570
+ log.success(`Written: ${written.join(", ")}`);
250363
250571
  }
250364
250572
  if (deleted.length > 0) {
250365
- R2.warn(`Deleted: ${deleted.join(", ")}`);
250573
+ log.warn(`Deleted: ${deleted.join(", ")}`);
250366
250574
  }
250367
250575
  if (written.length === 0 && deleted.length === 0) {
250368
- R2.info("All agents are already up to date");
250576
+ log.info("All agents are already up to date");
250369
250577
  }
250370
250578
  return {
250371
250579
  outroMessage: `Pulled ${remoteAgents.total} agents to ${agentsDir}`
@@ -250376,9 +250584,11 @@ function getAgentsPullCommand() {
250376
250584
  }
250377
250585
 
250378
250586
  // src/cli/commands/agents/push.ts
250379
- async function pushAgentsAction() {
250587
+ async function pushAgentsAction({
250588
+ log
250589
+ }) {
250380
250590
  const { agents } = await readProjectConfig();
250381
- R2.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
250591
+ log.info(agents.length === 0 ? "No local agents found - this will delete all remote agents" : `Found ${agents.length} agents to push`);
250382
250592
  const result = await runTask("Pushing agents to Base44", async () => {
250383
250593
  return await pushAgents(agents);
250384
250594
  }, {
@@ -250386,13 +250596,13 @@ async function pushAgentsAction() {
250386
250596
  errorMessage: "Failed to push agents"
250387
250597
  });
250388
250598
  if (result.created.length > 0) {
250389
- R2.success(`Created: ${result.created.join(", ")}`);
250599
+ log.success(`Created: ${result.created.join(", ")}`);
250390
250600
  }
250391
250601
  if (result.updated.length > 0) {
250392
- R2.success(`Updated: ${result.updated.join(", ")}`);
250602
+ log.success(`Updated: ${result.updated.join(", ")}`);
250393
250603
  }
250394
250604
  if (result.deleted.length > 0) {
250395
- R2.warn(`Deleted: ${result.deleted.join(", ")}`);
250605
+ log.warn(`Deleted: ${result.deleted.join(", ")}`);
250396
250606
  }
250397
250607
  return { outroMessage: "Agents pushed to Base44" };
250398
250608
  }
@@ -250405,6 +250615,121 @@ function getAgentsCommand() {
250405
250615
  return new Command("agents").description("Manage project agents").addCommand(getAgentsPushCommand()).addCommand(getAgentsPullCommand());
250406
250616
  }
250407
250617
 
250618
+ // src/cli/commands/auth/password-login.ts
250619
+ import { dirname as dirname8, join as join13 } from "node:path";
250620
+ function validateAction(action) {
250621
+ if (action !== "enable" && action !== "disable") {
250622
+ throw new InvalidInputError(`Invalid action "${action}". Must be "enable" or "disable".`, {
250623
+ hints: [
250624
+ {
250625
+ message: "Enable password auth: base44 auth password-login enable",
250626
+ command: "base44 auth password-login enable"
250627
+ },
250628
+ {
250629
+ message: "Disable password auth: base44 auth password-login disable",
250630
+ command: "base44 auth password-login disable"
250631
+ }
250632
+ ]
250633
+ });
250634
+ }
250635
+ }
250636
+ async function passwordLoginAction({ log }, action) {
250637
+ validateAction(action);
250638
+ const shouldEnable = action === "enable";
250639
+ const { project: project2 } = await readProjectConfig();
250640
+ const configDir = dirname8(project2.configPath);
250641
+ const authDir = join13(configDir, project2.authDir);
250642
+ const updated = await runTask("Updating local auth config", async () => {
250643
+ const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
250644
+ const merged = { ...current, enableUsernamePassword: shouldEnable };
250645
+ await writeAuthConfig(authDir, merged);
250646
+ return merged;
250647
+ });
250648
+ if (!shouldEnable && !hasAnyLoginMethod(updated)) {
250649
+ log.warn("Disabling password auth will leave no login methods enabled. Users will be locked out.");
250650
+ }
250651
+ const newStatus = shouldEnable ? "enabled" : "disabled";
250652
+ return {
250653
+ outroMessage: `Username & password authentication ${newStatus} in local config. Run \`base44 auth push\` or \`base44 deploy\` to apply.`
250654
+ };
250655
+ }
250656
+ function getPasswordLoginCommand() {
250657
+ return new Base44Command("password-login").description("Enable or disable username & password authentication").argument("<enable|disable>", "enable or disable password authentication").action(passwordLoginAction);
250658
+ }
250659
+
250660
+ // src/cli/commands/auth/pull.ts
250661
+ import { dirname as dirname9, join as join14 } from "node:path";
250662
+ async function pullAuthAction({ log }) {
250663
+ const { project: project2 } = await readProjectConfig();
250664
+ const configDir = dirname9(project2.configPath);
250665
+ const authDir = join14(configDir, project2.authDir);
250666
+ const remoteConfig = await runTask("Fetching auth config from Base44", async () => {
250667
+ return await pullAuthConfig();
250668
+ }, {
250669
+ successMessage: "Auth config fetched successfully",
250670
+ errorMessage: "Failed to fetch auth config"
250671
+ });
250672
+ const { written } = await runTask("Syncing auth config file", async () => {
250673
+ return await writeAuthConfig(authDir, remoteConfig);
250674
+ }, {
250675
+ successMessage: "Auth config file synced successfully",
250676
+ errorMessage: "Failed to sync auth config file"
250677
+ });
250678
+ if (written) {
250679
+ log.success("Auth config written to local file");
250680
+ } else {
250681
+ log.info("Auth config is already up to date");
250682
+ }
250683
+ return {
250684
+ outroMessage: `Pulled auth config to ${authDir} (overwrites local file)`
250685
+ };
250686
+ }
250687
+ function getAuthPullCommand() {
250688
+ return new Base44Command("pull").description("Pull auth config from Base44 to local file").action(pullAuthAction);
250689
+ }
250690
+
250691
+ // src/cli/commands/auth/push.ts
250692
+ async function pushAuthAction({ isNonInteractive, log }, options) {
250693
+ const { authConfig } = await readProjectConfig();
250694
+ if (authConfig.length === 0) {
250695
+ log.info("No local auth config found");
250696
+ return {
250697
+ outroMessage: "No auth config to push. Run `base44 auth pull` to fetch the remote config first."
250698
+ };
250699
+ }
250700
+ if (!hasAnyLoginMethod(authConfig[0])) {
250701
+ log.warn("This config has no login methods enabled. Pushing it will lock out all users.");
250702
+ }
250703
+ if (!options.yes) {
250704
+ if (isNonInteractive) {
250705
+ throw new InvalidInputError("--yes is required in non-interactive mode");
250706
+ }
250707
+ const shouldPush = await Re({
250708
+ message: "Push auth config to Base44?"
250709
+ });
250710
+ if (Ct(shouldPush) || !shouldPush) {
250711
+ return { outroMessage: "Push cancelled" };
250712
+ }
250713
+ }
250714
+ await runTask("Pushing auth config to Base44", async () => {
250715
+ return await pushAuthConfig(authConfig[0] ?? null);
250716
+ }, {
250717
+ successMessage: "Auth config pushed successfully",
250718
+ errorMessage: "Failed to push auth config"
250719
+ });
250720
+ return {
250721
+ outroMessage: "Auth config pushed to Base44"
250722
+ };
250723
+ }
250724
+ function getAuthPushCommand() {
250725
+ return new Base44Command("push").description("Push local auth config to Base44").option("-y, --yes", "Skip confirmation prompt").action(pushAuthAction);
250726
+ }
250727
+
250728
+ // src/cli/commands/auth/index.ts
250729
+ function getAuthCommand() {
250730
+ return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
250731
+ }
250732
+
250408
250733
  // src/cli/commands/auth/login.ts
250409
250734
  function getLoginCommand() {
250410
250735
  return new Base44Command("login", {
@@ -250414,7 +250739,7 @@ function getLoginCommand() {
250414
250739
  }
250415
250740
 
250416
250741
  // src/cli/commands/auth/logout.ts
250417
- async function logout() {
250742
+ async function logout(_ctx) {
250418
250743
  await deleteAuth();
250419
250744
  return { outroMessage: "Logged out successfully" };
250420
250745
  }
@@ -250426,7 +250751,7 @@ function getLogoutCommand() {
250426
250751
  }
250427
250752
 
250428
250753
  // src/cli/commands/auth/whoami.ts
250429
- async function whoami() {
250754
+ async function whoami(_ctx) {
250430
250755
  const auth2 = await readAuth();
250431
250756
  return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
250432
250757
  }
@@ -250435,7 +250760,9 @@ function getWhoamiCommand() {
250435
250760
  }
250436
250761
 
250437
250762
  // src/cli/commands/connectors/list-available.ts
250438
- async function listAvailableAction() {
250763
+ async function listAvailableAction({
250764
+ log
250765
+ }) {
250439
250766
  const { integrations } = await runTask("Fetching available integrations from Base44", async () => {
250440
250767
  return await listAvailableIntegrations();
250441
250768
  }, {
@@ -250448,7 +250775,7 @@ async function listAvailableAction() {
250448
250775
  for (const { displayName, ...rest } of integrations) {
250449
250776
  const yaml2 = formatYaml(rest);
250450
250777
  const pad = " ".repeat(YAML_INDENT);
250451
- R2.info(`${displayName}
250778
+ log.info(`${displayName}
250452
250779
  ${pad}${yaml2.replace(/\n/g, `
250453
250780
  ${pad}`)}`);
250454
250781
  }
@@ -250461,11 +250788,13 @@ function getConnectorsListAvailableCommand() {
250461
250788
  }
250462
250789
 
250463
250790
  // src/cli/commands/connectors/pull.ts
250464
- import { dirname as dirname8, join as join12 } from "node:path";
250465
- async function pullConnectorsAction() {
250791
+ import { dirname as dirname10, join as join15 } from "node:path";
250792
+ async function pullConnectorsAction({
250793
+ log
250794
+ }) {
250466
250795
  const { project: project2 } = await readProjectConfig();
250467
- const configDir = dirname8(project2.configPath);
250468
- const connectorsDir = join12(configDir, project2.connectorsDir);
250796
+ const configDir = dirname10(project2.configPath);
250797
+ const connectorsDir = join15(configDir, project2.connectorsDir);
250469
250798
  const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
250470
250799
  return await pullAllConnectors();
250471
250800
  }, {
@@ -250479,13 +250808,13 @@ async function pullConnectorsAction() {
250479
250808
  errorMessage: "Failed to sync connector files"
250480
250809
  });
250481
250810
  if (written.length > 0) {
250482
- R2.success(`Written: ${written.join(", ")}`);
250811
+ log.success(`Written: ${written.join(", ")}`);
250483
250812
  }
250484
250813
  if (deleted.length > 0) {
250485
- R2.warn(`Deleted: ${deleted.join(", ")}`);
250814
+ log.warn(`Deleted: ${deleted.join(", ")}`);
250486
250815
  }
250487
250816
  if (written.length === 0 && deleted.length === 0) {
250488
- R2.info("All connectors are already up to date");
250817
+ log.info("All connectors are already up to date");
250489
250818
  }
250490
250819
  return {
250491
250820
  outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
@@ -251154,14 +251483,14 @@ async function runOAuthFlowWithSkip(connector2) {
251154
251483
  }
251155
251484
  return finalStatus;
251156
251485
  }
251157
- async function promptOAuthFlows(pending, options) {
251486
+ async function promptOAuthFlows(pending, log, options) {
251158
251487
  const outcomes = new Map;
251159
251488
  if (pending.length === 0) {
251160
251489
  return outcomes;
251161
251490
  }
251162
- R2.warn(`${pending.length} connector(s) require authorization in your browser:`);
251491
+ log.warn(`${pending.length} connector(s) require authorization in your browser:`);
251163
251492
  for (const connector2 of pending) {
251164
- R2.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
251493
+ log.info(` ${connector2.type}: ${theme.styles.dim(connector2.redirectUrl)}`);
251165
251494
  }
251166
251495
  if (options?.skipPrompt) {
251167
251496
  return outcomes;
@@ -251174,11 +251503,11 @@ async function promptOAuthFlows(pending, options) {
251174
251503
  }
251175
251504
  for (const connector2 of pending) {
251176
251505
  try {
251177
- R2.info(`Opening browser for ${connector2.type}...`);
251506
+ log.info(`Opening browser for ${connector2.type}...`);
251178
251507
  const status = await runOAuthFlowWithSkip(connector2);
251179
251508
  outcomes.set(connector2.type, status);
251180
251509
  } catch (err) {
251181
- R2.error(`Failed to authorize ${connector2.type}: ${err instanceof Error ? err.message : String(err)}`);
251510
+ log.error(`Failed to authorize ${connector2.type}: ${err instanceof Error ? err.message : String(err)}`);
251182
251511
  outcomes.set(connector2.type, "FAILED");
251183
251512
  }
251184
251513
  }
@@ -251186,7 +251515,7 @@ async function promptOAuthFlows(pending, options) {
251186
251515
  }
251187
251516
 
251188
251517
  // src/cli/commands/connectors/push.ts
251189
- function printSummary(results, oauthOutcomes) {
251518
+ function printSummary(results, oauthOutcomes, log) {
251190
251519
  const synced = [];
251191
251520
  const added = [];
251192
251521
  let provisioned;
@@ -251224,57 +251553,58 @@ function printSummary(results, oauthOutcomes) {
251224
251553
  }
251225
251554
  }
251226
251555
  }
251227
- R2.info(theme.styles.bold("Summary:"));
251556
+ log.info(theme.styles.bold("Summary:"));
251228
251557
  if (provisioned) {
251229
- R2.success("Stripe sandbox provisioned");
251558
+ log.success("Stripe sandbox provisioned");
251230
251559
  if (provisioned.claimUrl) {
251231
- R2.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
251560
+ log.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
251232
251561
  }
251233
- R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
251562
+ log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
251234
251563
  }
251235
251564
  if (synced.length > 0) {
251236
- R2.success(`Synced: ${synced.join(", ")}`);
251565
+ log.success(`Synced: ${synced.join(", ")}`);
251237
251566
  }
251238
251567
  if (added.length > 0) {
251239
- R2.success(`Added: ${added.join(", ")}`);
251568
+ log.success(`Added: ${added.join(", ")}`);
251240
251569
  }
251241
251570
  if (removed.length > 0) {
251242
- R2.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
251571
+ log.info(theme.styles.dim(`Removed: ${removed.join(", ")}`));
251243
251572
  }
251244
251573
  if (skipped.length > 0) {
251245
- R2.warn(`Skipped: ${skipped.join(", ")}`);
251574
+ log.warn(`Skipped: ${skipped.join(", ")}`);
251246
251575
  }
251247
251576
  for (const r of failed) {
251248
- R2.error(`Failed: ${r.type} - ${r.error}`);
251577
+ log.error(`Failed: ${r.type} - ${r.error}`);
251249
251578
  }
251250
251579
  }
251251
- async function pushConnectorsAction(isNonInteractive) {
251580
+ async function pushConnectorsAction({
251581
+ isNonInteractive,
251582
+ log
251583
+ }) {
251252
251584
  const { connectors } = await readProjectConfig();
251253
251585
  if (connectors.length === 0) {
251254
- R2.info("No local connectors found - checking for remote connectors to remove");
251586
+ log.info("No local connectors found - checking for remote connectors to remove");
251255
251587
  } else {
251256
251588
  const connectorNames = connectors.map((c3) => c3.type).join(", ");
251257
- R2.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
251589
+ log.info(`Found ${connectors.length} connectors to push: ${connectorNames}`);
251258
251590
  }
251259
251591
  const { results } = await runTask("Pushing connectors to Base44", async () => {
251260
251592
  return await pushConnectors(connectors);
251261
251593
  });
251262
251594
  const needsOAuth = filterPendingOAuth(results);
251263
251595
  let outroMessage = "Connectors pushed to Base44";
251264
- const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
251596
+ const oauthOutcomes = await promptOAuthFlows(needsOAuth, log, {
251265
251597
  skipPrompt: isNonInteractive
251266
251598
  });
251267
251599
  const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
251268
251600
  if (needsOAuth.length > 0 && !allAuthorized) {
251269
251601
  outroMessage = isNonInteractive ? "Skipped OAuth in non-interactive mode. Run 'base44 connectors push' locally or open the links above to authorize." : "Some connectors still require authorization. Run 'base44 connectors push' or open the links above to authorize.";
251270
251602
  }
251271
- printSummary(results, oauthOutcomes);
251603
+ printSummary(results, oauthOutcomes, log);
251272
251604
  return { outroMessage };
251273
251605
  }
251274
251606
  function getConnectorsPushCommand() {
251275
- return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(async (_options, command2) => {
251276
- return await pushConnectorsAction(command2.isNonInteractive);
251277
- });
251607
+ return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(pushConnectorsAction);
251278
251608
  }
251279
251609
 
251280
251610
  // src/cli/commands/connectors/index.ts
@@ -251283,7 +251613,9 @@ function getConnectorsCommand() {
251283
251613
  }
251284
251614
 
251285
251615
  // src/cli/commands/dashboard/open.ts
251286
- async function openDashboard(isNonInteractive) {
251616
+ async function openDashboard({
251617
+ isNonInteractive
251618
+ }) {
251287
251619
  const dashboardUrl = getDashboardUrl();
251288
251620
  if (!isNonInteractive) {
251289
251621
  await open_default(dashboardUrl);
@@ -251291,9 +251623,7 @@ async function openDashboard(isNonInteractive) {
251291
251623
  return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
251292
251624
  }
251293
251625
  function getDashboardOpenCommand() {
251294
- return new Base44Command("open").description("Open the app dashboard in your browser").action(async (_options, command2) => {
251295
- return await openDashboard(command2.isNonInteractive);
251296
- });
251626
+ return new Base44Command("open").description("Open the app dashboard in your browser").action(openDashboard);
251297
251627
  }
251298
251628
 
251299
251629
  // src/cli/commands/dashboard/index.ts
@@ -251302,13 +251632,15 @@ function getDashboardCommand() {
251302
251632
  }
251303
251633
 
251304
251634
  // src/cli/commands/entities/push.ts
251305
- async function pushEntitiesAction() {
251635
+ async function pushEntitiesAction({
251636
+ log
251637
+ }) {
251306
251638
  const { entities } = await readProjectConfig();
251307
251639
  if (entities.length === 0) {
251308
251640
  return { outroMessage: "No entities found in project" };
251309
251641
  }
251310
251642
  const entityNames = entities.map((e2) => e2.name).join(", ");
251311
- R2.info(`Found ${entities.length} entities to push: ${entityNames}`);
251643
+ log.info(`Found ${entities.length} entities to push: ${entityNames}`);
251312
251644
  const result = await runTask("Pushing entities to Base44", async () => {
251313
251645
  return await pushEntities(entities);
251314
251646
  }, {
@@ -251316,13 +251648,13 @@ async function pushEntitiesAction() {
251316
251648
  errorMessage: "Failed to push entities"
251317
251649
  });
251318
251650
  if (result.created.length > 0) {
251319
- R2.success(`Created: ${result.created.join(", ")}`);
251651
+ log.success(`Created: ${result.created.join(", ")}`);
251320
251652
  }
251321
251653
  if (result.updated.length > 0) {
251322
- R2.success(`Updated: ${result.updated.join(", ")}`);
251654
+ log.success(`Updated: ${result.updated.join(", ")}`);
251323
251655
  }
251324
251656
  if (result.deleted.length > 0) {
251325
- R2.warn(`Deleted: ${result.deleted.join(", ")}`);
251657
+ log.warn(`Deleted: ${result.deleted.join(", ")}`);
251326
251658
  }
251327
251659
  return { outroMessage: "Entities pushed to Base44" };
251328
251660
  }
@@ -251331,7 +251663,7 @@ function getEntitiesPushCommand() {
251331
251663
  }
251332
251664
 
251333
251665
  // src/cli/commands/functions/delete.ts
251334
- async function deleteFunctionsAction(names) {
251666
+ async function deleteFunctionsAction(_ctx, names) {
251335
251667
  let deleted = 0;
251336
251668
  let notFound = 0;
251337
251669
  let errors5 = 0;
@@ -251377,9 +251709,9 @@ function validateNames(command2) {
251377
251709
  }
251378
251710
  }
251379
251711
  function getDeleteCommand() {
251380
- return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (rawNames) => {
251712
+ return new Base44Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").hook("preAction", validateNames).action(async (ctx, rawNames) => {
251381
251713
  const names = parseNames(rawNames);
251382
- return deleteFunctionsAction(names);
251714
+ return deleteFunctionsAction(ctx, names);
251383
251715
  });
251384
251716
  }
251385
251717
 
@@ -251387,15 +251719,15 @@ function getDeleteCommand() {
251387
251719
  function formatDuration(ms) {
251388
251720
  return `${(ms / 1000).toFixed(1)}s`;
251389
251721
  }
251390
- function formatDeployResult(result) {
251722
+ function formatDeployResult(result, log) {
251391
251723
  const label = result.name.padEnd(25);
251392
251724
  if (result.status === "deployed") {
251393
251725
  const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
251394
- R2.success(`${label} deployed${timing}`);
251726
+ log.success(`${label} deployed${timing}`);
251395
251727
  } else if (result.status === "unchanged") {
251396
- R2.success(`${label} unchanged`);
251728
+ log.success(`${label} unchanged`);
251397
251729
  } else {
251398
- R2.error(`${label} error: ${result.error}`);
251730
+ log.error(`${label} error: ${result.error}`);
251399
251731
  }
251400
251732
  }
251401
251733
 
@@ -251414,17 +251746,17 @@ function resolveFunctionsToDeploy(names, allFunctions) {
251414
251746
  }
251415
251747
  return allFunctions.filter((f) => names.includes(f.name));
251416
251748
  }
251417
- function formatPruneResult(pruneResult) {
251749
+ function formatPruneResult(pruneResult, log) {
251418
251750
  if (pruneResult.deleted) {
251419
- R2.success(`${pruneResult.name.padEnd(25)} deleted`);
251751
+ log.success(`${pruneResult.name.padEnd(25)} deleted`);
251420
251752
  } else {
251421
- R2.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
251753
+ log.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
251422
251754
  }
251423
251755
  }
251424
- function formatPruneSummary(pruneResults) {
251756
+ function formatPruneSummary(pruneResults, log) {
251425
251757
  if (pruneResults.length > 0) {
251426
251758
  const pruned = pruneResults.filter((r) => r.deleted).length;
251427
- R2.info(`${pruned} deleted`);
251759
+ log.info(`${pruned} deleted`);
251428
251760
  }
251429
251761
  }
251430
251762
  function buildDeploySummary(results) {
@@ -251440,7 +251772,7 @@ function buildDeploySummary(results) {
251440
251772
  parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
251441
251773
  return parts.join(", ") || "No functions deployed";
251442
251774
  }
251443
- async function deployFunctionsAction(names, options) {
251775
+ async function deployFunctionsAction({ log }, names, options) {
251444
251776
  if (options.force && names.length > 0) {
251445
251777
  throw new InvalidInputError("--force cannot be used when specifying function names");
251446
251778
  }
@@ -251451,17 +251783,17 @@ async function deployFunctionsAction(names, options) {
251451
251783
  outroMessage: "No functions found. Create functions in the 'functions' directory."
251452
251784
  };
251453
251785
  }
251454
- R2.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
251786
+ log.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
251455
251787
  let completed = 0;
251456
251788
  const total = toDeploy.length;
251457
251789
  const results = await deployFunctionsSequentially(toDeploy, {
251458
251790
  onStart: (startNames) => {
251459
251791
  const label = startNames.length === 1 ? startNames[0] : `${startNames.length} functions`;
251460
- R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
251792
+ log.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
251461
251793
  },
251462
251794
  onResult: (result) => {
251463
251795
  completed++;
251464
- formatDeployResult(result);
251796
+ formatDeployResult(result, log);
251465
251797
  }
251466
251798
  });
251467
251799
  if (options.force) {
@@ -251472,28 +251804,30 @@ async function deployFunctionsAction(names, options) {
251472
251804
  onStart: (total2) => {
251473
251805
  pruneTotal = total2;
251474
251806
  if (total2 > 0) {
251475
- R2.info(`Found ${total2} remote ${total2 === 1 ? "function" : "functions"} to delete`);
251807
+ log.info(`Found ${total2} remote ${total2 === 1 ? "function" : "functions"} to delete`);
251476
251808
  }
251477
251809
  },
251478
251810
  onBeforeDelete: (name2) => {
251479
251811
  pruneCompleted++;
251480
- R2.step(theme.styles.dim(`[${pruneCompleted}/${pruneTotal}] Deleting ${name2}...`));
251812
+ log.step(theme.styles.dim(`[${pruneCompleted}/${pruneTotal}] Deleting ${name2}...`));
251481
251813
  },
251482
- onResult: formatPruneResult
251814
+ onResult: (r) => formatPruneResult(r, log)
251483
251815
  });
251484
- formatPruneSummary(pruneResults);
251816
+ formatPruneSummary(pruneResults, log);
251485
251817
  }
251486
251818
  return { outroMessage: buildDeploySummary(results) };
251487
251819
  }
251488
251820
  function getDeployCommand() {
251489
- return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options) => {
251821
+ return new Base44Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (ctx, rawNames, options) => {
251490
251822
  const names = parseNames2(rawNames);
251491
- return deployFunctionsAction(names, options);
251823
+ return deployFunctionsAction(ctx, names, options);
251492
251824
  });
251493
251825
  }
251494
251826
 
251495
251827
  // src/cli/commands/functions/list.ts
251496
- async function listFunctionsAction() {
251828
+ async function listFunctionsAction({
251829
+ log
251830
+ }) {
251497
251831
  const { functions } = await runTask("Fetching functions...", async () => listDeployedFunctions(), { errorMessage: "Failed to fetch functions" });
251498
251832
  if (functions.length === 0) {
251499
251833
  return { outroMessage: "No functions on remote" };
@@ -251501,7 +251835,7 @@ async function listFunctionsAction() {
251501
251835
  for (const fn of functions) {
251502
251836
  const automationCount = fn.automations.length;
251503
251837
  const automationLabel = automationCount > 0 ? theme.styles.dim(` (${automationCount} automation${automationCount > 1 ? "s" : ""})`) : "";
251504
- R2.message(` ${fn.name}${automationLabel}`);
251838
+ log.message(` ${fn.name}${automationLabel}`);
251505
251839
  }
251506
251840
  return {
251507
251841
  outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
@@ -251512,11 +251846,11 @@ function getListCommand() {
251512
251846
  }
251513
251847
 
251514
251848
  // src/cli/commands/functions/pull.ts
251515
- import { dirname as dirname9, join as join13 } from "node:path";
251516
- async function pullFunctionsAction(name2) {
251849
+ import { dirname as dirname11, join as join16 } from "node:path";
251850
+ async function pullFunctionsAction({ log }, name2) {
251517
251851
  const { project: project2 } = await readProjectConfig();
251518
- const configDir = dirname9(project2.configPath);
251519
- const functionsDir = join13(configDir, project2.functionsDir);
251852
+ const configDir = dirname11(project2.configPath);
251853
+ const functionsDir = join16(configDir, project2.functionsDir);
251520
251854
  const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
251521
251855
  const { functions } = await listDeployedFunctions();
251522
251856
  return functions;
@@ -251540,10 +251874,10 @@ async function pullFunctionsAction(name2) {
251540
251874
  errorMessage: "Failed to write function files"
251541
251875
  });
251542
251876
  for (const name3 of written) {
251543
- R2.success(`${name3.padEnd(25)} written`);
251877
+ log.success(`${name3.padEnd(25)} written`);
251544
251878
  }
251545
251879
  for (const name3 of skipped) {
251546
- R2.info(`${name3.padEnd(25)} unchanged`);
251880
+ log.info(`${name3.padEnd(25)} unchanged`);
251547
251881
  }
251548
251882
  return {
251549
251883
  outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
@@ -251559,7 +251893,7 @@ function getFunctionsCommand() {
251559
251893
  }
251560
251894
 
251561
251895
  // src/cli/commands/project/create.ts
251562
- import { basename as basename3, join as join14, resolve as resolve2 } from "node:path";
251896
+ import { basename as basename3, join as join17, resolve as resolve2 } from "node:path";
251563
251897
  var import_kebabCase = __toESM(require_kebabCase(), 1);
251564
251898
  var DEFAULT_TEMPLATE_ID = "backend-only";
251565
251899
  async function getTemplateById(templateId) {
@@ -251579,7 +251913,7 @@ function validateNonInteractiveFlags(command2) {
251579
251913
  command2.error("--path requires a project name argument. Usage: base44 create <name> --path <path>");
251580
251914
  }
251581
251915
  }
251582
- async function createInteractive(options) {
251916
+ async function createInteractive(options, log) {
251583
251917
  const templates = await listTemplates();
251584
251918
  const templateOptions = templates.map((t) => ({
251585
251919
  value: t,
@@ -251621,10 +251955,10 @@ async function createInteractive(options) {
251621
251955
  deploy: options.deploy,
251622
251956
  skills: options.skills,
251623
251957
  isInteractive: true
251624
- });
251958
+ }, log);
251625
251959
  }
251626
- async function createNonInteractive(options) {
251627
- R2.info(`Creating a new project at ${resolve2(options.path)}`);
251960
+ async function createNonInteractive(options, log) {
251961
+ log.info(`Creating a new project at ${resolve2(options.path)}`);
251628
251962
  const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
251629
251963
  return await executeCreate({
251630
251964
  template: template2,
@@ -251633,7 +251967,7 @@ async function createNonInteractive(options) {
251633
251967
  deploy: options.deploy,
251634
251968
  skills: options.skills,
251635
251969
  isInteractive: false
251636
- });
251970
+ }, log);
251637
251971
  }
251638
251972
  async function executeCreate({
251639
251973
  template: template2,
@@ -251643,7 +251977,7 @@ async function executeCreate({
251643
251977
  deploy: deploy5,
251644
251978
  skills,
251645
251979
  isInteractive
251646
- }) {
251980
+ }, log) {
251647
251981
  const name2 = rawName.trim();
251648
251982
  const resolvedPath = resolve2(projectPath);
251649
251983
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -251696,7 +252030,7 @@ async function executeCreate({
251696
252030
  updateMessage("Building project...");
251697
252031
  await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
251698
252032
  updateMessage("Deploying site...");
251699
- return await deploySite(join14(resolvedPath, outputDirectory));
252033
+ return await deploySite(join17(resolvedPath, outputDirectory));
251700
252034
  }, {
251701
252035
  successMessage: theme.colors.base44Orange("Site deployed successfully"),
251702
252036
  errorMessage: "Failed to deploy site"
@@ -251718,13 +252052,32 @@ async function executeCreate({
251718
252052
  });
251719
252053
  } catch {}
251720
252054
  }
251721
- R2.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
251722
- R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
252055
+ log.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name2)}`);
252056
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(projectId))}`);
251723
252057
  if (finalAppUrl) {
251724
- R2.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
252058
+ log.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
251725
252059
  }
251726
252060
  return { outroMessage: "Your project is set up and ready to use" };
251727
252061
  }
252062
+ async function createAction({ log, isNonInteractive }, name2, options) {
252063
+ if (name2 && !options.path) {
252064
+ options.path = `./${import_kebabCase.default(name2)}`;
252065
+ }
252066
+ const skipPrompts = !!(options.name ?? name2) && !!options.path;
252067
+ if (!skipPrompts && isNonInteractive) {
252068
+ throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
252069
+ hints: [
252070
+ {
252071
+ message: "Usage: base44 create <name> --path <path>"
252072
+ }
252073
+ ]
252074
+ });
252075
+ }
252076
+ if (skipPrompts) {
252077
+ return await createNonInteractive({ name: options.name ?? name2, ...options }, log);
252078
+ }
252079
+ return await createInteractive({ name: name2, ...options }, log);
252080
+ }
251728
252081
  function getCreateCommand() {
251729
252082
  return new Base44Command("create", {
251730
252083
  requireAppConfig: false,
@@ -251733,39 +252086,21 @@ function getCreateCommand() {
251733
252086
  Examples:
251734
252087
  $ base44 create my-app Creates a base44 project at ./my-app
251735
252088
  $ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
251736
- $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options, command2) => {
251737
- if (name2 && !options.path) {
251738
- options.path = `./${import_kebabCase.default(name2)}`;
251739
- }
251740
- const skipPrompts = !!(options.name ?? name2) && !!options.path;
251741
- if (!skipPrompts && command2.isNonInteractive) {
251742
- throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
251743
- hints: [
251744
- {
251745
- message: "Usage: base44 create <name> --path <path>"
251746
- }
251747
- ]
251748
- });
251749
- }
251750
- if (skipPrompts) {
251751
- return await createNonInteractive({
251752
- name: options.name ?? name2,
251753
- ...options
251754
- });
251755
- }
251756
- return await createInteractive({ name: name2, ...options });
251757
- });
252089
+ $ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(createAction);
251758
252090
  }
251759
252091
 
251760
252092
  // src/cli/commands/project/deploy.ts
251761
- async function deployAction(options) {
252093
+ async function deployAction({ isNonInteractive, log }, options = {}) {
252094
+ if (isNonInteractive && !options.yes) {
252095
+ throw new InvalidInputError("--yes is required in non-interactive mode");
252096
+ }
251762
252097
  const projectData = await readProjectConfig(options.projectRoot);
251763
252098
  if (!hasResourcesToDeploy(projectData)) {
251764
252099
  return {
251765
252100
  outroMessage: "No resources found to deploy"
251766
252101
  };
251767
252102
  }
251768
- const { project: project2, entities, functions, agents, connectors } = projectData;
252103
+ const { project: project2, entities, functions, agents, connectors, authConfig } = projectData;
251769
252104
  const summaryLines = [];
251770
252105
  if (entities.length > 0) {
251771
252106
  summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
@@ -251779,11 +252114,14 @@ async function deployAction(options) {
251779
252114
  if (connectors.length > 0) {
251780
252115
  summaryLines.push(` - ${connectors.length} ${connectors.length === 1 ? "connector" : "connectors"}`);
251781
252116
  }
252117
+ if (authConfig.length > 0) {
252118
+ summaryLines.push(" - Auth config");
252119
+ }
251782
252120
  if (project2.site?.outputDirectory) {
251783
252121
  summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
251784
252122
  }
251785
252123
  if (!options.yes) {
251786
- R2.warn(`This will update your Base44 app with:
252124
+ log.warn(`This will update your Base44 app with:
251787
252125
  ${summaryLines.join(`
251788
252126
  `)}`);
251789
252127
  const shouldDeploy = await Re({
@@ -251793,7 +252131,7 @@ ${summaryLines.join(`
251793
252131
  return { outroMessage: "Deployment cancelled" };
251794
252132
  }
251795
252133
  } else {
251796
- R2.info(`Deploying:
252134
+ log.info(`Deploying:
251797
252135
  ${summaryLines.join(`
251798
252136
  `)}`);
251799
252137
  }
@@ -251802,54 +252140,46 @@ ${summaryLines.join(`
251802
252140
  const result = await deployAll(projectData, {
251803
252141
  onFunctionStart: (names) => {
251804
252142
  const label = names.length === 1 ? names[0] : `${names.length} functions`;
251805
- R2.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
252143
+ log.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
251806
252144
  },
251807
252145
  onFunctionResult: (r) => {
251808
252146
  functionCompleted++;
251809
- formatDeployResult(r);
252147
+ formatDeployResult(r, log);
251810
252148
  }
251811
252149
  });
251812
252150
  const connectorResults = result.connectorResults ?? [];
251813
- await handleOAuthConnectors(connectorResults, options);
252151
+ await handleOAuthConnectors(connectorResults, isNonInteractive, options, log);
251814
252152
  const stripeResult = connectorResults.find((r) => r.type === "stripe");
251815
252153
  if (stripeResult?.action === "provisioned") {
251816
- printStripeResult(stripeResult);
252154
+ printStripeResult(stripeResult, log);
251817
252155
  }
251818
- R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
252156
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
251819
252157
  if (result.appUrl) {
251820
- R2.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
252158
+ log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
251821
252159
  }
251822
252160
  return { outroMessage: "App deployed successfully" };
251823
252161
  }
251824
252162
  function getDeployCommand2() {
251825
- return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
251826
- if (command2.isNonInteractive && !options.yes) {
251827
- throw new InvalidInputError("--yes is required in non-interactive mode");
251828
- }
251829
- return await deployAction({
251830
- ...options,
251831
- isNonInteractive: command2.isNonInteractive
251832
- });
251833
- });
252163
+ return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
251834
252164
  }
251835
- async function handleOAuthConnectors(connectorResults, options) {
252165
+ async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
251836
252166
  const needsOAuth = filterPendingOAuth(connectorResults);
251837
252167
  if (needsOAuth.length === 0)
251838
252168
  return;
251839
- const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
251840
- skipPrompt: options.yes || options.isNonInteractive
252169
+ const oauthOutcomes = await promptOAuthFlows(needsOAuth, log, {
252170
+ skipPrompt: options.yes || isNonInteractive
251841
252171
  });
251842
252172
  const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
251843
252173
  if (!allAuthorized) {
251844
- R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
252174
+ log.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
251845
252175
  }
251846
252176
  }
251847
- function printStripeResult(r) {
251848
- R2.success("Stripe sandbox provisioned");
252177
+ function printStripeResult(r, log) {
252178
+ log.success("Stripe sandbox provisioned");
251849
252179
  if (r.claimUrl) {
251850
- R2.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
252180
+ log.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
251851
252181
  }
251852
- R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
252182
+ log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
251853
252183
  }
251854
252184
 
251855
252185
  // src/cli/commands/project/link.ts
@@ -251925,7 +252255,12 @@ async function promptForExistingProject(linkableProjects) {
251925
252255
  }
251926
252256
  return selectedProject;
251927
252257
  }
251928
- async function link(options) {
252258
+ async function link(ctx, options) {
252259
+ const { log, isNonInteractive } = ctx;
252260
+ const skipPrompts = !!options.create || !!options.projectId;
252261
+ if (!skipPrompts && isNonInteractive) {
252262
+ throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
252263
+ }
251929
252264
  const projectRoot = await findProjectRoot();
251930
252265
  if (!projectRoot) {
251931
252266
  throw new ConfigNotFoundError("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
@@ -251989,17 +252324,11 @@ async function link(options) {
251989
252324
  setAppConfig({ id: projectId, projectRoot: projectRoot.root });
251990
252325
  finalProjectId = projectId;
251991
252326
  }
251992
- R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
252327
+ log.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl(finalProjectId))}`);
251993
252328
  return { outroMessage: "Project linked" };
251994
252329
  }
251995
252330
  function getLinkCommand() {
251996
- return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options, command2) => {
251997
- const skipPrompts = !!options.create || !!options.projectId;
251998
- if (!skipPrompts && command2.isNonInteractive) {
251999
- throw new InvalidInputError("--create with --name, or --projectId, is required in non-interactive mode");
252000
- }
252001
- return await link(options);
252002
- });
252331
+ return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(link);
252003
252332
  }
252004
252333
 
252005
252334
  // src/cli/commands/project/logs.ts
@@ -252101,7 +252430,7 @@ function validateLimit(limit) {
252101
252430
  throw new InvalidInputError(`Invalid limit: "${limit}". Must be a number between 1 and 1000.`);
252102
252431
  }
252103
252432
  }
252104
- async function logsAction(options) {
252433
+ async function logsAction(_ctx, options) {
252105
252434
  validateLimit(options.limit);
252106
252435
  const specifiedFunctions = parseFunctionNames(options.function);
252107
252436
  const allProjectFunctions = await getAllFunctionNames();
@@ -252123,7 +252452,7 @@ function getLogsCommand() {
252123
252452
  }
252124
252453
 
252125
252454
  // src/cli/commands/secrets/delete.ts
252126
- async function deleteSecretAction(key) {
252455
+ async function deleteSecretAction(_ctx, key) {
252127
252456
  await runTask(`Deleting secret "${key}"`, async () => {
252128
252457
  return await deleteSecret(key);
252129
252458
  }, {
@@ -252139,7 +252468,9 @@ function getSecretsDeleteCommand() {
252139
252468
  }
252140
252469
 
252141
252470
  // src/cli/commands/secrets/list.ts
252142
- async function listSecretsAction() {
252471
+ async function listSecretsAction({
252472
+ log
252473
+ }) {
252143
252474
  const secrets = await runTask("Fetching secrets from Base44", async () => {
252144
252475
  return await listSecrets();
252145
252476
  }, {
@@ -252151,7 +252482,7 @@ async function listSecretsAction() {
252151
252482
  return { outroMessage: "No secrets configured." };
252152
252483
  }
252153
252484
  for (const name2 of names) {
252154
- R2.info(name2);
252485
+ log.info(name2);
252155
252486
  }
252156
252487
  return {
252157
252488
  outroMessage: `Found ${names.length} secrets.`
@@ -252189,7 +252520,7 @@ function validateInput(entries, options) {
252189
252520
  throw new InvalidInputError("Provide KEY=VALUE pairs or --env-file, but not both.");
252190
252521
  }
252191
252522
  }
252192
- async function setSecretsAction(entries, options) {
252523
+ async function setSecretsAction({ log }, entries, options) {
252193
252524
  validateInput(entries, options);
252194
252525
  let secrets;
252195
252526
  if (options.envFile) {
@@ -252207,7 +252538,7 @@ async function setSecretsAction(entries, options) {
252207
252538
  successMessage: `${names.length} secrets set successfully`,
252208
252539
  errorMessage: "Failed to set secrets"
252209
252540
  });
252210
- R2.info(`Set: ${names.join(", ")}`);
252541
+ log.info(`Set: ${names.join(", ")}`);
252211
252542
  return {
252212
252543
  outroMessage: "Secrets set successfully."
252213
252544
  };
@@ -252223,7 +252554,10 @@ function getSecretsCommand() {
252223
252554
 
252224
252555
  // src/cli/commands/site/deploy.ts
252225
252556
  import { resolve as resolve4 } from "node:path";
252226
- async function deployAction2(options) {
252557
+ async function deployAction2({ isNonInteractive }, options) {
252558
+ if (isNonInteractive && !options.yes) {
252559
+ throw new InvalidInputError("--yes is required in non-interactive mode");
252560
+ }
252227
252561
  const { project: project2 } = await readProjectConfig();
252228
252562
  if (!project2.site?.outputDirectory) {
252229
252563
  throw new ConfigNotFoundError("No site configuration found.", {
@@ -252252,19 +252586,13 @@ async function deployAction2(options) {
252252
252586
  return { outroMessage: `Visit your site at: ${result.appUrl}` };
252253
252587
  }
252254
252588
  function getSiteDeployCommand() {
252255
- return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
252256
- if (command2.isNonInteractive && !options.yes) {
252257
- throw new InvalidInputError("--yes is required in non-interactive mode");
252258
- }
252259
- return await deployAction2({
252260
- ...options,
252261
- isNonInteractive: command2.isNonInteractive
252262
- });
252263
- });
252589
+ return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(deployAction2);
252264
252590
  }
252265
252591
 
252266
252592
  // src/cli/commands/site/open.ts
252267
- async function openAction(isNonInteractive) {
252593
+ async function openAction({
252594
+ isNonInteractive
252595
+ }) {
252268
252596
  const siteUrl = await getSiteUrl();
252269
252597
  if (!isNonInteractive) {
252270
252598
  await open_default(siteUrl);
@@ -252272,9 +252600,7 @@ async function openAction(isNonInteractive) {
252272
252600
  return { outroMessage: `Site opened at ${siteUrl}` };
252273
252601
  }
252274
252602
  function getSiteOpenCommand() {
252275
- return new Base44Command("open").description("Open the published site in your browser").action(async (_options, command2) => {
252276
- return await openAction(command2.isNonInteractive);
252277
- });
252603
+ return new Base44Command("open").description("Open the published site in your browser").action(openAction);
252278
252604
  }
252279
252605
 
252280
252606
  // src/cli/commands/site/index.ts
@@ -252339,9 +252665,9 @@ async function generateContent(input) {
252339
252665
  `);
252340
252666
  }
252341
252667
  async function compileEntity(entity2) {
252342
- const { name: name2, ...schema9 } = entity2;
252668
+ const { name: name2, ...schema10 } = entity2;
252343
252669
  const jsonSchema = {
252344
- ...schema9,
252670
+ ...schema10,
252345
252671
  title: name2,
252346
252672
  additionalProperties: false
252347
252673
  };
@@ -252368,10 +252694,10 @@ function toPascalCase(name2) {
252368
252694
  return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
252369
252695
  }
252370
252696
  // src/core/types/update-project.ts
252371
- import { join as join17 } from "node:path";
252697
+ import { join as join20 } from "node:path";
252372
252698
  var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
252373
252699
  async function updateProjectConfig(projectRoot) {
252374
- const tsconfigPath = join17(projectRoot, "tsconfig.json");
252700
+ const tsconfigPath = join20(projectRoot, "tsconfig.json");
252375
252701
  if (!await pathExists(tsconfigPath)) {
252376
252702
  return false;
252377
252703
  }
@@ -252392,7 +252718,7 @@ async function updateProjectConfig(projectRoot) {
252392
252718
  }
252393
252719
  // src/cli/commands/types/generate.ts
252394
252720
  var TYPES_FILE_PATH = "base44/.types/types.d.ts";
252395
- async function generateTypesAction() {
252721
+ async function generateTypesAction(_ctx) {
252396
252722
  const { entities, functions, agents, connectors, project: project2 } = await readProjectConfig();
252397
252723
  await runTask("Generating types", async () => {
252398
252724
  await generateTypesFile({ entities, functions, agents, connectors });
@@ -252412,9 +252738,9 @@ function getTypesCommand() {
252412
252738
  }
252413
252739
 
252414
252740
  // src/cli/dev/dev-server/main.ts
252415
- import { dirname as dirname14, join as join20 } from "node:path";
252416
252741
  var import_cors = __toESM(require_lib4(), 1);
252417
252742
  var import_express5 = __toESM(require_express(), 1);
252743
+ import { dirname as dirname16, join as join23 } from "node:path";
252418
252744
 
252419
252745
  // ../../node_modules/get-port/index.js
252420
252746
  import net from "node:net";
@@ -252435,8 +252761,8 @@ var getLocalHosts = () => {
252435
252761
  const interfaces = os9.networkInterfaces();
252436
252762
  const results = new Set([undefined, "0.0.0.0"]);
252437
252763
  for (const _interface of Object.values(interfaces)) {
252438
- for (const config10 of _interface) {
252439
- results.add(config10.address);
252764
+ for (const config11 of _interface) {
252765
+ results.add(config11.address);
252440
252766
  }
252441
252767
  }
252442
252768
  return results;
@@ -252580,9 +252906,9 @@ class FunctionManager {
252580
252906
  starting = new Map;
252581
252907
  logger;
252582
252908
  wrapperPath;
252583
- constructor(functions, logger, wrapperPath) {
252909
+ constructor(functions, logger2, wrapperPath) {
252584
252910
  this.functions = new Map(functions.map((f7) => [f7.name, f7]));
252585
- this.logger = logger;
252911
+ this.logger = logger2;
252586
252912
  this.wrapperPath = wrapperPath;
252587
252913
  if (functions.length > 0) {
252588
252914
  verifyDenoInstalled("to run backend functions locally");
@@ -252721,7 +253047,7 @@ class FunctionManager {
252721
253047
  var import_express = __toESM(require_express(), 1);
252722
253048
  var import_http_proxy_middleware = __toESM(require_dist2(), 1);
252723
253049
  import { ServerResponse } from "node:http";
252724
- function createFunctionRouter(manager, logger) {
253050
+ function createFunctionRouter(manager, logger2) {
252725
253051
  const router = import_express.Router({ mergeParams: true });
252726
253052
  const portsByRequest = new WeakMap;
252727
253053
  const proxy = import_http_proxy_middleware.createProxyMiddleware({
@@ -252736,7 +253062,7 @@ function createFunctionRouter(manager, logger) {
252736
253062
  proxyReq.setHeader("Base44-Api-Url", `${req.protocol}://${req.headers.host}`);
252737
253063
  },
252738
253064
  error: (err, _req, res) => {
252739
- logger.error("Function proxy error:", err);
253065
+ logger2.error("Function proxy error:", err);
252740
253066
  if (res instanceof ServerResponse && !res.headersSent) {
252741
253067
  res.writeHead(502, { "Content-Type": "application/json" });
252742
253068
  res.end(JSON.stringify({
@@ -252754,7 +253080,7 @@ function createFunctionRouter(manager, logger) {
252754
253080
  portsByRequest.set(req, port);
252755
253081
  next();
252756
253082
  } catch (error48) {
252757
- logger.error("Function error:", error48);
253083
+ logger2.error("Function error:", error48);
252758
253084
  const message = error48 instanceof Error ? error48.message : String(error48);
252759
253085
  res.status(500).json({ error: message });
252760
253086
  }
@@ -253030,22 +253356,22 @@ class Database {
253030
253356
  this.schemas.clear();
253031
253357
  }
253032
253358
  validate(entityName, record2, partial2 = false) {
253033
- const schema9 = this.schemas.get(this.normalizeName(entityName));
253034
- if (!schema9) {
253359
+ const schema10 = this.schemas.get(this.normalizeName(entityName));
253360
+ if (!schema10) {
253035
253361
  throw new Error(`Entity "${entityName}" not found`);
253036
253362
  }
253037
- return this.validator.validate(record2, schema9, partial2);
253363
+ return this.validator.validate(record2, schema10, partial2);
253038
253364
  }
253039
253365
  prepareRecord(entityName, record2, partial2 = false) {
253040
- const schema9 = this.schemas.get(this.normalizeName(entityName));
253041
- if (!schema9) {
253366
+ const schema10 = this.schemas.get(this.normalizeName(entityName));
253367
+ if (!schema10) {
253042
253368
  throw new Error(`Entity "${entityName}" not found`);
253043
253369
  }
253044
- const filteredRecord = this.validator.filterFields(record2, schema9);
253370
+ const filteredRecord = this.validator.filterFields(record2, schema10);
253045
253371
  if (partial2) {
253046
253372
  return filteredRecord;
253047
253373
  }
253048
- return this.validator.applyDefaults(filteredRecord, schema9);
253374
+ return this.validator.applyDefaults(filteredRecord, schema10);
253049
253375
  }
253050
253376
  normalizeName(entityName) {
253051
253377
  return entityName.toLowerCase();
@@ -253090,7 +253416,7 @@ var import_express3 = __toESM(require_express(), 1);
253090
253416
  // src/cli/dev/dev-server/routes/entities/entities-user-router.ts
253091
253417
  var import_express2 = __toESM(require_express(), 1);
253092
253418
  var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
253093
- function createUserRouter(db2, logger) {
253419
+ function createUserRouter(db2, logger2) {
253094
253420
  const router = import_express2.Router({ mergeParams: true });
253095
253421
  const parseBody = import_express2.json();
253096
253422
  function withAuth(handler) {
@@ -253169,7 +253495,7 @@ function createUserRouter(db2, logger) {
253169
253495
  res.status(422).json(error48.context);
253170
253496
  return;
253171
253497
  }
253172
- logger.error(`Error in PUT /${USER_COLLECTION}/${req.params.id}:`, error48);
253498
+ logger2.error(`Error in PUT /${USER_COLLECTION}/${req.params.id}:`, error48);
253173
253499
  res.status(500).json({ error: "Internal server error" });
253174
253500
  }
253175
253501
  } else {
@@ -253205,7 +253531,7 @@ function parseFields(fields) {
253205
253531
  }
253206
253532
  return Object.keys(projection).length > 0 ? projection : undefined;
253207
253533
  }
253208
- async function createEntityRoutes(db2, logger, broadcast) {
253534
+ async function createEntityRoutes(db2, logger2, broadcast) {
253209
253535
  const router = import_express3.Router({ mergeParams: true });
253210
253536
  const parseBody = import_express3.json();
253211
253537
  function withCollection(handler) {
@@ -253233,7 +253559,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253233
253559
  }
253234
253560
  broadcast(appId, entityName, createData(data));
253235
253561
  }
253236
- const userRouter = createUserRouter(db2, logger);
253562
+ const userRouter = createUserRouter(db2, logger2);
253237
253563
  router.use("/User", userRouter);
253238
253564
  router.get("/:entityName/:id", withCollection(async (req, res, collection) => {
253239
253565
  const { entityName, id: id2 } = req.params;
@@ -253245,7 +253571,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253245
253571
  }
253246
253572
  res.json(stripInternalFields(doc2));
253247
253573
  } catch (error48) {
253248
- logger.error(`Error in GET /${entityName}/${id2}:`, error48);
253574
+ logger2.error(`Error in GET /${entityName}/${id2}:`, error48);
253249
253575
  res.status(500).json({ error: "Internal server error" });
253250
253576
  }
253251
253577
  }));
@@ -253286,7 +253612,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253286
253612
  const docs = await cursor3;
253287
253613
  res.json(stripInternalFields(docs));
253288
253614
  } catch (error48) {
253289
- logger.error(`Error in GET /${entityName}:`, error48);
253615
+ logger2.error(`Error in GET /${entityName}:`, error48);
253290
253616
  res.status(500).json({ error: "Internal server error" });
253291
253617
  }
253292
253618
  }));
@@ -253311,7 +253637,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253311
253637
  res.status(422).json(error48.context);
253312
253638
  return;
253313
253639
  }
253314
- logger.error(`Error in POST /${entityName}:`, error48);
253640
+ logger2.error(`Error in POST /${entityName}:`, error48);
253315
253641
  res.status(500).json({ error: "Internal server error" });
253316
253642
  }
253317
253643
  }));
@@ -253342,7 +253668,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253342
253668
  res.status(422).json(error48.context);
253343
253669
  return;
253344
253670
  }
253345
- logger.error(`Error in POST /${entityName}/bulk:`, error48);
253671
+ logger2.error(`Error in POST /${entityName}/bulk:`, error48);
253346
253672
  res.status(500).json({ error: "Internal server error" });
253347
253673
  }
253348
253674
  }));
@@ -253369,7 +253695,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253369
253695
  res.status(422).json(error48.context);
253370
253696
  return;
253371
253697
  }
253372
- logger.error(`Error in PUT /${entityName}/${id2}:`, error48);
253698
+ logger2.error(`Error in PUT /${entityName}/${id2}:`, error48);
253373
253699
  res.status(500).json({ error: "Internal server error" });
253374
253700
  }
253375
253701
  }));
@@ -253387,7 +253713,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253387
253713
  }
253388
253714
  res.json({ success: true });
253389
253715
  } catch (error48) {
253390
- logger.error(`Error in DELETE /${entityName}/${id2}:`, error48);
253716
+ logger2.error(`Error in DELETE /${entityName}/${id2}:`, error48);
253391
253717
  res.status(500).json({ error: "Internal server error" });
253392
253718
  }
253393
253719
  }));
@@ -253398,7 +253724,7 @@ async function createEntityRoutes(db2, logger, broadcast) {
253398
253724
  const numRemoved = await collection.removeAsync(query, { multi: true });
253399
253725
  res.json({ success: true, deleted: numRemoved });
253400
253726
  } catch (error48) {
253401
- logger.error(`Error in DELETE /${entityName}:`, error48);
253727
+ logger2.error(`Error in DELETE /${entityName}:`, error48);
253402
253728
  res.status(500).json({ error: "Internal server error" });
253403
253729
  }
253404
253730
  }));
@@ -253414,7 +253740,7 @@ import path18 from "node:path";
253414
253740
  function createFileToken(fileUri) {
253415
253741
  return createHash("sha256").update(fileUri).digest("hex");
253416
253742
  }
253417
- function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253743
+ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger2) {
253418
253744
  const router = import_express4.Router({ mergeParams: true });
253419
253745
  const parseBody = import_express4.json();
253420
253746
  const privateFilesDir = path18.join(mediaFilesDir, "private");
@@ -253467,12 +253793,12 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253467
253793
  res.json({ signed_url });
253468
253794
  });
253469
253795
  router.post("/Core/:endpointName", (req, res, next) => {
253470
- logger.warn(`Core.${req.params.endpointName} is not supported in local development`);
253796
+ logger2.warn(`Core.${req.params.endpointName} is not supported in local development`);
253471
253797
  req.url = req.originalUrl;
253472
253798
  remoteProxy(req, res, next);
253473
253799
  });
253474
253800
  router.post("/installable/:packageName/integration-endpoints/:endpointName", (req, res, next) => {
253475
- logger.warn(`${req.params.packageName}.${req.params.endpointName} is not supported in local development`);
253801
+ logger2.warn(`${req.params.packageName}.${req.params.endpointName} is not supported in local development`);
253476
253802
  req.url = req.originalUrl;
253477
253803
  remoteProxy(req, res, next);
253478
253804
  });
@@ -253485,10 +253811,10 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
253485
253811
  });
253486
253812
  return router;
253487
253813
  }
253488
- function createCustomIntegrationRoutes(remoteProxy, logger) {
253814
+ function createCustomIntegrationRoutes(remoteProxy, logger2) {
253489
253815
  const router = import_express4.Router({ mergeParams: true });
253490
253816
  router.post("/:slug/:operationId", (req, res, next) => {
253491
- logger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
253817
+ logger2.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
253492
253818
  req.url = req.originalUrl;
253493
253819
  remoteProxy(req, res, next);
253494
253820
  });
@@ -254227,9 +254553,9 @@ class NodeFsHandler {
254227
254553
  if (this.fsw.closed) {
254228
254554
  return;
254229
254555
  }
254230
- const dirname13 = sp2.dirname(file2);
254556
+ const dirname15 = sp2.dirname(file2);
254231
254557
  const basename5 = sp2.basename(file2);
254232
- const parent = this.fsw._getWatchedDir(dirname13);
254558
+ const parent = this.fsw._getWatchedDir(dirname15);
254233
254559
  let prevStats = stats;
254234
254560
  if (parent.has(basename5))
254235
254561
  return;
@@ -254256,7 +254582,7 @@ class NodeFsHandler {
254256
254582
  prevStats = newStats2;
254257
254583
  }
254258
254584
  } catch (error48) {
254259
- this.fsw._remove(dirname13, basename5);
254585
+ this.fsw._remove(dirname15, basename5);
254260
254586
  }
254261
254587
  } else if (parent.has(basename5)) {
254262
254588
  const at13 = newStats.atimeMs;
@@ -255121,10 +255447,10 @@ class WatchBase44 extends EventEmitter4 {
255121
255447
  entryNames;
255122
255448
  watchers = new Map;
255123
255449
  queueWaitForCreationTimeout = null;
255124
- constructor(itemsToWatch, logger) {
255450
+ constructor(itemsToWatch, logger2) {
255125
255451
  super();
255126
255452
  this.itemsToWatch = itemsToWatch;
255127
- this.logger = logger;
255453
+ this.logger = logger2;
255128
255454
  this.entryNames = Object.keys(itemsToWatch);
255129
255455
  }
255130
255456
  async start() {
@@ -255221,12 +255547,12 @@ async function createDevServer(options8) {
255221
255547
  const functionRoutes = createFunctionRouter(functionManager, devLogger);
255222
255548
  app.use("/api/apps/:appId/functions", functionRoutes);
255223
255549
  if (functionManager.getFunctionNames().length > 0) {
255224
- R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
255550
+ options8.log.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
255225
255551
  }
255226
255552
  const db2 = new Database;
255227
255553
  await db2.load(entities);
255228
255554
  if (db2.getCollectionNames().length > 0) {
255229
- R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
255555
+ options8.log.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
255230
255556
  }
255231
255557
  let emitEntityEvent = () => {};
255232
255558
  const entityRoutes = await createEntityRoutes(db2, devLogger, (...args) => emitEntityEvent(...args));
@@ -255277,8 +255603,8 @@ async function createDevServer(options8) {
255277
255603
  broadcastEntityEvent(io6, appId, entityName, event);
255278
255604
  };
255279
255605
  const base44ConfigWatcher = new WatchBase44({
255280
- functions: join20(dirname14(project2.configPath), project2.functionsDir),
255281
- entities: join20(dirname14(project2.configPath), project2.entitiesDir)
255606
+ functions: join23(dirname16(project2.configPath), project2.functionsDir),
255607
+ entities: join23(dirname16(project2.configPath), project2.entitiesDir)
255282
255608
  }, devLogger);
255283
255609
  base44ConfigWatcher.on("change", async (name2) => {
255284
255610
  try {
@@ -255322,9 +255648,10 @@ async function createDevServer(options8) {
255322
255648
  }
255323
255649
 
255324
255650
  // src/cli/commands/dev.ts
255325
- async function devAction(options8) {
255651
+ async function devAction({ log }, options8) {
255326
255652
  const port = options8.port ? Number(options8.port) : undefined;
255327
255653
  const { port: resolvedPort } = await createDevServer({
255654
+ log,
255328
255655
  port,
255329
255656
  denoWrapperPath: getDenoWrapperPath(),
255330
255657
  loadResources: async () => {
@@ -255422,15 +255749,22 @@ Examples:
255422
255749
  $ cat ./script.ts | base44 exec
255423
255750
 
255424
255751
  Inline script:
255425
- $ echo "const users = await base44.entities.User.list()" | base44 exec`).action(async (_options, command2) => {
255426
- return await execAction(command2.isNonInteractive);
255752
+ $ echo "const users = await base44.entities.User.list()" | base44 exec`).action(async ({ isNonInteractive }) => {
255753
+ return await execAction(isNonInteractive);
255427
255754
  });
255428
255755
  }
255429
255756
 
255430
255757
  // src/cli/commands/project/eject.ts
255431
255758
  import { resolve as resolve8 } from "node:path";
255432
255759
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
255433
- async function eject(options8) {
255760
+ async function eject(ctx, options8) {
255761
+ const { log, isNonInteractive } = ctx;
255762
+ if (isNonInteractive && !options8.projectId) {
255763
+ throw new InvalidInputError("--project-id is required in non-interactive mode");
255764
+ }
255765
+ if (isNonInteractive && !options8.path) {
255766
+ throw new InvalidInputError("--path is required in non-interactive mode");
255767
+ }
255434
255768
  const projects = await listProjects();
255435
255769
  const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
255436
255770
  let selectedProject;
@@ -255446,7 +255780,7 @@ async function eject(options8) {
255446
255780
  });
255447
255781
  }
255448
255782
  selectedProject = foundProject;
255449
- R2.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
255783
+ log.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
255450
255784
  } else {
255451
255785
  if (ejectableProjects.length === 0) {
255452
255786
  return { outroMessage: "No projects available to eject." };
@@ -255510,24 +255844,13 @@ async function eject(options8) {
255510
255844
  successMessage: theme.colors.base44Orange("Project built successfully"),
255511
255845
  errorMessage: "Failed to build project"
255512
255846
  });
255513
- await deployAction({ yes: true, projectRoot: resolvedPath });
255847
+ await deployAction(ctx, { yes: true, projectRoot: resolvedPath });
255514
255848
  }
255515
255849
  }
255516
255850
  return { outroMessage: "Your new project is set and ready to use" };
255517
255851
  }
255518
255852
  function getEjectCommand() {
255519
- return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8, command2) => {
255520
- if (command2.isNonInteractive && !options8.projectId) {
255521
- throw new InvalidInputError("--project-id is required in non-interactive mode");
255522
- }
255523
- if (command2.isNonInteractive && !options8.path) {
255524
- throw new InvalidInputError("--path is required in non-interactive mode");
255525
- }
255526
- return await eject({
255527
- ...options8,
255528
- isNonInteractive: command2.isNonInteractive
255529
- });
255530
- });
255853
+ return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(eject);
255531
255854
  }
255532
255855
 
255533
255856
  // src/cli/program.ts
@@ -255555,6 +255878,7 @@ function createProgram(context) {
255555
255878
  program2.addCommand(getConnectorsCommand());
255556
255879
  program2.addCommand(getFunctionsCommand());
255557
255880
  program2.addCommand(getSecretsCommand());
255881
+ program2.addCommand(getAuthCommand(), { hidden: true });
255558
255882
  program2.addCommand(getSiteCommand());
255559
255883
  program2.addCommand(getTypesCommand());
255560
255884
  program2.addCommand(getExecCommand());
@@ -255568,7 +255892,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
255568
255892
  import { release, type } from "node:os";
255569
255893
 
255570
255894
  // ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
255571
- import { dirname as dirname15, posix, sep } from "path";
255895
+ import { dirname as dirname17, posix, sep } from "path";
255572
255896
  function createModulerModifier() {
255573
255897
  const getModuleFromFileName = createGetModuleFromFilename();
255574
255898
  return async (frames) => {
@@ -255577,7 +255901,7 @@ function createModulerModifier() {
255577
255901
  return frames;
255578
255902
  };
255579
255903
  }
255580
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
255904
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
255581
255905
  const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
255582
255906
  return (filename) => {
255583
255907
  if (!filename)
@@ -256009,23 +256333,23 @@ function isInstanceOf(candidate, base) {
256009
256333
  }
256010
256334
 
256011
256335
  // ../../node_modules/@posthog/core/dist/utils/number-utils.mjs
256012
- function clampToRange(value, min, max, logger, fallbackValue) {
256336
+ function clampToRange(value, min, max, logger2, fallbackValue) {
256013
256337
  if (min > max) {
256014
- logger.warn("min cannot be greater than max.");
256338
+ logger2.warn("min cannot be greater than max.");
256015
256339
  min = max;
256016
256340
  }
256017
256341
  if (isNumber(value))
256018
256342
  if (value > max) {
256019
- logger.warn(" cannot be greater than max: " + max + ". Using max value instead.");
256343
+ logger2.warn(" cannot be greater than max: " + max + ". Using max value instead.");
256020
256344
  return max;
256021
256345
  } else {
256022
256346
  if (!(value < min))
256023
256347
  return value;
256024
- logger.warn(" cannot be less than min: " + min + ". Using min value instead.");
256348
+ logger2.warn(" cannot be less than min: " + min + ". Using min value instead.");
256025
256349
  return min;
256026
256350
  }
256027
- logger.warn(" must be a number. using max or fallback. max: " + max + ", fallback: " + fallbackValue);
256028
- return clampToRange(fallbackValue || max, min, max, logger);
256351
+ logger2.warn(" must be a number. using max or fallback. max: " + max + ", fallback: " + fallbackValue);
256352
+ return clampToRange(fallbackValue || max, min, max, logger2);
256029
256353
  }
256030
256354
 
256031
256355
  // ../../node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
@@ -256115,7 +256439,7 @@ var _createLogger = (prefix, maybeCall, consoleLike) => {
256115
256439
  consoleMethod(prefix, ...args);
256116
256440
  });
256117
256441
  }
256118
- const logger = {
256442
+ const logger2 = {
256119
256443
  info: (...args) => {
256120
256444
  _log("log", ...args);
256121
256445
  },
@@ -256130,7 +256454,7 @@ var _createLogger = (prefix, maybeCall, consoleLike) => {
256130
256454
  },
256131
256455
  createLogger: (additionalPrefix) => _createLogger(`${prefix} ${additionalPrefix}`, maybeCall, consoleLike)
256132
256456
  };
256133
- return logger;
256457
+ return logger2;
256134
256458
  };
256135
256459
  var passThrough = (fn9) => fn9();
256136
256460
  function createLogger(prefix, maybeCall = passThrough) {
@@ -259766,16 +260090,18 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
259766
260090
  });
259767
260091
  }
259768
260092
  // src/cli/index.ts
259769
- var __dirname4 = dirname16(fileURLToPath6(import.meta.url));
260093
+ var __dirname4 = dirname18(fileURLToPath6(import.meta.url));
259770
260094
  async function runCLI(options8) {
259771
- ensureNpmAssets(join21(__dirname4, "../assets"));
260095
+ ensureNpmAssets(join24(__dirname4, "../assets"));
259772
260096
  const errorReporter = new ErrorReporter;
259773
260097
  errorReporter.registerProcessErrorHandlers();
259774
260098
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
260099
+ const log = isNonInteractive ? new SimpleLogger : new ClackLogger;
259775
260100
  const context = {
259776
260101
  errorReporter,
259777
260102
  isNonInteractive,
259778
- distribution: options8?.distribution ?? "npm"
260103
+ distribution: options8?.distribution ?? "npm",
260104
+ log
259779
260105
  };
259780
260106
  const program2 = createProgram(context);
259781
260107
  try {
@@ -259801,4 +260127,4 @@ export {
259801
260127
  CLIExitError
259802
260128
  };
259803
260129
 
259804
- //# debugId=7F6DB6E03F5C038364756E2164756E21
260130
+ //# debugId=AC4685974E26477764756E2164756E21