@base44-preview/cli 0.0.36-pr.339.312de33 → 0.0.36-pr.339.4ca0d22
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 +442 -17
- package/dist/cli/index.js.map +9 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
function __accessProp(key) {
|
|
8
|
+
return this[key];
|
|
9
|
+
}
|
|
10
|
+
var __toESMCache_node;
|
|
11
|
+
var __toESMCache_esm;
|
|
7
12
|
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
+
var canCache = mod != null && typeof mod === "object";
|
|
14
|
+
if (canCache) {
|
|
15
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
+
var cached = cache.get(mod);
|
|
17
|
+
if (cached)
|
|
18
|
+
return cached;
|
|
19
|
+
}
|
|
8
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
22
|
for (let key of __getOwnPropNames(mod))
|
|
11
23
|
if (!__hasOwnProp.call(to, key))
|
|
12
24
|
__defProp(to, key, {
|
|
13
|
-
get: (
|
|
25
|
+
get: __accessProp.bind(mod, key),
|
|
14
26
|
enumerable: true
|
|
15
27
|
});
|
|
28
|
+
if (canCache)
|
|
29
|
+
cache.set(mod, to);
|
|
16
30
|
return to;
|
|
17
31
|
};
|
|
18
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
+
var __returnValue = (v) => v;
|
|
34
|
+
function __exportSetter(name, newValue) {
|
|
35
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
+
}
|
|
19
37
|
var __export = (target, all) => {
|
|
20
38
|
for (var name in all)
|
|
21
39
|
__defProp(target, name, {
|
|
22
40
|
get: all[name],
|
|
23
41
|
enumerable: true,
|
|
24
42
|
configurable: true,
|
|
25
|
-
set: (
|
|
43
|
+
set: __exportSetter.bind(all, name)
|
|
26
44
|
});
|
|
27
45
|
};
|
|
28
46
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -163119,6 +163137,389 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
163119
163137
|
__exportStar(require_legacy(), exports);
|
|
163120
163138
|
});
|
|
163121
163139
|
|
|
163140
|
+
// node_modules/tmp/lib/tmp.js
|
|
163141
|
+
var require_tmp = __commonJS((exports, module) => {
|
|
163142
|
+
/*!
|
|
163143
|
+
* Tmp
|
|
163144
|
+
*
|
|
163145
|
+
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
|
163146
|
+
*
|
|
163147
|
+
* MIT Licensed
|
|
163148
|
+
*/
|
|
163149
|
+
var fs28 = __require("fs");
|
|
163150
|
+
var os10 = __require("os");
|
|
163151
|
+
var path18 = __require("path");
|
|
163152
|
+
var crypto = __require("crypto");
|
|
163153
|
+
var _c3 = { fs: fs28.constants, os: os10.constants };
|
|
163154
|
+
var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
163155
|
+
var TEMPLATE_PATTERN = /XXXXXX/;
|
|
163156
|
+
var DEFAULT_TRIES = 3;
|
|
163157
|
+
var CREATE_FLAGS = (_c3.O_CREAT || _c3.fs.O_CREAT) | (_c3.O_EXCL || _c3.fs.O_EXCL) | (_c3.O_RDWR || _c3.fs.O_RDWR);
|
|
163158
|
+
var IS_WIN32 = os10.platform() === "win32";
|
|
163159
|
+
var EBADF = _c3.EBADF || _c3.os.errno.EBADF;
|
|
163160
|
+
var ENOENT = _c3.ENOENT || _c3.os.errno.ENOENT;
|
|
163161
|
+
var DIR_MODE = 448;
|
|
163162
|
+
var FILE_MODE = 384;
|
|
163163
|
+
var EXIT = "exit";
|
|
163164
|
+
var _removeObjects = [];
|
|
163165
|
+
var FN_RMDIR_SYNC = fs28.rmdirSync.bind(fs28);
|
|
163166
|
+
var _gracefulCleanup = false;
|
|
163167
|
+
function rimraf(dirPath, callback) {
|
|
163168
|
+
return fs28.rm(dirPath, { recursive: true }, callback);
|
|
163169
|
+
}
|
|
163170
|
+
function FN_RIMRAF_SYNC(dirPath) {
|
|
163171
|
+
return fs28.rmSync(dirPath, { recursive: true });
|
|
163172
|
+
}
|
|
163173
|
+
function tmpName(options8, callback) {
|
|
163174
|
+
const args = _parseArguments(options8, callback), opts = args[0], cb2 = args[1];
|
|
163175
|
+
_assertAndSanitizeOptions(opts, function(err, sanitizedOptions) {
|
|
163176
|
+
if (err)
|
|
163177
|
+
return cb2(err);
|
|
163178
|
+
let tries = sanitizedOptions.tries;
|
|
163179
|
+
(function _getUniqueName() {
|
|
163180
|
+
try {
|
|
163181
|
+
const name2 = _generateTmpName(sanitizedOptions);
|
|
163182
|
+
fs28.stat(name2, function(err2) {
|
|
163183
|
+
if (!err2) {
|
|
163184
|
+
if (tries-- > 0)
|
|
163185
|
+
return _getUniqueName();
|
|
163186
|
+
return cb2(new Error("Could not get a unique tmp filename, max tries reached " + name2));
|
|
163187
|
+
}
|
|
163188
|
+
cb2(null, name2);
|
|
163189
|
+
});
|
|
163190
|
+
} catch (err2) {
|
|
163191
|
+
cb2(err2);
|
|
163192
|
+
}
|
|
163193
|
+
})();
|
|
163194
|
+
});
|
|
163195
|
+
}
|
|
163196
|
+
function tmpNameSync(options8) {
|
|
163197
|
+
const args = _parseArguments(options8), opts = args[0];
|
|
163198
|
+
const sanitizedOptions = _assertAndSanitizeOptionsSync(opts);
|
|
163199
|
+
let tries = sanitizedOptions.tries;
|
|
163200
|
+
do {
|
|
163201
|
+
const name2 = _generateTmpName(sanitizedOptions);
|
|
163202
|
+
try {
|
|
163203
|
+
fs28.statSync(name2);
|
|
163204
|
+
} catch (e8) {
|
|
163205
|
+
return name2;
|
|
163206
|
+
}
|
|
163207
|
+
} while (tries-- > 0);
|
|
163208
|
+
throw new Error("Could not get a unique tmp filename, max tries reached");
|
|
163209
|
+
}
|
|
163210
|
+
function file2(options8, callback) {
|
|
163211
|
+
const args = _parseArguments(options8, callback), opts = args[0], cb2 = args[1];
|
|
163212
|
+
tmpName(opts, function _tmpNameCreated(err, name2) {
|
|
163213
|
+
if (err)
|
|
163214
|
+
return cb2(err);
|
|
163215
|
+
fs28.open(name2, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) {
|
|
163216
|
+
if (err2)
|
|
163217
|
+
return cb2(err2);
|
|
163218
|
+
if (opts.discardDescriptor) {
|
|
163219
|
+
return fs28.close(fd, function _discardCallback(possibleErr) {
|
|
163220
|
+
return cb2(possibleErr, name2, undefined, _prepareTmpFileRemoveCallback(name2, -1, opts, false));
|
|
163221
|
+
});
|
|
163222
|
+
} else {
|
|
163223
|
+
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
163224
|
+
cb2(null, name2, fd, _prepareTmpFileRemoveCallback(name2, discardOrDetachDescriptor ? -1 : fd, opts, false));
|
|
163225
|
+
}
|
|
163226
|
+
});
|
|
163227
|
+
});
|
|
163228
|
+
}
|
|
163229
|
+
function fileSync(options8) {
|
|
163230
|
+
const args = _parseArguments(options8), opts = args[0];
|
|
163231
|
+
const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
|
|
163232
|
+
const name2 = tmpNameSync(opts);
|
|
163233
|
+
let fd = fs28.openSync(name2, CREATE_FLAGS, opts.mode || FILE_MODE);
|
|
163234
|
+
if (opts.discardDescriptor) {
|
|
163235
|
+
fs28.closeSync(fd);
|
|
163236
|
+
fd = undefined;
|
|
163237
|
+
}
|
|
163238
|
+
return {
|
|
163239
|
+
name: name2,
|
|
163240
|
+
fd,
|
|
163241
|
+
removeCallback: _prepareTmpFileRemoveCallback(name2, discardOrDetachDescriptor ? -1 : fd, opts, true)
|
|
163242
|
+
};
|
|
163243
|
+
}
|
|
163244
|
+
function dir(options8, callback) {
|
|
163245
|
+
const args = _parseArguments(options8, callback), opts = args[0], cb2 = args[1];
|
|
163246
|
+
tmpName(opts, function _tmpNameCreated(err, name2) {
|
|
163247
|
+
if (err)
|
|
163248
|
+
return cb2(err);
|
|
163249
|
+
fs28.mkdir(name2, opts.mode || DIR_MODE, function _dirCreated(err2) {
|
|
163250
|
+
if (err2)
|
|
163251
|
+
return cb2(err2);
|
|
163252
|
+
cb2(null, name2, _prepareTmpDirRemoveCallback(name2, opts, false));
|
|
163253
|
+
});
|
|
163254
|
+
});
|
|
163255
|
+
}
|
|
163256
|
+
function dirSync(options8) {
|
|
163257
|
+
const args = _parseArguments(options8), opts = args[0];
|
|
163258
|
+
const name2 = tmpNameSync(opts);
|
|
163259
|
+
fs28.mkdirSync(name2, opts.mode || DIR_MODE);
|
|
163260
|
+
return {
|
|
163261
|
+
name: name2,
|
|
163262
|
+
removeCallback: _prepareTmpDirRemoveCallback(name2, opts, true)
|
|
163263
|
+
};
|
|
163264
|
+
}
|
|
163265
|
+
function _removeFileAsync(fdPath, next) {
|
|
163266
|
+
const _handler = function(err) {
|
|
163267
|
+
if (err && !_isENOENT(err)) {
|
|
163268
|
+
return next(err);
|
|
163269
|
+
}
|
|
163270
|
+
next();
|
|
163271
|
+
};
|
|
163272
|
+
if (0 <= fdPath[0])
|
|
163273
|
+
fs28.close(fdPath[0], function() {
|
|
163274
|
+
fs28.unlink(fdPath[1], _handler);
|
|
163275
|
+
});
|
|
163276
|
+
else
|
|
163277
|
+
fs28.unlink(fdPath[1], _handler);
|
|
163278
|
+
}
|
|
163279
|
+
function _removeFileSync(fdPath) {
|
|
163280
|
+
let rethrownException = null;
|
|
163281
|
+
try {
|
|
163282
|
+
if (0 <= fdPath[0])
|
|
163283
|
+
fs28.closeSync(fdPath[0]);
|
|
163284
|
+
} catch (e8) {
|
|
163285
|
+
if (!_isEBADF(e8) && !_isENOENT(e8))
|
|
163286
|
+
throw e8;
|
|
163287
|
+
} finally {
|
|
163288
|
+
try {
|
|
163289
|
+
fs28.unlinkSync(fdPath[1]);
|
|
163290
|
+
} catch (e8) {
|
|
163291
|
+
if (!_isENOENT(e8))
|
|
163292
|
+
rethrownException = e8;
|
|
163293
|
+
}
|
|
163294
|
+
}
|
|
163295
|
+
if (rethrownException !== null) {
|
|
163296
|
+
throw rethrownException;
|
|
163297
|
+
}
|
|
163298
|
+
}
|
|
163299
|
+
function _prepareTmpFileRemoveCallback(name2, fd, opts, sync) {
|
|
163300
|
+
const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name2], sync);
|
|
163301
|
+
const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name2], sync, removeCallbackSync);
|
|
163302
|
+
if (!opts.keep)
|
|
163303
|
+
_removeObjects.unshift(removeCallbackSync);
|
|
163304
|
+
return sync ? removeCallbackSync : removeCallback;
|
|
163305
|
+
}
|
|
163306
|
+
function _prepareTmpDirRemoveCallback(name2, opts, sync) {
|
|
163307
|
+
const removeFunction = opts.unsafeCleanup ? rimraf : fs28.rmdir.bind(fs28);
|
|
163308
|
+
const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;
|
|
163309
|
+
const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name2, sync);
|
|
163310
|
+
const removeCallback = _prepareRemoveCallback(removeFunction, name2, sync, removeCallbackSync);
|
|
163311
|
+
if (!opts.keep)
|
|
163312
|
+
_removeObjects.unshift(removeCallbackSync);
|
|
163313
|
+
return sync ? removeCallbackSync : removeCallback;
|
|
163314
|
+
}
|
|
163315
|
+
function _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {
|
|
163316
|
+
let called = false;
|
|
163317
|
+
return function _cleanupCallback(next) {
|
|
163318
|
+
if (!called) {
|
|
163319
|
+
const toRemove = cleanupCallbackSync || _cleanupCallback;
|
|
163320
|
+
const index = _removeObjects.indexOf(toRemove);
|
|
163321
|
+
if (index >= 0)
|
|
163322
|
+
_removeObjects.splice(index, 1);
|
|
163323
|
+
called = true;
|
|
163324
|
+
if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {
|
|
163325
|
+
return removeFunction(fileOrDirName);
|
|
163326
|
+
} else {
|
|
163327
|
+
return removeFunction(fileOrDirName, next || function() {});
|
|
163328
|
+
}
|
|
163329
|
+
}
|
|
163330
|
+
};
|
|
163331
|
+
}
|
|
163332
|
+
function _garbageCollector() {
|
|
163333
|
+
if (!_gracefulCleanup)
|
|
163334
|
+
return;
|
|
163335
|
+
while (_removeObjects.length) {
|
|
163336
|
+
try {
|
|
163337
|
+
_removeObjects[0]();
|
|
163338
|
+
} catch (e8) {}
|
|
163339
|
+
}
|
|
163340
|
+
}
|
|
163341
|
+
function _randomChars(howMany) {
|
|
163342
|
+
let value = [], rnd = null;
|
|
163343
|
+
try {
|
|
163344
|
+
rnd = crypto.randomBytes(howMany);
|
|
163345
|
+
} catch (e8) {
|
|
163346
|
+
rnd = crypto.pseudoRandomBytes(howMany);
|
|
163347
|
+
}
|
|
163348
|
+
for (let i5 = 0;i5 < howMany; i5++) {
|
|
163349
|
+
value.push(RANDOM_CHARS[rnd[i5] % RANDOM_CHARS.length]);
|
|
163350
|
+
}
|
|
163351
|
+
return value.join("");
|
|
163352
|
+
}
|
|
163353
|
+
function _isUndefined(obj) {
|
|
163354
|
+
return typeof obj === "undefined";
|
|
163355
|
+
}
|
|
163356
|
+
function _parseArguments(options8, callback) {
|
|
163357
|
+
if (typeof options8 === "function") {
|
|
163358
|
+
return [{}, options8];
|
|
163359
|
+
}
|
|
163360
|
+
if (_isUndefined(options8)) {
|
|
163361
|
+
return [{}, callback];
|
|
163362
|
+
}
|
|
163363
|
+
const actualOptions = {};
|
|
163364
|
+
for (const key2 of Object.getOwnPropertyNames(options8)) {
|
|
163365
|
+
actualOptions[key2] = options8[key2];
|
|
163366
|
+
}
|
|
163367
|
+
return [actualOptions, callback];
|
|
163368
|
+
}
|
|
163369
|
+
function _resolvePath(name2, tmpDir, cb2) {
|
|
163370
|
+
const pathToResolve = path18.isAbsolute(name2) ? name2 : path18.join(tmpDir, name2);
|
|
163371
|
+
fs28.stat(pathToResolve, function(err) {
|
|
163372
|
+
if (err) {
|
|
163373
|
+
fs28.realpath(path18.dirname(pathToResolve), function(err2, parentDir) {
|
|
163374
|
+
if (err2)
|
|
163375
|
+
return cb2(err2);
|
|
163376
|
+
cb2(null, path18.join(parentDir, path18.basename(pathToResolve)));
|
|
163377
|
+
});
|
|
163378
|
+
} else {
|
|
163379
|
+
fs28.realpath(pathToResolve, cb2);
|
|
163380
|
+
}
|
|
163381
|
+
});
|
|
163382
|
+
}
|
|
163383
|
+
function _resolvePathSync(name2, tmpDir) {
|
|
163384
|
+
const pathToResolve = path18.isAbsolute(name2) ? name2 : path18.join(tmpDir, name2);
|
|
163385
|
+
try {
|
|
163386
|
+
fs28.statSync(pathToResolve);
|
|
163387
|
+
return fs28.realpathSync(pathToResolve);
|
|
163388
|
+
} catch (_err) {
|
|
163389
|
+
const parentDir = fs28.realpathSync(path18.dirname(pathToResolve));
|
|
163390
|
+
return path18.join(parentDir, path18.basename(pathToResolve));
|
|
163391
|
+
}
|
|
163392
|
+
}
|
|
163393
|
+
function _generateTmpName(opts) {
|
|
163394
|
+
const tmpDir = opts.tmpdir;
|
|
163395
|
+
if (!_isUndefined(opts.name)) {
|
|
163396
|
+
return path18.join(tmpDir, opts.dir, opts.name);
|
|
163397
|
+
}
|
|
163398
|
+
if (!_isUndefined(opts.template)) {
|
|
163399
|
+
return path18.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
|
|
163400
|
+
}
|
|
163401
|
+
const name2 = [
|
|
163402
|
+
opts.prefix ? opts.prefix : "tmp",
|
|
163403
|
+
"-",
|
|
163404
|
+
process.pid,
|
|
163405
|
+
"-",
|
|
163406
|
+
_randomChars(12),
|
|
163407
|
+
opts.postfix ? "-" + opts.postfix : ""
|
|
163408
|
+
].join("");
|
|
163409
|
+
return path18.join(tmpDir, opts.dir, name2);
|
|
163410
|
+
}
|
|
163411
|
+
function _assertOptionsBase(options8) {
|
|
163412
|
+
if (!_isUndefined(options8.name)) {
|
|
163413
|
+
const name2 = options8.name;
|
|
163414
|
+
if (path18.isAbsolute(name2))
|
|
163415
|
+
throw new Error(`name option must not contain an absolute path, found "${name2}".`);
|
|
163416
|
+
const basename4 = path18.basename(name2);
|
|
163417
|
+
if (basename4 === ".." || basename4 === "." || basename4 !== name2)
|
|
163418
|
+
throw new Error(`name option must not contain a path, found "${name2}".`);
|
|
163419
|
+
}
|
|
163420
|
+
if (!_isUndefined(options8.template) && !options8.template.match(TEMPLATE_PATTERN)) {
|
|
163421
|
+
throw new Error(`Invalid template, found "${options8.template}".`);
|
|
163422
|
+
}
|
|
163423
|
+
if (!_isUndefined(options8.tries) && isNaN(options8.tries) || options8.tries < 0) {
|
|
163424
|
+
throw new Error(`Invalid tries, found "${options8.tries}".`);
|
|
163425
|
+
}
|
|
163426
|
+
options8.tries = _isUndefined(options8.name) ? options8.tries || DEFAULT_TRIES : 1;
|
|
163427
|
+
options8.keep = !!options8.keep;
|
|
163428
|
+
options8.detachDescriptor = !!options8.detachDescriptor;
|
|
163429
|
+
options8.discardDescriptor = !!options8.discardDescriptor;
|
|
163430
|
+
options8.unsafeCleanup = !!options8.unsafeCleanup;
|
|
163431
|
+
options8.prefix = _isUndefined(options8.prefix) ? "" : options8.prefix;
|
|
163432
|
+
options8.postfix = _isUndefined(options8.postfix) ? "" : options8.postfix;
|
|
163433
|
+
}
|
|
163434
|
+
function _getRelativePath(option, name2, tmpDir, cb2) {
|
|
163435
|
+
if (_isUndefined(name2))
|
|
163436
|
+
return cb2(null);
|
|
163437
|
+
_resolvePath(name2, tmpDir, function(err, resolvedPath) {
|
|
163438
|
+
if (err)
|
|
163439
|
+
return cb2(err);
|
|
163440
|
+
const relativePath = path18.relative(tmpDir, resolvedPath);
|
|
163441
|
+
if (!resolvedPath.startsWith(tmpDir)) {
|
|
163442
|
+
return cb2(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`));
|
|
163443
|
+
}
|
|
163444
|
+
cb2(null, relativePath);
|
|
163445
|
+
});
|
|
163446
|
+
}
|
|
163447
|
+
function _getRelativePathSync(option, name2, tmpDir) {
|
|
163448
|
+
if (_isUndefined(name2))
|
|
163449
|
+
return;
|
|
163450
|
+
const resolvedPath = _resolvePathSync(name2, tmpDir);
|
|
163451
|
+
const relativePath = path18.relative(tmpDir, resolvedPath);
|
|
163452
|
+
if (!resolvedPath.startsWith(tmpDir)) {
|
|
163453
|
+
throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`);
|
|
163454
|
+
}
|
|
163455
|
+
return relativePath;
|
|
163456
|
+
}
|
|
163457
|
+
function _assertAndSanitizeOptions(options8, cb2) {
|
|
163458
|
+
_getTmpDir(options8, function(err, tmpDir) {
|
|
163459
|
+
if (err)
|
|
163460
|
+
return cb2(err);
|
|
163461
|
+
options8.tmpdir = tmpDir;
|
|
163462
|
+
try {
|
|
163463
|
+
_assertOptionsBase(options8, tmpDir);
|
|
163464
|
+
} catch (err2) {
|
|
163465
|
+
return cb2(err2);
|
|
163466
|
+
}
|
|
163467
|
+
_getRelativePath("dir", options8.dir, tmpDir, function(err2, dir2) {
|
|
163468
|
+
if (err2)
|
|
163469
|
+
return cb2(err2);
|
|
163470
|
+
options8.dir = _isUndefined(dir2) ? "" : dir2;
|
|
163471
|
+
_getRelativePath("template", options8.template, tmpDir, function(err3, template2) {
|
|
163472
|
+
if (err3)
|
|
163473
|
+
return cb2(err3);
|
|
163474
|
+
options8.template = template2;
|
|
163475
|
+
cb2(null, options8);
|
|
163476
|
+
});
|
|
163477
|
+
});
|
|
163478
|
+
});
|
|
163479
|
+
}
|
|
163480
|
+
function _assertAndSanitizeOptionsSync(options8) {
|
|
163481
|
+
const tmpDir = options8.tmpdir = _getTmpDirSync(options8);
|
|
163482
|
+
_assertOptionsBase(options8, tmpDir);
|
|
163483
|
+
const dir2 = _getRelativePathSync("dir", options8.dir, tmpDir);
|
|
163484
|
+
options8.dir = _isUndefined(dir2) ? "" : dir2;
|
|
163485
|
+
options8.template = _getRelativePathSync("template", options8.template, tmpDir);
|
|
163486
|
+
return options8;
|
|
163487
|
+
}
|
|
163488
|
+
function _isEBADF(error48) {
|
|
163489
|
+
return _isExpectedError(error48, -EBADF, "EBADF");
|
|
163490
|
+
}
|
|
163491
|
+
function _isENOENT(error48) {
|
|
163492
|
+
return _isExpectedError(error48, -ENOENT, "ENOENT");
|
|
163493
|
+
}
|
|
163494
|
+
function _isExpectedError(error48, errno, code2) {
|
|
163495
|
+
return IS_WIN32 ? error48.code === code2 : error48.code === code2 && error48.errno === errno;
|
|
163496
|
+
}
|
|
163497
|
+
function setGracefulCleanup() {
|
|
163498
|
+
_gracefulCleanup = true;
|
|
163499
|
+
}
|
|
163500
|
+
function _getTmpDir(options8, cb2) {
|
|
163501
|
+
return fs28.realpath(options8 && options8.tmpdir || os10.tmpdir(), cb2);
|
|
163502
|
+
}
|
|
163503
|
+
function _getTmpDirSync(options8) {
|
|
163504
|
+
return fs28.realpathSync(options8 && options8.tmpdir || os10.tmpdir());
|
|
163505
|
+
}
|
|
163506
|
+
process.addListener(EXIT, _garbageCollector);
|
|
163507
|
+
Object.defineProperty(exports, "tmpdir", {
|
|
163508
|
+
enumerable: true,
|
|
163509
|
+
configurable: false,
|
|
163510
|
+
get: function() {
|
|
163511
|
+
return _getTmpDirSync();
|
|
163512
|
+
}
|
|
163513
|
+
});
|
|
163514
|
+
exports.dir = dir;
|
|
163515
|
+
exports.dirSync = dirSync;
|
|
163516
|
+
exports.file = file2;
|
|
163517
|
+
exports.fileSync = fileSync;
|
|
163518
|
+
exports.tmpName = tmpName;
|
|
163519
|
+
exports.tmpNameSync = tmpNameSync;
|
|
163520
|
+
exports.setGracefulCleanup = setGracefulCleanup;
|
|
163521
|
+
});
|
|
163522
|
+
|
|
163122
163523
|
// node_modules/@seald-io/nedb/lib/utils.js
|
|
163123
163524
|
var require_utils11 = __commonJS((exports, module) => {
|
|
163124
163525
|
var uniq = (array3, iteratee) => {
|
|
@@ -175265,9 +175666,9 @@ var require_utf8 = __commonJS((exports, module) => {
|
|
|
175265
175666
|
byteCount = byteArray.length;
|
|
175266
175667
|
byteIndex = 0;
|
|
175267
175668
|
var codePoints = [];
|
|
175268
|
-
var
|
|
175269
|
-
while ((
|
|
175270
|
-
codePoints.push(
|
|
175669
|
+
var tmp2;
|
|
175670
|
+
while ((tmp2 = decodeSymbol(strict)) !== false) {
|
|
175671
|
+
codePoints.push(tmp2);
|
|
175271
175672
|
}
|
|
175272
175673
|
return ucs2encode(codePoints);
|
|
175273
175674
|
}
|
|
@@ -209398,7 +209799,7 @@ var require_typedarray = __commonJS((exports) => {
|
|
|
209398
209799
|
ctor.prototype.set = function(index, value) {
|
|
209399
209800
|
if (arguments.length < 1)
|
|
209400
209801
|
throw new SyntaxError("Not enough arguments");
|
|
209401
|
-
var array3, sequence, offset, len, i5, s5, d5, byteOffset, byteLength,
|
|
209802
|
+
var array3, sequence, offset, len, i5, s5, d5, byteOffset, byteLength, tmp2;
|
|
209402
209803
|
if (typeof arguments[0] === "object" && arguments[0].constructor === this.constructor) {
|
|
209403
209804
|
array3 = arguments[0];
|
|
209404
209805
|
offset = ECMAScript.ToUint32(arguments[1]);
|
|
@@ -209408,12 +209809,12 @@ var require_typedarray = __commonJS((exports) => {
|
|
|
209408
209809
|
byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
|
|
209409
209810
|
byteLength = array3.length * this.BYTES_PER_ELEMENT;
|
|
209410
209811
|
if (array3.buffer === this.buffer) {
|
|
209411
|
-
|
|
209812
|
+
tmp2 = [];
|
|
209412
209813
|
for (i5 = 0, s5 = array3.byteOffset;i5 < byteLength; i5 += 1, s5 += 1) {
|
|
209413
|
-
|
|
209814
|
+
tmp2[i5] = array3.buffer._bytes[s5];
|
|
209414
209815
|
}
|
|
209415
209816
|
for (i5 = 0, d5 = byteOffset;i5 < byteLength; i5 += 1, d5 += 1) {
|
|
209416
|
-
this.buffer._bytes[d5] =
|
|
209817
|
+
this.buffer._bytes[d5] = tmp2[i5];
|
|
209417
209818
|
}
|
|
209418
209819
|
} else {
|
|
209419
209820
|
for (i5 = 0, s5 = array3.byteOffset, d5 = byteOffset;i5 < byteLength; i5 += 1, s5 += 1, d5 += 1) {
|
|
@@ -225623,6 +226024,7 @@ class ApiError extends SystemError {
|
|
|
225623
226024
|
requestMethod;
|
|
225624
226025
|
requestBody;
|
|
225625
226026
|
responseBody;
|
|
226027
|
+
requestId;
|
|
225626
226028
|
constructor(message, options, parsedResponse) {
|
|
225627
226029
|
const hints = options?.hints ?? ApiError.getReasonHints(parsedResponse) ?? ApiError.getDefaultHints(options?.statusCode);
|
|
225628
226030
|
super(message, { hints, cause: options?.cause });
|
|
@@ -225631,6 +226033,7 @@ class ApiError extends SystemError {
|
|
|
225631
226033
|
this.requestMethod = options?.requestMethod;
|
|
225632
226034
|
this.requestBody = options?.requestBody;
|
|
225633
226035
|
this.responseBody = options?.responseBody;
|
|
226036
|
+
this.requestId = options?.requestId;
|
|
225634
226037
|
}
|
|
225635
226038
|
static async fromHttpError(error48, context) {
|
|
225636
226039
|
if (error48 instanceof HTTPError) {
|
|
@@ -225649,12 +226052,14 @@ class ApiError extends SystemError {
|
|
|
225649
226052
|
}
|
|
225650
226053
|
const statusCode = ApiError.normalizeStatusCode(error48.response.status, responseBody);
|
|
225651
226054
|
const requestBody = error48.options.context?.__requestBody;
|
|
226055
|
+
const requestId = error48.response.headers.get("X-Request-ID") ?? undefined;
|
|
225652
226056
|
return new ApiError(`Error ${context}: ${message}`, {
|
|
225653
226057
|
statusCode,
|
|
225654
226058
|
requestUrl: error48.request.url,
|
|
225655
226059
|
requestMethod: error48.request.method,
|
|
225656
226060
|
requestBody,
|
|
225657
226061
|
responseBody,
|
|
226062
|
+
requestId,
|
|
225658
226063
|
cause: error48
|
|
225659
226064
|
}, parsedErrorResponse);
|
|
225660
226065
|
}
|
|
@@ -243108,7 +243513,6 @@ function getTypesCommand(context) {
|
|
|
243108
243513
|
}
|
|
243109
243514
|
|
|
243110
243515
|
// src/cli/dev/dev-server/main.ts
|
|
243111
|
-
import { dirname as dirname12, join as join16 } from "node:path";
|
|
243112
243516
|
var import_cors = __toESM(require_lib4(), 1);
|
|
243113
243517
|
var import_express4 = __toESM(require_express(), 1);
|
|
243114
243518
|
|
|
@@ -243229,6 +243633,19 @@ async function getPorts(options8) {
|
|
|
243229
243633
|
// src/cli/dev/dev-server/main.ts
|
|
243230
243634
|
var import_http_proxy_middleware2 = __toESM(require_dist2(), 1);
|
|
243231
243635
|
|
|
243636
|
+
// node_modules/tmp-promise/index.js
|
|
243637
|
+
var { promisify: promisify11 } = __require("util");
|
|
243638
|
+
var tmp = require_tmp();
|
|
243639
|
+
var $fileSync = tmp.fileSync;
|
|
243640
|
+
var fileWithOptions = promisify11((options8, cb2) => tmp.file(options8, (err, path18, fd, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, fd, cleanup: promisify11(cleanup) })));
|
|
243641
|
+
var $dirSync = tmp.dirSync;
|
|
243642
|
+
var dirWithOptions = promisify11((options8, cb2) => tmp.dir(options8, (err, path18, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, cleanup: promisify11(cleanup) })));
|
|
243643
|
+
var $dir = async (options8) => dirWithOptions(options8);
|
|
243644
|
+
var $tmpNameSync = tmp.tmpNameSync;
|
|
243645
|
+
var $tmpName = promisify11(tmp.tmpName);
|
|
243646
|
+
var $tmpdir = tmp.tmpdir;
|
|
243647
|
+
var $setGracefulCleanup = tmp.setGracefulCleanup;
|
|
243648
|
+
|
|
243232
243649
|
// src/cli/dev/createDevLogger.ts
|
|
243233
243650
|
var colorByType = {
|
|
243234
243651
|
error: theme.styles.error,
|
|
@@ -243795,6 +244212,13 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
243795
244212
|
req.url = req.originalUrl;
|
|
243796
244213
|
remoteProxy(req, res, next);
|
|
243797
244214
|
});
|
|
244215
|
+
router.use((err, _req, res, next) => {
|
|
244216
|
+
if (err instanceof import_multer.default.MulterError) {
|
|
244217
|
+
res.status(err.code === "LIMIT_FILE_SIZE" ? 413 : 400).json({ error: err.message });
|
|
244218
|
+
return;
|
|
244219
|
+
}
|
|
244220
|
+
next(err);
|
|
244221
|
+
});
|
|
243798
244222
|
return router;
|
|
243799
244223
|
}
|
|
243800
244224
|
function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
@@ -243846,15 +244270,15 @@ async function createDevServer(options8) {
|
|
|
243846
244270
|
let emitEntityEvent = () => {};
|
|
243847
244271
|
const entityRoutes = createEntityRoutes(db2, devLogger, remoteProxy, (...args) => emitEntityEvent(...args));
|
|
243848
244272
|
app.use("/api/apps/:appId/entities", entityRoutes);
|
|
243849
|
-
const
|
|
243850
|
-
const mediaFilesDir = join16(configDir, "tmp", "files");
|
|
244273
|
+
const { path: mediaFilesDir } = await $dir();
|
|
243851
244274
|
app.use("/media", import_express4.default.static(mediaFilesDir));
|
|
243852
244275
|
const integrationRoutes = createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, devLogger);
|
|
243853
244276
|
app.use("/api/apps/:appId/integration-endpoints", integrationRoutes);
|
|
243854
244277
|
const customIntegrationRoutes = createCustomIntegrationRoutes(remoteProxy, devLogger);
|
|
243855
244278
|
app.use("/api/apps/:appId/integrations/custom", customIntegrationRoutes);
|
|
243856
244279
|
app.use((req, res, next) => {
|
|
243857
|
-
|
|
244280
|
+
devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
|
|
244281
|
+
remoteProxy(req, res, next);
|
|
243858
244282
|
});
|
|
243859
244283
|
return new Promise((resolve6, reject) => {
|
|
243860
244284
|
const server = app.listen(port, "127.0.0.1", (err) => {
|
|
@@ -244031,7 +244455,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
244031
244455
|
import { release, type } from "node:os";
|
|
244032
244456
|
|
|
244033
244457
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
244034
|
-
import { dirname as
|
|
244458
|
+
import { dirname as dirname12, posix, sep } from "path";
|
|
244035
244459
|
function createModulerModifier() {
|
|
244036
244460
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
244037
244461
|
return async (frames) => {
|
|
@@ -244040,7 +244464,7 @@ function createModulerModifier() {
|
|
|
244040
244464
|
return frames;
|
|
244041
244465
|
};
|
|
244042
244466
|
}
|
|
244043
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
244467
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname12(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
|
|
244044
244468
|
const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
|
|
244045
244469
|
return (filename) => {
|
|
244046
244470
|
if (!filename)
|
|
@@ -248146,7 +248570,8 @@ class ErrorReporter {
|
|
|
248146
248570
|
api_request_url: error48.requestUrl,
|
|
248147
248571
|
api_request_method: error48.requestMethod,
|
|
248148
248572
|
api_request_body: error48.requestBody,
|
|
248149
|
-
api_response_body: error48.responseBody
|
|
248573
|
+
api_response_body: error48.responseBody,
|
|
248574
|
+
api_request_id: error48.requestId
|
|
248150
248575
|
} : {};
|
|
248151
248576
|
return {
|
|
248152
248577
|
session_id: this.sessionId,
|
|
@@ -248257,4 +248682,4 @@ export {
|
|
|
248257
248682
|
CLIExitError
|
|
248258
248683
|
};
|
|
248259
248684
|
|
|
248260
|
-
//# debugId=
|
|
248685
|
+
//# debugId=81D3CE8AEC065B8B64756E2164756E21
|