@base44-preview/cli 0.0.56-pr.547.f5a339a → 0.0.56-pr.549.8becca0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/dist/cli/index.js +187 -564
- package/dist/cli/index.js.map +12 -24
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -120878,7 +120878,7 @@ function parse42(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
|
|
|
120878
120878
|
}
|
|
120879
120879
|
return res;
|
|
120880
120880
|
}
|
|
120881
|
-
async function
|
|
120881
|
+
async function readFile2(file2) {
|
|
120882
120882
|
if (isUrlString(file2)) {
|
|
120883
120883
|
file2 = new URL(file2);
|
|
120884
120884
|
}
|
|
@@ -134672,7 +134672,7 @@ ${codeblock}`, options8);
|
|
|
134672
134672
|
"\\": "\\"
|
|
134673
134673
|
};
|
|
134674
134674
|
KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
134675
|
-
read_file_default =
|
|
134675
|
+
read_file_default = readFile2;
|
|
134676
134676
|
loadConfigFromPackageJson = process.versions.bun ? async function loadConfigFromBunPackageJson(file2) {
|
|
134677
134677
|
const { prettier } = await readBunPackageJson(file2);
|
|
134678
134678
|
return prettier;
|
|
@@ -138269,11 +138269,11 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
138269
138269
|
var require_formatter = __commonJS((exports) => {
|
|
138270
138270
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
138271
138271
|
function adopt(value) {
|
|
138272
|
-
return value instanceof P9 ? value : new P9(function(
|
|
138273
|
-
|
|
138272
|
+
return value instanceof P9 ? value : new P9(function(resolve10) {
|
|
138273
|
+
resolve10(value);
|
|
138274
138274
|
});
|
|
138275
138275
|
}
|
|
138276
|
-
return new (P9 || (P9 = Promise))(function(
|
|
138276
|
+
return new (P9 || (P9 = Promise))(function(resolve10, reject) {
|
|
138277
138277
|
function fulfilled(value) {
|
|
138278
138278
|
try {
|
|
138279
138279
|
step(generator.next(value));
|
|
@@ -138289,7 +138289,7 @@ var require_formatter = __commonJS((exports) => {
|
|
|
138289
138289
|
}
|
|
138290
138290
|
}
|
|
138291
138291
|
function step(result) {
|
|
138292
|
-
result.done ?
|
|
138292
|
+
result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
138293
138293
|
}
|
|
138294
138294
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
138295
138295
|
});
|
|
@@ -142942,7 +142942,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142942
142942
|
};
|
|
142943
142943
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
142944
142944
|
exports.parse = undefined;
|
|
142945
|
-
exports.resolve =
|
|
142945
|
+
exports.resolve = resolve10;
|
|
142946
142946
|
exports.cwd = cwd;
|
|
142947
142947
|
exports.getProtocol = getProtocol;
|
|
142948
142948
|
exports.getExtension = getExtension;
|
|
@@ -142970,7 +142970,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142970
142970
|
var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
|
|
142971
142971
|
var parse11 = (u4) => new URL(u4);
|
|
142972
142972
|
exports.parse = parse11;
|
|
142973
|
-
function
|
|
142973
|
+
function resolve10(from, to5) {
|
|
142974
142974
|
const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
|
|
142975
142975
|
const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
|
|
142976
142976
|
const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
|
|
@@ -143106,7 +143106,7 @@ var require_url = __commonJS((exports) => {
|
|
|
143106
143106
|
}
|
|
143107
143107
|
function relative4(from, to5) {
|
|
143108
143108
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
143109
|
-
return
|
|
143109
|
+
return resolve10(from, to5);
|
|
143110
143110
|
}
|
|
143111
143111
|
const fromDir = path_1.default.dirname(stripHash(from));
|
|
143112
143112
|
const toPath4 = stripHash(to5);
|
|
@@ -143782,7 +143782,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
143782
143782
|
let plugin;
|
|
143783
143783
|
let lastError;
|
|
143784
143784
|
let index = 0;
|
|
143785
|
-
return new Promise((
|
|
143785
|
+
return new Promise((resolve10, reject) => {
|
|
143786
143786
|
runNextPlugin();
|
|
143787
143787
|
function runNextPlugin() {
|
|
143788
143788
|
plugin = plugins[index++];
|
|
@@ -143810,7 +143810,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
143810
143810
|
}
|
|
143811
143811
|
}
|
|
143812
143812
|
function onSuccess(result) {
|
|
143813
|
-
|
|
143813
|
+
resolve10({
|
|
143814
143814
|
plugin,
|
|
143815
143815
|
result
|
|
143816
143816
|
});
|
|
@@ -143907,7 +143907,7 @@ var require_parse7 = __commonJS((exports) => {
|
|
|
143907
143907
|
extension: url3.getExtension(path18)
|
|
143908
143908
|
};
|
|
143909
143909
|
try {
|
|
143910
|
-
const resolver = await
|
|
143910
|
+
const resolver = await readFile3(file2, options8, $refs);
|
|
143911
143911
|
$ref.pathType = resolver.plugin.name;
|
|
143912
143912
|
file2.data = resolver.result;
|
|
143913
143913
|
const parser2 = await parseFile(file2, options8, $refs);
|
|
@@ -143920,7 +143920,7 @@ var require_parse7 = __commonJS((exports) => {
|
|
|
143920
143920
|
throw err;
|
|
143921
143921
|
}
|
|
143922
143922
|
}
|
|
143923
|
-
async function
|
|
143923
|
+
async function readFile3(file2, options8, $refs) {
|
|
143924
143924
|
let resolvers = plugins.all(options8.resolve);
|
|
143925
143925
|
resolvers = plugins.filter(resolvers, "canRead", file2);
|
|
143926
143926
|
plugins.sort(resolvers);
|
|
@@ -145143,11 +145143,11 @@ var require_lib3 = __commonJS((exports) => {
|
|
|
145143
145143
|
var require_resolver = __commonJS((exports) => {
|
|
145144
145144
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
145145
145145
|
function adopt(value) {
|
|
145146
|
-
return value instanceof P9 ? value : new P9(function(
|
|
145147
|
-
|
|
145146
|
+
return value instanceof P9 ? value : new P9(function(resolve10) {
|
|
145147
|
+
resolve10(value);
|
|
145148
145148
|
});
|
|
145149
145149
|
}
|
|
145150
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145150
|
+
return new (P9 || (P9 = Promise))(function(resolve10, reject) {
|
|
145151
145151
|
function fulfilled(value) {
|
|
145152
145152
|
try {
|
|
145153
145153
|
step(generator.next(value));
|
|
@@ -145163,7 +145163,7 @@ var require_resolver = __commonJS((exports) => {
|
|
|
145163
145163
|
}
|
|
145164
145164
|
}
|
|
145165
145165
|
function step(result) {
|
|
145166
|
-
result.done ?
|
|
145166
|
+
result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
145167
145167
|
}
|
|
145168
145168
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
145169
145169
|
});
|
|
@@ -145284,11 +145284,11 @@ var require_optionValidator = __commonJS((exports) => {
|
|
|
145284
145284
|
var require_src3 = __commonJS((exports) => {
|
|
145285
145285
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
145286
145286
|
function adopt(value) {
|
|
145287
|
-
return value instanceof P9 ? value : new P9(function(
|
|
145288
|
-
|
|
145287
|
+
return value instanceof P9 ? value : new P9(function(resolve10) {
|
|
145288
|
+
resolve10(value);
|
|
145289
145289
|
});
|
|
145290
145290
|
}
|
|
145291
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145291
|
+
return new (P9 || (P9 = Promise))(function(resolve10, reject) {
|
|
145292
145292
|
function fulfilled(value) {
|
|
145293
145293
|
try {
|
|
145294
145294
|
step(generator.next(value));
|
|
@@ -145304,7 +145304,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
145304
145304
|
}
|
|
145305
145305
|
}
|
|
145306
145306
|
function step(result) {
|
|
145307
|
-
result.done ?
|
|
145307
|
+
result.done ? resolve10(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
145308
145308
|
}
|
|
145309
145309
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
145310
145310
|
});
|
|
@@ -150819,11 +150819,11 @@ var require_raw_body = __commonJS((exports, module) => {
|
|
|
150819
150819
|
if (done) {
|
|
150820
150820
|
return readStream(stream, encoding, length, limit, wrap(done));
|
|
150821
150821
|
}
|
|
150822
|
-
return new Promise(function executor(
|
|
150822
|
+
return new Promise(function executor(resolve10, reject) {
|
|
150823
150823
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
150824
150824
|
if (err)
|
|
150825
150825
|
return reject(err);
|
|
150826
|
-
|
|
150826
|
+
resolve10(buf);
|
|
150827
150827
|
});
|
|
150828
150828
|
});
|
|
150829
150829
|
}
|
|
@@ -163948,7 +163948,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
163948
163948
|
var basename6 = path18.basename;
|
|
163949
163949
|
var extname2 = path18.extname;
|
|
163950
163950
|
var join25 = path18.join;
|
|
163951
|
-
var
|
|
163951
|
+
var resolve10 = path18.resolve;
|
|
163952
163952
|
module.exports = View;
|
|
163953
163953
|
function View(name2, options8) {
|
|
163954
163954
|
var opts = options8 || {};
|
|
@@ -163982,7 +163982,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
163982
163982
|
debug('lookup "%s"', name2);
|
|
163983
163983
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
163984
163984
|
var root2 = roots[i5];
|
|
163985
|
-
var loc =
|
|
163985
|
+
var loc = resolve10(root2, name2);
|
|
163986
163986
|
var dir = dirname19(loc);
|
|
163987
163987
|
var file2 = basename6(loc);
|
|
163988
163988
|
path19 = this.resolve(dir, file2);
|
|
@@ -164007,7 +164007,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
164007
164007
|
});
|
|
164008
164008
|
sync = false;
|
|
164009
164009
|
};
|
|
164010
|
-
View.prototype.resolve = function
|
|
164010
|
+
View.prototype.resolve = function resolve11(dir, file2) {
|
|
164011
164011
|
var ext = this.ext;
|
|
164012
164012
|
var path19 = join25(dir, file2);
|
|
164013
164013
|
var stat2 = tryStat(path19);
|
|
@@ -166166,7 +166166,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
166166
166166
|
var compileETag = require_utils10().compileETag;
|
|
166167
166167
|
var compileQueryParser = require_utils10().compileQueryParser;
|
|
166168
166168
|
var compileTrust = require_utils10().compileTrust;
|
|
166169
|
-
var
|
|
166169
|
+
var resolve10 = __require("node:path").resolve;
|
|
166170
166170
|
var once9 = require_once();
|
|
166171
166171
|
var Router = require_router();
|
|
166172
166172
|
var slice = Array.prototype.slice;
|
|
@@ -166220,7 +166220,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
166220
166220
|
this.mountpath = "/";
|
|
166221
166221
|
this.locals.settings = this.settings;
|
|
166222
166222
|
this.set("view", View);
|
|
166223
|
-
this.set("views",
|
|
166223
|
+
this.set("views", resolve10("views"));
|
|
166224
166224
|
this.set("jsonp callback name", "callback");
|
|
166225
166225
|
if (env3 === "production") {
|
|
166226
166226
|
this.enable("view cache");
|
|
@@ -167711,7 +167711,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167711
167711
|
var extname2 = path18.extname;
|
|
167712
167712
|
var join25 = path18.join;
|
|
167713
167713
|
var normalize2 = path18.normalize;
|
|
167714
|
-
var
|
|
167714
|
+
var resolve10 = path18.resolve;
|
|
167715
167715
|
var sep = path18.sep;
|
|
167716
167716
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
167717
167717
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
|
|
@@ -167740,7 +167740,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167740
167740
|
this._maxage = opts.maxAge || opts.maxage;
|
|
167741
167741
|
this._maxage = typeof this._maxage === "string" ? ms8(this._maxage) : Number(this._maxage);
|
|
167742
167742
|
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
167743
|
-
this._root = opts.root ?
|
|
167743
|
+
this._root = opts.root ? resolve10(opts.root) : null;
|
|
167744
167744
|
}
|
|
167745
167745
|
util2.inherits(SendStream, Stream2);
|
|
167746
167746
|
SendStream.prototype.error = function error48(status, err) {
|
|
@@ -167889,7 +167889,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167889
167889
|
return res;
|
|
167890
167890
|
}
|
|
167891
167891
|
parts = normalize2(path19).split(sep);
|
|
167892
|
-
path19 =
|
|
167892
|
+
path19 = resolve10(path19);
|
|
167893
167893
|
}
|
|
167894
167894
|
if (containsDotFile(parts)) {
|
|
167895
167895
|
debug('%s dotfile "%s"', this._dotfiles, path19);
|
|
@@ -168217,7 +168217,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168217
168217
|
var cookie = require_cookie();
|
|
168218
168218
|
var send = require_send();
|
|
168219
168219
|
var extname2 = path18.extname;
|
|
168220
|
-
var
|
|
168220
|
+
var resolve10 = path18.resolve;
|
|
168221
168221
|
var vary = require_vary();
|
|
168222
168222
|
var { Buffer: Buffer7 } = __require("node:buffer");
|
|
168223
168223
|
var res = Object.create(http.ServerResponse.prototype);
|
|
@@ -168426,7 +168426,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168426
168426
|
}
|
|
168427
168427
|
opts = Object.create(opts);
|
|
168428
168428
|
opts.headers = headers;
|
|
168429
|
-
var fullPath = !opts.root ?
|
|
168429
|
+
var fullPath = !opts.root ? resolve10(path19) : path19;
|
|
168430
168430
|
return this.sendFile(fullPath, opts, done);
|
|
168431
168431
|
};
|
|
168432
168432
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -168687,7 +168687,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
168687
168687
|
var encodeUrl = require_encodeurl();
|
|
168688
168688
|
var escapeHtml = require_escape_html();
|
|
168689
168689
|
var parseUrl = require_parseurl();
|
|
168690
|
-
var
|
|
168690
|
+
var resolve10 = __require("path").resolve;
|
|
168691
168691
|
var send = require_send();
|
|
168692
168692
|
var url3 = __require("url");
|
|
168693
168693
|
module.exports = serveStatic;
|
|
@@ -168706,7 +168706,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
168706
168706
|
throw new TypeError("option setHeaders must be function");
|
|
168707
168707
|
}
|
|
168708
168708
|
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
168709
|
-
opts.root =
|
|
168709
|
+
opts.root = resolve10(root2);
|
|
168710
168710
|
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
168711
168711
|
return function serveStatic2(req, res, next) {
|
|
168712
168712
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
@@ -172080,8 +172080,8 @@ var require_executor = __commonJS((exports, module) => {
|
|
|
172080
172080
|
}
|
|
172081
172081
|
resetBuffer() {
|
|
172082
172082
|
this.buffer = new Waterfall;
|
|
172083
|
-
this.buffer.chain(new Promise((
|
|
172084
|
-
this._triggerBuffer =
|
|
172083
|
+
this.buffer.chain(new Promise((resolve10) => {
|
|
172084
|
+
this._triggerBuffer = resolve10;
|
|
172085
172085
|
}));
|
|
172086
172086
|
if (this.ready)
|
|
172087
172087
|
this._triggerBuffer();
|
|
@@ -173101,7 +173101,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
173101
173101
|
throw e8;
|
|
173102
173102
|
}
|
|
173103
173103
|
};
|
|
173104
|
-
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((
|
|
173104
|
+
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve10, reject) => {
|
|
173105
173105
|
try {
|
|
173106
173106
|
const stream = writeFileStream(filename, { mode });
|
|
173107
173107
|
const readable2 = Readable6.from(lines);
|
|
@@ -173118,7 +173118,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
173118
173118
|
if (err)
|
|
173119
173119
|
reject(err);
|
|
173120
173120
|
else
|
|
173121
|
-
|
|
173121
|
+
resolve10();
|
|
173122
173122
|
});
|
|
173123
173123
|
});
|
|
173124
173124
|
readable2.on("error", (err) => {
|
|
@@ -173289,7 +173289,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
173289
173289
|
return { data: tdata, indexes };
|
|
173290
173290
|
}
|
|
173291
173291
|
treatRawStreamAsync(rawStream) {
|
|
173292
|
-
return new Promise((
|
|
173292
|
+
return new Promise((resolve10, reject) => {
|
|
173293
173293
|
const dataById = {};
|
|
173294
173294
|
const indexes = {};
|
|
173295
173295
|
let corruptItems = 0;
|
|
@@ -173332,7 +173332,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
173332
173332
|
}
|
|
173333
173333
|
}
|
|
173334
173334
|
const data = Object.values(dataById);
|
|
173335
|
-
|
|
173335
|
+
resolve10({ data, indexes });
|
|
173336
173336
|
});
|
|
173337
173337
|
lineStream.on("error", function(err) {
|
|
173338
173338
|
reject(err, null);
|
|
@@ -198943,13 +198943,13 @@ var require_broadcast_operator = __commonJS((exports) => {
|
|
|
198943
198943
|
return true;
|
|
198944
198944
|
}
|
|
198945
198945
|
emitWithAck(ev2, ...args) {
|
|
198946
|
-
return new Promise((
|
|
198946
|
+
return new Promise((resolve10, reject) => {
|
|
198947
198947
|
args.push((err, responses) => {
|
|
198948
198948
|
if (err) {
|
|
198949
198949
|
err.responses = responses;
|
|
198950
198950
|
return reject(err);
|
|
198951
198951
|
} else {
|
|
198952
|
-
return
|
|
198952
|
+
return resolve10(responses);
|
|
198953
198953
|
}
|
|
198954
198954
|
});
|
|
198955
198955
|
this.emit(ev2, ...args);
|
|
@@ -199137,12 +199137,12 @@ var require_socket2 = __commonJS((exports) => {
|
|
|
199137
199137
|
}
|
|
199138
199138
|
emitWithAck(ev2, ...args) {
|
|
199139
199139
|
const withErr = this.flags.timeout !== undefined;
|
|
199140
|
-
return new Promise((
|
|
199140
|
+
return new Promise((resolve10, reject) => {
|
|
199141
199141
|
args.push((arg1, arg2) => {
|
|
199142
199142
|
if (withErr) {
|
|
199143
|
-
return arg1 ? reject(arg1) :
|
|
199143
|
+
return arg1 ? reject(arg1) : resolve10(arg2);
|
|
199144
199144
|
} else {
|
|
199145
|
-
return
|
|
199145
|
+
return resolve10(arg1);
|
|
199146
199146
|
}
|
|
199147
199147
|
});
|
|
199148
199148
|
this.emit(ev2, ...args);
|
|
@@ -199597,13 +199597,13 @@ var require_namespace = __commonJS((exports) => {
|
|
|
199597
199597
|
return true;
|
|
199598
199598
|
}
|
|
199599
199599
|
serverSideEmitWithAck(ev2, ...args) {
|
|
199600
|
-
return new Promise((
|
|
199600
|
+
return new Promise((resolve10, reject) => {
|
|
199601
199601
|
args.push((err, responses) => {
|
|
199602
199602
|
if (err) {
|
|
199603
199603
|
err.responses = responses;
|
|
199604
199604
|
return reject(err);
|
|
199605
199605
|
} else {
|
|
199606
|
-
return
|
|
199606
|
+
return resolve10(responses);
|
|
199607
199607
|
}
|
|
199608
199608
|
});
|
|
199609
199609
|
this.serverSideEmit(ev2, ...args);
|
|
@@ -200287,7 +200287,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200287
200287
|
return localSockets;
|
|
200288
200288
|
}
|
|
200289
200289
|
const requestId = randomId();
|
|
200290
|
-
return new Promise((
|
|
200290
|
+
return new Promise((resolve10, reject) => {
|
|
200291
200291
|
const timeout3 = setTimeout(() => {
|
|
200292
200292
|
const storedRequest2 = this.requests.get(requestId);
|
|
200293
200293
|
if (storedRequest2) {
|
|
@@ -200297,7 +200297,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200297
200297
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
200298
200298
|
const storedRequest = {
|
|
200299
200299
|
type: MessageType.FETCH_SOCKETS,
|
|
200300
|
-
resolve:
|
|
200300
|
+
resolve: resolve10,
|
|
200301
200301
|
timeout: timeout3,
|
|
200302
200302
|
current: 0,
|
|
200303
200303
|
expected: expectedResponseCount,
|
|
@@ -200507,7 +200507,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200507
200507
|
return localSockets;
|
|
200508
200508
|
}
|
|
200509
200509
|
const requestId = randomId();
|
|
200510
|
-
return new Promise((
|
|
200510
|
+
return new Promise((resolve10, reject) => {
|
|
200511
200511
|
const timeout3 = setTimeout(() => {
|
|
200512
200512
|
const storedRequest2 = this.customRequests.get(requestId);
|
|
200513
200513
|
if (storedRequest2) {
|
|
@@ -200517,7 +200517,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
200517
200517
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
200518
200518
|
const storedRequest = {
|
|
200519
200519
|
type: MessageType.FETCH_SOCKETS,
|
|
200520
|
-
resolve:
|
|
200520
|
+
resolve: resolve10,
|
|
200521
200521
|
timeout: timeout3,
|
|
200522
200522
|
missingUids: new Set([...this.nodesMap.keys()]),
|
|
200523
200523
|
responses: localSockets
|
|
@@ -201246,13 +201246,13 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
201246
201246
|
this.engine.close();
|
|
201247
201247
|
(0, uws_1.restoreAdapter)();
|
|
201248
201248
|
if (this.httpServer) {
|
|
201249
|
-
return new Promise((
|
|
201249
|
+
return new Promise((resolve10) => {
|
|
201250
201250
|
this.httpServer.close((err) => {
|
|
201251
201251
|
fn9 && fn9(err);
|
|
201252
201252
|
if (err) {
|
|
201253
201253
|
debug("server was not running");
|
|
201254
201254
|
}
|
|
201255
|
-
|
|
201255
|
+
resolve10();
|
|
201256
201256
|
});
|
|
201257
201257
|
});
|
|
201258
201258
|
} else {
|
|
@@ -215914,14 +215914,14 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215914
215914
|
};
|
|
215915
215915
|
}
|
|
215916
215916
|
function readAndResolve(iter) {
|
|
215917
|
-
var
|
|
215918
|
-
if (
|
|
215917
|
+
var resolve10 = iter[kLastResolve];
|
|
215918
|
+
if (resolve10 !== null) {
|
|
215919
215919
|
var data = iter[kStream].read();
|
|
215920
215920
|
if (data !== null) {
|
|
215921
215921
|
iter[kLastPromise] = null;
|
|
215922
215922
|
iter[kLastResolve] = null;
|
|
215923
215923
|
iter[kLastReject] = null;
|
|
215924
|
-
|
|
215924
|
+
resolve10(createIterResult(data, false));
|
|
215925
215925
|
}
|
|
215926
215926
|
}
|
|
215927
215927
|
}
|
|
@@ -215929,13 +215929,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215929
215929
|
process.nextTick(readAndResolve, iter);
|
|
215930
215930
|
}
|
|
215931
215931
|
function wrapForNext(lastPromise, iter) {
|
|
215932
|
-
return function(
|
|
215932
|
+
return function(resolve10, reject) {
|
|
215933
215933
|
lastPromise.then(function() {
|
|
215934
215934
|
if (iter[kEnded]) {
|
|
215935
|
-
|
|
215935
|
+
resolve10(createIterResult(undefined, true));
|
|
215936
215936
|
return;
|
|
215937
215937
|
}
|
|
215938
|
-
iter[kHandlePromise](
|
|
215938
|
+
iter[kHandlePromise](resolve10, reject);
|
|
215939
215939
|
}, reject);
|
|
215940
215940
|
};
|
|
215941
215941
|
}
|
|
@@ -215954,12 +215954,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215954
215954
|
return Promise.resolve(createIterResult(undefined, true));
|
|
215955
215955
|
}
|
|
215956
215956
|
if (this[kStream].destroyed) {
|
|
215957
|
-
return new Promise(function(
|
|
215957
|
+
return new Promise(function(resolve10, reject) {
|
|
215958
215958
|
process.nextTick(function() {
|
|
215959
215959
|
if (_this[kError]) {
|
|
215960
215960
|
reject(_this[kError]);
|
|
215961
215961
|
} else {
|
|
215962
|
-
|
|
215962
|
+
resolve10(createIterResult(undefined, true));
|
|
215963
215963
|
}
|
|
215964
215964
|
});
|
|
215965
215965
|
});
|
|
@@ -215982,13 +215982,13 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
215982
215982
|
return this;
|
|
215983
215983
|
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
215984
215984
|
var _this2 = this;
|
|
215985
|
-
return new Promise(function(
|
|
215985
|
+
return new Promise(function(resolve10, reject) {
|
|
215986
215986
|
_this2[kStream].destroy(null, function(err) {
|
|
215987
215987
|
if (err) {
|
|
215988
215988
|
reject(err);
|
|
215989
215989
|
return;
|
|
215990
215990
|
}
|
|
215991
|
-
|
|
215991
|
+
resolve10(createIterResult(undefined, true));
|
|
215992
215992
|
});
|
|
215993
215993
|
});
|
|
215994
215994
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
@@ -216010,15 +216010,15 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
216010
216010
|
value: stream._readableState.endEmitted,
|
|
216011
216011
|
writable: true
|
|
216012
216012
|
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
216013
|
-
value: function value(
|
|
216013
|
+
value: function value(resolve10, reject) {
|
|
216014
216014
|
var data = iterator[kStream].read();
|
|
216015
216015
|
if (data) {
|
|
216016
216016
|
iterator[kLastPromise] = null;
|
|
216017
216017
|
iterator[kLastResolve] = null;
|
|
216018
216018
|
iterator[kLastReject] = null;
|
|
216019
|
-
|
|
216019
|
+
resolve10(createIterResult(data, false));
|
|
216020
216020
|
} else {
|
|
216021
|
-
iterator[kLastResolve] =
|
|
216021
|
+
iterator[kLastResolve] = resolve10;
|
|
216022
216022
|
iterator[kLastReject] = reject;
|
|
216023
216023
|
}
|
|
216024
216024
|
},
|
|
@@ -216037,12 +216037,12 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
216037
216037
|
iterator[kError] = err;
|
|
216038
216038
|
return;
|
|
216039
216039
|
}
|
|
216040
|
-
var
|
|
216041
|
-
if (
|
|
216040
|
+
var resolve10 = iterator[kLastResolve];
|
|
216041
|
+
if (resolve10 !== null) {
|
|
216042
216042
|
iterator[kLastPromise] = null;
|
|
216043
216043
|
iterator[kLastResolve] = null;
|
|
216044
216044
|
iterator[kLastReject] = null;
|
|
216045
|
-
|
|
216045
|
+
resolve10(createIterResult(undefined, true));
|
|
216046
216046
|
}
|
|
216047
216047
|
iterator[kEnded] = true;
|
|
216048
216048
|
});
|
|
@@ -216054,7 +216054,7 @@ var require_async_iterator = __commonJS((exports, module) => {
|
|
|
216054
216054
|
|
|
216055
216055
|
// ../../node_modules/readable-stream/lib/internal/streams/from.js
|
|
216056
216056
|
var require_from = __commonJS((exports, module) => {
|
|
216057
|
-
function asyncGeneratorStep(gen,
|
|
216057
|
+
function asyncGeneratorStep(gen, resolve10, reject, _next, _throw, key2, arg) {
|
|
216058
216058
|
try {
|
|
216059
216059
|
var info = gen[key2](arg);
|
|
216060
216060
|
var value = info.value;
|
|
@@ -216063,7 +216063,7 @@ var require_from = __commonJS((exports, module) => {
|
|
|
216063
216063
|
return;
|
|
216064
216064
|
}
|
|
216065
216065
|
if (info.done) {
|
|
216066
|
-
|
|
216066
|
+
resolve10(value);
|
|
216067
216067
|
} else {
|
|
216068
216068
|
Promise.resolve(value).then(_next, _throw);
|
|
216069
216069
|
}
|
|
@@ -216071,13 +216071,13 @@ var require_from = __commonJS((exports, module) => {
|
|
|
216071
216071
|
function _asyncToGenerator(fn9) {
|
|
216072
216072
|
return function() {
|
|
216073
216073
|
var self2 = this, args = arguments;
|
|
216074
|
-
return new Promise(function(
|
|
216074
|
+
return new Promise(function(resolve10, reject) {
|
|
216075
216075
|
var gen = fn9.apply(self2, args);
|
|
216076
216076
|
function _next(value) {
|
|
216077
|
-
asyncGeneratorStep(gen,
|
|
216077
|
+
asyncGeneratorStep(gen, resolve10, reject, _next, _throw, "next", value);
|
|
216078
216078
|
}
|
|
216079
216079
|
function _throw(err) {
|
|
216080
|
-
asyncGeneratorStep(gen,
|
|
216080
|
+
asyncGeneratorStep(gen, resolve10, reject, _next, _throw, "throw", err);
|
|
216081
216081
|
}
|
|
216082
216082
|
_next(undefined);
|
|
216083
216083
|
});
|
|
@@ -243426,7 +243426,7 @@ var ListFunctionsResponseSchema = exports_external.object({
|
|
|
243426
243426
|
var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
|
|
243427
243427
|
var FunctionLogEntrySchema = exports_external.object({
|
|
243428
243428
|
time: exports_external.string(),
|
|
243429
|
-
level: LogLevelSchema,
|
|
243429
|
+
level: exports_external.preprocess((v) => v === "warn" ? "warning" : v, LogLevelSchema),
|
|
243430
243430
|
message: exports_external.string()
|
|
243431
243431
|
});
|
|
243432
243432
|
var FunctionLogsResponseSchema = exports_external.array(FunctionLogEntrySchema);
|
|
@@ -244260,11 +244260,6 @@ function getAppClient() {
|
|
|
244260
244260
|
prefixUrl: new URL(`/api/apps/${id}/`, getBase44ApiUrl()).href
|
|
244261
244261
|
});
|
|
244262
244262
|
}
|
|
244263
|
-
function getSandboxClient(appId) {
|
|
244264
|
-
return base44Client.extend({
|
|
244265
|
-
prefixUrl: new URL(`/api/apps/${appId}/sandbox-bridge/`, getBase44ApiUrl()).href
|
|
244266
|
-
});
|
|
244267
|
-
}
|
|
244268
244263
|
// src/core/clients/oauth-client.ts
|
|
244269
244264
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
244270
244265
|
var oauthClient = distribution_default.create({
|
|
@@ -244285,7 +244280,7 @@ async function generateDeviceCode() {
|
|
|
244285
244280
|
const response = await oauthClient.post("oauth/device/code", {
|
|
244286
244281
|
json: {
|
|
244287
244282
|
client_id: AUTH_CLIENT_ID,
|
|
244288
|
-
scope: "apps:read apps:write
|
|
244283
|
+
scope: "apps:read apps:write"
|
|
244289
244284
|
},
|
|
244290
244285
|
throwHttpErrors: false
|
|
244291
244286
|
});
|
|
@@ -251200,7 +251195,7 @@ function createSimpleRunTask(log) {
|
|
|
251200
251195
|
};
|
|
251201
251196
|
}
|
|
251202
251197
|
// src/cli/utils/stdin.ts
|
|
251203
|
-
async function readStdin(flagName = "--stdin"
|
|
251198
|
+
async function readStdin(flagName = "--stdin") {
|
|
251204
251199
|
if (process.stdin.isTTY) {
|
|
251205
251200
|
throw new InvalidInputError(`${flagName} requires piped input (e.g., echo <value> | base44 ...)`);
|
|
251206
251201
|
}
|
|
@@ -251208,8 +251203,7 @@ async function readStdin(flagName = "--stdin", options = {}) {
|
|
|
251208
251203
|
for await (const chunk of process.stdin) {
|
|
251209
251204
|
chunks.push(chunk);
|
|
251210
251205
|
}
|
|
251211
|
-
|
|
251212
|
-
return options.trim === false ? text : text.trim();
|
|
251206
|
+
return Buffer.concat(chunks).toString("utf-8").trim();
|
|
251213
251207
|
}
|
|
251214
251208
|
|
|
251215
251209
|
// src/cli/utils/secret-input.ts
|
|
@@ -251835,6 +251829,73 @@ function getWhoamiCommand() {
|
|
|
251835
251829
|
return new Base44Command("whoami", { requireAppContext: false }).description("Display current authenticated user").action(whoami);
|
|
251836
251830
|
}
|
|
251837
251831
|
|
|
251832
|
+
// src/cli/commands/connectors/list-available.ts
|
|
251833
|
+
async function listAvailableAction({
|
|
251834
|
+
log,
|
|
251835
|
+
runTask: runTask2
|
|
251836
|
+
}) {
|
|
251837
|
+
const { integrations } = await runTask2("Fetching available integrations from Base44", async () => {
|
|
251838
|
+
return await listAvailableIntegrations();
|
|
251839
|
+
}, {
|
|
251840
|
+
successMessage: "Available integrations fetched successfully",
|
|
251841
|
+
errorMessage: "Failed to fetch available integrations"
|
|
251842
|
+
});
|
|
251843
|
+
if (integrations.length === 0) {
|
|
251844
|
+
return { outroMessage: "No available integrations found." };
|
|
251845
|
+
}
|
|
251846
|
+
for (const { displayName, ...rest } of integrations) {
|
|
251847
|
+
const yaml2 = formatYaml(rest);
|
|
251848
|
+
const pad = " ".repeat(YAML_INDENT);
|
|
251849
|
+
log.info(`${displayName}
|
|
251850
|
+
${pad}${yaml2.replace(/\n/g, `
|
|
251851
|
+
${pad}`)}`);
|
|
251852
|
+
}
|
|
251853
|
+
return {
|
|
251854
|
+
outroMessage: `Found ${integrations.length} available integrations.`
|
|
251855
|
+
};
|
|
251856
|
+
}
|
|
251857
|
+
function getConnectorsListAvailableCommand() {
|
|
251858
|
+
return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
|
|
251859
|
+
}
|
|
251860
|
+
|
|
251861
|
+
// src/cli/commands/connectors/pull.ts
|
|
251862
|
+
import { dirname as dirname15, join as join19 } from "node:path";
|
|
251863
|
+
async function pullConnectorsAction({
|
|
251864
|
+
log,
|
|
251865
|
+
runTask: runTask2
|
|
251866
|
+
}) {
|
|
251867
|
+
const { project: project2 } = await readProjectConfig();
|
|
251868
|
+
const configDir = dirname15(project2.configPath);
|
|
251869
|
+
const connectorsDir = join19(configDir, project2.connectorsDir);
|
|
251870
|
+
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
251871
|
+
return await pullAllConnectors();
|
|
251872
|
+
}, {
|
|
251873
|
+
successMessage: "Connectors fetched successfully",
|
|
251874
|
+
errorMessage: "Failed to fetch connectors"
|
|
251875
|
+
});
|
|
251876
|
+
const { written, deleted } = await runTask2("Syncing connector files", async () => {
|
|
251877
|
+
return await writeConnectors(connectorsDir, remoteConnectors);
|
|
251878
|
+
}, {
|
|
251879
|
+
successMessage: "Connector files synced successfully",
|
|
251880
|
+
errorMessage: "Failed to sync connector files"
|
|
251881
|
+
});
|
|
251882
|
+
if (written.length > 0) {
|
|
251883
|
+
log.success(`Written: ${written.join(", ")}`);
|
|
251884
|
+
}
|
|
251885
|
+
if (deleted.length > 0) {
|
|
251886
|
+
log.warn(`Deleted: ${deleted.join(", ")}`);
|
|
251887
|
+
}
|
|
251888
|
+
if (written.length === 0 && deleted.length === 0) {
|
|
251889
|
+
log.info("All connectors are already up to date");
|
|
251890
|
+
}
|
|
251891
|
+
return {
|
|
251892
|
+
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
251893
|
+
};
|
|
251894
|
+
}
|
|
251895
|
+
function getConnectorsPullCommand() {
|
|
251896
|
+
return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(pullConnectorsAction);
|
|
251897
|
+
}
|
|
251898
|
+
|
|
251838
251899
|
// ../../node_modules/open/index.js
|
|
251839
251900
|
import process20 from "node:process";
|
|
251840
251901
|
import path16 from "node:path";
|
|
@@ -252525,138 +252586,7 @@ async function promptOAuthFlows(pending, log, options) {
|
|
|
252525
252586
|
return outcomes;
|
|
252526
252587
|
}
|
|
252527
252588
|
|
|
252528
|
-
// src/cli/commands/connectors/initiate.ts
|
|
252529
|
-
function parseIntegrationType(value) {
|
|
252530
|
-
const result = IntegrationTypeSchema.safeParse(value);
|
|
252531
|
-
if (!result.success) {
|
|
252532
|
-
throw new InvalidInputError("A valid --integration-type is required (e.g. googlecalendar, gmail, slack).");
|
|
252533
|
-
}
|
|
252534
|
-
return result.data;
|
|
252535
|
-
}
|
|
252536
|
-
function parseScopes(scopes) {
|
|
252537
|
-
return (scopes ?? []).flatMap((s) => s.split(",")).map((s) => s.trim()).filter(Boolean);
|
|
252538
|
-
}
|
|
252539
|
-
async function initiateAction(ctx, options) {
|
|
252540
|
-
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
252541
|
-
const integrationType = parseIntegrationType(options.integrationType);
|
|
252542
|
-
const scopes = parseScopes(options.scopes);
|
|
252543
|
-
const response = await runTask2(`Initiating ${integrationType} connector`, () => setConnector(integrationType, scopes), {
|
|
252544
|
-
successMessage: `Connector ${integrationType} initialized`,
|
|
252545
|
-
errorMessage: `Failed to initialize ${integrationType}`
|
|
252546
|
-
});
|
|
252547
|
-
if (response.error) {
|
|
252548
|
-
const detail = response.error === "different_user" && response.otherUserEmail ? ` (already authorized by ${response.otherUserEmail})` : response.errorMessage ? ` (${response.errorMessage})` : "";
|
|
252549
|
-
throw new InvalidInputError(`Could not initiate ${integrationType}: ${response.error}${detail}`);
|
|
252550
|
-
}
|
|
252551
|
-
if (response.alreadyAuthorized || !response.redirectUrl) {
|
|
252552
|
-
return {
|
|
252553
|
-
outroMessage: `${integrationType} is already authorized. Run 'base44 connectors pull' to fetch its config.`
|
|
252554
|
-
};
|
|
252555
|
-
}
|
|
252556
|
-
log.info(`Authorize ${integrationType} here: ${theme.colors.links(response.redirectUrl)}`);
|
|
252557
|
-
const pending = {
|
|
252558
|
-
type: integrationType,
|
|
252559
|
-
action: "needs_oauth",
|
|
252560
|
-
redirectUrl: response.redirectUrl,
|
|
252561
|
-
connectionId: response.connectionId ?? undefined
|
|
252562
|
-
};
|
|
252563
|
-
const outcomes = await promptOAuthFlows([pending], log, {
|
|
252564
|
-
skipPrompt: isNonInteractive
|
|
252565
|
-
});
|
|
252566
|
-
if (outcomes.get(integrationType) === "ACTIVE") {
|
|
252567
|
-
return {
|
|
252568
|
-
outroMessage: `${integrationType} authorized. Run 'base44 connectors pull' to fetch its config.`
|
|
252569
|
-
};
|
|
252570
|
-
}
|
|
252571
|
-
return {
|
|
252572
|
-
outroMessage: `${integrationType} initialized. Open the link above to finish authorizing, then run 'base44 connectors pull'.`
|
|
252573
|
-
};
|
|
252574
|
-
}
|
|
252575
|
-
function getConnectorsInitiateCommand() {
|
|
252576
|
-
return new Base44Command("initiate").description("Initialize a connector on an app and start its OAuth flow (works with --app-id, no local project required)").requiredOption("--integration-type <type>", "Integration type to initiate (e.g. googlecalendar, gmail, slack)").option("--scopes <scopes...>", "OAuth scopes to request (space- or comma-separated)").addHelpText("after", `
|
|
252577
|
-
Examples:
|
|
252578
|
-
$ base44 connectors initiate --app-id app_123 --integration-type googlecalendar --scopes https://www.googleapis.com/auth/calendar
|
|
252579
|
-
$ base44 connectors initiate --integration-type gmail --scopes scope.a,scope.b`).action(initiateAction);
|
|
252580
|
-
}
|
|
252581
|
-
|
|
252582
|
-
// src/cli/commands/connectors/list-available.ts
|
|
252583
|
-
async function listAvailableAction({
|
|
252584
|
-
log,
|
|
252585
|
-
runTask: runTask2
|
|
252586
|
-
}) {
|
|
252587
|
-
const { integrations } = await runTask2("Fetching available integrations from Base44", async () => {
|
|
252588
|
-
return await listAvailableIntegrations();
|
|
252589
|
-
}, {
|
|
252590
|
-
successMessage: "Available integrations fetched successfully",
|
|
252591
|
-
errorMessage: "Failed to fetch available integrations"
|
|
252592
|
-
});
|
|
252593
|
-
if (integrations.length === 0) {
|
|
252594
|
-
return { outroMessage: "No available integrations found." };
|
|
252595
|
-
}
|
|
252596
|
-
for (const { displayName, ...rest } of integrations) {
|
|
252597
|
-
const yaml2 = formatYaml(rest);
|
|
252598
|
-
const pad = " ".repeat(YAML_INDENT);
|
|
252599
|
-
log.info(`${displayName}
|
|
252600
|
-
${pad}${yaml2.replace(/\n/g, `
|
|
252601
|
-
${pad}`)}`);
|
|
252602
|
-
}
|
|
252603
|
-
return {
|
|
252604
|
-
outroMessage: `Found ${integrations.length} available integrations.`
|
|
252605
|
-
};
|
|
252606
|
-
}
|
|
252607
|
-
function getConnectorsListAvailableCommand() {
|
|
252608
|
-
return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
|
|
252609
|
-
}
|
|
252610
|
-
|
|
252611
|
-
// src/cli/commands/connectors/pull.ts
|
|
252612
|
-
import { dirname as dirname15, join as join19, resolve as resolve5 } from "node:path";
|
|
252613
|
-
async function resolveConnectorsDir(options) {
|
|
252614
|
-
if (!getAppContext().projectRoot) {
|
|
252615
|
-
return resolve5(options.dir ?? "connectors");
|
|
252616
|
-
}
|
|
252617
|
-
const { project: project2 } = await readProjectConfig();
|
|
252618
|
-
return join19(dirname15(project2.configPath), project2.connectorsDir);
|
|
252619
|
-
}
|
|
252620
|
-
async function pullConnectorsAction({ log, runTask: runTask2 }, options) {
|
|
252621
|
-
const connectorsDir = await resolveConnectorsDir(options);
|
|
252622
|
-
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
252623
|
-
return await pullAllConnectors();
|
|
252624
|
-
}, {
|
|
252625
|
-
successMessage: "Connectors fetched successfully",
|
|
252626
|
-
errorMessage: "Failed to fetch connectors"
|
|
252627
|
-
});
|
|
252628
|
-
const { written, deleted } = await runTask2("Syncing connector files", async () => {
|
|
252629
|
-
return await writeConnectors(connectorsDir, remoteConnectors);
|
|
252630
|
-
}, {
|
|
252631
|
-
successMessage: "Connector files synced successfully",
|
|
252632
|
-
errorMessage: "Failed to sync connector files"
|
|
252633
|
-
});
|
|
252634
|
-
if (written.length > 0) {
|
|
252635
|
-
log.success(`Written: ${written.join(", ")}`);
|
|
252636
|
-
}
|
|
252637
|
-
if (deleted.length > 0) {
|
|
252638
|
-
log.warn(`Deleted: ${deleted.join(", ")}`);
|
|
252639
|
-
}
|
|
252640
|
-
if (written.length === 0 && deleted.length === 0) {
|
|
252641
|
-
log.info("All connectors are already up to date");
|
|
252642
|
-
}
|
|
252643
|
-
return {
|
|
252644
|
-
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
252645
|
-
};
|
|
252646
|
-
}
|
|
252647
|
-
function getConnectorsPullCommand() {
|
|
252648
|
-
return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").option("--dir <path>", "Directory to write connector files to (default: ./connectors when using --app-id)").action(pullConnectorsAction);
|
|
252649
|
-
}
|
|
252650
|
-
|
|
252651
252589
|
// src/cli/commands/connectors/push.ts
|
|
252652
|
-
import { resolve as resolve6 } from "node:path";
|
|
252653
|
-
async function readConnectorsToPush(options) {
|
|
252654
|
-
if (!getAppContext().projectRoot) {
|
|
252655
|
-
return readAllConnectors(resolve6(options.dir ?? "connectors"));
|
|
252656
|
-
}
|
|
252657
|
-
const { connectors } = await readProjectConfig();
|
|
252658
|
-
return connectors;
|
|
252659
|
-
}
|
|
252660
252590
|
function printSummary(results, oauthOutcomes, log) {
|
|
252661
252591
|
const synced = [];
|
|
252662
252592
|
const added = [];
|
|
@@ -252719,8 +252649,12 @@ function printSummary(results, oauthOutcomes, log) {
|
|
|
252719
252649
|
log.error(`Failed: ${r.type} - ${r.error}`);
|
|
252720
252650
|
}
|
|
252721
252651
|
}
|
|
252722
|
-
async function pushConnectorsAction({
|
|
252723
|
-
|
|
252652
|
+
async function pushConnectorsAction({
|
|
252653
|
+
isNonInteractive,
|
|
252654
|
+
log,
|
|
252655
|
+
runTask: runTask2
|
|
252656
|
+
}) {
|
|
252657
|
+
const { connectors } = await readProjectConfig();
|
|
252724
252658
|
if (connectors.length === 0) {
|
|
252725
252659
|
log.info("No local connectors found - checking for remote connectors to remove");
|
|
252726
252660
|
} else {
|
|
@@ -252743,12 +252677,12 @@ async function pushConnectorsAction({ isNonInteractive, log, runTask: runTask2 }
|
|
|
252743
252677
|
return { outroMessage };
|
|
252744
252678
|
}
|
|
252745
252679
|
function getConnectorsPushCommand() {
|
|
252746
|
-
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").
|
|
252680
|
+
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(pushConnectorsAction);
|
|
252747
252681
|
}
|
|
252748
252682
|
|
|
252749
252683
|
// src/cli/commands/connectors/index.ts
|
|
252750
252684
|
function getConnectorsCommand() {
|
|
252751
|
-
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(
|
|
252685
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(getConnectorsPullCommand()).addCommand(getConnectorsPushCommand());
|
|
252752
252686
|
}
|
|
252753
252687
|
|
|
252754
252688
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -253055,7 +252989,7 @@ function getFunctionsCommand() {
|
|
|
253055
252989
|
}
|
|
253056
252990
|
|
|
253057
252991
|
// src/cli/commands/project/create.ts
|
|
253058
|
-
import { basename as basename4, resolve as
|
|
252992
|
+
import { basename as basename4, resolve as resolve5 } from "node:path";
|
|
253059
252993
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
253060
252994
|
|
|
253061
252995
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -253209,7 +253143,7 @@ async function createInteractive(options, ctx) {
|
|
|
253209
253143
|
}, ctx);
|
|
253210
253144
|
}
|
|
253211
253145
|
async function createNonInteractive(options, ctx) {
|
|
253212
|
-
ctx.log.info(`Creating a new project at ${
|
|
253146
|
+
ctx.log.info(`Creating a new project at ${resolve5(options.path)}`);
|
|
253213
253147
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
253214
253148
|
return await executeCreate({
|
|
253215
253149
|
template: template2,
|
|
@@ -253231,7 +253165,7 @@ async function executeCreate({
|
|
|
253231
253165
|
}, ctx) {
|
|
253232
253166
|
const { log, runTask: runTask2 } = ctx;
|
|
253233
253167
|
const name2 = rawName.trim();
|
|
253234
|
-
const resolvedPath =
|
|
253168
|
+
const resolvedPath = resolve5(projectPath);
|
|
253235
253169
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
253236
253170
|
return await createProjectFiles({
|
|
253237
253171
|
name: name2,
|
|
@@ -253672,7 +253606,7 @@ function getLogsCommand() {
|
|
|
253672
253606
|
}
|
|
253673
253607
|
|
|
253674
253608
|
// src/cli/commands/project/scaffold.ts
|
|
253675
|
-
import { basename as basename5, resolve as
|
|
253609
|
+
import { basename as basename5, resolve as resolve6 } from "node:path";
|
|
253676
253610
|
function resolveAppId(options) {
|
|
253677
253611
|
const appId = options.appId;
|
|
253678
253612
|
if (!appId) {
|
|
@@ -253688,7 +253622,7 @@ function resolveAppId(options) {
|
|
|
253688
253622
|
async function scaffoldAction(ctx, name2, options, command2) {
|
|
253689
253623
|
const { log, runTask: runTask2 } = ctx;
|
|
253690
253624
|
const appId = resolveAppId(command2.optsWithGlobals());
|
|
253691
|
-
const resolvedPath =
|
|
253625
|
+
const resolvedPath = resolve6("./");
|
|
253692
253626
|
const projectName = (name2 ?? basename5(resolvedPath)).trim();
|
|
253693
253627
|
const template2 = await getTemplateById("backend-only");
|
|
253694
253628
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
@@ -253725,316 +253659,6 @@ Examples:
|
|
|
253725
253659
|
$ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
|
|
253726
253660
|
}
|
|
253727
253661
|
|
|
253728
|
-
// src/core/resources/sandbox/schema.ts
|
|
253729
|
-
var FileErrorSchema = exports_external.object({
|
|
253730
|
-
code: exports_external.string(),
|
|
253731
|
-
message: exports_external.string()
|
|
253732
|
-
});
|
|
253733
|
-
var ReadFileEntrySchema = exports_external.object({
|
|
253734
|
-
path: exports_external.string(),
|
|
253735
|
-
content: exports_external.string().optional(),
|
|
253736
|
-
start_line: exports_external.number().optional(),
|
|
253737
|
-
end_line: exports_external.number().optional(),
|
|
253738
|
-
total_lines: exports_external.number().optional(),
|
|
253739
|
-
truncated: exports_external.boolean().optional(),
|
|
253740
|
-
error: FileErrorSchema.optional()
|
|
253741
|
-
}).transform((data) => ({
|
|
253742
|
-
path: data.path,
|
|
253743
|
-
content: data.content,
|
|
253744
|
-
startLine: data.start_line,
|
|
253745
|
-
endLine: data.end_line,
|
|
253746
|
-
totalLines: data.total_lines,
|
|
253747
|
-
truncated: data.truncated,
|
|
253748
|
-
error: data.error
|
|
253749
|
-
}));
|
|
253750
|
-
var ReadFileResponseSchema = exports_external.object({
|
|
253751
|
-
files: exports_external.array(ReadFileEntrySchema)
|
|
253752
|
-
});
|
|
253753
|
-
var WriteFileResponseSchema = exports_external.object({
|
|
253754
|
-
path: exports_external.string(),
|
|
253755
|
-
bytes_written: exports_external.number(),
|
|
253756
|
-
created: exports_external.boolean(),
|
|
253757
|
-
overwritten: exports_external.boolean()
|
|
253758
|
-
}).transform((data) => ({
|
|
253759
|
-
path: data.path,
|
|
253760
|
-
bytesWritten: data.bytes_written,
|
|
253761
|
-
created: data.created,
|
|
253762
|
-
overwritten: data.overwritten
|
|
253763
|
-
}));
|
|
253764
|
-
var EditFileResponseSchema = exports_external.object({
|
|
253765
|
-
path: exports_external.string(),
|
|
253766
|
-
diff: exports_external.string(),
|
|
253767
|
-
applied: exports_external.boolean()
|
|
253768
|
-
});
|
|
253769
|
-
var GrepMatchSchema = exports_external.object({
|
|
253770
|
-
path: exports_external.string().nullable(),
|
|
253771
|
-
line: exports_external.number().nullable(),
|
|
253772
|
-
text: exports_external.string()
|
|
253773
|
-
});
|
|
253774
|
-
var GrepResponseSchema = exports_external.object({
|
|
253775
|
-
matches: exports_external.array(GrepMatchSchema),
|
|
253776
|
-
truncated: exports_external.boolean(),
|
|
253777
|
-
returned_matches: exports_external.number()
|
|
253778
|
-
}).transform((data) => ({
|
|
253779
|
-
matches: data.matches,
|
|
253780
|
-
truncated: data.truncated,
|
|
253781
|
-
returnedMatches: data.returned_matches
|
|
253782
|
-
}));
|
|
253783
|
-
var DirectoryEntrySchema = exports_external.object({
|
|
253784
|
-
name: exports_external.string(),
|
|
253785
|
-
path: exports_external.string(),
|
|
253786
|
-
type: exports_external.enum(["file", "directory"]),
|
|
253787
|
-
size: exports_external.number().optional()
|
|
253788
|
-
});
|
|
253789
|
-
var ListDirectoryResponseSchema = exports_external.object({
|
|
253790
|
-
entries: exports_external.array(DirectoryEntrySchema),
|
|
253791
|
-
truncated: exports_external.boolean()
|
|
253792
|
-
});
|
|
253793
|
-
var RunCommandResponseSchema = exports_external.object({
|
|
253794
|
-
stdout: exports_external.string(),
|
|
253795
|
-
stderr: exports_external.string(),
|
|
253796
|
-
exit_code: exports_external.number(),
|
|
253797
|
-
truncated: exports_external.boolean(),
|
|
253798
|
-
duration_ms: exports_external.number()
|
|
253799
|
-
}).transform((data) => ({
|
|
253800
|
-
stdout: data.stdout,
|
|
253801
|
-
stderr: data.stderr,
|
|
253802
|
-
exitCode: data.exit_code,
|
|
253803
|
-
truncated: data.truncated,
|
|
253804
|
-
durationMs: data.duration_ms
|
|
253805
|
-
}));
|
|
253806
|
-
var ReleaseResponseSchema = exports_external.object({
|
|
253807
|
-
app_id: exports_external.string(),
|
|
253808
|
-
released: exports_external.boolean()
|
|
253809
|
-
}).transform((data) => ({
|
|
253810
|
-
appId: data.app_id,
|
|
253811
|
-
released: data.released
|
|
253812
|
-
}));
|
|
253813
|
-
|
|
253814
|
-
// src/core/resources/sandbox/api.ts
|
|
253815
|
-
function isMissingSandboxScope(error48) {
|
|
253816
|
-
if (error48.statusCode !== 401 && error48.statusCode !== 403) {
|
|
253817
|
-
return false;
|
|
253818
|
-
}
|
|
253819
|
-
const text = `${error48.message} ${JSON.stringify(error48.responseBody ?? "")}`;
|
|
253820
|
-
return /sandbox:write/i.test(text) || /granting sandbox access/i.test(text);
|
|
253821
|
-
}
|
|
253822
|
-
function withSandboxAuthHint(error48) {
|
|
253823
|
-
if (!isMissingSandboxScope(error48)) {
|
|
253824
|
-
return error48;
|
|
253825
|
-
}
|
|
253826
|
-
return new ApiError(error48.message, {
|
|
253827
|
-
statusCode: error48.statusCode,
|
|
253828
|
-
requestUrl: error48.requestUrl,
|
|
253829
|
-
requestMethod: error48.requestMethod,
|
|
253830
|
-
requestBody: error48.requestBody,
|
|
253831
|
-
responseBody: error48.responseBody,
|
|
253832
|
-
requestId: error48.requestId,
|
|
253833
|
-
details: error48.details,
|
|
253834
|
-
hints: [
|
|
253835
|
-
...error48.hints,
|
|
253836
|
-
{
|
|
253837
|
-
message: "Run 'base44 login' again to grant sandbox access (the sandbox:write scope is only granted at login).",
|
|
253838
|
-
command: "base44 login"
|
|
253839
|
-
}
|
|
253840
|
-
],
|
|
253841
|
-
cause: error48
|
|
253842
|
-
});
|
|
253843
|
-
}
|
|
253844
|
-
async function callTool(appId, tool, payload, schema10, context, timeout2 = 60000) {
|
|
253845
|
-
const client = getSandboxClient(appId);
|
|
253846
|
-
let response;
|
|
253847
|
-
try {
|
|
253848
|
-
response = await client.post(tool, { json: payload, timeout: timeout2 });
|
|
253849
|
-
} catch (error48) {
|
|
253850
|
-
throw withSandboxAuthHint(await ApiError.fromHttpError(error48, context));
|
|
253851
|
-
}
|
|
253852
|
-
const result = schema10.safeParse(await response.json());
|
|
253853
|
-
if (!result.success) {
|
|
253854
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
253855
|
-
}
|
|
253856
|
-
return result.data;
|
|
253857
|
-
}
|
|
253858
|
-
function listDirectory(appId, params) {
|
|
253859
|
-
return callTool(appId, "list_directory", { ...params }, ListDirectoryResponseSchema, "listing directory");
|
|
253860
|
-
}
|
|
253861
|
-
function readFile2(appId, params) {
|
|
253862
|
-
return callTool(appId, "read_file", { ...params }, ReadFileResponseSchema, "reading file");
|
|
253863
|
-
}
|
|
253864
|
-
function writeFile2(appId, params) {
|
|
253865
|
-
return callTool(appId, "write_file", { ...params }, WriteFileResponseSchema, `writing file "${params.path}"`);
|
|
253866
|
-
}
|
|
253867
|
-
function editFile(appId, params) {
|
|
253868
|
-
return callTool(appId, "edit_file", { ...params }, EditFileResponseSchema, `editing file "${params.path}"`);
|
|
253869
|
-
}
|
|
253870
|
-
function grep(appId, params) {
|
|
253871
|
-
return callTool(appId, "grep", { ...params }, GrepResponseSchema, "searching files");
|
|
253872
|
-
}
|
|
253873
|
-
function runCommand(appId, params) {
|
|
253874
|
-
return callTool(appId, "run_command", { ...params }, RunCommandResponseSchema, "running command", false);
|
|
253875
|
-
}
|
|
253876
|
-
function releaseSession(appId) {
|
|
253877
|
-
return callTool(appId, "release", {}, ReleaseResponseSchema, "releasing sandbox session");
|
|
253878
|
-
}
|
|
253879
|
-
|
|
253880
|
-
// src/cli/commands/sandbox/shared.ts
|
|
253881
|
-
async function resolveFlagOrStdin(flagValue, flagName) {
|
|
253882
|
-
if (flagValue !== undefined) {
|
|
253883
|
-
return flagValue;
|
|
253884
|
-
}
|
|
253885
|
-
if (process.stdin.isTTY) {
|
|
253886
|
-
throw new InvalidInputError(`Provide ${flagName} or pipe the value via stdin (e.g. echo <value> | base44 sandbox ...).`);
|
|
253887
|
-
}
|
|
253888
|
-
return readStdin(flagName, { trim: false });
|
|
253889
|
-
}
|
|
253890
|
-
function toJsonStdout(result) {
|
|
253891
|
-
return `${JSON.stringify(result, null, 2)}
|
|
253892
|
-
`;
|
|
253893
|
-
}
|
|
253894
|
-
function parsePositiveInt(value, flagName) {
|
|
253895
|
-
if (value === undefined) {
|
|
253896
|
-
return;
|
|
253897
|
-
}
|
|
253898
|
-
const n2 = Number.parseInt(value, 10);
|
|
253899
|
-
if (!Number.isInteger(n2) || n2 < 1) {
|
|
253900
|
-
throw new InvalidInputError(`${flagName} must be a positive integer.`);
|
|
253901
|
-
}
|
|
253902
|
-
return n2;
|
|
253903
|
-
}
|
|
253904
|
-
|
|
253905
|
-
// src/cli/commands/sandbox/edit-file.ts
|
|
253906
|
-
var EditsInputSchema = exports_external.array(exports_external.object({
|
|
253907
|
-
old_text: exports_external.string().min(1),
|
|
253908
|
-
new_text: exports_external.string(),
|
|
253909
|
-
replace_all: exports_external.boolean().optional()
|
|
253910
|
-
})).min(1);
|
|
253911
|
-
function parseEdits(raw2) {
|
|
253912
|
-
let parsed;
|
|
253913
|
-
try {
|
|
253914
|
-
parsed = JSON.parse(raw2);
|
|
253915
|
-
} catch {
|
|
253916
|
-
throw new InvalidInputError("--edits-json must be valid JSON (an array of { old_text, new_text, replace_all? }).");
|
|
253917
|
-
}
|
|
253918
|
-
const result = EditsInputSchema.safeParse(parsed);
|
|
253919
|
-
if (!result.success) {
|
|
253920
|
-
throw new InvalidInputError("Invalid edits: expected a non-empty array of { old_text (non-empty string), new_text (string), replace_all? (boolean) }.");
|
|
253921
|
-
}
|
|
253922
|
-
return result.data;
|
|
253923
|
-
}
|
|
253924
|
-
async function editFileAction({ runTask: runTask2 }, path17, options) {
|
|
253925
|
-
const { id: appId } = getAppContext();
|
|
253926
|
-
const raw2 = await resolveFlagOrStdin(options.editsJson, "--edits-json");
|
|
253927
|
-
const edits = parseEdits(raw2);
|
|
253928
|
-
const result = await runTask2(options.dryRun ? "Previewing edit" : "Editing file", () => editFile(appId, { path: path17, edits, dry_run: options.dryRun }));
|
|
253929
|
-
return {
|
|
253930
|
-
outroMessage: options.dryRun ? "Previewed edit" : "Edited file",
|
|
253931
|
-
stdout: toJsonStdout(result)
|
|
253932
|
-
};
|
|
253933
|
-
}
|
|
253934
|
-
function getSandboxEditFileCommand() {
|
|
253935
|
-
return new Base44Command("edit-file").description("Apply exact old→new string edits to a file in the sandbox").argument("<path>", "File path relative to the app root").option("--edits-json <json>", "JSON array of edits (if omitted, read from stdin)").option("--dry-run", "Return the unified diff without writing").addHelpText("after", `
|
|
253936
|
-
Each edit is { "old_text": "...", "new_text": "...", "replace_all"?: true }.
|
|
253937
|
-
|
|
253938
|
-
Examples:
|
|
253939
|
-
$ echo '[{"old_text":"foo","new_text":"bar"}]' | base44 sandbox edit-file src/x.ts
|
|
253940
|
-
$ base44 sandbox edit-file src/x.ts --dry-run --edits-json '[{"old_text":"a","new_text":"b","replace_all":true}]'`).action(editFileAction);
|
|
253941
|
-
}
|
|
253942
|
-
|
|
253943
|
-
// src/cli/commands/sandbox/grep.ts
|
|
253944
|
-
async function grepAction({ runTask: runTask2 }, pattern, options) {
|
|
253945
|
-
const { id: appId } = getAppContext();
|
|
253946
|
-
const maxResults = parsePositiveInt(options.maxResults, "--max-results");
|
|
253947
|
-
const result = await runTask2("Searching files", () => grep(appId, {
|
|
253948
|
-
pattern,
|
|
253949
|
-
path: options.path,
|
|
253950
|
-
is_regex: options.regex,
|
|
253951
|
-
case_sensitive: options.caseSensitive,
|
|
253952
|
-
glob: options.glob,
|
|
253953
|
-
max_results: maxResults
|
|
253954
|
-
}));
|
|
253955
|
-
return { outroMessage: "Searched files", stdout: toJsonStdout(result) };
|
|
253956
|
-
}
|
|
253957
|
-
function getSandboxGrepCommand() {
|
|
253958
|
-
return new Base44Command("grep").description("Search files for a pattern in an app's remote sandbox").argument("<pattern>", "Search pattern").option("--path <path>", "Subtree to search, relative to the app root").option("--no-regex", "Treat the pattern as a literal string, not a regex").option("--case-sensitive", "Case-sensitive match").option("--glob <glob>", 'File glob filter, e.g. "*.tsx"').option("--max-results <n>", "Maximum number of match lines to return").action(grepAction);
|
|
253959
|
-
}
|
|
253960
|
-
|
|
253961
|
-
// src/cli/commands/sandbox/list-directory.ts
|
|
253962
|
-
async function listDirectoryAction({ runTask: runTask2 }, path17, options) {
|
|
253963
|
-
const { id: appId } = getAppContext();
|
|
253964
|
-
const maxDepth = parsePositiveInt(options.maxDepth, "--max-depth");
|
|
253965
|
-
const result = await runTask2("Listing directory", () => listDirectory(appId, {
|
|
253966
|
-
path: path17,
|
|
253967
|
-
recursive: options.recursive,
|
|
253968
|
-
max_depth: maxDepth,
|
|
253969
|
-
include_hidden: options.includeHidden
|
|
253970
|
-
}));
|
|
253971
|
-
return { outroMessage: "Listed directory", stdout: toJsonStdout(result) };
|
|
253972
|
-
}
|
|
253973
|
-
function getSandboxListDirectoryCommand() {
|
|
253974
|
-
return new Base44Command("list-directory").description("List directory entries in an app's remote sandbox").argument("[path]", "Directory relative to the app root (default: app root)").option("--recursive", "List nested entries").option("--max-depth <n>", "Max depth when recursive (1-10, default 3)").option("--include-hidden", "Include dotfiles").action(listDirectoryAction);
|
|
253975
|
-
}
|
|
253976
|
-
|
|
253977
|
-
// src/cli/commands/sandbox/read-file.ts
|
|
253978
|
-
async function readFileAction({ runTask: runTask2 }, paths, options) {
|
|
253979
|
-
const { id: appId } = getAppContext();
|
|
253980
|
-
const offset = parsePositiveInt(options.offset, "--offset");
|
|
253981
|
-
const limit = parsePositiveInt(options.limit, "--limit");
|
|
253982
|
-
const result = await runTask2("Reading file", () => readFile2(appId, { paths, offset, limit }));
|
|
253983
|
-
return { outroMessage: "Read file", stdout: toJsonStdout(result) };
|
|
253984
|
-
}
|
|
253985
|
-
function getSandboxReadFileCommand() {
|
|
253986
|
-
return new Base44Command("read-file").description("Read file contents from an app's remote sandbox").argument("<paths...>", "One or more file paths relative to the app root").option("--offset <n>", "1-based start line").option("--limit <n>", "Max lines to return from offset").action(readFileAction);
|
|
253987
|
-
}
|
|
253988
|
-
|
|
253989
|
-
// src/cli/commands/sandbox/release.ts
|
|
253990
|
-
async function releaseAction({
|
|
253991
|
-
runTask: runTask2
|
|
253992
|
-
}) {
|
|
253993
|
-
const { id: appId } = getAppContext();
|
|
253994
|
-
const result = await runTask2("Releasing sandbox session", () => releaseSession(appId));
|
|
253995
|
-
return {
|
|
253996
|
-
outroMessage: "Released sandbox session",
|
|
253997
|
-
stdout: toJsonStdout(result)
|
|
253998
|
-
};
|
|
253999
|
-
}
|
|
254000
|
-
function getSandboxReleaseCommand() {
|
|
254001
|
-
return new Base44Command("release").description("Release the external-agent session so the in-app builder can resume").action(releaseAction);
|
|
254002
|
-
}
|
|
254003
|
-
|
|
254004
|
-
// src/cli/commands/sandbox/run-command.ts
|
|
254005
|
-
async function runCommandAction({ runTask: runTask2 }, commandParts, options) {
|
|
254006
|
-
const { id: appId } = getAppContext();
|
|
254007
|
-
const timeoutMs = parsePositiveInt(options.timeoutMs, "--timeout-ms");
|
|
254008
|
-
const command2 = commandParts.join(" ");
|
|
254009
|
-
const result = await runTask2("Running command", () => runCommand(appId, { command: command2, cwd: options.cwd, timeout_ms: timeoutMs }));
|
|
254010
|
-
return { outroMessage: "Ran command", stdout: toJsonStdout(result) };
|
|
254011
|
-
}
|
|
254012
|
-
function getSandboxRunCommandCommand() {
|
|
254013
|
-
return new Base44Command("run-command").description("Run a shell command in an app's remote sandbox").argument("<command...>", "Shell command to execute (quote to keep as one)").option("--cwd <path>", "Working directory relative to the app root").option("--timeout-ms <n>", "Timeout in milliseconds (default 120000, max 600000)").addHelpText("after", `
|
|
254014
|
-
Examples:
|
|
254015
|
-
$ base44 sandbox run-command "npm test"
|
|
254016
|
-
$ base44 sandbox run-command ls -la --cwd src`).action(runCommandAction);
|
|
254017
|
-
}
|
|
254018
|
-
|
|
254019
|
-
// src/cli/commands/sandbox/write-file.ts
|
|
254020
|
-
async function writeFileAction({ runTask: runTask2 }, path17, options) {
|
|
254021
|
-
const { id: appId } = getAppContext();
|
|
254022
|
-
const content = await resolveFlagOrStdin(options.content, "--content");
|
|
254023
|
-
const result = await runTask2("Writing file", () => writeFile2(appId, { path: path17, content, overwrite: options.overwrite }));
|
|
254024
|
-
return { outroMessage: "Wrote file", stdout: toJsonStdout(result) };
|
|
254025
|
-
}
|
|
254026
|
-
function getSandboxWriteFileCommand() {
|
|
254027
|
-
return new Base44Command("write-file").description("Create or overwrite a file in an app's remote sandbox").argument("<path>", "File path relative to the app root").option("--content <content>", "File content (if omitted, read from stdin)").option("--overwrite", "Overwrite the file if it already exists").addHelpText("after", `
|
|
254028
|
-
Examples:
|
|
254029
|
-
$ echo "hello" | base44 sandbox write-file notes.txt
|
|
254030
|
-
$ base44 sandbox write-file notes.txt --content "hello" --overwrite`).action(writeFileAction);
|
|
254031
|
-
}
|
|
254032
|
-
|
|
254033
|
-
// src/cli/commands/sandbox/index.ts
|
|
254034
|
-
function getSandboxCommand() {
|
|
254035
|
-
return new Command("sandbox").description("Develop an app remotely via its server-side sandbox").addCommand(getSandboxListDirectoryCommand()).addCommand(getSandboxReadFileCommand()).addCommand(getSandboxWriteFileCommand()).addCommand(getSandboxEditFileCommand()).addCommand(getSandboxGrepCommand()).addCommand(getSandboxRunCommandCommand()).addCommand(getSandboxReleaseCommand());
|
|
254036
|
-
}
|
|
254037
|
-
|
|
254038
253662
|
// src/cli/commands/secrets/delete.ts
|
|
254039
253663
|
async function deleteSecretAction({ runTask: runTask2 }, key) {
|
|
254040
253664
|
await runTask2(`Deleting secret "${key}"`, async () => {
|
|
@@ -254078,7 +253702,7 @@ function getSecretsListCommand() {
|
|
|
254078
253702
|
}
|
|
254079
253703
|
|
|
254080
253704
|
// src/cli/commands/secrets/set.ts
|
|
254081
|
-
import { resolve as
|
|
253705
|
+
import { resolve as resolve7 } from "node:path";
|
|
254082
253706
|
function parseEntries(entries) {
|
|
254083
253707
|
const secrets = {};
|
|
254084
253708
|
for (const entry of entries) {
|
|
@@ -254109,7 +253733,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
254109
253733
|
validateInput(entries, options);
|
|
254110
253734
|
let secrets;
|
|
254111
253735
|
if (options.envFile) {
|
|
254112
|
-
secrets = await parseEnvFile(
|
|
253736
|
+
secrets = await parseEnvFile(resolve7(options.envFile));
|
|
254113
253737
|
if (Object.keys(secrets).length === 0) {
|
|
254114
253738
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
254115
253739
|
}
|
|
@@ -254138,7 +253762,7 @@ function getSecretsCommand() {
|
|
|
254138
253762
|
}
|
|
254139
253763
|
|
|
254140
253764
|
// src/cli/commands/site/deploy.ts
|
|
254141
|
-
import { resolve as
|
|
253765
|
+
import { resolve as resolve8 } from "node:path";
|
|
254142
253766
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
254143
253767
|
if (isNonInteractive && !options.yes) {
|
|
254144
253768
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -254153,7 +253777,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
254153
253777
|
]
|
|
254154
253778
|
});
|
|
254155
253779
|
}
|
|
254156
|
-
const outputDir =
|
|
253780
|
+
const outputDir = resolve8(project2.root, project2.site.outputDirectory);
|
|
254157
253781
|
if (!options.yes) {
|
|
254158
253782
|
const shouldDeploy = await Re({
|
|
254159
253783
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -254359,14 +253983,14 @@ var getLocalHosts = () => {
|
|
|
254359
253983
|
}
|
|
254360
253984
|
return results;
|
|
254361
253985
|
};
|
|
254362
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253986
|
+
var checkAvailablePort = (options8) => new Promise((resolve10, reject) => {
|
|
254363
253987
|
const server = net.createServer();
|
|
254364
253988
|
server.unref();
|
|
254365
253989
|
server.on("error", reject);
|
|
254366
253990
|
server.listen(options8, () => {
|
|
254367
253991
|
const { port } = server.address();
|
|
254368
253992
|
server.close(() => {
|
|
254369
|
-
|
|
253993
|
+
resolve10(port);
|
|
254370
253994
|
});
|
|
254371
253995
|
});
|
|
254372
253996
|
});
|
|
@@ -254625,7 +254249,7 @@ class FunctionManager {
|
|
|
254625
254249
|
});
|
|
254626
254250
|
}
|
|
254627
254251
|
waitForReady(name2, runningFunc) {
|
|
254628
|
-
return new Promise((
|
|
254252
|
+
return new Promise((resolve10, reject) => {
|
|
254629
254253
|
runningFunc.process.on("exit", (code2) => {
|
|
254630
254254
|
if (!runningFunc.ready) {
|
|
254631
254255
|
clearTimeout(timeout3);
|
|
@@ -254648,7 +254272,7 @@ class FunctionManager {
|
|
|
254648
254272
|
runningFunc.ready = true;
|
|
254649
254273
|
clearTimeout(timeout3);
|
|
254650
254274
|
runningFunc.process.stdout?.off("data", onData);
|
|
254651
|
-
|
|
254275
|
+
resolve10(runningFunc.port);
|
|
254652
254276
|
}
|
|
254653
254277
|
};
|
|
254654
254278
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -255906,15 +255530,15 @@ class ServeRunner {
|
|
|
255906
255530
|
return;
|
|
255907
255531
|
}
|
|
255908
255532
|
this.stopping = true;
|
|
255909
|
-
const exited = new Promise((
|
|
255533
|
+
const exited = new Promise((resolve10) => child.once("exit", () => resolve10()));
|
|
255910
255534
|
if (process21.platform === "win32" && child.pid) {
|
|
255911
255535
|
const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
|
|
255912
255536
|
stdio: "ignore",
|
|
255913
255537
|
windowsHide: true
|
|
255914
255538
|
});
|
|
255915
|
-
await new Promise((
|
|
255916
|
-
taskkill.once("exit", () =>
|
|
255917
|
-
taskkill.once("error", () =>
|
|
255539
|
+
await new Promise((resolve10) => {
|
|
255540
|
+
taskkill.once("exit", () => resolve10());
|
|
255541
|
+
taskkill.once("error", () => resolve10());
|
|
255918
255542
|
});
|
|
255919
255543
|
} else if (child.pid) {
|
|
255920
255544
|
try {
|
|
@@ -256808,7 +256432,7 @@ class NodeFsHandler {
|
|
|
256808
256432
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
256809
256433
|
}
|
|
256810
256434
|
}).on(EV.ERROR, this._boundHandleError);
|
|
256811
|
-
return new Promise((
|
|
256435
|
+
return new Promise((resolve11, reject) => {
|
|
256812
256436
|
if (!stream)
|
|
256813
256437
|
return reject();
|
|
256814
256438
|
stream.once(STR_END, () => {
|
|
@@ -256817,7 +256441,7 @@ class NodeFsHandler {
|
|
|
256817
256441
|
return;
|
|
256818
256442
|
}
|
|
256819
256443
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
256820
|
-
|
|
256444
|
+
resolve11(undefined);
|
|
256821
256445
|
previous.getChildren().filter((item) => {
|
|
256822
256446
|
return item !== directory && !current.has(item);
|
|
256823
256447
|
}).forEach((item) => {
|
|
@@ -257734,7 +257358,7 @@ async function createDevServer(options8) {
|
|
|
257734
257358
|
}
|
|
257735
257359
|
remoteProxy(req, res, next);
|
|
257736
257360
|
});
|
|
257737
|
-
const server = await new Promise((
|
|
257361
|
+
const server = await new Promise((resolve12, reject) => {
|
|
257738
257362
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
257739
257363
|
if (err) {
|
|
257740
257364
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -257743,7 +257367,7 @@ async function createDevServer(options8) {
|
|
|
257743
257367
|
reject(err);
|
|
257744
257368
|
}
|
|
257745
257369
|
} else {
|
|
257746
|
-
|
|
257370
|
+
resolve12(s5);
|
|
257747
257371
|
}
|
|
257748
257372
|
});
|
|
257749
257373
|
});
|
|
@@ -257806,13 +257430,13 @@ async function createDevServer(options8) {
|
|
|
257806
257430
|
if (!server.listening) {
|
|
257807
257431
|
return;
|
|
257808
257432
|
}
|
|
257809
|
-
await new Promise((
|
|
257433
|
+
await new Promise((resolve12, reject) => {
|
|
257810
257434
|
server.close((error48) => {
|
|
257811
257435
|
if (error48) {
|
|
257812
257436
|
reject(error48);
|
|
257813
257437
|
return;
|
|
257814
257438
|
}
|
|
257815
|
-
|
|
257439
|
+
resolve12();
|
|
257816
257440
|
});
|
|
257817
257441
|
});
|
|
257818
257442
|
};
|
|
@@ -257921,13 +257545,13 @@ async function runScript(options8) {
|
|
|
257921
257545
|
}
|
|
257922
257546
|
// src/cli/commands/exec.ts
|
|
257923
257547
|
function readStdin2() {
|
|
257924
|
-
return new Promise((
|
|
257548
|
+
return new Promise((resolve12, reject) => {
|
|
257925
257549
|
let data = "";
|
|
257926
257550
|
process.stdin.setEncoding("utf-8");
|
|
257927
257551
|
process.stdin.on("data", (chunk) => {
|
|
257928
257552
|
data += chunk;
|
|
257929
257553
|
});
|
|
257930
|
-
process.stdin.on("end", () =>
|
|
257554
|
+
process.stdin.on("end", () => resolve12(data));
|
|
257931
257555
|
process.stdin.on("error", reject);
|
|
257932
257556
|
});
|
|
257933
257557
|
}
|
|
@@ -257969,7 +257593,7 @@ Examples:
|
|
|
257969
257593
|
}
|
|
257970
257594
|
|
|
257971
257595
|
// src/cli/commands/project/eject.ts
|
|
257972
|
-
import { resolve as
|
|
257596
|
+
import { resolve as resolve12 } from "node:path";
|
|
257973
257597
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
257974
257598
|
async function eject(ctx, options8, command2) {
|
|
257975
257599
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -258033,7 +257657,7 @@ async function eject(ctx, options8, command2) {
|
|
|
258033
257657
|
Ne("Operation cancelled.");
|
|
258034
257658
|
throw new CLIExitError(0);
|
|
258035
257659
|
}
|
|
258036
|
-
const resolvedPath =
|
|
257660
|
+
const resolvedPath = resolve12(selectedPath);
|
|
258037
257661
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
258038
257662
|
await createProjectFilesForExistingProject({
|
|
258039
257663
|
projectId,
|
|
@@ -258103,7 +257727,6 @@ function createProgram(context) {
|
|
|
258103
257727
|
program2.addCommand(getConnectorsCommand());
|
|
258104
257728
|
program2.addCommand(getFunctionsCommand());
|
|
258105
257729
|
program2.addCommand(getSecretsCommand());
|
|
258106
|
-
program2.addCommand(getSandboxCommand());
|
|
258107
257730
|
program2.addCommand(getAuthCommand());
|
|
258108
257731
|
program2.addCommand(getSiteCommand());
|
|
258109
257732
|
program2.addCommand(getTypesCommand());
|
|
@@ -260405,14 +260028,14 @@ async function addSourceContext(frames) {
|
|
|
260405
260028
|
return frames;
|
|
260406
260029
|
}
|
|
260407
260030
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
260408
|
-
return new Promise((
|
|
260031
|
+
return new Promise((resolve13) => {
|
|
260409
260032
|
const stream = createReadStream2(path19);
|
|
260410
260033
|
const lineReaded = createInterface2({
|
|
260411
260034
|
input: stream
|
|
260412
260035
|
});
|
|
260413
260036
|
function destroyStreamAndResolve() {
|
|
260414
260037
|
stream.destroy();
|
|
260415
|
-
|
|
260038
|
+
resolve13();
|
|
260416
260039
|
}
|
|
260417
260040
|
let lineNumber = 0;
|
|
260418
260041
|
let currentRangeIndex = 0;
|
|
@@ -261524,15 +261147,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
261524
261147
|
return true;
|
|
261525
261148
|
if (this.featureFlagsPoller === undefined)
|
|
261526
261149
|
return false;
|
|
261527
|
-
return new Promise((
|
|
261150
|
+
return new Promise((resolve13) => {
|
|
261528
261151
|
const timeout3 = setTimeout(() => {
|
|
261529
261152
|
cleanup();
|
|
261530
|
-
|
|
261153
|
+
resolve13(false);
|
|
261531
261154
|
}, timeoutMs);
|
|
261532
261155
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
261533
261156
|
clearTimeout(timeout3);
|
|
261534
261157
|
cleanup();
|
|
261535
|
-
|
|
261158
|
+
resolve13(count2 > 0);
|
|
261536
261159
|
});
|
|
261537
261160
|
});
|
|
261538
261161
|
}
|
|
@@ -262355,4 +261978,4 @@ export {
|
|
|
262355
261978
|
CLIExitError
|
|
262356
261979
|
};
|
|
262357
261980
|
|
|
262358
|
-
//# debugId=
|
|
261981
|
+
//# debugId=FA0D67C1B29AA28264756E2164756E21
|