@base44-preview/cli 0.0.51-pr.503.9478486 → 0.0.51-pr.503.c2ae47f
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 +901 -305
- package/dist/cli/index.js.map +28 -15
- 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
8938
|
var resolve2 = path11.resolve;
|
|
8939
|
-
var includePath = resolve2(isDir ? filename :
|
|
8939
|
+
var includePath = resolve2(isDir ? filename : dirname7(filename), name2);
|
|
8940
8940
|
var ext = extname(name2);
|
|
8941
8941
|
if (!ext) {
|
|
8942
8942
|
includePath += ".ejs";
|
|
@@ -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,
|
|
@@ -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
|
+
id: exports_external.string().min(1, "Plugin id cannot be empty").regex(/^[a-zA-Z0-9_-]+$/, "Plugin id 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"
|
|
@@ -234633,7 +234639,8 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
234633
234639
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
234634
234640
|
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
234635
234641
|
authDir: exports_external.string().optional().default("auth"),
|
|
234636
|
-
|
|
234642
|
+
plugin: PluginMetadataSchema.optional(),
|
|
234643
|
+
plugins: exports_external.array(PluginReferenceSchema).optional().default([])
|
|
234637
234644
|
});
|
|
234638
234645
|
var AppConfigSchema = exports_external.object({
|
|
234639
234646
|
id: exports_external.string().min(1, "id cannot be empty")
|
|
@@ -241580,8 +241587,43 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
241580
241587
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
241581
241588
|
|
|
241582
241589
|
// src/core/project/config.ts
|
|
241590
|
+
import { dirname as dirname6, join as join9 } from "node:path";
|
|
241591
|
+
|
|
241592
|
+
// src/core/project/plugins.ts
|
|
241583
241593
|
import { createRequire as createRequire2 } from "node:module";
|
|
241584
|
-
import { dirname as
|
|
241594
|
+
import { dirname as dirname3, join as join3, resolve } from "node:path";
|
|
241595
|
+
function resolvePluginRoot(pluginSource, fromRoot) {
|
|
241596
|
+
if (pluginSource.startsWith(".")) {
|
|
241597
|
+
return resolve(fromRoot, pluginSource);
|
|
241598
|
+
}
|
|
241599
|
+
const req = createRequire2(join3(fromRoot, "package.json"));
|
|
241600
|
+
return dirname3(req.resolve(`${pluginSource}/package.json`));
|
|
241601
|
+
}
|
|
241602
|
+
function requirePluginId(project, pluginSource, configPath) {
|
|
241603
|
+
if (!project.plugin?.id) {
|
|
241604
|
+
throw new ConfigInvalidError(`Plugin loaded from "${pluginSource}" must define plugin.id`, configPath);
|
|
241605
|
+
}
|
|
241606
|
+
return project.plugin.id;
|
|
241607
|
+
}
|
|
241608
|
+
function namespacePluginFunctions(functions, pluginId) {
|
|
241609
|
+
return functions.map((fn) => ({
|
|
241610
|
+
...fn,
|
|
241611
|
+
name: `${pluginId}__${fn.name}`,
|
|
241612
|
+
source: {
|
|
241613
|
+
type: "plugin",
|
|
241614
|
+
id: pluginId
|
|
241615
|
+
}
|
|
241616
|
+
}));
|
|
241617
|
+
}
|
|
241618
|
+
function markPluginEntities(entities, pluginId) {
|
|
241619
|
+
return entities.map((entity) => ({
|
|
241620
|
+
...entity,
|
|
241621
|
+
source: {
|
|
241622
|
+
type: "plugin",
|
|
241623
|
+
id: pluginId
|
|
241624
|
+
}
|
|
241625
|
+
}));
|
|
241626
|
+
}
|
|
241585
241627
|
|
|
241586
241628
|
// src/core/resources/agent/schema.ts
|
|
241587
241629
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -241653,7 +241695,7 @@ async function fetchAgents() {
|
|
|
241653
241695
|
return result.data;
|
|
241654
241696
|
}
|
|
241655
241697
|
// src/core/resources/agent/config.ts
|
|
241656
|
-
import { join as
|
|
241698
|
+
import { join as join4, normalize } from "node:path";
|
|
241657
241699
|
import { isDeepStrictEqual } from "node:util";
|
|
241658
241700
|
async function readAgentFile(agentPath) {
|
|
241659
241701
|
const raw2 = await readJsonFile(agentPath);
|
|
@@ -241698,12 +241740,12 @@ async function readAllAgents(agentsDir) {
|
|
|
241698
241740
|
return [...nameToEntry.values()].map((e2) => e2.data);
|
|
241699
241741
|
}
|
|
241700
241742
|
function findAvailablePath(agentsDir, name2, claimedPaths) {
|
|
241701
|
-
const base =
|
|
241743
|
+
const base = join4(agentsDir, `${name2}.${CONFIG_FILE_EXTENSION}`);
|
|
241702
241744
|
if (!claimedPaths.has(base)) {
|
|
241703
241745
|
return base;
|
|
241704
241746
|
}
|
|
241705
241747
|
for (let i = 1;; i++) {
|
|
241706
|
-
const candidate =
|
|
241748
|
+
const candidate = join4(agentsDir, `${name2}_${i}.${CONFIG_FILE_EXTENSION}`);
|
|
241707
241749
|
if (!claimedPaths.has(candidate)) {
|
|
241708
241750
|
return candidate;
|
|
241709
241751
|
}
|
|
@@ -241849,7 +241891,7 @@ async function pushAuthConfigToApi(config3) {
|
|
|
241849
241891
|
return result.data.authConfig;
|
|
241850
241892
|
}
|
|
241851
241893
|
// src/core/resources/auth-config/config.ts
|
|
241852
|
-
import { join as
|
|
241894
|
+
import { join as join5 } from "node:path";
|
|
241853
241895
|
import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
|
|
241854
241896
|
var AUTH_CONFIG_FILENAME = `config.${CONFIG_FILE_EXTENSION}`;
|
|
241855
241897
|
var DEFAULT_AUTH_CONFIG = {
|
|
@@ -241865,7 +241907,7 @@ var DEFAULT_AUTH_CONFIG = {
|
|
|
241865
241907
|
useWorkspaceSSO: false
|
|
241866
241908
|
};
|
|
241867
241909
|
function getAuthConfigPath(authDir) {
|
|
241868
|
-
return
|
|
241910
|
+
return join5(authDir, AUTH_CONFIG_FILENAME);
|
|
241869
241911
|
}
|
|
241870
241912
|
async function readAuthConfig(authDir) {
|
|
241871
241913
|
const filePath = getAuthConfigPath(authDir);
|
|
@@ -241976,7 +242018,11 @@ async function updateSocialLoginConfig(authDir, provider, enable, customOAuth) {
|
|
|
241976
242018
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
241977
242019
|
const merged = {
|
|
241978
242020
|
...current,
|
|
241979
|
-
[providerInfo.field]: enable
|
|
242021
|
+
[providerInfo.field]: enable,
|
|
242022
|
+
...enable && {
|
|
242023
|
+
enableSSOLogin: false,
|
|
242024
|
+
ssoProviderName: null
|
|
242025
|
+
}
|
|
241980
242026
|
};
|
|
241981
242027
|
if (providerInfo.customOAuth) {
|
|
241982
242028
|
const oauth = providerInfo.customOAuth;
|
|
@@ -242000,6 +242046,192 @@ async function pushCustomOAuthSecret(provider, clientSecret) {
|
|
|
242000
242046
|
[providerInfo.customOAuth.secretKey]: clientSecret
|
|
242001
242047
|
});
|
|
242002
242048
|
}
|
|
242049
|
+
// src/core/resources/auth-config/sso/secret-keys.ts
|
|
242050
|
+
var SSOSecretKey;
|
|
242051
|
+
((SSOSecretKey2) => {
|
|
242052
|
+
SSOSecretKey2["Name"] = "sso_name";
|
|
242053
|
+
SSOSecretKey2["ClientId"] = "sso_client_id";
|
|
242054
|
+
SSOSecretKey2["ClientSecret"] = "sso_client_secret";
|
|
242055
|
+
SSOSecretKey2["Scope"] = "sso_scope";
|
|
242056
|
+
SSOSecretKey2["DiscoveryUrl"] = "sso_discovery_url";
|
|
242057
|
+
SSOSecretKey2["TenantId"] = "sso_tenant_id";
|
|
242058
|
+
SSOSecretKey2["AuthEndpoint"] = "sso_auth_endpoint";
|
|
242059
|
+
SSOSecretKey2["TokenEndpoint"] = "sso_token_endpoint";
|
|
242060
|
+
SSOSecretKey2["UserinfoEndpoint"] = "sso_userinfo_endpoint";
|
|
242061
|
+
SSOSecretKey2["OktaDomain"] = "sso_okta_domain";
|
|
242062
|
+
SSOSecretKey2["JwksUri"] = "sso_jwks_uri";
|
|
242063
|
+
})(SSOSecretKey ||= {});
|
|
242064
|
+
var ALL_SSO_SECRET_KEYS = Object.values(SSOSecretKey);
|
|
242065
|
+
var DEFAULT_OIDC_SCOPE = "openid email profile";
|
|
242066
|
+
var DEFAULT_GITHUB_SCOPE = "user:email";
|
|
242067
|
+
|
|
242068
|
+
// src/core/resources/auth-config/sso/providers/custom.ts
|
|
242069
|
+
var customProvider = {
|
|
242070
|
+
requiredKeys: [
|
|
242071
|
+
"sso_auth_endpoint" /* AuthEndpoint */,
|
|
242072
|
+
"sso_token_endpoint" /* TokenEndpoint */,
|
|
242073
|
+
"sso_userinfo_endpoint" /* UserinfoEndpoint */,
|
|
242074
|
+
"sso_jwks_uri" /* JwksUri */
|
|
242075
|
+
],
|
|
242076
|
+
defaults: {
|
|
242077
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
|
|
242078
|
+
}
|
|
242079
|
+
};
|
|
242080
|
+
|
|
242081
|
+
// src/core/resources/auth-config/sso/providers/github.ts
|
|
242082
|
+
var githubProvider = {
|
|
242083
|
+
requiredKeys: [],
|
|
242084
|
+
defaults: {
|
|
242085
|
+
["sso_scope" /* Scope */]: DEFAULT_GITHUB_SCOPE,
|
|
242086
|
+
["sso_auth_endpoint" /* AuthEndpoint */]: "https://github.com/login/oauth/authorize",
|
|
242087
|
+
["sso_token_endpoint" /* TokenEndpoint */]: "https://github.com/login/oauth/access_token",
|
|
242088
|
+
["sso_userinfo_endpoint" /* UserinfoEndpoint */]: "https://api.github.com/user"
|
|
242089
|
+
}
|
|
242090
|
+
};
|
|
242091
|
+
|
|
242092
|
+
// src/core/resources/auth-config/sso/providers/google.ts
|
|
242093
|
+
var googleProvider = {
|
|
242094
|
+
requiredKeys: [],
|
|
242095
|
+
defaults: {
|
|
242096
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE,
|
|
242097
|
+
["sso_discovery_url" /* DiscoveryUrl */]: "https://accounts.google.com/.well-known/openid-configuration"
|
|
242098
|
+
}
|
|
242099
|
+
};
|
|
242100
|
+
|
|
242101
|
+
// src/core/resources/auth-config/sso/providers/microsoft.ts
|
|
242102
|
+
var microsoftProvider = {
|
|
242103
|
+
requiredKeys: ["sso_tenant_id" /* TenantId */],
|
|
242104
|
+
defaults: {
|
|
242105
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
|
|
242106
|
+
},
|
|
242107
|
+
deriveDefaults: (secrets) => {
|
|
242108
|
+
const tenantId = secrets["sso_tenant_id" /* TenantId */];
|
|
242109
|
+
if (tenantId) {
|
|
242110
|
+
return {
|
|
242111
|
+
["sso_discovery_url" /* DiscoveryUrl */]: `https://login.microsoftonline.com/${tenantId}/v2.0/.well-known/openid-configuration`
|
|
242112
|
+
};
|
|
242113
|
+
}
|
|
242114
|
+
return {};
|
|
242115
|
+
}
|
|
242116
|
+
};
|
|
242117
|
+
|
|
242118
|
+
// src/core/resources/auth-config/sso/providers/okta.ts
|
|
242119
|
+
var oktaProvider = {
|
|
242120
|
+
requiredKeys: ["sso_okta_domain" /* OktaDomain */],
|
|
242121
|
+
defaults: {
|
|
242122
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
|
|
242123
|
+
},
|
|
242124
|
+
deriveDefaults: (secrets) => {
|
|
242125
|
+
const domain2 = secrets["sso_okta_domain" /* OktaDomain */];
|
|
242126
|
+
if (domain2) {
|
|
242127
|
+
return {
|
|
242128
|
+
["sso_discovery_url" /* DiscoveryUrl */]: `https://${domain2}/.well-known/openid-configuration`
|
|
242129
|
+
};
|
|
242130
|
+
}
|
|
242131
|
+
return {};
|
|
242132
|
+
}
|
|
242133
|
+
};
|
|
242134
|
+
|
|
242135
|
+
// src/core/resources/auth-config/sso/providers/index.ts
|
|
242136
|
+
var SSO_PROVIDER_SCHEMAS = {
|
|
242137
|
+
google: googleProvider,
|
|
242138
|
+
microsoft: microsoftProvider,
|
|
242139
|
+
github: githubProvider,
|
|
242140
|
+
okta: oktaProvider,
|
|
242141
|
+
custom: customProvider
|
|
242142
|
+
};
|
|
242143
|
+
|
|
242144
|
+
// src/core/resources/auth-config/sso/types.ts
|
|
242145
|
+
var KNOWN_SSO_PROVIDERS = {
|
|
242146
|
+
google: "google",
|
|
242147
|
+
microsoft: "microsoft",
|
|
242148
|
+
github: "github",
|
|
242149
|
+
okta: "okta",
|
|
242150
|
+
custom: "custom"
|
|
242151
|
+
};
|
|
242152
|
+
|
|
242153
|
+
// src/core/resources/auth-config/sso/operations.ts
|
|
242154
|
+
var OPTION_TO_SECRET_KEY = {
|
|
242155
|
+
scope: "sso_scope" /* Scope */,
|
|
242156
|
+
discoveryUrl: "sso_discovery_url" /* DiscoveryUrl */,
|
|
242157
|
+
tenantId: "sso_tenant_id" /* TenantId */,
|
|
242158
|
+
oktaDomain: "sso_okta_domain" /* OktaDomain */,
|
|
242159
|
+
authEndpoint: "sso_auth_endpoint" /* AuthEndpoint */,
|
|
242160
|
+
tokenEndpoint: "sso_token_endpoint" /* TokenEndpoint */,
|
|
242161
|
+
userinfoEndpoint: "sso_userinfo_endpoint" /* UserinfoEndpoint */,
|
|
242162
|
+
jwksUri: "sso_jwks_uri" /* JwksUri */
|
|
242163
|
+
};
|
|
242164
|
+
async function updateSSOConfig(authDir, provider, enable) {
|
|
242165
|
+
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
242166
|
+
const merged = {
|
|
242167
|
+
...current,
|
|
242168
|
+
enableSSOLogin: enable,
|
|
242169
|
+
ssoProviderName: enable && provider ? provider : null,
|
|
242170
|
+
...enable && {
|
|
242171
|
+
enableGoogleLogin: false,
|
|
242172
|
+
enableMicrosoftLogin: false,
|
|
242173
|
+
enableFacebookLogin: false,
|
|
242174
|
+
enableAppleLogin: false
|
|
242175
|
+
}
|
|
242176
|
+
};
|
|
242177
|
+
await writeAuthConfig(authDir, merged);
|
|
242178
|
+
return merged;
|
|
242179
|
+
}
|
|
242180
|
+
|
|
242181
|
+
class MissingSSOFieldsError extends InvalidInputError {
|
|
242182
|
+
missingKeys;
|
|
242183
|
+
provider;
|
|
242184
|
+
constructor(provider, missingKeys) {
|
|
242185
|
+
super(`Missing required fields for ${provider}: ${missingKeys.join(", ")}`);
|
|
242186
|
+
this.provider = provider;
|
|
242187
|
+
this.missingKeys = missingKeys;
|
|
242188
|
+
}
|
|
242189
|
+
}
|
|
242190
|
+
function buildSSOSecrets(provider, options) {
|
|
242191
|
+
const schema3 = SSO_PROVIDER_SCHEMAS[provider];
|
|
242192
|
+
const secrets = {};
|
|
242193
|
+
secrets["sso_name" /* Name */] = options.ssoName ?? provider;
|
|
242194
|
+
secrets["sso_client_id" /* ClientId */] = options.clientId;
|
|
242195
|
+
secrets["sso_client_secret" /* ClientSecret */] = options.clientSecret;
|
|
242196
|
+
for (const [optionKey, secretKey] of Object.entries(OPTION_TO_SECRET_KEY)) {
|
|
242197
|
+
const value = options[optionKey];
|
|
242198
|
+
if (typeof value === "string" && value.length > 0) {
|
|
242199
|
+
secrets[secretKey] = value;
|
|
242200
|
+
}
|
|
242201
|
+
}
|
|
242202
|
+
if (schema3.deriveDefaults) {
|
|
242203
|
+
const derived = schema3.deriveDefaults(secrets);
|
|
242204
|
+
for (const [key, val] of Object.entries(derived)) {
|
|
242205
|
+
if (!secrets[key]) {
|
|
242206
|
+
secrets[key] = val;
|
|
242207
|
+
}
|
|
242208
|
+
}
|
|
242209
|
+
}
|
|
242210
|
+
for (const [key, val] of Object.entries(schema3.defaults)) {
|
|
242211
|
+
if (!secrets[key]) {
|
|
242212
|
+
secrets[key] = val;
|
|
242213
|
+
}
|
|
242214
|
+
}
|
|
242215
|
+
const missing = [];
|
|
242216
|
+
for (const key of schema3.requiredKeys) {
|
|
242217
|
+
if (!secrets[key]) {
|
|
242218
|
+
missing.push(key);
|
|
242219
|
+
}
|
|
242220
|
+
}
|
|
242221
|
+
if (provider === KNOWN_SSO_PROVIDERS.custom && !options.ssoName) {
|
|
242222
|
+
missing.push("sso_name" /* Name */);
|
|
242223
|
+
}
|
|
242224
|
+
if (missing.length > 0) {
|
|
242225
|
+
throw new MissingSSOFieldsError(provider, missing);
|
|
242226
|
+
}
|
|
242227
|
+
return Object.fromEntries(Object.entries(secrets).filter(([, v]) => v.length > 0));
|
|
242228
|
+
}
|
|
242229
|
+
async function pushSSOSecrets(secrets) {
|
|
242230
|
+
await setSecrets(secrets);
|
|
242231
|
+
}
|
|
242232
|
+
async function deleteSSOSecrets() {
|
|
242233
|
+
await Promise.allSettled(ALL_SSO_SECRET_KEYS.map((key) => deleteSecret(key)));
|
|
242234
|
+
}
|
|
242003
242235
|
// src/core/resources/connector/schema.ts
|
|
242004
242236
|
var GoogleCalendarConnectorSchema = exports_external.object({
|
|
242005
242237
|
type: exports_external.literal("googlecalendar"),
|
|
@@ -242327,7 +242559,7 @@ async function removeStripe() {
|
|
|
242327
242559
|
return result.data;
|
|
242328
242560
|
}
|
|
242329
242561
|
// src/core/resources/connector/config.ts
|
|
242330
|
-
import { join as
|
|
242562
|
+
import { join as join6 } from "node:path";
|
|
242331
242563
|
import { isDeepStrictEqual as isDeepStrictEqual3 } from "node:util";
|
|
242332
242564
|
async function readConnectorFile(connectorPath) {
|
|
242333
242565
|
const parsed = await readJsonFile(connectorPath);
|
|
@@ -242388,7 +242620,7 @@ async function writeConnectors(connectorsDir, remoteConnectors) {
|
|
|
242388
242620
|
if (existing && isDeepStrictEqual3(existing.data, connector)) {
|
|
242389
242621
|
continue;
|
|
242390
242622
|
}
|
|
242391
|
-
const filePath = existing?.filePath ??
|
|
242623
|
+
const filePath = existing?.filePath ?? join6(connectorsDir, `${connector.type}.${CONFIG_FILE_EXTENSION}`);
|
|
242392
242624
|
await writeJsonFile(filePath, connector);
|
|
242393
242625
|
written.push(connector.type);
|
|
242394
242626
|
}
|
|
@@ -242543,6 +242775,17 @@ var connectorResource = {
|
|
|
242543
242775
|
readAll: readAllConnectors,
|
|
242544
242776
|
push: pushConnectors
|
|
242545
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
|
+
id: exports_external.string().min(1, "Plugin id cannot be empty")
|
|
242786
|
+
})
|
|
242787
|
+
]);
|
|
242788
|
+
|
|
242546
242789
|
// src/core/resources/entity/schema.ts
|
|
242547
242790
|
var FieldConditionSchema = exports_external.union([
|
|
242548
242791
|
exports_external.string(),
|
|
@@ -242649,7 +242892,8 @@ var EntitySchema = exports_external.looseObject({
|
|
|
242649
242892
|
description: exports_external.string().optional(),
|
|
242650
242893
|
properties: exports_external.record(exports_external.string(), PropertyDefinitionSchema).default({}),
|
|
242651
242894
|
required: exports_external.array(exports_external.string()).optional(),
|
|
242652
|
-
rls: EntityRLSSchema.optional()
|
|
242895
|
+
rls: EntityRLSSchema.optional(),
|
|
242896
|
+
source: ResourceSourceSchema.default({ type: "project" })
|
|
242653
242897
|
});
|
|
242654
242898
|
var SyncEntitiesResponseSchema = exports_external.object({
|
|
242655
242899
|
created: exports_external.array(exports_external.string()),
|
|
@@ -242657,6 +242901,27 @@ var SyncEntitiesResponseSchema = exports_external.object({
|
|
|
242657
242901
|
deleted: exports_external.array(exports_external.string())
|
|
242658
242902
|
});
|
|
242659
242903
|
|
|
242904
|
+
// src/core/resources/entity/api.ts
|
|
242905
|
+
async function syncEntities(entities) {
|
|
242906
|
+
const appClient = getAppClient();
|
|
242907
|
+
const schemaSyncPayload = Object.fromEntries(entities.map(({ source: _source, ...entity }) => [entity.name, entity]));
|
|
242908
|
+
let response;
|
|
242909
|
+
try {
|
|
242910
|
+
response = await appClient.put("entity-schemas", {
|
|
242911
|
+
json: {
|
|
242912
|
+
entityNameToSchema: schemaSyncPayload
|
|
242913
|
+
},
|
|
242914
|
+
timeout: 60000
|
|
242915
|
+
});
|
|
242916
|
+
} catch (error48) {
|
|
242917
|
+
throw await ApiError.fromHttpError(error48, "syncing entities");
|
|
242918
|
+
}
|
|
242919
|
+
const result = SyncEntitiesResponseSchema.safeParse(await response.json());
|
|
242920
|
+
if (!result.success) {
|
|
242921
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
242922
|
+
}
|
|
242923
|
+
return result.data;
|
|
242924
|
+
}
|
|
242660
242925
|
// src/core/resources/entity/config.ts
|
|
242661
242926
|
async function readEntityFile(entityPath) {
|
|
242662
242927
|
const parsed = await readJsonFile(entityPath);
|
|
@@ -242675,57 +242940,20 @@ async function readAllEntities(entitiesDir) {
|
|
|
242675
242940
|
absolute: true
|
|
242676
242941
|
});
|
|
242677
242942
|
const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
|
|
242678
|
-
|
|
242679
|
-
|
|
242680
|
-
|
|
242681
|
-
|
|
242682
|
-
|
|
242683
|
-
|
|
242684
|
-
|
|
242685
|
-
|
|
242686
|
-
|
|
242687
|
-
const pluginEntityProperties = Object.keys(pluginEntity.properties);
|
|
242688
|
-
const collidingProperties = appEntityProperties.filter((prop) => pluginEntityProperties.includes(prop));
|
|
242689
|
-
if (collidingProperties.length) {
|
|
242690
|
-
const collidingPropertiesNames = collidingProperties.map((name2) => `"${name2}"`).join(", ");
|
|
242691
|
-
throw new ConfigInvalidError(`Entity "${appEntityToMerge.name}" cannot override plugin-defined properties: ${collidingPropertiesNames}.
|
|
242692
|
-
Plugin properties are protected — remove or rename them in your local entity.`);
|
|
242693
|
-
}
|
|
242694
|
-
mergedEntities.push({
|
|
242695
|
-
...pluginEntity,
|
|
242696
|
-
properties: {
|
|
242697
|
-
...pluginEntity.properties,
|
|
242698
|
-
...appEntityToMerge.properties
|
|
242699
|
-
}
|
|
242943
|
+
const names = new Set;
|
|
242944
|
+
for (const entity of entities) {
|
|
242945
|
+
if (names.has(entity.name)) {
|
|
242946
|
+
throw new InvalidInputError(`Duplicate entity name "${entity.name}"`, {
|
|
242947
|
+
hints: [
|
|
242948
|
+
{
|
|
242949
|
+
message: `Remove duplicate entities with name "${entity.name}" - only one entity per name is allowed`
|
|
242950
|
+
}
|
|
242951
|
+
]
|
|
242700
242952
|
});
|
|
242701
|
-
appEntitiesByName.delete(appEntityToMerge.name);
|
|
242702
|
-
} else {
|
|
242703
|
-
mergedEntities.push(pluginEntity);
|
|
242704
242953
|
}
|
|
242705
|
-
|
|
242706
|
-
return [...mergedEntities, ...appEntitiesByName.values()];
|
|
242707
|
-
}
|
|
242708
|
-
|
|
242709
|
-
// src/core/resources/entity/api.ts
|
|
242710
|
-
async function syncEntities(entities) {
|
|
242711
|
-
const appClient = getAppClient();
|
|
242712
|
-
const schemaSyncPayload = Object.fromEntries(entities.map((entity) => [entity.name, entity]));
|
|
242713
|
-
let response;
|
|
242714
|
-
try {
|
|
242715
|
-
response = await appClient.put("entity-schemas", {
|
|
242716
|
-
json: {
|
|
242717
|
-
entityNameToSchema: schemaSyncPayload
|
|
242718
|
-
},
|
|
242719
|
-
timeout: 60000
|
|
242720
|
-
});
|
|
242721
|
-
} catch (error48) {
|
|
242722
|
-
throw await ApiError.fromHttpError(error48, "syncing entities");
|
|
242954
|
+
names.add(entity.name);
|
|
242723
242955
|
}
|
|
242724
|
-
|
|
242725
|
-
if (!result.success) {
|
|
242726
|
-
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
242727
|
-
}
|
|
242728
|
-
return result.data;
|
|
242956
|
+
return entities;
|
|
242729
242957
|
}
|
|
242730
242958
|
// src/core/resources/entity/deploy.ts
|
|
242731
242959
|
async function pushEntities(entities) {
|
|
@@ -242739,6 +242967,57 @@ var entityResource = {
|
|
|
242739
242967
|
readAll: readAllEntities,
|
|
242740
242968
|
push: pushEntities
|
|
242741
242969
|
};
|
|
242970
|
+
// src/core/resources/entity/merge.ts
|
|
242971
|
+
function mergePluginEntity(pluginEntity, projectEntity, configPath) {
|
|
242972
|
+
const unsupportedFields = [
|
|
242973
|
+
projectEntity.title ? "title" : null,
|
|
242974
|
+
projectEntity.description ? "description" : null,
|
|
242975
|
+
projectEntity.rls ? "rls" : null
|
|
242976
|
+
].filter(Boolean);
|
|
242977
|
+
if (unsupportedFields.length > 0) {
|
|
242978
|
+
throw new ConfigInvalidError(`Project entity "${projectEntity.name}" extends a plugin entity and cannot override fields: ${unsupportedFields.join(", ")}.`, configPath);
|
|
242979
|
+
}
|
|
242980
|
+
const projectProperties = projectEntity.properties ?? {};
|
|
242981
|
+
const addedPropertyNames = new Set(Object.keys(projectProperties));
|
|
242982
|
+
for (const propertyName of addedPropertyNames) {
|
|
242983
|
+
if (propertyName in pluginEntity.properties) {
|
|
242984
|
+
throw new ConfigInvalidError(`Cannot override plugin-defined property "${propertyName}"`, configPath);
|
|
242985
|
+
}
|
|
242986
|
+
}
|
|
242987
|
+
for (const requiredProperty of projectEntity.required ?? []) {
|
|
242988
|
+
if (!addedPropertyNames.has(requiredProperty)) {
|
|
242989
|
+
throw new ConfigInvalidError(`Required property "${requiredProperty}" must be declared in project entity "${projectEntity.name}" properties`, configPath);
|
|
242990
|
+
}
|
|
242991
|
+
}
|
|
242992
|
+
const required2 = pluginEntity.required || projectEntity.required ? [
|
|
242993
|
+
...new Set([
|
|
242994
|
+
...pluginEntity.required ?? [],
|
|
242995
|
+
...projectEntity.required ?? []
|
|
242996
|
+
])
|
|
242997
|
+
] : undefined;
|
|
242998
|
+
return {
|
|
242999
|
+
...pluginEntity,
|
|
243000
|
+
properties: {
|
|
243001
|
+
...pluginEntity.properties,
|
|
243002
|
+
...projectProperties
|
|
243003
|
+
},
|
|
243004
|
+
...required2 ? { required: required2 } : {}
|
|
243005
|
+
};
|
|
243006
|
+
}
|
|
243007
|
+
function mergeProjectAndPluginEntities(projectEntities, pluginEntities, configPath) {
|
|
243008
|
+
const projectEntitiesByName = new Map(projectEntities.map((entity) => [entity.name, entity]));
|
|
243009
|
+
const pluginEntityNames = new Set(pluginEntities.map((entity) => entity.name));
|
|
243010
|
+
const resolvedPluginEntities = pluginEntities.map((pluginEntity) => {
|
|
243011
|
+
const projectEntity = projectEntitiesByName.get(pluginEntity.name);
|
|
243012
|
+
if (!projectEntity) {
|
|
243013
|
+
return pluginEntity;
|
|
243014
|
+
}
|
|
243015
|
+
return mergePluginEntity(pluginEntity, projectEntity, configPath);
|
|
243016
|
+
});
|
|
243017
|
+
const projectOnlyEntities = projectEntities.filter((entity) => !pluginEntityNames.has(entity.name));
|
|
243018
|
+
return [...resolvedPluginEntities, ...projectOnlyEntities];
|
|
243019
|
+
}
|
|
243020
|
+
|
|
242742
243021
|
// src/core/resources/function/schema.ts
|
|
242743
243022
|
var FunctionNameSchema = exports_external.string().trim().min(1, "Function name cannot be empty").regex(/^[^.]+$/, "Function name cannot contain dots");
|
|
242744
243023
|
var FunctionFileSchema = exports_external.object({
|
|
@@ -242836,7 +243115,8 @@ var FunctionConfigSchema = exports_external.object({
|
|
|
242836
243115
|
});
|
|
242837
243116
|
var BackendFunctionSchema = FunctionConfigSchema.extend({
|
|
242838
243117
|
entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
|
|
242839
|
-
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file")
|
|
243118
|
+
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file"),
|
|
243119
|
+
source: ResourceSourceSchema
|
|
242840
243120
|
});
|
|
242841
243121
|
var DeploySingleFunctionResponseSchema = exports_external.object({
|
|
242842
243122
|
status: exports_external.enum(["deployed", "unchanged"])
|
|
@@ -242941,7 +243221,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
242941
243221
|
return result.data;
|
|
242942
243222
|
}
|
|
242943
243223
|
// src/core/resources/function/config.ts
|
|
242944
|
-
import { basename as basename2, dirname as
|
|
243224
|
+
import { basename as basename2, dirname as dirname4, join as join7, relative } from "node:path";
|
|
242945
243225
|
async function readFunctionConfig(configPath) {
|
|
242946
243226
|
const parsed = await readJsonFile(configPath);
|
|
242947
243227
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -242952,8 +243232,8 @@ async function readFunctionConfig(configPath) {
|
|
|
242952
243232
|
}
|
|
242953
243233
|
async function readFunction(configPath) {
|
|
242954
243234
|
const config6 = await readFunctionConfig(configPath);
|
|
242955
|
-
const functionDir =
|
|
242956
|
-
const entryPath =
|
|
243235
|
+
const functionDir = dirname4(configPath);
|
|
243236
|
+
const entryPath = join7(functionDir, config6.entry);
|
|
242957
243237
|
if (!await pathExists(entryPath)) {
|
|
242958
243238
|
throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
|
|
242959
243239
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
@@ -242963,7 +243243,12 @@ async function readFunction(configPath) {
|
|
|
242963
243243
|
cwd: functionDir,
|
|
242964
243244
|
absolute: true
|
|
242965
243245
|
});
|
|
242966
|
-
const functionData = {
|
|
243246
|
+
const functionData = {
|
|
243247
|
+
...config6,
|
|
243248
|
+
entryPath,
|
|
243249
|
+
filePaths,
|
|
243250
|
+
source: { type: "project" }
|
|
243251
|
+
};
|
|
242967
243252
|
return functionData;
|
|
242968
243253
|
}
|
|
242969
243254
|
async function readAllFunctions(functionsDir) {
|
|
@@ -242979,11 +243264,11 @@ async function readAllFunctions(functionsDir) {
|
|
|
242979
243264
|
absolute: true,
|
|
242980
243265
|
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
242981
243266
|
});
|
|
242982
|
-
const configFilesDirs = new Set(configFiles.map((f) =>
|
|
242983
|
-
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(
|
|
243267
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
243268
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
|
|
242984
243269
|
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
242985
243270
|
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
242986
|
-
const functionDir =
|
|
243271
|
+
const functionDir = dirname4(entryFile);
|
|
242987
243272
|
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
242988
243273
|
cwd: functionDir,
|
|
242989
243274
|
absolute: true
|
|
@@ -242999,7 +243284,14 @@ async function readAllFunctions(functionsDir) {
|
|
|
242999
243284
|
});
|
|
243000
243285
|
}
|
|
243001
243286
|
const entry = basename2(entryFile);
|
|
243002
|
-
|
|
243287
|
+
const functionData = {
|
|
243288
|
+
name: name2,
|
|
243289
|
+
entry,
|
|
243290
|
+
entryPath: entryFile,
|
|
243291
|
+
filePaths,
|
|
243292
|
+
source: { type: "project" }
|
|
243293
|
+
};
|
|
243294
|
+
return functionData;
|
|
243003
243295
|
}));
|
|
243004
243296
|
const functions = [...functionsFromConfig, ...functionsWithoutConfig];
|
|
243005
243297
|
const names = new Set;
|
|
@@ -243018,9 +243310,9 @@ async function readAllFunctions(functionsDir) {
|
|
|
243018
243310
|
return functions;
|
|
243019
243311
|
}
|
|
243020
243312
|
// src/core/resources/function/deploy.ts
|
|
243021
|
-
import { dirname as
|
|
243313
|
+
import { dirname as dirname5, relative as relative2 } from "node:path";
|
|
243022
243314
|
async function loadFunctionCode(fn) {
|
|
243023
|
-
const functionDir =
|
|
243315
|
+
const functionDir = dirname5(fn.entryPath);
|
|
243024
243316
|
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
243025
243317
|
const content = await readTextFile(filePath);
|
|
243026
243318
|
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
@@ -243087,14 +243379,14 @@ async function pruneRemovedFunctions(localFunctionNames, options) {
|
|
|
243087
243379
|
return results;
|
|
243088
243380
|
}
|
|
243089
243381
|
// src/core/resources/function/pull.ts
|
|
243090
|
-
import { join as
|
|
243382
|
+
import { join as join8 } from "node:path";
|
|
243091
243383
|
import { isDeepStrictEqual as isDeepStrictEqual4 } from "node:util";
|
|
243092
243384
|
async function writeFunctions(functionsDir, functions) {
|
|
243093
243385
|
const written = [];
|
|
243094
243386
|
const skipped = [];
|
|
243095
243387
|
for (const fn of functions) {
|
|
243096
|
-
const functionDir =
|
|
243097
|
-
const configPath =
|
|
243388
|
+
const functionDir = join8(functionsDir, fn.name);
|
|
243389
|
+
const configPath = join8(functionDir, "function.jsonc");
|
|
243098
243390
|
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
243099
243391
|
skipped.push(fn.name);
|
|
243100
243392
|
continue;
|
|
@@ -243108,7 +243400,7 @@ async function writeFunctions(functionsDir, functions) {
|
|
|
243108
243400
|
}
|
|
243109
243401
|
await writeJsonFile(configPath, config6);
|
|
243110
243402
|
for (const file2 of fn.files) {
|
|
243111
|
-
await writeFile(
|
|
243403
|
+
await writeFile(join8(functionDir, file2.path), file2.content);
|
|
243112
243404
|
}
|
|
243113
243405
|
written.push(fn.name);
|
|
243114
243406
|
}
|
|
@@ -243118,7 +243410,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243118
243410
|
if (!await pathExists(functionDir)) {
|
|
243119
243411
|
return false;
|
|
243120
243412
|
}
|
|
243121
|
-
const configPath =
|
|
243413
|
+
const configPath = join8(functionDir, "function.jsonc");
|
|
243122
243414
|
try {
|
|
243123
243415
|
const localConfig = await readJsonFile(configPath);
|
|
243124
243416
|
if (localConfig.entry !== fn.entry) {
|
|
@@ -243131,7 +243423,7 @@ async function isFunctionUnchanged(functionDir, fn) {
|
|
|
243131
243423
|
return false;
|
|
243132
243424
|
}
|
|
243133
243425
|
for (const file2 of fn.files) {
|
|
243134
|
-
const filePath =
|
|
243426
|
+
const filePath = join8(functionDir, file2.path);
|
|
243135
243427
|
if (!await pathExists(filePath)) {
|
|
243136
243428
|
return false;
|
|
243137
243429
|
}
|
|
@@ -243152,13 +243444,6 @@ var functionResource = {
|
|
|
243152
243444
|
push: (functions) => deployFunctionsSequentially(functions)
|
|
243153
243445
|
};
|
|
243154
243446
|
// src/core/project/config.ts
|
|
243155
|
-
function resolvePluginRoot(pluginRef, fromRoot) {
|
|
243156
|
-
if (pluginRef.startsWith(".")) {
|
|
243157
|
-
return resolve(fromRoot, pluginRef);
|
|
243158
|
-
}
|
|
243159
|
-
const req = createRequire2(join8(fromRoot, "package.json"));
|
|
243160
|
-
return dirname5(req.resolve(`${pluginRef}/package.json`));
|
|
243161
|
-
}
|
|
243162
243447
|
async function findConfigInDir(dir) {
|
|
243163
243448
|
const files = await globby(PROJECT_CONFIG_PATTERNS, {
|
|
243164
243449
|
cwd: dir,
|
|
@@ -243168,56 +243453,141 @@ async function findConfigInDir(dir) {
|
|
|
243168
243453
|
}
|
|
243169
243454
|
async function findProjectRoot(startPath) {
|
|
243170
243455
|
let current = startPath || process.cwd();
|
|
243171
|
-
while (current !==
|
|
243456
|
+
while (current !== dirname6(current)) {
|
|
243172
243457
|
const configPath = await findConfigInDir(current);
|
|
243173
243458
|
if (configPath) {
|
|
243174
243459
|
return { root: current, configPath };
|
|
243175
243460
|
}
|
|
243176
|
-
current =
|
|
243461
|
+
current = dirname6(current);
|
|
243177
243462
|
}
|
|
243178
243463
|
return null;
|
|
243179
243464
|
}
|
|
243180
|
-
|
|
243181
|
-
|
|
243182
|
-
|
|
243183
|
-
|
|
243184
|
-
|
|
243185
|
-
|
|
243186
|
-
|
|
243465
|
+
|
|
243466
|
+
class ProjectConfigReader {
|
|
243467
|
+
pluginIds = new Set;
|
|
243468
|
+
async readProjectConfig(projectRoot) {
|
|
243469
|
+
const { root, configPath } = await this.findConfigOrThrow(projectRoot);
|
|
243470
|
+
const project = await this.readConfigFile(configPath);
|
|
243471
|
+
this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
|
|
243472
|
+
const localResources = await this.readProjectResources(configPath, project);
|
|
243473
|
+
const pluginResources = await this.readPlugins(project.plugins, root);
|
|
243474
|
+
const entities = mergeProjectAndPluginEntities(localResources.entities, pluginResources.entities, configPath);
|
|
243475
|
+
const functions = [
|
|
243476
|
+
...localResources.functions,
|
|
243477
|
+
...pluginResources.functions
|
|
243478
|
+
];
|
|
243479
|
+
return {
|
|
243480
|
+
project: { ...project, root, configPath },
|
|
243481
|
+
entities,
|
|
243482
|
+
functions,
|
|
243483
|
+
agents: localResources.agents,
|
|
243484
|
+
connectors: localResources.connectors,
|
|
243485
|
+
authConfig: localResources.authConfig
|
|
243486
|
+
};
|
|
243487
|
+
}
|
|
243488
|
+
async findConfigOrThrow(projectRoot) {
|
|
243489
|
+
let found;
|
|
243490
|
+
if (projectRoot) {
|
|
243491
|
+
const configPath = await findConfigInDir(projectRoot);
|
|
243492
|
+
found = configPath ? { root: projectRoot, configPath } : null;
|
|
243493
|
+
} else {
|
|
243494
|
+
found = await findProjectRoot();
|
|
243495
|
+
}
|
|
243496
|
+
if (!found) {
|
|
243497
|
+
throw new ConfigNotFoundError(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
|
|
243498
|
+
}
|
|
243499
|
+
return found;
|
|
243187
243500
|
}
|
|
243188
|
-
|
|
243189
|
-
|
|
243501
|
+
async readConfigFile(configPath) {
|
|
243502
|
+
const parsed = await readJsonFile(configPath);
|
|
243503
|
+
const result = ProjectConfigSchema.safeParse(parsed);
|
|
243504
|
+
if (!result.success) {
|
|
243505
|
+
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
243506
|
+
}
|
|
243507
|
+
return result.data;
|
|
243190
243508
|
}
|
|
243191
|
-
|
|
243192
|
-
|
|
243193
|
-
|
|
243194
|
-
|
|
243195
|
-
|
|
243196
|
-
|
|
243197
|
-
|
|
243198
|
-
|
|
243199
|
-
|
|
243200
|
-
|
|
243201
|
-
|
|
243202
|
-
|
|
243203
|
-
|
|
243204
|
-
|
|
243205
|
-
|
|
243206
|
-
|
|
243207
|
-
|
|
243208
|
-
|
|
243209
|
-
|
|
243210
|
-
|
|
243211
|
-
|
|
243509
|
+
async readProjectResources(configPath, project) {
|
|
243510
|
+
const configDir = dirname6(configPath);
|
|
243511
|
+
const [entities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243512
|
+
entityResource.readAll(join9(configDir, project.entitiesDir)),
|
|
243513
|
+
functionResource.readAll(join9(configDir, project.functionsDir)),
|
|
243514
|
+
agentResource.readAll(join9(configDir, project.agentsDir)),
|
|
243515
|
+
connectorResource.readAll(join9(configDir, project.connectorsDir)),
|
|
243516
|
+
authConfigResource.readAll(join9(configDir, project.authDir))
|
|
243517
|
+
]);
|
|
243518
|
+
return { entities, functions, agents, connectors, authConfig };
|
|
243519
|
+
}
|
|
243520
|
+
assertPluginProjectDoesNotLoadPlugins(project, configPath) {
|
|
243521
|
+
if (project.plugin && project.plugins.length > 0) {
|
|
243522
|
+
throw new ConfigInvalidError("Plugin projects cannot define plugins in this version.", configPath);
|
|
243523
|
+
}
|
|
243524
|
+
}
|
|
243525
|
+
registerPluginId(pluginId, configPath) {
|
|
243526
|
+
if (this.pluginIds.has(pluginId)) {
|
|
243527
|
+
throw new ConfigInvalidError(`Duplicate plugin id "${pluginId}" in project configuration`, configPath, {
|
|
243528
|
+
hints: [
|
|
243529
|
+
{
|
|
243530
|
+
message: "Remove the plugin or change plugin id"
|
|
243531
|
+
}
|
|
243532
|
+
]
|
|
243533
|
+
});
|
|
243534
|
+
}
|
|
243535
|
+
this.pluginIds.add(pluginId);
|
|
243536
|
+
}
|
|
243537
|
+
async readPluginConfig(plugin, hostRoot) {
|
|
243538
|
+
const pluginRoot = resolvePluginRoot(plugin.source, hostRoot);
|
|
243539
|
+
const { configPath } = await this.findConfigOrThrow(pluginRoot);
|
|
243540
|
+
const project = await this.readConfigFile(configPath);
|
|
243541
|
+
const pluginId = requirePluginId(project, plugin.source, configPath);
|
|
243542
|
+
this.assertPluginProjectDoesNotLoadPlugins(project, configPath);
|
|
243543
|
+
return { configPath, pluginId, project };
|
|
243544
|
+
}
|
|
243545
|
+
async readPluginResources(project, configPath, pluginId) {
|
|
243546
|
+
const resources = await this.readProjectResources(configPath, project);
|
|
243547
|
+
return {
|
|
243548
|
+
entities: markPluginEntities(resources.entities, pluginId),
|
|
243549
|
+
functions: namespacePluginFunctions(resources.functions, pluginId),
|
|
243550
|
+
agents: [],
|
|
243551
|
+
connectors: [],
|
|
243552
|
+
authConfig: []
|
|
243553
|
+
};
|
|
243554
|
+
}
|
|
243555
|
+
async readPlugins(plugins, projectRoot) {
|
|
243556
|
+
const entities = [];
|
|
243557
|
+
const functions = [];
|
|
243558
|
+
const entityNameByPluginId = new Map;
|
|
243559
|
+
for (const plugin of plugins) {
|
|
243560
|
+
const { configPath, pluginId, project } = await this.readPluginConfig(plugin, projectRoot);
|
|
243561
|
+
this.registerPluginId(pluginId, configPath);
|
|
243562
|
+
const pluginData = await this.readPluginResources(project, configPath, pluginId);
|
|
243563
|
+
for (const entity of pluginData.entities) {
|
|
243564
|
+
const existingPluginId = entityNameByPluginId.get(entity.name);
|
|
243565
|
+
if (existingPluginId) {
|
|
243566
|
+
throw new ConfigInvalidError(`Entity "${entity.name}" is defined by more than one plugin: "${existingPluginId}" and "${pluginId}".`, configPath, {
|
|
243567
|
+
hints: [
|
|
243568
|
+
{
|
|
243569
|
+
message: "Plugin entity names are not namespaced. Remove one plugin or rename one of the entities."
|
|
243570
|
+
}
|
|
243571
|
+
]
|
|
243572
|
+
});
|
|
243573
|
+
}
|
|
243574
|
+
entityNameByPluginId.set(entity.name, pluginId);
|
|
243575
|
+
}
|
|
243576
|
+
entities.push(...pluginData.entities);
|
|
243577
|
+
functions.push(...pluginData.functions);
|
|
243578
|
+
}
|
|
243579
|
+
return {
|
|
243580
|
+
entities,
|
|
243581
|
+
functions,
|
|
243582
|
+
agents: [],
|
|
243583
|
+
connectors: [],
|
|
243584
|
+
authConfig: []
|
|
243585
|
+
};
|
|
243212
243586
|
}
|
|
243213
|
-
|
|
243214
|
-
|
|
243215
|
-
|
|
243216
|
-
|
|
243217
|
-
agents,
|
|
243218
|
-
connectors,
|
|
243219
|
-
authConfig
|
|
243220
|
-
};
|
|
243587
|
+
}
|
|
243588
|
+
async function readProjectConfig(projectRoot) {
|
|
243589
|
+
const reader = new ProjectConfigReader;
|
|
243590
|
+
return await reader.readProjectConfig(projectRoot);
|
|
243221
243591
|
}
|
|
243222
243592
|
|
|
243223
243593
|
// src/core/project/app-config.ts
|
|
@@ -243394,12 +243764,12 @@ async function getSiteUrl(projectId) {
|
|
|
243394
243764
|
// src/core/project/template.ts
|
|
243395
243765
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
243396
243766
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
243397
|
-
import { dirname as
|
|
243767
|
+
import { dirname as dirname7, join as join11 } from "node:path";
|
|
243398
243768
|
|
|
243399
243769
|
// src/core/assets.ts
|
|
243400
243770
|
import { cpSync, existsSync } from "node:fs";
|
|
243401
243771
|
import { homedir as homedir2 } from "node:os";
|
|
243402
|
-
import { join as
|
|
243772
|
+
import { join as join10 } from "node:path";
|
|
243403
243773
|
// package.json
|
|
243404
243774
|
var package_default = {
|
|
243405
243775
|
name: "base44",
|
|
@@ -243498,18 +243868,18 @@ var package_default = {
|
|
|
243498
243868
|
};
|
|
243499
243869
|
|
|
243500
243870
|
// src/core/assets.ts
|
|
243501
|
-
var ASSETS_DIR =
|
|
243871
|
+
var ASSETS_DIR = join10(homedir2(), ".base44", "assets", package_default.version);
|
|
243502
243872
|
function getTemplatesDir() {
|
|
243503
|
-
return
|
|
243873
|
+
return join10(ASSETS_DIR, "templates");
|
|
243504
243874
|
}
|
|
243505
243875
|
function getTemplatesIndexPath() {
|
|
243506
|
-
return
|
|
243876
|
+
return join10(ASSETS_DIR, "templates", "templates.json");
|
|
243507
243877
|
}
|
|
243508
243878
|
function getDenoWrapperPath() {
|
|
243509
|
-
return
|
|
243879
|
+
return join10(ASSETS_DIR, "deno-runtime", "main.ts");
|
|
243510
243880
|
}
|
|
243511
243881
|
function getExecWrapperPath() {
|
|
243512
|
-
return
|
|
243882
|
+
return join10(ASSETS_DIR, "deno-runtime", "exec.ts");
|
|
243513
243883
|
}
|
|
243514
243884
|
function ensureNpmAssets(sourceDir) {
|
|
243515
243885
|
if (existsSync(ASSETS_DIR))
|
|
@@ -243530,23 +243900,23 @@ async function listTemplates() {
|
|
|
243530
243900
|
return result.data.templates;
|
|
243531
243901
|
}
|
|
243532
243902
|
async function renderTemplate(template, destPath, data) {
|
|
243533
|
-
const templateDir =
|
|
243903
|
+
const templateDir = join11(getTemplatesDir(), template.path);
|
|
243534
243904
|
const files = await globby("**/*", {
|
|
243535
243905
|
cwd: templateDir,
|
|
243536
243906
|
dot: true,
|
|
243537
243907
|
onlyFiles: true
|
|
243538
243908
|
});
|
|
243539
243909
|
for (const file2 of files) {
|
|
243540
|
-
const srcPath =
|
|
243910
|
+
const srcPath = join11(templateDir, file2);
|
|
243541
243911
|
try {
|
|
243542
243912
|
if (file2.endsWith(".ejs")) {
|
|
243543
243913
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
243544
243914
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
243545
|
-
const destFile = attributes.outputFileName ?
|
|
243546
|
-
const destFilePath =
|
|
243915
|
+
const destFile = attributes.outputFileName ? join11(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
243916
|
+
const destFilePath = join11(destPath, destFile);
|
|
243547
243917
|
await writeFile(destFilePath, body);
|
|
243548
243918
|
} else {
|
|
243549
|
-
const destFilePath =
|
|
243919
|
+
const destFilePath = join11(destPath, file2);
|
|
243550
243920
|
await copyFile(srcPath, destFilePath);
|
|
243551
243921
|
}
|
|
243552
243922
|
} catch (error48) {
|
|
@@ -243621,7 +243991,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
243621
243991
|
// src/core/site/deploy.ts
|
|
243622
243992
|
import { randomUUID } from "node:crypto";
|
|
243623
243993
|
import { tmpdir } from "node:os";
|
|
243624
|
-
import { join as
|
|
243994
|
+
import { join as join12 } from "node:path";
|
|
243625
243995
|
async function deploySite(siteOutputDir) {
|
|
243626
243996
|
if (!await pathExists(siteOutputDir)) {
|
|
243627
243997
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -243638,7 +244008,7 @@ async function deploySite(siteOutputDir) {
|
|
|
243638
244008
|
]
|
|
243639
244009
|
});
|
|
243640
244010
|
}
|
|
243641
|
-
const archivePath =
|
|
244011
|
+
const archivePath = join12(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
243642
244012
|
try {
|
|
243643
244013
|
await createArchive(siteOutputDir, archivePath);
|
|
243644
244014
|
return await uploadSite(archivePath);
|
|
@@ -250825,8 +251195,8 @@ async function pullAgentsAction({
|
|
|
250825
251195
|
runTask: runTask2
|
|
250826
251196
|
}) {
|
|
250827
251197
|
const { project: project2 } = await readProjectConfig();
|
|
250828
|
-
const configDir =
|
|
250829
|
-
const agentsDir =
|
|
251198
|
+
const configDir = dirname8(project2.configPath);
|
|
251199
|
+
const agentsDir = join13(configDir, project2.agentsDir);
|
|
250830
251200
|
const remoteAgents = await runTask2("Fetching agents from Base44", async () => {
|
|
250831
251201
|
return await fetchAgents();
|
|
250832
251202
|
}, {
|
|
@@ -250890,12 +251260,12 @@ function getAgentsCommand() {
|
|
|
250890
251260
|
}
|
|
250891
251261
|
|
|
250892
251262
|
// src/cli/commands/auth/password-login.ts
|
|
250893
|
-
import { dirname as
|
|
251263
|
+
import { dirname as dirname9, join as join14 } from "node:path";
|
|
250894
251264
|
async function passwordLoginAction({ log, runTask: runTask2 }, action) {
|
|
250895
251265
|
const shouldEnable = action === "enable";
|
|
250896
251266
|
const { project: project2 } = await readProjectConfig();
|
|
250897
|
-
const configDir =
|
|
250898
|
-
const authDir =
|
|
251267
|
+
const configDir = dirname9(project2.configPath);
|
|
251268
|
+
const authDir = join14(configDir, project2.authDir);
|
|
250899
251269
|
const updated = await runTask2("Updating local auth config", async () => {
|
|
250900
251270
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
250901
251271
|
const merged = { ...current, enableUsernamePassword: shouldEnable };
|
|
@@ -250915,14 +251285,14 @@ function getPasswordLoginCommand() {
|
|
|
250915
251285
|
}
|
|
250916
251286
|
|
|
250917
251287
|
// src/cli/commands/auth/pull.ts
|
|
250918
|
-
import { dirname as
|
|
251288
|
+
import { dirname as dirname10, join as join15 } from "node:path";
|
|
250919
251289
|
async function pullAuthAction({
|
|
250920
251290
|
log,
|
|
250921
251291
|
runTask: runTask2
|
|
250922
251292
|
}) {
|
|
250923
251293
|
const { project: project2 } = await readProjectConfig();
|
|
250924
|
-
const configDir =
|
|
250925
|
-
const authDir =
|
|
251294
|
+
const configDir = dirname10(project2.configPath);
|
|
251295
|
+
const authDir = join15(configDir, project2.authDir);
|
|
250926
251296
|
const remoteConfig = await runTask2("Fetching auth config from Base44", async () => {
|
|
250927
251297
|
return await pullAuthConfig();
|
|
250928
251298
|
}, {
|
|
@@ -250986,7 +251356,7 @@ function getAuthPushCommand() {
|
|
|
250986
251356
|
}
|
|
250987
251357
|
|
|
250988
251358
|
// src/cli/commands/auth/social-login.ts
|
|
250989
|
-
import { dirname as
|
|
251359
|
+
import { dirname as dirname11, join as join16, resolve as resolve3 } from "node:path";
|
|
250990
251360
|
var PROVIDER_LABELS = {
|
|
250991
251361
|
google: "Google",
|
|
250992
251362
|
microsoft: "Microsoft",
|
|
@@ -251056,8 +251426,8 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
251056
251426
|
}
|
|
251057
251427
|
}
|
|
251058
251428
|
const { project: project2 } = await readProjectConfig();
|
|
251059
|
-
const configDir =
|
|
251060
|
-
const authDir =
|
|
251429
|
+
const configDir = dirname11(project2.configPath);
|
|
251430
|
+
const authDir = join16(configDir, project2.authDir);
|
|
251061
251431
|
const { config: updated } = await runTask2("Updating local auth config", async () => updateSocialLoginConfig(authDir, provider, shouldEnable, useCustomOAuth && options.clientId ? { clientId: options.clientId } : undefined));
|
|
251062
251432
|
if (clientSecret) {
|
|
251063
251433
|
await runTask2("Saving client secret", async () => pushCustomOAuthSecret(provider, clientSecret));
|
|
@@ -251081,9 +251451,213 @@ function getSocialLoginCommand() {
|
|
|
251081
251451
|
])).option("--client-id <id>", "custom OAuth client ID (Google only)").option("--client-secret <secret>", "custom OAuth client secret (Google only)").option("--client-secret-stdin", "read client secret from stdin (Google only)").option("--env-file <path>", "read client secret from a .env file (Google only)").action(socialLoginAction);
|
|
251082
251452
|
}
|
|
251083
251453
|
|
|
251454
|
+
// src/cli/commands/auth/sso.ts
|
|
251455
|
+
import { dirname as dirname12, join as join17, resolve as resolve4 } from "node:path";
|
|
251456
|
+
var SSOConfigFileSchema = exports_external.object({
|
|
251457
|
+
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251458
|
+
clientId: exports_external.string(),
|
|
251459
|
+
clientSecret: exports_external.string(),
|
|
251460
|
+
scope: exports_external.string().optional(),
|
|
251461
|
+
discoveryUrl: exports_external.string().optional(),
|
|
251462
|
+
tenantId: exports_external.string().optional(),
|
|
251463
|
+
oktaDomain: exports_external.string().optional(),
|
|
251464
|
+
authEndpoint: exports_external.string().optional(),
|
|
251465
|
+
tokenEndpoint: exports_external.string().optional(),
|
|
251466
|
+
userinfoEndpoint: exports_external.string().optional(),
|
|
251467
|
+
jwksUri: exports_external.string().optional(),
|
|
251468
|
+
ssoName: exports_external.string().optional()
|
|
251469
|
+
});
|
|
251470
|
+
async function loadSSOConfigFile(filePath) {
|
|
251471
|
+
const resolved = resolve4(filePath);
|
|
251472
|
+
const raw2 = await readJsonFile(resolved);
|
|
251473
|
+
const result = SSOConfigFileSchema.safeParse(raw2);
|
|
251474
|
+
if (!result.success) {
|
|
251475
|
+
throw new SchemaValidationError("Invalid SSO config file", result.error, filePath);
|
|
251476
|
+
}
|
|
251477
|
+
return result.data;
|
|
251478
|
+
}
|
|
251479
|
+
function mergeFileWithFlags(fileConfig, options) {
|
|
251480
|
+
return {
|
|
251481
|
+
provider: options.provider ?? fileConfig.provider,
|
|
251482
|
+
clientId: options.clientId ?? fileConfig.clientId,
|
|
251483
|
+
clientSecret: options.clientSecret ?? fileConfig.clientSecret,
|
|
251484
|
+
clientSecretStdin: options.clientSecretStdin,
|
|
251485
|
+
envFile: options.envFile,
|
|
251486
|
+
scope: options.scope ?? fileConfig.scope,
|
|
251487
|
+
discoveryUrl: options.discoveryUrl ?? fileConfig.discoveryUrl,
|
|
251488
|
+
tenantId: options.tenantId ?? fileConfig.tenantId,
|
|
251489
|
+
oktaDomain: options.oktaDomain ?? fileConfig.oktaDomain,
|
|
251490
|
+
authEndpoint: options.authEndpoint ?? fileConfig.authEndpoint,
|
|
251491
|
+
tokenEndpoint: options.tokenEndpoint ?? fileConfig.tokenEndpoint,
|
|
251492
|
+
userinfoEndpoint: options.userinfoEndpoint ?? fileConfig.userinfoEndpoint,
|
|
251493
|
+
jwksUri: options.jwksUri ?? fileConfig.jwksUri,
|
|
251494
|
+
ssoName: options.ssoName ?? fileConfig.ssoName
|
|
251495
|
+
};
|
|
251496
|
+
}
|
|
251497
|
+
var providerNames = Object.keys(KNOWN_SSO_PROVIDERS);
|
|
251498
|
+
var SECRET_KEY_TO_FLAG = {
|
|
251499
|
+
["sso_name" /* Name */]: "--sso-name",
|
|
251500
|
+
["sso_client_id" /* ClientId */]: "--client-id",
|
|
251501
|
+
["sso_client_secret" /* ClientSecret */]: "--client-secret",
|
|
251502
|
+
["sso_scope" /* Scope */]: "--scope",
|
|
251503
|
+
["sso_discovery_url" /* DiscoveryUrl */]: "--discovery-url",
|
|
251504
|
+
["sso_tenant_id" /* TenantId */]: "--tenant-id",
|
|
251505
|
+
["sso_auth_endpoint" /* AuthEndpoint */]: "--auth-endpoint",
|
|
251506
|
+
["sso_token_endpoint" /* TokenEndpoint */]: "--token-endpoint",
|
|
251507
|
+
["sso_userinfo_endpoint" /* UserinfoEndpoint */]: "--userinfo-endpoint",
|
|
251508
|
+
["sso_okta_domain" /* OktaDomain */]: "--okta-domain",
|
|
251509
|
+
["sso_jwks_uri" /* JwksUri */]: "--jwks-uri"
|
|
251510
|
+
};
|
|
251511
|
+
function secretKeyToFlag(key) {
|
|
251512
|
+
return SECRET_KEY_TO_FLAG[key];
|
|
251513
|
+
}
|
|
251514
|
+
function exampleCommand(provider) {
|
|
251515
|
+
let cmd = `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`;
|
|
251516
|
+
if (provider === KNOWN_SSO_PROVIDERS.microsoft)
|
|
251517
|
+
cmd += " --tenant-id <id>";
|
|
251518
|
+
if (provider === KNOWN_SSO_PROVIDERS.okta)
|
|
251519
|
+
cmd += " --okta-domain <domain>";
|
|
251520
|
+
if (provider === KNOWN_SSO_PROVIDERS.custom)
|
|
251521
|
+
cmd += " --sso-name <name> --auth-endpoint <url> --token-endpoint <url> --userinfo-endpoint <url> --jwks-uri <url>";
|
|
251522
|
+
return cmd;
|
|
251523
|
+
}
|
|
251524
|
+
function validateProvider(provider) {
|
|
251525
|
+
if (!provider) {
|
|
251526
|
+
throw new InvalidInputError("Missing --provider.", {
|
|
251527
|
+
hints: [
|
|
251528
|
+
{
|
|
251529
|
+
message: `Valid providers: ${providerNames.join(", ")}`,
|
|
251530
|
+
command: "base44 auth sso enable --provider <provider> --client-id <id> --client-secret <secret>"
|
|
251531
|
+
}
|
|
251532
|
+
]
|
|
251533
|
+
});
|
|
251534
|
+
}
|
|
251535
|
+
return provider;
|
|
251536
|
+
}
|
|
251537
|
+
async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options) {
|
|
251538
|
+
if (options.file && options.envFile) {
|
|
251539
|
+
throw new InvalidInputError("--file and --env-file cannot be used together. Provide the client secret either inside --file or via --env-file.");
|
|
251540
|
+
}
|
|
251541
|
+
let merged = options;
|
|
251542
|
+
if (options.file) {
|
|
251543
|
+
const fileConfig = await loadSSOConfigFile(options.file);
|
|
251544
|
+
merged = mergeFileWithFlags(fileConfig, options);
|
|
251545
|
+
}
|
|
251546
|
+
const provider = validateProvider(merged.provider);
|
|
251547
|
+
if (!merged.clientId) {
|
|
251548
|
+
throw new InvalidInputError("Missing --client-id.", {
|
|
251549
|
+
hints: [
|
|
251550
|
+
{
|
|
251551
|
+
message: `Example: base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`,
|
|
251552
|
+
command: `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`
|
|
251553
|
+
}
|
|
251554
|
+
]
|
|
251555
|
+
});
|
|
251556
|
+
}
|
|
251557
|
+
let clientSecret;
|
|
251558
|
+
if (merged.envFile && !merged.clientSecret) {
|
|
251559
|
+
const secrets2 = await parseEnvFile(resolve4(merged.envFile));
|
|
251560
|
+
const value = secrets2.sso_client_secret;
|
|
251561
|
+
if (!value) {
|
|
251562
|
+
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
251563
|
+
}
|
|
251564
|
+
clientSecret = value;
|
|
251565
|
+
} else {
|
|
251566
|
+
clientSecret = await resolveSecret({
|
|
251567
|
+
flagValue: merged.clientSecret,
|
|
251568
|
+
fromStdin: merged.clientSecretStdin,
|
|
251569
|
+
envVar: "sso_client_secret",
|
|
251570
|
+
promptMessage: "Enter SSO client secret",
|
|
251571
|
+
isNonInteractive,
|
|
251572
|
+
name: "client secret",
|
|
251573
|
+
hints: [
|
|
251574
|
+
{
|
|
251575
|
+
message: `Provide via flag: base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`,
|
|
251576
|
+
command: `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`
|
|
251577
|
+
},
|
|
251578
|
+
{
|
|
251579
|
+
message: `Provide via stdin: echo <secret> | base44 auth sso enable --provider ${provider} --client-id <id> --client-secret-stdin`
|
|
251580
|
+
},
|
|
251581
|
+
{
|
|
251582
|
+
message: `Provide via env: sso_client_secret=<secret> base44 auth sso enable --provider ${provider} --client-id <id>`
|
|
251583
|
+
}
|
|
251584
|
+
]
|
|
251585
|
+
});
|
|
251586
|
+
}
|
|
251587
|
+
const secretOptions = {
|
|
251588
|
+
clientId: merged.clientId,
|
|
251589
|
+
clientSecret,
|
|
251590
|
+
scope: merged.scope,
|
|
251591
|
+
discoveryUrl: merged.discoveryUrl,
|
|
251592
|
+
tenantId: merged.tenantId,
|
|
251593
|
+
oktaDomain: merged.oktaDomain,
|
|
251594
|
+
authEndpoint: merged.authEndpoint,
|
|
251595
|
+
tokenEndpoint: merged.tokenEndpoint,
|
|
251596
|
+
userinfoEndpoint: merged.userinfoEndpoint,
|
|
251597
|
+
jwksUri: merged.jwksUri,
|
|
251598
|
+
ssoName: merged.ssoName
|
|
251599
|
+
};
|
|
251600
|
+
let secrets;
|
|
251601
|
+
try {
|
|
251602
|
+
secrets = buildSSOSecrets(provider, secretOptions);
|
|
251603
|
+
} catch (error48) {
|
|
251604
|
+
if (error48 instanceof MissingSSOFieldsError) {
|
|
251605
|
+
const flagNames = error48.missingKeys.map(secretKeyToFlag);
|
|
251606
|
+
throw new InvalidInputError(`Missing required fields for ${error48.provider}: ${flagNames.join(", ")}`, {
|
|
251607
|
+
hints: [
|
|
251608
|
+
{
|
|
251609
|
+
message: `Example: ${exampleCommand(provider)}`,
|
|
251610
|
+
command: exampleCommand(provider)
|
|
251611
|
+
}
|
|
251612
|
+
]
|
|
251613
|
+
});
|
|
251614
|
+
}
|
|
251615
|
+
throw error48;
|
|
251616
|
+
}
|
|
251617
|
+
const { project: project2 } = await readProjectConfig();
|
|
251618
|
+
const configDir = dirname12(project2.configPath);
|
|
251619
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251620
|
+
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251621
|
+
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
251622
|
+
return {
|
|
251623
|
+
outroMessage: `SSO configured with ${provider} in local config. Run \`base44 auth push\` or \`base44 deploy\` to apply.`
|
|
251624
|
+
};
|
|
251625
|
+
}
|
|
251626
|
+
function hasEnableOnlyOptions(options) {
|
|
251627
|
+
return Boolean(options.provider || options.clientId || options.clientSecret || options.clientSecretStdin || options.envFile || options.file || options.scope || options.discoveryUrl || options.tenantId || options.oktaDomain || options.authEndpoint || options.tokenEndpoint || options.userinfoEndpoint || options.jwksUri || options.ssoName);
|
|
251628
|
+
}
|
|
251629
|
+
async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
251630
|
+
if (hasEnableOnlyOptions(options)) {
|
|
251631
|
+
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251632
|
+
}
|
|
251633
|
+
const { project: project2 } = await readProjectConfig();
|
|
251634
|
+
const configDir = dirname12(project2.configPath);
|
|
251635
|
+
const authDir = join17(configDir, project2.authDir);
|
|
251636
|
+
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251637
|
+
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
251638
|
+
if (!hasAnyLoginMethod(updated)) {
|
|
251639
|
+
log.warn("Disabling SSO will leave no login methods enabled. Users will be locked out.");
|
|
251640
|
+
}
|
|
251641
|
+
return {
|
|
251642
|
+
outroMessage: "SSO disabled in local config and credentials removed. Run `base44 auth push` or `base44 deploy` to apply."
|
|
251643
|
+
};
|
|
251644
|
+
}
|
|
251645
|
+
async function ssoAction(context, action, options) {
|
|
251646
|
+
if (action === "disable") {
|
|
251647
|
+
return ssoDisableAction(context, options);
|
|
251648
|
+
}
|
|
251649
|
+
return ssoEnableAction(context, options);
|
|
251650
|
+
}
|
|
251651
|
+
function getSSOCommand() {
|
|
251652
|
+
return new Base44Command("sso").description("Configure SSO identity provider (google, microsoft, github, okta, custom). SSO and social login are mutually exclusive — enabling one disables the other in the local auth config.").addArgument(new Argument("<action>", "enable or disable SSO").choices([
|
|
251653
|
+
"enable",
|
|
251654
|
+
"disable"
|
|
251655
|
+
])).addOption(new Option("--provider <provider>", "SSO provider").choices(Object.values(KNOWN_SSO_PROVIDERS))).option("--client-id <id>", "OAuth client ID").option("--client-secret <secret>", "OAuth client secret").option("--client-secret-stdin", "Read client secret from stdin").option("--env-file <path>", "Read client secret from a .env file (key: sso_client_secret)").option("--file <path>", "JSON config file with all SSO settings").option("--scope <scope>", "OAuth scope (defaults per provider)").option("--discovery-url <url>", "OIDC discovery URL").option("--tenant-id <id>", "Microsoft tenant ID (required for microsoft)").option("--okta-domain <domain>", "Okta domain (required for okta)").option("--auth-endpoint <url>", "Authorization endpoint (required for custom)").option("--token-endpoint <url>", "Token endpoint (required for custom)").option("--userinfo-endpoint <url>", "Userinfo endpoint (required for custom)").option("--jwks-uri <url>", "JWKS URI (required for custom)").option("--sso-name <name>", "Provider display name (required for custom)").action(ssoAction);
|
|
251656
|
+
}
|
|
251657
|
+
|
|
251084
251658
|
// src/cli/commands/auth/index.ts
|
|
251085
251659
|
function getAuthCommand() {
|
|
251086
|
-
return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getSocialLoginCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
|
|
251660
|
+
return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getSocialLoginCommand()).addCommand(getSSOCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
|
|
251087
251661
|
}
|
|
251088
251662
|
|
|
251089
251663
|
// src/cli/commands/auth/login.ts
|
|
@@ -251145,14 +251719,14 @@ function getConnectorsListAvailableCommand() {
|
|
|
251145
251719
|
}
|
|
251146
251720
|
|
|
251147
251721
|
// src/cli/commands/connectors/pull.ts
|
|
251148
|
-
import { dirname as
|
|
251722
|
+
import { dirname as dirname13, join as join18 } from "node:path";
|
|
251149
251723
|
async function pullConnectorsAction({
|
|
251150
251724
|
log,
|
|
251151
251725
|
runTask: runTask2
|
|
251152
251726
|
}) {
|
|
251153
251727
|
const { project: project2 } = await readProjectConfig();
|
|
251154
|
-
const configDir =
|
|
251155
|
-
const connectorsDir =
|
|
251728
|
+
const configDir = dirname13(project2.configPath);
|
|
251729
|
+
const connectorsDir = join18(configDir, project2.connectorsDir);
|
|
251156
251730
|
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
251157
251731
|
return await pullAllConnectors();
|
|
251158
251732
|
}, {
|
|
@@ -251681,19 +252255,19 @@ var baseOpen = async (options) => {
|
|
|
251681
252255
|
}
|
|
251682
252256
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
251683
252257
|
if (options.wait) {
|
|
251684
|
-
return new Promise((
|
|
252258
|
+
return new Promise((resolve5, reject) => {
|
|
251685
252259
|
subprocess.once("error", reject);
|
|
251686
252260
|
subprocess.once("close", (exitCode) => {
|
|
251687
252261
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
251688
252262
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
251689
252263
|
return;
|
|
251690
252264
|
}
|
|
251691
|
-
|
|
252265
|
+
resolve5(subprocess);
|
|
251692
252266
|
});
|
|
251693
252267
|
});
|
|
251694
252268
|
}
|
|
251695
252269
|
if (isFallbackAttempt) {
|
|
251696
|
-
return new Promise((
|
|
252270
|
+
return new Promise((resolve5, reject) => {
|
|
251697
252271
|
subprocess.once("error", reject);
|
|
251698
252272
|
subprocess.once("spawn", () => {
|
|
251699
252273
|
subprocess.once("close", (exitCode) => {
|
|
@@ -251703,17 +252277,17 @@ var baseOpen = async (options) => {
|
|
|
251703
252277
|
return;
|
|
251704
252278
|
}
|
|
251705
252279
|
subprocess.unref();
|
|
251706
|
-
|
|
252280
|
+
resolve5(subprocess);
|
|
251707
252281
|
});
|
|
251708
252282
|
});
|
|
251709
252283
|
});
|
|
251710
252284
|
}
|
|
251711
252285
|
subprocess.unref();
|
|
251712
|
-
return new Promise((
|
|
252286
|
+
return new Promise((resolve5, reject) => {
|
|
251713
252287
|
subprocess.once("error", reject);
|
|
251714
252288
|
subprocess.once("spawn", () => {
|
|
251715
252289
|
subprocess.off("error", reject);
|
|
251716
|
-
|
|
252290
|
+
resolve5(subprocess);
|
|
251717
252291
|
});
|
|
251718
252292
|
});
|
|
251719
252293
|
};
|
|
@@ -252156,6 +252730,11 @@ async function deployFunctionsAction({ log }, names, options) {
|
|
|
252156
252730
|
formatDeployResult(result, log);
|
|
252157
252731
|
}
|
|
252158
252732
|
});
|
|
252733
|
+
const hasFailures = results.some((r) => r.status === "error");
|
|
252734
|
+
if (hasFailures) {
|
|
252735
|
+
log.message(buildDeploySummary(results));
|
|
252736
|
+
throw new CLIExitError(1);
|
|
252737
|
+
}
|
|
252159
252738
|
if (options.force) {
|
|
252160
252739
|
const allLocalNames = functions.map((f) => f.name);
|
|
252161
252740
|
let pruneCompleted = 0;
|
|
@@ -252207,25 +252786,38 @@ function getListCommand() {
|
|
|
252207
252786
|
}
|
|
252208
252787
|
|
|
252209
252788
|
// src/cli/commands/functions/pull.ts
|
|
252210
|
-
import { dirname as
|
|
252789
|
+
import { dirname as dirname14, join as join19 } from "node:path";
|
|
252211
252790
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
252212
|
-
const { project: project2 } = await readProjectConfig();
|
|
252213
|
-
const configDir =
|
|
252214
|
-
const functionsDir =
|
|
252791
|
+
const { project: project2, functions } = await readProjectConfig();
|
|
252792
|
+
const configDir = dirname14(project2.configPath);
|
|
252793
|
+
const functionsDir = join19(configDir, project2.functionsDir);
|
|
252794
|
+
const pluginFunctionNames = new Set(functions.filter((fn) => fn.source.type === "plugin").map((fn) => fn.name));
|
|
252215
252795
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
252216
|
-
const { functions } = await listDeployedFunctions();
|
|
252217
|
-
return
|
|
252796
|
+
const { functions: functions2 } = await listDeployedFunctions();
|
|
252797
|
+
return functions2;
|
|
252218
252798
|
}, {
|
|
252219
252799
|
successMessage: "Functions fetched successfully",
|
|
252220
252800
|
errorMessage: "Failed to fetch functions"
|
|
252221
252801
|
});
|
|
252222
|
-
const
|
|
252223
|
-
if (name2 &&
|
|
252802
|
+
const matchingRemote = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
|
|
252803
|
+
if (name2 && pluginFunctionNames.has(name2)) {
|
|
252804
|
+
return {
|
|
252805
|
+
outroMessage: `Function "${name2}" is managed by a plugin and was not pulled into ${functionsDir}`
|
|
252806
|
+
};
|
|
252807
|
+
}
|
|
252808
|
+
if (name2 && matchingRemote.length === 0) {
|
|
252224
252809
|
return {
|
|
252225
252810
|
outroMessage: `Function "${name2}" not found on remote`
|
|
252226
252811
|
};
|
|
252227
252812
|
}
|
|
252813
|
+
const skippedPluginOwned = matchingRemote.filter((fn) => pluginFunctionNames.has(fn.name));
|
|
252814
|
+
const toPull = matchingRemote.filter((fn) => !pluginFunctionNames.has(fn.name));
|
|
252228
252815
|
if (toPull.length === 0) {
|
|
252816
|
+
if (skippedPluginOwned.length > 0) {
|
|
252817
|
+
return {
|
|
252818
|
+
outroMessage: `Skipped ${skippedPluginOwned.length} plugin-owned function${skippedPluginOwned.length !== 1 ? "s" : ""}; no project-owned functions to pull`
|
|
252819
|
+
};
|
|
252820
|
+
}
|
|
252229
252821
|
return { outroMessage: "No functions found on remote" };
|
|
252230
252822
|
}
|
|
252231
252823
|
const { written, skipped } = await runTask2("Writing function files", async () => {
|
|
@@ -252240,8 +252832,11 @@ async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
|
252240
252832
|
for (const name3 of skipped) {
|
|
252241
252833
|
log.info(`${name3.padEnd(25)} unchanged`);
|
|
252242
252834
|
}
|
|
252835
|
+
for (const fn of skippedPluginOwned) {
|
|
252836
|
+
log.info(`${fn.name.padEnd(25)} plugin-owned, skipped`);
|
|
252837
|
+
}
|
|
252243
252838
|
return {
|
|
252244
|
-
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
252839
|
+
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}${skippedPluginOwned.length > 0 ? `; skipped ${skippedPluginOwned.length} plugin-owned` : ""}`
|
|
252245
252840
|
};
|
|
252246
252841
|
}
|
|
252247
252842
|
function getPullCommand() {
|
|
@@ -252254,7 +252849,7 @@ function getFunctionsCommand() {
|
|
|
252254
252849
|
}
|
|
252255
252850
|
|
|
252256
252851
|
// src/cli/commands/project/create.ts
|
|
252257
|
-
import { basename as basename3, join as
|
|
252852
|
+
import { basename as basename3, join as join20, resolve as resolve5 } from "node:path";
|
|
252258
252853
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
252259
252854
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
252260
252855
|
async function getTemplateById(templateId) {
|
|
@@ -252319,7 +252914,7 @@ async function createInteractive(options, ctx) {
|
|
|
252319
252914
|
}, ctx);
|
|
252320
252915
|
}
|
|
252321
252916
|
async function createNonInteractive(options, ctx) {
|
|
252322
|
-
ctx.log.info(`Creating a new project at ${
|
|
252917
|
+
ctx.log.info(`Creating a new project at ${resolve5(options.path)}`);
|
|
252323
252918
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
252324
252919
|
return await executeCreate({
|
|
252325
252920
|
template: template2,
|
|
@@ -252340,7 +252935,7 @@ async function executeCreate({
|
|
|
252340
252935
|
isInteractive
|
|
252341
252936
|
}, { log, runTask: runTask2 }) {
|
|
252342
252937
|
const name2 = rawName.trim();
|
|
252343
|
-
const resolvedPath =
|
|
252938
|
+
const resolvedPath = resolve5(projectPath);
|
|
252344
252939
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
252345
252940
|
return await createProjectFiles({
|
|
252346
252941
|
name: name2,
|
|
@@ -252391,7 +252986,7 @@ async function executeCreate({
|
|
|
252391
252986
|
updateMessage("Building project...");
|
|
252392
252987
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
252393
252988
|
updateMessage("Deploying site...");
|
|
252394
|
-
return await deploySite(
|
|
252989
|
+
return await deploySite(join20(resolvedPath, outputDirectory));
|
|
252395
252990
|
}, {
|
|
252396
252991
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
252397
252992
|
errorMessage: "Failed to deploy site"
|
|
@@ -252856,7 +253451,7 @@ function getSecretsListCommand() {
|
|
|
252856
253451
|
}
|
|
252857
253452
|
|
|
252858
253453
|
// src/cli/commands/secrets/set.ts
|
|
252859
|
-
import { resolve as
|
|
253454
|
+
import { resolve as resolve6 } from "node:path";
|
|
252860
253455
|
function parseEntries(entries) {
|
|
252861
253456
|
const secrets = {};
|
|
252862
253457
|
for (const entry of entries) {
|
|
@@ -252887,7 +253482,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
252887
253482
|
validateInput(entries, options);
|
|
252888
253483
|
let secrets;
|
|
252889
253484
|
if (options.envFile) {
|
|
252890
|
-
secrets = await parseEnvFile(
|
|
253485
|
+
secrets = await parseEnvFile(resolve6(options.envFile));
|
|
252891
253486
|
if (Object.keys(secrets).length === 0) {
|
|
252892
253487
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
252893
253488
|
}
|
|
@@ -252916,7 +253511,7 @@ function getSecretsCommand() {
|
|
|
252916
253511
|
}
|
|
252917
253512
|
|
|
252918
253513
|
// src/cli/commands/site/deploy.ts
|
|
252919
|
-
import { resolve as
|
|
253514
|
+
import { resolve as resolve7 } from "node:path";
|
|
252920
253515
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
252921
253516
|
if (isNonInteractive && !options.yes) {
|
|
252922
253517
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -252931,7 +253526,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
252931
253526
|
]
|
|
252932
253527
|
});
|
|
252933
253528
|
}
|
|
252934
|
-
const outputDir =
|
|
253529
|
+
const outputDir = resolve7(project2.root, project2.site.outputDirectory);
|
|
252935
253530
|
if (!options.yes) {
|
|
252936
253531
|
const shouldDeploy = await Re({
|
|
252937
253532
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253057,10 +253652,10 @@ function toPascalCase(name2) {
|
|
|
253057
253652
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
253058
253653
|
}
|
|
253059
253654
|
// src/core/types/update-project.ts
|
|
253060
|
-
import { join as
|
|
253655
|
+
import { join as join23 } from "node:path";
|
|
253061
253656
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
253062
253657
|
async function updateProjectConfig(projectRoot) {
|
|
253063
|
-
const tsconfigPath =
|
|
253658
|
+
const tsconfigPath = join23(projectRoot, "tsconfig.json");
|
|
253064
253659
|
if (!await pathExists(tsconfigPath)) {
|
|
253065
253660
|
return false;
|
|
253066
253661
|
}
|
|
@@ -253108,7 +253703,7 @@ import process21 from "node:process";
|
|
|
253108
253703
|
// src/cli/dev/dev-server/main.ts
|
|
253109
253704
|
var import_cors = __toESM(require_lib4(), 1);
|
|
253110
253705
|
var import_express6 = __toESM(require_express(), 1);
|
|
253111
|
-
import { dirname as
|
|
253706
|
+
import { dirname as dirname19, join as join26 } from "node:path";
|
|
253112
253707
|
|
|
253113
253708
|
// ../../node_modules/get-port/index.js
|
|
253114
253709
|
import net from "node:net";
|
|
@@ -253135,14 +253730,14 @@ var getLocalHosts = () => {
|
|
|
253135
253730
|
}
|
|
253136
253731
|
return results;
|
|
253137
253732
|
};
|
|
253138
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253733
|
+
var checkAvailablePort = (options8) => new Promise((resolve9, reject) => {
|
|
253139
253734
|
const server = net.createServer();
|
|
253140
253735
|
server.unref();
|
|
253141
253736
|
server.on("error", reject);
|
|
253142
253737
|
server.listen(options8, () => {
|
|
253143
253738
|
const { port } = server.address();
|
|
253144
253739
|
server.close(() => {
|
|
253145
|
-
|
|
253740
|
+
resolve9(port);
|
|
253146
253741
|
});
|
|
253147
253742
|
});
|
|
253148
253743
|
});
|
|
@@ -253402,7 +253997,7 @@ class FunctionManager {
|
|
|
253402
253997
|
});
|
|
253403
253998
|
}
|
|
253404
253999
|
waitForReady(name2, runningFunc) {
|
|
253405
|
-
return new Promise((
|
|
254000
|
+
return new Promise((resolve9, reject) => {
|
|
253406
254001
|
runningFunc.process.on("exit", (code2) => {
|
|
253407
254002
|
if (!runningFunc.ready) {
|
|
253408
254003
|
clearTimeout(timeout3);
|
|
@@ -253425,7 +254020,7 @@ class FunctionManager {
|
|
|
253425
254020
|
runningFunc.ready = true;
|
|
253426
254021
|
clearTimeout(timeout3);
|
|
253427
254022
|
runningFunc.process.stdout?.off("data", onData);
|
|
253428
|
-
|
|
254023
|
+
resolve9(runningFunc.port);
|
|
253429
254024
|
}
|
|
253430
254025
|
};
|
|
253431
254026
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -253726,7 +254321,8 @@ class Database {
|
|
|
253726
254321
|
return {
|
|
253727
254322
|
name: "User",
|
|
253728
254323
|
type: "object",
|
|
253729
|
-
properties: { ...builtInFields, role: { type: "string" } }
|
|
254324
|
+
properties: { ...builtInFields, role: { type: "string" } },
|
|
254325
|
+
source: { type: "project" }
|
|
253730
254326
|
};
|
|
253731
254327
|
}
|
|
253732
254328
|
for (const field of Object.keys(builtInFields)) {
|
|
@@ -255346,9 +255942,9 @@ class NodeFsHandler {
|
|
|
255346
255942
|
if (this.fsw.closed) {
|
|
255347
255943
|
return;
|
|
255348
255944
|
}
|
|
255349
|
-
const
|
|
255945
|
+
const dirname18 = sp2.dirname(file2);
|
|
255350
255946
|
const basename5 = sp2.basename(file2);
|
|
255351
|
-
const parent = this.fsw._getWatchedDir(
|
|
255947
|
+
const parent = this.fsw._getWatchedDir(dirname18);
|
|
255352
255948
|
let prevStats = stats;
|
|
255353
255949
|
if (parent.has(basename5))
|
|
255354
255950
|
return;
|
|
@@ -255375,7 +255971,7 @@ class NodeFsHandler {
|
|
|
255375
255971
|
prevStats = newStats2;
|
|
255376
255972
|
}
|
|
255377
255973
|
} catch (error48) {
|
|
255378
|
-
this.fsw._remove(
|
|
255974
|
+
this.fsw._remove(dirname18, basename5);
|
|
255379
255975
|
}
|
|
255380
255976
|
} else if (parent.has(basename5)) {
|
|
255381
255977
|
const at13 = newStats.atimeMs;
|
|
@@ -255464,7 +256060,7 @@ class NodeFsHandler {
|
|
|
255464
256060
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
255465
256061
|
}
|
|
255466
256062
|
}).on(EV.ERROR, this._boundHandleError);
|
|
255467
|
-
return new Promise((
|
|
256063
|
+
return new Promise((resolve10, reject) => {
|
|
255468
256064
|
if (!stream)
|
|
255469
256065
|
return reject();
|
|
255470
256066
|
stream.once(STR_END, () => {
|
|
@@ -255473,7 +256069,7 @@ class NodeFsHandler {
|
|
|
255473
256069
|
return;
|
|
255474
256070
|
}
|
|
255475
256071
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
255476
|
-
|
|
256072
|
+
resolve10(undefined);
|
|
255477
256073
|
previous.getChildren().filter((item) => {
|
|
255478
256074
|
return item !== directory && !current.has(item);
|
|
255479
256075
|
}).forEach((item) => {
|
|
@@ -256384,7 +256980,7 @@ async function createDevServer(options8) {
|
|
|
256384
256980
|
}
|
|
256385
256981
|
remoteProxy(req, res, next);
|
|
256386
256982
|
});
|
|
256387
|
-
const server = await new Promise((
|
|
256983
|
+
const server = await new Promise((resolve11, reject) => {
|
|
256388
256984
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
256389
256985
|
if (err) {
|
|
256390
256986
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -256393,7 +256989,7 @@ async function createDevServer(options8) {
|
|
|
256393
256989
|
reject(err);
|
|
256394
256990
|
}
|
|
256395
256991
|
} else {
|
|
256396
|
-
|
|
256992
|
+
resolve11(s5);
|
|
256397
256993
|
}
|
|
256398
256994
|
});
|
|
256399
256995
|
});
|
|
@@ -256402,8 +256998,8 @@ async function createDevServer(options8) {
|
|
|
256402
256998
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
256403
256999
|
};
|
|
256404
257000
|
const base44ConfigWatcher = new WatchBase44({
|
|
256405
|
-
functions:
|
|
256406
|
-
entities:
|
|
257001
|
+
functions: join26(dirname19(project2.configPath), project2.functionsDir),
|
|
257002
|
+
entities: join26(dirname19(project2.configPath), project2.entitiesDir)
|
|
256407
257003
|
}, devLogger);
|
|
256408
257004
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
256409
257005
|
try {
|
|
@@ -256510,13 +257106,13 @@ async function runScript(options8) {
|
|
|
256510
257106
|
}
|
|
256511
257107
|
// src/cli/commands/exec.ts
|
|
256512
257108
|
function readStdin2() {
|
|
256513
|
-
return new Promise((
|
|
257109
|
+
return new Promise((resolve11, reject) => {
|
|
256514
257110
|
let data = "";
|
|
256515
257111
|
process.stdin.setEncoding("utf-8");
|
|
256516
257112
|
process.stdin.on("data", (chunk) => {
|
|
256517
257113
|
data += chunk;
|
|
256518
257114
|
});
|
|
256519
|
-
process.stdin.on("end", () =>
|
|
257115
|
+
process.stdin.on("end", () => resolve11(data));
|
|
256520
257116
|
process.stdin.on("error", reject);
|
|
256521
257117
|
});
|
|
256522
257118
|
}
|
|
@@ -256555,7 +257151,7 @@ Examples:
|
|
|
256555
257151
|
}
|
|
256556
257152
|
|
|
256557
257153
|
// src/cli/commands/project/eject.ts
|
|
256558
|
-
import { resolve as
|
|
257154
|
+
import { resolve as resolve11 } from "node:path";
|
|
256559
257155
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
256560
257156
|
async function eject(ctx, options8) {
|
|
256561
257157
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -256611,7 +257207,7 @@ async function eject(ctx, options8) {
|
|
|
256611
257207
|
Ne("Operation cancelled.");
|
|
256612
257208
|
throw new CLIExitError(0);
|
|
256613
257209
|
}
|
|
256614
|
-
const resolvedPath =
|
|
257210
|
+
const resolvedPath = resolve11(selectedPath);
|
|
256615
257211
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
256616
257212
|
await createProjectFilesForExistingProject({
|
|
256617
257213
|
projectId,
|
|
@@ -256692,7 +257288,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
256692
257288
|
import { release, type } from "node:os";
|
|
256693
257289
|
|
|
256694
257290
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
256695
|
-
import { dirname as
|
|
257291
|
+
import { dirname as dirname20, posix, sep } from "path";
|
|
256696
257292
|
function createModulerModifier() {
|
|
256697
257293
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
256698
257294
|
return async (frames) => {
|
|
@@ -256701,7 +257297,7 @@ function createModulerModifier() {
|
|
|
256701
257297
|
return frames;
|
|
256702
257298
|
};
|
|
256703
257299
|
}
|
|
256704
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
257300
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname20(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
256705
257301
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
256706
257302
|
return (filename) => {
|
|
256707
257303
|
if (!filename)
|
|
@@ -258979,14 +259575,14 @@ async function addSourceContext(frames) {
|
|
|
258979
259575
|
return frames;
|
|
258980
259576
|
}
|
|
258981
259577
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
258982
|
-
return new Promise((
|
|
259578
|
+
return new Promise((resolve12) => {
|
|
258983
259579
|
const stream = createReadStream2(path19);
|
|
258984
259580
|
const lineReaded = createInterface2({
|
|
258985
259581
|
input: stream
|
|
258986
259582
|
});
|
|
258987
259583
|
function destroyStreamAndResolve() {
|
|
258988
259584
|
stream.destroy();
|
|
258989
|
-
|
|
259585
|
+
resolve12();
|
|
258990
259586
|
}
|
|
258991
259587
|
let lineNumber = 0;
|
|
258992
259588
|
let currentRangeIndex = 0;
|
|
@@ -260098,15 +260694,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260098
260694
|
return true;
|
|
260099
260695
|
if (this.featureFlagsPoller === undefined)
|
|
260100
260696
|
return false;
|
|
260101
|
-
return new Promise((
|
|
260697
|
+
return new Promise((resolve12) => {
|
|
260102
260698
|
const timeout3 = setTimeout(() => {
|
|
260103
260699
|
cleanup();
|
|
260104
|
-
|
|
260700
|
+
resolve12(false);
|
|
260105
260701
|
}, timeoutMs);
|
|
260106
260702
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260107
260703
|
clearTimeout(timeout3);
|
|
260108
260704
|
cleanup();
|
|
260109
|
-
|
|
260705
|
+
resolve12(count2 > 0);
|
|
260110
260706
|
});
|
|
260111
260707
|
});
|
|
260112
260708
|
}
|
|
@@ -260890,9 +261486,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
260890
261486
|
});
|
|
260891
261487
|
}
|
|
260892
261488
|
// src/cli/index.ts
|
|
260893
|
-
var __dirname4 =
|
|
261489
|
+
var __dirname4 = dirname21(fileURLToPath6(import.meta.url));
|
|
260894
261490
|
async function runCLI(options8) {
|
|
260895
|
-
ensureNpmAssets(
|
|
261491
|
+
ensureNpmAssets(join27(__dirname4, "../assets"));
|
|
260896
261492
|
const errorReporter = new ErrorReporter;
|
|
260897
261493
|
errorReporter.registerProcessErrorHandlers();
|
|
260898
261494
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -260929,4 +261525,4 @@ export {
|
|
|
260929
261525
|
CLIExitError
|
|
260930
261526
|
};
|
|
260931
261527
|
|
|
260932
|
-
//# debugId=
|
|
261528
|
+
//# debugId=6F53421EFB4CBB2764756E2164756E21
|