@sinoia/hubdoc-tools 1.6.0 → 1.7.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 +1156 -762
- package/package.json +1 -1
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 path24 = require("path");
|
|
929
|
+
var fs20 = 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 = path24.resolve(baseDir, baseName);
|
|
1753
|
+
if (fs20.existsSync(localBin)) return localBin;
|
|
1754
|
+
if (sourceExt.includes(path24.extname(baseName))) return void 0;
|
|
1755
|
+
const foundExt = sourceExt.find((ext2) => fs20.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 = fs20.realpathSync(this._scriptPath);
|
|
1767
1767
|
} catch (err) {
|
|
1768
1768
|
resolvedScriptPath = this._scriptPath;
|
|
1769
1769
|
}
|
|
1770
|
-
executableDir =
|
|
1770
|
+
executableDir = path24.resolve(path24.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 = path24.basename(this._scriptPath, path24.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(path24.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 = path24.basename(filename, path24.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(path25) {
|
|
2580
|
+
if (path25 === void 0) return this._executableDir;
|
|
2581
|
+
this._executableDir = path25;
|
|
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 path24 = [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
|
+
path24.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 = path24;
|
|
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 os7 = 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 = os7.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(chalk27, 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 = chalk27;
|
|
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 = (chalk27, 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(chalk27, 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(chalk27, 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 chalk28 = {};
|
|
4172
|
+
applyOptions(chalk28, options);
|
|
4173
|
+
chalk28.template = (...arguments_) => chalkTag(chalk28.template, ...arguments_);
|
|
4174
|
+
Object.setPrototypeOf(chalk28, Chalk.prototype);
|
|
4175
|
+
Object.setPrototypeOf(chalk28.template, chalk28);
|
|
4176
|
+
chalk28.template.constructor = () => {
|
|
4177
4177
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
4178
4178
|
};
|
|
4179
|
-
|
|
4180
|
-
return
|
|
4179
|
+
chalk28.template.Instance = ChalkClass;
|
|
4180
|
+
return chalk28.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 = (chalk28, ...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(chalk28, parts2.join(""));
|
|
4308
4308
|
};
|
|
4309
4309
|
Object.defineProperties(Chalk.prototype, styles);
|
|
4310
|
-
var
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
module2.exports =
|
|
4310
|
+
var chalk27 = Chalk();
|
|
4311
|
+
chalk27.supportsColor = stdoutColor;
|
|
4312
|
+
chalk27.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
4313
|
+
chalk27.stderr.supportsColor = stderrColor;
|
|
4314
|
+
module2.exports = chalk27;
|
|
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(fs20) {
|
|
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(fs20);
|
|
4375
|
+
}
|
|
4376
|
+
if (!fs20.lutimes) {
|
|
4377
|
+
patchLutimes(fs20);
|
|
4378
|
+
}
|
|
4379
|
+
fs20.chown = chownFix(fs20.chown);
|
|
4380
|
+
fs20.fchown = chownFix(fs20.fchown);
|
|
4381
|
+
fs20.lchown = chownFix(fs20.lchown);
|
|
4382
|
+
fs20.chmod = chmodFix(fs20.chmod);
|
|
4383
|
+
fs20.fchmod = chmodFix(fs20.fchmod);
|
|
4384
|
+
fs20.lchmod = chmodFix(fs20.lchmod);
|
|
4385
|
+
fs20.chownSync = chownFixSync(fs20.chownSync);
|
|
4386
|
+
fs20.fchownSync = chownFixSync(fs20.fchownSync);
|
|
4387
|
+
fs20.lchownSync = chownFixSync(fs20.lchownSync);
|
|
4388
|
+
fs20.chmodSync = chmodFixSync(fs20.chmodSync);
|
|
4389
|
+
fs20.fchmodSync = chmodFixSync(fs20.fchmodSync);
|
|
4390
|
+
fs20.lchmodSync = chmodFixSync(fs20.lchmodSync);
|
|
4391
|
+
fs20.stat = statFix(fs20.stat);
|
|
4392
|
+
fs20.fstat = statFix(fs20.fstat);
|
|
4393
|
+
fs20.lstat = statFix(fs20.lstat);
|
|
4394
|
+
fs20.statSync = statFixSync(fs20.statSync);
|
|
4395
|
+
fs20.fstatSync = statFixSync(fs20.fstatSync);
|
|
4396
|
+
fs20.lstatSync = statFixSync(fs20.lstatSync);
|
|
4397
|
+
if (fs20.chmod && !fs20.lchmod) {
|
|
4398
|
+
fs20.lchmod = function(path24, mode, cb) {
|
|
4399
4399
|
if (cb) process.nextTick(cb);
|
|
4400
4400
|
};
|
|
4401
|
-
|
|
4401
|
+
fs20.lchmodSync = function() {
|
|
4402
4402
|
};
|
|
4403
4403
|
}
|
|
4404
|
-
if (
|
|
4405
|
-
|
|
4404
|
+
if (fs20.chown && !fs20.lchown) {
|
|
4405
|
+
fs20.lchown = function(path24, uid, gid, cb) {
|
|
4406
4406
|
if (cb) process.nextTick(cb);
|
|
4407
4407
|
};
|
|
4408
|
-
|
|
4408
|
+
fs20.lchownSync = function() {
|
|
4409
4409
|
};
|
|
4410
4410
|
}
|
|
4411
4411
|
if (platform === "win32") {
|
|
4412
|
-
|
|
4412
|
+
fs20.rename = typeof fs20.rename !== "function" ? fs20.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
|
+
fs20.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
|
+
})(fs20.rename);
|
|
4436
4436
|
}
|
|
4437
|
-
|
|
4437
|
+
fs20.read = typeof fs20.read !== "function" ? fs20.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(fs20, 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(fs20, 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
|
+
})(fs20.read);
|
|
4455
|
+
fs20.readSync = typeof fs20.readSync !== "function" ? fs20.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(fs20, 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
|
+
})(fs20.readSync);
|
|
4471
|
+
function patchLchmod(fs21) {
|
|
4472
|
+
fs21.lchmod = function(path24, mode, callback) {
|
|
4473
|
+
fs21.open(
|
|
4474
|
+
path24,
|
|
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
|
+
fs21.fchmod(fd, mode, function(err2) {
|
|
4483
|
+
fs21.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
|
+
fs21.lchmodSync = function(path24, mode) {
|
|
4491
|
+
var fd = fs21.openSync(path24, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
4492
4492
|
var threw = true;
|
|
4493
4493
|
var ret;
|
|
4494
4494
|
try {
|
|
4495
|
-
ret =
|
|
4495
|
+
ret = fs21.fchmodSync(fd, mode);
|
|
4496
4496
|
threw = false;
|
|
4497
4497
|
} finally {
|
|
4498
4498
|
if (threw) {
|
|
4499
4499
|
try {
|
|
4500
|
-
|
|
4500
|
+
fs21.closeSync(fd);
|
|
4501
4501
|
} catch (er) {
|
|
4502
4502
|
}
|
|
4503
4503
|
} else {
|
|
4504
|
-
|
|
4504
|
+
fs21.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(fs21) {
|
|
4511
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs21.futimes) {
|
|
4512
|
+
fs21.lutimes = function(path24, at, mt, cb) {
|
|
4513
|
+
fs21.open(path24, constants.O_SYMLINK, function(er, fd) {
|
|
4514
4514
|
if (er) {
|
|
4515
4515
|
if (cb) cb(er);
|
|
4516
4516
|
return;
|
|
4517
4517
|
}
|
|
4518
|
-
|
|
4519
|
-
|
|
4518
|
+
fs21.futimes(fd, at, mt, function(er2) {
|
|
4519
|
+
fs21.close(fd, function(er22) {
|
|
4520
4520
|
if (cb) cb(er2 || er22);
|
|
4521
4521
|
});
|
|
4522
4522
|
});
|
|
4523
4523
|
});
|
|
4524
4524
|
};
|
|
4525
|
-
|
|
4526
|
-
var fd =
|
|
4525
|
+
fs21.lutimesSync = function(path24, at, mt) {
|
|
4526
|
+
var fd = fs21.openSync(path24, constants.O_SYMLINK);
|
|
4527
4527
|
var ret;
|
|
4528
4528
|
var threw = true;
|
|
4529
4529
|
try {
|
|
4530
|
-
ret =
|
|
4530
|
+
ret = fs21.futimesSync(fd, at, mt);
|
|
4531
4531
|
threw = false;
|
|
4532
4532
|
} finally {
|
|
4533
4533
|
if (threw) {
|
|
4534
4534
|
try {
|
|
4535
|
-
|
|
4535
|
+
fs21.closeSync(fd);
|
|
4536
4536
|
} catch (er) {
|
|
4537
4537
|
}
|
|
4538
4538
|
} else {
|
|
4539
|
-
|
|
4539
|
+
fs21.closeSync(fd);
|
|
4540
4540
|
}
|
|
4541
4541
|
}
|
|
4542
4542
|
return ret;
|
|
4543
4543
|
};
|
|
4544
|
-
} else if (
|
|
4545
|
-
|
|
4544
|
+
} else if (fs21.futimes) {
|
|
4545
|
+
fs21.lutimes = function(_a, _b, _c, cb) {
|
|
4546
4546
|
if (cb) process.nextTick(cb);
|
|
4547
4547
|
};
|
|
4548
|
-
|
|
4548
|
+
fs21.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(fs20, 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(fs20, 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(fs20, 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(fs20, 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(fs20, target, options, callback) : orig.call(fs20, 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(fs20, target, options) : orig.call(fs20, 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(fs20) {
|
|
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(path24, options) {
|
|
4645
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path24, options);
|
|
4646
4646
|
Stream2.call(this);
|
|
4647
4647
|
var self2 = this;
|
|
4648
|
-
this.path =
|
|
4648
|
+
this.path = path24;
|
|
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
|
+
fs20.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(path24, options) {
|
|
4694
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path24, options);
|
|
4695
4695
|
Stream2.call(this);
|
|
4696
|
-
this.path =
|
|
4696
|
+
this.path = path24;
|
|
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 = fs20.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 fs20 = 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 (!fs20[gracefulQueue]) {
|
|
4789
4789
|
queue = global[gracefulQueue] || [];
|
|
4790
|
-
publishQueue(
|
|
4791
|
-
|
|
4790
|
+
publishQueue(fs20, queue);
|
|
4791
|
+
fs20.close = (function(fs$close) {
|
|
4792
4792
|
function close3(fd, cb) {
|
|
4793
|
-
return fs$close.call(
|
|
4793
|
+
return fs$close.call(fs20, 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
|
+
})(fs20.close);
|
|
4806
|
+
fs20.closeSync = (function(fs$closeSync) {
|
|
4807
4807
|
function closeSync(fd) {
|
|
4808
|
-
fs$closeSync.apply(
|
|
4808
|
+
fs$closeSync.apply(fs20, 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
|
+
})(fs20.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(fs20[gracefulQueue]);
|
|
4819
|
+
require("assert").equal(fs20[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, fs20[gracefulQueue]);
|
|
4826
|
+
}
|
|
4827
|
+
module2.exports = patch(clone(fs20));
|
|
4828
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs20.__patched) {
|
|
4829
|
+
module2.exports = patch(fs20);
|
|
4830
|
+
fs20.__patched = true;
|
|
4831
|
+
}
|
|
4832
|
+
function patch(fs21) {
|
|
4833
|
+
polyfills(fs21);
|
|
4834
|
+
fs21.gracefulify = patch;
|
|
4835
|
+
fs21.createReadStream = createReadStream3;
|
|
4836
|
+
fs21.createWriteStream = createWriteStream;
|
|
4837
|
+
var fs$readFile = fs21.readFile;
|
|
4838
|
+
fs21.readFile = readFile;
|
|
4839
|
+
function readFile(path24, 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(path24, options, cb);
|
|
4843
|
+
function go$readFile(path25, options2, cb2, startTime) {
|
|
4844
|
+
return fs$readFile(path25, options2, function(err) {
|
|
4845
4845
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4846
|
-
enqueue([go$readFile, [
|
|
4846
|
+
enqueue([go$readFile, [path25, 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 = fs21.writeFile;
|
|
4855
|
+
fs21.writeFile = writeFile;
|
|
4856
|
+
function writeFile(path24, 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(path24, data, options, cb);
|
|
4860
|
+
function go$writeFile(path25, data2, options2, cb2, startTime) {
|
|
4861
|
+
return fs$writeFile(path25, data2, options2, function(err) {
|
|
4862
4862
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4863
|
-
enqueue([go$writeFile, [
|
|
4863
|
+
enqueue([go$writeFile, [path25, 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 = fs21.appendFile;
|
|
4872
4872
|
if (fs$appendFile)
|
|
4873
|
-
|
|
4874
|
-
function appendFile(
|
|
4873
|
+
fs21.appendFile = appendFile;
|
|
4874
|
+
function appendFile(path24, 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(path24, data, options, cb);
|
|
4878
|
+
function go$appendFile(path25, data2, options2, cb2, startTime) {
|
|
4879
|
+
return fs$appendFile(path25, data2, options2, function(err) {
|
|
4880
4880
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4881
|
-
enqueue([go$appendFile, [
|
|
4881
|
+
enqueue([go$appendFile, [path25, 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 = fs21.copyFile;
|
|
4890
4890
|
if (fs$copyFile)
|
|
4891
|
-
|
|
4891
|
+
fs21.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 = fs21.readdir;
|
|
4910
|
+
fs21.readdir = readdir2;
|
|
4911
4911
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
4912
|
-
function readdir2(
|
|
4912
|
+
function readdir2(path24, 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(path25, options2, cb2, startTime) {
|
|
4916
|
+
return fs$readdir(path25, fs$readdirCallback(
|
|
4917
|
+
path25,
|
|
4918
4918
|
options2,
|
|
4919
4919
|
cb2,
|
|
4920
4920
|
startTime
|
|
4921
4921
|
));
|
|
4922
|
-
} : function go$readdir2(
|
|
4923
|
-
return fs$readdir(
|
|
4924
|
-
|
|
4922
|
+
} : function go$readdir2(path25, options2, cb2, startTime) {
|
|
4923
|
+
return fs$readdir(path25, options2, fs$readdirCallback(
|
|
4924
|
+
path25,
|
|
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(path24, options, cb);
|
|
4931
|
+
function fs$readdirCallback(path25, 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
|
+
[path25, 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(fs21);
|
|
4952
4952
|
ReadStream = legStreams.ReadStream;
|
|
4953
4953
|
WriteStream = legStreams.WriteStream;
|
|
4954
4954
|
}
|
|
4955
|
-
var fs$ReadStream =
|
|
4955
|
+
var fs$ReadStream = fs21.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 = fs21.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(fs21, "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(fs21, "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(fs21, "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(fs21, "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(path24, 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(path24, 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(path24, options) {
|
|
5046
|
+
return new fs21.ReadStream(path24, options);
|
|
5047
5047
|
}
|
|
5048
|
-
function createWriteStream(
|
|
5049
|
-
return new
|
|
5048
|
+
function createWriteStream(path24, options) {
|
|
5049
|
+
return new fs21.WriteStream(path24, options);
|
|
5050
5050
|
}
|
|
5051
|
-
var fs$open =
|
|
5052
|
-
|
|
5053
|
-
function open3(
|
|
5051
|
+
var fs$open = fs21.open;
|
|
5052
|
+
fs21.open = open3;
|
|
5053
|
+
function open3(path24, 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(path24, flags, mode, cb);
|
|
5057
|
+
function go$open(path25, flags2, mode2, cb2, startTime) {
|
|
5058
|
+
return fs$open(path25, flags2, mode2, function(err, fd) {
|
|
5059
5059
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
5060
|
-
enqueue([go$open, [
|
|
5060
|
+
enqueue([go$open, [path25, 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 fs21;
|
|
5069
5069
|
}
|
|
5070
5070
|
function enqueue(elem) {
|
|
5071
5071
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
5072
|
-
|
|
5072
|
+
fs20[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 < fs20[gracefulQueue].length; ++i) {
|
|
5079
|
+
if (fs20[gracefulQueue][i].length > 2) {
|
|
5080
|
+
fs20[gracefulQueue][i][3] = now;
|
|
5081
|
+
fs20[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 (fs20[gracefulQueue].length === 0)
|
|
5090
5090
|
return;
|
|
5091
|
-
var elem =
|
|
5091
|
+
var elem = fs20[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
|
+
fs20[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 fs20 = 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 fs20[key] === "function";
|
|
5170
5170
|
});
|
|
5171
|
-
Object.assign(exports2,
|
|
5171
|
+
Object.assign(exports2, fs20);
|
|
5172
5172
|
api.forEach((method) => {
|
|
5173
|
-
exports2[method] = u(
|
|
5173
|
+
exports2[method] = u(fs20[method]);
|
|
5174
5174
|
});
|
|
5175
5175
|
exports2.exists = function(filename, callback) {
|
|
5176
5176
|
if (typeof callback === "function") {
|
|
5177
|
-
return
|
|
5177
|
+
return fs20.exists(filename, callback);
|
|
5178
5178
|
}
|
|
5179
5179
|
return new Promise((resolve) => {
|
|
5180
|
-
return
|
|
5180
|
+
return fs20.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 fs20.read(fd, buffer, offset, length, position, callback);
|
|
5186
5186
|
}
|
|
5187
5187
|
return new Promise((resolve, reject) => {
|
|
5188
|
-
|
|
5188
|
+
fs20.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 fs20.write(fd, buffer, ...args);
|
|
5197
5197
|
}
|
|
5198
5198
|
return new Promise((resolve, reject) => {
|
|
5199
|
-
|
|
5199
|
+
fs20.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 fs20.readv(fd, buffers, ...args);
|
|
5208
5208
|
}
|
|
5209
5209
|
return new Promise((resolve, reject) => {
|
|
5210
|
-
|
|
5210
|
+
fs20.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 fs20.writev(fd, buffers, ...args);
|
|
5219
5219
|
}
|
|
5220
5220
|
return new Promise((resolve, reject) => {
|
|
5221
|
-
|
|
5221
|
+
fs20.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 fs20.realpath.native === "function") {
|
|
5228
|
+
exports2.realpath.native = u(fs20.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 path24 = 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(path24.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 fs20 = 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 fs20.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 fs20.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 fs20 = require_fs();
|
|
5310
|
+
function pathExists3(path24) {
|
|
5311
|
+
return fs20.access(path24).then(() => true).catch(() => false);
|
|
5312
5312
|
}
|
|
5313
5313
|
module2.exports = {
|
|
5314
5314
|
pathExists: u(pathExists3),
|
|
5315
|
-
pathExistsSync:
|
|
5315
|
+
pathExistsSync: fs20.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 fs20 = require_fs();
|
|
5325
5325
|
var u = require_universalify().fromPromise;
|
|
5326
|
-
async function utimesMillis(
|
|
5327
|
-
const fd = await
|
|
5326
|
+
async function utimesMillis(path24, atime, mtime) {
|
|
5327
|
+
const fd = await fs20.open(path24, "r+");
|
|
5328
5328
|
let closeErr = null;
|
|
5329
5329
|
try {
|
|
5330
|
-
await
|
|
5330
|
+
await fs20.futimes(fd, atime, mtime);
|
|
5331
5331
|
} finally {
|
|
5332
5332
|
try {
|
|
5333
|
-
await
|
|
5333
|
+
await fs20.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(path24, atime, mtime) {
|
|
5343
|
+
const fd = fs20.openSync(path24, "r+");
|
|
5344
|
+
fs20.futimesSync(fd, atime, mtime);
|
|
5345
|
+
return fs20.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 fs20 = require_fs();
|
|
5359
|
+
var path24 = 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) => fs20.stat(file, { bigint: true }) : (file) => fs20.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) => fs20.statSync(file, { bigint: true }) : (file) => fs20.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 = path24.basename(src);
|
|
5388
|
+
const destBaseName = path24.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 = path24.basename(src);
|
|
5411
|
+
const destBaseName = path24.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 = path24.resolve(path24.dirname(src));
|
|
5431
|
+
const destParent = path24.resolve(path24.dirname(dest));
|
|
5432
|
+
if (destParent === srcParent || destParent === path24.parse(destParent).root) return;
|
|
5433
5433
|
let destStat;
|
|
5434
5434
|
try {
|
|
5435
|
-
destStat = await
|
|
5435
|
+
destStat = await fs20.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 = path24.resolve(path24.dirname(src));
|
|
5447
|
+
const destParent = path24.resolve(path24.dirname(dest));
|
|
5448
|
+
if (destParent === srcParent || destParent === path24.parse(destParent).root) return;
|
|
5449
5449
|
let destStat;
|
|
5450
5450
|
try {
|
|
5451
|
-
destStat =
|
|
5451
|
+
destStat = fs20.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 = path24.resolve(src).split(path24.sep).filter((i) => i);
|
|
5466
|
+
const destArr = path24.resolve(dest).split(path24.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 fs20 = require_fs();
|
|
5519
|
+
var path24 = 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 = path24.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 ? fs20.stat : fs20.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 fs20.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 fs20.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 fs20.stat(src);
|
|
5580
5580
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
5581
5581
|
}
|
|
5582
|
-
return
|
|
5582
|
+
return fs20.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 fs20.chmod(dest, srcMode | 128);
|
|
5589
5589
|
}
|
|
5590
5590
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
5591
5591
|
if (!destStat) {
|
|
5592
|
-
await
|
|
5592
|
+
await fs20.mkdir(dest);
|
|
5593
5593
|
}
|
|
5594
|
-
await asyncIteratorConcurrentProcess(await
|
|
5595
|
-
const srcItem =
|
|
5596
|
-
const destItem =
|
|
5594
|
+
await asyncIteratorConcurrentProcess(await fs20.opendir(src), async (item) => {
|
|
5595
|
+
const srcItem = path24.join(src, item.name);
|
|
5596
|
+
const destItem = path24.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 fs20.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 fs20.readlink(src);
|
|
5609
5609
|
if (opts.dereference) {
|
|
5610
|
-
resolvedSrc =
|
|
5610
|
+
resolvedSrc = path24.resolve(process.cwd(), resolvedSrc);
|
|
5611
5611
|
}
|
|
5612
5612
|
if (!destStat) {
|
|
5613
|
-
return
|
|
5613
|
+
return fs20.symlink(resolvedSrc, dest);
|
|
5614
5614
|
}
|
|
5615
5615
|
let resolvedDest = null;
|
|
5616
5616
|
try {
|
|
5617
|
-
resolvedDest = await
|
|
5617
|
+
resolvedDest = await fs20.readlink(dest);
|
|
5618
5618
|
} catch (e) {
|
|
5619
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
5619
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs20.symlink(resolvedSrc, dest);
|
|
5620
5620
|
throw e;
|
|
5621
5621
|
}
|
|
5622
5622
|
if (opts.dereference) {
|
|
5623
|
-
resolvedDest =
|
|
5623
|
+
resolvedDest = path24.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 fs20.unlink(dest);
|
|
5632
|
+
return fs20.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 fs20 = require_graceful_fs();
|
|
5643
|
+
var path24 = 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 = path24.dirname(dest);
|
|
5665
|
+
if (!fs20.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 ? fs20.statSync : fs20.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
|
+
fs20.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
|
+
fs20.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 fs20.chmodSync(dest, srcMode);
|
|
5707
5707
|
}
|
|
5708
5708
|
function setDestTimestamps(src, dest) {
|
|
5709
|
-
const updatedSrcStat =
|
|
5709
|
+
const updatedSrcStat = fs20.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
|
+
fs20.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 = fs20.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 = path24.join(src, item);
|
|
5734
|
+
const destItem = path24.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 = fs20.readlinkSync(src);
|
|
5741
5741
|
if (opts.dereference) {
|
|
5742
|
-
resolvedSrc =
|
|
5742
|
+
resolvedSrc = path24.resolve(process.cwd(), resolvedSrc);
|
|
5743
5743
|
}
|
|
5744
5744
|
if (!destStat) {
|
|
5745
|
-
return
|
|
5745
|
+
return fs20.symlinkSync(resolvedSrc, dest);
|
|
5746
5746
|
} else {
|
|
5747
5747
|
let resolvedDest;
|
|
5748
5748
|
try {
|
|
5749
|
-
resolvedDest =
|
|
5749
|
+
resolvedDest = fs20.readlinkSync(dest);
|
|
5750
5750
|
} catch (err) {
|
|
5751
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
5751
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs20.symlinkSync(resolvedSrc, dest);
|
|
5752
5752
|
throw err;
|
|
5753
5753
|
}
|
|
5754
5754
|
if (opts.dereference) {
|
|
5755
|
-
resolvedDest =
|
|
5755
|
+
resolvedDest = path24.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
|
+
fs20.unlinkSync(dest);
|
|
5768
|
+
return fs20.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 fs20 = require_graceful_fs();
|
|
5791
5791
|
var u = require_universalify().fromCallback;
|
|
5792
|
-
function remove(
|
|
5793
|
-
|
|
5792
|
+
function remove(path24, callback) {
|
|
5793
|
+
fs20.rm(path24, { recursive: true, force: true }, callback);
|
|
5794
5794
|
}
|
|
5795
|
-
function removeSync(
|
|
5796
|
-
|
|
5795
|
+
function removeSync(path24) {
|
|
5796
|
+
fs20.rmSync(path24, { 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 fs20 = require_fs();
|
|
5811
|
+
var path24 = 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 fs20.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(path24.join(dir, item))));
|
|
5822
5822
|
});
|
|
5823
5823
|
function emptyDirSync(dir) {
|
|
5824
5824
|
let items;
|
|
5825
5825
|
try {
|
|
5826
|
-
items =
|
|
5826
|
+
items = fs20.readdirSync(dir);
|
|
5827
5827
|
} catch {
|
|
5828
5828
|
return mkdir.mkdirsSync(dir);
|
|
5829
5829
|
}
|
|
5830
5830
|
items.forEach((item) => {
|
|
5831
|
-
item =
|
|
5831
|
+
item = path24.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 path24 = require("path");
|
|
5850
|
+
var fs20 = 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 fs20.stat(file);
|
|
5856
5856
|
} catch {
|
|
5857
5857
|
}
|
|
5858
5858
|
if (stats && stats.isFile()) return;
|
|
5859
|
-
const dir =
|
|
5859
|
+
const dir = path24.dirname(file);
|
|
5860
5860
|
let dirStats = null;
|
|
5861
5861
|
try {
|
|
5862
|
-
dirStats = await
|
|
5862
|
+
dirStats = await fs20.stat(dir);
|
|
5863
5863
|
} catch (err) {
|
|
5864
5864
|
if (err.code === "ENOENT") {
|
|
5865
5865
|
await mkdir.mkdirs(dir);
|
|
5866
|
-
await
|
|
5866
|
+
await fs20.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 fs20.writeFile(file, "");
|
|
5874
5874
|
} else {
|
|
5875
|
-
await
|
|
5875
|
+
await fs20.readdir(dir);
|
|
5876
5876
|
}
|
|
5877
5877
|
}
|
|
5878
5878
|
function createFileSync(file) {
|
|
5879
5879
|
let stats;
|
|
5880
5880
|
try {
|
|
5881
|
-
stats =
|
|
5881
|
+
stats = fs20.statSync(file);
|
|
5882
5882
|
} catch {
|
|
5883
5883
|
}
|
|
5884
5884
|
if (stats && stats.isFile()) return;
|
|
5885
|
-
const dir =
|
|
5885
|
+
const dir = path24.dirname(file);
|
|
5886
5886
|
try {
|
|
5887
|
-
if (!
|
|
5888
|
-
|
|
5887
|
+
if (!fs20.statSync(dir).isDirectory()) {
|
|
5888
|
+
fs20.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
|
+
fs20.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 path24 = require("path");
|
|
5909
|
+
var fs20 = 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 fs20.lstat(dstpath);
|
|
5917
5917
|
} catch {
|
|
5918
5918
|
}
|
|
5919
5919
|
let srcStat;
|
|
5920
5920
|
try {
|
|
5921
|
-
srcStat = await
|
|
5921
|
+
srcStat = await fs20.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 = path24.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 fs20.link(srcpath, dstpath);
|
|
5933
5933
|
}
|
|
5934
5934
|
function createLinkSync(srcpath, dstpath) {
|
|
5935
5935
|
let dstStat;
|
|
5936
5936
|
try {
|
|
5937
|
-
dstStat =
|
|
5937
|
+
dstStat = fs20.lstatSync(dstpath);
|
|
5938
5938
|
} catch {
|
|
5939
5939
|
}
|
|
5940
5940
|
try {
|
|
5941
|
-
const srcStat =
|
|
5941
|
+
const srcStat = fs20.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 = path24.dirname(dstpath);
|
|
5948
|
+
const dirExists = fs20.existsSync(dir);
|
|
5949
|
+
if (dirExists) return fs20.linkSync(srcpath, dstpath);
|
|
5950
5950
|
mkdir.mkdirsSync(dir);
|
|
5951
|
-
return
|
|
5951
|
+
return fs20.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 path24 = require("path");
|
|
5965
|
+
var fs20 = 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 (path24.isAbsolute(srcpath)) {
|
|
5970
5970
|
try {
|
|
5971
|
-
await
|
|
5971
|
+
await fs20.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 = path24.dirname(dstpath);
|
|
5982
|
+
const relativeToDst = path24.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 fs20.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: path24.relative(dstdir, srcpath)
|
|
5999
5999
|
};
|
|
6000
6000
|
}
|
|
6001
6001
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
6002
|
-
if (
|
|
6003
|
-
const exists2 =
|
|
6002
|
+
if (path24.isAbsolute(srcpath)) {
|
|
6003
|
+
const exists2 = fs20.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 = path24.dirname(dstpath);
|
|
6011
|
+
const relativeToDst = path24.join(dstdir, srcpath);
|
|
6012
|
+
const exists = fs20.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 = fs20.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: path24.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 fs20 = 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 fs20.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 = fs20.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 path24 = require("path");
|
|
6072
|
+
var fs20 = 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 fs20.lstat(dstpath);
|
|
6082
6082
|
} catch {
|
|
6083
6083
|
}
|
|
6084
6084
|
if (stats && stats.isSymbolicLink()) {
|
|
6085
6085
|
const [srcStat, dstStat] = await Promise.all([
|
|
6086
|
-
|
|
6087
|
-
|
|
6086
|
+
fs20.stat(srcpath),
|
|
6087
|
+
fs20.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 = path24.dirname(dstpath);
|
|
6095
6095
|
if (!await pathExists3(dir)) {
|
|
6096
6096
|
await mkdirs(dir);
|
|
6097
6097
|
}
|
|
6098
|
-
return
|
|
6098
|
+
return fs20.symlink(srcpath, dstpath, toType);
|
|
6099
6099
|
}
|
|
6100
6100
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
6101
6101
|
let stats;
|
|
6102
6102
|
try {
|
|
6103
|
-
stats =
|
|
6103
|
+
stats = fs20.lstatSync(dstpath);
|
|
6104
6104
|
} catch {
|
|
6105
6105
|
}
|
|
6106
6106
|
if (stats && stats.isSymbolicLink()) {
|
|
6107
|
-
const srcStat =
|
|
6108
|
-
const dstStat =
|
|
6107
|
+
const srcStat = fs20.statSync(srcpath);
|
|
6108
|
+
const dstStat = fs20.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 = path24.dirname(dstpath);
|
|
6115
|
+
const exists = fs20.existsSync(dir);
|
|
6116
|
+
if (exists) return fs20.symlinkSync(srcpath, dstpath, type);
|
|
6117
6117
|
mkdirsSync(dir);
|
|
6118
|
-
return
|
|
6118
|
+
return fs20.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 fs20 = 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(fs20.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 fs20 = options.fs || _fs;
|
|
6208
6208
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
6209
6209
|
try {
|
|
6210
|
-
let content =
|
|
6210
|
+
let content = fs20.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 fs20 = options.fs || _fs;
|
|
6224
6224
|
const str = stringify(obj, options);
|
|
6225
|
-
await universalify.fromCallback(
|
|
6225
|
+
await universalify.fromCallback(fs20.writeFile)(file, str, options);
|
|
6226
6226
|
}
|
|
6227
6227
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
6228
6228
|
function writeFileSync2(file, obj, options = {}) {
|
|
6229
|
-
const
|
|
6229
|
+
const fs20 = options.fs || _fs;
|
|
6230
6230
|
const str = stringify(obj, options);
|
|
6231
|
-
return
|
|
6231
|
+
return fs20.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 fs20 = require_fs();
|
|
6263
|
+
var path24 = 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 = path24.dirname(file);
|
|
6268
6268
|
if (!await pathExists3(dir)) {
|
|
6269
6269
|
await mkdir.mkdirs(dir);
|
|
6270
6270
|
}
|
|
6271
|
-
return
|
|
6271
|
+
return fs20.writeFile(file, data, encoding);
|
|
6272
6272
|
}
|
|
6273
6273
|
function outputFileSync(file, ...args) {
|
|
6274
|
-
const dir =
|
|
6275
|
-
if (!
|
|
6274
|
+
const dir = path24.dirname(file);
|
|
6275
|
+
if (!fs20.existsSync(dir)) {
|
|
6276
6276
|
mkdir.mkdirsSync(dir);
|
|
6277
6277
|
}
|
|
6278
|
-
|
|
6278
|
+
fs20.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 fs20 = require_fs();
|
|
6338
|
+
var path24 = 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 = path24.dirname(dest);
|
|
6349
|
+
const parsedParentPath = path24.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 fs20.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 fs20 = require_graceful_fs();
|
|
6390
|
+
var path24 = 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(path24.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 = path24.dirname(dest);
|
|
6405
|
+
const parsedPath = path24.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 (fs20.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
|
+
fs20.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 chalk27 = require_source();
|
|
18206
18206
|
var isUnicodeSupported2 = require_is_unicode_supported();
|
|
18207
18207
|
var main = {
|
|
18208
|
-
info:
|
|
18209
|
-
success:
|
|
18210
|
-
warning:
|
|
18211
|
-
error:
|
|
18208
|
+
info: chalk27.blue("\u2139"),
|
|
18209
|
+
success: chalk27.green("\u2714"),
|
|
18210
|
+
warning: chalk27.yellow("\u26A0"),
|
|
18211
|
+
error: chalk27.red("\u2716")
|
|
18212
18212
|
};
|
|
18213
18213
|
var fallback = {
|
|
18214
|
-
info:
|
|
18215
|
-
success:
|
|
18216
|
-
warning:
|
|
18217
|
-
error:
|
|
18214
|
+
info: chalk27.blue("i"),
|
|
18215
|
+
success: chalk27.green("\u221A"),
|
|
18216
|
+
warning: chalk27.yellow("\u203C"),
|
|
18217
|
+
error: chalk27.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 chalk27 = 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 = chalk27[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 fs20 = (0, node_1.default)();
|
|
27584
27584
|
const handler = (err, buffer) => {
|
|
27585
27585
|
if (fd) {
|
|
27586
|
-
|
|
27586
|
+
fs20.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 = fs20.openSync(filepath, "r");
|
|
27599
27599
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
27600
|
-
|
|
27600
|
+
fs20.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
|
+
fs20.readFile(filepath, handler);
|
|
27613
27613
|
});
|
|
27614
27614
|
exports2.detectFile = detectFile;
|
|
27615
27615
|
var detectFileSync = (filepath, opts = {}) => {
|
|
27616
|
-
const
|
|
27616
|
+
const fs20 = (0, node_1.default)();
|
|
27617
27617
|
if (opts && opts.sampleSize) {
|
|
27618
|
-
const fd =
|
|
27618
|
+
const fd = fs20.openSync(filepath, "r");
|
|
27619
27619
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
27620
|
-
const bytesRead =
|
|
27620
|
+
const bytesRead = fs20.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
|
+
fs20.closeSync(fd);
|
|
27625
27625
|
return (0, exports2.detect)(sample);
|
|
27626
27626
|
}
|
|
27627
|
-
return (0, exports2.detect)(
|
|
27627
|
+
return (0, exports2.detect)(fs20.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(path24) {
|
|
40392
|
+
if (!path24 || typeof path24 !== "string") {
|
|
40393
40393
|
return false;
|
|
40394
40394
|
}
|
|
40395
|
-
var extension2 = extname3("x." +
|
|
40395
|
+
var extension2 = extname3("x." + path24).toLowerCase().substr(1);
|
|
40396
40396
|
if (!extension2) {
|
|
40397
40397
|
return false;
|
|
40398
40398
|
}
|
|
@@ -41497,11 +41497,11 @@ 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 path24 = 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 fs20 = require("fs");
|
|
41505
41505
|
var Stream2 = require("stream").Stream;
|
|
41506
41506
|
var crypto4 = require("crypto");
|
|
41507
41507
|
var mime = require_mime_types();
|
|
@@ -41568,7 +41568,7 @@ var require_form_data = __commonJS({
|
|
|
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
|
+
fs20.stat(value2.path, function(err, stat3) {
|
|
41572
41572
|
if (err) {
|
|
41573
41573
|
callback(err);
|
|
41574
41574
|
return;
|
|
@@ -41625,11 +41625,11 @@ var require_form_data = __commonJS({
|
|
|
41625
41625
|
FormData5.prototype._getContentDisposition = function(value2, options) {
|
|
41626
41626
|
var filename;
|
|
41627
41627
|
if (typeof options.filepath === "string") {
|
|
41628
|
-
filename =
|
|
41628
|
+
filename = path24.normalize(options.filepath).replace(/\\/g, "/");
|
|
41629
41629
|
} else if (options.filename || value2 && (value2.name || value2.path)) {
|
|
41630
|
-
filename =
|
|
41630
|
+
filename = path24.basename(options.filename || value2 && (value2.name || value2.path));
|
|
41631
41631
|
} else if (value2 && value2.readable && hasOwn(value2, "httpVersion")) {
|
|
41632
|
-
filename =
|
|
41632
|
+
filename = path24.basename(value2.client._httpMessage.path || "");
|
|
41633
41633
|
}
|
|
41634
41634
|
if (filename) {
|
|
41635
41635
|
return 'filename="' + filename + '"';
|
|
@@ -43115,9 +43115,9 @@ 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
|
|
43118
|
+
var fs20 = require("fs");
|
|
43119
|
+
var path24 = require("path");
|
|
43120
|
+
var os7 = require("os");
|
|
43121
43121
|
var crypto4 = require("crypto");
|
|
43122
43122
|
var packageJson = require_package();
|
|
43123
43123
|
var version = packageJson.version;
|
|
@@ -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 (fs20.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 = path24.resolve(process.cwd(), ".env.vault");
|
|
43236
43236
|
}
|
|
43237
|
-
if (
|
|
43237
|
+
if (fs20.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] === "~" ? path24.join(os7.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 = path24.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 path25 of optionPaths) {
|
|
43285
43285
|
try {
|
|
43286
|
-
const parsed = DotenvModule.parse(
|
|
43286
|
+
const parsed = DotenvModule.parse(fs20.readFileSync(path25, { 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 ${path25} ${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 = path24.relative(process.cwd(), filePath);
|
|
43306
43306
|
shortPaths.push(relative);
|
|
43307
43307
|
} catch (e) {
|
|
43308
43308
|
if (debug) {
|
|
@@ -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(path24, append2, encoding) {
|
|
44291
44291
|
if (encoding === void 0) {
|
|
44292
44292
|
encoding = DEFAULT_ENCODING;
|
|
44293
44293
|
}
|
|
44294
|
-
this.path =
|
|
44294
|
+
this.path = path24;
|
|
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, path24, 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(path24, 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 path24 = require("path");
|
|
50712
|
+
var fs20 = 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 = path24.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(path24.dirname(filename));
|
|
50732
50732
|
mod._compile("module.exports = require;", filename);
|
|
50733
50733
|
return mod.exports;
|
|
50734
50734
|
}
|
|
50735
|
-
function isDir(
|
|
50735
|
+
function isDir(path25) {
|
|
50736
50736
|
try {
|
|
50737
|
-
const stat3 =
|
|
50737
|
+
const stat3 = fs20.lstatSync(path25);
|
|
50738
50738
|
return stat3.isDirectory();
|
|
50739
50739
|
} catch (e) {
|
|
50740
50740
|
return false;
|
|
@@ -50750,17 +50750,17 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50750
50750
|
"use strict";
|
|
50751
50751
|
var Module = require("module");
|
|
50752
50752
|
var crypto4 = require("crypto");
|
|
50753
|
-
var
|
|
50754
|
-
var
|
|
50753
|
+
var fs20 = require("fs");
|
|
50754
|
+
var path24 = require("path");
|
|
50755
50755
|
var vm = require("vm");
|
|
50756
|
-
var
|
|
50756
|
+
var os7 = 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 = path24.join(directory, name + "BLOB");
|
|
50762
|
+
this._mapFilename = path24.join(directory, name + "MAP");
|
|
50763
|
+
this._lockFilename = path24.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
|
+
fs20.writeFileSync(this._lockFilename, "LOCK", { flag: "wx" });
|
|
50816
50816
|
} catch (error) {
|
|
50817
50817
|
return false;
|
|
50818
50818
|
}
|
|
50819
50819
|
try {
|
|
50820
|
-
|
|
50821
|
-
|
|
50820
|
+
fs20.writeFileSync(this._blobFilename, blobToStore);
|
|
50821
|
+
fs20.writeFileSync(this._mapFilename, mapToStore);
|
|
50822
50822
|
} finally {
|
|
50823
|
-
|
|
50823
|
+
fs20.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 = fs20.readFileSync(this._blobFilename);
|
|
50830
|
+
this._storedMap = JSON.parse(fs20.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 = path24.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);
|
|
@@ -50948,18 +50948,18 @@ var require_v8_compile_cache = __commonJS({
|
|
|
50948
50948
|
}
|
|
50949
50949
|
};
|
|
50950
50950
|
function mkdirpSync(p_) {
|
|
50951
|
-
_mkdirpSync(
|
|
50951
|
+
_mkdirpSync(path24.resolve(p_), 511);
|
|
50952
50952
|
}
|
|
50953
50953
|
function _mkdirpSync(p, mode) {
|
|
50954
50954
|
try {
|
|
50955
|
-
|
|
50955
|
+
fs20.mkdirSync(p, mode);
|
|
50956
50956
|
} catch (err0) {
|
|
50957
50957
|
if (err0.code === "ENOENT") {
|
|
50958
|
-
_mkdirpSync(
|
|
50958
|
+
_mkdirpSync(path24.dirname(p));
|
|
50959
50959
|
_mkdirpSync(p);
|
|
50960
50960
|
} else {
|
|
50961
50961
|
try {
|
|
50962
|
-
const stat3 =
|
|
50962
|
+
const stat3 = fs20.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 = path24.join(os7.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(path24) {
|
|
51203
|
+
return (0, path_1.isAbsolute)(path24);
|
|
51204
51204
|
}
|
|
51205
|
-
function combinePaths(
|
|
51206
|
-
return (0, util_1.normalizeSlashes)((0, path_1.resolve)(
|
|
51205
|
+
function combinePaths(path24, ...paths) {
|
|
51206
|
+
return (0, util_1.normalizeSlashes)((0, path_1.resolve)(path24, ...paths.filter((path25) => path25)));
|
|
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(path24, currentDirectory) {
|
|
51257
|
+
return reducePathComponents(getPathComponents(path24, currentDirectory));
|
|
51258
51258
|
}
|
|
51259
|
-
function getPathComponents(
|
|
51260
|
-
|
|
51261
|
-
return pathComponents(
|
|
51259
|
+
function getPathComponents(path24, currentDirectory = "") {
|
|
51260
|
+
path24 = combinePaths(currentDirectory, path24);
|
|
51261
|
+
return pathComponents(path24, getRootLength(path24));
|
|
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(path24) {
|
|
51287
|
+
const rootLength = getEncodedRootLength(path24);
|
|
51288
51288
|
return rootLength < 0 ? ~rootLength : rootLength;
|
|
51289
51289
|
}
|
|
51290
|
-
function getEncodedRootLength(
|
|
51291
|
-
if (!
|
|
51290
|
+
function getEncodedRootLength(path24) {
|
|
51291
|
+
if (!path24)
|
|
51292
51292
|
return 0;
|
|
51293
|
-
const ch0 =
|
|
51293
|
+
const ch0 = path24.charCodeAt(0);
|
|
51294
51294
|
if (ch0 === 47 || ch0 === 92) {
|
|
51295
|
-
if (
|
|
51295
|
+
if (path24.charCodeAt(1) !== ch0)
|
|
51296
51296
|
return 1;
|
|
51297
|
-
const p1 =
|
|
51297
|
+
const p1 = path24.indexOf(ch0 === 47 ? directorySeparator : altDirectorySeparator, 2);
|
|
51298
51298
|
if (p1 < 0)
|
|
51299
|
-
return
|
|
51299
|
+
return path24.length;
|
|
51300
51300
|
return p1 + 1;
|
|
51301
51301
|
}
|
|
51302
|
-
if (isVolumeCharacter(ch0) &&
|
|
51303
|
-
const ch2 =
|
|
51302
|
+
if (isVolumeCharacter(ch0) && path24.charCodeAt(1) === 58) {
|
|
51303
|
+
const ch2 = path24.charCodeAt(2);
|
|
51304
51304
|
if (ch2 === 47 || ch2 === 92)
|
|
51305
51305
|
return 3;
|
|
51306
|
-
if (
|
|
51306
|
+
if (path24.length === 2)
|
|
51307
51307
|
return 2;
|
|
51308
51308
|
}
|
|
51309
|
-
const schemeEnd =
|
|
51309
|
+
const schemeEnd = path24.indexOf(urlSchemeSeparator);
|
|
51310
51310
|
if (schemeEnd !== -1) {
|
|
51311
51311
|
const authorityStart = schemeEnd + urlSchemeSeparator.length;
|
|
51312
|
-
const authorityEnd =
|
|
51312
|
+
const authorityEnd = path24.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 = path24.slice(0, schemeEnd);
|
|
51315
|
+
const authority = path24.slice(authorityStart, authorityEnd);
|
|
51316
|
+
if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path24.charCodeAt(authorityEnd + 1))) {
|
|
51317
|
+
const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path24, authorityEnd + 2);
|
|
51318
51318
|
if (volumeSeparatorEnd !== -1) {
|
|
51319
|
-
if (
|
|
51319
|
+
if (path24.charCodeAt(volumeSeparatorEnd) === 47) {
|
|
51320
51320
|
return ~(volumeSeparatorEnd + 1);
|
|
51321
51321
|
}
|
|
51322
|
-
if (volumeSeparatorEnd ===
|
|
51322
|
+
if (volumeSeparatorEnd === path24.length) {
|
|
51323
51323
|
return ~volumeSeparatorEnd;
|
|
51324
51324
|
}
|
|
51325
51325
|
}
|
|
51326
51326
|
}
|
|
51327
51327
|
return ~(authorityEnd + 1);
|
|
51328
51328
|
}
|
|
51329
|
-
return ~
|
|
51329
|
+
return ~path24.length;
|
|
51330
51330
|
}
|
|
51331
51331
|
return 0;
|
|
51332
51332
|
}
|
|
51333
|
-
function hasTrailingDirectorySeparator(
|
|
51334
|
-
return
|
|
51333
|
+
function hasTrailingDirectorySeparator(path24) {
|
|
51334
|
+
return path24.length > 0 && isAnyDirectorySeparator(path24.charCodeAt(path24.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(path24) {
|
|
51340
|
+
if (hasTrailingDirectorySeparator(path24)) {
|
|
51341
|
+
return path24.substr(0, path24.length - 1);
|
|
51342
51342
|
}
|
|
51343
|
-
return
|
|
51343
|
+
return path24;
|
|
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(path24, rootLength) {
|
|
51377
|
+
const root = path24.substring(0, rootLength);
|
|
51378
|
+
const rest = path24.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((path24) => tsconfigRelativeResolver(path24, 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(path24) {
|
|
51805
|
+
const matched = matchPatterns(patternTypePairs, (_2) => _2.pattern, path24);
|
|
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(path24) {
|
|
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 fs20 = require("fs");
|
|
52032
52032
|
var { versionGteLt } = require_util2();
|
|
52033
|
-
function internalModuleReadJSON(
|
|
52033
|
+
function internalModuleReadJSON(path24) {
|
|
52034
52034
|
let string;
|
|
52035
52035
|
try {
|
|
52036
|
-
string =
|
|
52036
|
+
string = fs20.readFileSync(path24, "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(path24) {
|
|
52045
|
+
const stat3 = fs20.statSync(path24, { 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(path24) {
|
|
52051
52051
|
try {
|
|
52052
|
-
const stat3 =
|
|
52052
|
+
const stat3 = fs20.statSync(path24);
|
|
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 path24 = 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((path25, base, type = "package") => {
|
|
52369
|
+
return `Cannot find ${type} '${path25}' 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")),
|
|
@@ -52402,11 +52402,11 @@ var require_node_internal_errors = __commonJS({
|
|
|
52402
52402
|
return err;
|
|
52403
52403
|
}
|
|
52404
52404
|
function getErrRequireEsmMessage(filename, parentPath = null, packageJsonPath = null) {
|
|
52405
|
-
const ext2 =
|
|
52405
|
+
const ext2 = path24.extname(filename);
|
|
52406
52406
|
let msg = `Must use import to load ES Module: ${filename}`;
|
|
52407
52407
|
if (parentPath && packageJsonPath) {
|
|
52408
|
-
const
|
|
52409
|
-
const basename3 =
|
|
52408
|
+
const path25 = require("path");
|
|
52409
|
+
const basename3 = path25.basename(filename) === path25.basename(parentPath) ? filename : path25.basename(filename);
|
|
52410
52410
|
msg += `
|
|
52411
52411
|
require() of ES modules is not supported.
|
|
52412
52412
|
require() of ${filename} ${parentPath ? `from ${parentPath} ` : ""}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.
|
|
@@ -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 fs20 = require("fs");
|
|
52457
|
+
var path24 = require("path");
|
|
52458
|
+
var { sep: sep2 } = path24;
|
|
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 = path24.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 = path24.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(path24.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 = path24.resolve(requestPath, pkg);
|
|
52552
|
+
let actual = tryReplacementExtensions(filename, isMain) || tryFile(filename, isMain) || tryExtensions(filename, exts, isMain) || tryExtensions(path24.resolve(filename, "index"), exts, isMain);
|
|
52553
52553
|
if (actual === false) {
|
|
52554
|
-
actual = tryExtensions(
|
|
52554
|
+
actual = tryExtensions(path24.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 = path24.resolve(requestPath, "package.json");
|
|
52561
52561
|
err.requestPath = originalPath;
|
|
52562
52562
|
throw err;
|
|
52563
52563
|
} else {
|
|
52564
|
-
const jsonPath =
|
|
52564
|
+
const jsonPath = path24.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 path24.resolve(requestPath);
|
|
52580
52580
|
}
|
|
52581
52581
|
return toRealPath(requestPath);
|
|
52582
52582
|
}
|
|
52583
52583
|
function toRealPath(requestPath) {
|
|
52584
|
-
return
|
|
52584
|
+
return fs20.realpathSync(requestPath, {
|
|
52585
52585
|
// [internalFS.realpathCacheKey]: realpathCache
|
|
52586
52586
|
});
|
|
52587
52587
|
}
|
|
@@ -52635,7 +52635,7 @@ 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() + path24.sep;
|
|
52639
52639
|
} catch {
|
|
52640
52640
|
return false;
|
|
52641
52641
|
}
|
|
@@ -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 = path24.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 = path24.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 = path24.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 = path24.resolve(basePath);
|
|
52731
52731
|
} else {
|
|
52732
52732
|
filename = toRealPath(basePath);
|
|
52733
52733
|
}
|
|
52734
52734
|
} else if (preserveSymlinksMain) {
|
|
52735
|
-
filename =
|
|
52735
|
+
filename = path24.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 path25 = options.paths[i];
|
|
52773
|
+
fakeParent.paths = Module._nodeModulePaths(path25);
|
|
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]))
|
|
@@ -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
|
+
path24.resolve(pkgPath, "package.json")
|
|
52847
52847
|
);
|
|
52848
52848
|
throw err;
|
|
52849
52849
|
}
|
|
52850
|
-
function createEsmNotFoundErr(request,
|
|
52850
|
+
function createEsmNotFoundErr(request, path25) {
|
|
52851
52851
|
const err = new Error(`Cannot find module '${request}'`);
|
|
52852
52852
|
err.code = "MODULE_NOT_FOUND";
|
|
52853
|
-
if (
|
|
52854
|
-
err.path =
|
|
52853
|
+
if (path25)
|
|
52854
|
+
err.path = path25;
|
|
52855
52855
|
return err;
|
|
52856
52856
|
}
|
|
52857
52857
|
return {
|
|
@@ -52868,7 +52868,7 @@ var require_node_internal_modules_cjs_loader = __commonJS({
|
|
|
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
52870
|
const parentPath = module3.parent && module3.parent.filename;
|
|
52871
|
-
const packageJsonPath = pkg ?
|
|
52871
|
+
const packageJsonPath = pkg ? path24.resolve(pkg.path, "package.json") : null;
|
|
52872
52872
|
throw createErrRequireEsm(filename, parentPath, packageJsonPath);
|
|
52873
52873
|
}
|
|
52874
52874
|
}
|
|
@@ -59661,10 +59661,10 @@ var require_base = __commonJS({
|
|
|
59661
59661
|
}
|
|
59662
59662
|
return components;
|
|
59663
59663
|
}
|
|
59664
|
-
function clonePath(
|
|
59664
|
+
function clonePath(path24) {
|
|
59665
59665
|
return {
|
|
59666
|
-
newPos:
|
|
59667
|
-
components:
|
|
59666
|
+
newPos: path24.newPos,
|
|
59667
|
+
components: path24.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(path24) {
|
|
61365
|
+
this.path = path24;
|
|
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(path24) {
|
|
61375
|
+
if (path24 === 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(path24);
|
|
61379
61379
|
try {
|
|
61380
|
-
return (0, fs_1.readFileSync)(
|
|
61380
|
+
return (0, fs_1.readFileSync)(path24, "utf8");
|
|
61381
61381
|
} catch (err) {
|
|
61382
61382
|
}
|
|
61383
61383
|
}
|
|
61384
|
-
function fileExists(
|
|
61385
|
-
if (
|
|
61384
|
+
function fileExists(path24) {
|
|
61385
|
+
if (path24 === 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(path24);
|
|
61389
61389
|
try {
|
|
61390
|
-
const stats = (0, fs_1.statSync)(
|
|
61390
|
+
const stats = (0, fs_1.statSync)(path24);
|
|
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 path24 = match2[2];
|
|
62246
|
+
return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path24) ? path24 : "/" + path24, match2[3] || "", match2[4] || "");
|
|
62247
62247
|
}
|
|
62248
|
-
function makeUrl(scheme, user, host, port,
|
|
62248
|
+
function makeUrl(scheme, user, host, port, path24, query, hash) {
|
|
62249
62249
|
return {
|
|
62250
62250
|
scheme,
|
|
62251
62251
|
user,
|
|
62252
62252
|
host,
|
|
62253
62253
|
port,
|
|
62254
|
-
path:
|
|
62254
|
+
path: path24,
|
|
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(path24) {
|
|
62285
|
+
if (path24.endsWith("/.."))
|
|
62286
|
+
return path24;
|
|
62287
|
+
const index = path24.lastIndexOf("/");
|
|
62288
|
+
return path24.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 path24 = "";
|
|
62327
62327
|
for (let i = 1; i < pointer; i++) {
|
|
62328
|
-
|
|
62328
|
+
path24 += "/" + pieces[i];
|
|
62329
62329
|
}
|
|
62330
|
-
if (!
|
|
62331
|
-
|
|
62330
|
+
if (!path24 || addTrailingSlash && !path24.endsWith("/..")) {
|
|
62331
|
+
path24 += "/";
|
|
62332
62332
|
}
|
|
62333
|
-
url2.path =
|
|
62333
|
+
url2.path = path24;
|
|
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 path24 = url2.path.slice(1);
|
|
62375
|
+
if (!path24)
|
|
62376
62376
|
return queryHash || ".";
|
|
62377
|
-
if (isRelative(base || input) && !isRelative(
|
|
62378
|
-
return "./" +
|
|
62377
|
+
if (isRelative(base || input) && !isRelative(path24)) {
|
|
62378
|
+
return "./" + path24 + queryHash;
|
|
62379
62379
|
}
|
|
62380
|
-
return
|
|
62380
|
+
return path24 + 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(path24) {
|
|
62410
|
+
if (!path24)
|
|
62411
62411
|
return "";
|
|
62412
|
-
const index =
|
|
62413
|
-
return
|
|
62412
|
+
const index = path24.lastIndexOf("/");
|
|
62413
|
+
return path24.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 path24 = require("path");
|
|
62819
62819
|
var { fileURLToPath: fileURLToPath3, pathToFileURL } = require("url");
|
|
62820
62820
|
var util3 = require("util");
|
|
62821
|
-
var
|
|
62821
|
+
var fs20;
|
|
62822
62822
|
try {
|
|
62823
|
-
|
|
62824
|
-
if (!
|
|
62825
|
-
|
|
62823
|
+
fs20 = require("fs");
|
|
62824
|
+
if (!fs20.existsSync || !fs20.readFileSync) {
|
|
62825
|
+
fs20 = 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(path25) {
|
|
62964
|
+
path25 = path25.trim();
|
|
62965
|
+
if (/^file:/.test(path25)) {
|
|
62966
|
+
path25 = path25.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(path25);
|
|
62974
62974
|
if (hasFileContentsCacheFromKey(key)) {
|
|
62975
62975
|
return getFileContentsCacheFromKey(key);
|
|
62976
62976
|
}
|
|
62977
62977
|
var contents = "";
|
|
62978
62978
|
try {
|
|
62979
|
-
if (!
|
|
62979
|
+
if (!fs20) {
|
|
62980
62980
|
var xhr = new XMLHttpRequest();
|
|
62981
62981
|
xhr.open(
|
|
62982
62982
|
"GET",
|
|
62983
|
-
|
|
62983
|
+
path25,
|
|
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 (fs20.existsSync(path25)) {
|
|
62992
|
+
contents = fs20.readFileSync(path25, "utf8");
|
|
62993
62993
|
}
|
|
62994
62994
|
} catch (er) {
|
|
62995
62995
|
}
|
|
62996
|
-
return setFileContentsCache(
|
|
62996
|
+
return setFileContentsCache(path25, 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 (path24.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 (path24.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 (path24.isAbsolute(url2)) {
|
|
63021
|
+
return path24.normalize(url2);
|
|
63022
63022
|
}
|
|
63023
|
-
return
|
|
63023
|
+
return path24.join(file, "..", decodeURI(url2));
|
|
63024
63024
|
}
|
|
63025
63025
|
if (isAbsoluteUrl(url2) || isSchemeRelativeUrl(url2)) {
|
|
63026
63026
|
return url2;
|
|
63027
63027
|
}
|
|
63028
|
-
return
|
|
63028
|
+
return path24.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 (path24.isAbsolute(pathOrUrl)) return pathToFileURL(pathOrUrl).toString();
|
|
63038
|
+
} else if (path24.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
|
+
path24.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 && fs20 && fs20.existsSync(sourceAsPath)) {
|
|
63334
63334
|
try {
|
|
63335
|
-
contents =
|
|
63335
|
+
contents = fs20.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(path24) {
|
|
63633
|
+
const stats = statSync(path24, { throwIfNoEntry: false });
|
|
63634
63634
|
if (stats != null) return stats;
|
|
63635
63635
|
return statsIfNotFound;
|
|
63636
63636
|
}
|
|
63637
|
-
function tryStatSyncWithErrors(
|
|
63637
|
+
function tryStatSyncWithErrors(path24) {
|
|
63638
63638
|
try {
|
|
63639
|
-
return statSync(
|
|
63639
|
+
return statSync(path24);
|
|
63640
63640
|
} catch {
|
|
63641
63641
|
return statsIfNotFound;
|
|
63642
63642
|
}
|
|
63643
63643
|
}
|
|
63644
|
-
function getPackageConfig(
|
|
63645
|
-
const existing = packageJSONCache.get(
|
|
63644
|
+
function getPackageConfig(path24, specifier, base) {
|
|
63645
|
+
const existing = packageJSONCache.get(path24);
|
|
63646
63646
|
if (existing !== void 0) {
|
|
63647
63647
|
return existing;
|
|
63648
63648
|
}
|
|
63649
|
-
const source = packageJsonReader.read(
|
|
63649
|
+
const source = packageJsonReader.read(path24).string;
|
|
63650
63650
|
if (source === void 0) {
|
|
63651
63651
|
const packageConfig2 = {
|
|
63652
|
-
pjsonPath:
|
|
63652
|
+
pjsonPath: path24,
|
|
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(path24, 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
|
+
path24,
|
|
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: path24,
|
|
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(path24, 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 path25 = fileURLToPath3(resolved);
|
|
63805
63805
|
let file2 = resolveExtensionsWithTryExactName(resolved);
|
|
63806
63806
|
if (file2 !== void 0) return file2;
|
|
63807
|
-
if (!StringPrototypeEndsWith(
|
|
63807
|
+
if (!StringPrototypeEndsWith(path25, "/")) {
|
|
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 path24 = fileURLToPath3(file);
|
|
63821
|
+
const stats = tryStatSync(StringPrototypeEndsWith(path24, "/") ? StringPrototypeSlice(path24, -1) : path24);
|
|
63822
63822
|
if (stats.isDirectory()) {
|
|
63823
|
-
const err = new ERR_UNSUPPORTED_DIR_IMPORT(
|
|
63823
|
+
const err = new ERR_UNSUPPORTED_DIR_IMPORT(path24, 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
|
+
path24 || 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 path24 = pathOrUrl;
|
|
64876
|
+
if (experimentalEsmLoader && path24.startsWith("file://")) {
|
|
64877
64877
|
try {
|
|
64878
|
-
|
|
64878
|
+
path24 = (0, url_1.fileURLToPath)(path24);
|
|
64879
64879
|
} catch (e) {
|
|
64880
64880
|
}
|
|
64881
64881
|
}
|
|
64882
|
-
|
|
64883
|
-
return ((_a3 = outputCache.get(
|
|
64882
|
+
path24 = (0, util_1.normalizeSlashes)(path24);
|
|
64883
|
+
return ((_a3 = outputCache.get(path24)) === 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(path24) {
|
|
64910
|
+
const lastDotIndex = path24.lastIndexOf(".");
|
|
64911
64911
|
if (lastDotIndex >= 0) {
|
|
64912
|
-
const ext2 =
|
|
64912
|
+
const ext2 = path24.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, (path24, file, writeByteOrderMark) => {
|
|
65128
|
+
if (path24.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(path24, 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 path24 = (0, util_1.normalizeSlashes)(relname);
|
|
65300
|
+
return ignore.some((x) => x.test(path24));
|
|
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 os7 = 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 = os7.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_chalk26 = __toESM(require_source());
|
|
67125
|
+
var import_path19 = __toESM(require("path"));
|
|
67126
|
+
var import_fs_extra17 = __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, path24 = "", value2) => {
|
|
69484
69484
|
let pointer = obj;
|
|
69485
|
-
|
|
69485
|
+
path24.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, path24 = "", defaultValue) => {
|
|
69496
|
+
const travel = (regexp) => String.prototype.split.call(path24, 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(path24, key, dots) {
|
|
70376
|
+
if (!path24) return key;
|
|
70377
|
+
return path24.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, path24) {
|
|
70426
70426
|
let arr = value2;
|
|
70427
|
-
if (value2 && !
|
|
70427
|
+
if (value2 && !path24 && 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(path24, 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, path24) {
|
|
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 " + path24.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
|
+
path24,
|
|
70467
70467
|
exposedHelpers
|
|
70468
70468
|
);
|
|
70469
70469
|
if (result === true) {
|
|
70470
|
-
build(el,
|
|
70470
|
+
build(el, path24 ? path24.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, path24, 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(path24, value2, target, index) {
|
|
70713
|
+
let name = path24[index++];
|
|
70714
70714
|
if (name === "__proto__") return true;
|
|
70715
70715
|
const isNumericKey = Number.isFinite(+name);
|
|
70716
|
-
const isLast = index >=
|
|
70716
|
+
const isLast = index >= path24.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(path24, 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 path24;
|
|
72052
72052
|
try {
|
|
72053
|
-
|
|
72053
|
+
path24 = 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: path24,
|
|
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, path24, 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(path24)) {
|
|
72314
|
+
cookie.push(`path=${path24}`);
|
|
72315
72315
|
}
|
|
72316
72316
|
if (utils_default.isString(domain)) {
|
|
72317
72317
|
cookie.push(`domain=${domain}`);
|
|
@@ -76334,7 +76334,7 @@ var OAuthTokenService = class {
|
|
|
76334
76334
|
res.end("<h1>404 - Not Found</h1><p>This is the OAuth callback server.</p>");
|
|
76335
76335
|
}
|
|
76336
76336
|
});
|
|
76337
|
-
this.server.listen(port,
|
|
76337
|
+
this.server.listen(port, () => {
|
|
76338
76338
|
console.log(import_chalk2.default.gray(`\u{1F5A5}\uFE0F Local server started on port ${port}`));
|
|
76339
76339
|
});
|
|
76340
76340
|
this.server.on("error", (error) => {
|
|
@@ -76465,7 +76465,7 @@ var OAuthTokenService = class {
|
|
|
76465
76465
|
isPortAvailable(port) {
|
|
76466
76466
|
return new Promise((resolve) => {
|
|
76467
76467
|
const server = import_http4.default.createServer();
|
|
76468
|
-
server.listen(port,
|
|
76468
|
+
server.listen(port, () => {
|
|
76469
76469
|
server.close(() => resolve(true));
|
|
76470
76470
|
});
|
|
76471
76471
|
server.on("error", () => resolve(false));
|
|
@@ -77636,6 +77636,9 @@ var HubDocApiService = class {
|
|
|
77636
77636
|
if (mapping.autoClassify !== void 0) {
|
|
77637
77637
|
formData.append("auto_classify", String(mapping.autoClassify));
|
|
77638
77638
|
}
|
|
77639
|
+
if (mapping.externalId) {
|
|
77640
|
+
formData.append("external_id", mapping.externalId);
|
|
77641
|
+
}
|
|
77639
77642
|
if (mapping.metadata) {
|
|
77640
77643
|
formData.append("metadata_user", JSON.stringify(mapping.metadata));
|
|
77641
77644
|
}
|
|
@@ -81990,12 +81993,12 @@ var PathBase = class {
|
|
|
81990
81993
|
/**
|
|
81991
81994
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
81992
81995
|
*/
|
|
81993
|
-
resolve(
|
|
81994
|
-
if (!
|
|
81996
|
+
resolve(path24) {
|
|
81997
|
+
if (!path24) {
|
|
81995
81998
|
return this;
|
|
81996
81999
|
}
|
|
81997
|
-
const rootPath = this.getRootString(
|
|
81998
|
-
const dir =
|
|
82000
|
+
const rootPath = this.getRootString(path24);
|
|
82001
|
+
const dir = path24.substring(rootPath.length);
|
|
81999
82002
|
const dirParts = dir.split(this.splitSep);
|
|
82000
82003
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
82001
82004
|
return result;
|
|
@@ -82747,8 +82750,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
82747
82750
|
/**
|
|
82748
82751
|
* @internal
|
|
82749
82752
|
*/
|
|
82750
|
-
getRootString(
|
|
82751
|
-
return import_node_path2.win32.parse(
|
|
82753
|
+
getRootString(path24) {
|
|
82754
|
+
return import_node_path2.win32.parse(path24).root;
|
|
82752
82755
|
}
|
|
82753
82756
|
/**
|
|
82754
82757
|
* @internal
|
|
@@ -82794,8 +82797,8 @@ var PathPosix = class _PathPosix extends PathBase {
|
|
|
82794
82797
|
/**
|
|
82795
82798
|
* @internal
|
|
82796
82799
|
*/
|
|
82797
|
-
getRootString(
|
|
82798
|
-
return
|
|
82800
|
+
getRootString(path24) {
|
|
82801
|
+
return path24.startsWith("/") ? "/" : "";
|
|
82799
82802
|
}
|
|
82800
82803
|
/**
|
|
82801
82804
|
* @internal
|
|
@@ -82844,8 +82847,8 @@ var PathScurryBase = class {
|
|
|
82844
82847
|
*
|
|
82845
82848
|
* @internal
|
|
82846
82849
|
*/
|
|
82847
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
82848
|
-
this.#fs = fsFromOption(
|
|
82850
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs20 = defaultFS } = {}) {
|
|
82851
|
+
this.#fs = fsFromOption(fs20);
|
|
82849
82852
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
82850
82853
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
82851
82854
|
}
|
|
@@ -82884,11 +82887,11 @@ var PathScurryBase = class {
|
|
|
82884
82887
|
/**
|
|
82885
82888
|
* Get the depth of a provided path, string, or the cwd
|
|
82886
82889
|
*/
|
|
82887
|
-
depth(
|
|
82888
|
-
if (typeof
|
|
82889
|
-
|
|
82890
|
+
depth(path24 = this.cwd) {
|
|
82891
|
+
if (typeof path24 === "string") {
|
|
82892
|
+
path24 = this.cwd.resolve(path24);
|
|
82890
82893
|
}
|
|
82891
|
-
return
|
|
82894
|
+
return path24.depth();
|
|
82892
82895
|
}
|
|
82893
82896
|
/**
|
|
82894
82897
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -83375,9 +83378,9 @@ var PathScurryBase = class {
|
|
|
83375
83378
|
process3();
|
|
83376
83379
|
return results;
|
|
83377
83380
|
}
|
|
83378
|
-
chdir(
|
|
83381
|
+
chdir(path24 = this.cwd) {
|
|
83379
83382
|
const oldCwd = this.cwd;
|
|
83380
|
-
this.cwd = typeof
|
|
83383
|
+
this.cwd = typeof path24 === "string" ? this.cwd.resolve(path24) : path24;
|
|
83381
83384
|
this.cwd[setAsCwd](oldCwd);
|
|
83382
83385
|
}
|
|
83383
83386
|
};
|
|
@@ -83403,8 +83406,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
83403
83406
|
/**
|
|
83404
83407
|
* @internal
|
|
83405
83408
|
*/
|
|
83406
|
-
newRoot(
|
|
83407
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
83409
|
+
newRoot(fs20) {
|
|
83410
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs20 });
|
|
83408
83411
|
}
|
|
83409
83412
|
/**
|
|
83410
83413
|
* Return true if the provided path string is an absolute path
|
|
@@ -83432,8 +83435,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
83432
83435
|
/**
|
|
83433
83436
|
* @internal
|
|
83434
83437
|
*/
|
|
83435
|
-
newRoot(
|
|
83436
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
83438
|
+
newRoot(fs20) {
|
|
83439
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs20 });
|
|
83437
83440
|
}
|
|
83438
83441
|
/**
|
|
83439
83442
|
* Return true if the provided path string is an absolute path
|
|
@@ -83733,8 +83736,8 @@ var MatchRecord = class {
|
|
|
83733
83736
|
}
|
|
83734
83737
|
// match, absolute, ifdir
|
|
83735
83738
|
entries() {
|
|
83736
|
-
return [...this.store.entries()].map(([
|
|
83737
|
-
|
|
83739
|
+
return [...this.store.entries()].map(([path24, n]) => [
|
|
83740
|
+
path24,
|
|
83738
83741
|
!!(n & 2),
|
|
83739
83742
|
!!(n & 1)
|
|
83740
83743
|
]);
|
|
@@ -83939,9 +83942,9 @@ var GlobUtil = class {
|
|
|
83939
83942
|
signal;
|
|
83940
83943
|
maxDepth;
|
|
83941
83944
|
includeChildMatches;
|
|
83942
|
-
constructor(patterns,
|
|
83945
|
+
constructor(patterns, path24, opts) {
|
|
83943
83946
|
this.patterns = patterns;
|
|
83944
|
-
this.path =
|
|
83947
|
+
this.path = path24;
|
|
83945
83948
|
this.opts = opts;
|
|
83946
83949
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
83947
83950
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -83960,11 +83963,11 @@ var GlobUtil = class {
|
|
|
83960
83963
|
});
|
|
83961
83964
|
}
|
|
83962
83965
|
}
|
|
83963
|
-
#ignored(
|
|
83964
|
-
return this.seen.has(
|
|
83966
|
+
#ignored(path24) {
|
|
83967
|
+
return this.seen.has(path24) || !!this.#ignore?.ignored?.(path24);
|
|
83965
83968
|
}
|
|
83966
|
-
#childrenIgnored(
|
|
83967
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
83969
|
+
#childrenIgnored(path24) {
|
|
83970
|
+
return !!this.#ignore?.childrenIgnored?.(path24);
|
|
83968
83971
|
}
|
|
83969
83972
|
// backpressure mechanism
|
|
83970
83973
|
pause() {
|
|
@@ -84179,8 +84182,8 @@ var GlobUtil = class {
|
|
|
84179
84182
|
};
|
|
84180
84183
|
var GlobWalker = class extends GlobUtil {
|
|
84181
84184
|
matches = /* @__PURE__ */ new Set();
|
|
84182
|
-
constructor(patterns,
|
|
84183
|
-
super(patterns,
|
|
84185
|
+
constructor(patterns, path24, opts) {
|
|
84186
|
+
super(patterns, path24, opts);
|
|
84184
84187
|
}
|
|
84185
84188
|
matchEmit(e) {
|
|
84186
84189
|
this.matches.add(e);
|
|
@@ -84217,8 +84220,8 @@ var GlobWalker = class extends GlobUtil {
|
|
|
84217
84220
|
};
|
|
84218
84221
|
var GlobStream = class extends GlobUtil {
|
|
84219
84222
|
results;
|
|
84220
|
-
constructor(patterns,
|
|
84221
|
-
super(patterns,
|
|
84223
|
+
constructor(patterns, path24, opts) {
|
|
84224
|
+
super(patterns, path24, opts);
|
|
84222
84225
|
this.results = new Minipass({
|
|
84223
84226
|
signal: this.signal,
|
|
84224
84227
|
objectMode: true
|
|
@@ -84528,6 +84531,7 @@ var CsvManager = class {
|
|
|
84528
84531
|
filePath,
|
|
84529
84532
|
targetFolder: "",
|
|
84530
84533
|
workspace: "",
|
|
84534
|
+
externalId: "",
|
|
84531
84535
|
metadata: "",
|
|
84532
84536
|
permissions: "",
|
|
84533
84537
|
autoClassify: "false",
|
|
@@ -84544,6 +84548,7 @@ var CsvManager = class {
|
|
|
84544
84548
|
{ id: "filePath", title: "File Path" },
|
|
84545
84549
|
{ id: "targetFolder", title: "Target Folder" },
|
|
84546
84550
|
{ id: "workspace", title: "Workspace" },
|
|
84551
|
+
{ id: "externalId", title: "External ID" },
|
|
84547
84552
|
{ id: "metadata", title: "Metadata (key: value, parent.child: value)" },
|
|
84548
84553
|
{ id: "permissions", title: "Permissions (users:r:email1,email2 | users:w:admin | groups:Group Name)" },
|
|
84549
84554
|
{ id: "autoClassify", title: "Auto Classify" },
|
|
@@ -84587,6 +84592,7 @@ var CsvManager = class {
|
|
|
84587
84592
|
filePath: data["File Path"] ?? data.filePath,
|
|
84588
84593
|
targetFolder: cleanValue(data["Target Folder"] ?? data.targetFolder),
|
|
84589
84594
|
workspace: cleanValue(data["Workspace"] ?? data.workspace),
|
|
84595
|
+
externalId: cleanValue(data["External ID"] ?? data.externalId),
|
|
84590
84596
|
metadata: this.parseMetadata(
|
|
84591
84597
|
data["Metadata (key: value, parent.child: value)"] || data["Metadata (JSON)"] || data.Metadata || data.metadata
|
|
84592
84598
|
),
|
|
@@ -84697,8 +84703,8 @@ var CsvManager = class {
|
|
|
84697
84703
|
/**
|
|
84698
84704
|
* Set nested value in object using dot notation (e.g., "parent.child.key")
|
|
84699
84705
|
*/
|
|
84700
|
-
setNestedValue(obj,
|
|
84701
|
-
const keys =
|
|
84706
|
+
setNestedValue(obj, path24, value2) {
|
|
84707
|
+
const keys = path24.split(".");
|
|
84702
84708
|
let current = obj;
|
|
84703
84709
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
84704
84710
|
const key = keys[i];
|
|
@@ -84886,6 +84892,7 @@ var CsvManager = class {
|
|
|
84886
84892
|
filePath: m.filePath,
|
|
84887
84893
|
targetFolder: m.targetFolder || "",
|
|
84888
84894
|
workspace: m.workspace || "",
|
|
84895
|
+
externalId: m.externalId || "",
|
|
84889
84896
|
metadata: this.serializeMetadata(m.metadata),
|
|
84890
84897
|
permissions: this.serializePermissions(m.permissions),
|
|
84891
84898
|
autoClassify: m.autoClassify !== void 0 ? String(m.autoClassify) : "false",
|
|
@@ -84902,6 +84909,7 @@ var CsvManager = class {
|
|
|
84902
84909
|
{ id: "filePath", title: "File Path" },
|
|
84903
84910
|
{ id: "targetFolder", title: "Target Folder" },
|
|
84904
84911
|
{ id: "workspace", title: "Workspace" },
|
|
84912
|
+
{ id: "externalId", title: "External ID" },
|
|
84905
84913
|
{ id: "metadata", title: "Metadata (key: value, parent.child: value)" },
|
|
84906
84914
|
{ id: "permissions", title: "Permissions (users:r:email1,email2 | users:w:admin | groups:Group Name)" },
|
|
84907
84915
|
{ id: "autoClassify", title: "Auto Classify" },
|
|
@@ -85987,8 +85995,8 @@ var CsvManager2 = class {
|
|
|
85987
85995
|
/**
|
|
85988
85996
|
* Set nested value in object using dot notation (e.g., "parent.child.key")
|
|
85989
85997
|
*/
|
|
85990
|
-
setNestedValue(obj,
|
|
85991
|
-
const keys =
|
|
85998
|
+
setNestedValue(obj, path24, value2) {
|
|
85999
|
+
const keys = path24.split(".");
|
|
85992
86000
|
let current = obj;
|
|
85993
86001
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
85994
86002
|
const key = keys[i];
|
|
@@ -87133,7 +87141,10 @@ async function handlePluginImport(mappingFile, options) {
|
|
|
87133
87141
|
}
|
|
87134
87142
|
|
|
87135
87143
|
// apps/cli/cli/handlers/auth-handlers.ts
|
|
87136
|
-
var
|
|
87144
|
+
var import_os4 = __toESM(require("os"));
|
|
87145
|
+
var import_path15 = __toESM(require("path"));
|
|
87146
|
+
var import_fs_extra13 = __toESM(require_lib());
|
|
87147
|
+
var import_chalk24 = __toESM(require_source());
|
|
87137
87148
|
var import_child_process4 = require("child_process");
|
|
87138
87149
|
|
|
87139
87150
|
// apps/cli/cli/output/index.ts
|
|
@@ -87172,8 +87183,8 @@ function truncate(value2, max) {
|
|
|
87172
87183
|
if (!max || value2.length <= max) return value2;
|
|
87173
87184
|
return value2.slice(0, max - 1) + "\u2026";
|
|
87174
87185
|
}
|
|
87175
|
-
function get(obj,
|
|
87176
|
-
return
|
|
87186
|
+
function get(obj, path24) {
|
|
87187
|
+
return path24.split(".").reduce((acc, k) => acc == null ? acc : acc[k], obj);
|
|
87177
87188
|
}
|
|
87178
87189
|
function printTable(rows, columns) {
|
|
87179
87190
|
if (!rows || rows.length === 0) {
|
|
@@ -87414,6 +87425,110 @@ async function buildApiContext(out) {
|
|
|
87414
87425
|
};
|
|
87415
87426
|
}
|
|
87416
87427
|
|
|
87428
|
+
// apps/cli/services/device-auth-service.ts
|
|
87429
|
+
var import_os3 = __toESM(require("os"));
|
|
87430
|
+
var DEVICE_START_PATH = "/api/v1/cli/auth/device";
|
|
87431
|
+
var DEVICE_POLL_PATH = "/api/v1/cli/auth/device/poll";
|
|
87432
|
+
var defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
87433
|
+
var DeviceAuthService = class {
|
|
87434
|
+
constructor(apiUrl, version = "cli") {
|
|
87435
|
+
const base = apiUrl.startsWith("http") ? apiUrl : `https://${apiUrl}`;
|
|
87436
|
+
this.client = axios_default.create({
|
|
87437
|
+
baseURL: base.replace(/\/$/, ""),
|
|
87438
|
+
headers: {
|
|
87439
|
+
Accept: "application/json",
|
|
87440
|
+
// The parenthetical platform is what the backend uses to name the
|
|
87441
|
+
// generated PAT ("hubdoc-cli (darwin)"), via CliSession#pat_name_for.
|
|
87442
|
+
"User-Agent": `hubdoc-cli/${version} (${import_os3.default.platform()})`
|
|
87443
|
+
}
|
|
87444
|
+
});
|
|
87445
|
+
}
|
|
87446
|
+
/** POST /api/v1/cli/auth/device — open a new device authorization session. */
|
|
87447
|
+
async start() {
|
|
87448
|
+
try {
|
|
87449
|
+
const res = await this.client.post(DEVICE_START_PATH);
|
|
87450
|
+
return res.data;
|
|
87451
|
+
} catch (err) {
|
|
87452
|
+
if (err?.response) {
|
|
87453
|
+
const data = err.response.data || {};
|
|
87454
|
+
throw new Error(
|
|
87455
|
+
`Failed to start device flow: ${data.error || err.response.status} ${data.error_description || ""}`.trim()
|
|
87456
|
+
);
|
|
87457
|
+
}
|
|
87458
|
+
throw new Error(`Failed to start device flow: ${err.message}`);
|
|
87459
|
+
}
|
|
87460
|
+
}
|
|
87461
|
+
/** POST /api/v1/cli/auth/device/poll — one poll attempt, mapped to a PollResult. */
|
|
87462
|
+
async pollOnce(deviceCode) {
|
|
87463
|
+
try {
|
|
87464
|
+
const res = await this.client.post(DEVICE_POLL_PATH, {
|
|
87465
|
+
device_code: deviceCode
|
|
87466
|
+
});
|
|
87467
|
+
return { status: "ok", token: res.data };
|
|
87468
|
+
} catch (err) {
|
|
87469
|
+
const data = err?.response?.data;
|
|
87470
|
+
const code = data?.error;
|
|
87471
|
+
switch (code) {
|
|
87472
|
+
case "authorization_pending":
|
|
87473
|
+
return { status: "pending" };
|
|
87474
|
+
case "slow_down":
|
|
87475
|
+
return { status: "slow_down" };
|
|
87476
|
+
case "access_denied":
|
|
87477
|
+
return { status: "denied", error: code };
|
|
87478
|
+
case "expired_token":
|
|
87479
|
+
return { status: "expired", error: code };
|
|
87480
|
+
case "already_consumed":
|
|
87481
|
+
return { status: "consumed", error: code };
|
|
87482
|
+
default:
|
|
87483
|
+
if (err?.response) {
|
|
87484
|
+
throw new Error(
|
|
87485
|
+
`Device poll failed: ${code || err.response.status} ${data?.error_description || ""}`.trim()
|
|
87486
|
+
);
|
|
87487
|
+
}
|
|
87488
|
+
throw new Error(`Device poll failed: ${err.message}`);
|
|
87489
|
+
}
|
|
87490
|
+
}
|
|
87491
|
+
}
|
|
87492
|
+
/**
|
|
87493
|
+
* Poll until the user approves, the code expires, or the timeout is hit.
|
|
87494
|
+
* Honors `slow_down` by widening the interval (RFC 8628 §3.5).
|
|
87495
|
+
*/
|
|
87496
|
+
async pollUntilDone(deviceCode, opts) {
|
|
87497
|
+
const sleep = opts.sleep || defaultSleep;
|
|
87498
|
+
let intervalMs = Math.max(1, opts.interval) * 1e3;
|
|
87499
|
+
const caps = [Date.now() + opts.expiresIn * 1e3];
|
|
87500
|
+
if (opts.timeoutMs != null) caps.push(Date.now() + opts.timeoutMs);
|
|
87501
|
+
const deadline = Math.min(...caps);
|
|
87502
|
+
for (; ; ) {
|
|
87503
|
+
const result = await this.pollOnce(deviceCode);
|
|
87504
|
+
switch (result.status) {
|
|
87505
|
+
case "ok":
|
|
87506
|
+
return result.token;
|
|
87507
|
+
case "pending":
|
|
87508
|
+
break;
|
|
87509
|
+
case "slow_down":
|
|
87510
|
+
intervalMs += 5e3;
|
|
87511
|
+
break;
|
|
87512
|
+
case "denied":
|
|
87513
|
+
throw new Error("Device authorization was denied or revoked.");
|
|
87514
|
+
case "expired":
|
|
87515
|
+
throw new Error("Device code expired. Run `hubdoc login --start` again.");
|
|
87516
|
+
case "consumed":
|
|
87517
|
+
throw new Error(
|
|
87518
|
+
"This device code was already used. Run `hubdoc login --start` again."
|
|
87519
|
+
);
|
|
87520
|
+
}
|
|
87521
|
+
opts.onTick?.();
|
|
87522
|
+
if (Date.now() + intervalMs >= deadline) {
|
|
87523
|
+
throw new Error(
|
|
87524
|
+
"Timed out waiting for device approval. Run `hubdoc login --start` again."
|
|
87525
|
+
);
|
|
87526
|
+
}
|
|
87527
|
+
await sleep(intervalMs);
|
|
87528
|
+
}
|
|
87529
|
+
}
|
|
87530
|
+
};
|
|
87531
|
+
|
|
87417
87532
|
// apps/cli/cli/handlers/auth-handlers.ts
|
|
87418
87533
|
function decodeJwtPayload(token2) {
|
|
87419
87534
|
const parts2 = token2.split(".");
|
|
@@ -87471,7 +87586,7 @@ async function handleTokenSet(token2, opts) {
|
|
|
87471
87586
|
out.fail(new Error("Token cannot be empty"));
|
|
87472
87587
|
}
|
|
87473
87588
|
const trimmed = token2.trim();
|
|
87474
|
-
const configManager = new ConfigManager(
|
|
87589
|
+
const configManager = new ConfigManager(import_os4.default.homedir());
|
|
87475
87590
|
const existing = await configManager.loadConfig() || {};
|
|
87476
87591
|
const apiUrl = opts.apiUrl || existing.apiUrl || process.env.HUBDOC_API_URL || "http://localhost:3000";
|
|
87477
87592
|
if (opts.keychain) {
|
|
@@ -87511,6 +87626,134 @@ async function handleTokenSet(token2, opts) {
|
|
|
87511
87626
|
await configManager.saveConfig(next);
|
|
87512
87627
|
out.ok("Token saved", { apiUrl, storage: "config", tokenLength: trimmed.length });
|
|
87513
87628
|
}
|
|
87629
|
+
var DEVICE_SESSION_FILE = import_path15.default.join(import_os4.default.homedir(), ".hubdoc-tools", "device-session.json");
|
|
87630
|
+
async function resolveApiUrl(opts) {
|
|
87631
|
+
if (opts.apiUrl) return opts.apiUrl;
|
|
87632
|
+
const config = await new ConfigManager(import_os4.default.homedir()).loadConfig();
|
|
87633
|
+
return config?.apiUrl || process.env.HUBDOC_API_URL;
|
|
87634
|
+
}
|
|
87635
|
+
async function persistDeviceToken(apiUrl, token2) {
|
|
87636
|
+
const configManager = new ConfigManager(import_os4.default.homedir());
|
|
87637
|
+
const existing = await configManager.loadConfig() || {};
|
|
87638
|
+
const next = {
|
|
87639
|
+
...existing,
|
|
87640
|
+
apiUrl,
|
|
87641
|
+
token: token2.access_token,
|
|
87642
|
+
tokenType: token2.token_type || "Bearer",
|
|
87643
|
+
tokenExpiresIn: token2.expires_in,
|
|
87644
|
+
tokenGenerated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
87645
|
+
// Device flow yields a long-lived PAT — no refresh token to keep.
|
|
87646
|
+
refreshToken: void 0
|
|
87647
|
+
};
|
|
87648
|
+
await configManager.saveConfig(next);
|
|
87649
|
+
}
|
|
87650
|
+
function parseTimeoutMs(timeout) {
|
|
87651
|
+
if (!timeout) return void 0;
|
|
87652
|
+
const seconds = Number(timeout);
|
|
87653
|
+
return Number.isFinite(seconds) && seconds > 0 ? seconds * 1e3 : void 0;
|
|
87654
|
+
}
|
|
87655
|
+
async function handleLogin(opts) {
|
|
87656
|
+
const out = output(opts);
|
|
87657
|
+
if (opts.poll) {
|
|
87658
|
+
await handleLoginPoll(out, opts);
|
|
87659
|
+
return;
|
|
87660
|
+
}
|
|
87661
|
+
const apiUrl = await resolveApiUrl(opts);
|
|
87662
|
+
if (!apiUrl) {
|
|
87663
|
+
out.fail(new Error("No API URL configured. Pass --api-url=... or set HUBDOC_API_URL."));
|
|
87664
|
+
}
|
|
87665
|
+
const service = new DeviceAuthService(apiUrl);
|
|
87666
|
+
let start;
|
|
87667
|
+
try {
|
|
87668
|
+
start = await service.start();
|
|
87669
|
+
} catch (err) {
|
|
87670
|
+
out.fail(err);
|
|
87671
|
+
}
|
|
87672
|
+
if (opts.start) {
|
|
87673
|
+
const pending = {
|
|
87674
|
+
apiUrl,
|
|
87675
|
+
deviceCode: start.device_code,
|
|
87676
|
+
userCode: start.user_code,
|
|
87677
|
+
expiresAt: new Date(Date.now() + start.expires_in * 1e3).toISOString(),
|
|
87678
|
+
interval: start.interval
|
|
87679
|
+
};
|
|
87680
|
+
await import_fs_extra13.default.outputJson(DEVICE_SESSION_FILE, pending, { spaces: 2 });
|
|
87681
|
+
out.ok(
|
|
87682
|
+
"Device authorization started. Approve it in a browser, then run `hubdoc login --poll`.",
|
|
87683
|
+
{
|
|
87684
|
+
user_code: start.user_code,
|
|
87685
|
+
verification_uri_complete: start.verification_uri_complete,
|
|
87686
|
+
verification_uri: start.verification_uri,
|
|
87687
|
+
expires_in: start.expires_in,
|
|
87688
|
+
interval: start.interval
|
|
87689
|
+
}
|
|
87690
|
+
);
|
|
87691
|
+
return;
|
|
87692
|
+
}
|
|
87693
|
+
printActivationPrompt(out, opts, start.user_code, start.verification_uri_complete);
|
|
87694
|
+
try {
|
|
87695
|
+
const token2 = await service.pollUntilDone(start.device_code, {
|
|
87696
|
+
interval: start.interval,
|
|
87697
|
+
expiresIn: start.expires_in,
|
|
87698
|
+
timeoutMs: parseTimeoutMs(opts.timeout)
|
|
87699
|
+
});
|
|
87700
|
+
await persistDeviceToken(apiUrl, token2);
|
|
87701
|
+
out.ok("Logged in to HubDoc.", {
|
|
87702
|
+
apiUrl,
|
|
87703
|
+
user: token2.user,
|
|
87704
|
+
tokenExpiresIn: token2.expires_in,
|
|
87705
|
+
storage: "config"
|
|
87706
|
+
});
|
|
87707
|
+
} catch (err) {
|
|
87708
|
+
out.fail(err);
|
|
87709
|
+
}
|
|
87710
|
+
}
|
|
87711
|
+
async function handleLoginPoll(out, opts) {
|
|
87712
|
+
let pending;
|
|
87713
|
+
try {
|
|
87714
|
+
pending = await import_fs_extra13.default.readJson(DEVICE_SESSION_FILE);
|
|
87715
|
+
} catch {
|
|
87716
|
+
out.fail(new Error("No pending device session. Run `hubdoc login --start` first."));
|
|
87717
|
+
}
|
|
87718
|
+
const remainingMs = new Date(pending.expiresAt).getTime() - Date.now();
|
|
87719
|
+
if (remainingMs <= 0) {
|
|
87720
|
+
await import_fs_extra13.default.remove(DEVICE_SESSION_FILE).catch(() => void 0);
|
|
87721
|
+
out.fail(new Error("Device session expired. Run `hubdoc login --start` again."));
|
|
87722
|
+
}
|
|
87723
|
+
const service = new DeviceAuthService(pending.apiUrl);
|
|
87724
|
+
try {
|
|
87725
|
+
const token2 = await service.pollUntilDone(pending.deviceCode, {
|
|
87726
|
+
interval: pending.interval || 5,
|
|
87727
|
+
expiresIn: Math.ceil(remainingMs / 1e3),
|
|
87728
|
+
timeoutMs: parseTimeoutMs(opts.timeout)
|
|
87729
|
+
});
|
|
87730
|
+
await persistDeviceToken(pending.apiUrl, token2);
|
|
87731
|
+
await import_fs_extra13.default.remove(DEVICE_SESSION_FILE).catch(() => void 0);
|
|
87732
|
+
out.ok("Logged in to HubDoc.", {
|
|
87733
|
+
apiUrl: pending.apiUrl,
|
|
87734
|
+
user: token2.user,
|
|
87735
|
+
tokenExpiresIn: token2.expires_in,
|
|
87736
|
+
storage: "config"
|
|
87737
|
+
});
|
|
87738
|
+
} catch (err) {
|
|
87739
|
+
out.fail(err);
|
|
87740
|
+
}
|
|
87741
|
+
}
|
|
87742
|
+
function printActivationPrompt(out, opts, userCode, verificationUri) {
|
|
87743
|
+
if (opts.json) {
|
|
87744
|
+
process.stderr.write(
|
|
87745
|
+
`Open ${verificationUri} and confirm the code ${userCode}
|
|
87746
|
+
`
|
|
87747
|
+
);
|
|
87748
|
+
return;
|
|
87749
|
+
}
|
|
87750
|
+
process.stdout.write(
|
|
87751
|
+
"\n" + import_chalk24.default.bold("To sign in to HubDoc:\n") + ` 1. Open ${import_chalk24.default.cyan(verificationUri)}
|
|
87752
|
+
2. Confirm the code ${import_chalk24.default.bold.yellow(userCode)}
|
|
87753
|
+
|
|
87754
|
+
` + import_chalk24.default.gray("Waiting for approval... (Ctrl+C to abort)\n")
|
|
87755
|
+
);
|
|
87756
|
+
}
|
|
87514
87757
|
function platformOpenCommand(url2) {
|
|
87515
87758
|
if (process.platform === "darwin") return `open "${url2}"`;
|
|
87516
87759
|
if (process.platform === "win32") return `start "" "${url2}"`;
|
|
@@ -87520,7 +87763,7 @@ async function handleTokenOpen(opts) {
|
|
|
87520
87763
|
const out = output(opts);
|
|
87521
87764
|
let apiUrl = opts.apiUrl || process.env.HUBDOC_API_URL;
|
|
87522
87765
|
if (!apiUrl) {
|
|
87523
|
-
const configManager = new ConfigManager(
|
|
87766
|
+
const configManager = new ConfigManager(import_os4.default.homedir());
|
|
87524
87767
|
const config = await configManager.loadConfig();
|
|
87525
87768
|
apiUrl = config?.apiUrl;
|
|
87526
87769
|
}
|
|
@@ -87539,6 +87782,147 @@ async function handleTokenOpen(opts) {
|
|
|
87539
87782
|
out.ok(`Opened ${url2}`, { url: url2 });
|
|
87540
87783
|
}
|
|
87541
87784
|
|
|
87785
|
+
// apps/cli/cli/handlers/skill-handlers.ts
|
|
87786
|
+
var import_os5 = __toESM(require("os"));
|
|
87787
|
+
var import_path16 = __toESM(require("path"));
|
|
87788
|
+
var import_fs_extra14 = __toESM(require_lib());
|
|
87789
|
+
|
|
87790
|
+
// apps/cli/cli/skills/hubdoc-auth-skill.ts
|
|
87791
|
+
var HUBDOC_AUTH_SKILL_NAME = "hubdoc-auth";
|
|
87792
|
+
var HUBDOC_AUTH_SKILL_FILENAME = "SKILL.md";
|
|
87793
|
+
var HUBDOC_AUTH_SKILL_CONTENT = `---
|
|
87794
|
+
name: hubdoc-auth
|
|
87795
|
+
description: >-
|
|
87796
|
+
Authenticate the HubDoc CLI (\`hubdoc\`) from a shell with no browser \u2014 e.g. an
|
|
87797
|
+
AI agent behind a chatbot. Use when the user wants to log in / sign in to
|
|
87798
|
+
HubDoc, when a \`hubdoc\` command fails with "No API token configured" or a 401,
|
|
87799
|
+
or when a token has expired. Drives the OAuth 2.0 Device Authorization Grant:
|
|
87800
|
+
relay a short code + URL to the user, then poll until they approve.
|
|
87801
|
+
---
|
|
87802
|
+
|
|
87803
|
+
# HubDoc headless login (device flow)
|
|
87804
|
+
|
|
87805
|
+
The \`hubdoc\` CLI talks to a HubDoc instance using a bearer token stored in
|
|
87806
|
+
\`~/.hubdoc-config.json\`. On a machine with no browser you cannot run the normal
|
|
87807
|
+
OAuth redirect flow, so use the **device authorization grant**: the CLI shows a
|
|
87808
|
+
short code and a URL, the human approves it from any already-logged-in browser
|
|
87809
|
+
(phone, laptop, \u2026), and the CLI picks up a Personal Access Token.
|
|
87810
|
+
|
|
87811
|
+
## When to use
|
|
87812
|
+
|
|
87813
|
+
- The user asks to "log in", "sign in", "connect" to HubDoc.
|
|
87814
|
+
- A \`hubdoc\` command returns \`No API token configured\`, \`401\`, or \`403\`.
|
|
87815
|
+
- The stored token has expired (device-flow PATs last ~30 days).
|
|
87816
|
+
|
|
87817
|
+
## Prerequisites
|
|
87818
|
+
|
|
87819
|
+
- The \`hubdoc\` CLI is on \`PATH\` (verify with \`hubdoc --version\`).
|
|
87820
|
+
- The target instance is known via \`HUBDOC_API_URL\` **or** passed as
|
|
87821
|
+
\`--api-url https://<instance>\`. If neither is set, ask the user which HubDoc
|
|
87822
|
+
instance to connect to before starting.
|
|
87823
|
+
|
|
87824
|
+
## Procedure (two phases \u2014 do not skip the relay step)
|
|
87825
|
+
|
|
87826
|
+
1. **Start the session** and capture the code:
|
|
87827
|
+
|
|
87828
|
+
\`\`\`bash
|
|
87829
|
+
hubdoc login --start --json
|
|
87830
|
+
\`\`\`
|
|
87831
|
+
|
|
87832
|
+
This prints a JSON object like:
|
|
87833
|
+
|
|
87834
|
+
\`\`\`json
|
|
87835
|
+
{
|
|
87836
|
+
"ok": true,
|
|
87837
|
+
"data": {
|
|
87838
|
+
"user_code": "WDJB-MJHT",
|
|
87839
|
+
"verification_uri_complete": "https://<instance>/cli/activation/new?code=WDJB-MJHT",
|
|
87840
|
+
"verification_uri": "https://<instance>/cli/activation/new",
|
|
87841
|
+
"expires_in": 600,
|
|
87842
|
+
"interval": 5
|
|
87843
|
+
}
|
|
87844
|
+
}
|
|
87845
|
+
\`\`\`
|
|
87846
|
+
|
|
87847
|
+
2. **Relay to the user.** Show them the \`verification_uri_complete\` link and the
|
|
87848
|
+
\`user_code\`, and ask them to open it in a browser where they are logged in to
|
|
87849
|
+
HubDoc and confirm the code. Example message:
|
|
87850
|
+
|
|
87851
|
+
> Open **https://<instance>/cli/activation/new?code=WDJB-MJHT** in your
|
|
87852
|
+
> browser and confirm the code **WDJB-MJHT** to finish signing in.
|
|
87853
|
+
|
|
87854
|
+
3. **Poll until approved.** This blocks until the user confirms (or the code
|
|
87855
|
+
expires, ~10 min):
|
|
87856
|
+
|
|
87857
|
+
\`\`\`bash
|
|
87858
|
+
hubdoc login --poll --json
|
|
87859
|
+
\`\`\`
|
|
87860
|
+
|
|
87861
|
+
On success it prints \`{ "ok": true, ... }\` and the token is saved to
|
|
87862
|
+
\`~/.hubdoc-config.json\`. If it reports the session expired or was denied,
|
|
87863
|
+
start over at step 1.
|
|
87864
|
+
|
|
87865
|
+
4. **Verify** the session works:
|
|
87866
|
+
|
|
87867
|
+
\`\`\`bash
|
|
87868
|
+
hubdoc whoami --json
|
|
87869
|
+
\`\`\`
|
|
87870
|
+
|
|
87871
|
+
## One-shot variant (interactive humans only)
|
|
87872
|
+
|
|
87873
|
+
\`hubdoc login\` (no flag) prints the code and blocks until approval in a single
|
|
87874
|
+
command. Prefer the two-phase \`--start\` / \`--poll\` flow when acting as an agent
|
|
87875
|
+
so you can relay the code before blocking.
|
|
87876
|
+
|
|
87877
|
+
## Notes
|
|
87878
|
+
|
|
87879
|
+
- The token is a long-lived Personal Access Token named \`hubdoc-cli (<os>)\`,
|
|
87880
|
+
visible and revocable at \`https://<instance>/profile/personal-access-tokens\`.
|
|
87881
|
+
- There is no refresh token: when it expires, just run the flow again.
|
|
87882
|
+
- After authenticating, use the CLI normally \u2014 \`hubdoc --help\` lists commands
|
|
87883
|
+
(\`hubdoc workspaces ls\`, \`hubdoc files ...\`, \`hubdoc import ...\`, etc.). Add
|
|
87884
|
+
\`--json\` to any command for machine-readable output.
|
|
87885
|
+
`;
|
|
87886
|
+
|
|
87887
|
+
// apps/cli/cli/handlers/skill-handlers.ts
|
|
87888
|
+
function resolveSkillsDir(opts) {
|
|
87889
|
+
if (opts.path) return import_path16.default.resolve(opts.path);
|
|
87890
|
+
if (opts.project) return import_path16.default.join(process.cwd(), ".claude", "skills");
|
|
87891
|
+
return import_path16.default.join(import_os5.default.homedir(), ".claude", "skills");
|
|
87892
|
+
}
|
|
87893
|
+
async function handleSkillInstall(opts) {
|
|
87894
|
+
const out = output(opts);
|
|
87895
|
+
const skillsDir = resolveSkillsDir(opts);
|
|
87896
|
+
const skillDir = import_path16.default.join(skillsDir, HUBDOC_AUTH_SKILL_NAME);
|
|
87897
|
+
const target = import_path16.default.join(skillDir, HUBDOC_AUTH_SKILL_FILENAME);
|
|
87898
|
+
if (await import_fs_extra14.default.pathExists(target) && !opts.force) {
|
|
87899
|
+
out.fail(
|
|
87900
|
+
new Error(
|
|
87901
|
+
`Skill already installed at ${target}. Re-run with --force to overwrite.`
|
|
87902
|
+
)
|
|
87903
|
+
);
|
|
87904
|
+
}
|
|
87905
|
+
try {
|
|
87906
|
+
await import_fs_extra14.default.outputFile(target, HUBDOC_AUTH_SKILL_CONTENT);
|
|
87907
|
+
} catch (err) {
|
|
87908
|
+
out.fail(new Error(`Failed to write skill: ${err.message}`));
|
|
87909
|
+
}
|
|
87910
|
+
out.ok(`Installed the ${HUBDOC_AUTH_SKILL_NAME} skill`, {
|
|
87911
|
+
skill: HUBDOC_AUTH_SKILL_NAME,
|
|
87912
|
+
path: target,
|
|
87913
|
+
scope: opts.path ? "custom" : opts.project ? "project" : "user",
|
|
87914
|
+
hint: 'Restart Claude Code (or reload skills) to pick it up, then ask it to "log in to HubDoc".'
|
|
87915
|
+
});
|
|
87916
|
+
}
|
|
87917
|
+
async function handleSkillShow(opts) {
|
|
87918
|
+
const out = output(opts);
|
|
87919
|
+
if (opts.json) {
|
|
87920
|
+
out.show({ skill: HUBDOC_AUTH_SKILL_NAME, content: HUBDOC_AUTH_SKILL_CONTENT });
|
|
87921
|
+
return;
|
|
87922
|
+
}
|
|
87923
|
+
process.stdout.write(HUBDOC_AUTH_SKILL_CONTENT);
|
|
87924
|
+
}
|
|
87925
|
+
|
|
87542
87926
|
// apps/cli/cli/handlers/workspace-handlers.ts
|
|
87543
87927
|
var WORKSPACE_COLUMNS = [
|
|
87544
87928
|
{ header: "ID", key: "id" },
|
|
@@ -87789,15 +88173,15 @@ async function handleFoldersDelete(id, opts) {
|
|
|
87789
88173
|
}
|
|
87790
88174
|
|
|
87791
88175
|
// apps/cli/cli/handlers/file-handlers.ts
|
|
87792
|
-
var
|
|
87793
|
-
var
|
|
88176
|
+
var import_fs_extra15 = __toESM(require_lib());
|
|
88177
|
+
var import_path17 = __toESM(require("path"));
|
|
87794
88178
|
var import_form_data3 = __toESM(require_form_data());
|
|
87795
88179
|
|
|
87796
88180
|
// apps/cli/services/chunked-uploader.ts
|
|
87797
|
-
var
|
|
88181
|
+
var import_chalk25 = __toESM(require_source());
|
|
87798
88182
|
var crypto3 = __toESM(require("crypto"));
|
|
87799
|
-
var
|
|
87800
|
-
var
|
|
88183
|
+
var fs16 = __toESM(require_lib());
|
|
88184
|
+
var path20 = __toESM(require("path"));
|
|
87801
88185
|
|
|
87802
88186
|
// apps/cli/api/base.ts
|
|
87803
88187
|
var BASE_PATH2 = "http://localhost:3000".replace(/\/+$/, "");
|
|
@@ -88196,14 +88580,14 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88196
88580
|
async uploadFile(options) {
|
|
88197
88581
|
const { filePath, workspaceId, folderId, metadata, chunkSize, onProgress } = options;
|
|
88198
88582
|
try {
|
|
88199
|
-
if (!await
|
|
88583
|
+
if (!await fs16.pathExists(filePath)) {
|
|
88200
88584
|
throw new Error(`File not found: ${filePath}`);
|
|
88201
88585
|
}
|
|
88202
|
-
const stats = await
|
|
88586
|
+
const stats = await fs16.stat(filePath);
|
|
88203
88587
|
const fileSize = stats.size;
|
|
88204
|
-
const filename =
|
|
88588
|
+
const filename = path20.basename(filePath);
|
|
88205
88589
|
const contentType = this.getContentType(filePath);
|
|
88206
|
-
console.log(
|
|
88590
|
+
console.log(import_chalk25.default.blue(`\u{1F4E6} Preparing chunked upload for ${filename} (${this.formatBytes(fileSize)})`));
|
|
88207
88591
|
const session = await this.initializeSession(
|
|
88208
88592
|
filename,
|
|
88209
88593
|
fileSize,
|
|
@@ -88213,7 +88597,7 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88213
88597
|
folderId,
|
|
88214
88598
|
metadata
|
|
88215
88599
|
);
|
|
88216
|
-
console.log(
|
|
88600
|
+
console.log(import_chalk25.default.cyan(` Session created: ${session.upload_id} (${session.total_chunks} chunks)`));
|
|
88217
88601
|
const chunks = this.prepareChunks(fileSize, session.chunk_size);
|
|
88218
88602
|
const uploadProgress = {
|
|
88219
88603
|
uploadId: session.upload_id,
|
|
@@ -88232,11 +88616,11 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88232
88616
|
uploadProgress,
|
|
88233
88617
|
onProgress
|
|
88234
88618
|
);
|
|
88235
|
-
console.log(
|
|
88619
|
+
console.log(import_chalk25.default.cyan(` Calculating checksum...`));
|
|
88236
88620
|
const checksum = await this.calculateMD5(filePath);
|
|
88237
|
-
console.log(
|
|
88621
|
+
console.log(import_chalk25.default.cyan(` Finalizing upload...`));
|
|
88238
88622
|
const result = await this.completeUpload(session.upload_id, checksum);
|
|
88239
|
-
console.log(
|
|
88623
|
+
console.log(import_chalk25.default.green(`\u2705 Chunked upload completed: ${filename}`));
|
|
88240
88624
|
uploadProgress.status = "completed";
|
|
88241
88625
|
uploadProgress.progress = 100;
|
|
88242
88626
|
if (onProgress) {
|
|
@@ -88248,7 +88632,7 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88248
88632
|
objectKey: result.object_key
|
|
88249
88633
|
};
|
|
88250
88634
|
} catch (error) {
|
|
88251
|
-
console.error(
|
|
88635
|
+
console.error(import_chalk25.default.red(`\u274C Chunked upload failed: ${error.message}`));
|
|
88252
88636
|
return {
|
|
88253
88637
|
success: false,
|
|
88254
88638
|
uploadId: "",
|
|
@@ -88316,7 +88700,7 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88316
88700
|
if (onProgress) {
|
|
88317
88701
|
onProgress({ ...progress });
|
|
88318
88702
|
}
|
|
88319
|
-
console.log(
|
|
88703
|
+
console.log(import_chalk25.default.gray(` Chunk ${chunk.index}/${chunks.length} uploaded (${progress.progress.toFixed(1)}%)`));
|
|
88320
88704
|
}).catch((error) => {
|
|
88321
88705
|
throw new Error(`Chunk ${chunk.index} upload failed: ${error.message}`);
|
|
88322
88706
|
}).finally(() => {
|
|
@@ -88337,11 +88721,11 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88337
88721
|
for (let attempt = 0; attempt <= _ChunkedUploader.MAX_RETRY_PER_CHUNK; attempt++) {
|
|
88338
88722
|
try {
|
|
88339
88723
|
const buffer = Buffer.alloc(chunk.size);
|
|
88340
|
-
const fd = await
|
|
88724
|
+
const fd = await fs16.open(filePath, "r");
|
|
88341
88725
|
try {
|
|
88342
|
-
await
|
|
88726
|
+
await fs16.read(fd, buffer, 0, chunk.size, chunk.start);
|
|
88343
88727
|
} finally {
|
|
88344
|
-
await
|
|
88728
|
+
await fs16.close(fd);
|
|
88345
88729
|
}
|
|
88346
88730
|
await this.axiosClient.patch(
|
|
88347
88731
|
`/api/v1/documents/chunked_uploads/${uploadId}/chunks/${chunk.index}`,
|
|
@@ -88356,7 +88740,7 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88356
88740
|
} catch (error) {
|
|
88357
88741
|
lastError = error;
|
|
88358
88742
|
if (attempt < _ChunkedUploader.MAX_RETRY_PER_CHUNK) {
|
|
88359
|
-
console.log(
|
|
88743
|
+
console.log(import_chalk25.default.yellow(` \u26A0\uFE0F Chunk ${chunk.index} failed, retrying (${attempt + 1}/${_ChunkedUploader.MAX_RETRY_PER_CHUNK})...`));
|
|
88360
88744
|
await this.sleep(1e3 * (attempt + 1));
|
|
88361
88745
|
}
|
|
88362
88746
|
}
|
|
@@ -88386,7 +88770,7 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88386
88770
|
async calculateMD5(filePath) {
|
|
88387
88771
|
return new Promise((resolve, reject) => {
|
|
88388
88772
|
const hash = crypto3.createHash("md5");
|
|
88389
|
-
const stream5 =
|
|
88773
|
+
const stream5 = fs16.createReadStream(filePath);
|
|
88390
88774
|
stream5.on("data", (data) => hash.update(data));
|
|
88391
88775
|
stream5.on("end", () => resolve(hash.digest("base64")));
|
|
88392
88776
|
stream5.on("error", reject);
|
|
@@ -88396,7 +88780,7 @@ var ChunkedUploader2 = class _ChunkedUploader {
|
|
|
88396
88780
|
* Get content type from file extension
|
|
88397
88781
|
*/
|
|
88398
88782
|
getContentType(filePath) {
|
|
88399
|
-
const ext2 =
|
|
88783
|
+
const ext2 = path20.extname(filePath).toLowerCase();
|
|
88400
88784
|
const mimeTypes = {
|
|
88401
88785
|
".pdf": "application/pdf",
|
|
88402
88786
|
".doc": "application/msword",
|
|
@@ -88479,7 +88863,7 @@ async function handleFilesShow(id, opts) {
|
|
|
88479
88863
|
}
|
|
88480
88864
|
async function uploadDirect(ctx, filePath, fileName, opts, metadata) {
|
|
88481
88865
|
const form = new import_form_data3.default();
|
|
88482
|
-
form.append("uploaded_file",
|
|
88866
|
+
form.append("uploaded_file", import_fs_extra15.default.createReadStream(filePath), {
|
|
88483
88867
|
filename: fileName,
|
|
88484
88868
|
contentType: "application/octet-stream"
|
|
88485
88869
|
});
|
|
@@ -88524,18 +88908,18 @@ async function uploadChunked(ctx, filePath, opts, metadata, out) {
|
|
|
88524
88908
|
async function handleFilesUpload(filePath, opts) {
|
|
88525
88909
|
const out = output(opts);
|
|
88526
88910
|
const ctx = await buildApiContext(out);
|
|
88527
|
-
const resolved =
|
|
88528
|
-
if (!await
|
|
88911
|
+
const resolved = import_path17.default.resolve(filePath);
|
|
88912
|
+
if (!await import_fs_extra15.default.pathExists(resolved)) {
|
|
88529
88913
|
out.fail(new Error(`File not found: ${filePath}`));
|
|
88530
88914
|
}
|
|
88531
|
-
const stats = await
|
|
88915
|
+
const stats = await import_fs_extra15.default.stat(resolved);
|
|
88532
88916
|
if (!stats.isFile()) {
|
|
88533
88917
|
out.fail(new Error(`Not a regular file: ${filePath}`));
|
|
88534
88918
|
}
|
|
88535
88919
|
if (!opts.folder && !opts.workspace) {
|
|
88536
88920
|
out.note("No --folder or --workspace specified; server will use defaults");
|
|
88537
88921
|
}
|
|
88538
|
-
const fileName = (opts.name ||
|
|
88922
|
+
const fileName = (opts.name || import_path17.default.basename(resolved)).normalize("NFC");
|
|
88539
88923
|
const metadata = parseJsonOpt3("metadata", opts.metadata, out);
|
|
88540
88924
|
const useChunked = !!opts.chunked || stats.size >= CHUNKED_THRESHOLD;
|
|
88541
88925
|
try {
|
|
@@ -88554,8 +88938,8 @@ async function handleFilesUpload(filePath, opts) {
|
|
|
88554
88938
|
}
|
|
88555
88939
|
}
|
|
88556
88940
|
async function streamToFile(stream5, targetPath) {
|
|
88557
|
-
await
|
|
88558
|
-
const writer =
|
|
88941
|
+
await import_fs_extra15.default.ensureDir(import_path17.default.dirname(import_path17.default.resolve(targetPath)));
|
|
88942
|
+
const writer = import_fs_extra15.default.createWriteStream(targetPath);
|
|
88559
88943
|
stream5.pipe(writer);
|
|
88560
88944
|
await new Promise((resolve, reject) => {
|
|
88561
88945
|
writer.on("finish", resolve);
|
|
@@ -88574,7 +88958,7 @@ async function handleFilesDownload(id, opts) {
|
|
|
88574
88958
|
out.fail(err);
|
|
88575
88959
|
}
|
|
88576
88960
|
const fileName = meta?.name || `document-${id}`;
|
|
88577
|
-
const targetPath =
|
|
88961
|
+
const targetPath = import_path17.default.resolve(opts.to || fileName);
|
|
88578
88962
|
try {
|
|
88579
88963
|
const res = await ctx.axios.get(`/api/v1/documents/documents/${id}/blob`, {
|
|
88580
88964
|
responseType: "stream"
|
|
@@ -88853,8 +89237,8 @@ async function handleComposedExport(id, opts) {
|
|
|
88853
89237
|
}
|
|
88854
89238
|
|
|
88855
89239
|
// apps/cli/cli/handlers/part-handlers.ts
|
|
88856
|
-
var
|
|
88857
|
-
var
|
|
89240
|
+
var import_fs_extra16 = __toESM(require_lib());
|
|
89241
|
+
var import_path18 = __toESM(require("path"));
|
|
88858
89242
|
var partsBase = (cdId) => `/api/v1/documents/composed_documents/${encodeURIComponent(cdId)}/parts`;
|
|
88859
89243
|
var PART_COLUMNS = [
|
|
88860
89244
|
{ header: "ID", key: "id" },
|
|
@@ -88907,11 +89291,11 @@ async function handlePartsUpdate(id, opts) {
|
|
|
88907
89291
|
const body = {};
|
|
88908
89292
|
if (opts.content !== void 0) body.content = opts.content;
|
|
88909
89293
|
if (opts.contentFile !== void 0) {
|
|
88910
|
-
const resolved =
|
|
88911
|
-
if (!await
|
|
89294
|
+
const resolved = import_path18.default.resolve(opts.contentFile);
|
|
89295
|
+
if (!await import_fs_extra16.default.pathExists(resolved)) {
|
|
88912
89296
|
out.fail(new Error(`Content file not found: ${opts.contentFile}`));
|
|
88913
89297
|
}
|
|
88914
|
-
body.content = await
|
|
89298
|
+
body.content = await import_fs_extra16.default.readFile(resolved, "utf8");
|
|
88915
89299
|
}
|
|
88916
89300
|
if (opts.status !== void 0) body.status = opts.status;
|
|
88917
89301
|
if (opts.title !== void 0) body.title = opts.title;
|
|
@@ -89446,15 +89830,15 @@ async function handlePermissionsShow(id, opts) {
|
|
|
89446
89830
|
// apps/cli/cli.ts
|
|
89447
89831
|
var getVersion = () => {
|
|
89448
89832
|
try {
|
|
89449
|
-
if (true) return "1.
|
|
89833
|
+
if (true) return "1.7.0";
|
|
89450
89834
|
} catch {
|
|
89451
89835
|
}
|
|
89452
89836
|
for (const candidate of [
|
|
89453
|
-
|
|
89454
|
-
|
|
89837
|
+
import_path19.default.join(__dirname, "package.json"),
|
|
89838
|
+
import_path19.default.join(__dirname, "..", "package.json")
|
|
89455
89839
|
]) {
|
|
89456
89840
|
try {
|
|
89457
|
-
return
|
|
89841
|
+
return import_fs_extra17.default.readJsonSync(candidate).version;
|
|
89458
89842
|
} catch {
|
|
89459
89843
|
}
|
|
89460
89844
|
}
|
|
@@ -89474,18 +89858,18 @@ program2.command("run").description("Run HubDoc tool with engine selection (lega
|
|
|
89474
89858
|
if (options.interactive || (!options.engine || options.engine === "filesystem")) {
|
|
89475
89859
|
selectedEngine = await runEngineSelection(options.interactive);
|
|
89476
89860
|
}
|
|
89477
|
-
console.log(
|
|
89861
|
+
console.log(import_chalk26.default.blue(`\u{1F680} Starting HubDoc Tool with ${selectedEngine} engine...`));
|
|
89478
89862
|
logger.log("INFO", "INIT", selectedEngine, `Starting HubDoc Tool with ${selectedEngine} engine`, {
|
|
89479
89863
|
options: { ...options, logFile: logger.getLogPath() }
|
|
89480
89864
|
});
|
|
89481
89865
|
await handleEngineOperation(selectedEngine, options, logger);
|
|
89482
89866
|
logger.completeOperation(true);
|
|
89483
|
-
console.log(
|
|
89867
|
+
console.log(import_chalk26.default.green(`\u2705 Operation completed. Log: ${logger.getLogPath()}`));
|
|
89484
89868
|
} catch (error) {
|
|
89485
89869
|
logger.log("ERROR", "FAILED", options.engine || "unknown", `Operation failed: ${error.message}`, { error: error.stack });
|
|
89486
89870
|
logger.completeOperation(false);
|
|
89487
|
-
console.error(
|
|
89488
|
-
console.error(
|
|
89871
|
+
console.error(import_chalk26.default.red(`\u274C Error: ${error.message}`));
|
|
89872
|
+
console.error(import_chalk26.default.gray(`\u{1F4C4} Check log file: ${logger.getLogPath()}`));
|
|
89489
89873
|
process.exit(1);
|
|
89490
89874
|
}
|
|
89491
89875
|
});
|
|
@@ -89499,7 +89883,7 @@ Examples:
|
|
|
89499
89883
|
try {
|
|
89500
89884
|
await handleGenerateMapping(sourceDir, options);
|
|
89501
89885
|
} catch (error) {
|
|
89502
|
-
console.error(
|
|
89886
|
+
console.error(import_chalk26.default.red(`\u274C Error: ${error.message}`));
|
|
89503
89887
|
process.exit(1);
|
|
89504
89888
|
}
|
|
89505
89889
|
});
|
|
@@ -89514,7 +89898,7 @@ Examples:
|
|
|
89514
89898
|
try {
|
|
89515
89899
|
await handleImport(options);
|
|
89516
89900
|
} catch (error) {
|
|
89517
|
-
console.error(
|
|
89901
|
+
console.error(import_chalk26.default.red(`\u274C Import failed: ${error.message}`));
|
|
89518
89902
|
process.exit(1);
|
|
89519
89903
|
}
|
|
89520
89904
|
});
|
|
@@ -89522,7 +89906,7 @@ program2.command("export").description("Export documents from HubDoc").option("-
|
|
|
89522
89906
|
try {
|
|
89523
89907
|
await handleExport(options);
|
|
89524
89908
|
} catch (error) {
|
|
89525
|
-
console.error(
|
|
89909
|
+
console.error(import_chalk26.default.red(`\u274C Export failed: ${error.message}`));
|
|
89526
89910
|
process.exit(1);
|
|
89527
89911
|
}
|
|
89528
89912
|
});
|
|
@@ -89530,7 +89914,7 @@ program2.command("plugins").description("Manage document source plugins").action
|
|
|
89530
89914
|
try {
|
|
89531
89915
|
await handlePlugins();
|
|
89532
89916
|
} catch (error) {
|
|
89533
|
-
console.error(
|
|
89917
|
+
console.error(import_chalk26.default.red(`\u274C Error: ${error.message}`));
|
|
89534
89918
|
process.exit(1);
|
|
89535
89919
|
}
|
|
89536
89920
|
});
|
|
@@ -89538,7 +89922,7 @@ program2.command("connect").description("Create a connection to an external docu
|
|
|
89538
89922
|
try {
|
|
89539
89923
|
await handleConnect(plugin, options);
|
|
89540
89924
|
} catch (error) {
|
|
89541
|
-
console.error(
|
|
89925
|
+
console.error(import_chalk26.default.red(`\u274C Failed to create connection: ${error.message}`));
|
|
89542
89926
|
process.exit(1);
|
|
89543
89927
|
}
|
|
89544
89928
|
});
|
|
@@ -89546,7 +89930,7 @@ program2.command("plugin-scan").description("Scan external source and generate m
|
|
|
89546
89930
|
try {
|
|
89547
89931
|
await handlePluginScan(connectionId, options);
|
|
89548
89932
|
} catch (error) {
|
|
89549
|
-
console.error(
|
|
89933
|
+
console.error(import_chalk26.default.red(`\u274C Plugin scan failed: ${error.message}`));
|
|
89550
89934
|
process.exit(1);
|
|
89551
89935
|
}
|
|
89552
89936
|
});
|
|
@@ -89554,13 +89938,16 @@ program2.command("plugin-import").description("Import documents from external so
|
|
|
89554
89938
|
try {
|
|
89555
89939
|
await handlePluginImport(mappingFile, options);
|
|
89556
89940
|
} catch (error) {
|
|
89557
|
-
console.error(
|
|
89941
|
+
console.error(import_chalk26.default.red(`\u274C Plugin import failed: ${error.message}`));
|
|
89558
89942
|
process.exit(1);
|
|
89559
89943
|
}
|
|
89560
89944
|
});
|
|
89561
89945
|
program2.command("whoami").description("Show the authenticated user (LLM-friendly)").action(async (options) => {
|
|
89562
89946
|
await handleWhoami(withGlobals(options));
|
|
89563
89947
|
});
|
|
89948
|
+
program2.command("login").description("Sign in via OAuth device flow (no browser needed on this machine)").option("--device", "Use the device authorization grant (default)").option("--start", "Open a device session, print the code, then exit (for agents)").option("--poll", "Resume the pending device session and wait for approval").option("--timeout <seconds>", "Max seconds to wait for approval while polling").option("--api-url <url>", "API URL (defaults to current config or HUBDOC_API_URL)").action(async (options) => {
|
|
89949
|
+
await handleLogin(withGlobals(options));
|
|
89950
|
+
});
|
|
89564
89951
|
var token = program2.command("token").description("Manage API tokens");
|
|
89565
89952
|
token.command("set <token>").description("Persist an API token (config file by default, OS keychain with --keychain)").option("--api-url <url>", "API URL (defaults to current config or HUBDOC_API_URL)").option("--keychain", "Store in OS keychain via keytar (Keychain / libsecret / Credential Vault) instead of plaintext config").action(async (tokenValue, options) => {
|
|
89566
89953
|
await handleTokenSet(tokenValue, withGlobals(options));
|
|
@@ -89568,6 +89955,13 @@ token.command("set <token>").description("Persist an API token (config file by d
|
|
|
89568
89955
|
token.command("open").description("Open the Corex Personal Access Tokens UI in the default browser").option("--api-url <url>", "API URL (defaults to current config or HUBDOC_API_URL)").action(async (options) => {
|
|
89569
89956
|
await handleTokenOpen(withGlobals(options));
|
|
89570
89957
|
});
|
|
89958
|
+
var skill = program2.command("skill").description("Manage the bundled Claude Code skill");
|
|
89959
|
+
skill.command("install").description("Install the hubdoc-auth skill into ~/.claude/skills (or a project)").option("--project", "Install into ./.claude/skills instead of the user home").option("--path <dir>", "Explicit skills directory (overrides --project)").option("--force", "Overwrite an existing SKILL.md").action(async (options) => {
|
|
89960
|
+
await handleSkillInstall(withGlobals(options));
|
|
89961
|
+
});
|
|
89962
|
+
skill.command("show").description("Print the hubdoc-auth skill markdown").action(async (options) => {
|
|
89963
|
+
await handleSkillShow(withGlobals(options));
|
|
89964
|
+
});
|
|
89571
89965
|
var workspaces = program2.command("workspaces").description("Manage workspaces");
|
|
89572
89966
|
workspaces.command("ls").description("List workspaces").action(async (options) => {
|
|
89573
89967
|
await handleWorkspacesList(withGlobals(options));
|