@sinoia/hubdoc-tools 1.7.0 → 1.8.0
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/cli.js +1394 -819
- package/package.json +3 -2
package/cli.js
CHANGED
|
@@ -925,8 +925,8 @@ var require_command = __commonJS({
|
|
|
925
925
|
"node_modules/commander/lib/command.js"(exports2) {
|
|
926
926
|
var EventEmitter3 = require("events").EventEmitter;
|
|
927
927
|
var childProcess = require("child_process");
|
|
928
|
-
var
|
|
929
|
-
var
|
|
928
|
+
var path25 = require("path");
|
|
929
|
+
var fs21 = require("fs");
|
|
930
930
|
var process3 = require("process");
|
|
931
931
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
932
932
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -1749,10 +1749,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1749
1749
|
let launchWithNode = false;
|
|
1750
1750
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
1751
1751
|
function findFile(baseDir, baseName) {
|
|
1752
|
-
const localBin =
|
|
1753
|
-
if (
|
|
1754
|
-
if (sourceExt.includes(
|
|
1755
|
-
const foundExt = sourceExt.find((ext2) =>
|
|
1752
|
+
const localBin = path25.resolve(baseDir, baseName);
|
|
1753
|
+
if (fs21.existsSync(localBin)) return localBin;
|
|
1754
|
+
if (sourceExt.includes(path25.extname(baseName))) return void 0;
|
|
1755
|
+
const foundExt = sourceExt.find((ext2) => fs21.existsSync(`${localBin}${ext2}`));
|
|
1756
1756
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
1757
1757
|
return void 0;
|
|
1758
1758
|
}
|
|
@@ -1763,23 +1763,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1763
1763
|
if (this._scriptPath) {
|
|
1764
1764
|
let resolvedScriptPath;
|
|
1765
1765
|
try {
|
|
1766
|
-
resolvedScriptPath =
|
|
1766
|
+
resolvedScriptPath = fs21.realpathSync(this._scriptPath);
|
|
1767
1767
|
} catch (err) {
|
|
1768
1768
|
resolvedScriptPath = this._scriptPath;
|
|
1769
1769
|
}
|
|
1770
|
-
executableDir =
|
|
1770
|
+
executableDir = path25.resolve(path25.dirname(resolvedScriptPath), executableDir);
|
|
1771
1771
|
}
|
|
1772
1772
|
if (executableDir) {
|
|
1773
1773
|
let localFile = findFile(executableDir, executableFile);
|
|
1774
1774
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
1775
|
-
const legacyName =
|
|
1775
|
+
const legacyName = path25.basename(this._scriptPath, path25.extname(this._scriptPath));
|
|
1776
1776
|
if (legacyName !== this._name) {
|
|
1777
1777
|
localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
|
|
1778
1778
|
}
|
|
1779
1779
|
}
|
|
1780
1780
|
executableFile = localFile || executableFile;
|
|
1781
1781
|
}
|
|
1782
|
-
launchWithNode = sourceExt.includes(
|
|
1782
|
+
launchWithNode = sourceExt.includes(path25.extname(executableFile));
|
|
1783
1783
|
let proc2;
|
|
1784
1784
|
if (process3.platform !== "win32") {
|
|
1785
1785
|
if (launchWithNode) {
|
|
@@ -2562,7 +2562,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2562
2562
|
* @return {Command}
|
|
2563
2563
|
*/
|
|
2564
2564
|
nameFromFilename(filename) {
|
|
2565
|
-
this._name =
|
|
2565
|
+
this._name = path25.basename(filename, path25.extname(filename));
|
|
2566
2566
|
return this;
|
|
2567
2567
|
}
|
|
2568
2568
|
/**
|
|
@@ -2576,9 +2576,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2576
2576
|
* @param {string} [path]
|
|
2577
2577
|
* @return {string|null|Command}
|
|
2578
2578
|
*/
|
|
2579
|
-
executableDir(
|
|
2580
|
-
if (
|
|
2581
|
-
this._executableDir =
|
|
2579
|
+
executableDir(path26) {
|
|
2580
|
+
if (path26 === void 0) return this._executableDir;
|
|
2581
|
+
this._executableDir = path26;
|
|
2582
2582
|
return this;
|
|
2583
2583
|
}
|
|
2584
2584
|
/**
|
|
@@ -3638,15 +3638,15 @@ var require_route = __commonJS({
|
|
|
3638
3638
|
};
|
|
3639
3639
|
}
|
|
3640
3640
|
function wrapConversion(toModel, graph) {
|
|
3641
|
-
const
|
|
3641
|
+
const path25 = [graph[toModel].parent, toModel];
|
|
3642
3642
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
3643
3643
|
let cur = graph[toModel].parent;
|
|
3644
3644
|
while (graph[cur].parent) {
|
|
3645
|
-
|
|
3645
|
+
path25.unshift(graph[cur].parent);
|
|
3646
3646
|
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
3647
3647
|
cur = graph[cur].parent;
|
|
3648
3648
|
}
|
|
3649
|
-
fn.conversion =
|
|
3649
|
+
fn.conversion = path25;
|
|
3650
3650
|
return fn;
|
|
3651
3651
|
}
|
|
3652
3652
|
module2.exports = function(fromModel) {
|
|
@@ -3886,7 +3886,7 @@ var require_has_flag = __commonJS({
|
|
|
3886
3886
|
var require_supports_color = __commonJS({
|
|
3887
3887
|
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
3888
3888
|
"use strict";
|
|
3889
|
-
var
|
|
3889
|
+
var os9 = require("os");
|
|
3890
3890
|
var tty = require("tty");
|
|
3891
3891
|
var hasFlag = require_has_flag();
|
|
3892
3892
|
var { env } = process;
|
|
@@ -3934,7 +3934,7 @@ var require_supports_color = __commonJS({
|
|
|
3934
3934
|
return min;
|
|
3935
3935
|
}
|
|
3936
3936
|
if (process.platform === "win32") {
|
|
3937
|
-
const osRelease =
|
|
3937
|
+
const osRelease = os9.release().split(".");
|
|
3938
3938
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
3939
3939
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
3940
3940
|
}
|
|
@@ -4085,14 +4085,14 @@ var require_templates = __commonJS({
|
|
|
4085
4085
|
}
|
|
4086
4086
|
return results;
|
|
4087
4087
|
}
|
|
4088
|
-
function buildStyle(
|
|
4088
|
+
function buildStyle(chalk28, styles) {
|
|
4089
4089
|
const enabled = {};
|
|
4090
4090
|
for (const layer of styles) {
|
|
4091
4091
|
for (const style of layer.styles) {
|
|
4092
4092
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
4093
4093
|
}
|
|
4094
4094
|
}
|
|
4095
|
-
let current =
|
|
4095
|
+
let current = chalk28;
|
|
4096
4096
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
4097
4097
|
if (!Array.isArray(styles2)) {
|
|
4098
4098
|
continue;
|
|
@@ -4104,7 +4104,7 @@ var require_templates = __commonJS({
|
|
|
4104
4104
|
}
|
|
4105
4105
|
return current;
|
|
4106
4106
|
}
|
|
4107
|
-
module2.exports = (
|
|
4107
|
+
module2.exports = (chalk28, temporary) => {
|
|
4108
4108
|
const styles = [];
|
|
4109
4109
|
const chunks = [];
|
|
4110
4110
|
let chunk = [];
|
|
@@ -4114,13 +4114,13 @@ var require_templates = __commonJS({
|
|
|
4114
4114
|
} else if (style) {
|
|
4115
4115
|
const string = chunk.join("");
|
|
4116
4116
|
chunk = [];
|
|
4117
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
4117
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk28, styles)(string));
|
|
4118
4118
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
4119
4119
|
} else if (close3) {
|
|
4120
4120
|
if (styles.length === 0) {
|
|
4121
4121
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
4122
4122
|
}
|
|
4123
|
-
chunks.push(buildStyle(
|
|
4123
|
+
chunks.push(buildStyle(chalk28, styles)(chunk.join("")));
|
|
4124
4124
|
chunk = [];
|
|
4125
4125
|
styles.pop();
|
|
4126
4126
|
} else {
|
|
@@ -4168,16 +4168,16 @@ var require_source = __commonJS({
|
|
|
4168
4168
|
}
|
|
4169
4169
|
};
|
|
4170
4170
|
var chalkFactory = (options) => {
|
|
4171
|
-
const
|
|
4172
|
-
applyOptions(
|
|
4173
|
-
|
|
4174
|
-
Object.setPrototypeOf(
|
|
4175
|
-
Object.setPrototypeOf(
|
|
4176
|
-
|
|
4171
|
+
const chalk29 = {};
|
|
4172
|
+
applyOptions(chalk29, options);
|
|
4173
|
+
chalk29.template = (...arguments_) => chalkTag(chalk29.template, ...arguments_);
|
|
4174
|
+
Object.setPrototypeOf(chalk29, Chalk.prototype);
|
|
4175
|
+
Object.setPrototypeOf(chalk29.template, chalk29);
|
|
4176
|
+
chalk29.template.constructor = () => {
|
|
4177
4177
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
4178
4178
|
};
|
|
4179
|
-
|
|
4180
|
-
return
|
|
4179
|
+
chalk29.template.Instance = ChalkClass;
|
|
4180
|
+
return chalk29.template;
|
|
4181
4181
|
};
|
|
4182
4182
|
function Chalk(options) {
|
|
4183
4183
|
return chalkFactory(options);
|
|
@@ -4288,7 +4288,7 @@ var require_source = __commonJS({
|
|
|
4288
4288
|
return openAll + string + closeAll;
|
|
4289
4289
|
};
|
|
4290
4290
|
var template;
|
|
4291
|
-
var chalkTag = (
|
|
4291
|
+
var chalkTag = (chalk29, ...strings) => {
|
|
4292
4292
|
const [firstString] = strings;
|
|
4293
4293
|
if (!isArray2(firstString) || !isArray2(firstString.raw)) {
|
|
4294
4294
|
return strings.join(" ");
|
|
@@ -4304,14 +4304,14 @@ var require_source = __commonJS({
|
|
|
4304
4304
|
if (template === void 0) {
|
|
4305
4305
|
template = require_templates();
|
|
4306
4306
|
}
|
|
4307
|
-
return template(
|
|
4307
|
+
return template(chalk29, parts2.join(""));
|
|
4308
4308
|
};
|
|
4309
4309
|
Object.defineProperties(Chalk.prototype, styles);
|
|
4310
|
-
var
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
module2.exports =
|
|
4310
|
+
var chalk28 = Chalk();
|
|
4311
|
+
chalk28.supportsColor = stdoutColor;
|
|
4312
|
+
chalk28.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
4313
|
+
chalk28.stderr.supportsColor = stderrColor;
|
|
4314
|
+
module2.exports = chalk28;
|
|
4315
4315
|
}
|
|
4316
4316
|
});
|
|
4317
4317
|
|
|
@@ -4369,54 +4369,54 @@ var require_polyfills = __commonJS({
|
|
|
4369
4369
|
}
|
|
4370
4370
|
var chdir;
|
|
4371
4371
|
module2.exports = patch;
|
|
4372
|
-
function patch(
|
|
4372
|
+
function patch(fs21) {
|
|
4373
4373
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
4374
|
-
patchLchmod(
|
|
4375
|
-
}
|
|
4376
|
-
if (!
|
|
4377
|
-
patchLutimes(
|
|
4378
|
-
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
if (
|
|
4398
|
-
|
|
4374
|
+
patchLchmod(fs21);
|
|
4375
|
+
}
|
|
4376
|
+
if (!fs21.lutimes) {
|
|
4377
|
+
patchLutimes(fs21);
|
|
4378
|
+
}
|
|
4379
|
+
fs21.chown = chownFix(fs21.chown);
|
|
4380
|
+
fs21.fchown = chownFix(fs21.fchown);
|
|
4381
|
+
fs21.lchown = chownFix(fs21.lchown);
|
|
4382
|
+
fs21.chmod = chmodFix(fs21.chmod);
|
|
4383
|
+
fs21.fchmod = chmodFix(fs21.fchmod);
|
|
4384
|
+
fs21.lchmod = chmodFix(fs21.lchmod);
|
|
4385
|
+
fs21.chownSync = chownFixSync(fs21.chownSync);
|
|
4386
|
+
fs21.fchownSync = chownFixSync(fs21.fchownSync);
|
|
4387
|
+
fs21.lchownSync = chownFixSync(fs21.lchownSync);
|
|
4388
|
+
fs21.chmodSync = chmodFixSync(fs21.chmodSync);
|
|
4389
|
+
fs21.fchmodSync = chmodFixSync(fs21.fchmodSync);
|
|
4390
|
+
fs21.lchmodSync = chmodFixSync(fs21.lchmodSync);
|
|
4391
|
+
fs21.stat = statFix(fs21.stat);
|
|
4392
|
+
fs21.fstat = statFix(fs21.fstat);
|
|
4393
|
+
fs21.lstat = statFix(fs21.lstat);
|
|
4394
|
+
fs21.statSync = statFixSync(fs21.statSync);
|
|
4395
|
+
fs21.fstatSync = statFixSync(fs21.fstatSync);
|
|
4396
|
+
fs21.lstatSync = statFixSync(fs21.lstatSync);
|
|
4397
|
+
if (fs21.chmod && !fs21.lchmod) {
|
|
4398
|
+
fs21.lchmod = function(path25, mode, cb) {
|
|
4399
4399
|
if (cb) process.nextTick(cb);
|
|
4400
4400
|
};
|
|
4401
|
-
|
|
4401
|
+
fs21.lchmodSync = function() {
|
|
4402
4402
|
};
|
|
4403
4403
|
}
|
|
4404
|
-
if (
|
|
4405
|
-
|
|
4404
|
+
if (fs21.chown && !fs21.lchown) {
|
|
4405
|
+
fs21.lchown = function(path25, uid, gid, cb) {
|
|
4406
4406
|
if (cb) process.nextTick(cb);
|
|
4407
4407
|
};
|
|
4408
|
-
|
|
4408
|
+
fs21.lchownSync = function() {
|
|
4409
4409
|
};
|
|
4410
4410
|
}
|
|
4411
4411
|
if (platform === "win32") {
|
|
4412
|
-
|
|
4412
|
+
fs21.rename = typeof fs21.rename !== "function" ? fs21.rename : (function(fs$rename) {
|
|
4413
4413
|
function rename(from3, to, cb) {
|
|
4414
4414
|
var start = Date.now();
|
|
4415
4415
|
var backoff = 0;
|
|
4416
4416
|
fs$rename(from3, to, function CB(er) {
|
|
4417
4417
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
4418
4418
|
setTimeout(function() {
|
|
4419
|
-
|
|
4419
|
+
fs21.stat(to, function(stater, st) {
|
|
4420
4420
|
if (stater && stater.code === "ENOENT")
|
|
4421
4421
|
fs$rename(from3, to, CB);
|
|
4422
4422
|
else
|
|
@@ -4432,9 +4432,9 @@ var require_polyfills = __commonJS({
|
|
|
4432
4432
|
}
|
|
4433
4433
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
4434
4434
|
return rename;
|
|
4435
|
-
})(
|
|
4435
|
+
})(fs21.rename);
|
|
4436
4436
|
}
|
|
4437
|
-
|
|
4437
|
+
fs21.read = typeof fs21.read !== "function" ? fs21.read : (function(fs$read) {
|
|
4438
4438
|
function read3(fd, buffer, offset, length, position, callback_) {
|
|
4439
4439
|
var callback;
|
|
4440
4440
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -4442,22 +4442,22 @@ var require_polyfills = __commonJS({
|
|
|
4442
4442
|
callback = function(er, _2, __) {
|
|
4443
4443
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
4444
4444
|
eagCounter++;
|
|
4445
|
-
return fs$read.call(
|
|
4445
|
+
return fs$read.call(fs21, fd, buffer, offset, length, position, callback);
|
|
4446
4446
|
}
|
|
4447
4447
|
callback_.apply(this, arguments);
|
|
4448
4448
|
};
|
|
4449
4449
|
}
|
|
4450
|
-
return fs$read.call(
|
|
4450
|
+
return fs$read.call(fs21, fd, buffer, offset, length, position, callback);
|
|
4451
4451
|
}
|
|
4452
4452
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read3, fs$read);
|
|
4453
4453
|
return read3;
|
|
4454
|
-
})(
|
|
4455
|
-
|
|
4454
|
+
})(fs21.read);
|
|
4455
|
+
fs21.readSync = typeof fs21.readSync !== "function" ? fs21.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
4456
4456
|
return function(fd, buffer, offset, length, position) {
|
|
4457
4457
|
var eagCounter = 0;
|
|
4458
4458
|
while (true) {
|
|
4459
4459
|
try {
|
|
4460
|
-
return fs$readSync.call(
|
|
4460
|
+
return fs$readSync.call(fs21, fd, buffer, offset, length, position);
|
|
4461
4461
|
} catch (er) {
|
|
4462
4462
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
4463
4463
|
eagCounter++;
|
|
@@ -4467,11 +4467,11 @@ var require_polyfills = __commonJS({
|
|
|
4467
4467
|
}
|
|
4468
4468
|
}
|
|
4469
4469
|
};
|
|
4470
|
-
})(
|
|
4471
|
-
function patchLchmod(
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4470
|
+
})(fs21.readSync);
|
|
4471
|
+
function patchLchmod(fs22) {
|
|
4472
|
+
fs22.lchmod = function(path25, mode, callback) {
|
|
4473
|
+
fs22.open(
|
|
4474
|
+
path25,
|
|
4475
4475
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
4476
4476
|
mode,
|
|
4477
4477
|
function(err, fd) {
|
|
@@ -4479,80 +4479,80 @@ var require_polyfills = __commonJS({
|
|
|
4479
4479
|
if (callback) callback(err);
|
|
4480
4480
|
return;
|
|
4481
4481
|
}
|
|
4482
|
-
|
|
4483
|
-
|
|
4482
|
+
fs22.fchmod(fd, mode, function(err2) {
|
|
4483
|
+
fs22.close(fd, function(err22) {
|
|
4484
4484
|
if (callback) callback(err2 || err22);
|
|
4485
4485
|
});
|
|
4486
4486
|
});
|
|
4487
4487
|
}
|
|
4488
4488
|
);
|
|
4489
4489
|
};
|
|
4490
|
-
|
|
4491
|
-
var fd =
|
|
4490
|
+
fs22.lchmodSync = function(path25, mode) {
|
|
4491
|
+
var fd = fs22.openSync(path25, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
4492
4492
|
var threw = true;
|
|
4493
4493
|
var ret;
|
|
4494
4494
|
try {
|
|
4495
|
-
ret =
|
|
4495
|
+
ret = fs22.fchmodSync(fd, mode);
|
|
4496
4496
|
threw = false;
|
|
4497
4497
|
} finally {
|
|
4498
4498
|
if (threw) {
|
|
4499
4499
|
try {
|
|
4500
|
-
|
|
4500
|
+
fs22.closeSync(fd);
|
|
4501
4501
|
} catch (er) {
|
|
4502
4502
|
}
|
|
4503
4503
|
} else {
|
|
4504
|
-
|
|
4504
|
+
fs22.closeSync(fd);
|
|
4505
4505
|
}
|
|
4506
4506
|
}
|
|
4507
4507
|
return ret;
|
|
4508
4508
|
};
|
|
4509
4509
|
}
|
|
4510
|
-
function patchLutimes(
|
|
4511
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
4512
|
-
|
|
4513
|
-
|
|
4510
|
+
function patchLutimes(fs22) {
|
|
4511
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs22.futimes) {
|
|
4512
|
+
fs22.lutimes = function(path25, at, mt, cb) {
|
|
4513
|
+
fs22.open(path25, constants.O_SYMLINK, function(er, fd) {
|
|
4514
4514
|
if (er) {
|
|
4515
4515
|
if (cb) cb(er);
|
|
4516
4516
|
return;
|
|
4517
4517
|
}
|
|
4518
|
-
|
|
4519
|
-
|
|
4518
|
+
fs22.futimes(fd, at, mt, function(er2) {
|
|
4519
|
+
fs22.close(fd, function(er22) {
|
|
4520
4520
|
if (cb) cb(er2 || er22);
|
|
4521
4521
|
});
|
|
4522
4522
|
});
|
|
4523
4523
|
});
|
|
4524
4524
|
};
|
|
4525
|
-
|
|
4526
|
-
var fd =
|
|
4525
|
+
fs22.lutimesSync = function(path25, at, mt) {
|
|
4526
|
+
var fd = fs22.openSync(path25, constants.O_SYMLINK);
|
|
4527
4527
|
var ret;
|
|
4528
4528
|
var threw = true;
|
|
4529
4529
|
try {
|
|
4530
|
-
ret =
|
|
4530
|
+
ret = fs22.futimesSync(fd, at, mt);
|
|
4531
4531
|
threw = false;
|
|
4532
4532
|
} finally {
|
|
4533
4533
|
if (threw) {
|
|
4534
4534
|
try {
|
|
4535
|
-
|
|
4535
|
+
fs22.closeSync(fd);
|
|
4536
4536
|
} catch (er) {
|
|
4537
4537
|
}
|
|
4538
4538
|
} else {
|
|
4539
|
-
|
|
4539
|
+
fs22.closeSync(fd);
|
|
4540
4540
|
}
|
|
4541
4541
|
}
|
|
4542
4542
|
return ret;
|
|
4543
4543
|
};
|
|
4544
|
-
} else if (
|
|
4545
|
-
|
|
4544
|
+
} else if (fs22.futimes) {
|
|
4545
|
+
fs22.lutimes = function(_a, _b, _c, cb) {
|
|
4546
4546
|
if (cb) process.nextTick(cb);
|
|
4547
4547
|
};
|
|
4548
|
-
|
|
4548
|
+
fs22.lutimesSync = function() {
|
|
4549
4549
|
};
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
4552
4552
|
function chmodFix(orig) {
|
|
4553
4553
|
if (!orig) return orig;
|
|
4554
4554
|
return function(target, mode, cb) {
|
|
4555
|
-
return orig.call(
|
|
4555
|
+
return orig.call(fs21, target, mode, function(er) {
|
|
4556
4556
|
if (chownErOk(er)) er = null;
|
|
4557
4557
|
if (cb) cb.apply(this, arguments);
|
|
4558
4558
|
});
|
|
@@ -4562,7 +4562,7 @@ var require_polyfills = __commonJS({
|
|
|
4562
4562
|
if (!orig) return orig;
|
|
4563
4563
|
return function(target, mode) {
|
|
4564
4564
|
try {
|
|
4565
|
-
return orig.call(
|
|
4565
|
+
return orig.call(fs21, target, mode);
|
|
4566
4566
|
} catch (er) {
|
|
4567
4567
|
if (!chownErOk(er)) throw er;
|
|
4568
4568
|
}
|
|
@@ -4571,7 +4571,7 @@ var require_polyfills = __commonJS({
|
|
|
4571
4571
|
function chownFix(orig) {
|
|
4572
4572
|
if (!orig) return orig;
|
|
4573
4573
|
return function(target, uid, gid, cb) {
|
|
4574
|
-
return orig.call(
|
|
4574
|
+
return orig.call(fs21, target, uid, gid, function(er) {
|
|
4575
4575
|
if (chownErOk(er)) er = null;
|
|
4576
4576
|
if (cb) cb.apply(this, arguments);
|
|
4577
4577
|
});
|
|
@@ -4581,7 +4581,7 @@ var require_polyfills = __commonJS({
|
|
|
4581
4581
|
if (!orig) return orig;
|
|
4582
4582
|
return function(target, uid, gid) {
|
|
4583
4583
|
try {
|
|
4584
|
-
return orig.call(
|
|
4584
|
+
return orig.call(fs21, target, uid, gid);
|
|
4585
4585
|
} catch (er) {
|
|
4586
4586
|
if (!chownErOk(er)) throw er;
|
|
4587
4587
|
}
|
|
@@ -4601,13 +4601,13 @@ var require_polyfills = __commonJS({
|
|
|
4601
4601
|
}
|
|
4602
4602
|
if (cb) cb.apply(this, arguments);
|
|
4603
4603
|
}
|
|
4604
|
-
return options ? orig.call(
|
|
4604
|
+
return options ? orig.call(fs21, target, options, callback) : orig.call(fs21, target, callback);
|
|
4605
4605
|
};
|
|
4606
4606
|
}
|
|
4607
4607
|
function statFixSync(orig) {
|
|
4608
4608
|
if (!orig) return orig;
|
|
4609
4609
|
return function(target, options) {
|
|
4610
|
-
var stats = options ? orig.call(
|
|
4610
|
+
var stats = options ? orig.call(fs21, target, options) : orig.call(fs21, target);
|
|
4611
4611
|
if (stats) {
|
|
4612
4612
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
4613
4613
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -4636,16 +4636,16 @@ var require_legacy_streams = __commonJS({
|
|
|
4636
4636
|
"node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
|
|
4637
4637
|
var Stream2 = require("stream").Stream;
|
|
4638
4638
|
module2.exports = legacy;
|
|
4639
|
-
function legacy(
|
|
4639
|
+
function legacy(fs21) {
|
|
4640
4640
|
return {
|
|
4641
4641
|
ReadStream,
|
|
4642
4642
|
WriteStream
|
|
4643
4643
|
};
|
|
4644
|
-
function ReadStream(
|
|
4645
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
4644
|
+
function ReadStream(path25, options) {
|
|
4645
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path25, options);
|
|
4646
4646
|
Stream2.call(this);
|
|
4647
4647
|
var self2 = this;
|
|
4648
|
-
this.path =
|
|
4648
|
+
this.path = path25;
|
|
4649
4649
|
this.fd = null;
|
|
4650
4650
|
this.readable = true;
|
|
4651
4651
|
this.paused = false;
|
|
@@ -4679,7 +4679,7 @@ var require_legacy_streams = __commonJS({
|
|
|
4679
4679
|
});
|
|
4680
4680
|
return;
|
|
4681
4681
|
}
|
|
4682
|
-
|
|
4682
|
+
fs21.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
4683
4683
|
if (err) {
|
|
4684
4684
|
self2.emit("error", err);
|
|
4685
4685
|
self2.readable = false;
|
|
@@ -4690,10 +4690,10 @@ var require_legacy_streams = __commonJS({
|
|
|
4690
4690
|
self2._read();
|
|
4691
4691
|
});
|
|
4692
4692
|
}
|
|
4693
|
-
function WriteStream(
|
|
4694
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
4693
|
+
function WriteStream(path25, options) {
|
|
4694
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path25, options);
|
|
4695
4695
|
Stream2.call(this);
|
|
4696
|
-
this.path =
|
|
4696
|
+
this.path = path25;
|
|
4697
4697
|
this.fd = null;
|
|
4698
4698
|
this.writable = true;
|
|
4699
4699
|
this.flags = "w";
|
|
@@ -4718,7 +4718,7 @@ var require_legacy_streams = __commonJS({
|
|
|
4718
4718
|
this.busy = false;
|
|
4719
4719
|
this._queue = [];
|
|
4720
4720
|
if (this.fd === null) {
|
|
4721
|
-
this._open =
|
|
4721
|
+
this._open = fs21.open;
|
|
4722
4722
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
4723
4723
|
this.flush();
|
|
4724
4724
|
}
|
|
@@ -4753,7 +4753,7 @@ var require_clone = __commonJS({
|
|
|
4753
4753
|
// node_modules/graceful-fs/graceful-fs.js
|
|
4754
4754
|
var require_graceful_fs = __commonJS({
|
|
4755
4755
|
"node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
4756
|
-
var
|
|
4756
|
+
var fs21 = require("fs");
|
|
4757
4757
|
var polyfills = require_polyfills();
|
|
4758
4758
|
var legacy = require_legacy_streams();
|
|
4759
4759
|
var clone = require_clone();
|
|
@@ -4785,12 +4785,12 @@ var require_graceful_fs = __commonJS({
|
|
|
4785
4785
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
4786
4786
|
console.error(m);
|
|
4787
4787
|
};
|
|
4788
|
-
if (!
|
|
4788
|
+
if (!fs21[gracefulQueue]) {
|
|
4789
4789
|
queue = global[gracefulQueue] || [];
|
|
4790
|
-
publishQueue(
|
|
4791
|
-
|
|
4790
|
+
publishQueue(fs21, queue);
|
|
4791
|
+
fs21.close = (function(fs$close) {
|
|
4792
4792
|
function close3(fd, cb) {
|
|
4793
|
-
return fs$close.call(
|
|
4793
|
+
return fs$close.call(fs21, fd, function(err) {
|
|
4794
4794
|
if (!err) {
|
|
4795
4795
|
resetQueue();
|
|
4796
4796
|
}
|
|
@@ -4802,48 +4802,48 @@ var require_graceful_fs = __commonJS({
|
|
|
4802
4802
|
value: fs$close
|
|
4803
4803
|
});
|
|
4804
4804
|
return close3;
|
|
4805
|
-
})(
|
|
4806
|
-
|
|
4805
|
+
})(fs21.close);
|
|
4806
|
+
fs21.closeSync = (function(fs$closeSync) {
|
|
4807
4807
|
function closeSync(fd) {
|
|
4808
|
-
fs$closeSync.apply(
|
|
4808
|
+
fs$closeSync.apply(fs21, arguments);
|
|
4809
4809
|
resetQueue();
|
|
4810
4810
|
}
|
|
4811
4811
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
4812
4812
|
value: fs$closeSync
|
|
4813
4813
|
});
|
|
4814
4814
|
return closeSync;
|
|
4815
|
-
})(
|
|
4815
|
+
})(fs21.closeSync);
|
|
4816
4816
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
4817
4817
|
process.on("exit", function() {
|
|
4818
|
-
debug(
|
|
4819
|
-
require("assert").equal(
|
|
4818
|
+
debug(fs21[gracefulQueue]);
|
|
4819
|
+
require("assert").equal(fs21[gracefulQueue].length, 0);
|
|
4820
4820
|
});
|
|
4821
4821
|
}
|
|
4822
4822
|
}
|
|
4823
4823
|
var queue;
|
|
4824
4824
|
if (!global[gracefulQueue]) {
|
|
4825
|
-
publishQueue(global,
|
|
4826
|
-
}
|
|
4827
|
-
module2.exports = patch(clone(
|
|
4828
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
4829
|
-
module2.exports = patch(
|
|
4830
|
-
|
|
4831
|
-
}
|
|
4832
|
-
function patch(
|
|
4833
|
-
polyfills(
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
var fs$readFile =
|
|
4838
|
-
|
|
4839
|
-
function readFile(
|
|
4825
|
+
publishQueue(global, fs21[gracefulQueue]);
|
|
4826
|
+
}
|
|
4827
|
+
module2.exports = patch(clone(fs21));
|
|
4828
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs21.__patched) {
|
|
4829
|
+
module2.exports = patch(fs21);
|
|
4830
|
+
fs21.__patched = true;
|
|
4831
|
+
}
|
|
4832
|
+
function patch(fs22) {
|
|
4833
|
+
polyfills(fs22);
|
|
4834
|
+
fs22.gracefulify = patch;
|
|
4835
|
+
fs22.createReadStream = createReadStream3;
|
|
4836
|
+
fs22.createWriteStream = createWriteStream;
|
|
4837
|
+
var fs$readFile = fs22.readFile;
|
|
4838
|
+
fs22.readFile = readFile;
|
|
4839
|
+
function readFile(path25, options, cb) {
|
|
4840
4840
|
if (typeof options === "function")
|
|
4841
4841
|
cb = options, options = null;
|
|
4842
|
-
return go$readFile(
|
|
4843
|
-
function go$readFile(
|
|
4844
|
-
return fs$readFile(
|
|
4842
|
+
return go$readFile(path25, options, cb);
|
|
4843
|
+
function go$readFile(path26, options2, cb2, startTime) {
|
|
4844
|
+
return fs$readFile(path26, options2, function(err) {
|
|
4845
4845
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4846
|
-
enqueue([go$readFile, [
|
|
4846
|
+
enqueue([go$readFile, [path26, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4847
4847
|
else {
|
|
4848
4848
|
if (typeof cb2 === "function")
|
|
4849
4849
|
cb2.apply(this, arguments);
|
|
@@ -4851,16 +4851,16 @@ var require_graceful_fs = __commonJS({
|
|
|
4851
4851
|
});
|
|
4852
4852
|
}
|
|
4853
4853
|
}
|
|
4854
|
-
var fs$writeFile =
|
|
4855
|
-
|
|
4856
|
-
function writeFile(
|
|
4854
|
+
var fs$writeFile = fs22.writeFile;
|
|
4855
|
+
fs22.writeFile = writeFile;
|
|
4856
|
+
function writeFile(path25, data, options, cb) {
|
|
4857
4857
|
if (typeof options === "function")
|
|
4858
4858
|
cb = options, options = null;
|
|
4859
|
-
return go$writeFile(
|
|
4860
|
-
function go$writeFile(
|
|
4861
|
-
return fs$writeFile(
|
|
4859
|
+
return go$writeFile(path25, data, options, cb);
|
|
4860
|
+
function go$writeFile(path26, data2, options2, cb2, startTime) {
|
|
4861
|
+
return fs$writeFile(path26, data2, options2, function(err) {
|
|
4862
4862
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4863
|
-
enqueue([go$writeFile, [
|
|
4863
|
+
enqueue([go$writeFile, [path26, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4864
4864
|
else {
|
|
4865
4865
|
if (typeof cb2 === "function")
|
|
4866
4866
|
cb2.apply(this, arguments);
|
|
@@ -4868,17 +4868,17 @@ var require_graceful_fs = __commonJS({
|
|
|
4868
4868
|
});
|
|
4869
4869
|
}
|
|
4870
4870
|
}
|
|
4871
|
-
var fs$appendFile =
|
|
4871
|
+
var fs$appendFile = fs22.appendFile;
|
|
4872
4872
|
if (fs$appendFile)
|
|
4873
|
-
|
|
4874
|
-
function appendFile(
|
|
4873
|
+
fs22.appendFile = appendFile;
|
|
4874
|
+
function appendFile(path25, data, options, cb) {
|
|
4875
4875
|
if (typeof options === "function")
|
|
4876
4876
|
cb = options, options = null;
|
|
4877
|
-
return go$appendFile(
|
|
4878
|
-
function go$appendFile(
|
|
4879
|
-
return fs$appendFile(
|
|
4877
|
+
return go$appendFile(path25, data, options, cb);
|
|
4878
|
+
function go$appendFile(path26, data2, options2, cb2, startTime) {
|
|
4879
|
+
return fs$appendFile(path26, data2, options2, function(err) {
|
|
4880
4880
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4881
|
-
enqueue([go$appendFile, [
|
|
4881
|
+
enqueue([go$appendFile, [path26, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4882
4882
|
else {
|
|
4883
4883
|
if (typeof cb2 === "function")
|
|
4884
4884
|
cb2.apply(this, arguments);
|
|
@@ -4886,9 +4886,9 @@ var require_graceful_fs = __commonJS({
|
|
|
4886
4886
|
});
|
|
4887
4887
|
}
|
|
4888
4888
|
}
|
|
4889
|
-
var fs$copyFile =
|
|
4889
|
+
var fs$copyFile = fs22.copyFile;
|
|
4890
4890
|
if (fs$copyFile)
|
|
4891
|
-
|
|
4891
|
+
fs22.copyFile = copyFile;
|
|
4892
4892
|
function copyFile(src, dest, flags, cb) {
|
|
4893
4893
|
if (typeof flags === "function") {
|
|
4894
4894
|
cb = flags;
|
|
@@ -4906,34 +4906,34 @@ var require_graceful_fs = __commonJS({
|
|
|
4906
4906
|
});
|
|
4907
4907
|
}
|
|
4908
4908
|
}
|
|
4909
|
-
var fs$readdir =
|
|
4910
|
-
|
|
4909
|
+
var fs$readdir = fs22.readdir;
|
|
4910
|
+
fs22.readdir = readdir2;
|
|
4911
4911
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
4912
|
-
function readdir2(
|
|
4912
|
+
function readdir2(path25, options, cb) {
|
|
4913
4913
|
if (typeof options === "function")
|
|
4914
4914
|
cb = options, options = null;
|
|
4915
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
4916
|
-
return fs$readdir(
|
|
4917
|
-
|
|
4915
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path26, options2, cb2, startTime) {
|
|
4916
|
+
return fs$readdir(path26, fs$readdirCallback(
|
|
4917
|
+
path26,
|
|
4918
4918
|
options2,
|
|
4919
4919
|
cb2,
|
|
4920
4920
|
startTime
|
|
4921
4921
|
));
|
|
4922
|
-
} : function go$readdir2(
|
|
4923
|
-
return fs$readdir(
|
|
4924
|
-
|
|
4922
|
+
} : function go$readdir2(path26, options2, cb2, startTime) {
|
|
4923
|
+
return fs$readdir(path26, options2, fs$readdirCallback(
|
|
4924
|
+
path26,
|
|
4925
4925
|
options2,
|
|
4926
4926
|
cb2,
|
|
4927
4927
|
startTime
|
|
4928
4928
|
));
|
|
4929
4929
|
};
|
|
4930
|
-
return go$readdir(
|
|
4931
|
-
function fs$readdirCallback(
|
|
4930
|
+
return go$readdir(path25, options, cb);
|
|
4931
|
+
function fs$readdirCallback(path26, options2, cb2, startTime) {
|
|
4932
4932
|
return function(err, files2) {
|
|
4933
4933
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4934
4934
|
enqueue([
|
|
4935
4935
|
go$readdir,
|
|
4936
|
-
[
|
|
4936
|
+
[path26, options2, cb2],
|
|
4937
4937
|
err,
|
|
4938
4938
|
startTime || Date.now(),
|
|
4939
4939
|
Date.now()
|
|
@@ -4948,21 +4948,21 @@ var require_graceful_fs = __commonJS({
|
|
|
4948
4948
|
}
|
|
4949
4949
|
}
|
|
4950
4950
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
4951
|
-
var legStreams = legacy(
|
|
4951
|
+
var legStreams = legacy(fs22);
|
|
4952
4952
|
ReadStream = legStreams.ReadStream;
|
|
4953
4953
|
WriteStream = legStreams.WriteStream;
|
|
4954
4954
|
}
|
|
4955
|
-
var fs$ReadStream =
|
|
4955
|
+
var fs$ReadStream = fs22.ReadStream;
|
|
4956
4956
|
if (fs$ReadStream) {
|
|
4957
4957
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
4958
4958
|
ReadStream.prototype.open = ReadStream$open;
|
|
4959
4959
|
}
|
|
4960
|
-
var fs$WriteStream =
|
|
4960
|
+
var fs$WriteStream = fs22.WriteStream;
|
|
4961
4961
|
if (fs$WriteStream) {
|
|
4962
4962
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
4963
4963
|
WriteStream.prototype.open = WriteStream$open;
|
|
4964
4964
|
}
|
|
4965
|
-
Object.defineProperty(
|
|
4965
|
+
Object.defineProperty(fs22, "ReadStream", {
|
|
4966
4966
|
get: function() {
|
|
4967
4967
|
return ReadStream;
|
|
4968
4968
|
},
|
|
@@ -4972,7 +4972,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4972
4972
|
enumerable: true,
|
|
4973
4973
|
configurable: true
|
|
4974
4974
|
});
|
|
4975
|
-
Object.defineProperty(
|
|
4975
|
+
Object.defineProperty(fs22, "WriteStream", {
|
|
4976
4976
|
get: function() {
|
|
4977
4977
|
return WriteStream;
|
|
4978
4978
|
},
|
|
@@ -4983,7 +4983,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4983
4983
|
configurable: true
|
|
4984
4984
|
});
|
|
4985
4985
|
var FileReadStream = ReadStream;
|
|
4986
|
-
Object.defineProperty(
|
|
4986
|
+
Object.defineProperty(fs22, "FileReadStream", {
|
|
4987
4987
|
get: function() {
|
|
4988
4988
|
return FileReadStream;
|
|
4989
4989
|
},
|
|
@@ -4994,7 +4994,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4994
4994
|
configurable: true
|
|
4995
4995
|
});
|
|
4996
4996
|
var FileWriteStream = WriteStream;
|
|
4997
|
-
Object.defineProperty(
|
|
4997
|
+
Object.defineProperty(fs22, "FileWriteStream", {
|
|
4998
4998
|
get: function() {
|
|
4999
4999
|
return FileWriteStream;
|
|
5000
5000
|
},
|
|
@@ -5004,7 +5004,7 @@ var require_graceful_fs = __commonJS({
|
|
|
5004
5004
|
enumerable: true,
|
|
5005
5005
|
configurable: true
|
|
5006
5006
|
});
|
|
5007
|
-
function ReadStream(
|
|
5007
|
+
function ReadStream(path25, options) {
|
|
5008
5008
|
if (this instanceof ReadStream)
|
|
5009
5009
|
return fs$ReadStream.apply(this, arguments), this;
|
|
5010
5010
|
else
|
|
@@ -5024,7 +5024,7 @@ var require_graceful_fs = __commonJS({
|
|
|
5024
5024
|
}
|
|
5025
5025
|
});
|
|
5026
5026
|
}
|
|
5027
|
-
function WriteStream(
|
|
5027
|
+
function WriteStream(path25, options) {
|
|
5028
5028
|
if (this instanceof WriteStream)
|
|
5029
5029
|
return fs$WriteStream.apply(this, arguments), this;
|
|
5030
5030
|
else
|
|
@@ -5042,22 +5042,22 @@ var require_graceful_fs = __commonJS({
|
|
|
5042
5042
|
}
|
|
5043
5043
|
});
|
|
5044
5044
|
}
|
|
5045
|
-
function createReadStream3(
|
|
5046
|
-
return new
|
|
5045
|
+
function createReadStream3(path25, options) {
|
|
5046
|
+
return new fs22.ReadStream(path25, options);
|
|
5047
5047
|
}
|
|
5048
|
-
function createWriteStream(
|
|
5049
|
-
return new
|
|
5048
|
+
function createWriteStream(path25, options) {
|
|
5049
|
+
return new fs22.WriteStream(path25, options);
|
|
5050
5050
|
}
|
|
5051
|
-
var fs$open =
|
|
5052
|
-
|
|
5053
|
-
function open3(
|
|
5051
|
+
var fs$open = fs22.open;
|
|
5052
|
+
fs22.open = open3;
|
|
5053
|
+
function open3(path25, flags, mode, cb) {
|
|
5054
5054
|
if (typeof mode === "function")
|
|
5055
5055
|
cb = mode, mode = null;
|
|
5056
|
-
return go$open(
|
|
5057
|
-
function go$open(
|
|
5058
|
-
return fs$open(
|
|
5056
|
+
return go$open(path25, flags, mode, cb);
|
|
5057
|
+
function go$open(path26, flags2, mode2, cb2, startTime) {
|
|
5058
|
+
return fs$open(path26, flags2, mode2, function(err, fd) {
|
|
5059
5059
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5060
|
-
enqueue([go$open, [
|
|
5060
|
+
enqueue([go$open, [path26, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
5061
5061
|
else {
|
|
5062
5062
|
if (typeof cb2 === "function")
|
|
5063
5063
|
cb2.apply(this, arguments);
|
|
@@ -5065,20 +5065,20 @@ var require_graceful_fs = __commonJS({
|
|
|
5065
5065
|
});
|
|
5066
5066
|
}
|
|
5067
5067
|
}
|
|
5068
|
-
return
|
|
5068
|
+
return fs22;
|
|
5069
5069
|
}
|
|
5070
5070
|
function enqueue(elem) {
|
|
5071
5071
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
5072
|
-
|
|
5072
|
+
fs21[gracefulQueue].push(elem);
|
|
5073
5073
|
retry();
|
|
5074
5074
|
}
|
|
5075
5075
|
var retryTimer;
|
|
5076
5076
|
function resetQueue() {
|
|
5077
5077
|
var now = Date.now();
|
|
5078
|
-
for (var i = 0; i <
|
|
5079
|
-
if (
|
|
5080
|
-
|
|
5081
|
-
|
|
5078
|
+
for (var i = 0; i < fs21[gracefulQueue].length; ++i) {
|
|
5079
|
+
if (fs21[gracefulQueue][i].length > 2) {
|
|
5080
|
+
fs21[gracefulQueue][i][3] = now;
|
|
5081
|
+
fs21[gracefulQueue][i][4] = now;
|
|
5082
5082
|
}
|
|
5083
5083
|
}
|
|
5084
5084
|
retry();
|
|
@@ -5086,9 +5086,9 @@ var require_graceful_fs = __commonJS({
|
|
|
5086
5086
|
function retry() {
|
|
5087
5087
|
clearTimeout(retryTimer);
|
|
5088
5088
|
retryTimer = void 0;
|
|
5089
|
-
if (
|
|
5089
|
+
if (fs21[gracefulQueue].length === 0)
|
|
5090
5090
|
return;
|
|
5091
|
-
var elem =
|
|
5091
|
+
var elem = fs21[gracefulQueue].shift();
|
|
5092
5092
|
var fn = elem[0];
|
|
5093
5093
|
var args = elem[1];
|
|
5094
5094
|
var err = elem[2];
|
|
@@ -5110,7 +5110,7 @@ var require_graceful_fs = __commonJS({
|
|
|
5110
5110
|
debug("RETRY", fn.name, args);
|
|
5111
5111
|
fn.apply(null, args.concat([startTime]));
|
|
5112
5112
|
} else {
|
|
5113
|
-
|
|
5113
|
+
fs21[gracefulQueue].push(elem);
|
|
5114
5114
|
}
|
|
5115
5115
|
}
|
|
5116
5116
|
if (retryTimer === void 0) {
|
|
@@ -5125,7 +5125,7 @@ var require_fs = __commonJS({
|
|
|
5125
5125
|
"node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
5126
5126
|
"use strict";
|
|
5127
5127
|
var u = require_universalify().fromCallback;
|
|
5128
|
-
var
|
|
5128
|
+
var fs21 = require_graceful_fs();
|
|
5129
5129
|
var api = [
|
|
5130
5130
|
"access",
|
|
5131
5131
|
"appendFile",
|
|
@@ -5166,26 +5166,26 @@ var require_fs = __commonJS({
|
|
|
5166
5166
|
"utimes",
|
|
5167
5167
|
"writeFile"
|
|
5168
5168
|
].filter((key) => {
|
|
5169
|
-
return typeof
|
|
5169
|
+
return typeof fs21[key] === "function";
|
|
5170
5170
|
});
|
|
5171
|
-
Object.assign(exports2,
|
|
5171
|
+
Object.assign(exports2, fs21);
|
|
5172
5172
|
api.forEach((method) => {
|
|
5173
|
-
exports2[method] = u(
|
|
5173
|
+
exports2[method] = u(fs21[method]);
|
|
5174
5174
|
});
|
|
5175
5175
|
exports2.exists = function(filename, callback) {
|
|
5176
5176
|
if (typeof callback === "function") {
|
|
5177
|
-
return
|
|
5177
|
+
return fs21.exists(filename, callback);
|
|
5178
5178
|
}
|
|
5179
5179
|
return new Promise((resolve) => {
|
|
5180
|
-
return
|
|
5180
|
+
return fs21.exists(filename, resolve);
|
|
5181
5181
|
});
|
|
5182
5182
|
};
|
|
5183
5183
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
5184
5184
|
if (typeof callback === "function") {
|
|
5185
|
-
return
|
|
5185
|
+
return fs21.read(fd, buffer, offset, length, position, callback);
|
|
5186
5186
|
}
|
|
5187
5187
|
return new Promise((resolve, reject) => {
|
|
5188
|
-
|
|
5188
|
+
fs21.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
5189
5189
|
if (err) return reject(err);
|
|
5190
5190
|
resolve({ bytesRead, buffer: buffer2 });
|
|
5191
5191
|
});
|
|
@@ -5193,10 +5193,10 @@ var require_fs = __commonJS({
|
|
|
5193
5193
|
};
|
|
5194
5194
|
exports2.write = function(fd, buffer, ...args) {
|
|
5195
5195
|
if (typeof args[args.length - 1] === "function") {
|
|
5196
|
-
return
|
|
5196
|
+
return fs21.write(fd, buffer, ...args);
|
|
5197
5197
|
}
|
|
5198
5198
|
return new Promise((resolve, reject) => {
|
|
5199
|
-
|
|
5199
|
+
fs21.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
5200
5200
|
if (err) return reject(err);
|
|
5201
5201
|
resolve({ bytesWritten, buffer: buffer2 });
|
|
5202
5202
|
});
|
|
@@ -5204,10 +5204,10 @@ var require_fs = __commonJS({
|
|
|
5204
5204
|
};
|
|
5205
5205
|
exports2.readv = function(fd, buffers, ...args) {
|
|
5206
5206
|
if (typeof args[args.length - 1] === "function") {
|
|
5207
|
-
return
|
|
5207
|
+
return fs21.readv(fd, buffers, ...args);
|
|
5208
5208
|
}
|
|
5209
5209
|
return new Promise((resolve, reject) => {
|
|
5210
|
-
|
|
5210
|
+
fs21.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
5211
5211
|
if (err) return reject(err);
|
|
5212
5212
|
resolve({ bytesRead, buffers: buffers2 });
|
|
5213
5213
|
});
|
|
@@ -5215,17 +5215,17 @@ var require_fs = __commonJS({
|
|
|
5215
5215
|
};
|
|
5216
5216
|
exports2.writev = function(fd, buffers, ...args) {
|
|
5217
5217
|
if (typeof args[args.length - 1] === "function") {
|
|
5218
|
-
return
|
|
5218
|
+
return fs21.writev(fd, buffers, ...args);
|
|
5219
5219
|
}
|
|
5220
5220
|
return new Promise((resolve, reject) => {
|
|
5221
|
-
|
|
5221
|
+
fs21.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
5222
5222
|
if (err) return reject(err);
|
|
5223
5223
|
resolve({ bytesWritten, buffers: buffers2 });
|
|
5224
5224
|
});
|
|
5225
5225
|
});
|
|
5226
5226
|
};
|
|
5227
|
-
if (typeof
|
|
5228
|
-
exports2.realpath.native = u(
|
|
5227
|
+
if (typeof fs21.realpath.native === "function") {
|
|
5228
|
+
exports2.realpath.native = u(fs21.realpath.native);
|
|
5229
5229
|
} else {
|
|
5230
5230
|
process.emitWarning(
|
|
5231
5231
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -5240,10 +5240,10 @@ var require_fs = __commonJS({
|
|
|
5240
5240
|
var require_utils = __commonJS({
|
|
5241
5241
|
"node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
5242
5242
|
"use strict";
|
|
5243
|
-
var
|
|
5243
|
+
var path25 = require("path");
|
|
5244
5244
|
module2.exports.checkPath = function checkPath(pth) {
|
|
5245
5245
|
if (process.platform === "win32") {
|
|
5246
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
5246
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path25.parse(pth).root, ""));
|
|
5247
5247
|
if (pathHasInvalidWinCharacters) {
|
|
5248
5248
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
5249
5249
|
error.code = "EINVAL";
|
|
@@ -5258,7 +5258,7 @@ var require_utils = __commonJS({
|
|
|
5258
5258
|
var require_make_dir = __commonJS({
|
|
5259
5259
|
"node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
5260
5260
|
"use strict";
|
|
5261
|
-
var
|
|
5261
|
+
var fs21 = require_fs();
|
|
5262
5262
|
var { checkPath } = require_utils();
|
|
5263
5263
|
var getMode = (options) => {
|
|
5264
5264
|
const defaults3 = { mode: 511 };
|
|
@@ -5267,14 +5267,14 @@ var require_make_dir = __commonJS({
|
|
|
5267
5267
|
};
|
|
5268
5268
|
module2.exports.makeDir = async (dir, options) => {
|
|
5269
5269
|
checkPath(dir);
|
|
5270
|
-
return
|
|
5270
|
+
return fs21.mkdir(dir, {
|
|
5271
5271
|
mode: getMode(options),
|
|
5272
5272
|
recursive: true
|
|
5273
5273
|
});
|
|
5274
5274
|
};
|
|
5275
5275
|
module2.exports.makeDirSync = (dir, options) => {
|
|
5276
5276
|
checkPath(dir);
|
|
5277
|
-
return
|
|
5277
|
+
return fs21.mkdirSync(dir, {
|
|
5278
5278
|
mode: getMode(options),
|
|
5279
5279
|
recursive: true
|
|
5280
5280
|
});
|
|
@@ -5306,13 +5306,13 @@ var require_path_exists = __commonJS({
|
|
|
5306
5306
|
"node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
5307
5307
|
"use strict";
|
|
5308
5308
|
var u = require_universalify().fromPromise;
|
|
5309
|
-
var
|
|
5310
|
-
function pathExists3(
|
|
5311
|
-
return
|
|
5309
|
+
var fs21 = require_fs();
|
|
5310
|
+
function pathExists3(path25) {
|
|
5311
|
+
return fs21.access(path25).then(() => true).catch(() => false);
|
|
5312
5312
|
}
|
|
5313
5313
|
module2.exports = {
|
|
5314
5314
|
pathExists: u(pathExists3),
|
|
5315
|
-
pathExistsSync:
|
|
5315
|
+
pathExistsSync: fs21.existsSync
|
|
5316
5316
|
};
|
|
5317
5317
|
}
|
|
5318
5318
|
});
|
|
@@ -5321,16 +5321,16 @@ var require_path_exists = __commonJS({
|
|
|
5321
5321
|
var require_utimes = __commonJS({
|
|
5322
5322
|
"node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
5323
5323
|
"use strict";
|
|
5324
|
-
var
|
|
5324
|
+
var fs21 = require_fs();
|
|
5325
5325
|
var u = require_universalify().fromPromise;
|
|
5326
|
-
async function utimesMillis(
|
|
5327
|
-
const fd = await
|
|
5326
|
+
async function utimesMillis(path25, atime, mtime) {
|
|
5327
|
+
const fd = await fs21.open(path25, "r+");
|
|
5328
5328
|
let closeErr = null;
|
|
5329
5329
|
try {
|
|
5330
|
-
await
|
|
5330
|
+
await fs21.futimes(fd, atime, mtime);
|
|
5331
5331
|
} finally {
|
|
5332
5332
|
try {
|
|
5333
|
-
await
|
|
5333
|
+
await fs21.close(fd);
|
|
5334
5334
|
} catch (e) {
|
|
5335
5335
|
closeErr = e;
|
|
5336
5336
|
}
|
|
@@ -5339,10 +5339,10 @@ var require_utimes = __commonJS({
|
|
|
5339
5339
|
throw closeErr;
|
|
5340
5340
|
}
|
|
5341
5341
|
}
|
|
5342
|
-
function utimesMillisSync(
|
|
5343
|
-
const fd =
|
|
5344
|
-
|
|
5345
|
-
return
|
|
5342
|
+
function utimesMillisSync(path25, atime, mtime) {
|
|
5343
|
+
const fd = fs21.openSync(path25, "r+");
|
|
5344
|
+
fs21.futimesSync(fd, atime, mtime);
|
|
5345
|
+
return fs21.closeSync(fd);
|
|
5346
5346
|
}
|
|
5347
5347
|
module2.exports = {
|
|
5348
5348
|
utimesMillis: u(utimesMillis),
|
|
@@ -5355,11 +5355,11 @@ var require_utimes = __commonJS({
|
|
|
5355
5355
|
var require_stat = __commonJS({
|
|
5356
5356
|
"node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
5357
5357
|
"use strict";
|
|
5358
|
-
var
|
|
5359
|
-
var
|
|
5358
|
+
var fs21 = require_fs();
|
|
5359
|
+
var path25 = require("path");
|
|
5360
5360
|
var u = require_universalify().fromPromise;
|
|
5361
5361
|
function getStats(src, dest, opts) {
|
|
5362
|
-
const statFunc = opts.dereference ? (file) =>
|
|
5362
|
+
const statFunc = opts.dereference ? (file) => fs21.stat(file, { bigint: true }) : (file) => fs21.lstat(file, { bigint: true });
|
|
5363
5363
|
return Promise.all([
|
|
5364
5364
|
statFunc(src),
|
|
5365
5365
|
statFunc(dest).catch((err) => {
|
|
@@ -5370,7 +5370,7 @@ var require_stat = __commonJS({
|
|
|
5370
5370
|
}
|
|
5371
5371
|
function getStatsSync(src, dest, opts) {
|
|
5372
5372
|
let destStat;
|
|
5373
|
-
const statFunc = opts.dereference ? (file) =>
|
|
5373
|
+
const statFunc = opts.dereference ? (file) => fs21.statSync(file, { bigint: true }) : (file) => fs21.lstatSync(file, { bigint: true });
|
|
5374
5374
|
const srcStat = statFunc(src);
|
|
5375
5375
|
try {
|
|
5376
5376
|
destStat = statFunc(dest);
|
|
@@ -5384,8 +5384,8 @@ var require_stat = __commonJS({
|
|
|
5384
5384
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
5385
5385
|
if (destStat) {
|
|
5386
5386
|
if (areIdentical(srcStat, destStat)) {
|
|
5387
|
-
const srcBaseName =
|
|
5388
|
-
const destBaseName =
|
|
5387
|
+
const srcBaseName = path25.basename(src);
|
|
5388
|
+
const destBaseName = path25.basename(dest);
|
|
5389
5389
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
5390
5390
|
return { srcStat, destStat, isChangingCase: true };
|
|
5391
5391
|
}
|
|
@@ -5407,8 +5407,8 @@ var require_stat = __commonJS({
|
|
|
5407
5407
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
5408
5408
|
if (destStat) {
|
|
5409
5409
|
if (areIdentical(srcStat, destStat)) {
|
|
5410
|
-
const srcBaseName =
|
|
5411
|
-
const destBaseName =
|
|
5410
|
+
const srcBaseName = path25.basename(src);
|
|
5411
|
+
const destBaseName = path25.basename(dest);
|
|
5412
5412
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
5413
5413
|
return { srcStat, destStat, isChangingCase: true };
|
|
5414
5414
|
}
|
|
@@ -5427,12 +5427,12 @@ var require_stat = __commonJS({
|
|
|
5427
5427
|
return { srcStat, destStat };
|
|
5428
5428
|
}
|
|
5429
5429
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
5430
|
-
const srcParent =
|
|
5431
|
-
const destParent =
|
|
5432
|
-
if (destParent === srcParent || destParent ===
|
|
5430
|
+
const srcParent = path25.resolve(path25.dirname(src));
|
|
5431
|
+
const destParent = path25.resolve(path25.dirname(dest));
|
|
5432
|
+
if (destParent === srcParent || destParent === path25.parse(destParent).root) return;
|
|
5433
5433
|
let destStat;
|
|
5434
5434
|
try {
|
|
5435
|
-
destStat = await
|
|
5435
|
+
destStat = await fs21.stat(destParent, { bigint: true });
|
|
5436
5436
|
} catch (err) {
|
|
5437
5437
|
if (err.code === "ENOENT") return;
|
|
5438
5438
|
throw err;
|
|
@@ -5443,12 +5443,12 @@ var require_stat = __commonJS({
|
|
|
5443
5443
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
5444
5444
|
}
|
|
5445
5445
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
5446
|
-
const srcParent =
|
|
5447
|
-
const destParent =
|
|
5448
|
-
if (destParent === srcParent || destParent ===
|
|
5446
|
+
const srcParent = path25.resolve(path25.dirname(src));
|
|
5447
|
+
const destParent = path25.resolve(path25.dirname(dest));
|
|
5448
|
+
if (destParent === srcParent || destParent === path25.parse(destParent).root) return;
|
|
5449
5449
|
let destStat;
|
|
5450
5450
|
try {
|
|
5451
|
-
destStat =
|
|
5451
|
+
destStat = fs21.statSync(destParent, { bigint: true });
|
|
5452
5452
|
} catch (err) {
|
|
5453
5453
|
if (err.code === "ENOENT") return;
|
|
5454
5454
|
throw err;
|
|
@@ -5462,8 +5462,8 @@ var require_stat = __commonJS({
|
|
|
5462
5462
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
5463
5463
|
}
|
|
5464
5464
|
function isSrcSubdir(src, dest) {
|
|
5465
|
-
const srcArr =
|
|
5466
|
-
const destArr =
|
|
5465
|
+
const srcArr = path25.resolve(src).split(path25.sep).filter((i) => i);
|
|
5466
|
+
const destArr = path25.resolve(dest).split(path25.sep).filter((i) => i);
|
|
5467
5467
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
5468
5468
|
}
|
|
5469
5469
|
function errMsg(src, dest, funcName) {
|
|
@@ -5515,8 +5515,8 @@ var require_async = __commonJS({
|
|
|
5515
5515
|
var require_copy = __commonJS({
|
|
5516
5516
|
"node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
5517
5517
|
"use strict";
|
|
5518
|
-
var
|
|
5519
|
-
var
|
|
5518
|
+
var fs21 = require_fs();
|
|
5519
|
+
var path25 = require("path");
|
|
5520
5520
|
var { mkdirs } = require_mkdirs();
|
|
5521
5521
|
var { pathExists: pathExists3 } = require_path_exists();
|
|
5522
5522
|
var { utimesMillis } = require_utimes();
|
|
@@ -5539,7 +5539,7 @@ var require_copy = __commonJS({
|
|
|
5539
5539
|
await stat3.checkParentPaths(src, srcStat, dest, "copy");
|
|
5540
5540
|
const include = await runFilter(src, dest, opts);
|
|
5541
5541
|
if (!include) return;
|
|
5542
|
-
const destParent =
|
|
5542
|
+
const destParent = path25.dirname(dest);
|
|
5543
5543
|
const dirExists = await pathExists3(destParent);
|
|
5544
5544
|
if (!dirExists) {
|
|
5545
5545
|
await mkdirs(destParent);
|
|
@@ -5551,7 +5551,7 @@ var require_copy = __commonJS({
|
|
|
5551
5551
|
return opts.filter(src, dest);
|
|
5552
5552
|
}
|
|
5553
5553
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
5554
|
-
const statFn = opts.dereference ?
|
|
5554
|
+
const statFn = opts.dereference ? fs21.stat : fs21.lstat;
|
|
5555
5555
|
const srcStat = await statFn(src);
|
|
5556
5556
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
5557
5557
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -5563,7 +5563,7 @@ var require_copy = __commonJS({
|
|
|
5563
5563
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
5564
5564
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
5565
5565
|
if (opts.overwrite) {
|
|
5566
|
-
await
|
|
5566
|
+
await fs21.unlink(dest);
|
|
5567
5567
|
return copyFile(srcStat, src, dest, opts);
|
|
5568
5568
|
}
|
|
5569
5569
|
if (opts.errorOnExist) {
|
|
@@ -5571,29 +5571,29 @@ var require_copy = __commonJS({
|
|
|
5571
5571
|
}
|
|
5572
5572
|
}
|
|
5573
5573
|
async function copyFile(srcStat, src, dest, opts) {
|
|
5574
|
-
await
|
|
5574
|
+
await fs21.copyFile(src, dest);
|
|
5575
5575
|
if (opts.preserveTimestamps) {
|
|
5576
5576
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
5577
5577
|
await makeFileWritable(dest, srcStat.mode);
|
|
5578
5578
|
}
|
|
5579
|
-
const updatedSrcStat = await
|
|
5579
|
+
const updatedSrcStat = await fs21.stat(src);
|
|
5580
5580
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
5581
5581
|
}
|
|
5582
|
-
return
|
|
5582
|
+
return fs21.chmod(dest, srcStat.mode);
|
|
5583
5583
|
}
|
|
5584
5584
|
function fileIsNotWritable(srcMode) {
|
|
5585
5585
|
return (srcMode & 128) === 0;
|
|
5586
5586
|
}
|
|
5587
5587
|
function makeFileWritable(dest, srcMode) {
|
|
5588
|
-
return
|
|
5588
|
+
return fs21.chmod(dest, srcMode | 128);
|
|
5589
5589
|
}
|
|
5590
5590
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
5591
5591
|
if (!destStat) {
|
|
5592
|
-
await
|
|
5592
|
+
await fs21.mkdir(dest);
|
|
5593
5593
|
}
|
|
5594
|
-
await asyncIteratorConcurrentProcess(await
|
|
5595
|
-
const srcItem =
|
|
5596
|
-
const destItem =
|
|
5594
|
+
await asyncIteratorConcurrentProcess(await fs21.opendir(src), async (item) => {
|
|
5595
|
+
const srcItem = path25.join(src, item.name);
|
|
5596
|
+
const destItem = path25.join(dest, item.name);
|
|
5597
5597
|
const include = await runFilter(srcItem, destItem, opts);
|
|
5598
5598
|
if (include) {
|
|
5599
5599
|
const { destStat: destStat2 } = await stat3.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -5601,26 +5601,26 @@ var require_copy = __commonJS({
|
|
|
5601
5601
|
}
|
|
5602
5602
|
});
|
|
5603
5603
|
if (!destStat) {
|
|
5604
|
-
await
|
|
5604
|
+
await fs21.chmod(dest, srcStat.mode);
|
|
5605
5605
|
}
|
|
5606
5606
|
}
|
|
5607
5607
|
async function onLink(destStat, src, dest, opts) {
|
|
5608
|
-
let resolvedSrc = await
|
|
5608
|
+
let resolvedSrc = await fs21.readlink(src);
|
|
5609
5609
|
if (opts.dereference) {
|
|
5610
|
-
resolvedSrc =
|
|
5610
|
+
resolvedSrc = path25.resolve(process.cwd(), resolvedSrc);
|
|
5611
5611
|
}
|
|
5612
5612
|
if (!destStat) {
|
|
5613
|
-
return
|
|
5613
|
+
return fs21.symlink(resolvedSrc, dest);
|
|
5614
5614
|
}
|
|
5615
5615
|
let resolvedDest = null;
|
|
5616
5616
|
try {
|
|
5617
|
-
resolvedDest = await
|
|
5617
|
+
resolvedDest = await fs21.readlink(dest);
|
|
5618
5618
|
} catch (e) {
|
|
5619
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
5619
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs21.symlink(resolvedSrc, dest);
|
|
5620
5620
|
throw e;
|
|
5621
5621
|
}
|
|
5622
5622
|
if (opts.dereference) {
|
|
5623
|
-
resolvedDest =
|
|
5623
|
+
resolvedDest = path25.resolve(process.cwd(), resolvedDest);
|
|
5624
5624
|
}
|
|
5625
5625
|
if (stat3.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
5626
5626
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -5628,8 +5628,8 @@ var require_copy = __commonJS({
|
|
|
5628
5628
|
if (stat3.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
5629
5629
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
5630
5630
|
}
|
|
5631
|
-
await
|
|
5632
|
-
return
|
|
5631
|
+
await fs21.unlink(dest);
|
|
5632
|
+
return fs21.symlink(resolvedSrc, dest);
|
|
5633
5633
|
}
|
|
5634
5634
|
module2.exports = copy;
|
|
5635
5635
|
}
|
|
@@ -5639,8 +5639,8 @@ var require_copy = __commonJS({
|
|
|
5639
5639
|
var require_copy_sync = __commonJS({
|
|
5640
5640
|
"node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
5641
5641
|
"use strict";
|
|
5642
|
-
var
|
|
5643
|
-
var
|
|
5642
|
+
var fs21 = require_graceful_fs();
|
|
5643
|
+
var path25 = require("path");
|
|
5644
5644
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
5645
5645
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
5646
5646
|
var stat3 = require_stat();
|
|
@@ -5661,12 +5661,12 @@ var require_copy_sync = __commonJS({
|
|
|
5661
5661
|
const { srcStat, destStat } = stat3.checkPathsSync(src, dest, "copy", opts);
|
|
5662
5662
|
stat3.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
5663
5663
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
5664
|
-
const destParent =
|
|
5665
|
-
if (!
|
|
5664
|
+
const destParent = path25.dirname(dest);
|
|
5665
|
+
if (!fs21.existsSync(destParent)) mkdirsSync(destParent);
|
|
5666
5666
|
return getStats(destStat, src, dest, opts);
|
|
5667
5667
|
}
|
|
5668
5668
|
function getStats(destStat, src, dest, opts) {
|
|
5669
|
-
const statSync = opts.dereference ?
|
|
5669
|
+
const statSync = opts.dereference ? fs21.statSync : fs21.lstatSync;
|
|
5670
5670
|
const srcStat = statSync(src);
|
|
5671
5671
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
5672
5672
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -5681,14 +5681,14 @@ var require_copy_sync = __commonJS({
|
|
|
5681
5681
|
}
|
|
5682
5682
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
5683
5683
|
if (opts.overwrite) {
|
|
5684
|
-
|
|
5684
|
+
fs21.unlinkSync(dest);
|
|
5685
5685
|
return copyFile(srcStat, src, dest, opts);
|
|
5686
5686
|
} else if (opts.errorOnExist) {
|
|
5687
5687
|
throw new Error(`'${dest}' already exists`);
|
|
5688
5688
|
}
|
|
5689
5689
|
}
|
|
5690
5690
|
function copyFile(srcStat, src, dest, opts) {
|
|
5691
|
-
|
|
5691
|
+
fs21.copyFileSync(src, dest);
|
|
5692
5692
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
5693
5693
|
return setDestMode(dest, srcStat.mode);
|
|
5694
5694
|
}
|
|
@@ -5703,10 +5703,10 @@ var require_copy_sync = __commonJS({
|
|
|
5703
5703
|
return setDestMode(dest, srcMode | 128);
|
|
5704
5704
|
}
|
|
5705
5705
|
function setDestMode(dest, srcMode) {
|
|
5706
|
-
return
|
|
5706
|
+
return fs21.chmodSync(dest, srcMode);
|
|
5707
5707
|
}
|
|
5708
5708
|
function setDestTimestamps(src, dest) {
|
|
5709
|
-
const updatedSrcStat =
|
|
5709
|
+
const updatedSrcStat = fs21.statSync(src);
|
|
5710
5710
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
5711
5711
|
}
|
|
5712
5712
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -5714,12 +5714,12 @@ var require_copy_sync = __commonJS({
|
|
|
5714
5714
|
return copyDir(src, dest, opts);
|
|
5715
5715
|
}
|
|
5716
5716
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
5717
|
-
|
|
5717
|
+
fs21.mkdirSync(dest);
|
|
5718
5718
|
copyDir(src, dest, opts);
|
|
5719
5719
|
return setDestMode(dest, srcMode);
|
|
5720
5720
|
}
|
|
5721
5721
|
function copyDir(src, dest, opts) {
|
|
5722
|
-
const dir =
|
|
5722
|
+
const dir = fs21.opendirSync(src);
|
|
5723
5723
|
try {
|
|
5724
5724
|
let dirent;
|
|
5725
5725
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -5730,29 +5730,29 @@ var require_copy_sync = __commonJS({
|
|
|
5730
5730
|
}
|
|
5731
5731
|
}
|
|
5732
5732
|
function copyDirItem(item, src, dest, opts) {
|
|
5733
|
-
const srcItem =
|
|
5734
|
-
const destItem =
|
|
5733
|
+
const srcItem = path25.join(src, item);
|
|
5734
|
+
const destItem = path25.join(dest, item);
|
|
5735
5735
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
5736
5736
|
const { destStat } = stat3.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
5737
5737
|
return getStats(destStat, srcItem, destItem, opts);
|
|
5738
5738
|
}
|
|
5739
5739
|
function onLink(destStat, src, dest, opts) {
|
|
5740
|
-
let resolvedSrc =
|
|
5740
|
+
let resolvedSrc = fs21.readlinkSync(src);
|
|
5741
5741
|
if (opts.dereference) {
|
|
5742
|
-
resolvedSrc =
|
|
5742
|
+
resolvedSrc = path25.resolve(process.cwd(), resolvedSrc);
|
|
5743
5743
|
}
|
|
5744
5744
|
if (!destStat) {
|
|
5745
|
-
return
|
|
5745
|
+
return fs21.symlinkSync(resolvedSrc, dest);
|
|
5746
5746
|
} else {
|
|
5747
5747
|
let resolvedDest;
|
|
5748
5748
|
try {
|
|
5749
|
-
resolvedDest =
|
|
5749
|
+
resolvedDest = fs21.readlinkSync(dest);
|
|
5750
5750
|
} catch (err) {
|
|
5751
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
5751
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs21.symlinkSync(resolvedSrc, dest);
|
|
5752
5752
|
throw err;
|
|
5753
5753
|
}
|
|
5754
5754
|
if (opts.dereference) {
|
|
5755
|
-
resolvedDest =
|
|
5755
|
+
resolvedDest = path25.resolve(process.cwd(), resolvedDest);
|
|
5756
5756
|
}
|
|
5757
5757
|
if (stat3.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
5758
5758
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -5764,8 +5764,8 @@ var require_copy_sync = __commonJS({
|
|
|
5764
5764
|
}
|
|
5765
5765
|
}
|
|
5766
5766
|
function copyLink(resolvedSrc, dest) {
|
|
5767
|
-
|
|
5768
|
-
return
|
|
5767
|
+
fs21.unlinkSync(dest);
|
|
5768
|
+
return fs21.symlinkSync(resolvedSrc, dest);
|
|
5769
5769
|
}
|
|
5770
5770
|
module2.exports = copySync;
|
|
5771
5771
|
}
|
|
@@ -5787,13 +5787,13 @@ var require_copy2 = __commonJS({
|
|
|
5787
5787
|
var require_remove = __commonJS({
|
|
5788
5788
|
"node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
5789
5789
|
"use strict";
|
|
5790
|
-
var
|
|
5790
|
+
var fs21 = require_graceful_fs();
|
|
5791
5791
|
var u = require_universalify().fromCallback;
|
|
5792
|
-
function remove(
|
|
5793
|
-
|
|
5792
|
+
function remove(path25, callback) {
|
|
5793
|
+
fs21.rm(path25, { recursive: true, force: true }, callback);
|
|
5794
5794
|
}
|
|
5795
|
-
function removeSync(
|
|
5796
|
-
|
|
5795
|
+
function removeSync(path25) {
|
|
5796
|
+
fs21.rmSync(path25, { recursive: true, force: true });
|
|
5797
5797
|
}
|
|
5798
5798
|
module2.exports = {
|
|
5799
5799
|
remove: u(remove),
|
|
@@ -5807,28 +5807,28 @@ var require_empty = __commonJS({
|
|
|
5807
5807
|
"node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
5808
5808
|
"use strict";
|
|
5809
5809
|
var u = require_universalify().fromPromise;
|
|
5810
|
-
var
|
|
5811
|
-
var
|
|
5810
|
+
var fs21 = require_fs();
|
|
5811
|
+
var path25 = require("path");
|
|
5812
5812
|
var mkdir = require_mkdirs();
|
|
5813
5813
|
var remove = require_remove();
|
|
5814
5814
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
5815
5815
|
let items;
|
|
5816
5816
|
try {
|
|
5817
|
-
items = await
|
|
5817
|
+
items = await fs21.readdir(dir);
|
|
5818
5818
|
} catch {
|
|
5819
5819
|
return mkdir.mkdirs(dir);
|
|
5820
5820
|
}
|
|
5821
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
5821
|
+
return Promise.all(items.map((item) => remove.remove(path25.join(dir, item))));
|
|
5822
5822
|
});
|
|
5823
5823
|
function emptyDirSync(dir) {
|
|
5824
5824
|
let items;
|
|
5825
5825
|
try {
|
|
5826
|
-
items =
|
|
5826
|
+
items = fs21.readdirSync(dir);
|
|
5827
5827
|
} catch {
|
|
5828
5828
|
return mkdir.mkdirsSync(dir);
|
|
5829
5829
|
}
|
|
5830
5830
|
items.forEach((item) => {
|
|
5831
|
-
item =
|
|
5831
|
+
item = path25.join(dir, item);
|
|
5832
5832
|
remove.removeSync(item);
|
|
5833
5833
|
});
|
|
5834
5834
|
}
|
|
@@ -5846,52 +5846,52 @@ var require_file = __commonJS({
|
|
|
5846
5846
|
"node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
5847
5847
|
"use strict";
|
|
5848
5848
|
var u = require_universalify().fromPromise;
|
|
5849
|
-
var
|
|
5850
|
-
var
|
|
5849
|
+
var path25 = require("path");
|
|
5850
|
+
var fs21 = require_fs();
|
|
5851
5851
|
var mkdir = require_mkdirs();
|
|
5852
5852
|
async function createFile(file) {
|
|
5853
5853
|
let stats;
|
|
5854
5854
|
try {
|
|
5855
|
-
stats = await
|
|
5855
|
+
stats = await fs21.stat(file);
|
|
5856
5856
|
} catch {
|
|
5857
5857
|
}
|
|
5858
5858
|
if (stats && stats.isFile()) return;
|
|
5859
|
-
const dir =
|
|
5859
|
+
const dir = path25.dirname(file);
|
|
5860
5860
|
let dirStats = null;
|
|
5861
5861
|
try {
|
|
5862
|
-
dirStats = await
|
|
5862
|
+
dirStats = await fs21.stat(dir);
|
|
5863
5863
|
} catch (err) {
|
|
5864
5864
|
if (err.code === "ENOENT") {
|
|
5865
5865
|
await mkdir.mkdirs(dir);
|
|
5866
|
-
await
|
|
5866
|
+
await fs21.writeFile(file, "");
|
|
5867
5867
|
return;
|
|
5868
5868
|
} else {
|
|
5869
5869
|
throw err;
|
|
5870
5870
|
}
|
|
5871
5871
|
}
|
|
5872
5872
|
if (dirStats.isDirectory()) {
|
|
5873
|
-
await
|
|
5873
|
+
await fs21.writeFile(file, "");
|
|
5874
5874
|
} else {
|
|
5875
|
-
await
|
|
5875
|
+
await fs21.readdir(dir);
|
|
5876
5876
|
}
|
|
5877
5877
|
}
|
|
5878
5878
|
function createFileSync(file) {
|
|
5879
5879
|
let stats;
|
|
5880
5880
|
try {
|
|
5881
|
-
stats =
|
|
5881
|
+
stats = fs21.statSync(file);
|
|
5882
5882
|
} catch {
|
|
5883
5883
|
}
|
|
5884
5884
|
if (stats && stats.isFile()) return;
|
|
5885
|
-
const dir =
|
|
5885
|
+
const dir = path25.dirname(file);
|
|
5886
5886
|
try {
|
|
5887
|
-
if (!
|
|
5888
|
-
|
|
5887
|
+
if (!fs21.statSync(dir).isDirectory()) {
|
|
5888
|
+
fs21.readdirSync(dir);
|
|
5889
5889
|
}
|
|
5890
5890
|
} catch (err) {
|
|
5891
5891
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
5892
5892
|
else throw err;
|
|
5893
5893
|
}
|
|
5894
|
-
|
|
5894
|
+
fs21.writeFileSync(file, "");
|
|
5895
5895
|
}
|
|
5896
5896
|
module2.exports = {
|
|
5897
5897
|
createFile: u(createFile),
|
|
@@ -5905,50 +5905,50 @@ var require_link = __commonJS({
|
|
|
5905
5905
|
"node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
5906
5906
|
"use strict";
|
|
5907
5907
|
var u = require_universalify().fromPromise;
|
|
5908
|
-
var
|
|
5909
|
-
var
|
|
5908
|
+
var path25 = require("path");
|
|
5909
|
+
var fs21 = require_fs();
|
|
5910
5910
|
var mkdir = require_mkdirs();
|
|
5911
5911
|
var { pathExists: pathExists3 } = require_path_exists();
|
|
5912
5912
|
var { areIdentical } = require_stat();
|
|
5913
5913
|
async function createLink(srcpath, dstpath) {
|
|
5914
5914
|
let dstStat;
|
|
5915
5915
|
try {
|
|
5916
|
-
dstStat = await
|
|
5916
|
+
dstStat = await fs21.lstat(dstpath);
|
|
5917
5917
|
} catch {
|
|
5918
5918
|
}
|
|
5919
5919
|
let srcStat;
|
|
5920
5920
|
try {
|
|
5921
|
-
srcStat = await
|
|
5921
|
+
srcStat = await fs21.lstat(srcpath);
|
|
5922
5922
|
} catch (err) {
|
|
5923
5923
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
5924
5924
|
throw err;
|
|
5925
5925
|
}
|
|
5926
5926
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
5927
|
-
const dir =
|
|
5927
|
+
const dir = path25.dirname(dstpath);
|
|
5928
5928
|
const dirExists = await pathExists3(dir);
|
|
5929
5929
|
if (!dirExists) {
|
|
5930
5930
|
await mkdir.mkdirs(dir);
|
|
5931
5931
|
}
|
|
5932
|
-
await
|
|
5932
|
+
await fs21.link(srcpath, dstpath);
|
|
5933
5933
|
}
|
|
5934
5934
|
function createLinkSync(srcpath, dstpath) {
|
|
5935
5935
|
let dstStat;
|
|
5936
5936
|
try {
|
|
5937
|
-
dstStat =
|
|
5937
|
+
dstStat = fs21.lstatSync(dstpath);
|
|
5938
5938
|
} catch {
|
|
5939
5939
|
}
|
|
5940
5940
|
try {
|
|
5941
|
-
const srcStat =
|
|
5941
|
+
const srcStat = fs21.lstatSync(srcpath);
|
|
5942
5942
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
5943
5943
|
} catch (err) {
|
|
5944
5944
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
5945
5945
|
throw err;
|
|
5946
5946
|
}
|
|
5947
|
-
const dir =
|
|
5948
|
-
const dirExists =
|
|
5949
|
-
if (dirExists) return
|
|
5947
|
+
const dir = path25.dirname(dstpath);
|
|
5948
|
+
const dirExists = fs21.existsSync(dir);
|
|
5949
|
+
if (dirExists) return fs21.linkSync(srcpath, dstpath);
|
|
5950
5950
|
mkdir.mkdirsSync(dir);
|
|
5951
|
-
return
|
|
5951
|
+
return fs21.linkSync(srcpath, dstpath);
|
|
5952
5952
|
}
|
|
5953
5953
|
module2.exports = {
|
|
5954
5954
|
createLink: u(createLink),
|
|
@@ -5961,14 +5961,14 @@ var require_link = __commonJS({
|
|
|
5961
5961
|
var require_symlink_paths = __commonJS({
|
|
5962
5962
|
"node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
5963
5963
|
"use strict";
|
|
5964
|
-
var
|
|
5965
|
-
var
|
|
5964
|
+
var path25 = require("path");
|
|
5965
|
+
var fs21 = require_fs();
|
|
5966
5966
|
var { pathExists: pathExists3 } = require_path_exists();
|
|
5967
5967
|
var u = require_universalify().fromPromise;
|
|
5968
5968
|
async function symlinkPaths(srcpath, dstpath) {
|
|
5969
|
-
if (
|
|
5969
|
+
if (path25.isAbsolute(srcpath)) {
|
|
5970
5970
|
try {
|
|
5971
|
-
await
|
|
5971
|
+
await fs21.lstat(srcpath);
|
|
5972
5972
|
} catch (err) {
|
|
5973
5973
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
5974
5974
|
throw err;
|
|
@@ -5978,8 +5978,8 @@ var require_symlink_paths = __commonJS({
|
|
|
5978
5978
|
toDst: srcpath
|
|
5979
5979
|
};
|
|
5980
5980
|
}
|
|
5981
|
-
const dstdir =
|
|
5982
|
-
const relativeToDst =
|
|
5981
|
+
const dstdir = path25.dirname(dstpath);
|
|
5982
|
+
const relativeToDst = path25.join(dstdir, srcpath);
|
|
5983
5983
|
const exists = await pathExists3(relativeToDst);
|
|
5984
5984
|
if (exists) {
|
|
5985
5985
|
return {
|
|
@@ -5988,39 +5988,39 @@ var require_symlink_paths = __commonJS({
|
|
|
5988
5988
|
};
|
|
5989
5989
|
}
|
|
5990
5990
|
try {
|
|
5991
|
-
await
|
|
5991
|
+
await fs21.lstat(srcpath);
|
|
5992
5992
|
} catch (err) {
|
|
5993
5993
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
5994
5994
|
throw err;
|
|
5995
5995
|
}
|
|
5996
5996
|
return {
|
|
5997
5997
|
toCwd: srcpath,
|
|
5998
|
-
toDst:
|
|
5998
|
+
toDst: path25.relative(dstdir, srcpath)
|
|
5999
5999
|
};
|
|
6000
6000
|
}
|
|
6001
6001
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
6002
|
-
if (
|
|
6003
|
-
const exists2 =
|
|
6002
|
+
if (path25.isAbsolute(srcpath)) {
|
|
6003
|
+
const exists2 = fs21.existsSync(srcpath);
|
|
6004
6004
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
6005
6005
|
return {
|
|
6006
6006
|
toCwd: srcpath,
|
|
6007
6007
|
toDst: srcpath
|
|
6008
6008
|
};
|
|
6009
6009
|
}
|
|
6010
|
-
const dstdir =
|
|
6011
|
-
const relativeToDst =
|
|
6012
|
-
const exists =
|
|
6010
|
+
const dstdir = path25.dirname(dstpath);
|
|
6011
|
+
const relativeToDst = path25.join(dstdir, srcpath);
|
|
6012
|
+
const exists = fs21.existsSync(relativeToDst);
|
|
6013
6013
|
if (exists) {
|
|
6014
6014
|
return {
|
|
6015
6015
|
toCwd: relativeToDst,
|
|
6016
6016
|
toDst: srcpath
|
|
6017
6017
|
};
|
|
6018
6018
|
}
|
|
6019
|
-
const srcExists =
|
|
6019
|
+
const srcExists = fs21.existsSync(srcpath);
|
|
6020
6020
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
6021
6021
|
return {
|
|
6022
6022
|
toCwd: srcpath,
|
|
6023
|
-
toDst:
|
|
6023
|
+
toDst: path25.relative(dstdir, srcpath)
|
|
6024
6024
|
};
|
|
6025
6025
|
}
|
|
6026
6026
|
module2.exports = {
|
|
@@ -6034,13 +6034,13 @@ var require_symlink_paths = __commonJS({
|
|
|
6034
6034
|
var require_symlink_type = __commonJS({
|
|
6035
6035
|
"node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
6036
6036
|
"use strict";
|
|
6037
|
-
var
|
|
6037
|
+
var fs21 = require_fs();
|
|
6038
6038
|
var u = require_universalify().fromPromise;
|
|
6039
6039
|
async function symlinkType(srcpath, type) {
|
|
6040
6040
|
if (type) return type;
|
|
6041
6041
|
let stats;
|
|
6042
6042
|
try {
|
|
6043
|
-
stats = await
|
|
6043
|
+
stats = await fs21.lstat(srcpath);
|
|
6044
6044
|
} catch {
|
|
6045
6045
|
return "file";
|
|
6046
6046
|
}
|
|
@@ -6050,7 +6050,7 @@ var require_symlink_type = __commonJS({
|
|
|
6050
6050
|
if (type) return type;
|
|
6051
6051
|
let stats;
|
|
6052
6052
|
try {
|
|
6053
|
-
stats =
|
|
6053
|
+
stats = fs21.lstatSync(srcpath);
|
|
6054
6054
|
} catch {
|
|
6055
6055
|
return "file";
|
|
6056
6056
|
}
|
|
@@ -6068,8 +6068,8 @@ var require_symlink = __commonJS({
|
|
|
6068
6068
|
"node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
6069
6069
|
"use strict";
|
|
6070
6070
|
var u = require_universalify().fromPromise;
|
|
6071
|
-
var
|
|
6072
|
-
var
|
|
6071
|
+
var path25 = require("path");
|
|
6072
|
+
var fs21 = require_fs();
|
|
6073
6073
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
6074
6074
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
6075
6075
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -6078,44 +6078,44 @@ var require_symlink = __commonJS({
|
|
|
6078
6078
|
async function createSymlink(srcpath, dstpath, type) {
|
|
6079
6079
|
let stats;
|
|
6080
6080
|
try {
|
|
6081
|
-
stats = await
|
|
6081
|
+
stats = await fs21.lstat(dstpath);
|
|
6082
6082
|
} catch {
|
|
6083
6083
|
}
|
|
6084
6084
|
if (stats && stats.isSymbolicLink()) {
|
|
6085
6085
|
const [srcStat, dstStat] = await Promise.all([
|
|
6086
|
-
|
|
6087
|
-
|
|
6086
|
+
fs21.stat(srcpath),
|
|
6087
|
+
fs21.stat(dstpath)
|
|
6088
6088
|
]);
|
|
6089
6089
|
if (areIdentical(srcStat, dstStat)) return;
|
|
6090
6090
|
}
|
|
6091
6091
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
6092
6092
|
srcpath = relative.toDst;
|
|
6093
6093
|
const toType = await symlinkType(relative.toCwd, type);
|
|
6094
|
-
const dir =
|
|
6094
|
+
const dir = path25.dirname(dstpath);
|
|
6095
6095
|
if (!await pathExists3(dir)) {
|
|
6096
6096
|
await mkdirs(dir);
|
|
6097
6097
|
}
|
|
6098
|
-
return
|
|
6098
|
+
return fs21.symlink(srcpath, dstpath, toType);
|
|
6099
6099
|
}
|
|
6100
6100
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
6101
6101
|
let stats;
|
|
6102
6102
|
try {
|
|
6103
|
-
stats =
|
|
6103
|
+
stats = fs21.lstatSync(dstpath);
|
|
6104
6104
|
} catch {
|
|
6105
6105
|
}
|
|
6106
6106
|
if (stats && stats.isSymbolicLink()) {
|
|
6107
|
-
const srcStat =
|
|
6108
|
-
const dstStat =
|
|
6107
|
+
const srcStat = fs21.statSync(srcpath);
|
|
6108
|
+
const dstStat = fs21.statSync(dstpath);
|
|
6109
6109
|
if (areIdentical(srcStat, dstStat)) return;
|
|
6110
6110
|
}
|
|
6111
6111
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
6112
6112
|
srcpath = relative.toDst;
|
|
6113
6113
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
6114
|
-
const dir =
|
|
6115
|
-
const exists =
|
|
6116
|
-
if (exists) return
|
|
6114
|
+
const dir = path25.dirname(dstpath);
|
|
6115
|
+
const exists = fs21.existsSync(dir);
|
|
6116
|
+
if (exists) return fs21.symlinkSync(srcpath, dstpath, type);
|
|
6117
6117
|
mkdirsSync(dir);
|
|
6118
|
-
return
|
|
6118
|
+
return fs21.symlinkSync(srcpath, dstpath, type);
|
|
6119
6119
|
}
|
|
6120
6120
|
module2.exports = {
|
|
6121
6121
|
createSymlink: u(createSymlink),
|
|
@@ -6182,9 +6182,9 @@ var require_jsonfile = __commonJS({
|
|
|
6182
6182
|
if (typeof options === "string") {
|
|
6183
6183
|
options = { encoding: options };
|
|
6184
6184
|
}
|
|
6185
|
-
const
|
|
6185
|
+
const fs21 = options.fs || _fs;
|
|
6186
6186
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
6187
|
-
let data = await universalify.fromCallback(
|
|
6187
|
+
let data = await universalify.fromCallback(fs21.readFile)(file, options);
|
|
6188
6188
|
data = stripBom(data);
|
|
6189
6189
|
let obj;
|
|
6190
6190
|
try {
|
|
@@ -6204,10 +6204,10 @@ var require_jsonfile = __commonJS({
|
|
|
6204
6204
|
if (typeof options === "string") {
|
|
6205
6205
|
options = { encoding: options };
|
|
6206
6206
|
}
|
|
6207
|
-
const
|
|
6207
|
+
const fs21 = options.fs || _fs;
|
|
6208
6208
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
6209
6209
|
try {
|
|
6210
|
-
let content =
|
|
6210
|
+
let content = fs21.readFileSync(file, options);
|
|
6211
6211
|
content = stripBom(content);
|
|
6212
6212
|
return JSON.parse(content, options.reviver);
|
|
6213
6213
|
} catch (err) {
|
|
@@ -6220,15 +6220,15 @@ var require_jsonfile = __commonJS({
|
|
|
6220
6220
|
}
|
|
6221
6221
|
}
|
|
6222
6222
|
async function _writeFile(file, obj, options = {}) {
|
|
6223
|
-
const
|
|
6223
|
+
const fs21 = options.fs || _fs;
|
|
6224
6224
|
const str = stringify(obj, options);
|
|
6225
|
-
await universalify.fromCallback(
|
|
6225
|
+
await universalify.fromCallback(fs21.writeFile)(file, str, options);
|
|
6226
6226
|
}
|
|
6227
6227
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
6228
6228
|
function writeFileSync2(file, obj, options = {}) {
|
|
6229
|
-
const
|
|
6229
|
+
const fs21 = options.fs || _fs;
|
|
6230
6230
|
const str = stringify(obj, options);
|
|
6231
|
-
return
|
|
6231
|
+
return fs21.writeFileSync(file, str, options);
|
|
6232
6232
|
}
|
|
6233
6233
|
module2.exports = {
|
|
6234
6234
|
readFile,
|
|
@@ -6259,23 +6259,23 @@ var require_output_file = __commonJS({
|
|
|
6259
6259
|
"node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
6260
6260
|
"use strict";
|
|
6261
6261
|
var u = require_universalify().fromPromise;
|
|
6262
|
-
var
|
|
6263
|
-
var
|
|
6262
|
+
var fs21 = require_fs();
|
|
6263
|
+
var path25 = require("path");
|
|
6264
6264
|
var mkdir = require_mkdirs();
|
|
6265
6265
|
var pathExists3 = require_path_exists().pathExists;
|
|
6266
6266
|
async function outputFile(file, data, encoding = "utf-8") {
|
|
6267
|
-
const dir =
|
|
6267
|
+
const dir = path25.dirname(file);
|
|
6268
6268
|
if (!await pathExists3(dir)) {
|
|
6269
6269
|
await mkdir.mkdirs(dir);
|
|
6270
6270
|
}
|
|
6271
|
-
return
|
|
6271
|
+
return fs21.writeFile(file, data, encoding);
|
|
6272
6272
|
}
|
|
6273
6273
|
function outputFileSync(file, ...args) {
|
|
6274
|
-
const dir =
|
|
6275
|
-
if (!
|
|
6274
|
+
const dir = path25.dirname(file);
|
|
6275
|
+
if (!fs21.existsSync(dir)) {
|
|
6276
6276
|
mkdir.mkdirsSync(dir);
|
|
6277
6277
|
}
|
|
6278
|
-
|
|
6278
|
+
fs21.writeFileSync(file, ...args);
|
|
6279
6279
|
}
|
|
6280
6280
|
module2.exports = {
|
|
6281
6281
|
outputFile: u(outputFile),
|
|
@@ -6334,8 +6334,8 @@ var require_json = __commonJS({
|
|
|
6334
6334
|
var require_move = __commonJS({
|
|
6335
6335
|
"node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
6336
6336
|
"use strict";
|
|
6337
|
-
var
|
|
6338
|
-
var
|
|
6337
|
+
var fs21 = require_fs();
|
|
6338
|
+
var path25 = require("path");
|
|
6339
6339
|
var { copy } = require_copy2();
|
|
6340
6340
|
var { remove } = require_remove();
|
|
6341
6341
|
var { mkdirp } = require_mkdirs();
|
|
@@ -6345,8 +6345,8 @@ var require_move = __commonJS({
|
|
|
6345
6345
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
6346
6346
|
const { srcStat, isChangingCase = false } = await stat3.checkPaths(src, dest, "move", opts);
|
|
6347
6347
|
await stat3.checkParentPaths(src, srcStat, dest, "move");
|
|
6348
|
-
const destParent =
|
|
6349
|
-
const parsedParentPath =
|
|
6348
|
+
const destParent = path25.dirname(dest);
|
|
6349
|
+
const parsedParentPath = path25.parse(destParent);
|
|
6350
6350
|
if (parsedParentPath.root !== destParent) {
|
|
6351
6351
|
await mkdirp(destParent);
|
|
6352
6352
|
}
|
|
@@ -6361,7 +6361,7 @@ var require_move = __commonJS({
|
|
|
6361
6361
|
}
|
|
6362
6362
|
}
|
|
6363
6363
|
try {
|
|
6364
|
-
await
|
|
6364
|
+
await fs21.rename(src, dest);
|
|
6365
6365
|
} catch (err) {
|
|
6366
6366
|
if (err.code !== "EXDEV") {
|
|
6367
6367
|
throw err;
|
|
@@ -6386,8 +6386,8 @@ var require_move = __commonJS({
|
|
|
6386
6386
|
var require_move_sync = __commonJS({
|
|
6387
6387
|
"node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
6388
6388
|
"use strict";
|
|
6389
|
-
var
|
|
6390
|
-
var
|
|
6389
|
+
var fs21 = require_graceful_fs();
|
|
6390
|
+
var path25 = require("path");
|
|
6391
6391
|
var copySync = require_copy2().copySync;
|
|
6392
6392
|
var removeSync = require_remove().removeSync;
|
|
6393
6393
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -6397,12 +6397,12 @@ var require_move_sync = __commonJS({
|
|
|
6397
6397
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
6398
6398
|
const { srcStat, isChangingCase = false } = stat3.checkPathsSync(src, dest, "move", opts);
|
|
6399
6399
|
stat3.checkParentPathsSync(src, srcStat, dest, "move");
|
|
6400
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
6400
|
+
if (!isParentRoot(dest)) mkdirpSync(path25.dirname(dest));
|
|
6401
6401
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
6402
6402
|
}
|
|
6403
6403
|
function isParentRoot(dest) {
|
|
6404
|
-
const parent =
|
|
6405
|
-
const parsedPath =
|
|
6404
|
+
const parent = path25.dirname(dest);
|
|
6405
|
+
const parsedPath = path25.parse(parent);
|
|
6406
6406
|
return parsedPath.root === parent;
|
|
6407
6407
|
}
|
|
6408
6408
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -6411,12 +6411,12 @@ var require_move_sync = __commonJS({
|
|
|
6411
6411
|
removeSync(dest);
|
|
6412
6412
|
return rename(src, dest, overwrite);
|
|
6413
6413
|
}
|
|
6414
|
-
if (
|
|
6414
|
+
if (fs21.existsSync(dest)) throw new Error("dest already exists.");
|
|
6415
6415
|
return rename(src, dest, overwrite);
|
|
6416
6416
|
}
|
|
6417
6417
|
function rename(src, dest, overwrite) {
|
|
6418
6418
|
try {
|
|
6419
|
-
|
|
6419
|
+
fs21.renameSync(src, dest);
|
|
6420
6420
|
} catch (err) {
|
|
6421
6421
|
if (err.code !== "EXDEV") throw err;
|
|
6422
6422
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -18202,19 +18202,19 @@ var require_is_unicode_supported = __commonJS({
|
|
|
18202
18202
|
var require_log_symbols = __commonJS({
|
|
18203
18203
|
"node_modules/log-symbols/index.js"(exports2, module2) {
|
|
18204
18204
|
"use strict";
|
|
18205
|
-
var
|
|
18205
|
+
var chalk28 = require_source();
|
|
18206
18206
|
var isUnicodeSupported2 = require_is_unicode_supported();
|
|
18207
18207
|
var main = {
|
|
18208
|
-
info:
|
|
18209
|
-
success:
|
|
18210
|
-
warning:
|
|
18211
|
-
error:
|
|
18208
|
+
info: chalk28.blue("\u2139"),
|
|
18209
|
+
success: chalk28.green("\u2714"),
|
|
18210
|
+
warning: chalk28.yellow("\u26A0"),
|
|
18211
|
+
error: chalk28.red("\u2716")
|
|
18212
18212
|
};
|
|
18213
18213
|
var fallback = {
|
|
18214
|
-
info:
|
|
18215
|
-
success:
|
|
18216
|
-
warning:
|
|
18217
|
-
error:
|
|
18214
|
+
info: chalk28.blue("i"),
|
|
18215
|
+
success: chalk28.green("\u221A"),
|
|
18216
|
+
warning: chalk28.yellow("\u203C"),
|
|
18217
|
+
error: chalk28.red("\xD7")
|
|
18218
18218
|
};
|
|
18219
18219
|
module2.exports = isUnicodeSupported2() ? main : fallback;
|
|
18220
18220
|
}
|
|
@@ -21682,7 +21682,7 @@ var require_ora = __commonJS({
|
|
|
21682
21682
|
"node_modules/ora/index.js"(exports2, module2) {
|
|
21683
21683
|
"use strict";
|
|
21684
21684
|
var readline2 = require("readline");
|
|
21685
|
-
var
|
|
21685
|
+
var chalk28 = require_source();
|
|
21686
21686
|
var cliCursor = require_cli_cursor();
|
|
21687
21687
|
var cliSpinners = require_cli_spinners();
|
|
21688
21688
|
var logSymbols = require_log_symbols();
|
|
@@ -21879,7 +21879,7 @@ var require_ora = __commonJS({
|
|
|
21879
21879
|
const { frames } = this.spinner;
|
|
21880
21880
|
let frame = frames[this.frameIndex];
|
|
21881
21881
|
if (this.color) {
|
|
21882
|
-
frame =
|
|
21882
|
+
frame = chalk28[this.color](frame);
|
|
21883
21883
|
}
|
|
21884
21884
|
this.frameIndex = ++this.frameIndex % frames.length;
|
|
21885
21885
|
const fullPrefixText = typeof this.prefixText === "string" && this.prefixText !== "" ? this.prefixText + " " : "";
|
|
@@ -27580,10 +27580,10 @@ var require_lib2 = __commonJS({
|
|
|
27580
27580
|
exports2.analyse = analyse;
|
|
27581
27581
|
var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
|
|
27582
27582
|
let fd;
|
|
27583
|
-
const
|
|
27583
|
+
const fs21 = (0, node_1.default)();
|
|
27584
27584
|
const handler = (err, buffer) => {
|
|
27585
27585
|
if (fd) {
|
|
27586
|
-
|
|
27586
|
+
fs21.closeSync(fd);
|
|
27587
27587
|
}
|
|
27588
27588
|
if (err) {
|
|
27589
27589
|
reject(err);
|
|
@@ -27595,9 +27595,9 @@ var require_lib2 = __commonJS({
|
|
|
27595
27595
|
};
|
|
27596
27596
|
const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
|
|
27597
27597
|
if (sampleSize > 0) {
|
|
27598
|
-
fd =
|
|
27598
|
+
fd = fs21.openSync(filepath, "r");
|
|
27599
27599
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
27600
|
-
|
|
27600
|
+
fs21.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
|
|
27601
27601
|
if (err) {
|
|
27602
27602
|
handler(err, null);
|
|
27603
27603
|
} else {
|
|
@@ -27609,22 +27609,22 @@ var require_lib2 = __commonJS({
|
|
|
27609
27609
|
});
|
|
27610
27610
|
return;
|
|
27611
27611
|
}
|
|
27612
|
-
|
|
27612
|
+
fs21.readFile(filepath, handler);
|
|
27613
27613
|
});
|
|
27614
27614
|
exports2.detectFile = detectFile;
|
|
27615
27615
|
var detectFileSync = (filepath, opts = {}) => {
|
|
27616
|
-
const
|
|
27616
|
+
const fs21 = (0, node_1.default)();
|
|
27617
27617
|
if (opts && opts.sampleSize) {
|
|
27618
|
-
const fd =
|
|
27618
|
+
const fd = fs21.openSync(filepath, "r");
|
|
27619
27619
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
27620
|
-
const bytesRead =
|
|
27620
|
+
const bytesRead = fs21.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
27621
27621
|
if (bytesRead < opts.sampleSize) {
|
|
27622
27622
|
sample = sample.subarray(0, bytesRead);
|
|
27623
27623
|
}
|
|
27624
|
-
|
|
27624
|
+
fs21.closeSync(fd);
|
|
27625
27625
|
return (0, exports2.detect)(sample);
|
|
27626
27626
|
}
|
|
27627
|
-
return (0, exports2.detect)(
|
|
27627
|
+
return (0, exports2.detect)(fs21.readFileSync(filepath));
|
|
27628
27628
|
};
|
|
27629
27629
|
exports2.detectFileSync = detectFileSync;
|
|
27630
27630
|
exports2.default = {
|
|
@@ -40388,11 +40388,11 @@ var require_mime_types = __commonJS({
|
|
|
40388
40388
|
}
|
|
40389
40389
|
return exts[0];
|
|
40390
40390
|
}
|
|
40391
|
-
function lookup(
|
|
40392
|
-
if (!
|
|
40391
|
+
function lookup(path25) {
|
|
40392
|
+
if (!path25 || typeof path25 !== "string") {
|
|
40393
40393
|
return false;
|
|
40394
40394
|
}
|
|
40395
|
-
var extension2 = extname3("x." +
|
|
40395
|
+
var extension2 = extname3("x." + path25).toLowerCase().substr(1);
|
|
40396
40396
|
if (!extension2) {
|
|
40397
40397
|
return false;
|
|
40398
40398
|
}
|
|
@@ -41497,21 +41497,21 @@ var require_form_data = __commonJS({
|
|
|
41497
41497
|
"use strict";
|
|
41498
41498
|
var CombinedStream = require_combined_stream();
|
|
41499
41499
|
var util3 = require("util");
|
|
41500
|
-
var
|
|
41500
|
+
var path25 = require("path");
|
|
41501
41501
|
var http4 = require("http");
|
|
41502
41502
|
var https2 = require("https");
|
|
41503
41503
|
var parseUrl = require("url").parse;
|
|
41504
|
-
var
|
|
41504
|
+
var fs21 = require("fs");
|
|
41505
41505
|
var Stream2 = require("stream").Stream;
|
|
41506
|
-
var
|
|
41506
|
+
var crypto5 = require("crypto");
|
|
41507
41507
|
var mime = require_mime_types();
|
|
41508
41508
|
var asynckit = require_asynckit();
|
|
41509
41509
|
var setToStringTag = require_es_set_tostringtag();
|
|
41510
41510
|
var hasOwn = require_hasown();
|
|
41511
41511
|
var populate = require_populate();
|
|
41512
|
-
function
|
|
41513
|
-
if (!(this instanceof
|
|
41514
|
-
return new
|
|
41512
|
+
function FormData6(options) {
|
|
41513
|
+
if (!(this instanceof FormData6)) {
|
|
41514
|
+
return new FormData6(options);
|
|
41515
41515
|
}
|
|
41516
41516
|
this._overheadLength = 0;
|
|
41517
41517
|
this._valueLength = 0;
|
|
@@ -41522,10 +41522,10 @@ var require_form_data = __commonJS({
|
|
|
41522
41522
|
this[option] = options[option];
|
|
41523
41523
|
}
|
|
41524
41524
|
}
|
|
41525
|
-
util3.inherits(
|
|
41526
|
-
|
|
41527
|
-
|
|
41528
|
-
|
|
41525
|
+
util3.inherits(FormData6, CombinedStream);
|
|
41526
|
+
FormData6.LINE_BREAK = "\r\n";
|
|
41527
|
+
FormData6.DEFAULT_CONTENT_TYPE = "application/octet-stream";
|
|
41528
|
+
FormData6.prototype.append = function(field, value2, options) {
|
|
41529
41529
|
options = options || {};
|
|
41530
41530
|
if (typeof options === "string") {
|
|
41531
41531
|
options = { filename: options };
|
|
@@ -41545,7 +41545,7 @@ var require_form_data = __commonJS({
|
|
|
41545
41545
|
append2(footer);
|
|
41546
41546
|
this._trackLength(header, value2, options);
|
|
41547
41547
|
};
|
|
41548
|
-
|
|
41548
|
+
FormData6.prototype._trackLength = function(header, value2, options) {
|
|
41549
41549
|
var valueLength = 0;
|
|
41550
41550
|
if (options.knownLength != null) {
|
|
41551
41551
|
valueLength += Number(options.knownLength);
|
|
@@ -41555,7 +41555,7 @@ var require_form_data = __commonJS({
|
|
|
41555
41555
|
valueLength = Buffer.byteLength(value2);
|
|
41556
41556
|
}
|
|
41557
41557
|
this._valueLength += valueLength;
|
|
41558
|
-
this._overheadLength += Buffer.byteLength(header) +
|
|
41558
|
+
this._overheadLength += Buffer.byteLength(header) + FormData6.LINE_BREAK.length;
|
|
41559
41559
|
if (!value2 || !value2.path && !(value2.readable && hasOwn(value2, "httpVersion")) && !(value2 instanceof Stream2)) {
|
|
41560
41560
|
return;
|
|
41561
41561
|
}
|
|
@@ -41563,12 +41563,12 @@ var require_form_data = __commonJS({
|
|
|
41563
41563
|
this._valuesToMeasure.push(value2);
|
|
41564
41564
|
}
|
|
41565
41565
|
};
|
|
41566
|
-
|
|
41566
|
+
FormData6.prototype._lengthRetriever = function(value2, callback) {
|
|
41567
41567
|
if (hasOwn(value2, "fd")) {
|
|
41568
41568
|
if (value2.end != void 0 && value2.end != Infinity && value2.start != void 0) {
|
|
41569
41569
|
callback(null, value2.end + 1 - (value2.start ? value2.start : 0));
|
|
41570
41570
|
} else {
|
|
41571
|
-
|
|
41571
|
+
fs21.stat(value2.path, function(err, stat3) {
|
|
41572
41572
|
if (err) {
|
|
41573
41573
|
callback(err);
|
|
41574
41574
|
return;
|
|
@@ -41589,7 +41589,7 @@ var require_form_data = __commonJS({
|
|
|
41589
41589
|
callback("Unknown stream");
|
|
41590
41590
|
}
|
|
41591
41591
|
};
|
|
41592
|
-
|
|
41592
|
+
FormData6.prototype._multiPartHeader = function(field, value2, options) {
|
|
41593
41593
|
if (typeof options.header === "string") {
|
|
41594
41594
|
return options.header;
|
|
41595
41595
|
}
|
|
@@ -41616,26 +41616,26 @@ var require_form_data = __commonJS({
|
|
|
41616
41616
|
header = [header];
|
|
41617
41617
|
}
|
|
41618
41618
|
if (header.length) {
|
|
41619
|
-
contents += prop + ": " + header.join("; ") +
|
|
41619
|
+
contents += prop + ": " + header.join("; ") + FormData6.LINE_BREAK;
|
|
41620
41620
|
}
|
|
41621
41621
|
}
|
|
41622
41622
|
}
|
|
41623
|
-
return "--" + this.getBoundary() +
|
|
41623
|
+
return "--" + this.getBoundary() + FormData6.LINE_BREAK + contents + FormData6.LINE_BREAK;
|
|
41624
41624
|
};
|
|
41625
|
-
|
|
41625
|
+
FormData6.prototype._getContentDisposition = function(value2, options) {
|
|
41626
41626
|
var filename;
|
|
41627
41627
|
if (typeof options.filepath === "string") {
|
|
41628
|
-
filename =
|
|
41628
|
+
filename = path25.normalize(options.filepath).replace(/\\/g, "/");
|
|
41629
41629
|
} else if (options.filename || value2 && (value2.name || value2.path)) {
|
|
41630
|
-
filename =
|
|
41630
|
+
filename = path25.basename(options.filename || value2 && (value2.name || value2.path));
|
|
41631
41631
|
} else if (value2 && value2.readable && hasOwn(value2, "httpVersion")) {
|
|
41632
|
-
filename =
|
|
41632
|
+
filename = path25.basename(value2.client._httpMessage.path || "");
|
|
41633
41633
|
}
|
|
41634
41634
|
if (filename) {
|
|
41635
41635
|
return 'filename="' + filename + '"';
|
|
41636
41636
|
}
|
|
41637
41637
|
};
|
|
41638
|
-
|
|
41638
|
+
FormData6.prototype._getContentType = function(value2, options) {
|
|
41639
41639
|
var contentType = options.contentType;
|
|
41640
41640
|
if (!contentType && value2 && value2.name) {
|
|
41641
41641
|
contentType = mime.lookup(value2.name);
|
|
@@ -41650,13 +41650,13 @@ var require_form_data = __commonJS({
|
|
|
41650
41650
|
contentType = mime.lookup(options.filepath || options.filename);
|
|
41651
41651
|
}
|
|
41652
41652
|
if (!contentType && value2 && typeof value2 === "object") {
|
|
41653
|
-
contentType =
|
|
41653
|
+
contentType = FormData6.DEFAULT_CONTENT_TYPE;
|
|
41654
41654
|
}
|
|
41655
41655
|
return contentType;
|
|
41656
41656
|
};
|
|
41657
|
-
|
|
41657
|
+
FormData6.prototype._multiPartFooter = function() {
|
|
41658
41658
|
return function(next) {
|
|
41659
|
-
var footer =
|
|
41659
|
+
var footer = FormData6.LINE_BREAK;
|
|
41660
41660
|
var lastPart = this._streams.length === 0;
|
|
41661
41661
|
if (lastPart) {
|
|
41662
41662
|
footer += this._lastBoundary();
|
|
@@ -41664,10 +41664,10 @@ var require_form_data = __commonJS({
|
|
|
41664
41664
|
next(footer);
|
|
41665
41665
|
}.bind(this);
|
|
41666
41666
|
};
|
|
41667
|
-
|
|
41668
|
-
return "--" + this.getBoundary() + "--" +
|
|
41667
|
+
FormData6.prototype._lastBoundary = function() {
|
|
41668
|
+
return "--" + this.getBoundary() + "--" + FormData6.LINE_BREAK;
|
|
41669
41669
|
};
|
|
41670
|
-
|
|
41670
|
+
FormData6.prototype.getHeaders = function(userHeaders) {
|
|
41671
41671
|
var header;
|
|
41672
41672
|
var formHeaders = {
|
|
41673
41673
|
"content-type": "multipart/form-data; boundary=" + this.getBoundary()
|
|
@@ -41679,19 +41679,19 @@ var require_form_data = __commonJS({
|
|
|
41679
41679
|
}
|
|
41680
41680
|
return formHeaders;
|
|
41681
41681
|
};
|
|
41682
|
-
|
|
41682
|
+
FormData6.prototype.setBoundary = function(boundary) {
|
|
41683
41683
|
if (typeof boundary !== "string") {
|
|
41684
41684
|
throw new TypeError("FormData boundary must be a string");
|
|
41685
41685
|
}
|
|
41686
41686
|
this._boundary = boundary;
|
|
41687
41687
|
};
|
|
41688
|
-
|
|
41688
|
+
FormData6.prototype.getBoundary = function() {
|
|
41689
41689
|
if (!this._boundary) {
|
|
41690
41690
|
this._generateBoundary();
|
|
41691
41691
|
}
|
|
41692
41692
|
return this._boundary;
|
|
41693
41693
|
};
|
|
41694
|
-
|
|
41694
|
+
FormData6.prototype.getBuffer = function() {
|
|
41695
41695
|
var dataBuffer = new Buffer.alloc(0);
|
|
41696
41696
|
var boundary = this.getBoundary();
|
|
41697
41697
|
for (var i = 0, len = this._streams.length; i < len; i++) {
|
|
@@ -41702,16 +41702,16 @@ var require_form_data = __commonJS({
|
|
|
41702
41702
|
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
|
|
41703
41703
|
}
|
|
41704
41704
|
if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
|
|
41705
|
-
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(
|
|
41705
|
+
dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData6.LINE_BREAK)]);
|
|
41706
41706
|
}
|
|
41707
41707
|
}
|
|
41708
41708
|
}
|
|
41709
41709
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
41710
41710
|
};
|
|
41711
|
-
|
|
41712
|
-
this._boundary = "--------------------------" +
|
|
41711
|
+
FormData6.prototype._generateBoundary = function() {
|
|
41712
|
+
this._boundary = "--------------------------" + crypto5.randomBytes(12).toString("hex");
|
|
41713
41713
|
};
|
|
41714
|
-
|
|
41714
|
+
FormData6.prototype.getLengthSync = function() {
|
|
41715
41715
|
var knownLength = this._overheadLength + this._valueLength;
|
|
41716
41716
|
if (this._streams.length) {
|
|
41717
41717
|
knownLength += this._lastBoundary().length;
|
|
@@ -41721,14 +41721,14 @@ var require_form_data = __commonJS({
|
|
|
41721
41721
|
}
|
|
41722
41722
|
return knownLength;
|
|
41723
41723
|
};
|
|
41724
|
-
|
|
41724
|
+
FormData6.prototype.hasKnownLength = function() {
|
|
41725
41725
|
var hasKnownLength = true;
|
|
41726
41726
|
if (this._valuesToMeasure.length) {
|
|
41727
41727
|
hasKnownLength = false;
|
|
41728
41728
|
}
|
|
41729
41729
|
return hasKnownLength;
|
|
41730
41730
|
};
|
|
41731
|
-
|
|
41731
|
+
FormData6.prototype.getLength = function(cb) {
|
|
41732
41732
|
var knownLength = this._overheadLength + this._valueLength;
|
|
41733
41733
|
if (this._streams.length) {
|
|
41734
41734
|
knownLength += this._lastBoundary().length;
|
|
@@ -41748,7 +41748,7 @@ var require_form_data = __commonJS({
|
|
|
41748
41748
|
cb(null, knownLength);
|
|
41749
41749
|
});
|
|
41750
41750
|
};
|
|
41751
|
-
|
|
41751
|
+
FormData6.prototype.submit = function(params, cb) {
|
|
41752
41752
|
var request;
|
|
41753
41753
|
var options;
|
|
41754
41754
|
var defaults3 = { method: "post" };
|
|
@@ -41795,18 +41795,18 @@ var require_form_data = __commonJS({
|
|
|
41795
41795
|
}.bind(this));
|
|
41796
41796
|
return request;
|
|
41797
41797
|
};
|
|
41798
|
-
|
|
41798
|
+
FormData6.prototype._error = function(err) {
|
|
41799
41799
|
if (!this.error) {
|
|
41800
41800
|
this.error = err;
|
|
41801
41801
|
this.pause();
|
|
41802
41802
|
this.emit("error", err);
|
|
41803
41803
|
}
|
|
41804
41804
|
};
|
|
41805
|
-
|
|
41805
|
+
FormData6.prototype.toString = function() {
|
|
41806
41806
|
return "[object FormData]";
|
|
41807
41807
|
};
|
|
41808
|
-
setToStringTag(
|
|
41809
|
-
module2.exports =
|
|
41808
|
+
setToStringTag(FormData6, "FormData");
|
|
41809
|
+
module2.exports = FormData6;
|
|
41810
41810
|
}
|
|
41811
41811
|
});
|
|
41812
41812
|
|
|
@@ -43115,10 +43115,10 @@ var require_package = __commonJS({
|
|
|
43115
43115
|
// node_modules/dotenv/lib/main.js
|
|
43116
43116
|
var require_main = __commonJS({
|
|
43117
43117
|
"node_modules/dotenv/lib/main.js"(exports2, module2) {
|
|
43118
|
-
var
|
|
43119
|
-
var
|
|
43120
|
-
var
|
|
43121
|
-
var
|
|
43118
|
+
var fs21 = require("fs");
|
|
43119
|
+
var path25 = require("path");
|
|
43120
|
+
var os9 = require("os");
|
|
43121
|
+
var crypto5 = require("crypto");
|
|
43122
43122
|
var packageJson = require_package();
|
|
43123
43123
|
var version = packageJson.version;
|
|
43124
43124
|
var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
@@ -43224,7 +43224,7 @@ var require_main = __commonJS({
|
|
|
43224
43224
|
if (options && options.path && options.path.length > 0) {
|
|
43225
43225
|
if (Array.isArray(options.path)) {
|
|
43226
43226
|
for (const filepath of options.path) {
|
|
43227
|
-
if (
|
|
43227
|
+
if (fs21.existsSync(filepath)) {
|
|
43228
43228
|
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
43229
43229
|
}
|
|
43230
43230
|
}
|
|
@@ -43232,15 +43232,15 @@ var require_main = __commonJS({
|
|
|
43232
43232
|
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
43233
43233
|
}
|
|
43234
43234
|
} else {
|
|
43235
|
-
possibleVaultPath =
|
|
43235
|
+
possibleVaultPath = path25.resolve(process.cwd(), ".env.vault");
|
|
43236
43236
|
}
|
|
43237
|
-
if (
|
|
43237
|
+
if (fs21.existsSync(possibleVaultPath)) {
|
|
43238
43238
|
return possibleVaultPath;
|
|
43239
43239
|
}
|
|
43240
43240
|
return null;
|
|
43241
43241
|
}
|
|
43242
43242
|
function _resolveHome(envPath) {
|
|
43243
|
-
return envPath[0] === "~" ?
|
|
43243
|
+
return envPath[0] === "~" ? path25.join(os9.homedir(), envPath.slice(1)) : envPath;
|
|
43244
43244
|
}
|
|
43245
43245
|
function _configVault(options) {
|
|
43246
43246
|
const debug = Boolean(options && options.debug);
|
|
@@ -43257,7 +43257,7 @@ var require_main = __commonJS({
|
|
|
43257
43257
|
return { parsed };
|
|
43258
43258
|
}
|
|
43259
43259
|
function configDotenv(options) {
|
|
43260
|
-
const dotenvPath =
|
|
43260
|
+
const dotenvPath = path25.resolve(process.cwd(), ".env");
|
|
43261
43261
|
let encoding = "utf8";
|
|
43262
43262
|
const debug = Boolean(options && options.debug);
|
|
43263
43263
|
const quiet = options && "quiet" in options ? options.quiet : true;
|
|
@@ -43281,13 +43281,13 @@ var require_main = __commonJS({
|
|
|
43281
43281
|
}
|
|
43282
43282
|
let lastError;
|
|
43283
43283
|
const parsedAll = {};
|
|
43284
|
-
for (const
|
|
43284
|
+
for (const path26 of optionPaths) {
|
|
43285
43285
|
try {
|
|
43286
|
-
const parsed = DotenvModule.parse(
|
|
43286
|
+
const parsed = DotenvModule.parse(fs21.readFileSync(path26, { encoding }));
|
|
43287
43287
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
43288
43288
|
} catch (e) {
|
|
43289
43289
|
if (debug) {
|
|
43290
|
-
_debug(`Failed to load ${
|
|
43290
|
+
_debug(`Failed to load ${path26} ${e.message}`);
|
|
43291
43291
|
}
|
|
43292
43292
|
lastError = e;
|
|
43293
43293
|
}
|
|
@@ -43302,7 +43302,7 @@ var require_main = __commonJS({
|
|
|
43302
43302
|
const shortPaths = [];
|
|
43303
43303
|
for (const filePath of optionPaths) {
|
|
43304
43304
|
try {
|
|
43305
|
-
const relative =
|
|
43305
|
+
const relative = path25.relative(process.cwd(), filePath);
|
|
43306
43306
|
shortPaths.push(relative);
|
|
43307
43307
|
} catch (e) {
|
|
43308
43308
|
if (debug) {
|
|
@@ -43337,7 +43337,7 @@ var require_main = __commonJS({
|
|
|
43337
43337
|
const authTag = ciphertext.subarray(-16);
|
|
43338
43338
|
ciphertext = ciphertext.subarray(12, -16);
|
|
43339
43339
|
try {
|
|
43340
|
-
const aesgcm =
|
|
43340
|
+
const aesgcm = crypto5.createDecipheriv("aes-256-gcm", key, nonce);
|
|
43341
43341
|
aesgcm.setAuthTag(authTag);
|
|
43342
43342
|
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
43343
43343
|
} catch (error) {
|
|
@@ -44287,11 +44287,11 @@ var require_file_writer = __commonJS({
|
|
|
44287
44287
|
var FileWriter = (
|
|
44288
44288
|
/** @class */
|
|
44289
44289
|
(function() {
|
|
44290
|
-
function FileWriter2(
|
|
44290
|
+
function FileWriter2(path25, append2, encoding) {
|
|
44291
44291
|
if (encoding === void 0) {
|
|
44292
44292
|
encoding = DEFAULT_ENCODING;
|
|
44293
44293
|
}
|
|
44294
|
-
this.path =
|
|
44294
|
+
this.path = path25;
|
|
44295
44295
|
this.append = append2;
|
|
44296
44296
|
this.encoding = encoding;
|
|
44297
44297
|
}
|
|
@@ -44431,13 +44431,13 @@ var require_csv_writer = __commonJS({
|
|
|
44431
44431
|
var CsvWriter = (
|
|
44432
44432
|
/** @class */
|
|
44433
44433
|
(function() {
|
|
44434
|
-
function CsvWriter2(csvStringifier,
|
|
44434
|
+
function CsvWriter2(csvStringifier, path25, encoding, append2) {
|
|
44435
44435
|
if (append2 === void 0) {
|
|
44436
44436
|
append2 = DEFAULT_INITIAL_APPEND_FLAG;
|
|
44437
44437
|
}
|
|
44438
44438
|
this.csvStringifier = csvStringifier;
|
|
44439
44439
|
this.append = append2;
|
|
44440
|
-
this.fileWriter = new file_writer_1.FileWriter(
|
|
44440
|
+
this.fileWriter = new file_writer_1.FileWriter(path25, this.append, encoding);
|
|
44441
44441
|
}
|
|
44442
44442
|
CsvWriter2.prototype.writeRecords = function(records) {
|
|
44443
44443
|
return __awaiter(this, void 0, void 0, function() {
|
|
@@ -50708,14 +50708,14 @@ var require_yn = __commonJS({
|
|
|
50708
50708
|
var require_create_require = __commonJS({
|
|
50709
50709
|
"node_modules/create-require/create-require.js"(exports2, module2) {
|
|
50710
50710
|
var nativeModule = require("module");
|
|
50711
|
-
var
|
|
50712
|
-
var
|
|
50711
|
+
var path25 = require("path");
|
|
50712
|
+
var fs21 = require("fs");
|
|
50713
50713
|
function createRequire(filename) {
|
|
50714
50714
|
if (!filename) {
|
|
50715
50715
|
filename = process.cwd();
|
|
50716
50716
|
}
|
|
50717
50717
|
if (isDir(filename)) {
|
|
50718
|
-
filename =
|
|
50718
|
+
filename = path25.join(filename, "index.js");
|
|
50719
50719
|
}
|
|
50720
50720
|
if (nativeModule.createRequire) {
|
|
50721
50721
|
return nativeModule.createRequire(filename);
|
|
@@ -50728,13 +50728,13 @@ var require_create_require = __commonJS({
|
|
|
50728
50728
|
function _createRequire(filename) {
|
|
50729
50729
|
const mod = new nativeModule.Module(filename, null);
|
|
50730
50730
|
mod.filename = filename;
|
|
50731
|
-
mod.paths = nativeModule.Module._nodeModulePaths(
|
|
50731
|
+
mod.paths = nativeModule.Module._nodeModulePaths(path25.dirname(filename));
|
|
50732
50732
|
mod._compile("module.exports = require;", filename);
|
|
50733
50733
|
return mod.exports;
|
|
50734
50734
|
}
|
|
50735
|
-
function isDir(
|
|
50735
|
+
function isDir(path26) {
|
|
50736
50736
|
try {
|
|
50737
|
-
const stat3 =
|
|
50737
|
+
const stat3 = fs21.lstatSync(path26);
|
|
50738
50738
|
return stat3.isDirectory();
|
|
50739
50739
|
} catch (e) {
|
|
50740
50740
|
return false;
|
|
@@ -50749,18 +50749,18 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50749
50749
|
"node_modules/v8-compile-cache-lib/v8-compile-cache.js"(exports2, module2) {
|
|
50750
50750
|
"use strict";
|
|
50751
50751
|
var Module = require("module");
|
|
50752
|
-
var
|
|
50753
|
-
var
|
|
50754
|
-
var
|
|
50752
|
+
var crypto5 = require("crypto");
|
|
50753
|
+
var fs21 = require("fs");
|
|
50754
|
+
var path25 = require("path");
|
|
50755
50755
|
var vm = require("vm");
|
|
50756
|
-
var
|
|
50756
|
+
var os9 = require("os");
|
|
50757
50757
|
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
|
|
50758
50758
|
var FileSystemBlobStore = class {
|
|
50759
50759
|
constructor(directory, prefix) {
|
|
50760
50760
|
const name = prefix ? slashEscape(prefix + ".") : "";
|
|
50761
|
-
this._blobFilename =
|
|
50762
|
-
this._mapFilename =
|
|
50763
|
-
this._lockFilename =
|
|
50761
|
+
this._blobFilename = path25.join(directory, name + "BLOB");
|
|
50762
|
+
this._mapFilename = path25.join(directory, name + "MAP");
|
|
50763
|
+
this._lockFilename = path25.join(directory, name + "LOCK");
|
|
50764
50764
|
this._directory = directory;
|
|
50765
50765
|
this._load();
|
|
50766
50766
|
}
|
|
@@ -50812,22 +50812,22 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50812
50812
|
const mapToStore = JSON.stringify(dump[1]);
|
|
50813
50813
|
try {
|
|
50814
50814
|
mkdirpSync(this._directory);
|
|
50815
|
-
|
|
50815
|
+
fs21.writeFileSync(this._lockFilename, "LOCK", { flag: "wx" });
|
|
50816
50816
|
} catch (error) {
|
|
50817
50817
|
return false;
|
|
50818
50818
|
}
|
|
50819
50819
|
try {
|
|
50820
|
-
|
|
50821
|
-
|
|
50820
|
+
fs21.writeFileSync(this._blobFilename, blobToStore);
|
|
50821
|
+
fs21.writeFileSync(this._mapFilename, mapToStore);
|
|
50822
50822
|
} finally {
|
|
50823
|
-
|
|
50823
|
+
fs21.unlinkSync(this._lockFilename);
|
|
50824
50824
|
}
|
|
50825
50825
|
return true;
|
|
50826
50826
|
}
|
|
50827
50827
|
_load() {
|
|
50828
50828
|
try {
|
|
50829
|
-
this._storedBlob =
|
|
50830
|
-
this._storedMap = JSON.parse(
|
|
50829
|
+
this._storedBlob = fs21.readFileSync(this._blobFilename);
|
|
50830
|
+
this._storedMap = JSON.parse(fs21.readFileSync(this._mapFilename));
|
|
50831
50831
|
} catch (e) {
|
|
50832
50832
|
this._storedBlob = Buffer.alloc(0);
|
|
50833
50833
|
this._storedMap = {};
|
|
@@ -50891,7 +50891,7 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50891
50891
|
require2.main = process.mainModule;
|
|
50892
50892
|
require2.extensions = Module._extensions;
|
|
50893
50893
|
require2.cache = Module._cache;
|
|
50894
|
-
const dirname =
|
|
50894
|
+
const dirname = path25.dirname(filename);
|
|
50895
50895
|
const compiledWrapper = self2._moduleCompile(filename, content);
|
|
50896
50896
|
const args = [mod.exports, require2, mod, filename, dirname, process, global, Buffer];
|
|
50897
50897
|
return compiledWrapper.apply(mod.exports, args);
|
|
@@ -50924,7 +50924,7 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50924
50924
|
}
|
|
50925
50925
|
}
|
|
50926
50926
|
var wrapper = Module.wrap(content);
|
|
50927
|
-
var invalidationKey =
|
|
50927
|
+
var invalidationKey = crypto5.createHash("sha1").update(content, "utf8").digest("hex");
|
|
50928
50928
|
var buffer = this._cacheStore.get(filename, invalidationKey);
|
|
50929
50929
|
var script = new vm.Script(wrapper, {
|
|
50930
50930
|
filename,
|
|
@@ -50948,18 +50948,18 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50948
50948
|
}
|
|
50949
50949
|
};
|
|
50950
50950
|
function mkdirpSync(p_) {
|
|
50951
|
-
_mkdirpSync(
|
|
50951
|
+
_mkdirpSync(path25.resolve(p_), 511);
|
|
50952
50952
|
}
|
|
50953
50953
|
function _mkdirpSync(p, mode) {
|
|
50954
50954
|
try {
|
|
50955
|
-
|
|
50955
|
+
fs21.mkdirSync(p, mode);
|
|
50956
50956
|
} catch (err0) {
|
|
50957
50957
|
if (err0.code === "ENOENT") {
|
|
50958
|
-
_mkdirpSync(
|
|
50958
|
+
_mkdirpSync(path25.dirname(p));
|
|
50959
50959
|
_mkdirpSync(p);
|
|
50960
50960
|
} else {
|
|
50961
50961
|
try {
|
|
50962
|
-
const stat3 =
|
|
50962
|
+
const stat3 = fs21.statSync(p);
|
|
50963
50963
|
if (!stat3.isDirectory()) {
|
|
50964
50964
|
throw err0;
|
|
50965
50965
|
}
|
|
@@ -50991,7 +50991,7 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50991
50991
|
}
|
|
50992
50992
|
const dirname = typeof process.getuid === "function" ? "v8-compile-cache-" + process.getuid() : "v8-compile-cache";
|
|
50993
50993
|
const version = typeof process.versions.v8 === "string" ? process.versions.v8 : typeof process.versions.chakracore === "string" ? "chakracore-" + process.versions.chakracore : "node-" + process.version;
|
|
50994
|
-
const cacheDir =
|
|
50994
|
+
const cacheDir = path25.join(os9.tmpdir(), dirname, version);
|
|
50995
50995
|
return cacheDir;
|
|
50996
50996
|
}
|
|
50997
50997
|
function getMainName() {
|
|
@@ -51199,11 +51199,11 @@ var require_ts_internals = __commonJS({
|
|
|
51199
51199
|
}
|
|
51200
51200
|
return { getExtendsConfigPath };
|
|
51201
51201
|
}
|
|
51202
|
-
function isRootedDiskPath(
|
|
51203
|
-
return (0, path_1.isAbsolute)(
|
|
51202
|
+
function isRootedDiskPath(path25) {
|
|
51203
|
+
return (0, path_1.isAbsolute)(path25);
|
|
51204
51204
|
}
|
|
51205
|
-
function combinePaths(
|
|
51206
|
-
return (0, util_1.normalizeSlashes)((0, path_1.resolve)(
|
|
51205
|
+
function combinePaths(path25, ...paths) {
|
|
51206
|
+
return (0, util_1.normalizeSlashes)((0, path_1.resolve)(path25, ...paths.filter((path26) => path26)));
|
|
51207
51207
|
}
|
|
51208
51208
|
function getNormalizedAbsolutePath(fileName, currentDirectory) {
|
|
51209
51209
|
return (0, util_1.normalizeSlashes)(currentDirectory != null ? (0, path_1.resolve)(currentDirectory, fileName) : (0, path_1.resolve)(fileName));
|
|
@@ -51253,12 +51253,12 @@ var require_ts_internals = __commonJS({
|
|
|
51253
51253
|
doubleAsteriskRegexFragment: "(/.+?)?",
|
|
51254
51254
|
replaceWildcardCharacter: (match2) => replaceWildcardCharacter(match2, excludeMatcher.singleAsteriskRegexFragment)
|
|
51255
51255
|
};
|
|
51256
|
-
function getNormalizedPathComponents(
|
|
51257
|
-
return reducePathComponents(getPathComponents(
|
|
51256
|
+
function getNormalizedPathComponents(path25, currentDirectory) {
|
|
51257
|
+
return reducePathComponents(getPathComponents(path25, currentDirectory));
|
|
51258
51258
|
}
|
|
51259
|
-
function getPathComponents(
|
|
51260
|
-
|
|
51261
|
-
return pathComponents(
|
|
51259
|
+
function getPathComponents(path25, currentDirectory = "") {
|
|
51260
|
+
path25 = combinePaths(currentDirectory, path25);
|
|
51261
|
+
return pathComponents(path25, getRootLength(path25));
|
|
51262
51262
|
}
|
|
51263
51263
|
function reducePathComponents(components) {
|
|
51264
51264
|
if (!some(components))
|
|
@@ -51283,64 +51283,64 @@ var require_ts_internals = __commonJS({
|
|
|
51283
51283
|
}
|
|
51284
51284
|
return reduced;
|
|
51285
51285
|
}
|
|
51286
|
-
function getRootLength(
|
|
51287
|
-
const rootLength = getEncodedRootLength(
|
|
51286
|
+
function getRootLength(path25) {
|
|
51287
|
+
const rootLength = getEncodedRootLength(path25);
|
|
51288
51288
|
return rootLength < 0 ? ~rootLength : rootLength;
|
|
51289
51289
|
}
|
|
51290
|
-
function getEncodedRootLength(
|
|
51291
|
-
if (!
|
|
51290
|
+
function getEncodedRootLength(path25) {
|
|
51291
|
+
if (!path25)
|
|
51292
51292
|
return 0;
|
|
51293
|
-
const ch0 =
|
|
51293
|
+
const ch0 = path25.charCodeAt(0);
|
|
51294
51294
|
if (ch0 === 47 || ch0 === 92) {
|
|
51295
|
-
if (
|
|
51295
|
+
if (path25.charCodeAt(1) !== ch0)
|
|
51296
51296
|
return 1;
|
|
51297
|
-
const p1 =
|
|
51297
|
+
const p1 = path25.indexOf(ch0 === 47 ? directorySeparator : altDirectorySeparator, 2);
|
|
51298
51298
|
if (p1 < 0)
|
|
51299
|
-
return
|
|
51299
|
+
return path25.length;
|
|
51300
51300
|
return p1 + 1;
|
|
51301
51301
|
}
|
|
51302
|
-
if (isVolumeCharacter(ch0) &&
|
|
51303
|
-
const ch2 =
|
|
51302
|
+
if (isVolumeCharacter(ch0) && path25.charCodeAt(1) === 58) {
|
|
51303
|
+
const ch2 = path25.charCodeAt(2);
|
|
51304
51304
|
if (ch2 === 47 || ch2 === 92)
|
|
51305
51305
|
return 3;
|
|
51306
|
-
if (
|
|
51306
|
+
if (path25.length === 2)
|
|
51307
51307
|
return 2;
|
|
51308
51308
|
}
|
|
51309
|
-
const schemeEnd =
|
|
51309
|
+
const schemeEnd = path25.indexOf(urlSchemeSeparator);
|
|
51310
51310
|
if (schemeEnd !== -1) {
|
|
51311
51311
|
const authorityStart = schemeEnd + urlSchemeSeparator.length;
|
|
51312
|
-
const authorityEnd =
|
|
51312
|
+
const authorityEnd = path25.indexOf(directorySeparator, authorityStart);
|
|
51313
51313
|
if (authorityEnd !== -1) {
|
|
51314
|
-
const scheme =
|
|
51315
|
-
const authority =
|
|
51316
|
-
if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(
|
|
51317
|
-
const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(
|
|
51314
|
+
const scheme = path25.slice(0, schemeEnd);
|
|
51315
|
+
const authority = path25.slice(authorityStart, authorityEnd);
|
|
51316
|
+
if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path25.charCodeAt(authorityEnd + 1))) {
|
|
51317
|
+
const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path25, authorityEnd + 2);
|
|
51318
51318
|
if (volumeSeparatorEnd !== -1) {
|
|
51319
|
-
if (
|
|
51319
|
+
if (path25.charCodeAt(volumeSeparatorEnd) === 47) {
|
|
51320
51320
|
return ~(volumeSeparatorEnd + 1);
|
|
51321
51321
|
}
|
|
51322
|
-
if (volumeSeparatorEnd ===
|
|
51322
|
+
if (volumeSeparatorEnd === path25.length) {
|
|
51323
51323
|
return ~volumeSeparatorEnd;
|
|
51324
51324
|
}
|
|
51325
51325
|
}
|
|
51326
51326
|
}
|
|
51327
51327
|
return ~(authorityEnd + 1);
|
|
51328
51328
|
}
|
|
51329
|
-
return ~
|
|
51329
|
+
return ~path25.length;
|
|
51330
51330
|
}
|
|
51331
51331
|
return 0;
|
|
51332
51332
|
}
|
|
51333
|
-
function hasTrailingDirectorySeparator(
|
|
51334
|
-
return
|
|
51333
|
+
function hasTrailingDirectorySeparator(path25) {
|
|
51334
|
+
return path25.length > 0 && isAnyDirectorySeparator(path25.charCodeAt(path25.length - 1));
|
|
51335
51335
|
}
|
|
51336
51336
|
function isAnyDirectorySeparator(charCode) {
|
|
51337
51337
|
return charCode === 47 || charCode === 92;
|
|
51338
51338
|
}
|
|
51339
|
-
function removeTrailingDirectorySeparator(
|
|
51340
|
-
if (hasTrailingDirectorySeparator(
|
|
51341
|
-
return
|
|
51339
|
+
function removeTrailingDirectorySeparator(path25) {
|
|
51340
|
+
if (hasTrailingDirectorySeparator(path25)) {
|
|
51341
|
+
return path25.substr(0, path25.length - 1);
|
|
51342
51342
|
}
|
|
51343
|
-
return
|
|
51343
|
+
return path25;
|
|
51344
51344
|
}
|
|
51345
51345
|
var directorySeparator = "/";
|
|
51346
51346
|
var altDirectorySeparator = "\\";
|
|
@@ -51373,9 +51373,9 @@ var require_ts_internals = __commonJS({
|
|
|
51373
51373
|
}
|
|
51374
51374
|
return false;
|
|
51375
51375
|
}
|
|
51376
|
-
function pathComponents(
|
|
51377
|
-
const root =
|
|
51378
|
-
const rest =
|
|
51376
|
+
function pathComponents(path25, rootLength) {
|
|
51377
|
+
const root = path25.substring(0, rootLength);
|
|
51378
|
+
const rest = path25.substring(rootLength).split(directorySeparator);
|
|
51379
51379
|
if (rest.length && !lastOrUndefined(rest))
|
|
51380
51380
|
rest.pop();
|
|
51381
51381
|
return [root, ...rest];
|
|
@@ -51649,7 +51649,7 @@ var require_configuration = __commonJS({
|
|
|
51649
51649
|
const options = filterRecognizedTsConfigTsNodeOptions(config2["ts-node"]).recognized;
|
|
51650
51650
|
if (options.require) {
|
|
51651
51651
|
const tsconfigRelativeResolver = (0, util_1.createProjectLocalResolveHelper)((0, path_1.dirname)(configPath));
|
|
51652
|
-
options.require = options.require.map((
|
|
51652
|
+
options.require = options.require.map((path25) => tsconfigRelativeResolver(path25, false));
|
|
51653
51653
|
}
|
|
51654
51654
|
if (options.scopeDir) {
|
|
51655
51655
|
options.scopeDir = (0, path_1.resolve)(basePath2, options.scopeDir);
|
|
@@ -51801,14 +51801,14 @@ var require_module_type_classifier = __commonJS({
|
|
|
51801
51801
|
}
|
|
51802
51802
|
};
|
|
51803
51803
|
const auto = classifications.package;
|
|
51804
|
-
function classifyModuleNonCached(
|
|
51805
|
-
const matched = matchPatterns(patternTypePairs, (_2) => _2.pattern,
|
|
51804
|
+
function classifyModuleNonCached(path25) {
|
|
51805
|
+
const matched = matchPatterns(patternTypePairs, (_2) => _2.pattern, path25);
|
|
51806
51806
|
if (matched)
|
|
51807
51807
|
return classifications[matched.type];
|
|
51808
51808
|
return auto;
|
|
51809
51809
|
}
|
|
51810
51810
|
const classifyModule = (0, util_1.cachedLookup)(classifyModuleNonCached);
|
|
51811
|
-
function classifyModuleAuto(
|
|
51811
|
+
function classifyModuleAuto(path25) {
|
|
51812
51812
|
return auto;
|
|
51813
51813
|
}
|
|
51814
51814
|
return {
|
|
@@ -52028,12 +52028,12 @@ var require_node_nativemodule = __commonJS({
|
|
|
52028
52028
|
// node_modules/ts-node/dist-raw/node-internalBinding-fs.js
|
|
52029
52029
|
var require_node_internalBinding_fs = __commonJS({
|
|
52030
52030
|
"node_modules/ts-node/dist-raw/node-internalBinding-fs.js"(exports2, module2) {
|
|
52031
|
-
var
|
|
52031
|
+
var fs21 = require("fs");
|
|
52032
52032
|
var { versionGteLt } = require_util2();
|
|
52033
|
-
function internalModuleReadJSON(
|
|
52033
|
+
function internalModuleReadJSON(path25) {
|
|
52034
52034
|
let string;
|
|
52035
52035
|
try {
|
|
52036
|
-
string =
|
|
52036
|
+
string = fs21.readFileSync(path25, "utf8");
|
|
52037
52037
|
} catch (e) {
|
|
52038
52038
|
if (e.code === "ENOENT") return [];
|
|
52039
52039
|
throw e;
|
|
@@ -52041,15 +52041,15 @@ var require_node_internalBinding_fs = __commonJS({
|
|
|
52041
52041
|
const containsKeys = true;
|
|
52042
52042
|
return [string, containsKeys];
|
|
52043
52043
|
}
|
|
52044
|
-
function internalModuleStat(
|
|
52045
|
-
const stat3 =
|
|
52044
|
+
function internalModuleStat(path25) {
|
|
52045
|
+
const stat3 = fs21.statSync(path25, { throwIfNoEntry: false });
|
|
52046
52046
|
if (!stat3) return -1;
|
|
52047
52047
|
if (stat3.isFile()) return 0;
|
|
52048
52048
|
if (stat3.isDirectory()) return 1;
|
|
52049
52049
|
}
|
|
52050
|
-
function internalModuleStatInefficient(
|
|
52050
|
+
function internalModuleStatInefficient(path25) {
|
|
52051
52051
|
try {
|
|
52052
|
-
const stat3 =
|
|
52052
|
+
const stat3 = fs21.statSync(path25);
|
|
52053
52053
|
if (stat3.isFile()) return 0;
|
|
52054
52054
|
if (stat3.isDirectory()) return 1;
|
|
52055
52055
|
} catch (e) {
|
|
@@ -52357,7 +52357,7 @@ var require_node_internal_modules_cjs_helpers = __commonJS({
|
|
|
52357
52357
|
var require_node_internal_errors = __commonJS({
|
|
52358
52358
|
"node_modules/ts-node/dist-raw/node-internal-errors.js"(exports2) {
|
|
52359
52359
|
"use strict";
|
|
52360
|
-
var
|
|
52360
|
+
var path25 = require("path");
|
|
52361
52361
|
exports2.codes = {
|
|
52362
52362
|
ERR_INPUT_TYPE_NOT_ALLOWED: createErrorCtor(joinArgs("ERR_INPUT_TYPE_NOT_ALLOWED")),
|
|
52363
52363
|
ERR_INVALID_ARG_VALUE: createErrorCtor(joinArgs("ERR_INVALID_ARG_VALUE")),
|
|
@@ -52365,8 +52365,8 @@ var require_node_internal_errors = __commonJS({
|
|
|
52365
52365
|
ERR_INVALID_PACKAGE_CONFIG: createErrorCtor(joinArgs("ERR_INVALID_PACKAGE_CONFIG")),
|
|
52366
52366
|
ERR_INVALID_PACKAGE_TARGET: createErrorCtor(joinArgs("ERR_INVALID_PACKAGE_TARGET")),
|
|
52367
52367
|
ERR_MANIFEST_DEPENDENCY_MISSING: createErrorCtor(joinArgs("ERR_MANIFEST_DEPENDENCY_MISSING")),
|
|
52368
|
-
ERR_MODULE_NOT_FOUND: createErrorCtor((
|
|
52369
|
-
return `Cannot find ${type} '${
|
|
52368
|
+
ERR_MODULE_NOT_FOUND: createErrorCtor((path26, base, type = "package") => {
|
|
52369
|
+
return `Cannot find ${type} '${path26}' imported from ${base}`;
|
|
52370
52370
|
}),
|
|
52371
52371
|
ERR_PACKAGE_IMPORT_NOT_DEFINED: createErrorCtor(joinArgs("ERR_PACKAGE_IMPORT_NOT_DEFINED")),
|
|
52372
52372
|
ERR_PACKAGE_PATH_NOT_EXPORTED: createErrorCtor(joinArgs("ERR_PACKAGE_PATH_NOT_EXPORTED")),
|
|
@@ -52387,9 +52387,9 @@ var require_node_internal_errors = __commonJS({
|
|
|
52387
52387
|
};
|
|
52388
52388
|
}
|
|
52389
52389
|
exports2.createErrRequireEsm = createErrRequireEsm;
|
|
52390
|
-
function createErrRequireEsm(filename,
|
|
52390
|
+
function createErrRequireEsm(filename, parentPath2, packageJsonPath) {
|
|
52391
52391
|
const code = "ERR_REQUIRE_ESM";
|
|
52392
|
-
const err = new Error(getErrRequireEsmMessage(filename,
|
|
52392
|
+
const err = new Error(getErrRequireEsmMessage(filename, parentPath2, packageJsonPath));
|
|
52393
52393
|
err.name = `Error [${code}]`;
|
|
52394
52394
|
err.stack;
|
|
52395
52395
|
Object.defineProperty(err, "name", {
|
|
@@ -52401,15 +52401,15 @@ var require_node_internal_errors = __commonJS({
|
|
|
52401
52401
|
err.code = code;
|
|
52402
52402
|
return err;
|
|
52403
52403
|
}
|
|
52404
|
-
function getErrRequireEsmMessage(filename,
|
|
52405
|
-
const ext2 =
|
|
52404
|
+
function getErrRequireEsmMessage(filename, parentPath2 = null, packageJsonPath = null) {
|
|
52405
|
+
const ext2 = path25.extname(filename);
|
|
52406
52406
|
let msg = `Must use import to load ES Module: ${filename}`;
|
|
52407
|
-
if (
|
|
52408
|
-
const
|
|
52409
|
-
const basename3 =
|
|
52407
|
+
if (parentPath2 && packageJsonPath) {
|
|
52408
|
+
const path26 = require("path");
|
|
52409
|
+
const basename3 = path26.basename(filename) === path26.basename(parentPath2) ? filename : path26.basename(filename);
|
|
52410
52410
|
msg += `
|
|
52411
52411
|
require() of ES modules is not supported.
|
|
52412
|
-
require() of ${filename} ${
|
|
52412
|
+
require() of ${filename} ${parentPath2 ? `from ${parentPath2} ` : ""}is an ES module file as it is a ${ext2} file whose nearest parent package.json contains "type": "module" which defines all ${ext2} files in that package scope as ES modules.
|
|
52413
52413
|
Instead change the requiring code to use import(), or remove "type": "module" from ${packageJsonPath}.
|
|
52414
52414
|
`;
|
|
52415
52415
|
return msg;
|
|
@@ -52453,9 +52453,9 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52453
52453
|
} = require_node_primordials();
|
|
52454
52454
|
var { NativeModule } = require_node_nativemodule();
|
|
52455
52455
|
var { pathToFileURL, fileURLToPath: fileURLToPath3 } = require("url");
|
|
52456
|
-
var
|
|
52457
|
-
var
|
|
52458
|
-
var { sep: sep2 } =
|
|
52456
|
+
var fs21 = require("fs");
|
|
52457
|
+
var path25 = require("path");
|
|
52458
|
+
var { sep: sep2 } = path25;
|
|
52459
52459
|
var { internalModuleStat } = require_node_internalBinding_fs();
|
|
52460
52460
|
var packageJsonReader = require_node_internal_modules_package_json_reader();
|
|
52461
52461
|
var {
|
|
@@ -52478,7 +52478,7 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52478
52478
|
var isWindows = process.platform === "win32";
|
|
52479
52479
|
var statCache = null;
|
|
52480
52480
|
function stat3(filename) {
|
|
52481
|
-
filename =
|
|
52481
|
+
filename = path25.toNamespacedPath(filename);
|
|
52482
52482
|
if (statCache !== null) {
|
|
52483
52483
|
const result2 = statCache.get(filename);
|
|
52484
52484
|
if (result2 !== void 0) return result2;
|
|
@@ -52492,7 +52492,7 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52492
52492
|
var moduleParentCache = new SafeWeakMap();
|
|
52493
52493
|
var packageJsonCache = new SafeMap();
|
|
52494
52494
|
function readPackage(requestPath) {
|
|
52495
|
-
const jsonPath =
|
|
52495
|
+
const jsonPath = path25.resolve(requestPath, "package.json");
|
|
52496
52496
|
const existing = packageJsonCache.get(jsonPath);
|
|
52497
52497
|
if (existing !== void 0) return existing;
|
|
52498
52498
|
const result = packageJsonReader.read(jsonPath);
|
|
@@ -52546,22 +52546,22 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52546
52546
|
const tmp = readPackage(requestPath);
|
|
52547
52547
|
const pkg = tmp != null ? tmp.main : void 0;
|
|
52548
52548
|
if (!pkg) {
|
|
52549
|
-
return tryExtensions(
|
|
52549
|
+
return tryExtensions(path25.resolve(requestPath, "index"), exts, isMain);
|
|
52550
52550
|
}
|
|
52551
|
-
const filename =
|
|
52552
|
-
let actual = tryReplacementExtensions(filename, isMain) || tryFile(filename, isMain) || tryExtensions(filename, exts, isMain) || tryExtensions(
|
|
52551
|
+
const filename = path25.resolve(requestPath, pkg);
|
|
52552
|
+
let actual = tryReplacementExtensions(filename, isMain) || tryFile(filename, isMain) || tryExtensions(filename, exts, isMain) || tryExtensions(path25.resolve(filename, "index"), exts, isMain);
|
|
52553
52553
|
if (actual === false) {
|
|
52554
|
-
actual = tryExtensions(
|
|
52554
|
+
actual = tryExtensions(path25.resolve(requestPath, "index"), exts, isMain);
|
|
52555
52555
|
if (!actual) {
|
|
52556
52556
|
const err = new Error(
|
|
52557
52557
|
`Cannot find module '${filename}'. Please verify that the package.json has a valid "main" entry`
|
|
52558
52558
|
);
|
|
52559
52559
|
err.code = "MODULE_NOT_FOUND";
|
|
52560
|
-
err.path =
|
|
52560
|
+
err.path = path25.resolve(requestPath, "package.json");
|
|
52561
52561
|
err.requestPath = originalPath;
|
|
52562
52562
|
throw err;
|
|
52563
52563
|
} else {
|
|
52564
|
-
const jsonPath =
|
|
52564
|
+
const jsonPath = path25.resolve(requestPath, "package.json");
|
|
52565
52565
|
process.emitWarning(
|
|
52566
52566
|
`Invalid 'main' field in '${jsonPath}' of '${pkg}'. Please either fix that or report it to the module author`,
|
|
52567
52567
|
"DeprecationWarning",
|
|
@@ -52576,12 +52576,12 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52576
52576
|
const rc = stat3(requestPath);
|
|
52577
52577
|
if (rc !== 0) return;
|
|
52578
52578
|
if (preserveSymlinks && !isMain) {
|
|
52579
|
-
return
|
|
52579
|
+
return path25.resolve(requestPath);
|
|
52580
52580
|
}
|
|
52581
52581
|
return toRealPath(requestPath);
|
|
52582
52582
|
}
|
|
52583
52583
|
function toRealPath(requestPath) {
|
|
52584
|
-
return
|
|
52584
|
+
return fs21.realpathSync(requestPath, {
|
|
52585
52585
|
// [internalFS.realpathCacheKey]: realpathCache
|
|
52586
52586
|
});
|
|
52587
52587
|
}
|
|
@@ -52635,15 +52635,15 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52635
52635
|
return parent.filename;
|
|
52636
52636
|
} else if (parent.id === "<repl>" || parent.id === "internal/preload") {
|
|
52637
52637
|
try {
|
|
52638
|
-
return process.cwd() +
|
|
52638
|
+
return process.cwd() + path25.sep;
|
|
52639
52639
|
} catch {
|
|
52640
52640
|
return false;
|
|
52641
52641
|
}
|
|
52642
52642
|
}
|
|
52643
52643
|
}
|
|
52644
|
-
function trySelf(
|
|
52645
|
-
if (!
|
|
52646
|
-
const { data: pkg, path: pkgPath } = readPackageScope(
|
|
52644
|
+
function trySelf(parentPath2, request) {
|
|
52645
|
+
if (!parentPath2) return false;
|
|
52646
|
+
const { data: pkg, path: pkgPath } = readPackageScope(parentPath2) || {};
|
|
52647
52647
|
if (!pkg || pkg.exports === void 0) return false;
|
|
52648
52648
|
if (typeof pkg.name !== "string") return false;
|
|
52649
52649
|
let expansion;
|
|
@@ -52659,9 +52659,9 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52659
52659
|
pathToFileURL(pkgPath + "/package.json"),
|
|
52660
52660
|
expansion,
|
|
52661
52661
|
pkg,
|
|
52662
|
-
pathToFileURL(
|
|
52662
|
+
pathToFileURL(parentPath2),
|
|
52663
52663
|
cjsConditions
|
|
52664
|
-
).resolved,
|
|
52664
|
+
).resolved, parentPath2, pkgPath);
|
|
52665
52665
|
} catch (e) {
|
|
52666
52666
|
if (e.code === "ERR_MODULE_NOT_FOUND")
|
|
52667
52667
|
throw createEsmNotFoundErr(request, pkgPath + "/package.json");
|
|
@@ -52673,7 +52673,7 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52673
52673
|
const { 1: name, 2: expansion = "" } = StringPrototypeMatch(request, EXPORTS_PATTERN) || [];
|
|
52674
52674
|
if (!name)
|
|
52675
52675
|
return;
|
|
52676
|
-
const pkgPath =
|
|
52676
|
+
const pkgPath = path25.resolve(nmPath, name);
|
|
52677
52677
|
const pkg = readPackage(pkgPath);
|
|
52678
52678
|
if (pkg != null && pkg.exports != null) {
|
|
52679
52679
|
try {
|
|
@@ -52697,7 +52697,7 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52697
52697
|
const Module_pathCache_set = hasModulePathCache ? (cacheKey, value2) => Module._pathCache[cacheKey] = value2 : (cacheKey) => Module_pathCache[cacheKey] = value;
|
|
52698
52698
|
const trailingSlashRegex = /(?:^|\/)\.?\.$/;
|
|
52699
52699
|
const Module_findPath = function _findPath(request, paths, isMain) {
|
|
52700
|
-
const absoluteRequest =
|
|
52700
|
+
const absoluteRequest = path25.isAbsolute(request);
|
|
52701
52701
|
if (absoluteRequest) {
|
|
52702
52702
|
paths = [""];
|
|
52703
52703
|
} else if (!paths || paths.length === 0) {
|
|
@@ -52720,19 +52720,19 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52720
52720
|
if (exportsResolved)
|
|
52721
52721
|
return exportsResolved;
|
|
52722
52722
|
}
|
|
52723
|
-
const _basePath =
|
|
52723
|
+
const _basePath = path25.resolve(curPath, request);
|
|
52724
52724
|
let filename;
|
|
52725
52725
|
const [rc, basePath] = statReplacementExtensions(_basePath);
|
|
52726
52726
|
if (!trailingSlash) {
|
|
52727
52727
|
if (rc === 0) {
|
|
52728
52728
|
if (!isMain) {
|
|
52729
52729
|
if (preserveSymlinks) {
|
|
52730
|
-
filename =
|
|
52730
|
+
filename = path25.resolve(basePath);
|
|
52731
52731
|
} else {
|
|
52732
52732
|
filename = toRealPath(basePath);
|
|
52733
52733
|
}
|
|
52734
52734
|
} else if (preserveSymlinksMain) {
|
|
52735
|
-
filename =
|
|
52735
|
+
filename = path25.resolve(basePath);
|
|
52736
52736
|
} else {
|
|
52737
52737
|
filename = toRealPath(basePath);
|
|
52738
52738
|
}
|
|
@@ -52769,8 +52769,8 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52769
52769
|
const fakeParent = new Module("", null);
|
|
52770
52770
|
paths = [];
|
|
52771
52771
|
for (let i = 0; i < options.paths.length; i++) {
|
|
52772
|
-
const
|
|
52773
|
-
fakeParent.paths = Module._nodeModulePaths(
|
|
52772
|
+
const path26 = options.paths[i];
|
|
52773
|
+
fakeParent.paths = Module._nodeModulePaths(path26);
|
|
52774
52774
|
const lookupPaths = Module._resolveLookupPaths(request, fakeParent);
|
|
52775
52775
|
for (let j = 0; j < lookupPaths.length; j++) {
|
|
52776
52776
|
if (!ArrayPrototypeIncludes(paths, lookupPaths[j]))
|
|
@@ -52808,8 +52808,8 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52808
52808
|
}
|
|
52809
52809
|
}
|
|
52810
52810
|
}
|
|
52811
|
-
const
|
|
52812
|
-
const selfResolved = trySelf(
|
|
52811
|
+
const parentPath2 = trySelfParentPath(parent);
|
|
52812
|
+
const selfResolved = trySelf(parentPath2, request);
|
|
52813
52813
|
if (selfResolved) {
|
|
52814
52814
|
const cacheKey = request + "\0" + (paths.length === 1 ? paths[0] : ArrayPrototypeJoin(paths, "\0"));
|
|
52815
52815
|
Module._pathCache[cacheKey] = selfResolved;
|
|
@@ -52830,12 +52830,12 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52830
52830
|
err.requireStack = requireStack;
|
|
52831
52831
|
throw err;
|
|
52832
52832
|
};
|
|
52833
|
-
function finalizeEsmResolution(resolved,
|
|
52833
|
+
function finalizeEsmResolution(resolved, parentPath2, pkgPath) {
|
|
52834
52834
|
if (RegExpPrototypeTest(encodedSepRegEx, resolved))
|
|
52835
52835
|
throw new ERR_INVALID_MODULE_SPECIFIER(
|
|
52836
52836
|
resolved,
|
|
52837
52837
|
'must not include encoded "/" or "\\" characters',
|
|
52838
|
-
|
|
52838
|
+
parentPath2
|
|
52839
52839
|
);
|
|
52840
52840
|
const filename = fileURLToPath3(resolved);
|
|
52841
52841
|
const actual = tryReplacementExtensions(filename) || tryFile(filename);
|
|
@@ -52843,15 +52843,15 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52843
52843
|
return actual;
|
|
52844
52844
|
const err = createEsmNotFoundErr(
|
|
52845
52845
|
filename,
|
|
52846
|
-
|
|
52846
|
+
path25.resolve(pkgPath, "package.json")
|
|
52847
52847
|
);
|
|
52848
52848
|
throw err;
|
|
52849
52849
|
}
|
|
52850
|
-
function createEsmNotFoundErr(request,
|
|
52850
|
+
function createEsmNotFoundErr(request, path26) {
|
|
52851
52851
|
const err = new Error(`Cannot find module '${request}'`);
|
|
52852
52852
|
err.code = "MODULE_NOT_FOUND";
|
|
52853
|
-
if (
|
|
52854
|
-
err.path =
|
|
52853
|
+
if (path26)
|
|
52854
|
+
err.path = path26;
|
|
52855
52855
|
return err;
|
|
52856
52856
|
}
|
|
52857
52857
|
return {
|
|
@@ -52867,9 +52867,9 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
52867
52867
|
const ext2 = lastDotIndex >= 0 ? filename.slice(lastDotIndex) : "";
|
|
52868
52868
|
if ((ext2 === ".cts" || ext2 === ".cjs") && tsNodeClassification.moduleType === "auto") return;
|
|
52869
52869
|
if (ext2 === ".mts" || ext2 === ".mjs" || tsNodeClassification.moduleType === "esm" || pkg && pkg.data && pkg.data.type === "module") {
|
|
52870
|
-
const
|
|
52871
|
-
const packageJsonPath = pkg ?
|
|
52872
|
-
throw createErrRequireEsm(filename,
|
|
52870
|
+
const parentPath2 = module3.parent && module3.parent.filename;
|
|
52871
|
+
const packageJsonPath = pkg ? path25.resolve(pkg.path, "package.json") : null;
|
|
52872
|
+
throw createErrRequireEsm(filename, parentPath2, packageJsonPath);
|
|
52873
52873
|
}
|
|
52874
52874
|
}
|
|
52875
52875
|
module2.exports = {
|
|
@@ -59661,10 +59661,10 @@ var require_base = __commonJS({
|
|
|
59661
59661
|
}
|
|
59662
59662
|
return components;
|
|
59663
59663
|
}
|
|
59664
|
-
function clonePath(
|
|
59664
|
+
function clonePath(path25) {
|
|
59665
59665
|
return {
|
|
59666
|
-
newPos:
|
|
59667
|
-
components:
|
|
59666
|
+
newPos: path25.newPos,
|
|
59667
|
+
components: path25.components.slice(0)
|
|
59668
59668
|
};
|
|
59669
59669
|
}
|
|
59670
59670
|
}
|
|
@@ -61361,8 +61361,8 @@ ${module_1.builtinModules.filter((name) => !name.startsWith("_") && !name.includ
|
|
|
61361
61361
|
}
|
|
61362
61362
|
exports2.createRepl = createRepl;
|
|
61363
61363
|
var EvalState = class {
|
|
61364
|
-
constructor(
|
|
61365
|
-
this.path =
|
|
61364
|
+
constructor(path25) {
|
|
61365
|
+
this.path = path25;
|
|
61366
61366
|
this.input = "";
|
|
61367
61367
|
this.output = "";
|
|
61368
61368
|
this.version = 0;
|
|
@@ -61371,23 +61371,23 @@ ${module_1.builtinModules.filter((name) => !name.startsWith("_") && !name.includ
|
|
|
61371
61371
|
};
|
|
61372
61372
|
exports2.EvalState = EvalState;
|
|
61373
61373
|
function createEvalAwarePartialHost(state, composeWith) {
|
|
61374
|
-
function readFile(
|
|
61375
|
-
if (
|
|
61374
|
+
function readFile(path25) {
|
|
61375
|
+
if (path25 === state.path)
|
|
61376
61376
|
return state.input;
|
|
61377
61377
|
if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.readFile)
|
|
61378
|
-
return composeWith.readFile(
|
|
61378
|
+
return composeWith.readFile(path25);
|
|
61379
61379
|
try {
|
|
61380
|
-
return (0, fs_1.readFileSync)(
|
|
61380
|
+
return (0, fs_1.readFileSync)(path25, "utf8");
|
|
61381
61381
|
} catch (err) {
|
|
61382
61382
|
}
|
|
61383
61383
|
}
|
|
61384
|
-
function fileExists(
|
|
61385
|
-
if (
|
|
61384
|
+
function fileExists(path25) {
|
|
61385
|
+
if (path25 === state.path)
|
|
61386
61386
|
return true;
|
|
61387
61387
|
if (composeWith === null || composeWith === void 0 ? void 0 : composeWith.fileExists)
|
|
61388
|
-
return composeWith.fileExists(
|
|
61388
|
+
return composeWith.fileExists(path25);
|
|
61389
61389
|
try {
|
|
61390
|
-
const stats = (0, fs_1.statSync)(
|
|
61390
|
+
const stats = (0, fs_1.statSync)(path25);
|
|
61391
61391
|
return stats.isFile() || stats.isFIFO();
|
|
61392
61392
|
} catch (err) {
|
|
61393
61393
|
return false;
|
|
@@ -62242,16 +62242,16 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
62242
62242
|
}
|
|
62243
62243
|
function parseFileUrl(input) {
|
|
62244
62244
|
const match2 = fileRegex.exec(input);
|
|
62245
|
-
const
|
|
62246
|
-
return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(
|
|
62245
|
+
const path25 = match2[2];
|
|
62246
|
+
return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path25) ? path25 : "/" + path25, match2[3] || "", match2[4] || "");
|
|
62247
62247
|
}
|
|
62248
|
-
function makeUrl(scheme, user, host, port,
|
|
62248
|
+
function makeUrl(scheme, user, host, port, path25, query, hash) {
|
|
62249
62249
|
return {
|
|
62250
62250
|
scheme,
|
|
62251
62251
|
user,
|
|
62252
62252
|
host,
|
|
62253
62253
|
port,
|
|
62254
|
-
path:
|
|
62254
|
+
path: path25,
|
|
62255
62255
|
query,
|
|
62256
62256
|
hash,
|
|
62257
62257
|
type: 7
|
|
@@ -62281,11 +62281,11 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
62281
62281
|
url2.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
|
|
62282
62282
|
return url2;
|
|
62283
62283
|
}
|
|
62284
|
-
function stripPathFilename(
|
|
62285
|
-
if (
|
|
62286
|
-
return
|
|
62287
|
-
const index =
|
|
62288
|
-
return
|
|
62284
|
+
function stripPathFilename(path25) {
|
|
62285
|
+
if (path25.endsWith("/.."))
|
|
62286
|
+
return path25;
|
|
62287
|
+
const index = path25.lastIndexOf("/");
|
|
62288
|
+
return path25.slice(0, index + 1);
|
|
62289
62289
|
}
|
|
62290
62290
|
function mergePaths(url2, base) {
|
|
62291
62291
|
normalizePath(base, base.type);
|
|
@@ -62323,14 +62323,14 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
62323
62323
|
pieces[pointer++] = piece;
|
|
62324
62324
|
positive++;
|
|
62325
62325
|
}
|
|
62326
|
-
let
|
|
62326
|
+
let path25 = "";
|
|
62327
62327
|
for (let i = 1; i < pointer; i++) {
|
|
62328
|
-
|
|
62328
|
+
path25 += "/" + pieces[i];
|
|
62329
62329
|
}
|
|
62330
|
-
if (!
|
|
62331
|
-
|
|
62330
|
+
if (!path25 || addTrailingSlash && !path25.endsWith("/..")) {
|
|
62331
|
+
path25 += "/";
|
|
62332
62332
|
}
|
|
62333
|
-
url2.path =
|
|
62333
|
+
url2.path = path25;
|
|
62334
62334
|
}
|
|
62335
62335
|
function resolve(input, base) {
|
|
62336
62336
|
if (!input && !base)
|
|
@@ -62371,13 +62371,13 @@ var require_resolve_uri_umd = __commonJS({
|
|
|
62371
62371
|
case 3:
|
|
62372
62372
|
return queryHash;
|
|
62373
62373
|
case 4: {
|
|
62374
|
-
const
|
|
62375
|
-
if (!
|
|
62374
|
+
const path25 = url2.path.slice(1);
|
|
62375
|
+
if (!path25)
|
|
62376
62376
|
return queryHash || ".";
|
|
62377
|
-
if (isRelative(base || input) && !isRelative(
|
|
62378
|
-
return "./" +
|
|
62377
|
+
if (isRelative(base || input) && !isRelative(path25)) {
|
|
62378
|
+
return "./" + path25 + queryHash;
|
|
62379
62379
|
}
|
|
62380
|
-
return
|
|
62380
|
+
return path25 + queryHash;
|
|
62381
62381
|
}
|
|
62382
62382
|
case 5:
|
|
62383
62383
|
return url2.path + queryHash;
|
|
@@ -62406,11 +62406,11 @@ var require_trace_mapping_umd = __commonJS({
|
|
|
62406
62406
|
base += "/";
|
|
62407
62407
|
return resolveUri__default["default"](input, base);
|
|
62408
62408
|
}
|
|
62409
|
-
function stripFilename(
|
|
62410
|
-
if (!
|
|
62409
|
+
function stripFilename(path25) {
|
|
62410
|
+
if (!path25)
|
|
62411
62411
|
return "";
|
|
62412
|
-
const index =
|
|
62413
|
-
return
|
|
62412
|
+
const index = path25.lastIndexOf("/");
|
|
62413
|
+
return path25.slice(0, index + 1);
|
|
62414
62414
|
}
|
|
62415
62415
|
const COLUMN = 0;
|
|
62416
62416
|
const SOURCES_INDEX = 1;
|
|
@@ -62815,14 +62815,14 @@ var require_trace_mapping_umd = __commonJS({
|
|
|
62815
62815
|
var require_source_map_support = __commonJS({
|
|
62816
62816
|
"node_modules/@cspotcode/source-map-support/source-map-support.js"(exports2, module2) {
|
|
62817
62817
|
var { TraceMap, originalPositionFor, AnyMap } = require_trace_mapping_umd();
|
|
62818
|
-
var
|
|
62818
|
+
var path25 = require("path");
|
|
62819
62819
|
var { fileURLToPath: fileURLToPath3, pathToFileURL } = require("url");
|
|
62820
62820
|
var util3 = require("util");
|
|
62821
|
-
var
|
|
62821
|
+
var fs21;
|
|
62822
62822
|
try {
|
|
62823
|
-
|
|
62824
|
-
if (!
|
|
62825
|
-
|
|
62823
|
+
fs21 = require("fs");
|
|
62824
|
+
if (!fs21.existsSync || !fs21.readFileSync) {
|
|
62825
|
+
fs21 = null;
|
|
62826
62826
|
}
|
|
62827
62827
|
} catch (err) {
|
|
62828
62828
|
}
|
|
@@ -62960,27 +62960,27 @@ var require_source_map_support = __commonJS({
|
|
|
62960
62960
|
};
|
|
62961
62961
|
}
|
|
62962
62962
|
var retrieveFile = handlerExec(sharedData.retrieveFileHandlers, sharedData.internalRetrieveFileHandlers);
|
|
62963
|
-
sharedData.internalRetrieveFileHandlers.push(function(
|
|
62964
|
-
|
|
62965
|
-
if (/^file:/.test(
|
|
62966
|
-
|
|
62963
|
+
sharedData.internalRetrieveFileHandlers.push(function(path26) {
|
|
62964
|
+
path26 = path26.trim();
|
|
62965
|
+
if (/^file:/.test(path26)) {
|
|
62966
|
+
path26 = path26.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
|
|
62967
62967
|
return drive ? "" : (
|
|
62968
62968
|
// file:///C:/dir/file -> C:/dir/file
|
|
62969
62969
|
"/"
|
|
62970
62970
|
);
|
|
62971
62971
|
});
|
|
62972
62972
|
}
|
|
62973
|
-
const key = getCacheKey(
|
|
62973
|
+
const key = getCacheKey(path26);
|
|
62974
62974
|
if (hasFileContentsCacheFromKey(key)) {
|
|
62975
62975
|
return getFileContentsCacheFromKey(key);
|
|
62976
62976
|
}
|
|
62977
62977
|
var contents = "";
|
|
62978
62978
|
try {
|
|
62979
|
-
if (!
|
|
62979
|
+
if (!fs21) {
|
|
62980
62980
|
var xhr = new XMLHttpRequest();
|
|
62981
62981
|
xhr.open(
|
|
62982
62982
|
"GET",
|
|
62983
|
-
|
|
62983
|
+
path26,
|
|
62984
62984
|
/** async */
|
|
62985
62985
|
false
|
|
62986
62986
|
);
|
|
@@ -62988,12 +62988,12 @@ var require_source_map_support = __commonJS({
|
|
|
62988
62988
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
62989
62989
|
contents = xhr.responseText;
|
|
62990
62990
|
}
|
|
62991
|
-
} else if (
|
|
62992
|
-
contents =
|
|
62991
|
+
} else if (fs21.existsSync(path26)) {
|
|
62992
|
+
contents = fs21.readFileSync(path26, "utf8");
|
|
62993
62993
|
}
|
|
62994
62994
|
} catch (er) {
|
|
62995
62995
|
}
|
|
62996
|
-
return setFileContentsCache(
|
|
62996
|
+
return setFileContentsCache(path26, contents);
|
|
62997
62997
|
});
|
|
62998
62998
|
function supportRelativeURL(file, url2) {
|
|
62999
62999
|
if (!file) return url2;
|
|
@@ -63002,12 +63002,12 @@ var require_source_map_support = __commonJS({
|
|
|
63002
63002
|
if (isAbsoluteUrl(url2) || isSchemeRelativeUrl(url2)) {
|
|
63003
63003
|
return new URL(url2, file).toString();
|
|
63004
63004
|
}
|
|
63005
|
-
if (
|
|
63005
|
+
if (path25.isAbsolute(url2)) {
|
|
63006
63006
|
return new URL(pathToFileURL(url2), file).toString();
|
|
63007
63007
|
}
|
|
63008
63008
|
return new URL(url2.replace(/\\/g, "/"), file).toString();
|
|
63009
63009
|
}
|
|
63010
|
-
if (
|
|
63010
|
+
if (path25.isAbsolute(file)) {
|
|
63011
63011
|
if (isFileUrl(url2)) {
|
|
63012
63012
|
return fileURLToPath3(url2);
|
|
63013
63013
|
}
|
|
@@ -63017,15 +63017,15 @@ var require_source_map_support = __commonJS({
|
|
|
63017
63017
|
if (isAbsoluteUrl(url2)) {
|
|
63018
63018
|
return url2;
|
|
63019
63019
|
}
|
|
63020
|
-
if (
|
|
63021
|
-
return
|
|
63020
|
+
if (path25.isAbsolute(url2)) {
|
|
63021
|
+
return path25.normalize(url2);
|
|
63022
63022
|
}
|
|
63023
|
-
return
|
|
63023
|
+
return path25.join(file, "..", decodeURI(url2));
|
|
63024
63024
|
}
|
|
63025
63025
|
if (isAbsoluteUrl(url2) || isSchemeRelativeUrl(url2)) {
|
|
63026
63026
|
return url2;
|
|
63027
63027
|
}
|
|
63028
|
-
return
|
|
63028
|
+
return path25.join(file, "..", url2);
|
|
63029
63029
|
} catch (e) {
|
|
63030
63030
|
return url2;
|
|
63031
63031
|
}
|
|
@@ -63034,8 +63034,8 @@ var require_source_map_support = __commonJS({
|
|
|
63034
63034
|
try {
|
|
63035
63035
|
if (isAbsoluteUrl(matchStyleOf) || isSchemeRelativeUrl(matchStyleOf)) {
|
|
63036
63036
|
if (isAbsoluteUrl(pathOrUrl) || isSchemeRelativeUrl(pathOrUrl)) return pathOrUrl;
|
|
63037
|
-
if (
|
|
63038
|
-
} else if (
|
|
63037
|
+
if (path25.isAbsolute(pathOrUrl)) return pathToFileURL(pathOrUrl).toString();
|
|
63038
|
+
} else if (path25.isAbsolute(matchStyleOf)) {
|
|
63039
63039
|
if (isAbsoluteUrl(pathOrUrl) || isSchemeRelativeUrl(pathOrUrl)) {
|
|
63040
63040
|
return fileURLToPath3(new URL(pathOrUrl, "file://"));
|
|
63041
63041
|
}
|
|
@@ -63284,7 +63284,7 @@ var require_source_map_support = __commonJS({
|
|
|
63284
63284
|
}
|
|
63285
63285
|
var kIsNodeError = void 0;
|
|
63286
63286
|
try {
|
|
63287
|
-
|
|
63287
|
+
path25.resolve(123);
|
|
63288
63288
|
} catch (e) {
|
|
63289
63289
|
const symbols = Object.getOwnPropertySymbols(e);
|
|
63290
63290
|
const symbol = symbols.find(function(s) {
|
|
@@ -63330,9 +63330,9 @@ var require_source_map_support = __commonJS({
|
|
|
63330
63330
|
var column = +match2[3];
|
|
63331
63331
|
var contents = getFileContentsCache(source);
|
|
63332
63332
|
const sourceAsPath = tryFileURLToPath(source);
|
|
63333
|
-
if (!contents &&
|
|
63333
|
+
if (!contents && fs21 && fs21.existsSync(sourceAsPath)) {
|
|
63334
63334
|
try {
|
|
63335
|
-
contents =
|
|
63335
|
+
contents = fs21.readFileSync(sourceAsPath, "utf8");
|
|
63336
63336
|
} catch (er) {
|
|
63337
63337
|
contents = "";
|
|
63338
63338
|
}
|
|
@@ -63629,27 +63629,27 @@ Update this package.json to use a subpath pattern like "${match2}*".`,
|
|
|
63629
63629
|
const statSupportsThrowIfNoEntry = versionGteLt(process.versions.node, "15.3.0") || versionGteLt(process.versions.node, "14.17.0", "15.0.0");
|
|
63630
63630
|
const tryStatSync = statSupportsThrowIfNoEntry ? tryStatSyncWithoutErrors : tryStatSyncWithErrors;
|
|
63631
63631
|
const statsIfNotFound = new Stats();
|
|
63632
|
-
function tryStatSyncWithoutErrors(
|
|
63633
|
-
const stats = statSync(
|
|
63632
|
+
function tryStatSyncWithoutErrors(path25) {
|
|
63633
|
+
const stats = statSync(path25, { throwIfNoEntry: false });
|
|
63634
63634
|
if (stats != null) return stats;
|
|
63635
63635
|
return statsIfNotFound;
|
|
63636
63636
|
}
|
|
63637
|
-
function tryStatSyncWithErrors(
|
|
63637
|
+
function tryStatSyncWithErrors(path25) {
|
|
63638
63638
|
try {
|
|
63639
|
-
return statSync(
|
|
63639
|
+
return statSync(path25);
|
|
63640
63640
|
} catch {
|
|
63641
63641
|
return statsIfNotFound;
|
|
63642
63642
|
}
|
|
63643
63643
|
}
|
|
63644
|
-
function getPackageConfig(
|
|
63645
|
-
const existing = packageJSONCache.get(
|
|
63644
|
+
function getPackageConfig(path25, specifier, base) {
|
|
63645
|
+
const existing = packageJSONCache.get(path25);
|
|
63646
63646
|
if (existing !== void 0) {
|
|
63647
63647
|
return existing;
|
|
63648
63648
|
}
|
|
63649
|
-
const source = packageJsonReader.read(
|
|
63649
|
+
const source = packageJsonReader.read(path25).string;
|
|
63650
63650
|
if (source === void 0) {
|
|
63651
63651
|
const packageConfig2 = {
|
|
63652
|
-
pjsonPath:
|
|
63652
|
+
pjsonPath: path25,
|
|
63653
63653
|
exists: false,
|
|
63654
63654
|
main: void 0,
|
|
63655
63655
|
name: void 0,
|
|
@@ -63657,7 +63657,7 @@ Update this package.json to use a subpath pattern like "${match2}*".`,
|
|
|
63657
63657
|
exports: void 0,
|
|
63658
63658
|
imports: void 0
|
|
63659
63659
|
};
|
|
63660
|
-
packageJSONCache.set(
|
|
63660
|
+
packageJSONCache.set(path25, packageConfig2);
|
|
63661
63661
|
return packageConfig2;
|
|
63662
63662
|
}
|
|
63663
63663
|
let packageJSON;
|
|
@@ -63665,7 +63665,7 @@ Update this package.json to use a subpath pattern like "${match2}*".`,
|
|
|
63665
63665
|
packageJSON = JSONParse(source);
|
|
63666
63666
|
} catch (error) {
|
|
63667
63667
|
throw new ERR_INVALID_PACKAGE_CONFIG(
|
|
63668
|
-
|
|
63668
|
+
path25,
|
|
63669
63669
|
(base ? `"${specifier}" from ` : "") + fileURLToPath3(base || specifier),
|
|
63670
63670
|
error.message
|
|
63671
63671
|
);
|
|
@@ -63677,7 +63677,7 @@ Update this package.json to use a subpath pattern like "${match2}*".`,
|
|
|
63677
63677
|
if (typeof name !== "string") name = void 0;
|
|
63678
63678
|
if (type !== "module" && type !== "commonjs") type = "none";
|
|
63679
63679
|
const packageConfig = {
|
|
63680
|
-
pjsonPath:
|
|
63680
|
+
pjsonPath: path25,
|
|
63681
63681
|
exists: true,
|
|
63682
63682
|
main,
|
|
63683
63683
|
name,
|
|
@@ -63685,7 +63685,7 @@ Update this package.json to use a subpath pattern like "${match2}*".`,
|
|
|
63685
63685
|
exports: exports3,
|
|
63686
63686
|
imports
|
|
63687
63687
|
};
|
|
63688
|
-
packageJSONCache.set(
|
|
63688
|
+
packageJSONCache.set(path25, packageConfig);
|
|
63689
63689
|
return packageConfig;
|
|
63690
63690
|
}
|
|
63691
63691
|
function getPackageScopeConfig(resolved) {
|
|
@@ -63801,10 +63801,10 @@ Update this package.json to use a subpath pattern like "${match2}*".`,
|
|
|
63801
63801
|
fileURLToPath3(base)
|
|
63802
63802
|
);
|
|
63803
63803
|
if (experimentalSpecifierResolution === "node") {
|
|
63804
|
-
const
|
|
63804
|
+
const path26 = fileURLToPath3(resolved);
|
|
63805
63805
|
let file2 = resolveExtensionsWithTryExactName(resolved);
|
|
63806
63806
|
if (file2 !== void 0) return file2;
|
|
63807
|
-
if (!StringPrototypeEndsWith(
|
|
63807
|
+
if (!StringPrototypeEndsWith(path26, "/")) {
|
|
63808
63808
|
file2 = resolveIndex(new URL3(`${resolved}/`));
|
|
63809
63809
|
if (file2 !== void 0) return file2;
|
|
63810
63810
|
} else {
|
|
@@ -63817,15 +63817,15 @@ Update this package.json to use a subpath pattern like "${match2}*".`,
|
|
|
63817
63817
|
);
|
|
63818
63818
|
}
|
|
63819
63819
|
const file = resolveReplacementExtensions(resolved) || resolved;
|
|
63820
|
-
const
|
|
63821
|
-
const stats = tryStatSync(StringPrototypeEndsWith(
|
|
63820
|
+
const path25 = fileURLToPath3(file);
|
|
63821
|
+
const stats = tryStatSync(StringPrototypeEndsWith(path25, "/") ? StringPrototypeSlice(path25, -1) : path25);
|
|
63822
63822
|
if (stats.isDirectory()) {
|
|
63823
|
-
const err = new ERR_UNSUPPORTED_DIR_IMPORT(
|
|
63823
|
+
const err = new ERR_UNSUPPORTED_DIR_IMPORT(path25, fileURLToPath3(base));
|
|
63824
63824
|
err.url = String(resolved);
|
|
63825
63825
|
throw err;
|
|
63826
63826
|
} else if (!stats.isFile()) {
|
|
63827
63827
|
throw new ERR_MODULE_NOT_FOUND(
|
|
63828
|
-
|
|
63828
|
+
path25 || resolved.pathname,
|
|
63829
63829
|
fileURLToPath3(base),
|
|
63830
63830
|
"module"
|
|
63831
63831
|
);
|
|
@@ -64872,15 +64872,15 @@ ${diagnosticText}`);
|
|
|
64872
64872
|
environment: "node",
|
|
64873
64873
|
retrieveFile(pathOrUrl) {
|
|
64874
64874
|
var _a3;
|
|
64875
|
-
let
|
|
64876
|
-
if (experimentalEsmLoader &&
|
|
64875
|
+
let path25 = pathOrUrl;
|
|
64876
|
+
if (experimentalEsmLoader && path25.startsWith("file://")) {
|
|
64877
64877
|
try {
|
|
64878
|
-
|
|
64878
|
+
path25 = (0, url_1.fileURLToPath)(path25);
|
|
64879
64879
|
} catch (e) {
|
|
64880
64880
|
}
|
|
64881
64881
|
}
|
|
64882
|
-
|
|
64883
|
-
return ((_a3 = outputCache.get(
|
|
64882
|
+
path25 = (0, util_1.normalizeSlashes)(path25);
|
|
64883
|
+
return ((_a3 = outputCache.get(path25)) === null || _a3 === void 0 ? void 0 : _a3.content) || "";
|
|
64884
64884
|
},
|
|
64885
64885
|
redirectConflictingLibrary: true,
|
|
64886
64886
|
onConflictingLibraryRedirect(request, parent, isMain, options2, redirectedRequest) {
|
|
@@ -64906,10 +64906,10 @@ ${diagnosticText}`);
|
|
|
64906
64906
|
if (configDiagnosticList.length)
|
|
64907
64907
|
reportTSError(configDiagnosticList);
|
|
64908
64908
|
const jsxEmitPreserve = config.options.jsx === ts.JsxEmit.Preserve;
|
|
64909
|
-
function getEmitExtension(
|
|
64910
|
-
const lastDotIndex =
|
|
64909
|
+
function getEmitExtension(path25) {
|
|
64910
|
+
const lastDotIndex = path25.lastIndexOf(".");
|
|
64911
64911
|
if (lastDotIndex >= 0) {
|
|
64912
|
-
const ext2 =
|
|
64912
|
+
const ext2 = path25.slice(lastDotIndex);
|
|
64913
64913
|
switch (ext2) {
|
|
64914
64914
|
case ".js":
|
|
64915
64915
|
case ".ts":
|
|
@@ -65124,14 +65124,14 @@ This is usually the result of a faulty configuration or import. Make sure there
|
|
|
65124
65124
|
const diagnosticList = filterDiagnostics(diagnostics, diagnosticFilters);
|
|
65125
65125
|
if (diagnosticList.length)
|
|
65126
65126
|
reportTSError(diagnosticList);
|
|
65127
|
-
const result = builderProgram.emit(sourceFile, (
|
|
65128
|
-
if (
|
|
65127
|
+
const result = builderProgram.emit(sourceFile, (path25, file, writeByteOrderMark) => {
|
|
65128
|
+
if (path25.endsWith(".map")) {
|
|
65129
65129
|
outMap = file;
|
|
65130
65130
|
} else {
|
|
65131
65131
|
outText = file;
|
|
65132
65132
|
}
|
|
65133
65133
|
if (options.emit)
|
|
65134
|
-
sys.writeFile(
|
|
65134
|
+
sys.writeFile(path25, file, writeByteOrderMark);
|
|
65135
65135
|
}, void 0, void 0, customTransformers);
|
|
65136
65136
|
if (result.emitSkipped) {
|
|
65137
65137
|
return [void 0, void 0, true];
|
|
@@ -65296,8 +65296,8 @@ This is usually the result of a faulty configuration or import. Make sure there
|
|
|
65296
65296
|
function createIgnore(ignoreBaseDir, ignore) {
|
|
65297
65297
|
return (fileName) => {
|
|
65298
65298
|
const relname = (0, path_1.relative)(ignoreBaseDir, fileName);
|
|
65299
|
-
const
|
|
65300
|
-
return ignore.some((x) => x.test(
|
|
65299
|
+
const path25 = (0, util_1.normalizeSlashes)(relname);
|
|
65300
|
+
return ignore.some((x) => x.test(path25));
|
|
65301
65301
|
};
|
|
65302
65302
|
}
|
|
65303
65303
|
function registerExtensions(preferTsExts, extensions, service, originalJsHandler) {
|
|
@@ -65815,7 +65815,7 @@ var require_has_flag2 = __commonJS({
|
|
|
65815
65815
|
var require_supports_colors = __commonJS({
|
|
65816
65816
|
"node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
|
|
65817
65817
|
"use strict";
|
|
65818
|
-
var
|
|
65818
|
+
var os9 = require("os");
|
|
65819
65819
|
var hasFlag = require_has_flag2();
|
|
65820
65820
|
var env = process.env;
|
|
65821
65821
|
var forceColor = void 0;
|
|
@@ -65853,7 +65853,7 @@ var require_supports_colors = __commonJS({
|
|
|
65853
65853
|
}
|
|
65854
65854
|
var min = forceColor ? 1 : 0;
|
|
65855
65855
|
if (process.platform === "win32") {
|
|
65856
|
-
var osRelease =
|
|
65856
|
+
var osRelease = os9.release().split(".");
|
|
65857
65857
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
65858
65858
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
65859
65859
|
}
|
|
@@ -67121,9 +67121,9 @@ var {
|
|
|
67121
67121
|
} = import_index.default;
|
|
67122
67122
|
|
|
67123
67123
|
// apps/cli/cli.ts
|
|
67124
|
-
var
|
|
67125
|
-
var
|
|
67126
|
-
var
|
|
67124
|
+
var import_chalk27 = __toESM(require_source());
|
|
67125
|
+
var import_path20 = __toESM(require("path"));
|
|
67126
|
+
var import_fs_extra18 = __toESM(require_lib());
|
|
67127
67127
|
|
|
67128
67128
|
// apps/cli/utils/operation-logger.ts
|
|
67129
67129
|
var import_fs_extra = __toESM(require_lib());
|
|
@@ -69480,9 +69480,9 @@ var fetchAsyncQuestionProperty = function(question, prop, answers) {
|
|
|
69480
69480
|
|
|
69481
69481
|
// node_modules/inquirer/lib/ui/prompt.js
|
|
69482
69482
|
var _ = {
|
|
69483
|
-
set: (obj,
|
|
69483
|
+
set: (obj, path25 = "", value2) => {
|
|
69484
69484
|
let pointer = obj;
|
|
69485
|
-
|
|
69485
|
+
path25.split(".").forEach((key, index, arr) => {
|
|
69486
69486
|
if (key === "__proto__" || key === "constructor") return;
|
|
69487
69487
|
if (index === arr.length - 1) {
|
|
69488
69488
|
pointer[key] = value2;
|
|
@@ -69492,8 +69492,8 @@ var _ = {
|
|
|
69492
69492
|
pointer = pointer[key];
|
|
69493
69493
|
});
|
|
69494
69494
|
},
|
|
69495
|
-
get: (obj,
|
|
69496
|
-
const travel = (regexp) => String.prototype.split.call(
|
|
69495
|
+
get: (obj, path25 = "", defaultValue) => {
|
|
69496
|
+
const travel = (regexp) => String.prototype.split.call(path25, regexp).filter(Boolean).reduce(
|
|
69497
69497
|
// @ts-expect-error implicit any on res[key]
|
|
69498
69498
|
(res, key) => res !== null && res !== void 0 ? res[key] : res,
|
|
69499
69499
|
obj
|
|
@@ -70372,9 +70372,9 @@ function isVisitable(thing) {
|
|
|
70372
70372
|
function removeBrackets(key) {
|
|
70373
70373
|
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
70374
70374
|
}
|
|
70375
|
-
function renderKey(
|
|
70376
|
-
if (!
|
|
70377
|
-
return
|
|
70375
|
+
function renderKey(path25, key, dots) {
|
|
70376
|
+
if (!path25) return key;
|
|
70377
|
+
return path25.concat(key).map(function each(token2, i) {
|
|
70378
70378
|
token2 = removeBrackets(token2);
|
|
70379
70379
|
return !dots && i ? "[" + token2 + "]" : token2;
|
|
70380
70380
|
}).join(dots ? "." : "");
|
|
@@ -70422,9 +70422,9 @@ function toFormData(obj, formData, options) {
|
|
|
70422
70422
|
}
|
|
70423
70423
|
return value2;
|
|
70424
70424
|
}
|
|
70425
|
-
function defaultVisitor(value2, key,
|
|
70425
|
+
function defaultVisitor(value2, key, path25) {
|
|
70426
70426
|
let arr = value2;
|
|
70427
|
-
if (value2 && !
|
|
70427
|
+
if (value2 && !path25 && typeof value2 === "object") {
|
|
70428
70428
|
if (utils_default.endsWith(key, "{}")) {
|
|
70429
70429
|
key = metaTokens ? key : key.slice(0, -2);
|
|
70430
70430
|
value2 = JSON.stringify(value2);
|
|
@@ -70443,7 +70443,7 @@ function toFormData(obj, formData, options) {
|
|
|
70443
70443
|
if (isVisitable(value2)) {
|
|
70444
70444
|
return true;
|
|
70445
70445
|
}
|
|
70446
|
-
formData.append(renderKey(
|
|
70446
|
+
formData.append(renderKey(path25, key, dots), convertValue(value2));
|
|
70447
70447
|
return false;
|
|
70448
70448
|
}
|
|
70449
70449
|
const stack = [];
|
|
@@ -70452,10 +70452,10 @@ function toFormData(obj, formData, options) {
|
|
|
70452
70452
|
convertValue,
|
|
70453
70453
|
isVisitable
|
|
70454
70454
|
});
|
|
70455
|
-
function build(value2,
|
|
70455
|
+
function build(value2, path25) {
|
|
70456
70456
|
if (utils_default.isUndefined(value2)) return;
|
|
70457
70457
|
if (stack.indexOf(value2) !== -1) {
|
|
70458
|
-
throw Error("Circular reference detected in " +
|
|
70458
|
+
throw Error("Circular reference detected in " + path25.join("."));
|
|
70459
70459
|
}
|
|
70460
70460
|
stack.push(value2);
|
|
70461
70461
|
utils_default.forEach(value2, function each(el, key) {
|
|
@@ -70463,11 +70463,11 @@ function toFormData(obj, formData, options) {
|
|
|
70463
70463
|
formData,
|
|
70464
70464
|
el,
|
|
70465
70465
|
utils_default.isString(key) ? key.trim() : key,
|
|
70466
|
-
|
|
70466
|
+
path25,
|
|
70467
70467
|
exposedHelpers
|
|
70468
70468
|
);
|
|
70469
70469
|
if (result === true) {
|
|
70470
|
-
build(el,
|
|
70470
|
+
build(el, path25 ? path25.concat(key) : [key]);
|
|
70471
70471
|
}
|
|
70472
70472
|
});
|
|
70473
70473
|
stack.pop();
|
|
@@ -70679,7 +70679,7 @@ var platform_default = {
|
|
|
70679
70679
|
// node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
70680
70680
|
function toURLEncodedForm(data, options) {
|
|
70681
70681
|
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
70682
|
-
visitor: function(value2, key,
|
|
70682
|
+
visitor: function(value2, key, path25, helpers) {
|
|
70683
70683
|
if (platform_default.isNode && utils_default.isBuffer(value2)) {
|
|
70684
70684
|
this.append(key, value2.toString("base64"));
|
|
70685
70685
|
return false;
|
|
@@ -70709,11 +70709,11 @@ function arrayToObject(arr) {
|
|
|
70709
70709
|
return obj;
|
|
70710
70710
|
}
|
|
70711
70711
|
function formDataToJSON(formData) {
|
|
70712
|
-
function buildPath(
|
|
70713
|
-
let name =
|
|
70712
|
+
function buildPath(path25, value2, target, index) {
|
|
70713
|
+
let name = path25[index++];
|
|
70714
70714
|
if (name === "__proto__") return true;
|
|
70715
70715
|
const isNumericKey = Number.isFinite(+name);
|
|
70716
|
-
const isLast = index >=
|
|
70716
|
+
const isLast = index >= path25.length;
|
|
70717
70717
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
70718
70718
|
if (isLast) {
|
|
70719
70719
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -70726,7 +70726,7 @@ function formDataToJSON(formData) {
|
|
|
70726
70726
|
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
70727
70727
|
target[name] = [];
|
|
70728
70728
|
}
|
|
70729
|
-
const result = buildPath(
|
|
70729
|
+
const result = buildPath(path25, value2, target[name], index);
|
|
70730
70730
|
if (result && utils_default.isArray(target[name])) {
|
|
70731
70731
|
target[name] = arrayToObject(target[name]);
|
|
70732
70732
|
}
|
|
@@ -72048,9 +72048,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
72048
72048
|
auth = urlUsername + ":" + urlPassword;
|
|
72049
72049
|
}
|
|
72050
72050
|
auth && headers.delete("authorization");
|
|
72051
|
-
let
|
|
72051
|
+
let path25;
|
|
72052
72052
|
try {
|
|
72053
|
-
|
|
72053
|
+
path25 = buildURL(
|
|
72054
72054
|
parsed.pathname + parsed.search,
|
|
72055
72055
|
config.params,
|
|
72056
72056
|
config.paramsSerializer
|
|
@@ -72068,7 +72068,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
72068
72068
|
false
|
|
72069
72069
|
);
|
|
72070
72070
|
const options = {
|
|
72071
|
-
path:
|
|
72071
|
+
path: path25,
|
|
72072
72072
|
method,
|
|
72073
72073
|
headers: headers.toJSON(),
|
|
72074
72074
|
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
@@ -72304,14 +72304,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
|
|
|
72304
72304
|
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
72305
72305
|
// Standard browser envs support document.cookie
|
|
72306
72306
|
{
|
|
72307
|
-
write(name, value2, expires,
|
|
72307
|
+
write(name, value2, expires, path25, domain, secure, sameSite) {
|
|
72308
72308
|
if (typeof document === "undefined") return;
|
|
72309
72309
|
const cookie = [`${name}=${encodeURIComponent(value2)}`];
|
|
72310
72310
|
if (utils_default.isNumber(expires)) {
|
|
72311
72311
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
72312
72312
|
}
|
|
72313
|
-
if (utils_default.isString(
|
|
72314
|
-
cookie.push(`path=${
|
|
72313
|
+
if (utils_default.isString(path25)) {
|
|
72314
|
+
cookie.push(`path=${path25}`);
|
|
72315
72315
|
}
|
|
72316
72316
|
if (utils_default.isString(domain)) {
|
|
72317
72317
|
cookie.push(`domain=${domain}`);
|
|
@@ -81993,12 +81993,12 @@ var PathBase = class {
|
|
|
81993
81993
|
/**
|
|
81994
81994
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
81995
81995
|
*/
|
|
81996
|
-
resolve(
|
|
81997
|
-
if (!
|
|
81996
|
+
resolve(path25) {
|
|
81997
|
+
if (!path25) {
|
|
81998
81998
|
return this;
|
|
81999
81999
|
}
|
|
82000
|
-
const rootPath = this.getRootString(
|
|
82001
|
-
const dir =
|
|
82000
|
+
const rootPath = this.getRootString(path25);
|
|
82001
|
+
const dir = path25.substring(rootPath.length);
|
|
82002
82002
|
const dirParts = dir.split(this.splitSep);
|
|
82003
82003
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
82004
82004
|
return result;
|
|
@@ -82750,8 +82750,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
82750
82750
|
/**
|
|
82751
82751
|
* @internal
|
|
82752
82752
|
*/
|
|
82753
|
-
getRootString(
|
|
82754
|
-
return import_node_path2.win32.parse(
|
|
82753
|
+
getRootString(path25) {
|
|
82754
|
+
return import_node_path2.win32.parse(path25).root;
|
|
82755
82755
|
}
|
|
82756
82756
|
/**
|
|
82757
82757
|
* @internal
|
|
@@ -82797,8 +82797,8 @@ var PathPosix = class _PathPosix extends PathBase {
|
|
|
82797
82797
|
/**
|
|
82798
82798
|
* @internal
|
|
82799
82799
|
*/
|
|
82800
|
-
getRootString(
|
|
82801
|
-
return
|
|
82800
|
+
getRootString(path25) {
|
|
82801
|
+
return path25.startsWith("/") ? "/" : "";
|
|
82802
82802
|
}
|
|
82803
82803
|
/**
|
|
82804
82804
|
* @internal
|
|
@@ -82847,8 +82847,8 @@ var PathScurryBase = class {
|
|
|
82847
82847
|
*
|
|
82848
82848
|
* @internal
|
|
82849
82849
|
*/
|
|
82850
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
82851
|
-
this.#fs = fsFromOption(
|
|
82850
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs21 = defaultFS } = {}) {
|
|
82851
|
+
this.#fs = fsFromOption(fs21);
|
|
82852
82852
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
82853
82853
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
82854
82854
|
}
|
|
@@ -82887,11 +82887,11 @@ var PathScurryBase = class {
|
|
|
82887
82887
|
/**
|
|
82888
82888
|
* Get the depth of a provided path, string, or the cwd
|
|
82889
82889
|
*/
|
|
82890
|
-
depth(
|
|
82891
|
-
if (typeof
|
|
82892
|
-
|
|
82890
|
+
depth(path25 = this.cwd) {
|
|
82891
|
+
if (typeof path25 === "string") {
|
|
82892
|
+
path25 = this.cwd.resolve(path25);
|
|
82893
82893
|
}
|
|
82894
|
-
return
|
|
82894
|
+
return path25.depth();
|
|
82895
82895
|
}
|
|
82896
82896
|
/**
|
|
82897
82897
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -83378,9 +83378,9 @@ var PathScurryBase = class {
|
|
|
83378
83378
|
process3();
|
|
83379
83379
|
return results;
|
|
83380
83380
|
}
|
|
83381
|
-
chdir(
|
|
83381
|
+
chdir(path25 = this.cwd) {
|
|
83382
83382
|
const oldCwd = this.cwd;
|
|
83383
|
-
this.cwd = typeof
|
|
83383
|
+
this.cwd = typeof path25 === "string" ? this.cwd.resolve(path25) : path25;
|
|
83384
83384
|
this.cwd[setAsCwd](oldCwd);
|
|
83385
83385
|
}
|
|
83386
83386
|
};
|
|
@@ -83406,8 +83406,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
83406
83406
|
/**
|
|
83407
83407
|
* @internal
|
|
83408
83408
|
*/
|
|
83409
|
-
newRoot(
|
|
83410
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
83409
|
+
newRoot(fs21) {
|
|
83410
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs21 });
|
|
83411
83411
|
}
|
|
83412
83412
|
/**
|
|
83413
83413
|
* Return true if the provided path string is an absolute path
|
|
@@ -83435,8 +83435,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
83435
83435
|
/**
|
|
83436
83436
|
* @internal
|
|
83437
83437
|
*/
|
|
83438
|
-
newRoot(
|
|
83439
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
83438
|
+
newRoot(fs21) {
|
|
83439
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs21 });
|
|
83440
83440
|
}
|
|
83441
83441
|
/**
|
|
83442
83442
|
* Return true if the provided path string is an absolute path
|
|
@@ -83736,8 +83736,8 @@ var MatchRecord = class {
|
|
|
83736
83736
|
}
|
|
83737
83737
|
// match, absolute, ifdir
|
|
83738
83738
|
entries() {
|
|
83739
|
-
return [...this.store.entries()].map(([
|
|
83740
|
-
|
|
83739
|
+
return [...this.store.entries()].map(([path25, n]) => [
|
|
83740
|
+
path25,
|
|
83741
83741
|
!!(n & 2),
|
|
83742
83742
|
!!(n & 1)
|
|
83743
83743
|
]);
|
|
@@ -83942,9 +83942,9 @@ var GlobUtil = class {
|
|
|
83942
83942
|
signal;
|
|
83943
83943
|
maxDepth;
|
|
83944
83944
|
includeChildMatches;
|
|
83945
|
-
constructor(patterns,
|
|
83945
|
+
constructor(patterns, path25, opts) {
|
|
83946
83946
|
this.patterns = patterns;
|
|
83947
|
-
this.path =
|
|
83947
|
+
this.path = path25;
|
|
83948
83948
|
this.opts = opts;
|
|
83949
83949
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
83950
83950
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -83963,11 +83963,11 @@ var GlobUtil = class {
|
|
|
83963
83963
|
});
|
|
83964
83964
|
}
|
|
83965
83965
|
}
|
|
83966
|
-
#ignored(
|
|
83967
|
-
return this.seen.has(
|
|
83966
|
+
#ignored(path25) {
|
|
83967
|
+
return this.seen.has(path25) || !!this.#ignore?.ignored?.(path25);
|
|
83968
83968
|
}
|
|
83969
|
-
#childrenIgnored(
|
|
83970
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
83969
|
+
#childrenIgnored(path25) {
|
|
83970
|
+
return !!this.#ignore?.childrenIgnored?.(path25);
|
|
83971
83971
|
}
|
|
83972
83972
|
// backpressure mechanism
|
|
83973
83973
|
pause() {
|
|
@@ -84182,8 +84182,8 @@ var GlobUtil = class {
|
|
|
84182
84182
|
};
|
|
84183
84183
|
var GlobWalker = class extends GlobUtil {
|
|
84184
84184
|
matches = /* @__PURE__ */ new Set();
|
|
84185
|
-
constructor(patterns,
|
|
84186
|
-
super(patterns,
|
|
84185
|
+
constructor(patterns, path25, opts) {
|
|
84186
|
+
super(patterns, path25, opts);
|
|
84187
84187
|
}
|
|
84188
84188
|
matchEmit(e) {
|
|
84189
84189
|
this.matches.add(e);
|
|
@@ -84220,8 +84220,8 @@ var GlobWalker = class extends GlobUtil {
|
|
|
84220
84220
|
};
|
|
84221
84221
|
var GlobStream = class extends GlobUtil {
|
|
84222
84222
|
results;
|
|
84223
|
-
constructor(patterns,
|
|
84224
|
-
super(patterns,
|
|
84223
|
+
constructor(patterns, path25, opts) {
|
|
84224
|
+
super(patterns, path25, opts);
|
|
84225
84225
|
this.results = new Minipass({
|
|
84226
84226
|
signal: this.signal,
|
|
84227
84227
|
objectMode: true
|
|
@@ -84703,8 +84703,8 @@ var CsvManager = class {
|
|
|
84703
84703
|
/**
|
|
84704
84704
|
* Set nested value in object using dot notation (e.g., "parent.child.key")
|
|
84705
84705
|
*/
|
|
84706
|
-
setNestedValue(obj,
|
|
84707
|
-
const keys =
|
|
84706
|
+
setNestedValue(obj, path25, value2) {
|
|
84707
|
+
const keys = path25.split(".");
|
|
84708
84708
|
let current = obj;
|
|
84709
84709
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
84710
84710
|
const key = keys[i];
|
|
@@ -85811,7 +85811,7 @@ var import_xml2js = __toESM(require_xml2js());
|
|
|
85811
85811
|
var import_chalk19 = __toESM(require_source());
|
|
85812
85812
|
var import_ora5 = __toESM(require_ora());
|
|
85813
85813
|
var import_path12 = __toESM(require("path"));
|
|
85814
|
-
var
|
|
85814
|
+
var import_os2 = __toESM(require("os"));
|
|
85815
85815
|
|
|
85816
85816
|
// apps/cli/utils/csv.ts
|
|
85817
85817
|
var import_chalk17 = __toESM(require_source());
|
|
@@ -85820,6 +85820,45 @@ var import_csv_writer3 = __toESM(require_dist());
|
|
|
85820
85820
|
var import_fs_extra9 = __toESM(require_lib());
|
|
85821
85821
|
var import_path10 = __toESM(require("path"));
|
|
85822
85822
|
var CsvManager2 = class {
|
|
85823
|
+
/**
|
|
85824
|
+
* Write a standard HubDoc mapping CSV (the `;`-delimited format consumed by
|
|
85825
|
+
* readMappingFile / the `import` command). Used by the plugin-import bridge so
|
|
85826
|
+
* downloaded files round-trip into the standard importer without a delimiter
|
|
85827
|
+
* mismatch (arrayToCsv produces comma-separated output, which readMappingFile
|
|
85828
|
+
* — separator ';' — cannot parse).
|
|
85829
|
+
*/
|
|
85830
|
+
async writeStandardMapping(rows, outputPath) {
|
|
85831
|
+
const csvWriter = (0, import_csv_writer3.createObjectCsvWriter)({
|
|
85832
|
+
path: outputPath,
|
|
85833
|
+
fieldDelimiter: ";",
|
|
85834
|
+
header: [
|
|
85835
|
+
{ id: "filePath", title: "File Path" },
|
|
85836
|
+
{ id: "targetFolder", title: "Target Folder" },
|
|
85837
|
+
{ id: "workspace", title: "Workspace" },
|
|
85838
|
+
{ id: "metadata", title: "Metadata (key: value, parent.child: value)" },
|
|
85839
|
+
{ id: "permissions", title: "Permissions (users:r:email1,email2 | users:w:admin | groups:Group Name)" },
|
|
85840
|
+
{ id: "autoClassify", title: "Auto Classify" },
|
|
85841
|
+
{ id: "status", title: "Status" },
|
|
85842
|
+
{ id: "progress", title: "Progress (%)" },
|
|
85843
|
+
{ id: "error", title: "Error" },
|
|
85844
|
+
{ id: "documentId", title: "Document ID" },
|
|
85845
|
+
{ id: "bulkUploadId", title: "Bulk Upload ID" }
|
|
85846
|
+
]
|
|
85847
|
+
});
|
|
85848
|
+
await csvWriter.writeRecords(rows.map((r) => ({
|
|
85849
|
+
filePath: r.filePath,
|
|
85850
|
+
targetFolder: r.targetFolder || "",
|
|
85851
|
+
workspace: r.workspace || "",
|
|
85852
|
+
metadata: r.metadata || "",
|
|
85853
|
+
permissions: r.permissions || "",
|
|
85854
|
+
autoClassify: "false",
|
|
85855
|
+
status: "pending",
|
|
85856
|
+
progress: "0",
|
|
85857
|
+
error: "",
|
|
85858
|
+
documentId: "",
|
|
85859
|
+
bulkUploadId: ""
|
|
85860
|
+
})));
|
|
85861
|
+
}
|
|
85823
85862
|
async generateMappingFile(sourceDir, outputPath = "mapping.csv") {
|
|
85824
85863
|
const files2 = await this.getAllFiles(sourceDir);
|
|
85825
85864
|
const mappingData = files2.map((filePath) => ({
|
|
@@ -85995,8 +86034,8 @@ var CsvManager2 = class {
|
|
|
85995
86034
|
/**
|
|
85996
86035
|
* Set nested value in object using dot notation (e.g., "parent.child.key")
|
|
85997
86036
|
*/
|
|
85998
|
-
setNestedValue(obj,
|
|
85999
|
-
const keys =
|
|
86037
|
+
setNestedValue(obj, path25, value2) {
|
|
86038
|
+
const keys = path25.split(".");
|
|
86000
86039
|
let current = obj;
|
|
86001
86040
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
86002
86041
|
const key = keys[i];
|
|
@@ -86116,7 +86155,8 @@ var CsvManager2 = class {
|
|
|
86116
86155
|
return new Promise((resolve, reject) => {
|
|
86117
86156
|
const results = [];
|
|
86118
86157
|
import_fs_extra9.default.createReadStream(filePath).pipe((0, import_csv_parser3.default)({
|
|
86119
|
-
|
|
86158
|
+
// Plugin mapping is written comma-separated by arrayToCsv(); read it the same way.
|
|
86159
|
+
separator: ",",
|
|
86120
86160
|
mapHeaders: ({ header }) => header.trim()
|
|
86121
86161
|
})).on("data", (data) => results.push(data)).on("end", () => resolve(results)).on("error", reject);
|
|
86122
86162
|
});
|
|
@@ -86279,12 +86319,37 @@ var CsvManager2 = class {
|
|
|
86279
86319
|
var import_chalk18 = __toESM(require_source());
|
|
86280
86320
|
var import_fs_extra10 = __toESM(require_lib());
|
|
86281
86321
|
var import_path11 = __toESM(require("path"));
|
|
86322
|
+
var import_os = __toESM(require("os"));
|
|
86282
86323
|
var PluginManager2 = class {
|
|
86283
|
-
constructor(pluginsDir = "./plugins") {
|
|
86324
|
+
constructor(pluginsDir = "./plugins", connectionsFile) {
|
|
86284
86325
|
this.plugins = /* @__PURE__ */ new Map();
|
|
86285
86326
|
this.connections = /* @__PURE__ */ new Map();
|
|
86286
86327
|
this.tsNodeRegistered = false;
|
|
86287
86328
|
this.pluginsDir = import_path11.default.resolve(pluginsDir);
|
|
86329
|
+
this.connectionsFile = connectionsFile ?? process.env.HUBDOC_CONNECTIONS_FILE ?? import_path11.default.join(import_os.default.homedir(), ".hubdoc-connections.json");
|
|
86330
|
+
this.loadConnections();
|
|
86331
|
+
}
|
|
86332
|
+
/** Load persisted connections from disk (best-effort; ignores a missing/corrupt store). */
|
|
86333
|
+
loadConnections() {
|
|
86334
|
+
try {
|
|
86335
|
+
if (import_fs_extra10.default.existsSync(this.connectionsFile)) {
|
|
86336
|
+
const list = import_fs_extra10.default.readJsonSync(this.connectionsFile);
|
|
86337
|
+
for (const c of list) this.connections.set(c.id, c);
|
|
86338
|
+
}
|
|
86339
|
+
} catch {
|
|
86340
|
+
}
|
|
86341
|
+
}
|
|
86342
|
+
/** Persist the current connections to disk. */
|
|
86343
|
+
saveConnections() {
|
|
86344
|
+
try {
|
|
86345
|
+
import_fs_extra10.default.writeJsonSync(
|
|
86346
|
+
this.connectionsFile,
|
|
86347
|
+
Array.from(this.connections.values()),
|
|
86348
|
+
{ spaces: 2 }
|
|
86349
|
+
);
|
|
86350
|
+
} catch (e) {
|
|
86351
|
+
console.error(import_chalk18.default.yellow(`\u26A0\uFE0F Could not persist connections: ${e.message}`));
|
|
86352
|
+
}
|
|
86288
86353
|
}
|
|
86289
86354
|
/**
|
|
86290
86355
|
* Register ts-node to allow loading TypeScript files
|
|
@@ -86428,6 +86493,7 @@ var PluginManager2 = class {
|
|
|
86428
86493
|
if (isConnected) {
|
|
86429
86494
|
await plugin.plugin.initialize(config);
|
|
86430
86495
|
this.connections.set(id, connection);
|
|
86496
|
+
this.saveConnections();
|
|
86431
86497
|
console.log(import_chalk18.default.green(`\u2705 Connection established: ${name}`));
|
|
86432
86498
|
} else {
|
|
86433
86499
|
console.error(import_chalk18.default.red(`\u274C Failed to connect: ${name}`));
|
|
@@ -86458,6 +86524,7 @@ var PluginManager2 = class {
|
|
|
86458
86524
|
await plugin.plugin.destroy();
|
|
86459
86525
|
}
|
|
86460
86526
|
this.connections.delete(id);
|
|
86527
|
+
this.saveConnections();
|
|
86461
86528
|
console.log(import_chalk18.default.blue(`\u{1F5D1}\uFE0F Connection removed: ${connection.name}`));
|
|
86462
86529
|
}
|
|
86463
86530
|
}
|
|
@@ -86632,7 +86699,7 @@ var PluginImportService = class {
|
|
|
86632
86699
|
lastModified: /* @__PURE__ */ new Date(),
|
|
86633
86700
|
metadata: mapping.metadata
|
|
86634
86701
|
}));
|
|
86635
|
-
const workingDir = tempDir || import_path12.default.join(
|
|
86702
|
+
const workingDir = tempDir || import_path12.default.join(import_os2.default.tmpdir(), "hubdoc-tools", "plugin-import");
|
|
86636
86703
|
const downloadSpinner = (0, import_ora5.default)(`Downloading ${sources.length} files from ${connection.name}...`).start();
|
|
86637
86704
|
const importResults = await plugin.plugin.import(
|
|
86638
86705
|
connection.config,
|
|
@@ -86680,11 +86747,11 @@ var PluginImportService = class {
|
|
|
86680
86747
|
sourceSize: source.size,
|
|
86681
86748
|
sourceMimeType: source.mimeType,
|
|
86682
86749
|
sourceLastModified: source.lastModified.toISOString(),
|
|
86683
|
-
|
|
86684
|
-
|
|
86750
|
+
// Pre-fill from the source's classification when the plugin provides it; still editable.
|
|
86751
|
+
targetFolder: source.targetFolder || "",
|
|
86685
86752
|
workspace: "",
|
|
86686
86753
|
// To be filled by user
|
|
86687
|
-
domain: "",
|
|
86754
|
+
domain: source.domain || "",
|
|
86688
86755
|
planClassement: "",
|
|
86689
86756
|
metadata: source.metadata ? JSON.stringify(source.metadata) : "",
|
|
86690
86757
|
readPermissions: "",
|
|
@@ -86731,30 +86798,21 @@ var PluginImportService = class {
|
|
|
86731
86798
|
* Create HubDoc-compatible mapping from plugin results
|
|
86732
86799
|
*/
|
|
86733
86800
|
async createHubDocMapping(importResults, originalMappings, outputFile) {
|
|
86734
|
-
const
|
|
86801
|
+
const rows = importResults.map((result) => {
|
|
86735
86802
|
const originalMapping = originalMappings.find((m) => m.sourceId === result.source.id);
|
|
86803
|
+
const permParts = [];
|
|
86804
|
+
if (originalMapping?.readPermissions) permParts.push(originalMapping.readPermissions);
|
|
86805
|
+
if (originalMapping?.writePermissions) permParts.push(originalMapping.writePermissions);
|
|
86736
86806
|
return {
|
|
86737
86807
|
filePath: result.localPath || "",
|
|
86738
86808
|
targetFolder: originalMapping?.targetFolder || "",
|
|
86739
86809
|
workspace: originalMapping?.workspace || "",
|
|
86740
|
-
|
|
86741
|
-
planClassement: originalMapping?.planClassement || "",
|
|
86810
|
+
// parseMetadata accepts legacy JSON, so the rich plugin metadata survives.
|
|
86742
86811
|
metadata: originalMapping?.metadata ? JSON.stringify(originalMapping.metadata) : "",
|
|
86743
|
-
|
|
86744
|
-
writePermissions: originalMapping?.writePermissions || ""
|
|
86812
|
+
permissions: permParts.join(" | ")
|
|
86745
86813
|
};
|
|
86746
86814
|
});
|
|
86747
|
-
|
|
86748
|
-
{ id: "filePath", title: "File Path" },
|
|
86749
|
-
{ id: "targetFolder", title: "Target Folder" },
|
|
86750
|
-
{ id: "workspace", title: "Workspace" },
|
|
86751
|
-
{ id: "domain", title: "Domain" },
|
|
86752
|
-
{ id: "planClassement", title: "Plan Classement" },
|
|
86753
|
-
{ id: "metadata", title: "Metadata (JSON)" },
|
|
86754
|
-
{ id: "readPermissions", title: "Read Permissions (users:user1,user2|groups:group1,group2)" },
|
|
86755
|
-
{ id: "writePermissions", title: "Write Permissions (users:user1,user2|groups:group1,group2)" }
|
|
86756
|
-
]);
|
|
86757
|
-
await this.csvManager.writeCsv(outputFile, csvContent);
|
|
86815
|
+
await this.csvManager.writeStandardMapping(rows, outputFile);
|
|
86758
86816
|
}
|
|
86759
86817
|
/**
|
|
86760
86818
|
* Group mappings by connection ID
|
|
@@ -87141,7 +87199,7 @@ async function handlePluginImport(mappingFile, options) {
|
|
|
87141
87199
|
}
|
|
87142
87200
|
|
|
87143
87201
|
// apps/cli/cli/handlers/auth-handlers.ts
|
|
87144
|
-
var
|
|
87202
|
+
var import_os5 = __toESM(require("os"));
|
|
87145
87203
|
var import_path15 = __toESM(require("path"));
|
|
87146
87204
|
var import_fs_extra13 = __toESM(require_lib());
|
|
87147
87205
|
var import_chalk24 = __toESM(require_source());
|
|
@@ -87183,8 +87241,8 @@ function truncate(value2, max) {
|
|
|
87183
87241
|
if (!max || value2.length <= max) return value2;
|
|
87184
87242
|
return value2.slice(0, max - 1) + "\u2026";
|
|
87185
87243
|
}
|
|
87186
|
-
function get(obj,
|
|
87187
|
-
return
|
|
87244
|
+
function get(obj, path25) {
|
|
87245
|
+
return path25.split(".").reduce((acc, k) => acc == null ? acc : acc[k], obj);
|
|
87188
87246
|
}
|
|
87189
87247
|
function printTable(rows, columns) {
|
|
87190
87248
|
if (!rows || rows.length === 0) {
|
|
@@ -87286,7 +87344,7 @@ function output(opts) {
|
|
|
87286
87344
|
}
|
|
87287
87345
|
|
|
87288
87346
|
// apps/cli/cli/llm/api-context.ts
|
|
87289
|
-
var
|
|
87347
|
+
var import_os3 = __toESM(require("os"));
|
|
87290
87348
|
|
|
87291
87349
|
// apps/cli/api/configuration.ts
|
|
87292
87350
|
var Configuration2 = class {
|
|
@@ -87396,7 +87454,7 @@ async function resolveToken(config) {
|
|
|
87396
87454
|
return null;
|
|
87397
87455
|
}
|
|
87398
87456
|
async function buildApiContext(out) {
|
|
87399
|
-
const globalConfig = await new ConfigManager(
|
|
87457
|
+
const globalConfig = await new ConfigManager(import_os3.default.homedir()).loadConfig();
|
|
87400
87458
|
const cwdConfig = await new ConfigManager().loadConfig();
|
|
87401
87459
|
const config = cwdConfig ?? globalConfig;
|
|
87402
87460
|
if (!config || !config.apiUrl) {
|
|
@@ -87426,7 +87484,7 @@ async function buildApiContext(out) {
|
|
|
87426
87484
|
}
|
|
87427
87485
|
|
|
87428
87486
|
// apps/cli/services/device-auth-service.ts
|
|
87429
|
-
var
|
|
87487
|
+
var import_os4 = __toESM(require("os"));
|
|
87430
87488
|
var DEVICE_START_PATH = "/api/v1/cli/auth/device";
|
|
87431
87489
|
var DEVICE_POLL_PATH = "/api/v1/cli/auth/device/poll";
|
|
87432
87490
|
var defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -87439,7 +87497,7 @@ var DeviceAuthService = class {
|
|
|
87439
87497
|
Accept: "application/json",
|
|
87440
87498
|
// The parenthetical platform is what the backend uses to name the
|
|
87441
87499
|
// generated PAT ("hubdoc-cli (darwin)"), via CliSession#pat_name_for.
|
|
87442
|
-
"User-Agent": `hubdoc-cli/${version} (${
|
|
87500
|
+
"User-Agent": `hubdoc-cli/${version} (${import_os4.default.platform()})`
|
|
87443
87501
|
}
|
|
87444
87502
|
});
|
|
87445
87503
|
}
|
|
@@ -87586,7 +87644,7 @@ async function handleTokenSet(token2, opts) {
|
|
|
87586
87644
|
out.fail(new Error("Token cannot be empty"));
|
|
87587
87645
|
}
|
|
87588
87646
|
const trimmed = token2.trim();
|
|
87589
|
-
const configManager = new ConfigManager(
|
|
87647
|
+
const configManager = new ConfigManager(import_os5.default.homedir());
|
|
87590
87648
|
const existing = await configManager.loadConfig() || {};
|
|
87591
87649
|
const apiUrl = opts.apiUrl || existing.apiUrl || process.env.HUBDOC_API_URL || "http://localhost:3000";
|
|
87592
87650
|
if (opts.keychain) {
|
|
@@ -87626,14 +87684,14 @@ async function handleTokenSet(token2, opts) {
|
|
|
87626
87684
|
await configManager.saveConfig(next);
|
|
87627
87685
|
out.ok("Token saved", { apiUrl, storage: "config", tokenLength: trimmed.length });
|
|
87628
87686
|
}
|
|
87629
|
-
var DEVICE_SESSION_FILE = import_path15.default.join(
|
|
87687
|
+
var DEVICE_SESSION_FILE = import_path15.default.join(import_os5.default.homedir(), ".hubdoc-tools", "device-session.json");
|
|
87630
87688
|
async function resolveApiUrl(opts) {
|
|
87631
87689
|
if (opts.apiUrl) return opts.apiUrl;
|
|
87632
|
-
const config = await new ConfigManager(
|
|
87690
|
+
const config = await new ConfigManager(import_os5.default.homedir()).loadConfig();
|
|
87633
87691
|
return config?.apiUrl || process.env.HUBDOC_API_URL;
|
|
87634
87692
|
}
|
|
87635
87693
|
async function persistDeviceToken(apiUrl, token2) {
|
|
87636
|
-
const configManager = new ConfigManager(
|
|
87694
|
+
const configManager = new ConfigManager(import_os5.default.homedir());
|
|
87637
87695
|
const existing = await configManager.loadConfig() || {};
|
|
87638
87696
|
const next = {
|
|
87639
87697
|
...existing,
|
|
@@ -87763,7 +87821,7 @@ async function handleTokenOpen(opts) {
|
|
|
87763
87821
|
const out = output(opts);
|
|
87764
87822
|
let apiUrl = opts.apiUrl || process.env.HUBDOC_API_URL;
|
|
87765
87823
|
if (!apiUrl) {
|
|
87766
|
-
const configManager = new ConfigManager(
|
|
87824
|
+
const configManager = new ConfigManager(import_os5.default.homedir());
|
|
87767
87825
|
const config = await configManager.loadConfig();
|
|
87768
87826
|
apiUrl = config?.apiUrl;
|
|
87769
87827
|
}
|
|
@@ -87783,7 +87841,7 @@ async function handleTokenOpen(opts) {
|
|
|
87783
87841
|
}
|
|
87784
87842
|
|
|
87785
87843
|
// apps/cli/cli/handlers/skill-handlers.ts
|
|
87786
|
-
var
|
|
87844
|
+
var import_os6 = __toESM(require("os"));
|
|
87787
87845
|
var import_path16 = __toESM(require("path"));
|
|
87788
87846
|
var import_fs_extra14 = __toESM(require_lib());
|
|
87789
87847
|
|
|
@@ -87888,7 +87946,7 @@ so you can relay the code before blocking.
|
|
|
87888
87946
|
function resolveSkillsDir(opts) {
|
|
87889
87947
|
if (opts.path) return import_path16.default.resolve(opts.path);
|
|
87890
87948
|
if (opts.project) return import_path16.default.join(process.cwd(), ".claude", "skills");
|
|
87891
|
-
return import_path16.default.join(
|
|
87949
|
+
return import_path16.default.join(import_os6.default.homedir(), ".claude", "skills");
|
|
87892
87950
|
}
|
|
87893
87951
|
async function handleSkillInstall(opts) {
|
|
87894
87952
|
const out = output(opts);
|
|
@@ -89097,6 +89155,520 @@ async function handleSearch(query, opts) {
|
|
|
89097
89155
|
}
|
|
89098
89156
|
}
|
|
89099
89157
|
|
|
89158
|
+
// apps/cli/cli/handlers/mount-handlers.ts
|
|
89159
|
+
var import_chalk26 = __toESM(require_source());
|
|
89160
|
+
|
|
89161
|
+
// apps/cli/cli/fuse/hubdoc-fs.ts
|
|
89162
|
+
var import_fs_extra16 = __toESM(require_lib());
|
|
89163
|
+
var import_os7 = __toESM(require("os"));
|
|
89164
|
+
var import_path18 = __toESM(require("path"));
|
|
89165
|
+
var import_crypto2 = __toESM(require("crypto"));
|
|
89166
|
+
var import_form_data4 = __toESM(require_form_data());
|
|
89167
|
+
var DIR_MODE = 16877;
|
|
89168
|
+
var FILE_MODE = 33188;
|
|
89169
|
+
var HubdocFs = class {
|
|
89170
|
+
constructor(ctx, root, opts = {}) {
|
|
89171
|
+
this.ctx = ctx;
|
|
89172
|
+
this.root = root;
|
|
89173
|
+
this.opts = opts;
|
|
89174
|
+
this.nodes = /* @__PURE__ */ new Map();
|
|
89175
|
+
this.handles = /* @__PURE__ */ new Map();
|
|
89176
|
+
this.nextFd = 10;
|
|
89177
|
+
this.fuse = null;
|
|
89178
|
+
this.ttlMs = opts.ttlMs ?? 3e4;
|
|
89179
|
+
const host = (() => {
|
|
89180
|
+
try {
|
|
89181
|
+
return new URL(ctx.baseUrl).host;
|
|
89182
|
+
} catch {
|
|
89183
|
+
return "instance";
|
|
89184
|
+
}
|
|
89185
|
+
})();
|
|
89186
|
+
this.cacheDir = opts.cacheDir ?? import_path18.default.join(
|
|
89187
|
+
process.env.XDG_CACHE_HOME || import_path18.default.join(import_os7.default.homedir(), ".cache"),
|
|
89188
|
+
"hubdoc-mount",
|
|
89189
|
+
host
|
|
89190
|
+
);
|
|
89191
|
+
import_fs_extra16.default.ensureDirSync(this.cacheDir);
|
|
89192
|
+
this.nodes.set("/", this.rootNode());
|
|
89193
|
+
}
|
|
89194
|
+
// --- node model ----------------------------------------------------------
|
|
89195
|
+
rootNode() {
|
|
89196
|
+
const now = /* @__PURE__ */ new Date();
|
|
89197
|
+
if (this.root.mode === "workspace") {
|
|
89198
|
+
return { kind: "dir", hub: "workspace", name: "/", id: this.root.workspaceId, workspaceId: this.root.workspaceId, size: 0, mtime: now };
|
|
89199
|
+
}
|
|
89200
|
+
if (this.root.mode === "folder") {
|
|
89201
|
+
return { kind: "dir", hub: "folder", name: "/", id: this.root.folderId, workspaceId: this.root.workspaceId, folderId: this.root.folderId, size: 0, mtime: now };
|
|
89202
|
+
}
|
|
89203
|
+
return { kind: "dir", hub: "root", name: "/", size: 0, mtime: now };
|
|
89204
|
+
}
|
|
89205
|
+
log(...args) {
|
|
89206
|
+
if (this.opts.verbose) console.error("[mount]", ...args);
|
|
89207
|
+
}
|
|
89208
|
+
fresh(node) {
|
|
89209
|
+
return node.loadedAt !== void 0 && Date.now() - node.loadedAt < this.ttlMs;
|
|
89210
|
+
}
|
|
89211
|
+
/** Resolve a fuse path to a node, lazily loading ancestors as needed. */
|
|
89212
|
+
async resolve(p) {
|
|
89213
|
+
if (p === "/") return this.nodes.get("/");
|
|
89214
|
+
const segments = p.split("/").filter(Boolean);
|
|
89215
|
+
let curPath = "";
|
|
89216
|
+
let node = this.nodes.get("/");
|
|
89217
|
+
for (const seg of segments) {
|
|
89218
|
+
if (node.kind !== "dir") return null;
|
|
89219
|
+
await this.ensureChildren(node, curPath || "/");
|
|
89220
|
+
const childPath = (curPath || "") + "/" + seg;
|
|
89221
|
+
const child = this.nodes.get(childPath);
|
|
89222
|
+
if (!child) return null;
|
|
89223
|
+
node = child;
|
|
89224
|
+
curPath = childPath;
|
|
89225
|
+
}
|
|
89226
|
+
return node;
|
|
89227
|
+
}
|
|
89228
|
+
/** Populate a directory node's children from the API (respecting the TTL). */
|
|
89229
|
+
async ensureChildren(node, nodePath) {
|
|
89230
|
+
if (node.kind !== "dir") return;
|
|
89231
|
+
if (node.children && this.fresh(node)) return;
|
|
89232
|
+
const children2 = /* @__PURE__ */ new Map();
|
|
89233
|
+
const base = nodePath === "/" ? "" : nodePath;
|
|
89234
|
+
if (node.hub === "root") {
|
|
89235
|
+
const ws = await this.listWorkspaces();
|
|
89236
|
+
for (const w of ws) {
|
|
89237
|
+
const name = this.uniqueName(children2, w.label || w.id);
|
|
89238
|
+
const childPath = base + "/" + name;
|
|
89239
|
+
this.nodes.set(childPath, {
|
|
89240
|
+
kind: "dir",
|
|
89241
|
+
hub: "workspace",
|
|
89242
|
+
name,
|
|
89243
|
+
id: w.id,
|
|
89244
|
+
workspaceId: w.id,
|
|
89245
|
+
size: 0,
|
|
89246
|
+
mtime: parseDate(w.updated_at)
|
|
89247
|
+
});
|
|
89248
|
+
children2.set(name, childPath);
|
|
89249
|
+
}
|
|
89250
|
+
} else {
|
|
89251
|
+
const ws = node.workspaceId;
|
|
89252
|
+
const folderId = node.hub === "folder" ? node.folderId : void 0;
|
|
89253
|
+
const folders2 = await this.listFolders(ws, folderId);
|
|
89254
|
+
for (const f of folders2) {
|
|
89255
|
+
const name = this.uniqueName(children2, f.name);
|
|
89256
|
+
const childPath = base + "/" + name;
|
|
89257
|
+
this.nodes.set(childPath, {
|
|
89258
|
+
kind: "dir",
|
|
89259
|
+
hub: "folder",
|
|
89260
|
+
name,
|
|
89261
|
+
id: f.id,
|
|
89262
|
+
workspaceId: f.workspace_id || ws,
|
|
89263
|
+
folderId: f.id,
|
|
89264
|
+
size: 0,
|
|
89265
|
+
mtime: parseDate(f.updated_at)
|
|
89266
|
+
});
|
|
89267
|
+
children2.set(name, childPath);
|
|
89268
|
+
}
|
|
89269
|
+
const docs = await this.listDocuments(ws, folderId);
|
|
89270
|
+
for (const d of docs) {
|
|
89271
|
+
const name = this.uniqueName(children2, d.name);
|
|
89272
|
+
const childPath = base + "/" + name;
|
|
89273
|
+
const existing = this.nodes.get(childPath);
|
|
89274
|
+
this.nodes.set(childPath, {
|
|
89275
|
+
kind: "file",
|
|
89276
|
+
hub: "file",
|
|
89277
|
+
name,
|
|
89278
|
+
id: d.id,
|
|
89279
|
+
workspaceId: d.workspace_id || ws,
|
|
89280
|
+
folderId: d.documents_folder_id || folderId,
|
|
89281
|
+
size: d.byte_size ?? d.file_size ?? existing?.size ?? 0,
|
|
89282
|
+
mtime: parseDate(d.updated_at),
|
|
89283
|
+
// keep a still-valid local cache across refreshes
|
|
89284
|
+
cachePath: existing?.cachePath,
|
|
89285
|
+
downloaded: existing?.downloaded
|
|
89286
|
+
});
|
|
89287
|
+
children2.set(name, childPath);
|
|
89288
|
+
}
|
|
89289
|
+
}
|
|
89290
|
+
node.children = children2;
|
|
89291
|
+
node.loadedAt = Date.now();
|
|
89292
|
+
}
|
|
89293
|
+
uniqueName(children2, raw) {
|
|
89294
|
+
const safe = (raw || "sans-nom").replace(/\//g, "\u2215");
|
|
89295
|
+
if (!children2.has(safe)) return safe;
|
|
89296
|
+
const ext2 = import_path18.default.extname(safe);
|
|
89297
|
+
const stem = safe.slice(0, safe.length - ext2.length);
|
|
89298
|
+
let i = 2;
|
|
89299
|
+
while (children2.has(`${stem} (${i})${ext2}`)) i++;
|
|
89300
|
+
return `${stem} (${i})${ext2}`;
|
|
89301
|
+
}
|
|
89302
|
+
// --- API helpers (all via the shared axios, relative /api/v1 paths) -------
|
|
89303
|
+
async listWorkspaces() {
|
|
89304
|
+
const res = await this.ctx.axios.get("/api/v1/documents/workspaces", { params: { per_page: 1e3 } });
|
|
89305
|
+
return res.data;
|
|
89306
|
+
}
|
|
89307
|
+
async listFolders(workspaceId, parentFolderId) {
|
|
89308
|
+
const res = await this.ctx.axios.get("/api/v1/documents/folders", {
|
|
89309
|
+
params: { workspace_id: workspaceId, documents_folder_id: parentFolderId, per_page: 1e3 }
|
|
89310
|
+
});
|
|
89311
|
+
const all3 = res.data;
|
|
89312
|
+
return all3.filter((f) => (f.documents_folder_id ?? null) === (parentFolderId ?? null));
|
|
89313
|
+
}
|
|
89314
|
+
async listDocuments(workspaceId, folderId) {
|
|
89315
|
+
const res = await this.ctx.axios.get("/api/v1/documents/documents", {
|
|
89316
|
+
params: { workspace_id: workspaceId, documents_folder_id: folderId, per_page: 1e3 }
|
|
89317
|
+
});
|
|
89318
|
+
const all3 = res.data;
|
|
89319
|
+
return all3.filter((d) => (d.documents_folder_id ?? null) === (folderId ?? null));
|
|
89320
|
+
}
|
|
89321
|
+
cacheFileFor(node) {
|
|
89322
|
+
if (!node.cachePath) {
|
|
89323
|
+
const key = node.id || import_crypto2.default.randomBytes(8).toString("hex");
|
|
89324
|
+
node.cachePath = import_path18.default.join(this.cacheDir, key);
|
|
89325
|
+
}
|
|
89326
|
+
return node.cachePath;
|
|
89327
|
+
}
|
|
89328
|
+
async download(node) {
|
|
89329
|
+
if (node.downloaded && node.cachePath && await import_fs_extra16.default.pathExists(node.cachePath)) return;
|
|
89330
|
+
const dest = this.cacheFileFor(node);
|
|
89331
|
+
const res = await this.ctx.axios.get(`/api/v1/documents/documents/${node.id}/blob`, { responseType: "stream" });
|
|
89332
|
+
await new Promise((resolve, reject) => {
|
|
89333
|
+
const w = import_fs_extra16.default.createWriteStream(dest);
|
|
89334
|
+
res.data.pipe(w);
|
|
89335
|
+
w.on("finish", () => resolve());
|
|
89336
|
+
w.on("error", reject);
|
|
89337
|
+
res.data.on("error", reject);
|
|
89338
|
+
});
|
|
89339
|
+
node.downloaded = true;
|
|
89340
|
+
node.size = (await import_fs_extra16.default.stat(dest)).size;
|
|
89341
|
+
}
|
|
89342
|
+
async uploadNew(node) {
|
|
89343
|
+
const local = this.cacheFileFor(node);
|
|
89344
|
+
const form = new import_form_data4.default();
|
|
89345
|
+
form.append("uploaded_file", import_fs_extra16.default.createReadStream(local), {
|
|
89346
|
+
filename: node.name,
|
|
89347
|
+
contentType: "application/octet-stream"
|
|
89348
|
+
});
|
|
89349
|
+
if (node.folderId) form.append("documents_folder_id", node.folderId);
|
|
89350
|
+
else if (node.workspaceId) form.append("workspace_id", node.workspaceId);
|
|
89351
|
+
if (node.name.toLowerCase().endsWith(".md")) {
|
|
89352
|
+
this.log(`\u26A0\uFE0F ${node.name}: write-back markdown \u2014 voir caveat collab #508`);
|
|
89353
|
+
}
|
|
89354
|
+
const res = await this.ctx.axios.post("/api/v1/documents/documents", form, {
|
|
89355
|
+
headers: form.getHeaders(),
|
|
89356
|
+
maxBodyLength: Infinity,
|
|
89357
|
+
maxContentLength: Infinity
|
|
89358
|
+
});
|
|
89359
|
+
const created = res.data?.document ?? res.data;
|
|
89360
|
+
if (created?.id) node.id = created.id;
|
|
89361
|
+
node.isNew = false;
|
|
89362
|
+
node.size = (await import_fs_extra16.default.stat(local)).size;
|
|
89363
|
+
}
|
|
89364
|
+
async uploadUpdate(node) {
|
|
89365
|
+
const local = this.cacheFileFor(node);
|
|
89366
|
+
const form = new import_form_data4.default();
|
|
89367
|
+
form.append("uploaded_file", import_fs_extra16.default.createReadStream(local), {
|
|
89368
|
+
filename: node.name,
|
|
89369
|
+
contentType: "application/octet-stream"
|
|
89370
|
+
});
|
|
89371
|
+
await this.ctx.axios.patch(`/api/v1/documents/documents/${node.id}`, form, {
|
|
89372
|
+
headers: form.getHeaders(),
|
|
89373
|
+
maxBodyLength: Infinity,
|
|
89374
|
+
maxContentLength: Infinity
|
|
89375
|
+
});
|
|
89376
|
+
node.size = (await import_fs_extra16.default.stat(local)).size;
|
|
89377
|
+
}
|
|
89378
|
+
invalidateParent(p) {
|
|
89379
|
+
const parent = this.nodes.get(parentPath(p));
|
|
89380
|
+
if (parent) parent.loadedAt = 0;
|
|
89381
|
+
}
|
|
89382
|
+
// --- FUSE ops ------------------------------------------------------------
|
|
89383
|
+
ops() {
|
|
89384
|
+
const Fuse = this.fuse;
|
|
89385
|
+
const ro = !!this.opts.readOnly;
|
|
89386
|
+
const uid = process.getuid ? process.getuid() : 0;
|
|
89387
|
+
const gid = process.getgid ? process.getgid() : 0;
|
|
89388
|
+
const wrap = (fn) => (...args) => {
|
|
89389
|
+
const cb = args[args.length - 1];
|
|
89390
|
+
fn(...args).catch((err) => {
|
|
89391
|
+
this.log("op error", err?.message || err);
|
|
89392
|
+
cb(typeof err?.errno === "number" ? err.errno : Fuse.EIO);
|
|
89393
|
+
});
|
|
89394
|
+
};
|
|
89395
|
+
return {
|
|
89396
|
+
init: (cb) => cb(0),
|
|
89397
|
+
getattr: wrap(async (p, cb) => {
|
|
89398
|
+
const node = await this.resolve(p);
|
|
89399
|
+
if (!node) return cb(Fuse.ENOENT);
|
|
89400
|
+
const isDir = node.kind === "dir";
|
|
89401
|
+
cb(0, {
|
|
89402
|
+
mtime: node.mtime,
|
|
89403
|
+
atime: node.mtime,
|
|
89404
|
+
ctime: node.mtime,
|
|
89405
|
+
size: isDir ? 4096 : node.size,
|
|
89406
|
+
mode: isDir ? DIR_MODE : FILE_MODE,
|
|
89407
|
+
uid,
|
|
89408
|
+
gid,
|
|
89409
|
+
nlink: 1,
|
|
89410
|
+
blocks: Math.ceil((isDir ? 4096 : node.size) / 512)
|
|
89411
|
+
});
|
|
89412
|
+
}),
|
|
89413
|
+
readdir: wrap(async (p, cb) => {
|
|
89414
|
+
const node = await this.resolve(p);
|
|
89415
|
+
if (!node) return cb(Fuse.ENOENT);
|
|
89416
|
+
if (node.kind !== "dir") return cb(Fuse.ENOTDIR);
|
|
89417
|
+
await this.ensureChildren(node, p);
|
|
89418
|
+
cb(0, [".", "..", ...Array.from(node.children.keys())]);
|
|
89419
|
+
}),
|
|
89420
|
+
open: wrap(async (p, flags, cb) => {
|
|
89421
|
+
const node = await this.resolve(p);
|
|
89422
|
+
if (!node) return cb(Fuse.ENOENT);
|
|
89423
|
+
if (node.kind !== "file") return cb(Fuse.EISDIR);
|
|
89424
|
+
const write = (flags & 3) !== 0;
|
|
89425
|
+
if (write && ro) return cb(Fuse.EACCES);
|
|
89426
|
+
if (node.id) await this.download(node);
|
|
89427
|
+
const localFd = await import_fs_extra16.default.open(this.cacheFileFor(node), "r+").catch(async () => import_fs_extra16.default.open(this.cacheFileFor(node), "w+"));
|
|
89428
|
+
const fd = this.nextFd++;
|
|
89429
|
+
this.handles.set(fd, { node, localFd, write });
|
|
89430
|
+
cb(0, fd);
|
|
89431
|
+
}),
|
|
89432
|
+
read: wrap(async (_p, fd, buf, len, pos, cb) => {
|
|
89433
|
+
const h = this.handles.get(fd);
|
|
89434
|
+
if (!h) return cb(Fuse.EBADF);
|
|
89435
|
+
const { bytesRead } = await import_fs_extra16.default.read(h.localFd, buf, 0, len, pos);
|
|
89436
|
+
cb(bytesRead);
|
|
89437
|
+
}),
|
|
89438
|
+
write: wrap(async (_p, fd, buf, len, pos, cb) => {
|
|
89439
|
+
if (ro) return cb(Fuse.EACCES);
|
|
89440
|
+
const h = this.handles.get(fd);
|
|
89441
|
+
if (!h) return cb(Fuse.EBADF);
|
|
89442
|
+
const { bytesWritten } = await import_fs_extra16.default.write(h.localFd, buf, 0, len, pos);
|
|
89443
|
+
h.node.dirty = true;
|
|
89444
|
+
cb(bytesWritten);
|
|
89445
|
+
}),
|
|
89446
|
+
truncate: wrap(async (p, size, cb) => {
|
|
89447
|
+
if (ro) return cb(Fuse.EACCES);
|
|
89448
|
+
const node = await this.resolve(p);
|
|
89449
|
+
if (!node || node.kind !== "file") return cb(Fuse.ENOENT);
|
|
89450
|
+
if (node.id) await this.download(node);
|
|
89451
|
+
await import_fs_extra16.default.truncate(this.cacheFileFor(node), size);
|
|
89452
|
+
node.dirty = true;
|
|
89453
|
+
node.size = size;
|
|
89454
|
+
cb(0);
|
|
89455
|
+
}),
|
|
89456
|
+
create: wrap(async (p, _mode, cb) => {
|
|
89457
|
+
if (ro) return cb(Fuse.EACCES);
|
|
89458
|
+
const parent = await this.resolve(parentPath(p));
|
|
89459
|
+
if (!parent || parent.kind !== "dir") return cb(Fuse.ENOENT);
|
|
89460
|
+
if (parent.hub === "root") return cb(Fuse.EPERM);
|
|
89461
|
+
const name = import_path18.default.basename(p);
|
|
89462
|
+
const node = {
|
|
89463
|
+
kind: "file",
|
|
89464
|
+
hub: "file",
|
|
89465
|
+
name,
|
|
89466
|
+
workspaceId: parent.workspaceId,
|
|
89467
|
+
folderId: parent.hub === "folder" ? parent.folderId : void 0,
|
|
89468
|
+
size: 0,
|
|
89469
|
+
mtime: /* @__PURE__ */ new Date(),
|
|
89470
|
+
isNew: true,
|
|
89471
|
+
dirty: true,
|
|
89472
|
+
downloaded: true
|
|
89473
|
+
};
|
|
89474
|
+
await import_fs_extra16.default.writeFile(this.cacheFileFor(node), Buffer.alloc(0));
|
|
89475
|
+
this.nodes.set(p, node);
|
|
89476
|
+
parent.children?.set(name, p);
|
|
89477
|
+
const localFd = await import_fs_extra16.default.open(node.cachePath, "r+");
|
|
89478
|
+
const fd = this.nextFd++;
|
|
89479
|
+
this.handles.set(fd, { node, localFd, write: true });
|
|
89480
|
+
cb(0, fd);
|
|
89481
|
+
}),
|
|
89482
|
+
release: wrap(async (_p, fd, cb) => {
|
|
89483
|
+
const h = this.handles.get(fd);
|
|
89484
|
+
if (!h) return cb(0);
|
|
89485
|
+
this.handles.delete(fd);
|
|
89486
|
+
try {
|
|
89487
|
+
await import_fs_extra16.default.close(h.localFd);
|
|
89488
|
+
} catch {
|
|
89489
|
+
}
|
|
89490
|
+
if (h.node.dirty && !ro) {
|
|
89491
|
+
if (h.node.isNew || !h.node.id) await this.uploadNew(h.node);
|
|
89492
|
+
else await this.uploadUpdate(h.node);
|
|
89493
|
+
h.node.dirty = false;
|
|
89494
|
+
h.node.mtime = /* @__PURE__ */ new Date();
|
|
89495
|
+
}
|
|
89496
|
+
cb(0);
|
|
89497
|
+
}),
|
|
89498
|
+
flush: (_p, _fd, cb) => cb(0),
|
|
89499
|
+
fsync: (_p, _fd, _datasync, cb) => cb(0),
|
|
89500
|
+
unlink: wrap(async (p, cb) => {
|
|
89501
|
+
if (ro) return cb(Fuse.EACCES);
|
|
89502
|
+
const node = await this.resolve(p);
|
|
89503
|
+
if (!node || node.kind !== "file") return cb(Fuse.ENOENT);
|
|
89504
|
+
if (node.id) await this.ctx.axios.delete(`/api/v1/documents/documents/${node.id}`);
|
|
89505
|
+
if (node.cachePath) await import_fs_extra16.default.remove(node.cachePath).catch(() => {
|
|
89506
|
+
});
|
|
89507
|
+
this.nodes.delete(p);
|
|
89508
|
+
this.invalidateParent(p);
|
|
89509
|
+
cb(0);
|
|
89510
|
+
}),
|
|
89511
|
+
mkdir: wrap(async (p, _mode, cb) => {
|
|
89512
|
+
if (ro) return cb(Fuse.EACCES);
|
|
89513
|
+
const parent = await this.resolve(parentPath(p));
|
|
89514
|
+
if (!parent || parent.kind !== "dir" || parent.hub === "root") return cb(Fuse.EPERM);
|
|
89515
|
+
const name = import_path18.default.basename(p);
|
|
89516
|
+
const body = { name };
|
|
89517
|
+
if (parent.hub === "folder") body.documents_folder_id = parent.folderId;
|
|
89518
|
+
if (parent.workspaceId) body.workspace_id = parent.workspaceId;
|
|
89519
|
+
const res = await this.ctx.axios.post("/api/v1/documents/folders", body);
|
|
89520
|
+
const created = res.data?.folder ?? res.data;
|
|
89521
|
+
this.nodes.set(p, {
|
|
89522
|
+
kind: "dir",
|
|
89523
|
+
hub: "folder",
|
|
89524
|
+
name,
|
|
89525
|
+
id: created.id,
|
|
89526
|
+
workspaceId: parent.workspaceId,
|
|
89527
|
+
folderId: created.id,
|
|
89528
|
+
size: 0,
|
|
89529
|
+
mtime: /* @__PURE__ */ new Date()
|
|
89530
|
+
});
|
|
89531
|
+
parent.children?.set(name, p);
|
|
89532
|
+
cb(0);
|
|
89533
|
+
}),
|
|
89534
|
+
rmdir: wrap(async (p, cb) => {
|
|
89535
|
+
if (ro) return cb(Fuse.EACCES);
|
|
89536
|
+
const node = await this.resolve(p);
|
|
89537
|
+
if (!node || node.kind !== "dir") return cb(Fuse.ENOENT);
|
|
89538
|
+
if (node.hub !== "folder" || !node.id) return cb(Fuse.EPERM);
|
|
89539
|
+
await this.ctx.axios.delete(`/api/v1/documents/folders/${node.id}`);
|
|
89540
|
+
this.nodes.delete(p);
|
|
89541
|
+
this.invalidateParent(p);
|
|
89542
|
+
cb(0);
|
|
89543
|
+
}),
|
|
89544
|
+
rename: wrap(async (src, dest, cb) => {
|
|
89545
|
+
if (ro) return cb(Fuse.EACCES);
|
|
89546
|
+
const node = await this.resolve(src);
|
|
89547
|
+
if (!node) return cb(Fuse.ENOENT);
|
|
89548
|
+
const newParent = await this.resolve(parentPath(dest));
|
|
89549
|
+
if (!newParent || newParent.kind !== "dir" || newParent.hub === "root") return cb(Fuse.EPERM);
|
|
89550
|
+
const newName = import_path18.default.basename(dest);
|
|
89551
|
+
const newFolderId = newParent.hub === "folder" ? newParent.folderId : null;
|
|
89552
|
+
const resource = node.kind === "file" ? "documents" : "folders";
|
|
89553
|
+
if (!node.id) return cb(Fuse.EPERM);
|
|
89554
|
+
await this.ctx.axios.patch(`/api/v1/documents/${resource}/${node.id}`, {
|
|
89555
|
+
name: newName,
|
|
89556
|
+
documents_folder_id: newFolderId
|
|
89557
|
+
});
|
|
89558
|
+
this.nodes.delete(src);
|
|
89559
|
+
node.name = newName;
|
|
89560
|
+
node.folderId = node.kind === "file" ? newFolderId ?? void 0 : node.folderId;
|
|
89561
|
+
node.workspaceId = newParent.workspaceId;
|
|
89562
|
+
this.nodes.set(dest, node);
|
|
89563
|
+
this.invalidateParent(src);
|
|
89564
|
+
this.invalidateParent(dest);
|
|
89565
|
+
cb(0);
|
|
89566
|
+
}),
|
|
89567
|
+
// no-op metadata ops so editors/copies don't fail
|
|
89568
|
+
chmod: (_p, _m, cb) => cb(0),
|
|
89569
|
+
chown: (_p, _u, _g, cb) => cb(0),
|
|
89570
|
+
utimens: (_p, _a, _m, cb) => cb(0)
|
|
89571
|
+
};
|
|
89572
|
+
}
|
|
89573
|
+
// --- mount lifecycle -----------------------------------------------------
|
|
89574
|
+
async mount(mountPath) {
|
|
89575
|
+
let Fuse;
|
|
89576
|
+
try {
|
|
89577
|
+
Fuse = require("@cocalc/fuse-native");
|
|
89578
|
+
} catch (e) {
|
|
89579
|
+
throw new Error(
|
|
89580
|
+
"Le module natif FUSE n'est pas install\xE9. Installe-le :\n npm install @cocalc/fuse-native\n (Linux : apt install fuse3 ; macOS : macFUSE depuis https://macfuse.io)"
|
|
89581
|
+
);
|
|
89582
|
+
}
|
|
89583
|
+
this.fuse = Fuse;
|
|
89584
|
+
await import_fs_extra16.default.ensureDir(mountPath);
|
|
89585
|
+
const fuse = new Fuse(mountPath, this.ops(), {
|
|
89586
|
+
force: true,
|
|
89587
|
+
mkdir: true,
|
|
89588
|
+
displayFolder: "Hubdoc",
|
|
89589
|
+
// macOS shows the volume name in Finder
|
|
89590
|
+
...process.platform === "darwin" ? { volname: "Hubdoc" } : {}
|
|
89591
|
+
});
|
|
89592
|
+
await new Promise((resolve, reject) => fuse.mount((err) => err ? reject(err) : resolve()));
|
|
89593
|
+
const unmount = () => new Promise((resolve) => {
|
|
89594
|
+
Fuse.unmount(mountPath, () => resolve());
|
|
89595
|
+
});
|
|
89596
|
+
return unmount;
|
|
89597
|
+
}
|
|
89598
|
+
};
|
|
89599
|
+
function parentPath(p) {
|
|
89600
|
+
const parent = import_path18.default.posix.dirname(p);
|
|
89601
|
+
return parent === "." ? "/" : parent;
|
|
89602
|
+
}
|
|
89603
|
+
function parseDate(v) {
|
|
89604
|
+
const d = v ? new Date(v) : /* @__PURE__ */ new Date();
|
|
89605
|
+
return isNaN(d.getTime()) ? /* @__PURE__ */ new Date() : d;
|
|
89606
|
+
}
|
|
89607
|
+
|
|
89608
|
+
// apps/cli/cli/handlers/mount-handlers.ts
|
|
89609
|
+
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
89610
|
+
async function handleMount(argA, argB, opts) {
|
|
89611
|
+
const out = output(opts);
|
|
89612
|
+
const ctx = await buildApiContext(out);
|
|
89613
|
+
let mountDir;
|
|
89614
|
+
let root;
|
|
89615
|
+
if (opts.all) {
|
|
89616
|
+
mountDir = requireDir(argA, out);
|
|
89617
|
+
root = { mode: "all" };
|
|
89618
|
+
} else if (opts.folder) {
|
|
89619
|
+
mountDir = requireDir(argA, out);
|
|
89620
|
+
const res = await ctx.axios.get(`/api/v1/documents/folders/${opts.folder}`);
|
|
89621
|
+
const f = res.data?.folder ?? res.data;
|
|
89622
|
+
if (!f?.id) out.fail(new Error(`Dossier introuvable : ${opts.folder}`));
|
|
89623
|
+
root = { mode: "folder", folderId: f.id, workspaceId: f.workspace_id, name: f.name };
|
|
89624
|
+
} else {
|
|
89625
|
+
if (!argB) out.fail(new Error("Usage : hubdoc mount <workspace> <dossier> (ou --all / --folder <id> <dossier>)"));
|
|
89626
|
+
mountDir = argB;
|
|
89627
|
+
const target = argA;
|
|
89628
|
+
const list = (await ctx.axios.get("/api/v1/documents/workspaces", { params: { per_page: 1e3 } })).data;
|
|
89629
|
+
const ws = UUID_RE.test(target) ? list.find((w) => w.id === target) : list.find((w) => (w.label || "").toLowerCase() === target.toLowerCase());
|
|
89630
|
+
if (!ws) out.fail(new Error(`Workspace introuvable : "${target}". Liste : hubdoc workspaces list`));
|
|
89631
|
+
root = { mode: "workspace", workspaceId: ws.id, label: ws.label };
|
|
89632
|
+
}
|
|
89633
|
+
const mountOpts = {
|
|
89634
|
+
readOnly: !!opts.readOnly,
|
|
89635
|
+
verbose: !!opts.verbose,
|
|
89636
|
+
ttlMs: opts.ttl ? Math.max(1e3, parseInt(opts.ttl, 10) * 1e3) : void 0
|
|
89637
|
+
};
|
|
89638
|
+
const fsImpl = new HubdocFs(ctx, root, mountOpts);
|
|
89639
|
+
const label = root.mode === "all" ? "tous les workspaces" : root.mode === "workspace" ? `workspace \xAB ${root.label} \xBB` : `dossier \xAB ${root.name} \xBB`;
|
|
89640
|
+
console.error(import_chalk26.default.blue(`\u26F0\uFE0F Montage du ${label} sur ${import_chalk26.default.bold(mountDir)}${opts.readOnly ? " (lecture seule)" : ""}\u2026`));
|
|
89641
|
+
let unmount;
|
|
89642
|
+
try {
|
|
89643
|
+
unmount = await fsImpl.mount(mountDir);
|
|
89644
|
+
} catch (e) {
|
|
89645
|
+
out.fail(e);
|
|
89646
|
+
return;
|
|
89647
|
+
}
|
|
89648
|
+
console.error(import_chalk26.default.green(`\u2705 Mont\xE9. Ctrl-C pour d\xE9monter.`));
|
|
89649
|
+
let unmounting = false;
|
|
89650
|
+
const cleanup = async () => {
|
|
89651
|
+
if (unmounting) return;
|
|
89652
|
+
unmounting = true;
|
|
89653
|
+
console.error(import_chalk26.default.yellow("\n\u23CF\uFE0F D\xE9montage\u2026"));
|
|
89654
|
+
try {
|
|
89655
|
+
await unmount();
|
|
89656
|
+
console.error(import_chalk26.default.green("\u2705 D\xE9mont\xE9."));
|
|
89657
|
+
} catch (e) {
|
|
89658
|
+
console.error(import_chalk26.default.red(`\xC9chec du d\xE9montage : ${e?.message}. Force : fusermount3 -u ${mountDir} (ou umount).`));
|
|
89659
|
+
}
|
|
89660
|
+
process.exit(0);
|
|
89661
|
+
};
|
|
89662
|
+
process.on("SIGINT", cleanup);
|
|
89663
|
+
process.on("SIGTERM", cleanup);
|
|
89664
|
+
await new Promise(() => {
|
|
89665
|
+
});
|
|
89666
|
+
}
|
|
89667
|
+
function requireDir(dir, out) {
|
|
89668
|
+
if (!dir) out.fail(new Error("Indique le dossier de montage. Ex : hubdoc mount --all ~/hubdoc"));
|
|
89669
|
+
return dir;
|
|
89670
|
+
}
|
|
89671
|
+
|
|
89100
89672
|
// apps/cli/cli/handlers/composed-document-handlers.ts
|
|
89101
89673
|
var BASE = "/api/v1/documents/composed_documents";
|
|
89102
89674
|
var LIST_COLUMNS = [
|
|
@@ -89237,8 +89809,8 @@ async function handleComposedExport(id, opts) {
|
|
|
89237
89809
|
}
|
|
89238
89810
|
|
|
89239
89811
|
// apps/cli/cli/handlers/part-handlers.ts
|
|
89240
|
-
var
|
|
89241
|
-
var
|
|
89812
|
+
var import_fs_extra17 = __toESM(require_lib());
|
|
89813
|
+
var import_path19 = __toESM(require("path"));
|
|
89242
89814
|
var partsBase = (cdId) => `/api/v1/documents/composed_documents/${encodeURIComponent(cdId)}/parts`;
|
|
89243
89815
|
var PART_COLUMNS = [
|
|
89244
89816
|
{ header: "ID", key: "id" },
|
|
@@ -89291,11 +89863,11 @@ async function handlePartsUpdate(id, opts) {
|
|
|
89291
89863
|
const body = {};
|
|
89292
89864
|
if (opts.content !== void 0) body.content = opts.content;
|
|
89293
89865
|
if (opts.contentFile !== void 0) {
|
|
89294
|
-
const resolved =
|
|
89295
|
-
if (!await
|
|
89866
|
+
const resolved = import_path19.default.resolve(opts.contentFile);
|
|
89867
|
+
if (!await import_fs_extra17.default.pathExists(resolved)) {
|
|
89296
89868
|
out.fail(new Error(`Content file not found: ${opts.contentFile}`));
|
|
89297
89869
|
}
|
|
89298
|
-
body.content = await
|
|
89870
|
+
body.content = await import_fs_extra17.default.readFile(resolved, "utf8");
|
|
89299
89871
|
}
|
|
89300
89872
|
if (opts.status !== void 0) body.status = opts.status;
|
|
89301
89873
|
if (opts.title !== void 0) body.title = opts.title;
|
|
@@ -89830,15 +90402,15 @@ async function handlePermissionsShow(id, opts) {
|
|
|
89830
90402
|
// apps/cli/cli.ts
|
|
89831
90403
|
var getVersion = () => {
|
|
89832
90404
|
try {
|
|
89833
|
-
if (true) return "1.
|
|
90405
|
+
if (true) return "1.8.0";
|
|
89834
90406
|
} catch {
|
|
89835
90407
|
}
|
|
89836
90408
|
for (const candidate of [
|
|
89837
|
-
|
|
89838
|
-
|
|
90409
|
+
import_path20.default.join(__dirname, "package.json"),
|
|
90410
|
+
import_path20.default.join(__dirname, "..", "package.json")
|
|
89839
90411
|
]) {
|
|
89840
90412
|
try {
|
|
89841
|
-
return
|
|
90413
|
+
return import_fs_extra18.default.readJsonSync(candidate).version;
|
|
89842
90414
|
} catch {
|
|
89843
90415
|
}
|
|
89844
90416
|
}
|
|
@@ -89858,18 +90430,18 @@ program2.command("run").description("Run HubDoc tool with engine selection (lega
|
|
|
89858
90430
|
if (options.interactive || (!options.engine || options.engine === "filesystem")) {
|
|
89859
90431
|
selectedEngine = await runEngineSelection(options.interactive);
|
|
89860
90432
|
}
|
|
89861
|
-
console.log(
|
|
90433
|
+
console.log(import_chalk27.default.blue(`\u{1F680} Starting HubDoc Tool with ${selectedEngine} engine...`));
|
|
89862
90434
|
logger.log("INFO", "INIT", selectedEngine, `Starting HubDoc Tool with ${selectedEngine} engine`, {
|
|
89863
90435
|
options: { ...options, logFile: logger.getLogPath() }
|
|
89864
90436
|
});
|
|
89865
90437
|
await handleEngineOperation(selectedEngine, options, logger);
|
|
89866
90438
|
logger.completeOperation(true);
|
|
89867
|
-
console.log(
|
|
90439
|
+
console.log(import_chalk27.default.green(`\u2705 Operation completed. Log: ${logger.getLogPath()}`));
|
|
89868
90440
|
} catch (error) {
|
|
89869
90441
|
logger.log("ERROR", "FAILED", options.engine || "unknown", `Operation failed: ${error.message}`, { error: error.stack });
|
|
89870
90442
|
logger.completeOperation(false);
|
|
89871
|
-
console.error(
|
|
89872
|
-
console.error(
|
|
90443
|
+
console.error(import_chalk27.default.red(`\u274C Error: ${error.message}`));
|
|
90444
|
+
console.error(import_chalk27.default.gray(`\u{1F4C4} Check log file: ${logger.getLogPath()}`));
|
|
89873
90445
|
process.exit(1);
|
|
89874
90446
|
}
|
|
89875
90447
|
});
|
|
@@ -89883,7 +90455,7 @@ Examples:
|
|
|
89883
90455
|
try {
|
|
89884
90456
|
await handleGenerateMapping(sourceDir, options);
|
|
89885
90457
|
} catch (error) {
|
|
89886
|
-
console.error(
|
|
90458
|
+
console.error(import_chalk27.default.red(`\u274C Error: ${error.message}`));
|
|
89887
90459
|
process.exit(1);
|
|
89888
90460
|
}
|
|
89889
90461
|
});
|
|
@@ -89898,7 +90470,7 @@ Examples:
|
|
|
89898
90470
|
try {
|
|
89899
90471
|
await handleImport(options);
|
|
89900
90472
|
} catch (error) {
|
|
89901
|
-
console.error(
|
|
90473
|
+
console.error(import_chalk27.default.red(`\u274C Import failed: ${error.message}`));
|
|
89902
90474
|
process.exit(1);
|
|
89903
90475
|
}
|
|
89904
90476
|
});
|
|
@@ -89906,7 +90478,7 @@ program2.command("export").description("Export documents from HubDoc").option("-
|
|
|
89906
90478
|
try {
|
|
89907
90479
|
await handleExport(options);
|
|
89908
90480
|
} catch (error) {
|
|
89909
|
-
console.error(
|
|
90481
|
+
console.error(import_chalk27.default.red(`\u274C Export failed: ${error.message}`));
|
|
89910
90482
|
process.exit(1);
|
|
89911
90483
|
}
|
|
89912
90484
|
});
|
|
@@ -89914,7 +90486,7 @@ program2.command("plugins").description("Manage document source plugins").action
|
|
|
89914
90486
|
try {
|
|
89915
90487
|
await handlePlugins();
|
|
89916
90488
|
} catch (error) {
|
|
89917
|
-
console.error(
|
|
90489
|
+
console.error(import_chalk27.default.red(`\u274C Error: ${error.message}`));
|
|
89918
90490
|
process.exit(1);
|
|
89919
90491
|
}
|
|
89920
90492
|
});
|
|
@@ -89922,7 +90494,7 @@ program2.command("connect").description("Create a connection to an external docu
|
|
|
89922
90494
|
try {
|
|
89923
90495
|
await handleConnect(plugin, options);
|
|
89924
90496
|
} catch (error) {
|
|
89925
|
-
console.error(
|
|
90497
|
+
console.error(import_chalk27.default.red(`\u274C Failed to create connection: ${error.message}`));
|
|
89926
90498
|
process.exit(1);
|
|
89927
90499
|
}
|
|
89928
90500
|
});
|
|
@@ -89930,7 +90502,7 @@ program2.command("plugin-scan").description("Scan external source and generate m
|
|
|
89930
90502
|
try {
|
|
89931
90503
|
await handlePluginScan(connectionId, options);
|
|
89932
90504
|
} catch (error) {
|
|
89933
|
-
console.error(
|
|
90505
|
+
console.error(import_chalk27.default.red(`\u274C Plugin scan failed: ${error.message}`));
|
|
89934
90506
|
process.exit(1);
|
|
89935
90507
|
}
|
|
89936
90508
|
});
|
|
@@ -89938,7 +90510,7 @@ program2.command("plugin-import").description("Import documents from external so
|
|
|
89938
90510
|
try {
|
|
89939
90511
|
await handlePluginImport(mappingFile, options);
|
|
89940
90512
|
} catch (error) {
|
|
89941
|
-
console.error(
|
|
90513
|
+
console.error(import_chalk27.default.red(`\u274C Plugin import failed: ${error.message}`));
|
|
89942
90514
|
process.exit(1);
|
|
89943
90515
|
}
|
|
89944
90516
|
});
|
|
@@ -90028,6 +90600,9 @@ files.command("delete <id>").description("Delete a document").option("--yes", "S
|
|
|
90028
90600
|
program2.command("search <query>").description("Hybrid search (FTS + semantic + RRF) across accessible content").option("--entity-type <type>", "Restrict to one of: files, folders, workspaces").option("--workspace <id>", "Restrict to one workspace").option("--limit <n>", "Max results (server caps at 100)").action(async (query, options) => {
|
|
90029
90601
|
await handleSearch(query, withGlobals(options));
|
|
90030
90602
|
});
|
|
90603
|
+
program2.command("mount <target> [dir]").description("Monte un workspace/dossier Hubdoc en local via FUSE (voir docs/mount.md)").option("--all", "Monte tous les workspaces (chacun = un sous-dossier) ; <target> = dossier de montage").option("--folder <id>", "Monte un dossier pr\xE9cis par son id ; <target> = dossier de montage").option("--read-only", "Montage en lecture seule (pas de write-back)").option("--ttl <seconds>", "TTL du cache d\u2019arborescence en secondes (d\xE9faut 30)").option("--verbose", "Logs d\xE9taill\xE9s des op\xE9rations FUSE").action(async (target, dir, options) => {
|
|
90604
|
+
await handleMount(target, dir, withGlobals(options));
|
|
90605
|
+
});
|
|
90031
90606
|
var composed = program2.command("composed-documents").alias("composed").description("Manage composed documents (Markdown/Typst editorial pipeline)");
|
|
90032
90607
|
composed.command("ls").description("List composed documents").option("--workspace <id>").option("--folder <id>").option("--status <status>").option("--page <n>").option("--per-page <n>").action(async (options) => {
|
|
90033
90608
|
await handleComposedList(withGlobals(options));
|