@kevisual/cli 0.0.55 → 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/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.2/node_modules/form-data/lib/populate.js
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.2/node_modules/form-data/lib/form_data.js
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 == "string") {
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 == "number") {
41298
- value = "" + 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 += +options.knownLength;
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 && Object.prototype.hasOwnProperty.call(value, "httpVersion")) && !(value instanceof Stream)) {
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 (Object.prototype.hasOwnProperty.call(value, "fd")) {
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 (Object.prototype.hasOwnProperty.call(value, "httpVersion")) {
41345
- callback(null, +value.headers["content-length"]);
41346
- } else if (Object.prototype.hasOwnProperty.call(value, "httpModule")) {
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, +response.headers["content-length"]);
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 == "string") {
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 == "object") {
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 (Object.prototype.hasOwnProperty.call(headers, prop)) {
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, contentDisposition;
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 && Object.prototype.hasOwnProperty.call(value, "httpVersion")) {
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
- contentDisposition = 'filename="' + filename + '"';
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 && Object.prototype.hasOwnProperty.call(value, "httpVersion")) {
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 == "object") {
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 (Object.prototype.hasOwnProperty.call(userHeaders, header)) {
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, options, defaults = { method: "post" };
41517
- if (typeof params == "string") {
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 == "https:" ? 443 : 80;
41531
+ options.port = options.protocol === "https:" ? 443 : 80;
41529
41532
  }
41530
41533
  }
41531
41534
  options.headers = this.getHeaders(params.headers);
41532
- if (options.protocol == "https:") {
41535
+ if (options.protocol === "https:") {
41533
41536
  request = https.request(options);
41534
41537
  } else {
41535
41538
  request = http.request(options);
@@ -41568,9 +41571,10 @@ 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
- // node_modules/.pnpm/ignore@7.0.4/node_modules/ignore/index.js
41577
+ // node_modules/.pnpm/ignore@7.0.5/node_modules/ignore/index.js
41574
41578
  var require_ignore = __commonJS((exports, module) => {
41575
41579
  function makeArray(subject) {
41576
41580
  return Array.isArray(subject) ? subject : [subject];
@@ -41882,15 +41886,19 @@ var require_ignore = __commonJS((exports, module) => {
41882
41886
  }
41883
41887
  var factory = (options) => new Ignore(options);
41884
41888
  var isPathValid = (path9) => checkPath(path9 && checkPath.convert(path9), path9, RETURN_FALSE);
41885
- if (typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) {
41889
+ var setupWindows = () => {
41886
41890
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
41887
41891
  checkPath.convert = makePosix;
41888
41892
  const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
41889
41893
  checkPath.isNotRelative = (path9) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path9) || isNotRelative(path9);
41894
+ };
41895
+ if (typeof process !== "undefined" && process.platform === "win32") {
41896
+ setupWindows();
41890
41897
  }
41891
41898
  module.exports = factory;
41892
41899
  factory.default = factory;
41893
41900
  module.exports.isPathValid = isPathValid;
41901
+ define2(module.exports, Symbol.for("setupWindows"), setupWindows);
41894
41902
  });
41895
41903
 
41896
41904
  // node_modules/.pnpm/commander@14.0.0/node_modules/commander/esm.mjs
@@ -41913,8 +41921,8 @@ var {
41913
41921
  import fs from "fs";
41914
41922
  var version = "0.0.1";
41915
41923
  try {
41916
- if ("0.0.55")
41917
- version = "0.0.55";
41924
+ if ("0.0.57")
41925
+ version = "0.0.57";
41918
41926
  } catch (e) {}
41919
41927
  program.name("app").description("A CLI tool with envison").version(version, "-V, --version");
41920
41928
  var ls = new Command("ls").description("List files in the current directory").action(() => {
@@ -41959,14 +41967,14 @@ var writeConfig = (config) => {
41959
41967
  return config;
41960
41968
  };
41961
41969
 
41962
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/key.js
41970
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/key.js
41963
41971
  var isUpKey = (key) => key.name === "up" || key.name === "k" || key.ctrl && key.name === "p";
41964
41972
  var isDownKey = (key) => key.name === "down" || key.name === "j" || key.ctrl && key.name === "n";
41965
41973
  var isSpaceKey = (key) => key.name === "space";
41966
41974
  var isBackspaceKey = (key) => key.name === "backspace";
41967
41975
  var isNumberKey = (key) => "1234567890".includes(key.name);
41968
41976
  var isEnterKey = (key) => key.name === "enter" || key.name === "return";
41969
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/errors.js
41977
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/errors.js
41970
41978
  class AbortPromptError extends Error {
41971
41979
  name = "AbortPromptError";
41972
41980
  message = "Prompt was aborted";
@@ -41992,10 +42000,10 @@ class HookError extends Error {
41992
42000
  class ValidationError extends Error {
41993
42001
  name = "ValidationError";
41994
42002
  }
41995
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
42003
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-state.js
41996
42004
  import { AsyncResource as AsyncResource2 } from "node:async_hooks";
41997
42005
 
41998
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
42006
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
41999
42007
  import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
42000
42008
  var hookStorage = new AsyncLocalStorage;
42001
42009
  function createStore(rl) {
@@ -42100,25 +42108,25 @@ var effectScheduler = {
42100
42108
  }
42101
42109
  };
42102
42110
 
42103
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/use-state.js
42111
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-state.js
42104
42112
  function useState(defaultValue) {
42105
42113
  return withPointer((pointer) => {
42106
- const setFn = (newValue) => {
42114
+ const setState = AsyncResource2.bind(function setState(newValue) {
42107
42115
  if (pointer.get() !== newValue) {
42108
42116
  pointer.set(newValue);
42109
42117
  handleChange();
42110
42118
  }
42111
- };
42119
+ });
42112
42120
  if (pointer.initialized) {
42113
- return [pointer.get(), setFn];
42121
+ return [pointer.get(), setState];
42114
42122
  }
42115
42123
  const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
42116
42124
  pointer.set(value);
42117
- return [value, setFn];
42125
+ return [value, setState];
42118
42126
  });
42119
42127
  }
42120
42128
 
42121
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
42129
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
42122
42130
  function useEffect(cb, depArray) {
42123
42131
  withPointer((pointer) => {
42124
42132
  const oldDeps = pointer.get();
@@ -42130,10 +42138,10 @@ function useEffect(cb, depArray) {
42130
42138
  });
42131
42139
  }
42132
42140
 
42133
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/theme.js
42141
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/theme.js
42134
42142
  var import_yoctocolors_cjs = __toESM(require_yoctocolors_cjs(), 1);
42135
42143
 
42136
- // node_modules/.pnpm/@inquirer+figures@1.0.11/node_modules/@inquirer/figures/dist/esm/index.js
42144
+ // node_modules/.pnpm/@inquirer+figures@1.0.12/node_modules/@inquirer/figures/dist/esm/index.js
42137
42145
  import process2 from "node:process";
42138
42146
  function isUnicodeSupported() {
42139
42147
  if (process2.platform !== "win32") {
@@ -42419,7 +42427,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
42419
42427
  var esm_default = figures;
42420
42428
  var replacements = Object.entries(specialMainSymbols);
42421
42429
 
42422
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/theme.js
42430
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/theme.js
42423
42431
  var defaultTheme = {
42424
42432
  prefix: {
42425
42433
  idle: import_yoctocolors_cjs.default.blue("?"),
@@ -42440,7 +42448,7 @@ var defaultTheme = {
42440
42448
  }
42441
42449
  };
42442
42450
 
42443
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
42451
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
42444
42452
  function isPlainObject(value) {
42445
42453
  if (typeof value !== "object" || value === null)
42446
42454
  return false;
@@ -42468,7 +42476,7 @@ function makeTheme(...themes) {
42468
42476
  return deepMerge(...themesToMerge);
42469
42477
  }
42470
42478
 
42471
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
42479
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
42472
42480
  function usePrefix({ status = "idle", theme }) {
42473
42481
  const [showLoader, setShowLoader] = useState(false);
42474
42482
  const [tick, setTick] = useState(0);
@@ -42477,13 +42485,13 @@ function usePrefix({ status = "idle", theme }) {
42477
42485
  if (status === "loading") {
42478
42486
  let tickInterval;
42479
42487
  let inc = -1;
42480
- const delayTimeout = setTimeout(AsyncResource2.bind(() => {
42488
+ const delayTimeout = setTimeout(() => {
42481
42489
  setShowLoader(true);
42482
- tickInterval = setInterval(AsyncResource2.bind(() => {
42490
+ tickInterval = setInterval(() => {
42483
42491
  inc = inc + 1;
42484
42492
  setTick(inc % spinner.frames.length);
42485
- }), spinner.interval);
42486
- }), 300);
42493
+ }, spinner.interval);
42494
+ }, 300);
42487
42495
  return () => {
42488
42496
  clearTimeout(delayTimeout);
42489
42497
  clearInterval(tickInterval);
@@ -42498,7 +42506,7 @@ function usePrefix({ status = "idle", theme }) {
42498
42506
  const iconName = status === "loading" ? "idle" : status;
42499
42507
  return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
42500
42508
  }
42501
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
42509
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
42502
42510
  function useMemo(fn, dependencies) {
42503
42511
  return withPointer((pointer) => {
42504
42512
  const prev = pointer.get();
@@ -42510,11 +42518,11 @@ function useMemo(fn, dependencies) {
42510
42518
  return prev.value;
42511
42519
  });
42512
42520
  }
42513
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
42521
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
42514
42522
  function useRef(val) {
42515
42523
  return useState({ current: val })[0];
42516
42524
  }
42517
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
42525
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
42518
42526
  function useKeypress(userHandler) {
42519
42527
  const signal = useRef(userHandler);
42520
42528
  signal.current = userHandler;
@@ -42532,7 +42540,7 @@ function useKeypress(userHandler) {
42532
42540
  };
42533
42541
  }, []);
42534
42542
  }
42535
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/utils.js
42543
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/utils.js
42536
42544
  var import_cli_width = __toESM(require_cli_width(), 1);
42537
42545
  var import_wrap_ansi = __toESM(require_wrap_ansi(), 1);
42538
42546
  function breakLines(content, width) {
@@ -42545,96 +42553,73 @@ function readlineWidth() {
42545
42553
  return import_cli_width.default({ defaultWidth: 80, output: readline().output });
42546
42554
  }
42547
42555
 
42548
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.js
42549
- function split(content, width) {
42550
- return breakLines(content, width).split(`
42551
- `);
42552
- }
42553
- function rotate(count, items) {
42554
- const max = items.length;
42555
- const offset = (count % max + max) % max;
42556
- return [...items.slice(offset), ...items.slice(0, offset)];
42557
- }
42558
- function lines({ items, width, renderItem, active, position: requested, pageSize }) {
42559
- const layouts = items.map((item, index) => ({
42560
- item,
42561
- index,
42562
- isActive: index === active
42563
- }));
42564
- const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
42565
- const renderItemAt = (index) => layoutsInPage[index] == null ? [] : split(renderItem(layoutsInPage[index]), width);
42566
- const pageBuffer = Array.from({ length: pageSize });
42567
- const activeItem = renderItemAt(requested).slice(0, pageSize);
42568
- const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
42569
- pageBuffer.splice(position, activeItem.length, ...activeItem);
42570
- let bufferPointer = position + activeItem.length;
42571
- let layoutPointer = requested + 1;
42572
- while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
42573
- for (const line of renderItemAt(layoutPointer)) {
42574
- pageBuffer[bufferPointer++] = line;
42575
- if (bufferPointer >= pageSize)
42576
- break;
42577
- }
42578
- layoutPointer++;
42579
- }
42580
- bufferPointer = position - 1;
42581
- layoutPointer = requested - 1;
42582
- while (bufferPointer >= 0 && layoutPointer >= 0) {
42583
- for (const line of renderItemAt(layoutPointer).reverse()) {
42584
- pageBuffer[bufferPointer--] = line;
42585
- if (bufferPointer < 0)
42586
- break;
42587
- }
42588
- layoutPointer--;
42589
- }
42590
- return pageBuffer.filter((line) => typeof line === "string");
42591
- }
42592
-
42593
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/pagination/position.js
42594
- function finite({ active, pageSize, total }) {
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
42557
+ function usePointerPosition({ active, renderedItems, pageSize, loop }) {
42558
+ const state = useRef({
42559
+ lastPointer: active,
42560
+ lastActive: undefined
42561
+ });
42562
+ const { lastPointer, lastActive } = state.current;
42595
42563
  const middle = Math.floor(pageSize / 2);
42596
- if (total <= pageSize || active < middle)
42597
- return active;
42598
- if (active >= total - middle)
42599
- return active + pageSize - total;
42600
- return middle;
42601
- }
42602
- function infinite({ active, lastActive, total, pageSize, pointer }) {
42603
- if (total <= pageSize)
42604
- return active;
42605
- if (lastActive < active && active - lastActive < pageSize) {
42606
- return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
42564
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
42565
+ const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
42566
+ let pointer = defaultPointerPosition;
42567
+ if (renderedLength > pageSize) {
42568
+ if (loop) {
42569
+ pointer = lastPointer;
42570
+ if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
42571
+ pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
42572
+ }
42573
+ } else {
42574
+ const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
42575
+ pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
42576
+ }
42607
42577
  }
42578
+ state.current.lastPointer = pointer;
42579
+ state.current.lastActive = active;
42608
42580
  return pointer;
42609
42581
  }
42610
-
42611
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
42612
42582
  function usePagination({ items, active, renderItem, pageSize, loop = true }) {
42613
- const state = useRef({ position: 0, lastActive: 0 });
42614
- const position = loop ? infinite({
42615
- active,
42616
- lastActive: state.current.lastActive,
42617
- total: items.length,
42618
- pageSize,
42619
- pointer: state.current.position
42620
- }) : finite({
42621
- active,
42622
- total: items.length,
42623
- pageSize
42583
+ const width = readlineWidth();
42584
+ const bound = (num) => (num % items.length + items.length) % items.length;
42585
+ const renderedItems = items.map((item, index) => {
42586
+ if (item == null)
42587
+ return [];
42588
+ return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
42589
+ `);
42624
42590
  });
42625
- state.current.position = position;
42626
- state.current.lastActive = active;
42627
- return lines({
42628
- items,
42629
- width: readlineWidth(),
42630
- renderItem,
42631
- active,
42632
- position,
42633
- pageSize
42634
- }).join(`
42591
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
42592
+ const renderItemAtIndex = (index) => renderedItems[index] ?? [];
42593
+ const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
42594
+ const activeItem = renderItemAtIndex(active).slice(0, pageSize);
42595
+ const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
42596
+ const pageBuffer = Array.from({ length: pageSize });
42597
+ pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
42598
+ const itemVisited = new Set([active]);
42599
+ let bufferPointer = activeItemPosition + activeItem.length;
42600
+ let itemPointer = bound(active + 1);
42601
+ while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
42602
+ const lines = renderItemAtIndex(itemPointer);
42603
+ const linesToAdd = lines.slice(0, pageSize - bufferPointer);
42604
+ pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
42605
+ itemVisited.add(itemPointer);
42606
+ bufferPointer += linesToAdd.length;
42607
+ itemPointer = bound(itemPointer + 1);
42608
+ }
42609
+ bufferPointer = activeItemPosition - 1;
42610
+ itemPointer = bound(active - 1);
42611
+ while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
42612
+ const lines = renderItemAtIndex(itemPointer);
42613
+ const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
42614
+ pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
42615
+ itemVisited.add(itemPointer);
42616
+ bufferPointer -= linesToAdd.length;
42617
+ itemPointer = bound(itemPointer - 1);
42618
+ }
42619
+ return pageBuffer.filter((line) => typeof line === "string").join(`
42635
42620
  `);
42636
42621
  }
42637
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
42622
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
42638
42623
  var import_mute_stream = __toESM(require_lib(), 1);
42639
42624
  import * as readline2 from "node:readline";
42640
42625
  import { AsyncResource as AsyncResource3 } from "node:async_hooks";
@@ -42847,7 +42832,7 @@ var {
42847
42832
  unload
42848
42833
  } = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
42849
42834
 
42850
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
42835
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
42851
42836
  var import_ansi_escapes = __toESM(require_ansi_escapes(), 1);
42852
42837
  import { stripVTControlCharacters } from "node:util";
42853
42838
  var height = (content) => content.split(`
@@ -42917,7 +42902,7 @@ class ScreenManager {
42917
42902
  }
42918
42903
  }
42919
42904
 
42920
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
42905
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
42921
42906
  class PromisePolyfill extends Promise {
42922
42907
  static withResolver() {
42923
42908
  let resolve;
@@ -42930,7 +42915,7 @@ class PromisePolyfill extends Promise {
42930
42915
  }
42931
42916
  }
42932
42917
 
42933
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
42918
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
42934
42919
  function getCallSites() {
42935
42920
  const _prepareStackTrace = Error.prepareStackTrace;
42936
42921
  let result = [];
@@ -43016,7 +43001,7 @@ function createPrompt(view) {
43016
43001
  };
43017
43002
  return prompt;
43018
43003
  }
43019
- // node_modules/.pnpm/@inquirer+core@10.1.11_@types+node@22.15.21/node_modules/@inquirer/core/dist/esm/lib/Separator.js
43004
+ // node_modules/.pnpm/@inquirer+core@10.1.13_@types+node@24.0.3/node_modules/@inquirer/core/dist/esm/lib/Separator.js
43020
43005
  var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
43021
43006
  class Separator {
43022
43007
  separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
@@ -43030,7 +43015,7 @@ class Separator {
43030
43015
  return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
43031
43016
  }
43032
43017
  }
43033
- // node_modules/.pnpm/@inquirer+checkbox@4.1.6_@types+node@22.15.21/node_modules/@inquirer/checkbox/dist/esm/index.js
43018
+ // node_modules/.pnpm/@inquirer+checkbox@4.1.8_@types+node@24.0.3/node_modules/@inquirer/checkbox/dist/esm/index.js
43034
43019
  var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
43035
43020
  var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
43036
43021
  var checkboxTheme = {
@@ -43204,9 +43189,8 @@ ${theme.style.error(errorMsg)}`;
43204
43189
  return `${prefix} ${message}${helpTipTop}
43205
43190
  ${page}${helpTipBottom}${choiceDescription}${error}${import_ansi_escapes2.default.cursorHide}`;
43206
43191
  });
43207
- // node_modules/.pnpm/@inquirer+editor@4.2.11_@types+node@22.15.21/node_modules/@inquirer/editor/dist/esm/index.js
43192
+ // node_modules/.pnpm/@inquirer+editor@4.2.13_@types+node@24.0.3/node_modules/@inquirer/editor/dist/esm/index.js
43208
43193
  var import_external_editor = __toESM(require_main(), 1);
43209
- import { AsyncResource as AsyncResource4 } from "node:async_hooks";
43210
43194
  var editorTheme = {
43211
43195
  validationFailureMode: "keep"
43212
43196
  };
@@ -43219,7 +43203,7 @@ var esm_default3 = createPrompt((config, done) => {
43219
43203
  const prefix = usePrefix({ status, theme });
43220
43204
  function startEditor(rl) {
43221
43205
  rl.pause();
43222
- const editCallback = AsyncResource4.bind(async (error2, answer) => {
43206
+ const editCallback = async (error2, answer) => {
43223
43207
  rl.resume();
43224
43208
  if (error2) {
43225
43209
  setError(error2.toString());
@@ -43240,7 +43224,7 @@ var esm_default3 = createPrompt((config, done) => {
43240
43224
  setStatus("idle");
43241
43225
  }
43242
43226
  }
43243
- });
43227
+ };
43244
43228
  import_external_editor.editAsync(value, (error2, answer) => void editCallback(error2, answer), {
43245
43229
  postfix,
43246
43230
  ...fileProps
@@ -43273,7 +43257,7 @@ var esm_default3 = createPrompt((config, done) => {
43273
43257
  }
43274
43258
  return [[prefix, message, helpTip].filter(Boolean).join(" "), error];
43275
43259
  });
43276
- // node_modules/.pnpm/@inquirer+confirm@5.1.10_@types+node@22.15.21/node_modules/@inquirer/confirm/dist/esm/index.js
43260
+ // node_modules/.pnpm/@inquirer+confirm@5.1.12_@types+node@24.0.3/node_modules/@inquirer/confirm/dist/esm/index.js
43277
43261
  function getBooleanValue(value, defaultValue) {
43278
43262
  let answer = defaultValue !== false;
43279
43263
  if (/^(y|yes)/i.test(value))
@@ -43316,7 +43300,7 @@ var esm_default4 = createPrompt((config, done) => {
43316
43300
  const message = theme.style.message(config.message, status);
43317
43301
  return `${prefix} ${message}${defaultValue} ${formattedValue}`;
43318
43302
  });
43319
- // node_modules/.pnpm/@inquirer+input@4.1.10_@types+node@22.15.21/node_modules/@inquirer/input/dist/esm/index.js
43303
+ // node_modules/.pnpm/@inquirer+input@4.1.12_@types+node@24.0.3/node_modules/@inquirer/input/dist/esm/index.js
43320
43304
  var inputTheme = {
43321
43305
  validationFailureMode: "keep"
43322
43306
  };
@@ -43381,7 +43365,7 @@ var esm_default5 = createPrompt((config, done) => {
43381
43365
  error
43382
43366
  ];
43383
43367
  });
43384
- // node_modules/.pnpm/@inquirer+number@3.0.13_@types+node@22.15.21/node_modules/@inquirer/number/dist/esm/index.js
43368
+ // node_modules/.pnpm/@inquirer+number@3.0.15_@types+node@24.0.3/node_modules/@inquirer/number/dist/esm/index.js
43385
43369
  function isStepOf(value, step, min) {
43386
43370
  const valuePow = value * Math.pow(10, 6);
43387
43371
  const stepPow = step * Math.pow(10, 6);
@@ -43461,7 +43445,7 @@ var esm_default6 = createPrompt((config, done) => {
43461
43445
  error
43462
43446
  ];
43463
43447
  });
43464
- // node_modules/.pnpm/@inquirer+expand@4.0.13_@types+node@22.15.21/node_modules/@inquirer/expand/dist/esm/index.js
43448
+ // node_modules/.pnpm/@inquirer+expand@4.0.15_@types+node@24.0.3/node_modules/@inquirer/expand/dist/esm/index.js
43465
43449
  var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
43466
43450
  function normalizeChoices2(choices) {
43467
43451
  return choices.map((choice) => {
@@ -43558,7 +43542,7 @@ var esm_default7 = createPrompt((config, done) => {
43558
43542
  `)
43559
43543
  ];
43560
43544
  });
43561
- // node_modules/.pnpm/@inquirer+rawlist@4.1.1_@types+node@22.15.21/node_modules/@inquirer/rawlist/dist/esm/index.js
43545
+ // node_modules/.pnpm/@inquirer+rawlist@4.1.3_@types+node@24.0.3/node_modules/@inquirer/rawlist/dist/esm/index.js
43562
43546
  var import_yoctocolors_cjs5 = __toESM(require_yoctocolors_cjs(), 1);
43563
43547
  var numberRegex = /\d+/;
43564
43548
  function isSelectableChoice(choice) {
@@ -43670,7 +43654,7 @@ var esm_default8 = createPrompt((config, done) => {
43670
43654
  `)
43671
43655
  ];
43672
43656
  });
43673
- // node_modules/.pnpm/@inquirer+password@4.0.13_@types+node@22.15.21/node_modules/@inquirer/password/dist/esm/index.js
43657
+ // node_modules/.pnpm/@inquirer+password@4.0.15_@types+node@24.0.3/node_modules/@inquirer/password/dist/esm/index.js
43674
43658
  var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
43675
43659
  var esm_default9 = createPrompt((config, done) => {
43676
43660
  const { validate = () => true } = config;
@@ -43719,7 +43703,7 @@ var esm_default9 = createPrompt((config, done) => {
43719
43703
  }
43720
43704
  return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error];
43721
43705
  });
43722
- // node_modules/.pnpm/@inquirer+search@3.0.13_@types+node@22.15.21/node_modules/@inquirer/search/dist/esm/index.js
43706
+ // node_modules/.pnpm/@inquirer+search@3.0.15_@types+node@24.0.3/node_modules/@inquirer/search/dist/esm/index.js
43723
43707
  var import_yoctocolors_cjs6 = __toESM(require_yoctocolors_cjs(), 1);
43724
43708
  var searchTheme = {
43725
43709
  icon: { cursor: esm_default.pointer },
@@ -43884,7 +43868,7 @@ ${theme.style.description(selectedChoice.description)}` : ``;
43884
43868
  `${error ?? page}${helpTip}${choiceDescription}`
43885
43869
  ];
43886
43870
  });
43887
- // node_modules/.pnpm/@inquirer+select@4.2.1_@types+node@22.15.21/node_modules/@inquirer/select/dist/esm/index.js
43871
+ // node_modules/.pnpm/@inquirer+select@4.2.3_@types+node@24.0.3/node_modules/@inquirer/select/dist/esm/index.js
43888
43872
  var import_yoctocolors_cjs7 = __toESM(require_yoctocolors_cjs(), 1);
43889
43873
  var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
43890
43874
  var selectTheme = {
@@ -44030,7 +44014,7 @@ ${theme.style.description(selectedChoice.description)}` : ``;
44030
44014
  return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
44031
44015
  ${page}${helpTipBottom}${choiceDescription}${import_ansi_escapes4.default.cursorHide}`;
44032
44016
  });
44033
- // node_modules/.pnpm/inquirer@12.6.1_@types+node@22.15.21/node_modules/inquirer/dist/esm/ui/prompt.js
44017
+ // node_modules/.pnpm/inquirer@12.6.3_@types+node@24.0.3/node_modules/inquirer/dist/esm/ui/prompt.js
44034
44018
  var import_rxjs = __toESM(require_cjs(), 1);
44035
44019
  var import_run_async = __toESM(require_run_async(), 1);
44036
44020
  var import_mute_stream2 = __toESM(require_lib(), 1);
@@ -44242,7 +44226,7 @@ class PromptsRunner {
44242
44226
  };
44243
44227
  }
44244
44228
 
44245
- // node_modules/.pnpm/inquirer@12.6.1_@types+node@22.15.21/node_modules/inquirer/dist/esm/index.js
44229
+ // node_modules/.pnpm/inquirer@12.6.3_@types+node@24.0.3/node_modules/inquirer/dist/esm/index.js
44246
44230
  var builtInPrompts = {
44247
44231
  input: esm_default5,
44248
44232
  select: esm_default11,
@@ -44294,15 +44278,25 @@ var esm_default12 = inquirer;
44294
44278
  // src/module/login/login-by-web.ts
44295
44279
  var import_md5 = __toESM(require_md5(), 1);
44296
44280
 
44297
- // node_modules/.pnpm/@kevisual+query@0.0.18_encoding@0.1.13_ws@8.18.0/node_modules/@kevisual/query/dist/query.js
44298
- var adapter = async (opts, overloadOpts) => {
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) => {
44299
44289
  const controller = new AbortController;
44300
44290
  const signal = controller.signal;
44291
+ const isBlob = opts.isBlob || false;
44292
+ const isText = opts.isText || false;
44293
+ const isPostFile = opts.isPostFile || false;
44301
44294
  const timeout = opts.timeout || 60000 * 3;
44302
44295
  const timer = setTimeout(() => {
44303
44296
  controller.abort();
44304
44297
  }, timeout);
44305
- let method = overloadOpts?.method || opts.method || "POST";
44298
+ let method = overloadOpts?.method || opts?.method || "POST";
44299
+ let headers = { ...opts?.headers, ...overloadOpts?.headers };
44306
44300
  let origin = "";
44307
44301
  let url;
44308
44302
  if (opts?.url?.startsWith("http")) {
@@ -44315,21 +44309,40 @@ var adapter = async (opts, overloadOpts) => {
44315
44309
  if (isGet) {
44316
44310
  url.search = new URLSearchParams(opts.body).toString();
44317
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
+ }
44318
44324
  return fetch(url, {
44319
44325
  method: method.toUpperCase(),
44320
- headers: {
44321
- "Content-Type": "application/json",
44322
- ...opts.headers
44323
- },
44324
44326
  signal,
44327
+ body,
44325
44328
  ...overloadOpts,
44326
- body: isGet ? undefined : JSON.stringify(opts.body)
44327
- }).then((response) => {
44329
+ headers
44330
+ }).then(async (response) => {
44328
44331
  const contentType = response.headers.get("Content-Type");
44329
- if (contentType && contentType.includes("application/json")) {
44330
- return response.json();
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
+ };
44331
44344
  } else {
44332
- return response.text();
44345
+ return response;
44333
44346
  }
44334
44347
  }).catch((err) => {
44335
44348
  if (err.name === "AbortError") {
@@ -44350,6 +44363,7 @@ var setBaseResponse = (res) => {
44350
44363
  fn?.();
44351
44364
  }
44352
44365
  };
44366
+ return res;
44353
44367
  };
44354
44368
  var wrapperError = ({ code, message }) => {
44355
44369
  const result = {
@@ -44370,6 +44384,7 @@ class Query {
44370
44384
  headers;
44371
44385
  timeout;
44372
44386
  stop;
44387
+ qws;
44373
44388
  constructor(opts) {
44374
44389
  this.adapter = opts?.adapter || adapter;
44375
44390
  this.url = opts?.url || "/api/router";
@@ -44378,6 +44393,9 @@ class Query {
44378
44393
  };
44379
44394
  this.timeout = opts?.timeout || 60000 * 3;
44380
44395
  }
44396
+ setQueryWs(qws) {
44397
+ this.qws = qws;
44398
+ }
44381
44399
  setStop(stop) {
44382
44400
  this.stop = stop;
44383
44401
  }
@@ -44417,7 +44435,7 @@ class Query {
44417
44435
  message: "api request beforeFn error"
44418
44436
  });
44419
44437
  }
44420
- if (this.stop) {
44438
+ if (this.stop && !options?.noStop) {
44421
44439
  const that = this;
44422
44440
  await new Promise((resolve) => {
44423
44441
  let timer = 0;
@@ -44459,17 +44477,45 @@ class Query {
44459
44477
  after(fn) {
44460
44478
  this.afterResponse = fn;
44461
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
+ }
44462
44498
  }
44463
44499
 
44464
- // node_modules/.pnpm/@kevisual+query@0.0.18_encoding@0.1.13_ws@8.18.0/node_modules/@kevisual/query/dist/query-browser.js
44465
- var adapter2 = async (opts, overloadOpts) => {
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) => {
44466
44508
  const controller = new AbortController;
44467
44509
  const signal = controller.signal;
44510
+ const isBlob = opts.isBlob || false;
44511
+ const isText = opts.isText || false;
44512
+ const isPostFile = opts.isPostFile || false;
44468
44513
  const timeout = opts.timeout || 60000 * 3;
44469
44514
  const timer = setTimeout(() => {
44470
44515
  controller.abort();
44471
44516
  }, timeout);
44472
- let method = overloadOpts?.method || opts.method || "POST";
44517
+ let method = overloadOpts?.method || opts?.method || "POST";
44518
+ let headers = { ...opts?.headers, ...overloadOpts?.headers };
44473
44519
  let origin = "";
44474
44520
  let url;
44475
44521
  if (opts?.url?.startsWith("http")) {
@@ -44482,21 +44528,40 @@ var adapter2 = async (opts, overloadOpts) => {
44482
44528
  if (isGet) {
44483
44529
  url.search = new URLSearchParams(opts.body).toString();
44484
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
+ }
44485
44543
  return fetch(url, {
44486
44544
  method: method.toUpperCase(),
44487
- headers: {
44488
- "Content-Type": "application/json",
44489
- ...opts.headers
44490
- },
44491
44545
  signal,
44546
+ body,
44492
44547
  ...overloadOpts,
44493
- body: isGet ? undefined : JSON.stringify(opts.body)
44494
- }).then((response) => {
44548
+ headers
44549
+ }).then(async (response) => {
44495
44550
  const contentType = response.headers.get("Content-Type");
44496
- if (contentType && contentType.includes("application/json")) {
44497
- return response.json();
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
+ };
44498
44563
  } else {
44499
- return response.text();
44564
+ return response;
44500
44565
  }
44501
44566
  }).catch((err) => {
44502
44567
  if (err.name === "AbortError") {
@@ -44517,6 +44582,7 @@ var setBaseResponse2 = (res) => {
44517
44582
  fn?.();
44518
44583
  }
44519
44584
  };
44585
+ return res;
44520
44586
  };
44521
44587
  var wrapperError2 = ({ code, message }) => {
44522
44588
  const result = {
@@ -44537,6 +44603,7 @@ class Query2 {
44537
44603
  headers;
44538
44604
  timeout;
44539
44605
  stop;
44606
+ qws;
44540
44607
  constructor(opts) {
44541
44608
  this.adapter = opts?.adapter || adapter2;
44542
44609
  this.url = opts?.url || "/api/router";
@@ -44545,6 +44612,9 @@ class Query2 {
44545
44612
  };
44546
44613
  this.timeout = opts?.timeout || 60000 * 3;
44547
44614
  }
44615
+ setQueryWs(qws) {
44616
+ this.qws = qws;
44617
+ }
44548
44618
  setStop(stop) {
44549
44619
  this.stop = stop;
44550
44620
  }
@@ -44584,7 +44654,7 @@ class Query2 {
44584
44654
  message: "api request beforeFn error"
44585
44655
  });
44586
44656
  }
44587
- if (this.stop) {
44657
+ if (this.stop && !options?.noStop) {
44588
44658
  const that = this;
44589
44659
  await new Promise((resolve) => {
44590
44660
  let timer = 0;
@@ -44626,12 +44696,42 @@ class Query2 {
44626
44696
  after(fn) {
44627
44697
  this.afterResponse = fn;
44628
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
+ }
44629
44717
  }
44630
44718
 
44631
44719
  class BaseQuery {
44632
44720
  query;
44633
- constructor({ query }) {
44634
- this.query = query;
44721
+ queryDefine;
44722
+ constructor(opts) {
44723
+ if (opts?.clientQuery) {
44724
+ this.query = opts.clientQuery;
44725
+ } else {
44726
+ this.query = opts?.query;
44727
+ }
44728
+ if (opts.queryDefine) {
44729
+ this.queryDefine = opts.queryDefine;
44730
+ this.queryDefine.query = this.query;
44731
+ }
44732
+ }
44733
+ get chain() {
44734
+ return this.queryDefine.queryChain;
44635
44735
  }
44636
44736
  post(data, options) {
44637
44737
  return this.query.post(data, options);
@@ -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.18_encoding@0.1.13_ws@8.18.0__rollup@4.41.0_tslib@2.8.1_typescript@5.8.2/node_modules/@kevisual/query-login/dist/query-login-node.js
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 import_form_data2 = __toESM(require_form_data(), 1);
46591
+ var import_form_data = __toESM(require_form_data(), 1);
46492
46592
  import path10 from "path";
46493
46593
  import fs17 from "fs";
46494
46594
 
@@ -48594,10 +48694,10 @@ class Header {
48594
48694
  throw new Error("need 512 bytes for header");
48595
48695
  }
48596
48696
  const prefixSize = this.ctime || this.atime ? 130 : 155;
48597
- const split2 = splitPrefix(this.path || "", prefixSize);
48598
- const path2 = split2[0];
48599
- const prefix = split2[1];
48600
- this.needPax = !!split2[2];
48697
+ const split = splitPrefix(this.path || "", prefixSize);
48698
+ const path2 = split[0];
48699
+ const prefix = split[1];
48700
+ this.needPax = !!split[2];
48601
48701
  this.needPax = encString(buf, off, 100, path2) || this.needPax;
48602
48702
  this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax;
48603
48703
  this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax;
@@ -52479,11 +52579,26 @@ var deployLoadFn = async (id, fileKey, force = false, install = false) => {
52479
52579
  console.error(chalk2.red("id is required"));
52480
52580
  return;
52481
52581
  }
52582
+ let appKey = "";
52583
+ let version3 = "";
52584
+ if (id && id.includes("/")) {
52585
+ const [a, b] = id.split("/");
52586
+ if (a) {
52587
+ appKey = b || "1.0.0";
52588
+ version3 = a;
52589
+ id = "";
52590
+ } else {
52591
+ console.error(chalk2.red('id format error, please use "version/appKey" format'));
52592
+ return;
52593
+ }
52594
+ }
52482
52595
  const res = await query.post({
52483
52596
  path: "micro-app",
52484
52597
  key: "deploy",
52485
52598
  data: {
52486
52599
  id,
52600
+ version: version3,
52601
+ appKey,
52487
52602
  key: fileKey,
52488
52603
  force,
52489
52604
  install: !!install
@@ -52735,8 +52850,25 @@ var getBufferHash = (buffer) => {
52735
52850
  return import_md52.default(buffer.toString()).toString();
52736
52851
  };
52737
52852
 
52738
- // src/module/download/upload.ts
52739
- var import_form_data = __toESM(require_form_data(), 1);
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
+ };
52740
52872
 
52741
52873
  // node_modules/.pnpm/@kevisual+logger@0.0.4/node_modules/@kevisual/logger/dist/logger-node.mjs
52742
52874
  import process5 from "node:process";
@@ -53352,97 +53484,8 @@ var logger = new Logger2({
53352
53484
  level
53353
53485
  });
53354
53486
 
53355
- // src/module/download/upload.ts
53356
- var handleResponse = async (err, res) => {
53357
- return new Promise((resolve2) => {
53358
- if (err) {
53359
- console.error("Upload failed:", err);
53360
- resolve2({ code: 500, message: err });
53361
- return;
53362
- }
53363
- let body = "";
53364
- res.on("data", (chunk) => {
53365
- body += chunk;
53366
- });
53367
- res.on("end", () => {
53368
- try {
53369
- const res2 = JSON.parse(body);
53370
- resolve2(res2);
53371
- } catch (e) {
53372
- resolve2({ code: 500, message: body });
53373
- }
53374
- });
53375
- });
53376
- };
53377
- var getFormParams = (opts, headers) => {
53378
- const url = new URL(opts.url);
53379
- if (opts.token) {}
53380
- if (opts.meta) {
53381
- url.searchParams.append("meta", encodeURIComponent(JSON.stringify(opts.meta)));
53382
- }
53383
- const value = {
53384
- path: url.pathname + url.search,
53385
- host: url.hostname,
53386
- method: "POST",
53387
- protocol: url.protocol === "https:" ? "https:" : "http:",
53388
- port: url.port || (url.protocol === "https:" ? 443 : 80),
53389
- headers: {
53390
- Authorization: "Bearer " + opts.token,
53391
- ...headers
53392
- }
53393
- };
53394
- logger.debug("getFormParams", value);
53395
- return value;
53396
- };
53397
- var upload = (opts) => {
53398
- const form = opts?.form || new import_form_data.default;
53399
- if (!opts.form) {
53400
- let hash = "";
53401
- let value;
53402
- let type = "string";
53403
- if (typeof opts.file === "string") {
53404
- value = Buffer.from(opts.file);
53405
- } else {
53406
- type = "buffer";
53407
- value = opts.file;
53408
- }
53409
- form.append("file", value);
53410
- if (opts.needHash) {
53411
- hash = opts?.hash || getBufferHash(value);
53412
- opts.url = new URL(opts.url.toString());
53413
- opts.url.searchParams.append("hash", hash);
53414
- }
53415
- }
53416
- const headers = form.getHeaders();
53417
- return new Promise((resolve2) => {
53418
- form.submit(getFormParams(opts, headers), (err, res) => {
53419
- handleResponse(err, res).then(resolve2);
53420
- });
53421
- });
53422
- };
53423
-
53424
- // src/query/app-manager/query-app.ts
53425
- var queryApp = async (params, opts) => {
53426
- return await query.post({
53427
- path: "app",
53428
- key: "getApp",
53429
- data: {
53430
- ...params
53431
- }
53432
- }, opts);
53433
- };
53434
- var queryAppVersion = async (params, opts) => {
53435
- return await query.post({
53436
- path: "app",
53437
- key: "get",
53438
- data: {
53439
- ...params
53440
- }
53441
- }, opts);
53442
- };
53443
-
53444
53487
  // src/command/deploy.ts
53445
- var getPackageJson = () => {
53488
+ var getPackageJson = (opts) => {
53446
53489
  const filePath = path10.join(process.cwd(), "package.json");
53447
53490
  if (!fs17.existsSync(filePath)) {
53448
53491
  return null;
@@ -53453,12 +53496,12 @@ var getPackageJson = () => {
53453
53496
  const version3 = packageJson.version || "";
53454
53497
  const app = packageJson.app;
53455
53498
  const userAppArry = basename2.split("/");
53456
- if (userAppArry.length <= 2) {
53499
+ if (userAppArry.length <= 2 && !opts?.appKey) {
53457
53500
  console.error(source_default.red("basename is error, 请输入正确的路径, packages.json中basename例如 /root/appKey"));
53458
53501
  return null;
53459
53502
  }
53460
53503
  const [user, appKey] = userAppArry;
53461
- return { basename: basename2, version: version3, pkg: packageJson, user, appKey, app };
53504
+ return { basename: basename2, version: version3, pkg: packageJson, user, appKey: appKey || opts?.appKey, app };
53462
53505
  } catch (error) {
53463
53506
  return null;
53464
53507
  }
@@ -53468,7 +53511,7 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
53468
53511
  let { version: version3, key: key2, yes, update: update3, org, showBackend } = options;
53469
53512
  const noCheck = !options.noCheck;
53470
53513
  const dot = !!options.dot;
53471
- const pkgInfo = getPackageJson();
53514
+ const pkgInfo = getPackageJson({ version: version3, appKey: key2 });
53472
53515
  if (!version3 && pkgInfo?.version) {
53473
53516
  version3 = pkgInfo?.version || "";
53474
53517
  }
@@ -53501,9 +53544,21 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
53501
53544
  let isDirectory = false;
53502
53545
  if (stat2.isDirectory()) {
53503
53546
  isDirectory = true;
53504
- const gPath = path10.join(directory, "**/*");
53505
- const files = await import_fast_glob2.default(gPath, { cwd: pwd, ignore: ["node_modules/**/*"], onlyFiles: true, dot });
53506
- _relativeFiles = files.map((file) => path10.relative(directory, file));
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
+ });
53507
53562
  } else if (stat2.isFile()) {
53508
53563
  const filename = path10.basename(directory);
53509
53564
  _relativeFiles = [filename];
@@ -53572,11 +53627,15 @@ var command2 = new Command("deploy").description("把前端文件传到服务器
53572
53627
  });
53573
53628
  var uploadFiles = async (files, directory, opts) => {
53574
53629
  const { key: key2, version: version3, username } = opts || {};
53575
- const form = new import_form_data2.default;
53630
+ const form = new import_form_data.default;
53576
53631
  const data = { files: [] };
53577
53632
  for (const file of files) {
53578
53633
  const filePath = path10.join(directory, file);
53579
53634
  const hash = getHash(filePath);
53635
+ if (!hash) {
53636
+ console.error("文件", filePath, "不存在");
53637
+ console.error("请检查文件是否存在");
53638
+ }
53580
53639
  data.files.push({ path: file, hash });
53581
53640
  }
53582
53641
  data.appKey = key2;
@@ -53593,7 +53652,7 @@ var uploadFiles = async (files, directory, opts) => {
53593
53652
  }
53594
53653
  const token2 = await storage.getItem("token");
53595
53654
  const checkUrl = new URL("/api/s1/resources/upload/check", getBaseURL());
53596
- const res = await query.adapter({ url: checkUrl.toString(), method: "POST", body: data, headers: { Authorization: "Bearer " + token2, contentType: "application/json" } }).then((res2) => {
53655
+ const res = await query.adapter({ url: checkUrl.toString(), method: "POST", body: data, headers: { Authorization: "Bearer " + token2 } }).then((res2) => {
53597
53656
  try {
53598
53657
  if (typeof res2 === "string") {
53599
53658
  return JSON.parse(res2);
@@ -53609,6 +53668,7 @@ var uploadFiles = async (files, directory, opts) => {
53609
53668
  console.error("check failed", res);
53610
53669
  return res;
53611
53670
  }
53671
+ console.log("res", res);
53612
53672
  let needUpload = false;
53613
53673
  for (const file of files) {
53614
53674
  const filePath = path10.join(directory, file);
@@ -53636,7 +53696,7 @@ var uploadFiles = async (files, directory, opts) => {
53636
53696
  if (opts.noCheckAppFiles) {
53637
53697
  url.searchParams.append("noCheckAppFiles", "true");
53638
53698
  }
53639
- return upload({ url, form, token: token2 });
53699
+ return { code: 200 };
53640
53700
  };
53641
53701
  program.addCommand(command2);
53642
53702
  var deployLoadFn2 = async (id, org) => {
@@ -54582,11 +54642,12 @@ class SyncBase {
54582
54642
  import path15 from "path";
54583
54643
  import fs22 from "fs";
54584
54644
  var import_fast_glob4 = __toESM(require_out4(), 1);
54585
- var fetchLink = async (url, opts) => {
54645
+ var fetchLink = async (url = "", opts) => {
54586
54646
  const token2 = process.env.KEVISUAL_TOKEN || storage.getItem("token");
54587
54647
  const fetchURL = new URL(url);
54588
54648
  const check2 = opts?.check ?? false;
54589
- const setToken = opts?.setToken ?? true;
54649
+ const isKevisual = !!url.includes("kevisual");
54650
+ const setToken = opts?.setToken ?? isKevisual;
54590
54651
  if (check2) {
54591
54652
  if (!url.startsWith(baseURL)) {
54592
54653
  throw new Error("url must start with " + baseURL);
@@ -54803,11 +54864,83 @@ var fetchAiList = async (url, opts) => {
54803
54864
 
54804
54865
  // src/command/sync/sync.ts
54805
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
54806
54939
  import path16 from "node:path";
54807
54940
  var command8 = new Command("sync").option("-d --dir <dir>").description("同步项目").action(() => {
54808
54941
  console.log("同步项目");
54809
54942
  });
54810
- var syncUpload = new Command("upload").option("-d --dir <dir>", "配置目录").option("-c --config <config>", "配置文件的名字", "kevisual.json").option("-f --file <file>", "操作的对应的文件名").description("上传项目").action(async (opts) => {
54943
+ var syncUpload = new Command("upload").option("-d --dir <dir>", "配置目录").option("-c --config <config>", "配置文件的名字", "kevisual.json").option("-f --file <file>", "操作的对应的文件名").description("上传项目, 上传需要和registry的地址同步。").action(async (opts) => {
54811
54944
  console.log("上传项目");
54812
54945
  const sync = new SyncBase({ dir: opts.dir, baseURL, configFilename: opts.config });
54813
54946
  const syncList = await sync.getSyncList({ getFile: true });
@@ -54818,6 +54951,7 @@ var syncUpload = new Command("upload").option("-d --dir <dir>", "配置目录").
54818
54951
  ...sync.config.metadata
54819
54952
  };
54820
54953
  const filepath = sync.getRelativePath(opts.file);
54954
+ const newInfos = [];
54821
54955
  for (const item of syncList) {
54822
54956
  if (!item.auth || !item.exist) {
54823
54957
  nodonwArr.push(item);
@@ -54840,15 +54974,22 @@ var syncUpload = new Command("upload").option("-d --dir <dir>", "配置目录").
54840
54974
  });
54841
54975
  if (res.code === 200) {
54842
54976
  if (res.data?.isNew) {
54843
- logger.info("上传成功", item.key, chalk2.green(item.url), chalk2.green("文件上传"));
54977
+ newInfos.push(["上传成功", item.key, chalk2.green(item.url), chalk2.green("文件上传")]);
54844
54978
  } else if (res.data?.isNewMeta) {
54845
- logger.info("上传成功", item.key, chalk2.green(item.url), chalk2.green("元数据更新"));
54979
+ newInfos.push(["上传成功", item.key, chalk2.green(item.url), chalk2.green("元数据更新")]);
54846
54980
  } else {
54847
54981
  logger.info("上传成功", item.key, chalk2.green(item.url), chalk2.blue("文件未更新"));
54848
54982
  }
54849
54983
  }
54850
54984
  logger.debug(res);
54851
54985
  }
54986
+ if (newInfos.length) {
54987
+ logger.info(`上传成功的文件
54988
+ `);
54989
+ newInfos.forEach((item) => {
54990
+ logger.info(...item);
54991
+ });
54992
+ }
54852
54993
  if (nodonwArr.length && !filepath) {
54853
54994
  logger.warn(`以下文件未上传
54854
54995
  `, nodonwArr.map((item) => item.key).join(","));