@base44-preview/cli 0.0.51-pr.484.a220663 → 0.0.51-pr.503.299048e
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 +558 -278
- 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) {
|
|
@@ -124338,7 +124338,7 @@ var init_prettier = __esm(() => {
|
|
|
124338
124338
|
const absolute = [];
|
|
124339
124339
|
const relative22 = [];
|
|
124340
124340
|
for (const pattern of patterns) {
|
|
124341
|
-
if (
|
|
124341
|
+
if (isAbsolute3(pattern)) {
|
|
124342
124342
|
absolute.push(pattern);
|
|
124343
124343
|
} else {
|
|
124344
124344
|
relative22.push(pattern);
|
|
@@ -124347,10 +124347,10 @@ var init_prettier = __esm(() => {
|
|
|
124347
124347
|
return [absolute, relative22];
|
|
124348
124348
|
}
|
|
124349
124349
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
124350
|
-
function
|
|
124350
|
+
function isAbsolute3(pattern) {
|
|
124351
124351
|
return path152.isAbsolute(pattern);
|
|
124352
124352
|
}
|
|
124353
|
-
exports.isAbsolute =
|
|
124353
|
+
exports.isAbsolute = isAbsolute3;
|
|
124354
124354
|
}
|
|
124355
124355
|
});
|
|
124356
124356
|
require_merge22 = __commonJS2({
|
|
@@ -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, isAbsolute as isAbsolute2, join as join3, resolve } from "node:path";
|
|
241595
|
+
function resolvePluginRoot(pluginSource, fromRoot) {
|
|
241596
|
+
if (pluginSource.startsWith(".") || isAbsolute2(pluginSource)) {
|
|
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 ConfigInvalidError(`Duplicate entity name "${entity.name}" in ${entitiesDir}`, entitiesDir, {
|
|
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,54 @@ 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 projectEntityFields = new Set(Object.keys(projectEntity));
|
|
242973
|
+
const unsupportedFields = ["title", "description", "rls"].filter((field) => projectEntityFields.has(field));
|
|
242974
|
+
if (unsupportedFields.length > 0) {
|
|
242975
|
+
throw new ConfigInvalidError(`Project entity "${projectEntity.name}" extends a plugin entity and cannot override fields: ${unsupportedFields.join(", ")}.`, configPath);
|
|
242976
|
+
}
|
|
242977
|
+
const projectProperties = projectEntity.properties ?? {};
|
|
242978
|
+
const addedPropertyNames = new Set(Object.keys(projectProperties));
|
|
242979
|
+
for (const propertyName of addedPropertyNames) {
|
|
242980
|
+
if (propertyName in pluginEntity.properties) {
|
|
242981
|
+
throw new ConfigInvalidError(`Cannot override plugin-defined property "${propertyName}"`, configPath);
|
|
242982
|
+
}
|
|
242983
|
+
}
|
|
242984
|
+
for (const requiredProperty of projectEntity.required ?? []) {
|
|
242985
|
+
if (!addedPropertyNames.has(requiredProperty)) {
|
|
242986
|
+
throw new ConfigInvalidError(`Project entity "${projectEntity.name}" can only mark project-added properties as required; "${requiredProperty}" is not declared in the project extension.`, configPath);
|
|
242987
|
+
}
|
|
242988
|
+
}
|
|
242989
|
+
const required2 = pluginEntity.required || projectEntity.required ? [
|
|
242990
|
+
...new Set([
|
|
242991
|
+
...pluginEntity.required ?? [],
|
|
242992
|
+
...projectEntity.required ?? []
|
|
242993
|
+
])
|
|
242994
|
+
] : undefined;
|
|
242995
|
+
return {
|
|
242996
|
+
...pluginEntity,
|
|
242997
|
+
properties: {
|
|
242998
|
+
...pluginEntity.properties,
|
|
242999
|
+
...projectProperties
|
|
243000
|
+
},
|
|
243001
|
+
...required2 ? { required: required2 } : {}
|
|
243002
|
+
};
|
|
243003
|
+
}
|
|
243004
|
+
function mergeProjectAndPluginEntities(projectEntities, pluginEntities, configPath) {
|
|
243005
|
+
const projectEntitiesByName = new Map(projectEntities.map((entity) => [entity.name, entity]));
|
|
243006
|
+
const pluginEntityNames = new Set(pluginEntities.map((entity) => entity.name));
|
|
243007
|
+
const resolvedPluginEntities = pluginEntities.map((pluginEntity) => {
|
|
243008
|
+
const projectEntity = projectEntitiesByName.get(pluginEntity.name);
|
|
243009
|
+
if (!projectEntity) {
|
|
243010
|
+
return pluginEntity;
|
|
243011
|
+
}
|
|
243012
|
+
return mergePluginEntity(pluginEntity, projectEntity, configPath);
|
|
243013
|
+
});
|
|
243014
|
+
const projectOnlyEntities = projectEntities.filter((entity) => !pluginEntityNames.has(entity.name));
|
|
243015
|
+
return [...resolvedPluginEntities, ...projectOnlyEntities];
|
|
243016
|
+
}
|
|
243017
|
+
|
|
242901
243018
|
// src/core/resources/function/schema.ts
|
|
242902
243019
|
var FunctionNameSchema = exports_external.string().trim().min(1, "Function name cannot be empty").regex(/^[^.]+$/, "Function name cannot contain dots");
|
|
242903
243020
|
var FunctionFileSchema = exports_external.object({
|
|
@@ -242995,7 +243112,8 @@ var FunctionConfigSchema = exports_external.object({
|
|
|
242995
243112
|
});
|
|
242996
243113
|
var BackendFunctionSchema = FunctionConfigSchema.extend({
|
|
242997
243114
|
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")
|
|
243115
|
+
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file"),
|
|
243116
|
+
source: ResourceSourceSchema
|
|
242999
243117
|
});
|
|
243000
243118
|
var DeploySingleFunctionResponseSchema = exports_external.object({
|
|
243001
243119
|
status: exports_external.enum(["deployed", "unchanged"])
|
|
@@ -243100,7 +243218,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
243100
243218
|
return result.data;
|
|
243101
243219
|
}
|
|
243102
243220
|
// src/core/resources/function/config.ts
|
|
243103
|
-
import { basename as basename2, dirname as
|
|
243221
|
+
import { basename as basename2, dirname as dirname4, join as join7, relative } from "node:path";
|
|
243104
243222
|
async function readFunctionConfig(configPath) {
|
|
243105
243223
|
const parsed = await readJsonFile(configPath);
|
|
243106
243224
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -243111,8 +243229,8 @@ async function readFunctionConfig(configPath) {
|
|
|
243111
243229
|
}
|
|
243112
243230
|
async function readFunction(configPath) {
|
|
243113
243231
|
const config6 = await readFunctionConfig(configPath);
|
|
243114
|
-
const functionDir =
|
|
243115
|
-
const entryPath =
|
|
243232
|
+
const functionDir = dirname4(configPath);
|
|
243233
|
+
const entryPath = join7(functionDir, config6.entry);
|
|
243116
243234
|
if (!await pathExists(entryPath)) {
|
|
243117
243235
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
243118
243236
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -243122,7 +243240,12 @@ async function readFunction(configPath) {
|
|
|
243122
243240
|
cwd: functionDir,
|
|
243123
243241
|
absolute: true
|
|
243124
243242
|
});
|
|
243125
|
-
const functionData = {
|
|
243243
|
+
const functionData = {
|
|
243244
|
+
...config6,
|
|
243245
|
+
entryPath,
|
|
243246
|
+
filePaths,
|
|
243247
|
+
source: { type: "project" }
|
|
243248
|
+
};
|
|
243126
243249
|
return functionData;
|
|
243127
243250
|
}
|
|
243128
243251
|
async function readAllFunctions(functionsDir) {
|
|
@@ -243138,11 +243261,11 @@ async function readAllFunctions(functionsDir) {
|
|
|
243138
243261
|
absolute: true,
|
|
243139
243262
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
243140
243263
|
});
|
|
243141
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
243142
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
243264
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
243265
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
|
|
243143
243266
|
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
243144
243267
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
243145
|
-
const functionDir =
|
|
243268
|
+
const functionDir = dirname4(entryFile);
|
|
243146
243269
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
243147
243270
|
cwd: functionDir,
|
|
243148
243271
|
absolute: true
|
|
@@ -243158,13 +243281,20 @@ async function readAllFunctions(functionsDir) {
|
|
|
243158
243281
|
});
|
|
243159
243282
|
}
|
|
243160
243283
|
const entry = basename2(entryFile);
|
|
243161
|
-
|
|
243284
|
+
const functionData = {
|
|
243285
|
+
name: name2,
|
|
243286
|
+
entry,
|
|
243287
|
+
entryPath: entryFile,
|
|
243288
|
+
filePaths,
|
|
243289
|
+
source: { type: "project" }
|
|
243290
|
+
};
|
|
243291
|
+
return functionData;
|
|
243162
243292
|
}));
|
|
243163
243293
|
const functions = [...functionsFromConfig, ...functionsWithoutConfig];
|
|
243164
243294
|
const names = new Set;
|
|
243165
243295
|
for (const fn of functions) {
|
|
243166
243296
|
if (names.has(fn.name)) {
|
|
243167
|
-
throw new
|
|
243297
|
+
throw new ConfigInvalidError(`Duplicate function name "${fn.name}" in ${functionsDir}`, functionsDir, {
|
|
243168
243298
|
hints: [
|
|
243169
243299
|
{
|
|
243170
243300
|
message: "Ensure each function has a unique name (or path for zero-config functions)."
|
|
@@ -243177,9 +243307,9 @@ async function readAllFunctions(functionsDir) {
|
|
|
243177
243307
|
return functions;
|
|
243178
243308
|
}
|
|
243179
243309
|
// src/core/resources/function/deploy.ts
|
|
243180
|
-
import { dirname as
|
|
243310
|
+
import { dirname as dirname5, relative as relative2 } from "node:path";
|
|
243181
243311
|
async function loadFunctionCode(fn) {
|
|
243182
|
-
const functionDir =
|
|
243312
|
+
const functionDir = dirname5(fn.entryPath);
|
|
243183
243313
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
243184
243314
|
const content = await readTextFile(filePath);
|
|
243185
243315
|
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
@@ -243246,14 +243376,14 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
243246
243376
|
return results;
|
|
243247
243377
|
}
|
|
243248
243378
|
// src/core/resources/function/pull.ts
|
|
243249
|
-
import { join as
|
|
243379
|
+
import { join as join8 } from "node:path";
|
|
243250
243380
|
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
243251
243381
|
async function writeFunctions(functionsDir, functions) {
|
|
243252
243382
|
const written = [];
|
|
243253
243383
|
const skipped = [];
|
|
243254
243384
|
for (const fn of functions) {
|
|
243255
|
-
const functionDir =
|
|
243256
|
-
const configPath =
|
|
243385
|
+
const functionDir = join8(functionsDir, fn.name);
|
|
243386
|
+
const configPath = join8(functionDir, "function.jsonc");
|
|
243257
243387
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
243258
243388
|
skipped.push(fn.name);
|
|
243259
243389
|
continue;
|
|
@@ -243267,7 +243397,7 @@ async function writeFunctions(functionsDir, functions) {
|
|
|
243267
243397
|
}
|
|
243268
243398
|
await writeJsonFile(configPath, config6);
|
|
243269
243399
|
for (const file2 of fn.files) {
|
|
243270
|
-
await writeFile(
|
|
243400
|
+
await writeFile(join8(functionDir, file2.path), file2.content);
|
|
243271
243401
|
}
|
|
243272
243402
|
written.push(fn.name);
|
|
243273
243403
|
}
|
|
@@ -243277,7 +243407,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243277
243407
|
if (!await pathExists(functionDir)) {
|
|
243278
243408
|
return false;
|
|
243279
243409
|
}
|
|
243280
|
-
const configPath =
|
|
243410
|
+
const configPath = join8(functionDir, "function.jsonc");
|
|
243281
243411
|
try {
|
|
243282
243412
|
const localConfig = await readJsonFile(configPath);
|
|
243283
243413
|
if (localConfig.entry !== fn.entry) {
|
|
@@ -243290,7 +243420,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243290
243420
|
return false;
|
|
243291
243421
|
}
|
|
243292
243422
|
for (const file2 of fn.files) {
|
|
243293
|
-
const filePath =
|
|
243423
|
+
const filePath = join8(functionDir, file2.path);
|
|
243294
243424
|
if (!await pathExists(filePath)) {
|
|
243295
243425
|
return false;
|
|
243296
243426
|
}
|
|
@@ -243320,49 +243450,164 @@ async function findConfigInDir(dir) {
|
|
|
243320
243450
|
}
|
|
243321
243451
|
async function findProjectRoot(startPath) {
|
|
243322
243452
|
let current = startPath || process.cwd();
|
|
243323
|
-
while (current !==
|
|
243453
|
+
while (current !== dirname6(current)) {
|
|
243324
243454
|
const configPath = await findConfigInDir(current);
|
|
243325
243455
|
if (configPath) {
|
|
243326
243456
|
return { root: current, configPath };
|
|
243327
243457
|
}
|
|
243328
|
-
current =
|
|
243458
|
+
current = dirname6(current);
|
|
243329
243459
|
}
|
|
243330
243460
|
return null;
|
|
243331
243461
|
}
|
|
243332
|
-
|
|
243333
|
-
|
|
243334
|
-
|
|
243335
|
-
|
|
243336
|
-
|
|
243337
|
-
|
|
243338
|
-
|
|
243462
|
+
|
|
243463
|
+
class ProjectConfigReader {
|
|
243464
|
+
pluginSourceByNamespace = new Map;
|
|
243465
|
+
async readProjectConfig(projectRoot) {
|
|
243466
|
+
const { root, configPath } = await this.findConfigOrThrow(projectRoot);
|
|
243467
|
+
const project = await this.readConfigFile(configPath);
|
|
243468
|
+
this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
|
|
243469
|
+
const localResources = await this.readProjectResources(configPath, project);
|
|
243470
|
+
const pluginResources = await this.readPlugins(project.plugins, configPath);
|
|
243471
|
+
const entities = mergeProjectAndPluginEntities(localResources.entities, pluginResources.entities, configPath);
|
|
243472
|
+
const functions = [
|
|
243473
|
+
...localResources.functions,
|
|
243474
|
+
...pluginResources.functions
|
|
243475
|
+
];
|
|
243476
|
+
this.validateFunctionNames(functions, configPath);
|
|
243477
|
+
return {
|
|
243478
|
+
project: { ...project, root, configPath },
|
|
243479
|
+
entities,
|
|
243480
|
+
functions,
|
|
243481
|
+
agents: localResources.agents,
|
|
243482
|
+
connectors: localResources.connectors,
|
|
243483
|
+
authConfig: localResources.authConfig
|
|
243484
|
+
};
|
|
243485
|
+
}
|
|
243486
|
+
async findConfigOrThrow(projectRoot) {
|
|
243487
|
+
let found;
|
|
243488
|
+
if (projectRoot) {
|
|
243489
|
+
const configPath = await findConfigInDir(projectRoot);
|
|
243490
|
+
found = configPath ? { root: projectRoot, configPath } : null;
|
|
243491
|
+
} else {
|
|
243492
|
+
found = await findProjectRoot();
|
|
243493
|
+
}
|
|
243494
|
+
if (!found) {
|
|
243495
|
+
throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
|
|
243496
|
+
}
|
|
243497
|
+
return found;
|
|
243339
243498
|
}
|
|
243340
|
-
|
|
243341
|
-
|
|
243499
|
+
async readConfigFile(configPath) {
|
|
243500
|
+
const parsed = await readJsonFile(configPath);
|
|
243501
|
+
const result = ProjectConfigSchema.safeParse(parsed);
|
|
243502
|
+
if (!result.success) {
|
|
243503
|
+
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
243504
|
+
}
|
|
243505
|
+
return result.data;
|
|
243506
|
+
}
|
|
243507
|
+
async readProjectResources(configPath, project) {
|
|
243508
|
+
const configDir = dirname6(configPath);
|
|
243509
|
+
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243510
|
+
entityResource.readAll(join9(configDir, project.entitiesDir)),
|
|
243511
|
+
functionResource.readAll(join9(configDir, project.functionsDir)),
|
|
243512
|
+
agentResource.readAll(join9(configDir, project.agentsDir)),
|
|
243513
|
+
connectorResource.readAll(join9(configDir, project.connectorsDir)),
|
|
243514
|
+
authConfigResource.readAll(join9(configDir, project.authDir))
|
|
243515
|
+
]);
|
|
243516
|
+
return { entities, functions, agents, connectors, authConfig };
|
|
243517
|
+
}
|
|
243518
|
+
assertPluginProjectDoesNotLoadPlugins(project, configPath) {
|
|
243519
|
+
if (project.plugin && project.plugins.length > 0) {
|
|
243520
|
+
throw new ConfigInvalidError("Plugin projects cannot define plugins in this version.", configPath);
|
|
243521
|
+
}
|
|
243522
|
+
}
|
|
243523
|
+
registerPluginNamespace(namespace, source, configPath) {
|
|
243524
|
+
const existingSource = this.pluginSourceByNamespace.get(namespace);
|
|
243525
|
+
if (existingSource) {
|
|
243526
|
+
throw new ConfigInvalidError(`Duplicate plugin namespace "${namespace}" in project configuration: "${existingSource}" and "${source}".`, configPath, {
|
|
243527
|
+
hints: [
|
|
243528
|
+
{
|
|
243529
|
+
message: "Remove the plugin or change plugin namespace"
|
|
243530
|
+
}
|
|
243531
|
+
]
|
|
243532
|
+
});
|
|
243533
|
+
}
|
|
243534
|
+
this.pluginSourceByNamespace.set(namespace, source);
|
|
243535
|
+
}
|
|
243536
|
+
async readPluginConfig(plugin, hostConfigPath) {
|
|
243537
|
+
const pluginRoot = resolvePluginRoot(plugin.source, dirname6(hostConfigPath));
|
|
243538
|
+
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
243539
|
+
const project = await this.readConfigFile(configPath);
|
|
243540
|
+
const namespace = requirePluginNamespace(project, plugin.source, configPath);
|
|
243541
|
+
this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
|
|
243542
|
+
return { configPath, namespace, project, source: plugin.source };
|
|
243543
|
+
}
|
|
243544
|
+
async readPluginResources(project, configPath, namespace) {
|
|
243545
|
+
const resources = await this.readProjectResources(configPath, project);
|
|
243546
|
+
return {
|
|
243547
|
+
entities: markPluginEntities(resources.entities, namespace),
|
|
243548
|
+
functions: namespacePluginFunctions(resources.functions, namespace),
|
|
243549
|
+
agents: [],
|
|
243550
|
+
connectors: [],
|
|
243551
|
+
authConfig: []
|
|
243552
|
+
};
|
|
243553
|
+
}
|
|
243554
|
+
async readPlugins(plugins, configPath) {
|
|
243555
|
+
const entities = [];
|
|
243556
|
+
const functions = [];
|
|
243557
|
+
const pluginSourceByEntityName = new Map;
|
|
243558
|
+
for (const plugin of plugins) {
|
|
243559
|
+
const {
|
|
243560
|
+
configPath: pluginConfigPath,
|
|
243561
|
+
namespace,
|
|
243562
|
+
project,
|
|
243563
|
+
source
|
|
243564
|
+
} = await this.readPluginConfig(plugin, configPath);
|
|
243565
|
+
this.registerPluginNamespace(namespace, source, pluginConfigPath);
|
|
243566
|
+
const pluginData = await this.readPluginResources(project, pluginConfigPath, namespace);
|
|
243567
|
+
for (const entity of pluginData.entities) {
|
|
243568
|
+
const existingSource = pluginSourceByEntityName.get(entity.name);
|
|
243569
|
+
if (existingSource) {
|
|
243570
|
+
throw new ConfigInvalidError(`Entity "${entity.name}" is defined by more than one plugin: "${existingSource}" and "${source}".`, 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
|
+
pluginSourceByEntityName.set(entity.name, source);
|
|
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
|
+
validateFunctionNames(functions, configPath) {
|
|
243592
|
+
const functionsByName = new Map;
|
|
243593
|
+
for (const fn of functions) {
|
|
243594
|
+
const existingFunction = functionsByName.get(fn.name);
|
|
243595
|
+
if (existingFunction) {
|
|
243596
|
+
throw new ConfigInvalidError(`Duplicate function name "${fn.name}" after loading project plugins.`, configPath, {
|
|
243597
|
+
hints: [
|
|
243598
|
+
{
|
|
243599
|
+
message: "Rename the project function or change the plugin namespace/function name so every deploy name is unique."
|
|
243600
|
+
}
|
|
243601
|
+
]
|
|
243602
|
+
});
|
|
243603
|
+
}
|
|
243604
|
+
functionsByName.set(fn.name, fn);
|
|
243605
|
+
}
|
|
243342
243606
|
}
|
|
243343
|
-
|
|
243344
|
-
|
|
243345
|
-
const
|
|
243346
|
-
|
|
243347
|
-
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
243348
|
-
}
|
|
243349
|
-
const project = result.data;
|
|
243350
|
-
const configDir = dirname5(configPath);
|
|
243351
|
-
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243352
|
-
entityResource.readAll(join8(configDir, project.entitiesDir)),
|
|
243353
|
-
functionResource.readAll(join8(configDir, project.functionsDir)),
|
|
243354
|
-
agentResource.readAll(join8(configDir, project.agentsDir)),
|
|
243355
|
-
connectorResource.readAll(join8(configDir, project.connectorsDir)),
|
|
243356
|
-
authConfigResource.readAll(join8(configDir, project.authDir))
|
|
243357
|
-
]);
|
|
243358
|
-
return {
|
|
243359
|
-
project: { ...project, root, configPath },
|
|
243360
|
-
entities,
|
|
243361
|
-
functions,
|
|
243362
|
-
agents,
|
|
243363
|
-
connectors,
|
|
243364
|
-
authConfig
|
|
243365
|
-
};
|
|
243607
|
+
}
|
|
243608
|
+
async function readProjectConfig(projectRoot) {
|
|
243609
|
+
const reader = new ProjectConfigReader;
|
|
243610
|
+
return await reader.readProjectConfig(projectRoot);
|
|
243366
243611
|
}
|
|
243367
243612
|
|
|
243368
243613
|
// src/core/project/app-config.ts
|
|
@@ -243539,12 +243784,12 @@ async function getSiteUrl(projectId) {
|
|
|
243539
243784
|
// src/core/project/template.ts
|
|
243540
243785
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
243541
243786
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
243542
|
-
import { dirname as
|
|
243787
|
+
import { dirname as dirname7, join as join11 } from "node:path";
|
|
243543
243788
|
|
|
243544
243789
|
// src/core/assets.ts
|
|
243545
243790
|
import { cpSync, existsSync } from "node:fs";
|
|
243546
243791
|
import { homedir as homedir2 } from "node:os";
|
|
243547
|
-
import { join as
|
|
243792
|
+
import { join as join10 } from "node:path";
|
|
243548
243793
|
// package.json
|
|
243549
243794
|
var package_default = {
|
|
243550
243795
|
name: "base44",
|
|
@@ -243643,18 +243888,18 @@ var package_default = {
|
|
|
243643
243888
|
};
|
|
243644
243889
|
|
|
243645
243890
|
// src/core/assets.ts
|
|
243646
|
-
var ASSETS_DIR =
|
|
243891
|
+
var ASSETS_DIR = join10(homedir2(), ".base44", "assets", package_default.version);
|
|
243647
243892
|
function getTemplatesDir() {
|
|
243648
|
-
return
|
|
243893
|
+
return join10(ASSETS_DIR, "templates");
|
|
243649
243894
|
}
|
|
243650
243895
|
function getTemplatesIndexPath() {
|
|
243651
|
-
return
|
|
243896
|
+
return join10(ASSETS_DIR, "templates", "templates.json");
|
|
243652
243897
|
}
|
|
243653
243898
|
function getDenoWrapperPath() {
|
|
243654
|
-
return
|
|
243899
|
+
return join10(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
243655
243900
|
}
|
|
243656
243901
|
function getExecWrapperPath() {
|
|
243657
|
-
return
|
|
243902
|
+
return join10(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
243658
243903
|
}
|
|
243659
243904
|
function ensureNpmAssets(sourceDir) {
|
|
243660
243905
|
if (existsSync(ASSETS_DIR))
|
|
@@ -243675,23 +243920,23 @@ async function listTemplates() {
|
|
|
243675
243920
|
return result.data.templates;
|
|
243676
243921
|
}
|
|
243677
243922
|
async function renderTemplate(template, destPath, data) {
|
|
243678
|
-
const templateDir =
|
|
243923
|
+
const templateDir = join11(getTemplatesDir(), template.path);
|
|
243679
243924
|
const files = await globby("**/*", {
|
|
243680
243925
|
cwd: templateDir,
|
|
243681
243926
|
dot: true,
|
|
243682
243927
|
onlyFiles: true
|
|
243683
243928
|
});
|
|
243684
243929
|
for (const file2 of files) {
|
|
243685
|
-
const srcPath =
|
|
243930
|
+
const srcPath = join11(templateDir, file2);
|
|
243686
243931
|
try {
|
|
243687
243932
|
if (file2.endsWith(".ejs")) {
|
|
243688
243933
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
243689
243934
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243690
|
-
const destFile = attributes.outputFileName ?
|
|
243691
|
-
const destFilePath =
|
|
243935
|
+
const destFile = attributes.outputFileName ? join11(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
243936
|
+
const destFilePath = join11(destPath, destFile);
|
|
243692
243937
|
await writeFile(destFilePath, body);
|
|
243693
243938
|
} else {
|
|
243694
|
-
const destFilePath =
|
|
243939
|
+
const destFilePath = join11(destPath, file2);
|
|
243695
243940
|
await copyFile(srcPath, destFilePath);
|
|
243696
243941
|
}
|
|
243697
243942
|
} catch (error48) {
|
|
@@ -243731,7 +243976,7 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
243731
243976
|
};
|
|
243732
243977
|
}
|
|
243733
243978
|
// src/core/project/deploy.ts
|
|
243734
|
-
import { resolve } from "node:path";
|
|
243979
|
+
import { resolve as resolve2 } from "node:path";
|
|
243735
243980
|
|
|
243736
243981
|
// src/core/site/api.ts
|
|
243737
243982
|
async function uploadSite(archivePath) {
|
|
@@ -243766,7 +244011,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
243766
244011
|
// src/core/site/deploy.ts
|
|
243767
244012
|
import { randomUUID } from "node:crypto";
|
|
243768
244013
|
import { tmpdir } from "node:os";
|
|
243769
|
-
import { join as
|
|
244014
|
+
import { join as join12 } from "node:path";
|
|
243770
244015
|
async function deploySite(siteOutputDir) {
|
|
243771
244016
|
if (!await pathExists(siteOutputDir)) {
|
|
243772
244017
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -243783,7 +244028,7 @@ async function deploySite(siteOutputDir) {
|
|
|
243783
244028
|
]
|
|
243784
244029
|
});
|
|
243785
244030
|
}
|
|
243786
|
-
const archivePath =
|
|
244031
|
+
const archivePath = join12(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
243787
244032
|
try {
|
|
243788
244033
|
await createArchive(siteOutputDir, archivePath);
|
|
243789
244034
|
return await uploadSite(archivePath);
|
|
@@ -243820,7 +244065,7 @@ async function deployAll(projectData, options) {
|
|
|
243820
244065
|
await authConfigResource.push(authConfig);
|
|
243821
244066
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
243822
244067
|
if (project.site?.outputDirectory) {
|
|
243823
|
-
const outputDir =
|
|
244068
|
+
const outputDir = resolve2(project.root, project.site.outputDirectory);
|
|
243824
244069
|
const { appUrl } = await deploySite(outputDir);
|
|
243825
244070
|
return { appUrl, connectorResults };
|
|
243826
244071
|
}
|
|
@@ -245635,8 +245880,8 @@ var disconnect = (anyProcess) => {
|
|
|
245635
245880
|
// ../../node_modules/execa/lib/utils/deferred.js
|
|
245636
245881
|
var createDeferred = () => {
|
|
245637
245882
|
const methods = {};
|
|
245638
|
-
const promise2 = new Promise((
|
|
245639
|
-
Object.assign(methods, { resolve:
|
|
245883
|
+
const promise2 = new Promise((resolve3, reject) => {
|
|
245884
|
+
Object.assign(methods, { resolve: resolve3, reject });
|
|
245640
245885
|
});
|
|
245641
245886
|
return Object.assign(promise2, methods);
|
|
245642
245887
|
};
|
|
@@ -250000,11 +250245,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
250000
250245
|
const promises = weakMap.get(stream);
|
|
250001
250246
|
const promise2 = createDeferred();
|
|
250002
250247
|
promises.push(promise2);
|
|
250003
|
-
const
|
|
250004
|
-
return { resolve:
|
|
250248
|
+
const resolve3 = promise2.resolve.bind(promise2);
|
|
250249
|
+
return { resolve: resolve3, promises };
|
|
250005
250250
|
};
|
|
250006
|
-
var waitForConcurrentStreams = async ({ resolve:
|
|
250007
|
-
|
|
250251
|
+
var waitForConcurrentStreams = async ({ resolve: resolve3, promises }, subprocess) => {
|
|
250252
|
+
resolve3();
|
|
250008
250253
|
const [isSubprocessExit] = await Promise.race([
|
|
250009
250254
|
Promise.allSettled([true, subprocess]),
|
|
250010
250255
|
Promise.all([false, ...promises])
|
|
@@ -250970,8 +251215,8 @@ async function pullAgentsAction({
|
|
|
250970
251215
|
runTask: runTask2
|
|
250971
251216
|
}) {
|
|
250972
251217
|
const { project: project2 } = await readProjectConfig();
|
|
250973
|
-
const configDir =
|
|
250974
|
-
const agentsDir =
|
|
251218
|
+
const configDir = dirname8(project2.configPath);
|
|
251219
|
+
const agentsDir = join13(configDir, project2.agentsDir);
|
|
250975
251220
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
250976
251221
|
return await fetchAgents();
|
|
250977
251222
|
}, {
|
|
@@ -251035,12 +251280,12 @@ function getAgentsCommand() {
|
|
|
251035
251280
|
}
|
|
251036
251281
|
|
|
251037
251282
|
// src/cli/commands/auth/password-login.ts
|
|
251038
|
-
import { dirname as
|
|
251283
|
+
import { dirname as dirname9, join as join14 } from "node:path";
|
|
251039
251284
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
251040
251285
|
const shouldEnable = action === "enable";
|
|
251041
251286
|
const { project: project2 } = await readProjectConfig();
|
|
251042
|
-
const configDir =
|
|
251043
|
-
const authDir =
|
|
251287
|
+
const configDir = dirname9(project2.configPath);
|
|
251288
|
+
const authDir = join14(configDir, project2.authDir);
|
|
251044
251289
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
251045
251290
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
251046
251291
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -251060,14 +251305,14 @@ function getPasswordLoginCommand() {
|
|
|
251060
251305
|
}
|
|
251061
251306
|
|
|
251062
251307
|
// src/cli/commands/auth/pull.ts
|
|
251063
|
-
import { dirname as
|
|
251308
|
+
import { dirname as dirname10, join as join15 } from "node:path";
|
|
251064
251309
|
async function pullAuthAction({
|
|
251065
251310
|
log,
|
|
251066
251311
|
runTask: runTask2
|
|
251067
251312
|
}) {
|
|
251068
251313
|
const { project: project2 } = await readProjectConfig();
|
|
251069
|
-
const configDir =
|
|
251070
|
-
const authDir =
|
|
251314
|
+
const configDir = dirname10(project2.configPath);
|
|
251315
|
+
const authDir = join15(configDir, project2.authDir);
|
|
251071
251316
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
251072
251317
|
return await pullAuthConfig();
|
|
251073
251318
|
}, {
|
|
@@ -251131,7 +251376,7 @@ function getAuthPushCommand() {
|
|
|
251131
251376
|
}
|
|
251132
251377
|
|
|
251133
251378
|
// src/cli/commands/auth/social-login.ts
|
|
251134
|
-
import { dirname as
|
|
251379
|
+
import { dirname as dirname11, join as join16, resolve as resolve3 } from "node:path";
|
|
251135
251380
|
var PROVIDER_LABELS = {
|
|
251136
251381
|
google: "Google",
|
|
251137
251382
|
microsoft: "Microsoft",
|
|
@@ -251171,7 +251416,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251171
251416
|
let clientSecret;
|
|
251172
251417
|
if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
|
|
251173
251418
|
if (options.envFile) {
|
|
251174
|
-
const secrets = await parseEnvFile(
|
|
251419
|
+
const secrets = await parseEnvFile(resolve3(options.envFile));
|
|
251175
251420
|
const value = secrets[oauthCli.envVar];
|
|
251176
251421
|
if (!value) {
|
|
251177
251422
|
throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
|
|
@@ -251201,8 +251446,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251201
251446
|
}
|
|
251202
251447
|
}
|
|
251203
251448
|
const { project: project2 } = await readProjectConfig();
|
|
251204
|
-
const configDir =
|
|
251205
|
-
const authDir =
|
|
251449
|
+
const configDir = dirname11(project2.configPath);
|
|
251450
|
+
const authDir = join16(configDir, project2.authDir);
|
|
251206
251451
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251207
251452
|
if (clientSecret) {
|
|
251208
251453
|
await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -251227,7 +251472,7 @@ function getSocialLoginCommand() {
|
|
|
251227
251472
|
}
|
|
251228
251473
|
|
|
251229
251474
|
// src/cli/commands/auth/sso.ts
|
|
251230
|
-
import { dirname as
|
|
251475
|
+
import { dirname as dirname12, join as join17, resolve as resolve4 } from "node:path";
|
|
251231
251476
|
var SSOConfigFileSchema = exports_external.object({
|
|
251232
251477
|
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251233
251478
|
clientId: exports_external.string(),
|
|
@@ -251243,7 +251488,7 @@ var SSOConfigFileSchema = exports_external.object({
|
|
|
251243
251488
|
ssoName: exports_external.string().optional()
|
|
251244
251489
|
});
|
|
251245
251490
|
async function loadSSOConfigFile(filePath) {
|
|
251246
|
-
const resolved =
|
|
251491
|
+
const resolved = resolve4(filePath);
|
|
251247
251492
|
const raw2 = await readJsonFile(resolved);
|
|
251248
251493
|
const result = SSOConfigFileSchema.safeParse(raw2);
|
|
251249
251494
|
if (!result.success) {
|
|
@@ -251270,8 +251515,21 @@ function mergeFileWithFlags(fileConfig, options) {
|
|
|
251270
251515
|
};
|
|
251271
251516
|
}
|
|
251272
251517
|
var providerNames = Object.keys(KNOWN_SSO_PROVIDERS);
|
|
251518
|
+
var SECRET_KEY_TO_FLAG = {
|
|
251519
|
+
["sso_name" /* Name */]: "--sso-name",
|
|
251520
|
+
["sso_client_id" /* ClientId */]: "--client-id",
|
|
251521
|
+
["sso_client_secret" /* ClientSecret */]: "--client-secret",
|
|
251522
|
+
["sso_scope" /* Scope */]: "--scope",
|
|
251523
|
+
["sso_discovery_url" /* DiscoveryUrl */]: "--discovery-url",
|
|
251524
|
+
["sso_tenant_id" /* TenantId */]: "--tenant-id",
|
|
251525
|
+
["sso_auth_endpoint" /* AuthEndpoint */]: "--auth-endpoint",
|
|
251526
|
+
["sso_token_endpoint" /* TokenEndpoint */]: "--token-endpoint",
|
|
251527
|
+
["sso_userinfo_endpoint" /* UserinfoEndpoint */]: "--userinfo-endpoint",
|
|
251528
|
+
["sso_okta_domain" /* OktaDomain */]: "--okta-domain",
|
|
251529
|
+
["sso_jwks_uri" /* JwksUri */]: "--jwks-uri"
|
|
251530
|
+
};
|
|
251273
251531
|
function secretKeyToFlag(key) {
|
|
251274
|
-
return
|
|
251532
|
+
return SECRET_KEY_TO_FLAG[key];
|
|
251275
251533
|
}
|
|
251276
251534
|
function exampleCommand(provider) {
|
|
251277
251535
|
let cmd = `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`;
|
|
@@ -251318,7 +251576,7 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251318
251576
|
}
|
|
251319
251577
|
let clientSecret;
|
|
251320
251578
|
if (merged.envFile && !merged.clientSecret) {
|
|
251321
|
-
const secrets2 = await parseEnvFile(
|
|
251579
|
+
const secrets2 = await parseEnvFile(resolve4(merged.envFile));
|
|
251322
251580
|
const value = secrets2.sso_client_secret;
|
|
251323
251581
|
if (!value) {
|
|
251324
251582
|
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
@@ -251377,8 +251635,8 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
|
|
|
251377
251635
|
throw error48;
|
|
251378
251636
|
}
|
|
251379
251637
|
const { project: project2 } = await readProjectConfig();
|
|
251380
|
-
const configDir =
|
|
251381
|
-
const authDir =
|
|
251638
|
+
const configDir = dirname12(project2.configPath);
|
|
251639
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251382
251640
|
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251383
251641
|
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
251384
251642
|
return {
|
|
@@ -251393,8 +251651,8 @@ async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
|
251393
251651
|
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251394
251652
|
}
|
|
251395
251653
|
const { project: project2 } = await readProjectConfig();
|
|
251396
|
-
const configDir =
|
|
251397
|
-
const authDir =
|
|
251654
|
+
const configDir = dirname12(project2.configPath);
|
|
251655
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251398
251656
|
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251399
251657
|
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
251400
251658
|
if (!hasAnyLoginMethod(updated)) {
|
|
@@ -251481,14 +251739,14 @@ function getConnectorsListAvailableCommand() {
|
|
|
251481
251739
|
}
|
|
251482
251740
|
|
|
251483
251741
|
// src/cli/commands/connectors/pull.ts
|
|
251484
|
-
import { dirname as
|
|
251742
|
+
import { dirname as dirname13, join as join18 } from "node:path";
|
|
251485
251743
|
async function pullConnectorsAction({
|
|
251486
251744
|
log,
|
|
251487
251745
|
runTask: runTask2
|
|
251488
251746
|
}) {
|
|
251489
251747
|
const { project: project2 } = await readProjectConfig();
|
|
251490
|
-
const configDir =
|
|
251491
|
-
const connectorsDir =
|
|
251748
|
+
const configDir = dirname13(project2.configPath);
|
|
251749
|
+
const connectorsDir = join18(configDir, project2.connectorsDir);
|
|
251492
251750
|
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
251493
251751
|
return await pullAllConnectors();
|
|
251494
251752
|
}, {
|
|
@@ -252017,19 +252275,19 @@ var baseOpen = async (options) => {
|
|
|
252017
252275
|
}
|
|
252018
252276
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
252019
252277
|
if (options.wait) {
|
|
252020
|
-
return new Promise((
|
|
252278
|
+
return new Promise((resolve5, reject) => {
|
|
252021
252279
|
subprocess.once("error", reject);
|
|
252022
252280
|
subprocess.once("close", (exitCode) => {
|
|
252023
252281
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
252024
252282
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
252025
252283
|
return;
|
|
252026
252284
|
}
|
|
252027
|
-
|
|
252285
|
+
resolve5(subprocess);
|
|
252028
252286
|
});
|
|
252029
252287
|
});
|
|
252030
252288
|
}
|
|
252031
252289
|
if (isFallbackAttempt) {
|
|
252032
|
-
return new Promise((
|
|
252290
|
+
return new Promise((resolve5, reject) => {
|
|
252033
252291
|
subprocess.once("error", reject);
|
|
252034
252292
|
subprocess.once("spawn", () => {
|
|
252035
252293
|
subprocess.once("close", (exitCode) => {
|
|
@@ -252039,17 +252297,17 @@ var baseOpen = async (options) => {
|
|
|
252039
252297
|
return;
|
|
252040
252298
|
}
|
|
252041
252299
|
subprocess.unref();
|
|
252042
|
-
|
|
252300
|
+
resolve5(subprocess);
|
|
252043
252301
|
});
|
|
252044
252302
|
});
|
|
252045
252303
|
});
|
|
252046
252304
|
}
|
|
252047
252305
|
subprocess.unref();
|
|
252048
|
-
return new Promise((
|
|
252306
|
+
return new Promise((resolve5, reject) => {
|
|
252049
252307
|
subprocess.once("error", reject);
|
|
252050
252308
|
subprocess.once("spawn", () => {
|
|
252051
252309
|
subprocess.off("error", reject);
|
|
252052
|
-
|
|
252310
|
+
resolve5(subprocess);
|
|
252053
252311
|
});
|
|
252054
252312
|
});
|
|
252055
252313
|
};
|
|
@@ -252492,6 +252750,11 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
252492
252750
|
formatDeployResult(result, log);
|
|
252493
252751
|
}
|
|
252494
252752
|
});
|
|
252753
|
+
const hasFailures = results.some((r) => r.status === "error");
|
|
252754
|
+
if (hasFailures) {
|
|
252755
|
+
log.message(buildDeploySummary(results));
|
|
252756
|
+
throw new CLIExitError(1);
|
|
252757
|
+
}
|
|
252495
252758
|
if (options.force) {
|
|
252496
252759
|
const allLocalNames = functions.map((f) => f.name);
|
|
252497
252760
|
let pruneCompleted = 0;
|
|
@@ -252543,25 +252806,38 @@ function getListCommand() {
|
|
|
252543
252806
|
}
|
|
252544
252807
|
|
|
252545
252808
|
// src/cli/commands/functions/pull.ts
|
|
252546
|
-
import { dirname as
|
|
252809
|
+
import { dirname as dirname14, join as join19 } from "node:path";
|
|
252547
252810
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
252548
|
-
const { project: project2 } = await readProjectConfig();
|
|
252549
|
-
const configDir =
|
|
252550
|
-
const functionsDir =
|
|
252811
|
+
const { project: project2, functions } = await readProjectConfig();
|
|
252812
|
+
const configDir = dirname14(project2.configPath);
|
|
252813
|
+
const functionsDir = join19(configDir, project2.functionsDir);
|
|
252814
|
+
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
252551
252815
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
252552
|
-
const { functions } = await listDeployedFunctions();
|
|
252553
|
-
return
|
|
252816
|
+
const { functions: functions2 } = await listDeployedFunctions();
|
|
252817
|
+
return functions2;
|
|
252554
252818
|
}, {
|
|
252555
252819
|
successMessage: "Functions fetched successfully",
|
|
252556
252820
|
errorMessage: "Failed to fetch functions"
|
|
252557
252821
|
});
|
|
252558
|
-
|
|
252559
|
-
|
|
252822
|
+
if (name2 && pluginFunctionNames.has(name2)) {
|
|
252823
|
+
return {
|
|
252824
|
+
outroMessage: `Function "${name2}" is managed by a plugin and was not pulled into ${functionsDir}`
|
|
252825
|
+
};
|
|
252826
|
+
}
|
|
252827
|
+
const matchingRemote = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
|
|
252828
|
+
if (name2 && matchingRemote.length === 0) {
|
|
252560
252829
|
return {
|
|
252561
252830
|
outroMessage: `Function "${name2}" not found on remote`
|
|
252562
252831
|
};
|
|
252563
252832
|
}
|
|
252833
|
+
const skippedPluginOwned = matchingRemote.filter((fn) => pluginFunctionNames.has(fn.name));
|
|
252834
|
+
const toPull = matchingRemote.filter((fn) => !pluginFunctionNames.has(fn.name));
|
|
252564
252835
|
if (toPull.length === 0) {
|
|
252836
|
+
if (skippedPluginOwned.length > 0) {
|
|
252837
|
+
return {
|
|
252838
|
+
outroMessage: `Skipped ${skippedPluginOwned.length} plugin-owned function${skippedPluginOwned.length !== 1 ? "s" : ""}; no project-owned functions to pull`
|
|
252839
|
+
};
|
|
252840
|
+
}
|
|
252565
252841
|
return { outroMessage: "No functions found on remote" };
|
|
252566
252842
|
}
|
|
252567
252843
|
const { written, skipped } = await runTask2("Writing function files", async () => {
|
|
@@ -252576,8 +252852,11 @@ async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
|
252576
252852
|
for (const name3 of skipped) {
|
|
252577
252853
|
log.info(`${name3.padEnd(25)} unchanged`);
|
|
252578
252854
|
}
|
|
252855
|
+
for (const fn of skippedPluginOwned) {
|
|
252856
|
+
log.info(`${fn.name.padEnd(25)} plugin-owned, skipped`);
|
|
252857
|
+
}
|
|
252579
252858
|
return {
|
|
252580
|
-
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
252859
|
+
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}${skippedPluginOwned.length > 0 ? `; skipped ${skippedPluginOwned.length} plugin-owned` : ""}`
|
|
252581
252860
|
};
|
|
252582
252861
|
}
|
|
252583
252862
|
function getPullCommand() {
|
|
@@ -252590,7 +252869,7 @@ function getFunctionsCommand() {
|
|
|
252590
252869
|
}
|
|
252591
252870
|
|
|
252592
252871
|
// src/cli/commands/project/create.ts
|
|
252593
|
-
import { basename as basename3, join as
|
|
252872
|
+
import { basename as basename3, join as join20, resolve as resolve5 } from "node:path";
|
|
252594
252873
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
252595
252874
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
252596
252875
|
async function getTemplateById(templateId) {
|
|
@@ -252655,7 +252934,7 @@ async function createInteractive(options, ctx) {
|
|
|
252655
252934
|
}, ctx);
|
|
252656
252935
|
}
|
|
252657
252936
|
async function createNonInteractive(options, ctx) {
|
|
252658
|
-
ctx.log.info(`Creating a new project at ${
|
|
252937
|
+
ctx.log.info(`Creating a new project at ${resolve5(options.path)}`);
|
|
252659
252938
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
252660
252939
|
return await executeCreate({
|
|
252661
252940
|
template: template2,
|
|
@@ -252676,7 +252955,7 @@ async function executeCreate({
|
|
|
252676
252955
|
isInteractive
|
|
252677
252956
|
}, { log, runTask: runTask2 }) {
|
|
252678
252957
|
const name2 = rawName.trim();
|
|
252679
|
-
const resolvedPath =
|
|
252958
|
+
const resolvedPath = resolve5(projectPath);
|
|
252680
252959
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
252681
252960
|
return await createProjectFiles({
|
|
252682
252961
|
name: name2,
|
|
@@ -252727,7 +253006,7 @@ async function executeCreate({
|
|
|
252727
253006
|
updateMessage("Building project...");
|
|
252728
253007
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
252729
253008
|
updateMessage("Deploying site...");
|
|
252730
|
-
return await deploySite(
|
|
253009
|
+
return await deploySite(join20(resolvedPath, outputDirectory));
|
|
252731
253010
|
}, {
|
|
252732
253011
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
252733
253012
|
errorMessage: "Failed to deploy site"
|
|
@@ -253192,7 +253471,7 @@ function getSecretsListCommand() {
|
|
|
253192
253471
|
}
|
|
253193
253472
|
|
|
253194
253473
|
// src/cli/commands/secrets/set.ts
|
|
253195
|
-
import { resolve as
|
|
253474
|
+
import { resolve as resolve6 } from "node:path";
|
|
253196
253475
|
function parseEntries(entries) {
|
|
253197
253476
|
const secrets = {};
|
|
253198
253477
|
for (const entry of entries) {
|
|
@@ -253223,7 +253502,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
253223
253502
|
validateInput(entries, options);
|
|
253224
253503
|
let secrets;
|
|
253225
253504
|
if (options.envFile) {
|
|
253226
|
-
secrets = await parseEnvFile(
|
|
253505
|
+
secrets = await parseEnvFile(resolve6(options.envFile));
|
|
253227
253506
|
if (Object.keys(secrets).length === 0) {
|
|
253228
253507
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
253229
253508
|
}
|
|
@@ -253252,7 +253531,7 @@ function getSecretsCommand() {
|
|
|
253252
253531
|
}
|
|
253253
253532
|
|
|
253254
253533
|
// src/cli/commands/site/deploy.ts
|
|
253255
|
-
import { resolve as
|
|
253534
|
+
import { resolve as resolve7 } from "node:path";
|
|
253256
253535
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
253257
253536
|
if (isNonInteractive && !options.yes) {
|
|
253258
253537
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -253267,7 +253546,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
253267
253546
|
]
|
|
253268
253547
|
});
|
|
253269
253548
|
}
|
|
253270
|
-
const outputDir =
|
|
253549
|
+
const outputDir = resolve7(project2.root, project2.site.outputDirectory);
|
|
253271
253550
|
if (!options.yes) {
|
|
253272
253551
|
const shouldDeploy = await Re({
|
|
253273
253552
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253393,10 +253672,10 @@ function toPascalCase(name2) {
|
|
|
253393
253672
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
253394
253673
|
}
|
|
253395
253674
|
// src/core/types/update-project.ts
|
|
253396
|
-
import { join as
|
|
253675
|
+
import { join as join23 } from "node:path";
|
|
253397
253676
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
253398
253677
|
async function updateProjectConfig(projectRoot) {
|
|
253399
|
-
const tsconfigPath =
|
|
253678
|
+
const tsconfigPath = join23(projectRoot, "tsconfig.json");
|
|
253400
253679
|
if (!await pathExists(tsconfigPath)) {
|
|
253401
253680
|
return false;
|
|
253402
253681
|
}
|
|
@@ -253444,7 +253723,7 @@ import process21 from "node:process";
|
|
|
253444
253723
|
// src/cli/dev/dev-server/main.ts
|
|
253445
253724
|
var import_cors = __toESM(require_lib4(), 1);
|
|
253446
253725
|
var import_express6 = __toESM(require_express(), 1);
|
|
253447
|
-
import { dirname as
|
|
253726
|
+
import { dirname as dirname19, join as join26 } from "node:path";
|
|
253448
253727
|
|
|
253449
253728
|
// ../../node_modules/get-port/index.js
|
|
253450
253729
|
import net from "node:net";
|
|
@@ -253471,14 +253750,14 @@ var getLocalHosts = () => {
|
|
|
253471
253750
|
}
|
|
253472
253751
|
return results;
|
|
253473
253752
|
};
|
|
253474
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253753
|
+
var checkAvailablePort = (options8) => new Promise((resolve9, reject) => {
|
|
253475
253754
|
const server = net.createServer();
|
|
253476
253755
|
server.unref();
|
|
253477
253756
|
server.on("error", reject);
|
|
253478
253757
|
server.listen(options8, () => {
|
|
253479
253758
|
const { port } = server.address();
|
|
253480
253759
|
server.close(() => {
|
|
253481
|
-
|
|
253760
|
+
resolve9(port);
|
|
253482
253761
|
});
|
|
253483
253762
|
});
|
|
253484
253763
|
});
|
|
@@ -253738,7 +254017,7 @@ class FunctionManager {
|
|
|
253738
254017
|
});
|
|
253739
254018
|
}
|
|
253740
254019
|
waitForReady(name2, runningFunc) {
|
|
253741
|
-
return new Promise((
|
|
254020
|
+
return new Promise((resolve9, reject) => {
|
|
253742
254021
|
runningFunc.process.on("exit", (code2) => {
|
|
253743
254022
|
if (!runningFunc.ready) {
|
|
253744
254023
|
clearTimeout(timeout3);
|
|
@@ -253761,7 +254040,7 @@ class FunctionManager {
|
|
|
253761
254040
|
runningFunc.ready = true;
|
|
253762
254041
|
clearTimeout(timeout3);
|
|
253763
254042
|
runningFunc.process.stdout?.off("data", onData);
|
|
253764
|
-
|
|
254043
|
+
resolve9(runningFunc.port);
|
|
253765
254044
|
}
|
|
253766
254045
|
};
|
|
253767
254046
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -254062,7 +254341,8 @@ class Database {
|
|
|
254062
254341
|
return {
|
|
254063
254342
|
name: "User",
|
|
254064
254343
|
type: "object",
|
|
254065
|
-
properties: { ...builtInFields, role: { type: "string" } }
|
|
254344
|
+
properties: { ...builtInFields, role: { type: "string" } },
|
|
254345
|
+
source: { type: "project" }
|
|
254066
254346
|
};
|
|
254067
254347
|
}
|
|
254068
254348
|
for (const field of Object.keys(builtInFields)) {
|
|
@@ -255682,9 +255962,9 @@ class NodeFsHandler {
|
|
|
255682
255962
|
if (this.fsw.closed) {
|
|
255683
255963
|
return;
|
|
255684
255964
|
}
|
|
255685
|
-
const
|
|
255965
|
+
const dirname18 = sp2.dirname(file2);
|
|
255686
255966
|
const basename5 = sp2.basename(file2);
|
|
255687
|
-
const parent = this.fsw._getWatchedDir(
|
|
255967
|
+
const parent = this.fsw._getWatchedDir(dirname18);
|
|
255688
255968
|
let prevStats = stats;
|
|
255689
255969
|
if (parent.has(basename5))
|
|
255690
255970
|
return;
|
|
@@ -255711,7 +255991,7 @@ class NodeFsHandler {
|
|
|
255711
255991
|
prevStats = newStats2;
|
|
255712
255992
|
}
|
|
255713
255993
|
} catch (error48) {
|
|
255714
|
-
this.fsw._remove(
|
|
255994
|
+
this.fsw._remove(dirname18, basename5);
|
|
255715
255995
|
}
|
|
255716
255996
|
} else if (parent.has(basename5)) {
|
|
255717
255997
|
const at13 = newStats.atimeMs;
|
|
@@ -255800,7 +256080,7 @@ class NodeFsHandler {
|
|
|
255800
256080
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
255801
256081
|
}
|
|
255802
256082
|
}).on(EV.ERROR, this._boundHandleError);
|
|
255803
|
-
return new Promise((
|
|
256083
|
+
return new Promise((resolve10, reject) => {
|
|
255804
256084
|
if (!stream)
|
|
255805
256085
|
return reject();
|
|
255806
256086
|
stream.once(STR_END, () => {
|
|
@@ -255809,7 +256089,7 @@ class NodeFsHandler {
|
|
|
255809
256089
|
return;
|
|
255810
256090
|
}
|
|
255811
256091
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
255812
|
-
|
|
256092
|
+
resolve10(undefined);
|
|
255813
256093
|
previous.getChildren().filter((item) => {
|
|
255814
256094
|
return item !== directory && !current.has(item);
|
|
255815
256095
|
}).forEach((item) => {
|
|
@@ -256720,7 +257000,7 @@ async function createDevServer(options8) {
|
|
|
256720
257000
|
}
|
|
256721
257001
|
remoteProxy(req, res, next);
|
|
256722
257002
|
});
|
|
256723
|
-
const server = await new Promise((
|
|
257003
|
+
const server = await new Promise((resolve11, reject) => {
|
|
256724
257004
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
256725
257005
|
if (err) {
|
|
256726
257006
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -256729,7 +257009,7 @@ async function createDevServer(options8) {
|
|
|
256729
257009
|
reject(err);
|
|
256730
257010
|
}
|
|
256731
257011
|
} else {
|
|
256732
|
-
|
|
257012
|
+
resolve11(s5);
|
|
256733
257013
|
}
|
|
256734
257014
|
});
|
|
256735
257015
|
});
|
|
@@ -256738,8 +257018,8 @@ async function createDevServer(options8) {
|
|
|
256738
257018
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
256739
257019
|
};
|
|
256740
257020
|
const base44ConfigWatcher = new WatchBase44({
|
|
256741
|
-
functions:
|
|
256742
|
-
entities:
|
|
257021
|
+
functions: join26(dirname19(project2.configPath), project2.functionsDir),
|
|
257022
|
+
entities: join26(dirname19(project2.configPath), project2.entitiesDir)
|
|
256743
257023
|
}, devLogger);
|
|
256744
257024
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
256745
257025
|
try {
|
|
@@ -256846,13 +257126,13 @@ async function runScript(options8) {
|
|
|
256846
257126
|
}
|
|
256847
257127
|
// src/cli/commands/exec.ts
|
|
256848
257128
|
function readStdin2() {
|
|
256849
|
-
return new Promise((
|
|
257129
|
+
return new Promise((resolve11, reject) => {
|
|
256850
257130
|
let data = "";
|
|
256851
257131
|
process.stdin.setEncoding("utf-8");
|
|
256852
257132
|
process.stdin.on("data", (chunk) => {
|
|
256853
257133
|
data += chunk;
|
|
256854
257134
|
});
|
|
256855
|
-
process.stdin.on("end", () =>
|
|
257135
|
+
process.stdin.on("end", () => resolve11(data));
|
|
256856
257136
|
process.stdin.on("error", reject);
|
|
256857
257137
|
});
|
|
256858
257138
|
}
|
|
@@ -256891,7 +257171,7 @@ Examples:
|
|
|
256891
257171
|
}
|
|
256892
257172
|
|
|
256893
257173
|
// src/cli/commands/project/eject.ts
|
|
256894
|
-
import { resolve as
|
|
257174
|
+
import { resolve as resolve11 } from "node:path";
|
|
256895
257175
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
256896
257176
|
async function eject(ctx, options8) {
|
|
256897
257177
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -256947,7 +257227,7 @@ async function eject(ctx, options8) {
|
|
|
256947
257227
|
Ne("Operation cancelled.");
|
|
256948
257228
|
throw new CLIExitError(0);
|
|
256949
257229
|
}
|
|
256950
|
-
const resolvedPath =
|
|
257230
|
+
const resolvedPath = resolve11(selectedPath);
|
|
256951
257231
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
256952
257232
|
await createProjectFilesForExistingProject({
|
|
256953
257233
|
projectId,
|
|
@@ -257028,7 +257308,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
257028
257308
|
import { release, type } from "node:os";
|
|
257029
257309
|
|
|
257030
257310
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
257031
|
-
import { dirname as
|
|
257311
|
+
import { dirname as dirname20, posix, sep } from "path";
|
|
257032
257312
|
function createModulerModifier() {
|
|
257033
257313
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
257034
257314
|
return async (frames) => {
|
|
@@ -257037,7 +257317,7 @@ function createModulerModifier() {
|
|
|
257037
257317
|
return frames;
|
|
257038
257318
|
};
|
|
257039
257319
|
}
|
|
257040
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
257320
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname20(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
257041
257321
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
257042
257322
|
return (filename) => {
|
|
257043
257323
|
if (!filename)
|
|
@@ -259315,14 +259595,14 @@ async function addSourceContext(frames) {
|
|
|
259315
259595
|
return frames;
|
|
259316
259596
|
}
|
|
259317
259597
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
259318
|
-
return new Promise((
|
|
259598
|
+
return new Promise((resolve12) => {
|
|
259319
259599
|
const stream = createReadStream2(path19);
|
|
259320
259600
|
const lineReaded = createInterface2({
|
|
259321
259601
|
input: stream
|
|
259322
259602
|
});
|
|
259323
259603
|
function destroyStreamAndResolve() {
|
|
259324
259604
|
stream.destroy();
|
|
259325
|
-
|
|
259605
|
+
resolve12();
|
|
259326
259606
|
}
|
|
259327
259607
|
let lineNumber = 0;
|
|
259328
259608
|
let currentRangeIndex = 0;
|
|
@@ -260434,15 +260714,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260434
260714
|
return true;
|
|
260435
260715
|
if (this.featureFlagsPoller === undefined)
|
|
260436
260716
|
return false;
|
|
260437
|
-
return new Promise((
|
|
260717
|
+
return new Promise((resolve12) => {
|
|
260438
260718
|
const timeout3 = setTimeout(() => {
|
|
260439
260719
|
cleanup();
|
|
260440
|
-
|
|
260720
|
+
resolve12(false);
|
|
260441
260721
|
}, timeoutMs);
|
|
260442
260722
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260443
260723
|
clearTimeout(timeout3);
|
|
260444
260724
|
cleanup();
|
|
260445
|
-
|
|
260725
|
+
resolve12(count2 > 0);
|
|
260446
260726
|
});
|
|
260447
260727
|
});
|
|
260448
260728
|
}
|
|
@@ -261226,9 +261506,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
261226
261506
|
});
|
|
261227
261507
|
}
|
|
261228
261508
|
// src/cli/index.ts
|
|
261229
|
-
var __dirname4 =
|
|
261509
|
+
var __dirname4 = dirname21(fileURLToPath6(import.meta.url));
|
|
261230
261510
|
async function runCLI(options8) {
|
|
261231
|
-
ensureNpmAssets(
|
|
261511
|
+
ensureNpmAssets(join27(__dirname4, "../assets"));
|
|
261232
261512
|
const errorReporter = new ErrorReporter;
|
|
261233
261513
|
errorReporter.registerProcessErrorHandlers();
|
|
261234
261514
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -261265,4 +261545,4 @@ export {
|
|
|
261265
261545
|
CLIExitError
|
|
261266
261546
|
};
|
|
261267
261547
|
|
|
261268
|
-
//# debugId=
|
|
261548
|
+
//# debugId=2ADA1E4C26BBE1A464756E2164756E21
|