@base44-preview/cli 0.0.51-pr.481.a2befc3 → 0.0.51-pr.484.222fc2f
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 +517 -139
- package/dist/cli/index.js.map +16 -6
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -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" ? join20(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 join20(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: join20,
|
|
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" ? join22(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 join22(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: join22,
|
|
133963
133963
|
line: line3,
|
|
133964
133964
|
softline: softline2,
|
|
133965
133965
|
hardline: hardline4,
|
|
@@ -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(resolve8) {
|
|
134618
|
+
resolve8(value);
|
|
134619
134619
|
});
|
|
134620
134620
|
}
|
|
134621
|
-
return new (P9 || (P9 = Promise))(function(
|
|
134621
|
+
return new (P9 || (P9 = Promise))(function(resolve8, 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 ? resolve8(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 = resolve8;
|
|
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 resolve8(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 resolve8(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((resolve8, 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
|
+
resolve8({
|
|
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(resolve8) {
|
|
141492
|
+
resolve8(value);
|
|
141493
141493
|
});
|
|
141494
141494
|
}
|
|
141495
|
-
return new (P9 || (P9 = Promise))(function(
|
|
141495
|
+
return new (P9 || (P9 = Promise))(function(resolve8, 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 ? resolve8(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(resolve8) {
|
|
141633
|
+
resolve8(value);
|
|
141634
141634
|
});
|
|
141635
141635
|
}
|
|
141636
|
-
return new (P9 || (P9 = Promise))(function(
|
|
141636
|
+
return new (P9 || (P9 = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
141653
141653
|
}
|
|
141654
141654
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
141655
141655
|
});
|
|
@@ -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(resolve8, reject) {
|
|
147278
147278
|
readStream(stream, encoding, length, limit, function onRead2(err, buf) {
|
|
147279
147279
|
if (err)
|
|
147280
147280
|
return reject(err);
|
|
147281
|
-
|
|
147281
|
+
resolve8(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 dirname16 = path18.dirname;
|
|
160403
160403
|
var basename4 = path18.basename;
|
|
160404
160404
|
var extname2 = path18.extname;
|
|
160405
|
-
var
|
|
160406
|
-
var
|
|
160405
|
+
var join23 = path18.join;
|
|
160406
|
+
var resolve8 = 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 = resolve8(root2, name2);
|
|
160441
|
+
var dir = dirname16(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 resolve9(dir, file2) {
|
|
160466
160466
|
var ext = this.ext;
|
|
160467
|
-
var path19 =
|
|
160467
|
+
var path19 = join23(dir, file2);
|
|
160468
160468
|
var stat2 = tryStat(path19);
|
|
160469
160469
|
if (stat2 && stat2.isFile()) {
|
|
160470
160470
|
return path19;
|
|
160471
160471
|
}
|
|
160472
|
-
path19 =
|
|
160472
|
+
path19 = join23(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 resolve8 = __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", resolve8("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 join23 = path18.join;
|
|
164168
164168
|
var normalize2 = path18.normalize;
|
|
164169
|
-
var
|
|
164169
|
+
var resolve8 = 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 ? resolve8(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(join23(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 = resolve8(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 = join23(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 resolve8 = 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 ? resolve8(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 resolve8 = __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 = resolve8(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((resolve8) => {
|
|
168539
|
+
this._triggerBuffer = resolve8;
|
|
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((resolve8, 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
|
+
resolve8();
|
|
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((resolve8, 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
|
+
resolve8({ data, indexes });
|
|
169791
169791
|
});
|
|
169792
169792
|
lineStream.on("error", function(err) {
|
|
169793
169793
|
reject(err, null);
|
|
@@ -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((resolve8, 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 resolve8(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((resolve8, reject) => {
|
|
195596
195596
|
args.push((arg1, arg2) => {
|
|
195597
195597
|
if (withErr) {
|
|
195598
|
-
return arg1 ? reject(arg1) :
|
|
195598
|
+
return arg1 ? reject(arg1) : resolve8(arg2);
|
|
195599
195599
|
} else {
|
|
195600
|
-
return
|
|
195600
|
+
return resolve8(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((resolve8, 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 resolve8(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((resolve8, 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: resolve8,
|
|
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((resolve8, 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: resolve8,
|
|
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((resolve8) => {
|
|
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
|
+
resolve8();
|
|
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 join23(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 resolve8 = iter[kLastResolve];
|
|
215918
|
+
if (resolve8 !== 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
|
+
resolve8(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(resolve8, reject) {
|
|
215933
215933
|
lastPromise.then(function() {
|
|
215934
215934
|
if (iter[kEnded]) {
|
|
215935
|
-
|
|
215935
|
+
resolve8(createIterResult(undefined, true));
|
|
215936
215936
|
return;
|
|
215937
215937
|
}
|
|
215938
|
-
iter[kHandlePromise](
|
|
215938
|
+
iter[kHandlePromise](resolve8, 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(resolve8, reject) {
|
|
215958
215958
|
process.nextTick(function() {
|
|
215959
215959
|
if (_this[kError]) {
|
|
215960
215960
|
reject(_this[kError]);
|
|
215961
215961
|
} else {
|
|
215962
|
-
|
|
215962
|
+
resolve8(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(resolve8, reject) {
|
|
215986
215986
|
_this2[kStream].destroy(null, function(err) {
|
|
215987
215987
|
if (err) {
|
|
215988
215988
|
reject(err);
|
|
215989
215989
|
return;
|
|
215990
215990
|
}
|
|
215991
|
-
|
|
215991
|
+
resolve8(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(resolve8, 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
|
+
resolve8(createIterResult(data, false));
|
|
216020
216020
|
} else {
|
|
216021
|
-
iterator[kLastResolve] =
|
|
216021
|
+
iterator[kLastResolve] = resolve8;
|
|
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 resolve8 = iterator[kLastResolve];
|
|
216041
|
+
if (resolve8 !== null) {
|
|
216042
216042
|
iterator[kLastPromise] = null;
|
|
216043
216043
|
iterator[kLastResolve] = null;
|
|
216044
216044
|
iterator[kLastReject] = null;
|
|
216045
|
-
|
|
216045
|
+
resolve8(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, resolve8, 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
|
+
resolve8(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(resolve8, reject) {
|
|
216075
216075
|
var gen = fn9.apply(self2, args);
|
|
216076
216076
|
function _next(value) {
|
|
216077
|
-
asyncGeneratorStep(gen,
|
|
216077
|
+
asyncGeneratorStep(gen, resolve8, reject, _next, _throw, "next", value);
|
|
216078
216078
|
}
|
|
216079
216079
|
function _throw(err) {
|
|
216080
|
-
asyncGeneratorStep(gen,
|
|
216080
|
+
asyncGeneratorStep(gen, resolve8, 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 dirname20, join as join26 } from "node:path";
|
|
218274
218274
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
218275
218275
|
|
|
218276
218276
|
// ../../node_modules/@clack/core/dist/index.mjs
|
|
@@ -241974,7 +241974,11 @@ async function updateSocialLoginConfig(authDir, provider, enable, customOAuth) {
|
|
|
241974
241974
|
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
241975
241975
|
const merged = {
|
|
241976
241976
|
...current,
|
|
241977
|
-
[providerInfo.field]: enable
|
|
241977
|
+
[providerInfo.field]: enable,
|
|
241978
|
+
...enable && {
|
|
241979
|
+
enableSSOLogin: false,
|
|
241980
|
+
ssoProviderName: null
|
|
241981
|
+
}
|
|
241978
241982
|
};
|
|
241979
241983
|
if (providerInfo.customOAuth) {
|
|
241980
241984
|
const oauth = providerInfo.customOAuth;
|
|
@@ -241998,6 +242002,192 @@ async function pushCustomOAuthSecret(provider, clientSecret) {
|
|
|
241998
242002
|
[providerInfo.customOAuth.secretKey]: clientSecret
|
|
241999
242003
|
});
|
|
242000
242004
|
}
|
|
242005
|
+
// src/core/resources/auth-config/sso/secret-keys.ts
|
|
242006
|
+
var SSOSecretKey;
|
|
242007
|
+
((SSOSecretKey2) => {
|
|
242008
|
+
SSOSecretKey2["Name"] = "sso_name";
|
|
242009
|
+
SSOSecretKey2["ClientId"] = "sso_client_id";
|
|
242010
|
+
SSOSecretKey2["ClientSecret"] = "sso_client_secret";
|
|
242011
|
+
SSOSecretKey2["Scope"] = "sso_scope";
|
|
242012
|
+
SSOSecretKey2["DiscoveryUrl"] = "sso_discovery_url";
|
|
242013
|
+
SSOSecretKey2["TenantId"] = "sso_tenant_id";
|
|
242014
|
+
SSOSecretKey2["AuthEndpoint"] = "sso_auth_endpoint";
|
|
242015
|
+
SSOSecretKey2["TokenEndpoint"] = "sso_token_endpoint";
|
|
242016
|
+
SSOSecretKey2["UserinfoEndpoint"] = "sso_userinfo_endpoint";
|
|
242017
|
+
SSOSecretKey2["OktaDomain"] = "sso_okta_domain";
|
|
242018
|
+
SSOSecretKey2["JwksUri"] = "sso_jwks_uri";
|
|
242019
|
+
})(SSOSecretKey ||= {});
|
|
242020
|
+
var ALL_SSO_SECRET_KEYS = Object.values(SSOSecretKey);
|
|
242021
|
+
var DEFAULT_OIDC_SCOPE = "openid email profile";
|
|
242022
|
+
var DEFAULT_GITHUB_SCOPE = "user:email";
|
|
242023
|
+
|
|
242024
|
+
// src/core/resources/auth-config/sso/providers/custom.ts
|
|
242025
|
+
var customProvider = {
|
|
242026
|
+
requiredKeys: [
|
|
242027
|
+
"sso_auth_endpoint" /* AuthEndpoint */,
|
|
242028
|
+
"sso_token_endpoint" /* TokenEndpoint */,
|
|
242029
|
+
"sso_userinfo_endpoint" /* UserinfoEndpoint */,
|
|
242030
|
+
"sso_jwks_uri" /* JwksUri */
|
|
242031
|
+
],
|
|
242032
|
+
defaults: {
|
|
242033
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
|
|
242034
|
+
}
|
|
242035
|
+
};
|
|
242036
|
+
|
|
242037
|
+
// src/core/resources/auth-config/sso/providers/github.ts
|
|
242038
|
+
var githubProvider = {
|
|
242039
|
+
requiredKeys: [],
|
|
242040
|
+
defaults: {
|
|
242041
|
+
["sso_scope" /* Scope */]: DEFAULT_GITHUB_SCOPE,
|
|
242042
|
+
["sso_auth_endpoint" /* AuthEndpoint */]: "https://github.com/login/oauth/authorize",
|
|
242043
|
+
["sso_token_endpoint" /* TokenEndpoint */]: "https://github.com/login/oauth/access_token",
|
|
242044
|
+
["sso_userinfo_endpoint" /* UserinfoEndpoint */]: "https://api.github.com/user"
|
|
242045
|
+
}
|
|
242046
|
+
};
|
|
242047
|
+
|
|
242048
|
+
// src/core/resources/auth-config/sso/providers/google.ts
|
|
242049
|
+
var googleProvider = {
|
|
242050
|
+
requiredKeys: [],
|
|
242051
|
+
defaults: {
|
|
242052
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE,
|
|
242053
|
+
["sso_discovery_url" /* DiscoveryUrl */]: "https://accounts.google.com/.well-known/openid-configuration"
|
|
242054
|
+
}
|
|
242055
|
+
};
|
|
242056
|
+
|
|
242057
|
+
// src/core/resources/auth-config/sso/providers/microsoft.ts
|
|
242058
|
+
var microsoftProvider = {
|
|
242059
|
+
requiredKeys: ["sso_tenant_id" /* TenantId */],
|
|
242060
|
+
defaults: {
|
|
242061
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
|
|
242062
|
+
},
|
|
242063
|
+
deriveDefaults: (secrets) => {
|
|
242064
|
+
const tenantId = secrets["sso_tenant_id" /* TenantId */];
|
|
242065
|
+
if (tenantId) {
|
|
242066
|
+
return {
|
|
242067
|
+
["sso_discovery_url" /* DiscoveryUrl */]: `https://login.microsoftonline.com/${tenantId}/v2.0/.well-known/openid-configuration`
|
|
242068
|
+
};
|
|
242069
|
+
}
|
|
242070
|
+
return {};
|
|
242071
|
+
}
|
|
242072
|
+
};
|
|
242073
|
+
|
|
242074
|
+
// src/core/resources/auth-config/sso/providers/okta.ts
|
|
242075
|
+
var oktaProvider = {
|
|
242076
|
+
requiredKeys: ["sso_okta_domain" /* OktaDomain */],
|
|
242077
|
+
defaults: {
|
|
242078
|
+
["sso_scope" /* Scope */]: DEFAULT_OIDC_SCOPE
|
|
242079
|
+
},
|
|
242080
|
+
deriveDefaults: (secrets) => {
|
|
242081
|
+
const domain2 = secrets["sso_okta_domain" /* OktaDomain */];
|
|
242082
|
+
if (domain2) {
|
|
242083
|
+
return {
|
|
242084
|
+
["sso_discovery_url" /* DiscoveryUrl */]: `https://${domain2}/.well-known/openid-configuration`
|
|
242085
|
+
};
|
|
242086
|
+
}
|
|
242087
|
+
return {};
|
|
242088
|
+
}
|
|
242089
|
+
};
|
|
242090
|
+
|
|
242091
|
+
// src/core/resources/auth-config/sso/providers/index.ts
|
|
242092
|
+
var SSO_PROVIDER_SCHEMAS = {
|
|
242093
|
+
google: googleProvider,
|
|
242094
|
+
microsoft: microsoftProvider,
|
|
242095
|
+
github: githubProvider,
|
|
242096
|
+
okta: oktaProvider,
|
|
242097
|
+
custom: customProvider
|
|
242098
|
+
};
|
|
242099
|
+
|
|
242100
|
+
// src/core/resources/auth-config/sso/types.ts
|
|
242101
|
+
var KNOWN_SSO_PROVIDERS = {
|
|
242102
|
+
google: "google",
|
|
242103
|
+
microsoft: "microsoft",
|
|
242104
|
+
github: "github",
|
|
242105
|
+
okta: "okta",
|
|
242106
|
+
custom: "custom"
|
|
242107
|
+
};
|
|
242108
|
+
|
|
242109
|
+
// src/core/resources/auth-config/sso/operations.ts
|
|
242110
|
+
var OPTION_TO_SECRET_KEY = {
|
|
242111
|
+
scope: "sso_scope" /* Scope */,
|
|
242112
|
+
discoveryUrl: "sso_discovery_url" /* DiscoveryUrl */,
|
|
242113
|
+
tenantId: "sso_tenant_id" /* TenantId */,
|
|
242114
|
+
oktaDomain: "sso_okta_domain" /* OktaDomain */,
|
|
242115
|
+
authEndpoint: "sso_auth_endpoint" /* AuthEndpoint */,
|
|
242116
|
+
tokenEndpoint: "sso_token_endpoint" /* TokenEndpoint */,
|
|
242117
|
+
userinfoEndpoint: "sso_userinfo_endpoint" /* UserinfoEndpoint */,
|
|
242118
|
+
jwksUri: "sso_jwks_uri" /* JwksUri */
|
|
242119
|
+
};
|
|
242120
|
+
async function updateSSOConfig(authDir, provider, enable) {
|
|
242121
|
+
const current = await readAuthConfig(authDir) ?? DEFAULT_AUTH_CONFIG;
|
|
242122
|
+
const merged = {
|
|
242123
|
+
...current,
|
|
242124
|
+
enableSSOLogin: enable,
|
|
242125
|
+
ssoProviderName: enable && provider ? provider : null,
|
|
242126
|
+
...enable && {
|
|
242127
|
+
enableGoogleLogin: false,
|
|
242128
|
+
enableMicrosoftLogin: false,
|
|
242129
|
+
enableFacebookLogin: false,
|
|
242130
|
+
enableAppleLogin: false
|
|
242131
|
+
}
|
|
242132
|
+
};
|
|
242133
|
+
await writeAuthConfig(authDir, merged);
|
|
242134
|
+
return merged;
|
|
242135
|
+
}
|
|
242136
|
+
|
|
242137
|
+
class MissingSSOFieldsError extends InvalidInputError {
|
|
242138
|
+
missingKeys;
|
|
242139
|
+
provider;
|
|
242140
|
+
constructor(provider, missingKeys) {
|
|
242141
|
+
super(`Missing required fields for ${provider}: ${missingKeys.join(", ")}`);
|
|
242142
|
+
this.provider = provider;
|
|
242143
|
+
this.missingKeys = missingKeys;
|
|
242144
|
+
}
|
|
242145
|
+
}
|
|
242146
|
+
function buildSSOSecrets(provider, options) {
|
|
242147
|
+
const schema3 = SSO_PROVIDER_SCHEMAS[provider];
|
|
242148
|
+
const secrets = {};
|
|
242149
|
+
secrets["sso_name" /* Name */] = options.ssoName ?? provider;
|
|
242150
|
+
secrets["sso_client_id" /* ClientId */] = options.clientId;
|
|
242151
|
+
secrets["sso_client_secret" /* ClientSecret */] = options.clientSecret;
|
|
242152
|
+
for (const [optionKey, secretKey] of Object.entries(OPTION_TO_SECRET_KEY)) {
|
|
242153
|
+
const value = options[optionKey];
|
|
242154
|
+
if (typeof value === "string" && value.length > 0) {
|
|
242155
|
+
secrets[secretKey] = value;
|
|
242156
|
+
}
|
|
242157
|
+
}
|
|
242158
|
+
if (schema3.deriveDefaults) {
|
|
242159
|
+
const derived = schema3.deriveDefaults(secrets);
|
|
242160
|
+
for (const [key, val] of Object.entries(derived)) {
|
|
242161
|
+
if (!secrets[key]) {
|
|
242162
|
+
secrets[key] = val;
|
|
242163
|
+
}
|
|
242164
|
+
}
|
|
242165
|
+
}
|
|
242166
|
+
for (const [key, val] of Object.entries(schema3.defaults)) {
|
|
242167
|
+
if (!secrets[key]) {
|
|
242168
|
+
secrets[key] = val;
|
|
242169
|
+
}
|
|
242170
|
+
}
|
|
242171
|
+
const missing = [];
|
|
242172
|
+
for (const key of schema3.requiredKeys) {
|
|
242173
|
+
if (!secrets[key]) {
|
|
242174
|
+
missing.push(key);
|
|
242175
|
+
}
|
|
242176
|
+
}
|
|
242177
|
+
if (provider === KNOWN_SSO_PROVIDERS.custom && !options.ssoName) {
|
|
242178
|
+
missing.push("sso_name" /* Name */);
|
|
242179
|
+
}
|
|
242180
|
+
if (missing.length > 0) {
|
|
242181
|
+
throw new MissingSSOFieldsError(provider, missing);
|
|
242182
|
+
}
|
|
242183
|
+
return Object.fromEntries(Object.entries(secrets).filter(([, v]) => v.length > 0));
|
|
242184
|
+
}
|
|
242185
|
+
async function pushSSOSecrets(secrets) {
|
|
242186
|
+
await setSecrets(secrets);
|
|
242187
|
+
}
|
|
242188
|
+
async function deleteSSOSecrets() {
|
|
242189
|
+
await Promise.allSettled(ALL_SSO_SECRET_KEYS.map((key) => deleteSecret(key)));
|
|
242190
|
+
}
|
|
242001
242191
|
// src/core/resources/connector/schema.ts
|
|
242002
242192
|
var GoogleCalendarConnectorSchema = exports_external.object({
|
|
242003
242193
|
type: exports_external.literal("googlecalendar"),
|
|
@@ -251036,9 +251226,197 @@ function getSocialLoginCommand() {
|
|
|
251036
251226
|
])).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);
|
|
251037
251227
|
}
|
|
251038
251228
|
|
|
251229
|
+
// src/cli/commands/auth/sso.ts
|
|
251230
|
+
import { dirname as dirname11, join as join16, resolve as resolve3 } from "node:path";
|
|
251231
|
+
var SSOConfigFileSchema = exports_external.object({
|
|
251232
|
+
provider: exports_external.enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
251233
|
+
clientId: exports_external.string(),
|
|
251234
|
+
clientSecret: exports_external.string(),
|
|
251235
|
+
scope: exports_external.string().optional(),
|
|
251236
|
+
discoveryUrl: exports_external.string().optional(),
|
|
251237
|
+
tenantId: exports_external.string().optional(),
|
|
251238
|
+
oktaDomain: exports_external.string().optional(),
|
|
251239
|
+
authEndpoint: exports_external.string().optional(),
|
|
251240
|
+
tokenEndpoint: exports_external.string().optional(),
|
|
251241
|
+
userinfoEndpoint: exports_external.string().optional(),
|
|
251242
|
+
jwksUri: exports_external.string().optional(),
|
|
251243
|
+
ssoName: exports_external.string().optional()
|
|
251244
|
+
});
|
|
251245
|
+
async function loadSSOConfigFile(filePath) {
|
|
251246
|
+
const resolved = resolve3(filePath);
|
|
251247
|
+
const raw2 = await readJsonFile(resolved);
|
|
251248
|
+
const result = SSOConfigFileSchema.safeParse(raw2);
|
|
251249
|
+
if (!result.success) {
|
|
251250
|
+
throw new SchemaValidationError("Invalid SSO config file", result.error, filePath);
|
|
251251
|
+
}
|
|
251252
|
+
return result.data;
|
|
251253
|
+
}
|
|
251254
|
+
function mergeFileWithFlags(fileConfig, options) {
|
|
251255
|
+
return {
|
|
251256
|
+
provider: options.provider ?? fileConfig.provider,
|
|
251257
|
+
clientId: options.clientId ?? fileConfig.clientId,
|
|
251258
|
+
clientSecret: options.clientSecret ?? fileConfig.clientSecret,
|
|
251259
|
+
clientSecretStdin: options.clientSecretStdin,
|
|
251260
|
+
envFile: options.envFile,
|
|
251261
|
+
scope: options.scope ?? fileConfig.scope,
|
|
251262
|
+
discoveryUrl: options.discoveryUrl ?? fileConfig.discoveryUrl,
|
|
251263
|
+
tenantId: options.tenantId ?? fileConfig.tenantId,
|
|
251264
|
+
oktaDomain: options.oktaDomain ?? fileConfig.oktaDomain,
|
|
251265
|
+
authEndpoint: options.authEndpoint ?? fileConfig.authEndpoint,
|
|
251266
|
+
tokenEndpoint: options.tokenEndpoint ?? fileConfig.tokenEndpoint,
|
|
251267
|
+
userinfoEndpoint: options.userinfoEndpoint ?? fileConfig.userinfoEndpoint,
|
|
251268
|
+
jwksUri: options.jwksUri ?? fileConfig.jwksUri,
|
|
251269
|
+
ssoName: options.ssoName ?? fileConfig.ssoName
|
|
251270
|
+
};
|
|
251271
|
+
}
|
|
251272
|
+
var providerNames = Object.keys(KNOWN_SSO_PROVIDERS);
|
|
251273
|
+
function secretKeyToFlag(key) {
|
|
251274
|
+
return `--${key.replace(/^sso_/, "").replace(/_/g, "-")}`;
|
|
251275
|
+
}
|
|
251276
|
+
function exampleCommand(provider) {
|
|
251277
|
+
let cmd = `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`;
|
|
251278
|
+
if (provider === KNOWN_SSO_PROVIDERS.microsoft)
|
|
251279
|
+
cmd += " --tenant-id <id>";
|
|
251280
|
+
if (provider === KNOWN_SSO_PROVIDERS.okta)
|
|
251281
|
+
cmd += " --okta-domain <domain>";
|
|
251282
|
+
if (provider === KNOWN_SSO_PROVIDERS.custom)
|
|
251283
|
+
cmd += " --sso-name <name> --auth-endpoint <url> --token-endpoint <url> --userinfo-endpoint <url> --jwks-uri <url>";
|
|
251284
|
+
return cmd;
|
|
251285
|
+
}
|
|
251286
|
+
function validateProvider(provider) {
|
|
251287
|
+
if (!provider) {
|
|
251288
|
+
throw new InvalidInputError("Missing --provider.", {
|
|
251289
|
+
hints: [
|
|
251290
|
+
{
|
|
251291
|
+
message: `Valid providers: ${providerNames.join(", ")}`,
|
|
251292
|
+
command: "base44 auth sso enable --provider <provider> --client-id <id> --client-secret <secret>"
|
|
251293
|
+
}
|
|
251294
|
+
]
|
|
251295
|
+
});
|
|
251296
|
+
}
|
|
251297
|
+
return provider;
|
|
251298
|
+
}
|
|
251299
|
+
async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options) {
|
|
251300
|
+
let merged = options;
|
|
251301
|
+
if (options.file) {
|
|
251302
|
+
const fileConfig = await loadSSOConfigFile(options.file);
|
|
251303
|
+
merged = mergeFileWithFlags(fileConfig, options);
|
|
251304
|
+
}
|
|
251305
|
+
const provider = validateProvider(merged.provider);
|
|
251306
|
+
if (!merged.clientId) {
|
|
251307
|
+
throw new InvalidInputError("Missing --client-id.", {
|
|
251308
|
+
hints: [
|
|
251309
|
+
{
|
|
251310
|
+
message: `Example: base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`,
|
|
251311
|
+
command: `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`
|
|
251312
|
+
}
|
|
251313
|
+
]
|
|
251314
|
+
});
|
|
251315
|
+
}
|
|
251316
|
+
let clientSecret;
|
|
251317
|
+
if (merged.envFile && !merged.clientSecret) {
|
|
251318
|
+
const secrets2 = await parseEnvFile(resolve3(merged.envFile));
|
|
251319
|
+
const value = secrets2.sso_client_secret;
|
|
251320
|
+
if (!value) {
|
|
251321
|
+
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
251322
|
+
}
|
|
251323
|
+
clientSecret = value;
|
|
251324
|
+
} else {
|
|
251325
|
+
clientSecret = await resolveSecret({
|
|
251326
|
+
flagValue: merged.clientSecret,
|
|
251327
|
+
fromStdin: merged.clientSecretStdin,
|
|
251328
|
+
envVar: "sso_client_secret",
|
|
251329
|
+
promptMessage: "Enter SSO client secret",
|
|
251330
|
+
isNonInteractive,
|
|
251331
|
+
name: "client secret",
|
|
251332
|
+
hints: [
|
|
251333
|
+
{
|
|
251334
|
+
message: `Provide via flag: base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`,
|
|
251335
|
+
command: `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`
|
|
251336
|
+
},
|
|
251337
|
+
{
|
|
251338
|
+
message: `Provide via stdin: echo <secret> | base44 auth sso enable --provider ${provider} --client-id <id> --client-secret-stdin`
|
|
251339
|
+
},
|
|
251340
|
+
{
|
|
251341
|
+
message: `Provide via env: sso_client_secret=<secret> base44 auth sso enable --provider ${provider} --client-id <id>`
|
|
251342
|
+
}
|
|
251343
|
+
]
|
|
251344
|
+
});
|
|
251345
|
+
}
|
|
251346
|
+
const secretOptions = {
|
|
251347
|
+
clientId: merged.clientId,
|
|
251348
|
+
clientSecret,
|
|
251349
|
+
scope: merged.scope,
|
|
251350
|
+
discoveryUrl: merged.discoveryUrl,
|
|
251351
|
+
tenantId: merged.tenantId,
|
|
251352
|
+
oktaDomain: merged.oktaDomain,
|
|
251353
|
+
authEndpoint: merged.authEndpoint,
|
|
251354
|
+
tokenEndpoint: merged.tokenEndpoint,
|
|
251355
|
+
userinfoEndpoint: merged.userinfoEndpoint,
|
|
251356
|
+
jwksUri: merged.jwksUri,
|
|
251357
|
+
ssoName: merged.ssoName
|
|
251358
|
+
};
|
|
251359
|
+
let secrets;
|
|
251360
|
+
try {
|
|
251361
|
+
secrets = buildSSOSecrets(provider, secretOptions);
|
|
251362
|
+
} catch (error48) {
|
|
251363
|
+
if (error48 instanceof MissingSSOFieldsError) {
|
|
251364
|
+
const flagNames = error48.missingKeys.map(secretKeyToFlag);
|
|
251365
|
+
throw new InvalidInputError(`Missing required fields for ${error48.provider}: ${flagNames.join(", ")}`, {
|
|
251366
|
+
hints: [
|
|
251367
|
+
{
|
|
251368
|
+
message: `Example: ${exampleCommand(provider)}`,
|
|
251369
|
+
command: exampleCommand(provider)
|
|
251370
|
+
}
|
|
251371
|
+
]
|
|
251372
|
+
});
|
|
251373
|
+
}
|
|
251374
|
+
throw error48;
|
|
251375
|
+
}
|
|
251376
|
+
const { project: project2 } = await readProjectConfig();
|
|
251377
|
+
const configDir = dirname11(project2.configPath);
|
|
251378
|
+
const authDir = join16(configDir, project2.authDir);
|
|
251379
|
+
await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, provider, true));
|
|
251380
|
+
await runTask2("Saving SSO credentials", async () => pushSSOSecrets(secrets));
|
|
251381
|
+
return {
|
|
251382
|
+
outroMessage: `SSO configured with ${provider} in local config. Run \`base44 auth push\` or \`base44 deploy\` to apply.`
|
|
251383
|
+
};
|
|
251384
|
+
}
|
|
251385
|
+
function hasEnableOnlyOptions(options) {
|
|
251386
|
+
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);
|
|
251387
|
+
}
|
|
251388
|
+
async function ssoDisableAction({ log, runTask: runTask2 }, options) {
|
|
251389
|
+
if (hasEnableOnlyOptions(options)) {
|
|
251390
|
+
throw new InvalidInputError("Configuration options cannot be used with disable. To disable SSO: base44 auth sso disable");
|
|
251391
|
+
}
|
|
251392
|
+
const { project: project2 } = await readProjectConfig();
|
|
251393
|
+
const configDir = dirname11(project2.configPath);
|
|
251394
|
+
const authDir = join16(configDir, project2.authDir);
|
|
251395
|
+
const updated = await runTask2("Updating local auth config", async () => updateSSOConfig(authDir, null, false));
|
|
251396
|
+
await runTask2("Removing SSO credentials", async () => deleteSSOSecrets());
|
|
251397
|
+
if (!hasAnyLoginMethod(updated)) {
|
|
251398
|
+
log.warn("Disabling SSO will leave no login methods enabled. Users will be locked out.");
|
|
251399
|
+
}
|
|
251400
|
+
return {
|
|
251401
|
+
outroMessage: "SSO disabled in local config and credentials removed. Run `base44 auth push` or `base44 deploy` to apply."
|
|
251402
|
+
};
|
|
251403
|
+
}
|
|
251404
|
+
async function ssoAction(context, action, options) {
|
|
251405
|
+
if (action === "disable") {
|
|
251406
|
+
return ssoDisableAction(context, options);
|
|
251407
|
+
}
|
|
251408
|
+
return ssoEnableAction(context, options);
|
|
251409
|
+
}
|
|
251410
|
+
function getSSOCommand() {
|
|
251411
|
+
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([
|
|
251412
|
+
"enable",
|
|
251413
|
+
"disable"
|
|
251414
|
+
])).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). Ignored if --client-secret is provided directly or via --file.").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);
|
|
251415
|
+
}
|
|
251416
|
+
|
|
251039
251417
|
// src/cli/commands/auth/index.ts
|
|
251040
251418
|
function getAuthCommand() {
|
|
251041
|
-
return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getSocialLoginCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
|
|
251419
|
+
return new Command("auth").description("Manage app authentication settings").addCommand(getPasswordLoginCommand()).addCommand(getSocialLoginCommand()).addCommand(getSSOCommand()).addCommand(getAuthPullCommand()).addCommand(getAuthPushCommand());
|
|
251042
251420
|
}
|
|
251043
251421
|
|
|
251044
251422
|
// src/cli/commands/auth/login.ts
|
|
@@ -251100,14 +251478,14 @@ function getConnectorsListAvailableCommand() {
|
|
|
251100
251478
|
}
|
|
251101
251479
|
|
|
251102
251480
|
// src/cli/commands/connectors/pull.ts
|
|
251103
|
-
import { dirname as
|
|
251481
|
+
import { dirname as dirname12, join as join17 } from "node:path";
|
|
251104
251482
|
async function pullConnectorsAction({
|
|
251105
251483
|
log,
|
|
251106
251484
|
runTask: runTask2
|
|
251107
251485
|
}) {
|
|
251108
251486
|
const { project: project2 } = await readProjectConfig();
|
|
251109
|
-
const configDir =
|
|
251110
|
-
const connectorsDir =
|
|
251487
|
+
const configDir = dirname12(project2.configPath);
|
|
251488
|
+
const connectorsDir = join17(configDir, project2.connectorsDir);
|
|
251111
251489
|
const remoteConnectors = await runTask2("Fetching connectors from Base44", async () => {
|
|
251112
251490
|
return await pullAllConnectors();
|
|
251113
251491
|
}, {
|
|
@@ -251636,19 +252014,19 @@ var baseOpen = async (options) => {
|
|
|
251636
252014
|
}
|
|
251637
252015
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
251638
252016
|
if (options.wait) {
|
|
251639
|
-
return new Promise((
|
|
252017
|
+
return new Promise((resolve4, reject) => {
|
|
251640
252018
|
subprocess.once("error", reject);
|
|
251641
252019
|
subprocess.once("close", (exitCode) => {
|
|
251642
252020
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
251643
252021
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
251644
252022
|
return;
|
|
251645
252023
|
}
|
|
251646
|
-
|
|
252024
|
+
resolve4(subprocess);
|
|
251647
252025
|
});
|
|
251648
252026
|
});
|
|
251649
252027
|
}
|
|
251650
252028
|
if (isFallbackAttempt) {
|
|
251651
|
-
return new Promise((
|
|
252029
|
+
return new Promise((resolve4, reject) => {
|
|
251652
252030
|
subprocess.once("error", reject);
|
|
251653
252031
|
subprocess.once("spawn", () => {
|
|
251654
252032
|
subprocess.once("close", (exitCode) => {
|
|
@@ -251658,17 +252036,17 @@ var baseOpen = async (options) => {
|
|
|
251658
252036
|
return;
|
|
251659
252037
|
}
|
|
251660
252038
|
subprocess.unref();
|
|
251661
|
-
|
|
252039
|
+
resolve4(subprocess);
|
|
251662
252040
|
});
|
|
251663
252041
|
});
|
|
251664
252042
|
});
|
|
251665
252043
|
}
|
|
251666
252044
|
subprocess.unref();
|
|
251667
|
-
return new Promise((
|
|
252045
|
+
return new Promise((resolve4, reject) => {
|
|
251668
252046
|
subprocess.once("error", reject);
|
|
251669
252047
|
subprocess.once("spawn", () => {
|
|
251670
252048
|
subprocess.off("error", reject);
|
|
251671
|
-
|
|
252049
|
+
resolve4(subprocess);
|
|
251672
252050
|
});
|
|
251673
252051
|
});
|
|
251674
252052
|
};
|
|
@@ -252162,11 +252540,11 @@ function getListCommand() {
|
|
|
252162
252540
|
}
|
|
252163
252541
|
|
|
252164
252542
|
// src/cli/commands/functions/pull.ts
|
|
252165
|
-
import { dirname as
|
|
252543
|
+
import { dirname as dirname13, join as join18 } from "node:path";
|
|
252166
252544
|
async function pullFunctionsAction({ log, runTask: runTask2 }, name2) {
|
|
252167
252545
|
const { project: project2 } = await readProjectConfig();
|
|
252168
|
-
const configDir =
|
|
252169
|
-
const functionsDir =
|
|
252546
|
+
const configDir = dirname13(project2.configPath);
|
|
252547
|
+
const functionsDir = join18(configDir, project2.functionsDir);
|
|
252170
252548
|
const remoteFunctions = await runTask2("Fetching functions from Base44", async () => {
|
|
252171
252549
|
const { functions } = await listDeployedFunctions();
|
|
252172
252550
|
return functions;
|
|
@@ -252209,7 +252587,7 @@ function getFunctionsCommand() {
|
|
|
252209
252587
|
}
|
|
252210
252588
|
|
|
252211
252589
|
// src/cli/commands/project/create.ts
|
|
252212
|
-
import { basename as basename3, join as
|
|
252590
|
+
import { basename as basename3, join as join19, resolve as resolve4 } from "node:path";
|
|
252213
252591
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
252214
252592
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
252215
252593
|
async function getTemplateById(templateId) {
|
|
@@ -252274,7 +252652,7 @@ async function createInteractive(options, ctx) {
|
|
|
252274
252652
|
}, ctx);
|
|
252275
252653
|
}
|
|
252276
252654
|
async function createNonInteractive(options, ctx) {
|
|
252277
|
-
ctx.log.info(`Creating a new project at ${
|
|
252655
|
+
ctx.log.info(`Creating a new project at ${resolve4(options.path)}`);
|
|
252278
252656
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
252279
252657
|
return await executeCreate({
|
|
252280
252658
|
template: template2,
|
|
@@ -252295,7 +252673,7 @@ async function executeCreate({
|
|
|
252295
252673
|
isInteractive
|
|
252296
252674
|
}, { log, runTask: runTask2 }) {
|
|
252297
252675
|
const name2 = rawName.trim();
|
|
252298
|
-
const resolvedPath =
|
|
252676
|
+
const resolvedPath = resolve4(projectPath);
|
|
252299
252677
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
252300
252678
|
return await createProjectFiles({
|
|
252301
252679
|
name: name2,
|
|
@@ -252346,7 +252724,7 @@ async function executeCreate({
|
|
|
252346
252724
|
updateMessage("Building project...");
|
|
252347
252725
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
252348
252726
|
updateMessage("Deploying site...");
|
|
252349
|
-
return await deploySite(
|
|
252727
|
+
return await deploySite(join19(resolvedPath, outputDirectory));
|
|
252350
252728
|
}, {
|
|
252351
252729
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
252352
252730
|
errorMessage: "Failed to deploy site"
|
|
@@ -252811,7 +253189,7 @@ function getSecretsListCommand() {
|
|
|
252811
253189
|
}
|
|
252812
253190
|
|
|
252813
253191
|
// src/cli/commands/secrets/set.ts
|
|
252814
|
-
import { resolve as
|
|
253192
|
+
import { resolve as resolve5 } from "node:path";
|
|
252815
253193
|
function parseEntries(entries) {
|
|
252816
253194
|
const secrets = {};
|
|
252817
253195
|
for (const entry of entries) {
|
|
@@ -252842,7 +253220,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
252842
253220
|
validateInput(entries, options);
|
|
252843
253221
|
let secrets;
|
|
252844
253222
|
if (options.envFile) {
|
|
252845
|
-
secrets = await parseEnvFile(
|
|
253223
|
+
secrets = await parseEnvFile(resolve5(options.envFile));
|
|
252846
253224
|
if (Object.keys(secrets).length === 0) {
|
|
252847
253225
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
252848
253226
|
}
|
|
@@ -252871,7 +253249,7 @@ function getSecretsCommand() {
|
|
|
252871
253249
|
}
|
|
252872
253250
|
|
|
252873
253251
|
// src/cli/commands/site/deploy.ts
|
|
252874
|
-
import { resolve as
|
|
253252
|
+
import { resolve as resolve6 } from "node:path";
|
|
252875
253253
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
252876
253254
|
if (isNonInteractive && !options.yes) {
|
|
252877
253255
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -252886,7 +253264,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
252886
253264
|
]
|
|
252887
253265
|
});
|
|
252888
253266
|
}
|
|
252889
|
-
const outputDir =
|
|
253267
|
+
const outputDir = resolve6(project2.root, project2.site.outputDirectory);
|
|
252890
253268
|
if (!options.yes) {
|
|
252891
253269
|
const shouldDeploy = await Re({
|
|
252892
253270
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253012,10 +253390,10 @@ function toPascalCase(name2) {
|
|
|
253012
253390
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
253013
253391
|
}
|
|
253014
253392
|
// src/core/types/update-project.ts
|
|
253015
|
-
import { join as
|
|
253393
|
+
import { join as join22 } from "node:path";
|
|
253016
253394
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
253017
253395
|
async function updateProjectConfig(projectRoot) {
|
|
253018
|
-
const tsconfigPath =
|
|
253396
|
+
const tsconfigPath = join22(projectRoot, "tsconfig.json");
|
|
253019
253397
|
if (!await pathExists(tsconfigPath)) {
|
|
253020
253398
|
return false;
|
|
253021
253399
|
}
|
|
@@ -253063,7 +253441,7 @@ import process21 from "node:process";
|
|
|
253063
253441
|
// src/cli/dev/dev-server/main.ts
|
|
253064
253442
|
var import_cors = __toESM(require_lib4(), 1);
|
|
253065
253443
|
var import_express6 = __toESM(require_express(), 1);
|
|
253066
|
-
import { dirname as
|
|
253444
|
+
import { dirname as dirname18, join as join25 } from "node:path";
|
|
253067
253445
|
|
|
253068
253446
|
// ../../node_modules/get-port/index.js
|
|
253069
253447
|
import net from "node:net";
|
|
@@ -253090,14 +253468,14 @@ var getLocalHosts = () => {
|
|
|
253090
253468
|
}
|
|
253091
253469
|
return results;
|
|
253092
253470
|
};
|
|
253093
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253471
|
+
var checkAvailablePort = (options8) => new Promise((resolve8, reject) => {
|
|
253094
253472
|
const server = net.createServer();
|
|
253095
253473
|
server.unref();
|
|
253096
253474
|
server.on("error", reject);
|
|
253097
253475
|
server.listen(options8, () => {
|
|
253098
253476
|
const { port } = server.address();
|
|
253099
253477
|
server.close(() => {
|
|
253100
|
-
|
|
253478
|
+
resolve8(port);
|
|
253101
253479
|
});
|
|
253102
253480
|
});
|
|
253103
253481
|
});
|
|
@@ -253357,7 +253735,7 @@ class FunctionManager {
|
|
|
253357
253735
|
});
|
|
253358
253736
|
}
|
|
253359
253737
|
waitForReady(name2, runningFunc) {
|
|
253360
|
-
return new Promise((
|
|
253738
|
+
return new Promise((resolve8, reject) => {
|
|
253361
253739
|
runningFunc.process.on("exit", (code2) => {
|
|
253362
253740
|
if (!runningFunc.ready) {
|
|
253363
253741
|
clearTimeout(timeout3);
|
|
@@ -253380,7 +253758,7 @@ class FunctionManager {
|
|
|
253380
253758
|
runningFunc.ready = true;
|
|
253381
253759
|
clearTimeout(timeout3);
|
|
253382
253760
|
runningFunc.process.stdout?.off("data", onData);
|
|
253383
|
-
|
|
253761
|
+
resolve8(runningFunc.port);
|
|
253384
253762
|
}
|
|
253385
253763
|
};
|
|
253386
253764
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -255301,9 +255679,9 @@ class NodeFsHandler {
|
|
|
255301
255679
|
if (this.fsw.closed) {
|
|
255302
255680
|
return;
|
|
255303
255681
|
}
|
|
255304
|
-
const
|
|
255682
|
+
const dirname17 = sp2.dirname(file2);
|
|
255305
255683
|
const basename5 = sp2.basename(file2);
|
|
255306
|
-
const parent = this.fsw._getWatchedDir(
|
|
255684
|
+
const parent = this.fsw._getWatchedDir(dirname17);
|
|
255307
255685
|
let prevStats = stats;
|
|
255308
255686
|
if (parent.has(basename5))
|
|
255309
255687
|
return;
|
|
@@ -255330,7 +255708,7 @@ class NodeFsHandler {
|
|
|
255330
255708
|
prevStats = newStats2;
|
|
255331
255709
|
}
|
|
255332
255710
|
} catch (error48) {
|
|
255333
|
-
this.fsw._remove(
|
|
255711
|
+
this.fsw._remove(dirname17, basename5);
|
|
255334
255712
|
}
|
|
255335
255713
|
} else if (parent.has(basename5)) {
|
|
255336
255714
|
const at13 = newStats.atimeMs;
|
|
@@ -255419,7 +255797,7 @@ class NodeFsHandler {
|
|
|
255419
255797
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
255420
255798
|
}
|
|
255421
255799
|
}).on(EV.ERROR, this._boundHandleError);
|
|
255422
|
-
return new Promise((
|
|
255800
|
+
return new Promise((resolve9, reject) => {
|
|
255423
255801
|
if (!stream)
|
|
255424
255802
|
return reject();
|
|
255425
255803
|
stream.once(STR_END, () => {
|
|
@@ -255428,7 +255806,7 @@ class NodeFsHandler {
|
|
|
255428
255806
|
return;
|
|
255429
255807
|
}
|
|
255430
255808
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
255431
|
-
|
|
255809
|
+
resolve9(undefined);
|
|
255432
255810
|
previous.getChildren().filter((item) => {
|
|
255433
255811
|
return item !== directory && !current.has(item);
|
|
255434
255812
|
}).forEach((item) => {
|
|
@@ -256339,7 +256717,7 @@ async function createDevServer(options8) {
|
|
|
256339
256717
|
}
|
|
256340
256718
|
remoteProxy(req, res, next);
|
|
256341
256719
|
});
|
|
256342
|
-
const server = await new Promise((
|
|
256720
|
+
const server = await new Promise((resolve10, reject) => {
|
|
256343
256721
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
256344
256722
|
if (err) {
|
|
256345
256723
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -256348,7 +256726,7 @@ async function createDevServer(options8) {
|
|
|
256348
256726
|
reject(err);
|
|
256349
256727
|
}
|
|
256350
256728
|
} else {
|
|
256351
|
-
|
|
256729
|
+
resolve10(s5);
|
|
256352
256730
|
}
|
|
256353
256731
|
});
|
|
256354
256732
|
});
|
|
@@ -256357,8 +256735,8 @@ async function createDevServer(options8) {
|
|
|
256357
256735
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
256358
256736
|
};
|
|
256359
256737
|
const base44ConfigWatcher = new WatchBase44({
|
|
256360
|
-
functions:
|
|
256361
|
-
entities:
|
|
256738
|
+
functions: join25(dirname18(project2.configPath), project2.functionsDir),
|
|
256739
|
+
entities: join25(dirname18(project2.configPath), project2.entitiesDir)
|
|
256362
256740
|
}, devLogger);
|
|
256363
256741
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
256364
256742
|
try {
|
|
@@ -256465,13 +256843,13 @@ async function runScript(options8) {
|
|
|
256465
256843
|
}
|
|
256466
256844
|
// src/cli/commands/exec.ts
|
|
256467
256845
|
function readStdin2() {
|
|
256468
|
-
return new Promise((
|
|
256846
|
+
return new Promise((resolve10, reject) => {
|
|
256469
256847
|
let data = "";
|
|
256470
256848
|
process.stdin.setEncoding("utf-8");
|
|
256471
256849
|
process.stdin.on("data", (chunk) => {
|
|
256472
256850
|
data += chunk;
|
|
256473
256851
|
});
|
|
256474
|
-
process.stdin.on("end", () =>
|
|
256852
|
+
process.stdin.on("end", () => resolve10(data));
|
|
256475
256853
|
process.stdin.on("error", reject);
|
|
256476
256854
|
});
|
|
256477
256855
|
}
|
|
@@ -256510,7 +256888,7 @@ Examples:
|
|
|
256510
256888
|
}
|
|
256511
256889
|
|
|
256512
256890
|
// src/cli/commands/project/eject.ts
|
|
256513
|
-
import { resolve as
|
|
256891
|
+
import { resolve as resolve10 } from "node:path";
|
|
256514
256892
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
256515
256893
|
async function eject(ctx, options8) {
|
|
256516
256894
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -256566,7 +256944,7 @@ async function eject(ctx, options8) {
|
|
|
256566
256944
|
Ne("Operation cancelled.");
|
|
256567
256945
|
throw new CLIExitError(0);
|
|
256568
256946
|
}
|
|
256569
|
-
const resolvedPath =
|
|
256947
|
+
const resolvedPath = resolve10(selectedPath);
|
|
256570
256948
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
256571
256949
|
await createProjectFilesForExistingProject({
|
|
256572
256950
|
projectId,
|
|
@@ -256647,7 +257025,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
256647
257025
|
import { release, type } from "node:os";
|
|
256648
257026
|
|
|
256649
257027
|
// ../../node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
256650
|
-
import { dirname as
|
|
257028
|
+
import { dirname as dirname19, posix, sep } from "path";
|
|
256651
257029
|
function createModulerModifier() {
|
|
256652
257030
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
256653
257031
|
return async (frames) => {
|
|
@@ -256656,7 +257034,7 @@ function createModulerModifier() {
|
|
|
256656
257034
|
return frames;
|
|
256657
257035
|
};
|
|
256658
257036
|
}
|
|
256659
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
257037
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname19(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
256660
257038
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
256661
257039
|
return (filename) => {
|
|
256662
257040
|
if (!filename)
|
|
@@ -258934,14 +259312,14 @@ async function addSourceContext(frames) {
|
|
|
258934
259312
|
return frames;
|
|
258935
259313
|
}
|
|
258936
259314
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
258937
|
-
return new Promise((
|
|
259315
|
+
return new Promise((resolve11) => {
|
|
258938
259316
|
const stream = createReadStream2(path19);
|
|
258939
259317
|
const lineReaded = createInterface2({
|
|
258940
259318
|
input: stream
|
|
258941
259319
|
});
|
|
258942
259320
|
function destroyStreamAndResolve() {
|
|
258943
259321
|
stream.destroy();
|
|
258944
|
-
|
|
259322
|
+
resolve11();
|
|
258945
259323
|
}
|
|
258946
259324
|
let lineNumber = 0;
|
|
258947
259325
|
let currentRangeIndex = 0;
|
|
@@ -260053,15 +260431,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260053
260431
|
return true;
|
|
260054
260432
|
if (this.featureFlagsPoller === undefined)
|
|
260055
260433
|
return false;
|
|
260056
|
-
return new Promise((
|
|
260434
|
+
return new Promise((resolve11) => {
|
|
260057
260435
|
const timeout3 = setTimeout(() => {
|
|
260058
260436
|
cleanup();
|
|
260059
|
-
|
|
260437
|
+
resolve11(false);
|
|
260060
260438
|
}, timeoutMs);
|
|
260061
260439
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260062
260440
|
clearTimeout(timeout3);
|
|
260063
260441
|
cleanup();
|
|
260064
|
-
|
|
260442
|
+
resolve11(count2 > 0);
|
|
260065
260443
|
});
|
|
260066
260444
|
});
|
|
260067
260445
|
}
|
|
@@ -260845,9 +261223,9 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
|
|
|
260845
261223
|
});
|
|
260846
261224
|
}
|
|
260847
261225
|
// src/cli/index.ts
|
|
260848
|
-
var __dirname4 =
|
|
261226
|
+
var __dirname4 = dirname20(fileURLToPath6(import.meta.url));
|
|
260849
261227
|
async function runCLI(options8) {
|
|
260850
|
-
ensureNpmAssets(
|
|
261228
|
+
ensureNpmAssets(join26(__dirname4, "../assets"));
|
|
260851
261229
|
const errorReporter = new ErrorReporter;
|
|
260852
261230
|
errorReporter.registerProcessErrorHandlers();
|
|
260853
261231
|
const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
|
|
@@ -260884,4 +261262,4 @@ export {
|
|
|
260884
261262
|
CLIExitError
|
|
260885
261263
|
};
|
|
260886
261264
|
|
|
260887
|
-
//# debugId=
|
|
261265
|
+
//# debugId=E1D26BE93FCEF41264756E2164756E21
|