@base44-preview/cli 0.0.56-pr.547.f5a339a → 0.0.56-pr.550.7e7ee9d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js
CHANGED
|
@@ -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
|
});
|
|
@@ -233809,6 +233809,9 @@ class ApiError extends SystemError {
|
|
|
233809
233809
|
}
|
|
233810
233810
|
];
|
|
233811
233811
|
}
|
|
233812
|
+
if (statusCode && statusCode < 500) {
|
|
233813
|
+
return [];
|
|
233814
|
+
}
|
|
233812
233815
|
return [{ message: "Check your network connection and try again" }];
|
|
233813
233816
|
}
|
|
233814
233817
|
static getReasonHints(parsedResponse) {
|
|
@@ -236012,11 +236015,13 @@ var PluginMetadataSchema = exports_external.object({
|
|
|
236012
236015
|
var PluginReferenceSchema = exports_external.object({
|
|
236013
236016
|
source: exports_external.string().min(1, "Plugin source cannot be empty")
|
|
236014
236017
|
});
|
|
236018
|
+
var VISIBILITY_LEVELS = ["public", "private", "workspace"];
|
|
236015
236019
|
var ProjectConfigSchema = exports_external.object({
|
|
236016
236020
|
name: exports_external.string({
|
|
236017
236021
|
error: "App name cannot be empty"
|
|
236018
236022
|
}).min(1, "App name cannot be empty"),
|
|
236019
236023
|
description: exports_external.string().optional(),
|
|
236024
|
+
visibility: exports_external.enum(VISIBILITY_LEVELS).optional(),
|
|
236020
236025
|
site: SiteConfigSchema.optional(),
|
|
236021
236026
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
236022
236027
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
@@ -244101,6 +244106,30 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
244101
244106
|
// src/core/project/deploy.ts
|
|
244102
244107
|
import { resolve as resolve2 } from "node:path";
|
|
244103
244108
|
|
|
244109
|
+
// src/core/project/visibility.ts
|
|
244110
|
+
var PUBLIC_SETTINGS = {
|
|
244111
|
+
public: "public_without_login",
|
|
244112
|
+
private: "private_with_login",
|
|
244113
|
+
workspace: "workspace_with_login"
|
|
244114
|
+
};
|
|
244115
|
+
async function setAppVisibility(visibility) {
|
|
244116
|
+
const { id } = getAppContext();
|
|
244117
|
+
try {
|
|
244118
|
+
await base44Client.put(`api/apps/${id}`, {
|
|
244119
|
+
json: { public_settings: PUBLIC_SETTINGS[visibility] }
|
|
244120
|
+
});
|
|
244121
|
+
} catch (error48) {
|
|
244122
|
+
throw await ApiError.fromHttpError(error48, "updating app visibility");
|
|
244123
|
+
}
|
|
244124
|
+
}
|
|
244125
|
+
async function writeVisibilityToConfig(configPath, visibility) {
|
|
244126
|
+
const text = await readTextFile(configPath);
|
|
244127
|
+
const existing = /("visibility"\s*:\s*")(?:public|private|workspace)(")/;
|
|
244128
|
+
const next = existing.test(text) ? text.replace(existing, `$1${visibility}$2`) : text.replace("{", `{
|
|
244129
|
+
"visibility": "${visibility}",`);
|
|
244130
|
+
await writeFile(configPath, next);
|
|
244131
|
+
}
|
|
244132
|
+
|
|
244104
244133
|
// src/core/site/api.ts
|
|
244105
244134
|
async function uploadSite(archivePath) {
|
|
244106
244135
|
const archiveBuffer = await readFile(archivePath);
|
|
@@ -244175,10 +244204,14 @@ function hasResourcesToDeploy(projectData) {
|
|
|
244175
244204
|
const hasAgents = agents.length > 0;
|
|
244176
244205
|
const hasConnectors = connectors.length > 0;
|
|
244177
244206
|
const hasAuthConfig = authConfig.length > 0;
|
|
244178
|
-
|
|
244207
|
+
const hasVisibility = Boolean(project.visibility);
|
|
244208
|
+
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasVisibility || hasSite;
|
|
244179
244209
|
}
|
|
244180
244210
|
async function deployAll(projectData, options) {
|
|
244181
244211
|
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244212
|
+
if (project.visibility) {
|
|
244213
|
+
await setAppVisibility(project.visibility);
|
|
244214
|
+
}
|
|
244182
244215
|
await entityResource.push(entities);
|
|
244183
244216
|
await deployFunctionsSequentially(functions, {
|
|
244184
244217
|
onStart: options?.onFunctionStart,
|
|
@@ -244260,11 +244293,6 @@ function getAppClient() {
|
|
|
244260
244293
|
prefixUrl: new URL(`/api/apps/${id}/`, getBase44ApiUrl()).href
|
|
244261
244294
|
});
|
|
244262
244295
|
}
|
|
244263
|
-
function getSandboxClient(appId) {
|
|
244264
|
-
return base44Client.extend({
|
|
244265
|
-
prefixUrl: new URL(`/api/apps/${appId}/sandbox-bridge/`, getBase44ApiUrl()).href
|
|
244266
|
-
});
|
|
244267
|
-
}
|
|
244268
244296
|
// src/core/clients/oauth-client.ts
|
|
244269
244297
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
244270
244298
|
var oauthClient = distribution_default.create({
|
|
@@ -244285,7 +244313,7 @@ async function generateDeviceCode() {
|
|
|
244285
244313
|
const response = await oauthClient.post("oauth/device/code", {
|
|
244286
244314
|
json: {
|
|
244287
244315
|
client_id: AUTH_CLIENT_ID,
|
|
244288
|
-
scope: "apps:read apps:write
|
|
244316
|
+
scope: "apps:read apps:write"
|
|
244289
244317
|
},
|
|
244290
244318
|
throwHttpErrors: false
|
|
244291
244319
|
});
|
|
@@ -251200,7 +251228,7 @@ function createSimpleRunTask(log) {
|
|
|
251200
251228
|
};
|
|
251201
251229
|
}
|
|
251202
251230
|
// src/cli/utils/stdin.ts
|
|
251203
|
-
async function readStdin(flagName = "--stdin"
|
|
251231
|
+
async function readStdin(flagName = "--stdin") {
|
|
251204
251232
|
if (process.stdin.isTTY) {
|
|
251205
251233
|
throw new InvalidInputError(`${flagName} requires piped input (e.g., echo <value> | base44 ...)`);
|
|
251206
251234
|
}
|
|
@@ -251208,8 +251236,7 @@ async function readStdin(flagName = "--stdin", options = {}) {
|
|
|
251208
251236
|
for await (const chunk of process.stdin) {
|
|
251209
251237
|
chunks.push(chunk);
|
|
251210
251238
|
}
|
|
251211
|
-
|
|
251212
|
-
return options.trim === false ? text : text.trim();
|
|
251239
|
+
return Buffer.concat(chunks).toString("utf-8").trim();
|
|
251213
251240
|
}
|
|
251214
251241
|
|
|
251215
251242
|
// src/cli/utils/secret-input.ts
|
|
@@ -251835,6 +251862,73 @@ function getWhoamiCommand() {
|
|
|
251835
251862
|
return new Base44Command("whoami", { requireAppContext: false }).description("Display current authenticated user").action(whoami);
|
|
251836
251863
|
}
|
|
251837
251864
|
|
|
251865
|
+
// src/cli/commands/connectors/list-available.ts
|
|
251866
|
+
async function listAvailableAction({
|
|
251867
|
+
log,
|
|
251868
|
+
runTask: runTask2
|
|
251869
|
+
}) {
|
|
251870
|
+
const { integrations } = await runTask2("Fetching available integrations from Base44", async () => {
|
|
251871
|
+
return await listAvailableIntegrations();
|
|
251872
|
+
}, {
|
|
251873
|
+
successMessage: "Available integrations fetched successfully",
|
|
251874
|
+
errorMessage: "Failed to fetch available integrations"
|
|
251875
|
+
});
|
|
251876
|
+
if (integrations.length === 0) {
|
|
251877
|
+
return { outroMessage: "No available integrations found." };
|
|
251878
|
+
}
|
|
251879
|
+
for (const { displayName, ...rest } of integrations) {
|
|
251880
|
+
const yaml2 = formatYaml(rest);
|
|
251881
|
+
const pad = " ".repeat(YAML_INDENT);
|
|
251882
|
+
log.info(`${displayName}
|
|
251883
|
+
${pad}${yaml2.replace(/\n/g, `
|
|
251884
|
+
${pad}`)}`);
|
|
251885
|
+
}
|
|
251886
|
+
return {
|
|
251887
|
+
outroMessage: `Found ${integrations.length} available integrations.`
|
|
251888
|
+
};
|
|
251889
|
+
}
|
|
251890
|
+
function getConnectorsListAvailableCommand() {
|
|
251891
|
+
return new Base44Command("list-available").description("List all available integration types").action(listAvailableAction);
|
|
251892
|
+
}
|
|
251893
|
+
|
|
251894
|
+
// src/cli/commands/connectors/pull.ts
|
|
251895
|
+
import { dirname as dirname15, join as join19 } from "node:path";
|
|
251896
|
+
async function pullConnectorsAction({
|
|
251897
|
+
log,
|
|
251898
|
+
runTask: runTask2
|
|
251899
|
+
}) {
|
|
251900
|
+
const { project: project2 } = await readProjectConfig();
|
|
251901
|
+
const configDir = dirname15(project2.configPath);
|
|
251902
|
+
const connectorsDir = join19(configDir, project2.connectorsDir);
|
|
251903
|
+
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
251904
|
+
return await pullAllConnectors();
|
|
251905
|
+
}, {
|
|
251906
|
+
successMessage: "Connectors fetched successfully",
|
|
251907
|
+
errorMessage: "Failed to fetch connectors"
|
|
251908
|
+
});
|
|
251909
|
+
const { written, deleted } = await runTask2("Syncing connector files", async () => {
|
|
251910
|
+
return await writeConnectors(connectorsDir, remoteConnectors);
|
|
251911
|
+
}, {
|
|
251912
|
+
successMessage: "Connector files synced successfully",
|
|
251913
|
+
errorMessage: "Failed to sync connector files"
|
|
251914
|
+
});
|
|
251915
|
+
if (written.length > 0) {
|
|
251916
|
+
log.success(`Written: ${written.join(", ")}`);
|
|
251917
|
+
}
|
|
251918
|
+
if (deleted.length > 0) {
|
|
251919
|
+
log.warn(`Deleted: ${deleted.join(", ")}`);
|
|
251920
|
+
}
|
|
251921
|
+
if (written.length === 0 && deleted.length === 0) {
|
|
251922
|
+
log.info("All connectors are already up to date");
|
|
251923
|
+
}
|
|
251924
|
+
return {
|
|
251925
|
+
outroMessage: `Pulled ${remoteConnectors.length} connectors to ${connectorsDir}`
|
|
251926
|
+
};
|
|
251927
|
+
}
|
|
251928
|
+
function getConnectorsPullCommand() {
|
|
251929
|
+
return new Base44Command("pull").description("Pull connectors from Base44 to local files (replaces all local connector configs)").action(pullConnectorsAction);
|
|
251930
|
+
}
|
|
251931
|
+
|
|
251838
251932
|
// ../../node_modules/open/index.js
|
|
251839
251933
|
import process20 from "node:process";
|
|
251840
251934
|
import path16 from "node:path";
|
|
@@ -252525,138 +252619,7 @@ async function promptOAuthFlows(pending, log, options) {
|
|
|
252525
252619
|
return outcomes;
|
|
252526
252620
|
}
|
|
252527
252621
|
|
|
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
252622
|
// 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
252623
|
function printSummary(results, oauthOutcomes, log) {
|
|
252661
252624
|
const synced = [];
|
|
252662
252625
|
const added = [];
|
|
@@ -252719,8 +252682,12 @@ function printSummary(results, oauthOutcomes, log) {
|
|
|
252719
252682
|
log.error(`Failed: ${r.type} - ${r.error}`);
|
|
252720
252683
|
}
|
|
252721
252684
|
}
|
|
252722
|
-
async function pushConnectorsAction({
|
|
252723
|
-
|
|
252685
|
+
async function pushConnectorsAction({
|
|
252686
|
+
isNonInteractive,
|
|
252687
|
+
log,
|
|
252688
|
+
runTask: runTask2
|
|
252689
|
+
}) {
|
|
252690
|
+
const { connectors } = await readProjectConfig();
|
|
252724
252691
|
if (connectors.length === 0) {
|
|
252725
252692
|
log.info("No local connectors found - checking for remote connectors to remove");
|
|
252726
252693
|
} else {
|
|
@@ -252743,12 +252710,12 @@ async function pushConnectorsAction({ isNonInteractive, log, runTask: runTask2 }
|
|
|
252743
252710
|
return { outroMessage };
|
|
252744
252711
|
}
|
|
252745
252712
|
function getConnectorsPushCommand() {
|
|
252746
|
-
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").
|
|
252713
|
+
return new Base44Command("push").description("Push local connectors to Base44 (overwrites connectors on Base44)").action(pushConnectorsAction);
|
|
252747
252714
|
}
|
|
252748
252715
|
|
|
252749
252716
|
// src/cli/commands/connectors/index.ts
|
|
252750
252717
|
function getConnectorsCommand() {
|
|
252751
|
-
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(
|
|
252718
|
+
return new Command("connectors").description("Manage project connectors (OAuth integrations)").addCommand(getConnectorsListAvailableCommand()).addCommand(getConnectorsPullCommand()).addCommand(getConnectorsPushCommand());
|
|
252752
252719
|
}
|
|
252753
252720
|
|
|
252754
252721
|
// src/cli/commands/dashboard/open.ts
|
|
@@ -253055,7 +253022,7 @@ function getFunctionsCommand() {
|
|
|
253055
253022
|
}
|
|
253056
253023
|
|
|
253057
253024
|
// src/cli/commands/project/create.ts
|
|
253058
|
-
import { basename as basename4, resolve as
|
|
253025
|
+
import { basename as basename4, resolve as resolve5 } from "node:path";
|
|
253059
253026
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
253060
253027
|
|
|
253061
253028
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -253209,7 +253176,7 @@ async function createInteractive(options, ctx) {
|
|
|
253209
253176
|
}, ctx);
|
|
253210
253177
|
}
|
|
253211
253178
|
async function createNonInteractive(options, ctx) {
|
|
253212
|
-
ctx.log.info(`Creating a new project at ${
|
|
253179
|
+
ctx.log.info(`Creating a new project at ${resolve5(options.path)}`);
|
|
253213
253180
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
253214
253181
|
return await executeCreate({
|
|
253215
253182
|
template: template2,
|
|
@@ -253231,7 +253198,7 @@ async function executeCreate({
|
|
|
253231
253198
|
}, ctx) {
|
|
253232
253199
|
const { log, runTask: runTask2 } = ctx;
|
|
253233
253200
|
const name2 = rawName.trim();
|
|
253234
|
-
const resolvedPath =
|
|
253201
|
+
const resolvedPath = resolve5(projectPath);
|
|
253235
253202
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
253236
253203
|
return await createProjectFiles({
|
|
253237
253204
|
name: name2,
|
|
@@ -253306,6 +253273,9 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
253306
253273
|
if (authConfig.length > 0) {
|
|
253307
253274
|
summaryLines.push(" - Auth config");
|
|
253308
253275
|
}
|
|
253276
|
+
if (project2.visibility) {
|
|
253277
|
+
summaryLines.push(` - Visibility: ${project2.visibility}`);
|
|
253278
|
+
}
|
|
253309
253279
|
if (project2.site?.outputDirectory) {
|
|
253310
253280
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
253311
253281
|
}
|
|
@@ -253672,7 +253642,7 @@ function getLogsCommand() {
|
|
|
253672
253642
|
}
|
|
253673
253643
|
|
|
253674
253644
|
// src/cli/commands/project/scaffold.ts
|
|
253675
|
-
import { basename as basename5, resolve as
|
|
253645
|
+
import { basename as basename5, resolve as resolve6 } from "node:path";
|
|
253676
253646
|
function resolveAppId(options) {
|
|
253677
253647
|
const appId = options.appId;
|
|
253678
253648
|
if (!appId) {
|
|
@@ -253688,7 +253658,7 @@ function resolveAppId(options) {
|
|
|
253688
253658
|
async function scaffoldAction(ctx, name2, options, command2) {
|
|
253689
253659
|
const { log, runTask: runTask2 } = ctx;
|
|
253690
253660
|
const appId = resolveAppId(command2.optsWithGlobals());
|
|
253691
|
-
const resolvedPath =
|
|
253661
|
+
const resolvedPath = resolve6("./");
|
|
253692
253662
|
const projectName = (name2 ?? basename5(resolvedPath)).trim();
|
|
253693
253663
|
const template2 = await getTemplateById("backend-only");
|
|
253694
253664
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
@@ -253725,314 +253695,18 @@ Examples:
|
|
|
253725
253695
|
$ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
|
|
253726
253696
|
}
|
|
253727
253697
|
|
|
253728
|
-
// src/
|
|
253729
|
-
|
|
253730
|
-
|
|
253731
|
-
|
|
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));
|
|
253698
|
+
// src/cli/commands/project/visibility.ts
|
|
253699
|
+
async function visibilityAction({ runTask: runTask2 }, level) {
|
|
253700
|
+
const { project: project2 } = await readProjectConfig();
|
|
253701
|
+
await runTask2("Updating local config", () => writeVisibilityToConfig(project2.configPath, level));
|
|
253995
253702
|
return {
|
|
253996
|
-
outroMessage:
|
|
253997
|
-
stdout: toJsonStdout(result)
|
|
253703
|
+
outroMessage: `Visibility set to ${level} in local config. Run \`base44 deploy\` to apply.`
|
|
253998
253704
|
};
|
|
253999
253705
|
}
|
|
254000
|
-
function
|
|
254001
|
-
return new Base44Command("
|
|
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());
|
|
253706
|
+
function getVisibilityCommand() {
|
|
253707
|
+
return new Base44Command("visibility").description("Set app visibility (public, private, or workspace)").addArgument(new Argument("<level>", "Visibility level").choices([
|
|
253708
|
+
...VISIBILITY_LEVELS
|
|
253709
|
+
])).action(visibilityAction);
|
|
254036
253710
|
}
|
|
254037
253711
|
|
|
254038
253712
|
// src/cli/commands/secrets/delete.ts
|
|
@@ -254078,7 +253752,7 @@ function getSecretsListCommand() {
|
|
|
254078
253752
|
}
|
|
254079
253753
|
|
|
254080
253754
|
// src/cli/commands/secrets/set.ts
|
|
254081
|
-
import { resolve as
|
|
253755
|
+
import { resolve as resolve7 } from "node:path";
|
|
254082
253756
|
function parseEntries(entries) {
|
|
254083
253757
|
const secrets = {};
|
|
254084
253758
|
for (const entry of entries) {
|
|
@@ -254109,7 +253783,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
254109
253783
|
validateInput(entries, options);
|
|
254110
253784
|
let secrets;
|
|
254111
253785
|
if (options.envFile) {
|
|
254112
|
-
secrets = await parseEnvFile(
|
|
253786
|
+
secrets = await parseEnvFile(resolve7(options.envFile));
|
|
254113
253787
|
if (Object.keys(secrets).length === 0) {
|
|
254114
253788
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
254115
253789
|
}
|
|
@@ -254138,7 +253812,7 @@ function getSecretsCommand() {
|
|
|
254138
253812
|
}
|
|
254139
253813
|
|
|
254140
253814
|
// src/cli/commands/site/deploy.ts
|
|
254141
|
-
import { resolve as
|
|
253815
|
+
import { resolve as resolve8 } from "node:path";
|
|
254142
253816
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
254143
253817
|
if (isNonInteractive && !options.yes) {
|
|
254144
253818
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -254153,7 +253827,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
254153
253827
|
]
|
|
254154
253828
|
});
|
|
254155
253829
|
}
|
|
254156
|
-
const outputDir =
|
|
253830
|
+
const outputDir = resolve8(project2.root, project2.site.outputDirectory);
|
|
254157
253831
|
if (!options.yes) {
|
|
254158
253832
|
const shouldDeploy = await Re({
|
|
254159
253833
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -254359,14 +254033,14 @@ var getLocalHosts = () => {
|
|
|
254359
254033
|
}
|
|
254360
254034
|
return results;
|
|
254361
254035
|
};
|
|
254362
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
254036
|
+
var checkAvailablePort = (options8) => new Promise((resolve10, reject) => {
|
|
254363
254037
|
const server = net.createServer();
|
|
254364
254038
|
server.unref();
|
|
254365
254039
|
server.on("error", reject);
|
|
254366
254040
|
server.listen(options8, () => {
|
|
254367
254041
|
const { port } = server.address();
|
|
254368
254042
|
server.close(() => {
|
|
254369
|
-
|
|
254043
|
+
resolve10(port);
|
|
254370
254044
|
});
|
|
254371
254045
|
});
|
|
254372
254046
|
});
|
|
@@ -254625,7 +254299,7 @@ class FunctionManager {
|
|
|
254625
254299
|
});
|
|
254626
254300
|
}
|
|
254627
254301
|
waitForReady(name2, runningFunc) {
|
|
254628
|
-
return new Promise((
|
|
254302
|
+
return new Promise((resolve10, reject) => {
|
|
254629
254303
|
runningFunc.process.on("exit", (code2) => {
|
|
254630
254304
|
if (!runningFunc.ready) {
|
|
254631
254305
|
clearTimeout(timeout3);
|
|
@@ -254648,7 +254322,7 @@ class FunctionManager {
|
|
|
254648
254322
|
runningFunc.ready = true;
|
|
254649
254323
|
clearTimeout(timeout3);
|
|
254650
254324
|
runningFunc.process.stdout?.off("data", onData);
|
|
254651
|
-
|
|
254325
|
+
resolve10(runningFunc.port);
|
|
254652
254326
|
}
|
|
254653
254327
|
};
|
|
254654
254328
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -255906,15 +255580,15 @@ class ServeRunner {
|
|
|
255906
255580
|
return;
|
|
255907
255581
|
}
|
|
255908
255582
|
this.stopping = true;
|
|
255909
|
-
const exited = new Promise((
|
|
255583
|
+
const exited = new Promise((resolve10) => child.once("exit", () => resolve10()));
|
|
255910
255584
|
if (process21.platform === "win32" && child.pid) {
|
|
255911
255585
|
const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
|
|
255912
255586
|
stdio: "ignore",
|
|
255913
255587
|
windowsHide: true
|
|
255914
255588
|
});
|
|
255915
|
-
await new Promise((
|
|
255916
|
-
taskkill.once("exit", () =>
|
|
255917
|
-
taskkill.once("error", () =>
|
|
255589
|
+
await new Promise((resolve10) => {
|
|
255590
|
+
taskkill.once("exit", () => resolve10());
|
|
255591
|
+
taskkill.once("error", () => resolve10());
|
|
255918
255592
|
});
|
|
255919
255593
|
} else if (child.pid) {
|
|
255920
255594
|
try {
|
|
@@ -256808,7 +256482,7 @@ class NodeFsHandler {
|
|
|
256808
256482
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
256809
256483
|
}
|
|
256810
256484
|
}).on(EV.ERROR, this._boundHandleError);
|
|
256811
|
-
return new Promise((
|
|
256485
|
+
return new Promise((resolve11, reject) => {
|
|
256812
256486
|
if (!stream)
|
|
256813
256487
|
return reject();
|
|
256814
256488
|
stream.once(STR_END, () => {
|
|
@@ -256817,7 +256491,7 @@ class NodeFsHandler {
|
|
|
256817
256491
|
return;
|
|
256818
256492
|
}
|
|
256819
256493
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
256820
|
-
|
|
256494
|
+
resolve11(undefined);
|
|
256821
256495
|
previous.getChildren().filter((item) => {
|
|
256822
256496
|
return item !== directory && !current.has(item);
|
|
256823
256497
|
}).forEach((item) => {
|
|
@@ -257734,7 +257408,7 @@ async function createDevServer(options8) {
|
|
|
257734
257408
|
}
|
|
257735
257409
|
remoteProxy(req, res, next);
|
|
257736
257410
|
});
|
|
257737
|
-
const server = await new Promise((
|
|
257411
|
+
const server = await new Promise((resolve12, reject) => {
|
|
257738
257412
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
257739
257413
|
if (err) {
|
|
257740
257414
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -257743,7 +257417,7 @@ async function createDevServer(options8) {
|
|
|
257743
257417
|
reject(err);
|
|
257744
257418
|
}
|
|
257745
257419
|
} else {
|
|
257746
|
-
|
|
257420
|
+
resolve12(s5);
|
|
257747
257421
|
}
|
|
257748
257422
|
});
|
|
257749
257423
|
});
|
|
@@ -257806,13 +257480,13 @@ async function createDevServer(options8) {
|
|
|
257806
257480
|
if (!server.listening) {
|
|
257807
257481
|
return;
|
|
257808
257482
|
}
|
|
257809
|
-
await new Promise((
|
|
257483
|
+
await new Promise((resolve12, reject) => {
|
|
257810
257484
|
server.close((error48) => {
|
|
257811
257485
|
if (error48) {
|
|
257812
257486
|
reject(error48);
|
|
257813
257487
|
return;
|
|
257814
257488
|
}
|
|
257815
|
-
|
|
257489
|
+
resolve12();
|
|
257816
257490
|
});
|
|
257817
257491
|
});
|
|
257818
257492
|
};
|
|
@@ -257921,13 +257595,13 @@ async function runScript(options8) {
|
|
|
257921
257595
|
}
|
|
257922
257596
|
// src/cli/commands/exec.ts
|
|
257923
257597
|
function readStdin2() {
|
|
257924
|
-
return new Promise((
|
|
257598
|
+
return new Promise((resolve12, reject) => {
|
|
257925
257599
|
let data = "";
|
|
257926
257600
|
process.stdin.setEncoding("utf-8");
|
|
257927
257601
|
process.stdin.on("data", (chunk) => {
|
|
257928
257602
|
data += chunk;
|
|
257929
257603
|
});
|
|
257930
|
-
process.stdin.on("end", () =>
|
|
257604
|
+
process.stdin.on("end", () => resolve12(data));
|
|
257931
257605
|
process.stdin.on("error", reject);
|
|
257932
257606
|
});
|
|
257933
257607
|
}
|
|
@@ -257969,7 +257643,7 @@ Examples:
|
|
|
257969
257643
|
}
|
|
257970
257644
|
|
|
257971
257645
|
// src/cli/commands/project/eject.ts
|
|
257972
|
-
import { resolve as
|
|
257646
|
+
import { resolve as resolve12 } from "node:path";
|
|
257973
257647
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
257974
257648
|
async function eject(ctx, options8, command2) {
|
|
257975
257649
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -258033,7 +257707,7 @@ async function eject(ctx, options8, command2) {
|
|
|
258033
257707
|
Ne("Operation cancelled.");
|
|
258034
257708
|
throw new CLIExitError(0);
|
|
258035
257709
|
}
|
|
258036
|
-
const resolvedPath =
|
|
257710
|
+
const resolvedPath = resolve12(selectedPath);
|
|
258037
257711
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
258038
257712
|
await createProjectFilesForExistingProject({
|
|
258039
257713
|
projectId,
|
|
@@ -258096,6 +257770,7 @@ function createProgram(context) {
|
|
|
258096
257770
|
program2.addCommand(getScaffoldCommand());
|
|
258097
257771
|
program2.addCommand(getDashboardCommand());
|
|
258098
257772
|
program2.addCommand(getDeployCommand2());
|
|
257773
|
+
program2.addCommand(getVisibilityCommand());
|
|
258099
257774
|
program2.addCommand(getLinkCommand());
|
|
258100
257775
|
program2.addCommand(getEjectCommand());
|
|
258101
257776
|
program2.addCommand(getEntitiesPushCommand());
|
|
@@ -258103,7 +257778,6 @@ function createProgram(context) {
|
|
|
258103
257778
|
program2.addCommand(getConnectorsCommand());
|
|
258104
257779
|
program2.addCommand(getFunctionsCommand());
|
|
258105
257780
|
program2.addCommand(getSecretsCommand());
|
|
258106
|
-
program2.addCommand(getSandboxCommand());
|
|
258107
257781
|
program2.addCommand(getAuthCommand());
|
|
258108
257782
|
program2.addCommand(getSiteCommand());
|
|
258109
257783
|
program2.addCommand(getTypesCommand());
|
|
@@ -260405,14 +260079,14 @@ async function addSourceContext(frames) {
|
|
|
260405
260079
|
return frames;
|
|
260406
260080
|
}
|
|
260407
260081
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
260408
|
-
return new Promise((
|
|
260082
|
+
return new Promise((resolve13) => {
|
|
260409
260083
|
const stream = createReadStream2(path19);
|
|
260410
260084
|
const lineReaded = createInterface2({
|
|
260411
260085
|
input: stream
|
|
260412
260086
|
});
|
|
260413
260087
|
function destroyStreamAndResolve() {
|
|
260414
260088
|
stream.destroy();
|
|
260415
|
-
|
|
260089
|
+
resolve13();
|
|
260416
260090
|
}
|
|
260417
260091
|
let lineNumber = 0;
|
|
260418
260092
|
let currentRangeIndex = 0;
|
|
@@ -261524,15 +261198,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
261524
261198
|
return true;
|
|
261525
261199
|
if (this.featureFlagsPoller === undefined)
|
|
261526
261200
|
return false;
|
|
261527
|
-
return new Promise((
|
|
261201
|
+
return new Promise((resolve13) => {
|
|
261528
261202
|
const timeout3 = setTimeout(() => {
|
|
261529
261203
|
cleanup();
|
|
261530
|
-
|
|
261204
|
+
resolve13(false);
|
|
261531
261205
|
}, timeoutMs);
|
|
261532
261206
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
261533
261207
|
clearTimeout(timeout3);
|
|
261534
261208
|
cleanup();
|
|
261535
|
-
|
|
261209
|
+
resolve13(count2 > 0);
|
|
261536
261210
|
});
|
|
261537
261211
|
});
|
|
261538
261212
|
}
|
|
@@ -262355,4 +262029,4 @@ export {
|
|
|
262355
262029
|
CLIExitError
|
|
262356
262030
|
};
|
|
262357
262031
|
|
|
262358
|
-
//# debugId=
|
|
262032
|
+
//# debugId=25CD73953FB041AA64756E2164756E21
|