@base44-preview/cli 0.0.51-pr.481.a2befc3 → 0.0.51-pr.503.a910f3e
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 +198 -153
- package/dist/cli/index.js.map +7 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -8935,8 +8935,8 @@ var require_ejs = __commonJS((exports) => {
|
|
|
8935
8935
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
8936
8936
|
var dirname6 = path11.dirname;
|
|
8937
8937
|
var extname = path11.extname;
|
|
8938
|
-
var
|
|
8939
|
-
var includePath =
|
|
8938
|
+
var resolve2 = path11.resolve;
|
|
8939
|
+
var includePath = resolve2(isDir ? filename : dirname6(filename), name2);
|
|
8940
8940
|
var ext = extname(name2);
|
|
8941
8941
|
if (!ext) {
|
|
8942
8942
|
includePath += ".ejs";
|
|
@@ -9011,10 +9011,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
9011
9011
|
var result;
|
|
9012
9012
|
if (!cb) {
|
|
9013
9013
|
if (typeof exports.promiseImpl == "function") {
|
|
9014
|
-
return new exports.promiseImpl(function(
|
|
9014
|
+
return new exports.promiseImpl(function(resolve2, reject) {
|
|
9015
9015
|
try {
|
|
9016
9016
|
result = handleCache(options)(data);
|
|
9017
|
-
|
|
9017
|
+
resolve2(result);
|
|
9018
9018
|
} catch (err) {
|
|
9019
9019
|
reject(err);
|
|
9020
9020
|
}
|
|
@@ -12452,12 +12452,12 @@ var require_isexe = __commonJS((exports, module) => {
|
|
|
12452
12452
|
if (typeof Promise !== "function") {
|
|
12453
12453
|
throw new TypeError("callback not provided");
|
|
12454
12454
|
}
|
|
12455
|
-
return new Promise(function(
|
|
12455
|
+
return new Promise(function(resolve3, reject) {
|
|
12456
12456
|
isexe(path11, options || {}, function(er, is) {
|
|
12457
12457
|
if (er) {
|
|
12458
12458
|
reject(er);
|
|
12459
12459
|
} else {
|
|
12460
|
-
|
|
12460
|
+
resolve3(is);
|
|
12461
12461
|
}
|
|
12462
12462
|
});
|
|
12463
12463
|
});
|
|
@@ -12519,27 +12519,27 @@ var require_which = __commonJS((exports, module) => {
|
|
|
12519
12519
|
opt = {};
|
|
12520
12520
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
12521
12521
|
const found = [];
|
|
12522
|
-
const step = (i) => new Promise((
|
|
12522
|
+
const step = (i) => new Promise((resolve3, reject) => {
|
|
12523
12523
|
if (i === pathEnv.length)
|
|
12524
|
-
return opt.all && found.length ?
|
|
12524
|
+
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
12525
12525
|
const ppRaw = pathEnv[i];
|
|
12526
12526
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
12527
12527
|
const pCmd = path11.join(pathPart, cmd);
|
|
12528
12528
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
12529
|
-
|
|
12529
|
+
resolve3(subStep(p, i, 0));
|
|
12530
12530
|
});
|
|
12531
|
-
const subStep = (p, i, ii) => new Promise((
|
|
12531
|
+
const subStep = (p, i, ii) => new Promise((resolve3, reject) => {
|
|
12532
12532
|
if (ii === pathExt.length)
|
|
12533
|
-
return
|
|
12533
|
+
return resolve3(step(i + 1));
|
|
12534
12534
|
const ext = pathExt[ii];
|
|
12535
12535
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
12536
12536
|
if (!er && is) {
|
|
12537
12537
|
if (opt.all)
|
|
12538
12538
|
found.push(p + ext);
|
|
12539
12539
|
else
|
|
12540
|
-
return
|
|
12540
|
+
return resolve3(p + ext);
|
|
12541
12541
|
}
|
|
12542
|
-
return
|
|
12542
|
+
return resolve3(subStep(p, i, ii + 1));
|
|
12543
12543
|
});
|
|
12544
12544
|
});
|
|
12545
12545
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -115559,7 +115559,7 @@ import { fileURLToPath as fileURLToPath22 } from "url";
|
|
|
115559
115559
|
import v8 from "v8";
|
|
115560
115560
|
import assert22 from "assert";
|
|
115561
115561
|
import { format as format2, inspect as inspect3 } from "util";
|
|
115562
|
-
import { createRequire as
|
|
115562
|
+
import { createRequire as createRequire3 } from "module";
|
|
115563
115563
|
import { equal, ok, strictEqual } from "assert";
|
|
115564
115564
|
import path112 from "path";
|
|
115565
115565
|
import { fileURLToPath as fileURLToPath52 } from "url";
|
|
@@ -118133,7 +118133,7 @@ function importFromFile(specifier, parent) {
|
|
|
118133
118133
|
return import(url3);
|
|
118134
118134
|
}
|
|
118135
118135
|
function requireFromFile(id2, parent) {
|
|
118136
|
-
const require22 =
|
|
118136
|
+
const require22 = createRequire3(parent);
|
|
118137
118137
|
return require22(id2);
|
|
118138
118138
|
}
|
|
118139
118139
|
async function loadExternalConfig(externalConfig, configFile) {
|
|
@@ -124338,7 +124338,7 @@ var init_prettier = __esm(() => {
|
|
|
124338
124338
|
const absolute = [];
|
|
124339
124339
|
const relative22 = [];
|
|
124340
124340
|
for (const pattern of patterns) {
|
|
124341
|
-
if (
|
|
124341
|
+
if (isAbsolute3(pattern)) {
|
|
124342
124342
|
absolute.push(pattern);
|
|
124343
124343
|
} else {
|
|
124344
124344
|
relative22.push(pattern);
|
|
@@ -124347,10 +124347,10 @@ var init_prettier = __esm(() => {
|
|
|
124347
124347
|
return [absolute, relative22];
|
|
124348
124348
|
}
|
|
124349
124349
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
124350
|
-
function
|
|
124350
|
+
function isAbsolute3(pattern) {
|
|
124351
124351
|
return path152.isAbsolute(pattern);
|
|
124352
124352
|
}
|
|
124353
|
-
exports.isAbsolute =
|
|
124353
|
+
exports.isAbsolute = isAbsolute3;
|
|
124354
124354
|
}
|
|
124355
124355
|
});
|
|
124356
124356
|
require_merge22 = __commonJS2({
|
|
@@ -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
|
}
|
|
@@ -160403,7 +160403,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
160403
160403
|
var basename4 = path18.basename;
|
|
160404
160404
|
var extname2 = path18.extname;
|
|
160405
160405
|
var join22 = path18.join;
|
|
160406
|
-
var
|
|
160406
|
+
var resolve8 = path18.resolve;
|
|
160407
160407
|
module.exports = View;
|
|
160408
160408
|
function View(name2, options8) {
|
|
160409
160409
|
var opts = options8 || {};
|
|
@@ -160437,7 +160437,7 @@ 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 =
|
|
160440
|
+
var loc = resolve8(root2, name2);
|
|
160441
160441
|
var dir = dirname15(loc);
|
|
160442
160442
|
var file2 = basename4(loc);
|
|
160443
160443
|
path19 = this.resolve(dir, file2);
|
|
@@ -160462,7 +160462,7 @@ 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
160467
|
var path19 = join22(dir, file2);
|
|
160468
160468
|
var stat2 = tryStat(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");
|
|
@@ -164166,7 +164166,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
164166
164166
|
var extname2 = path18.extname;
|
|
164167
164167
|
var join22 = 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) {
|
|
@@ -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);
|
|
@@ -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 {
|
|
@@ -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
|
});
|
|
@@ -234632,7 +234632,8 @@ var ProjectConfigSchema = exports_external.object({
|
|
|
234632
234632
|
functionsDir: exports_external.string().optional().default("functions"),
|
|
234633
234633
|
agentsDir: exports_external.string().optional().default("agents"),
|
|
234634
234634
|
connectorsDir: exports_external.string().optional().default("connectors"),
|
|
234635
|
-
authDir: exports_external.string().optional().default("auth")
|
|
234635
|
+
authDir: exports_external.string().optional().default("auth"),
|
|
234636
|
+
plugins: exports_external.array(exports_external.string()).optional().default([])
|
|
234636
234637
|
});
|
|
234637
234638
|
var AppConfigSchema = exports_external.object({
|
|
234638
234639
|
id: exports_external.string().min(1, "id cannot be empty")
|
|
@@ -241579,7 +241580,8 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
241579
241580
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
241580
241581
|
|
|
241581
241582
|
// src/core/project/config.ts
|
|
241582
|
-
import {
|
|
241583
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
241584
|
+
import { dirname as dirname5, isAbsolute as isAbsolute2, join as join8, resolve } from "node:path";
|
|
241583
241585
|
|
|
241584
241586
|
// src/core/resources/agent/schema.ts
|
|
241585
241587
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -242655,6 +242657,55 @@ var SyncEntitiesResponseSchema = exports_external.object({
|
|
|
242655
242657
|
deleted: exports_external.array(exports_external.string())
|
|
242656
242658
|
});
|
|
242657
242659
|
|
|
242660
|
+
// src/core/resources/entity/config.ts
|
|
242661
|
+
async function readEntityFile(entityPath) {
|
|
242662
|
+
const parsed = await readJsonFile(entityPath);
|
|
242663
|
+
const result = EntitySchema.safeParse(parsed);
|
|
242664
|
+
if (!result.success) {
|
|
242665
|
+
throw new SchemaValidationError("Invalid entity file", result.error, entityPath);
|
|
242666
|
+
}
|
|
242667
|
+
return result.data;
|
|
242668
|
+
}
|
|
242669
|
+
async function readAllEntities(entitiesDir) {
|
|
242670
|
+
if (!await pathExists(entitiesDir)) {
|
|
242671
|
+
return [];
|
|
242672
|
+
}
|
|
242673
|
+
const files = await globby(`*.${CONFIG_FILE_EXTENSION_GLOB}`, {
|
|
242674
|
+
cwd: entitiesDir,
|
|
242675
|
+
absolute: true
|
|
242676
|
+
});
|
|
242677
|
+
const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
|
|
242678
|
+
return entities;
|
|
242679
|
+
}
|
|
242680
|
+
function mergeEntities(appEntities, pluginEntities) {
|
|
242681
|
+
const appEntitiesByName = new Map(appEntities.map((entity) => [entity.name, entity]));
|
|
242682
|
+
let mergedEntities = [];
|
|
242683
|
+
pluginEntities.forEach((pluginEntity) => {
|
|
242684
|
+
const appEntityToMerge = appEntitiesByName.get(pluginEntity.name);
|
|
242685
|
+
if (appEntityToMerge) {
|
|
242686
|
+
const appEntityProperties = Object.keys(appEntityToMerge.properties);
|
|
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
|
+
}
|
|
242700
|
+
});
|
|
242701
|
+
appEntitiesByName.delete(appEntityToMerge.name);
|
|
242702
|
+
} else {
|
|
242703
|
+
mergedEntities.push(pluginEntity);
|
|
242704
|
+
}
|
|
242705
|
+
});
|
|
242706
|
+
return [...mergedEntities, ...appEntitiesByName.values()];
|
|
242707
|
+
}
|
|
242708
|
+
|
|
242658
242709
|
// src/core/resources/entity/api.ts
|
|
242659
242710
|
async function syncEntities(entities) {
|
|
242660
242711
|
const appClient = getAppClient();
|
|
@@ -242676,26 +242727,6 @@ async function syncEntities(entities) {
|
|
|
242676
242727
|
}
|
|
242677
242728
|
return result.data;
|
|
242678
242729
|
}
|
|
242679
|
-
// src/core/resources/entity/config.ts
|
|
242680
|
-
async function readEntityFile(entityPath) {
|
|
242681
|
-
const parsed = await readJsonFile(entityPath);
|
|
242682
|
-
const result = EntitySchema.safeParse(parsed);
|
|
242683
|
-
if (!result.success) {
|
|
242684
|
-
throw new SchemaValidationError("Invalid entity file", result.error, entityPath);
|
|
242685
|
-
}
|
|
242686
|
-
return result.data;
|
|
242687
|
-
}
|
|
242688
|
-
async function readAllEntities(entitiesDir) {
|
|
242689
|
-
if (!await pathExists(entitiesDir)) {
|
|
242690
|
-
return [];
|
|
242691
|
-
}
|
|
242692
|
-
const files = await globby(`*.${CONFIG_FILE_EXTENSION_GLOB}`, {
|
|
242693
|
-
cwd: entitiesDir,
|
|
242694
|
-
absolute: true
|
|
242695
|
-
});
|
|
242696
|
-
const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
|
|
242697
|
-
return entities;
|
|
242698
|
-
}
|
|
242699
242730
|
// src/core/resources/entity/deploy.ts
|
|
242700
242731
|
async function pushEntities(entities) {
|
|
242701
242732
|
if (entities.length === 0) {
|
|
@@ -243121,6 +243152,13 @@ var functionResource = {
|
|
|
243121
243152
|
push: (functions) => deployFunctionsSequentially(functions)
|
|
243122
243153
|
};
|
|
243123
243154
|
// src/core/project/config.ts
|
|
243155
|
+
function resolvePluginRoot(pluginRef, fromRoot) {
|
|
243156
|
+
if (pluginRef.startsWith(".") || isAbsolute2(pluginRef)) {
|
|
243157
|
+
return resolve(fromRoot, pluginRef);
|
|
243158
|
+
}
|
|
243159
|
+
const req = createRequire2(join8(fromRoot, "package.json"));
|
|
243160
|
+
return dirname5(req.resolve(`${pluginRef}/package.json`));
|
|
243161
|
+
}
|
|
243124
243162
|
async function findConfigInDir(dir) {
|
|
243125
243163
|
const files = await globby(PROJECT_CONFIG_PATTERNS, {
|
|
243126
243164
|
cwd: dir,
|
|
@@ -243158,13 +243196,20 @@ async function readProjectConfig(projectRoot) {
|
|
|
243158
243196
|
}
|
|
243159
243197
|
const project = result.data;
|
|
243160
243198
|
const configDir = dirname5(configPath);
|
|
243161
|
-
const [
|
|
243199
|
+
const [appEntities, functions, agents, connectors, authConfig] = await Promise.all([
|
|
243162
243200
|
entityResource.readAll(join8(configDir, project.entitiesDir)),
|
|
243163
243201
|
functionResource.readAll(join8(configDir, project.functionsDir)),
|
|
243164
243202
|
agentResource.readAll(join8(configDir, project.agentsDir)),
|
|
243165
243203
|
connectorResource.readAll(join8(configDir, project.connectorsDir)),
|
|
243166
243204
|
authConfigResource.readAll(join8(configDir, project.authDir))
|
|
243167
243205
|
]);
|
|
243206
|
+
let entities = appEntities;
|
|
243207
|
+
for (const pluginRef of project.plugins) {
|
|
243208
|
+
const plugin = await readProjectConfig(resolvePluginRoot(pluginRef, root));
|
|
243209
|
+
entities = mergeEntities(appEntities, plugin.entities);
|
|
243210
|
+
functions.push(...plugin.functions);
|
|
243211
|
+
agents.push(...plugin.agents);
|
|
243212
|
+
}
|
|
243168
243213
|
return {
|
|
243169
243214
|
project: { ...project, root, configPath },
|
|
243170
243215
|
entities,
|
|
@@ -243541,7 +243586,7 @@ async function createProjectFilesForExistingProject(options) {
|
|
|
243541
243586
|
};
|
|
243542
243587
|
}
|
|
243543
243588
|
// src/core/project/deploy.ts
|
|
243544
|
-
import { resolve } from "node:path";
|
|
243589
|
+
import { resolve as resolve2 } from "node:path";
|
|
243545
243590
|
|
|
243546
243591
|
// src/core/site/api.ts
|
|
243547
243592
|
async function uploadSite(archivePath) {
|
|
@@ -243630,7 +243675,7 @@ async function deployAll(projectData, options) {
|
|
|
243630
243675
|
await authConfigResource.push(authConfig);
|
|
243631
243676
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
243632
243677
|
if (project.site?.outputDirectory) {
|
|
243633
|
-
const outputDir =
|
|
243678
|
+
const outputDir = resolve2(project.root, project.site.outputDirectory);
|
|
243634
243679
|
const { appUrl } = await deploySite(outputDir);
|
|
243635
243680
|
return { appUrl, connectorResults };
|
|
243636
243681
|
}
|
|
@@ -245445,8 +245490,8 @@ var disconnect = (anyProcess) => {
|
|
|
245445
245490
|
// ../../node_modules/execa/lib/utils/deferred.js
|
|
245446
245491
|
var createDeferred = () => {
|
|
245447
245492
|
const methods = {};
|
|
245448
|
-
const promise2 = new Promise((
|
|
245449
|
-
Object.assign(methods, { resolve:
|
|
245493
|
+
const promise2 = new Promise((resolve3, reject) => {
|
|
245494
|
+
Object.assign(methods, { resolve: resolve3, reject });
|
|
245450
245495
|
});
|
|
245451
245496
|
return Object.assign(promise2, methods);
|
|
245452
245497
|
};
|
|
@@ -249810,11 +249855,11 @@ var addConcurrentStream = (concurrentStreams, stream, waitName) => {
|
|
|
249810
249855
|
const promises = weakMap.get(stream);
|
|
249811
249856
|
const promise2 = createDeferred();
|
|
249812
249857
|
promises.push(promise2);
|
|
249813
|
-
const
|
|
249814
|
-
return { resolve:
|
|
249858
|
+
const resolve3 = promise2.resolve.bind(promise2);
|
|
249859
|
+
return { resolve: resolve3, promises };
|
|
249815
249860
|
};
|
|
249816
|
-
var waitForConcurrentStreams = async ({ resolve:
|
|
249817
|
-
|
|
249861
|
+
var waitForConcurrentStreams = async ({ resolve: resolve3, promises }, subprocess) => {
|
|
249862
|
+
resolve3();
|
|
249818
249863
|
const [isSubprocessExit] = await Promise.race([
|
|
249819
249864
|
Promise.allSettled([true, subprocess]),
|
|
249820
249865
|
Promise.all([false, ...promises])
|
|
@@ -250941,7 +250986,7 @@ function getAuthPushCommand() {
|
|
|
250941
250986
|
}
|
|
250942
250987
|
|
|
250943
250988
|
// src/cli/commands/auth/social-login.ts
|
|
250944
|
-
import { dirname as dirname10, join as join15, resolve as
|
|
250989
|
+
import { dirname as dirname10, join as join15, resolve as resolve3 } from "node:path";
|
|
250945
250990
|
var PROVIDER_LABELS = {
|
|
250946
250991
|
google: "Google",
|
|
250947
250992
|
microsoft: "Microsoft",
|
|
@@ -250981,7 +251026,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask: runTask2 }, p
|
|
|
250981
251026
|
let clientSecret;
|
|
250982
251027
|
if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
|
|
250983
251028
|
if (options.envFile) {
|
|
250984
|
-
const secrets = await parseEnvFile(
|
|
251029
|
+
const secrets = await parseEnvFile(resolve3(options.envFile));
|
|
250985
251030
|
const value = secrets[oauthCli.envVar];
|
|
250986
251031
|
if (!value) {
|
|
250987
251032
|
throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
|
|
@@ -251636,19 +251681,19 @@ var baseOpen = async (options) => {
|
|
|
251636
251681
|
}
|
|
251637
251682
|
const subprocess = childProcess3.spawn(command2, cliArguments, childProcessOptions);
|
|
251638
251683
|
if (options.wait) {
|
|
251639
|
-
return new Promise((
|
|
251684
|
+
return new Promise((resolve4, reject) => {
|
|
251640
251685
|
subprocess.once("error", reject);
|
|
251641
251686
|
subprocess.once("close", (exitCode) => {
|
|
251642
251687
|
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
251643
251688
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
251644
251689
|
return;
|
|
251645
251690
|
}
|
|
251646
|
-
|
|
251691
|
+
resolve4(subprocess);
|
|
251647
251692
|
});
|
|
251648
251693
|
});
|
|
251649
251694
|
}
|
|
251650
251695
|
if (isFallbackAttempt) {
|
|
251651
|
-
return new Promise((
|
|
251696
|
+
return new Promise((resolve4, reject) => {
|
|
251652
251697
|
subprocess.once("error", reject);
|
|
251653
251698
|
subprocess.once("spawn", () => {
|
|
251654
251699
|
subprocess.once("close", (exitCode) => {
|
|
@@ -251658,17 +251703,17 @@ var baseOpen = async (options) => {
|
|
|
251658
251703
|
return;
|
|
251659
251704
|
}
|
|
251660
251705
|
subprocess.unref();
|
|
251661
|
-
|
|
251706
|
+
resolve4(subprocess);
|
|
251662
251707
|
});
|
|
251663
251708
|
});
|
|
251664
251709
|
});
|
|
251665
251710
|
}
|
|
251666
251711
|
subprocess.unref();
|
|
251667
|
-
return new Promise((
|
|
251712
|
+
return new Promise((resolve4, reject) => {
|
|
251668
251713
|
subprocess.once("error", reject);
|
|
251669
251714
|
subprocess.once("spawn", () => {
|
|
251670
251715
|
subprocess.off("error", reject);
|
|
251671
|
-
|
|
251716
|
+
resolve4(subprocess);
|
|
251672
251717
|
});
|
|
251673
251718
|
});
|
|
251674
251719
|
};
|
|
@@ -252209,7 +252254,7 @@ function getFunctionsCommand() {
|
|
|
252209
252254
|
}
|
|
252210
252255
|
|
|
252211
252256
|
// src/cli/commands/project/create.ts
|
|
252212
|
-
import { basename as basename3, join as join18, resolve as
|
|
252257
|
+
import { basename as basename3, join as join18, resolve as resolve4 } from "node:path";
|
|
252213
252258
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
252214
252259
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
252215
252260
|
async function getTemplateById(templateId) {
|
|
@@ -252274,7 +252319,7 @@ async function createInteractive(options, ctx) {
|
|
|
252274
252319
|
}, ctx);
|
|
252275
252320
|
}
|
|
252276
252321
|
async function createNonInteractive(options, ctx) {
|
|
252277
|
-
ctx.log.info(`Creating a new project at ${
|
|
252322
|
+
ctx.log.info(`Creating a new project at ${resolve4(options.path)}`);
|
|
252278
252323
|
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
252279
252324
|
return await executeCreate({
|
|
252280
252325
|
template: template2,
|
|
@@ -252295,7 +252340,7 @@ async function executeCreate({
|
|
|
252295
252340
|
isInteractive
|
|
252296
252341
|
}, { log, runTask: runTask2 }) {
|
|
252297
252342
|
const name2 = rawName.trim();
|
|
252298
|
-
const resolvedPath =
|
|
252343
|
+
const resolvedPath = resolve4(projectPath);
|
|
252299
252344
|
const { projectId } = await runTask2("Setting up your project...", async () => {
|
|
252300
252345
|
return await createProjectFiles({
|
|
252301
252346
|
name: name2,
|
|
@@ -252811,7 +252856,7 @@ function getSecretsListCommand() {
|
|
|
252811
252856
|
}
|
|
252812
252857
|
|
|
252813
252858
|
// src/cli/commands/secrets/set.ts
|
|
252814
|
-
import { resolve as
|
|
252859
|
+
import { resolve as resolve5 } from "node:path";
|
|
252815
252860
|
function parseEntries(entries) {
|
|
252816
252861
|
const secrets = {};
|
|
252817
252862
|
for (const entry of entries) {
|
|
@@ -252842,7 +252887,7 @@ async function setSecretsAction({ log, runTask: runTask2 }, entries, options) {
|
|
|
252842
252887
|
validateInput(entries, options);
|
|
252843
252888
|
let secrets;
|
|
252844
252889
|
if (options.envFile) {
|
|
252845
|
-
secrets = await parseEnvFile(
|
|
252890
|
+
secrets = await parseEnvFile(resolve5(options.envFile));
|
|
252846
252891
|
if (Object.keys(secrets).length === 0) {
|
|
252847
252892
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
252848
252893
|
}
|
|
@@ -252871,7 +252916,7 @@ function getSecretsCommand() {
|
|
|
252871
252916
|
}
|
|
252872
252917
|
|
|
252873
252918
|
// src/cli/commands/site/deploy.ts
|
|
252874
|
-
import { resolve as
|
|
252919
|
+
import { resolve as resolve6 } from "node:path";
|
|
252875
252920
|
async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
252876
252921
|
if (isNonInteractive && !options.yes) {
|
|
252877
252922
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
@@ -252886,7 +252931,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
|
|
|
252886
252931
|
]
|
|
252887
252932
|
});
|
|
252888
252933
|
}
|
|
252889
|
-
const outputDir =
|
|
252934
|
+
const outputDir = resolve6(project2.root, project2.site.outputDirectory);
|
|
252890
252935
|
if (!options.yes) {
|
|
252891
252936
|
const shouldDeploy = await Re({
|
|
252892
252937
|
message: `Deploy site from ${project2.site.outputDirectory}?`
|
|
@@ -253090,14 +253135,14 @@ var getLocalHosts = () => {
|
|
|
253090
253135
|
}
|
|
253091
253136
|
return results;
|
|
253092
253137
|
};
|
|
253093
|
-
var checkAvailablePort = (options8) => new Promise((
|
|
253138
|
+
var checkAvailablePort = (options8) => new Promise((resolve8, reject) => {
|
|
253094
253139
|
const server = net.createServer();
|
|
253095
253140
|
server.unref();
|
|
253096
253141
|
server.on("error", reject);
|
|
253097
253142
|
server.listen(options8, () => {
|
|
253098
253143
|
const { port } = server.address();
|
|
253099
253144
|
server.close(() => {
|
|
253100
|
-
|
|
253145
|
+
resolve8(port);
|
|
253101
253146
|
});
|
|
253102
253147
|
});
|
|
253103
253148
|
});
|
|
@@ -253357,7 +253402,7 @@ class FunctionManager {
|
|
|
253357
253402
|
});
|
|
253358
253403
|
}
|
|
253359
253404
|
waitForReady(name2, runningFunc) {
|
|
253360
|
-
return new Promise((
|
|
253405
|
+
return new Promise((resolve8, reject) => {
|
|
253361
253406
|
runningFunc.process.on("exit", (code2) => {
|
|
253362
253407
|
if (!runningFunc.ready) {
|
|
253363
253408
|
clearTimeout(timeout3);
|
|
@@ -253380,7 +253425,7 @@ class FunctionManager {
|
|
|
253380
253425
|
runningFunc.ready = true;
|
|
253381
253426
|
clearTimeout(timeout3);
|
|
253382
253427
|
runningFunc.process.stdout?.off("data", onData);
|
|
253383
|
-
|
|
253428
|
+
resolve8(runningFunc.port);
|
|
253384
253429
|
}
|
|
253385
253430
|
};
|
|
253386
253431
|
runningFunc.process.stdout?.on("data", onData);
|
|
@@ -255419,7 +255464,7 @@ class NodeFsHandler {
|
|
|
255419
255464
|
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
255420
255465
|
}
|
|
255421
255466
|
}).on(EV.ERROR, this._boundHandleError);
|
|
255422
|
-
return new Promise((
|
|
255467
|
+
return new Promise((resolve9, reject) => {
|
|
255423
255468
|
if (!stream)
|
|
255424
255469
|
return reject();
|
|
255425
255470
|
stream.once(STR_END, () => {
|
|
@@ -255428,7 +255473,7 @@ class NodeFsHandler {
|
|
|
255428
255473
|
return;
|
|
255429
255474
|
}
|
|
255430
255475
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
255431
|
-
|
|
255476
|
+
resolve9(undefined);
|
|
255432
255477
|
previous.getChildren().filter((item) => {
|
|
255433
255478
|
return item !== directory && !current.has(item);
|
|
255434
255479
|
}).forEach((item) => {
|
|
@@ -256339,7 +256384,7 @@ async function createDevServer(options8) {
|
|
|
256339
256384
|
}
|
|
256340
256385
|
remoteProxy(req, res, next);
|
|
256341
256386
|
});
|
|
256342
|
-
const server = await new Promise((
|
|
256387
|
+
const server = await new Promise((resolve10, reject) => {
|
|
256343
256388
|
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
256344
256389
|
if (err) {
|
|
256345
256390
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
@@ -256348,7 +256393,7 @@ async function createDevServer(options8) {
|
|
|
256348
256393
|
reject(err);
|
|
256349
256394
|
}
|
|
256350
256395
|
} else {
|
|
256351
|
-
|
|
256396
|
+
resolve10(s5);
|
|
256352
256397
|
}
|
|
256353
256398
|
});
|
|
256354
256399
|
});
|
|
@@ -256465,13 +256510,13 @@ async function runScript(options8) {
|
|
|
256465
256510
|
}
|
|
256466
256511
|
// src/cli/commands/exec.ts
|
|
256467
256512
|
function readStdin2() {
|
|
256468
|
-
return new Promise((
|
|
256513
|
+
return new Promise((resolve10, reject) => {
|
|
256469
256514
|
let data = "";
|
|
256470
256515
|
process.stdin.setEncoding("utf-8");
|
|
256471
256516
|
process.stdin.on("data", (chunk) => {
|
|
256472
256517
|
data += chunk;
|
|
256473
256518
|
});
|
|
256474
|
-
process.stdin.on("end", () =>
|
|
256519
|
+
process.stdin.on("end", () => resolve10(data));
|
|
256475
256520
|
process.stdin.on("error", reject);
|
|
256476
256521
|
});
|
|
256477
256522
|
}
|
|
@@ -256510,7 +256555,7 @@ Examples:
|
|
|
256510
256555
|
}
|
|
256511
256556
|
|
|
256512
256557
|
// src/cli/commands/project/eject.ts
|
|
256513
|
-
import { resolve as
|
|
256558
|
+
import { resolve as resolve10 } from "node:path";
|
|
256514
256559
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
256515
256560
|
async function eject(ctx, options8) {
|
|
256516
256561
|
const { log, runTask: runTask2, isNonInteractive } = ctx;
|
|
@@ -256566,7 +256611,7 @@ async function eject(ctx, options8) {
|
|
|
256566
256611
|
Ne("Operation cancelled.");
|
|
256567
256612
|
throw new CLIExitError(0);
|
|
256568
256613
|
}
|
|
256569
|
-
const resolvedPath =
|
|
256614
|
+
const resolvedPath = resolve10(selectedPath);
|
|
256570
256615
|
await runTask2("Downloading your project's code...", async (updateMessage) => {
|
|
256571
256616
|
await createProjectFilesForExistingProject({
|
|
256572
256617
|
projectId,
|
|
@@ -258934,14 +258979,14 @@ async function addSourceContext(frames) {
|
|
|
258934
258979
|
return frames;
|
|
258935
258980
|
}
|
|
258936
258981
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
258937
|
-
return new Promise((
|
|
258982
|
+
return new Promise((resolve11) => {
|
|
258938
258983
|
const stream = createReadStream2(path19);
|
|
258939
258984
|
const lineReaded = createInterface2({
|
|
258940
258985
|
input: stream
|
|
258941
258986
|
});
|
|
258942
258987
|
function destroyStreamAndResolve() {
|
|
258943
258988
|
stream.destroy();
|
|
258944
|
-
|
|
258989
|
+
resolve11();
|
|
258945
258990
|
}
|
|
258946
258991
|
let lineNumber = 0;
|
|
258947
258992
|
let currentRangeIndex = 0;
|
|
@@ -260053,15 +260098,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
260053
260098
|
return true;
|
|
260054
260099
|
if (this.featureFlagsPoller === undefined)
|
|
260055
260100
|
return false;
|
|
260056
|
-
return new Promise((
|
|
260101
|
+
return new Promise((resolve11) => {
|
|
260057
260102
|
const timeout3 = setTimeout(() => {
|
|
260058
260103
|
cleanup();
|
|
260059
|
-
|
|
260104
|
+
resolve11(false);
|
|
260060
260105
|
}, timeoutMs);
|
|
260061
260106
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
260062
260107
|
clearTimeout(timeout3);
|
|
260063
260108
|
cleanup();
|
|
260064
|
-
|
|
260109
|
+
resolve11(count2 > 0);
|
|
260065
260110
|
});
|
|
260066
260111
|
});
|
|
260067
260112
|
}
|
|
@@ -260884,4 +260929,4 @@ export {
|
|
|
260884
260929
|
CLIExitError
|
|
260885
260930
|
};
|
|
260886
260931
|
|
|
260887
|
-
//# debugId=
|
|
260932
|
+
//# debugId=9C297F3E77E38E4B64756E2164756E21
|