@capgo/cli 4.0.12 → 4.0.14

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/index.js CHANGED
@@ -934,7 +934,7 @@ var require_command = __commonJS({
934
934
  var childProcess2 = require("child_process");
935
935
  var path3 = require("path");
936
936
  var fs6 = require("fs");
937
- var process7 = require("process");
937
+ var process30 = require("process");
938
938
  var { Argument: Argument2, humanReadableArgName } = require_argument();
939
939
  var { CommanderError: CommanderError2 } = require_error();
940
940
  var { Help: Help2 } = require_help();
@@ -980,10 +980,10 @@ var require_command = __commonJS({
980
980
  this._showHelpAfterError = false;
981
981
  this._showSuggestionAfterError = true;
982
982
  this._outputConfiguration = {
983
- writeOut: (str) => process7.stdout.write(str),
984
- writeErr: (str) => process7.stderr.write(str),
985
- getOutHelpWidth: () => process7.stdout.isTTY ? process7.stdout.columns : void 0,
986
- getErrHelpWidth: () => process7.stderr.isTTY ? process7.stderr.columns : void 0,
983
+ writeOut: (str) => process30.stdout.write(str),
984
+ writeErr: (str) => process30.stderr.write(str),
985
+ getOutHelpWidth: () => process30.stdout.isTTY ? process30.stdout.columns : void 0,
986
+ getErrHelpWidth: () => process30.stderr.isTTY ? process30.stderr.columns : void 0,
987
987
  outputError: (str, write) => write(str)
988
988
  };
989
989
  this._hidden = false;
@@ -1367,7 +1367,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1367
1367
  if (this._exitCallback) {
1368
1368
  this._exitCallback(new CommanderError2(exitCode, code, message));
1369
1369
  }
1370
- process7.exit(exitCode);
1370
+ process30.exit(exitCode);
1371
1371
  }
1372
1372
  /**
1373
1373
  * Register callback `fn` for the command.
@@ -1742,8 +1742,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
1742
1742
  }
1743
1743
  parseOptions = parseOptions || {};
1744
1744
  if (argv === void 0) {
1745
- argv = process7.argv;
1746
- if (process7.versions && process7.versions.electron) {
1745
+ argv = process30.argv;
1746
+ if (process30.versions && process30.versions.electron) {
1747
1747
  parseOptions.from = "electron";
1748
1748
  }
1749
1749
  }
@@ -1756,7 +1756,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1756
1756
  userArgs = argv.slice(2);
1757
1757
  break;
1758
1758
  case "electron":
1759
- if (process7.defaultApp) {
1759
+ if (process30.defaultApp) {
1760
1760
  this._scriptPath = argv[1];
1761
1761
  userArgs = argv.slice(2);
1762
1762
  } else {
@@ -1863,23 +1863,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
1863
1863
  }
1864
1864
  launchWithNode = sourceExt.includes(path3.extname(executableFile));
1865
1865
  let proc;
1866
- if (process7.platform !== "win32") {
1866
+ if (process30.platform !== "win32") {
1867
1867
  if (launchWithNode) {
1868
1868
  args.unshift(executableFile);
1869
- args = incrementNodeInspectorPort(process7.execArgv).concat(args);
1870
- proc = childProcess2.spawn(process7.argv[0], args, { stdio: "inherit" });
1869
+ args = incrementNodeInspectorPort(process30.execArgv).concat(args);
1870
+ proc = childProcess2.spawn(process30.argv[0], args, { stdio: "inherit" });
1871
1871
  } else {
1872
1872
  proc = childProcess2.spawn(executableFile, args, { stdio: "inherit" });
1873
1873
  }
1874
1874
  } else {
1875
1875
  args.unshift(executableFile);
1876
- args = incrementNodeInspectorPort(process7.execArgv).concat(args);
1877
- proc = childProcess2.spawn(process7.execPath, args, { stdio: "inherit" });
1876
+ args = incrementNodeInspectorPort(process30.execArgv).concat(args);
1877
+ proc = childProcess2.spawn(process30.execPath, args, { stdio: "inherit" });
1878
1878
  }
1879
1879
  if (!proc.killed) {
1880
1880
  const signals = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
1881
1881
  signals.forEach((signal) => {
1882
- process7.on(signal, () => {
1882
+ process30.on(signal, () => {
1883
1883
  if (proc.killed === false && proc.exitCode === null) {
1884
1884
  proc.kill(signal);
1885
1885
  }
@@ -1890,7 +1890,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1890
1890
  proc.on("close", (code, _signal) => {
1891
1891
  code = code ?? 1;
1892
1892
  if (!exitCallback) {
1893
- process7.exit(code);
1893
+ process30.exit(code);
1894
1894
  } else {
1895
1895
  exitCallback(new CommanderError2(code, "commander.executeSubCommandAsync", "(close)"));
1896
1896
  }
@@ -1907,7 +1907,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1907
1907
  throw new Error(`'${executableFile}' not executable`);
1908
1908
  }
1909
1909
  if (!exitCallback) {
1910
- process7.exit(1);
1910
+ process30.exit(1);
1911
1911
  } else {
1912
1912
  const wrappedError = new CommanderError2(1, "commander.executeSubCommandAsync", "(error)");
1913
1913
  wrappedError.nestedError = err;
@@ -2381,11 +2381,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2381
2381
  */
2382
2382
  _parseOptionsEnv() {
2383
2383
  this.options.forEach((option) => {
2384
- if (option.envVar && option.envVar in process7.env) {
2384
+ if (option.envVar && option.envVar in process30.env) {
2385
2385
  const optionKey = option.attributeName();
2386
2386
  if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes(this.getOptionValueSource(optionKey))) {
2387
2387
  if (option.required || option.optional) {
2388
- this.emit(`optionEnv:${option.name()}`, process7.env[option.envVar]);
2388
+ this.emit(`optionEnv:${option.name()}`, process30.env[option.envVar]);
2389
2389
  } else {
2390
2390
  this.emit(`optionEnv:${option.name()}`);
2391
2391
  }
@@ -2807,7 +2807,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2807
2807
  */
2808
2808
  help(contextOptions) {
2809
2809
  this.outputHelp(contextOptions);
2810
- let exitCode = process7.exitCode || 0;
2810
+ let exitCode = process30.exitCode || 0;
2811
2811
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
2812
2812
  exitCode = 1;
2813
2813
  }
@@ -5478,12 +5478,12 @@ var require_buffer_list = __commonJS({
5478
5478
  return (hint === "string" ? String : Number)(input);
5479
5479
  }
5480
5480
  var _require = require("buffer");
5481
- var Buffer3 = _require.Buffer;
5481
+ var Buffer4 = _require.Buffer;
5482
5482
  var _require2 = require("util");
5483
5483
  var inspect = _require2.inspect;
5484
5484
  var custom = inspect && inspect.custom || "inspect";
5485
5485
  function copyBuffer(src, target, offset) {
5486
- Buffer3.prototype.copy.call(src, target, offset);
5486
+ Buffer4.prototype.copy.call(src, target, offset);
5487
5487
  }
5488
5488
  module2.exports = /* @__PURE__ */ function() {
5489
5489
  function BufferList() {
@@ -5552,8 +5552,8 @@ var require_buffer_list = __commonJS({
5552
5552
  key: "concat",
5553
5553
  value: function concat(n) {
5554
5554
  if (this.length === 0)
5555
- return Buffer3.alloc(0);
5556
- var ret = Buffer3.allocUnsafe(n >>> 0);
5555
+ return Buffer4.alloc(0);
5556
+ var ret = Buffer4.allocUnsafe(n >>> 0);
5557
5557
  var p2 = this.head;
5558
5558
  var i = 0;
5559
5559
  while (p2) {
@@ -5621,7 +5621,7 @@ var require_buffer_list = __commonJS({
5621
5621
  }, {
5622
5622
  key: "_getBuffer",
5623
5623
  value: function _getBuffer(n) {
5624
- var ret = Buffer3.allocUnsafe(n);
5624
+ var ret = Buffer4.allocUnsafe(n);
5625
5625
  var p2 = this.head;
5626
5626
  var c2 = 1;
5627
5627
  p2.data.copy(ret);
@@ -5957,14 +5957,14 @@ var require_stream_writable = __commonJS({
5957
5957
  deprecate: require_node()
5958
5958
  };
5959
5959
  var Stream = require_stream();
5960
- var Buffer3 = require("buffer").Buffer;
5960
+ var Buffer4 = require("buffer").Buffer;
5961
5961
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
5962
5962
  };
5963
5963
  function _uint8ArrayToBuffer(chunk) {
5964
- return Buffer3.from(chunk);
5964
+ return Buffer4.from(chunk);
5965
5965
  }
5966
5966
  function _isUint8Array(obj) {
5967
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
5967
+ return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array;
5968
5968
  }
5969
5969
  var destroyImpl = require_destroy();
5970
5970
  var _require = require_state();
@@ -6101,7 +6101,7 @@ var require_stream_writable = __commonJS({
6101
6101
  var state = this._writableState;
6102
6102
  var ret = false;
6103
6103
  var isBuf = !state.objectMode && _isUint8Array(chunk);
6104
- if (isBuf && !Buffer3.isBuffer(chunk)) {
6104
+ if (isBuf && !Buffer4.isBuffer(chunk)) {
6105
6105
  chunk = _uint8ArrayToBuffer(chunk);
6106
6106
  }
6107
6107
  if (typeof encoding === "function") {
@@ -6152,7 +6152,7 @@ var require_stream_writable = __commonJS({
6152
6152
  });
6153
6153
  function decodeChunk(state, chunk, encoding) {
6154
6154
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
6155
- chunk = Buffer3.from(chunk, encoding);
6155
+ chunk = Buffer4.from(chunk, encoding);
6156
6156
  }
6157
6157
  return chunk;
6158
6158
  }
@@ -6541,34 +6541,34 @@ var require_stream_duplex = __commonJS({
6541
6541
  var require_safe_buffer = __commonJS({
6542
6542
  "node_modules/safe-buffer/index.js"(exports2, module2) {
6543
6543
  var buffer = require("buffer");
6544
- var Buffer3 = buffer.Buffer;
6544
+ var Buffer4 = buffer.Buffer;
6545
6545
  function copyProps(src, dst) {
6546
6546
  for (var key2 in src) {
6547
6547
  dst[key2] = src[key2];
6548
6548
  }
6549
6549
  }
6550
- if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
6550
+ if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) {
6551
6551
  module2.exports = buffer;
6552
6552
  } else {
6553
6553
  copyProps(buffer, exports2);
6554
6554
  exports2.Buffer = SafeBuffer;
6555
6555
  }
6556
6556
  function SafeBuffer(arg, encodingOrOffset, length) {
6557
- return Buffer3(arg, encodingOrOffset, length);
6557
+ return Buffer4(arg, encodingOrOffset, length);
6558
6558
  }
6559
- SafeBuffer.prototype = Object.create(Buffer3.prototype);
6560
- copyProps(Buffer3, SafeBuffer);
6559
+ SafeBuffer.prototype = Object.create(Buffer4.prototype);
6560
+ copyProps(Buffer4, SafeBuffer);
6561
6561
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
6562
6562
  if (typeof arg === "number") {
6563
6563
  throw new TypeError("Argument must not be a number");
6564
6564
  }
6565
- return Buffer3(arg, encodingOrOffset, length);
6565
+ return Buffer4(arg, encodingOrOffset, length);
6566
6566
  };
6567
6567
  SafeBuffer.alloc = function(size, fill, encoding) {
6568
6568
  if (typeof size !== "number") {
6569
6569
  throw new TypeError("Argument must be a number");
6570
6570
  }
6571
- var buf = Buffer3(size);
6571
+ var buf = Buffer4(size);
6572
6572
  if (fill !== void 0) {
6573
6573
  if (typeof encoding === "string") {
6574
6574
  buf.fill(fill, encoding);
@@ -6584,7 +6584,7 @@ var require_safe_buffer = __commonJS({
6584
6584
  if (typeof size !== "number") {
6585
6585
  throw new TypeError("Argument must be a number");
6586
6586
  }
6587
- return Buffer3(size);
6587
+ return Buffer4(size);
6588
6588
  };
6589
6589
  SafeBuffer.allocUnsafeSlow = function(size) {
6590
6590
  if (typeof size !== "number") {
@@ -6599,8 +6599,8 @@ var require_safe_buffer = __commonJS({
6599
6599
  var require_string_decoder = __commonJS({
6600
6600
  "node_modules/string_decoder/lib/string_decoder.js"(exports2) {
6601
6601
  "use strict";
6602
- var Buffer3 = require_safe_buffer().Buffer;
6603
- var isEncoding = Buffer3.isEncoding || function(encoding) {
6602
+ var Buffer4 = require_safe_buffer().Buffer;
6603
+ var isEncoding = Buffer4.isEncoding || function(encoding) {
6604
6604
  encoding = "" + encoding;
6605
6605
  switch (encoding && encoding.toLowerCase()) {
6606
6606
  case "hex":
@@ -6650,7 +6650,7 @@ var require_string_decoder = __commonJS({
6650
6650
  }
6651
6651
  function normalizeEncoding(enc) {
6652
6652
  var nenc = _normalizeEncoding(enc);
6653
- if (typeof nenc !== "string" && (Buffer3.isEncoding === isEncoding || !isEncoding(enc)))
6653
+ if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc)))
6654
6654
  throw new Error("Unknown encoding: " + enc);
6655
6655
  return nenc || enc;
6656
6656
  }
@@ -6680,7 +6680,7 @@ var require_string_decoder = __commonJS({
6680
6680
  }
6681
6681
  this.lastNeed = 0;
6682
6682
  this.lastTotal = 0;
6683
- this.lastChar = Buffer3.allocUnsafe(nb);
6683
+ this.lastChar = Buffer4.allocUnsafe(nb);
6684
6684
  }
6685
6685
  StringDecoder.prototype.write = function(buf) {
6686
6686
  if (buf.length === 0)
@@ -7279,14 +7279,14 @@ var require_stream_readable = __commonJS({
7279
7279
  return emitter.listeners(type).length;
7280
7280
  };
7281
7281
  var Stream = require_stream();
7282
- var Buffer3 = require("buffer").Buffer;
7282
+ var Buffer4 = require("buffer").Buffer;
7283
7283
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
7284
7284
  };
7285
7285
  function _uint8ArrayToBuffer(chunk) {
7286
- return Buffer3.from(chunk);
7286
+ return Buffer4.from(chunk);
7287
7287
  }
7288
7288
  function _isUint8Array(obj) {
7289
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
7289
+ return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array;
7290
7290
  }
7291
7291
  var debugUtil = require("util");
7292
7292
  var debug;
@@ -7404,7 +7404,7 @@ var require_stream_readable = __commonJS({
7404
7404
  if (typeof chunk === "string") {
7405
7405
  encoding = encoding || state.defaultEncoding;
7406
7406
  if (encoding !== state.encoding) {
7407
- chunk = Buffer3.from(chunk, encoding);
7407
+ chunk = Buffer4.from(chunk, encoding);
7408
7408
  encoding = "";
7409
7409
  }
7410
7410
  skipChunkCheck = true;
@@ -7430,7 +7430,7 @@ var require_stream_readable = __commonJS({
7430
7430
  if (er) {
7431
7431
  errorOrDestroy(stream, er);
7432
7432
  } else if (state.objectMode || chunk && chunk.length > 0) {
7433
- if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer3.prototype) {
7433
+ if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer4.prototype) {
7434
7434
  chunk = _uint8ArrayToBuffer(chunk);
7435
7435
  }
7436
7436
  if (addToFront) {
@@ -10026,33 +10026,33 @@ var require_stream2 = __commonJS({
10026
10026
  var require_safe_buffer2 = __commonJS({
10027
10027
  "node_modules/from2/node_modules/readable-stream/node_modules/safe-buffer/index.js"(exports2, module2) {
10028
10028
  var buffer = require("buffer");
10029
- var Buffer3 = buffer.Buffer;
10029
+ var Buffer4 = buffer.Buffer;
10030
10030
  function copyProps(src, dst) {
10031
10031
  for (var key2 in src) {
10032
10032
  dst[key2] = src[key2];
10033
10033
  }
10034
10034
  }
10035
- if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
10035
+ if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) {
10036
10036
  module2.exports = buffer;
10037
10037
  } else {
10038
10038
  copyProps(buffer, exports2);
10039
10039
  exports2.Buffer = SafeBuffer;
10040
10040
  }
10041
10041
  function SafeBuffer(arg, encodingOrOffset, length) {
10042
- return Buffer3(arg, encodingOrOffset, length);
10042
+ return Buffer4(arg, encodingOrOffset, length);
10043
10043
  }
10044
- copyProps(Buffer3, SafeBuffer);
10044
+ copyProps(Buffer4, SafeBuffer);
10045
10045
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
10046
10046
  if (typeof arg === "number") {
10047
10047
  throw new TypeError("Argument must not be a number");
10048
10048
  }
10049
- return Buffer3(arg, encodingOrOffset, length);
10049
+ return Buffer4(arg, encodingOrOffset, length);
10050
10050
  };
10051
10051
  SafeBuffer.alloc = function(size, fill, encoding) {
10052
10052
  if (typeof size !== "number") {
10053
10053
  throw new TypeError("Argument must be a number");
10054
10054
  }
10055
- var buf = Buffer3(size);
10055
+ var buf = Buffer4(size);
10056
10056
  if (fill !== void 0) {
10057
10057
  if (typeof encoding === "string") {
10058
10058
  buf.fill(fill, encoding);
@@ -10068,7 +10068,7 @@ var require_safe_buffer2 = __commonJS({
10068
10068
  if (typeof size !== "number") {
10069
10069
  throw new TypeError("Argument must be a number");
10070
10070
  }
10071
- return Buffer3(size);
10071
+ return Buffer4(size);
10072
10072
  };
10073
10073
  SafeBuffer.allocUnsafeSlow = function(size) {
10074
10074
  if (typeof size !== "number") {
@@ -10158,7 +10158,7 @@ var require_BufferList = __commonJS({
10158
10158
  throw new TypeError("Cannot call a class as a function");
10159
10159
  }
10160
10160
  }
10161
- var Buffer3 = require_safe_buffer2().Buffer;
10161
+ var Buffer4 = require_safe_buffer2().Buffer;
10162
10162
  var util = require("util");
10163
10163
  function copyBuffer(src, target, offset) {
10164
10164
  src.copy(target, offset);
@@ -10213,8 +10213,8 @@ var require_BufferList = __commonJS({
10213
10213
  };
10214
10214
  BufferList.prototype.concat = function concat(n) {
10215
10215
  if (this.length === 0)
10216
- return Buffer3.alloc(0);
10217
- var ret = Buffer3.allocUnsafe(n >>> 0);
10216
+ return Buffer4.alloc(0);
10217
+ var ret = Buffer4.allocUnsafe(n >>> 0);
10218
10218
  var p2 = this.head;
10219
10219
  var i = 0;
10220
10220
  while (p2) {
@@ -10327,14 +10327,14 @@ var require_stream_writable2 = __commonJS({
10327
10327
  deprecate: require_node()
10328
10328
  };
10329
10329
  var Stream = require_stream2();
10330
- var Buffer3 = require_safe_buffer2().Buffer;
10330
+ var Buffer4 = require_safe_buffer2().Buffer;
10331
10331
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
10332
10332
  };
10333
10333
  function _uint8ArrayToBuffer(chunk) {
10334
- return Buffer3.from(chunk);
10334
+ return Buffer4.from(chunk);
10335
10335
  }
10336
10336
  function _isUint8Array(obj) {
10337
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
10337
+ return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array;
10338
10338
  }
10339
10339
  var destroyImpl = require_destroy2();
10340
10340
  util.inherits(Writable, Stream);
@@ -10466,7 +10466,7 @@ var require_stream_writable2 = __commonJS({
10466
10466
  var state = this._writableState;
10467
10467
  var ret = false;
10468
10468
  var isBuf = !state.objectMode && _isUint8Array(chunk);
10469
- if (isBuf && !Buffer3.isBuffer(chunk)) {
10469
+ if (isBuf && !Buffer4.isBuffer(chunk)) {
10470
10470
  chunk = _uint8ArrayToBuffer(chunk);
10471
10471
  }
10472
10472
  if (typeof encoding === "function") {
@@ -10509,7 +10509,7 @@ var require_stream_writable2 = __commonJS({
10509
10509
  };
10510
10510
  function decodeChunk(state, chunk, encoding) {
10511
10511
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
10512
- chunk = Buffer3.from(chunk, encoding);
10512
+ chunk = Buffer4.from(chunk, encoding);
10513
10513
  }
10514
10514
  return chunk;
10515
10515
  }
@@ -10859,8 +10859,8 @@ var require_stream_duplex2 = __commonJS({
10859
10859
  var require_string_decoder2 = __commonJS({
10860
10860
  "node_modules/from2/node_modules/readable-stream/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
10861
10861
  "use strict";
10862
- var Buffer3 = require_safe_buffer2().Buffer;
10863
- var isEncoding = Buffer3.isEncoding || function(encoding) {
10862
+ var Buffer4 = require_safe_buffer2().Buffer;
10863
+ var isEncoding = Buffer4.isEncoding || function(encoding) {
10864
10864
  encoding = "" + encoding;
10865
10865
  switch (encoding && encoding.toLowerCase()) {
10866
10866
  case "hex":
@@ -10910,7 +10910,7 @@ var require_string_decoder2 = __commonJS({
10910
10910
  }
10911
10911
  function normalizeEncoding(enc) {
10912
10912
  var nenc = _normalizeEncoding(enc);
10913
- if (typeof nenc !== "string" && (Buffer3.isEncoding === isEncoding || !isEncoding(enc)))
10913
+ if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc)))
10914
10914
  throw new Error("Unknown encoding: " + enc);
10915
10915
  return nenc || enc;
10916
10916
  }
@@ -10940,7 +10940,7 @@ var require_string_decoder2 = __commonJS({
10940
10940
  }
10941
10941
  this.lastNeed = 0;
10942
10942
  this.lastTotal = 0;
10943
- this.lastChar = Buffer3.allocUnsafe(nb);
10943
+ this.lastChar = Buffer4.allocUnsafe(nb);
10944
10944
  }
10945
10945
  StringDecoder.prototype.write = function(buf) {
10946
10946
  if (buf.length === 0)
@@ -11129,14 +11129,14 @@ var require_stream_readable2 = __commonJS({
11129
11129
  return emitter.listeners(type).length;
11130
11130
  };
11131
11131
  var Stream = require_stream2();
11132
- var Buffer3 = require_safe_buffer2().Buffer;
11132
+ var Buffer4 = require_safe_buffer2().Buffer;
11133
11133
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
11134
11134
  };
11135
11135
  function _uint8ArrayToBuffer(chunk) {
11136
- return Buffer3.from(chunk);
11136
+ return Buffer4.from(chunk);
11137
11137
  }
11138
11138
  function _isUint8Array(obj) {
11139
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
11139
+ return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array;
11140
11140
  }
11141
11141
  var util = Object.create(require_util2());
11142
11142
  util.inherits = require_inherits();
@@ -11247,7 +11247,7 @@ var require_stream_readable2 = __commonJS({
11247
11247
  if (typeof chunk === "string") {
11248
11248
  encoding = encoding || state.defaultEncoding;
11249
11249
  if (encoding !== state.encoding) {
11250
- chunk = Buffer3.from(chunk, encoding);
11250
+ chunk = Buffer4.from(chunk, encoding);
11251
11251
  encoding = "";
11252
11252
  }
11253
11253
  skipChunkCheck = true;
@@ -11272,7 +11272,7 @@ var require_stream_readable2 = __commonJS({
11272
11272
  if (er) {
11273
11273
  stream.emit("error", er);
11274
11274
  } else if (state.objectMode || chunk && chunk.length > 0) {
11275
- if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer3.prototype) {
11275
+ if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer4.prototype) {
11276
11276
  chunk = _uint8ArrayToBuffer(chunk);
11277
11277
  }
11278
11278
  if (addToFront) {
@@ -11819,7 +11819,7 @@ var require_stream_readable2 = __commonJS({
11819
11819
  return ret;
11820
11820
  }
11821
11821
  function copyFromBuffer(n, list) {
11822
- var ret = Buffer3.allocUnsafe(n);
11822
+ var ret = Buffer4.allocUnsafe(n);
11823
11823
  var p2 = list.head;
11824
11824
  var c2 = 1;
11825
11825
  p2.data.copy(ret);
@@ -12267,33 +12267,33 @@ var require_stream3 = __commonJS({
12267
12267
  var require_safe_buffer3 = __commonJS({
12268
12268
  "node_modules/progress-stream/node_modules/through2/node_modules/readable-stream/node_modules/safe-buffer/index.js"(exports2, module2) {
12269
12269
  var buffer = require("buffer");
12270
- var Buffer3 = buffer.Buffer;
12270
+ var Buffer4 = buffer.Buffer;
12271
12271
  function copyProps(src, dst) {
12272
12272
  for (var key2 in src) {
12273
12273
  dst[key2] = src[key2];
12274
12274
  }
12275
12275
  }
12276
- if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
12276
+ if (Buffer4.from && Buffer4.alloc && Buffer4.allocUnsafe && Buffer4.allocUnsafeSlow) {
12277
12277
  module2.exports = buffer;
12278
12278
  } else {
12279
12279
  copyProps(buffer, exports2);
12280
12280
  exports2.Buffer = SafeBuffer;
12281
12281
  }
12282
12282
  function SafeBuffer(arg, encodingOrOffset, length) {
12283
- return Buffer3(arg, encodingOrOffset, length);
12283
+ return Buffer4(arg, encodingOrOffset, length);
12284
12284
  }
12285
- copyProps(Buffer3, SafeBuffer);
12285
+ copyProps(Buffer4, SafeBuffer);
12286
12286
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
12287
12287
  if (typeof arg === "number") {
12288
12288
  throw new TypeError("Argument must not be a number");
12289
12289
  }
12290
- return Buffer3(arg, encodingOrOffset, length);
12290
+ return Buffer4(arg, encodingOrOffset, length);
12291
12291
  };
12292
12292
  SafeBuffer.alloc = function(size, fill, encoding) {
12293
12293
  if (typeof size !== "number") {
12294
12294
  throw new TypeError("Argument must be a number");
12295
12295
  }
12296
- var buf = Buffer3(size);
12296
+ var buf = Buffer4(size);
12297
12297
  if (fill !== void 0) {
12298
12298
  if (typeof encoding === "string") {
12299
12299
  buf.fill(fill, encoding);
@@ -12309,7 +12309,7 @@ var require_safe_buffer3 = __commonJS({
12309
12309
  if (typeof size !== "number") {
12310
12310
  throw new TypeError("Argument must be a number");
12311
12311
  }
12312
- return Buffer3(size);
12312
+ return Buffer4(size);
12313
12313
  };
12314
12314
  SafeBuffer.allocUnsafeSlow = function(size) {
12315
12315
  if (typeof size !== "number") {
@@ -12329,7 +12329,7 @@ var require_BufferList2 = __commonJS({
12329
12329
  throw new TypeError("Cannot call a class as a function");
12330
12330
  }
12331
12331
  }
12332
- var Buffer3 = require_safe_buffer3().Buffer;
12332
+ var Buffer4 = require_safe_buffer3().Buffer;
12333
12333
  var util = require("util");
12334
12334
  function copyBuffer(src, target, offset) {
12335
12335
  src.copy(target, offset);
@@ -12384,8 +12384,8 @@ var require_BufferList2 = __commonJS({
12384
12384
  };
12385
12385
  BufferList.prototype.concat = function concat(n) {
12386
12386
  if (this.length === 0)
12387
- return Buffer3.alloc(0);
12388
- var ret = Buffer3.allocUnsafe(n >>> 0);
12387
+ return Buffer4.alloc(0);
12388
+ var ret = Buffer4.allocUnsafe(n >>> 0);
12389
12389
  var p2 = this.head;
12390
12390
  var i = 0;
12391
12391
  while (p2) {
@@ -12498,14 +12498,14 @@ var require_stream_writable3 = __commonJS({
12498
12498
  deprecate: require_node()
12499
12499
  };
12500
12500
  var Stream = require_stream3();
12501
- var Buffer3 = require_safe_buffer3().Buffer;
12501
+ var Buffer4 = require_safe_buffer3().Buffer;
12502
12502
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
12503
12503
  };
12504
12504
  function _uint8ArrayToBuffer(chunk) {
12505
- return Buffer3.from(chunk);
12505
+ return Buffer4.from(chunk);
12506
12506
  }
12507
12507
  function _isUint8Array(obj) {
12508
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
12508
+ return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array;
12509
12509
  }
12510
12510
  var destroyImpl = require_destroy3();
12511
12511
  util.inherits(Writable, Stream);
@@ -12637,7 +12637,7 @@ var require_stream_writable3 = __commonJS({
12637
12637
  var state = this._writableState;
12638
12638
  var ret = false;
12639
12639
  var isBuf = !state.objectMode && _isUint8Array(chunk);
12640
- if (isBuf && !Buffer3.isBuffer(chunk)) {
12640
+ if (isBuf && !Buffer4.isBuffer(chunk)) {
12641
12641
  chunk = _uint8ArrayToBuffer(chunk);
12642
12642
  }
12643
12643
  if (typeof encoding === "function") {
@@ -12680,7 +12680,7 @@ var require_stream_writable3 = __commonJS({
12680
12680
  };
12681
12681
  function decodeChunk(state, chunk, encoding) {
12682
12682
  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
12683
- chunk = Buffer3.from(chunk, encoding);
12683
+ chunk = Buffer4.from(chunk, encoding);
12684
12684
  }
12685
12685
  return chunk;
12686
12686
  }
@@ -13030,8 +13030,8 @@ var require_stream_duplex3 = __commonJS({
13030
13030
  var require_string_decoder3 = __commonJS({
13031
13031
  "node_modules/progress-stream/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
13032
13032
  "use strict";
13033
- var Buffer3 = require_safe_buffer3().Buffer;
13034
- var isEncoding = Buffer3.isEncoding || function(encoding) {
13033
+ var Buffer4 = require_safe_buffer3().Buffer;
13034
+ var isEncoding = Buffer4.isEncoding || function(encoding) {
13035
13035
  encoding = "" + encoding;
13036
13036
  switch (encoding && encoding.toLowerCase()) {
13037
13037
  case "hex":
@@ -13081,7 +13081,7 @@ var require_string_decoder3 = __commonJS({
13081
13081
  }
13082
13082
  function normalizeEncoding(enc) {
13083
13083
  var nenc = _normalizeEncoding(enc);
13084
- if (typeof nenc !== "string" && (Buffer3.isEncoding === isEncoding || !isEncoding(enc)))
13084
+ if (typeof nenc !== "string" && (Buffer4.isEncoding === isEncoding || !isEncoding(enc)))
13085
13085
  throw new Error("Unknown encoding: " + enc);
13086
13086
  return nenc || enc;
13087
13087
  }
@@ -13111,7 +13111,7 @@ var require_string_decoder3 = __commonJS({
13111
13111
  }
13112
13112
  this.lastNeed = 0;
13113
13113
  this.lastTotal = 0;
13114
- this.lastChar = Buffer3.allocUnsafe(nb);
13114
+ this.lastChar = Buffer4.allocUnsafe(nb);
13115
13115
  }
13116
13116
  StringDecoder.prototype.write = function(buf) {
13117
13117
  if (buf.length === 0)
@@ -13300,14 +13300,14 @@ var require_stream_readable3 = __commonJS({
13300
13300
  return emitter.listeners(type).length;
13301
13301
  };
13302
13302
  var Stream = require_stream3();
13303
- var Buffer3 = require_safe_buffer3().Buffer;
13303
+ var Buffer4 = require_safe_buffer3().Buffer;
13304
13304
  var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {
13305
13305
  };
13306
13306
  function _uint8ArrayToBuffer(chunk) {
13307
- return Buffer3.from(chunk);
13307
+ return Buffer4.from(chunk);
13308
13308
  }
13309
13309
  function _isUint8Array(obj) {
13310
- return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array;
13310
+ return Buffer4.isBuffer(obj) || obj instanceof OurUint8Array;
13311
13311
  }
13312
13312
  var util = Object.create(require_util2());
13313
13313
  util.inherits = require_inherits();
@@ -13418,7 +13418,7 @@ var require_stream_readable3 = __commonJS({
13418
13418
  if (typeof chunk === "string") {
13419
13419
  encoding = encoding || state.defaultEncoding;
13420
13420
  if (encoding !== state.encoding) {
13421
- chunk = Buffer3.from(chunk, encoding);
13421
+ chunk = Buffer4.from(chunk, encoding);
13422
13422
  encoding = "";
13423
13423
  }
13424
13424
  skipChunkCheck = true;
@@ -13443,7 +13443,7 @@ var require_stream_readable3 = __commonJS({
13443
13443
  if (er) {
13444
13444
  stream.emit("error", er);
13445
13445
  } else if (state.objectMode || chunk && chunk.length > 0) {
13446
- if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer3.prototype) {
13446
+ if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer4.prototype) {
13447
13447
  chunk = _uint8ArrayToBuffer(chunk);
13448
13448
  }
13449
13449
  if (addToFront) {
@@ -13990,7 +13990,7 @@ var require_stream_readable3 = __commonJS({
13990
13990
  return ret;
13991
13991
  }
13992
13992
  function copyFromBuffer(n, list) {
13993
- var ret = Buffer3.allocUnsafe(n);
13993
+ var ret = Buffer4.allocUnsafe(n);
13994
13994
  var p2 = list.head;
13995
13995
  var c2 = 1;
13996
13996
  p2.data.copy(ret);
@@ -14424,7 +14424,7 @@ var require_tunnel_agent = __commonJS({
14424
14424
  var events = require("events");
14425
14425
  var assert = require("assert");
14426
14426
  var util = require("util");
14427
- var Buffer3 = require_safe_buffer().Buffer;
14427
+ var Buffer4 = require_safe_buffer().Buffer;
14428
14428
  exports2.httpOverHttp = httpOverHttp;
14429
14429
  exports2.httpsOverHttp = httpsOverHttp;
14430
14430
  exports2.httpOverHttps = httpOverHttps;
@@ -14522,7 +14522,7 @@ var require_tunnel_agent = __commonJS({
14522
14522
  );
14523
14523
  if (connectOptions.proxyAuth) {
14524
14524
  connectOptions.headers = connectOptions.headers || {};
14525
- connectOptions.headers["Proxy-Authorization"] = "Basic " + Buffer3.from(connectOptions.proxyAuth).toString("base64");
14525
+ connectOptions.headers["Proxy-Authorization"] = "Basic " + Buffer4.from(connectOptions.proxyAuth).toString("base64");
14526
14526
  }
14527
14527
  debug("making CONNECT request");
14528
14528
  var connectReq = self2.request(connectOptions);
@@ -24948,11 +24948,11 @@ var require_signals = __commonJS({
24948
24948
  // node_modules/signal-exit/index.js
24949
24949
  var require_signal_exit = __commonJS({
24950
24950
  "node_modules/signal-exit/index.js"(exports2, module2) {
24951
- var process7 = global.process;
24952
- var processOk = function(process8) {
24953
- return process8 && typeof process8 === "object" && typeof process8.removeListener === "function" && typeof process8.emit === "function" && typeof process8.reallyExit === "function" && typeof process8.listeners === "function" && typeof process8.kill === "function" && typeof process8.pid === "number" && typeof process8.on === "function";
24951
+ var process30 = global.process;
24952
+ var processOk = function(process31) {
24953
+ return process31 && typeof process31 === "object" && typeof process31.removeListener === "function" && typeof process31.emit === "function" && typeof process31.reallyExit === "function" && typeof process31.listeners === "function" && typeof process31.kill === "function" && typeof process31.pid === "number" && typeof process31.on === "function";
24954
24954
  };
24955
- if (!processOk(process7)) {
24955
+ if (!processOk(process30)) {
24956
24956
  module2.exports = function() {
24957
24957
  return function() {
24958
24958
  };
@@ -24960,15 +24960,15 @@ var require_signal_exit = __commonJS({
24960
24960
  } else {
24961
24961
  assert = require("assert");
24962
24962
  signals = require_signals();
24963
- isWin = /^win/i.test(process7.platform);
24963
+ isWin = /^win/i.test(process30.platform);
24964
24964
  EE = require("events");
24965
24965
  if (typeof EE !== "function") {
24966
24966
  EE = EE.EventEmitter;
24967
24967
  }
24968
- if (process7.__signal_exit_emitter__) {
24969
- emitter = process7.__signal_exit_emitter__;
24968
+ if (process30.__signal_exit_emitter__) {
24969
+ emitter = process30.__signal_exit_emitter__;
24970
24970
  } else {
24971
- emitter = process7.__signal_exit_emitter__ = new EE();
24971
+ emitter = process30.__signal_exit_emitter__ = new EE();
24972
24972
  emitter.count = 0;
24973
24973
  emitter.emitted = {};
24974
24974
  }
@@ -25005,12 +25005,12 @@ var require_signal_exit = __commonJS({
25005
25005
  loaded = false;
25006
25006
  signals.forEach(function(sig) {
25007
25007
  try {
25008
- process7.removeListener(sig, sigListeners[sig]);
25008
+ process30.removeListener(sig, sigListeners[sig]);
25009
25009
  } catch (er) {
25010
25010
  }
25011
25011
  });
25012
- process7.emit = originalProcessEmit;
25013
- process7.reallyExit = originalProcessReallyExit;
25012
+ process30.emit = originalProcessEmit;
25013
+ process30.reallyExit = originalProcessReallyExit;
25014
25014
  emitter.count -= 1;
25015
25015
  };
25016
25016
  module2.exports.unload = unload;
@@ -25027,7 +25027,7 @@ var require_signal_exit = __commonJS({
25027
25027
  if (!processOk(global.process)) {
25028
25028
  return;
25029
25029
  }
25030
- var listeners = process7.listeners(sig);
25030
+ var listeners = process30.listeners(sig);
25031
25031
  if (listeners.length === emitter.count) {
25032
25032
  unload();
25033
25033
  emit("exit", null, sig);
@@ -25035,7 +25035,7 @@ var require_signal_exit = __commonJS({
25035
25035
  if (isWin && sig === "SIGHUP") {
25036
25036
  sig = "SIGINT";
25037
25037
  }
25038
- process7.kill(process7.pid, sig);
25038
+ process30.kill(process30.pid, sig);
25039
25039
  }
25040
25040
  };
25041
25041
  });
@@ -25051,36 +25051,36 @@ var require_signal_exit = __commonJS({
25051
25051
  emitter.count += 1;
25052
25052
  signals = signals.filter(function(sig) {
25053
25053
  try {
25054
- process7.on(sig, sigListeners[sig]);
25054
+ process30.on(sig, sigListeners[sig]);
25055
25055
  return true;
25056
25056
  } catch (er) {
25057
25057
  return false;
25058
25058
  }
25059
25059
  });
25060
- process7.emit = processEmit;
25061
- process7.reallyExit = processReallyExit;
25060
+ process30.emit = processEmit;
25061
+ process30.reallyExit = processReallyExit;
25062
25062
  };
25063
25063
  module2.exports.load = load;
25064
- originalProcessReallyExit = process7.reallyExit;
25064
+ originalProcessReallyExit = process30.reallyExit;
25065
25065
  processReallyExit = function processReallyExit2(code) {
25066
25066
  if (!processOk(global.process)) {
25067
25067
  return;
25068
25068
  }
25069
- process7.exitCode = code || /* istanbul ignore next */
25069
+ process30.exitCode = code || /* istanbul ignore next */
25070
25070
  0;
25071
- emit("exit", process7.exitCode, null);
25072
- emit("afterexit", process7.exitCode, null);
25073
- originalProcessReallyExit.call(process7, process7.exitCode);
25071
+ emit("exit", process30.exitCode, null);
25072
+ emit("afterexit", process30.exitCode, null);
25073
+ originalProcessReallyExit.call(process30, process30.exitCode);
25074
25074
  };
25075
- originalProcessEmit = process7.emit;
25075
+ originalProcessEmit = process30.emit;
25076
25076
  processEmit = function processEmit2(ev, arg) {
25077
25077
  if (ev === "exit" && processOk(global.process)) {
25078
25078
  if (arg !== void 0) {
25079
- process7.exitCode = arg;
25079
+ process30.exitCode = arg;
25080
25080
  }
25081
25081
  var ret = originalProcessEmit.apply(this, arguments);
25082
- emit("exit", process7.exitCode, null);
25083
- emit("afterexit", process7.exitCode, null);
25082
+ emit("exit", process30.exitCode, null);
25083
+ emit("afterexit", process30.exitCode, null);
25084
25084
  return ret;
25085
25085
  } else {
25086
25086
  return originalProcessEmit.apply(this, arguments);
@@ -48713,7 +48713,7 @@ var require_SupabaseClient = __commonJS({
48713
48713
  flowType: "implicit"
48714
48714
  };
48715
48715
  var DEFAULT_REALTIME_OPTIONS = {};
48716
- var SupabaseClient2 = class {
48716
+ var SupabaseClient = class {
48717
48717
  /**
48718
48718
  * Create a new client for use in the browser.
48719
48719
  * @param supabaseUrl The unique Supabase URL which is supplied when you create a new project in your project dashboard.
@@ -48860,7 +48860,7 @@ var require_SupabaseClient = __commonJS({
48860
48860
  }
48861
48861
  }
48862
48862
  };
48863
- exports2.default = SupabaseClient2;
48863
+ exports2.default = SupabaseClient;
48864
48864
  }
48865
48865
  });
48866
48866
 
@@ -49870,7 +49870,7 @@ var require_safer = __commonJS({
49870
49870
  "node_modules/safer-buffer/safer.js"(exports2, module2) {
49871
49871
  "use strict";
49872
49872
  var buffer = require("buffer");
49873
- var Buffer3 = buffer.Buffer;
49873
+ var Buffer4 = buffer.Buffer;
49874
49874
  var safer = {};
49875
49875
  var key2;
49876
49876
  for (key2 in buffer) {
@@ -49881,14 +49881,14 @@ var require_safer = __commonJS({
49881
49881
  safer[key2] = buffer[key2];
49882
49882
  }
49883
49883
  var Safer = safer.Buffer = {};
49884
- for (key2 in Buffer3) {
49885
- if (!Buffer3.hasOwnProperty(key2))
49884
+ for (key2 in Buffer4) {
49885
+ if (!Buffer4.hasOwnProperty(key2))
49886
49886
  continue;
49887
49887
  if (key2 === "allocUnsafe" || key2 === "allocUnsafeSlow")
49888
49888
  continue;
49889
- Safer[key2] = Buffer3[key2];
49889
+ Safer[key2] = Buffer4[key2];
49890
49890
  }
49891
- safer.Buffer.prototype = Buffer3.prototype;
49891
+ safer.Buffer.prototype = Buffer4.prototype;
49892
49892
  if (!Safer.from || Safer.from === Uint8Array.from) {
49893
49893
  Safer.from = function(value, encodingOrOffset, length) {
49894
49894
  if (typeof value === "number") {
@@ -49897,7 +49897,7 @@ var require_safer = __commonJS({
49897
49897
  if (value && typeof value.length === "undefined") {
49898
49898
  throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
49899
49899
  }
49900
- return Buffer3(value, encodingOrOffset, length);
49900
+ return Buffer4(value, encodingOrOffset, length);
49901
49901
  };
49902
49902
  }
49903
49903
  if (!Safer.alloc) {
@@ -49908,7 +49908,7 @@ var require_safer = __commonJS({
49908
49908
  if (size < 0 || size >= 2 * (1 << 30)) {
49909
49909
  throw new RangeError('The value "' + size + '" is invalid for option "size"');
49910
49910
  }
49911
- var buf = Buffer3(size);
49911
+ var buf = Buffer4(size);
49912
49912
  if (!fill || fill.length === 0) {
49913
49913
  buf.fill(0);
49914
49914
  } else if (typeof encoding === "string") {
@@ -49985,7 +49985,7 @@ var require_bom_handling = __commonJS({
49985
49985
  var require_internal = __commonJS({
49986
49986
  "node_modules/iconv-lite/encodings/internal.js"(exports2, module2) {
49987
49987
  "use strict";
49988
- var Buffer3 = require_safer().Buffer;
49988
+ var Buffer4 = require_safer().Buffer;
49989
49989
  module2.exports = {
49990
49990
  // Encodings
49991
49991
  utf8: { type: "_internal", bomAware: true },
@@ -50007,7 +50007,7 @@ var require_internal = __commonJS({
50007
50007
  else if (this.enc === "cesu8") {
50008
50008
  this.enc = "utf8";
50009
50009
  this.encoder = InternalEncoderCesu8;
50010
- if (Buffer3.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
50010
+ if (Buffer4.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
50011
50011
  this.decoder = InternalDecoderCesu8;
50012
50012
  this.defaultCharUnicode = iconv.defaultCharUnicode;
50013
50013
  }
@@ -50023,8 +50023,8 @@ var require_internal = __commonJS({
50023
50023
  this.decoder = new StringDecoder(codec.enc);
50024
50024
  }
50025
50025
  InternalDecoder.prototype.write = function(buf) {
50026
- if (!Buffer3.isBuffer(buf)) {
50027
- buf = Buffer3.from(buf);
50026
+ if (!Buffer4.isBuffer(buf)) {
50027
+ buf = Buffer4.from(buf);
50028
50028
  }
50029
50029
  return this.decoder.write(buf);
50030
50030
  };
@@ -50035,7 +50035,7 @@ var require_internal = __commonJS({
50035
50035
  this.enc = codec.enc;
50036
50036
  }
50037
50037
  InternalEncoder.prototype.write = function(str) {
50038
- return Buffer3.from(str, this.enc);
50038
+ return Buffer4.from(str, this.enc);
50039
50039
  };
50040
50040
  InternalEncoder.prototype.end = function() {
50041
50041
  };
@@ -50047,15 +50047,15 @@ var require_internal = __commonJS({
50047
50047
  var completeQuads = str.length - str.length % 4;
50048
50048
  this.prevStr = str.slice(completeQuads);
50049
50049
  str = str.slice(0, completeQuads);
50050
- return Buffer3.from(str, "base64");
50050
+ return Buffer4.from(str, "base64");
50051
50051
  };
50052
50052
  InternalEncoderBase64.prototype.end = function() {
50053
- return Buffer3.from(this.prevStr, "base64");
50053
+ return Buffer4.from(this.prevStr, "base64");
50054
50054
  };
50055
50055
  function InternalEncoderCesu8(options, codec) {
50056
50056
  }
50057
50057
  InternalEncoderCesu8.prototype.write = function(str) {
50058
- var buf = Buffer3.alloc(str.length * 3), bufIdx = 0;
50058
+ var buf = Buffer4.alloc(str.length * 3), bufIdx = 0;
50059
50059
  for (var i = 0; i < str.length; i++) {
50060
50060
  var charCode = str.charCodeAt(i);
50061
50061
  if (charCode < 128)
@@ -50137,7 +50137,7 @@ var require_internal = __commonJS({
50137
50137
  var require_utf32 = __commonJS({
50138
50138
  "node_modules/iconv-lite/encodings/utf32.js"(exports2) {
50139
50139
  "use strict";
50140
- var Buffer3 = require_safer().Buffer;
50140
+ var Buffer4 = require_safer().Buffer;
50141
50141
  exports2._utf32 = Utf32Codec;
50142
50142
  function Utf32Codec(codecOptions, iconv) {
50143
50143
  this.iconv = iconv;
@@ -50155,8 +50155,8 @@ var require_utf32 = __commonJS({
50155
50155
  this.highSurrogate = 0;
50156
50156
  }
50157
50157
  Utf32Encoder.prototype.write = function(str) {
50158
- var src = Buffer3.from(str, "ucs2");
50159
- var dst = Buffer3.alloc(src.length * 2);
50158
+ var src = Buffer4.from(str, "ucs2");
50159
+ var dst = Buffer4.alloc(src.length * 2);
50160
50160
  var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
50161
50161
  var offset = 0;
50162
50162
  for (var i = 0; i < src.length; i += 2) {
@@ -50190,7 +50190,7 @@ var require_utf32 = __commonJS({
50190
50190
  Utf32Encoder.prototype.end = function() {
50191
50191
  if (!this.highSurrogate)
50192
50192
  return;
50193
- var buf = Buffer3.alloc(4);
50193
+ var buf = Buffer4.alloc(4);
50194
50194
  if (this.isLE)
50195
50195
  buf.writeUInt32LE(this.highSurrogate, 0);
50196
50196
  else
@@ -50208,7 +50208,7 @@ var require_utf32 = __commonJS({
50208
50208
  return "";
50209
50209
  var i = 0;
50210
50210
  var codepoint = 0;
50211
- var dst = Buffer3.alloc(src.length + 4);
50211
+ var dst = Buffer4.alloc(src.length + 4);
50212
50212
  var offset = 0;
50213
50213
  var isLE = this.isLE;
50214
50214
  var overflow = this.overflow;
@@ -50362,7 +50362,7 @@ var require_utf32 = __commonJS({
50362
50362
  var require_utf16 = __commonJS({
50363
50363
  "node_modules/iconv-lite/encodings/utf16.js"(exports2) {
50364
50364
  "use strict";
50365
- var Buffer3 = require_safer().Buffer;
50365
+ var Buffer4 = require_safer().Buffer;
50366
50366
  exports2.utf16be = Utf16BECodec;
50367
50367
  function Utf16BECodec() {
50368
50368
  }
@@ -50372,7 +50372,7 @@ var require_utf16 = __commonJS({
50372
50372
  function Utf16BEEncoder() {
50373
50373
  }
50374
50374
  Utf16BEEncoder.prototype.write = function(str) {
50375
- var buf = Buffer3.from(str, "ucs2");
50375
+ var buf = Buffer4.from(str, "ucs2");
50376
50376
  for (var i = 0; i < buf.length; i += 2) {
50377
50377
  var tmp = buf[i];
50378
50378
  buf[i] = buf[i + 1];
@@ -50388,7 +50388,7 @@ var require_utf16 = __commonJS({
50388
50388
  Utf16BEDecoder.prototype.write = function(buf) {
50389
50389
  if (buf.length == 0)
50390
50390
  return "";
50391
- var buf2 = Buffer3.alloc(buf.length + 1), i = 0, j2 = 0;
50391
+ var buf2 = Buffer4.alloc(buf.length + 1), i = 0, j2 = 0;
50392
50392
  if (this.overflowByte !== -1) {
50393
50393
  buf2[0] = buf[0];
50394
50394
  buf2[1] = this.overflowByte;
@@ -50502,7 +50502,7 @@ var require_utf16 = __commonJS({
50502
50502
  var require_utf7 = __commonJS({
50503
50503
  "node_modules/iconv-lite/encodings/utf7.js"(exports2) {
50504
50504
  "use strict";
50505
- var Buffer3 = require_safer().Buffer;
50505
+ var Buffer4 = require_safer().Buffer;
50506
50506
  exports2.utf7 = Utf7Codec;
50507
50507
  exports2.unicode11utf7 = "utf7";
50508
50508
  function Utf7Codec(codecOptions, iconv) {
@@ -50516,7 +50516,7 @@ var require_utf7 = __commonJS({
50516
50516
  this.iconv = codec.iconv;
50517
50517
  }
50518
50518
  Utf7Encoder.prototype.write = function(str) {
50519
- return Buffer3.from(str.replace(nonDirectChars, function(chunk) {
50519
+ return Buffer4.from(str.replace(nonDirectChars, function(chunk) {
50520
50520
  return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
50521
50521
  }.bind(this)));
50522
50522
  };
@@ -50550,7 +50550,7 @@ var require_utf7 = __commonJS({
50550
50550
  res += "+";
50551
50551
  } else {
50552
50552
  var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii");
50553
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
50553
+ res += this.iconv.decode(Buffer4.from(b64str, "base64"), "utf16-be");
50554
50554
  }
50555
50555
  if (buf[i2] != minusChar)
50556
50556
  i2--;
@@ -50567,7 +50567,7 @@ var require_utf7 = __commonJS({
50567
50567
  var canBeDecoded = b64str.length - b64str.length % 8;
50568
50568
  base64Accum = b64str.slice(canBeDecoded);
50569
50569
  b64str = b64str.slice(0, canBeDecoded);
50570
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
50570
+ res += this.iconv.decode(Buffer4.from(b64str, "base64"), "utf16-be");
50571
50571
  }
50572
50572
  this.inBase64 = inBase64;
50573
50573
  this.base64Accum = base64Accum;
@@ -50576,7 +50576,7 @@ var require_utf7 = __commonJS({
50576
50576
  Utf7Decoder.prototype.end = function() {
50577
50577
  var res = "";
50578
50578
  if (this.inBase64 && this.base64Accum.length > 0)
50579
- res = this.iconv.decode(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
50579
+ res = this.iconv.decode(Buffer4.from(this.base64Accum, "base64"), "utf16-be");
50580
50580
  this.inBase64 = false;
50581
50581
  this.base64Accum = "";
50582
50582
  return res;
@@ -50591,11 +50591,11 @@ var require_utf7 = __commonJS({
50591
50591
  function Utf7IMAPEncoder(options, codec) {
50592
50592
  this.iconv = codec.iconv;
50593
50593
  this.inBase64 = false;
50594
- this.base64Accum = Buffer3.alloc(6);
50594
+ this.base64Accum = Buffer4.alloc(6);
50595
50595
  this.base64AccumIdx = 0;
50596
50596
  }
50597
50597
  Utf7IMAPEncoder.prototype.write = function(str) {
50598
- var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer3.alloc(str.length * 5 + 10), bufIdx = 0;
50598
+ var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer4.alloc(str.length * 5 + 10), bufIdx = 0;
50599
50599
  for (var i2 = 0; i2 < str.length; i2++) {
50600
50600
  var uChar = str.charCodeAt(i2);
50601
50601
  if (32 <= uChar && uChar <= 126) {
@@ -50632,7 +50632,7 @@ var require_utf7 = __commonJS({
50632
50632
  return buf.slice(0, bufIdx);
50633
50633
  };
50634
50634
  Utf7IMAPEncoder.prototype.end = function() {
50635
- var buf = Buffer3.alloc(10), bufIdx = 0;
50635
+ var buf = Buffer4.alloc(10), bufIdx = 0;
50636
50636
  if (this.inBase64) {
50637
50637
  if (this.base64AccumIdx > 0) {
50638
50638
  bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx);
@@ -50665,7 +50665,7 @@ var require_utf7 = __commonJS({
50665
50665
  res += "&";
50666
50666
  } else {
50667
50667
  var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii").replace(/,/g, "/");
50668
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
50668
+ res += this.iconv.decode(Buffer4.from(b64str, "base64"), "utf16-be");
50669
50669
  }
50670
50670
  if (buf[i2] != minusChar)
50671
50671
  i2--;
@@ -50682,7 +50682,7 @@ var require_utf7 = __commonJS({
50682
50682
  var canBeDecoded = b64str.length - b64str.length % 8;
50683
50683
  base64Accum = b64str.slice(canBeDecoded);
50684
50684
  b64str = b64str.slice(0, canBeDecoded);
50685
- res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
50685
+ res += this.iconv.decode(Buffer4.from(b64str, "base64"), "utf16-be");
50686
50686
  }
50687
50687
  this.inBase64 = inBase64;
50688
50688
  this.base64Accum = base64Accum;
@@ -50691,7 +50691,7 @@ var require_utf7 = __commonJS({
50691
50691
  Utf7IMAPDecoder.prototype.end = function() {
50692
50692
  var res = "";
50693
50693
  if (this.inBase64 && this.base64Accum.length > 0)
50694
- res = this.iconv.decode(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
50694
+ res = this.iconv.decode(Buffer4.from(this.base64Accum, "base64"), "utf16-be");
50695
50695
  this.inBase64 = false;
50696
50696
  this.base64Accum = "";
50697
50697
  return res;
@@ -50703,7 +50703,7 @@ var require_utf7 = __commonJS({
50703
50703
  var require_sbcs_codec = __commonJS({
50704
50704
  "node_modules/iconv-lite/encodings/sbcs-codec.js"(exports2) {
50705
50705
  "use strict";
50706
- var Buffer3 = require_safer().Buffer;
50706
+ var Buffer4 = require_safer().Buffer;
50707
50707
  exports2._sbcs = SBCSCodec;
50708
50708
  function SBCSCodec(codecOptions, iconv) {
50709
50709
  if (!codecOptions)
@@ -50716,8 +50716,8 @@ var require_sbcs_codec = __commonJS({
50716
50716
  asciiString += String.fromCharCode(i);
50717
50717
  codecOptions.chars = asciiString + codecOptions.chars;
50718
50718
  }
50719
- this.decodeBuf = Buffer3.from(codecOptions.chars, "ucs2");
50720
- var encodeBuf = Buffer3.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
50719
+ this.decodeBuf = Buffer4.from(codecOptions.chars, "ucs2");
50720
+ var encodeBuf = Buffer4.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
50721
50721
  for (var i = 0; i < codecOptions.chars.length; i++)
50722
50722
  encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
50723
50723
  this.encodeBuf = encodeBuf;
@@ -50728,7 +50728,7 @@ var require_sbcs_codec = __commonJS({
50728
50728
  this.encodeBuf = codec.encodeBuf;
50729
50729
  }
50730
50730
  SBCSEncoder.prototype.write = function(str) {
50731
- var buf = Buffer3.alloc(str.length);
50731
+ var buf = Buffer4.alloc(str.length);
50732
50732
  for (var i = 0; i < str.length; i++)
50733
50733
  buf[i] = this.encodeBuf[str.charCodeAt(i)];
50734
50734
  return buf;
@@ -50740,7 +50740,7 @@ var require_sbcs_codec = __commonJS({
50740
50740
  }
50741
50741
  SBCSDecoder.prototype.write = function(buf) {
50742
50742
  var decodeBuf = this.decodeBuf;
50743
- var newBuf = Buffer3.alloc(buf.length * 2);
50743
+ var newBuf = Buffer4.alloc(buf.length * 2);
50744
50744
  var idx1 = 0, idx2 = 0;
50745
50745
  for (var i = 0; i < buf.length; i++) {
50746
50746
  idx1 = buf[i] * 2;
@@ -51367,7 +51367,7 @@ var require_sbcs_data_generated = __commonJS({
51367
51367
  var require_dbcs_codec = __commonJS({
51368
51368
  "node_modules/iconv-lite/encodings/dbcs-codec.js"(exports2) {
51369
51369
  "use strict";
51370
- var Buffer3 = require_safer().Buffer;
51370
+ var Buffer4 = require_safer().Buffer;
51371
51371
  exports2._dbcs = DBCSCodec;
51372
51372
  var UNASSIGNED = -1;
51373
51373
  var GB18030_CODE = -2;
@@ -51582,7 +51582,7 @@ var require_dbcs_codec = __commonJS({
51582
51582
  this.gb18030 = codec.gb18030;
51583
51583
  }
51584
51584
  DBCSEncoder.prototype.write = function(str) {
51585
- var newBuf = Buffer3.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0, j2 = 0;
51585
+ var newBuf = Buffer4.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0, j2 = 0;
51586
51586
  while (true) {
51587
51587
  if (nextChar === -1) {
51588
51588
  if (i2 == str.length)
@@ -51679,7 +51679,7 @@ var require_dbcs_codec = __commonJS({
51679
51679
  DBCSEncoder.prototype.end = function() {
51680
51680
  if (this.leadSurrogate === -1 && this.seqObj === void 0)
51681
51681
  return;
51682
- var newBuf = Buffer3.alloc(10), j2 = 0;
51682
+ var newBuf = Buffer4.alloc(10), j2 = 0;
51683
51683
  if (this.seqObj) {
51684
51684
  var dbcsCode = this.seqObj[DEF_CHAR];
51685
51685
  if (dbcsCode !== void 0) {
@@ -51709,7 +51709,7 @@ var require_dbcs_codec = __commonJS({
51709
51709
  this.gb18030 = codec.gb18030;
51710
51710
  }
51711
51711
  DBCSDecoder.prototype.write = function(buf) {
51712
- var newBuf = Buffer3.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
51712
+ var newBuf = Buffer4.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
51713
51713
  for (var i2 = 0, j2 = 0; i2 < buf.length; i2++) {
51714
51714
  var curByte = i2 >= 0 ? buf[i2] : prevBytes[i2 + prevOffset];
51715
51715
  var uCode = this.decodeTables[nodeIdx][curByte];
@@ -53310,7 +53310,7 @@ var require_encodings = __commonJS({
53310
53310
  var require_streams = __commonJS({
53311
53311
  "node_modules/iconv-lite/lib/streams.js"(exports2, module2) {
53312
53312
  "use strict";
53313
- var Buffer3 = require_safer().Buffer;
53313
+ var Buffer4 = require_safer().Buffer;
53314
53314
  module2.exports = function(stream_module) {
53315
53315
  var Transform = stream_module.Transform;
53316
53316
  function IconvLiteEncoderStream(conv, options) {
@@ -53351,7 +53351,7 @@ var require_streams = __commonJS({
53351
53351
  chunks.push(chunk);
53352
53352
  });
53353
53353
  this.on("end", function() {
53354
- cb(null, Buffer3.concat(chunks));
53354
+ cb(null, Buffer4.concat(chunks));
53355
53355
  });
53356
53356
  return this;
53357
53357
  };
@@ -53365,7 +53365,7 @@ var require_streams = __commonJS({
53365
53365
  constructor: { value: IconvLiteDecoderStream }
53366
53366
  });
53367
53367
  IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
53368
- if (!Buffer3.isBuffer(chunk) && !(chunk instanceof Uint8Array))
53368
+ if (!Buffer4.isBuffer(chunk) && !(chunk instanceof Uint8Array))
53369
53369
  return done(new Error("Iconv decoding stream needs buffers as its input."));
53370
53370
  try {
53371
53371
  var res = this.conv.write(chunk);
@@ -53409,7 +53409,7 @@ var require_streams = __commonJS({
53409
53409
  var require_lib6 = __commonJS({
53410
53410
  "node_modules/iconv-lite/lib/index.js"(exports2, module2) {
53411
53411
  "use strict";
53412
- var Buffer3 = require_safer().Buffer;
53412
+ var Buffer4 = require_safer().Buffer;
53413
53413
  var bomHandling = require_bom_handling();
53414
53414
  var iconv = module2.exports;
53415
53415
  iconv.encodings = null;
@@ -53420,7 +53420,7 @@ var require_lib6 = __commonJS({
53420
53420
  var encoder = iconv.getEncoder(encoding, options);
53421
53421
  var res = encoder.write(str);
53422
53422
  var trail = encoder.end();
53423
- return trail && trail.length > 0 ? Buffer3.concat([res, trail]) : res;
53423
+ return trail && trail.length > 0 ? Buffer4.concat([res, trail]) : res;
53424
53424
  };
53425
53425
  iconv.decode = function decode(buf, encoding, options) {
53426
53426
  if (typeof buf === "string") {
@@ -53428,7 +53428,7 @@ var require_lib6 = __commonJS({
53428
53428
  console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
53429
53429
  iconv.skipDecodeWarning = true;
53430
53430
  }
53431
- buf = Buffer3.from("" + (buf || ""), "binary");
53431
+ buf = Buffer4.from("" + (buf || ""), "binary");
53432
53432
  }
53433
53433
  var decoder = iconv.getDecoder(encoding, options);
53434
53434
  var res = decoder.write(buf);
@@ -60015,9 +60015,9 @@ var require_ci_info = __commonJS({
60015
60015
  }
60016
60016
  });
60017
60017
 
60018
- // node_modules/mimic-fn/index.js
60018
+ // node_modules/restore-cursor/node_modules/onetime/node_modules/mimic-fn/index.js
60019
60019
  var require_mimic_fn = __commonJS({
60020
- "node_modules/mimic-fn/index.js"(exports2, module2) {
60020
+ "node_modules/restore-cursor/node_modules/onetime/node_modules/mimic-fn/index.js"(exports2, module2) {
60021
60021
  "use strict";
60022
60022
  var mimicFn = (to, from) => {
60023
60023
  for (const prop of Reflect.ownKeys(from)) {
@@ -60030,9 +60030,9 @@ var require_mimic_fn = __commonJS({
60030
60030
  }
60031
60031
  });
60032
60032
 
60033
- // node_modules/onetime/index.js
60033
+ // node_modules/restore-cursor/node_modules/onetime/index.js
60034
60034
  var require_onetime = __commonJS({
60035
- "node_modules/onetime/index.js"(exports2, module2) {
60035
+ "node_modules/restore-cursor/node_modules/onetime/index.js"(exports2, module2) {
60036
60036
  "use strict";
60037
60037
  var mimicFn = require_mimic_fn();
60038
60038
  var calledFunctions = /* @__PURE__ */ new WeakMap();
@@ -61134,9 +61134,108 @@ var {
61134
61134
  Help
61135
61135
  } = import_index.default;
61136
61136
 
61137
+ // package.json
61138
+ var package_default = {
61139
+ name: "@capgo/cli",
61140
+ version: "4.0.14",
61141
+ description: "A CLI to upload to capgo servers",
61142
+ main: "dist/index.js",
61143
+ bin: {
61144
+ capgo: "dist/index.js"
61145
+ },
61146
+ repository: {
61147
+ type: "git",
61148
+ url: "git+https://github.com/Cap-go/CLI.git"
61149
+ },
61150
+ bugs: {
61151
+ url: "https://github.com/Cap-go/CLI/issues"
61152
+ },
61153
+ homepage: "https://github.com/Cap-go/CLIl#readme",
61154
+ engines: {
61155
+ npm: ">=8.0.0",
61156
+ node: ">=20.0.0"
61157
+ },
61158
+ keywords: [
61159
+ "appflow alternative",
61160
+ "ionic",
61161
+ "capacitor",
61162
+ "auto update",
61163
+ "live update",
61164
+ "capgo",
61165
+ "cli",
61166
+ "upload",
61167
+ "capgo-cli"
61168
+ ],
61169
+ scripts: {
61170
+ build: "node build.mjs",
61171
+ dev: "NODE_ENV=development node build.mjs",
61172
+ "no-debug": "node dist/index.js",
61173
+ test: "npx --yes ts-node -T src/index.ts",
61174
+ "dev-build": "SUPA_DB=development node build.mjs",
61175
+ pack: "pkg",
61176
+ types: "npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",
61177
+ test_rls: "ts-node ./test/test_headers_rls.ts",
61178
+ lint: 'eslint "src/**/*.ts" --fix'
61179
+ },
61180
+ author: "github.com/riderx",
61181
+ license: "Apache 2.0",
61182
+ dependencies: {
61183
+ "@capacitor/cli": "5.7.0",
61184
+ "@capgo/find-package-manager": "0.0.10",
61185
+ "@clack/prompts": "^0.7.0",
61186
+ "@supabase/supabase-js": "^2.39.3",
61187
+ "@tomasklaen/checksum": "^1.1.0",
61188
+ "@trufflesuite/spinnies": "^0.1.1",
61189
+ "adm-zip": "^0.5.10",
61190
+ "ci-info": "^4.0.0",
61191
+ commander: "12.0.0",
61192
+ "console-table-printer": "^2.12.0",
61193
+ "get-latest-version": "^5.1.0",
61194
+ ky: "^1.2.0",
61195
+ logsnag: "1.0.0",
61196
+ mime: "^4.0.1",
61197
+ "node-dir": "^0.1.17",
61198
+ open: "^10.0.3",
61199
+ prettyjson: "^1.2.5",
61200
+ "prompt-sync": "^4.2.0",
61201
+ qrcode: "^1.5.3",
61202
+ semver: "^7.6.0"
61203
+ },
61204
+ devDependencies: {
61205
+ "@antfu/eslint-config": "^2.6.4",
61206
+ "@types/adm-zip": "0.5.5",
61207
+ "@types/mime": "^3.0.4",
61208
+ "@types/node": "^20.11.17",
61209
+ "@types/node-dir": "^0.0.37",
61210
+ "@types/npmcli__ci-detect": "^2.0.3",
61211
+ "@types/prettyjson": "^0.0.33",
61212
+ "@types/prompt-sync": "^4.2.3",
61213
+ "@types/qrcode": "^1.5.5",
61214
+ "@types/semver": "^7.5.6",
61215
+ "@typescript-eslint/eslint-plugin": "6.21.0",
61216
+ "@typescript-eslint/parser": "6.21.0",
61217
+ esbuild: "^0.20.0",
61218
+ eslint: "8.56.0",
61219
+ "eslint-config-airbnb-base": "^15.0.0",
61220
+ "eslint-config-prettier": "^9.1.0",
61221
+ "eslint-import-resolver-typescript": "3.6.1",
61222
+ "eslint-plugin-import": "2.29.1",
61223
+ "eslint-plugin-prettier": "^5.1.3",
61224
+ "git-format-staged": "3.0.0",
61225
+ husky: "^9.0.10",
61226
+ pkg: "5.8.1",
61227
+ prettier: "3.2.5",
61228
+ "ts-loader": "^9.5.1",
61229
+ "ts-node": "^10.9.2",
61230
+ "tsconfig-paths": "4.2.0",
61231
+ typescript: "5.3.3"
61232
+ }
61233
+ };
61234
+
61137
61235
  // src/bundle/zip.ts
61138
61236
  var import_node_crypto = require("node:crypto");
61139
61237
  var import_node_fs6 = require("node:fs");
61238
+ var import_node_process9 = __toESM(require("node:process"));
61140
61239
  var import_adm_zip = __toESM(require_adm_zip());
61141
61240
 
61142
61241
  // node_modules/@clack/core/dist/index.mjs
@@ -61657,106 +61756,7 @@ var import_checksum = __toESM(require_dist());
61657
61756
 
61658
61757
  // src/api/update.ts
61659
61758
  var import_get_latest_version = __toESM(require_src3());
61660
-
61661
- // package.json
61662
- var package_default = {
61663
- name: "@capgo/cli",
61664
- version: "4.0.12",
61665
- description: "A CLI to upload to capgo servers",
61666
- main: "dist/index.js",
61667
- bin: {
61668
- capgo: "dist/index.js"
61669
- },
61670
- repository: {
61671
- type: "git",
61672
- url: "git+https://github.com/Cap-go/CLI.git"
61673
- },
61674
- bugs: {
61675
- url: "https://github.com/Cap-go/CLI/issues"
61676
- },
61677
- homepage: "https://github.com/Cap-go/CLIl#readme",
61678
- engines: {
61679
- npm: ">=8.0.0",
61680
- node: ">=20.0.0"
61681
- },
61682
- keywords: [
61683
- "appflow alternative",
61684
- "ionic",
61685
- "capacitor",
61686
- "auto update",
61687
- "live update",
61688
- "capgo",
61689
- "cli",
61690
- "upload",
61691
- "capgo-cli"
61692
- ],
61693
- scripts: {
61694
- build: "node build.mjs",
61695
- dev: "NODE_ENV=development node build.mjs",
61696
- "no-debug": "node dist/index.js",
61697
- test: "npx --yes ts-node -T src/index.ts",
61698
- "dev-build": "SUPA_DB=development node build.mjs",
61699
- pack: "pkg",
61700
- types: "npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",
61701
- test_rls: "ts-node ./test/test_headers_rls.ts",
61702
- lint: "eslint . --ext .ts --fix"
61703
- },
61704
- author: "github.com/riderx",
61705
- license: "Apache 2.0",
61706
- dependencies: {
61707
- "@capacitor/cli": "5.7.0",
61708
- "@capgo/find-package-manager": "0.0.10",
61709
- "@clack/prompts": "^0.7.0",
61710
- "@supabase/supabase-js": "^2.39.3",
61711
- "@tomasklaen/checksum": "^1.1.0",
61712
- "@trufflesuite/spinnies": "^0.1.1",
61713
- "adm-zip": "^0.5.10",
61714
- "ci-info": "^4.0.0",
61715
- commander: "12.0.0",
61716
- "console-table-printer": "^2.12.0",
61717
- "get-latest-version": "^5.1.0",
61718
- ky: "^1.2.0",
61719
- logsnag: "1.0.0",
61720
- mime: "^4.0.1",
61721
- "node-dir": "^0.1.17",
61722
- open: "^10.0.3",
61723
- prettyjson: "^1.2.5",
61724
- "prompt-sync": "^4.2.0",
61725
- qrcode: "^1.5.3",
61726
- semver: "^7.6.0"
61727
- },
61728
- devDependencies: {
61729
- "@types/adm-zip": "0.5.5",
61730
- "@types/mime": "^3.0.4",
61731
- "@types/node": "^20.11.17",
61732
- "@types/node-dir": "^0.0.37",
61733
- "@types/npmcli__ci-detect": "^2.0.3",
61734
- "@types/prettyjson": "^0.0.33",
61735
- "@types/prompt-sync": "^4.2.3",
61736
- "@types/qrcode": "^1.5.5",
61737
- "@types/semver": "^7.5.6",
61738
- "@typescript-eslint/eslint-plugin": "6.21.0",
61739
- "@typescript-eslint/parser": "6.21.0",
61740
- esbuild: "^0.20.0",
61741
- eslint: "8.56.0",
61742
- "eslint-config-airbnb-base": "^15.0.0",
61743
- "eslint-config-prettier": "^9.1.0",
61744
- "eslint-import-resolver-typescript": "3.6.1",
61745
- "eslint-plugin-import": "2.29.1",
61746
- "eslint-plugin-prettier": "^5.1.3",
61747
- "git-format-staged": "3.0.0",
61748
- husky: "^9.0.10",
61749
- pkg: "5.8.1",
61750
- prettier: "3.2.5",
61751
- "ts-loader": "^9.5.1",
61752
- "ts-node": "^10.9.2",
61753
- "tsconfig-paths": "4.2.0",
61754
- typescript: "5.3.3"
61755
- }
61756
- };
61757
-
61758
- // src/api/update.ts
61759
- var checkLatest = async () => {
61759
+ async function checkLatest() {
61760
61760
  const latest = await (0, import_get_latest_version.default)("@capgo/cli");
61761
61761
  if (latest !== package_default.version) {
61762
61762
  f2.warning(
@@ -61764,12 +61764,13 @@ var checkLatest = async () => {
61764
61764
  Please use @capgo/cli@${latest}" or @capgo/cli@latest to keep up to date with the latest features and bug fixes.`
61765
61765
  );
61766
61766
  }
61767
- };
61767
+ }
61768
61768
 
61769
61769
  // src/utils.ts
61770
61770
  var import_node_fs4 = require("node:fs");
61771
61771
  var import_node_os2 = require("node:os");
61772
61772
  var import_node_path2 = require("node:path");
61773
+ var import_node_process8 = __toESM(require("node:process"));
61773
61774
  var import_config = __toESM(require_config());
61774
61775
  var import_supabase_js = __toESM(require_main6());
61775
61776
  var import_prettyjson = __toESM(require_prettyjson());
@@ -62309,7 +62310,9 @@ var defaultHost = "https://capgo.app";
62309
62310
  var defaultApiHost = "https://api.capgo.app";
62310
62311
  var defaultHostWeb = "https://web.capgo.app";
62311
62312
  var regexSemver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
62312
- var getConfig = async () => {
62313
+ var formatError = (error) => error ? `
62314
+ ${import_prettyjson.default.render(error)}` : "";
62315
+ async function getConfig() {
62313
62316
  let config;
62314
62317
  try {
62315
62318
  config = await (0, import_config.loadConfig)();
@@ -62318,8 +62321,8 @@ var getConfig = async () => {
62318
62321
  program.error("");
62319
62322
  }
62320
62323
  return config;
62321
- };
62322
- var getLocalConfig = async () => {
62324
+ }
62325
+ async function getLocalConfig() {
62323
62326
  try {
62324
62327
  const config = await getConfig();
62325
62328
  const capConfig = {
@@ -62338,16 +62341,16 @@ var getLocalConfig = async () => {
62338
62341
  hostWeb: defaultHostWeb
62339
62342
  };
62340
62343
  }
62341
- };
62344
+ }
62342
62345
  var nativeFileRegex = /([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;
62343
- var getRemoteConfig = async () => {
62346
+ async function getRemoteConfig() {
62344
62347
  const localConfig = await getLocalConfig();
62345
62348
  return distribution_default.get(`${defaultApiHost}/private/config`).then((res) => res.json()).then((data) => ({ ...data, ...localConfig })).catch(() => {
62346
- console.log("Local config", localConfig);
62349
+ f2.info(`Local config ${formatError(localConfig)}`);
62347
62350
  return localConfig;
62348
62351
  });
62349
- };
62350
- var createSupabaseClient = async (apikey) => {
62352
+ }
62353
+ async function createSupabaseClient(apikey) {
62351
62354
  const config = await getRemoteConfig();
62352
62355
  if (!config.supaHost || !config.supaKey) {
62353
62356
  f2.error("Cannot connect to server please try again later");
@@ -62363,47 +62366,46 @@ var createSupabaseClient = async (apikey) => {
62363
62366
  }
62364
62367
  }
62365
62368
  });
62366
- };
62367
- var checkKey = async (supabase, apikey, keymode) => {
62369
+ }
62370
+ async function checkKey(supabase, apikey, keymode) {
62368
62371
  const { data: apiAccess } = await supabase.rpc("is_allowed_capgkey", { apikey, keymode }).single();
62369
62372
  if (!apiAccess) {
62370
62373
  f2.error(`Invalid API key or insufficient permissions.`);
62371
62374
  const keymodeStr = keymode.map((k2, i) => {
62372
- if (i === keymode.length - 1) {
62375
+ if (i === keymode.length - 1)
62373
62376
  return `or ${k2}`;
62374
- }
62375
62377
  return `${k2}, `;
62376
62378
  }).join("");
62377
62379
  f2.error(`Your key should be: ${keymodeStr} mode.`);
62378
62380
  program.error("");
62379
62381
  }
62380
- };
62381
- var isPaying = async (supabase, userId) => {
62382
+ }
62383
+ async function isPaying(supabase, userId) {
62382
62384
  const { data } = await supabase.rpc("is_paying", { userid: userId }).single();
62383
62385
  return data || false;
62384
- };
62385
- var isTrial = async (supabase, userId) => {
62386
+ }
62387
+ async function isTrial(supabase, userId) {
62386
62388
  const { data } = await supabase.rpc("is_trial", { userid: userId }).single();
62387
62389
  return data || 0;
62388
- };
62389
- var isAllowedActionAppIdApiKey = async (supabase, appId, apikey) => {
62390
+ }
62391
+ async function isAllowedActionAppIdApiKey(supabase, appId, apikey) {
62390
62392
  const { data } = await supabase.rpc("is_allowed_action", { apikey, appid: appId }).single();
62391
62393
  return !!data;
62392
- };
62393
- var getAppOwner = async (supabase, appId) => {
62394
+ }
62395
+ async function getAppOwner(supabase, appId) {
62394
62396
  const { data, error } = await supabase.from("apps").select("user_id").eq("app_id", appId).single();
62395
62397
  if (error) {
62396
62398
  f2.error("Cannot get app owner, exiting");
62397
62399
  f2.error("Please report the following error to capgo's staff");
62398
62400
  console.error(error);
62399
- process.exit(1);
62401
+ import_node_process8.default.exit(1);
62400
62402
  }
62401
62403
  return data.user_id;
62402
- };
62403
- var isAllowedApp = async (supabase, apikey, appId) => {
62404
+ }
62405
+ async function isAllowedApp(supabase, apikey, appId) {
62404
62406
  const { data } = await supabase.rpc("is_app_owner", { apikey, appid: appId }).single();
62405
62407
  return !!data;
62406
- };
62408
+ }
62407
62409
  var OrganizationPerm = /* @__PURE__ */ ((OrganizationPerm2) => {
62408
62410
  OrganizationPerm2[OrganizationPerm2["none"] = 0] = "none";
62409
62411
  OrganizationPerm2[OrganizationPerm2["read"] = 1] = "read";
@@ -62414,12 +62416,12 @@ var OrganizationPerm = /* @__PURE__ */ ((OrganizationPerm2) => {
62414
62416
  return OrganizationPerm2;
62415
62417
  })(OrganizationPerm || {});
62416
62418
  var hasOrganizationPerm = (perm, required) => perm >= required;
62417
- var isAllowedAppOrg = async (supabase, apikey, appId) => {
62419
+ async function isAllowedAppOrg(supabase, apikey, appId) {
62418
62420
  const { data, error } = await supabase.rpc("get_org_perm_for_apikey", { apikey, app_id: appId }).single();
62419
62421
  if (error) {
62420
62422
  f2.error("Cannot get permissions for organization!");
62421
62423
  console.error(error);
62422
- process.exit(1);
62424
+ import_node_process8.default.exit(1);
62423
62425
  }
62424
62426
  const ok = data.includes("perm");
62425
62427
  if (ok) {
@@ -62452,10 +62454,10 @@ var isAllowedAppOrg = async (supabase, apikey, appId) => {
62452
62454
  default: {
62453
62455
  if (data.includes("invite")) {
62454
62456
  f2.info("Please accept/deny the organization invitation before trying to access the app");
62455
- process.exit(1);
62457
+ import_node_process8.default.exit(1);
62456
62458
  }
62457
62459
  f2.error(`Invalid output when fetching organization permission. Response: ${data}`);
62458
- process.exit(1);
62460
+ import_node_process8.default.exit(1);
62459
62461
  }
62460
62462
  }
62461
62463
  return {
@@ -62479,15 +62481,15 @@ var isAllowedAppOrg = async (supabase, apikey, appId) => {
62479
62481
  }
62480
62482
  default: {
62481
62483
  f2.error(`Invalid error when fetching organization permission. Response: ${data}`);
62482
- process.exit(1);
62484
+ import_node_process8.default.exit(1);
62483
62485
  }
62484
62486
  }
62485
62487
  return {
62486
62488
  okay: false,
62487
62489
  error: functionError
62488
62490
  };
62489
- };
62490
- var checkPlanValid = async (supabase, userId, appId, apikey, warning = true) => {
62491
+ }
62492
+ async function checkPlanValid(supabase, userId, appId, apikey, warning = true) {
62491
62493
  const config = await getRemoteConfig();
62492
62494
  const validPlan = await isAllowedActionAppIdApiKey(supabase, appId, apikey);
62493
62495
  if (!validPlan) {
@@ -62503,13 +62505,12 @@ var checkPlanValid = async (supabase, userId, appId, apikey, warning = true) =>
62503
62505
  }
62504
62506
  const trialDays = await isTrial(supabase, userId);
62505
62507
  const ispaying = await isPaying(supabase, userId);
62506
- if (trialDays > 0 && warning && !ispaying) {
62508
+ if (trialDays > 0 && warning && !ispaying)
62507
62509
  f2.warn(`WARNING !!
62508
62510
  Trial expires in ${trialDays} days, upgrade here: ${config.hostWeb}/dashboard/settings/plans
62509
62511
  `);
62510
- }
62511
- };
62512
- var findSavedKey = (quiet = false) => {
62512
+ }
62513
+ function findSavedKey(quiet = false) {
62513
62514
  const userHomeDir = (0, import_node_os2.homedir)();
62514
62515
  let key2;
62515
62516
  let keyPath = `${userHomeDir}/.capgo`;
@@ -62529,22 +62530,21 @@ var findSavedKey = (quiet = false) => {
62529
62530
  program.error("");
62530
62531
  }
62531
62532
  return key2;
62532
- };
62533
+ }
62533
62534
  async function* getFiles(dir) {
62534
62535
  const dirents = await (0, import_node_fs4.readdirSync)(dir, { withFileTypes: true });
62535
62536
  for (const dirent of dirents) {
62536
62537
  const res = (0, import_node_path2.resolve)(dir, dirent.name);
62537
- if (dirent.isDirectory() && !dirent.name.startsWith(".") && !dirent.name.startsWith("node_modules") && !dirent.name.startsWith("dist")) {
62538
+ if (dirent.isDirectory() && !dirent.name.startsWith(".") && !dirent.name.startsWith("node_modules") && !dirent.name.startsWith("dist"))
62538
62539
  yield* getFiles(res);
62539
- } else {
62540
+ else
62540
62541
  yield res;
62541
- }
62542
62542
  }
62543
62543
  }
62544
- var findMainFile = async () => {
62544
+ async function findMainFile() {
62545
62545
  const mainRegex = /(main|index)\.(ts|tsx|js|jsx)$/;
62546
62546
  let mainFile = "";
62547
- const pwd = process.cwd();
62547
+ const pwd = import_node_process8.default.cwd();
62548
62548
  const pwdL = pwd.split("/").length;
62549
62549
  for await (const f3 of getFiles(pwd)) {
62550
62550
  const folders = f3.split("/").length - pwdL;
@@ -62555,13 +62555,10 @@ var findMainFile = async () => {
62555
62555
  }
62556
62556
  }
62557
62557
  return mainFile;
62558
- };
62559
- var formatError = (error) => error ? `
62560
- ${import_prettyjson.default.render(error)}` : "";
62561
- var updateOrCreateVersion = async (supabase, update, apikey) => (
62562
- // console.log('updateOrCreateVersion', update, apikey)
62563
- supabase.from("app_versions").upsert(update, { onConflict: "name,app_id" }).eq("app_id", update.app_id).eq("name", update.name)
62564
- );
62558
+ }
62559
+ async function updateOrCreateVersion(supabase, update) {
62560
+ return supabase.from("app_versions").upsert(update, { onConflict: "name,app_id" }).eq("app_id", update.app_id).eq("name", update.name);
62561
+ }
62565
62562
  async function uploadUrl(supabase, appId, bucketId) {
62566
62563
  const data = {
62567
62564
  app_id: appId,
@@ -62572,11 +62569,11 @@ async function uploadUrl(supabase, appId, bucketId) {
62572
62569
  const res = await supabase.functions.invoke(pathUploadLink, { body: JSON.stringify(data) });
62573
62570
  return res.data.url;
62574
62571
  } catch (error) {
62575
- f2.error(`Cannot get upload url ${JSON.stringify(error)}`);
62572
+ f2.error(`Cannot get upload url ${formatError(error)}`);
62576
62573
  }
62577
62574
  return "";
62578
62575
  }
62579
- var updateOrCreateChannel = async (supabase, update) => {
62576
+ async function updateOrCreateChannel(supabase, update) {
62580
62577
  if (!update.app_id || !update.name || !update.created_by) {
62581
62578
  f2.error("missing app_id, name, or created_by");
62582
62579
  return Promise.reject(new Error("missing app_id, name, or created_by"));
@@ -62599,16 +62596,16 @@ var updateOrCreateChannel = async (supabase, update) => {
62599
62596
  return supabase.from("channels").update(update).eq("app_id", update.app_id).eq("name", update.name).select().single();
62600
62597
  }
62601
62598
  return supabase.from("channels").insert(update).select().single();
62602
- };
62603
- var useLogSnag = () => {
62599
+ }
62600
+ function useLogSnag() {
62604
62601
  const logsnag = new import_logsnag.LogSnag({
62605
62602
  token: "c124f5e9d0ce5bdd14bbb48f815d5583",
62606
62603
  project: "capgo"
62607
62604
  });
62608
62605
  return logsnag;
62609
- };
62606
+ }
62610
62607
  var convertAppName = (appName) => appName.replace(/\./g, "--");
62611
- var verifyUser = async (supabase, apikey, keymod = ["all"]) => {
62608
+ async function verifyUser(supabase, apikey, keymod = ["all"]) {
62612
62609
  await checkKey(supabase, apikey, keymod);
62613
62610
  const { data: dataUser, error: userIdError } = await supabase.rpc("get_user_id", { apikey }).single();
62614
62611
  const userId = (dataUser || "").toString();
@@ -62617,22 +62614,22 @@ var verifyUser = async (supabase, apikey, keymod = ["all"]) => {
62617
62614
  program.error("");
62618
62615
  }
62619
62616
  return userId;
62620
- };
62621
- var requireUpdateMetadata = async (supabase, channel2) => {
62617
+ }
62618
+ async function requireUpdateMetadata(supabase, channel2) {
62622
62619
  const { data, error } = await supabase.from("channels").select("disableAutoUpdate").eq("name", channel2).limit(1);
62623
62620
  if (error) {
62624
- f2.error(`Cannot check if disableAutoUpdate is required ${JSON.stringify(error)}`);
62621
+ f2.error(`Cannot check if disableAutoUpdate is required ${formatError(error)}`);
62625
62622
  program.error("");
62626
62623
  }
62627
62624
  if (data.length === 0)
62628
62625
  return false;
62629
62626
  const { disableAutoUpdate } = data[0];
62630
62627
  return disableAutoUpdate === "version_number";
62631
- };
62632
- var getHumanDate = (createdA) => {
62628
+ }
62629
+ function getHumanDate(createdA) {
62633
62630
  const date = new Date(createdA || "");
62634
62631
  return date.toLocaleString();
62635
- };
62632
+ }
62636
62633
  async function getLocalDepenencies() {
62637
62634
  if (!(0, import_node_fs4.existsSync)("./package.json")) {
62638
62635
  f2.error("Missing package.json, you need to be in a capacitor project");
@@ -62671,9 +62668,8 @@ async function getLocalDepenencies() {
62671
62668
  }
62672
62669
  let hasNativeFiles = false;
62673
62670
  await (0, import_node_dir.promiseFiles)(`./node_modules/${key2}`).then((files) => {
62674
- if (files.find((fileName) => nativeFileRegex.test(fileName))) {
62671
+ if (files.find((fileName) => nativeFileRegex.test(fileName)))
62675
62672
  hasNativeFiles = true;
62676
- }
62677
62673
  }).catch((error) => {
62678
62674
  f2.error(`Error reading node_modulses files for ${key2} package`);
62679
62675
  console.error(error);
@@ -62731,12 +62727,13 @@ async function checkCompatibility(supabase, appId, channel2) {
62731
62727
  const mappedRemoteNativePackages = await getRemoteDepenencies(supabase, appId, channel2);
62732
62728
  const finalDepenencies = dependenciesObject.filter((a2) => !!a2.native).map((local) => {
62733
62729
  const remotePackage = mappedRemoteNativePackages.get(local.name);
62734
- if (remotePackage)
62730
+ if (remotePackage) {
62735
62731
  return {
62736
62732
  name: local.name,
62737
62733
  localVersion: local.version,
62738
62734
  remoteVersion: remotePackage.version
62739
62735
  };
62736
+ }
62740
62737
  return {
62741
62738
  name: local.name,
62742
62739
  localVersion: local.version,
@@ -62753,47 +62750,43 @@ async function checkCompatibility(supabase, appId, channel2) {
62753
62750
 
62754
62751
  // src/bundle/check.ts
62755
62752
  var import_node_fs5 = __toESM(require("node:fs"));
62756
- var import_path = __toESM(require("path"));
62757
- var searchInFile = (filePath, searchString) => {
62753
+ var import_node_path3 = __toESM(require("node:path"));
62754
+ function searchInFile(filePath, searchString) {
62758
62755
  const content = import_node_fs5.default.readFileSync(filePath, "utf8");
62759
62756
  return content.includes(searchString);
62760
- };
62761
- var searchInDirectory = (dirPath, searchString) => {
62757
+ }
62758
+ function searchInDirectory(dirPath, searchString) {
62762
62759
  const files = import_node_fs5.default.readdirSync(dirPath);
62763
62760
  for (const file of files) {
62764
- const filePath = import_path.default.join(dirPath, file);
62761
+ const filePath = import_node_path3.default.join(dirPath, file);
62765
62762
  const stats = import_node_fs5.default.statSync(filePath);
62766
62763
  if (stats.isDirectory()) {
62767
- if (searchInDirectory(filePath, searchString)) {
62764
+ if (searchInDirectory(filePath, searchString))
62768
62765
  return true;
62769
- }
62770
- } else if (stats.isFile() && import_path.default.extname(filePath) === ".js") {
62771
- if (searchInFile(filePath, searchString)) {
62766
+ } else if (stats.isFile() && import_node_path3.default.extname(filePath) === ".js") {
62767
+ if (searchInFile(filePath, searchString))
62772
62768
  return true;
62773
- }
62774
62769
  }
62775
62770
  }
62776
62771
  return false;
62777
- };
62778
- var checkIndexPosition = (dirPath) => {
62772
+ }
62773
+ function checkIndexPosition(dirPath) {
62779
62774
  const files = import_node_fs5.default.readdirSync(dirPath);
62780
62775
  if (files.length === 1) {
62781
- const filePath = import_path.default.join(dirPath, files[0]);
62776
+ const filePath = import_node_path3.default.join(dirPath, files[0]);
62782
62777
  const stats = import_node_fs5.default.statSync(filePath);
62783
- if (stats.isDirectory()) {
62778
+ if (stats.isDirectory())
62784
62779
  return checkIndexPosition(filePath);
62785
- }
62786
62780
  }
62787
62781
  const index = files.indexOf("index.html");
62788
- if (index > -1) {
62782
+ if (index > -1)
62789
62783
  return true;
62790
- }
62791
62784
  return false;
62792
- };
62785
+ }
62793
62786
 
62794
62787
  // src/bundle/zip.ts
62795
62788
  var alertMb = 20;
62796
- var zipBundle = async (appId, options) => {
62789
+ async function zipBundle(appId, options) {
62797
62790
  let { bundle: bundle2, path: path3 } = options;
62798
62791
  const { json } = options;
62799
62792
  const snag = useLogSnag();
@@ -62809,7 +62802,7 @@ var zipBundle = async (appId, options) => {
62809
62802
  if (!json)
62810
62803
  f2.error(`Your bundle name ${bundle2}, is not valid it should follow semver convention : https://semver.org/`);
62811
62804
  else
62812
- console.error(JSON.stringify({ error: "invalid_semver" }));
62805
+ console.error(formatError({ error: "invalid_semver" }));
62813
62806
  program.error("");
62814
62807
  }
62815
62808
  path3 = path3 || config?.app?.webDir;
@@ -62817,7 +62810,7 @@ var zipBundle = async (appId, options) => {
62817
62810
  if (!json)
62818
62811
  f2.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project");
62819
62812
  else
62820
- console.error(JSON.stringify({ error: "missing_argument" }));
62813
+ console.error(formatError({ error: "missing_argument" }));
62821
62814
  program.error("");
62822
62815
  }
62823
62816
  if (!json)
@@ -62829,7 +62822,7 @@ var zipBundle = async (appId, options) => {
62829
62822
  if (!json)
62830
62823
  f2.error(`notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready`);
62831
62824
  else
62832
- console.error(JSON.stringify({ error: "notifyAppReady_not_in_source_code" }));
62825
+ console.error(formatError({ error: "notifyAppReady_not_in_source_code" }));
62833
62826
  program.error("");
62834
62827
  }
62835
62828
  const foundIndex = checkIndexPosition(path3);
@@ -62837,7 +62830,7 @@ var zipBundle = async (appId, options) => {
62837
62830
  if (!json)
62838
62831
  f2.error(`index.html is missing in the root folder or in the only folder in the root folder`);
62839
62832
  else
62840
- console.error(JSON.stringify({ error: "index_html_not_found" }));
62833
+ console.error(formatError({ error: "index_html_not_found" }));
62841
62834
  program.error("");
62842
62835
  }
62843
62836
  }
@@ -62882,7 +62875,7 @@ The app size is ${mbSize} Mb, this may take a while to download for users
62882
62875
  filename: name,
62883
62876
  checksum
62884
62877
  };
62885
- console.log(JSON.stringify(output));
62878
+ f2.info(formatError(output));
62886
62879
  }
62887
62880
  await snag.track({
62888
62881
  channel: "app",
@@ -62895,12 +62888,13 @@ The app size is ${mbSize} Mb, this may take a while to download for users
62895
62888
  }).catch();
62896
62889
  if (!json)
62897
62890
  $e(`Done \u2705`);
62898
- process.exit();
62899
- };
62891
+ import_node_process9.default.exit();
62892
+ }
62900
62893
 
62901
62894
  // src/init.ts
62902
62895
  var import_node_fs11 = require("node:fs");
62903
- var import_child_process = require("child_process");
62896
+ var import_node_child_process6 = require("node:child_process");
62897
+ var import_node_process16 = __toESM(require("node:process"));
62904
62898
 
62905
62899
  // node_modules/@capgo/find-package-manager/main.js
62906
62900
  var import_fs = require("fs");
@@ -62927,31 +62921,33 @@ var findPackageManagerType = (path3 = ".") => {
62927
62921
  // src/init.ts
62928
62922
  var import_semver = __toESM(require_semver4());
62929
62923
 
62924
+ // src/app/debug.ts
62925
+ var import_node_process10 = __toESM(require("node:process"));
62926
+
62930
62927
  // src/api/app.ts
62931
- var checkAppExists = async (supabase, appid) => {
62928
+ async function checkAppExists(supabase, appid) {
62932
62929
  const { data: app2 } = await supabase.rpc("exist_app_v2", { appid }).single();
62933
62930
  return !!app2;
62934
- };
62935
- var checkAppExistsAndHasPermissionErr = async (supabase, apikey, appid, shouldExist = true) => {
62936
- const res = await checkAppExists(supabase, appid);
62931
+ }
62932
+ async function checkAppExistsAndHasPermissionErr(supabase, apikey, appid, shouldExist = true) {
62933
+ const appExist = await checkAppExists(supabase, appid);
62937
62934
  const perm = await isAllowedApp(supabase, apikey, appid);
62938
- if (res && !shouldExist) {
62935
+ if (appExist && !shouldExist) {
62939
62936
  f2.error(`App ${appid} already exist`);
62940
62937
  program.error("");
62941
62938
  }
62942
- if (!res && shouldExist) {
62939
+ if (!appExist && shouldExist) {
62943
62940
  f2.error(`App ${appid} does not exist`);
62944
62941
  program.error("");
62945
62942
  }
62946
- if (res && !perm) {
62943
+ if (appExist && !perm) {
62947
62944
  f2.error(`App ${appid} exist and you don't have permission to access it`);
62948
- if (appid === "io.ionic.starter") {
62945
+ if (appid === "io.ionic.starter")
62949
62946
  f2.info("Modify your appid in your capacitor.config.json file to something unique, this is a default appid for ionic starter app");
62950
- }
62951
62947
  program.error("");
62952
62948
  }
62953
- };
62954
- var checkAppExistsAndHasPermissionOrgErr = async (supabase, apikey, appid, requiredPermission) => {
62949
+ }
62950
+ async function checkAppExistsAndHasPermissionOrgErr(supabase, apikey, appid, requiredPermission) {
62955
62951
  const permissions = await isAllowedAppOrg(supabase, apikey, appid);
62956
62952
  if (!permissions.okay) {
62957
62953
  switch (permissions.error) {
@@ -62979,14 +62975,16 @@ var checkAppExistsAndHasPermissionOrgErr = async (supabase, apikey, appid, requi
62979
62975
  program.error("");
62980
62976
  }
62981
62977
  return permissions.data;
62982
- };
62978
+ }
62983
62979
  var newIconPath = "assets/icon.png";
62984
62980
 
62985
62981
  // src/app/debug.ts
62986
- var wait = (ms) => new Promise((resolve2) => {
62987
- setTimeout(resolve2, ms);
62988
- });
62989
- var markSnag = async (channel2, userId, snag, event, icon = "\u2705") => {
62982
+ function wait(ms) {
62983
+ return new Promise((resolve2) => {
62984
+ setTimeout(resolve2, ms);
62985
+ });
62986
+ }
62987
+ async function markSnag(channel2, userId, snag, event, icon = "\u2705") {
62990
62988
  await snag.track({
62991
62989
  channel: channel2,
62992
62990
  event,
@@ -62994,27 +62992,26 @@ var markSnag = async (channel2, userId, snag, event, icon = "\u2705") => {
62994
62992
  user_id: userId,
62995
62993
  notify: false
62996
62994
  }).catch();
62997
- };
62998
- var cancelCommand = async (channel2, command, userId, snag) => {
62995
+ }
62996
+ async function cancelCommand(channel2, command, userId, snag) {
62999
62997
  if (eD(command)) {
63000
62998
  await markSnag(channel2, userId, snag, "canceled", "\u{1F937}");
63001
- process.exit();
62999
+ import_node_process10.default.exit();
63002
63000
  }
63003
- };
63001
+ }
63004
63002
  async function getStats(supabase, query) {
63005
63003
  try {
63006
63004
  const pathStats = "private/stats";
63007
63005
  const res = await supabase.functions.invoke(pathStats, { body: JSON.stringify(query) });
63008
63006
  const listData = res.data.data;
63009
- if (listData?.length > 0) {
63007
+ if (listData?.length > 0)
63010
63008
  return listData[0];
63011
- }
63012
63009
  } catch (error) {
63013
- f2.error(`Cannot get stats ${JSON.stringify(error)}`);
63010
+ f2.error(`Cannot get stats ${formatError(error)}`);
63014
63011
  }
63015
63012
  return null;
63016
63013
  }
63017
- var waitLog = async (channel2, supabase, appId, snag, userId, deviceId) => {
63014
+ async function waitLog(channel2, supabase, appId, snag, userId, deviceId) {
63018
63015
  let loop = true;
63019
63016
  let now = (/* @__PURE__ */ new Date()).toISOString();
63020
63017
  const appIdUrl = convertAppName(appId);
@@ -63100,8 +63097,8 @@ var waitLog = async (channel2, supabase, appId, snag, userId, deviceId) => {
63100
63097
  await wait(1e3);
63101
63098
  }
63102
63099
  return Promise.resolve();
63103
- };
63104
- var debugApp = async (appId, options) => {
63100
+ }
63101
+ async function debugApp(appId, options) {
63105
63102
  oe(`Debug Live update in Capgo`);
63106
63103
  await checkLatest();
63107
63104
  options.apikey = options.apikey || findSavedKey();
@@ -63132,8 +63129,8 @@ var debugApp = async (appId, options) => {
63132
63129
  $e(`Canceled \u274C`);
63133
63130
  }
63134
63131
  $e(`Done \u2705`);
63135
- process.exit();
63136
- };
63132
+ import_node_process10.default.exit();
63133
+ }
63137
63134
 
63138
63135
  // src/key.ts
63139
63136
  var import_node_fs7 = require("node:fs");
@@ -63141,11 +63138,12 @@ var import_config2 = __toESM(require_config());
63141
63138
 
63142
63139
  // src/api/crypto.ts
63143
63140
  var import_node_crypto2 = require("node:crypto");
63141
+ var import_node_buffer2 = require("node:buffer");
63144
63142
  var algorithm = "aes-128-cbc";
63145
63143
  var oaepHash = "sha256";
63146
63144
  var formatB64 = "base64";
63147
63145
  var padding = import_node_crypto2.constants.RSA_PKCS1_OAEP_PADDING;
63148
- var decryptSource = (source, ivSessionKey, privateKey) => {
63146
+ function decryptSource(source, ivSessionKey, privateKey) {
63149
63147
  const [ivB64, sessionb64Encrypted] = ivSessionKey.split(":");
63150
63148
  const sessionKey = (0, import_node_crypto2.privateDecrypt)(
63151
63149
  {
@@ -63153,15 +63151,15 @@ var decryptSource = (source, ivSessionKey, privateKey) => {
63153
63151
  padding,
63154
63152
  oaepHash
63155
63153
  },
63156
- Buffer.from(sessionb64Encrypted, formatB64)
63154
+ import_node_buffer2.Buffer.from(sessionb64Encrypted, formatB64)
63157
63155
  );
63158
- const initVector = Buffer.from(ivB64, formatB64);
63156
+ const initVector = import_node_buffer2.Buffer.from(ivB64, formatB64);
63159
63157
  const decipher = (0, import_node_crypto2.createDecipheriv)(algorithm, sessionKey, initVector);
63160
63158
  decipher.setAutoPadding(true);
63161
- const decryptedData = Buffer.concat([decipher.update(source), decipher.final()]);
63159
+ const decryptedData = import_node_buffer2.Buffer.concat([decipher.update(source), decipher.final()]);
63162
63160
  return decryptedData;
63163
- };
63164
- var encryptSource = (source, publicKey) => {
63161
+ }
63162
+ function encryptSource(source, publicKey) {
63165
63163
  const initVector = (0, import_node_crypto2.randomBytes)(16);
63166
63164
  const sessionKey = (0, import_node_crypto2.randomBytes)(16);
63167
63165
  const cipher = (0, import_node_crypto2.createCipheriv)(algorithm, sessionKey, initVector);
@@ -63176,13 +63174,13 @@ var encryptSource = (source, publicKey) => {
63176
63174
  sessionKey
63177
63175
  ).toString(formatB64);
63178
63176
  const ivSessionKey = `${ivB64}:${sessionb64Encrypted}`;
63179
- const encryptedData = Buffer.concat([cipher.update(source), cipher.final()]);
63177
+ const encryptedData = import_node_buffer2.Buffer.concat([cipher.update(source), cipher.final()]);
63180
63178
  return {
63181
63179
  encryptedData,
63182
63180
  ivSessionKey
63183
63181
  };
63184
- };
63185
- var createRSA = () => {
63182
+ }
63183
+ function createRSA() {
63186
63184
  const { publicKey, privateKey } = (0, import_node_crypto2.generateKeyPairSync)("rsa", {
63187
63185
  // The standard secure default length for RSA keys is 2048 bits
63188
63186
  modulusLength: 2048
@@ -63197,13 +63195,12 @@ var createRSA = () => {
63197
63195
  format: "pem"
63198
63196
  })
63199
63197
  };
63200
- };
63198
+ }
63201
63199
 
63202
63200
  // src/key.ts
63203
- var saveKey = async (options, log = true) => {
63204
- if (log) {
63201
+ async function saveKey(options, log = true) {
63202
+ if (log)
63205
63203
  oe(`Save keys \u{1F511}`);
63206
- }
63207
63204
  const config = await getConfig();
63208
63205
  const { extConfig } = config.app;
63209
63206
  const keyPath = options.key || baseKey;
@@ -63226,9 +63223,8 @@ var saveKey = async (options, log = true) => {
63226
63223
  CapacitorUpdater: {}
63227
63224
  };
63228
63225
  }
63229
- if (!extConfig.plugins.CapacitorUpdater) {
63226
+ if (!extConfig.plugins.CapacitorUpdater)
63230
63227
  extConfig.plugins.CapacitorUpdater = {};
63231
- }
63232
63228
  extConfig.plugins.CapacitorUpdater.privateKey = privateKey;
63233
63229
  (0, import_config2.writeConfig)(extConfig, config.app.extConfigFilePath);
63234
63230
  }
@@ -63237,16 +63233,15 @@ var saveKey = async (options, log = true) => {
63237
63233
  f2.success(`your app will decode the zip archive with this key`);
63238
63234
  }
63239
63235
  return true;
63240
- };
63241
- var saveKeyCommand = async (options) => {
63236
+ }
63237
+ async function saveKeyCommand(options) {
63242
63238
  oe(`Save keys \u{1F511}`);
63243
63239
  await checkLatest();
63244
63240
  await saveKey(options);
63245
- };
63246
- var createKey = async (options, log = true) => {
63247
- if (log) {
63241
+ }
63242
+ async function createKey(options, log = true) {
63243
+ if (log)
63248
63244
  oe(`Create keys \u{1F511}`);
63249
- }
63250
63245
  const { publicKey, privateKey } = createRSA();
63251
63246
  if ((0, import_node_fs7.existsSync)(baseKeyPub) && !options.force) {
63252
63247
  if (log) {
@@ -63291,15 +63286,19 @@ var createKey = async (options, log = true) => {
63291
63286
  $e(`Done \u2705`);
63292
63287
  }
63293
63288
  return true;
63294
- };
63295
- var createKeyCommand = async (options) => {
63289
+ }
63290
+ async function createKeyCommand(options) {
63296
63291
  await checkLatest();
63297
63292
  await createKey(options);
63298
- };
63293
+ }
63294
+
63295
+ // src/channel/add.ts
63296
+ var import_node_process12 = __toESM(require("node:process"));
63299
63297
 
63300
63298
  // src/api/channels.ts
63299
+ var import_node_process11 = __toESM(require("node:process"));
63301
63300
  var import_console_table_printer = __toESM(require_dist18());
63302
- var checkVersionNotUsedInChannel = async (supabase, appid, userId, versionData) => {
63301
+ async function checkVersionNotUsedInChannel(supabase, appid, userId, versionData) {
63303
63302
  const { data: channelFound, error: errorChannel } = await supabase.from("channels").select().eq("app_id", appid).eq("created_by", userId).eq("version", versionData.id);
63304
63303
  if (errorChannel) {
63305
63304
  f2.error(`Cannot check Version ${appid}@${versionData.name}`);
@@ -63316,7 +63315,7 @@ var checkVersionNotUsedInChannel = async (supabase, appid, userId, versionData)
63316
63315
  }).eq("id", channel2.id);
63317
63316
  if (errorChannelUpdate) {
63318
63317
  s.stop(`Cannot update channel ${channel2.name} ${formatError(errorChannelUpdate)}`);
63319
- process.exit(1);
63318
+ import_node_process11.default.exit(1);
63320
63319
  }
63321
63320
  s.stop(`\u2705 Channel ${channel2.name} unlinked`);
63322
63321
  }
@@ -63326,11 +63325,17 @@ var checkVersionNotUsedInChannel = async (supabase, appid, userId, versionData)
63326
63325
  }
63327
63326
  $e(`Version unlinked from ${channelFound.length} channel`);
63328
63327
  }
63329
- };
63330
- var findUnknownVersion = (supabase, appId) => supabase.from("app_versions").select("id").eq("app_id", appId).eq("name", "unknown").throwOnError().single().then(({ data }) => data);
63331
- var createChannel = (supabase, update) => supabase.from("channels").insert(update).select().single();
63332
- var delChannel = (supabase, name, appId, userId) => supabase.from("channels").delete().eq("name", name).eq("app_id", appId).eq("created_by", userId).single();
63333
- var displayChannels = (data) => {
63328
+ }
63329
+ function findUnknownVersion(supabase, appId) {
63330
+ return supabase.from("app_versions").select("id").eq("app_id", appId).eq("name", "unknown").throwOnError().single().then(({ data }) => data);
63331
+ }
63332
+ function createChannel(supabase, update) {
63333
+ return supabase.from("channels").insert(update).select().single();
63334
+ }
63335
+ function delChannel(supabase, name, appId, userId) {
63336
+ return supabase.from("channels").delete().eq("name", name).eq("app_id", appId).eq("created_by", userId).single();
63337
+ }
63338
+ function displayChannels(data) {
63334
63339
  const t = new import_console_table_printer.Table({
63335
63340
  title: "Channels",
63336
63341
  charLength: { "\u274C": 2, "\u2705": 2 }
@@ -63343,18 +63348,18 @@ var displayChannels = (data) => {
63343
63348
  });
63344
63349
  });
63345
63350
  f2.success(t.render());
63346
- };
63347
- var getActiveChannels = async (supabase, appid) => {
63351
+ }
63352
+ async function getActiveChannels(supabase, appid) {
63348
63353
  const { data, error: vError } = await supabase.from("channels").select().eq("app_id", appid).order("created_at", { ascending: false });
63349
63354
  if (vError) {
63350
63355
  f2.error(`App ${appid} not found in database`);
63351
63356
  program.error("");
63352
63357
  }
63353
63358
  return data;
63354
- };
63359
+ }
63355
63360
 
63356
63361
  // src/channel/add.ts
63357
- var addChannel = async (channelId, appId, options, shouldExit = true) => {
63362
+ async function addChannel(channelId, appId, options, shouldExit = true) {
63358
63363
  oe(`Create channel`);
63359
63364
  options.apikey = options.apikey || findSavedKey();
63360
63365
  const config = await getConfig();
@@ -63402,22 +63407,23 @@ var addChannel = async (channelId, appId, options, shouldExit = true) => {
63402
63407
  }
63403
63408
  if (shouldExit) {
63404
63409
  $e(`Done \u2705`);
63405
- process.exit();
63410
+ import_node_process12.default.exit();
63406
63411
  }
63407
63412
  return true;
63408
- };
63409
- var addChannelCommand = async (apikey, appId, options) => {
63413
+ }
63414
+ async function addChannelCommand(apikey, appId, options) {
63410
63415
  addChannel(apikey, appId, options, true);
63411
- };
63416
+ }
63412
63417
 
63413
63418
  // src/bundle/upload.ts
63414
63419
  var import_node_crypto3 = require("node:crypto");
63415
63420
  var import_node_fs8 = require("node:fs");
63421
+ var import_node_process13 = __toESM(require("node:process"));
63416
63422
  var import_adm_zip2 = __toESM(require_adm_zip());
63417
63423
  var import_checksum2 = __toESM(require_dist());
63418
63424
  var import_ci_info = __toESM(require_ci_info());
63419
63425
  var alertMb2 = 20;
63420
- var uploadBundle = async (appid, options, shouldExit = true) => {
63426
+ async function uploadBundle(appid, options, shouldExit = true) {
63421
63427
  oe(`Uploading`);
63422
63428
  await checkLatest();
63423
63429
  let { bundle: bundle2, path: path3, channel: channel2 } = options;
@@ -63549,9 +63555,8 @@ Trial expires in ${isTrial2} days`);
63549
63555
  let keyData = options.keyData || "";
63550
63556
  if (!keyData && !(0, import_node_fs8.existsSync)(publicKey)) {
63551
63557
  f2.error(`Cannot find public key ${publicKey}`);
63552
- if (import_ci_info.default.isCI) {
63558
+ if (import_ci_info.default.isCI)
63553
63559
  program.error("");
63554
- }
63555
63560
  const res2 = await se({ message: "Do you want to use our public key ?" });
63556
63561
  if (!res2) {
63557
63562
  f2.error(`Error: Missing public key`);
@@ -63633,7 +63638,7 @@ The app size is ${mbSize} Mb, this may take a while to download for users
63633
63638
  native_packages: nativePackages,
63634
63639
  checksum
63635
63640
  };
63636
- const { error: dbError } = await updateOrCreateVersion(supabase, versionData, options.apikey);
63641
+ const { error: dbError } = await updateOrCreateVersion(supabase, versionData);
63637
63642
  if (dbError) {
63638
63643
  f2.error(`Cannot add bundle ${formatError(dbError)}`);
63639
63644
  program.error("");
@@ -63656,10 +63661,9 @@ The app size is ${mbSize} Mb, this may take a while to download for users
63656
63661
  } : void 0
63657
63662
  });
63658
63663
  versionData.storage_provider = "r2";
63659
- const { error: dbError2 } = await updateOrCreateVersion(supabase, versionData, options.apikey);
63664
+ const { error: dbError2 } = await updateOrCreateVersion(supabase, versionData);
63660
63665
  if (dbError2) {
63661
- console.log(dbError2);
63662
- f2.error(`Cannot update bundle ${formatError(dbError)}`);
63666
+ f2.error(`Cannot update bundle ${formatError(dbError2)}`);
63663
63667
  program.error("");
63664
63668
  }
63665
63669
  spinner.stop("Bundle Uploaded \u{1F4AA}");
@@ -63673,20 +63677,17 @@ The app size is ${mbSize} Mb, this may take a while to download for users
63673
63677
  version: versionId
63674
63678
  });
63675
63679
  if (dbError3) {
63676
- f2.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this.`);
63677
- console.log(dbError3);
63680
+ f2.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${formatError(dbError3)}`);
63678
63681
  program.error("");
63679
63682
  }
63680
63683
  const appidWeb = convertAppName(appid);
63681
63684
  const bundleUrl = `${localConfig.hostWeb}/app/p/${appidWeb}/channel/${data.id}`;
63682
- if (data?.public) {
63685
+ if (data?.public)
63683
63686
  f2.info("Your update is now available in your public channel \u{1F389}");
63684
- } else if (data?.id) {
63687
+ else if (data?.id)
63685
63688
  f2.info(`Link device to this bundle to try it: ${bundleUrl}`);
63686
- }
63687
- if (options.bundleUrl) {
63689
+ if (options.bundleUrl)
63688
63690
  f2.info(`Bundle url: ${bundleUrl}`);
63689
- }
63690
63691
  } else if (!versionId) {
63691
63692
  f2.warn("Cannot set bundle with upload key, use key with more rights for that");
63692
63693
  program.error("");
@@ -63705,35 +63706,35 @@ The app size is ${mbSize} Mb, this may take a while to download for users
63705
63706
  }).catch();
63706
63707
  if (shouldExit) {
63707
63708
  $e("Time to share your update to the world \u{1F30D}");
63708
- process.exit();
63709
+ import_node_process13.default.exit();
63709
63710
  }
63710
63711
  return true;
63711
- };
63712
- var uploadCommand = async (apikey, options) => {
63712
+ }
63713
+ async function uploadCommand(apikey, options) {
63713
63714
  try {
63714
63715
  await uploadBundle(apikey, options, true);
63715
63716
  } catch (error) {
63716
- f2.error(JSON.stringify(error));
63717
+ f2.error(formatError(error));
63717
63718
  program.error("");
63718
63719
  }
63719
- };
63720
- var uploadDeprecatedCommand = async (apikey, options) => {
63720
+ }
63721
+ async function uploadDeprecatedCommand(apikey, options) {
63721
63722
  f2.warn('\u26A0\uFE0F This command is deprecated, use "npx @capgo/cli bundle upload" instead \u26A0\uFE0F');
63722
63723
  try {
63723
63724
  await uploadBundle(apikey, options, true);
63724
63725
  } catch (error) {
63725
- f2.error(JSON.stringify(error));
63726
+ f2.error(formatError(error));
63726
63727
  program.error("");
63727
63728
  }
63728
- };
63729
+ }
63729
63730
 
63730
63731
  // src/login.ts
63731
63732
  var import_node_fs9 = require("node:fs");
63732
63733
  var import_node_os3 = require("node:os");
63733
- var login = async (apikey, options, shouldExit = true) => {
63734
- if (shouldExit) {
63734
+ var import_node_process14 = __toESM(require("node:process"));
63735
+ async function login(apikey, options, shouldExit = true) {
63736
+ if (shouldExit)
63735
63737
  oe(`Login to Capgo`);
63736
- }
63737
63738
  if (!apikey) {
63738
63739
  if (shouldExit) {
63739
63740
  f2.error("Missing API key, you need to provide a API key to upload your bundle");
@@ -63770,20 +63771,22 @@ var login = async (apikey, options, shouldExit = true) => {
63770
63771
  f2.success(`login saved into .capgo file in ${local ? "local" : "home"} directory`);
63771
63772
  } catch (e2) {
63772
63773
  f2.error(`Error while saving login`);
63773
- process.exit(1);
63774
+ import_node_process14.default.exit(1);
63774
63775
  }
63775
63776
  if (shouldExit) {
63776
63777
  $e("Done \u2705");
63777
- process.exit();
63778
+ import_node_process14.default.exit();
63778
63779
  }
63779
63780
  return true;
63780
- };
63781
- var loginCommand = async (apikey, options) => {
63781
+ }
63782
+ async function loginCommand(apikey, options) {
63782
63783
  login(apikey, options, true);
63783
- };
63784
+ }
63784
63785
 
63785
63786
  // src/app/add.ts
63786
63787
  var import_node_crypto4 = require("node:crypto");
63788
+ var import_node_fs10 = require("node:fs");
63789
+ var import_node_process15 = __toESM(require("node:process"));
63787
63790
 
63788
63791
  // node_modules/mime/dist/types/other.js
63789
63792
  var types = { "application/prs.cww": ["cww"], "application/prs.xsf+xml": ["xsf"], "application/vnd.1000minds.decision-model+xml": ["1km"], "application/vnd.3gpp.pic-bw-large": ["plb"], "application/vnd.3gpp.pic-bw-small": ["psb"], "application/vnd.3gpp.pic-bw-var": ["pvb"], "application/vnd.3gpp2.tcap": ["tcap"], "application/vnd.3m.post-it-notes": ["pwn"], "application/vnd.accpac.simply.aso": ["aso"], "application/vnd.accpac.simply.imp": ["imp"], "application/vnd.acucobol": ["acu"], "application/vnd.acucorp": ["atc", "acutc"], "application/vnd.adobe.air-application-installer-package+zip": ["air"], "application/vnd.adobe.formscentral.fcdt": ["fcdt"], "application/vnd.adobe.fxp": ["fxp", "fxpl"], "application/vnd.adobe.xdp+xml": ["xdp"], "application/vnd.adobe.xfdf": ["*xfdf"], "application/vnd.age": ["age"], "application/vnd.ahead.space": ["ahead"], "application/vnd.airzip.filesecure.azf": ["azf"], "application/vnd.airzip.filesecure.azs": ["azs"], "application/vnd.amazon.ebook": ["azw"], "application/vnd.americandynamics.acc": ["acc"], "application/vnd.amiga.ami": ["ami"], "application/vnd.android.package-archive": ["apk"], "application/vnd.anser-web-certificate-issue-initiation": ["cii"], "application/vnd.anser-web-funds-transfer-initiation": ["fti"], "application/vnd.antix.game-component": ["atx"], "application/vnd.apple.installer+xml": ["mpkg"], "application/vnd.apple.keynote": ["key"], "application/vnd.apple.mpegurl": ["m3u8"], "application/vnd.apple.numbers": ["numbers"], "application/vnd.apple.pages": ["pages"], "application/vnd.apple.pkpass": ["pkpass"], "application/vnd.aristanetworks.swi": ["swi"], "application/vnd.astraea-software.iota": ["iota"], "application/vnd.audiograph": ["aep"], "application/vnd.balsamiq.bmml+xml": ["bmml"], "application/vnd.blueice.multipass": ["mpm"], "application/vnd.bmi": ["bmi"], "application/vnd.businessobjects": ["rep"], "application/vnd.chemdraw+xml": ["cdxml"], "application/vnd.chipnuts.karaoke-mmd": ["mmd"], "application/vnd.cinderella": ["cdy"], "application/vnd.citationstyles.style+xml": ["csl"], "application/vnd.claymore": ["cla"], "application/vnd.cloanto.rp9": ["rp9"], "application/vnd.clonk.c4group": ["c4g", "c4d", "c4f", "c4p", "c4u"], "application/vnd.cluetrust.cartomobile-config": ["c11amc"], "application/vnd.cluetrust.cartomobile-config-pkg": ["c11amz"], "application/vnd.commonspace": ["csp"], "application/vnd.contact.cmsg": ["cdbcmsg"], "application/vnd.cosmocaller": ["cmc"], "application/vnd.crick.clicker": ["clkx"], "application/vnd.crick.clicker.keyboard": ["clkk"], "application/vnd.crick.clicker.palette": ["clkp"], "application/vnd.crick.clicker.template": ["clkt"], "application/vnd.crick.clicker.wordbank": ["clkw"], "application/vnd.criticaltools.wbs+xml": ["wbs"], "application/vnd.ctc-posml": ["pml"], "application/vnd.cups-ppd": ["ppd"], "application/vnd.curl.car": ["car"], "application/vnd.curl.pcurl": ["pcurl"], "application/vnd.dart": ["dart"], "application/vnd.data-vision.rdz": ["rdz"], "application/vnd.dbf": ["dbf"], "application/vnd.dece.data": ["uvf", "uvvf", "uvd", "uvvd"], "application/vnd.dece.ttml+xml": ["uvt", "uvvt"], "application/vnd.dece.unspecified": ["uvx", "uvvx"], "application/vnd.dece.zip": ["uvz", "uvvz"], "application/vnd.denovo.fcselayout-link": ["fe_launch"], "application/vnd.dna": ["dna"], "application/vnd.dolby.mlp": ["mlp"], "application/vnd.dpgraph": ["dpg"], "application/vnd.dreamfactory": ["dfac"], "application/vnd.ds-keypoint": ["kpxx"], "application/vnd.dvb.ait": ["ait"], "application/vnd.dvb.service": ["svc"], "application/vnd.dynageo": ["geo"], "application/vnd.ecowin.chart": ["mag"], "application/vnd.enliven": ["nml"], "application/vnd.epson.esf": ["esf"], "application/vnd.epson.msf": ["msf"], "application/vnd.epson.quickanime": ["qam"], "application/vnd.epson.salt": ["slt"], "application/vnd.epson.ssf": ["ssf"], "application/vnd.eszigno3+xml": ["es3", "et3"], "application/vnd.ezpix-album": ["ez2"], "application/vnd.ezpix-package": ["ez3"], "application/vnd.fdf": ["*fdf"], "application/vnd.fdsn.mseed": ["mseed"], "application/vnd.fdsn.seed": ["seed", "dataless"], "application/vnd.flographit": ["gph"], "application/vnd.fluxtime.clip": ["ftc"], "application/vnd.framemaker": ["fm", "frame", "maker", "book"], "application/vnd.frogans.fnc": ["fnc"], "application/vnd.frogans.ltf": ["ltf"], "application/vnd.fsc.weblaunch": ["fsc"], "application/vnd.fujitsu.oasys": ["oas"], "application/vnd.fujitsu.oasys2": ["oa2"], "application/vnd.fujitsu.oasys3": ["oa3"], "application/vnd.fujitsu.oasysgp": ["fg5"], "application/vnd.fujitsu.oasysprs": ["bh2"], "application/vnd.fujixerox.ddd": ["ddd"], "application/vnd.fujixerox.docuworks": ["xdw"], "application/vnd.fujixerox.docuworks.binder": ["xbd"], "application/vnd.fuzzysheet": ["fzs"], "application/vnd.genomatix.tuxedo": ["txd"], "application/vnd.geogebra.file": ["ggb"], "application/vnd.geogebra.tool": ["ggt"], "application/vnd.geometry-explorer": ["gex", "gre"], "application/vnd.geonext": ["gxt"], "application/vnd.geoplan": ["g2w"], "application/vnd.geospace": ["g3w"], "application/vnd.gmx": ["gmx"], "application/vnd.google-apps.document": ["gdoc"], "application/vnd.google-apps.presentation": ["gslides"], "application/vnd.google-apps.spreadsheet": ["gsheet"], "application/vnd.google-earth.kml+xml": ["kml"], "application/vnd.google-earth.kmz": ["kmz"], "application/vnd.grafeq": ["gqf", "gqs"], "application/vnd.groove-account": ["gac"], "application/vnd.groove-help": ["ghf"], "application/vnd.groove-identity-message": ["gim"], "application/vnd.groove-injector": ["grv"], "application/vnd.groove-tool-message": ["gtm"], "application/vnd.groove-tool-template": ["tpl"], "application/vnd.groove-vcard": ["vcg"], "application/vnd.hal+xml": ["hal"], "application/vnd.handheld-entertainment+xml": ["zmm"], "application/vnd.hbci": ["hbci"], "application/vnd.hhe.lesson-player": ["les"], "application/vnd.hp-hpgl": ["hpgl"], "application/vnd.hp-hpid": ["hpid"], "application/vnd.hp-hps": ["hps"], "application/vnd.hp-jlyt": ["jlt"], "application/vnd.hp-pcl": ["pcl"], "application/vnd.hp-pclxl": ["pclxl"], "application/vnd.hydrostatix.sof-data": ["sfd-hdstx"], "application/vnd.ibm.minipay": ["mpy"], "application/vnd.ibm.modcap": ["afp", "listafp", "list3820"], "application/vnd.ibm.rights-management": ["irm"], "application/vnd.ibm.secure-container": ["sc"], "application/vnd.iccprofile": ["icc", "icm"], "application/vnd.igloader": ["igl"], "application/vnd.immervision-ivp": ["ivp"], "application/vnd.immervision-ivu": ["ivu"], "application/vnd.insors.igm": ["igm"], "application/vnd.intercon.formnet": ["xpw", "xpx"], "application/vnd.intergeo": ["i2g"], "application/vnd.intu.qbo": ["qbo"], "application/vnd.intu.qfx": ["qfx"], "application/vnd.ipunplugged.rcprofile": ["rcprofile"], "application/vnd.irepository.package+xml": ["irp"], "application/vnd.is-xpr": ["xpr"], "application/vnd.isac.fcs": ["fcs"], "application/vnd.jam": ["jam"], "application/vnd.jcp.javame.midlet-rms": ["rms"], "application/vnd.jisp": ["jisp"], "application/vnd.joost.joda-archive": ["joda"], "application/vnd.kahootz": ["ktz", "ktr"], "application/vnd.kde.karbon": ["karbon"], "application/vnd.kde.kchart": ["chrt"], "application/vnd.kde.kformula": ["kfo"], "application/vnd.kde.kivio": ["flw"], "application/vnd.kde.kontour": ["kon"], "application/vnd.kde.kpresenter": ["kpr", "kpt"], "application/vnd.kde.kspread": ["ksp"], "application/vnd.kde.kword": ["kwd", "kwt"], "application/vnd.kenameaapp": ["htke"], "application/vnd.kidspiration": ["kia"], "application/vnd.kinar": ["kne", "knp"], "application/vnd.koan": ["skp", "skd", "skt", "skm"], "application/vnd.kodak-descriptor": ["sse"], "application/vnd.las.las+xml": ["lasxml"], "application/vnd.llamagraphics.life-balance.desktop": ["lbd"], "application/vnd.llamagraphics.life-balance.exchange+xml": ["lbe"], "application/vnd.lotus-1-2-3": ["123"], "application/vnd.lotus-approach": ["apr"], "application/vnd.lotus-freelance": ["pre"], "application/vnd.lotus-notes": ["nsf"], "application/vnd.lotus-organizer": ["org"], "application/vnd.lotus-screencam": ["scm"], "application/vnd.lotus-wordpro": ["lwp"], "application/vnd.macports.portpkg": ["portpkg"], "application/vnd.mapbox-vector-tile": ["mvt"], "application/vnd.mcd": ["mcd"], "application/vnd.medcalcdata": ["mc1"], "application/vnd.mediastation.cdkey": ["cdkey"], "application/vnd.mfer": ["mwf"], "application/vnd.mfmp": ["mfm"], "application/vnd.micrografx.flo": ["flo"], "application/vnd.micrografx.igx": ["igx"], "application/vnd.mif": ["mif"], "application/vnd.mobius.daf": ["daf"], "application/vnd.mobius.dis": ["dis"], "application/vnd.mobius.mbk": ["mbk"], "application/vnd.mobius.mqy": ["mqy"], "application/vnd.mobius.msl": ["msl"], "application/vnd.mobius.plc": ["plc"], "application/vnd.mobius.txf": ["txf"], "application/vnd.mophun.application": ["mpn"], "application/vnd.mophun.certificate": ["mpc"], "application/vnd.mozilla.xul+xml": ["xul"], "application/vnd.ms-artgalry": ["cil"], "application/vnd.ms-cab-compressed": ["cab"], "application/vnd.ms-excel": ["xls", "xlm", "xla", "xlc", "xlt", "xlw"], "application/vnd.ms-excel.addin.macroenabled.12": ["xlam"], "application/vnd.ms-excel.sheet.binary.macroenabled.12": ["xlsb"], "application/vnd.ms-excel.sheet.macroenabled.12": ["xlsm"], "application/vnd.ms-excel.template.macroenabled.12": ["xltm"], "application/vnd.ms-fontobject": ["eot"], "application/vnd.ms-htmlhelp": ["chm"], "application/vnd.ms-ims": ["ims"], "application/vnd.ms-lrm": ["lrm"], "application/vnd.ms-officetheme": ["thmx"], "application/vnd.ms-outlook": ["msg"], "application/vnd.ms-pki.seccat": ["cat"], "application/vnd.ms-pki.stl": ["*stl"], "application/vnd.ms-powerpoint": ["ppt", "pps", "pot"], "application/vnd.ms-powerpoint.addin.macroenabled.12": ["ppam"], "application/vnd.ms-powerpoint.presentation.macroenabled.12": ["pptm"], "application/vnd.ms-powerpoint.slide.macroenabled.12": ["sldm"], "application/vnd.ms-powerpoint.slideshow.macroenabled.12": ["ppsm"], "application/vnd.ms-powerpoint.template.macroenabled.12": ["potm"], "application/vnd.ms-project": ["*mpp", "mpt"], "application/vnd.ms-word.document.macroenabled.12": ["docm"], "application/vnd.ms-word.template.macroenabled.12": ["dotm"], "application/vnd.ms-works": ["wps", "wks", "wcm", "wdb"], "application/vnd.ms-wpl": ["wpl"], "application/vnd.ms-xpsdocument": ["xps"], "application/vnd.mseq": ["mseq"], "application/vnd.musician": ["mus"], "application/vnd.muvee.style": ["msty"], "application/vnd.mynfc": ["taglet"], "application/vnd.neurolanguage.nlu": ["nlu"], "application/vnd.nitf": ["ntf", "nitf"], "application/vnd.noblenet-directory": ["nnd"], "application/vnd.noblenet-sealer": ["nns"], "application/vnd.noblenet-web": ["nnw"], "application/vnd.nokia.n-gage.ac+xml": ["*ac"], "application/vnd.nokia.n-gage.data": ["ngdat"], "application/vnd.nokia.n-gage.symbian.install": ["n-gage"], "application/vnd.nokia.radio-preset": ["rpst"], "application/vnd.nokia.radio-presets": ["rpss"], "application/vnd.novadigm.edm": ["edm"], "application/vnd.novadigm.edx": ["edx"], "application/vnd.novadigm.ext": ["ext"], "application/vnd.oasis.opendocument.chart": ["odc"], "application/vnd.oasis.opendocument.chart-template": ["otc"], "application/vnd.oasis.opendocument.database": ["odb"], "application/vnd.oasis.opendocument.formula": ["odf"], "application/vnd.oasis.opendocument.formula-template": ["odft"], "application/vnd.oasis.opendocument.graphics": ["odg"], "application/vnd.oasis.opendocument.graphics-template": ["otg"], "application/vnd.oasis.opendocument.image": ["odi"], "application/vnd.oasis.opendocument.image-template": ["oti"], "application/vnd.oasis.opendocument.presentation": ["odp"], "application/vnd.oasis.opendocument.presentation-template": ["otp"], "application/vnd.oasis.opendocument.spreadsheet": ["ods"], "application/vnd.oasis.opendocument.spreadsheet-template": ["ots"], "application/vnd.oasis.opendocument.text": ["odt"], "application/vnd.oasis.opendocument.text-master": ["odm"], "application/vnd.oasis.opendocument.text-template": ["ott"], "application/vnd.oasis.opendocument.text-web": ["oth"], "application/vnd.olpc-sugar": ["xo"], "application/vnd.oma.dd2+xml": ["dd2"], "application/vnd.openblox.game+xml": ["obgx"], "application/vnd.openofficeorg.extension": ["oxt"], "application/vnd.openstreetmap.data+xml": ["osm"], "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"], "application/vnd.openxmlformats-officedocument.presentationml.slide": ["sldx"], "application/vnd.openxmlformats-officedocument.presentationml.slideshow": ["ppsx"], "application/vnd.openxmlformats-officedocument.presentationml.template": ["potx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"], "application/vnd.openxmlformats-officedocument.spreadsheetml.template": ["xltx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"], "application/vnd.openxmlformats-officedocument.wordprocessingml.template": ["dotx"], "application/vnd.osgeo.mapguide.package": ["mgp"], "application/vnd.osgi.dp": ["dp"], "application/vnd.osgi.subsystem": ["esa"], "application/vnd.palm": ["pdb", "pqa", "oprc"], "application/vnd.pawaafile": ["paw"], "application/vnd.pg.format": ["str"], "application/vnd.pg.osasli": ["ei6"], "application/vnd.picsel": ["efif"], "application/vnd.pmi.widget": ["wg"], "application/vnd.pocketlearn": ["plf"], "application/vnd.powerbuilder6": ["pbd"], "application/vnd.previewsystems.box": ["box"], "application/vnd.proteus.magazine": ["mgz"], "application/vnd.publishare-delta-tree": ["qps"], "application/vnd.pvi.ptid1": ["ptid"], "application/vnd.pwg-xhtml-print+xml": ["xhtm"], "application/vnd.quark.quarkxpress": ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"], "application/vnd.rar": ["rar"], "application/vnd.realvnc.bed": ["bed"], "application/vnd.recordare.musicxml": ["mxl"], "application/vnd.recordare.musicxml+xml": ["musicxml"], "application/vnd.rig.cryptonote": ["cryptonote"], "application/vnd.rim.cod": ["cod"], "application/vnd.rn-realmedia": ["rm"], "application/vnd.rn-realmedia-vbr": ["rmvb"], "application/vnd.route66.link66+xml": ["link66"], "application/vnd.sailingtracker.track": ["st"], "application/vnd.seemail": ["see"], "application/vnd.sema": ["sema"], "application/vnd.semd": ["semd"], "application/vnd.semf": ["semf"], "application/vnd.shana.informed.formdata": ["ifm"], "application/vnd.shana.informed.formtemplate": ["itp"], "application/vnd.shana.informed.interchange": ["iif"], "application/vnd.shana.informed.package": ["ipk"], "application/vnd.simtech-mindmapper": ["twd", "twds"], "application/vnd.smaf": ["mmf"], "application/vnd.smart.teacher": ["teacher"], "application/vnd.software602.filler.form+xml": ["fo"], "application/vnd.solent.sdkm+xml": ["sdkm", "sdkd"], "application/vnd.spotfire.dxp": ["dxp"], "application/vnd.spotfire.sfs": ["sfs"], "application/vnd.stardivision.calc": ["sdc"], "application/vnd.stardivision.draw": ["sda"], "application/vnd.stardivision.impress": ["sdd"], "application/vnd.stardivision.math": ["smf"], "application/vnd.stardivision.writer": ["sdw", "vor"], "application/vnd.stardivision.writer-global": ["sgl"], "application/vnd.stepmania.package": ["smzip"], "application/vnd.stepmania.stepchart": ["sm"], "application/vnd.sun.wadl+xml": ["wadl"], "application/vnd.sun.xml.calc": ["sxc"], "application/vnd.sun.xml.calc.template": ["stc"], "application/vnd.sun.xml.draw": ["sxd"], "application/vnd.sun.xml.draw.template": ["std"], "application/vnd.sun.xml.impress": ["sxi"], "application/vnd.sun.xml.impress.template": ["sti"], "application/vnd.sun.xml.math": ["sxm"], "application/vnd.sun.xml.writer": ["sxw"], "application/vnd.sun.xml.writer.global": ["sxg"], "application/vnd.sun.xml.writer.template": ["stw"], "application/vnd.sus-calendar": ["sus", "susp"], "application/vnd.svd": ["svd"], "application/vnd.symbian.install": ["sis", "sisx"], "application/vnd.syncml+xml": ["xsm"], "application/vnd.syncml.dm+wbxml": ["bdm"], "application/vnd.syncml.dm+xml": ["xdm"], "application/vnd.syncml.dmddf+xml": ["ddf"], "application/vnd.tao.intent-module-archive": ["tao"], "application/vnd.tcpdump.pcap": ["pcap", "cap", "dmp"], "application/vnd.tmobile-livetv": ["tmo"], "application/vnd.trid.tpt": ["tpt"], "application/vnd.triscape.mxs": ["mxs"], "application/vnd.trueapp": ["tra"], "application/vnd.ufdl": ["ufd", "ufdl"], "application/vnd.uiq.theme": ["utz"], "application/vnd.umajin": ["umj"], "application/vnd.unity": ["unityweb"], "application/vnd.uoml+xml": ["uoml", "uo"], "application/vnd.vcx": ["vcx"], "application/vnd.visio": ["vsd", "vst", "vss", "vsw"], "application/vnd.visionary": ["vis"], "application/vnd.vsf": ["vsf"], "application/vnd.wap.wbxml": ["wbxml"], "application/vnd.wap.wmlc": ["wmlc"], "application/vnd.wap.wmlscriptc": ["wmlsc"], "application/vnd.webturbo": ["wtb"], "application/vnd.wolfram.player": ["nbp"], "application/vnd.wordperfect": ["wpd"], "application/vnd.wqd": ["wqd"], "application/vnd.wt.stf": ["stf"], "application/vnd.xara": ["xar"], "application/vnd.xfdl": ["xfdl"], "application/vnd.yamaha.hv-dic": ["hvd"], "application/vnd.yamaha.hv-script": ["hvs"], "application/vnd.yamaha.hv-voice": ["hvp"], "application/vnd.yamaha.openscoreformat": ["osf"], "application/vnd.yamaha.openscoreformat.osfpvg+xml": ["osfpvg"], "application/vnd.yamaha.smaf-audio": ["saf"], "application/vnd.yamaha.smaf-phrase": ["spf"], "application/vnd.yellowriver-custom-menu": ["cmp"], "application/vnd.zul": ["zir", "zirz"], "application/vnd.zzazz.deck+xml": ["zaz"], "application/x-7z-compressed": ["7z"], "application/x-abiword": ["abw"], "application/x-ace-compressed": ["ace"], "application/x-apple-diskimage": ["*dmg"], "application/x-arj": ["arj"], "application/x-authorware-bin": ["aab", "x32", "u32", "vox"], "application/x-authorware-map": ["aam"], "application/x-authorware-seg": ["aas"], "application/x-bcpio": ["bcpio"], "application/x-bdoc": ["*bdoc"], "application/x-bittorrent": ["torrent"], "application/x-blorb": ["blb", "blorb"], "application/x-bzip": ["bz"], "application/x-bzip2": ["bz2", "boz"], "application/x-cbr": ["cbr", "cba", "cbt", "cbz", "cb7"], "application/x-cdlink": ["vcd"], "application/x-cfs-compressed": ["cfs"], "application/x-chat": ["chat"], "application/x-chess-pgn": ["pgn"], "application/x-chrome-extension": ["crx"], "application/x-cocoa": ["cco"], "application/x-conference": ["nsc"], "application/x-cpio": ["cpio"], "application/x-csh": ["csh"], "application/x-debian-package": ["*deb", "udeb"], "application/x-dgc-compressed": ["dgc"], "application/x-director": ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"], "application/x-doom": ["wad"], "application/x-dtbncx+xml": ["ncx"], "application/x-dtbook+xml": ["dtb"], "application/x-dtbresource+xml": ["res"], "application/x-dvi": ["dvi"], "application/x-envoy": ["evy"], "application/x-eva": ["eva"], "application/x-font-bdf": ["bdf"], "application/x-font-ghostscript": ["gsf"], "application/x-font-linux-psf": ["psf"], "application/x-font-pcf": ["pcf"], "application/x-font-snf": ["snf"], "application/x-font-type1": ["pfa", "pfb", "pfm", "afm"], "application/x-freearc": ["arc"], "application/x-futuresplash": ["spl"], "application/x-gca-compressed": ["gca"], "application/x-glulx": ["ulx"], "application/x-gnumeric": ["gnumeric"], "application/x-gramps-xml": ["gramps"], "application/x-gtar": ["gtar"], "application/x-hdf": ["hdf"], "application/x-httpd-php": ["php"], "application/x-install-instructions": ["install"], "application/x-iso9660-image": ["*iso"], "application/x-iwork-keynote-sffkey": ["*key"], "application/x-iwork-numbers-sffnumbers": ["*numbers"], "application/x-iwork-pages-sffpages": ["*pages"], "application/x-java-archive-diff": ["jardiff"], "application/x-java-jnlp-file": ["jnlp"], "application/x-keepass2": ["kdbx"], "application/x-latex": ["latex"], "application/x-lua-bytecode": ["luac"], "application/x-lzh-compressed": ["lzh", "lha"], "application/x-makeself": ["run"], "application/x-mie": ["mie"], "application/x-mobipocket-ebook": ["*prc", "mobi"], "application/x-ms-application": ["application"], "application/x-ms-shortcut": ["lnk"], "application/x-ms-wmd": ["wmd"], "application/x-ms-wmz": ["wmz"], "application/x-ms-xbap": ["xbap"], "application/x-msaccess": ["mdb"], "application/x-msbinder": ["obd"], "application/x-mscardfile": ["crd"], "application/x-msclip": ["clp"], "application/x-msdos-program": ["*exe"], "application/x-msdownload": ["*exe", "*dll", "com", "bat", "*msi"], "application/x-msmediaview": ["mvb", "m13", "m14"], "application/x-msmetafile": ["*wmf", "*wmz", "*emf", "emz"], "application/x-msmoney": ["mny"], "application/x-mspublisher": ["pub"], "application/x-msschedule": ["scd"], "application/x-msterminal": ["trm"], "application/x-mswrite": ["wri"], "application/x-netcdf": ["nc", "cdf"], "application/x-ns-proxy-autoconfig": ["pac"], "application/x-nzb": ["nzb"], "application/x-perl": ["pl", "pm"], "application/x-pilot": ["*prc", "*pdb"], "application/x-pkcs12": ["p12", "pfx"], "application/x-pkcs7-certificates": ["p7b", "spc"], "application/x-pkcs7-certreqresp": ["p7r"], "application/x-rar-compressed": ["*rar"], "application/x-redhat-package-manager": ["rpm"], "application/x-research-info-systems": ["ris"], "application/x-sea": ["sea"], "application/x-sh": ["sh"], "application/x-shar": ["shar"], "application/x-shockwave-flash": ["swf"], "application/x-silverlight-app": ["xap"], "application/x-sql": ["*sql"], "application/x-stuffit": ["sit"], "application/x-stuffitx": ["sitx"], "application/x-subrip": ["srt"], "application/x-sv4cpio": ["sv4cpio"], "application/x-sv4crc": ["sv4crc"], "application/x-t3vm-image": ["t3"], "application/x-tads": ["gam"], "application/x-tar": ["tar"], "application/x-tcl": ["tcl", "tk"], "application/x-tex": ["tex"], "application/x-tex-tfm": ["tfm"], "application/x-texinfo": ["texinfo", "texi"], "application/x-tgif": ["*obj"], "application/x-ustar": ["ustar"], "application/x-virtualbox-hdd": ["hdd"], "application/x-virtualbox-ova": ["ova"], "application/x-virtualbox-ovf": ["ovf"], "application/x-virtualbox-vbox": ["vbox"], "application/x-virtualbox-vbox-extpack": ["vbox-extpack"], "application/x-virtualbox-vdi": ["vdi"], "application/x-virtualbox-vhd": ["vhd"], "application/x-virtualbox-vmdk": ["vmdk"], "application/x-wais-source": ["src"], "application/x-web-app-manifest+json": ["webapp"], "application/x-x509-ca-cert": ["der", "crt", "pem"], "application/x-xfig": ["fig"], "application/x-xliff+xml": ["*xlf"], "application/x-xpinstall": ["xpi"], "application/x-xz": ["xz"], "application/x-zmachine": ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"], "audio/vnd.dece.audio": ["uva", "uvva"], "audio/vnd.digital-winds": ["eol"], "audio/vnd.dra": ["dra"], "audio/vnd.dts": ["dts"], "audio/vnd.dts.hd": ["dtshd"], "audio/vnd.lucent.voice": ["lvp"], "audio/vnd.ms-playready.media.pya": ["pya"], "audio/vnd.nuera.ecelp4800": ["ecelp4800"], "audio/vnd.nuera.ecelp7470": ["ecelp7470"], "audio/vnd.nuera.ecelp9600": ["ecelp9600"], "audio/vnd.rip": ["rip"], "audio/x-aac": ["*aac"], "audio/x-aiff": ["aif", "aiff", "aifc"], "audio/x-caf": ["caf"], "audio/x-flac": ["flac"], "audio/x-m4a": ["*m4a"], "audio/x-matroska": ["mka"], "audio/x-mpegurl": ["m3u"], "audio/x-ms-wax": ["wax"], "audio/x-ms-wma": ["wma"], "audio/x-pn-realaudio": ["ram", "ra"], "audio/x-pn-realaudio-plugin": ["rmp"], "audio/x-realaudio": ["*ra"], "audio/x-wav": ["*wav"], "chemical/x-cdx": ["cdx"], "chemical/x-cif": ["cif"], "chemical/x-cmdf": ["cmdf"], "chemical/x-cml": ["cml"], "chemical/x-csml": ["csml"], "chemical/x-xyz": ["xyz"], "image/prs.btif": ["btif", "btf"], "image/prs.pti": ["pti"], "image/vnd.adobe.photoshop": ["psd"], "image/vnd.airzip.accelerator.azv": ["azv"], "image/vnd.dece.graphic": ["uvi", "uvvi", "uvg", "uvvg"], "image/vnd.djvu": ["djvu", "djv"], "image/vnd.dvb.subtitle": ["*sub"], "image/vnd.dwg": ["dwg"], "image/vnd.dxf": ["dxf"], "image/vnd.fastbidsheet": ["fbs"], "image/vnd.fpx": ["fpx"], "image/vnd.fst": ["fst"], "image/vnd.fujixerox.edmics-mmr": ["mmr"], "image/vnd.fujixerox.edmics-rlc": ["rlc"], "image/vnd.microsoft.icon": ["ico"], "image/vnd.ms-dds": ["dds"], "image/vnd.ms-modi": ["mdi"], "image/vnd.ms-photo": ["wdp"], "image/vnd.net-fpx": ["npx"], "image/vnd.pco.b16": ["b16"], "image/vnd.tencent.tap": ["tap"], "image/vnd.valve.source.texture": ["vtf"], "image/vnd.wap.wbmp": ["wbmp"], "image/vnd.xiff": ["xif"], "image/vnd.zbrush.pcx": ["pcx"], "image/x-3ds": ["3ds"], "image/x-cmu-raster": ["ras"], "image/x-cmx": ["cmx"], "image/x-freehand": ["fh", "fhc", "fh4", "fh5", "fh7"], "image/x-icon": ["*ico"], "image/x-jng": ["jng"], "image/x-mrsid-image": ["sid"], "image/x-ms-bmp": ["*bmp"], "image/x-pcx": ["*pcx"], "image/x-pict": ["pic", "pct"], "image/x-portable-anymap": ["pnm"], "image/x-portable-bitmap": ["pbm"], "image/x-portable-graymap": ["pgm"], "image/x-portable-pixmap": ["ppm"], "image/x-rgb": ["rgb"], "image/x-tga": ["tga"], "image/x-xbitmap": ["xbm"], "image/x-xpixmap": ["xpm"], "image/x-xwindowdump": ["xwd"], "message/vnd.wfa.wsc": ["wsc"], "model/vnd.cld": ["cld"], "model/vnd.collada+xml": ["dae"], "model/vnd.dwf": ["dwf"], "model/vnd.gdl": ["gdl"], "model/vnd.gtw": ["gtw"], "model/vnd.mts": ["mts"], "model/vnd.opengex": ["ogex"], "model/vnd.parasolid.transmit.binary": ["x_b"], "model/vnd.parasolid.transmit.text": ["x_t"], "model/vnd.pytha.pyox": ["pyo", "pyox"], "model/vnd.sap.vds": ["vds"], "model/vnd.usda": ["usda"], "model/vnd.usdz+zip": ["usdz"], "model/vnd.valve.source.compiled-map": ["bsp"], "model/vnd.vtu": ["vtu"], "text/prs.lines.tag": ["dsc"], "text/vnd.curl": ["curl"], "text/vnd.curl.dcurl": ["dcurl"], "text/vnd.curl.mcurl": ["mcurl"], "text/vnd.curl.scurl": ["scurl"], "text/vnd.dvb.subtitle": ["sub"], "text/vnd.familysearch.gedcom": ["ged"], "text/vnd.fly": ["fly"], "text/vnd.fmi.flexstor": ["flx"], "text/vnd.graphviz": ["gv"], "text/vnd.in3d.3dml": ["3dml"], "text/vnd.in3d.spot": ["spot"], "text/vnd.sun.j2me.app-descriptor": ["jad"], "text/vnd.wap.wml": ["wml"], "text/vnd.wap.wmlscript": ["wmls"], "text/x-asm": ["s", "asm"], "text/x-c": ["c", "cc", "cxx", "cpp", "h", "hh", "dic"], "text/x-component": ["htc"], "text/x-fortran": ["f", "for", "f77", "f90"], "text/x-handlebars-template": ["hbs"], "text/x-java-source": ["java"], "text/x-lua": ["lua"], "text/x-markdown": ["mkd"], "text/x-nfo": ["nfo"], "text/x-opml": ["opml"], "text/x-org": ["*org"], "text/x-pascal": ["p", "pas"], "text/x-processing": ["pde"], "text/x-sass": ["sass"], "text/x-scss": ["scss"], "text/x-setext": ["etx"], "text/x-sfv": ["sfv"], "text/x-suse-ymp": ["ymp"], "text/x-uuencode": ["uu"], "text/x-vcalendar": ["vcs"], "text/x-vcard": ["vcf"], "video/vnd.dece.hd": ["uvh", "uvvh"], "video/vnd.dece.mobile": ["uvm", "uvvm"], "video/vnd.dece.pd": ["uvp", "uvvp"], "video/vnd.dece.sd": ["uvs", "uvvs"], "video/vnd.dece.video": ["uvv", "uvvv"], "video/vnd.dvb.file": ["dvb"], "video/vnd.fvt": ["fvt"], "video/vnd.mpegurl": ["mxu", "m4u"], "video/vnd.ms-playready.media.pyv": ["pyv"], "video/vnd.uvvu.mp4": ["uvu", "uvvu"], "video/vnd.vivo": ["viv"], "video/x-f4v": ["f4v"], "video/x-fli": ["fli"], "video/x-flv": ["flv"], "video/x-m4v": ["m4v"], "video/x-matroska": ["mkv", "mk3d", "mks"], "video/x-mng": ["mng"], "video/x-ms-asf": ["asf", "asx"], "video/x-ms-vob": ["vob"], "video/x-ms-wm": ["wm"], "video/x-ms-wmv": ["wmv"], "video/x-ms-wmx": ["wmx"], "video/x-ms-wvx": ["wvx"], "video/x-msvideo": ["avi"], "video/x-sgi-movie": ["movie"], "video/x-smv": ["smv"], "x-conference/x-cooltalk": ["ice"] };
@@ -63889,11 +63892,9 @@ var Mime_default = Mime;
63889
63892
  var src_default = new Mime_default(standard_default, other_default)._freeze();
63890
63893
 
63891
63894
  // src/app/add.ts
63892
- var import_node_fs10 = require("node:fs");
63893
- var addApp = async (appId, options, throwErr = true) => {
63894
- if (throwErr) {
63895
+ async function addApp(appId, options, throwErr = true) {
63896
+ if (throwErr)
63895
63897
  oe(`Adding`);
63896
- }
63897
63898
  await checkLatest();
63898
63899
  options.apikey = options.apikey || findSavedKey();
63899
63900
  const config = await getConfig();
@@ -63924,9 +63925,8 @@ var addApp = async (appId, options, throwErr = true) => {
63924
63925
  f2.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project");
63925
63926
  program.error("");
63926
63927
  }
63927
- if (throwErr) {
63928
+ if (throwErr)
63928
63929
  f2.info(`Adding ${appId} to Capgo`);
63929
- }
63930
63930
  let iconBuff;
63931
63931
  let iconType;
63932
63932
  if (icon && (0, import_node_fs10.existsSync)(icon)) {
@@ -63993,13 +63993,13 @@ var addApp = async (appId, options, throwErr = true) => {
63993
63993
  f2.success(`App ${appId} added to Capgo. ${throwErr ? "You can upload a bundle now" : ""}`);
63994
63994
  if (throwErr) {
63995
63995
  $e(`Done \u2705`);
63996
- process.exit();
63996
+ import_node_process15.default.exit();
63997
63997
  }
63998
63998
  return true;
63999
- };
64000
- var addCommand = async (apikey, options) => {
63999
+ }
64000
+ async function addCommand(apikey, options) {
64001
64001
  addApp(apikey, options, true);
64002
- };
64002
+ }
64003
64003
 
64004
64004
  // src/init.ts
64005
64005
  var importInject = "import { CapacitorUpdater } from '@capgo/capacitor-updater'";
@@ -64007,31 +64007,32 @@ var codeInject = "CapacitorUpdater.notifyAppReady()";
64007
64007
  var regexImport = /import.*from.*/g;
64008
64008
  var defaultChannel = "production";
64009
64009
  var execOption = { stdio: "pipe" };
64010
- var cancelCommand2 = async (command, userId, snag) => {
64010
+ async function cancelCommand2(command, userId, snag) {
64011
64011
  if (eD(command)) {
64012
64012
  await markSnag("onboarding-v2", userId, snag, "canceled", "\u{1F937}");
64013
- process.exit();
64013
+ import_node_process16.default.exit();
64014
64014
  }
64015
- };
64016
- var markStep = async (userId, snag, step) => markSnag("onboarding-v2", userId, snag, `onboarding-step-${step}`);
64017
- var step2 = async (userId, snag, appId, options) => {
64015
+ }
64016
+ async function markStep(userId, snag, step) {
64017
+ return markSnag("onboarding-v2", userId, snag, `onboarding-step-${step}`);
64018
+ }
64019
+ async function step2(userId, snag, appId, options) {
64018
64020
  const doAdd = await se({ message: `Add ${appId} in Capgo?` });
64019
64021
  await cancelCommand2(doAdd, userId, snag);
64020
64022
  if (doAdd) {
64021
64023
  const s = de();
64022
64024
  s.start(`Running: npx @capgo/cli@latest app add ${appId}`);
64023
64025
  const addRes = await addApp(appId, options, false);
64024
- if (!addRes) {
64026
+ if (!addRes)
64025
64027
  s.stop(`App already add \u2705`);
64026
- } else {
64028
+ else
64027
64029
  s.stop(`App add Done \u2705`);
64028
- }
64029
64030
  } else {
64030
64031
  f2.info(`Run yourself "npx @capgo/cli@latest app add ${appId}"`);
64031
64032
  }
64032
64033
  await markStep(userId, snag, 2);
64033
- };
64034
- var step3 = async (userId, snag, apikey, appId) => {
64034
+ }
64035
+ async function step3(userId, snag, apikey, appId) {
64035
64036
  const doChannel = await se({ message: `Create default channel ${defaultChannel} for ${appId} in Capgo?` });
64036
64037
  await cancelCommand2(doChannel, userId, snag);
64037
64038
  if (doChannel) {
@@ -64041,18 +64042,17 @@ var step3 = async (userId, snag, apikey, appId) => {
64041
64042
  default: true,
64042
64043
  apikey
64043
64044
  }, false);
64044
- if (!addChannelRes) {
64045
+ if (!addChannelRes)
64045
64046
  s.stop(`Channel already added \u2705`);
64046
- } else {
64047
+ else
64047
64048
  s.stop(`Channel add Done \u2705`);
64048
- }
64049
64049
  } else {
64050
64050
  f2.info(`Run yourself "npx @capgo/cli@latest channel add ${defaultChannel} ${appId} --default"`);
64051
64051
  }
64052
64052
  await markStep(userId, snag, 3);
64053
- };
64053
+ }
64054
64054
  var urlMigrateV5 = "https://capacitorjs.com/docs/updating/5-0";
64055
- var step4 = async (userId, snag, apikey, appId) => {
64055
+ async function step4(userId, snag, apikey, appId) {
64056
64056
  const doInstall = await se({ message: `Automatic Install "@capgo/capacitor-updater" dependency in ${appId}?` });
64057
64057
  await cancelCommand2(doInstall, userId, snag);
64058
64058
  if (doInstall) {
@@ -64063,29 +64063,29 @@ var step4 = async (userId, snag, apikey, appId) => {
64063
64063
  coreVersion = coreVersion?.replace("^", "").replace("~", "");
64064
64064
  if (!coreVersion) {
64065
64065
  s.stop(`Cannot find @capacitor/core in package.json, please run \`capgo init\` in a capacitor project`);
64066
- process.exit();
64066
+ import_node_process16.default.exit();
64067
64067
  } else if (import_semver.default.lt(coreVersion, "5.0.0")) {
64068
64068
  s.stop(`@capacitor/core version is ${coreVersion}, please update to Capacitor v5 first: ${urlMigrateV5}`);
64069
- process.exit();
64069
+ import_node_process16.default.exit();
64070
64070
  }
64071
64071
  const pm = findPackageManagerType();
64072
64072
  if (pm === "unknown") {
64073
64073
  s.stop(`Cannot reconize package manager, please run \`capgo init\` in a capacitor project with npm, pnpm or yarn`);
64074
- process.exit();
64074
+ import_node_process16.default.exit();
64075
64075
  }
64076
64076
  const installCmd = pm === "yarn" ? "add" : "install";
64077
64077
  if (pack.dependencies["@capgo/capacitor-updater"]) {
64078
64078
  s.stop(`Capgo already installed \u2705`);
64079
64079
  } else {
64080
- await (0, import_child_process.execSync)(`${pm} ${installCmd} @capgo/capacitor-updater@latest`, execOption);
64080
+ await (0, import_node_child_process6.execSync)(`${pm} ${installCmd} @capgo/capacitor-updater@latest`, execOption);
64081
64081
  s.stop(`Install Done \u2705`);
64082
64082
  }
64083
64083
  } else {
64084
64084
  f2.info(`Run yourself "npm i @capgo/capacitor-updater@latest"`);
64085
64085
  }
64086
64086
  await markStep(userId, snag, 4);
64087
- };
64088
- var step5 = async (userId, snag, apikey, appId) => {
64087
+ }
64088
+ async function step5(userId, snag, apikey, appId) {
64089
64089
  const doAddCode = await se({ message: `Automatic Add "${codeInject}" code and import in ${appId}?` });
64090
64090
  await cancelCommand2(doAddCode, userId, snag);
64091
64091
  if (doAddCode) {
@@ -64094,7 +64094,7 @@ var step5 = async (userId, snag, apikey, appId) => {
64094
64094
  const mainFilePath = await findMainFile();
64095
64095
  if (!mainFilePath) {
64096
64096
  s.stop("No main.ts, main.js, index.ts or index.js file found, You need to add @capgo/capacitor-updater manually");
64097
- process.exit();
64097
+ import_node_process16.default.exit();
64098
64098
  }
64099
64099
  const mainFile = (0, import_node_fs11.readFileSync)(mainFilePath);
64100
64100
  const mainFileContent = mainFile.toString();
@@ -64102,7 +64102,7 @@ var step5 = async (userId, snag, apikey, appId) => {
64102
64102
  const last = matches?.pop();
64103
64103
  if (!last) {
64104
64104
  s.stop(`Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/installation/`);
64105
- process.exit();
64105
+ import_node_process16.default.exit();
64106
64106
  }
64107
64107
  if (mainFileContent.includes(codeInject)) {
64108
64108
  s.stop(`Code already added to ${mainFilePath} \u2705`);
@@ -64124,8 +64124,8 @@ ${importInject};
64124
64124
  ${codeInject};
64125
64125
  `);
64126
64126
  }
64127
- };
64128
- var step6 = async (userId, snag, apikey, appId) => {
64127
+ }
64128
+ async function step6(userId, snag, apikey, appId) {
64129
64129
  const doEncrypt = await se({ message: `Automatic configure end-to-end encryption in ${appId} updates?` });
64130
64130
  await cancelCommand2(doEncrypt, userId, snag);
64131
64131
  if (doEncrypt) {
@@ -64134,15 +64134,15 @@ var step6 = async (userId, snag, apikey, appId) => {
64134
64134
  const keyRes = await createKey({}, false);
64135
64135
  if (!keyRes) {
64136
64136
  s.stop(`Cannot create key \u274C`);
64137
- process.exit(1);
64137
+ import_node_process16.default.exit(1);
64138
64138
  } else {
64139
64139
  s.stop(`key created \u{1F511}`);
64140
64140
  }
64141
64141
  markSnag("onboarding-v2", userId, snag, "Use encryption");
64142
64142
  }
64143
64143
  await markStep(userId, snag, 6);
64144
- };
64145
- var step7 = async (userId, snag, apikey, appId) => {
64144
+ }
64145
+ async function step7(userId, snag, apikey, appId) {
64146
64146
  const doBuild = await se({ message: `Automatic build ${appId} with "npm run build" ?` });
64147
64147
  await cancelCommand2(doBuild, userId, snag);
64148
64148
  if (doBuild) {
@@ -64151,16 +64151,16 @@ var step7 = async (userId, snag, apikey, appId) => {
64151
64151
  const pack = JSON.parse((0, import_node_fs11.readFileSync)("package.json").toString());
64152
64152
  if (!pack.scripts?.build) {
64153
64153
  s.stop(`Cannot find build script in package.json, please add it and run \`capgo init\` again`);
64154
- process.exit();
64154
+ import_node_process16.default.exit();
64155
64155
  }
64156
- (0, import_child_process.execSync)(`npm run build && npx cap sync`, execOption);
64156
+ (0, import_node_child_process6.execSync)(`npm run build && npx cap sync`, execOption);
64157
64157
  s.stop(`Build & Sync Done \u2705`);
64158
64158
  } else {
64159
64159
  f2.info(`Build yourself with command: npm run build && npx cap sync`);
64160
64160
  }
64161
64161
  await markStep(userId, snag, 7);
64162
- };
64163
- var step8 = async (userId, snag, apikey, appId) => {
64162
+ }
64163
+ async function step8(userId, snag, apikey, appId) {
64164
64164
  const doBundle = await se({ message: `Automatic upload ${appId} bundle to Capgo?` });
64165
64165
  await cancelCommand2(doBundle, userId, snag);
64166
64166
  if (doBundle) {
@@ -64172,7 +64172,7 @@ var step8 = async (userId, snag, apikey, appId) => {
64172
64172
  }, false);
64173
64173
  if (!uploadRes) {
64174
64174
  s.stop(`Upload failed \u274C`);
64175
- process.exit();
64175
+ import_node_process16.default.exit();
64176
64176
  } else {
64177
64177
  s.stop(`Upload Done \u2705`);
64178
64178
  }
@@ -64180,8 +64180,8 @@ var step8 = async (userId, snag, apikey, appId) => {
64180
64180
  f2.info(`Upload yourself with command: npx @capgo/cli@latest bundle upload`);
64181
64181
  }
64182
64182
  await markStep(userId, snag, 8);
64183
- };
64184
- var step9 = async (userId, snag) => {
64183
+ }
64184
+ async function step9(userId, snag) {
64185
64185
  const doRun = await se({ message: `Run in device now ?` });
64186
64186
  await cancelCommand2(doRun, userId, snag);
64187
64187
  if (doRun) {
@@ -64192,20 +64192,19 @@ var step9 = async (userId, snag) => {
64192
64192
  { value: "android", label: "Android" }
64193
64193
  ]
64194
64194
  });
64195
- if (eD(plaformType)) {
64196
- process.exit();
64197
- }
64195
+ if (eD(plaformType))
64196
+ import_node_process16.default.exit();
64198
64197
  const platform2 = plaformType;
64199
64198
  const s = de();
64200
64199
  s.start(`Running: npx cap run ${platform2}`);
64201
- await (0, import_child_process.spawnSync)("npx", ["cap", "run", platform2], { stdio: "inherit" });
64200
+ await (0, import_node_child_process6.spawnSync)("npx", ["cap", "run", platform2], { stdio: "inherit" });
64202
64201
  s.stop(`Started Done \u2705`);
64203
64202
  } else {
64204
64203
  f2.info(`Run yourself with command: npx cap run <ios|android>`);
64205
64204
  }
64206
64205
  await markStep(userId, snag, 9);
64207
- };
64208
- var step10 = async (userId, snag, supabase, appId) => {
64206
+ }
64207
+ async function step10(userId, snag, supabase, appId) {
64209
64208
  const doRun = await se({ message: `Automatic check if update working in device ?` });
64210
64209
  await cancelCommand2(doRun, userId, snag);
64211
64210
  if (doRun) {
@@ -64217,8 +64216,8 @@ var step10 = async (userId, snag, supabase, appId) => {
64217
64216
  f2.info(`Check logs in https://web.capgo.app/app/p/${appIdUrl}/logs to see if update works.`);
64218
64217
  }
64219
64218
  await markStep(userId, snag, 10);
64220
- };
64221
- var initApp = async (apikey, appId, options) => {
64219
+ }
64220
+ async function initApp(apikey, appId, options) {
64222
64221
  oe(`Capgo onboarding \u{1F6EB}`);
64223
64222
  await checkLatest();
64224
64223
  const snag = useLogSnag();
@@ -64228,11 +64227,10 @@ var initApp = async (apikey, appId, options) => {
64228
64227
  const log = de();
64229
64228
  log.start("Running: npx @capgo/cli@latest login ***");
64230
64229
  const loginRes = await login(apikey, options, false);
64231
- if (!loginRes) {
64230
+ if (!loginRes)
64232
64231
  log.stop("Login already done \u2705");
64233
- } else {
64232
+ else
64234
64233
  log.stop("Login Done \u2705");
64235
- }
64236
64234
  const supabase = await createSupabaseClient(apikey);
64237
64235
  const userId = await verifyUser(supabase, apikey, ["upload", "all", "read", "write"]);
64238
64236
  await markStep(userId, snag, 1);
@@ -64250,14 +64248,18 @@ var initApp = async (apikey, appId, options) => {
64250
64248
  f2.info(`Your Capgo update system is setup`);
64251
64249
  f2.info(`Next time use \`npx @capgo/cli@latest bundle upload\` to only upload your bundle`);
64252
64250
  $e(`Bye \u{1F44B}`);
64253
- process.exit();
64254
- };
64251
+ import_node_process16.default.exit();
64252
+ }
64253
+
64254
+ // src/bundle/list.ts
64255
+ var import_node_process18 = __toESM(require("node:process"));
64255
64256
 
64256
64257
  // src/api/versions.ts
64257
64258
  var import_console_table_printer2 = __toESM(require_dist18());
64258
64259
 
64259
64260
  // src/api/devices_override.ts
64260
- var checkVersionNotUsedInDeviceOverride = async (supabase, appid, versionData) => {
64261
+ var import_node_process17 = __toESM(require("node:process"));
64262
+ async function checkVersionNotUsedInDeviceOverride(supabase, appid, versionData) {
64261
64263
  const { data: deviceFound, error: errorDevice } = await supabase.from("devices_override").select().eq("app_id", appid).eq("version", versionData.id);
64262
64264
  if (errorDevice) {
64263
64265
  f2.error(`Cannot check Device override ${appid}@${versionData.name}`);
@@ -64272,7 +64274,7 @@ var checkVersionNotUsedInDeviceOverride = async (supabase, appid, versionData) =
64272
64274
  const { error: errorDeviceDel } = await supabase.from("devices_override").delete().eq("device_id", device.device_id);
64273
64275
  if (errorDeviceDel) {
64274
64276
  s.stop(`Cannot unlink device ${device.device_id} ${formatError(errorDeviceDel)}`);
64275
- process.exit(1);
64277
+ import_node_process17.default.exit(1);
64276
64278
  }
64277
64279
  s.stop(`\u2705 Device ${device.device_id} unlinked`);
64278
64280
  }
@@ -64281,10 +64283,10 @@ var checkVersionNotUsedInDeviceOverride = async (supabase, appid, versionData) =
64281
64283
  program.error("");
64282
64284
  }
64283
64285
  }
64284
- };
64286
+ }
64285
64287
 
64286
64288
  // src/api/versions.ts
64287
- var deleteAppVersion = async (supabase, appid, userId, bundle2) => {
64289
+ async function deleteAppVersion(supabase, appid, userId, bundle2) {
64288
64290
  const { error: delAppSpecVersionError } = await supabase.from("app_versions").update({
64289
64291
  deleted: true
64290
64292
  }).eq("app_id", appid).eq("deleted", false).eq("user_id", userId).eq("name", bundle2);
@@ -64292,14 +64294,14 @@ var deleteAppVersion = async (supabase, appid, userId, bundle2) => {
64292
64294
  f2.error(`App Version ${appid}@${bundle2} not found in database`);
64293
64295
  program.error("");
64294
64296
  }
64295
- };
64296
- var deleteSpecificVersion = async (supabase, appid, userId, bundle2) => {
64297
+ }
64298
+ async function deleteSpecificVersion(supabase, appid, userId, bundle2) {
64297
64299
  const versionData = await getVersionData(supabase, appid, userId, bundle2);
64298
64300
  await checkVersionNotUsedInChannel(supabase, appid, userId, versionData);
64299
64301
  await checkVersionNotUsedInDeviceOverride(supabase, appid, versionData);
64300
64302
  await deleteAppVersion(supabase, appid, userId, bundle2);
64301
- };
64302
- var displayBundles = (data) => {
64303
+ }
64304
+ function displayBundles(data) {
64303
64305
  const t = new import_console_table_printer2.Table({
64304
64306
  title: "Bundles",
64305
64307
  charLength: { "\u274C": 2, "\u2705": 2 }
@@ -64312,34 +64314,34 @@ var displayBundles = (data) => {
64312
64314
  });
64313
64315
  });
64314
64316
  f2.success(t.render());
64315
- };
64316
- var getActiveAppVersions = async (supabase, appid, userId) => {
64317
+ }
64318
+ async function getActiveAppVersions(supabase, appid, userId) {
64317
64319
  const { data, error: vError } = await supabase.from("app_versions").select().eq("app_id", appid).eq("user_id", userId).eq("deleted", false).order("created_at", { ascending: false });
64318
64320
  if (vError) {
64319
64321
  f2.error(`App ${appid} not found in database`);
64320
64322
  program.error("");
64321
64323
  }
64322
64324
  return data;
64323
- };
64324
- var getChannelsVersion = async (supabase, appid) => {
64325
+ }
64326
+ async function getChannelsVersion(supabase, appid) {
64325
64327
  const { data: channels, error: channelsError } = await supabase.from("channels").select("version").eq("app_id", appid);
64326
64328
  if (channelsError) {
64327
64329
  f2.error(`App ${appid} not found in database`);
64328
64330
  program.error("");
64329
64331
  }
64330
64332
  return channels.map((c2) => c2.version);
64331
- };
64332
- var getVersionData = async (supabase, appid, userId, bundle2) => {
64333
+ }
64334
+ async function getVersionData(supabase, appid, userId, bundle2) {
64333
64335
  const { data: versionData, error: versionIdError } = await supabase.from("app_versions").select().eq("app_id", appid).eq("user_id", userId).eq("name", bundle2).eq("deleted", false).single();
64334
64336
  if (!versionData || versionIdError) {
64335
64337
  f2.error(`App Version ${appid}@${bundle2} doesn't exist`);
64336
64338
  program.error("");
64337
64339
  }
64338
64340
  return versionData;
64339
- };
64341
+ }
64340
64342
 
64341
64343
  // src/bundle/list.ts
64342
- var listBundle = async (appId, options) => {
64344
+ async function listBundle(appId, options) {
64343
64345
  oe(`List bundles`);
64344
64346
  await checkLatest();
64345
64347
  options.apikey = options.apikey || findSavedKey();
@@ -64361,12 +64363,13 @@ var listBundle = async (appId, options) => {
64361
64363
  f2.info(`Active versions in Capgo: ${allVersions?.length}`);
64362
64364
  displayBundles(allVersions);
64363
64365
  $e(`Done \u2705`);
64364
- process.exit();
64365
- };
64366
+ import_node_process18.default.exit();
64367
+ }
64366
64368
 
64367
64369
  // src/bundle/decrypt.ts
64368
64370
  var import_node_fs12 = require("node:fs");
64369
- var decryptZip = async (zipPath, ivsessionKey, options) => {
64371
+ var import_node_process19 = __toESM(require("node:process"));
64372
+ async function decryptZip(zipPath, ivsessionKey, options) {
64370
64373
  oe(`Decrypt zip file`);
64371
64374
  await checkLatest();
64372
64375
  if (!(0, import_node_fs12.existsSync)(zipPath)) {
@@ -64392,23 +64395,24 @@ var decryptZip = async (zipPath, ivsessionKey, options) => {
64392
64395
  const decodedZip = decryptSource(zipFile, ivsessionKey, options.keyData ?? privateKey ?? "");
64393
64396
  (0, import_node_fs12.writeFileSync)(`${zipPath}_decrypted.zip`, decodedZip);
64394
64397
  $e(`Decrypted zip file at ${zipPath}_decrypted.zip`);
64395
- process.exit();
64396
- };
64398
+ import_node_process19.default.exit();
64399
+ }
64397
64400
 
64398
64401
  // src/bundle/encrypt.ts
64399
- var import_fs2 = require("fs");
64402
+ var import_node_fs13 = require("node:fs");
64403
+ var import_node_process20 = __toESM(require("node:process"));
64400
64404
  var import_ci_info2 = __toESM(require_ci_info());
64401
- var encryptZip = async (zipPath, options) => {
64405
+ async function encryptZip(zipPath, options) {
64402
64406
  oe(`Encryption`);
64403
64407
  await checkLatest();
64404
64408
  const localConfig = await getLocalConfig();
64405
- if (!(0, import_fs2.existsSync)(zipPath)) {
64409
+ if (!(0, import_node_fs13.existsSync)(zipPath)) {
64406
64410
  f2.error(`Error: Zip not found at the path ${zipPath}`);
64407
64411
  program.error("");
64408
64412
  }
64409
64413
  const keyPath = options.key || baseKeyPub;
64410
64414
  let publicKey = options.keyData || "";
64411
- if (!(0, import_fs2.existsSync)(keyPath) && !publicKey) {
64415
+ if (!(0, import_node_fs13.existsSync)(keyPath) && !publicKey) {
64412
64416
  f2.warning(`Cannot find public key ${keyPath} or as keyData option`);
64413
64417
  if (import_ci_info2.default.isCI) {
64414
64418
  f2.error(`Error: Missing public key`);
@@ -64420,26 +64424,27 @@ var encryptZip = async (zipPath, options) => {
64420
64424
  program.error("");
64421
64425
  }
64422
64426
  publicKey = localConfig.signKey || "";
64423
- } else if ((0, import_fs2.existsSync)(keyPath)) {
64424
- const keyFile = (0, import_fs2.readFileSync)(keyPath);
64427
+ } else if ((0, import_node_fs13.existsSync)(keyPath)) {
64428
+ const keyFile = (0, import_node_fs13.readFileSync)(keyPath);
64425
64429
  publicKey = keyFile.toString();
64426
64430
  }
64427
- const zipFile = (0, import_fs2.readFileSync)(zipPath);
64431
+ const zipFile = (0, import_node_fs13.readFileSync)(zipPath);
64428
64432
  const encodedZip = encryptSource(zipFile, publicKey);
64429
64433
  f2.success(`ivSessionKey: ${encodedZip.ivSessionKey}`);
64430
- (0, import_fs2.writeFileSync)(`${zipPath}_encrypted.zip`, encodedZip.encryptedData);
64434
+ (0, import_node_fs13.writeFileSync)(`${zipPath}_encrypted.zip`, encodedZip.encryptedData);
64431
64435
  f2.success(`Encrypted zip saved at ${zipPath}_encrypted.zip`);
64432
64436
  $e(`Done \u2705`);
64433
- process.exit();
64434
- };
64437
+ import_node_process20.default.exit();
64438
+ }
64435
64439
 
64436
64440
  // src/app/info.ts
64437
- var import_fs3 = require("fs");
64438
- var import_node_path3 = require("node:path");
64441
+ var import_node_fs14 = require("node:fs");
64442
+ var import_node_path4 = require("node:path");
64439
64443
  var import_node_os4 = __toESM(require("node:os"));
64444
+ var import_node_process21 = __toESM(require("node:process"));
64440
64445
  var import_get_latest_version2 = __toESM(require_src3());
64441
64446
  var import_spinnies = __toESM(require_spinnies());
64442
- var getLatestDependencies = async (installedDependencies) => {
64447
+ async function getLatestDependencies(installedDependencies) {
64443
64448
  const latestDependencies = {};
64444
64449
  const all = [];
64445
64450
  for (const dependency in installedDependencies) {
@@ -64451,18 +64456,17 @@ var getLatestDependencies = async (installedDependencies) => {
64451
64456
  const keys = Object.keys(installedDependencies);
64452
64457
  for (let i = 0; i < values.length; i += 1) {
64453
64458
  const v2 = values[i];
64454
- if (v2) {
64459
+ if (v2)
64455
64460
  latestDependencies[keys[i]] = v2;
64456
- }
64457
64461
  }
64458
64462
  });
64459
64463
  return latestDependencies;
64460
- };
64461
- var readPackageJson = async () => {
64462
- const packageJson = (0, import_fs3.readFileSync)((0, import_node_path3.join)(process.cwd(), "package.json"));
64464
+ }
64465
+ async function readPackageJson() {
64466
+ const packageJson = (0, import_node_fs14.readFileSync)((0, import_node_path4.join)(import_node_process21.default.cwd(), "package.json"));
64463
64467
  return JSON.parse(packageJson);
64464
- };
64465
- var getInstalledDependencies = async () => {
64468
+ }
64469
+ async function getInstalledDependencies() {
64466
64470
  const { dependencies } = await readPackageJson();
64467
64471
  const installedDependencies = {
64468
64472
  "@capgo/cli": package_default.version
@@ -64474,50 +64478,47 @@ var getInstalledDependencies = async () => {
64474
64478
  }
64475
64479
  }
64476
64480
  return installedDependencies;
64477
- };
64478
- var getInfo = async () => {
64479
- console.log(" \u{1F48A} Capgo Doctor \u{1F48A}\n");
64480
- console.log(` OS: ${import_node_os4.default.platform()} ${import_node_os4.default.version()}
64481
+ }
64482
+ async function getInfo() {
64483
+ f2.info(" \u{1F48A} Capgo Doctor \u{1F48A}\n");
64484
+ f2.info(` OS: ${import_node_os4.default.platform()} ${import_node_os4.default.version()}
64481
64485
  `);
64482
- console.log(` Node: ${process.version}
64486
+ f2.info(` Node: ${import_node_process21.default.version}
64483
64487
  `);
64484
- console.log(" Installed Dependencies:\n");
64488
+ f2.info(" Installed Dependencies:\n");
64485
64489
  const installedDependencies = await getInstalledDependencies();
64486
64490
  if (Object.keys(installedDependencies).length === 0) {
64487
- console.log("\n");
64488
- console.log("\x1B[31m%s\x1B[0m", "\u{1F6A8} No dependencies found");
64489
- process.exit(1);
64491
+ f2.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found");
64492
+ import_node_process21.default.exit(1);
64490
64493
  }
64491
64494
  for (const dependency in installedDependencies) {
64492
64495
  if (Object.prototype.hasOwnProperty.call(installedDependencies, dependency)) {
64493
64496
  const installedVersion = installedDependencies[dependency];
64494
- console.log(` ${dependency}: ${installedVersion}`);
64497
+ f2.info(` ${dependency}: ${installedVersion}`);
64495
64498
  }
64496
64499
  }
64497
- console.log("\n");
64500
+ f2.info("\n");
64498
64501
  const spinnies = new import_spinnies.default();
64499
- spinnies.add("loading", { text: "Loading latest dependencies" });
64502
+ spinnies.add("loading", { text: " Loading latest dependencies" });
64500
64503
  const latestDependencies = await getLatestDependencies(installedDependencies);
64501
- spinnies.succeed("loading", { text: "Latest Dependencies:" });
64502
- console.log("\n");
64504
+ spinnies.succeed("loading", { text: " Latest Dependencies:" });
64503
64505
  for (const dependency in latestDependencies) {
64504
64506
  if (Object.prototype.hasOwnProperty.call(latestDependencies, dependency)) {
64505
64507
  const latestVersion = latestDependencies[dependency];
64506
- console.log(` ${dependency}: ${latestVersion}`);
64508
+ f2.info(` ${dependency}: ${latestVersion}`);
64507
64509
  }
64508
64510
  }
64509
64511
  if (JSON.stringify(installedDependencies) !== JSON.stringify(latestDependencies)) {
64510
- console.log("\n");
64511
- console.log("\x1B[31m%s\x1B[0m", "\u{1F6A8} Some dependencies are not up to date");
64512
- process.exit(1);
64512
+ f2.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m");
64513
+ import_node_process21.default.exit(1);
64513
64514
  }
64514
- console.log("\n");
64515
- console.log("\x1B[32m%s\x1B[0m", "\u2705 All dependencies are up to date");
64516
- process.exit();
64517
- };
64515
+ f2.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m");
64516
+ import_node_process21.default.exit();
64517
+ }
64518
64518
 
64519
64519
  // src/bundle/delete.ts
64520
- var deleteBundle = async (bundleId, appId, options) => {
64520
+ var import_node_process22 = __toESM(require("node:process"));
64521
+ async function deleteBundle(bundleId, appId, options) {
64521
64522
  oe(`Delete bundle`);
64522
64523
  options.apikey = options.apikey || findSavedKey();
64523
64524
  const config = await getConfig();
@@ -64550,12 +64551,13 @@ var deleteBundle = async (bundleId, appId, options) => {
64550
64551
  await deleteSpecificVersion(supabase, appId, userId, bundleId);
64551
64552
  f2.success(`Bundle ${appId}@${bundleId} deleted in Capgo`);
64552
64553
  $e(`Done`);
64553
- process.exit();
64554
- };
64554
+ import_node_process22.default.exit();
64555
+ }
64555
64556
 
64556
64557
  // src/channel/set.ts
64558
+ var import_node_process23 = __toESM(require("node:process"));
64557
64559
  var disableAutoUpdatesPossibleOptions = ["major", "minor", "metadata", "none"];
64558
- var setChannel = async (channel2, appId, options) => {
64560
+ async function setChannel(channel2, appId, options) {
64559
64561
  oe(`Set channel`);
64560
64562
  options.apikey = options.apikey || findSavedKey();
64561
64563
  const config = await getConfig();
@@ -64604,9 +64606,8 @@ var setChannel = async (channel2, appId, options) => {
64604
64606
  channelPayload.version = data.id;
64605
64607
  }
64606
64608
  if (state != null) {
64607
- if (state === "public" || state === "private") {
64609
+ if (state === "public" || state === "private")
64608
64610
  f2.info(`Set ${appId} channel: ${channel2} to public or private is deprecated, use default or normal instead`);
64609
- }
64610
64611
  f2.info(`Set ${appId} channel: ${channel2} to ${state === "public" || state === "default" ? "default" : "normal"}`);
64611
64612
  channelPayload.public = state === "public" || state === "default";
64612
64613
  }
@@ -64632,9 +64633,8 @@ var setChannel = async (channel2, appId, options) => {
64632
64633
  f2.error(`Channel strategy ${finalDisableAutoUpdate} is not known. The possible values are: ${disableAutoUpdatesPossibleOptions.join(", ")}.`);
64633
64634
  program.error("");
64634
64635
  }
64635
- if (finalDisableAutoUpdate === "metadata") {
64636
+ if (finalDisableAutoUpdate === "metadata")
64636
64637
  finalDisableAutoUpdate = "version_number";
64637
- }
64638
64638
  channelPayload.disableAutoUpdate = finalDisableAutoUpdate;
64639
64639
  f2.info(`Set ${appId} channel: ${channel2} to ${finalDisableAutoUpdate} disable update strategy to this channel`);
64640
64640
  }
@@ -64664,11 +64664,12 @@ var setChannel = async (channel2, appId, options) => {
64664
64664
  program.error("");
64665
64665
  }
64666
64666
  $e(`Done \u2705`);
64667
- process.exit();
64668
- };
64667
+ import_node_process23.default.exit();
64668
+ }
64669
64669
 
64670
64670
  // src/channel/currentBundle.ts
64671
- var currentBundle = async (channel2, appId, options) => {
64671
+ var import_node_process24 = __toESM(require("node:process"));
64672
+ async function currentBundle(channel2, appId, options) {
64672
64673
  const { quiet } = options;
64673
64674
  if (!quiet)
64674
64675
  oe(`List current bundle`);
@@ -64703,13 +64704,14 @@ var currentBundle = async (channel2, appId, options) => {
64703
64704
  if (!quiet)
64704
64705
  f2.info(`Current bundle for channel ${channel2} is ${version.name}`);
64705
64706
  else
64706
- console.log(version.name);
64707
- process.exit();
64708
- };
64707
+ f2.info(version.name);
64708
+ import_node_process24.default.exit();
64709
+ }
64709
64710
 
64710
64711
  // src/app/list.ts
64712
+ var import_node_process25 = __toESM(require("node:process"));
64711
64713
  var import_console_table_printer3 = __toESM(require_dist18());
64712
- var displayApp = (data) => {
64714
+ function displayApp(data) {
64713
64715
  const t = new import_console_table_printer3.Table({
64714
64716
  title: "Apps",
64715
64717
  charLength: { "\u274C": 2, "\u2705": 2 }
@@ -64722,16 +64724,16 @@ var displayApp = (data) => {
64722
64724
  });
64723
64725
  });
64724
64726
  f2.success(t.render());
64725
- };
64726
- var getActiveApps = async (supabase) => {
64727
+ }
64728
+ async function getActiveApps(supabase) {
64727
64729
  const { data, error: vError } = await supabase.from("apps").select().order("created_at", { ascending: false });
64728
64730
  if (vError) {
64729
64731
  f2.error("Apps not found");
64730
64732
  program.error("");
64731
64733
  }
64732
64734
  return data;
64733
- };
64734
- var listApp = async (options) => {
64735
+ }
64736
+ async function listApp(options) {
64735
64737
  oe(`List apps in Capgo`);
64736
64738
  await checkLatest();
64737
64739
  options.apikey = options.apikey || findSavedKey();
@@ -64742,29 +64744,29 @@ var listApp = async (options) => {
64742
64744
  f2.info(`Active app in Capgo: ${allApps?.length}`);
64743
64745
  displayApp(allApps);
64744
64746
  $e(`Done \u2705`);
64745
- process.exit();
64746
- };
64747
+ import_node_process25.default.exit();
64748
+ }
64747
64749
 
64748
64750
  // src/bundle/cleanup.ts
64751
+ var import_node_process26 = __toESM(require("node:process"));
64749
64752
  var import_preload = __toESM(require_preload());
64750
64753
  var import_prompt_sync = __toESM(require_prompt_sync());
64751
64754
  var prompt = (0, import_prompt_sync.default)();
64752
- var removeVersions = async (toRemove, supabase, appid, userId) => {
64755
+ async function removeVersions(toRemove, supabase, appid, userId) {
64753
64756
  for await (const row of toRemove) {
64754
64757
  f2.warn(`Removing ${row.name} created on ${getHumanDate(row.created_at)}`);
64755
64758
  await deleteSpecificVersion(supabase, appid, userId, row.name);
64756
64759
  }
64757
- };
64758
- var getRemovableVersionsInSemverRange = (data, bundle2, nextMajor) => {
64760
+ }
64761
+ function getRemovableVersionsInSemverRange(data, bundle2, nextMajor) {
64759
64762
  const toRemove = [];
64760
64763
  data?.forEach((row) => {
64761
- if (import_preload.default.gte(row.name, bundle2) && import_preload.default.lt(row.name, `${nextMajor}`)) {
64764
+ if (import_preload.default.gte(row.name, bundle2) && import_preload.default.lt(row.name, `${nextMajor}`))
64762
64765
  toRemove.push(row);
64763
- }
64764
64766
  });
64765
64767
  return toRemove;
64766
- };
64767
- var cleanupBundle = async (appid, options) => {
64768
+ }
64769
+ async function cleanupBundle(appid, options) {
64768
64770
  oe(`Cleanup versions in Capgo`);
64769
64771
  await checkLatest();
64770
64772
  options.apikey = options.apikey || findSavedKey();
@@ -64794,11 +64796,7 @@ var cleanupBundle = async (appid, options) => {
64794
64796
  if (bundle2) {
64795
64797
  const nextMajor = `${import_preload.default.inc(bundle2, "major")}`;
64796
64798
  f2.info(`Querying available versions in Capgo between ${bundle2} and ${nextMajor}`);
64797
- allVersions = getRemovableVersionsInSemverRange(
64798
- allVersions,
64799
- bundle2,
64800
- nextMajor
64801
- );
64799
+ allVersions = getRemovableVersionsInSemverRange(allVersions, bundle2, nextMajor);
64802
64800
  f2.info(`Active versions in Capgo between ${bundle2} and ${nextMajor}: ${allVersions?.length}`);
64803
64801
  }
64804
64802
  const toRemove = [];
@@ -64806,11 +64804,10 @@ var cleanupBundle = async (appid, options) => {
64806
64804
  allVersions.forEach((v2) => {
64807
64805
  const isInUse = versionInUse.find((vi) => vi === v2.id);
64808
64806
  if (kept < keep || isInUse) {
64809
- if (isInUse) {
64807
+ if (isInUse)
64810
64808
  v2.keep = "\u2705 (Linked to channel)";
64811
- } else {
64809
+ else
64812
64810
  v2.keep = "\u2705";
64813
- }
64814
64811
  kept += 1;
64815
64812
  } else {
64816
64813
  v2.keep = "\u274C";
@@ -64832,11 +64829,12 @@ var cleanupBundle = async (appid, options) => {
64832
64829
  f2.success("You have confirmed removal, removing versions now");
64833
64830
  await removeVersions(toRemove, supabase, appid, userId);
64834
64831
  $e(`Done \u2705`);
64835
- process.exit();
64836
- };
64832
+ import_node_process26.default.exit();
64833
+ }
64837
64834
 
64838
64835
  // src/channel/delete.ts
64839
- var deleteChannel = async (channelId, appId, options) => {
64836
+ var import_node_process27 = __toESM(require("node:process"));
64837
+ async function deleteChannel(channelId, appId, options) {
64840
64838
  oe(`Delete channel`);
64841
64839
  options.apikey = options.apikey || findSavedKey();
64842
64840
  const config = await getConfig();
@@ -64872,19 +64870,19 @@ var deleteChannel = async (channelId, appId, options) => {
64872
64870
  f2.error(`Cannot delete Channel \u{1F640}`);
64873
64871
  }
64874
64872
  $e(`Done \u2705`);
64875
- process.exit();
64876
- };
64873
+ import_node_process27.default.exit();
64874
+ }
64877
64875
 
64878
64876
  // src/channel/list.ts
64879
- var listChannels = async (appId, options) => {
64877
+ var import_node_process28 = __toESM(require("node:process"));
64878
+ async function listChannels(appId, options) {
64880
64879
  oe(`List channels`);
64881
64880
  options.apikey = options.apikey || findSavedKey();
64882
64881
  const config = await getConfig();
64883
64882
  appId = appId || config?.app?.appId;
64884
64883
  const snag = useLogSnag();
64885
- if (!options.apikey) {
64884
+ if (!options.apikey)
64886
64885
  f2.error("Missing API key, you need to provide a API key to upload your bundle");
64887
- }
64888
64886
  if (!appId) {
64889
64887
  f2.error("Missing argument, you need to provide a appId, or be in a capacitor project");
64890
64888
  program.error("");
@@ -64907,13 +64905,14 @@ var listChannels = async (appId, options) => {
64907
64905
  notify: false
64908
64906
  }).catch();
64909
64907
  $e(`Done \u2705`);
64910
- process.exit();
64911
- };
64908
+ import_node_process28.default.exit();
64909
+ }
64912
64910
 
64913
64911
  // src/app/set.ts
64914
- var import_crypto5 = require("crypto");
64915
- var import_node_fs13 = require("node:fs");
64916
- var setApp = async (appId, options) => {
64912
+ var import_node_crypto5 = require("node:crypto");
64913
+ var import_node_fs15 = require("node:fs");
64914
+ var import_node_process29 = __toESM(require("node:process"));
64915
+ async function setApp(appId, options) {
64917
64916
  oe(`Set app`);
64918
64917
  options.apikey = options.apikey || findSavedKey();
64919
64918
  const config = await getConfig();
@@ -64939,15 +64938,15 @@ var setApp = async (appId, options) => {
64939
64938
  }
64940
64939
  let iconBuff;
64941
64940
  let iconType;
64942
- const fileName = `icon_${(0, import_crypto5.randomUUID)()}`;
64941
+ const fileName = `icon_${(0, import_node_crypto5.randomUUID)()}`;
64943
64942
  let signedURL = "https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";
64944
- if (icon && (0, import_node_fs13.existsSync)(icon)) {
64945
- iconBuff = (0, import_node_fs13.readFileSync)(icon);
64943
+ if (icon && (0, import_node_fs15.existsSync)(icon)) {
64944
+ iconBuff = (0, import_node_fs15.readFileSync)(icon);
64946
64945
  const contentType = src_default.getType(icon);
64947
64946
  iconType = contentType || "image/png";
64948
64947
  f2.warn(`Found app icon ${icon}`);
64949
- } else if ((0, import_node_fs13.existsSync)(newIconPath)) {
64950
- iconBuff = (0, import_node_fs13.readFileSync)(newIconPath);
64948
+ } else if ((0, import_node_fs15.existsSync)(newIconPath)) {
64949
+ iconBuff = (0, import_node_fs15.readFileSync)(newIconPath);
64951
64950
  const contentType = src_default.getType(newIconPath);
64952
64951
  iconType = contentType || "image/png";
64953
64952
  f2.warn(`Found app icon ${newIconPath}`);
@@ -64975,11 +64974,12 @@ var setApp = async (appId, options) => {
64975
64974
  program.error(``);
64976
64975
  }
64977
64976
  $e(`Done \u2705`);
64978
- process.exit();
64979
- };
64977
+ import_node_process29.default.exit();
64978
+ }
64980
64979
 
64981
64980
  // src/app/delete.ts
64982
- var deleteApp = async (appId, options) => {
64981
+ var import_node_process30 = __toESM(require("node:process"));
64982
+ async function deleteApp(appId, options) {
64983
64983
  oe(`Deleting`);
64984
64984
  options.apikey = options.apikey || findSavedKey();
64985
64985
  const config = await getConfig();
@@ -64997,9 +64997,8 @@ var deleteApp = async (appId, options) => {
64997
64997
  const userId = await verifyUser(supabase, options.apikey, ["write", "all"]);
64998
64998
  await checkAppExistsAndHasPermissionErr(supabase, options.apikey, appId);
64999
64999
  const { error } = await supabase.storage.from(`images/${userId}`).remove([appId]);
65000
- if (error) {
65000
+ if (error)
65001
65001
  f2.error("Could not delete app logo");
65002
- }
65003
65002
  const { error: delError } = await supabase.storage.from(`apps/${appId}/${userId}`).remove(["versions"]);
65004
65003
  if (delError) {
65005
65004
  f2.error("Could not delete app version");
@@ -65022,12 +65021,12 @@ var deleteApp = async (appId, options) => {
65022
65021
  }).catch();
65023
65022
  f2.success(`App deleted in Capgo`);
65024
65023
  $e("Done \u2705");
65025
- process.exit();
65026
- };
65024
+ import_node_process30.default.exit();
65025
+ }
65027
65026
 
65028
65027
  // src/bundle/compatibility.ts
65029
65028
  var import_console_table_printer4 = __toESM(require_dist18());
65030
- var checkCompatibilityCommand = async (appId, options) => {
65029
+ async function checkCompatibilityCommand(appId, options) {
65031
65030
  oe(`Check compatibility`);
65032
65031
  options.apikey = options.apikey || findSavedKey();
65033
65032
  const config = await getConfig();
@@ -65046,7 +65045,7 @@ var checkCompatibilityCommand = async (appId, options) => {
65046
65045
  program.error("");
65047
65046
  }
65048
65047
  const supabase = await createSupabaseClient(options.apikey);
65049
- const _3 = await verifyUser(supabase, options.apikey, ["write", "all", "read", "upload"]);
65048
+ await verifyUser(supabase, options.apikey, ["write", "all", "read", "upload"]);
65050
65049
  await checkAppExistsAndHasPermissionErr(supabase, options.apikey, appId);
65051
65050
  const { finalCompatibility } = await checkCompatibility(supabase, appId, channel2);
65052
65051
  const t = new import_console_table_printer4.Table({
@@ -65058,14 +65057,14 @@ var checkCompatibilityCommand = async (appId, options) => {
65058
65057
  finalCompatibility.forEach((data) => {
65059
65058
  const { name, localVersion, remoteVersion } = data;
65060
65059
  t.addRow({
65061
- Package: name,
65060
+ "Package": name,
65062
65061
  "Local version": localVersion ?? "None",
65063
65062
  "Remote version": remoteVersion ?? "None",
65064
- Compatible: remoteVersion === localVersion ? yesSymbol : noSymbol
65063
+ "Compatible": remoteVersion === localVersion ? yesSymbol : noSymbol
65065
65064
  });
65066
65065
  });
65067
65066
  f2.success(t.render());
65068
- };
65067
+ }
65069
65068
 
65070
65069
  // src/index.ts
65071
65070
  program.name(package_default.name).description("Manage packages and bundle versions in Capgo Cloud").version(package_default.version);
@@ -65096,10 +65095,7 @@ channel.command("add [channelId] [appId]").alias("a").description("Create channe
65096
65095
  channel.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(deleteChannel).option("-a, --apikey <apikey>", "apikey to link to your account");
65097
65096
  channel.command("list [appId]").alias("l").description("List channel").action(listChannels).option("-a, --apikey <apikey>", "apikey to link to your account");
65098
65097
  channel.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(currentBundle).option("-c, --channel <channel>", "channel to get the current bundle from").option("-a, --apikey <apikey>", "apikey to link to your account").option("--quiet", "only print the bundle version");
65099
- channel.command("set [channelId] [appId]").alias("s").description("Set channel").action(setChannel).option("-a, --apikey <apikey>", "apikey to link to your account").option("-b, --bundle <bundle>", "bundle version number of the file to set").option("-s, --state <state>", "set the state of the channel, default or normal").option("--latest", "get the latest version key in the package.json to set it to the channel").option("--downgrade", "Allow to downgrade to version under native one").option("--no-downgrade", "Disable downgrade to version under native one").option("--upgrade", "Allow to upgrade to version above native one").option("--no-upgrade", "Disable upgrade to version above native one").option("--ios", "Allow sending update to ios devices").option("--no-ios", "Disable sending update to ios devices").option("--android", "Allow sending update to android devices").option("--no-android", "Disable sending update to android devices").option("--self-assign", "Allow to device to self assign to this channel").option("--no-self-assign", "Disable devices to self assign to this channel").option(
65100
- "--disable-auto-update <disableAutoUpdate>",
65101
- "Disable auto update strategy for this channel.The possible options are: major, minor, metadata, none"
65102
- );
65098
+ channel.command("set [channelId] [appId]").alias("s").description("Set channel").action(setChannel).option("-a, --apikey <apikey>", "apikey to link to your account").option("-b, --bundle <bundle>", "bundle version number of the file to set").option("-s, --state <state>", "set the state of the channel, default or normal").option("--latest", "get the latest version key in the package.json to set it to the channel").option("--downgrade", "Allow to downgrade to version under native one").option("--no-downgrade", "Disable downgrade to version under native one").option("--upgrade", "Allow to upgrade to version above native one").option("--no-upgrade", "Disable upgrade to version above native one").option("--ios", "Allow sending update to ios devices").option("--no-ios", "Disable sending update to ios devices").option("--android", "Allow sending update to android devices").option("--no-android", "Disable sending update to android devices").option("--self-assign", "Allow to device to self assign to this channel").option("--no-self-assign", "Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>", "Disable auto update strategy for this channel.The possible options are: major, minor, metadata, none");
65103
65099
  var key = program.command("key").description("Manage key");
65104
65100
  key.command("save").description("Save base64 signing key in capacitor config, usefull for CI").action(saveKeyCommand).option("-f, --force", "force generate a new one").option("--key", "key path to save in capacitor config").option("--key-data", "key data to save in capacitor config");
65105
65101
  key.command("create").description("Create a new signing key").action(createKeyCommand).option("-f, --force", "force generate a new one");