@base44-preview/cli 0.0.37-pr.365.290ff33 → 0.0.38-pr.251.8fd4c92
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 +447 -244
- package/dist/cli/index.js.map +25 -26
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -8933,10 +8933,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
8933
8933
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
8934
8934
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
8935
8935
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
8936
|
-
var
|
|
8936
|
+
var dirname7 = path11.dirname;
|
|
8937
8937
|
var extname = path11.extname;
|
|
8938
8938
|
var resolve = path11.resolve;
|
|
8939
|
-
var includePath = resolve(isDir ? filename :
|
|
8939
|
+
var includePath = resolve(isDir ? filename : dirname7(filename), name2);
|
|
8940
8940
|
var ext = extname(name2);
|
|
8941
8941
|
if (!ext) {
|
|
8942
8942
|
includePath += ".ejs";
|
|
@@ -12652,8 +12652,8 @@ var require_main = __commonJS((exports, module) => {
|
|
|
12652
12652
|
const shortPaths = [];
|
|
12653
12653
|
for (const filePath of optionPaths) {
|
|
12654
12654
|
try {
|
|
12655
|
-
const
|
|
12656
|
-
shortPaths.push(
|
|
12655
|
+
const relative3 = path11.relative(process.cwd(), filePath);
|
|
12656
|
+
shortPaths.push(relative3);
|
|
12657
12657
|
} catch (e2) {
|
|
12658
12658
|
if (debug) {
|
|
12659
12659
|
_debug(`Failed to load ${filePath} ${e2.message}`);
|
|
@@ -18062,7 +18062,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
18062
18062
|
function nth(array2, n2) {
|
|
18063
18063
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
18064
18064
|
}
|
|
18065
|
-
var
|
|
18065
|
+
var pull2 = baseRest(pullAll);
|
|
18066
18066
|
function pullAll(array2, values2) {
|
|
18067
18067
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
18068
18068
|
}
|
|
@@ -19827,7 +19827,7 @@ __p += '`;
|
|
|
19827
19827
|
lodash.pickBy = pickBy;
|
|
19828
19828
|
lodash.property = property;
|
|
19829
19829
|
lodash.propertyOf = propertyOf;
|
|
19830
|
-
lodash.pull =
|
|
19830
|
+
lodash.pull = pull2;
|
|
19831
19831
|
lodash.pullAll = pullAll;
|
|
19832
19832
|
lodash.pullAllBy = pullAllBy;
|
|
19833
19833
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -110477,9 +110477,9 @@ function getMessage2(key2, parameters, self2) {
|
|
|
110477
110477
|
assert22.ok(message.length <= parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
|
|
110478
110478
|
return Reflect.apply(message, self2, parameters);
|
|
110479
110479
|
}
|
|
110480
|
-
const
|
|
110480
|
+
const regex = /%[dfijoOs]/g;
|
|
110481
110481
|
let expectedLength = 0;
|
|
110482
|
-
while (
|
|
110482
|
+
while (regex.exec(message) !== null)
|
|
110483
110483
|
expectedLength++;
|
|
110484
110484
|
assert22.ok(expectedLength === parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
|
|
110485
110485
|
if (parameters.length === 0)
|
|
@@ -111380,9 +111380,9 @@ function convertEndOfLineOptionToCharacter2(endOfLineOption) {
|
|
|
111380
111380
|
return endOfLineOption === OPTION_CR2 ? CHARACTER_CR2 : endOfLineOption === OPTION_CRLF2 ? CHARACTER_CRLF2 : DEFAULT_EOL2;
|
|
111381
111381
|
}
|
|
111382
111382
|
function countEndOfLineCharacters(text, endOfLineCharacter) {
|
|
111383
|
-
const
|
|
111383
|
+
const regex = regexps.get(endOfLineCharacter);
|
|
111384
111384
|
if (false) {}
|
|
111385
|
-
return text.match(
|
|
111385
|
+
return text.match(regex)?.length ?? 0;
|
|
111386
111386
|
}
|
|
111387
111387
|
function normalizeEndOfLine(text) {
|
|
111388
111388
|
return method_replace_all_default2(0, text, END_OF_LINE_REGEXP, CHARACTER_LF2);
|
|
@@ -113584,8 +113584,8 @@ function legacyIsNextLineEmpty(text, node, locEnd) {
|
|
|
113584
113584
|
}
|
|
113585
113585
|
function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
113586
113586
|
const otherQuote = enclosingQuote === '"' ? "'" : '"';
|
|
113587
|
-
const
|
|
113588
|
-
const raw2 = method_replace_all_default2(0, rawText,
|
|
113587
|
+
const regex = /\\(.)|(["'])/gsu;
|
|
113588
|
+
const raw2 = method_replace_all_default2(0, rawText, regex, (match, escaped, quote) => {
|
|
113589
113589
|
if (escaped === otherQuote) {
|
|
113590
113590
|
return escaped;
|
|
113591
113591
|
}
|
|
@@ -117006,17 +117006,17 @@ var init_prettier = __esm(() => {
|
|
|
117006
117006
|
}
|
|
117007
117007
|
const opts = options8 || {};
|
|
117008
117008
|
const posix = utils3.isWindows(options8);
|
|
117009
|
-
const
|
|
117010
|
-
const state =
|
|
117011
|
-
delete
|
|
117009
|
+
const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
|
|
117010
|
+
const state = regex.state;
|
|
117011
|
+
delete regex.state;
|
|
117012
117012
|
let isIgnored2 = () => false;
|
|
117013
117013
|
if (opts.ignore) {
|
|
117014
117014
|
const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null };
|
|
117015
117015
|
isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
117016
117016
|
}
|
|
117017
117017
|
const matcher = (input, returnObject = false) => {
|
|
117018
|
-
const { isMatch, match, output } = picomatch.test(input,
|
|
117019
|
-
const result = { glob, state, regex
|
|
117018
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix });
|
|
117019
|
+
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
117020
117020
|
if (typeof opts.onResult === "function") {
|
|
117021
117021
|
opts.onResult(result);
|
|
117022
117022
|
}
|
|
@@ -117041,7 +117041,7 @@ var init_prettier = __esm(() => {
|
|
|
117041
117041
|
}
|
|
117042
117042
|
return matcher;
|
|
117043
117043
|
};
|
|
117044
|
-
picomatch.test = (input,
|
|
117044
|
+
picomatch.test = (input, regex, options8, { glob, posix } = {}) => {
|
|
117045
117045
|
if (typeof input !== "string") {
|
|
117046
117046
|
throw new TypeError("Expected input to be a string");
|
|
117047
117047
|
}
|
|
@@ -117058,16 +117058,16 @@ var init_prettier = __esm(() => {
|
|
|
117058
117058
|
}
|
|
117059
117059
|
if (match === false || opts.capture === true) {
|
|
117060
117060
|
if (opts.matchBase === true || opts.basename === true) {
|
|
117061
|
-
match = picomatch.matchBase(input,
|
|
117061
|
+
match = picomatch.matchBase(input, regex, options8, posix);
|
|
117062
117062
|
} else {
|
|
117063
|
-
match =
|
|
117063
|
+
match = regex.exec(output);
|
|
117064
117064
|
}
|
|
117065
117065
|
}
|
|
117066
117066
|
return { isMatch: Boolean(match), match, output };
|
|
117067
117067
|
};
|
|
117068
117068
|
picomatch.matchBase = (input, glob, options8, posix = utils3.isWindows(options8)) => {
|
|
117069
|
-
const
|
|
117070
|
-
return
|
|
117069
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
|
|
117070
|
+
return regex.test(path152.basename(input));
|
|
117071
117071
|
};
|
|
117072
117072
|
picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
|
|
117073
117073
|
picomatch.parse = (pattern, options8) => {
|
|
@@ -117087,11 +117087,11 @@ var init_prettier = __esm(() => {
|
|
|
117087
117087
|
if (state && state.negated === true) {
|
|
117088
117088
|
source2 = `^(?!${source2}).*$`;
|
|
117089
117089
|
}
|
|
117090
|
-
const
|
|
117090
|
+
const regex = picomatch.toRegex(source2, options8);
|
|
117091
117091
|
if (returnState === true) {
|
|
117092
|
-
|
|
117092
|
+
regex.state = state;
|
|
117093
117093
|
}
|
|
117094
|
-
return
|
|
117094
|
+
return regex;
|
|
117095
117095
|
};
|
|
117096
117096
|
picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => {
|
|
117097
117097
|
if (!input || typeof input !== "string") {
|
|
@@ -117255,8 +117255,8 @@ var init_prettier = __esm(() => {
|
|
|
117255
117255
|
};
|
|
117256
117256
|
micromatch2.capture = (glob, input, options8) => {
|
|
117257
117257
|
let posix = utils3.isWindows(options8);
|
|
117258
|
-
let
|
|
117259
|
-
let match =
|
|
117258
|
+
let regex = picomatch.makeRe(String(glob), { ...options8, capture: true });
|
|
117259
|
+
let match = regex.exec(posix ? utils3.toPosixSlashes(input) : input);
|
|
117260
117260
|
if (match) {
|
|
117261
117261
|
return match.slice(1).map((v10) => v10 === undefined ? "" : v10);
|
|
117262
117262
|
}
|
|
@@ -117434,15 +117434,15 @@ var init_prettier = __esm(() => {
|
|
|
117434
117434
|
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
117435
117435
|
function partitionAbsoluteAndRelative(patterns) {
|
|
117436
117436
|
const absolute = [];
|
|
117437
|
-
const
|
|
117437
|
+
const relative22 = [];
|
|
117438
117438
|
for (const pattern of patterns) {
|
|
117439
117439
|
if (isAbsolute2(pattern)) {
|
|
117440
117440
|
absolute.push(pattern);
|
|
117441
117441
|
} else {
|
|
117442
|
-
|
|
117442
|
+
relative22.push(pattern);
|
|
117443
117443
|
}
|
|
117444
117444
|
}
|
|
117445
|
-
return [absolute,
|
|
117445
|
+
return [absolute, relative22];
|
|
117446
117446
|
}
|
|
117447
117447
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
117448
117448
|
function isAbsolute2(pattern) {
|
|
@@ -121695,7 +121695,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
121695
121695
|
};
|
|
121696
121696
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
121697
121697
|
var fs42 = __importStar(__require2("fs"));
|
|
121698
|
-
var
|
|
121698
|
+
var regex = {
|
|
121699
121699
|
section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,
|
|
121700
121700
|
param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
|
|
121701
121701
|
comment: /^\s*[#;].*$/
|
|
@@ -121727,14 +121727,14 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
121727
121727
|
var lines = data.split(/\r\n|\r|\n/);
|
|
121728
121728
|
lines.forEach(function(line3) {
|
|
121729
121729
|
var match;
|
|
121730
|
-
if (
|
|
121730
|
+
if (regex.comment.test(line3)) {
|
|
121731
121731
|
return;
|
|
121732
121732
|
}
|
|
121733
|
-
if (
|
|
121734
|
-
match = line3.match(
|
|
121733
|
+
if (regex.param.test(line3)) {
|
|
121734
|
+
match = line3.match(regex.param);
|
|
121735
121735
|
sectionBody[match[1]] = match[2];
|
|
121736
|
-
} else if (
|
|
121737
|
-
match = line3.match(
|
|
121736
|
+
} else if (regex.section.test(line3)) {
|
|
121737
|
+
match = line3.match(regex.section);
|
|
121738
121738
|
sectionName = match[1];
|
|
121739
121739
|
sectionBody = {};
|
|
121740
121740
|
value.push([sectionName, sectionBody]);
|
|
@@ -122820,8 +122820,8 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
122820
122820
|
}
|
|
122821
122821
|
_make(mode, key2) {
|
|
122822
122822
|
const str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, TRAILING_WILD_CARD_REPLACERS[mode]);
|
|
122823
|
-
const
|
|
122824
|
-
return define2(this, key2,
|
|
122823
|
+
const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
|
|
122824
|
+
return define2(this, key2, regex);
|
|
122825
122825
|
}
|
|
122826
122826
|
};
|
|
122827
122827
|
var createRule = ({
|
|
@@ -127617,8 +127617,8 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
127617
127617
|
}
|
|
127618
127618
|
function makeString2(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
127619
127619
|
const otherQuote = enclosingQuote === '"' ? "'" : '"';
|
|
127620
|
-
const
|
|
127621
|
-
const raw2 = method_replace_all_default3(0, rawText,
|
|
127620
|
+
const regex = /\\(.)|(["'])/gsu;
|
|
127621
|
+
const raw2 = method_replace_all_default3(0, rawText, regex, (match, escaped, quote) => {
|
|
127622
127622
|
if (escaped === otherQuote) {
|
|
127623
127623
|
return escaped;
|
|
127624
127624
|
}
|
|
@@ -132397,7 +132397,7 @@ var require_url = __commonJS((exports) => {
|
|
|
132397
132397
|
exports.fromFileSystemPath = fromFileSystemPath;
|
|
132398
132398
|
exports.toFileSystemPath = toFileSystemPath;
|
|
132399
132399
|
exports.safePointerToPath = safePointerToPath;
|
|
132400
|
-
exports.relative =
|
|
132400
|
+
exports.relative = relative4;
|
|
132401
132401
|
var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
|
|
132402
132402
|
var path_1 = __importStar(__require("path"));
|
|
132403
132403
|
var forwardSlashPattern = /\//g;
|
|
@@ -132547,7 +132547,7 @@ var require_url = __commonJS((exports) => {
|
|
|
132547
132547
|
return decodeURIComponent(value).replace(jsonPointerSlash, "/").replace(jsonPointerTilde, "~");
|
|
132548
132548
|
});
|
|
132549
132549
|
}
|
|
132550
|
-
function
|
|
132550
|
+
function relative4(from, to5) {
|
|
132551
132551
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
132552
132552
|
return resolve6(from, to5);
|
|
132553
132553
|
}
|
|
@@ -138614,7 +138614,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
138614
138614
|
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|
138615
138615
|
* MIT Licensed
|
|
138616
138616
|
*/
|
|
138617
|
-
var
|
|
138617
|
+
var relative4 = __require("path").relative;
|
|
138618
138618
|
module.exports = depd;
|
|
138619
138619
|
var basePath = process.cwd();
|
|
138620
138620
|
function containsNamespace(str, namespace) {
|
|
@@ -138810,7 +138810,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
138810
138810
|
return formatted;
|
|
138811
138811
|
}
|
|
138812
138812
|
function formatLocation(callSite) {
|
|
138813
|
-
return
|
|
138813
|
+
return relative4(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
138814
138814
|
}
|
|
138815
138815
|
function getStack() {
|
|
138816
138816
|
var limit = Error.stackTraceLimit;
|
|
@@ -156272,7 +156272,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156272
156272
|
var debug = require_src4()("express:view");
|
|
156273
156273
|
var path18 = __require("node:path");
|
|
156274
156274
|
var fs28 = __require("node:fs");
|
|
156275
|
-
var
|
|
156275
|
+
var dirname12 = path18.dirname;
|
|
156276
156276
|
var basename4 = path18.basename;
|
|
156277
156277
|
var extname2 = path18.extname;
|
|
156278
156278
|
var join15 = path18.join;
|
|
@@ -156311,7 +156311,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156311
156311
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
156312
156312
|
var root2 = roots[i5];
|
|
156313
156313
|
var loc = resolve6(root2, name2);
|
|
156314
|
-
var dir =
|
|
156314
|
+
var dir = dirname12(loc);
|
|
156315
156315
|
var file2 = basename4(loc);
|
|
156316
156316
|
path19 = this.resolve(dir, file2);
|
|
156317
156317
|
}
|
|
@@ -156661,12 +156661,12 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
156661
156661
|
return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
|
|
156662
156662
|
};
|
|
156663
156663
|
IPv6.prototype.toRFC5952String = function() {
|
|
156664
|
-
var bestMatchIndex, bestMatchLength, match,
|
|
156665
|
-
|
|
156664
|
+
var bestMatchIndex, bestMatchLength, match, regex, string4;
|
|
156665
|
+
regex = /((^|:)(0(:|$)){2,})/g;
|
|
156666
156666
|
string4 = this.toNormalizedString();
|
|
156667
156667
|
bestMatchIndex = 0;
|
|
156668
156668
|
bestMatchLength = -1;
|
|
156669
|
-
while (match =
|
|
156669
|
+
while (match = regex.exec(string4)) {
|
|
156670
156670
|
if (match[0].length > bestMatchLength) {
|
|
156671
156671
|
bestMatchIndex = match.index;
|
|
156672
156672
|
bestMatchLength = match[0].length;
|
|
@@ -161958,8 +161958,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
161958
161958
|
}
|
|
161959
161959
|
return parsed;
|
|
161960
161960
|
}
|
|
161961
|
-
function resolveUrl(
|
|
161962
|
-
return useNativeURL ? new URL2(
|
|
161961
|
+
function resolveUrl(relative4, base) {
|
|
161962
|
+
return useNativeURL ? new URL2(relative4, base) : parseUrl(url3.resolve(base, relative4));
|
|
161963
161963
|
}
|
|
161964
161964
|
function validateUrl(input) {
|
|
161965
161965
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -161984,10 +161984,10 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
161984
161984
|
spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
|
|
161985
161985
|
return spread;
|
|
161986
161986
|
}
|
|
161987
|
-
function removeMatchingHeaders(
|
|
161987
|
+
function removeMatchingHeaders(regex, headers) {
|
|
161988
161988
|
var lastValue;
|
|
161989
161989
|
for (var header2 in headers) {
|
|
161990
|
-
if (
|
|
161990
|
+
if (regex.test(header2)) {
|
|
161991
161991
|
lastValue = headers[header2];
|
|
161992
161992
|
delete headers[header2];
|
|
161993
161993
|
}
|
|
@@ -193547,9 +193547,9 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
193547
193547
|
name2 = "/" + name2;
|
|
193548
193548
|
let nsp = this._nsps.get(name2);
|
|
193549
193549
|
if (!nsp) {
|
|
193550
|
-
for (const [
|
|
193551
|
-
if (
|
|
193552
|
-
debug("attaching namespace %s to parent namespace %s", name2,
|
|
193550
|
+
for (const [regex, parentNamespace] of this.parentNamespacesFromRegExp) {
|
|
193551
|
+
if (regex.test(name2)) {
|
|
193552
|
+
debug("attaching namespace %s to parent namespace %s", name2, regex);
|
|
193553
193553
|
return parentNamespace.createChild(name2);
|
|
193554
193554
|
}
|
|
193555
193555
|
}
|
|
@@ -210671,7 +210671,7 @@ var {
|
|
|
210671
210671
|
} = import__.default;
|
|
210672
210672
|
|
|
210673
210673
|
// src/cli/commands/agents/pull.ts
|
|
210674
|
-
import { dirname as
|
|
210674
|
+
import { dirname as dirname8, join as join9 } from "node:path";
|
|
210675
210675
|
|
|
210676
210676
|
// node_modules/@clack/core/dist/index.mjs
|
|
210677
210677
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -225313,6 +225313,9 @@ var UserInfoSchema = exports_external.object({
|
|
|
225313
225313
|
name: exports_external.string()
|
|
225314
225314
|
});
|
|
225315
225315
|
|
|
225316
|
+
// src/core/clients/base44-client.ts
|
|
225317
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
225318
|
+
|
|
225316
225319
|
// node_modules/ky/distribution/errors/HTTPError.js
|
|
225317
225320
|
class HTTPError extends Error {
|
|
225318
225321
|
response;
|
|
@@ -226141,7 +226144,9 @@ import { fileURLToPath } from "node:url";
|
|
|
226141
226144
|
var PROJECT_SUBDIR = "base44";
|
|
226142
226145
|
var CONFIG_FILE_EXTENSION = "jsonc";
|
|
226143
226146
|
var CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
|
|
226144
|
-
var
|
|
226147
|
+
var FUNCTION_CONFIG_GLOB = `**/function.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
226148
|
+
var ENTRY_FILE_GLOB = "**/entry.{js,ts}";
|
|
226149
|
+
var ENTRY_IGNORE_DOT_PATHS = ["**/*.*/**"];
|
|
226145
226150
|
var APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
226146
226151
|
var PROJECT_CONFIG_PATTERNS = [
|
|
226147
226152
|
`${PROJECT_SUBDIR}/config.${CONFIG_FILE_EXTENSION_GLOB}`,
|
|
@@ -233170,7 +233175,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
233170
233175
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
233171
233176
|
|
|
233172
233177
|
// src/core/project/config.ts
|
|
233173
|
-
import { dirname as
|
|
233178
|
+
import { dirname as dirname6, join as join6 } from "node:path";
|
|
233174
233179
|
|
|
233175
233180
|
// src/core/resources/agent/schema.ts
|
|
233176
233181
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -233386,6 +233391,10 @@ var GoogleBigQueryConnectorSchema = exports_external.object({
|
|
|
233386
233391
|
type: exports_external.literal("googlebigquery"),
|
|
233387
233392
|
scopes: exports_external.array(exports_external.string()).default([])
|
|
233388
233393
|
});
|
|
233394
|
+
var StripeConnectorSchema = exports_external.object({
|
|
233395
|
+
type: exports_external.literal("stripe"),
|
|
233396
|
+
scopes: exports_external.array(exports_external.string()).default([])
|
|
233397
|
+
});
|
|
233389
233398
|
var CustomTypeSchema = exports_external.string().min(1).regex(/^[a-z0-9_-]+$/i);
|
|
233390
233399
|
var GenericConnectorSchema = exports_external.object({
|
|
233391
233400
|
type: CustomTypeSchema,
|
|
@@ -233405,6 +233414,7 @@ var ConnectorResourceSchema = exports_external.union([
|
|
|
233405
233414
|
HubspotConnectorSchema,
|
|
233406
233415
|
LinkedInConnectorSchema,
|
|
233407
233416
|
TikTokConnectorSchema,
|
|
233417
|
+
StripeConnectorSchema,
|
|
233408
233418
|
GenericConnectorSchema
|
|
233409
233419
|
]);
|
|
233410
233420
|
var KnownIntegrationTypes = [
|
|
@@ -233420,7 +233430,8 @@ var KnownIntegrationTypes = [
|
|
|
233420
233430
|
"salesforce",
|
|
233421
233431
|
"hubspot",
|
|
233422
233432
|
"linkedin",
|
|
233423
|
-
"tiktok"
|
|
233433
|
+
"tiktok",
|
|
233434
|
+
"stripe"
|
|
233424
233435
|
];
|
|
233425
233436
|
var IntegrationTypeSchema = exports_external.union([
|
|
233426
233437
|
exports_external.enum(KnownIntegrationTypes),
|
|
@@ -233473,6 +233484,18 @@ var RemoveConnectorResponseSchema = exports_external.object({
|
|
|
233473
233484
|
status: data.status,
|
|
233474
233485
|
integrationType: data.integration_type
|
|
233475
233486
|
}));
|
|
233487
|
+
var STRIPE_CONNECTOR_TYPE = "stripe";
|
|
233488
|
+
var InstallStripeResponseSchema = exports_external.object({
|
|
233489
|
+
already_installed: exports_external.boolean(),
|
|
233490
|
+
claim_url: exports_external.string().nullable()
|
|
233491
|
+
});
|
|
233492
|
+
var StripeStatusResponseSchema = exports_external.object({
|
|
233493
|
+
stripe_mode: exports_external.enum(["sandbox", "live"]).nullable(),
|
|
233494
|
+
sandbox_claim_url: exports_external.string().nullable().optional()
|
|
233495
|
+
});
|
|
233496
|
+
var RemoveStripeResponseSchema = exports_external.object({
|
|
233497
|
+
success: exports_external.boolean()
|
|
233498
|
+
});
|
|
233476
233499
|
|
|
233477
233500
|
// src/core/resources/connector/api.ts
|
|
233478
233501
|
async function listConnectors() {
|
|
@@ -233540,6 +233563,54 @@ async function removeConnector(integrationType) {
|
|
|
233540
233563
|
}
|
|
233541
233564
|
return result.data;
|
|
233542
233565
|
}
|
|
233566
|
+
async function installStripe() {
|
|
233567
|
+
const appClient = getAppClient();
|
|
233568
|
+
let response;
|
|
233569
|
+
try {
|
|
233570
|
+
response = await appClient.post("payments/stripe/install", {
|
|
233571
|
+
timeout: 60000
|
|
233572
|
+
});
|
|
233573
|
+
} catch (error48) {
|
|
233574
|
+
throw await ApiError.fromHttpError(error48, "installing Stripe");
|
|
233575
|
+
}
|
|
233576
|
+
const result = InstallStripeResponseSchema.safeParse(await response.json());
|
|
233577
|
+
if (!result.success) {
|
|
233578
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
233579
|
+
}
|
|
233580
|
+
return result.data;
|
|
233581
|
+
}
|
|
233582
|
+
async function getStripeStatus() {
|
|
233583
|
+
const appClient = getAppClient();
|
|
233584
|
+
let response;
|
|
233585
|
+
try {
|
|
233586
|
+
response = await appClient.get("payments/stripe/status", {
|
|
233587
|
+
timeout: 60000
|
|
233588
|
+
});
|
|
233589
|
+
} catch (error48) {
|
|
233590
|
+
throw await ApiError.fromHttpError(error48, "checking Stripe integration status");
|
|
233591
|
+
}
|
|
233592
|
+
const result = StripeStatusResponseSchema.safeParse(await response.json());
|
|
233593
|
+
if (!result.success) {
|
|
233594
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
233595
|
+
}
|
|
233596
|
+
return result.data;
|
|
233597
|
+
}
|
|
233598
|
+
async function removeStripe() {
|
|
233599
|
+
const appClient = getAppClient();
|
|
233600
|
+
let response;
|
|
233601
|
+
try {
|
|
233602
|
+
response = await appClient.delete("payments/stripe", {
|
|
233603
|
+
timeout: 60000
|
|
233604
|
+
});
|
|
233605
|
+
} catch (error48) {
|
|
233606
|
+
throw await ApiError.fromHttpError(error48, "removing Stripe integration");
|
|
233607
|
+
}
|
|
233608
|
+
const result = RemoveStripeResponseSchema.safeParse(await response.json());
|
|
233609
|
+
if (!result.success) {
|
|
233610
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
233611
|
+
}
|
|
233612
|
+
return result.data;
|
|
233613
|
+
}
|
|
233543
233614
|
// src/core/resources/connector/config.ts
|
|
233544
233615
|
import { join as join4 } from "node:path";
|
|
233545
233616
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
@@ -233588,7 +233659,7 @@ async function readAllConnectors(connectorsDir) {
|
|
|
233588
233659
|
async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
233589
233660
|
const entries = await readConnectorFiles(connectorsDir);
|
|
233590
233661
|
const typeToEntry = buildTypeToEntryMap(entries);
|
|
233591
|
-
const newTypes = new Set(remoteConnectors.map((c) => c.
|
|
233662
|
+
const newTypes = new Set(remoteConnectors.map((c) => c.type));
|
|
233592
233663
|
const deleted = [];
|
|
233593
233664
|
for (const [type, entry] of typeToEntry) {
|
|
233594
233665
|
if (!newTypes.has(type)) {
|
|
@@ -233598,22 +233669,44 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
233598
233669
|
}
|
|
233599
233670
|
const written = [];
|
|
233600
233671
|
for (const connector of remoteConnectors) {
|
|
233601
|
-
const existing = typeToEntry.get(connector.
|
|
233602
|
-
|
|
233603
|
-
type: connector.integrationType,
|
|
233604
|
-
scopes: connector.scopes
|
|
233605
|
-
};
|
|
233606
|
-
if (existing && isDeepStrictEqual2(existing.data, localConnector)) {
|
|
233672
|
+
const existing = typeToEntry.get(connector.type);
|
|
233673
|
+
if (existing && isDeepStrictEqual2(existing.data, connector)) {
|
|
233607
233674
|
continue;
|
|
233608
233675
|
}
|
|
233609
|
-
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.
|
|
233610
|
-
await writeJsonFile(filePath,
|
|
233611
|
-
written.push(connector.
|
|
233676
|
+
const filePath = existing?.filePath ?? join4(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
233677
|
+
await writeJsonFile(filePath, connector);
|
|
233678
|
+
written.push(connector.type);
|
|
233612
233679
|
}
|
|
233613
233680
|
return { written, deleted };
|
|
233614
233681
|
}
|
|
233682
|
+
// src/core/resources/connector/pull.ts
|
|
233683
|
+
async function pullAllConnectors() {
|
|
233684
|
+
const [oauthResponse, stripeStatus] = await Promise.all([
|
|
233685
|
+
listConnectors(),
|
|
233686
|
+
getStripeStatus()
|
|
233687
|
+
]);
|
|
233688
|
+
const connectors = oauthResponse.integrations.map((i) => ({
|
|
233689
|
+
type: i.integrationType,
|
|
233690
|
+
scopes: i.scopes
|
|
233691
|
+
}));
|
|
233692
|
+
if (stripeStatus.stripe_mode !== null) {
|
|
233693
|
+
connectors.push({ type: STRIPE_CONNECTOR_TYPE, scopes: [] });
|
|
233694
|
+
}
|
|
233695
|
+
return connectors;
|
|
233696
|
+
}
|
|
233615
233697
|
// src/core/resources/connector/push.ts
|
|
233616
233698
|
async function pushConnectors(connectors) {
|
|
233699
|
+
const stripeConnector = connectors.find((c) => c.type === STRIPE_CONNECTOR_TYPE);
|
|
233700
|
+
const oauthConnectors = connectors.filter((c) => c.type !== STRIPE_CONNECTOR_TYPE);
|
|
233701
|
+
const oauthResults = await syncOAuthConnectors(oauthConnectors);
|
|
233702
|
+
const stripeResult = await syncStripeConnector(stripeConnector);
|
|
233703
|
+
const results = [...oauthResults];
|
|
233704
|
+
if (stripeResult) {
|
|
233705
|
+
results.push(stripeResult);
|
|
233706
|
+
}
|
|
233707
|
+
return { results };
|
|
233708
|
+
}
|
|
233709
|
+
async function syncOAuthConnectors(connectors) {
|
|
233617
233710
|
const results = [];
|
|
233618
233711
|
const upstream = await listConnectors();
|
|
233619
233712
|
const localTypes = new Set(connectors.map((c) => c.type));
|
|
@@ -233646,7 +233739,62 @@ async function pushConnectors(connectors) {
|
|
|
233646
233739
|
}
|
|
233647
233740
|
}
|
|
233648
233741
|
}
|
|
233649
|
-
return
|
|
233742
|
+
return results;
|
|
233743
|
+
}
|
|
233744
|
+
async function syncStripeConnector(localStripe) {
|
|
233745
|
+
const remoteStatus = await fetchStripeRemoteStatus();
|
|
233746
|
+
if (remoteStatus === "error") {
|
|
233747
|
+
return localStripe ? stripeError("Failed to check Stripe integration status") : null;
|
|
233748
|
+
}
|
|
233749
|
+
const isRemoteInstalled = remoteStatus.stripe_mode !== null;
|
|
233750
|
+
const needsInstall = localStripe && !isRemoteInstalled;
|
|
233751
|
+
const alreadySynced = localStripe && isRemoteInstalled;
|
|
233752
|
+
const needsRemoval = !localStripe && isRemoteInstalled;
|
|
233753
|
+
if (needsInstall) {
|
|
233754
|
+
return handleStripeInstall();
|
|
233755
|
+
}
|
|
233756
|
+
if (alreadySynced) {
|
|
233757
|
+
return stripeSynced();
|
|
233758
|
+
}
|
|
233759
|
+
if (needsRemoval) {
|
|
233760
|
+
return handleStripeRemoval();
|
|
233761
|
+
}
|
|
233762
|
+
return null;
|
|
233763
|
+
}
|
|
233764
|
+
async function fetchStripeRemoteStatus() {
|
|
233765
|
+
try {
|
|
233766
|
+
return await getStripeStatus();
|
|
233767
|
+
} catch {
|
|
233768
|
+
return "error";
|
|
233769
|
+
}
|
|
233770
|
+
}
|
|
233771
|
+
async function handleStripeInstall() {
|
|
233772
|
+
try {
|
|
233773
|
+
const result = await installStripe();
|
|
233774
|
+
return stripeProvisioned(result.claim_url ?? undefined);
|
|
233775
|
+
} catch (err) {
|
|
233776
|
+
return stripeError(err instanceof Error ? err.message : String(err));
|
|
233777
|
+
}
|
|
233778
|
+
}
|
|
233779
|
+
async function handleStripeRemoval() {
|
|
233780
|
+
try {
|
|
233781
|
+
await removeStripe();
|
|
233782
|
+
return stripeRemoved();
|
|
233783
|
+
} catch (err) {
|
|
233784
|
+
return stripeError(err instanceof Error ? err.message : String(err));
|
|
233785
|
+
}
|
|
233786
|
+
}
|
|
233787
|
+
function stripeSynced() {
|
|
233788
|
+
return { type: STRIPE_CONNECTOR_TYPE, action: "synced" };
|
|
233789
|
+
}
|
|
233790
|
+
function stripeProvisioned(claimUrl) {
|
|
233791
|
+
return { type: STRIPE_CONNECTOR_TYPE, action: "provisioned", claimUrl };
|
|
233792
|
+
}
|
|
233793
|
+
function stripeRemoved() {
|
|
233794
|
+
return { type: STRIPE_CONNECTOR_TYPE, action: "removed" };
|
|
233795
|
+
}
|
|
233796
|
+
function stripeError(error48) {
|
|
233797
|
+
return { type: STRIPE_CONNECTOR_TYPE, action: "error", error: error48 };
|
|
233650
233798
|
}
|
|
233651
233799
|
function getConnectorSyncResult(type, response) {
|
|
233652
233800
|
if (response.error === "different_user") {
|
|
@@ -233664,7 +233812,7 @@ function getConnectorSyncResult(type, response) {
|
|
|
233664
233812
|
type,
|
|
233665
233813
|
action: "needs_oauth",
|
|
233666
233814
|
redirectUrl: response.redirectUrl,
|
|
233667
|
-
connectionId: response.connectionId ??
|
|
233815
|
+
connectionId: response.connectionId ?? ""
|
|
233668
233816
|
};
|
|
233669
233817
|
}
|
|
233670
233818
|
return { type, action: "synced" };
|
|
@@ -233980,7 +234128,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
233980
234128
|
return result.data;
|
|
233981
234129
|
}
|
|
233982
234130
|
// src/core/resources/function/config.ts
|
|
233983
|
-
import { dirname as dirname4, join as join5 } from "node:path";
|
|
234131
|
+
import { basename as basename2, dirname as dirname4, join as join5, relative } from "node:path";
|
|
233984
234132
|
async function readFunctionConfig(configPath) {
|
|
233985
234133
|
const parsed = await readJsonFile(configPath);
|
|
233986
234134
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -233998,7 +234146,7 @@ async function readFunction(configPath) {
|
|
|
233998
234146
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
233999
234147
|
});
|
|
234000
234148
|
}
|
|
234001
|
-
const filePaths = await globby("
|
|
234149
|
+
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
234002
234150
|
cwd: functionDir,
|
|
234003
234151
|
absolute: true
|
|
234004
234152
|
});
|
|
@@ -234009,26 +234157,61 @@ async function readAllFunctions(functionsDir) {
|
|
|
234009
234157
|
if (!await pathExists(functionsDir)) {
|
|
234010
234158
|
return [];
|
|
234011
234159
|
}
|
|
234012
|
-
const configFiles = await globby(
|
|
234160
|
+
const configFiles = await globby(FUNCTION_CONFIG_GLOB, {
|
|
234013
234161
|
cwd: functionsDir,
|
|
234014
234162
|
absolute: true
|
|
234015
234163
|
});
|
|
234016
|
-
const
|
|
234164
|
+
const entryFiles = await globby(ENTRY_FILE_GLOB, {
|
|
234165
|
+
cwd: functionsDir,
|
|
234166
|
+
absolute: true,
|
|
234167
|
+
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
234168
|
+
});
|
|
234169
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
234170
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
|
|
234171
|
+
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
234172
|
+
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
234173
|
+
const functionDir = dirname4(entryFile);
|
|
234174
|
+
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
234175
|
+
cwd: functionDir,
|
|
234176
|
+
absolute: true
|
|
234177
|
+
});
|
|
234178
|
+
const name2 = relative(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
234179
|
+
if (!name2) {
|
|
234180
|
+
throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
|
|
234181
|
+
hints: [
|
|
234182
|
+
{
|
|
234183
|
+
message: `Move ${entryFile} into a subfolder (e.g. functions/myFunc/entry.ts)`
|
|
234184
|
+
}
|
|
234185
|
+
]
|
|
234186
|
+
});
|
|
234187
|
+
}
|
|
234188
|
+
const entry = basename2(entryFile);
|
|
234189
|
+
return { name: name2, entry, entryPath: entryFile, filePaths };
|
|
234190
|
+
}));
|
|
234191
|
+
const functions = [...functionsFromConfig, ...functionsWithoutConfig];
|
|
234017
234192
|
const names = new Set;
|
|
234018
234193
|
for (const fn of functions) {
|
|
234019
234194
|
if (names.has(fn.name)) {
|
|
234020
|
-
throw new
|
|
234195
|
+
throw new InvalidInputError(`Duplicate function name "${fn.name}"`, {
|
|
234196
|
+
hints: [
|
|
234197
|
+
{
|
|
234198
|
+
message: "Ensure each function has a unique name (or path for zero-config functions)."
|
|
234199
|
+
}
|
|
234200
|
+
]
|
|
234201
|
+
});
|
|
234021
234202
|
}
|
|
234022
234203
|
names.add(fn.name);
|
|
234023
234204
|
}
|
|
234024
234205
|
return functions;
|
|
234025
234206
|
}
|
|
234026
234207
|
// src/core/resources/function/deploy.ts
|
|
234027
|
-
import {
|
|
234208
|
+
import { dirname as dirname5, relative as relative2 } from "node:path";
|
|
234028
234209
|
async function loadFunctionCode(fn) {
|
|
234210
|
+
const functionDir = dirname5(fn.entryPath);
|
|
234029
234211
|
const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
234030
234212
|
const content = await readTextFile(filePath);
|
|
234031
|
-
|
|
234213
|
+
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
234214
|
+
return { path: path11, content };
|
|
234032
234215
|
}));
|
|
234033
234216
|
return { ...fn, files: loadedFiles };
|
|
234034
234217
|
}
|
|
@@ -234054,12 +234237,12 @@ async function findConfigInDir(dir) {
|
|
|
234054
234237
|
}
|
|
234055
234238
|
async function findProjectRoot(startPath) {
|
|
234056
234239
|
let current = startPath || process.cwd();
|
|
234057
|
-
while (current !==
|
|
234240
|
+
while (current !== dirname6(current)) {
|
|
234058
234241
|
const configPath = await findConfigInDir(current);
|
|
234059
234242
|
if (configPath) {
|
|
234060
234243
|
return { root: current, configPath };
|
|
234061
234244
|
}
|
|
234062
|
-
current =
|
|
234245
|
+
current = dirname6(current);
|
|
234063
234246
|
}
|
|
234064
234247
|
return null;
|
|
234065
234248
|
}
|
|
@@ -234081,7 +234264,7 @@ async function readProjectConfig(projectRoot) {
|
|
|
234081
234264
|
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
234082
234265
|
}
|
|
234083
234266
|
const project = result.data;
|
|
234084
|
-
const configDir =
|
|
234267
|
+
const configDir = dirname6(configPath);
|
|
234085
234268
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
234086
234269
|
entityResource.readAll(join6(configDir, project.entitiesDir)),
|
|
234087
234270
|
functionResource.readAll(join6(configDir, project.functionsDir)),
|
|
@@ -234183,7 +234366,7 @@ async function readAppConfig(projectRoot) {
|
|
|
234183
234366
|
// src/core/project/template.ts
|
|
234184
234367
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
234185
234368
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
234186
|
-
import { dirname as
|
|
234369
|
+
import { dirname as dirname7, join as join7 } from "node:path";
|
|
234187
234370
|
async function listTemplates() {
|
|
234188
234371
|
const parsed = await readJsonFile(getTemplatesIndexPath());
|
|
234189
234372
|
const result = TemplatesConfigSchema.safeParse(parsed);
|
|
@@ -234205,7 +234388,7 @@ async function renderTemplate(template, destPath, data) {
|
|
|
234205
234388
|
if (file2.endsWith(".ejs")) {
|
|
234206
234389
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
234207
234390
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
234208
|
-
const destFile = attributes.outputFileName ? join7(
|
|
234391
|
+
const destFile = attributes.outputFileName ? join7(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
234209
234392
|
const destFilePath = join7(destPath, destFile);
|
|
234210
234393
|
await writeFile(destFilePath, body);
|
|
234211
234394
|
} else {
|
|
@@ -234391,8 +234574,12 @@ async function handleUnauthorized(request, _options, response) {
|
|
|
234391
234574
|
return;
|
|
234392
234575
|
}
|
|
234393
234576
|
retriedRequests.add(request);
|
|
234577
|
+
const requestId = request.headers.get("X-Request-ID");
|
|
234394
234578
|
return distribution_default(request.clone(), {
|
|
234395
|
-
headers: {
|
|
234579
|
+
headers: {
|
|
234580
|
+
...requestId && { "X-Request-ID": requestId },
|
|
234581
|
+
Authorization: `Bearer ${newAccessToken}`
|
|
234582
|
+
}
|
|
234396
234583
|
});
|
|
234397
234584
|
}
|
|
234398
234585
|
var base44Client = distribution_default.create({
|
|
@@ -234402,6 +234589,9 @@ var base44Client = distribution_default.create({
|
|
|
234402
234589
|
},
|
|
234403
234590
|
hooks: {
|
|
234404
234591
|
beforeRequest: [
|
|
234592
|
+
(request) => {
|
|
234593
|
+
request.headers.set("X-Request-ID", randomUUID2());
|
|
234594
|
+
},
|
|
234405
234595
|
captureRequestBody,
|
|
234406
234596
|
async (request) => {
|
|
234407
234597
|
try {
|
|
@@ -234427,10 +234617,18 @@ function getAppClient() {
|
|
|
234427
234617
|
});
|
|
234428
234618
|
}
|
|
234429
234619
|
// src/core/clients/oauth-client.ts
|
|
234620
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
234430
234621
|
var oauthClient = distribution_default.create({
|
|
234431
234622
|
prefixUrl: getBase44ApiUrl(),
|
|
234432
234623
|
headers: {
|
|
234433
234624
|
"User-Agent": "Base44 CLI"
|
|
234625
|
+
},
|
|
234626
|
+
hooks: {
|
|
234627
|
+
beforeRequest: [
|
|
234628
|
+
(request) => {
|
|
234629
|
+
request.headers.set("X-Request-ID", randomUUID3());
|
|
234630
|
+
}
|
|
234631
|
+
]
|
|
234434
234632
|
}
|
|
234435
234633
|
});
|
|
234436
234634
|
// src/core/auth/api.ts
|
|
@@ -234575,7 +234773,8 @@ async function deleteSecret(name2) {
|
|
|
234575
234773
|
let response;
|
|
234576
234774
|
try {
|
|
234577
234775
|
response = await appClient.delete("secrets", {
|
|
234578
|
-
searchParams: { secret_name: name2 }
|
|
234776
|
+
searchParams: { secret_name: name2 },
|
|
234777
|
+
timeout: false
|
|
234579
234778
|
});
|
|
234580
234779
|
} catch (error48) {
|
|
234581
234780
|
throw await ApiError.fromHttpError(error48, "deleting secret");
|
|
@@ -235383,24 +235582,6 @@ async function login() {
|
|
|
235383
235582
|
};
|
|
235384
235583
|
}
|
|
235385
235584
|
|
|
235386
|
-
// node_modules/ansi-regex/index.js
|
|
235387
|
-
function ansiRegex({ onlyFirst = false } = {}) {
|
|
235388
|
-
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
235389
|
-
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
235390
|
-
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
235391
|
-
const pattern = `${osc}|${csi}`;
|
|
235392
|
-
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
235393
|
-
}
|
|
235394
|
-
|
|
235395
|
-
// node_modules/strip-ansi/index.js
|
|
235396
|
-
var regex = ansiRegex();
|
|
235397
|
-
function stripAnsi(string4) {
|
|
235398
|
-
if (typeof string4 !== "string") {
|
|
235399
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
|
|
235400
|
-
}
|
|
235401
|
-
return string4.replace(regex, "");
|
|
235402
|
-
}
|
|
235403
|
-
|
|
235404
235585
|
// node_modules/is-plain-obj/index.js
|
|
235405
235586
|
function isPlainObject2(value) {
|
|
235406
235587
|
if (typeof value !== "object" || value === null) {
|
|
@@ -241899,7 +242080,7 @@ var {
|
|
|
241899
242080
|
// package.json
|
|
241900
242081
|
var package_default = {
|
|
241901
242082
|
name: "base44",
|
|
241902
|
-
version: "0.0.
|
|
242083
|
+
version: "0.0.38",
|
|
241903
242084
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
241904
242085
|
type: "module",
|
|
241905
242086
|
bin: {
|
|
@@ -242017,38 +242198,16 @@ async function checkForUpgrade() {
|
|
|
242017
242198
|
}
|
|
242018
242199
|
|
|
242019
242200
|
// src/cli/utils/upgradeNotification.ts
|
|
242020
|
-
|
|
242021
|
-
function formatUpgradeBox(info) {
|
|
242201
|
+
function formatUpgradeMessage(info) {
|
|
242022
242202
|
const { shinyOrange } = theme.colors;
|
|
242023
242203
|
const { bold: bold2 } = theme.styles;
|
|
242024
|
-
|
|
242025
|
-
shinyOrange(`Update available! ${info.currentVersion} → ${bold2(info.latestVersion)}`),
|
|
242026
|
-
shinyOrange(`Run: ${bold2(UPGRADE_COMMAND)}`),
|
|
242027
|
-
"",
|
|
242028
|
-
"[Agent Hints]",
|
|
242029
|
-
` Run: ${UPGRADE_COMMAND}`
|
|
242030
|
-
];
|
|
242031
|
-
const maxVisualWidth = Math.max(...lines.map((l) => stripAnsi(l).length));
|
|
242032
|
-
const pad = (line) => {
|
|
242033
|
-
const visual = stripAnsi(line).length;
|
|
242034
|
-
return `${line}${" ".repeat(maxVisualWidth - visual)}`;
|
|
242035
|
-
};
|
|
242036
|
-
const top = `┌${"─".repeat(maxVisualWidth + 2)}┐`;
|
|
242037
|
-
const bottom = `└${"─".repeat(maxVisualWidth + 2)}┘`;
|
|
242038
|
-
const body = lines.map((l) => `│ ${pad(l)} │`).join(`
|
|
242039
|
-
`);
|
|
242040
|
-
return `${top}
|
|
242041
|
-
${body}
|
|
242042
|
-
${bottom}`;
|
|
242043
|
-
}
|
|
242044
|
-
function startUpgradeCheck() {
|
|
242045
|
-
return checkForUpgrade().catch(() => null);
|
|
242204
|
+
return `${shinyOrange("Update available!")} ${shinyOrange(`${info.currentVersion} → ${info.latestVersion}`)} ${shinyOrange("Run:")} ${bold2(shinyOrange("npm install -g base44@latest"))}`;
|
|
242046
242205
|
}
|
|
242047
|
-
async function
|
|
242206
|
+
async function printUpgradeNotificationIfAvailable() {
|
|
242048
242207
|
try {
|
|
242049
|
-
const upgradeInfo = await
|
|
242208
|
+
const upgradeInfo = await checkForUpgrade();
|
|
242050
242209
|
if (upgradeInfo) {
|
|
242051
|
-
R2.
|
|
242210
|
+
R2.message(formatUpgradeMessage(upgradeInfo));
|
|
242052
242211
|
}
|
|
242053
242212
|
} catch {}
|
|
242054
242213
|
}
|
|
@@ -242061,7 +242220,7 @@ async function runCommand(commandFn, options, context) {
|
|
|
242061
242220
|
} else {
|
|
242062
242221
|
We(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
242063
242222
|
}
|
|
242064
|
-
|
|
242223
|
+
await printUpgradeNotificationIfAvailable();
|
|
242065
242224
|
try {
|
|
242066
242225
|
if (options?.requireAuth) {
|
|
242067
242226
|
const loggedIn = await isLoggedIn();
|
|
@@ -242081,14 +242240,12 @@ async function runCommand(commandFn, options, context) {
|
|
|
242081
242240
|
context.errorReporter.setContext({ appId: appConfig.id });
|
|
242082
242241
|
}
|
|
242083
242242
|
const result = await commandFn();
|
|
242084
|
-
await printUpgradeNotification(upgradeCheckPromise);
|
|
242085
242243
|
Le(result.outroMessage || "");
|
|
242086
242244
|
if (result.stdout) {
|
|
242087
242245
|
process.stdout.write(result.stdout);
|
|
242088
242246
|
}
|
|
242089
242247
|
} catch (error48) {
|
|
242090
242248
|
displayError(error48);
|
|
242091
|
-
await printUpgradeNotification(upgradeCheckPromise);
|
|
242092
242249
|
const errorContext = context.errorReporter.getErrorContext();
|
|
242093
242250
|
Le(theme.format.errorContext(errorContext));
|
|
242094
242251
|
throw error48;
|
|
@@ -242129,10 +242286,14 @@ function getDashboardUrl(projectId) {
|
|
|
242129
242286
|
const id = projectId ?? getAppConfig().id;
|
|
242130
242287
|
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/overview`;
|
|
242131
242288
|
}
|
|
242289
|
+
function getConnectorsUrl(projectId) {
|
|
242290
|
+
const id = projectId ?? getAppConfig().id;
|
|
242291
|
+
return `${getBase44ApiUrl()}/apps/${id}/editor/workspace/app-connections`;
|
|
242292
|
+
}
|
|
242132
242293
|
// src/cli/commands/agents/pull.ts
|
|
242133
242294
|
async function pullAgentsAction() {
|
|
242134
242295
|
const { project: project2 } = await readProjectConfig();
|
|
242135
|
-
const configDir =
|
|
242296
|
+
const configDir = dirname8(project2.configPath);
|
|
242136
242297
|
const agentsDir = join9(configDir, project2.agentsDir);
|
|
242137
242298
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
242138
242299
|
return await fetchAgents();
|
|
@@ -242227,19 +242388,19 @@ function getWhoamiCommand(context) {
|
|
|
242227
242388
|
}
|
|
242228
242389
|
|
|
242229
242390
|
// src/cli/commands/connectors/pull.ts
|
|
242230
|
-
import { dirname as
|
|
242391
|
+
import { dirname as dirname9, join as join10 } from "node:path";
|
|
242231
242392
|
async function pullConnectorsAction() {
|
|
242232
242393
|
const { project: project2 } = await readProjectConfig();
|
|
242233
|
-
const configDir =
|
|
242394
|
+
const configDir = dirname9(project2.configPath);
|
|
242234
242395
|
const connectorsDir = join10(configDir, project2.connectorsDir);
|
|
242235
242396
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
242236
|
-
return await
|
|
242397
|
+
return await pullAllConnectors();
|
|
242237
242398
|
}, {
|
|
242238
242399
|
successMessage: "Connectors fetched successfully",
|
|
242239
242400
|
errorMessage: "Failed to fetch connectors"
|
|
242240
242401
|
});
|
|
242241
242402
|
const { written, deleted } = await runTask("Syncing connector files", async () => {
|
|
242242
|
-
return await writeConnectors(connectorsDir, remoteConnectors
|
|
242403
|
+
return await writeConnectors(connectorsDir, remoteConnectors);
|
|
242243
242404
|
}, {
|
|
242244
242405
|
successMessage: "Connector files synced successfully",
|
|
242245
242406
|
errorMessage: "Failed to sync connector files"
|
|
@@ -242254,7 +242415,7 @@ async function pullConnectorsAction() {
|
|
|
242254
242415
|
R2.info("All connectors are already up to date");
|
|
242255
242416
|
}
|
|
242256
242417
|
return {
|
|
242257
|
-
outroMessage: `Pulled ${remoteConnectors.
|
|
242418
|
+
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
242258
242419
|
};
|
|
242259
242420
|
}
|
|
242260
242421
|
function getConnectorsPullCommand(context) {
|
|
@@ -242873,7 +243034,7 @@ var open_default = open;
|
|
|
242873
243034
|
var POLL_INTERVAL_MS = 2000;
|
|
242874
243035
|
var POLL_TIMEOUT_MS = 2 * 60 * 1000;
|
|
242875
243036
|
function filterPendingOAuth(results) {
|
|
242876
|
-
return results.filter((r) => r.action === "needs_oauth" && !!r.
|
|
243037
|
+
return results.filter((r) => r.action === "needs_oauth" && !!r.connectionId);
|
|
242877
243038
|
}
|
|
242878
243039
|
async function runOAuthFlowWithSkip(connector2) {
|
|
242879
243040
|
await open_default(connector2.redirectUrl);
|
|
@@ -242953,32 +243114,49 @@ async function promptOAuthFlows(pending, options) {
|
|
|
242953
243114
|
function printSummary(results, oauthOutcomes) {
|
|
242954
243115
|
const synced = [];
|
|
242955
243116
|
const added = [];
|
|
243117
|
+
let provisioned;
|
|
242956
243118
|
const removed = [];
|
|
242957
243119
|
const skipped = [];
|
|
242958
243120
|
const failed = [];
|
|
242959
243121
|
for (const r of results) {
|
|
242960
|
-
|
|
242961
|
-
|
|
242962
|
-
|
|
242963
|
-
|
|
242964
|
-
|
|
242965
|
-
|
|
242966
|
-
|
|
242967
|
-
|
|
242968
|
-
|
|
242969
|
-
|
|
242970
|
-
|
|
242971
|
-
|
|
242972
|
-
|
|
242973
|
-
|
|
242974
|
-
|
|
242975
|
-
|
|
242976
|
-
|
|
242977
|
-
|
|
243122
|
+
switch (r.action) {
|
|
243123
|
+
case "provisioned":
|
|
243124
|
+
provisioned = r;
|
|
243125
|
+
break;
|
|
243126
|
+
case "synced":
|
|
243127
|
+
synced.push(r.type);
|
|
243128
|
+
break;
|
|
243129
|
+
case "removed":
|
|
243130
|
+
removed.push(r.type);
|
|
243131
|
+
break;
|
|
243132
|
+
case "error":
|
|
243133
|
+
failed.push({ type: r.type, error: r.error });
|
|
243134
|
+
break;
|
|
243135
|
+
case "needs_oauth": {
|
|
243136
|
+
const oauthStatus = oauthOutcomes.get(r.type);
|
|
243137
|
+
if (oauthStatus === "ACTIVE") {
|
|
243138
|
+
added.push(r.type);
|
|
243139
|
+
} else if (oauthStatus === "SKIPPED") {
|
|
243140
|
+
skipped.push(r.type);
|
|
243141
|
+
} else if (oauthStatus === "PENDING") {
|
|
243142
|
+
failed.push({ type: r.type, error: "authorization timed out" });
|
|
243143
|
+
} else if (oauthStatus === "FAILED") {
|
|
243144
|
+
failed.push({ type: r.type, error: "authorization failed" });
|
|
243145
|
+
} else {
|
|
243146
|
+
failed.push({ type: r.type, error: "needs authorization" });
|
|
243147
|
+
}
|
|
243148
|
+
break;
|
|
242978
243149
|
}
|
|
242979
243150
|
}
|
|
242980
243151
|
}
|
|
242981
243152
|
R2.info(theme.styles.bold("Summary:"));
|
|
243153
|
+
if (provisioned) {
|
|
243154
|
+
R2.success("Stripe sandbox provisioned");
|
|
243155
|
+
if (provisioned.claimUrl) {
|
|
243156
|
+
R2.info(` Claim your Stripe sandbox: ${theme.colors.links(provisioned.claimUrl)}`);
|
|
243157
|
+
}
|
|
243158
|
+
R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
243159
|
+
}
|
|
242982
243160
|
if (synced.length > 0) {
|
|
242983
243161
|
R2.success(`Synced: ${synced.join(", ")}`);
|
|
242984
243162
|
}
|
|
@@ -242992,7 +243170,7 @@ function printSummary(results, oauthOutcomes) {
|
|
|
242992
243170
|
R2.warn(`Skipped: ${skipped.join(", ")}`);
|
|
242993
243171
|
}
|
|
242994
243172
|
for (const r of failed) {
|
|
242995
|
-
R2.error(`Failed: ${r.type}
|
|
243173
|
+
R2.error(`Failed: ${r.type} - ${r.error}`);
|
|
242996
243174
|
}
|
|
242997
243175
|
}
|
|
242998
243176
|
async function pushConnectorsAction(isNonInteractive) {
|
|
@@ -243026,7 +243204,7 @@ function getConnectorsPushCommand(context) {
|
|
|
243026
243204
|
|
|
243027
243205
|
// src/cli/commands/connectors/index.ts
|
|
243028
243206
|
function getConnectorsCommand(context) {
|
|
243029
|
-
return new Command("connectors").description("Manage project connectors
|
|
243207
|
+
return new Command("connectors").description("Manage project connectors").addCommand(getConnectorsPullCommand(context)).addCommand(getConnectorsPushCommand(context));
|
|
243030
243208
|
}
|
|
243031
243209
|
|
|
243032
243210
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -243340,15 +243518,11 @@ ${summaryLines.join(`
|
|
|
243340
243518
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
243341
243519
|
errorMessage: "Deployment failed"
|
|
243342
243520
|
});
|
|
243343
|
-
const
|
|
243344
|
-
|
|
243345
|
-
|
|
243346
|
-
|
|
243347
|
-
|
|
243348
|
-
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
243349
|
-
if (!allAuthorized) {
|
|
243350
|
-
R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
243351
|
-
}
|
|
243521
|
+
const connectorResults = result.connectorResults ?? [];
|
|
243522
|
+
await handleOAuthConnectors(connectorResults, options);
|
|
243523
|
+
const stripeResult = connectorResults.find((r) => r.action === "provisioned");
|
|
243524
|
+
if (stripeResult) {
|
|
243525
|
+
printStripeResult(stripeResult);
|
|
243352
243526
|
}
|
|
243353
243527
|
R2.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(getDashboardUrl())}`);
|
|
243354
243528
|
if (result.appUrl) {
|
|
@@ -243364,6 +243538,25 @@ function getDeployCommand(context) {
|
|
|
243364
243538
|
}), { requireAuth: true }, context);
|
|
243365
243539
|
});
|
|
243366
243540
|
}
|
|
243541
|
+
async function handleOAuthConnectors(connectorResults, options) {
|
|
243542
|
+
const needsOAuth = filterPendingOAuth(connectorResults);
|
|
243543
|
+
if (needsOAuth.length === 0)
|
|
243544
|
+
return;
|
|
243545
|
+
const oauthOutcomes = await promptOAuthFlows(needsOAuth, {
|
|
243546
|
+
skipPrompt: options.yes || options.isNonInteractive
|
|
243547
|
+
});
|
|
243548
|
+
const allAuthorized = oauthOutcomes.size > 0 && [...oauthOutcomes.values()].every((s) => s === "ACTIVE");
|
|
243549
|
+
if (!allAuthorized) {
|
|
243550
|
+
R2.info("Some connectors still require authorization. Run 'base44 connectors push' or open the links above in your browser.");
|
|
243551
|
+
}
|
|
243552
|
+
}
|
|
243553
|
+
function printStripeResult(r) {
|
|
243554
|
+
R2.success("Stripe sandbox provisioned");
|
|
243555
|
+
if (r.claimUrl) {
|
|
243556
|
+
R2.info(` Claim your Stripe sandbox: ${theme.colors.links(r.claimUrl)}`);
|
|
243557
|
+
}
|
|
243558
|
+
R2.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
|
|
243559
|
+
}
|
|
243367
243560
|
|
|
243368
243561
|
// src/cli/commands/project/link.ts
|
|
243369
243562
|
function validateNonInteractiveFlags2(command) {
|
|
@@ -243926,7 +244119,7 @@ function getTypesCommand(context) {
|
|
|
243926
244119
|
}
|
|
243927
244120
|
|
|
243928
244121
|
// src/cli/dev/dev-server/main.ts
|
|
243929
|
-
import { dirname as
|
|
244122
|
+
import { dirname as dirname15, join as join18 } from "node:path";
|
|
243930
244123
|
var import_cors = __toESM(require_lib4(), 1);
|
|
243931
244124
|
var import_express4 = __toESM(require_express(), 1);
|
|
243932
244125
|
|
|
@@ -244085,9 +244278,9 @@ function createDevLogger() {
|
|
|
244085
244278
|
|
|
244086
244279
|
// src/cli/dev/dev-server/function-manager.ts
|
|
244087
244280
|
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
244088
|
-
import { dirname as
|
|
244281
|
+
import { dirname as dirname12, join as join15 } from "node:path";
|
|
244089
244282
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
244090
|
-
var __dirname5 =
|
|
244283
|
+
var __dirname5 = dirname12(fileURLToPath7(import.meta.url));
|
|
244091
244284
|
var WRAPPER_PATH = join15(__dirname5, "../deno-runtime/main.js");
|
|
244092
244285
|
var READY_TIMEOUT = 30000;
|
|
244093
244286
|
|
|
@@ -244289,9 +244482,8 @@ function createFunctionRouter(manager, logger) {
|
|
|
244289
244482
|
var import_nedb = __toESM(require_nedb(), 1);
|
|
244290
244483
|
|
|
244291
244484
|
class Database {
|
|
244292
|
-
collections;
|
|
244293
|
-
|
|
244294
|
-
this.collections = new Map;
|
|
244485
|
+
collections = new Map;
|
|
244486
|
+
load(entities) {
|
|
244295
244487
|
for (const entity2 of entities) {
|
|
244296
244488
|
this.collections.set(entity2.name, new import_nedb.default);
|
|
244297
244489
|
}
|
|
@@ -244302,6 +244494,12 @@ class Database {
|
|
|
244302
244494
|
getCollectionNames() {
|
|
244303
244495
|
return Array.from(this.collections.keys());
|
|
244304
244496
|
}
|
|
244497
|
+
dropAll() {
|
|
244498
|
+
for (const collection of this.collections.values()) {
|
|
244499
|
+
collection.remove({}, { multi: true });
|
|
244500
|
+
}
|
|
244501
|
+
this.collections.clear();
|
|
244502
|
+
}
|
|
244305
244503
|
}
|
|
244306
244504
|
|
|
244307
244505
|
// node_modules/socket.io/wrapper.mjs
|
|
@@ -244584,7 +244782,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
244584
244782
|
// src/cli/dev/dev-server/routes/integrations.ts
|
|
244585
244783
|
var import_express3 = __toESM(require_express(), 1);
|
|
244586
244784
|
var import_multer = __toESM(require_multer(), 1);
|
|
244587
|
-
import { randomUUID as
|
|
244785
|
+
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
244588
244786
|
import fs28 from "node:fs";
|
|
244589
244787
|
import path18 from "node:path";
|
|
244590
244788
|
function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
@@ -244595,7 +244793,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
244595
244793
|
destination: mediaFilesDir,
|
|
244596
244794
|
filename: (_req, file2, cb2) => {
|
|
244597
244795
|
const ext = path18.extname(file2.originalname);
|
|
244598
|
-
cb2(null, `${
|
|
244796
|
+
cb2(null, `${randomUUID4()}${ext}`);
|
|
244599
244797
|
}
|
|
244600
244798
|
});
|
|
244601
244799
|
const MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
@@ -244622,7 +244820,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
244622
244820
|
res.status(400).json({ error: "file_uri is required" });
|
|
244623
244821
|
return;
|
|
244624
244822
|
}
|
|
244625
|
-
const signature =
|
|
244823
|
+
const signature = randomUUID4();
|
|
244626
244824
|
const signed_url = `${baseUrl}/media/${file_uri}?signature=${signature}`;
|
|
244627
244825
|
res.json({ signed_url });
|
|
244628
244826
|
});
|
|
@@ -244657,7 +244855,7 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
244657
244855
|
|
|
244658
244856
|
// src/cli/dev/dev-server/watcher.ts
|
|
244659
244857
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
244660
|
-
import { relative as
|
|
244858
|
+
import { relative as relative6 } from "node:path";
|
|
244661
244859
|
|
|
244662
244860
|
// node_modules/chokidar/index.js
|
|
244663
244861
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
@@ -245387,9 +245585,9 @@ class NodeFsHandler {
|
|
|
245387
245585
|
if (this.fsw.closed) {
|
|
245388
245586
|
return;
|
|
245389
245587
|
}
|
|
245390
|
-
const
|
|
245588
|
+
const dirname14 = sp2.dirname(file2);
|
|
245391
245589
|
const basename5 = sp2.basename(file2);
|
|
245392
|
-
const parent = this.fsw._getWatchedDir(
|
|
245590
|
+
const parent = this.fsw._getWatchedDir(dirname14);
|
|
245393
245591
|
let prevStats = stats;
|
|
245394
245592
|
if (parent.has(basename5))
|
|
245395
245593
|
return;
|
|
@@ -245416,7 +245614,7 @@ class NodeFsHandler {
|
|
|
245416
245614
|
prevStats = newStats2;
|
|
245417
245615
|
}
|
|
245418
245616
|
} catch (error48) {
|
|
245419
|
-
this.fsw._remove(
|
|
245617
|
+
this.fsw._remove(dirname14, basename5);
|
|
245420
245618
|
}
|
|
245421
245619
|
} else if (parent.has(basename5)) {
|
|
245422
245620
|
const at13 = newStats.atimeMs;
|
|
@@ -245639,11 +245837,11 @@ function createPattern(matcher) {
|
|
|
245639
245837
|
if (matcher.path === string4)
|
|
245640
245838
|
return true;
|
|
245641
245839
|
if (matcher.recursive) {
|
|
245642
|
-
const
|
|
245643
|
-
if (!
|
|
245840
|
+
const relative6 = sp3.relative(matcher.path, string4);
|
|
245841
|
+
if (!relative6) {
|
|
245644
245842
|
return false;
|
|
245645
245843
|
}
|
|
245646
|
-
return !
|
|
245844
|
+
return !relative6.startsWith("..") && !sp3.isAbsolute(relative6);
|
|
245647
245845
|
}
|
|
245648
245846
|
return false;
|
|
245649
245847
|
};
|
|
@@ -246278,79 +246476,74 @@ var WATCH_QUEUE_DELAY_MS = 500;
|
|
|
246278
246476
|
class WatchBase44 extends EventEmitter4 {
|
|
246279
246477
|
itemsToWatch;
|
|
246280
246478
|
logger;
|
|
246281
|
-
|
|
246282
|
-
|
|
246479
|
+
entryNames;
|
|
246480
|
+
watchers = new Map;
|
|
246283
246481
|
queueWaitForCreationTimeout = null;
|
|
246284
246482
|
constructor(itemsToWatch, logger) {
|
|
246285
246483
|
super();
|
|
246286
246484
|
this.itemsToWatch = itemsToWatch;
|
|
246287
246485
|
this.logger = logger;
|
|
246486
|
+
this.entryNames = Object.keys(itemsToWatch);
|
|
246288
246487
|
}
|
|
246289
246488
|
async start() {
|
|
246290
|
-
if (this.watchers.
|
|
246489
|
+
if (this.watchers.size > 0) {
|
|
246291
246490
|
return;
|
|
246292
246491
|
}
|
|
246293
|
-
for (const
|
|
246294
|
-
|
|
246295
|
-
|
|
246296
|
-
|
|
246297
|
-
this.queueWaitForCreation.push(item);
|
|
246492
|
+
for (const name2 of this.entryNames) {
|
|
246493
|
+
const targetPath = this.itemsToWatch[name2];
|
|
246494
|
+
if (await pathExists(targetPath)) {
|
|
246495
|
+
this.watchers.set(name2, this.watchTarget(name2, targetPath));
|
|
246298
246496
|
}
|
|
246299
246497
|
}
|
|
246300
|
-
this.
|
|
246498
|
+
this.watchEntries();
|
|
246301
246499
|
}
|
|
246302
246500
|
async close() {
|
|
246303
246501
|
if (this.queueWaitForCreationTimeout) {
|
|
246304
246502
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246305
246503
|
this.queueWaitForCreationTimeout = null;
|
|
246306
246504
|
}
|
|
246307
|
-
for (const watcher of this.watchers) {
|
|
246505
|
+
for (const watcher of this.watchers.values()) {
|
|
246308
246506
|
await watcher.close();
|
|
246309
246507
|
}
|
|
246310
|
-
this.watchers
|
|
246311
|
-
this.queueWaitForCreation = [];
|
|
246508
|
+
this.watchers.clear();
|
|
246312
246509
|
}
|
|
246313
|
-
|
|
246510
|
+
watchEntries() {
|
|
246314
246511
|
if (this.queueWaitForCreationTimeout) {
|
|
246315
246512
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246316
246513
|
}
|
|
246317
246514
|
this.queueWaitForCreationTimeout = setTimeout(async () => {
|
|
246318
|
-
const
|
|
246319
|
-
|
|
246320
|
-
|
|
246321
|
-
|
|
246322
|
-
|
|
246515
|
+
for (const name2 of this.entryNames) {
|
|
246516
|
+
const path19 = this.itemsToWatch[name2];
|
|
246517
|
+
const watchItem = this.watchers.get(name2);
|
|
246518
|
+
const exists = await pathExists(path19);
|
|
246519
|
+
if (!watchItem && exists) {
|
|
246520
|
+
this.emit("change", name2, path19);
|
|
246521
|
+
this.watchers.set(name2, this.watchTarget(name2, path19));
|
|
246522
|
+
} else if (watchItem && !exists) {
|
|
246523
|
+
await watchItem.close();
|
|
246524
|
+
this.emit("change", name2, path19);
|
|
246525
|
+
setTimeout(() => {
|
|
246526
|
+
this.watchers.forEach((watcher, watcherName) => {
|
|
246527
|
+
if (watcher.closed) {
|
|
246528
|
+
this.watchers.delete(watcherName);
|
|
246529
|
+
}
|
|
246530
|
+
});
|
|
246531
|
+
});
|
|
246323
246532
|
}
|
|
246324
246533
|
}
|
|
246325
|
-
this.
|
|
246326
|
-
|
|
246327
|
-
this.watchCreationQueue();
|
|
246328
|
-
} else {
|
|
246329
|
-
this.queueWaitForCreationTimeout = null;
|
|
246330
|
-
}
|
|
246534
|
+
this.queueWaitForCreationTimeout = null;
|
|
246535
|
+
this.watchEntries();
|
|
246331
246536
|
}, WATCH_QUEUE_DELAY_MS);
|
|
246332
246537
|
}
|
|
246333
|
-
watchTarget(
|
|
246334
|
-
const
|
|
246335
|
-
this.emit("change", item.name, relative4(item.path, path19));
|
|
246336
|
-
}, WATCH_DEBOUNCE_MS);
|
|
246337
|
-
const watcher = watch(item.path, {
|
|
246538
|
+
watchTarget(name2, targetPath) {
|
|
246539
|
+
const watcher = watch(targetPath, {
|
|
246338
246540
|
ignoreInitial: true
|
|
246339
246541
|
});
|
|
246340
|
-
watcher.on("all",
|
|
246341
|
-
|
|
246342
|
-
|
|
246343
|
-
return;
|
|
246344
|
-
}
|
|
246345
|
-
await watcher.close();
|
|
246346
|
-
this.queueWaitForCreation.push(item);
|
|
246347
|
-
this.watchCreationQueue();
|
|
246348
|
-
setTimeout(() => {
|
|
246349
|
-
this.watchers = this.watchers.filter((watcher2) => !watcher2.closed);
|
|
246350
|
-
});
|
|
246351
|
-
});
|
|
246542
|
+
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
246543
|
+
this.emit("change", name2, relative6(targetPath, path19));
|
|
246544
|
+
}, WATCH_DEBOUNCE_MS));
|
|
246352
246545
|
watcher.on("error", (err) => {
|
|
246353
|
-
this.logger.error(`Watch handler failed for ${
|
|
246546
|
+
this.logger.error(`Watch handler failed for ${targetPath}`, err instanceof Error ? err : undefined);
|
|
246354
246547
|
});
|
|
246355
246548
|
return watcher;
|
|
246356
246549
|
}
|
|
@@ -246388,7 +246581,8 @@ async function createDevServer(options8) {
|
|
|
246388
246581
|
if (functionManager.getFunctionNames().length > 0) {
|
|
246389
246582
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
246390
246583
|
}
|
|
246391
|
-
const db2 = new Database
|
|
246584
|
+
const db2 = new Database;
|
|
246585
|
+
db2.load(entities);
|
|
246392
246586
|
if (db2.getCollectionNames().length > 0) {
|
|
246393
246587
|
R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246394
246588
|
}
|
|
@@ -246422,16 +246616,14 @@ async function createDevServer(options8) {
|
|
|
246422
246616
|
emitEntityEvent = (appId, entityName, event) => {
|
|
246423
246617
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246424
246618
|
};
|
|
246425
|
-
const base44ConfigWatcher = new WatchBase44(
|
|
246426
|
-
|
|
246427
|
-
|
|
246428
|
-
|
|
246429
|
-
}
|
|
246430
|
-
], devLogger);
|
|
246619
|
+
const base44ConfigWatcher = new WatchBase44({
|
|
246620
|
+
functions: join18(dirname15(project2.configPath), project2.functionsDir),
|
|
246621
|
+
entities: join18(dirname15(project2.configPath), project2.entitiesDir)
|
|
246622
|
+
}, devLogger);
|
|
246431
246623
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
246432
246624
|
try {
|
|
246625
|
+
const { functions: functions2, entities: entities2 } = await options8.loadResources();
|
|
246433
246626
|
if (name2 === "functions") {
|
|
246434
|
-
const { functions: functions2 } = await options8.loadResources();
|
|
246435
246627
|
const previousFunctionCount = functionManager.getFunctionNames().length;
|
|
246436
246628
|
functionManager.reload(functions2);
|
|
246437
246629
|
const names = functionManager.getFunctionNames();
|
|
@@ -246441,6 +246633,17 @@ async function createDevServer(options8) {
|
|
|
246441
246633
|
devLogger.log("All functions removed");
|
|
246442
246634
|
}
|
|
246443
246635
|
}
|
|
246636
|
+
if (name2 === "entities") {
|
|
246637
|
+
const previousEntityCount = db2.getCollectionNames().length;
|
|
246638
|
+
db2.dropAll();
|
|
246639
|
+
if (previousEntityCount > 0) {
|
|
246640
|
+
devLogger.log("Entities directory changed, clearing data...");
|
|
246641
|
+
}
|
|
246642
|
+
db2.load(entities2);
|
|
246643
|
+
if (db2.getCollectionNames().length > 0) {
|
|
246644
|
+
devLogger.log(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246645
|
+
}
|
|
246646
|
+
}
|
|
246444
246647
|
} catch (error48) {
|
|
246445
246648
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
246446
246649
|
devLogger.error(errorMessage);
|
|
@@ -246604,7 +246807,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
246604
246807
|
import { release, type } from "node:os";
|
|
246605
246808
|
|
|
246606
246809
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
246607
|
-
import { dirname as
|
|
246810
|
+
import { dirname as dirname16, posix, sep } from "path";
|
|
246608
246811
|
function createModulerModifier() {
|
|
246609
246812
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
246610
246813
|
return async (frames) => {
|
|
@@ -246613,7 +246816,7 @@ function createModulerModifier() {
|
|
|
246613
246816
|
return frames;
|
|
246614
246817
|
};
|
|
246615
246818
|
}
|
|
246616
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
246819
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname16(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
246617
246820
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
246618
246821
|
return (filename) => {
|
|
246619
246822
|
if (!filename)
|
|
@@ -249817,9 +250020,9 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
|
|
|
249817
250020
|
throw new InconclusiveMatchError("can't match cohort without a given cohort property value");
|
|
249818
250021
|
return propertyGroupType === "AND";
|
|
249819
250022
|
}
|
|
249820
|
-
function isValidRegex(
|
|
250023
|
+
function isValidRegex(regex) {
|
|
249821
250024
|
try {
|
|
249822
|
-
new RegExp(
|
|
250025
|
+
new RegExp(regex);
|
|
249823
250026
|
return true;
|
|
249824
250027
|
} catch (err) {
|
|
249825
250028
|
return false;
|
|
@@ -249837,8 +250040,8 @@ function convertToDateTime(value) {
|
|
|
249837
250040
|
throw new InconclusiveMatchError(`The date provided ${value} must be a string, number, or date object`);
|
|
249838
250041
|
}
|
|
249839
250042
|
function relativeDateParseForFeatureFlagMatching(value) {
|
|
249840
|
-
const
|
|
249841
|
-
const match = value.match(
|
|
250043
|
+
const regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
|
|
250044
|
+
const match = value.match(regex);
|
|
249842
250045
|
const parsedDt = new Date(new Date().toISOString());
|
|
249843
250046
|
if (!match)
|
|
249844
250047
|
return null;
|
|
@@ -250831,4 +251034,4 @@ export {
|
|
|
250831
251034
|
CLIExitError
|
|
250832
251035
|
};
|
|
250833
251036
|
|
|
250834
|
-
//# debugId=
|
|
251037
|
+
//# debugId=213D2B84FD9C210664756E2164756E21
|