@kevisual/cli 0.0.56 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant-server.js +464 -439
- package/dist/assistant.js +373 -373
- package/dist/envision.mjs +314 -197
- package/package.json +9 -10
package/dist/envision.mjs
CHANGED
|
@@ -41246,7 +41246,7 @@ var require_es_set_tostringtag = __commonJS((exports, module) => {
|
|
|
41246
41246
|
};
|
|
41247
41247
|
});
|
|
41248
41248
|
|
|
41249
|
-
// node_modules/.pnpm/form-data@4.0.
|
|
41249
|
+
// node_modules/.pnpm/form-data@4.0.3/node_modules/form-data/lib/populate.js
|
|
41250
41250
|
var require_populate = __commonJS((exports, module) => {
|
|
41251
41251
|
module.exports = function(dst, src) {
|
|
41252
41252
|
Object.keys(src).forEach(function(prop) {
|
|
@@ -41256,7 +41256,7 @@ var require_populate = __commonJS((exports, module) => {
|
|
|
41256
41256
|
};
|
|
41257
41257
|
});
|
|
41258
41258
|
|
|
41259
|
-
// node_modules/.pnpm/form-data@4.0.
|
|
41259
|
+
// node_modules/.pnpm/form-data@4.0.3/node_modules/form-data/lib/form_data.js
|
|
41260
41260
|
var require_form_data = __commonJS((exports, module) => {
|
|
41261
41261
|
var CombinedStream = require_combined_stream();
|
|
41262
41262
|
var util2 = __require("util");
|
|
@@ -41269,9 +41269,8 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41269
41269
|
var mime = require_mime_types();
|
|
41270
41270
|
var asynckit = require_asynckit();
|
|
41271
41271
|
var setToStringTag = require_es_set_tostringtag();
|
|
41272
|
+
var hasOwn = require_hasown();
|
|
41272
41273
|
var populate = require_populate();
|
|
41273
|
-
module.exports = FormData;
|
|
41274
|
-
util2.inherits(FormData, CombinedStream);
|
|
41275
41274
|
function FormData(options) {
|
|
41276
41275
|
if (!(this instanceof FormData)) {
|
|
41277
41276
|
return new FormData(options);
|
|
@@ -41285,17 +41284,18 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41285
41284
|
this[option] = options[option];
|
|
41286
41285
|
}
|
|
41287
41286
|
}
|
|
41287
|
+
util2.inherits(FormData, CombinedStream);
|
|
41288
41288
|
FormData.LINE_BREAK = `\r
|
|
41289
41289
|
`;
|
|
41290
41290
|
FormData.DEFAULT_CONTENT_TYPE = "application/octet-stream";
|
|
41291
41291
|
FormData.prototype.append = function(field, value, options) {
|
|
41292
41292
|
options = options || {};
|
|
41293
|
-
if (typeof options
|
|
41293
|
+
if (typeof options === "string") {
|
|
41294
41294
|
options = { filename: options };
|
|
41295
41295
|
}
|
|
41296
41296
|
var append = CombinedStream.prototype.append.bind(this);
|
|
41297
|
-
if (typeof value
|
|
41298
|
-
value =
|
|
41297
|
+
if (typeof value === "number" || value == null) {
|
|
41298
|
+
value = String(value);
|
|
41299
41299
|
}
|
|
41300
41300
|
if (Array.isArray(value)) {
|
|
41301
41301
|
this._error(new Error("Arrays are not supported."));
|
|
@@ -41311,7 +41311,7 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41311
41311
|
FormData.prototype._trackLength = function(header, value, options) {
|
|
41312
41312
|
var valueLength = 0;
|
|
41313
41313
|
if (options.knownLength != null) {
|
|
41314
|
-
valueLength +=
|
|
41314
|
+
valueLength += Number(options.knownLength);
|
|
41315
41315
|
} else if (Buffer.isBuffer(value)) {
|
|
41316
41316
|
valueLength = value.length;
|
|
41317
41317
|
} else if (typeof value === "string") {
|
|
@@ -41319,7 +41319,7 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41319
41319
|
}
|
|
41320
41320
|
this._valueLength += valueLength;
|
|
41321
41321
|
this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
|
|
41322
|
-
if (!value || !value.path && !(value.readable &&
|
|
41322
|
+
if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) {
|
|
41323
41323
|
return;
|
|
41324
41324
|
}
|
|
41325
41325
|
if (!options.knownLength) {
|
|
@@ -41327,26 +41327,25 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41327
41327
|
}
|
|
41328
41328
|
};
|
|
41329
41329
|
FormData.prototype._lengthRetriever = function(value, callback) {
|
|
41330
|
-
if (
|
|
41330
|
+
if (hasOwn(value, "fd")) {
|
|
41331
41331
|
if (value.end != null && value.end != Infinity && value.start != null) {
|
|
41332
41332
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
41333
41333
|
} else {
|
|
41334
41334
|
fs4.stat(value.path, function(err, stat) {
|
|
41335
|
-
var fileSize;
|
|
41336
41335
|
if (err) {
|
|
41337
41336
|
callback(err);
|
|
41338
41337
|
return;
|
|
41339
41338
|
}
|
|
41340
|
-
fileSize = stat.size - (value.start ? value.start : 0);
|
|
41339
|
+
var fileSize = stat.size - (value.start ? value.start : 0);
|
|
41341
41340
|
callback(null, fileSize);
|
|
41342
41341
|
});
|
|
41343
41342
|
}
|
|
41344
|
-
} else if (
|
|
41345
|
-
callback(null,
|
|
41346
|
-
} else if (
|
|
41343
|
+
} else if (hasOwn(value, "httpVersion")) {
|
|
41344
|
+
callback(null, Number(value.headers["content-length"]));
|
|
41345
|
+
} else if (hasOwn(value, "httpModule")) {
|
|
41347
41346
|
value.on("response", function(response) {
|
|
41348
41347
|
value.pause();
|
|
41349
|
-
callback(null,
|
|
41348
|
+
callback(null, Number(response.headers["content-length"]));
|
|
41350
41349
|
});
|
|
41351
41350
|
value.resume();
|
|
41352
41351
|
} else {
|
|
@@ -41354,7 +41353,7 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41354
41353
|
}
|
|
41355
41354
|
};
|
|
41356
41355
|
FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
41357
|
-
if (typeof options.header
|
|
41356
|
+
if (typeof options.header === "string") {
|
|
41358
41357
|
return options.header;
|
|
41359
41358
|
}
|
|
41360
41359
|
var contentDisposition = this._getContentDisposition(value, options);
|
|
@@ -41364,12 +41363,12 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41364
41363
|
"Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []),
|
|
41365
41364
|
"Content-Type": [].concat(contentType || [])
|
|
41366
41365
|
};
|
|
41367
|
-
if (typeof options.header
|
|
41366
|
+
if (typeof options.header === "object") {
|
|
41368
41367
|
populate(headers, options.header);
|
|
41369
41368
|
}
|
|
41370
41369
|
var header;
|
|
41371
41370
|
for (var prop in headers) {
|
|
41372
|
-
if (
|
|
41371
|
+
if (hasOwn(headers, prop)) {
|
|
41373
41372
|
header = headers[prop];
|
|
41374
41373
|
if (header == null) {
|
|
41375
41374
|
continue;
|
|
@@ -41385,34 +41384,33 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41385
41384
|
return "--" + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
|
|
41386
41385
|
};
|
|
41387
41386
|
FormData.prototype._getContentDisposition = function(value, options) {
|
|
41388
|
-
var filename
|
|
41387
|
+
var filename;
|
|
41389
41388
|
if (typeof options.filepath === "string") {
|
|
41390
41389
|
filename = path2.normalize(options.filepath).replace(/\\/g, "/");
|
|
41391
|
-
} else if (options.filename || value.name || value.path) {
|
|
41392
|
-
filename = path2.basename(options.filename || value.name || value.path);
|
|
41393
|
-
} else if (value.readable &&
|
|
41390
|
+
} else if (options.filename || value && (value.name || value.path)) {
|
|
41391
|
+
filename = path2.basename(options.filename || value && (value.name || value.path));
|
|
41392
|
+
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
41394
41393
|
filename = path2.basename(value.client._httpMessage.path || "");
|
|
41395
41394
|
}
|
|
41396
41395
|
if (filename) {
|
|
41397
|
-
|
|
41396
|
+
return 'filename="' + filename + '"';
|
|
41398
41397
|
}
|
|
41399
|
-
return contentDisposition;
|
|
41400
41398
|
};
|
|
41401
41399
|
FormData.prototype._getContentType = function(value, options) {
|
|
41402
41400
|
var contentType = options.contentType;
|
|
41403
|
-
if (!contentType && value.name) {
|
|
41401
|
+
if (!contentType && value && value.name) {
|
|
41404
41402
|
contentType = mime.lookup(value.name);
|
|
41405
41403
|
}
|
|
41406
|
-
if (!contentType && value.path) {
|
|
41404
|
+
if (!contentType && value && value.path) {
|
|
41407
41405
|
contentType = mime.lookup(value.path);
|
|
41408
41406
|
}
|
|
41409
|
-
if (!contentType && value.readable &&
|
|
41407
|
+
if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) {
|
|
41410
41408
|
contentType = value.headers["content-type"];
|
|
41411
41409
|
}
|
|
41412
41410
|
if (!contentType && (options.filepath || options.filename)) {
|
|
41413
41411
|
contentType = mime.lookup(options.filepath || options.filename);
|
|
41414
41412
|
}
|
|
41415
|
-
if (!contentType && typeof value
|
|
41413
|
+
if (!contentType && value && typeof value === "object") {
|
|
41416
41414
|
contentType = FormData.DEFAULT_CONTENT_TYPE;
|
|
41417
41415
|
}
|
|
41418
41416
|
return contentType;
|
|
@@ -41436,13 +41434,16 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41436
41434
|
"content-type": "multipart/form-data; boundary=" + this.getBoundary()
|
|
41437
41435
|
};
|
|
41438
41436
|
for (header in userHeaders) {
|
|
41439
|
-
if (
|
|
41437
|
+
if (hasOwn(userHeaders, header)) {
|
|
41440
41438
|
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
41441
41439
|
}
|
|
41442
41440
|
}
|
|
41443
41441
|
return formHeaders;
|
|
41444
41442
|
};
|
|
41445
41443
|
FormData.prototype.setBoundary = function(boundary) {
|
|
41444
|
+
if (typeof boundary !== "string") {
|
|
41445
|
+
throw new TypeError("FormData boundary must be a string");
|
|
41446
|
+
}
|
|
41446
41447
|
this._boundary = boundary;
|
|
41447
41448
|
};
|
|
41448
41449
|
FormData.prototype.getBoundary = function() {
|
|
@@ -41513,8 +41514,10 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41513
41514
|
});
|
|
41514
41515
|
};
|
|
41515
41516
|
FormData.prototype.submit = function(params, cb) {
|
|
41516
|
-
var request
|
|
41517
|
-
|
|
41517
|
+
var request;
|
|
41518
|
+
var options;
|
|
41519
|
+
var defaults = { method: "post" };
|
|
41520
|
+
if (typeof params === "string") {
|
|
41518
41521
|
params = parseUrl(params);
|
|
41519
41522
|
options = populate({
|
|
41520
41523
|
port: params.port,
|
|
@@ -41525,11 +41528,11 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41525
41528
|
} else {
|
|
41526
41529
|
options = populate(params, defaults);
|
|
41527
41530
|
if (!options.port) {
|
|
41528
|
-
options.port = options.protocol
|
|
41531
|
+
options.port = options.protocol === "https:" ? 443 : 80;
|
|
41529
41532
|
}
|
|
41530
41533
|
}
|
|
41531
41534
|
options.headers = this.getHeaders(params.headers);
|
|
41532
|
-
if (options.protocol
|
|
41535
|
+
if (options.protocol === "https:") {
|
|
41533
41536
|
request = https.request(options);
|
|
41534
41537
|
} else {
|
|
41535
41538
|
request = http.request(options);
|
|
@@ -41568,6 +41571,7 @@ var require_form_data = __commonJS((exports, module) => {
|
|
|
41568
41571
|
return "[object FormData]";
|
|
41569
41572
|
};
|
|
41570
41573
|
setToStringTag(FormData, "FormData");
|
|
41574
|
+
module.exports = FormData;
|
|
41571
41575
|
});
|
|
41572
41576
|
|
|
41573
41577
|
// node_modules/.pnpm/ignore@7.0.5/node_modules/ignore/index.js
|
|
@@ -41917,8 +41921,8 @@ var {
|
|
|
41917
41921
|
import fs from "fs";
|
|
41918
41922
|
var version = "0.0.1";
|
|
41919
41923
|
try {
|
|
41920
|
-
if ("0.0.
|
|
41921
|
-
version = "0.0.
|
|
41924
|
+
if ("0.0.57")
|
|
41925
|
+
version = "0.0.57";
|
|
41922
41926
|
} catch (e) {}
|
|
41923
41927
|
program.name("app").description("A CLI tool with envison").version(version, "-V, --version");
|
|
41924
41928
|
var ls = new Command("ls").description("List files in the current directory").action(() => {
|
|
@@ -41963,14 +41967,14 @@ var writeConfig = (config) => {
|
|
|
41963
41967
|
return config;
|
|
41964
41968
|
};
|
|
41965
41969
|
|
|
41966
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
41970
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/key.js
|
|
41967
41971
|
var isUpKey = (key) => key.name === "up" || key.name === "k" || key.ctrl && key.name === "p";
|
|
41968
41972
|
var isDownKey = (key) => key.name === "down" || key.name === "j" || key.ctrl && key.name === "n";
|
|
41969
41973
|
var isSpaceKey = (key) => key.name === "space";
|
|
41970
41974
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
41971
41975
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
41972
41976
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
41973
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
41977
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
|
41974
41978
|
class AbortPromptError extends Error {
|
|
41975
41979
|
name = "AbortPromptError";
|
|
41976
41980
|
message = "Prompt was aborted";
|
|
@@ -41996,10 +42000,10 @@ class HookError extends Error {
|
|
|
41996
42000
|
class ValidationError extends Error {
|
|
41997
42001
|
name = "ValidationError";
|
|
41998
42002
|
}
|
|
41999
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42003
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
|
42000
42004
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
42001
42005
|
|
|
42002
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42006
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
|
42003
42007
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
42004
42008
|
var hookStorage = new AsyncLocalStorage;
|
|
42005
42009
|
function createStore(rl) {
|
|
@@ -42104,7 +42108,7 @@ var effectScheduler = {
|
|
|
42104
42108
|
}
|
|
42105
42109
|
};
|
|
42106
42110
|
|
|
42107
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42111
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
|
42108
42112
|
function useState(defaultValue) {
|
|
42109
42113
|
return withPointer((pointer) => {
|
|
42110
42114
|
const setState = AsyncResource2.bind(function setState(newValue) {
|
|
@@ -42122,7 +42126,7 @@ function useState(defaultValue) {
|
|
|
42122
42126
|
});
|
|
42123
42127
|
}
|
|
42124
42128
|
|
|
42125
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42129
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
|
42126
42130
|
function useEffect(cb, depArray) {
|
|
42127
42131
|
withPointer((pointer) => {
|
|
42128
42132
|
const oldDeps = pointer.get();
|
|
@@ -42134,7 +42138,7 @@ function useEffect(cb, depArray) {
|
|
|
42134
42138
|
});
|
|
42135
42139
|
}
|
|
42136
42140
|
|
|
42137
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42141
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
42138
42142
|
var import_yoctocolors_cjs = __toESM(require_yoctocolors_cjs(), 1);
|
|
42139
42143
|
|
|
42140
42144
|
// node_modules/.pnpm/@inquirer+figures@1.0.12/node_modules/@inquirer/figures/dist/esm/index.js
|
|
@@ -42423,7 +42427,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
42423
42427
|
var esm_default = figures;
|
|
42424
42428
|
var replacements = Object.entries(specialMainSymbols);
|
|
42425
42429
|
|
|
42426
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42430
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
|
42427
42431
|
var defaultTheme = {
|
|
42428
42432
|
prefix: {
|
|
42429
42433
|
idle: import_yoctocolors_cjs.default.blue("?"),
|
|
@@ -42444,7 +42448,7 @@ var defaultTheme = {
|
|
|
42444
42448
|
}
|
|
42445
42449
|
};
|
|
42446
42450
|
|
|
42447
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42451
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
|
42448
42452
|
function isPlainObject(value) {
|
|
42449
42453
|
if (typeof value !== "object" || value === null)
|
|
42450
42454
|
return false;
|
|
@@ -42472,7 +42476,7 @@ function makeTheme(...themes) {
|
|
|
42472
42476
|
return deepMerge(...themesToMerge);
|
|
42473
42477
|
}
|
|
42474
42478
|
|
|
42475
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42479
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
|
42476
42480
|
function usePrefix({ status = "idle", theme }) {
|
|
42477
42481
|
const [showLoader, setShowLoader] = useState(false);
|
|
42478
42482
|
const [tick, setTick] = useState(0);
|
|
@@ -42502,7 +42506,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
42502
42506
|
const iconName = status === "loading" ? "idle" : status;
|
|
42503
42507
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
42504
42508
|
}
|
|
42505
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42509
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
|
42506
42510
|
function useMemo(fn, dependencies) {
|
|
42507
42511
|
return withPointer((pointer) => {
|
|
42508
42512
|
const prev = pointer.get();
|
|
@@ -42514,11 +42518,11 @@ function useMemo(fn, dependencies) {
|
|
|
42514
42518
|
return prev.value;
|
|
42515
42519
|
});
|
|
42516
42520
|
}
|
|
42517
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42521
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
|
42518
42522
|
function useRef(val) {
|
|
42519
42523
|
return useState({ current: val })[0];
|
|
42520
42524
|
}
|
|
42521
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42525
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
|
42522
42526
|
function useKeypress(userHandler) {
|
|
42523
42527
|
const signal = useRef(userHandler);
|
|
42524
42528
|
signal.current = userHandler;
|
|
@@ -42536,7 +42540,7 @@ function useKeypress(userHandler) {
|
|
|
42536
42540
|
};
|
|
42537
42541
|
}, []);
|
|
42538
42542
|
}
|
|
42539
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42543
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
|
42540
42544
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
42541
42545
|
var import_wrap_ansi = __toESM(require_wrap_ansi(), 1);
|
|
42542
42546
|
function breakLines(content, width) {
|
|
@@ -42549,7 +42553,7 @@ function readlineWidth() {
|
|
|
42549
42553
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
42550
42554
|
}
|
|
42551
42555
|
|
|
42552
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42556
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
|
42553
42557
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
42554
42558
|
const state = useRef({
|
|
42555
42559
|
lastPointer: active,
|
|
@@ -42615,7 +42619,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
42615
42619
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
42616
42620
|
`);
|
|
42617
42621
|
}
|
|
42618
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42622
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
42619
42623
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
42620
42624
|
import * as readline2 from "node:readline";
|
|
42621
42625
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -42828,7 +42832,7 @@ var {
|
|
|
42828
42832
|
unload
|
|
42829
42833
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
|
|
42830
42834
|
|
|
42831
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42835
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
|
42832
42836
|
var import_ansi_escapes = __toESM(require_ansi_escapes(), 1);
|
|
42833
42837
|
import { stripVTControlCharacters } from "node:util";
|
|
42834
42838
|
var height = (content) => content.split(`
|
|
@@ -42898,7 +42902,7 @@ class ScreenManager {
|
|
|
42898
42902
|
}
|
|
42899
42903
|
}
|
|
42900
42904
|
|
|
42901
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42905
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
|
42902
42906
|
class PromisePolyfill extends Promise {
|
|
42903
42907
|
static withResolver() {
|
|
42904
42908
|
let resolve;
|
|
@@ -42911,7 +42915,7 @@ class PromisePolyfill extends Promise {
|
|
|
42911
42915
|
}
|
|
42912
42916
|
}
|
|
42913
42917
|
|
|
42914
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
42918
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
|
42915
42919
|
function getCallSites() {
|
|
42916
42920
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
42917
42921
|
let result = [];
|
|
@@ -42997,7 +43001,7 @@ function createPrompt(view) {
|
|
|
42997
43001
|
};
|
|
42998
43002
|
return prompt;
|
|
42999
43003
|
}
|
|
43000
|
-
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@
|
|
43004
|
+
// node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
|
43001
43005
|
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
|
43002
43006
|
class Separator {
|
|
43003
43007
|
separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
|
@@ -43011,7 +43015,7 @@ class Separator {
|
|
|
43011
43015
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
43012
43016
|
}
|
|
43013
43017
|
}
|
|
43014
|
-
// node_modules/.pnpm/@inquirer+checkbox@4.1.8_@types+node@
|
|
43018
|
+
// node_modules/.pnpm/@inquirer+checkbox@4.1.8_@types+node@24.0.3/node_modules/@inquirer/checkbox/dist/esm/index.js
|
|
43015
43019
|
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
|
43016
43020
|
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
|
43017
43021
|
var checkboxTheme = {
|
|
@@ -43185,7 +43189,7 @@ ${theme.style.error(errorMsg)}`;
|
|
|
43185
43189
|
return `${prefix} ${message}${helpTipTop}
|
|
43186
43190
|
${page}${helpTipBottom}${choiceDescription}${error}${import_ansi_escapes2.default.cursorHide}`;
|
|
43187
43191
|
});
|
|
43188
|
-
// node_modules/.pnpm/@inquirer+editor@4.2.13_@types+node@
|
|
43192
|
+
// node_modules/.pnpm/@inquirer+editor@4.2.13_@types+node@24.0.3/node_modules/@inquirer/editor/dist/esm/index.js
|
|
43189
43193
|
var import_external_editor = __toESM(require_main(), 1);
|
|
43190
43194
|
var editorTheme = {
|
|
43191
43195
|
validationFailureMode: "keep"
|
|
@@ -43253,7 +43257,7 @@ var esm_default3 = createPrompt((config, done) => {
|
|
|
43253
43257
|
}
|
|
43254
43258
|
return [[prefix, message, helpTip].filter(Boolean).join(" "), error];
|
|
43255
43259
|
});
|
|
43256
|
-
// node_modules/.pnpm/@inquirer+confirm@5.1.12_@types+node@
|
|
43260
|
+
// node_modules/.pnpm/@inquirer+confirm@5.1.12_@types+node@24.0.3/node_modules/@inquirer/confirm/dist/esm/index.js
|
|
43257
43261
|
function getBooleanValue(value, defaultValue) {
|
|
43258
43262
|
let answer = defaultValue !== false;
|
|
43259
43263
|
if (/^(y|yes)/i.test(value))
|
|
@@ -43296,7 +43300,7 @@ var esm_default4 = createPrompt((config, done) => {
|
|
|
43296
43300
|
const message = theme.style.message(config.message, status);
|
|
43297
43301
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
43298
43302
|
});
|
|
43299
|
-
// node_modules/.pnpm/@inquirer+input@4.1.12_@types+node@
|
|
43303
|
+
// node_modules/.pnpm/@inquirer+input@4.1.12_@types+node@24.0.3/node_modules/@inquirer/input/dist/esm/index.js
|
|
43300
43304
|
var inputTheme = {
|
|
43301
43305
|
validationFailureMode: "keep"
|
|
43302
43306
|
};
|
|
@@ -43361,7 +43365,7 @@ var esm_default5 = createPrompt((config, done) => {
|
|
|
43361
43365
|
error
|
|
43362
43366
|
];
|
|
43363
43367
|
});
|
|
43364
|
-
// node_modules/.pnpm/@inquirer+number@3.0.15_@types+node@
|
|
43368
|
+
// node_modules/.pnpm/@inquirer+number@3.0.15_@types+node@24.0.3/node_modules/@inquirer/number/dist/esm/index.js
|
|
43365
43369
|
function isStepOf(value, step, min) {
|
|
43366
43370
|
const valuePow = value * Math.pow(10, 6);
|
|
43367
43371
|
const stepPow = step * Math.pow(10, 6);
|
|
@@ -43441,7 +43445,7 @@ var esm_default6 = createPrompt((config, done) => {
|
|
|
43441
43445
|
error
|
|
43442
43446
|
];
|
|
43443
43447
|
});
|
|
43444
|
-
// node_modules/.pnpm/@inquirer+expand@4.0.15_@types+node@
|
|
43448
|
+
// node_modules/.pnpm/@inquirer+expand@4.0.15_@types+node@24.0.3/node_modules/@inquirer/expand/dist/esm/index.js
|
|
43445
43449
|
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
|
43446
43450
|
function normalizeChoices2(choices) {
|
|
43447
43451
|
return choices.map((choice) => {
|
|
@@ -43538,7 +43542,7 @@ var esm_default7 = createPrompt((config, done) => {
|
|
|
43538
43542
|
`)
|
|
43539
43543
|
];
|
|
43540
43544
|
});
|
|
43541
|
-
// node_modules/.pnpm/@inquirer+rawlist@4.1.3_@types+node@
|
|
43545
|
+
// node_modules/.pnpm/@inquirer+rawlist@4.1.3_@types+node@24.0.3/node_modules/@inquirer/rawlist/dist/esm/index.js
|
|
43542
43546
|
var import_yoctocolors_cjs5 = __toESM(require_yoctocolors_cjs(), 1);
|
|
43543
43547
|
var numberRegex = /\d+/;
|
|
43544
43548
|
function isSelectableChoice(choice) {
|
|
@@ -43650,7 +43654,7 @@ var esm_default8 = createPrompt((config, done) => {
|
|
|
43650
43654
|
`)
|
|
43651
43655
|
];
|
|
43652
43656
|
});
|
|
43653
|
-
// node_modules/.pnpm/@inquirer+password@4.0.15_@types+node@
|
|
43657
|
+
// node_modules/.pnpm/@inquirer+password@4.0.15_@types+node@24.0.3/node_modules/@inquirer/password/dist/esm/index.js
|
|
43654
43658
|
var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
|
43655
43659
|
var esm_default9 = createPrompt((config, done) => {
|
|
43656
43660
|
const { validate = () => true } = config;
|
|
@@ -43699,7 +43703,7 @@ var esm_default9 = createPrompt((config, done) => {
|
|
|
43699
43703
|
}
|
|
43700
43704
|
return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error];
|
|
43701
43705
|
});
|
|
43702
|
-
// node_modules/.pnpm/@inquirer+search@3.0.15_@types+node@
|
|
43706
|
+
// node_modules/.pnpm/@inquirer+search@3.0.15_@types+node@24.0.3/node_modules/@inquirer/search/dist/esm/index.js
|
|
43703
43707
|
var import_yoctocolors_cjs6 = __toESM(require_yoctocolors_cjs(), 1);
|
|
43704
43708
|
var searchTheme = {
|
|
43705
43709
|
icon: { cursor: esm_default.pointer },
|
|
@@ -43864,7 +43868,7 @@ ${theme.style.description(selectedChoice.description)}` : ``;
|
|
|
43864
43868
|
`${error ?? page}${helpTip}${choiceDescription}`
|
|
43865
43869
|
];
|
|
43866
43870
|
});
|
|
43867
|
-
// node_modules/.pnpm/@inquirer+select@4.2.3_@types+node@
|
|
43871
|
+
// node_modules/.pnpm/@inquirer+select@4.2.3_@types+node@24.0.3/node_modules/@inquirer/select/dist/esm/index.js
|
|
43868
43872
|
var import_yoctocolors_cjs7 = __toESM(require_yoctocolors_cjs(), 1);
|
|
43869
43873
|
var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
|
|
43870
43874
|
var selectTheme = {
|
|
@@ -44010,7 +44014,7 @@ ${theme.style.description(selectedChoice.description)}` : ``;
|
|
|
44010
44014
|
return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
|
|
44011
44015
|
${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursorHide}`;
|
|
44012
44016
|
});
|
|
44013
|
-
// node_modules/.pnpm/inquirer@12.6.3_@types+node@
|
|
44017
|
+
// node_modules/.pnpm/inquirer@12.6.3_@types+node@24.0.3/node_modules/inquirer/dist/esm/ui/prompt.js
|
|
44014
44018
|
var import_rxjs = __toESM(require_cjs(), 1);
|
|
44015
44019
|
var import_run_async = __toESM(require_run_async(), 1);
|
|
44016
44020
|
var import_mute_stream2 = __toESM(require_lib(), 1);
|
|
@@ -44222,7 +44226,7 @@ class PromptsRunner {
|
|
|
44222
44226
|
};
|
|
44223
44227
|
}
|
|
44224
44228
|
|
|
44225
|
-
// node_modules/.pnpm/inquirer@12.6.3_@types+node@
|
|
44229
|
+
// node_modules/.pnpm/inquirer@12.6.3_@types+node@24.0.3/node_modules/inquirer/dist/esm/index.js
|
|
44226
44230
|
var builtInPrompts = {
|
|
44227
44231
|
input: esm_default5,
|
|
44228
44232
|
select: esm_default11,
|
|
@@ -44274,15 +44278,25 @@ var esm_default12 = inquirer;
|
|
|
44274
44278
|
// src/module/login/login-by-web.ts
|
|
44275
44279
|
var import_md5 = __toESM(require_md5(), 1);
|
|
44276
44280
|
|
|
44277
|
-
// node_modules/.pnpm/@kevisual+query@0.0.
|
|
44278
|
-
var
|
|
44281
|
+
// node_modules/.pnpm/@kevisual+query@0.0.29_ws@8.18.0/node_modules/@kevisual/query/dist/query.js
|
|
44282
|
+
var isTextForContentType = (contentType) => {
|
|
44283
|
+
if (!contentType)
|
|
44284
|
+
return false;
|
|
44285
|
+
const textTypes = ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded"];
|
|
44286
|
+
return textTypes.some((type) => contentType.includes(type));
|
|
44287
|
+
};
|
|
44288
|
+
var adapter = async (opts = {}, overloadOpts) => {
|
|
44279
44289
|
const controller = new AbortController;
|
|
44280
44290
|
const signal = controller.signal;
|
|
44291
|
+
const isBlob = opts.isBlob || false;
|
|
44292
|
+
const isText = opts.isText || false;
|
|
44293
|
+
const isPostFile = opts.isPostFile || false;
|
|
44281
44294
|
const timeout = opts.timeout || 60000 * 3;
|
|
44282
44295
|
const timer = setTimeout(() => {
|
|
44283
44296
|
controller.abort();
|
|
44284
44297
|
}, timeout);
|
|
44285
|
-
let method = overloadOpts?.method || opts
|
|
44298
|
+
let method = overloadOpts?.method || opts?.method || "POST";
|
|
44299
|
+
let headers = { ...opts?.headers, ...overloadOpts?.headers };
|
|
44286
44300
|
let origin = "";
|
|
44287
44301
|
let url;
|
|
44288
44302
|
if (opts?.url?.startsWith("http")) {
|
|
@@ -44295,21 +44309,40 @@ var adapter = async (opts, overloadOpts) => {
|
|
|
44295
44309
|
if (isGet) {
|
|
44296
44310
|
url.search = new URLSearchParams(opts.body).toString();
|
|
44297
44311
|
}
|
|
44312
|
+
let body = undefined;
|
|
44313
|
+
if (isGet) {
|
|
44314
|
+
body = undefined;
|
|
44315
|
+
} else if (isPostFile) {
|
|
44316
|
+
body = opts.body;
|
|
44317
|
+
} else {
|
|
44318
|
+
headers = {
|
|
44319
|
+
"Content-Type": "application/json",
|
|
44320
|
+
...headers
|
|
44321
|
+
};
|
|
44322
|
+
body = JSON.stringify(opts.body);
|
|
44323
|
+
}
|
|
44298
44324
|
return fetch(url, {
|
|
44299
44325
|
method: method.toUpperCase(),
|
|
44300
|
-
headers: {
|
|
44301
|
-
"Content-Type": "application/json",
|
|
44302
|
-
...opts.headers
|
|
44303
|
-
},
|
|
44304
44326
|
signal,
|
|
44327
|
+
body,
|
|
44305
44328
|
...overloadOpts,
|
|
44306
|
-
|
|
44307
|
-
}).then((response) => {
|
|
44329
|
+
headers
|
|
44330
|
+
}).then(async (response) => {
|
|
44308
44331
|
const contentType = response.headers.get("Content-Type");
|
|
44309
|
-
if (
|
|
44310
|
-
return response.
|
|
44332
|
+
if (isBlob) {
|
|
44333
|
+
return await response.blob();
|
|
44334
|
+
}
|
|
44335
|
+
const isJson = contentType && contentType.includes("application/json");
|
|
44336
|
+
if (isJson && !isText) {
|
|
44337
|
+
return await response.json();
|
|
44338
|
+
} else if (isTextForContentType(contentType)) {
|
|
44339
|
+
return {
|
|
44340
|
+
code: 200,
|
|
44341
|
+
status: response.status,
|
|
44342
|
+
data: await response.text()
|
|
44343
|
+
};
|
|
44311
44344
|
} else {
|
|
44312
|
-
return response
|
|
44345
|
+
return response;
|
|
44313
44346
|
}
|
|
44314
44347
|
}).catch((err) => {
|
|
44315
44348
|
if (err.name === "AbortError") {
|
|
@@ -44330,6 +44363,7 @@ var setBaseResponse = (res) => {
|
|
|
44330
44363
|
fn?.();
|
|
44331
44364
|
}
|
|
44332
44365
|
};
|
|
44366
|
+
return res;
|
|
44333
44367
|
};
|
|
44334
44368
|
var wrapperError = ({ code, message }) => {
|
|
44335
44369
|
const result = {
|
|
@@ -44401,7 +44435,7 @@ class Query {
|
|
|
44401
44435
|
message: "api request beforeFn error"
|
|
44402
44436
|
});
|
|
44403
44437
|
}
|
|
44404
|
-
if (this.stop) {
|
|
44438
|
+
if (this.stop && !options?.noStop) {
|
|
44405
44439
|
const that = this;
|
|
44406
44440
|
await new Promise((resolve) => {
|
|
44407
44441
|
let timer = 0;
|
|
@@ -44443,17 +44477,45 @@ class Query {
|
|
|
44443
44477
|
after(fn) {
|
|
44444
44478
|
this.afterResponse = fn;
|
|
44445
44479
|
}
|
|
44480
|
+
async fetchText(urlOrOptions, options) {
|
|
44481
|
+
let _options = { ...options };
|
|
44482
|
+
if (typeof urlOrOptions === "string" && !_options.url) {
|
|
44483
|
+
_options.url = urlOrOptions;
|
|
44484
|
+
}
|
|
44485
|
+
if (typeof urlOrOptions === "object") {
|
|
44486
|
+
_options = { ...urlOrOptions, ..._options };
|
|
44487
|
+
}
|
|
44488
|
+
const res = await adapter({
|
|
44489
|
+
method: "GET",
|
|
44490
|
+
..._options,
|
|
44491
|
+
headers: {
|
|
44492
|
+
...this.headers,
|
|
44493
|
+
..._options?.headers || {}
|
|
44494
|
+
}
|
|
44495
|
+
});
|
|
44496
|
+
return setBaseResponse(res);
|
|
44497
|
+
}
|
|
44446
44498
|
}
|
|
44447
44499
|
|
|
44448
|
-
// node_modules/.pnpm/@kevisual+query@0.0.
|
|
44449
|
-
var
|
|
44500
|
+
// node_modules/.pnpm/@kevisual+query@0.0.29_ws@8.18.0/node_modules/@kevisual/query/dist/query-browser.js
|
|
44501
|
+
var isTextForContentType2 = (contentType) => {
|
|
44502
|
+
if (!contentType)
|
|
44503
|
+
return false;
|
|
44504
|
+
const textTypes = ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded"];
|
|
44505
|
+
return textTypes.some((type) => contentType.includes(type));
|
|
44506
|
+
};
|
|
44507
|
+
var adapter2 = async (opts = {}, overloadOpts) => {
|
|
44450
44508
|
const controller = new AbortController;
|
|
44451
44509
|
const signal = controller.signal;
|
|
44510
|
+
const isBlob = opts.isBlob || false;
|
|
44511
|
+
const isText = opts.isText || false;
|
|
44512
|
+
const isPostFile = opts.isPostFile || false;
|
|
44452
44513
|
const timeout = opts.timeout || 60000 * 3;
|
|
44453
44514
|
const timer = setTimeout(() => {
|
|
44454
44515
|
controller.abort();
|
|
44455
44516
|
}, timeout);
|
|
44456
|
-
let method = overloadOpts?.method || opts
|
|
44517
|
+
let method = overloadOpts?.method || opts?.method || "POST";
|
|
44518
|
+
let headers = { ...opts?.headers, ...overloadOpts?.headers };
|
|
44457
44519
|
let origin = "";
|
|
44458
44520
|
let url;
|
|
44459
44521
|
if (opts?.url?.startsWith("http")) {
|
|
@@ -44466,21 +44528,40 @@ var adapter2 = async (opts, overloadOpts) => {
|
|
|
44466
44528
|
if (isGet) {
|
|
44467
44529
|
url.search = new URLSearchParams(opts.body).toString();
|
|
44468
44530
|
}
|
|
44531
|
+
let body = undefined;
|
|
44532
|
+
if (isGet) {
|
|
44533
|
+
body = undefined;
|
|
44534
|
+
} else if (isPostFile) {
|
|
44535
|
+
body = opts.body;
|
|
44536
|
+
} else {
|
|
44537
|
+
headers = {
|
|
44538
|
+
"Content-Type": "application/json",
|
|
44539
|
+
...headers
|
|
44540
|
+
};
|
|
44541
|
+
body = JSON.stringify(opts.body);
|
|
44542
|
+
}
|
|
44469
44543
|
return fetch(url, {
|
|
44470
44544
|
method: method.toUpperCase(),
|
|
44471
|
-
headers: {
|
|
44472
|
-
"Content-Type": "application/json",
|
|
44473
|
-
...opts.headers
|
|
44474
|
-
},
|
|
44475
44545
|
signal,
|
|
44546
|
+
body,
|
|
44476
44547
|
...overloadOpts,
|
|
44477
|
-
|
|
44478
|
-
}).then((response) => {
|
|
44548
|
+
headers
|
|
44549
|
+
}).then(async (response) => {
|
|
44479
44550
|
const contentType = response.headers.get("Content-Type");
|
|
44480
|
-
if (
|
|
44481
|
-
return response.
|
|
44551
|
+
if (isBlob) {
|
|
44552
|
+
return await response.blob();
|
|
44553
|
+
}
|
|
44554
|
+
const isJson = contentType && contentType.includes("application/json");
|
|
44555
|
+
if (isJson && !isText) {
|
|
44556
|
+
return await response.json();
|
|
44557
|
+
} else if (isTextForContentType2(contentType)) {
|
|
44558
|
+
return {
|
|
44559
|
+
code: 200,
|
|
44560
|
+
status: response.status,
|
|
44561
|
+
data: await response.text()
|
|
44562
|
+
};
|
|
44482
44563
|
} else {
|
|
44483
|
-
return response
|
|
44564
|
+
return response;
|
|
44484
44565
|
}
|
|
44485
44566
|
}).catch((err) => {
|
|
44486
44567
|
if (err.name === "AbortError") {
|
|
@@ -44501,6 +44582,7 @@ var setBaseResponse2 = (res) => {
|
|
|
44501
44582
|
fn?.();
|
|
44502
44583
|
}
|
|
44503
44584
|
};
|
|
44585
|
+
return res;
|
|
44504
44586
|
};
|
|
44505
44587
|
var wrapperError2 = ({ code, message }) => {
|
|
44506
44588
|
const result = {
|
|
@@ -44572,7 +44654,7 @@ class Query2 {
|
|
|
44572
44654
|
message: "api request beforeFn error"
|
|
44573
44655
|
});
|
|
44574
44656
|
}
|
|
44575
|
-
if (this.stop) {
|
|
44657
|
+
if (this.stop && !options?.noStop) {
|
|
44576
44658
|
const that = this;
|
|
44577
44659
|
await new Promise((resolve) => {
|
|
44578
44660
|
let timer = 0;
|
|
@@ -44614,6 +44696,24 @@ class Query2 {
|
|
|
44614
44696
|
after(fn) {
|
|
44615
44697
|
this.afterResponse = fn;
|
|
44616
44698
|
}
|
|
44699
|
+
async fetchText(urlOrOptions, options) {
|
|
44700
|
+
let _options = { ...options };
|
|
44701
|
+
if (typeof urlOrOptions === "string" && !_options.url) {
|
|
44702
|
+
_options.url = urlOrOptions;
|
|
44703
|
+
}
|
|
44704
|
+
if (typeof urlOrOptions === "object") {
|
|
44705
|
+
_options = { ...urlOrOptions, ..._options };
|
|
44706
|
+
}
|
|
44707
|
+
const res = await adapter2({
|
|
44708
|
+
method: "GET",
|
|
44709
|
+
..._options,
|
|
44710
|
+
headers: {
|
|
44711
|
+
...this.headers,
|
|
44712
|
+
..._options?.headers || {}
|
|
44713
|
+
}
|
|
44714
|
+
});
|
|
44715
|
+
return setBaseResponse2(res);
|
|
44716
|
+
}
|
|
44617
44717
|
}
|
|
44618
44718
|
|
|
44619
44719
|
class BaseQuery {
|
|
@@ -44641,7 +44741,7 @@ class BaseQuery {
|
|
|
44641
44741
|
}
|
|
44642
44742
|
}
|
|
44643
44743
|
|
|
44644
|
-
// node_modules/.pnpm/@kevisual+query-login@0.0.6_@kevisual+query@0.0.
|
|
44744
|
+
// node_modules/.pnpm/@kevisual+query-login@0.0.6_@kevisual+query@0.0.29_ws@8.18.0_/node_modules/@kevisual/query-login/dist/query-login-node.js
|
|
44645
44745
|
import { homedir } from "node:os";
|
|
44646
44746
|
import { join, dirname } from "node:path";
|
|
44647
44747
|
import fs3 from "node:fs";
|
|
@@ -46488,7 +46588,7 @@ baseURL2.addCommand(kv);
|
|
|
46488
46588
|
|
|
46489
46589
|
// src/command/deploy.ts
|
|
46490
46590
|
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
46491
|
-
var
|
|
46591
|
+
var import_form_data = __toESM(require_form_data(), 1);
|
|
46492
46592
|
import path10 from "path";
|
|
46493
46593
|
import fs17 from "fs";
|
|
46494
46594
|
|
|
@@ -52750,8 +52850,25 @@ var getBufferHash = (buffer) => {
|
|
|
52750
52850
|
return import_md52.default(buffer.toString()).toString();
|
|
52751
52851
|
};
|
|
52752
52852
|
|
|
52753
|
-
// src/
|
|
52754
|
-
var
|
|
52853
|
+
// src/query/app-manager/query-app.ts
|
|
52854
|
+
var queryApp = async (params, opts) => {
|
|
52855
|
+
return await query.post({
|
|
52856
|
+
path: "app",
|
|
52857
|
+
key: "getApp",
|
|
52858
|
+
data: {
|
|
52859
|
+
...params
|
|
52860
|
+
}
|
|
52861
|
+
}, opts);
|
|
52862
|
+
};
|
|
52863
|
+
var queryAppVersion = async (params, opts) => {
|
|
52864
|
+
return await query.post({
|
|
52865
|
+
path: "app",
|
|
52866
|
+
key: "get",
|
|
52867
|
+
data: {
|
|
52868
|
+
...params
|
|
52869
|
+
}
|
|
52870
|
+
}, opts);
|
|
52871
|
+
};
|
|
52755
52872
|
|
|
52756
52873
|
// node_modules/.pnpm/@kevisual+logger@0.0.4/node_modules/@kevisual/logger/dist/logger-node.mjs
|
|
52757
52874
|
import process5 from "node:process";
|
|
@@ -53367,97 +53484,8 @@ var logger = new Logger2({
|
|
|
53367
53484
|
level
|
|
53368
53485
|
});
|
|
53369
53486
|
|
|
53370
|
-
// src/module/download/upload.ts
|
|
53371
|
-
var handleResponse = async (err, res) => {
|
|
53372
|
-
return new Promise((resolve2) => {
|
|
53373
|
-
if (err) {
|
|
53374
|
-
console.error("Upload failed:", err);
|
|
53375
|
-
resolve2({ code: 500, message: err });
|
|
53376
|
-
return;
|
|
53377
|
-
}
|
|
53378
|
-
let body = "";
|
|
53379
|
-
res.on("data", (chunk) => {
|
|
53380
|
-
body += chunk;
|
|
53381
|
-
});
|
|
53382
|
-
res.on("end", () => {
|
|
53383
|
-
try {
|
|
53384
|
-
const res2 = JSON.parse(body);
|
|
53385
|
-
resolve2(res2);
|
|
53386
|
-
} catch (e) {
|
|
53387
|
-
resolve2({ code: 500, message: body });
|
|
53388
|
-
}
|
|
53389
|
-
});
|
|
53390
|
-
});
|
|
53391
|
-
};
|
|
53392
|
-
var getFormParams = (opts, headers) => {
|
|
53393
|
-
const url = new URL(opts.url);
|
|
53394
|
-
if (opts.token) {}
|
|
53395
|
-
if (opts.meta) {
|
|
53396
|
-
url.searchParams.append("meta", encodeURIComponent(JSON.stringify(opts.meta)));
|
|
53397
|
-
}
|
|
53398
|
-
const value = {
|
|
53399
|
-
path: url.pathname + url.search,
|
|
53400
|
-
host: url.hostname,
|
|
53401
|
-
method: "POST",
|
|
53402
|
-
protocol: url.protocol === "https:" ? "https:" : "http:",
|
|
53403
|
-
port: url.port || (url.protocol === "https:" ? 443 : 80),
|
|
53404
|
-
headers: {
|
|
53405
|
-
Authorization: "Bearer " + opts.token,
|
|
53406
|
-
...headers
|
|
53407
|
-
}
|
|
53408
|
-
};
|
|
53409
|
-
logger.debug("getFormParams", value);
|
|
53410
|
-
return value;
|
|
53411
|
-
};
|
|
53412
|
-
var upload = (opts) => {
|
|
53413
|
-
const form = opts?.form || new import_form_data.default;
|
|
53414
|
-
if (!opts.form) {
|
|
53415
|
-
let hash = "";
|
|
53416
|
-
let value;
|
|
53417
|
-
let type = "string";
|
|
53418
|
-
if (typeof opts.file === "string") {
|
|
53419
|
-
value = Buffer.from(opts.file);
|
|
53420
|
-
} else {
|
|
53421
|
-
type = "buffer";
|
|
53422
|
-
value = opts.file;
|
|
53423
|
-
}
|
|
53424
|
-
form.append("file", value);
|
|
53425
|
-
if (opts.needHash) {
|
|
53426
|
-
hash = opts?.hash || getBufferHash(value);
|
|
53427
|
-
opts.url = new URL(opts.url.toString());
|
|
53428
|
-
opts.url.searchParams.append("hash", hash);
|
|
53429
|
-
}
|
|
53430
|
-
}
|
|
53431
|
-
const headers = form.getHeaders();
|
|
53432
|
-
return new Promise((resolve2) => {
|
|
53433
|
-
form.submit(getFormParams(opts, headers), (err, res) => {
|
|
53434
|
-
handleResponse(err, res).then(resolve2);
|
|
53435
|
-
});
|
|
53436
|
-
});
|
|
53437
|
-
};
|
|
53438
|
-
|
|
53439
|
-
// src/query/app-manager/query-app.ts
|
|
53440
|
-
var queryApp = async (params, opts) => {
|
|
53441
|
-
return await query.post({
|
|
53442
|
-
path: "app",
|
|
53443
|
-
key: "getApp",
|
|
53444
|
-
data: {
|
|
53445
|
-
...params
|
|
53446
|
-
}
|
|
53447
|
-
}, opts);
|
|
53448
|
-
};
|
|
53449
|
-
var queryAppVersion = async (params, opts) => {
|
|
53450
|
-
return await query.post({
|
|
53451
|
-
path: "app",
|
|
53452
|
-
key: "get",
|
|
53453
|
-
data: {
|
|
53454
|
-
...params
|
|
53455
|
-
}
|
|
53456
|
-
}, opts);
|
|
53457
|
-
};
|
|
53458
|
-
|
|
53459
53487
|
// src/command/deploy.ts
|
|
53460
|
-
var getPackageJson = () => {
|
|
53488
|
+
var getPackageJson = (opts) => {
|
|
53461
53489
|
const filePath = path10.join(process.cwd(), "package.json");
|
|
53462
53490
|
if (!fs17.existsSync(filePath)) {
|
|
53463
53491
|
return null;
|
|
@@ -53468,12 +53496,12 @@ var getPackageJson = () => {
|
|
|
53468
53496
|
const version3 = packageJson.version || "";
|
|
53469
53497
|
const app = packageJson.app;
|
|
53470
53498
|
const userAppArry = basename2.split("/");
|
|
53471
|
-
if (userAppArry.length <= 2) {
|
|
53499
|
+
if (userAppArry.length <= 2 && !opts?.appKey) {
|
|
53472
53500
|
console.error(source_default.red("basename is error, 请输入正确的路径, packages.json中basename例如 /root/appKey"));
|
|
53473
53501
|
return null;
|
|
53474
53502
|
}
|
|
53475
53503
|
const [user, appKey] = userAppArry;
|
|
53476
|
-
return { basename: basename2, version: version3, pkg: packageJson, user, appKey, app };
|
|
53504
|
+
return { basename: basename2, version: version3, pkg: packageJson, user, appKey: appKey || opts?.appKey, app };
|
|
53477
53505
|
} catch (error) {
|
|
53478
53506
|
return null;
|
|
53479
53507
|
}
|
|
@@ -53483,7 +53511,7 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
|
|
|
53483
53511
|
let { version: version3, key: key2, yes, update: update3, org, showBackend } = options;
|
|
53484
53512
|
const noCheck = !options.noCheck;
|
|
53485
53513
|
const dot = !!options.dot;
|
|
53486
|
-
const pkgInfo = getPackageJson();
|
|
53514
|
+
const pkgInfo = getPackageJson({ version: version3, appKey: key2 });
|
|
53487
53515
|
if (!version3 && pkgInfo?.version) {
|
|
53488
53516
|
version3 = pkgInfo?.version || "";
|
|
53489
53517
|
}
|
|
@@ -53516,9 +53544,21 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
|
|
|
53516
53544
|
let isDirectory = false;
|
|
53517
53545
|
if (stat2.isDirectory()) {
|
|
53518
53546
|
isDirectory = true;
|
|
53519
|
-
const
|
|
53520
|
-
|
|
53521
|
-
|
|
53547
|
+
const files = await import_fast_glob2.default("**/*", {
|
|
53548
|
+
cwd: directory,
|
|
53549
|
+
ignore: ["node_modules/**/*", ".git/**/*", ".DS_Store"],
|
|
53550
|
+
onlyFiles: true,
|
|
53551
|
+
dot,
|
|
53552
|
+
absolute: true
|
|
53553
|
+
});
|
|
53554
|
+
console.log("files", files);
|
|
53555
|
+
const normalizeFilePath = (filePath2) => {
|
|
53556
|
+
return filePath2.split(path10.sep).join("/");
|
|
53557
|
+
};
|
|
53558
|
+
_relativeFiles = files.map((file) => {
|
|
53559
|
+
const relativePath = path10.relative(directory, file);
|
|
53560
|
+
return normalizeFilePath(relativePath);
|
|
53561
|
+
});
|
|
53522
53562
|
} else if (stat2.isFile()) {
|
|
53523
53563
|
const filename = path10.basename(directory);
|
|
53524
53564
|
_relativeFiles = [filename];
|
|
@@ -53587,11 +53627,15 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
|
|
|
53587
53627
|
});
|
|
53588
53628
|
var uploadFiles = async (files, directory, opts) => {
|
|
53589
53629
|
const { key: key2, version: version3, username } = opts || {};
|
|
53590
|
-
const form = new
|
|
53630
|
+
const form = new import_form_data.default;
|
|
53591
53631
|
const data = { files: [] };
|
|
53592
53632
|
for (const file of files) {
|
|
53593
53633
|
const filePath = path10.join(directory, file);
|
|
53594
53634
|
const hash = getHash(filePath);
|
|
53635
|
+
if (!hash) {
|
|
53636
|
+
console.error("文件", filePath, "不存在");
|
|
53637
|
+
console.error("请检查文件是否存在");
|
|
53638
|
+
}
|
|
53595
53639
|
data.files.push({ path: file, hash });
|
|
53596
53640
|
}
|
|
53597
53641
|
data.appKey = key2;
|
|
@@ -53608,7 +53652,7 @@ var uploadFiles = async (files, directory, opts) => {
|
|
|
53608
53652
|
}
|
|
53609
53653
|
const token2 = await storage.getItem("token");
|
|
53610
53654
|
const checkUrl = new URL("/api/s1/resources/upload/check", getBaseURL());
|
|
53611
|
-
const res = await query.adapter({ url: checkUrl.toString(), method: "POST", body: data, headers: { Authorization: "Bearer " + token2
|
|
53655
|
+
const res = await query.adapter({ url: checkUrl.toString(), method: "POST", body: data, headers: { Authorization: "Bearer " + token2 } }).then((res2) => {
|
|
53612
53656
|
try {
|
|
53613
53657
|
if (typeof res2 === "string") {
|
|
53614
53658
|
return JSON.parse(res2);
|
|
@@ -53624,6 +53668,7 @@ var uploadFiles = async (files, directory, opts) => {
|
|
|
53624
53668
|
console.error("check failed", res);
|
|
53625
53669
|
return res;
|
|
53626
53670
|
}
|
|
53671
|
+
console.log("res", res);
|
|
53627
53672
|
let needUpload = false;
|
|
53628
53673
|
for (const file of files) {
|
|
53629
53674
|
const filePath = path10.join(directory, file);
|
|
@@ -53651,7 +53696,7 @@ var uploadFiles = async (files, directory, opts) => {
|
|
|
53651
53696
|
if (opts.noCheckAppFiles) {
|
|
53652
53697
|
url.searchParams.append("noCheckAppFiles", "true");
|
|
53653
53698
|
}
|
|
53654
|
-
return
|
|
53699
|
+
return { code: 200 };
|
|
53655
53700
|
};
|
|
53656
53701
|
program.addCommand(command2);
|
|
53657
53702
|
var deployLoadFn2 = async (id, org) => {
|
|
@@ -54819,6 +54864,78 @@ var fetchAiList = async (url, opts) => {
|
|
|
54819
54864
|
|
|
54820
54865
|
// src/command/sync/sync.ts
|
|
54821
54866
|
import fs23 from "node:fs";
|
|
54867
|
+
|
|
54868
|
+
// src/module/download/upload.ts
|
|
54869
|
+
var import_form_data2 = __toESM(require_form_data(), 1);
|
|
54870
|
+
var handleResponse = async (err, res) => {
|
|
54871
|
+
return new Promise((resolve2) => {
|
|
54872
|
+
if (err) {
|
|
54873
|
+
console.error("Upload failed:", err);
|
|
54874
|
+
resolve2({ code: 500, message: err });
|
|
54875
|
+
return;
|
|
54876
|
+
}
|
|
54877
|
+
let body = "";
|
|
54878
|
+
res.on("data", (chunk) => {
|
|
54879
|
+
body += chunk;
|
|
54880
|
+
});
|
|
54881
|
+
res.on("end", () => {
|
|
54882
|
+
try {
|
|
54883
|
+
const res2 = JSON.parse(body);
|
|
54884
|
+
resolve2(res2);
|
|
54885
|
+
} catch (e) {
|
|
54886
|
+
resolve2({ code: 500, message: body });
|
|
54887
|
+
}
|
|
54888
|
+
});
|
|
54889
|
+
});
|
|
54890
|
+
};
|
|
54891
|
+
var getFormParams = (opts, headers) => {
|
|
54892
|
+
const url = new URL(opts.url);
|
|
54893
|
+
if (opts.token) {}
|
|
54894
|
+
if (opts.meta) {
|
|
54895
|
+
url.searchParams.append("meta", encodeURIComponent(JSON.stringify(opts.meta)));
|
|
54896
|
+
}
|
|
54897
|
+
const value = {
|
|
54898
|
+
path: url.pathname + url.search,
|
|
54899
|
+
host: url.hostname,
|
|
54900
|
+
method: "POST",
|
|
54901
|
+
protocol: url.protocol === "https:" ? "https:" : "http:",
|
|
54902
|
+
port: url.port || (url.protocol === "https:" ? 443 : 80),
|
|
54903
|
+
headers: {
|
|
54904
|
+
Authorization: "Bearer " + opts.token,
|
|
54905
|
+
...headers
|
|
54906
|
+
}
|
|
54907
|
+
};
|
|
54908
|
+
logger.debug("getFormParams", value);
|
|
54909
|
+
return value;
|
|
54910
|
+
};
|
|
54911
|
+
var upload = (opts) => {
|
|
54912
|
+
const form = opts?.form || new import_form_data2.default;
|
|
54913
|
+
if (!opts.form) {
|
|
54914
|
+
let hash = "";
|
|
54915
|
+
let value;
|
|
54916
|
+
let type = "string";
|
|
54917
|
+
if (typeof opts.file === "string") {
|
|
54918
|
+
value = Buffer.from(opts.file);
|
|
54919
|
+
} else {
|
|
54920
|
+
type = "buffer";
|
|
54921
|
+
value = opts.file;
|
|
54922
|
+
}
|
|
54923
|
+
form.append("file", value);
|
|
54924
|
+
if (opts.needHash) {
|
|
54925
|
+
hash = opts?.hash || getBufferHash(value);
|
|
54926
|
+
opts.url = new URL(opts.url.toString());
|
|
54927
|
+
opts.url.searchParams.append("hash", hash);
|
|
54928
|
+
}
|
|
54929
|
+
}
|
|
54930
|
+
const headers = form.getHeaders();
|
|
54931
|
+
return new Promise((resolve2) => {
|
|
54932
|
+
form.submit(getFormParams(opts, headers), (err, res) => {
|
|
54933
|
+
handleResponse(err, res).then(resolve2);
|
|
54934
|
+
});
|
|
54935
|
+
});
|
|
54936
|
+
};
|
|
54937
|
+
|
|
54938
|
+
// src/command/sync/sync.ts
|
|
54822
54939
|
import path16 from "node:path";
|
|
54823
54940
|
var command8 = new Command("sync").option("-d --dir <dir>").description("同步项目").action(() => {
|
|
54824
54941
|
console.log("同步项目");
|