@base44-preview/cli 0.1.2-pr.561.234c4ed → 0.1.2-pr.563.37a52bb
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 +347 -215
- package/dist/cli/index.js.map +13 -12
- package/package.json +1 -1
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 dirname10 = path11.dirname;
|
|
12984
|
+
var extname2 = path11.extname;
|
|
12985
|
+
var resolve4 = path11.resolve;
|
|
12986
|
+
var includePath = resolve4(isDir ? filename : dirname10(filename), name2);
|
|
12987
|
+
var ext = extname2(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(resolve4, reject) {
|
|
13062
13062
|
try {
|
|
13063
13063
|
result = handleCache(options)(data);
|
|
13064
|
-
|
|
13064
|
+
resolve4(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(resolve5, reject) {
|
|
16503
16503
|
isexe(path11, options || {}, function(er, is) {
|
|
16504
16504
|
if (er) {
|
|
16505
16505
|
reject(er);
|
|
16506
16506
|
} else {
|
|
16507
|
-
|
|
16507
|
+
resolve5(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((resolve5, reject) => {
|
|
16570
16570
|
if (i === pathEnv.length)
|
|
16571
|
-
return opt.all && found.length ?
|
|
16571
|
+
return opt.all && found.length ? resolve5(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
|
+
resolve5(subStep(p, i, 0));
|
|
16577
16577
|
});
|
|
16578
|
-
const subStep = (p, i, ii) => new Promise((
|
|
16578
|
+
const subStep = (p, i, ii) => new Promise((resolve5, reject) => {
|
|
16579
16579
|
if (ii === pathExt.length)
|
|
16580
|
-
return
|
|
16580
|
+
return resolve5(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 resolve5(p + ext);
|
|
16588
16588
|
}
|
|
16589
|
-
return
|
|
16589
|
+
return resolve5(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 extname2(url3) {
|
|
121160
121160
|
const pathname = url3.pathname;
|
|
121161
121161
|
let index = pathname.length;
|
|
121162
121162
|
while (index--) {
|
|
@@ -121171,7 +121171,7 @@ function extname(url3) {
|
|
|
121171
121171
|
return "";
|
|
121172
121172
|
}
|
|
121173
121173
|
function getFileProtocolModuleFormat(url3, _context, ignoreErrors) {
|
|
121174
|
-
const value =
|
|
121174
|
+
const value = extname2(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(resolve14) {
|
|
138273
|
+
resolve14(value);
|
|
138274
138274
|
});
|
|
138275
138275
|
}
|
|
138276
|
-
return new (P9 || (P9 = Promise))(function(
|
|
138276
|
+
return new (P9 || (P9 = Promise))(function(resolve14, 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 ? resolve14(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 = resolve14;
|
|
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 = relative5;
|
|
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 resolve14(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 relative5(from, to5) {
|
|
143108
143108
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
143109
|
-
return
|
|
143109
|
+
return resolve14(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((resolve14, 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
|
+
resolve14({
|
|
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(resolve14) {
|
|
145147
|
+
resolve14(value);
|
|
145148
145148
|
});
|
|
145149
145149
|
}
|
|
145150
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145150
|
+
return new (P9 || (P9 = Promise))(function(resolve14, 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 ? resolve14(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(resolve14) {
|
|
145288
|
+
resolve14(value);
|
|
145289
145289
|
});
|
|
145290
145290
|
}
|
|
145291
|
-
return new (P9 || (P9 = Promise))(function(
|
|
145291
|
+
return new (P9 || (P9 = Promise))(function(resolve14, 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 ? resolve14(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 relative5 = __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 relative5(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(resolve14, reject) {
|
|
150823
150823
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
150824
150824
|
if (err)
|
|
150825
150825
|
return reject(err);
|
|
150826
|
-
|
|
150826
|
+
resolve14(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 extname3 = __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 = extname3("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 dirname20 = path18.dirname;
|
|
163948
163948
|
var basename6 = path18.basename;
|
|
163949
|
-
var
|
|
163949
|
+
var extname3 = path18.extname;
|
|
163950
163950
|
var join25 = path18.join;
|
|
163951
|
-
var
|
|
163951
|
+
var resolve14 = 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 = extname3(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 = resolve14(root2, name2);
|
|
163986
|
+
var dir = dirname20(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 resolve15(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 resolve14 = __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", resolve14("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 extname3 = path18.extname;
|
|
167712
167712
|
var join25 = path18.join;
|
|
167713
167713
|
var normalize2 = path18.normalize;
|
|
167714
|
-
var
|
|
167714
|
+
var resolve14 = 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 ? resolve14(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 = resolve14(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" && !extname3(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 = extname3(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 extname3 = path18.extname;
|
|
168220
|
+
var resolve14 = 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 ? resolve14(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(extname3(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 resolve14 = __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 = resolve14(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(relative5, base) {
|
|
169634
|
+
return useNativeURL ? new URL2(relative5, base) : parseUrl(url3.resolve(base, relative5));
|
|
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((resolve14) => {
|
|
172084
|
+
this._triggerBuffer = resolve14;
|
|
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((resolve14, 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
|
+
resolve14();
|
|
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((resolve14, 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
|
+
resolve14({ 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 extname3 = __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 = extname3("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 extname3 = __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 = extname3("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((resolve14, 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 resolve14(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((resolve14, reject) => {
|
|
199141
199141
|
args.push((arg1, arg2) => {
|
|
199142
199142
|
if (withErr) {
|
|
199143
|
-
return arg1 ? reject(arg1) :
|
|
199143
|
+
return arg1 ? reject(arg1) : resolve14(arg2);
|
|
199144
199144
|
} else {
|
|
199145
|
-
return
|
|
199145
|
+
return resolve14(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((resolve14, 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 resolve14(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((resolve14, 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: resolve14,
|
|
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((resolve14, 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: resolve14,
|
|
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((resolve14) => {
|
|
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
|
+
resolve14();
|
|
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 extname3 = __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 = extname3("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 resolve14 = iter[kLastResolve];
|
|
215918
|
+
if (resolve14 !== 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
|
+
resolve14(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(resolve14, reject) {
|
|
215933
215933
|
lastPromise.then(function() {
|
|
215934
215934
|
if (iter[kEnded]) {
|
|
215935
|
-
|
|
215935
|
+
resolve14(createIterResult(undefined, true));
|
|
215936
215936
|
return;
|
|
215937
215937
|
}
|
|
215938
|
-
iter[kHandlePromise](
|
|
215938
|
+
iter[kHandlePromise](resolve14, 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(resolve14, reject) {
|
|
215958
215958
|
process.nextTick(function() {
|
|
215959
215959
|
if (_this[kError]) {
|
|
215960
215960
|
reject(_this[kError]);
|
|
215961
215961
|
} else {
|
|
215962
|
-
|
|
215962
|
+
resolve14(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(resolve14, reject) {
|
|
215986
215986
|
_this2[kStream].destroy(null, function(err) {
|
|
215987
215987
|
if (err) {
|
|
215988
215988
|
reject(err);
|
|
215989
215989
|
return;
|
|
215990
215990
|
}
|
|
215991
|
-
|
|
215991
|
+
resolve14(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(resolve14, 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
|
+
resolve14(createIterResult(data, false));
|
|
216020
216020
|
} else {
|
|
216021
|
-
iterator[kLastResolve] =
|
|
216021
|
+
iterator[kLastResolve] = resolve14;
|
|
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 resolve14 = iterator[kLastResolve];
|
|
216041
|
+
if (resolve14 !== null) {
|
|
216042
216042
|
iterator[kLastPromise] = null;
|
|
216043
216043
|
iterator[kLastResolve] = null;
|
|
216044
216044
|
iterator[kLastReject] = null;
|
|
216045
|
-
|
|
216045
|
+
resolve14(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, resolve14, 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
|
+
resolve14(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(resolve14, reject) {
|
|
216075
216075
|
var gen = fn9.apply(self2, args);
|
|
216076
216076
|
function _next(value) {
|
|
216077
|
-
asyncGeneratorStep(gen,
|
|
216077
|
+
asyncGeneratorStep(gen, resolve14, reject, _next, _throw, "next", value);
|
|
216078
216078
|
}
|
|
216079
216079
|
function _throw(err) {
|
|
216080
|
-
asyncGeneratorStep(gen,
|
|
216080
|
+
asyncGeneratorStep(gen, resolve14, 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) {
|
|
@@ -234018,7 +234028,7 @@ function normalizeBase44Env() {
|
|
|
234018
234028
|
loadProjectEnvFiles();
|
|
234019
234029
|
|
|
234020
234030
|
// src/cli/index.ts
|
|
234021
|
-
import { dirname as
|
|
234031
|
+
import { dirname as dirname24, join as join28 } from "node:path";
|
|
234022
234032
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
234023
234033
|
|
|
234024
234034
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -235226,7 +235236,7 @@ var {
|
|
|
235226
235236
|
} = import__.default;
|
|
235227
235237
|
|
|
235228
235238
|
// src/cli/commands/agents/pull.ts
|
|
235229
|
-
import { dirname as
|
|
235239
|
+
import { dirname as dirname11, join as join14 } from "node:path";
|
|
235230
235240
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
235231
235241
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
235232
235242
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -236102,7 +236112,19 @@ function getTestOverrides() {
|
|
|
236102
236112
|
|
|
236103
236113
|
// src/core/auth/config.ts
|
|
236104
236114
|
var TOKEN_REFRESH_BUFFER_MS = 60 * 1000;
|
|
236115
|
+
var WORKSPACE_API_KEY_PREFIX = "b44k_";
|
|
236105
236116
|
var refreshPromise = null;
|
|
236117
|
+
function getWorkspaceApiKeyFromEnv() {
|
|
236118
|
+
const key = process.env.BASE44_API_KEY?.trim();
|
|
236119
|
+
return key ? key : null;
|
|
236120
|
+
}
|
|
236121
|
+
function isWorkspaceApiKey(value) {
|
|
236122
|
+
return value.startsWith(WORKSPACE_API_KEY_PREFIX);
|
|
236123
|
+
}
|
|
236124
|
+
function hasWorkspaceApiKeyAuth() {
|
|
236125
|
+
const key = getWorkspaceApiKeyFromEnv();
|
|
236126
|
+
return key !== null && isWorkspaceApiKey(key);
|
|
236127
|
+
}
|
|
236106
236128
|
async function seedAuthFromEnv() {
|
|
236107
236129
|
const accessToken = process.env.BASE44_ACCESS_TOKEN;
|
|
236108
236130
|
if (!accessToken) {
|
|
@@ -241894,7 +241916,7 @@ async function getSiteUrl() {
|
|
|
241894
241916
|
return result.data.url;
|
|
241895
241917
|
}
|
|
241896
241918
|
// src/core/project/config.ts
|
|
241897
|
-
import { dirname as
|
|
241919
|
+
import { dirname as dirname9, join as join10 } from "node:path";
|
|
241898
241920
|
|
|
241899
241921
|
// src/core/project/plugins.ts
|
|
241900
241922
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -243424,9 +243446,14 @@ var FunctionConfigSchema = exports_external.object({
|
|
|
243424
243446
|
entry: exports_external.string().min(1, "Entry point cannot be empty"),
|
|
243425
243447
|
automations: exports_external.array(AutomationSchema).optional()
|
|
243426
243448
|
});
|
|
243449
|
+
var OutOfBoundsImportSchema = exports_external.object({
|
|
243450
|
+
importer: exports_external.string(),
|
|
243451
|
+
specifier: exports_external.string()
|
|
243452
|
+
});
|
|
243427
243453
|
var BackendFunctionSchema = FunctionConfigSchema.extend({
|
|
243428
243454
|
entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
|
|
243429
243455
|
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file"),
|
|
243456
|
+
outOfBoundsImports: exports_external.array(OutOfBoundsImportSchema).optional().default([]),
|
|
243430
243457
|
source: ResourceSourceSchema
|
|
243431
243458
|
});
|
|
243432
243459
|
var DeploySingleFunctionResponseSchema = exports_external.object({
|
|
@@ -243536,7 +243563,75 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
243536
243563
|
return result.data;
|
|
243537
243564
|
}
|
|
243538
243565
|
// src/core/resources/function/config.ts
|
|
243539
|
-
import { basename as basename3, dirname as
|
|
243566
|
+
import { basename as basename3, dirname as dirname7, join as join8, relative as relative2, resolve as resolve3 } from "node:path";
|
|
243567
|
+
|
|
243568
|
+
// src/core/resources/function/reachability.ts
|
|
243569
|
+
import { dirname as dirname6, extname, relative, resolve as resolve2 } from "node:path";
|
|
243570
|
+
var RELATIVE_IMPORT_RE = /(?:from|import|require)\s*\(?['"`](\.\.?\/[^'"`\s]+)['"`]/g;
|
|
243571
|
+
async function resolveSpecifier(specifier, fromDir) {
|
|
243572
|
+
const base = resolve2(fromDir, specifier);
|
|
243573
|
+
const ext = extname(base);
|
|
243574
|
+
if (ext) {
|
|
243575
|
+
if (ext === ".js") {
|
|
243576
|
+
const asTts = `${base.slice(0, -3)}.ts`;
|
|
243577
|
+
if (await pathExists(asTts))
|
|
243578
|
+
return asTts;
|
|
243579
|
+
}
|
|
243580
|
+
if (await pathExists(base))
|
|
243581
|
+
return base;
|
|
243582
|
+
return null;
|
|
243583
|
+
}
|
|
243584
|
+
for (const candidate of [
|
|
243585
|
+
`${base}.ts`,
|
|
243586
|
+
`${base}.js`,
|
|
243587
|
+
`${base}.json`,
|
|
243588
|
+
resolve2(base, "index.ts"),
|
|
243589
|
+
resolve2(base, "index.js")
|
|
243590
|
+
]) {
|
|
243591
|
+
if (await pathExists(candidate))
|
|
243592
|
+
return candidate;
|
|
243593
|
+
}
|
|
243594
|
+
return null;
|
|
243595
|
+
}
|
|
243596
|
+
async function collectReachableBackendFiles(_entryPath, functionFilePaths, backendRoot) {
|
|
243597
|
+
const visited = new Set(functionFilePaths);
|
|
243598
|
+
const queue = [...functionFilePaths];
|
|
243599
|
+
const extra = [];
|
|
243600
|
+
const outOfBounds = [];
|
|
243601
|
+
while (queue.length > 0) {
|
|
243602
|
+
const filePath = queue.shift();
|
|
243603
|
+
let content;
|
|
243604
|
+
try {
|
|
243605
|
+
content = await readTextFile(filePath);
|
|
243606
|
+
} catch {
|
|
243607
|
+
continue;
|
|
243608
|
+
}
|
|
243609
|
+
const dir = dirname6(filePath);
|
|
243610
|
+
for (const match of content.matchAll(RELATIVE_IMPORT_RE)) {
|
|
243611
|
+
const specifier = match[1];
|
|
243612
|
+
const resolved = await resolveSpecifier(specifier, dir);
|
|
243613
|
+
if (!resolved)
|
|
243614
|
+
continue;
|
|
243615
|
+
const rel = relative(backendRoot, resolved);
|
|
243616
|
+
if (rel.startsWith("..")) {
|
|
243617
|
+
outOfBounds.push({ importer: filePath, specifier });
|
|
243618
|
+
continue;
|
|
243619
|
+
}
|
|
243620
|
+
if (!visited.has(resolved)) {
|
|
243621
|
+
visited.add(resolved);
|
|
243622
|
+
queue.push(resolved);
|
|
243623
|
+
extra.push(resolved);
|
|
243624
|
+
}
|
|
243625
|
+
}
|
|
243626
|
+
}
|
|
243627
|
+
const functionSet = new Set(functionFilePaths);
|
|
243628
|
+
return {
|
|
243629
|
+
extra: extra.filter((p) => !functionSet.has(p)),
|
|
243630
|
+
outOfBounds
|
|
243631
|
+
};
|
|
243632
|
+
}
|
|
243633
|
+
|
|
243634
|
+
// src/core/resources/function/config.ts
|
|
243540
243635
|
async function readFunctionConfig(configPath) {
|
|
243541
243636
|
const parsed = await readJsonFile(configPath);
|
|
243542
243637
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -243545,9 +243640,9 @@ async function readFunctionConfig(configPath) {
|
|
|
243545
243640
|
}
|
|
243546
243641
|
return result.data;
|
|
243547
243642
|
}
|
|
243548
|
-
async function readFunction(configPath) {
|
|
243643
|
+
async function readFunction(configPath, backendRoot) {
|
|
243549
243644
|
const config7 = await readFunctionConfig(configPath);
|
|
243550
|
-
const functionDir =
|
|
243645
|
+
const functionDir = dirname7(configPath);
|
|
243551
243646
|
const entryPath = join8(functionDir, config7.entry);
|
|
243552
243647
|
if (!await pathExists(entryPath)) {
|
|
243553
243648
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
@@ -243558,10 +243653,13 @@ async function readFunction(configPath) {
|
|
|
243558
243653
|
cwd: functionDir,
|
|
243559
243654
|
absolute: true
|
|
243560
243655
|
});
|
|
243656
|
+
const { extra, outOfBounds } = await collectReachableBackendFiles(entryPath, filePaths, backendRoot);
|
|
243657
|
+
const allFilePaths = [...new Set([...filePaths, ...extra])];
|
|
243561
243658
|
const functionData = {
|
|
243562
243659
|
...config7,
|
|
243563
243660
|
entryPath,
|
|
243564
|
-
filePaths,
|
|
243661
|
+
filePaths: allFilePaths,
|
|
243662
|
+
outOfBoundsImports: outOfBounds,
|
|
243565
243663
|
source: { type: "project" }
|
|
243566
243664
|
};
|
|
243567
243665
|
return functionData;
|
|
@@ -243579,16 +243677,19 @@ async function readAllFunctions(functionsDir) {
|
|
|
243579
243677
|
absolute: true,
|
|
243580
243678
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
243581
243679
|
});
|
|
243582
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
243583
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
243584
|
-
const
|
|
243680
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname7(f)));
|
|
243681
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname7(entryFile)));
|
|
243682
|
+
const backendRoot = resolve3(functionsDir, "..");
|
|
243683
|
+
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath, backendRoot)));
|
|
243585
243684
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
243586
|
-
const functionDir =
|
|
243685
|
+
const functionDir = dirname7(entryFile);
|
|
243587
243686
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
243588
243687
|
cwd: functionDir,
|
|
243589
243688
|
absolute: true
|
|
243590
243689
|
});
|
|
243591
|
-
const
|
|
243690
|
+
const { extra, outOfBounds } = await collectReachableBackendFiles(entryFile, filePaths, backendRoot);
|
|
243691
|
+
const allFilePaths = [...new Set([...filePaths, ...extra])];
|
|
243692
|
+
const name2 = relative2(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
243592
243693
|
if (!name2) {
|
|
243593
243694
|
throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
|
|
243594
243695
|
hints: [
|
|
@@ -243603,7 +243704,8 @@ async function readAllFunctions(functionsDir) {
|
|
|
243603
243704
|
name: name2,
|
|
243604
243705
|
entry,
|
|
243605
243706
|
entryPath: entryFile,
|
|
243606
|
-
filePaths,
|
|
243707
|
+
filePaths: allFilePaths,
|
|
243708
|
+
outOfBoundsImports: outOfBounds,
|
|
243607
243709
|
source: { type: "project" }
|
|
243608
243710
|
};
|
|
243609
243711
|
return functionData;
|
|
@@ -243625,12 +243727,12 @@ async function readAllFunctions(functionsDir) {
|
|
|
243625
243727
|
return functions;
|
|
243626
243728
|
}
|
|
243627
243729
|
// src/core/resources/function/deploy.ts
|
|
243628
|
-
import { dirname as
|
|
243730
|
+
import { dirname as dirname8, relative as relative3 } from "node:path";
|
|
243629
243731
|
async function loadFunctionCode(fn) {
|
|
243630
|
-
const functionDir =
|
|
243732
|
+
const functionDir = dirname8(fn.entryPath);
|
|
243631
243733
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
243632
243734
|
const content = await readTextFile(filePath);
|
|
243633
|
-
const path11 =
|
|
243735
|
+
const path11 = relative3(functionDir, filePath).split(/[/\\]/).join("/");
|
|
243634
243736
|
return { path: path11, content };
|
|
243635
243737
|
}));
|
|
243636
243738
|
return { ...fn, files: resolvedFiles };
|
|
@@ -243804,7 +243906,7 @@ class ProjectConfigReader {
|
|
|
243804
243906
|
return result.data;
|
|
243805
243907
|
}
|
|
243806
243908
|
async readProjectResources(configPath, project) {
|
|
243807
|
-
const configDir =
|
|
243909
|
+
const configDir = dirname9(configPath);
|
|
243808
243910
|
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243809
243911
|
entityResource.readAll(join10(configDir, project.entitiesDir)),
|
|
243810
243912
|
functionResource.readAll(join10(configDir, project.functionsDir)),
|
|
@@ -243833,7 +243935,7 @@ class ProjectConfigReader {
|
|
|
243833
243935
|
this.pluginSourceByNamespace.set(namespace, source);
|
|
243834
243936
|
}
|
|
243835
243937
|
async readPluginConfig(plugin, hostConfigPath) {
|
|
243836
|
-
const pluginRoot = resolvePluginRoot(plugin.source,
|
|
243938
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname9(hostConfigPath));
|
|
243837
243939
|
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
243838
243940
|
const project = await this.readConfigFile(configPath);
|
|
243839
243941
|
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
@@ -243911,7 +244013,7 @@ async function readProjectConfig(projectRoot) {
|
|
|
243911
244013
|
// src/core/project/template.ts
|
|
243912
244014
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
243913
244015
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
243914
|
-
import { dirname as
|
|
244016
|
+
import { dirname as dirname10, join as join12 } from "node:path";
|
|
243915
244017
|
|
|
243916
244018
|
// src/core/assets.ts
|
|
243917
244019
|
import { cpSync, existsSync } from "node:fs";
|
|
@@ -244063,7 +244165,7 @@ async function renderTemplate(template, destPath, data, options = {}) {
|
|
|
244063
244165
|
if (file2.endsWith(".ejs")) {
|
|
244064
244166
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
244065
244167
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
244066
|
-
const destFile = attributes.outputFileName ? join12(
|
|
244168
|
+
const destFile = attributes.outputFileName ? join12(dirname10(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
244067
244169
|
const destFilePath = join12(destPath, destFile);
|
|
244068
244170
|
if (skipExisting && await pathExists(destFilePath)) {
|
|
244069
244171
|
skipped.push(destFile);
|
|
@@ -244130,7 +244232,7 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
244130
244232
|
};
|
|
244131
244233
|
}
|
|
244132
244234
|
// src/core/project/deploy.ts
|
|
244133
|
-
import { resolve as
|
|
244235
|
+
import { resolve as resolve4 } from "node:path";
|
|
244134
244236
|
|
|
244135
244237
|
// src/core/site/api.ts
|
|
244136
244238
|
async function uploadSite(archivePath) {
|
|
@@ -244217,9 +244319,10 @@ async function deployAll(projectData, options) {
|
|
|
244217
244319
|
});
|
|
244218
244320
|
await agentResource.push(agents);
|
|
244219
244321
|
await authConfigResource.push(authConfig);
|
|
244220
|
-
const
|
|
244322
|
+
const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
|
|
244323
|
+
const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
|
|
244221
244324
|
if (project.site?.outputDirectory) {
|
|
244222
|
-
const outputDir =
|
|
244325
|
+
const outputDir = resolve4(project.root, project.site.outputDirectory);
|
|
244223
244326
|
const { appUrl } = await deploySite(outputDir);
|
|
244224
244327
|
return { appUrl, connectorResults };
|
|
244225
244328
|
}
|
|
@@ -244241,6 +244344,9 @@ async function handleUnauthorized(request, _options, response) {
|
|
|
244241
244344
|
if (response.status !== 401) {
|
|
244242
244345
|
return;
|
|
244243
244346
|
}
|
|
244347
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
244348
|
+
return;
|
|
244349
|
+
}
|
|
244244
244350
|
if (retriedRequests.has(request)) {
|
|
244245
244351
|
return;
|
|
244246
244352
|
}
|
|
@@ -244269,6 +244375,11 @@ var base44Client = distribution_default.create({
|
|
|
244269
244375
|
},
|
|
244270
244376
|
captureRequestBody,
|
|
244271
244377
|
async (request) => {
|
|
244378
|
+
const workspaceApiKey = getWorkspaceApiKeyFromEnv();
|
|
244379
|
+
if (workspaceApiKey && isWorkspaceApiKey(workspaceApiKey)) {
|
|
244380
|
+
request.headers.set("api_key", workspaceApiKey);
|
|
244381
|
+
return;
|
|
244382
|
+
}
|
|
244272
244383
|
try {
|
|
244273
244384
|
const auth = await readAuth();
|
|
244274
244385
|
if (isTokenExpired(auth)) {
|
|
@@ -244474,6 +244585,12 @@ async function login({
|
|
|
244474
244585
|
|
|
244475
244586
|
// src/cli/utils/command/middleware.ts
|
|
244476
244587
|
async function ensureAuth(ctx) {
|
|
244588
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
244589
|
+
ctx.errorReporter.setContext({
|
|
244590
|
+
user: { email: "workspace-api-key", name: "Workspace API key" }
|
|
244591
|
+
});
|
|
244592
|
+
return;
|
|
244593
|
+
}
|
|
244477
244594
|
await seedAuthFromEnv();
|
|
244478
244595
|
const loggedIn = await isLoggedIn();
|
|
244479
244596
|
if (!loggedIn) {
|
|
@@ -246041,8 +246158,8 @@ var disconnect = (anyProcess) => {
|
|
|
246041
246158
|
// ../../node_modules/execa/lib/utils/deferred.js
|
|
246042
246159
|
var createDeferred = () => {
|
|
246043
246160
|
const methods = {};
|
|
246044
|
-
const promise2 = new Promise((
|
|
246045
|
-
Object.assign(methods, { resolve:
|
|
246161
|
+
const promise2 = new Promise((resolve5, reject) => {
|
|
246162
|
+
Object.assign(methods, { resolve: resolve5, reject });
|
|
246046
246163
|
});
|
|
246047
246164
|
return Object.assign(promise2, methods);
|
|
246048
246165
|
};
|
|
@@ -250406,11 +250523,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
250406
250523
|
const promises = weakMap.get(stream);
|
|
250407
250524
|
const promise2 = createDeferred();
|
|
250408
250525
|
promises.push(promise2);
|
|
250409
|
-
const
|
|
250410
|
-
return { resolve:
|
|
250526
|
+
const resolve5 = promise2.resolve.bind(promise2);
|
|
250527
|
+
return { resolve: resolve5, promises };
|
|
250411
250528
|
};
|
|
250412
|
-
var waitForConcurrentStreams = async ({ resolve:
|
|
250413
|
-
|
|
250529
|
+
var waitForConcurrentStreams = async ({ resolve: resolve5, promises }, subprocess) => {
|
|
250530
|
+
resolve5();
|
|
250414
250531
|
const [isSubprocessExit] = await Promise.race([
|
|
250415
250532
|
Promise.allSettled([true, subprocess]),
|
|
250416
250533
|
Promise.all([false, ...promises])
|
|
@@ -251411,7 +251528,7 @@ async function pullAgentsAction({
|
|
|
251411
251528
|
runTask: runTask2
|
|
251412
251529
|
}) {
|
|
251413
251530
|
const { project: project2 } = await readProjectConfig();
|
|
251414
|
-
const configDir =
|
|
251531
|
+
const configDir = dirname11(project2.configPath);
|
|
251415
251532
|
const agentsDir = join14(configDir, project2.agentsDir);
|
|
251416
251533
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
251417
251534
|
return await fetchAgents();
|
|
@@ -251476,11 +251593,11 @@ function getAgentsCommand() {
|
|
|
251476
251593
|
}
|
|
251477
251594
|
|
|
251478
251595
|
// src/cli/commands/auth/password-login.ts
|
|
251479
|
-
import { dirname as
|
|
251596
|
+
import { dirname as dirname12, join as join15 } from "node:path";
|
|
251480
251597
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
251481
251598
|
const shouldEnable = action === "enable";
|
|
251482
251599
|
const { project: project2 } = await readProjectConfig();
|
|
251483
|
-
const configDir =
|
|
251600
|
+
const configDir = dirname12(project2.configPath);
|
|
251484
251601
|
const authDir = join15(configDir, project2.authDir);
|
|
251485
251602
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
251486
251603
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
@@ -251501,13 +251618,13 @@ function getPasswordLoginCommand() {
|
|
|
251501
251618
|
}
|
|
251502
251619
|
|
|
251503
251620
|
// src/cli/commands/auth/pull.ts
|
|
251504
|
-
import { dirname as
|
|
251621
|
+
import { dirname as dirname13, join as join16 } from "node:path";
|
|
251505
251622
|
async function pullAuthAction({
|
|
251506
251623
|
log,
|
|
251507
251624
|
runTask: runTask2
|
|
251508
251625
|
}) {
|
|
251509
251626
|
const { project: project2 } = await readProjectConfig();
|
|
251510
|
-
const configDir =
|
|
251627
|
+
const configDir = dirname13(project2.configPath);
|
|
251511
251628
|
const authDir = join16(configDir, project2.authDir);
|
|
251512
251629
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
251513
251630
|
return await pullAuthConfig();
|
|
@@ -251572,7 +251689,7 @@ function getAuthPushCommand() {
|
|
|
251572
251689
|
}
|
|
251573
251690
|
|
|
251574
251691
|
// src/cli/commands/auth/social-login.ts
|
|
251575
|
-
import { dirname as
|
|
251692
|
+
import { dirname as dirname14, join as join17, resolve as resolve5 } from "node:path";
|
|
251576
251693
|
var PROVIDER_LABELS = {
|
|
251577
251694
|
google: "Google",
|
|
251578
251695
|
microsoft: "Microsoft",
|
|
@@ -251612,7 +251729,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251612
251729
|
let clientSecret;
|
|
251613
251730
|
if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
|
|
251614
251731
|
if (options.envFile) {
|
|
251615
|
-
const secrets = await parseEnvFile(
|
|
251732
|
+
const secrets = await parseEnvFile(resolve5(options.envFile));
|
|
251616
251733
|
const value = secrets[oauthCli.envVar];
|
|
251617
251734
|
if (!value) {
|
|
251618
251735
|
throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
|
|
@@ -251642,7 +251759,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251642
251759
|
}
|
|
251643
251760
|
}
|
|
251644
251761
|
const { project: project2 } = await readProjectConfig();
|
|
251645
|
-
const configDir =
|
|
251762
|
+
const configDir = dirname14(project2.configPath);
|
|
251646
251763
|
const authDir = join17(configDir, project2.authDir);
|
|
251647
251764
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251648
251765
|
if (clientSecret) {
|
|
@@ -251668,7 +251785,7 @@ function getSocialLoginCommand() {
|
|
|
251668
251785
|
}
|
|
251669
251786
|
|
|
251670
251787
|
// src/cli/commands/auth/sso.ts
|
|
251671
|
-
import { dirname as
|
|
251788
|
+
import { dirname as dirname15, join as join18, resolve as resolve6 } from "node:path";
|
|
251672
251789
|
var SSOConfigFileSchema = exports_external.object({
|
|
251673
251790
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251674
251791
|
clientId: exports_external.string(),
|
|
@@ -251684,7 +251801,7 @@ var SSOConfigFileSchema = exports_external.object({
|
|
|
251684
251801
|
ssoName: exports_external.string().optional()
|
|
251685
251802
|
});
|
|
251686
251803
|
async function loadSSOConfigFile(filePath) {
|
|
251687
|
-
const resolved =
|
|
251804
|
+
const resolved = resolve6(filePath);
|
|
251688
251805
|
const raw2 = await readJsonFile(resolved);
|
|
251689
251806
|
const result = SSOConfigFileSchema.safeParse(raw2);
|
|
251690
251807
|
if (!result.success) {
|
|
@@ -251772,7 +251889,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251772
251889
|
}
|
|
251773
251890
|
let clientSecret;
|
|
251774
251891
|
if (merged.envFile && !merged.clientSecret) {
|
|
251775
|
-
const secrets2 = await parseEnvFile(
|
|
251892
|
+
const secrets2 = await parseEnvFile(resolve6(merged.envFile));
|
|
251776
251893
|
const value = secrets2.sso_client_secret;
|
|
251777
251894
|
if (!value) {
|
|
251778
251895
|
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
@@ -251831,7 +251948,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251831
251948
|
throw error48;
|
|
251832
251949
|
}
|
|
251833
251950
|
const { project: project2 } = await readProjectConfig();
|
|
251834
|
-
const configDir =
|
|
251951
|
+
const configDir = dirname15(project2.configPath);
|
|
251835
251952
|
const authDir = join18(configDir, project2.authDir);
|
|
251836
251953
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251837
251954
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
@@ -251847,7 +251964,7 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
251847
251964
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251848
251965
|
}
|
|
251849
251966
|
const { project: project2 } = await readProjectConfig();
|
|
251850
|
-
const configDir =
|
|
251967
|
+
const configDir = dirname15(project2.configPath);
|
|
251851
251968
|
const authDir = join18(configDir, project2.authDir);
|
|
251852
251969
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251853
251970
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
@@ -251898,6 +252015,12 @@ function getLogoutCommand() {
|
|
|
251898
252015
|
|
|
251899
252016
|
// src/cli/commands/auth/whoami.ts
|
|
251900
252017
|
async function whoami(_ctx) {
|
|
252018
|
+
const workspaceApiKey = getWorkspaceApiKeyFromEnv();
|
|
252019
|
+
if (workspaceApiKey && isWorkspaceApiKey(workspaceApiKey)) {
|
|
252020
|
+
return {
|
|
252021
|
+
outroMessage: `Using workspace API key: ${theme.styles.bold(workspaceApiKey.slice(0, 10))}`
|
|
252022
|
+
};
|
|
252023
|
+
}
|
|
251901
252024
|
const auth2 = await readAuth();
|
|
251902
252025
|
return { outroMessage: `Logged in as: ${theme.styles.bold(auth2.email)}` };
|
|
251903
252026
|
}
|
|
@@ -252404,19 +252527,19 @@ var baseOpen = async (options) => {
|
|
|
252404
252527
|
}
|
|
252405
252528
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
252406
252529
|
if (options.wait) {
|
|
252407
|
-
return new Promise((
|
|
252530
|
+
return new Promise((resolve7, reject) => {
|
|
252408
252531
|
subprocess.once("error", reject);
|
|
252409
252532
|
subprocess.once("close", (exitCode) => {
|
|
252410
252533
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
252411
252534
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
252412
252535
|
return;
|
|
252413
252536
|
}
|
|
252414
|
-
|
|
252537
|
+
resolve7(subprocess);
|
|
252415
252538
|
});
|
|
252416
252539
|
});
|
|
252417
252540
|
}
|
|
252418
252541
|
if (isFallbackAttempt) {
|
|
252419
|
-
return new Promise((
|
|
252542
|
+
return new Promise((resolve7, reject) => {
|
|
252420
252543
|
subprocess.once("error", reject);
|
|
252421
252544
|
subprocess.once("spawn", () => {
|
|
252422
252545
|
subprocess.once("close", (exitCode) => {
|
|
@@ -252426,17 +252549,17 @@ var baseOpen = async (options) => {
|
|
|
252426
252549
|
return;
|
|
252427
252550
|
}
|
|
252428
252551
|
subprocess.unref();
|
|
252429
|
-
|
|
252552
|
+
resolve7(subprocess);
|
|
252430
252553
|
});
|
|
252431
252554
|
});
|
|
252432
252555
|
});
|
|
252433
252556
|
}
|
|
252434
252557
|
subprocess.unref();
|
|
252435
|
-
return new Promise((
|
|
252558
|
+
return new Promise((resolve7, reject) => {
|
|
252436
252559
|
subprocess.once("error", reject);
|
|
252437
252560
|
subprocess.once("spawn", () => {
|
|
252438
252561
|
subprocess.off("error", reject);
|
|
252439
|
-
|
|
252562
|
+
resolve7(subprocess);
|
|
252440
252563
|
});
|
|
252441
252564
|
});
|
|
252442
252565
|
};
|
|
@@ -252699,13 +252822,13 @@ function getConnectorsListAvailableCommand() {
|
|
|
252699
252822
|
}
|
|
252700
252823
|
|
|
252701
252824
|
// src/cli/commands/connectors/pull.ts
|
|
252702
|
-
import { dirname as
|
|
252825
|
+
import { dirname as dirname16, join as join19, resolve as resolve7 } from "node:path";
|
|
252703
252826
|
async function resolveConnectorsDir(options) {
|
|
252704
252827
|
if (!getAppContext().projectRoot) {
|
|
252705
|
-
return
|
|
252828
|
+
return resolve7(options.dir ?? "connectors");
|
|
252706
252829
|
}
|
|
252707
252830
|
const { project: project2 } = await readProjectConfig();
|
|
252708
|
-
return join19(
|
|
252831
|
+
return join19(dirname16(project2.configPath), project2.connectorsDir);
|
|
252709
252832
|
}
|
|
252710
252833
|
async function pullConnectorsAction({ log, runTask: runTask2, jsonMode }, options) {
|
|
252711
252834
|
const connectorsDir = await resolveConnectorsDir(options);
|
|
@@ -252746,10 +252869,10 @@ function getConnectorsPullCommand() {
|
|
|
252746
252869
|
}
|
|
252747
252870
|
|
|
252748
252871
|
// src/cli/commands/connectors/push.ts
|
|
252749
|
-
import { resolve as
|
|
252872
|
+
import { resolve as resolve8 } from "node:path";
|
|
252750
252873
|
async function readConnectorsToPush(options) {
|
|
252751
252874
|
if (!getAppContext().projectRoot) {
|
|
252752
|
-
return readAllConnectors(
|
|
252875
|
+
return readAllConnectors(resolve8(options.dir ?? "connectors"));
|
|
252753
252876
|
}
|
|
252754
252877
|
const { connectors } = await readProjectConfig();
|
|
252755
252878
|
return connectors;
|
|
@@ -253030,6 +253153,15 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
253030
253153
|
};
|
|
253031
253154
|
}
|
|
253032
253155
|
log.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
|
|
253156
|
+
for (const fn of toDeploy) {
|
|
253157
|
+
if (fn.outOfBoundsImports && fn.outOfBoundsImports.length > 0) {
|
|
253158
|
+
for (const { importer, specifier } of fn.outOfBoundsImports) {
|
|
253159
|
+
const rel = importer.includes(fn.name) ? importer.slice(importer.lastIndexOf(fn.name)) : importer;
|
|
253160
|
+
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. Functions run on Deno — use npm: or jsr: specifiers (not package.json) for external packages.`);
|
|
253161
|
+
}
|
|
253162
|
+
throw new CLIExitError(1);
|
|
253163
|
+
}
|
|
253164
|
+
}
|
|
253033
253165
|
let completed = 0;
|
|
253034
253166
|
const total = toDeploy.length;
|
|
253035
253167
|
const results = await deployFunctionsSequentially(toDeploy, {
|
|
@@ -253098,10 +253230,10 @@ function getListCommand() {
|
|
|
253098
253230
|
}
|
|
253099
253231
|
|
|
253100
253232
|
// src/cli/commands/functions/pull.ts
|
|
253101
|
-
import { dirname as
|
|
253233
|
+
import { dirname as dirname17, join as join20 } from "node:path";
|
|
253102
253234
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
253103
253235
|
const { project: project2, functions } = await readProjectConfig();
|
|
253104
|
-
const configDir =
|
|
253236
|
+
const configDir = dirname17(project2.configPath);
|
|
253105
253237
|
const functionsDir = join20(configDir, project2.functionsDir);
|
|
253106
253238
|
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
253107
253239
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
@@ -253161,7 +253293,7 @@ function getFunctionsCommand() {
|
|
|
253161
253293
|
}
|
|
253162
253294
|
|
|
253163
253295
|
// src/cli/commands/project/create.ts
|
|
253164
|
-
import { basename as basename4, resolve as
|
|
253296
|
+
import { basename as basename4, resolve as resolve9 } from "node:path";
|
|
253165
253297
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
253166
253298
|
|
|
253167
253299
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -253315,7 +253447,7 @@ async function createInteractive(options, ctx) {
|
|
|
253315
253447
|
}, ctx);
|
|
253316
253448
|
}
|
|
253317
253449
|
async function createNonInteractive(options, ctx) {
|
|
253318
|
-
ctx.log.info(`Creating a new project at ${
|
|
253450
|
+
ctx.log.info(`Creating a new project at ${resolve9(options.path)}`);
|
|
253319
253451
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
253320
253452
|
return await executeCreate({
|
|
253321
253453
|
template: template2,
|
|
@@ -253337,7 +253469,7 @@ async function executeCreate({
|
|
|
253337
253469
|
}, ctx) {
|
|
253338
253470
|
const { log, runTask: runTask2 } = ctx;
|
|
253339
253471
|
const name2 = rawName.trim();
|
|
253340
|
-
const resolvedPath =
|
|
253472
|
+
const resolvedPath = resolve9(projectPath);
|
|
253341
253473
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
253342
253474
|
return await createProjectFiles({
|
|
253343
253475
|
name: name2,
|
|
@@ -253733,7 +253865,7 @@ async function followLogs(functionNames, options, availableFunctionNames, jsonMo
|
|
|
253733
253865
|
for (const entry of fresh)
|
|
253734
253866
|
writeFollowLine(entry, jsonMode);
|
|
253735
253867
|
first = false;
|
|
253736
|
-
await new Promise((
|
|
253868
|
+
await new Promise((resolve10) => setTimeout(resolve10, 2000));
|
|
253737
253869
|
}
|
|
253738
253870
|
}
|
|
253739
253871
|
function formatLogs(entries, env3) {
|
|
@@ -253847,7 +253979,7 @@ function getLogsCommand() {
|
|
|
253847
253979
|
}
|
|
253848
253980
|
|
|
253849
253981
|
// src/cli/commands/project/scaffold.ts
|
|
253850
|
-
import { basename as basename5, resolve as
|
|
253982
|
+
import { basename as basename5, resolve as resolve10 } from "node:path";
|
|
253851
253983
|
function resolveAppId(options) {
|
|
253852
253984
|
const appId = options.appId;
|
|
253853
253985
|
if (!appId) {
|
|
@@ -253863,7 +253995,7 @@ function resolveAppId(options) {
|
|
|
253863
253995
|
async function scaffoldAction(ctx, name2, options, command2) {
|
|
253864
253996
|
const { log, runTask: runTask2 } = ctx;
|
|
253865
253997
|
const appId = resolveAppId(command2.optsWithGlobals());
|
|
253866
|
-
const resolvedPath =
|
|
253998
|
+
const resolvedPath = resolve10("./");
|
|
253867
253999
|
const projectName = (name2 ?? basename5(resolvedPath)).trim();
|
|
253868
254000
|
const template2 = await getTemplateById("backend-only");
|
|
253869
254001
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
@@ -254253,7 +254385,7 @@ function getSecretsListCommand() {
|
|
|
254253
254385
|
}
|
|
254254
254386
|
|
|
254255
254387
|
// src/cli/commands/secrets/set.ts
|
|
254256
|
-
import { resolve as
|
|
254388
|
+
import { resolve as resolve11 } from "node:path";
|
|
254257
254389
|
function parseEntries(entries) {
|
|
254258
254390
|
const secrets = {};
|
|
254259
254391
|
for (const entry of entries) {
|
|
@@ -254284,7 +254416,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
254284
254416
|
validateInput(entries, options);
|
|
254285
254417
|
let secrets;
|
|
254286
254418
|
if (options.envFile) {
|
|
254287
|
-
secrets = await parseEnvFile(
|
|
254419
|
+
secrets = await parseEnvFile(resolve11(options.envFile));
|
|
254288
254420
|
if (Object.keys(secrets).length === 0) {
|
|
254289
254421
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
254290
254422
|
}
|
|
@@ -254313,7 +254445,7 @@ function getSecretsCommand() {
|
|
|
254313
254445
|
}
|
|
254314
254446
|
|
|
254315
254447
|
// src/cli/commands/site/deploy.ts
|
|
254316
|
-
import { resolve as
|
|
254448
|
+
import { resolve as resolve12 } from "node:path";
|
|
254317
254449
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
254318
254450
|
if (isNonInteractive && !options.yes) {
|
|
254319
254451
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -254328,7 +254460,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
254328
254460
|
]
|
|
254329
254461
|
});
|
|
254330
254462
|
}
|
|
254331
|
-
const outputDir =
|
|
254463
|
+
const outputDir = resolve12(project2.root, project2.site.outputDirectory);
|
|
254332
254464
|
if (!options.yes) {
|
|
254333
254465
|
const shouldDeploy = await Re({
|
|
254334
254466
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -254507,7 +254639,7 @@ function getTypesCommand() {
|
|
|
254507
254639
|
// src/cli/dev/dev-server/main.ts
|
|
254508
254640
|
var import_cors = __toESM(require_lib4(), 1);
|
|
254509
254641
|
var import_express6 = __toESM(require_express(), 1);
|
|
254510
|
-
import { dirname as
|
|
254642
|
+
import { dirname as dirname22, join as join27 } from "node:path";
|
|
254511
254643
|
|
|
254512
254644
|
// ../../node_modules/get-port/index.js
|
|
254513
254645
|
import net from "node:net";
|
|
@@ -254534,14 +254666,14 @@ var getLocalHosts = () => {
|
|
|
254534
254666
|
}
|
|
254535
254667
|
return results;
|
|
254536
254668
|
};
|
|
254537
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
254669
|
+
var checkAvailablePort = (options8) => new Promise((resolve14, reject) => {
|
|
254538
254670
|
const server = net.createServer();
|
|
254539
254671
|
server.unref();
|
|
254540
254672
|
server.on("error", reject);
|
|
254541
254673
|
server.listen(options8, () => {
|
|
254542
254674
|
const { port } = server.address();
|
|
254543
254675
|
server.close(() => {
|
|
254544
|
-
|
|
254676
|
+
resolve14(port);
|
|
254545
254677
|
});
|
|
254546
254678
|
});
|
|
254547
254679
|
});
|
|
@@ -254800,7 +254932,7 @@ class FunctionManager {
|
|
|
254800
254932
|
});
|
|
254801
254933
|
}
|
|
254802
254934
|
waitForReady(name2, runningFunc) {
|
|
254803
|
-
return new Promise((
|
|
254935
|
+
return new Promise((resolve14, reject) => {
|
|
254804
254936
|
runningFunc.process.on("exit", (code2) => {
|
|
254805
254937
|
if (!runningFunc.ready) {
|
|
254806
254938
|
clearTimeout(timeout3);
|
|
@@ -254823,7 +254955,7 @@ class FunctionManager {
|
|
|
254823
254955
|
runningFunc.ready = true;
|
|
254824
254956
|
clearTimeout(timeout3);
|
|
254825
254957
|
runningFunc.process.stdout?.off("data", onData);
|
|
254826
|
-
|
|
254958
|
+
resolve14(runningFunc.port);
|
|
254827
254959
|
}
|
|
254828
254960
|
};
|
|
254829
254961
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -256081,15 +256213,15 @@ class ServeRunner {
|
|
|
256081
256213
|
return;
|
|
256082
256214
|
}
|
|
256083
256215
|
this.stopping = true;
|
|
256084
|
-
const exited = new Promise((
|
|
256216
|
+
const exited = new Promise((resolve14) => child.once("exit", () => resolve14()));
|
|
256085
256217
|
if (process21.platform === "win32" && child.pid) {
|
|
256086
256218
|
const taskkill = spawn3("taskkill", ["/pid", String(child.pid), "/T", "/F"], {
|
|
256087
256219
|
stdio: "ignore",
|
|
256088
256220
|
windowsHide: true
|
|
256089
256221
|
});
|
|
256090
|
-
await new Promise((
|
|
256091
|
-
taskkill.once("exit", () =>
|
|
256092
|
-
taskkill.once("error", () =>
|
|
256222
|
+
await new Promise((resolve14) => {
|
|
256223
|
+
taskkill.once("exit", () => resolve14());
|
|
256224
|
+
taskkill.once("error", () => resolve14());
|
|
256093
256225
|
});
|
|
256094
256226
|
} else if (child.pid) {
|
|
256095
256227
|
try {
|
|
@@ -256135,7 +256267,7 @@ class ServeRunner {
|
|
|
256135
256267
|
|
|
256136
256268
|
// src/cli/dev/dev-server/watcher.ts
|
|
256137
256269
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
256138
|
-
import { relative as
|
|
256270
|
+
import { relative as relative7 } from "node:path";
|
|
256139
256271
|
|
|
256140
256272
|
// ../../node_modules/chokidar/index.js
|
|
256141
256273
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
@@ -256865,9 +256997,9 @@ class NodeFsHandler {
|
|
|
256865
256997
|
if (this.fsw.closed) {
|
|
256866
256998
|
return;
|
|
256867
256999
|
}
|
|
256868
|
-
const
|
|
257000
|
+
const dirname21 = sp2.dirname(file2);
|
|
256869
257001
|
const basename7 = sp2.basename(file2);
|
|
256870
|
-
const parent = this.fsw._getWatchedDir(
|
|
257002
|
+
const parent = this.fsw._getWatchedDir(dirname21);
|
|
256871
257003
|
let prevStats = stats;
|
|
256872
257004
|
if (parent.has(basename7))
|
|
256873
257005
|
return;
|
|
@@ -256894,7 +257026,7 @@ class NodeFsHandler {
|
|
|
256894
257026
|
prevStats = newStats2;
|
|
256895
257027
|
}
|
|
256896
257028
|
} catch (error48) {
|
|
256897
|
-
this.fsw._remove(
|
|
257029
|
+
this.fsw._remove(dirname21, basename7);
|
|
256898
257030
|
}
|
|
256899
257031
|
} else if (parent.has(basename7)) {
|
|
256900
257032
|
const at13 = newStats.atimeMs;
|
|
@@ -256983,7 +257115,7 @@ class NodeFsHandler {
|
|
|
256983
257115
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
256984
257116
|
}
|
|
256985
257117
|
}).on(EV.ERROR, this._boundHandleError);
|
|
256986
|
-
return new Promise((
|
|
257118
|
+
return new Promise((resolve15, reject) => {
|
|
256987
257119
|
if (!stream)
|
|
256988
257120
|
return reject();
|
|
256989
257121
|
stream.once(STR_END, () => {
|
|
@@ -256992,7 +257124,7 @@ class NodeFsHandler {
|
|
|
256992
257124
|
return;
|
|
256993
257125
|
}
|
|
256994
257126
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
256995
|
-
|
|
257127
|
+
resolve15(undefined);
|
|
256996
257128
|
previous.getChildren().filter((item) => {
|
|
256997
257129
|
return item !== directory && !current.has(item);
|
|
256998
257130
|
}).forEach((item) => {
|
|
@@ -257117,11 +257249,11 @@ function createPattern(matcher) {
|
|
|
257117
257249
|
if (matcher.path === string4)
|
|
257118
257250
|
return true;
|
|
257119
257251
|
if (matcher.recursive) {
|
|
257120
|
-
const
|
|
257121
|
-
if (!
|
|
257252
|
+
const relative7 = sp3.relative(matcher.path, string4);
|
|
257253
|
+
if (!relative7) {
|
|
257122
257254
|
return false;
|
|
257123
257255
|
}
|
|
257124
|
-
return !
|
|
257256
|
+
return !relative7.startsWith("..") && !sp3.isAbsolute(relative7);
|
|
257125
257257
|
}
|
|
257126
257258
|
return false;
|
|
257127
257259
|
};
|
|
@@ -257820,7 +257952,7 @@ class WatchBase44 extends EventEmitter4 {
|
|
|
257820
257952
|
ignoreInitial: true
|
|
257821
257953
|
});
|
|
257822
257954
|
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
257823
|
-
this.emit("change", name2,
|
|
257955
|
+
this.emit("change", name2, relative7(targetPath, path19));
|
|
257824
257956
|
}, WATCH_DEBOUNCE_MS));
|
|
257825
257957
|
watcher.on("error", (err) => {
|
|
257826
257958
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -257909,7 +258041,7 @@ async function createDevServer(options8) {
|
|
|
257909
258041
|
}
|
|
257910
258042
|
remoteProxy(req, res, next);
|
|
257911
258043
|
});
|
|
257912
|
-
const server = await new Promise((
|
|
258044
|
+
const server = await new Promise((resolve16, reject) => {
|
|
257913
258045
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
257914
258046
|
if (err) {
|
|
257915
258047
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -257918,7 +258050,7 @@ async function createDevServer(options8) {
|
|
|
257918
258050
|
reject(err);
|
|
257919
258051
|
}
|
|
257920
258052
|
} else {
|
|
257921
|
-
|
|
258053
|
+
resolve16(s5);
|
|
257922
258054
|
}
|
|
257923
258055
|
});
|
|
257924
258056
|
});
|
|
@@ -257927,8 +258059,8 @@ async function createDevServer(options8) {
|
|
|
257927
258059
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
257928
258060
|
};
|
|
257929
258061
|
const base44ConfigWatcher = new WatchBase44({
|
|
257930
|
-
functions: join27(
|
|
257931
|
-
entities: join27(
|
|
258062
|
+
functions: join27(dirname22(project2.configPath), project2.functionsDir),
|
|
258063
|
+
entities: join27(dirname22(project2.configPath), project2.entitiesDir)
|
|
257932
258064
|
}, devLogger);
|
|
257933
258065
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
257934
258066
|
try {
|
|
@@ -257981,13 +258113,13 @@ async function createDevServer(options8) {
|
|
|
257981
258113
|
if (!server.listening) {
|
|
257982
258114
|
return;
|
|
257983
258115
|
}
|
|
257984
|
-
await new Promise((
|
|
258116
|
+
await new Promise((resolve16, reject) => {
|
|
257985
258117
|
server.close((error48) => {
|
|
257986
258118
|
if (error48) {
|
|
257987
258119
|
reject(error48);
|
|
257988
258120
|
return;
|
|
257989
258121
|
}
|
|
257990
|
-
|
|
258122
|
+
resolve16();
|
|
257991
258123
|
});
|
|
257992
258124
|
});
|
|
257993
258125
|
};
|
|
@@ -258096,13 +258228,13 @@ async function runScript(options8) {
|
|
|
258096
258228
|
}
|
|
258097
258229
|
// src/cli/commands/exec.ts
|
|
258098
258230
|
function readStdin2() {
|
|
258099
|
-
return new Promise((
|
|
258231
|
+
return new Promise((resolve16, reject) => {
|
|
258100
258232
|
let data = "";
|
|
258101
258233
|
process.stdin.setEncoding("utf-8");
|
|
258102
258234
|
process.stdin.on("data", (chunk) => {
|
|
258103
258235
|
data += chunk;
|
|
258104
258236
|
});
|
|
258105
|
-
process.stdin.on("end", () =>
|
|
258237
|
+
process.stdin.on("end", () => resolve16(data));
|
|
258106
258238
|
process.stdin.on("error", reject);
|
|
258107
258239
|
});
|
|
258108
258240
|
}
|
|
@@ -258144,7 +258276,7 @@ Examples:
|
|
|
258144
258276
|
}
|
|
258145
258277
|
|
|
258146
258278
|
// src/cli/commands/project/eject.ts
|
|
258147
|
-
import { resolve as
|
|
258279
|
+
import { resolve as resolve16 } from "node:path";
|
|
258148
258280
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
258149
258281
|
async function eject(ctx, options8, command2) {
|
|
258150
258282
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -258208,7 +258340,7 @@ async function eject(ctx, options8, command2) {
|
|
|
258208
258340
|
Ne("Operation cancelled.");
|
|
258209
258341
|
throw new CLIExitError(0);
|
|
258210
258342
|
}
|
|
258211
|
-
const resolvedPath =
|
|
258343
|
+
const resolvedPath = resolve16(selectedPath);
|
|
258212
258344
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
258213
258345
|
await createProjectFilesForExistingProject({
|
|
258214
258346
|
projectId,
|
|
@@ -258293,7 +258425,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
258293
258425
|
import { release, type } from "node:os";
|
|
258294
258426
|
|
|
258295
258427
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
258296
|
-
import { dirname as
|
|
258428
|
+
import { dirname as dirname23, posix, sep } from "path";
|
|
258297
258429
|
function createModulerModifier() {
|
|
258298
258430
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
258299
258431
|
return async (frames) => {
|
|
@@ -258302,7 +258434,7 @@ function createModulerModifier() {
|
|
|
258302
258434
|
return frames;
|
|
258303
258435
|
};
|
|
258304
258436
|
}
|
|
258305
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
258437
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname23(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
258306
258438
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
258307
258439
|
return (filename) => {
|
|
258308
258440
|
if (!filename)
|
|
@@ -260580,14 +260712,14 @@ async function addSourceContext(frames) {
|
|
|
260580
260712
|
return frames;
|
|
260581
260713
|
}
|
|
260582
260714
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
260583
|
-
return new Promise((
|
|
260715
|
+
return new Promise((resolve17) => {
|
|
260584
260716
|
const stream = createReadStream2(path19);
|
|
260585
260717
|
const lineReaded = createInterface2({
|
|
260586
260718
|
input: stream
|
|
260587
260719
|
});
|
|
260588
260720
|
function destroyStreamAndResolve() {
|
|
260589
260721
|
stream.destroy();
|
|
260590
|
-
|
|
260722
|
+
resolve17();
|
|
260591
260723
|
}
|
|
260592
260724
|
let lineNumber = 0;
|
|
260593
260725
|
let currentRangeIndex = 0;
|
|
@@ -261699,15 +261831,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
261699
261831
|
return true;
|
|
261700
261832
|
if (this.featureFlagsPoller === undefined)
|
|
261701
261833
|
return false;
|
|
261702
|
-
return new Promise((
|
|
261834
|
+
return new Promise((resolve17) => {
|
|
261703
261835
|
const timeout3 = setTimeout(() => {
|
|
261704
261836
|
cleanup();
|
|
261705
|
-
|
|
261837
|
+
resolve17(false);
|
|
261706
261838
|
}, timeoutMs);
|
|
261707
261839
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
261708
261840
|
clearTimeout(timeout3);
|
|
261709
261841
|
cleanup();
|
|
261710
|
-
|
|
261842
|
+
resolve17(count2 > 0);
|
|
261711
261843
|
});
|
|
261712
261844
|
});
|
|
261713
261845
|
}
|
|
@@ -262491,7 +262623,7 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
262491
262623
|
});
|
|
262492
262624
|
}
|
|
262493
262625
|
// src/cli/index.ts
|
|
262494
|
-
var __dirname4 =
|
|
262626
|
+
var __dirname4 = dirname24(fileURLToPath6(import.meta.url));
|
|
262495
262627
|
async function runCLI(options8) {
|
|
262496
262628
|
ensureNpmAssets(join28(__dirname4, "../assets"));
|
|
262497
262629
|
const errorReporter = new ErrorReporter;
|
|
@@ -262532,4 +262664,4 @@ export {
|
|
|
262532
262664
|
CLIExitError
|
|
262533
262665
|
};
|
|
262534
262666
|
|
|
262535
|
-
//# debugId=
|
|
262667
|
+
//# debugId=3549116E1982FEC664756E2164756E21
|