@base44-preview/cli 0.0.51-pr.484.a220663 → 0.0.51-pr.503.3e3774c
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 +538 -274
- package/dist/cli/index.js.map +17 -14
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -988,7 +988,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
988
988
|
this._exitCallback = (err) => {
|
|
989
989
|
if (err.code !== "commander.executeSubCommandAsync") {
|
|
990
990
|
throw err;
|
|
991
|
-
}
|
|
991
|
+
}
|
|
992
992
|
};
|
|
993
993
|
}
|
|
994
994
|
return this;
|
|
@@ -8933,10 +8933,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
8933
8933
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
8934
8934
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
8935
8935
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
8936
|
-
var
|
|
8936
|
+
var dirname7 = path11.dirname;
|
|
8937
8937
|
var extname = path11.extname;
|
|
8938
|
-
var
|
|
8939
|
-
var includePath =
|
|
8938
|
+
var resolve2 = path11.resolve;
|
|
8939
|
+
var includePath = resolve2(isDir ? filename : dirname7(filename), name2);
|
|
8940
8940
|
var ext = extname(name2);
|
|
8941
8941
|
if (!ext) {
|
|
8942
8942
|
includePath += ".ejs";
|
|
@@ -9011,10 +9011,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
9011
9011
|
var result;
|
|
9012
9012
|
if (!cb) {
|
|
9013
9013
|
if (typeof exports.promiseImpl == "function") {
|
|
9014
|
-
return new exports.promiseImpl(function(
|
|
9014
|
+
return new exports.promiseImpl(function(resolve2, reject) {
|
|
9015
9015
|
try {
|
|
9016
9016
|
result = handleCache(options)(data);
|
|
9017
|
-
|
|
9017
|
+
resolve2(result);
|
|
9018
9018
|
} catch (err) {
|
|
9019
9019
|
reject(err);
|
|
9020
9020
|
}
|
|
@@ -12452,12 +12452,12 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
12452
12452
|
if (typeof Promise !== "function") {
|
|
12453
12453
|
throw new TypeError("callback not provided");
|
|
12454
12454
|
}
|
|
12455
|
-
return new Promise(function(
|
|
12455
|
+
return new Promise(function(resolve3, reject) {
|
|
12456
12456
|
isexe(path11, options || {}, function(er, is) {
|
|
12457
12457
|
if (er) {
|
|
12458
12458
|
reject(er);
|
|
12459
12459
|
} else {
|
|
12460
|
-
|
|
12460
|
+
resolve3(is);
|
|
12461
12461
|
}
|
|
12462
12462
|
});
|
|
12463
12463
|
});
|
|
@@ -12519,27 +12519,27 @@ var require_which = __commonJS((exports, module) => {
|
|
|
12519
12519
|
opt = {};
|
|
12520
12520
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
12521
12521
|
const found = [];
|
|
12522
|
-
const step = (i) => new Promise((
|
|
12522
|
+
const step = (i) => new Promise((resolve3, reject) => {
|
|
12523
12523
|
if (i === pathEnv.length)
|
|
12524
|
-
return opt.all && found.length ?
|
|
12524
|
+
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
12525
12525
|
const ppRaw = pathEnv[i];
|
|
12526
12526
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
12527
12527
|
const pCmd = path11.join(pathPart, cmd);
|
|
12528
12528
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
12529
|
-
|
|
12529
|
+
resolve3(subStep(p, i, 0));
|
|
12530
12530
|
});
|
|
12531
|
-
const subStep = (p, i, ii) => new Promise((
|
|
12531
|
+
const subStep = (p, i, ii) => new Promise((resolve3, reject) => {
|
|
12532
12532
|
if (ii === pathExt.length)
|
|
12533
|
-
return
|
|
12533
|
+
return resolve3(step(i + 1));
|
|
12534
12534
|
const ext = pathExt[ii];
|
|
12535
12535
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
12536
12536
|
if (!er && is) {
|
|
12537
12537
|
if (opt.all)
|
|
12538
12538
|
found.push(p + ext);
|
|
12539
12539
|
else
|
|
12540
|
-
return
|
|
12540
|
+
return resolve3(p + ext);
|
|
12541
12541
|
}
|
|
12542
|
-
return
|
|
12542
|
+
return resolve3(subStep(p, i, ii + 1));
|
|
12543
12543
|
});
|
|
12544
12544
|
});
|
|
12545
12545
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -16067,7 +16067,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
16067
16067
|
}
|
|
16068
16068
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
16069
16069
|
});
|
|
16070
|
-
function
|
|
16070
|
+
function join13(array2, separator) {
|
|
16071
16071
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
16072
16072
|
}
|
|
16073
16073
|
function last(array2) {
|
|
@@ -17999,7 +17999,7 @@ __p += '`;
|
|
|
17999
17999
|
lodash.isUndefined = isUndefined;
|
|
18000
18000
|
lodash.isWeakMap = isWeakMap;
|
|
18001
18001
|
lodash.isWeakSet = isWeakSet;
|
|
18002
|
-
lodash.join =
|
|
18002
|
+
lodash.join = join13;
|
|
18003
18003
|
lodash.kebabCase = kebabCase;
|
|
18004
18004
|
lodash.last = last;
|
|
18005
18005
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -27503,7 +27503,7 @@ function cleanDoc(doc2) {
|
|
|
27503
27503
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
27504
27504
|
}
|
|
27505
27505
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
27506
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
27506
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join21(replacement, currentDoc.split(`
|
|
27507
27507
|
`)) : currentDoc);
|
|
27508
27508
|
}
|
|
27509
27509
|
function canBreakFn(doc2) {
|
|
@@ -27583,7 +27583,7 @@ function indentIfBreak(contents, options) {
|
|
|
27583
27583
|
negate: options.negate
|
|
27584
27584
|
};
|
|
27585
27585
|
}
|
|
27586
|
-
function
|
|
27586
|
+
function join21(separator, docs) {
|
|
27587
27587
|
assertDoc(separator);
|
|
27588
27588
|
assertDocArray(docs);
|
|
27589
27589
|
const parts = [];
|
|
@@ -28294,7 +28294,7 @@ var init_doc = __esm(() => {
|
|
|
28294
28294
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
28295
28295
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
28296
28296
|
builders = {
|
|
28297
|
-
join:
|
|
28297
|
+
join: join21,
|
|
28298
28298
|
line,
|
|
28299
28299
|
softline,
|
|
28300
28300
|
hardline,
|
|
@@ -115559,7 +115559,7 @@ import { fileURLToPath as fileURLToPath22 } from "url";
|
|
|
115559
115559
|
import v8 from "v8";
|
|
115560
115560
|
import assert22 from "assert";
|
|
115561
115561
|
import { format as format2, inspect as inspect3 } from "util";
|
|
115562
|
-
import { createRequire as
|
|
115562
|
+
import { createRequire as createRequire3 } from "module";
|
|
115563
115563
|
import { equal, ok, strictEqual } from "assert";
|
|
115564
115564
|
import path112 from "path";
|
|
115565
115565
|
import { fileURLToPath as fileURLToPath52 } from "url";
|
|
@@ -118133,7 +118133,7 @@ function importFromFile(specifier, parent) {
|
|
|
118133
118133
|
return import(url3);
|
|
118134
118134
|
}
|
|
118135
118135
|
function requireFromFile(id2, parent) {
|
|
118136
|
-
const require22 =
|
|
118136
|
+
const require22 = createRequire3(parent);
|
|
118137
118137
|
return require22(id2);
|
|
118138
118138
|
}
|
|
118139
118139
|
async function loadExternalConfig(externalConfig, configFile) {
|
|
@@ -133208,7 +133208,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133208
133208
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
133209
133209
|
}
|
|
133210
133210
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
133211
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
133211
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join23(replacement, currentDoc.split(`
|
|
133212
133212
|
`)) : currentDoc);
|
|
133213
133213
|
}
|
|
133214
133214
|
function canBreakFn2(doc2) {
|
|
@@ -133294,7 +133294,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133294
133294
|
negate: options8.negate
|
|
133295
133295
|
};
|
|
133296
133296
|
}
|
|
133297
|
-
function
|
|
133297
|
+
function join23(separator, docs) {
|
|
133298
133298
|
assertDoc2(separator);
|
|
133299
133299
|
assertDocArray2(docs);
|
|
133300
133300
|
const parts = [];
|
|
@@ -133959,7 +133959,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
133959
133959
|
}
|
|
133960
133960
|
}
|
|
133961
133961
|
var builders2 = {
|
|
133962
|
-
join:
|
|
133962
|
+
join: join23,
|
|
133963
133963
|
line: line3,
|
|
133964
133964
|
softline: softline2,
|
|
133965
133965
|
hardline: hardline4,
|
|
@@ -134606,7 +134606,7 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
134606
134606
|
prettier.util = (init_public(), __toCommonJS(public_exports3));
|
|
134607
134607
|
prettier.doc = require_doc();
|
|
134608
134608
|
prettier.version = (init_version_evaluate(), __toCommonJS(version_evaluate_exports)).default;
|
|
134609
|
-
}
|
|
134609
|
+
}
|
|
134610
134610
|
module.exports = prettier;
|
|
134611
134611
|
});
|
|
134612
134612
|
|
|
@@ -134614,11 +134614,11 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
134614
134614
|
var require_formatter = __commonJS((exports) => {
|
|
134615
134615
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
134616
134616
|
function adopt(value) {
|
|
134617
|
-
return value instanceof P9 ? value : new P9(function(
|
|
134618
|
-
|
|
134617
|
+
return value instanceof P9 ? value : new P9(function(resolve9) {
|
|
134618
|
+
resolve9(value);
|
|
134619
134619
|
});
|
|
134620
134620
|
}
|
|
134621
|
-
return new (P9 || (P9 = Promise))(function(
|
|
134621
|
+
return new (P9 || (P9 = Promise))(function(resolve9, reject) {
|
|
134622
134622
|
function fulfilled(value) {
|
|
134623
134623
|
try {
|
|
134624
134624
|
step(generator.next(value));
|
|
@@ -134634,7 +134634,7 @@ var require_formatter = __commonJS((exports) => {
|
|
|
134634
134634
|
}
|
|
134635
134635
|
}
|
|
134636
134636
|
function step(result) {
|
|
134637
|
-
result.done ?
|
|
134637
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
134638
134638
|
}
|
|
134639
134639
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
134640
134640
|
});
|
|
@@ -139287,7 +139287,7 @@ var require_url = __commonJS((exports) => {
|
|
|
139287
139287
|
};
|
|
139288
139288
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
139289
139289
|
exports.parse = undefined;
|
|
139290
|
-
exports.resolve =
|
|
139290
|
+
exports.resolve = resolve9;
|
|
139291
139291
|
exports.cwd = cwd;
|
|
139292
139292
|
exports.getProtocol = getProtocol;
|
|
139293
139293
|
exports.getExtension = getExtension;
|
|
@@ -139315,7 +139315,7 @@ var require_url = __commonJS((exports) => {
|
|
|
139315
139315
|
var urlDecodePatterns = [/%23/g, "#", /%24/g, "$", /%26/g, "&", /%2C/g, ",", /%40/g, "@"];
|
|
139316
139316
|
var parse11 = (u4) => new URL(u4);
|
|
139317
139317
|
exports.parse = parse11;
|
|
139318
|
-
function
|
|
139318
|
+
function resolve9(from, to5) {
|
|
139319
139319
|
const fromUrl = new URL((0, convert_path_to_posix_1.default)(from), "https://aaa.nonexistanturl.com");
|
|
139320
139320
|
const resolvedUrl = new URL((0, convert_path_to_posix_1.default)(to5), fromUrl);
|
|
139321
139321
|
const endSpaces = to5.match(/(\s*)$/)?.[1] || "";
|
|
@@ -139451,7 +139451,7 @@ var require_url = __commonJS((exports) => {
|
|
|
139451
139451
|
}
|
|
139452
139452
|
function relative4(from, to5) {
|
|
139453
139453
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
139454
|
-
return
|
|
139454
|
+
return resolve9(from, to5);
|
|
139455
139455
|
}
|
|
139456
139456
|
const fromDir = path_1.default.dirname(stripHash(from));
|
|
139457
139457
|
const toPath4 = stripHash(to5);
|
|
@@ -140127,7 +140127,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
140127
140127
|
let plugin;
|
|
140128
140128
|
let lastError;
|
|
140129
140129
|
let index = 0;
|
|
140130
|
-
return new Promise((
|
|
140130
|
+
return new Promise((resolve9, reject) => {
|
|
140131
140131
|
runNextPlugin();
|
|
140132
140132
|
function runNextPlugin() {
|
|
140133
140133
|
plugin = plugins[index++];
|
|
@@ -140155,7 +140155,7 @@ var require_plugins = __commonJS((exports) => {
|
|
|
140155
140155
|
}
|
|
140156
140156
|
}
|
|
140157
140157
|
function onSuccess(result) {
|
|
140158
|
-
|
|
140158
|
+
resolve9({
|
|
140159
140159
|
plugin,
|
|
140160
140160
|
result
|
|
140161
140161
|
});
|
|
@@ -141488,11 +141488,11 @@ var require_lib3 = __commonJS((exports) => {
|
|
|
141488
141488
|
var require_resolver = __commonJS((exports) => {
|
|
141489
141489
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
141490
141490
|
function adopt(value) {
|
|
141491
|
-
return value instanceof P9 ? value : new P9(function(
|
|
141492
|
-
|
|
141491
|
+
return value instanceof P9 ? value : new P9(function(resolve9) {
|
|
141492
|
+
resolve9(value);
|
|
141493
141493
|
});
|
|
141494
141494
|
}
|
|
141495
|
-
return new (P9 || (P9 = Promise))(function(
|
|
141495
|
+
return new (P9 || (P9 = Promise))(function(resolve9, reject) {
|
|
141496
141496
|
function fulfilled(value) {
|
|
141497
141497
|
try {
|
|
141498
141498
|
step(generator.next(value));
|
|
@@ -141508,7 +141508,7 @@ var require_resolver = __commonJS((exports) => {
|
|
|
141508
141508
|
}
|
|
141509
141509
|
}
|
|
141510
141510
|
function step(result) {
|
|
141511
|
-
result.done ?
|
|
141511
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
141512
141512
|
}
|
|
141513
141513
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
141514
141514
|
});
|
|
@@ -141629,11 +141629,11 @@ var require_optionValidator = __commonJS((exports) => {
|
|
|
141629
141629
|
var require_src3 = __commonJS((exports) => {
|
|
141630
141630
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P9, generator) {
|
|
141631
141631
|
function adopt(value) {
|
|
141632
|
-
return value instanceof P9 ? value : new P9(function(
|
|
141633
|
-
|
|
141632
|
+
return value instanceof P9 ? value : new P9(function(resolve9) {
|
|
141633
|
+
resolve9(value);
|
|
141634
141634
|
});
|
|
141635
141635
|
}
|
|
141636
|
-
return new (P9 || (P9 = Promise))(function(
|
|
141636
|
+
return new (P9 || (P9 = Promise))(function(resolve9, reject) {
|
|
141637
141637
|
function fulfilled(value) {
|
|
141638
141638
|
try {
|
|
141639
141639
|
step(generator.next(value));
|
|
@@ -141649,7 +141649,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
141649
141649
|
}
|
|
141650
141650
|
}
|
|
141651
141651
|
function step(result) {
|
|
141652
|
-
result.done ?
|
|
141652
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
141653
141653
|
}
|
|
141654
141654
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
141655
141655
|
});
|
|
@@ -145360,7 +145360,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
145360
145360
|
if (resCode !== undefined) {
|
|
145361
145361
|
dbcsCode = resCode;
|
|
145362
145362
|
nextChar = uCode;
|
|
145363
|
-
}
|
|
145363
|
+
}
|
|
145364
145364
|
}
|
|
145365
145365
|
seqObj = undefined;
|
|
145366
145366
|
} else if (uCode >= 0) {
|
|
@@ -145425,7 +145425,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
145425
145425
|
newBuf[j10++] = dbcsCode >> 8;
|
|
145426
145426
|
newBuf[j10++] = dbcsCode & 255;
|
|
145427
145427
|
}
|
|
145428
|
-
}
|
|
145428
|
+
}
|
|
145429
145429
|
this.seqObj = undefined;
|
|
145430
145430
|
}
|
|
145431
145431
|
if (this.leadSurrogate !== -1) {
|
|
@@ -147274,11 +147274,11 @@ var require_raw_body = __commonJS((exports, module) => {
|
|
|
147274
147274
|
if (done) {
|
|
147275
147275
|
return readStream(stream, encoding, length, limit, wrap(done));
|
|
147276
147276
|
}
|
|
147277
|
-
return new Promise(function executor(
|
|
147277
|
+
return new Promise(function executor(resolve9, reject) {
|
|
147278
147278
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
147279
147279
|
if (err)
|
|
147280
147280
|
return reject(err);
|
|
147281
|
-
|
|
147281
|
+
resolve9(buf);
|
|
147282
147282
|
});
|
|
147283
147283
|
});
|
|
147284
147284
|
}
|
|
@@ -160399,11 +160399,11 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160399
160399
|
var debug = require_src4()("express:view");
|
|
160400
160400
|
var path18 = __require("node:path");
|
|
160401
160401
|
var fs28 = __require("node:fs");
|
|
160402
|
-
var
|
|
160402
|
+
var dirname17 = path18.dirname;
|
|
160403
160403
|
var basename4 = path18.basename;
|
|
160404
160404
|
var extname2 = path18.extname;
|
|
160405
|
-
var
|
|
160406
|
-
var
|
|
160405
|
+
var join24 = path18.join;
|
|
160406
|
+
var resolve9 = path18.resolve;
|
|
160407
160407
|
module.exports = View;
|
|
160408
160408
|
function View(name2, options8) {
|
|
160409
160409
|
var opts = options8 || {};
|
|
@@ -160437,8 +160437,8 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160437
160437
|
debug('lookup "%s"', name2);
|
|
160438
160438
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
160439
160439
|
var root2 = roots[i5];
|
|
160440
|
-
var loc =
|
|
160441
|
-
var dir =
|
|
160440
|
+
var loc = resolve9(root2, name2);
|
|
160441
|
+
var dir = dirname17(loc);
|
|
160442
160442
|
var file2 = basename4(loc);
|
|
160443
160443
|
path19 = this.resolve(dir, file2);
|
|
160444
160444
|
}
|
|
@@ -160462,14 +160462,14 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160462
160462
|
});
|
|
160463
160463
|
sync = false;
|
|
160464
160464
|
};
|
|
160465
|
-
View.prototype.resolve = function
|
|
160465
|
+
View.prototype.resolve = function resolve10(dir, file2) {
|
|
160466
160466
|
var ext = this.ext;
|
|
160467
|
-
var path19 =
|
|
160467
|
+
var path19 = join24(dir, file2);
|
|
160468
160468
|
var stat2 = tryStat(path19);
|
|
160469
160469
|
if (stat2 && stat2.isFile()) {
|
|
160470
160470
|
return path19;
|
|
160471
160471
|
}
|
|
160472
|
-
path19 =
|
|
160472
|
+
path19 = join24(dir, basename4(file2, ext), "index" + ext);
|
|
160473
160473
|
stat2 = tryStat(path19);
|
|
160474
160474
|
if (stat2 && stat2.isFile()) {
|
|
160475
160475
|
return path19;
|
|
@@ -162621,7 +162621,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
162621
162621
|
var compileETag = require_utils10().compileETag;
|
|
162622
162622
|
var compileQueryParser = require_utils10().compileQueryParser;
|
|
162623
162623
|
var compileTrust = require_utils10().compileTrust;
|
|
162624
|
-
var
|
|
162624
|
+
var resolve9 = __require("node:path").resolve;
|
|
162625
162625
|
var once9 = require_once();
|
|
162626
162626
|
var Router = require_router();
|
|
162627
162627
|
var slice = Array.prototype.slice;
|
|
@@ -162675,7 +162675,7 @@ var require_application = __commonJS((exports, module) => {
|
|
|
162675
162675
|
this.mountpath = "/";
|
|
162676
162676
|
this.locals.settings = this.settings;
|
|
162677
162677
|
this.set("view", View);
|
|
162678
|
-
this.set("views",
|
|
162678
|
+
this.set("views", resolve9("views"));
|
|
162679
162679
|
this.set("jsonp callback name", "callback");
|
|
162680
162680
|
if (env3 === "production") {
|
|
162681
162681
|
this.enable("view cache");
|
|
@@ -164164,9 +164164,9 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164164
164164
|
var Stream2 = __require("stream");
|
|
164165
164165
|
var util2 = __require("util");
|
|
164166
164166
|
var extname2 = path18.extname;
|
|
164167
|
-
var
|
|
164167
|
+
var join24 = path18.join;
|
|
164168
164168
|
var normalize2 = path18.normalize;
|
|
164169
|
-
var
|
|
164169
|
+
var resolve9 = path18.resolve;
|
|
164170
164170
|
var sep = path18.sep;
|
|
164171
164171
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
164172
164172
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
|
|
@@ -164195,7 +164195,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164195
164195
|
this._maxage = opts.maxAge || opts.maxage;
|
|
164196
164196
|
this._maxage = typeof this._maxage === "string" ? ms8(this._maxage) : Number(this._maxage);
|
|
164197
164197
|
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
164198
|
-
this._root = opts.root ?
|
|
164198
|
+
this._root = opts.root ? resolve9(opts.root) : null;
|
|
164199
164199
|
}
|
|
164200
164200
|
util2.inherits(SendStream, Stream2);
|
|
164201
164201
|
SendStream.prototype.error = function error48(status, err) {
|
|
@@ -164336,7 +164336,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164336
164336
|
return res;
|
|
164337
164337
|
}
|
|
164338
164338
|
parts = path19.split(sep);
|
|
164339
|
-
path19 = normalize2(
|
|
164339
|
+
path19 = normalize2(join24(root2, path19));
|
|
164340
164340
|
} else {
|
|
164341
164341
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
164342
164342
|
debug('malicious path "%s"', path19);
|
|
@@ -164344,7 +164344,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164344
164344
|
return res;
|
|
164345
164345
|
}
|
|
164346
164346
|
parts = normalize2(path19).split(sep);
|
|
164347
|
-
path19 =
|
|
164347
|
+
path19 = resolve9(path19);
|
|
164348
164348
|
}
|
|
164349
164349
|
if (containsDotFile(parts)) {
|
|
164350
164350
|
debug('%s dotfile "%s"', this._dotfiles, path19);
|
|
@@ -164476,7 +164476,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164476
164476
|
return self2.onStatError(err);
|
|
164477
164477
|
return self2.error(404);
|
|
164478
164478
|
}
|
|
164479
|
-
var p4 =
|
|
164479
|
+
var p4 = join24(path19, self2._index[i5]);
|
|
164480
164480
|
debug('stat "%s"', p4);
|
|
164481
164481
|
fs28.stat(p4, function(err2, stat2) {
|
|
164482
164482
|
if (err2)
|
|
@@ -164672,7 +164672,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
164672
164672
|
var cookie = require_cookie();
|
|
164673
164673
|
var send = require_send();
|
|
164674
164674
|
var extname2 = path18.extname;
|
|
164675
|
-
var
|
|
164675
|
+
var resolve9 = path18.resolve;
|
|
164676
164676
|
var vary = require_vary();
|
|
164677
164677
|
var { Buffer: Buffer7 } = __require("node:buffer");
|
|
164678
164678
|
var res = Object.create(http.ServerResponse.prototype);
|
|
@@ -164881,7 +164881,7 @@ var require_response = __commonJS((exports, module) => {
|
|
|
164881
164881
|
}
|
|
164882
164882
|
opts = Object.create(opts);
|
|
164883
164883
|
opts.headers = headers;
|
|
164884
|
-
var fullPath = !opts.root ?
|
|
164884
|
+
var fullPath = !opts.root ? resolve9(path19) : path19;
|
|
164885
164885
|
return this.sendFile(fullPath, opts, done);
|
|
164886
164886
|
};
|
|
164887
164887
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -165142,7 +165142,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
165142
165142
|
var encodeUrl = require_encodeurl();
|
|
165143
165143
|
var escapeHtml = require_escape_html();
|
|
165144
165144
|
var parseUrl = require_parseurl();
|
|
165145
|
-
var
|
|
165145
|
+
var resolve9 = __require("path").resolve;
|
|
165146
165146
|
var send = require_send();
|
|
165147
165147
|
var url3 = __require("url");
|
|
165148
165148
|
module.exports = serveStatic;
|
|
@@ -165161,7 +165161,7 @@ var require_serve_static = __commonJS((exports, module) => {
|
|
|
165161
165161
|
throw new TypeError("option setHeaders must be function");
|
|
165162
165162
|
}
|
|
165163
165163
|
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
165164
|
-
opts.root =
|
|
165164
|
+
opts.root = resolve9(root2);
|
|
165165
165165
|
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
165166
165166
|
return function serveStatic2(req, res, next) {
|
|
165167
165167
|
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
@@ -168535,8 +168535,8 @@ var require_executor = __commonJS((exports, module) => {
|
|
|
168535
168535
|
}
|
|
168536
168536
|
resetBuffer() {
|
|
168537
168537
|
this.buffer = new Waterfall;
|
|
168538
|
-
this.buffer.chain(new Promise((
|
|
168539
|
-
this._triggerBuffer =
|
|
168538
|
+
this.buffer.chain(new Promise((resolve9) => {
|
|
168539
|
+
this._triggerBuffer = resolve9;
|
|
168540
168540
|
}));
|
|
168541
168541
|
if (this.ready)
|
|
168542
168542
|
this._triggerBuffer();
|
|
@@ -169556,7 +169556,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
169556
169556
|
throw e8;
|
|
169557
169557
|
}
|
|
169558
169558
|
};
|
|
169559
|
-
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((
|
|
169559
|
+
var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve9, reject) => {
|
|
169560
169560
|
try {
|
|
169561
169561
|
const stream = writeFileStream(filename, { mode });
|
|
169562
169562
|
const readable2 = Readable6.from(lines);
|
|
@@ -169573,7 +169573,7 @@ var require_storage = __commonJS((exports, module) => {
|
|
|
169573
169573
|
if (err)
|
|
169574
169574
|
reject(err);
|
|
169575
169575
|
else
|
|
169576
|
-
|
|
169576
|
+
resolve9();
|
|
169577
169577
|
});
|
|
169578
169578
|
});
|
|
169579
169579
|
readable2.on("error", (err) => {
|
|
@@ -169744,7 +169744,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
169744
169744
|
return { data: tdata, indexes };
|
|
169745
169745
|
}
|
|
169746
169746
|
treatRawStreamAsync(rawStream) {
|
|
169747
|
-
return new Promise((
|
|
169747
|
+
return new Promise((resolve9, reject) => {
|
|
169748
169748
|
const dataById = {};
|
|
169749
169749
|
const indexes = {};
|
|
169750
169750
|
let corruptItems = 0;
|
|
@@ -169787,7 +169787,7 @@ var require_persistence = __commonJS((exports, module) => {
|
|
|
169787
169787
|
}
|
|
169788
169788
|
}
|
|
169789
169789
|
const data = Object.values(dataById);
|
|
169790
|
-
|
|
169790
|
+
resolve9({ data, indexes });
|
|
169791
169791
|
});
|
|
169792
169792
|
lineStream.on("error", function(err) {
|
|
169793
169793
|
reject(err, null);
|
|
@@ -190013,7 +190013,7 @@ var require_socket = __commonJS((exports) => {
|
|
|
190013
190013
|
} else {
|
|
190014
190014
|
this.remoteAddress = req.connection.remoteAddress;
|
|
190015
190015
|
}
|
|
190016
|
-
}
|
|
190016
|
+
}
|
|
190017
190017
|
this.pingTimeoutTimer = null;
|
|
190018
190018
|
this.pingIntervalTimer = null;
|
|
190019
190019
|
this.setTransport(transport);
|
|
@@ -195398,13 +195398,13 @@ var require_broadcast_operator = __commonJS((exports) => {
|
|
|
195398
195398
|
return true;
|
|
195399
195399
|
}
|
|
195400
195400
|
emitWithAck(ev2, ...args) {
|
|
195401
|
-
return new Promise((
|
|
195401
|
+
return new Promise((resolve9, reject) => {
|
|
195402
195402
|
args.push((err, responses) => {
|
|
195403
195403
|
if (err) {
|
|
195404
195404
|
err.responses = responses;
|
|
195405
195405
|
return reject(err);
|
|
195406
195406
|
} else {
|
|
195407
|
-
return
|
|
195407
|
+
return resolve9(responses);
|
|
195408
195408
|
}
|
|
195409
195409
|
});
|
|
195410
195410
|
this.emit(ev2, ...args);
|
|
@@ -195592,12 +195592,12 @@ var require_socket2 = __commonJS((exports) => {
|
|
|
195592
195592
|
}
|
|
195593
195593
|
emitWithAck(ev2, ...args) {
|
|
195594
195594
|
const withErr = this.flags.timeout !== undefined;
|
|
195595
|
-
return new Promise((
|
|
195595
|
+
return new Promise((resolve9, reject) => {
|
|
195596
195596
|
args.push((arg1, arg2) => {
|
|
195597
195597
|
if (withErr) {
|
|
195598
|
-
return arg1 ? reject(arg1) :
|
|
195598
|
+
return arg1 ? reject(arg1) : resolve9(arg2);
|
|
195599
195599
|
} else {
|
|
195600
|
-
return
|
|
195600
|
+
return resolve9(arg1);
|
|
195601
195601
|
}
|
|
195602
195602
|
});
|
|
195603
195603
|
this.emit(ev2, ...args);
|
|
@@ -196052,13 +196052,13 @@ var require_namespace = __commonJS((exports) => {
|
|
|
196052
196052
|
return true;
|
|
196053
196053
|
}
|
|
196054
196054
|
serverSideEmitWithAck(ev2, ...args) {
|
|
196055
|
-
return new Promise((
|
|
196055
|
+
return new Promise((resolve9, reject) => {
|
|
196056
196056
|
args.push((err, responses) => {
|
|
196057
196057
|
if (err) {
|
|
196058
196058
|
err.responses = responses;
|
|
196059
196059
|
return reject(err);
|
|
196060
196060
|
} else {
|
|
196061
|
-
return
|
|
196061
|
+
return resolve9(responses);
|
|
196062
196062
|
}
|
|
196063
196063
|
});
|
|
196064
196064
|
this.serverSideEmit(ev2, ...args);
|
|
@@ -196742,7 +196742,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
196742
196742
|
return localSockets;
|
|
196743
196743
|
}
|
|
196744
196744
|
const requestId = randomId();
|
|
196745
|
-
return new Promise((
|
|
196745
|
+
return new Promise((resolve9, reject) => {
|
|
196746
196746
|
const timeout3 = setTimeout(() => {
|
|
196747
196747
|
const storedRequest2 = this.requests.get(requestId);
|
|
196748
196748
|
if (storedRequest2) {
|
|
@@ -196752,7 +196752,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
196752
196752
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
196753
196753
|
const storedRequest = {
|
|
196754
196754
|
type: MessageType.FETCH_SOCKETS,
|
|
196755
|
-
resolve:
|
|
196755
|
+
resolve: resolve9,
|
|
196756
196756
|
timeout: timeout3,
|
|
196757
196757
|
current: 0,
|
|
196758
196758
|
expected: expectedResponseCount,
|
|
@@ -196962,7 +196962,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
196962
196962
|
return localSockets;
|
|
196963
196963
|
}
|
|
196964
196964
|
const requestId = randomId();
|
|
196965
|
-
return new Promise((
|
|
196965
|
+
return new Promise((resolve9, reject) => {
|
|
196966
196966
|
const timeout3 = setTimeout(() => {
|
|
196967
196967
|
const storedRequest2 = this.customRequests.get(requestId);
|
|
196968
196968
|
if (storedRequest2) {
|
|
@@ -196972,7 +196972,7 @@ var require_cluster_adapter = __commonJS((exports) => {
|
|
|
196972
196972
|
}, opts.flags.timeout || DEFAULT_TIMEOUT);
|
|
196973
196973
|
const storedRequest = {
|
|
196974
196974
|
type: MessageType.FETCH_SOCKETS,
|
|
196975
|
-
resolve:
|
|
196975
|
+
resolve: resolve9,
|
|
196976
196976
|
timeout: timeout3,
|
|
196977
196977
|
missingUids: new Set([...this.nodesMap.keys()]),
|
|
196978
196978
|
responses: localSockets
|
|
@@ -197701,13 +197701,13 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
197701
197701
|
this.engine.close();
|
|
197702
197702
|
(0, uws_1.restoreAdapter)();
|
|
197703
197703
|
if (this.httpServer) {
|
|
197704
|
-
return new Promise((
|
|
197704
|
+
return new Promise((resolve9) => {
|
|
197705
197705
|
this.httpServer.close((err) => {
|
|
197706
197706
|
fn9 && fn9(err);
|
|
197707
197707
|
if (err) {
|
|
197708
197708
|
debug("server was not running");
|
|
197709
197709
|
}
|
|
197710
|
-
|
|
197710
|
+
resolve9();
|
|
197711
197711
|
});
|
|
197712
197712
|
});
|
|
197713
197713
|
} else {
|
|
@@ -214616,7 +214616,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
214616
214616
|
}
|
|
214617
214617
|
}, {
|
|
214618
214618
|
key: "join",
|
|
214619
|
-
value: function
|
|
214619
|
+
value: function join24(s5) {
|
|
214620
214620
|
if (this.length === 0)
|
|
214621
214621
|
return "";
|
|
214622
214622
|
var p4 = this.head;
|
|
@@ -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 resolve9 = iter[kLastResolve];
|
|
215918
|
+
if (resolve9 !== 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
|
+
resolve9(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(resolve9, reject) {
|
|
215933
215933
|
lastPromise.then(function() {
|
|
215934
215934
|
if (iter[kEnded]) {
|
|
215935
|
-
|
|
215935
|
+
resolve9(createIterResult(undefined, true));
|
|
215936
215936
|
return;
|
|
215937
215937
|
}
|
|
215938
|
-
iter[kHandlePromise](
|
|
215938
|
+
iter[kHandlePromise](resolve9, 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(resolve9, reject) {
|
|
215958
215958
|
process.nextTick(function() {
|
|
215959
215959
|
if (_this[kError]) {
|
|
215960
215960
|
reject(_this[kError]);
|
|
215961
215961
|
} else {
|
|
215962
|
-
|
|
215962
|
+
resolve9(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(resolve9, reject) {
|
|
215986
215986
|
_this2[kStream].destroy(null, function(err) {
|
|
215987
215987
|
if (err) {
|
|
215988
215988
|
reject(err);
|
|
215989
215989
|
return;
|
|
215990
215990
|
}
|
|
215991
|
-
|
|
215991
|
+
resolve9(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(resolve9, 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
|
+
resolve9(createIterResult(data, false));
|
|
216020
216020
|
} else {
|
|
216021
|
-
iterator[kLastResolve] =
|
|
216021
|
+
iterator[kLastResolve] = resolve9;
|
|
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 resolve9 = iterator[kLastResolve];
|
|
216041
|
+
if (resolve9 !== null) {
|
|
216042
216042
|
iterator[kLastPromise] = null;
|
|
216043
216043
|
iterator[kLastResolve] = null;
|
|
216044
216044
|
iterator[kLastReject] = null;
|
|
216045
|
-
|
|
216045
|
+
resolve9(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, resolve9, 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
|
+
resolve9(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(resolve9, reject) {
|
|
216075
216075
|
var gen = fn9.apply(self2, args);
|
|
216076
216076
|
function _next(value) {
|
|
216077
|
-
asyncGeneratorStep(gen,
|
|
216077
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "next", value);
|
|
216078
216078
|
}
|
|
216079
216079
|
function _throw(err) {
|
|
216080
|
-
asyncGeneratorStep(gen,
|
|
216080
|
+
asyncGeneratorStep(gen, resolve9, reject, _next, _throw, "throw", err);
|
|
216081
216081
|
}
|
|
216082
216082
|
_next(undefined);
|
|
216083
216083
|
});
|
|
@@ -218270,7 +218270,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
218270
218270
|
});
|
|
218271
218271
|
|
|
218272
218272
|
// src/cli/index.ts
|
|
218273
|
-
import { dirname as
|
|
218273
|
+
import { dirname as dirname21, join as join27 } from "node:path";
|
|
218274
218274
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
218275
218275
|
|
|
218276
218276
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -219478,7 +219478,7 @@ var {
|
|
|
219478
219478
|
} = import__.default;
|
|
219479
219479
|
|
|
219480
219480
|
// src/cli/commands/agents/pull.ts
|
|
219481
|
-
import { dirname as
|
|
219481
|
+
import { dirname as dirname8, join as join13 } from "node:path";
|
|
219482
219482
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
219483
219483
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
219484
219484
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
@@ -231128,7 +231128,7 @@ function finalize(ctx, schema) {
|
|
|
231128
231128
|
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
231129
231129
|
} else if (ctx.target === "draft-04") {
|
|
231130
231130
|
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
231131
|
-
} else if (ctx.target === "openapi-3.0") {}
|
|
231131
|
+
} else if (ctx.target === "openapi-3.0") {}
|
|
231132
231132
|
if (ctx.external?.uri) {
|
|
231133
231133
|
const id = ctx.external.registry.get(schema)?.id;
|
|
231134
231134
|
if (!id)
|
|
@@ -231376,7 +231376,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
|
|
|
231376
231376
|
if (val === undefined) {
|
|
231377
231377
|
if (ctx.unrepresentable === "throw") {
|
|
231378
231378
|
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
231379
|
-
}
|
|
231379
|
+
}
|
|
231380
231380
|
} else if (typeof val === "bigint") {
|
|
231381
231381
|
if (ctx.unrepresentable === "throw") {
|
|
231382
231382
|
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
@@ -234622,6 +234622,12 @@ var SiteConfigSchema = exports_external.object({
|
|
|
234622
234622
|
outputDirectory: exports_external.string().optional(),
|
|
234623
234623
|
installCommand: exports_external.string().optional()
|
|
234624
234624
|
});
|
|
234625
|
+
var PluginMetadataSchema = exports_external.object({
|
|
234626
|
+
namespace: exports_external.string().min(1, "Plugin namespace cannot be empty").regex(/^[a-zA-Z0-9_-]+$/, "Plugin namespace can only contain letters, numbers, underscores, and dashes")
|
|
234627
|
+
});
|
|
234628
|
+
var PluginReferenceSchema = exports_external.object({
|
|
234629
|
+
source: exports_external.string().min(1, "Plugin source cannot be empty")
|
|
234630
|
+
});
|
|
234625
234631
|
var ProjectConfigSchema = exports_external.object({
|
|
234626
234632
|
name: exports_external.string({
|
|
234627
234633
|
error: "App name cannot be empty"
|
|
@@ -234632,7 +234638,9 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
234632
234638
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
234633
234639
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
234634
234640
|
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
234635
|
-
authDir: exports_external.string().optional().default("auth")
|
|
234641
|
+
authDir: exports_external.string().optional().default("auth"),
|
|
234642
|
+
plugin: PluginMetadataSchema.optional(),
|
|
234643
|
+
plugins: exports_external.array(PluginReferenceSchema).optional().default([])
|
|
234636
234644
|
});
|
|
234637
234645
|
var AppConfigSchema = exports_external.object({
|
|
234638
234646
|
id: exports_external.string().min(1, "id cannot be empty")
|
|
@@ -241579,7 +241587,43 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
241579
241587
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
241580
241588
|
|
|
241581
241589
|
// src/core/project/config.ts
|
|
241582
|
-
import { dirname as
|
|
241590
|
+
import { dirname as dirname6, join as join9 } from "node:path";
|
|
241591
|
+
|
|
241592
|
+
// src/core/project/plugins.ts
|
|
241593
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
241594
|
+
import { dirname as dirname3, join as join3, resolve } from "node:path";
|
|
241595
|
+
function resolvePluginRoot(pluginSource, fromRoot) {
|
|
241596
|
+
if (pluginSource.startsWith(".")) {
|
|
241597
|
+
return resolve(fromRoot, pluginSource);
|
|
241598
|
+
}
|
|
241599
|
+
const req = createRequire2(join3(fromRoot, "package.json"));
|
|
241600
|
+
return dirname3(req.resolve(`${pluginSource}/package.json`));
|
|
241601
|
+
}
|
|
241602
|
+
function requirePluginNamespace(project, pluginSource, configPath) {
|
|
241603
|
+
if (!project.plugin?.namespace) {
|
|
241604
|
+
throw new ConfigInvalidError(`Plugin loaded from "${pluginSource}" must define plugin.namespace`, configPath);
|
|
241605
|
+
}
|
|
241606
|
+
return project.plugin.namespace;
|
|
241607
|
+
}
|
|
241608
|
+
function namespacePluginFunctions(functions, pluginNamespace) {
|
|
241609
|
+
return functions.map((fn) => ({
|
|
241610
|
+
...fn,
|
|
241611
|
+
name: `${pluginNamespace}__${fn.name}`,
|
|
241612
|
+
source: {
|
|
241613
|
+
type: "plugin",
|
|
241614
|
+
namespace: pluginNamespace
|
|
241615
|
+
}
|
|
241616
|
+
}));
|
|
241617
|
+
}
|
|
241618
|
+
function markPluginEntities(entities, pluginNamespace) {
|
|
241619
|
+
return entities.map((entity) => ({
|
|
241620
|
+
...entity,
|
|
241621
|
+
source: {
|
|
241622
|
+
type: "plugin",
|
|
241623
|
+
namespace: pluginNamespace
|
|
241624
|
+
}
|
|
241625
|
+
}));
|
|
241626
|
+
}
|
|
241583
241627
|
|
|
241584
241628
|
// src/core/resources/agent/schema.ts
|
|
241585
241629
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -241651,7 +241695,7 @@ async function fetchAgents() {
|
|
|
241651
241695
|
return result.data;
|
|
241652
241696
|
}
|
|
241653
241697
|
// src/core/resources/agent/config.ts
|
|
241654
|
-
import { join as
|
|
241698
|
+
import { join as join4, normalize } from "node:path";
|
|
241655
241699
|
import { isDeepStrictEqual } from "node:util";
|
|
241656
241700
|
async function readAgentFile(agentPath) {
|
|
241657
241701
|
const raw2 = await readJsonFile(agentPath);
|
|
@@ -241696,12 +241740,12 @@ async function readAllAgents(agentsDir) {
|
|
|
241696
241740
|
return [...nameToEntry.values()].map((e2) => e2.data);
|
|
241697
241741
|
}
|
|
241698
241742
|
function findAvailablePath(agentsDir, name2, claimedPaths) {
|
|
241699
|
-
const base =
|
|
241743
|
+
const base = join4(agentsDir, `${name2}.${CONFIG_FILE_EXTENSION}`);
|
|
241700
241744
|
if (!claimedPaths.has(base)) {
|
|
241701
241745
|
return base;
|
|
241702
241746
|
}
|
|
241703
241747
|
for (let i = 1;; i++) {
|
|
241704
|
-
const candidate =
|
|
241748
|
+
const candidate = join4(agentsDir, `${name2}_${i}.${CONFIG_FILE_EXTENSION}`);
|
|
241705
241749
|
if (!claimedPaths.has(candidate)) {
|
|
241706
241750
|
return candidate;
|
|
241707
241751
|
}
|
|
@@ -241847,7 +241891,7 @@ async function pushAuthConfigToApi(config3) {
|
|
|
241847
241891
|
return result.data.authConfig;
|
|
241848
241892
|
}
|
|
241849
241893
|
// src/core/resources/auth-config/config.ts
|
|
241850
|
-
import { join as
|
|
241894
|
+
import { join as join5 } from "node:path";
|
|
241851
241895
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
241852
241896
|
var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
|
|
241853
241897
|
var DEFAULT_AUTH_CONFIG = {
|
|
@@ -241863,7 +241907,7 @@ var DEFAULT_AUTH_CONFIG = {
|
|
|
241863
241907
|
useWorkspaceSSO: false
|
|
241864
241908
|
};
|
|
241865
241909
|
function getAuthConfigPath(authDir) {
|
|
241866
|
-
return
|
|
241910
|
+
return join5(authDir, AUTH_CONFIG_FILENAME);
|
|
241867
241911
|
}
|
|
241868
241912
|
async function readAuthConfig(authDir) {
|
|
241869
241913
|
const filePath = getAuthConfigPath(authDir);
|
|
@@ -242515,7 +242559,7 @@ async function removeStripe() {
|
|
|
242515
242559
|
return result.data;
|
|
242516
242560
|
}
|
|
242517
242561
|
// src/core/resources/connector/config.ts
|
|
242518
|
-
import { join as
|
|
242562
|
+
import { join as join6 } from "node:path";
|
|
242519
242563
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
242520
242564
|
async function readConnectorFile(connectorPath) {
|
|
242521
242565
|
const parsed = await readJsonFile(connectorPath);
|
|
@@ -242576,7 +242620,7 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
242576
242620
|
if (existing && isDeepStrictEqual3(existing.data, connector)) {
|
|
242577
242621
|
continue;
|
|
242578
242622
|
}
|
|
242579
|
-
const filePath = existing?.filePath ??
|
|
242623
|
+
const filePath = existing?.filePath ?? join6(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
242580
242624
|
await writeJsonFile(filePath, connector);
|
|
242581
242625
|
written.push(connector.type);
|
|
242582
242626
|
}
|
|
@@ -242731,6 +242775,17 @@ var connectorResource = {
|
|
|
242731
242775
|
readAll: readAllConnectors,
|
|
242732
242776
|
push: pushConnectors
|
|
242733
242777
|
};
|
|
242778
|
+
// src/core/resources/types.ts
|
|
242779
|
+
var ResourceSourceSchema = exports_external.discriminatedUnion("type", [
|
|
242780
|
+
exports_external.object({
|
|
242781
|
+
type: exports_external.literal("project")
|
|
242782
|
+
}),
|
|
242783
|
+
exports_external.object({
|
|
242784
|
+
type: exports_external.literal("plugin"),
|
|
242785
|
+
namespace: exports_external.string().min(1, "Plugin namespace cannot be empty")
|
|
242786
|
+
})
|
|
242787
|
+
]);
|
|
242788
|
+
|
|
242734
242789
|
// src/core/resources/entity/schema.ts
|
|
242735
242790
|
var FieldConditionSchema = exports_external.union([
|
|
242736
242791
|
exports_external.string(),
|
|
@@ -242837,7 +242892,8 @@ var EntitySchema = exports_external.looseObject({
|
|
|
242837
242892
|
description: exports_external.string().optional(),
|
|
242838
242893
|
properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema).default({}),
|
|
242839
242894
|
required: exports_external.array(exports_external.string()).optional(),
|
|
242840
|
-
rls: EntityRLSSchema.optional()
|
|
242895
|
+
rls: EntityRLSSchema.optional(),
|
|
242896
|
+
source: ResourceSourceSchema.default({ type: "project" })
|
|
242841
242897
|
});
|
|
242842
242898
|
var SyncEntitiesResponseSchema = exports_external.object({
|
|
242843
242899
|
created: exports_external.array(exports_external.string()),
|
|
@@ -242848,7 +242904,7 @@ var SyncEntitiesResponseSchema = exports_external.object({
|
|
|
242848
242904
|
// src/core/resources/entity/api.ts
|
|
242849
242905
|
async function syncEntities(entities) {
|
|
242850
242906
|
const appClient = getAppClient();
|
|
242851
|
-
const schemaSyncPayload = Object.fromEntries(entities.map((entity) => [entity.name, entity]));
|
|
242907
|
+
const schemaSyncPayload = Object.fromEntries(entities.map(({ source: _source, ...entity }) => [entity.name, entity]));
|
|
242852
242908
|
let response;
|
|
242853
242909
|
try {
|
|
242854
242910
|
response = await appClient.put("entity-schemas", {
|
|
@@ -242884,6 +242940,19 @@ async function readAllEntities(entitiesDir) {
|
|
|
242884
242940
|
absolute: true
|
|
242885
242941
|
});
|
|
242886
242942
|
const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
|
|
242943
|
+
const names = new Set;
|
|
242944
|
+
for (const entity of entities) {
|
|
242945
|
+
if (names.has(entity.name)) {
|
|
242946
|
+
throw new InvalidInputError(`Duplicate entity name "${entity.name}"`, {
|
|
242947
|
+
hints: [
|
|
242948
|
+
{
|
|
242949
|
+
message: `Remove duplicate entities with name "${entity.name}" - only one entity per name is allowed`
|
|
242950
|
+
}
|
|
242951
|
+
]
|
|
242952
|
+
});
|
|
242953
|
+
}
|
|
242954
|
+
names.add(entity.name);
|
|
242955
|
+
}
|
|
242887
242956
|
return entities;
|
|
242888
242957
|
}
|
|
242889
242958
|
// src/core/resources/entity/deploy.ts
|
|
@@ -242898,6 +242967,57 @@ var entityResource = {
|
|
|
242898
242967
|
readAll: readAllEntities,
|
|
242899
242968
|
push: pushEntities
|
|
242900
242969
|
};
|
|
242970
|
+
// src/core/resources/entity/merge.ts
|
|
242971
|
+
function mergePluginEntity(pluginEntity, projectEntity, configPath) {
|
|
242972
|
+
const unsupportedFields = [
|
|
242973
|
+
projectEntity.title ? "title" : null,
|
|
242974
|
+
projectEntity.description ? "description" : null,
|
|
242975
|
+
projectEntity.rls ? "rls" : null
|
|
242976
|
+
].filter(Boolean);
|
|
242977
|
+
if (unsupportedFields.length > 0) {
|
|
242978
|
+
throw new ConfigInvalidError(`Project entity "${projectEntity.name}" extends a plugin entity and cannot override fields: ${unsupportedFields.join(", ")}.`, configPath);
|
|
242979
|
+
}
|
|
242980
|
+
const projectProperties = projectEntity.properties ?? {};
|
|
242981
|
+
const addedPropertyNames = new Set(Object.keys(projectProperties));
|
|
242982
|
+
for (const propertyName of addedPropertyNames) {
|
|
242983
|
+
if (propertyName in pluginEntity.properties) {
|
|
242984
|
+
throw new ConfigInvalidError(`Cannot override plugin-defined property "${propertyName}"`, configPath);
|
|
242985
|
+
}
|
|
242986
|
+
}
|
|
242987
|
+
for (const requiredProperty of projectEntity.required ?? []) {
|
|
242988
|
+
if (!addedPropertyNames.has(requiredProperty)) {
|
|
242989
|
+
throw new ConfigInvalidError(`Required property "${requiredProperty}" must be declared in project entity "${projectEntity.name}" properties`, configPath);
|
|
242990
|
+
}
|
|
242991
|
+
}
|
|
242992
|
+
const required2 = pluginEntity.required || projectEntity.required ? [
|
|
242993
|
+
...new Set([
|
|
242994
|
+
...pluginEntity.required ?? [],
|
|
242995
|
+
...projectEntity.required ?? []
|
|
242996
|
+
])
|
|
242997
|
+
] : undefined;
|
|
242998
|
+
return {
|
|
242999
|
+
...pluginEntity,
|
|
243000
|
+
properties: {
|
|
243001
|
+
...pluginEntity.properties,
|
|
243002
|
+
...projectProperties
|
|
243003
|
+
},
|
|
243004
|
+
...required2 ? { required: required2 } : {}
|
|
243005
|
+
};
|
|
243006
|
+
}
|
|
243007
|
+
function mergeProjectAndPluginEntities(projectEntities, pluginEntities, configPath) {
|
|
243008
|
+
const projectEntitiesByName = new Map(projectEntities.map((entity) => [entity.name, entity]));
|
|
243009
|
+
const pluginEntityNames = new Set(pluginEntities.map((entity) => entity.name));
|
|
243010
|
+
const resolvedPluginEntities = pluginEntities.map((pluginEntity) => {
|
|
243011
|
+
const projectEntity = projectEntitiesByName.get(pluginEntity.name);
|
|
243012
|
+
if (!projectEntity) {
|
|
243013
|
+
return pluginEntity;
|
|
243014
|
+
}
|
|
243015
|
+
return mergePluginEntity(pluginEntity, projectEntity, configPath);
|
|
243016
|
+
});
|
|
243017
|
+
const projectOnlyEntities = projectEntities.filter((entity) => !pluginEntityNames.has(entity.name));
|
|
243018
|
+
return [...resolvedPluginEntities, ...projectOnlyEntities];
|
|
243019
|
+
}
|
|
243020
|
+
|
|
242901
243021
|
// src/core/resources/function/schema.ts
|
|
242902
243022
|
var FunctionNameSchema = exports_external.string().trim().min(1, "Function name cannot be empty").regex(/^[^.]+$/, "Function name cannot contain dots");
|
|
242903
243023
|
var FunctionFileSchema = exports_external.object({
|
|
@@ -242995,7 +243115,8 @@ var FunctionConfigSchema = exports_external.object({
|
|
|
242995
243115
|
});
|
|
242996
243116
|
var BackendFunctionSchema = FunctionConfigSchema.extend({
|
|
242997
243117
|
entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
|
|
242998
|
-
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file")
|
|
243118
|
+
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file"),
|
|
243119
|
+
source: ResourceSourceSchema
|
|
242999
243120
|
});
|
|
243000
243121
|
var DeploySingleFunctionResponseSchema = exports_external.object({
|
|
243001
243122
|
status: exports_external.enum(["deployed", "unchanged"])
|
|
@@ -243100,7 +243221,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
243100
243221
|
return result.data;
|
|
243101
243222
|
}
|
|
243102
243223
|
// src/core/resources/function/config.ts
|
|
243103
|
-
import { basename as basename2, dirname as
|
|
243224
|
+
import { basename as basename2, dirname as dirname4, join as join7, relative } from "node:path";
|
|
243104
243225
|
async function readFunctionConfig(configPath) {
|
|
243105
243226
|
const parsed = await readJsonFile(configPath);
|
|
243106
243227
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -243111,8 +243232,8 @@ async function readFunctionConfig(configPath) {
|
|
|
243111
243232
|
}
|
|
243112
243233
|
async function readFunction(configPath) {
|
|
243113
243234
|
const config6 = await readFunctionConfig(configPath);
|
|
243114
|
-
const functionDir =
|
|
243115
|
-
const entryPath =
|
|
243235
|
+
const functionDir = dirname4(configPath);
|
|
243236
|
+
const entryPath = join7(functionDir, config6.entry);
|
|
243116
243237
|
if (!await pathExists(entryPath)) {
|
|
243117
243238
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
243118
243239
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -243122,7 +243243,12 @@ async function readFunction(configPath) {
|
|
|
243122
243243
|
cwd: functionDir,
|
|
243123
243244
|
absolute: true
|
|
243124
243245
|
});
|
|
243125
|
-
const functionData = {
|
|
243246
|
+
const functionData = {
|
|
243247
|
+
...config6,
|
|
243248
|
+
entryPath,
|
|
243249
|
+
filePaths,
|
|
243250
|
+
source: { type: "project" }
|
|
243251
|
+
};
|
|
243126
243252
|
return functionData;
|
|
243127
243253
|
}
|
|
243128
243254
|
async function readAllFunctions(functionsDir) {
|
|
@@ -243138,11 +243264,11 @@ async function readAllFunctions(functionsDir) {
|
|
|
243138
243264
|
absolute: true,
|
|
243139
243265
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
243140
243266
|
});
|
|
243141
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
243142
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
243267
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
243268
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
|
|
243143
243269
|
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
243144
243270
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
243145
|
-
const functionDir =
|
|
243271
|
+
const functionDir = dirname4(entryFile);
|
|
243146
243272
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
243147
243273
|
cwd: functionDir,
|
|
243148
243274
|
absolute: true
|
|
@@ -243158,7 +243284,14 @@ async function readAllFunctions(functionsDir) {
|
|
|
243158
243284
|
});
|
|
243159
243285
|
}
|
|
243160
243286
|
const entry = basename2(entryFile);
|
|
243161
|
-
|
|
243287
|
+
const functionData = {
|
|
243288
|
+
name: name2,
|
|
243289
|
+
entry,
|
|
243290
|
+
entryPath: entryFile,
|
|
243291
|
+
filePaths,
|
|
243292
|
+
source: { type: "project" }
|
|
243293
|
+
};
|
|
243294
|
+
return functionData;
|
|
243162
243295
|
}));
|
|
243163
243296
|
const functions = [...functionsFromConfig, ...functionsWithoutConfig];
|
|
243164
243297
|
const names = new Set;
|
|
@@ -243177,9 +243310,9 @@ async function readAllFunctions(functionsDir) {
|
|
|
243177
243310
|
return functions;
|
|
243178
243311
|
}
|
|
243179
243312
|
// src/core/resources/function/deploy.ts
|
|
243180
|
-
import { dirname as
|
|
243313
|
+
import { dirname as dirname5, relative as relative2 } from "node:path";
|
|
243181
243314
|
async function loadFunctionCode(fn) {
|
|
243182
|
-
const functionDir =
|
|
243315
|
+
const functionDir = dirname5(fn.entryPath);
|
|
243183
243316
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
243184
243317
|
const content = await readTextFile(filePath);
|
|
243185
243318
|
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
@@ -243246,14 +243379,14 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
243246
243379
|
return results;
|
|
243247
243380
|
}
|
|
243248
243381
|
// src/core/resources/function/pull.ts
|
|
243249
|
-
import { join as
|
|
243382
|
+
import { join as join8 } from "node:path";
|
|
243250
243383
|
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
243251
243384
|
async function writeFunctions(functionsDir, functions) {
|
|
243252
243385
|
const written = [];
|
|
243253
243386
|
const skipped = [];
|
|
243254
243387
|
for (const fn of functions) {
|
|
243255
|
-
const functionDir =
|
|
243256
|
-
const configPath =
|
|
243388
|
+
const functionDir = join8(functionsDir, fn.name);
|
|
243389
|
+
const configPath = join8(functionDir, "function.jsonc");
|
|
243257
243390
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
243258
243391
|
skipped.push(fn.name);
|
|
243259
243392
|
continue;
|
|
@@ -243267,7 +243400,7 @@ async function writeFunctions(functionsDir, functions) {
|
|
|
243267
243400
|
}
|
|
243268
243401
|
await writeJsonFile(configPath, config6);
|
|
243269
243402
|
for (const file2 of fn.files) {
|
|
243270
|
-
await writeFile(
|
|
243403
|
+
await writeFile(join8(functionDir, file2.path), file2.content);
|
|
243271
243404
|
}
|
|
243272
243405
|
written.push(fn.name);
|
|
243273
243406
|
}
|
|
@@ -243277,7 +243410,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243277
243410
|
if (!await pathExists(functionDir)) {
|
|
243278
243411
|
return false;
|
|
243279
243412
|
}
|
|
243280
|
-
const configPath =
|
|
243413
|
+
const configPath = join8(functionDir, "function.jsonc");
|
|
243281
243414
|
try {
|
|
243282
243415
|
const localConfig = await readJsonFile(configPath);
|
|
243283
243416
|
if (localConfig.entry !== fn.entry) {
|
|
@@ -243290,7 +243423,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243290
243423
|
return false;
|
|
243291
243424
|
}
|
|
243292
243425
|
for (const file2 of fn.files) {
|
|
243293
|
-
const filePath =
|
|
243426
|
+
const filePath = join8(functionDir, file2.path);
|
|
243294
243427
|
if (!await pathExists(filePath)) {
|
|
243295
243428
|
return false;
|
|
243296
243429
|
}
|
|
@@ -243320,49 +243453,145 @@ async function findConfigInDir(dir) {
|
|
|
243320
243453
|
}
|
|
243321
243454
|
async function findProjectRoot(startPath) {
|
|
243322
243455
|
let current = startPath || process.cwd();
|
|
243323
|
-
while (current !==
|
|
243456
|
+
while (current !== dirname6(current)) {
|
|
243324
243457
|
const configPath = await findConfigInDir(current);
|
|
243325
243458
|
if (configPath) {
|
|
243326
243459
|
return { root: current, configPath };
|
|
243327
243460
|
}
|
|
243328
|
-
current =
|
|
243461
|
+
current = dirname6(current);
|
|
243329
243462
|
}
|
|
243330
243463
|
return null;
|
|
243331
243464
|
}
|
|
243332
|
-
|
|
243333
|
-
|
|
243334
|
-
|
|
243335
|
-
|
|
243336
|
-
|
|
243337
|
-
|
|
243338
|
-
|
|
243465
|
+
|
|
243466
|
+
class ProjectConfigReader {
|
|
243467
|
+
pluginNamespaces = new Set;
|
|
243468
|
+
async readProjectConfig(projectRoot) {
|
|
243469
|
+
const { root, configPath } = await this.findConfigOrThrow(projectRoot);
|
|
243470
|
+
const project = await this.readConfigFile(configPath);
|
|
243471
|
+
this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
|
|
243472
|
+
const localResources = await this.readProjectResources(configPath, project);
|
|
243473
|
+
const pluginResources = await this.readPlugins(project.plugins, configPath);
|
|
243474
|
+
const entities = mergeProjectAndPluginEntities(localResources.entities, pluginResources.entities, configPath);
|
|
243475
|
+
const functions = [
|
|
243476
|
+
...localResources.functions,
|
|
243477
|
+
...pluginResources.functions
|
|
243478
|
+
];
|
|
243479
|
+
return {
|
|
243480
|
+
project: { ...project, root, configPath },
|
|
243481
|
+
entities,
|
|
243482
|
+
functions,
|
|
243483
|
+
agents: localResources.agents,
|
|
243484
|
+
connectors: localResources.connectors,
|
|
243485
|
+
authConfig: localResources.authConfig
|
|
243486
|
+
};
|
|
243487
|
+
}
|
|
243488
|
+
async findConfigOrThrow(projectRoot) {
|
|
243489
|
+
let found;
|
|
243490
|
+
if (projectRoot) {
|
|
243491
|
+
const configPath = await findConfigInDir(projectRoot);
|
|
243492
|
+
found = configPath ? { root: projectRoot, configPath } : null;
|
|
243493
|
+
} else {
|
|
243494
|
+
found = await findProjectRoot();
|
|
243495
|
+
}
|
|
243496
|
+
if (!found) {
|
|
243497
|
+
throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
|
|
243498
|
+
}
|
|
243499
|
+
return found;
|
|
243339
243500
|
}
|
|
243340
|
-
|
|
243341
|
-
|
|
243501
|
+
async readConfigFile(configPath) {
|
|
243502
|
+
const parsed = await readJsonFile(configPath);
|
|
243503
|
+
const result = ProjectConfigSchema.safeParse(parsed);
|
|
243504
|
+
if (!result.success) {
|
|
243505
|
+
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
243506
|
+
}
|
|
243507
|
+
return result.data;
|
|
243342
243508
|
}
|
|
243343
|
-
|
|
243344
|
-
|
|
243345
|
-
|
|
243346
|
-
|
|
243347
|
-
|
|
243348
|
-
|
|
243349
|
-
|
|
243350
|
-
|
|
243351
|
-
|
|
243352
|
-
|
|
243353
|
-
|
|
243354
|
-
|
|
243355
|
-
|
|
243356
|
-
|
|
243357
|
-
|
|
243358
|
-
|
|
243359
|
-
|
|
243360
|
-
|
|
243361
|
-
|
|
243362
|
-
|
|
243363
|
-
|
|
243364
|
-
|
|
243365
|
-
|
|
243509
|
+
async readProjectResources(configPath, project) {
|
|
243510
|
+
const configDir = dirname6(configPath);
|
|
243511
|
+
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243512
|
+
entityResource.readAll(join9(configDir, project.entitiesDir)),
|
|
243513
|
+
functionResource.readAll(join9(configDir, project.functionsDir)),
|
|
243514
|
+
agentResource.readAll(join9(configDir, project.agentsDir)),
|
|
243515
|
+
connectorResource.readAll(join9(configDir, project.connectorsDir)),
|
|
243516
|
+
authConfigResource.readAll(join9(configDir, project.authDir))
|
|
243517
|
+
]);
|
|
243518
|
+
return { entities, functions, agents, connectors, authConfig };
|
|
243519
|
+
}
|
|
243520
|
+
assertPluginProjectDoesNotLoadPlugins(project, configPath) {
|
|
243521
|
+
if (project.plugin && project.plugins.length > 0) {
|
|
243522
|
+
throw new ConfigInvalidError("Plugin projects cannot define plugins in this version.", configPath);
|
|
243523
|
+
}
|
|
243524
|
+
}
|
|
243525
|
+
registerPluginNamespace(pluginNamespace, configPath) {
|
|
243526
|
+
if (this.pluginNamespaces.has(pluginNamespace)) {
|
|
243527
|
+
throw new ConfigInvalidError(`Duplicate plugin namespace "${pluginNamespace}" in project configuration`, configPath, {
|
|
243528
|
+
hints: [
|
|
243529
|
+
{
|
|
243530
|
+
message: "Remove the plugin or change plugin namespace"
|
|
243531
|
+
}
|
|
243532
|
+
]
|
|
243533
|
+
});
|
|
243534
|
+
}
|
|
243535
|
+
this.pluginNamespaces.add(pluginNamespace);
|
|
243536
|
+
}
|
|
243537
|
+
async readPluginConfig(plugin, hostConfigPath) {
|
|
243538
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname6(hostConfigPath));
|
|
243539
|
+
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
243540
|
+
const project = await this.readConfigFile(configPath);
|
|
243541
|
+
const pluginNamespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
243542
|
+
this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
|
|
243543
|
+
return { configPath, pluginNamespace, project };
|
|
243544
|
+
}
|
|
243545
|
+
async readPluginResources(project, configPath, pluginNamespace) {
|
|
243546
|
+
const resources = await this.readProjectResources(configPath, project);
|
|
243547
|
+
return {
|
|
243548
|
+
entities: markPluginEntities(resources.entities, pluginNamespace),
|
|
243549
|
+
functions: namespacePluginFunctions(resources.functions, pluginNamespace),
|
|
243550
|
+
agents: [],
|
|
243551
|
+
connectors: [],
|
|
243552
|
+
authConfig: []
|
|
243553
|
+
};
|
|
243554
|
+
}
|
|
243555
|
+
async readPlugins(plugins, configPath) {
|
|
243556
|
+
const entities = [];
|
|
243557
|
+
const functions = [];
|
|
243558
|
+
const entityNameByPluginNamespace = new Map;
|
|
243559
|
+
for (const plugin of plugins) {
|
|
243560
|
+
const {
|
|
243561
|
+
configPath: pluginConfigPath,
|
|
243562
|
+
pluginNamespace,
|
|
243563
|
+
project
|
|
243564
|
+
} = await this.readPluginConfig(plugin, configPath);
|
|
243565
|
+
this.registerPluginNamespace(pluginNamespace, pluginConfigPath);
|
|
243566
|
+
const pluginData = await this.readPluginResources(project, pluginConfigPath, pluginNamespace);
|
|
243567
|
+
for (const entity of pluginData.entities) {
|
|
243568
|
+
const existingPluginNamespace = entityNameByPluginNamespace.get(entity.name);
|
|
243569
|
+
if (existingPluginNamespace) {
|
|
243570
|
+
throw new ConfigInvalidError(`Entity "${entity.name}" is defined by more than one plugin: "${existingPluginNamespace}" and "${pluginNamespace}".`, pluginConfigPath, {
|
|
243571
|
+
hints: [
|
|
243572
|
+
{
|
|
243573
|
+
message: "Plugin entity names are not namespaced. Remove one plugin or rename one of the entities."
|
|
243574
|
+
}
|
|
243575
|
+
]
|
|
243576
|
+
});
|
|
243577
|
+
}
|
|
243578
|
+
entityNameByPluginNamespace.set(entity.name, pluginNamespace);
|
|
243579
|
+
}
|
|
243580
|
+
entities.push(...pluginData.entities);
|
|
243581
|
+
functions.push(...pluginData.functions);
|
|
243582
|
+
}
|
|
243583
|
+
return {
|
|
243584
|
+
entities,
|
|
243585
|
+
functions,
|
|
243586
|
+
agents: [],
|
|
243587
|
+
connectors: [],
|
|
243588
|
+
authConfig: []
|
|
243589
|
+
};
|
|
243590
|
+
}
|
|
243591
|
+
}
|
|
243592
|
+
async function readProjectConfig(projectRoot) {
|
|
243593
|
+
const reader = new ProjectConfigReader;
|
|
243594
|
+
return await reader.readProjectConfig(projectRoot);
|
|
243366
243595
|
}
|
|
243367
243596
|
|
|
243368
243597
|
// src/core/project/app-config.ts
|
|
@@ -243539,12 +243768,12 @@ async function getSiteUrl(projectId) {
|
|
|
243539
243768
|
// src/core/project/template.ts
|
|
243540
243769
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
243541
243770
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
243542
|
-
import { dirname as
|
|
243771
|
+
import { dirname as dirname7, join as join11 } from "node:path";
|
|
243543
243772
|
|
|
243544
243773
|
// src/core/assets.ts
|
|
243545
243774
|
import { cpSync, existsSync } from "node:fs";
|
|
243546
243775
|
import { homedir as homedir2 } from "node:os";
|
|
243547
|
-
import { join as
|
|
243776
|
+
import { join as join10 } from "node:path";
|
|
243548
243777
|
// package.json
|
|
243549
243778
|
var package_default = {
|
|
243550
243779
|
name: "base44",
|
|
@@ -243643,18 +243872,18 @@ var package_default = {
|
|
|
243643
243872
|
};
|
|
243644
243873
|
|
|
243645
243874
|
// src/core/assets.ts
|
|
243646
|
-
var ASSETS_DIR =
|
|
243875
|
+
var ASSETS_DIR = join10(homedir2(), ".base44", "assets", package_default.version);
|
|
243647
243876
|
function getTemplatesDir() {
|
|
243648
|
-
return
|
|
243877
|
+
return join10(ASSETS_DIR, "templates");
|
|
243649
243878
|
}
|
|
243650
243879
|
function getTemplatesIndexPath() {
|
|
243651
|
-
return
|
|
243880
|
+
return join10(ASSETS_DIR, "templates", "templates.json");
|
|
243652
243881
|
}
|
|
243653
243882
|
function getDenoWrapperPath() {
|
|
243654
|
-
return
|
|
243883
|
+
return join10(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
243655
243884
|
}
|
|
243656
243885
|
function getExecWrapperPath() {
|
|
243657
|
-
return
|
|
243886
|
+
return join10(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
243658
243887
|
}
|
|
243659
243888
|
function ensureNpmAssets(sourceDir) {
|
|
243660
243889
|
if (existsSync(ASSETS_DIR))
|
|
@@ -243675,23 +243904,23 @@ async function listTemplates() {
|
|
|
243675
243904
|
return result.data.templates;
|
|
243676
243905
|
}
|
|
243677
243906
|
async function renderTemplate(template, destPath, data) {
|
|
243678
|
-
const templateDir =
|
|
243907
|
+
const templateDir = join11(getTemplatesDir(), template.path);
|
|
243679
243908
|
const files = await globby("**/*", {
|
|
243680
243909
|
cwd: templateDir,
|
|
243681
243910
|
dot: true,
|
|
243682
243911
|
onlyFiles: true
|
|
243683
243912
|
});
|
|
243684
243913
|
for (const file2 of files) {
|
|
243685
|
-
const srcPath =
|
|
243914
|
+
const srcPath = join11(templateDir, file2);
|
|
243686
243915
|
try {
|
|
243687
243916
|
if (file2.endsWith(".ejs")) {
|
|
243688
243917
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
243689
243918
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243690
|
-
const destFile = attributes.outputFileName ?
|
|
243691
|
-
const destFilePath =
|
|
243919
|
+
const destFile = attributes.outputFileName ? join11(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
243920
|
+
const destFilePath = join11(destPath, destFile);
|
|
243692
243921
|
await writeFile(destFilePath, body);
|
|
243693
243922
|
} else {
|
|
243694
|
-
const destFilePath =
|
|
243923
|
+
const destFilePath = join11(destPath, file2);
|
|
243695
243924
|
await copyFile(srcPath, destFilePath);
|
|
243696
243925
|
}
|
|
243697
243926
|
} catch (error48) {
|
|
@@ -243731,7 +243960,7 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
243731
243960
|
};
|
|
243732
243961
|
}
|
|
243733
243962
|
// src/core/project/deploy.ts
|
|
243734
|
-
import { resolve } from "node:path";
|
|
243963
|
+
import { resolve as resolve2 } from "node:path";
|
|
243735
243964
|
|
|
243736
243965
|
// src/core/site/api.ts
|
|
243737
243966
|
async function uploadSite(archivePath) {
|
|
@@ -243766,7 +243995,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
243766
243995
|
// src/core/site/deploy.ts
|
|
243767
243996
|
import { randomUUID } from "node:crypto";
|
|
243768
243997
|
import { tmpdir } from "node:os";
|
|
243769
|
-
import { join as
|
|
243998
|
+
import { join as join12 } from "node:path";
|
|
243770
243999
|
async function deploySite(siteOutputDir) {
|
|
243771
244000
|
if (!await pathExists(siteOutputDir)) {
|
|
243772
244001
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -243783,7 +244012,7 @@ async function deploySite(siteOutputDir) {
|
|
|
243783
244012
|
]
|
|
243784
244013
|
});
|
|
243785
244014
|
}
|
|
243786
|
-
const archivePath =
|
|
244015
|
+
const archivePath = join12(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
243787
244016
|
try {
|
|
243788
244017
|
await createArchive(siteOutputDir, archivePath);
|
|
243789
244018
|
return await uploadSite(archivePath);
|
|
@@ -243820,7 +244049,7 @@ async function deployAll(projectData, options) {
|
|
|
243820
244049
|
await authConfigResource.push(authConfig);
|
|
243821
244050
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
243822
244051
|
if (project.site?.outputDirectory) {
|
|
243823
|
-
const outputDir =
|
|
244052
|
+
const outputDir = resolve2(project.root, project.site.outputDirectory);
|
|
243824
244053
|
const { appUrl } = await deploySite(outputDir);
|
|
243825
244054
|
return { appUrl, connectorResults };
|
|
243826
244055
|
}
|
|
@@ -245635,8 +245864,8 @@ var disconnect = (anyProcess) => {
|
|
|
245635
245864
|
// ../../node_modules/execa/lib/utils/deferred.js
|
|
245636
245865
|
var createDeferred = () => {
|
|
245637
245866
|
const methods = {};
|
|
245638
|
-
const promise2 = new Promise((
|
|
245639
|
-
Object.assign(methods, { resolve:
|
|
245867
|
+
const promise2 = new Promise((resolve3, reject) => {
|
|
245868
|
+
Object.assign(methods, { resolve: resolve3, reject });
|
|
245640
245869
|
});
|
|
245641
245870
|
return Object.assign(promise2, methods);
|
|
245642
245871
|
};
|
|
@@ -250000,11 +250229,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
250000
250229
|
const promises = weakMap.get(stream);
|
|
250001
250230
|
const promise2 = createDeferred();
|
|
250002
250231
|
promises.push(promise2);
|
|
250003
|
-
const
|
|
250004
|
-
return { resolve:
|
|
250232
|
+
const resolve3 = promise2.resolve.bind(promise2);
|
|
250233
|
+
return { resolve: resolve3, promises };
|
|
250005
250234
|
};
|
|
250006
|
-
var waitForConcurrentStreams = async ({ resolve:
|
|
250007
|
-
|
|
250235
|
+
var waitForConcurrentStreams = async ({ resolve: resolve3, promises }, subprocess) => {
|
|
250236
|
+
resolve3();
|
|
250008
250237
|
const [isSubprocessExit] = await Promise.race([
|
|
250009
250238
|
Promise.allSettled([true, subprocess]),
|
|
250010
250239
|
Promise.all([false, ...promises])
|
|
@@ -250970,8 +251199,8 @@ async function pullAgentsAction({
|
|
|
250970
251199
|
runTask: runTask2
|
|
250971
251200
|
}) {
|
|
250972
251201
|
const { project: project2 } = await readProjectConfig();
|
|
250973
|
-
const configDir =
|
|
250974
|
-
const agentsDir =
|
|
251202
|
+
const configDir = dirname8(project2.configPath);
|
|
251203
|
+
const agentsDir = join13(configDir, project2.agentsDir);
|
|
250975
251204
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
250976
251205
|
return await fetchAgents();
|
|
250977
251206
|
}, {
|
|
@@ -251035,12 +251264,12 @@ function getAgentsCommand() {
|
|
|
251035
251264
|
}
|
|
251036
251265
|
|
|
251037
251266
|
// src/cli/commands/auth/password-login.ts
|
|
251038
|
-
import { dirname as
|
|
251267
|
+
import { dirname as dirname9, join as join14 } from "node:path";
|
|
251039
251268
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
251040
251269
|
const shouldEnable = action === "enable";
|
|
251041
251270
|
const { project: project2 } = await readProjectConfig();
|
|
251042
|
-
const configDir =
|
|
251043
|
-
const authDir =
|
|
251271
|
+
const configDir = dirname9(project2.configPath);
|
|
251272
|
+
const authDir = join14(configDir, project2.authDir);
|
|
251044
251273
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
251045
251274
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
251046
251275
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -251060,14 +251289,14 @@ function getPasswordLoginCommand() {
|
|
|
251060
251289
|
}
|
|
251061
251290
|
|
|
251062
251291
|
// src/cli/commands/auth/pull.ts
|
|
251063
|
-
import { dirname as
|
|
251292
|
+
import { dirname as dirname10, join as join15 } from "node:path";
|
|
251064
251293
|
async function pullAuthAction({
|
|
251065
251294
|
log,
|
|
251066
251295
|
runTask: runTask2
|
|
251067
251296
|
}) {
|
|
251068
251297
|
const { project: project2 } = await readProjectConfig();
|
|
251069
|
-
const configDir =
|
|
251070
|
-
const authDir =
|
|
251298
|
+
const configDir = dirname10(project2.configPath);
|
|
251299
|
+
const authDir = join15(configDir, project2.authDir);
|
|
251071
251300
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
251072
251301
|
return await pullAuthConfig();
|
|
251073
251302
|
}, {
|
|
@@ -251131,7 +251360,7 @@ function getAuthPushCommand() {
|
|
|
251131
251360
|
}
|
|
251132
251361
|
|
|
251133
251362
|
// src/cli/commands/auth/social-login.ts
|
|
251134
|
-
import { dirname as
|
|
251363
|
+
import { dirname as dirname11, join as join16, resolve as resolve3 } from "node:path";
|
|
251135
251364
|
var PROVIDER_LABELS = {
|
|
251136
251365
|
google: "Google",
|
|
251137
251366
|
microsoft: "Microsoft",
|
|
@@ -251171,7 +251400,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251171
251400
|
let clientSecret;
|
|
251172
251401
|
if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
|
|
251173
251402
|
if (options.envFile) {
|
|
251174
|
-
const secrets = await parseEnvFile(
|
|
251403
|
+
const secrets = await parseEnvFile(resolve3(options.envFile));
|
|
251175
251404
|
const value = secrets[oauthCli.envVar];
|
|
251176
251405
|
if (!value) {
|
|
251177
251406
|
throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
|
|
@@ -251201,8 +251430,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251201
251430
|
}
|
|
251202
251431
|
}
|
|
251203
251432
|
const { project: project2 } = await readProjectConfig();
|
|
251204
|
-
const configDir =
|
|
251205
|
-
const authDir =
|
|
251433
|
+
const configDir = dirname11(project2.configPath);
|
|
251434
|
+
const authDir = join16(configDir, project2.authDir);
|
|
251206
251435
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251207
251436
|
if (clientSecret) {
|
|
251208
251437
|
await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -251227,7 +251456,7 @@ function getSocialLoginCommand() {
|
|
|
251227
251456
|
}
|
|
251228
251457
|
|
|
251229
251458
|
// src/cli/commands/auth/sso.ts
|
|
251230
|
-
import { dirname as
|
|
251459
|
+
import { dirname as dirname12, join as join17, resolve as resolve4 } from "node:path";
|
|
251231
251460
|
var SSOConfigFileSchema = exports_external.object({
|
|
251232
251461
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251233
251462
|
clientId: exports_external.string(),
|
|
@@ -251243,7 +251472,7 @@ var SSOConfigFileSchema = exports_external.object({
|
|
|
251243
251472
|
ssoName: exports_external.string().optional()
|
|
251244
251473
|
});
|
|
251245
251474
|
async function loadSSOConfigFile(filePath) {
|
|
251246
|
-
const resolved =
|
|
251475
|
+
const resolved = resolve4(filePath);
|
|
251247
251476
|
const raw2 = await readJsonFile(resolved);
|
|
251248
251477
|
const result = SSOConfigFileSchema.safeParse(raw2);
|
|
251249
251478
|
if (!result.success) {
|
|
@@ -251270,8 +251499,21 @@ function mergeFileWithFlags(fileConfig, options) {
|
|
|
251270
251499
|
};
|
|
251271
251500
|
}
|
|
251272
251501
|
var providerNames = Object.keys(KNOWN_SSO_PROVIDERS);
|
|
251502
|
+
var SECRET_KEY_TO_FLAG = {
|
|
251503
|
+
["sso_name" /* Name */]: "--sso-name",
|
|
251504
|
+
["sso_client_id" /* ClientId */]: "--client-id",
|
|
251505
|
+
["sso_client_secret" /* ClientSecret */]: "--client-secret",
|
|
251506
|
+
["sso_scope" /* Scope */]: "--scope",
|
|
251507
|
+
["sso_discovery_url" /* DiscoveryUrl */]: "--discovery-url",
|
|
251508
|
+
["sso_tenant_id" /* TenantId */]: "--tenant-id",
|
|
251509
|
+
["sso_auth_endpoint" /* AuthEndpoint */]: "--auth-endpoint",
|
|
251510
|
+
["sso_token_endpoint" /* TokenEndpoint */]: "--token-endpoint",
|
|
251511
|
+
["sso_userinfo_endpoint" /* UserinfoEndpoint */]: "--userinfo-endpoint",
|
|
251512
|
+
["sso_okta_domain" /* OktaDomain */]: "--okta-domain",
|
|
251513
|
+
["sso_jwks_uri" /* JwksUri */]: "--jwks-uri"
|
|
251514
|
+
};
|
|
251273
251515
|
function secretKeyToFlag(key) {
|
|
251274
|
-
return
|
|
251516
|
+
return SECRET_KEY_TO_FLAG[key];
|
|
251275
251517
|
}
|
|
251276
251518
|
function exampleCommand(provider) {
|
|
251277
251519
|
let cmd = `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`;
|
|
@@ -251318,7 +251560,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251318
251560
|
}
|
|
251319
251561
|
let clientSecret;
|
|
251320
251562
|
if (merged.envFile && !merged.clientSecret) {
|
|
251321
|
-
const secrets2 = await parseEnvFile(
|
|
251563
|
+
const secrets2 = await parseEnvFile(resolve4(merged.envFile));
|
|
251322
251564
|
const value = secrets2.sso_client_secret;
|
|
251323
251565
|
if (!value) {
|
|
251324
251566
|
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
@@ -251377,8 +251619,8 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251377
251619
|
throw error48;
|
|
251378
251620
|
}
|
|
251379
251621
|
const { project: project2 } = await readProjectConfig();
|
|
251380
|
-
const configDir =
|
|
251381
|
-
const authDir =
|
|
251622
|
+
const configDir = dirname12(project2.configPath);
|
|
251623
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251382
251624
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251383
251625
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
251384
251626
|
return {
|
|
@@ -251393,8 +251635,8 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
251393
251635
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251394
251636
|
}
|
|
251395
251637
|
const { project: project2 } = await readProjectConfig();
|
|
251396
|
-
const configDir =
|
|
251397
|
-
const authDir =
|
|
251638
|
+
const configDir = dirname12(project2.configPath);
|
|
251639
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251398
251640
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251399
251641
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
251400
251642
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -251481,14 +251723,14 @@ function getConnectorsListAvailableCommand() {
|
|
|
251481
251723
|
}
|
|
251482
251724
|
|
|
251483
251725
|
// src/cli/commands/connectors/pull.ts
|
|
251484
|
-
import { dirname as
|
|
251726
|
+
import { dirname as dirname13, join as join18 } from "node:path";
|
|
251485
251727
|
async function pullConnectorsAction({
|
|
251486
251728
|
log,
|
|
251487
251729
|
runTask: runTask2
|
|
251488
251730
|
}) {
|
|
251489
251731
|
const { project: project2 } = await readProjectConfig();
|
|
251490
|
-
const configDir =
|
|
251491
|
-
const connectorsDir =
|
|
251732
|
+
const configDir = dirname13(project2.configPath);
|
|
251733
|
+
const connectorsDir = join18(configDir, project2.connectorsDir);
|
|
251492
251734
|
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
251493
251735
|
return await pullAllConnectors();
|
|
251494
251736
|
}, {
|
|
@@ -252017,19 +252259,19 @@ var baseOpen = async (options) => {
|
|
|
252017
252259
|
}
|
|
252018
252260
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
252019
252261
|
if (options.wait) {
|
|
252020
|
-
return new Promise((
|
|
252262
|
+
return new Promise((resolve5, reject) => {
|
|
252021
252263
|
subprocess.once("error", reject);
|
|
252022
252264
|
subprocess.once("close", (exitCode) => {
|
|
252023
252265
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
252024
252266
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
252025
252267
|
return;
|
|
252026
252268
|
}
|
|
252027
|
-
|
|
252269
|
+
resolve5(subprocess);
|
|
252028
252270
|
});
|
|
252029
252271
|
});
|
|
252030
252272
|
}
|
|
252031
252273
|
if (isFallbackAttempt) {
|
|
252032
|
-
return new Promise((
|
|
252274
|
+
return new Promise((resolve5, reject) => {
|
|
252033
252275
|
subprocess.once("error", reject);
|
|
252034
252276
|
subprocess.once("spawn", () => {
|
|
252035
252277
|
subprocess.once("close", (exitCode) => {
|
|
@@ -252039,17 +252281,17 @@ var baseOpen = async (options) => {
|
|
|
252039
252281
|
return;
|
|
252040
252282
|
}
|
|
252041
252283
|
subprocess.unref();
|
|
252042
|
-
|
|
252284
|
+
resolve5(subprocess);
|
|
252043
252285
|
});
|
|
252044
252286
|
});
|
|
252045
252287
|
});
|
|
252046
252288
|
}
|
|
252047
252289
|
subprocess.unref();
|
|
252048
|
-
return new Promise((
|
|
252290
|
+
return new Promise((resolve5, reject) => {
|
|
252049
252291
|
subprocess.once("error", reject);
|
|
252050
252292
|
subprocess.once("spawn", () => {
|
|
252051
252293
|
subprocess.off("error", reject);
|
|
252052
|
-
|
|
252294
|
+
resolve5(subprocess);
|
|
252053
252295
|
});
|
|
252054
252296
|
});
|
|
252055
252297
|
};
|
|
@@ -252492,6 +252734,11 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
252492
252734
|
formatDeployResult(result, log);
|
|
252493
252735
|
}
|
|
252494
252736
|
});
|
|
252737
|
+
const hasFailures = results.some((r) => r.status === "error");
|
|
252738
|
+
if (hasFailures) {
|
|
252739
|
+
log.message(buildDeploySummary(results));
|
|
252740
|
+
throw new CLIExitError(1);
|
|
252741
|
+
}
|
|
252495
252742
|
if (options.force) {
|
|
252496
252743
|
const allLocalNames = functions.map((f) => f.name);
|
|
252497
252744
|
let pruneCompleted = 0;
|
|
@@ -252543,25 +252790,38 @@ function getListCommand() {
|
|
|
252543
252790
|
}
|
|
252544
252791
|
|
|
252545
252792
|
// src/cli/commands/functions/pull.ts
|
|
252546
|
-
import { dirname as
|
|
252793
|
+
import { dirname as dirname14, join as join19 } from "node:path";
|
|
252547
252794
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
252548
|
-
const { project: project2 } = await readProjectConfig();
|
|
252549
|
-
const configDir =
|
|
252550
|
-
const functionsDir =
|
|
252795
|
+
const { project: project2, functions } = await readProjectConfig();
|
|
252796
|
+
const configDir = dirname14(project2.configPath);
|
|
252797
|
+
const functionsDir = join19(configDir, project2.functionsDir);
|
|
252798
|
+
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
252551
252799
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
252552
|
-
const { functions } = await listDeployedFunctions();
|
|
252553
|
-
return
|
|
252800
|
+
const { functions: functions2 } = await listDeployedFunctions();
|
|
252801
|
+
return functions2;
|
|
252554
252802
|
}, {
|
|
252555
252803
|
successMessage: "Functions fetched successfully",
|
|
252556
252804
|
errorMessage: "Failed to fetch functions"
|
|
252557
252805
|
});
|
|
252558
|
-
const
|
|
252559
|
-
if (name2 &&
|
|
252806
|
+
const matchingRemote = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
|
|
252807
|
+
if (name2 && pluginFunctionNames.has(name2)) {
|
|
252808
|
+
return {
|
|
252809
|
+
outroMessage: `Function "${name2}" is managed by a plugin and was not pulled into ${functionsDir}`
|
|
252810
|
+
};
|
|
252811
|
+
}
|
|
252812
|
+
if (name2 && matchingRemote.length === 0) {
|
|
252560
252813
|
return {
|
|
252561
252814
|
outroMessage: `Function "${name2}" not found on remote`
|
|
252562
252815
|
};
|
|
252563
252816
|
}
|
|
252817
|
+
const skippedPluginOwned = matchingRemote.filter((fn) => pluginFunctionNames.has(fn.name));
|
|
252818
|
+
const toPull = matchingRemote.filter((fn) => !pluginFunctionNames.has(fn.name));
|
|
252564
252819
|
if (toPull.length === 0) {
|
|
252820
|
+
if (skippedPluginOwned.length > 0) {
|
|
252821
|
+
return {
|
|
252822
|
+
outroMessage: `Skipped ${skippedPluginOwned.length} plugin-owned function${skippedPluginOwned.length !== 1 ? "s" : ""}; no project-owned functions to pull`
|
|
252823
|
+
};
|
|
252824
|
+
}
|
|
252565
252825
|
return { outroMessage: "No functions found on remote" };
|
|
252566
252826
|
}
|
|
252567
252827
|
const { written, skipped } = await runTask2("Writing function files", async () => {
|
|
@@ -252576,8 +252836,11 @@ async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
|
252576
252836
|
for (const name3 of skipped) {
|
|
252577
252837
|
log.info(`${name3.padEnd(25)} unchanged`);
|
|
252578
252838
|
}
|
|
252839
|
+
for (const fn of skippedPluginOwned) {
|
|
252840
|
+
log.info(`${fn.name.padEnd(25)} plugin-owned, skipped`);
|
|
252841
|
+
}
|
|
252579
252842
|
return {
|
|
252580
|
-
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
252843
|
+
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}${skippedPluginOwned.length > 0 ? `; skipped ${skippedPluginOwned.length} plugin-owned` : ""}`
|
|
252581
252844
|
};
|
|
252582
252845
|
}
|
|
252583
252846
|
function getPullCommand() {
|
|
@@ -252590,7 +252853,7 @@ function getFunctionsCommand() {
|
|
|
252590
252853
|
}
|
|
252591
252854
|
|
|
252592
252855
|
// src/cli/commands/project/create.ts
|
|
252593
|
-
import { basename as basename3, join as
|
|
252856
|
+
import { basename as basename3, join as join20, resolve as resolve5 } from "node:path";
|
|
252594
252857
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
252595
252858
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
252596
252859
|
async function getTemplateById(templateId) {
|
|
@@ -252655,7 +252918,7 @@ async function createInteractive(options, ctx) {
|
|
|
252655
252918
|
}, ctx);
|
|
252656
252919
|
}
|
|
252657
252920
|
async function createNonInteractive(options, ctx) {
|
|
252658
|
-
ctx.log.info(`Creating a new project at ${
|
|
252921
|
+
ctx.log.info(`Creating a new project at ${resolve5(options.path)}`);
|
|
252659
252922
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
252660
252923
|
return await executeCreate({
|
|
252661
252924
|
template: template2,
|
|
@@ -252676,7 +252939,7 @@ async function executeCreate({
|
|
|
252676
252939
|
isInteractive
|
|
252677
252940
|
}, { log, runTask: runTask2 }) {
|
|
252678
252941
|
const name2 = rawName.trim();
|
|
252679
|
-
const resolvedPath =
|
|
252942
|
+
const resolvedPath = resolve5(projectPath);
|
|
252680
252943
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
252681
252944
|
return await createProjectFiles({
|
|
252682
252945
|
name: name2,
|
|
@@ -252727,7 +252990,7 @@ async function executeCreate({
|
|
|
252727
252990
|
updateMessage("Building project...");
|
|
252728
252991
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
252729
252992
|
updateMessage("Deploying site...");
|
|
252730
|
-
return await deploySite(
|
|
252993
|
+
return await deploySite(join20(resolvedPath, outputDirectory));
|
|
252731
252994
|
}, {
|
|
252732
252995
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
252733
252996
|
errorMessage: "Failed to deploy site"
|
|
@@ -253192,7 +253455,7 @@ function getSecretsListCommand() {
|
|
|
253192
253455
|
}
|
|
253193
253456
|
|
|
253194
253457
|
// src/cli/commands/secrets/set.ts
|
|
253195
|
-
import { resolve as
|
|
253458
|
+
import { resolve as resolve6 } from "node:path";
|
|
253196
253459
|
function parseEntries(entries) {
|
|
253197
253460
|
const secrets = {};
|
|
253198
253461
|
for (const entry of entries) {
|
|
@@ -253223,7 +253486,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
253223
253486
|
validateInput(entries, options);
|
|
253224
253487
|
let secrets;
|
|
253225
253488
|
if (options.envFile) {
|
|
253226
|
-
secrets = await parseEnvFile(
|
|
253489
|
+
secrets = await parseEnvFile(resolve6(options.envFile));
|
|
253227
253490
|
if (Object.keys(secrets).length === 0) {
|
|
253228
253491
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
253229
253492
|
}
|
|
@@ -253252,7 +253515,7 @@ function getSecretsCommand() {
|
|
|
253252
253515
|
}
|
|
253253
253516
|
|
|
253254
253517
|
// src/cli/commands/site/deploy.ts
|
|
253255
|
-
import { resolve as
|
|
253518
|
+
import { resolve as resolve7 } from "node:path";
|
|
253256
253519
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
253257
253520
|
if (isNonInteractive && !options.yes) {
|
|
253258
253521
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -253267,7 +253530,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
253267
253530
|
]
|
|
253268
253531
|
});
|
|
253269
253532
|
}
|
|
253270
|
-
const outputDir =
|
|
253533
|
+
const outputDir = resolve7(project2.root, project2.site.outputDirectory);
|
|
253271
253534
|
if (!options.yes) {
|
|
253272
253535
|
const shouldDeploy = await Re({
|
|
253273
253536
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253393,10 +253656,10 @@ function toPascalCase(name2) {
|
|
|
253393
253656
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
253394
253657
|
}
|
|
253395
253658
|
// src/core/types/update-project.ts
|
|
253396
|
-
import { join as
|
|
253659
|
+
import { join as join23 } from "node:path";
|
|
253397
253660
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
253398
253661
|
async function updateProjectConfig(projectRoot) {
|
|
253399
|
-
const tsconfigPath =
|
|
253662
|
+
const tsconfigPath = join23(projectRoot, "tsconfig.json");
|
|
253400
253663
|
if (!await pathExists(tsconfigPath)) {
|
|
253401
253664
|
return false;
|
|
253402
253665
|
}
|
|
@@ -253444,7 +253707,7 @@ import process21 from "node:process";
|
|
|
253444
253707
|
// src/cli/dev/dev-server/main.ts
|
|
253445
253708
|
var import_cors = __toESM(require_lib4(), 1);
|
|
253446
253709
|
var import_express6 = __toESM(require_express(), 1);
|
|
253447
|
-
import { dirname as
|
|
253710
|
+
import { dirname as dirname19, join as join26 } from "node:path";
|
|
253448
253711
|
|
|
253449
253712
|
// ../../node_modules/get-port/index.js
|
|
253450
253713
|
import net from "node:net";
|
|
@@ -253471,14 +253734,14 @@ var getLocalHosts = () => {
|
|
|
253471
253734
|
}
|
|
253472
253735
|
return results;
|
|
253473
253736
|
};
|
|
253474
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253737
|
+
var checkAvailablePort = (options8) => new Promise((resolve9, reject) => {
|
|
253475
253738
|
const server = net.createServer();
|
|
253476
253739
|
server.unref();
|
|
253477
253740
|
server.on("error", reject);
|
|
253478
253741
|
server.listen(options8, () => {
|
|
253479
253742
|
const { port } = server.address();
|
|
253480
253743
|
server.close(() => {
|
|
253481
|
-
|
|
253744
|
+
resolve9(port);
|
|
253482
253745
|
});
|
|
253483
253746
|
});
|
|
253484
253747
|
});
|
|
@@ -253738,7 +254001,7 @@ class FunctionManager {
|
|
|
253738
254001
|
});
|
|
253739
254002
|
}
|
|
253740
254003
|
waitForReady(name2, runningFunc) {
|
|
253741
|
-
return new Promise((
|
|
254004
|
+
return new Promise((resolve9, reject) => {
|
|
253742
254005
|
runningFunc.process.on("exit", (code2) => {
|
|
253743
254006
|
if (!runningFunc.ready) {
|
|
253744
254007
|
clearTimeout(timeout3);
|
|
@@ -253761,7 +254024,7 @@ class FunctionManager {
|
|
|
253761
254024
|
runningFunc.ready = true;
|
|
253762
254025
|
clearTimeout(timeout3);
|
|
253763
254026
|
runningFunc.process.stdout?.off("data", onData);
|
|
253764
|
-
|
|
254027
|
+
resolve9(runningFunc.port);
|
|
253765
254028
|
}
|
|
253766
254029
|
};
|
|
253767
254030
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -254062,7 +254325,8 @@ class Database {
|
|
|
254062
254325
|
return {
|
|
254063
254326
|
name: "User",
|
|
254064
254327
|
type: "object",
|
|
254065
|
-
properties: { ...builtInFields, role: { type: "string" } }
|
|
254328
|
+
properties: { ...builtInFields, role: { type: "string" } },
|
|
254329
|
+
source: { type: "project" }
|
|
254066
254330
|
};
|
|
254067
254331
|
}
|
|
254068
254332
|
for (const field of Object.keys(builtInFields)) {
|
|
@@ -255682,9 +255946,9 @@ class NodeFsHandler {
|
|
|
255682
255946
|
if (this.fsw.closed) {
|
|
255683
255947
|
return;
|
|
255684
255948
|
}
|
|
255685
|
-
const
|
|
255949
|
+
const dirname18 = sp2.dirname(file2);
|
|
255686
255950
|
const basename5 = sp2.basename(file2);
|
|
255687
|
-
const parent = this.fsw._getWatchedDir(
|
|
255951
|
+
const parent = this.fsw._getWatchedDir(dirname18);
|
|
255688
255952
|
let prevStats = stats;
|
|
255689
255953
|
if (parent.has(basename5))
|
|
255690
255954
|
return;
|
|
@@ -255711,7 +255975,7 @@ class NodeFsHandler {
|
|
|
255711
255975
|
prevStats = newStats2;
|
|
255712
255976
|
}
|
|
255713
255977
|
} catch (error48) {
|
|
255714
|
-
this.fsw._remove(
|
|
255978
|
+
this.fsw._remove(dirname18, basename5);
|
|
255715
255979
|
}
|
|
255716
255980
|
} else if (parent.has(basename5)) {
|
|
255717
255981
|
const at13 = newStats.atimeMs;
|
|
@@ -255800,7 +256064,7 @@ class NodeFsHandler {
|
|
|
255800
256064
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
255801
256065
|
}
|
|
255802
256066
|
}).on(EV.ERROR, this._boundHandleError);
|
|
255803
|
-
return new Promise((
|
|
256067
|
+
return new Promise((resolve10, reject) => {
|
|
255804
256068
|
if (!stream)
|
|
255805
256069
|
return reject();
|
|
255806
256070
|
stream.once(STR_END, () => {
|
|
@@ -255809,7 +256073,7 @@ class NodeFsHandler {
|
|
|
255809
256073
|
return;
|
|
255810
256074
|
}
|
|
255811
256075
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
255812
|
-
|
|
256076
|
+
resolve10(undefined);
|
|
255813
256077
|
previous.getChildren().filter((item) => {
|
|
255814
256078
|
return item !== directory && !current.has(item);
|
|
255815
256079
|
}).forEach((item) => {
|
|
@@ -256720,7 +256984,7 @@ async function createDevServer(options8) {
|
|
|
256720
256984
|
}
|
|
256721
256985
|
remoteProxy(req, res, next);
|
|
256722
256986
|
});
|
|
256723
|
-
const server = await new Promise((
|
|
256987
|
+
const server = await new Promise((resolve11, reject) => {
|
|
256724
256988
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
256725
256989
|
if (err) {
|
|
256726
256990
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -256729,7 +256993,7 @@ async function createDevServer(options8) {
|
|
|
256729
256993
|
reject(err);
|
|
256730
256994
|
}
|
|
256731
256995
|
} else {
|
|
256732
|
-
|
|
256996
|
+
resolve11(s5);
|
|
256733
256997
|
}
|
|
256734
256998
|
});
|
|
256735
256999
|
});
|
|
@@ -256738,8 +257002,8 @@ async function createDevServer(options8) {
|
|
|
256738
257002
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
256739
257003
|
};
|
|
256740
257004
|
const base44ConfigWatcher = new WatchBase44({
|
|
256741
|
-
functions:
|
|
256742
|
-
entities:
|
|
257005
|
+
functions: join26(dirname19(project2.configPath), project2.functionsDir),
|
|
257006
|
+
entities: join26(dirname19(project2.configPath), project2.entitiesDir)
|
|
256743
257007
|
}, devLogger);
|
|
256744
257008
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
256745
257009
|
try {
|
|
@@ -256846,13 +257110,13 @@ async function runScript(options8) {
|
|
|
256846
257110
|
}
|
|
256847
257111
|
// src/cli/commands/exec.ts
|
|
256848
257112
|
function readStdin2() {
|
|
256849
|
-
return new Promise((
|
|
257113
|
+
return new Promise((resolve11, reject) => {
|
|
256850
257114
|
let data = "";
|
|
256851
257115
|
process.stdin.setEncoding("utf-8");
|
|
256852
257116
|
process.stdin.on("data", (chunk) => {
|
|
256853
257117
|
data += chunk;
|
|
256854
257118
|
});
|
|
256855
|
-
process.stdin.on("end", () =>
|
|
257119
|
+
process.stdin.on("end", () => resolve11(data));
|
|
256856
257120
|
process.stdin.on("error", reject);
|
|
256857
257121
|
});
|
|
256858
257122
|
}
|
|
@@ -256891,7 +257155,7 @@ Examples:
|
|
|
256891
257155
|
}
|
|
256892
257156
|
|
|
256893
257157
|
// src/cli/commands/project/eject.ts
|
|
256894
|
-
import { resolve as
|
|
257158
|
+
import { resolve as resolve11 } from "node:path";
|
|
256895
257159
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
256896
257160
|
async function eject(ctx, options8) {
|
|
256897
257161
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -256947,7 +257211,7 @@ async function eject(ctx, options8) {
|
|
|
256947
257211
|
Ne("Operation cancelled.");
|
|
256948
257212
|
throw new CLIExitError(0);
|
|
256949
257213
|
}
|
|
256950
|
-
const resolvedPath =
|
|
257214
|
+
const resolvedPath = resolve11(selectedPath);
|
|
256951
257215
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
256952
257216
|
await createProjectFilesForExistingProject({
|
|
256953
257217
|
projectId,
|
|
@@ -257028,7 +257292,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
257028
257292
|
import { release, type } from "node:os";
|
|
257029
257293
|
|
|
257030
257294
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
257031
|
-
import { dirname as
|
|
257295
|
+
import { dirname as dirname20, posix, sep } from "path";
|
|
257032
257296
|
function createModulerModifier() {
|
|
257033
257297
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
257034
257298
|
return async (frames) => {
|
|
@@ -257037,7 +257301,7 @@ function createModulerModifier() {
|
|
|
257037
257301
|
return frames;
|
|
257038
257302
|
};
|
|
257039
257303
|
}
|
|
257040
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
257304
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname20(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
257041
257305
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
257042
257306
|
return (filename) => {
|
|
257043
257307
|
if (!filename)
|
|
@@ -259315,14 +259579,14 @@ async function addSourceContext(frames) {
|
|
|
259315
259579
|
return frames;
|
|
259316
259580
|
}
|
|
259317
259581
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
259318
|
-
return new Promise((
|
|
259582
|
+
return new Promise((resolve12) => {
|
|
259319
259583
|
const stream = createReadStream2(path19);
|
|
259320
259584
|
const lineReaded = createInterface2({
|
|
259321
259585
|
input: stream
|
|
259322
259586
|
});
|
|
259323
259587
|
function destroyStreamAndResolve() {
|
|
259324
259588
|
stream.destroy();
|
|
259325
|
-
|
|
259589
|
+
resolve12();
|
|
259326
259590
|
}
|
|
259327
259591
|
let lineNumber = 0;
|
|
259328
259592
|
let currentRangeIndex = 0;
|
|
@@ -260434,15 +260698,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260434
260698
|
return true;
|
|
260435
260699
|
if (this.featureFlagsPoller === undefined)
|
|
260436
260700
|
return false;
|
|
260437
|
-
return new Promise((
|
|
260701
|
+
return new Promise((resolve12) => {
|
|
260438
260702
|
const timeout3 = setTimeout(() => {
|
|
260439
260703
|
cleanup();
|
|
260440
|
-
|
|
260704
|
+
resolve12(false);
|
|
260441
260705
|
}, timeoutMs);
|
|
260442
260706
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260443
260707
|
clearTimeout(timeout3);
|
|
260444
260708
|
cleanup();
|
|
260445
|
-
|
|
260709
|
+
resolve12(count2 > 0);
|
|
260446
260710
|
});
|
|
260447
260711
|
});
|
|
260448
260712
|
}
|
|
@@ -261226,9 +261490,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
261226
261490
|
});
|
|
261227
261491
|
}
|
|
261228
261492
|
// src/cli/index.ts
|
|
261229
|
-
var __dirname4 =
|
|
261493
|
+
var __dirname4 = dirname21(fileURLToPath6(import.meta.url));
|
|
261230
261494
|
async function runCLI(options8) {
|
|
261231
|
-
ensureNpmAssets(
|
|
261495
|
+
ensureNpmAssets(join27(__dirname4, "../assets"));
|
|
261232
261496
|
const errorReporter = new ErrorReporter;
|
|
261233
261497
|
errorReporter.registerProcessErrorHandlers();
|
|
261234
261498
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -261265,4 +261529,4 @@ export {
|
|
|
261265
261529
|
CLIExitError
|
|
261266
261530
|
};
|
|
261267
261531
|
|
|
261268
|
-
//# debugId=
|
|
261532
|
+
//# debugId=F9698F6E012A29BB64756E2164756E21
|