@base44-preview/cli 0.1.2-pr.563.d0deef5 → 0.1.3-pr.550.44b16f9
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
|
@@ -12980,11 +12980,11 @@ var require_ejs = __commonJS((exports) => {
|
|
|
12980
12980
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
12981
12981
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
12982
12982
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
12983
|
-
var
|
|
12984
|
-
var
|
|
12985
|
-
var
|
|
12986
|
-
var includePath =
|
|
12987
|
-
var ext =
|
|
12983
|
+
var dirname9 = path11.dirname;
|
|
12984
|
+
var extname = path11.extname;
|
|
12985
|
+
var resolve2 = path11.resolve;
|
|
12986
|
+
var includePath = resolve2(isDir ? filename : dirname9(filename), name2);
|
|
12987
|
+
var ext = extname(name2);
|
|
12988
12988
|
if (!ext) {
|
|
12989
12989
|
includePath += ".ejs";
|
|
12990
12990
|
}
|
|
@@ -13058,10 +13058,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
13058
13058
|
var result;
|
|
13059
13059
|
if (!cb) {
|
|
13060
13060
|
if (typeof exports.promiseImpl == "function") {
|
|
13061
|
-
return new exports.promiseImpl(function(
|
|
13061
|
+
return new exports.promiseImpl(function(resolve2, reject) {
|
|
13062
13062
|
try {
|
|
13063
13063
|
result = handleCache(options)(data);
|
|
13064
|
-
|
|
13064
|
+
resolve2(result);
|
|
13065
13065
|
} catch (err) {
|
|
13066
13066
|
reject(err);
|
|
13067
13067
|
}
|
|
@@ -16499,12 +16499,12 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
16499
16499
|
if (typeof Promise !== "function") {
|
|
16500
16500
|
throw new TypeError("callback not provided");
|
|
16501
16501
|
}
|
|
16502
|
-
return new Promise(function(
|
|
16502
|
+
return new Promise(function(resolve3, reject) {
|
|
16503
16503
|
isexe(path11, options || {}, function(er, is) {
|
|
16504
16504
|
if (er) {
|
|
16505
16505
|
reject(er);
|
|
16506
16506
|
} else {
|
|
16507
|
-
|
|
16507
|
+
resolve3(is);
|
|
16508
16508
|
}
|
|
16509
16509
|
});
|
|
16510
16510
|
});
|
|
@@ -16566,27 +16566,27 @@ var require_which = __commonJS((exports, module) => {
|
|
|
16566
16566
|
opt = {};
|
|
16567
16567
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
16568
16568
|
const found = [];
|
|
16569
|
-
const step = (i) => new Promise((
|
|
16569
|
+
const step = (i) => new Promise((resolve3, reject) => {
|
|
16570
16570
|
if (i === pathEnv.length)
|
|
16571
|
-
return opt.all && found.length ?
|
|
16571
|
+
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
16572
16572
|
const ppRaw = pathEnv[i];
|
|
16573
16573
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
16574
16574
|
const pCmd = path11.join(pathPart, cmd);
|
|
16575
16575
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
16576
|
-
|
|
16576
|
+
resolve3(subStep(p, i, 0));
|
|
16577
16577
|
});
|
|
16578
|
-
const subStep = (p, i, ii) => new Promise((
|
|
16578
|
+
const subStep = (p, i, ii) => new Promise((resolve3, reject) => {
|
|
16579
16579
|
if (ii === pathExt.length)
|
|
16580
|
-
return
|
|
16580
|
+
return resolve3(step(i + 1));
|
|
16581
16581
|
const ext = pathExt[ii];
|
|
16582
16582
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
16583
16583
|
if (!er && is) {
|
|
16584
16584
|
if (opt.all)
|
|
16585
16585
|
found.push(p + ext);
|
|
16586
16586
|
else
|
|
16587
|
-
return
|
|
16587
|
+
return resolve3(p + ext);
|
|
16588
16588
|
}
|
|
16589
|
-
return
|
|
16589
|
+
return resolve3(subStep(p, i, ii + 1));
|
|
16590
16590
|
});
|
|
16591
16591
|
});
|
|
16592
16592
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -121156,7 +121156,7 @@ function getDataProtocolModuleFormat(parsed) {
|
|
|
121156
121156
|
const { 1: mime } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [null, null, null];
|
|
121157
121157
|
return mimeToFormat(mime);
|
|
121158
121158
|
}
|
|
121159
|
-
function
|
|
121159
|
+
function extname(url3) {
|
|
121160
121160
|
const pathname = url3.pathname;
|
|
121161
121161
|
let index = pathname.length;
|
|
121162
121162
|
while (index--) {
|
|
@@ -121171,7 +121171,7 @@ function extname2(url3) {
|
|
|
121171
121171
|
return "";
|
|
121172
121172
|
}
|
|
121173
121173
|
function getFileProtocolModuleFormat(url3, _context, ignoreErrors) {
|
|
121174
|
-
const value =
|
|
121174
|
+
const value = extname(url3);
|
|
121175
121175
|
if (value === ".js") {
|
|
121176
121176
|
const packageType = getPackageType(url3);
|
|
121177
121177
|
if (packageType !== "none") {
|
|
@@ -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(resolve12) {
|
|
138273
|
+
resolve12(value);
|
|
138274
138274
|
});
|
|
138275
138275
|
}
|
|
138276
|
-
return new (P9 || (P9 = Promise))(function(
|
|
138276
|
+
return new (P9 || (P9 = Promise))(function(resolve12, 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 ? resolve12(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 = resolve12;
|
|
142946
142946
|
exports.cwd = cwd;
|
|
142947
142947
|
exports.getProtocol = getProtocol;
|
|
142948
142948
|
exports.getExtension = getExtension;
|
|
@@ -142954,7 +142954,7 @@ var require_url = __commonJS((exports) => {
|
|
|
142954
142954
|
exports.fromFileSystemPath = fromFileSystemPath;
|
|
142955
142955
|
exports.toFileSystemPath = toFileSystemPath;
|
|
142956
142956
|
exports.safePointerToPath = safePointerToPath;
|
|
142957
|
-
exports.relative =
|
|
142957
|
+
exports.relative = relative4;
|
|
142958
142958
|
var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
|
|
142959
142959
|
var path_1 = __importStar(__require("path"));
|
|
142960
142960
|
var forwardSlashPattern = /\//g;
|
|
@@ -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 resolve12(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] || "";
|
|
@@ -143104,9 +143104,9 @@ var require_url = __commonJS((exports) => {
|
|
|
143104
143104
|
return decodeURIComponent(value).replace(jsonPointerSlash, "/").replace(jsonPointerTilde, "~");
|
|
143105
143105
|
});
|
|
143106
143106
|
}
|
|
143107
|
-
function
|
|
143107
|
+
function relative4(from, to5) {
|
|
143108
143108
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
143109
|
-
return
|
|
143109
|
+
return resolve12(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((resolve12, 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
|
+
resolve12({
|
|
143814
143814
|
plugin,
|
|
143815
143815
|
result
|
|
143816
143816
|
});
|
|
@@ -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(resolve12) {
|
|
145147
|
+
resolve12(value);
|
|
145148
145148
|
});
|
|
145149
145149
|
}
|
|
145150
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145150
|
+
return new (P9 || (P9 = Promise))(function(resolve12, 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 ? resolve12(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(resolve12) {
|
|
145288
|
+
resolve12(value);
|
|
145289
145289
|
});
|
|
145290
145290
|
}
|
|
145291
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145291
|
+
return new (P9 || (P9 = Promise))(function(resolve12, 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 ? resolve12(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
145308
145308
|
}
|
|
145309
145309
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
145310
145310
|
});
|
|
@@ -146286,7 +146286,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
146286
146286
|
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|
146287
146287
|
* MIT Licensed
|
|
146288
146288
|
*/
|
|
146289
|
-
var
|
|
146289
|
+
var relative4 = __require("path").relative;
|
|
146290
146290
|
module.exports = depd;
|
|
146291
146291
|
var basePath = process.cwd();
|
|
146292
146292
|
function containsNamespace(str, namespace) {
|
|
@@ -146482,7 +146482,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
146482
146482
|
return formatted;
|
|
146483
146483
|
}
|
|
146484
146484
|
function formatLocation(callSite) {
|
|
146485
|
-
return
|
|
146485
|
+
return relative4(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
146486
146486
|
}
|
|
146487
146487
|
function getStack() {
|
|
146488
146488
|
var limit = Error.stackTraceLimit;
|
|
@@ -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(resolve12, reject) {
|
|
150823
150823
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
150824
150824
|
if (err)
|
|
150825
150825
|
return reject(err);
|
|
150826
|
-
|
|
150826
|
+
resolve12(buf);
|
|
150827
150827
|
});
|
|
150828
150828
|
});
|
|
150829
150829
|
}
|
|
@@ -160627,7 +160627,7 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
160627
160627
|
* MIT Licensed
|
|
160628
160628
|
*/
|
|
160629
160629
|
var db2 = require_db();
|
|
160630
|
-
var
|
|
160630
|
+
var extname2 = __require("path").extname;
|
|
160631
160631
|
var mimeScore = require_mimeScore();
|
|
160632
160632
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
160633
160633
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
@@ -160684,7 +160684,7 @@ var require_mime_types = __commonJS((exports) => {
|
|
|
160684
160684
|
if (!path18 || typeof path18 !== "string") {
|
|
160685
160685
|
return false;
|
|
160686
160686
|
}
|
|
160687
|
-
var extension2 =
|
|
160687
|
+
var extension2 = extname2("x." + path18).toLowerCase().slice(1);
|
|
160688
160688
|
if (!extension2) {
|
|
160689
160689
|
return false;
|
|
160690
160690
|
}
|
|
@@ -163944,16 +163944,16 @@ var require_view = __commonJS((exports, module) => {
|
|
|
163944
163944
|
var debug = require_src4()("express:view");
|
|
163945
163945
|
var path18 = __require("node:path");
|
|
163946
163946
|
var fs28 = __require("node:fs");
|
|
163947
|
-
var
|
|
163947
|
+
var dirname19 = path18.dirname;
|
|
163948
163948
|
var basename6 = path18.basename;
|
|
163949
|
-
var
|
|
163949
|
+
var extname2 = path18.extname;
|
|
163950
163950
|
var join25 = path18.join;
|
|
163951
|
-
var
|
|
163951
|
+
var resolve12 = path18.resolve;
|
|
163952
163952
|
module.exports = View;
|
|
163953
163953
|
function View(name2, options8) {
|
|
163954
163954
|
var opts = options8 || {};
|
|
163955
163955
|
this.defaultEngine = opts.defaultEngine;
|
|
163956
|
-
this.ext =
|
|
163956
|
+
this.ext = extname2(name2);
|
|
163957
163957
|
this.name = name2;
|
|
163958
163958
|
this.root = opts.root;
|
|
163959
163959
|
if (!this.ext && !this.defaultEngine) {
|
|
@@ -163982,8 +163982,8 @@ 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 =
|
|
163986
|
-
var dir =
|
|
163985
|
+
var loc = resolve12(root2, name2);
|
|
163986
|
+
var dir = dirname19(loc);
|
|
163987
163987
|
var file2 = basename6(loc);
|
|
163988
163988
|
path19 = this.resolve(dir, file2);
|
|
163989
163989
|
}
|
|
@@ -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 resolve13(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 resolve12 = __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", resolve12("views"));
|
|
166224
166224
|
this.set("jsonp callback name", "callback");
|
|
166225
166225
|
if (env3 === "production") {
|
|
166226
166226
|
this.enable("view cache");
|
|
@@ -167708,10 +167708,10 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167708
167708
|
var statuses = require_statuses();
|
|
167709
167709
|
var Stream2 = __require("stream");
|
|
167710
167710
|
var util2 = __require("util");
|
|
167711
|
-
var
|
|
167711
|
+
var extname2 = path18.extname;
|
|
167712
167712
|
var join25 = path18.join;
|
|
167713
167713
|
var normalize2 = path18.normalize;
|
|
167714
|
-
var
|
|
167714
|
+
var resolve12 = 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" ? ms9(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 ? resolve12(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 = resolve12(path19);
|
|
167893
167893
|
}
|
|
167894
167894
|
if (containsDotFile(parts)) {
|
|
167895
167895
|
debug('%s dotfile "%s"', this._dotfiles, path19);
|
|
@@ -167984,7 +167984,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
167984
167984
|
debug('stat "%s"', path19);
|
|
167985
167985
|
fs28.stat(path19, function onstat(err, stat2) {
|
|
167986
167986
|
var pathEndsWithSep = path19[path19.length - 1] === sep;
|
|
167987
|
-
if (err && err.code === "ENOENT" && !
|
|
167987
|
+
if (err && err.code === "ENOENT" && !extname2(path19) && !pathEndsWithSep) {
|
|
167988
167988
|
return next(err);
|
|
167989
167989
|
}
|
|
167990
167990
|
if (err)
|
|
@@ -168056,7 +168056,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
168056
168056
|
var res = this.res;
|
|
168057
168057
|
if (res.getHeader("Content-Type"))
|
|
168058
168058
|
return;
|
|
168059
|
-
var ext =
|
|
168059
|
+
var ext = extname2(path19);
|
|
168060
168060
|
var type2 = mime.contentType(ext) || "application/octet-stream";
|
|
168061
168061
|
debug("content-type %s", type2);
|
|
168062
168062
|
res.setHeader("Content-Type", type2);
|
|
@@ -168216,8 +168216,8 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168216
168216
|
var setCharset = require_utils10().setCharset;
|
|
168217
168217
|
var cookie = require_cookie();
|
|
168218
168218
|
var send = require_send();
|
|
168219
|
-
var
|
|
168220
|
-
var
|
|
168219
|
+
var extname2 = path18.extname;
|
|
168220
|
+
var resolve12 = 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 ? resolve12(path19) : path19;
|
|
168430
168430
|
return this.sendFile(fullPath, opts, done);
|
|
168431
168431
|
};
|
|
168432
168432
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -168457,7 +168457,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
168457
168457
|
};
|
|
168458
168458
|
res.attachment = function attachment(filename) {
|
|
168459
168459
|
if (filename) {
|
|
168460
|
-
this.type(
|
|
168460
|
+
this.type(extname2(filename));
|
|
168461
168461
|
}
|
|
168462
168462
|
this.set("Content-Disposition", contentDisposition(filename));
|
|
168463
168463
|
return this;
|
|
@@ -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 resolve12 = __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 = resolve12(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") {
|
|
@@ -169630,8 +169630,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
169630
169630
|
}
|
|
169631
169631
|
return parsed;
|
|
169632
169632
|
}
|
|
169633
|
-
function resolveUrl(
|
|
169634
|
-
return useNativeURL ? new URL2(
|
|
169633
|
+
function resolveUrl(relative4, base) {
|
|
169634
|
+
return useNativeURL ? new URL2(relative4, base) : parseUrl(url3.resolve(base, relative4));
|
|
169635
169635
|
}
|
|
169636
169636
|
function validateUrl(input) {
|
|
169637
169637
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -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((resolve12) => {
|
|
172084
|
+
this._triggerBuffer = resolve12;
|
|
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((resolve12, 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
|
+
resolve12();
|
|
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((resolve12, 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
|
+
resolve12({ data, indexes });
|
|
173336
173336
|
});
|
|
173337
173337
|
lineStream.on("error", function(err) {
|
|
173338
173338
|
reject(err, null);
|
|
@@ -182865,7 +182865,7 @@ var require_mime_types2 = __commonJS((exports) => {
|
|
|
182865
182865
|
* MIT Licensed
|
|
182866
182866
|
*/
|
|
182867
182867
|
var db2 = require_db2();
|
|
182868
|
-
var
|
|
182868
|
+
var extname2 = __require("path").extname;
|
|
182869
182869
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
182870
182870
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
182871
182871
|
exports.charset = charset;
|
|
@@ -182920,7 +182920,7 @@ var require_mime_types2 = __commonJS((exports) => {
|
|
|
182920
182920
|
if (!path18 || typeof path18 !== "string") {
|
|
182921
182921
|
return false;
|
|
182922
182922
|
}
|
|
182923
|
-
var extension2 =
|
|
182923
|
+
var extension2 = extname2("x." + path18).toLowerCase().substr(1);
|
|
182924
182924
|
if (!extension2) {
|
|
182925
182925
|
return false;
|
|
182926
182926
|
}
|
|
@@ -192912,7 +192912,7 @@ var require_mime_types3 = __commonJS((exports) => {
|
|
|
192912
192912
|
* MIT Licensed
|
|
192913
192913
|
*/
|
|
192914
192914
|
var db2 = require_db3();
|
|
192915
|
-
var
|
|
192915
|
+
var extname2 = __require("path").extname;
|
|
192916
192916
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
192917
192917
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
192918
192918
|
exports.charset = charset;
|
|
@@ -192967,7 +192967,7 @@ var require_mime_types3 = __commonJS((exports) => {
|
|
|
192967
192967
|
if (!path18 || typeof path18 !== "string") {
|
|
192968
192968
|
return false;
|
|
192969
192969
|
}
|
|
192970
|
-
var extension2 =
|
|
192970
|
+
var extension2 = extname2("x." + path18).toLowerCase().substr(1);
|
|
192971
192971
|
if (!extension2) {
|
|
192972
192972
|
return false;
|
|
192973
192973
|
}
|
|
@@ -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((resolve12, 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 resolve12(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((resolve12, reject) => {
|
|
199141
199141
|
args.push((arg1, arg2) => {
|
|
199142
199142
|
if (withErr) {
|
|
199143
|
-
return arg1 ? reject(arg1) :
|
|
199143
|
+
return arg1 ? reject(arg1) : resolve12(arg2);
|
|
199144
199144
|
} else {
|
|
199145
|
-
return
|
|
199145
|
+
return resolve12(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((resolve12, 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 resolve12(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((resolve12, 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: resolve12,
|
|
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((resolve12, 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: resolve12,
|
|
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((resolve12) => {
|
|
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
|
+
resolve12();
|
|
201256
201256
|
});
|
|
201257
201257
|
});
|
|
201258
201258
|
} else {
|
|
@@ -209988,7 +209988,7 @@ var require_mime_types4 = __commonJS((exports) => {
|
|
|
209988
209988
|
* MIT Licensed
|
|
209989
209989
|
*/
|
|
209990
209990
|
var db2 = require_db4();
|
|
209991
|
-
var
|
|
209991
|
+
var extname2 = __require("path").extname;
|
|
209992
209992
|
var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
|
|
209993
209993
|
var TEXT_TYPE_REGEXP = /^text\//i;
|
|
209994
209994
|
exports.charset = charset;
|
|
@@ -210043,7 +210043,7 @@ var require_mime_types4 = __commonJS((exports) => {
|
|
|
210043
210043
|
if (!path18 || typeof path18 !== "string") {
|
|
210044
210044
|
return false;
|
|
210045
210045
|
}
|
|
210046
|
-
var extension2 =
|
|
210046
|
+
var extension2 = extname2("x." + path18).toLowerCase().substr(1);
|
|
210047
210047
|
if (!extension2) {
|
|
210048
210048
|
return false;
|
|
210049
210049
|
}
|
|
@@ -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 resolve12 = iter[kLastResolve];
|
|
215918
|
+
if (resolve12 !== 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
|
+
resolve12(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(resolve12, reject) {
|
|
215933
215933
|
lastPromise.then(function() {
|
|
215934
215934
|
if (iter[kEnded]) {
|
|
215935
|
-
|
|
215935
|
+
resolve12(createIterResult(undefined, true));
|
|
215936
215936
|
return;
|
|
215937
215937
|
}
|
|
215938
|
-
iter[kHandlePromise](
|
|
215938
|
+
iter[kHandlePromise](resolve12, 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(resolve12, reject) {
|
|
215958
215958
|
process.nextTick(function() {
|
|
215959
215959
|
if (_this[kError]) {
|
|
215960
215960
|
reject(_this[kError]);
|
|
215961
215961
|
} else {
|
|
215962
|
-
|
|
215962
|
+
resolve12(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(resolve12, reject) {
|
|
215986
215986
|
_this2[kStream].destroy(null, function(err) {
|
|
215987
215987
|
if (err) {
|
|
215988
215988
|
reject(err);
|
|
215989
215989
|
return;
|
|
215990
215990
|
}
|
|
215991
|
-
|
|
215991
|
+
resolve12(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(resolve12, 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
|
+
resolve12(createIterResult(data, false));
|
|
216020
216020
|
} else {
|
|
216021
|
-
iterator[kLastResolve] =
|
|
216021
|
+
iterator[kLastResolve] = resolve12;
|
|
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 resolve12 = iterator[kLastResolve];
|
|
216041
|
+
if (resolve12 !== null) {
|
|
216042
216042
|
iterator[kLastPromise] = null;
|
|
216043
216043
|
iterator[kLastResolve] = null;
|
|
216044
216044
|
iterator[kLastReject] = null;
|
|
216045
|
-
|
|
216045
|
+
resolve12(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, resolve12, 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
|
+
resolve12(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(resolve12, reject) {
|
|
216075
216075
|
var gen = fn9.apply(self2, args);
|
|
216076
216076
|
function _next(value) {
|
|
216077
|
-
asyncGeneratorStep(gen,
|
|
216077
|
+
asyncGeneratorStep(gen, resolve12, reject, _next, _throw, "next", value);
|
|
216078
216078
|
}
|
|
216079
216079
|
function _throw(err) {
|
|
216080
|
-
asyncGeneratorStep(gen,
|
|
216080
|
+
asyncGeneratorStep(gen, resolve12, reject, _next, _throw, "throw", err);
|
|
216081
216081
|
}
|
|
216082
216082
|
_next(undefined);
|
|
216083
216083
|
});
|
|
@@ -233593,6 +233593,9 @@ var ApiErrorResponseSchema = exports_external.looseObject({
|
|
|
233593
233593
|
});
|
|
233594
233594
|
|
|
233595
233595
|
// src/core/errors.ts
|
|
233596
|
+
function usingWorkspaceApiKey() {
|
|
233597
|
+
return process.env.BASE44_API_KEY?.trim().startsWith("b44k_") ?? false;
|
|
233598
|
+
}
|
|
233596
233599
|
function formatApiError(errorBody, parsed) {
|
|
233597
233600
|
const data = parsed ?? ApiErrorResponseSchema.safeParse(errorBody).data;
|
|
233598
233601
|
if (data) {
|
|
@@ -233787,6 +233790,13 @@ class ApiError extends SystemError {
|
|
|
233787
233790
|
];
|
|
233788
233791
|
}
|
|
233789
233792
|
if (statusCode === 401) {
|
|
233793
|
+
if (usingWorkspaceApiKey()) {
|
|
233794
|
+
return [
|
|
233795
|
+
{
|
|
233796
|
+
message: "The workspace API key (BASE44_API_KEY) was rejected. Verify it is valid and authorized for this app."
|
|
233797
|
+
}
|
|
233798
|
+
];
|
|
233799
|
+
}
|
|
233790
233800
|
return [{ message: "Try logging in again", command: "base44 login" }];
|
|
233791
233801
|
}
|
|
233792
233802
|
if (statusCode === 403) {
|
|
@@ -233809,6 +233819,9 @@ class ApiError extends SystemError {
|
|
|
233809
233819
|
}
|
|
233810
233820
|
];
|
|
233811
233821
|
}
|
|
233822
|
+
if (statusCode && statusCode < 500) {
|
|
233823
|
+
return [];
|
|
233824
|
+
}
|
|
233812
233825
|
return [{ message: "Check your network connection and try again" }];
|
|
233813
233826
|
}
|
|
233814
233827
|
static getReasonHints(parsedResponse) {
|
|
@@ -234018,7 +234031,7 @@ function normalizeBase44Env() {
|
|
|
234018
234031
|
loadProjectEnvFiles();
|
|
234019
234032
|
|
|
234020
234033
|
// src/cli/index.ts
|
|
234021
|
-
import { dirname as
|
|
234034
|
+
import { dirname as dirname23, join as join28 } from "node:path";
|
|
234022
234035
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
234023
234036
|
|
|
234024
234037
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -235226,7 +235239,7 @@ var {
|
|
|
235226
235239
|
} = import__.default;
|
|
235227
235240
|
|
|
235228
235241
|
// src/cli/commands/agents/pull.ts
|
|
235229
|
-
import { dirname as
|
|
235242
|
+
import { dirname as dirname10, join as join14 } from "node:path";
|
|
235230
235243
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
235231
235244
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
235232
235245
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -236030,11 +236043,13 @@ var PluginMetadataSchema = exports_external.object({
|
|
|
236030
236043
|
var PluginReferenceSchema = exports_external.object({
|
|
236031
236044
|
source: exports_external.string().min(1, "Plugin source cannot be empty")
|
|
236032
236045
|
});
|
|
236046
|
+
var VISIBILITY_LEVELS = ["public", "private", "workspace"];
|
|
236033
236047
|
var ProjectConfigSchema = exports_external.object({
|
|
236034
236048
|
name: exports_external.string({
|
|
236035
236049
|
error: "App name cannot be empty"
|
|
236036
236050
|
}).min(1, "App name cannot be empty"),
|
|
236037
236051
|
description: exports_external.string().optional(),
|
|
236052
|
+
visibility: exports_external.enum(VISIBILITY_LEVELS).optional(),
|
|
236038
236053
|
site: SiteConfigSchema.optional(),
|
|
236039
236054
|
entitiesDir: exports_external.string().optional().default("entities"),
|
|
236040
236055
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
@@ -236102,7 +236117,19 @@ function getTestOverrides() {
|
|
|
236102
236117
|
|
|
236103
236118
|
// src/core/auth/config.ts
|
|
236104
236119
|
var TOKEN_REFRESH_BUFFER_MS = 60 * 1000;
|
|
236120
|
+
var WORKSPACE_API_KEY_PREFIX = "b44k_";
|
|
236105
236121
|
var refreshPromise = null;
|
|
236122
|
+
function getWorkspaceApiKeyFromEnv() {
|
|
236123
|
+
const key = process.env.BASE44_API_KEY?.trim();
|
|
236124
|
+
return key ? key : null;
|
|
236125
|
+
}
|
|
236126
|
+
function isWorkspaceApiKey(value) {
|
|
236127
|
+
return value.startsWith(WORKSPACE_API_KEY_PREFIX);
|
|
236128
|
+
}
|
|
236129
|
+
function hasWorkspaceApiKeyAuth() {
|
|
236130
|
+
const key = getWorkspaceApiKeyFromEnv();
|
|
236131
|
+
return key !== null && isWorkspaceApiKey(key);
|
|
236132
|
+
}
|
|
236106
236133
|
async function seedAuthFromEnv() {
|
|
236107
236134
|
const accessToken = process.env.BASE44_ACCESS_TOKEN;
|
|
236108
236135
|
if (!accessToken) {
|
|
@@ -241817,6 +241844,11 @@ var PublishedUrlResponseSchema = exports_external.object({
|
|
|
241817
241844
|
});
|
|
241818
241845
|
|
|
241819
241846
|
// src/core/project/api.ts
|
|
241847
|
+
var PUBLIC_SETTINGS = {
|
|
241848
|
+
public: "public_without_login",
|
|
241849
|
+
private: "private_with_login",
|
|
241850
|
+
workspace: "workspace_with_login"
|
|
241851
|
+
};
|
|
241820
241852
|
async function createProject(projectName, description) {
|
|
241821
241853
|
let response;
|
|
241822
241854
|
try {
|
|
@@ -241825,7 +241857,7 @@ async function createProject(projectName, description) {
|
|
|
241825
241857
|
name: projectName,
|
|
241826
241858
|
user_description: description ?? `Backend for '${projectName}'`,
|
|
241827
241859
|
is_managed_source_code: false,
|
|
241828
|
-
public_settings:
|
|
241860
|
+
public_settings: PUBLIC_SETTINGS.public
|
|
241829
241861
|
}
|
|
241830
241862
|
});
|
|
241831
241863
|
} catch (error48) {
|
|
@@ -241839,6 +241871,18 @@ async function createProject(projectName, description) {
|
|
|
241839
241871
|
projectId: result.data.id
|
|
241840
241872
|
};
|
|
241841
241873
|
}
|
|
241874
|
+
async function setAppVisibility(visibility) {
|
|
241875
|
+
if (!visibility)
|
|
241876
|
+
return;
|
|
241877
|
+
const { id } = getAppContext();
|
|
241878
|
+
try {
|
|
241879
|
+
await base44Client.put(`api/apps/${id}`, {
|
|
241880
|
+
json: { public_settings: PUBLIC_SETTINGS[visibility] }
|
|
241881
|
+
});
|
|
241882
|
+
} catch (error48) {
|
|
241883
|
+
throw await ApiError.fromHttpError(error48, "updating app visibility");
|
|
241884
|
+
}
|
|
241885
|
+
}
|
|
241842
241886
|
async function listProjects() {
|
|
241843
241887
|
let response;
|
|
241844
241888
|
try {
|
|
@@ -241894,7 +241938,7 @@ async function getSiteUrl() {
|
|
|
241894
241938
|
return result.data.url;
|
|
241895
241939
|
}
|
|
241896
241940
|
// src/core/project/config.ts
|
|
241897
|
-
import { dirname as
|
|
241941
|
+
import { dirname as dirname8, join as join10 } from "node:path";
|
|
241898
241942
|
|
|
241899
241943
|
// src/core/project/plugins.ts
|
|
241900
241944
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -243424,14 +243468,9 @@ var FunctionConfigSchema = exports_external.object({
|
|
|
243424
243468
|
entry: exports_external.string().min(1, "Entry point cannot be empty"),
|
|
243425
243469
|
automations: exports_external.array(AutomationSchema).optional()
|
|
243426
243470
|
});
|
|
243427
|
-
var OutOfBoundsImportSchema = exports_external.object({
|
|
243428
|
-
importer: exports_external.string(),
|
|
243429
|
-
specifier: exports_external.string()
|
|
243430
|
-
});
|
|
243431
243471
|
var BackendFunctionSchema = FunctionConfigSchema.extend({
|
|
243432
243472
|
entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
|
|
243433
243473
|
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file"),
|
|
243434
|
-
outOfBoundsImports: exports_external.array(OutOfBoundsImportSchema).optional().default([]),
|
|
243435
243474
|
source: ResourceSourceSchema
|
|
243436
243475
|
});
|
|
243437
243476
|
var DeploySingleFunctionResponseSchema = exports_external.object({
|
|
@@ -243541,75 +243580,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
243541
243580
|
return result.data;
|
|
243542
243581
|
}
|
|
243543
243582
|
// src/core/resources/function/config.ts
|
|
243544
|
-
import { basename as basename3, dirname as
|
|
243545
|
-
|
|
243546
|
-
// src/core/resources/function/reachability.ts
|
|
243547
|
-
import { dirname as dirname6, extname, relative, resolve as resolve2 } from "node:path";
|
|
243548
|
-
var RELATIVE_IMPORT_RE = /(?:from|import|require)\s*\(?['"`](\.\.?\/[^'"`\s]+)['"`]/g;
|
|
243549
|
-
async function resolveSpecifier(specifier, fromDir) {
|
|
243550
|
-
const base = resolve2(fromDir, specifier);
|
|
243551
|
-
const ext = extname(base);
|
|
243552
|
-
if (ext) {
|
|
243553
|
-
if (ext === ".js") {
|
|
243554
|
-
const asTts = `${base.slice(0, -3)}.ts`;
|
|
243555
|
-
if (await pathExists(asTts))
|
|
243556
|
-
return asTts;
|
|
243557
|
-
}
|
|
243558
|
-
if (await pathExists(base))
|
|
243559
|
-
return base;
|
|
243560
|
-
return null;
|
|
243561
|
-
}
|
|
243562
|
-
for (const candidate of [
|
|
243563
|
-
`${base}.ts`,
|
|
243564
|
-
`${base}.js`,
|
|
243565
|
-
`${base}.json`,
|
|
243566
|
-
resolve2(base, "index.ts"),
|
|
243567
|
-
resolve2(base, "index.js")
|
|
243568
|
-
]) {
|
|
243569
|
-
if (await pathExists(candidate))
|
|
243570
|
-
return candidate;
|
|
243571
|
-
}
|
|
243572
|
-
return null;
|
|
243573
|
-
}
|
|
243574
|
-
async function collectReachableBackendFiles(_entryPath, functionFilePaths, backendRoot) {
|
|
243575
|
-
const visited = new Set(functionFilePaths);
|
|
243576
|
-
const queue = [...functionFilePaths];
|
|
243577
|
-
const extra = [];
|
|
243578
|
-
const outOfBounds = [];
|
|
243579
|
-
while (queue.length > 0) {
|
|
243580
|
-
const filePath = queue.shift();
|
|
243581
|
-
let content;
|
|
243582
|
-
try {
|
|
243583
|
-
content = await readTextFile(filePath);
|
|
243584
|
-
} catch {
|
|
243585
|
-
continue;
|
|
243586
|
-
}
|
|
243587
|
-
const dir = dirname6(filePath);
|
|
243588
|
-
for (const match of content.matchAll(RELATIVE_IMPORT_RE)) {
|
|
243589
|
-
const specifier = match[1];
|
|
243590
|
-
const resolved = await resolveSpecifier(specifier, dir);
|
|
243591
|
-
if (!resolved)
|
|
243592
|
-
continue;
|
|
243593
|
-
const rel = relative(backendRoot, resolved);
|
|
243594
|
-
if (rel.startsWith("..")) {
|
|
243595
|
-
outOfBounds.push({ importer: filePath, specifier });
|
|
243596
|
-
continue;
|
|
243597
|
-
}
|
|
243598
|
-
if (!visited.has(resolved)) {
|
|
243599
|
-
visited.add(resolved);
|
|
243600
|
-
queue.push(resolved);
|
|
243601
|
-
extra.push(resolved);
|
|
243602
|
-
}
|
|
243603
|
-
}
|
|
243604
|
-
}
|
|
243605
|
-
const functionSet = new Set(functionFilePaths);
|
|
243606
|
-
return {
|
|
243607
|
-
extra: extra.filter((p) => !functionSet.has(p)),
|
|
243608
|
-
outOfBounds
|
|
243609
|
-
};
|
|
243610
|
-
}
|
|
243611
|
-
|
|
243612
|
-
// src/core/resources/function/config.ts
|
|
243583
|
+
import { basename as basename3, dirname as dirname6, join as join8, relative } from "node:path";
|
|
243613
243584
|
async function readFunctionConfig(configPath) {
|
|
243614
243585
|
const parsed = await readJsonFile(configPath);
|
|
243615
243586
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -243618,9 +243589,9 @@ async function readFunctionConfig(configPath) {
|
|
|
243618
243589
|
}
|
|
243619
243590
|
return result.data;
|
|
243620
243591
|
}
|
|
243621
|
-
async function readFunction(configPath
|
|
243592
|
+
async function readFunction(configPath) {
|
|
243622
243593
|
const config7 = await readFunctionConfig(configPath);
|
|
243623
|
-
const functionDir =
|
|
243594
|
+
const functionDir = dirname6(configPath);
|
|
243624
243595
|
const entryPath = join8(functionDir, config7.entry);
|
|
243625
243596
|
if (!await pathExists(entryPath)) {
|
|
243626
243597
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
@@ -243631,13 +243602,10 @@ async function readFunction(configPath, backendRoot) {
|
|
|
243631
243602
|
cwd: functionDir,
|
|
243632
243603
|
absolute: true
|
|
243633
243604
|
});
|
|
243634
|
-
const { extra, outOfBounds } = await collectReachableBackendFiles(entryPath, filePaths, backendRoot);
|
|
243635
|
-
const allFilePaths = [...new Set([...filePaths, ...extra])];
|
|
243636
243605
|
const functionData = {
|
|
243637
243606
|
...config7,
|
|
243638
243607
|
entryPath,
|
|
243639
|
-
filePaths
|
|
243640
|
-
outOfBoundsImports: outOfBounds,
|
|
243608
|
+
filePaths,
|
|
243641
243609
|
source: { type: "project" }
|
|
243642
243610
|
};
|
|
243643
243611
|
return functionData;
|
|
@@ -243655,19 +243623,16 @@ async function readAllFunctions(functionsDir) {
|
|
|
243655
243623
|
absolute: true,
|
|
243656
243624
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
243657
243625
|
});
|
|
243658
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
243659
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
243660
|
-
const
|
|
243661
|
-
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath, backendRoot)));
|
|
243626
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname6(f)));
|
|
243627
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname6(entryFile)));
|
|
243628
|
+
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
243662
243629
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
243663
|
-
const functionDir =
|
|
243630
|
+
const functionDir = dirname6(entryFile);
|
|
243664
243631
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
243665
243632
|
cwd: functionDir,
|
|
243666
243633
|
absolute: true
|
|
243667
243634
|
});
|
|
243668
|
-
const
|
|
243669
|
-
const allFilePaths = [...new Set([...filePaths, ...extra])];
|
|
243670
|
-
const name2 = relative2(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
243635
|
+
const name2 = relative(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
243671
243636
|
if (!name2) {
|
|
243672
243637
|
throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
|
|
243673
243638
|
hints: [
|
|
@@ -243682,8 +243647,7 @@ async function readAllFunctions(functionsDir) {
|
|
|
243682
243647
|
name: name2,
|
|
243683
243648
|
entry,
|
|
243684
243649
|
entryPath: entryFile,
|
|
243685
|
-
filePaths
|
|
243686
|
-
outOfBoundsImports: outOfBounds,
|
|
243650
|
+
filePaths,
|
|
243687
243651
|
source: { type: "project" }
|
|
243688
243652
|
};
|
|
243689
243653
|
return functionData;
|
|
@@ -243705,12 +243669,12 @@ async function readAllFunctions(functionsDir) {
|
|
|
243705
243669
|
return functions;
|
|
243706
243670
|
}
|
|
243707
243671
|
// src/core/resources/function/deploy.ts
|
|
243708
|
-
import { dirname as
|
|
243672
|
+
import { dirname as dirname7, relative as relative2 } from "node:path";
|
|
243709
243673
|
async function loadFunctionCode(fn) {
|
|
243710
|
-
const functionDir =
|
|
243674
|
+
const functionDir = dirname7(fn.entryPath);
|
|
243711
243675
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
243712
243676
|
const content = await readTextFile(filePath);
|
|
243713
|
-
const path11 =
|
|
243677
|
+
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
243714
243678
|
return { path: path11, content };
|
|
243715
243679
|
}));
|
|
243716
243680
|
return { ...fn, files: resolvedFiles };
|
|
@@ -243884,7 +243848,7 @@ class ProjectConfigReader {
|
|
|
243884
243848
|
return result.data;
|
|
243885
243849
|
}
|
|
243886
243850
|
async readProjectResources(configPath, project) {
|
|
243887
|
-
const configDir =
|
|
243851
|
+
const configDir = dirname8(configPath);
|
|
243888
243852
|
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243889
243853
|
entityResource.readAll(join10(configDir, project.entitiesDir)),
|
|
243890
243854
|
functionResource.readAll(join10(configDir, project.functionsDir)),
|
|
@@ -243913,7 +243877,7 @@ class ProjectConfigReader {
|
|
|
243913
243877
|
this.pluginSourceByNamespace.set(namespace, source);
|
|
243914
243878
|
}
|
|
243915
243879
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
243916
|
-
const pluginRoot = resolvePluginRoot(plugin.source,
|
|
243880
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname8(hostConfigPath));
|
|
243917
243881
|
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
243918
243882
|
const project = await this.readConfigFile(configPath);
|
|
243919
243883
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
@@ -243991,7 +243955,7 @@ async function readProjectConfig(projectRoot) {
|
|
|
243991
243955
|
// src/core/project/template.ts
|
|
243992
243956
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
243993
243957
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
243994
|
-
import { dirname as
|
|
243958
|
+
import { dirname as dirname9, join as join12 } from "node:path";
|
|
243995
243959
|
|
|
243996
243960
|
// src/core/assets.ts
|
|
243997
243961
|
import { cpSync, existsSync } from "node:fs";
|
|
@@ -244000,7 +243964,7 @@ import { join as join11 } from "node:path";
|
|
|
244000
243964
|
// package.json
|
|
244001
243965
|
var package_default = {
|
|
244002
243966
|
name: "base44",
|
|
244003
|
-
version: "0.1.
|
|
243967
|
+
version: "0.1.3",
|
|
244004
243968
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
244005
243969
|
type: "module",
|
|
244006
243970
|
bin: {
|
|
@@ -244143,7 +244107,7 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
244143
244107
|
if (file2.endsWith(".ejs")) {
|
|
244144
244108
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
244145
244109
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
244146
|
-
const destFile = attributes.outputFileName ? join12(
|
|
244110
|
+
const destFile = attributes.outputFileName ? join12(dirname9(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
244147
244111
|
const destFilePath = join12(destPath, destFile);
|
|
244148
244112
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
244149
244113
|
skipped.push(destFile);
|
|
@@ -244210,7 +244174,7 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
244210
244174
|
};
|
|
244211
244175
|
}
|
|
244212
244176
|
// src/core/project/deploy.ts
|
|
244213
|
-
import { resolve as
|
|
244177
|
+
import { resolve as resolve2 } from "node:path";
|
|
244214
244178
|
|
|
244215
244179
|
// src/core/site/api.ts
|
|
244216
244180
|
async function uploadSite(archivePath) {
|
|
@@ -244286,10 +244250,15 @@ function hasResourcesToDeploy(projectData) {
|
|
|
244286
244250
|
const hasAgents = agents.length > 0;
|
|
244287
244251
|
const hasConnectors = connectors.length > 0;
|
|
244288
244252
|
const hasAuthConfig = authConfig.length > 0;
|
|
244289
|
-
|
|
244253
|
+
const hasVisibility = Boolean(project.visibility);
|
|
244254
|
+
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasAuthConfig || hasVisibility || hasSite;
|
|
244290
244255
|
}
|
|
244291
244256
|
async function deployAll(projectData, options) {
|
|
244292
244257
|
const { project, entities, functions, agents, connectors, authConfig } = projectData;
|
|
244258
|
+
await setAppVisibility(project.visibility);
|
|
244259
|
+
if (project.visibility) {
|
|
244260
|
+
options?.onVisibilitySet?.(project.visibility);
|
|
244261
|
+
}
|
|
244293
244262
|
await entityResource.push(entities);
|
|
244294
244263
|
await deployFunctionsSequentially(functions, {
|
|
244295
244264
|
onStart: options?.onFunctionStart,
|
|
@@ -244297,9 +244266,10 @@ async function deployAll(projectData, options) {
|
|
|
244297
244266
|
});
|
|
244298
244267
|
await agentResource.push(agents);
|
|
244299
244268
|
await authConfigResource.push(authConfig);
|
|
244300
|
-
const
|
|
244269
|
+
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
244270
|
+
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
244301
244271
|
if (project.site?.outputDirectory) {
|
|
244302
|
-
const outputDir =
|
|
244272
|
+
const outputDir = resolve2(project.root, project.site.outputDirectory);
|
|
244303
244273
|
const { appUrl } = await deploySite(outputDir);
|
|
244304
244274
|
return { appUrl, connectorResults };
|
|
244305
244275
|
}
|
|
@@ -244321,6 +244291,9 @@ async function handleUnauthorized(request, _options, response) {
|
|
|
244321
244291
|
if (response.status !== 401) {
|
|
244322
244292
|
return;
|
|
244323
244293
|
}
|
|
244294
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
244295
|
+
return;
|
|
244296
|
+
}
|
|
244324
244297
|
if (retriedRequests.has(request)) {
|
|
244325
244298
|
return;
|
|
244326
244299
|
}
|
|
@@ -244349,6 +244322,11 @@ var base44Client = distribution_default.create({
|
|
|
244349
244322
|
},
|
|
244350
244323
|
captureRequestBody,
|
|
244351
244324
|
async (request) => {
|
|
244325
|
+
const workspaceApiKey = getWorkspaceApiKeyFromEnv();
|
|
244326
|
+
if (workspaceApiKey && isWorkspaceApiKey(workspaceApiKey)) {
|
|
244327
|
+
request.headers.set("api_key", workspaceApiKey);
|
|
244328
|
+
return;
|
|
244329
|
+
}
|
|
244352
244330
|
try {
|
|
244353
244331
|
const auth = await readAuth();
|
|
244354
244332
|
if (isTokenExpired(auth)) {
|
|
@@ -244554,6 +244532,12 @@ async function login({
|
|
|
244554
244532
|
|
|
244555
244533
|
// src/cli/utils/command/middleware.ts
|
|
244556
244534
|
async function ensureAuth(ctx) {
|
|
244535
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
244536
|
+
ctx.errorReporter.setContext({
|
|
244537
|
+
user: { email: "workspace-api-key", name: "Workspace API key" }
|
|
244538
|
+
});
|
|
244539
|
+
return;
|
|
244540
|
+
}
|
|
244557
244541
|
await seedAuthFromEnv();
|
|
244558
244542
|
const loggedIn = await isLoggedIn();
|
|
244559
244543
|
if (!loggedIn) {
|
|
@@ -246121,8 +246105,8 @@ var disconnect = (anyProcess) => {
|
|
|
246121
246105
|
// ../../node_modules/execa/lib/utils/deferred.js
|
|
246122
246106
|
var createDeferred = () => {
|
|
246123
246107
|
const methods = {};
|
|
246124
|
-
const promise2 = new Promise((
|
|
246125
|
-
Object.assign(methods, { resolve:
|
|
246108
|
+
const promise2 = new Promise((resolve3, reject) => {
|
|
246109
|
+
Object.assign(methods, { resolve: resolve3, reject });
|
|
246126
246110
|
});
|
|
246127
246111
|
return Object.assign(promise2, methods);
|
|
246128
246112
|
};
|
|
@@ -250486,11 +250470,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
250486
250470
|
const promises = weakMap.get(stream);
|
|
250487
250471
|
const promise2 = createDeferred();
|
|
250488
250472
|
promises.push(promise2);
|
|
250489
|
-
const
|
|
250490
|
-
return { resolve:
|
|
250473
|
+
const resolve3 = promise2.resolve.bind(promise2);
|
|
250474
|
+
return { resolve: resolve3, promises };
|
|
250491
250475
|
};
|
|
250492
|
-
var waitForConcurrentStreams = async ({ resolve:
|
|
250493
|
-
|
|
250476
|
+
var waitForConcurrentStreams = async ({ resolve: resolve3, promises }, subprocess) => {
|
|
250477
|
+
resolve3();
|
|
250494
250478
|
const [isSubprocessExit] = await Promise.race([
|
|
250495
250479
|
Promise.allSettled([true, subprocess]),
|
|
250496
250480
|
Promise.all([false, ...promises])
|
|
@@ -251491,7 +251475,7 @@ async function pullAgentsAction({
|
|
|
251491
251475
|
runTask: runTask2
|
|
251492
251476
|
}) {
|
|
251493
251477
|
const { project: project2 } = await readProjectConfig();
|
|
251494
|
-
const configDir =
|
|
251478
|
+
const configDir = dirname10(project2.configPath);
|
|
251495
251479
|
const agentsDir = join14(configDir, project2.agentsDir);
|
|
251496
251480
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
251497
251481
|
return await fetchAgents();
|
|
@@ -251556,11 +251540,11 @@ function getAgentsCommand() {
|
|
|
251556
251540
|
}
|
|
251557
251541
|
|
|
251558
251542
|
// src/cli/commands/auth/password-login.ts
|
|
251559
|
-
import { dirname as
|
|
251543
|
+
import { dirname as dirname11, join as join15 } from "node:path";
|
|
251560
251544
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
251561
251545
|
const shouldEnable = action === "enable";
|
|
251562
251546
|
const { project: project2 } = await readProjectConfig();
|
|
251563
|
-
const configDir =
|
|
251547
|
+
const configDir = dirname11(project2.configPath);
|
|
251564
251548
|
const authDir = join15(configDir, project2.authDir);
|
|
251565
251549
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
251566
251550
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
@@ -251581,13 +251565,13 @@ function getPasswordLoginCommand() {
|
|
|
251581
251565
|
}
|
|
251582
251566
|
|
|
251583
251567
|
// src/cli/commands/auth/pull.ts
|
|
251584
|
-
import { dirname as
|
|
251568
|
+
import { dirname as dirname12, join as join16 } from "node:path";
|
|
251585
251569
|
async function pullAuthAction({
|
|
251586
251570
|
log,
|
|
251587
251571
|
runTask: runTask2
|
|
251588
251572
|
}) {
|
|
251589
251573
|
const { project: project2 } = await readProjectConfig();
|
|
251590
|
-
const configDir =
|
|
251574
|
+
const configDir = dirname12(project2.configPath);
|
|
251591
251575
|
const authDir = join16(configDir, project2.authDir);
|
|
251592
251576
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
251593
251577
|
return await pullAuthConfig();
|
|
@@ -251652,7 +251636,7 @@ function getAuthPushCommand() {
|
|
|
251652
251636
|
}
|
|
251653
251637
|
|
|
251654
251638
|
// src/cli/commands/auth/social-login.ts
|
|
251655
|
-
import { dirname as
|
|
251639
|
+
import { dirname as dirname13, join as join17, resolve as resolve3 } from "node:path";
|
|
251656
251640
|
var PROVIDER_LABELS = {
|
|
251657
251641
|
google: "Google",
|
|
251658
251642
|
microsoft: "Microsoft",
|
|
@@ -251692,7 +251676,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251692
251676
|
let clientSecret;
|
|
251693
251677
|
if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
|
|
251694
251678
|
if (options.envFile) {
|
|
251695
|
-
const secrets = await parseEnvFile(
|
|
251679
|
+
const secrets = await parseEnvFile(resolve3(options.envFile));
|
|
251696
251680
|
const value = secrets[oauthCli.envVar];
|
|
251697
251681
|
if (!value) {
|
|
251698
251682
|
throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
|
|
@@ -251722,7 +251706,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251722
251706
|
}
|
|
251723
251707
|
}
|
|
251724
251708
|
const { project: project2 } = await readProjectConfig();
|
|
251725
|
-
const configDir =
|
|
251709
|
+
const configDir = dirname13(project2.configPath);
|
|
251726
251710
|
const authDir = join17(configDir, project2.authDir);
|
|
251727
251711
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251728
251712
|
if (clientSecret) {
|
|
@@ -251748,7 +251732,7 @@ function getSocialLoginCommand() {
|
|
|
251748
251732
|
}
|
|
251749
251733
|
|
|
251750
251734
|
// src/cli/commands/auth/sso.ts
|
|
251751
|
-
import { dirname as
|
|
251735
|
+
import { dirname as dirname14, join as join18, resolve as resolve4 } from "node:path";
|
|
251752
251736
|
var SSOConfigFileSchema = exports_external.object({
|
|
251753
251737
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251754
251738
|
clientId: exports_external.string(),
|
|
@@ -251764,7 +251748,7 @@ var SSOConfigFileSchema = exports_external.object({
|
|
|
251764
251748
|
ssoName: exports_external.string().optional()
|
|
251765
251749
|
});
|
|
251766
251750
|
async function loadSSOConfigFile(filePath) {
|
|
251767
|
-
const resolved =
|
|
251751
|
+
const resolved = resolve4(filePath);
|
|
251768
251752
|
const raw2 = await readJsonFile(resolved);
|
|
251769
251753
|
const result = SSOConfigFileSchema.safeParse(raw2);
|
|
251770
251754
|
if (!result.success) {
|
|
@@ -251852,7 +251836,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251852
251836
|
}
|
|
251853
251837
|
let clientSecret;
|
|
251854
251838
|
if (merged.envFile && !merged.clientSecret) {
|
|
251855
|
-
const secrets2 = await parseEnvFile(
|
|
251839
|
+
const secrets2 = await parseEnvFile(resolve4(merged.envFile));
|
|
251856
251840
|
const value = secrets2.sso_client_secret;
|
|
251857
251841
|
if (!value) {
|
|
251858
251842
|
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
@@ -251911,7 +251895,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251911
251895
|
throw error48;
|
|
251912
251896
|
}
|
|
251913
251897
|
const { project: project2 } = await readProjectConfig();
|
|
251914
|
-
const configDir =
|
|
251898
|
+
const configDir = dirname14(project2.configPath);
|
|
251915
251899
|
const authDir = join18(configDir, project2.authDir);
|
|
251916
251900
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251917
251901
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
@@ -251927,7 +251911,7 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
251927
251911
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251928
251912
|
}
|
|
251929
251913
|
const { project: project2 } = await readProjectConfig();
|
|
251930
|
-
const configDir =
|
|
251914
|
+
const configDir = dirname14(project2.configPath);
|
|
251931
251915
|
const authDir = join18(configDir, project2.authDir);
|
|
251932
251916
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251933
251917
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
@@ -251978,6 +251962,12 @@ function getLogoutCommand() {
|
|
|
251978
251962
|
|
|
251979
251963
|
// src/cli/commands/auth/whoami.ts
|
|
251980
251964
|
async function whoami(_ctx) {
|
|
251965
|
+
const workspaceApiKey = getWorkspaceApiKeyFromEnv();
|
|
251966
|
+
if (workspaceApiKey && isWorkspaceApiKey(workspaceApiKey)) {
|
|
251967
|
+
return {
|
|
251968
|
+
outroMessage: `Using workspace API key: ${theme.styles.bold(workspaceApiKey.slice(0, 10))}`
|
|
251969
|
+
};
|
|
251970
|
+
}
|
|
251981
251971
|
const auth2 = await readAuth();
|
|
251982
251972
|
return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
|
|
251983
251973
|
}
|
|
@@ -252484,19 +252474,19 @@ var baseOpen = async (options) => {
|
|
|
252484
252474
|
}
|
|
252485
252475
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
252486
252476
|
if (options.wait) {
|
|
252487
|
-
return new Promise((
|
|
252477
|
+
return new Promise((resolve5, reject) => {
|
|
252488
252478
|
subprocess.once("error", reject);
|
|
252489
252479
|
subprocess.once("close", (exitCode) => {
|
|
252490
252480
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
252491
252481
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
252492
252482
|
return;
|
|
252493
252483
|
}
|
|
252494
|
-
|
|
252484
|
+
resolve5(subprocess);
|
|
252495
252485
|
});
|
|
252496
252486
|
});
|
|
252497
252487
|
}
|
|
252498
252488
|
if (isFallbackAttempt) {
|
|
252499
|
-
return new Promise((
|
|
252489
|
+
return new Promise((resolve5, reject) => {
|
|
252500
252490
|
subprocess.once("error", reject);
|
|
252501
252491
|
subprocess.once("spawn", () => {
|
|
252502
252492
|
subprocess.once("close", (exitCode) => {
|
|
@@ -252506,17 +252496,17 @@ var baseOpen = async (options) => {
|
|
|
252506
252496
|
return;
|
|
252507
252497
|
}
|
|
252508
252498
|
subprocess.unref();
|
|
252509
|
-
|
|
252499
|
+
resolve5(subprocess);
|
|
252510
252500
|
});
|
|
252511
252501
|
});
|
|
252512
252502
|
});
|
|
252513
252503
|
}
|
|
252514
252504
|
subprocess.unref();
|
|
252515
|
-
return new Promise((
|
|
252505
|
+
return new Promise((resolve5, reject) => {
|
|
252516
252506
|
subprocess.once("error", reject);
|
|
252517
252507
|
subprocess.once("spawn", () => {
|
|
252518
252508
|
subprocess.off("error", reject);
|
|
252519
|
-
|
|
252509
|
+
resolve5(subprocess);
|
|
252520
252510
|
});
|
|
252521
252511
|
});
|
|
252522
252512
|
};
|
|
@@ -252779,13 +252769,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
252779
252769
|
}
|
|
252780
252770
|
|
|
252781
252771
|
// src/cli/commands/connectors/pull.ts
|
|
252782
|
-
import { dirname as
|
|
252772
|
+
import { dirname as dirname15, join as join19, resolve as resolve5 } from "node:path";
|
|
252783
252773
|
async function resolveConnectorsDir(options) {
|
|
252784
252774
|
if (!getAppContext().projectRoot) {
|
|
252785
|
-
return
|
|
252775
|
+
return resolve5(options.dir ?? "connectors");
|
|
252786
252776
|
}
|
|
252787
252777
|
const { project: project2 } = await readProjectConfig();
|
|
252788
|
-
return join19(
|
|
252778
|
+
return join19(dirname15(project2.configPath), project2.connectorsDir);
|
|
252789
252779
|
}
|
|
252790
252780
|
async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
|
|
252791
252781
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -252826,10 +252816,10 @@ function getConnectorsPullCommand() {
|
|
|
252826
252816
|
}
|
|
252827
252817
|
|
|
252828
252818
|
// src/cli/commands/connectors/push.ts
|
|
252829
|
-
import { resolve as
|
|
252819
|
+
import { resolve as resolve6 } from "node:path";
|
|
252830
252820
|
async function readConnectorsToPush(options) {
|
|
252831
252821
|
if (!getAppContext().projectRoot) {
|
|
252832
|
-
return readAllConnectors(
|
|
252822
|
+
return readAllConnectors(resolve6(options.dir ?? "connectors"));
|
|
252833
252823
|
}
|
|
252834
252824
|
const { connectors } = await readProjectConfig();
|
|
252835
252825
|
return connectors;
|
|
@@ -253110,15 +253100,6 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
253110
253100
|
};
|
|
253111
253101
|
}
|
|
253112
253102
|
log.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
|
|
253113
|
-
for (const fn of toDeploy) {
|
|
253114
|
-
if (fn.outOfBoundsImports && fn.outOfBoundsImports.length > 0) {
|
|
253115
|
-
for (const { importer, specifier } of fn.outOfBoundsImports) {
|
|
253116
|
-
const rel = importer.includes(fn.name) ? importer.slice(importer.lastIndexOf(fn.name)) : importer;
|
|
253117
|
-
log.error(`[${fn.name}] Cannot import "${specifier}" in ${rel}: the file is outside base44/ and cannot be uploaded. Move it to base44/shared/ to share it across functions, or use an npm:/jsr: specifier for external packages.`);
|
|
253118
|
-
}
|
|
253119
|
-
throw new CLIExitError(1);
|
|
253120
|
-
}
|
|
253121
|
-
}
|
|
253122
253103
|
let completed = 0;
|
|
253123
253104
|
const total = toDeploy.length;
|
|
253124
253105
|
const results = await deployFunctionsSequentially(toDeploy, {
|
|
@@ -253187,10 +253168,10 @@ function getListCommand() {
|
|
|
253187
253168
|
}
|
|
253188
253169
|
|
|
253189
253170
|
// src/cli/commands/functions/pull.ts
|
|
253190
|
-
import { dirname as
|
|
253171
|
+
import { dirname as dirname16, join as join20 } from "node:path";
|
|
253191
253172
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
253192
253173
|
const { project: project2, functions } = await readProjectConfig();
|
|
253193
|
-
const configDir =
|
|
253174
|
+
const configDir = dirname16(project2.configPath);
|
|
253194
253175
|
const functionsDir = join20(configDir, project2.functionsDir);
|
|
253195
253176
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
253196
253177
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
@@ -253250,7 +253231,7 @@ function getFunctionsCommand() {
|
|
|
253250
253231
|
}
|
|
253251
253232
|
|
|
253252
253233
|
// src/cli/commands/project/create.ts
|
|
253253
|
-
import { basename as basename4, resolve as
|
|
253234
|
+
import { basename as basename4, resolve as resolve7 } from "node:path";
|
|
253254
253235
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
253255
253236
|
|
|
253256
253237
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -253404,7 +253385,7 @@ async function createInteractive(options, ctx) {
|
|
|
253404
253385
|
}, ctx);
|
|
253405
253386
|
}
|
|
253406
253387
|
async function createNonInteractive(options, ctx) {
|
|
253407
|
-
ctx.log.info(`Creating a new project at ${
|
|
253388
|
+
ctx.log.info(`Creating a new project at ${resolve7(options.path)}`);
|
|
253408
253389
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
253409
253390
|
return await executeCreate({
|
|
253410
253391
|
template: template2,
|
|
@@ -253426,7 +253407,7 @@ async function executeCreate({
|
|
|
253426
253407
|
}, ctx) {
|
|
253427
253408
|
const { log, runTask: runTask2 } = ctx;
|
|
253428
253409
|
const name2 = rawName.trim();
|
|
253429
|
-
const resolvedPath =
|
|
253410
|
+
const resolvedPath = resolve7(projectPath);
|
|
253430
253411
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
253431
253412
|
return await createProjectFiles({
|
|
253432
253413
|
name: name2,
|
|
@@ -253501,6 +253482,9 @@ async function deployAction({ isNonInteractive, log }, options = {}) {
|
|
|
253501
253482
|
if (authConfig.length > 0) {
|
|
253502
253483
|
summaryLines.push(" - Auth config");
|
|
253503
253484
|
}
|
|
253485
|
+
if (project2.visibility) {
|
|
253486
|
+
summaryLines.push(` - Visibility: ${project2.visibility}`);
|
|
253487
|
+
}
|
|
253504
253488
|
if (project2.site?.outputDirectory) {
|
|
253505
253489
|
summaryLines.push(` - Site from ${project2.site.outputDirectory}`);
|
|
253506
253490
|
}
|
|
@@ -253522,6 +253506,9 @@ ${summaryLines.join(`
|
|
|
253522
253506
|
let functionCompleted = 0;
|
|
253523
253507
|
const functionTotal = functions.length;
|
|
253524
253508
|
const result = await deployAll(projectData, {
|
|
253509
|
+
onVisibilitySet: (level) => {
|
|
253510
|
+
log.success(`App visibility set to ${level}`);
|
|
253511
|
+
},
|
|
253525
253512
|
onFunctionStart: (names) => {
|
|
253526
253513
|
const label = names.length === 1 ? names[0] : `${names.length} functions`;
|
|
253527
253514
|
log.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
|
|
@@ -253822,7 +253809,7 @@ async function followLogs(functionNames, options, availableFunctionNames, jsonMo
|
|
|
253822
253809
|
for (const entry of fresh)
|
|
253823
253810
|
writeFollowLine(entry, jsonMode);
|
|
253824
253811
|
first = false;
|
|
253825
|
-
await new Promise((
|
|
253812
|
+
await new Promise((resolve8) => setTimeout(resolve8, 2000));
|
|
253826
253813
|
}
|
|
253827
253814
|
}
|
|
253828
253815
|
function formatLogs(entries, env3) {
|
|
@@ -253871,7 +253858,8 @@ async function fetchLogsForFunctions(functionNames, options, availableFunctionNa
|
|
|
253871
253858
|
}
|
|
253872
253859
|
throw error48;
|
|
253873
253860
|
}
|
|
253874
|
-
|
|
253861
|
+
const matchingLogs = filters.level ? logs.filter((entry) => entry.level === filters.level) : logs;
|
|
253862
|
+
allEntries.push(...matchingLogs.map((entry) => normalizeLogEntry(entry, functionName)));
|
|
253875
253863
|
}
|
|
253876
253864
|
if (functionNames.length > 1) {
|
|
253877
253865
|
const order = options.order?.toUpperCase() === "ASC" ? 1 : -1;
|
|
@@ -253935,7 +253923,7 @@ function getLogsCommand() {
|
|
|
253935
253923
|
}
|
|
253936
253924
|
|
|
253937
253925
|
// src/cli/commands/project/scaffold.ts
|
|
253938
|
-
import { basename as basename5, resolve as
|
|
253926
|
+
import { basename as basename5, resolve as resolve8 } from "node:path";
|
|
253939
253927
|
function resolveAppId(options) {
|
|
253940
253928
|
const appId = options.appId;
|
|
253941
253929
|
if (!appId) {
|
|
@@ -253951,7 +253939,7 @@ function resolveAppId(options) {
|
|
|
253951
253939
|
async function scaffoldAction(ctx, name2, options, command2) {
|
|
253952
253940
|
const { log, runTask: runTask2 } = ctx;
|
|
253953
253941
|
const appId = resolveAppId(command2.optsWithGlobals());
|
|
253954
|
-
const resolvedPath =
|
|
253942
|
+
const resolvedPath = resolve8("./");
|
|
253955
253943
|
const projectName = (name2 ?? basename5(resolvedPath)).trim();
|
|
253956
253944
|
const template2 = await getTemplateById("backend-only");
|
|
253957
253945
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
@@ -253988,6 +253976,17 @@ Examples:
|
|
|
253988
253976
|
$ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
|
|
253989
253977
|
}
|
|
253990
253978
|
|
|
253979
|
+
// src/cli/commands/project/visibility.ts
|
|
253980
|
+
async function setVisibility({ runTask: runTask2 }, level) {
|
|
253981
|
+
await runTask2(`Setting app visibility to ${level}`, () => setAppVisibility(level));
|
|
253982
|
+
return { outroMessage: `App visibility set to ${level}` };
|
|
253983
|
+
}
|
|
253984
|
+
function getVisibilityCommand() {
|
|
253985
|
+
return new Base44Command("visibility").description("Set the app's visibility on the server (public, private, or workspace)").addArgument(new Argument("<level>", "Visibility level").choices([
|
|
253986
|
+
...VISIBILITY_LEVELS
|
|
253987
|
+
])).action(setVisibility);
|
|
253988
|
+
}
|
|
253989
|
+
|
|
253991
253990
|
// src/core/resources/sandbox/schema.ts
|
|
253992
253991
|
var FileErrorSchema = exports_external.object({
|
|
253993
253992
|
code: exports_external.string(),
|
|
@@ -254341,7 +254340,7 @@ function getSecretsListCommand() {
|
|
|
254341
254340
|
}
|
|
254342
254341
|
|
|
254343
254342
|
// src/cli/commands/secrets/set.ts
|
|
254344
|
-
import { resolve as
|
|
254343
|
+
import { resolve as resolve9 } from "node:path";
|
|
254345
254344
|
function parseEntries(entries) {
|
|
254346
254345
|
const secrets = {};
|
|
254347
254346
|
for (const entry of entries) {
|
|
@@ -254372,7 +254371,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
254372
254371
|
validateInput(entries, options);
|
|
254373
254372
|
let secrets;
|
|
254374
254373
|
if (options.envFile) {
|
|
254375
|
-
secrets = await parseEnvFile(
|
|
254374
|
+
secrets = await parseEnvFile(resolve9(options.envFile));
|
|
254376
254375
|
if (Object.keys(secrets).length === 0) {
|
|
254377
254376
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
254378
254377
|
}
|
|
@@ -254401,7 +254400,7 @@ function getSecretsCommand() {
|
|
|
254401
254400
|
}
|
|
254402
254401
|
|
|
254403
254402
|
// src/cli/commands/site/deploy.ts
|
|
254404
|
-
import { resolve as
|
|
254403
|
+
import { resolve as resolve10 } from "node:path";
|
|
254405
254404
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
254406
254405
|
if (isNonInteractive && !options.yes) {
|
|
254407
254406
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -254416,7 +254415,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
254416
254415
|
]
|
|
254417
254416
|
});
|
|
254418
254417
|
}
|
|
254419
|
-
const outputDir =
|
|
254418
|
+
const outputDir = resolve10(project2.root, project2.site.outputDirectory);
|
|
254420
254419
|
if (!options.yes) {
|
|
254421
254420
|
const shouldDeploy = await Re({
|
|
254422
254421
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -254595,7 +254594,7 @@ function getTypesCommand() {
|
|
|
254595
254594
|
// src/cli/dev/dev-server/main.ts
|
|
254596
254595
|
var import_cors = __toESM(require_lib4(), 1);
|
|
254597
254596
|
var import_express6 = __toESM(require_express(), 1);
|
|
254598
|
-
import { dirname as
|
|
254597
|
+
import { dirname as dirname21, join as join27 } from "node:path";
|
|
254599
254598
|
|
|
254600
254599
|
// ../../node_modules/get-port/index.js
|
|
254601
254600
|
import net from "node:net";
|
|
@@ -254622,14 +254621,14 @@ var getLocalHosts = () => {
|
|
|
254622
254621
|
}
|
|
254623
254622
|
return results;
|
|
254624
254623
|
};
|
|
254625
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
254624
|
+
var checkAvailablePort = (options8) => new Promise((resolve12, reject) => {
|
|
254626
254625
|
const server = net.createServer();
|
|
254627
254626
|
server.unref();
|
|
254628
254627
|
server.on("error", reject);
|
|
254629
254628
|
server.listen(options8, () => {
|
|
254630
254629
|
const { port } = server.address();
|
|
254631
254630
|
server.close(() => {
|
|
254632
|
-
|
|
254631
|
+
resolve12(port);
|
|
254633
254632
|
});
|
|
254634
254633
|
});
|
|
254635
254634
|
});
|
|
@@ -254888,7 +254887,7 @@ class FunctionManager {
|
|
|
254888
254887
|
});
|
|
254889
254888
|
}
|
|
254890
254889
|
waitForReady(name2, runningFunc) {
|
|
254891
|
-
return new Promise((
|
|
254890
|
+
return new Promise((resolve12, reject) => {
|
|
254892
254891
|
runningFunc.process.on("exit", (code2) => {
|
|
254893
254892
|
if (!runningFunc.ready) {
|
|
254894
254893
|
clearTimeout(timeout3);
|
|
@@ -254911,7 +254910,7 @@ class FunctionManager {
|
|
|
254911
254910
|
runningFunc.ready = true;
|
|
254912
254911
|
clearTimeout(timeout3);
|
|
254913
254912
|
runningFunc.process.stdout?.off("data", onData);
|
|
254914
|
-
|
|
254913
|
+
resolve12(runningFunc.port);
|
|
254915
254914
|
}
|
|
254916
254915
|
};
|
|
254917
254916
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -256169,15 +256168,15 @@ class ServeRunner {
|
|
|
256169
256168
|
return;
|
|
256170
256169
|
}
|
|
256171
256170
|
this.stopping = true;
|
|
256172
|
-
const exited = new Promise((
|
|
256171
|
+
const exited = new Promise((resolve12) => child.once("exit", () => resolve12()));
|
|
256173
256172
|
if (process21.platform === "win32" && child.pid) {
|
|
256174
256173
|
const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
|
|
256175
256174
|
stdio: "ignore",
|
|
256176
256175
|
windowsHide: true
|
|
256177
256176
|
});
|
|
256178
|
-
await new Promise((
|
|
256179
|
-
taskkill.once("exit", () =>
|
|
256180
|
-
taskkill.once("error", () =>
|
|
256177
|
+
await new Promise((resolve12) => {
|
|
256178
|
+
taskkill.once("exit", () => resolve12());
|
|
256179
|
+
taskkill.once("error", () => resolve12());
|
|
256181
256180
|
});
|
|
256182
256181
|
} else if (child.pid) {
|
|
256183
256182
|
try {
|
|
@@ -256223,7 +256222,7 @@ class ServeRunner {
|
|
|
256223
256222
|
|
|
256224
256223
|
// src/cli/dev/dev-server/watcher.ts
|
|
256225
256224
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
256226
|
-
import { relative as
|
|
256225
|
+
import { relative as relative6 } from "node:path";
|
|
256227
256226
|
|
|
256228
256227
|
// ../../node_modules/chokidar/index.js
|
|
256229
256228
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
@@ -256953,9 +256952,9 @@ class NodeFsHandler {
|
|
|
256953
256952
|
if (this.fsw.closed) {
|
|
256954
256953
|
return;
|
|
256955
256954
|
}
|
|
256956
|
-
const
|
|
256955
|
+
const dirname20 = sp2.dirname(file2);
|
|
256957
256956
|
const basename7 = sp2.basename(file2);
|
|
256958
|
-
const parent = this.fsw._getWatchedDir(
|
|
256957
|
+
const parent = this.fsw._getWatchedDir(dirname20);
|
|
256959
256958
|
let prevStats = stats;
|
|
256960
256959
|
if (parent.has(basename7))
|
|
256961
256960
|
return;
|
|
@@ -256982,7 +256981,7 @@ class NodeFsHandler {
|
|
|
256982
256981
|
prevStats = newStats2;
|
|
256983
256982
|
}
|
|
256984
256983
|
} catch (error48) {
|
|
256985
|
-
this.fsw._remove(
|
|
256984
|
+
this.fsw._remove(dirname20, basename7);
|
|
256986
256985
|
}
|
|
256987
256986
|
} else if (parent.has(basename7)) {
|
|
256988
256987
|
const at13 = newStats.atimeMs;
|
|
@@ -257071,7 +257070,7 @@ class NodeFsHandler {
|
|
|
257071
257070
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
257072
257071
|
}
|
|
257073
257072
|
}).on(EV.ERROR, this._boundHandleError);
|
|
257074
|
-
return new Promise((
|
|
257073
|
+
return new Promise((resolve13, reject) => {
|
|
257075
257074
|
if (!stream)
|
|
257076
257075
|
return reject();
|
|
257077
257076
|
stream.once(STR_END, () => {
|
|
@@ -257080,7 +257079,7 @@ class NodeFsHandler {
|
|
|
257080
257079
|
return;
|
|
257081
257080
|
}
|
|
257082
257081
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
257083
|
-
|
|
257082
|
+
resolve13(undefined);
|
|
257084
257083
|
previous.getChildren().filter((item) => {
|
|
257085
257084
|
return item !== directory && !current.has(item);
|
|
257086
257085
|
}).forEach((item) => {
|
|
@@ -257205,11 +257204,11 @@ function createPattern(matcher) {
|
|
|
257205
257204
|
if (matcher.path === string4)
|
|
257206
257205
|
return true;
|
|
257207
257206
|
if (matcher.recursive) {
|
|
257208
|
-
const
|
|
257209
|
-
if (!
|
|
257207
|
+
const relative6 = sp3.relative(matcher.path, string4);
|
|
257208
|
+
if (!relative6) {
|
|
257210
257209
|
return false;
|
|
257211
257210
|
}
|
|
257212
|
-
return !
|
|
257211
|
+
return !relative6.startsWith("..") && !sp3.isAbsolute(relative6);
|
|
257213
257212
|
}
|
|
257214
257213
|
return false;
|
|
257215
257214
|
};
|
|
@@ -257908,7 +257907,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
257908
257907
|
ignoreInitial: true
|
|
257909
257908
|
});
|
|
257910
257909
|
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
257911
|
-
this.emit("change", name2,
|
|
257910
|
+
this.emit("change", name2, relative6(targetPath, path19));
|
|
257912
257911
|
}, WATCH_DEBOUNCE_MS));
|
|
257913
257912
|
watcher.on("error", (err) => {
|
|
257914
257913
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -257997,7 +257996,7 @@ async function createDevServer(options8) {
|
|
|
257997
257996
|
}
|
|
257998
257997
|
remoteProxy(req, res, next);
|
|
257999
257998
|
});
|
|
258000
|
-
const server = await new Promise((
|
|
257999
|
+
const server = await new Promise((resolve14, reject) => {
|
|
258001
258000
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
258002
258001
|
if (err) {
|
|
258003
258002
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -258006,7 +258005,7 @@ async function createDevServer(options8) {
|
|
|
258006
258005
|
reject(err);
|
|
258007
258006
|
}
|
|
258008
258007
|
} else {
|
|
258009
|
-
|
|
258008
|
+
resolve14(s5);
|
|
258010
258009
|
}
|
|
258011
258010
|
});
|
|
258012
258011
|
});
|
|
@@ -258015,8 +258014,8 @@ async function createDevServer(options8) {
|
|
|
258015
258014
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
258016
258015
|
};
|
|
258017
258016
|
const base44ConfigWatcher = new WatchBase44({
|
|
258018
|
-
functions: join27(
|
|
258019
|
-
entities: join27(
|
|
258017
|
+
functions: join27(dirname21(project2.configPath), project2.functionsDir),
|
|
258018
|
+
entities: join27(dirname21(project2.configPath), project2.entitiesDir)
|
|
258020
258019
|
}, devLogger);
|
|
258021
258020
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
258022
258021
|
try {
|
|
@@ -258069,13 +258068,13 @@ async function createDevServer(options8) {
|
|
|
258069
258068
|
if (!server.listening) {
|
|
258070
258069
|
return;
|
|
258071
258070
|
}
|
|
258072
|
-
await new Promise((
|
|
258071
|
+
await new Promise((resolve14, reject) => {
|
|
258073
258072
|
server.close((error48) => {
|
|
258074
258073
|
if (error48) {
|
|
258075
258074
|
reject(error48);
|
|
258076
258075
|
return;
|
|
258077
258076
|
}
|
|
258078
|
-
|
|
258077
|
+
resolve14();
|
|
258079
258078
|
});
|
|
258080
258079
|
});
|
|
258081
258080
|
};
|
|
@@ -258184,13 +258183,13 @@ async function runScript(options8) {
|
|
|
258184
258183
|
}
|
|
258185
258184
|
// src/cli/commands/exec.ts
|
|
258186
258185
|
function readStdin2() {
|
|
258187
|
-
return new Promise((
|
|
258186
|
+
return new Promise((resolve14, reject) => {
|
|
258188
258187
|
let data = "";
|
|
258189
258188
|
process.stdin.setEncoding("utf-8");
|
|
258190
258189
|
process.stdin.on("data", (chunk) => {
|
|
258191
258190
|
data += chunk;
|
|
258192
258191
|
});
|
|
258193
|
-
process.stdin.on("end", () =>
|
|
258192
|
+
process.stdin.on("end", () => resolve14(data));
|
|
258194
258193
|
process.stdin.on("error", reject);
|
|
258195
258194
|
});
|
|
258196
258195
|
}
|
|
@@ -258232,7 +258231,7 @@ Examples:
|
|
|
258232
258231
|
}
|
|
258233
258232
|
|
|
258234
258233
|
// src/cli/commands/project/eject.ts
|
|
258235
|
-
import { resolve as
|
|
258234
|
+
import { resolve as resolve14 } from "node:path";
|
|
258236
258235
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
258237
258236
|
async function eject(ctx, options8, command2) {
|
|
258238
258237
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -258296,7 +258295,7 @@ async function eject(ctx, options8, command2) {
|
|
|
258296
258295
|
Ne("Operation cancelled.");
|
|
258297
258296
|
throw new CLIExitError(0);
|
|
258298
258297
|
}
|
|
258299
|
-
const resolvedPath =
|
|
258298
|
+
const resolvedPath = resolve14(selectedPath);
|
|
258300
258299
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
258301
258300
|
await createProjectFilesForExistingProject({
|
|
258302
258301
|
projectId,
|
|
@@ -258359,6 +258358,7 @@ function createProgram(context) {
|
|
|
258359
258358
|
program2.addCommand(getScaffoldCommand());
|
|
258360
258359
|
program2.addCommand(getDashboardCommand());
|
|
258361
258360
|
program2.addCommand(getDeployCommand2());
|
|
258361
|
+
program2.addCommand(getVisibilityCommand());
|
|
258362
258362
|
program2.addCommand(getLinkCommand());
|
|
258363
258363
|
program2.addCommand(getEjectCommand());
|
|
258364
258364
|
program2.addCommand(getEntitiesPushCommand());
|
|
@@ -258381,7 +258381,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
258381
258381
|
import { release, type } from "node:os";
|
|
258382
258382
|
|
|
258383
258383
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
258384
|
-
import { dirname as
|
|
258384
|
+
import { dirname as dirname22, posix, sep } from "path";
|
|
258385
258385
|
function createModulerModifier() {
|
|
258386
258386
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
258387
258387
|
return async (frames) => {
|
|
@@ -258390,7 +258390,7 @@ function createModulerModifier() {
|
|
|
258390
258390
|
return frames;
|
|
258391
258391
|
};
|
|
258392
258392
|
}
|
|
258393
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
258393
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname22(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
258394
258394
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
258395
258395
|
return (filename) => {
|
|
258396
258396
|
if (!filename)
|
|
@@ -260668,14 +260668,14 @@ async function addSourceContext(frames) {
|
|
|
260668
260668
|
return frames;
|
|
260669
260669
|
}
|
|
260670
260670
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
260671
|
-
return new Promise((
|
|
260671
|
+
return new Promise((resolve15) => {
|
|
260672
260672
|
const stream = createReadStream2(path19);
|
|
260673
260673
|
const lineReaded = createInterface2({
|
|
260674
260674
|
input: stream
|
|
260675
260675
|
});
|
|
260676
260676
|
function destroyStreamAndResolve() {
|
|
260677
260677
|
stream.destroy();
|
|
260678
|
-
|
|
260678
|
+
resolve15();
|
|
260679
260679
|
}
|
|
260680
260680
|
let lineNumber = 0;
|
|
260681
260681
|
let currentRangeIndex = 0;
|
|
@@ -261787,15 +261787,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
261787
261787
|
return true;
|
|
261788
261788
|
if (this.featureFlagsPoller === undefined)
|
|
261789
261789
|
return false;
|
|
261790
|
-
return new Promise((
|
|
261790
|
+
return new Promise((resolve15) => {
|
|
261791
261791
|
const timeout3 = setTimeout(() => {
|
|
261792
261792
|
cleanup();
|
|
261793
|
-
|
|
261793
|
+
resolve15(false);
|
|
261794
261794
|
}, timeoutMs);
|
|
261795
261795
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
261796
261796
|
clearTimeout(timeout3);
|
|
261797
261797
|
cleanup();
|
|
261798
|
-
|
|
261798
|
+
resolve15(count2 > 0);
|
|
261799
261799
|
});
|
|
261800
261800
|
});
|
|
261801
261801
|
}
|
|
@@ -262579,7 +262579,7 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
262579
262579
|
});
|
|
262580
262580
|
}
|
|
262581
262581
|
// src/cli/index.ts
|
|
262582
|
-
var __dirname4 =
|
|
262582
|
+
var __dirname4 = dirname23(fileURLToPath6(import.meta.url));
|
|
262583
262583
|
async function runCLI(options8) {
|
|
262584
262584
|
ensureNpmAssets(join28(__dirname4, "../assets"));
|
|
262585
262585
|
const errorReporter = new ErrorReporter;
|
|
@@ -262620,4 +262620,4 @@ export {
|
|
|
262620
262620
|
CLIExitError
|
|
262621
262621
|
};
|
|
262622
262622
|
|
|
262623
|
-
//# debugId=
|
|
262623
|
+
//# debugId=278D22E76D79024164756E2164756E21
|