@settlemint/sdk-cli 2.1.4-prfa991a9d → 2.1.5-pr3ad019ac

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/cli.js CHANGED
@@ -3709,23 +3709,51 @@ var require_decrypt = __commonJS((exports, module) => {
3709
3709
  module.exports = decrypt;
3710
3710
  });
3711
3711
 
3712
- // ../../node_modules/@noble/ciphers/_assert.js
3713
- var require__assert = __commonJS((exports) => {
3712
+ // ../../node_modules/@noble/ciphers/utils.js
3713
+ var require_utils3 = __commonJS((exports) => {
3714
+ /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
3714
3715
  Object.defineProperty(exports, "__esModule", { value: true });
3716
+ exports.wrapCipher = exports.Hash = exports.nextTick = exports.isLE = undefined;
3717
+ exports.isBytes = isBytes;
3715
3718
  exports.abool = abool;
3719
+ exports.anumber = anumber;
3716
3720
  exports.abytes = abytes;
3717
- exports.aexists = aexists;
3718
3721
  exports.ahash = ahash;
3719
- exports.anumber = anumber;
3722
+ exports.aexists = aexists;
3720
3723
  exports.aoutput = aoutput;
3721
- exports.isBytes = isBytes;
3724
+ exports.u8 = u8;
3725
+ exports.u32 = u32;
3726
+ exports.clean = clean;
3727
+ exports.createView = createView;
3728
+ exports.bytesToHex = bytesToHex;
3729
+ exports.hexToBytes = hexToBytes;
3730
+ exports.hexToNumber = hexToNumber;
3731
+ exports.bytesToNumberBE = bytesToNumberBE;
3732
+ exports.numberToBytesBE = numberToBytesBE;
3733
+ exports.utf8ToBytes = utf8ToBytes;
3734
+ exports.bytesToUtf8 = bytesToUtf8;
3735
+ exports.toBytes = toBytes;
3736
+ exports.overlapBytes = overlapBytes;
3737
+ exports.complexOverlapBytes = complexOverlapBytes;
3738
+ exports.concatBytes = concatBytes;
3739
+ exports.checkOpts = checkOpts;
3740
+ exports.equalBytes = equalBytes;
3741
+ exports.getOutput = getOutput;
3742
+ exports.setBigUint64 = setBigUint64;
3743
+ exports.u64Lengths = u64Lengths;
3744
+ exports.isAligned32 = isAligned32;
3745
+ exports.copyBytes = copyBytes;
3746
+ function isBytes(a) {
3747
+ return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
3748
+ }
3749
+ function abool(b) {
3750
+ if (typeof b !== "boolean")
3751
+ throw new Error(`boolean expected, not ${b}`);
3752
+ }
3722
3753
  function anumber(n) {
3723
3754
  if (!Number.isSafeInteger(n) || n < 0)
3724
3755
  throw new Error("positive integer expected, got " + n);
3725
3756
  }
3726
- function isBytes(a) {
3727
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
3728
- }
3729
3757
  function abytes(b, ...lengths) {
3730
3758
  if (!isBytes(b))
3731
3759
  throw new Error("Uint8Array expected");
@@ -3734,7 +3762,7 @@ var require__assert = __commonJS((exports) => {
3734
3762
  }
3735
3763
  function ahash(h) {
3736
3764
  if (typeof h !== "function" || typeof h.create !== "function")
3737
- throw new Error("Hash should be wrapped by utils.wrapConstructor");
3765
+ throw new Error("Hash should be wrapped by utils.createHasher");
3738
3766
  anumber(h.outputLen);
3739
3767
  anumber(h.blockLen);
3740
3768
  }
@@ -3751,49 +3779,27 @@ var require__assert = __commonJS((exports) => {
3751
3779
  throw new Error("digestInto() expects output buffer of length at least " + min);
3752
3780
  }
3753
3781
  }
3754
- function abool(b) {
3755
- if (typeof b !== "boolean")
3756
- throw new Error(`boolean expected, not ${b}`);
3782
+ function u8(arr) {
3783
+ return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
3757
3784
  }
3758
- });
3759
-
3760
- // ../../node_modules/@noble/ciphers/utils.js
3761
- var require_utils3 = __commonJS((exports) => {
3762
- Object.defineProperty(exports, "__esModule", { value: true });
3763
- exports.wrapCipher = exports.Hash = exports.nextTick = exports.isLE = exports.createView = exports.u32 = exports.u8 = undefined;
3764
- exports.bytesToHex = bytesToHex;
3765
- exports.hexToBytes = hexToBytes;
3766
- exports.hexToNumber = hexToNumber;
3767
- exports.bytesToNumberBE = bytesToNumberBE;
3768
- exports.numberToBytesBE = numberToBytesBE;
3769
- exports.utf8ToBytes = utf8ToBytes;
3770
- exports.bytesToUtf8 = bytesToUtf8;
3771
- exports.toBytes = toBytes;
3772
- exports.overlapBytes = overlapBytes;
3773
- exports.complexOverlapBytes = complexOverlapBytes;
3774
- exports.concatBytes = concatBytes;
3775
- exports.checkOpts = checkOpts;
3776
- exports.equalBytes = equalBytes;
3777
- exports.getOutput = getOutput;
3778
- exports.setBigUint64 = setBigUint64;
3779
- exports.u64Lengths = u64Lengths;
3780
- exports.isAligned32 = isAligned32;
3781
- exports.copyBytes = copyBytes;
3782
- exports.clean = clean;
3783
- /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
3784
- var _assert_js_1 = require__assert();
3785
- var u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
3786
- exports.u8 = u8;
3787
- var u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
3788
- exports.u32 = u32;
3789
- var createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
3790
- exports.createView = createView;
3791
- exports.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
3792
- if (!exports.isLE)
3793
- throw new Error("Non little-endian hardware is not supported");
3785
+ function u32(arr) {
3786
+ return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
3787
+ }
3788
+ function clean(...arrays) {
3789
+ for (let i = 0;i < arrays.length; i++) {
3790
+ arrays[i].fill(0);
3791
+ }
3792
+ }
3793
+ function createView(arr) {
3794
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
3795
+ }
3796
+ exports.isLE = (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)();
3797
+ var hasHexBuiltin = /* @__PURE__ */ (() => typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function")();
3794
3798
  var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
3795
3799
  function bytesToHex(bytes) {
3796
- (0, _assert_js_1.abytes)(bytes);
3800
+ abytes(bytes);
3801
+ if (hasHexBuiltin)
3802
+ return bytes.toHex();
3797
3803
  let hex = "";
3798
3804
  for (let i = 0;i < bytes.length; i++) {
3799
3805
  hex += hexes[bytes[i]];
@@ -3813,6 +3819,8 @@ var require_utils3 = __commonJS((exports) => {
3813
3819
  function hexToBytes(hex) {
3814
3820
  if (typeof hex !== "string")
3815
3821
  throw new Error("hex string expected, got " + typeof hex);
3822
+ if (hasHexBuiltin)
3823
+ return Uint8Array.fromHex(hex);
3816
3824
  const hl = hex.length;
3817
3825
  const al = hl / 2;
3818
3826
  if (hl % 2)
@@ -3853,7 +3861,7 @@ var require_utils3 = __commonJS((exports) => {
3853
3861
  function toBytes(data) {
3854
3862
  if (typeof data === "string")
3855
3863
  data = utf8ToBytes(data);
3856
- else if ((0, _assert_js_1.isBytes)(data))
3864
+ else if (isBytes(data))
3857
3865
  data = copyBytes(data);
3858
3866
  else
3859
3867
  throw new Error("Uint8Array expected, got " + typeof data);
@@ -3870,7 +3878,7 @@ var require_utils3 = __commonJS((exports) => {
3870
3878
  let sum = 0;
3871
3879
  for (let i = 0;i < arrays.length; i++) {
3872
3880
  const a = arrays[i];
3873
- (0, _assert_js_1.abytes)(a);
3881
+ abytes(a);
3874
3882
  sum += a.length;
3875
3883
  }
3876
3884
  const res = new Uint8Array(sum);
@@ -3901,26 +3909,28 @@ var require_utils3 = __commonJS((exports) => {
3901
3909
  exports.Hash = Hash;
3902
3910
  var wrapCipher = (params, constructor) => {
3903
3911
  function wrappedCipher(key, ...args) {
3904
- (0, _assert_js_1.abytes)(key);
3912
+ abytes(key);
3913
+ if (!exports.isLE)
3914
+ throw new Error("Non little-endian hardware is not yet supported");
3905
3915
  if (params.nonceLength !== undefined) {
3906
3916
  const nonce = args[0];
3907
3917
  if (!nonce)
3908
3918
  throw new Error("nonce / iv required");
3909
3919
  if (params.varSizeNonce)
3910
- (0, _assert_js_1.abytes)(nonce);
3920
+ abytes(nonce);
3911
3921
  else
3912
- (0, _assert_js_1.abytes)(nonce, params.nonceLength);
3922
+ abytes(nonce, params.nonceLength);
3913
3923
  }
3914
3924
  const tagl = params.tagLength;
3915
3925
  if (tagl && args[1] !== undefined) {
3916
- (0, _assert_js_1.abytes)(args[1]);
3926
+ abytes(args[1]);
3917
3927
  }
3918
3928
  const cipher = constructor(key, ...args);
3919
3929
  const checkOutput = (fnLength, output) => {
3920
3930
  if (output !== undefined) {
3921
3931
  if (fnLength !== 2)
3922
3932
  throw new Error("cipher output not supported");
3923
- (0, _assert_js_1.abytes)(output);
3933
+ abytes(output);
3924
3934
  }
3925
3935
  };
3926
3936
  let called = false;
@@ -3929,12 +3939,12 @@ var require_utils3 = __commonJS((exports) => {
3929
3939
  if (called)
3930
3940
  throw new Error("cannot encrypt() twice with same key + nonce");
3931
3941
  called = true;
3932
- (0, _assert_js_1.abytes)(data);
3942
+ abytes(data);
3933
3943
  checkOutput(cipher.encrypt.length, output);
3934
3944
  return cipher.encrypt(data, output);
3935
3945
  },
3936
3946
  decrypt(data, output) {
3937
- (0, _assert_js_1.abytes)(data);
3947
+ abytes(data);
3938
3948
  if (tagl && data.length < tagl)
3939
3949
  throw new Error("invalid ciphertext length: smaller than tagLength=" + tagl);
3940
3950
  checkOutput(cipher.decrypt.length, output);
@@ -3968,11 +3978,12 @@ var require_utils3 = __commonJS((exports) => {
3968
3978
  view.setUint32(byteOffset + h, wh, isLE);
3969
3979
  view.setUint32(byteOffset + l, wl, isLE);
3970
3980
  }
3971
- function u64Lengths(ciphertext, AAD) {
3981
+ function u64Lengths(dataLength, aadLength, isLE) {
3982
+ abool(isLE);
3972
3983
  const num = new Uint8Array(16);
3973
- const view = (0, exports.createView)(num);
3974
- setBigUint64(view, 0, BigInt(AAD ? AAD.length : 0), true);
3975
- setBigUint64(view, 8, BigInt(ciphertext.length), true);
3984
+ const view = createView(num);
3985
+ setBigUint64(view, 0, BigInt(aadLength), isLE);
3986
+ setBigUint64(view, 8, BigInt(dataLength), isLE);
3976
3987
  return num;
3977
3988
  }
3978
3989
  function isAligned32(bytes) {
@@ -3981,11 +3992,6 @@ var require_utils3 = __commonJS((exports) => {
3981
3992
  function copyBytes(bytes) {
3982
3993
  return Uint8Array.from(bytes);
3983
3994
  }
3984
- function clean(...arrays) {
3985
- for (let i = 0;i < arrays.length; i++) {
3986
- arrays[i].fill(0);
3987
- }
3988
- }
3989
3995
  });
3990
3996
 
3991
3997
  // ../../node_modules/eciesjs/dist/consts.js
@@ -4068,14 +4074,13 @@ var require_webcrypto = __commonJS((exports) => {
4068
4074
  exports.getWebcryptoSubtle = getWebcryptoSubtle;
4069
4075
  exports.managedNonce = managedNonce;
4070
4076
  var crypto_1 = require_cryptoNode();
4071
- var _assert_js_1 = require__assert();
4072
- var utils_js_1 = require_utils3();
4077
+ var utils_ts_1 = require_utils3();
4073
4078
  function randomBytes(bytesLength = 32) {
4074
4079
  if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") {
4075
4080
  return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));
4076
4081
  }
4077
4082
  if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === "function") {
4078
- return crypto_1.crypto.randomBytes(bytesLength);
4083
+ return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength));
4079
4084
  }
4080
4085
  throw new Error("crypto.getRandomValues must be defined");
4081
4086
  }
@@ -4086,12 +4091,12 @@ var require_webcrypto = __commonJS((exports) => {
4086
4091
  }
4087
4092
  function managedNonce(fn) {
4088
4093
  const { nonceLength } = fn;
4089
- (0, _assert_js_1.anumber)(nonceLength);
4094
+ (0, utils_ts_1.anumber)(nonceLength);
4090
4095
  return (key, ...args) => ({
4091
4096
  encrypt(plaintext, ...argsEnc) {
4092
4097
  const nonce = randomBytes(nonceLength);
4093
4098
  const ciphertext = fn(key, nonce, ...args).encrypt(plaintext, ...argsEnc);
4094
- const out = (0, utils_js_1.concatBytes)(nonce, ciphertext);
4099
+ const out = (0, utils_ts_1.concatBytes)(nonce, ciphertext);
4095
4100
  ciphertext.fill(0);
4096
4101
  return out;
4097
4102
  },
@@ -4136,21 +4141,21 @@ var require_webcrypto = __commonJS((exports) => {
4136
4141
  }
4137
4142
  function generate(algo) {
4138
4143
  return (key, nonce, AAD) => {
4139
- (0, _assert_js_1.abytes)(key);
4140
- (0, _assert_js_1.abytes)(nonce);
4144
+ (0, utils_ts_1.abytes)(key);
4145
+ (0, utils_ts_1.abytes)(nonce);
4141
4146
  const keyParams = { name: algo, length: key.length * 8 };
4142
4147
  const cryptParams = getCryptParams(algo, nonce, AAD);
4143
4148
  let consumed = false;
4144
4149
  return {
4145
4150
  encrypt(plaintext) {
4146
- (0, _assert_js_1.abytes)(plaintext);
4151
+ (0, utils_ts_1.abytes)(plaintext);
4147
4152
  if (consumed)
4148
4153
  throw new Error("Cannot encrypt() twice with same key / nonce");
4149
4154
  consumed = true;
4150
4155
  return exports.utils.encrypt(key, keyParams, cryptParams, plaintext);
4151
4156
  },
4152
4157
  decrypt(ciphertext) {
4153
- (0, _assert_js_1.abytes)(ciphertext);
4158
+ (0, utils_ts_1.abytes)(ciphertext);
4154
4159
  return exports.utils.decrypt(key, keyParams, cryptParams, ciphertext);
4155
4160
  }
4156
4161
  };
@@ -4162,7 +4167,7 @@ var require_webcrypto = __commonJS((exports) => {
4162
4167
  });
4163
4168
 
4164
4169
  // ../../node_modules/@noble/hashes/_assert.js
4165
- var require__assert2 = __commonJS((exports) => {
4170
+ var require__assert = __commonJS((exports) => {
4166
4171
  Object.defineProperty(exports, "__esModule", { value: true });
4167
4172
  exports.anumber = anumber;
4168
4173
  exports.abytes = abytes;
@@ -4236,7 +4241,7 @@ var require_utils4 = __commonJS((exports) => {
4236
4241
  exports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;
4237
4242
  exports.randomBytes = randomBytes;
4238
4243
  var crypto_1 = require_cryptoNode2();
4239
- var _assert_ts_1 = require__assert2();
4244
+ var _assert_ts_1 = require__assert();
4240
4245
  function isBytes(a) {
4241
4246
  return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
4242
4247
  }
@@ -4402,7 +4407,7 @@ var require__md = __commonJS((exports) => {
4402
4407
  exports.setBigUint64 = setBigUint64;
4403
4408
  exports.Chi = Chi;
4404
4409
  exports.Maj = Maj;
4405
- var _assert_ts_1 = require__assert2();
4410
+ var _assert_ts_1 = require__assert();
4406
4411
  var utils_ts_1 = require_utils4();
4407
4412
  function setBigUint64(view, byteOffset, value, isLE) {
4408
4413
  if (typeof view.setBigUint64 === "function")
@@ -6925,7 +6930,7 @@ var require_ed25519 = __commonJS((exports) => {
6925
6930
  var require_hmac = __commonJS((exports) => {
6926
6931
  Object.defineProperty(exports, "__esModule", { value: true });
6927
6932
  exports.hmac = exports.HMAC = undefined;
6928
- var _assert_ts_1 = require__assert2();
6933
+ var _assert_ts_1 = require__assert();
6929
6934
  var utils_ts_1 = require_utils4();
6930
6935
 
6931
6936
  class HMAC extends utils_ts_1.Hash {
@@ -8253,7 +8258,7 @@ var require_hkdf = __commonJS((exports) => {
8253
8258
  exports.hkdf = undefined;
8254
8259
  exports.extract = extract;
8255
8260
  exports.expand = expand;
8256
- var _assert_ts_1 = require__assert2();
8261
+ var _assert_ts_1 = require__assert();
8257
8262
  var hmac_ts_1 = require_hmac();
8258
8263
  var utils_ts_1 = require_utils4();
8259
8264
  function extract(hash, ikm, salt) {
@@ -245340,7 +245345,7 @@ function pruneCurrentEnv(currentEnv, env2) {
245340
245345
  var package_default = {
245341
245346
  name: "@settlemint/sdk-cli",
245342
245347
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
245343
- version: "2.1.4-prfa991a9d",
245348
+ version: "2.1.5-pr3ad019ac",
245344
245349
  type: "module",
245345
245350
  private: false,
245346
245351
  license: "FSL-1.1-MIT",
@@ -245388,10 +245393,10 @@ var package_default = {
245388
245393
  "@inquirer/confirm": "5.1.9",
245389
245394
  "@inquirer/input": "4.1.9",
245390
245395
  "@inquirer/password": "4.0.12",
245391
- "@inquirer/select": "4.1.1",
245392
- "@settlemint/sdk-js": "2.1.4-prfa991a9d",
245393
- "@settlemint/sdk-utils": "2.1.4-prfa991a9d",
245394
- "@types/node": "22.14.1",
245396
+ "@inquirer/select": "4.2.0",
245397
+ "@settlemint/sdk-js": "2.1.5-pr3ad019ac",
245398
+ "@settlemint/sdk-utils": "2.1.5-pr3ad019ac",
245399
+ "@types/node": "22.15.1",
245395
245400
  "@types/semver": "7.7.0",
245396
245401
  "@types/which": "3.0.4",
245397
245402
  "get-tsconfig": "4.10.0",
@@ -246548,13 +246553,21 @@ class Separator {
246548
246553
  // ../utils/dist/terminal.mjs
246549
246554
  import { spawn } from "node:child_process";
246550
246555
  var import_console_table_printer2 = __toESM(require_dist2(), 1);
246551
- var ascii = () => console.log(magentaBright(`
246556
+ function shouldPrint() {
246557
+ return process.env.SETTLEMINT_DISABLE_TERMINAL !== "true";
246558
+ }
246559
+ var ascii = () => {
246560
+ if (!shouldPrint()) {
246561
+ return;
246562
+ }
246563
+ console.log(magentaBright(`
246552
246564
  _________ __ __ .__ _____ .__ __
246553
246565
  / _____/ _____/ |__/ |_| | ____ / \\ |__| _____/ |_
246554
246566
  \\_____ \\_/ __ \\ __\\ __\\ | _/ __ \\ / \\ / \\| |/ \\ __\\
246555
246567
  / \\ ___/| | | | | |_\\ ___// Y \\ | | \\ |
246556
246568
  /_________/\\_____>__| |__| |____/\\_____>____|____/__|___|__/__|
246557
246569
  `));
246570
+ };
246558
246571
  var maskTokens2 = (output) => {
246559
246572
  return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
246560
246573
  };
@@ -246566,6 +246579,13 @@ var cancel2 = (msg) => {
246566
246579
  console.log("");
246567
246580
  throw new CancelError2(msg);
246568
246581
  };
246582
+ var CommandError = class extends Error {
246583
+ constructor(message, code, output) {
246584
+ super(message);
246585
+ this.code = code;
246586
+ this.output = output;
246587
+ }
246588
+ };
246569
246589
  async function executeCommand(command, args, options) {
246570
246590
  const child = spawn(command, args, { env: { ...process.env, ...options?.env } });
246571
246591
  process.stdin.pipe(child.stdin);
@@ -246585,23 +246605,29 @@ async function executeCommand(command, args, options) {
246585
246605
  }
246586
246606
  output.push(maskedData);
246587
246607
  });
246588
- child.on("error", (err) => reject(err));
246608
+ child.on("error", (err) => reject(new CommandError(err.message, "code" in err && typeof err.code === "number" ? err.code : 1, output)));
246589
246609
  child.on("close", (code) => {
246590
246610
  if (code === 0 || code === null || code === 143) {
246591
246611
  process.stdin.unpipe(child.stdin);
246592
246612
  resolve(output);
246593
246613
  return;
246594
246614
  }
246595
- reject(new Error(`Command "${command}" exited with code ${code}`));
246615
+ reject(new CommandError(`Command "${command}" exited with code ${code}`, code, output));
246596
246616
  });
246597
246617
  });
246598
246618
  }
246599
246619
  var intro = (msg) => {
246620
+ if (!shouldPrint()) {
246621
+ return;
246622
+ }
246600
246623
  console.log("");
246601
246624
  console.log(magentaBright(maskTokens2(msg)));
246602
246625
  console.log("");
246603
246626
  };
246604
246627
  var note = (message, level = "info") => {
246628
+ if (!shouldPrint()) {
246629
+ return;
246630
+ }
246605
246631
  const maskedMessage = maskTokens2(message);
246606
246632
  console.log("");
246607
246633
  if (level === "warn") {
@@ -246626,6 +246652,9 @@ function list(title, items) {
246626
246652
  ${formatItems(items)}`);
246627
246653
  }
246628
246654
  var outro = (msg) => {
246655
+ if (!shouldPrint()) {
246656
+ return;
246657
+ }
246629
246658
  console.log("");
246630
246659
  console.log(inverse(greenBright(maskTokens2(msg))));
246631
246660
  console.log("");
@@ -246645,7 +246674,7 @@ var spinner = async (options) => {
246645
246674
  ${error.stack}`));
246646
246675
  throw new SpinnerError(errorMessage, error);
246647
246676
  };
246648
- if (is_in_ci_default) {
246677
+ if (is_in_ci_default || !shouldPrint()) {
246649
246678
  try {
246650
246679
  return await options.task();
246651
246680
  } catch (err) {
@@ -246673,6 +246702,9 @@ function camelCaseToWords(s) {
246673
246702
  return capitalized.replace(/\s+/g, " ").trim();
246674
246703
  }
246675
246704
  function table(title, data) {
246705
+ if (!shouldPrint()) {
246706
+ return;
246707
+ }
246676
246708
  note(title);
246677
246709
  if (!data || data.length === 0) {
246678
246710
  note("No data to display");
@@ -248203,6 +248235,7 @@ var getEnv = (gqlClient) => {
248203
248235
  };
248204
248236
  var LoadBalancerFragment = graphql(`
248205
248237
  fragment LoadBalancer on LoadBalancer {
248238
+ __typename
248206
248239
  id
248207
248240
  uniqueName
248208
248241
  name
@@ -250030,10 +250063,16 @@ async function getPackageManagerExecutable(targetDir) {
250030
250063
  }
250031
250064
  return { command: "npx", args: [] };
250032
250065
  }
250066
+ function shouldPrint2() {
250067
+ return process.env.SETTLEMINT_DISABLE_TERMINAL !== "true";
250068
+ }
250033
250069
  var maskTokens3 = (output) => {
250034
250070
  return output.replace(/sm_(pat|aat|sat)_[0-9a-zA-Z]+/g, "***");
250035
250071
  };
250036
250072
  var note2 = (message, level = "info") => {
250073
+ if (!shouldPrint2()) {
250074
+ return;
250075
+ }
250037
250076
  const maskedMessage = maskTokens3(message);
250038
250077
  console.log("");
250039
250078
  if (level === "warn") {
@@ -250085,6 +250124,16 @@ function tryParseJson3(value2, defaultValue = null) {
250085
250124
  return defaultValue;
250086
250125
  }
250087
250126
  }
250127
+ function extractJsonObject(value2) {
250128
+ if (value2.length > 5000) {
250129
+ throw new Error("Input too long");
250130
+ }
250131
+ const result = /\{([\s\S]*)\}/.exec(value2);
250132
+ if (!result) {
250133
+ return null;
250134
+ }
250135
+ return tryParseJson3(result[0]);
250136
+ }
250088
250137
  async function retryWhenFailed2(fn, maxRetries = 5, initialSleepTime = 1000, stopOnError) {
250089
250138
  let attempt = 0;
250090
250139
  while (attempt < maxRetries) {
@@ -251586,6 +251635,9 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
251586
251635
  };
251587
251636
  }
251588
251637
 
251638
+ // src/constants/default-subgraph.ts
251639
+ var DEFAULT_SUBGRAPH_NAME = "kit";
251640
+
251589
251641
  // src/utils/subgraph/sanitize-name.ts
251590
251642
  var import_slugify = __toESM(require_slugify(), 1);
251591
251643
  function sanitizeName(value4, length = 35) {
@@ -251795,9 +251847,9 @@ var esm_default3 = createPrompt((config3, done) => {
251795
251847
  firstRender.current = false;
251796
251848
  if (items.length > pageSize) {
251797
251849
  helpTipBottom = `
251798
- ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
251850
+ ${theme.style.help(`(${config3.instructions?.pager ?? "Use arrow keys to reveal more choices"})`)}`;
251799
251851
  } else {
251800
- helpTipTop = theme.style.help("(Use arrow keys)");
251852
+ helpTipTop = theme.style.help(`(${config3.instructions?.navigation ?? "Use arrow keys"})`);
251801
251853
  }
251802
251854
  }
251803
251855
  const page = usePagination({
@@ -251848,7 +251900,13 @@ async function subgraphPrompt({
251848
251900
  if (env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH) {
251849
251901
  return [env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH];
251850
251902
  }
251851
- return subgraphNames.length === 1 ? subgraphNames : [];
251903
+ if (subgraphNames.length === 1) {
251904
+ return subgraphNames;
251905
+ }
251906
+ if (subgraphNames.includes(DEFAULT_SUBGRAPH_NAME)) {
251907
+ return [DEFAULT_SUBGRAPH_NAME];
251908
+ }
251909
+ return [];
251852
251910
  }
251853
251911
  if (!allowNew) {
251854
251912
  if (subgraphNames.length === 0) {
@@ -252033,7 +252091,8 @@ async function codegenBlockscout(env2) {
252033
252091
  }
252034
252092
  }
252035
252093
  }
252036
- `
252094
+ `,
252095
+ operationName: "IntrospectionQuery"
252037
252096
  })
252038
252097
  });
252039
252098
  await writeFile6(introspectionJsonPath, JSON.stringify(data));
@@ -252800,7 +252859,7 @@ async function theGraphPrompt({
252800
252859
  envKey: "SETTLEMINT_THEGRAPH",
252801
252860
  isRequired,
252802
252861
  defaultHandler: async ({ defaultService: defaultMiddleware, choices }) => {
252803
- const filteredChoices = filterRunningOnly ? choices.filter(({ value: middleware }) => middleware === undefined || middleware?.status === "COMPLETED") : choices;
252862
+ const filteredChoices = filterRunningOnly ? choices.filter(({ value: middleware }) => isRunning(middleware)) : choices;
252804
252863
  return esm_default3({
252805
252864
  message: "Which The Graph instance do you want to connect to?",
252806
252865
  choices: filteredChoices,
@@ -253040,8 +253099,10 @@ async function getGraphEndpoint(settlemint, service, graphName) {
253040
253099
  })
253041
253100
  });
253042
253101
  const endpoints = theGraphMiddleware.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue);
253102
+ const hasKitSubgraph = endpoints.map((endpoint) => endpoint.split("/").pop()).some((endpoint) => endpoint === DEFAULT_SUBGRAPH_NAME);
253043
253103
  return {
253044
- SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: endpoints
253104
+ SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: endpoints,
253105
+ SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: hasKitSubgraph ? DEFAULT_SUBGRAPH_NAME : undefined
253045
253106
  };
253046
253107
  }
253047
253108
  function getIpfsEndpoints(service) {
@@ -253128,7 +253189,7 @@ async function blockchainNodeOrLoadBalancerPrompt({
253128
253189
  envKey: "SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER",
253129
253190
  isRequired,
253130
253191
  defaultHandler: async ({ defaultService: defaultNode, choices }) => {
253131
- const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => node === undefined || node?.status === "COMPLETED") : choices;
253192
+ const filteredChoices = filterRunningOnly ? choices.filter(({ value: node }) => isRunning(node)) : choices;
253132
253193
  return esm_default3({
253133
253194
  message: promptMessage ?? "Which blockchain node or load balancer do you want to connect to?",
253134
253195
  choices: filteredChoices,
@@ -253198,7 +253259,7 @@ function connectCommand() {
253198
253259
  env: { ...env2, ...graphEndpoints },
253199
253260
  accept: acceptDefaults,
253200
253261
  message: "Which The Graph subgraph do you want to use as the default?"
253201
- }) : [];
253262
+ }) : [graphEndpoints.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH];
253202
253263
  const portal = await portalPrompt({
253203
253264
  env: env2,
253204
253265
  middlewares,
@@ -257222,13 +257283,16 @@ function getCreateCommand({
257222
257283
  region: selectedRegion?.id ?? ""
257223
257284
  });
257224
257285
  if (wait) {
257225
- await waitForCompletion({
257286
+ const isDeployed = await waitForCompletion({
257226
257287
  settlemint,
257227
257288
  type: waitFor?.resourceType ?? type4,
257228
257289
  uniqueName: waitFor?.uniqueName ?? result.uniqueName,
257229
257290
  action: "deploy",
257230
257291
  restartIfTimeout
257231
257292
  });
257293
+ if (!isDeployed) {
257294
+ throw new Error(`Failed to deploy ${waitFor?.resourceType ?? type4} ${waitFor?.uniqueName ?? result.uniqueName}`);
257295
+ }
257232
257296
  if (waitFor) {
257233
257297
  outro(`${capitalizeFirstLetter2(waitFor.resourceType)} ${waitFor.name} created successfully`);
257234
257298
  }
@@ -257773,22 +257837,26 @@ function blockscoutInsightsCreateCommand() {
257773
257837
  if (!applicationUniqueName) {
257774
257838
  return missingApplication();
257775
257839
  }
257776
- let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
257777
- const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER;
257840
+ let blockchainNodeUniqueName = blockchainNode;
257841
+ let loadBalancerUniqueName = loadBalancer;
257778
257842
  if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
257779
257843
  const blockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
257780
257844
  const loadBalancers = await serviceSpinner("load balancer", () => settlemint.loadBalancer.list(applicationUniqueName));
257781
- const node = await blockchainNodeOrLoadBalancerPrompt({
257845
+ const nodeOrLoadbalancer = await blockchainNodeOrLoadBalancerPrompt({
257782
257846
  env: env2,
257783
257847
  nodes: blockchainNodes,
257784
257848
  loadBalancers,
257785
257849
  accept: acceptDefaults,
257786
257850
  isRequired: true
257787
257851
  });
257788
- if (!node) {
257852
+ if (!nodeOrLoadbalancer) {
257789
257853
  return nothingSelectedError("blockchain node");
257790
257854
  }
257791
- blockchainNodeUniqueName = node.uniqueName;
257855
+ if (nodeOrLoadbalancer.__typename?.endsWith("LoadBalancer")) {
257856
+ loadBalancerUniqueName = nodeOrLoadbalancer.uniqueName;
257857
+ } else {
257858
+ blockchainNodeUniqueName = nodeOrLoadbalancer.uniqueName;
257859
+ }
257792
257860
  }
257793
257861
  const result = await showSpinner(() => settlemint.insights.create({
257794
257862
  name: name3,
@@ -257901,7 +257969,17 @@ function loadBalancerEvmCreateCommand() {
257901
257969
  type: "load balancer",
257902
257970
  subType: "EVM",
257903
257971
  execute: (cmd2, baseAction) => {
257904
- addClusterServiceArgs(cmd2).option("--app, --application <application>", "The application unique name to create the load balancer in (defaults to application from env)").option("--blockchain-nodes <blockchainNodes...>", "Blockchain node unique names where the load balancer connects to (must be from the same network)").action(async (name3, { application, provider, region, size, type: type4, blockchainNodes, acceptDefaults, ...defaultArgs }) => {
257972
+ addClusterServiceArgs(cmd2).option("--app, --application <application>", "The application unique name to create the load balancer in (defaults to application from env)").option("--blockchain-nodes <blockchainNodes...>", "Blockchain node unique names where the load balancer connects to (must be from the same network)").option("--blockchain-network <blockchainNetwork>", "Blockchain network unique name where the load balancer connects to, can be skipped if the --blockchain-nodes option is used (defaults to network from env)").action(async (name3, {
257973
+ application,
257974
+ provider,
257975
+ region,
257976
+ size,
257977
+ type: type4,
257978
+ blockchainNodes,
257979
+ blockchainNetwork,
257980
+ acceptDefaults,
257981
+ ...defaultArgs
257982
+ }) => {
257905
257983
  return baseAction({
257906
257984
  ...defaultArgs,
257907
257985
  acceptDefaults,
@@ -257912,11 +257990,12 @@ function loadBalancerEvmCreateCommand() {
257912
257990
  if (!applicationUniqueName) {
257913
257991
  return missingApplication();
257914
257992
  }
257915
- let networkUniqueName;
257993
+ const applicationBlockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
257994
+ let networkUniqueName = blockchainNetwork;
257916
257995
  let connectedNodesUniqueNames = blockchainNodes;
257917
257996
  if (!connectedNodesUniqueNames) {
257918
257997
  const networks = await serviceSpinner("blockchain network", () => settlemint.blockchainNetwork.list(applicationUniqueName));
257919
- const network = await blockchainNetworkPrompt({
257998
+ const network = networkUniqueName ? networks.find((network2) => network2.uniqueName === networkUniqueName) : await blockchainNetworkPrompt({
257920
257999
  env: env2,
257921
258000
  networks,
257922
258001
  accept: acceptDefaults,
@@ -257926,31 +258005,29 @@ function loadBalancerEvmCreateCommand() {
257926
258005
  return nothingSelectedError("blockchain network");
257927
258006
  }
257928
258007
  networkUniqueName = network.uniqueName;
257929
- const blockchainNodes2 = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
257930
258008
  const connectedNodes = await blockchainNodePrompt({
257931
258009
  env: env2,
257932
- nodes: blockchainNodes2.filter((node) => node.blockchainNetwork?.uniqueName === network.uniqueName),
258010
+ nodes: applicationBlockchainNodes.filter((node) => node.blockchainNetwork?.uniqueName === network.uniqueName),
257933
258011
  accept: acceptDefaults,
257934
258012
  promptMessage: "Which blockchain node do you want to connect the load balancer to?",
257935
258013
  allowAll: true
257936
258014
  });
257937
- connectedNodesUniqueNames = Array.isArray(connectedNodes) ? blockchainNodes2.map((node) => node.uniqueName) : connectedNodes ? [connectedNodes.uniqueName] : [];
258015
+ connectedNodesUniqueNames = Array.isArray(connectedNodes) ? applicationBlockchainNodes.map((node) => node.uniqueName) : connectedNodes ? [connectedNodes.uniqueName] : [];
257938
258016
  }
257939
258017
  if (connectedNodesUniqueNames.length === 0) {
257940
258018
  return cancel2("A load balancer must connect to at least one blockchain node");
257941
258019
  }
258020
+ const selectedBlockchainNodes = applicationBlockchainNodes.filter((node) => connectedNodesUniqueNames.includes(node.uniqueName));
258021
+ if (selectedBlockchainNodes.length === 0) {
258022
+ return cancel2(`Blockchain node(s) '${connectedNodesUniqueNames.join(", ")}' are not part of the application '${applicationUniqueName}'`);
258023
+ }
257942
258024
  if (!networkUniqueName) {
257943
- const applicationBlockchainNodes = await serviceSpinner("blockchain node", () => settlemint.blockchainNode.list(applicationUniqueName));
257944
- const selectedBlockchainNodes = applicationBlockchainNodes.filter((node) => connectedNodesUniqueNames.includes(node.uniqueName));
257945
- if (selectedBlockchainNodes.length === 0) {
257946
- return cancel2(`Blockchain node(s) '${connectedNodesUniqueNames.join(", ")}' are not part of the application '${applicationUniqueName}'`);
257947
- }
257948
- const onTheSameNetwork = selectedBlockchainNodes.every((node) => node.blockchainNetwork?.uniqueName === selectedBlockchainNodes[0].blockchainNetwork?.uniqueName);
257949
- if (!onTheSameNetwork) {
257950
- return cancel2("Blockchain nodes must be on the same network");
257951
- }
257952
258025
  networkUniqueName = selectedBlockchainNodes[0].blockchainNetwork?.uniqueName;
257953
258026
  }
258027
+ const onTheSameNetwork = selectedBlockchainNodes.every((node) => node.blockchainNetwork?.uniqueName === networkUniqueName);
258028
+ if (!onTheSameNetwork) {
258029
+ return cancel2("Blockchain nodes must be on the same network");
258030
+ }
257954
258031
  const result = await showSpinner(() => settlemint.loadBalancer.create({
257955
258032
  applicationUniqueName,
257956
258033
  name: name3,
@@ -257966,7 +258043,8 @@ function loadBalancerEvmCreateCommand() {
257966
258043
  mapDefaultEnv: () => {
257967
258044
  return {
257968
258045
  SETTLEMINT_APPLICATION: applicationUniqueName,
257969
- SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: result.uniqueName
258046
+ SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER: result.uniqueName,
258047
+ ...getBlockchainNodeOrLoadBalancerEndpoints(result)
257970
258048
  };
257971
258049
  }
257972
258050
  };
@@ -258658,7 +258736,15 @@ function getRestartCommand({
258658
258736
  stopMessage: `${capitalizeFirstLetter2(type4)} restart initiated`
258659
258737
  });
258660
258738
  if (wait) {
258661
- await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "restart" });
258739
+ const isRestarted = await waitForCompletion({
258740
+ settlemint,
258741
+ type: type4,
258742
+ uniqueName: serviceUniqueName,
258743
+ action: "restart"
258744
+ });
258745
+ if (!isRestarted) {
258746
+ throw new Error(`Failed to restart ${type4} ${uniqueName}`);
258747
+ }
258662
258748
  }
258663
258749
  outro(`${capitalizeFirstLetter2(type4)} ${result.name} restart initiated successfully`);
258664
258750
  });
@@ -258914,10 +259000,7 @@ function yamlOutput(data) {
258914
259000
  // src/commands/platform/config.ts
258915
259001
  function configCommand() {
258916
259002
  return new Command("config").alias("cfg").description("Get platform configuration").option("--prod", "Connect to your production environment").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").addOption(new Option("-o, --output <output>", "The output format").choices(["json", "yaml"])).action(async ({ prod, instance, output }) => {
258917
- const printToTerminal = !output;
258918
- if (printToTerminal) {
258919
- intro("Getting platform configuration");
258920
- }
259003
+ intro("Getting platform configuration");
258921
259004
  const env2 = await loadEnv(false, !!prod);
258922
259005
  const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
258923
259006
  const settlemint = createSettleMintClient({
@@ -258947,19 +259030,17 @@ function configCommand() {
258947
259030
  }))).sort((a8, b4) => a8.providerId.localeCompare(b4.providerId) || a8.regionId.localeCompare(b4.regionId)),
258948
259031
  preDeployedContracts: platformConfig.preDeployedContracts.sort()
258949
259032
  };
258950
- if (printToTerminal) {
259033
+ if (output === "json") {
259034
+ jsonOutput(platformConfigData);
259035
+ } else if (output === "yaml") {
259036
+ yamlOutput(platformConfigData);
259037
+ } else {
258951
259038
  table("Templates (Kits)", platformConfigData.kits);
258952
259039
  table("Use cases (Smart Contract Sets)", platformConfigData.useCases);
258953
259040
  table("Providers and regions", platformConfigData.deploymentEngineTargets);
258954
259041
  list("Pre-deployed abis (Smart Contract Portal)", platformConfigData.preDeployedContracts);
258955
- } else if (output === "json") {
258956
- jsonOutput(platformConfigData);
258957
- } else if (output === "yaml") {
258958
- yamlOutput(platformConfigData);
258959
- }
258960
- if (printToTerminal) {
258961
- outro("Platform configuration retrieved");
258962
259042
  }
259043
+ outro("Platform configuration retrieved");
258963
259044
  });
258964
259045
  }
258965
259046
 
@@ -259006,6 +259087,9 @@ function getUrlPathForService(service, serviceType) {
259006
259087
  if (serviceType === "insights") {
259007
259088
  return `insights/${encodeURIComponent(service.id)}/details`;
259008
259089
  }
259090
+ if (serviceType === "load-balancer") {
259091
+ return `loadbalancers/${encodeURIComponent(service.id)}/details`;
259092
+ }
259009
259093
  return "";
259010
259094
  }
259011
259095
  function getWorkspaceUrlPath(workspace) {
@@ -259035,10 +259119,7 @@ function applicationsListCommand() {
259035
259119
  command: "platform list applications -o yaml > applications.yaml"
259036
259120
  }
259037
259121
  ])).option("-w, --workspace <workspace>", "The workspace unique name to list applications for (defaults to workspace from env)").addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).action(async ({ workspace, output }) => {
259038
- const printToTerminal = !output || output === "wide";
259039
- if (printToTerminal) {
259040
- intro("Listing applications");
259041
- }
259122
+ intro("Listing applications");
259042
259123
  const env2 = await loadEnv(false, false);
259043
259124
  const selectedInstance = await instancePrompt(env2, true);
259044
259125
  const personalAccessToken = await getInstanceCredentials(selectedInstance);
@@ -259051,13 +259132,12 @@ function applicationsListCommand() {
259051
259132
  });
259052
259133
  const workspaceUniqueName = workspace ?? env2.SETTLEMINT_WORKSPACE ?? await selectWorkspace(settlemint, env2);
259053
259134
  const applications = await applicationsSpinner(settlemint, workspaceUniqueName);
259054
- const wide = output === "wide";
259055
259135
  const applicationsData = applications.map((application) => {
259056
259136
  const basicFields = {
259057
259137
  name: application.name,
259058
259138
  uniqueName: application.uniqueName
259059
259139
  };
259060
- if (wide || !printToTerminal) {
259140
+ if (output) {
259061
259141
  return {
259062
259142
  ...basicFields,
259063
259143
  url: getApplicationUrl(selectedInstance, application)
@@ -259065,17 +259145,15 @@ function applicationsListCommand() {
259065
259145
  }
259066
259146
  return basicFields;
259067
259147
  });
259068
- if (printToTerminal) {
259069
- const selectedWorkspace = await settlemint.workspace.read(workspaceUniqueName);
259070
- table(`Applications for workspace ${selectedWorkspace.name} (${selectedWorkspace.uniqueName}) - ${getWorkspaceUrl(selectedInstance, selectedWorkspace)}`, applicationsData);
259071
- } else if (output === "json") {
259148
+ const selectedWorkspace = await settlemint.workspace.read(workspaceUniqueName);
259149
+ if (output === "json") {
259072
259150
  jsonOutput(applicationsData);
259073
259151
  } else if (output === "yaml") {
259074
259152
  yamlOutput(applicationsData);
259153
+ } else {
259154
+ table(`Applications for workspace ${selectedWorkspace.name} (${selectedWorkspace.uniqueName}) - ${getWorkspaceUrl(selectedInstance, selectedWorkspace)}`, applicationsData);
259075
259155
  }
259076
- if (printToTerminal) {
259077
- outro("Applications listed");
259078
- }
259156
+ outro("Applications listed");
259079
259157
  });
259080
259158
  }
259081
259159
  async function selectWorkspace(settlemint, env2) {
@@ -259089,7 +259167,7 @@ function formatServiceSubType(service, printToTerminal = true) {
259089
259167
  if ("__typename" in service && typeof service.__typename === "string") {
259090
259168
  return printToTerminal ? camelCaseToWords2(service.__typename) : service.__typename;
259091
259169
  }
259092
- return printToTerminal ? "Unknown" : "Unknown";
259170
+ return "Unknown";
259093
259171
  }
259094
259172
 
259095
259173
  // src/commands/platform/utils/formatting/format-health-status.ts
@@ -259120,6 +259198,7 @@ function formatStatus(status, printToTerminal = true) {
259120
259198
  var SERVICE_TYPES = [
259121
259199
  "blockchain-network",
259122
259200
  "blockchain-node",
259201
+ "load-balancer",
259123
259202
  "custom-deployment",
259124
259203
  "insights",
259125
259204
  "integration-tool",
@@ -259158,10 +259237,7 @@ function servicesCommand() {
259158
259237
  command: "platform list services --type blockchain-network blockchain-node middleware"
259159
259238
  }
259160
259239
  ])).option("--app, --application <application>", "The application unique name to list the services in (defaults to application from env)").addOption(new Option("-t, --type <type...>", "The type(s) of service to list").choices(SERVICE_TYPES)).addOption(new Option("-o, --output <output>", "The output format").choices(["wide", "json", "yaml"])).action(async ({ application, type: type4, output }) => {
259161
- const printToTerminal = !output || output === "wide";
259162
- if (printToTerminal) {
259163
- intro("Listing application services");
259164
- }
259240
+ intro("Listing application services");
259165
259241
  const env2 = await loadEnv(false, false);
259166
259242
  const selectedInstance = await instancePrompt(env2, true);
259167
259243
  const personalAccessToken = await getInstanceCredentials(selectedInstance);
@@ -259173,6 +259249,7 @@ function servicesCommand() {
259173
259249
  accessToken,
259174
259250
  instance: selectedInstance
259175
259251
  });
259252
+ const printToTerminal = !output || output === "wide";
259176
259253
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION ?? (printToTerminal ? await selectApplication(settlemint, env2) : null);
259177
259254
  if (!applicationUniqueName) {
259178
259255
  return nothingSelectedError("application");
@@ -259200,16 +259277,14 @@ function servicesCommand() {
259200
259277
  },
259201
259278
  services: servicesToShow
259202
259279
  };
259203
- if (printToTerminal) {
259204
- table(`Services for ${selectedApplication.name} (${applicationUniqueName}) - ${getApplicationUrl(selectedInstance, selectedApplication)}`, servicesToShow);
259205
- } else if (output === "json") {
259280
+ if (output === "json") {
259206
259281
  jsonOutput(data);
259207
259282
  } else if (output === "yaml") {
259208
259283
  yamlOutput(data);
259284
+ } else {
259285
+ table(`Services for ${selectedApplication.name} (${applicationUniqueName}) - ${getApplicationUrl(selectedInstance, selectedApplication)}`, servicesToShow);
259209
259286
  }
259210
- if (printToTerminal) {
259211
- outro("Application services listed");
259212
- }
259287
+ outro("Application services listed");
259213
259288
  });
259214
259289
  }
259215
259290
  async function selectApplication(settlemint, env2) {
@@ -259278,6 +259353,8 @@ function getItemsForServiceType(services, serviceType) {
259278
259353
  return services.blockchainNetworks;
259279
259354
  case "blockchain-node":
259280
259355
  return services.blockchainNodes;
259356
+ case "load-balancer":
259357
+ return services.loadBalancers;
259281
259358
  default:
259282
259359
  return [];
259283
259360
  }
@@ -259742,15 +259819,21 @@ Please select another key or activate this key on the node and try again.`, "war
259742
259819
  async function getHardhatConfigData(envConfig) {
259743
259820
  try {
259744
259821
  const { command, args } = await getPackageManagerExecutable();
259745
- const output = await executeCommand(command, [...args, "ts-node", "-e", `import hardhat from "hardhat";
259746
- console.log(JSON.stringify(hardhat.userConfig));`], {
259822
+ const output = await executeCommand(command, [
259823
+ ...args,
259824
+ "ts-node",
259825
+ "-e",
259826
+ `import hardhat from "hardhat";
259827
+ console.log(JSON.stringify(hardhat.userConfig));`,
259828
+ "--transpileOnly"
259829
+ ], {
259747
259830
  env: {
259748
259831
  ...process.env,
259749
259832
  ...envConfig
259750
259833
  },
259751
259834
  silent: true
259752
259835
  });
259753
- const config3 = tryParseJson3(output.join(" "));
259836
+ const config3 = extractJsonObject(output.join(" "));
259754
259837
  if (isHardhatConfig(config3)) {
259755
259838
  return config3;
259756
259839
  }
@@ -260256,7 +260339,8 @@ function subgraphDeployCommand() {
260256
260339
  await writeEnvSpinner(!!prod, {
260257
260340
  ...env2,
260258
260341
  SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
260259
- ...graphEndpoints
260342
+ ...graphEndpoints,
260343
+ SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH ?? graphName
260260
260344
  });
260261
260345
  outro(`Subgraph ${graphName} deployed successfully`);
260262
260346
  });
@@ -260326,8 +260410,8 @@ function subgraphRemoveCommand() {
260326
260410
  await writeEnvSpinner(!!prod, {
260327
260411
  ...env2,
260328
260412
  SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
260329
- SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH === graphName ? undefined : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH,
260330
- ...graphEndpoints
260413
+ ...graphEndpoints,
260414
+ SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH: env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH === graphName ? undefined : env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH
260331
260415
  });
260332
260416
  outro(`Subgraph ${graphName} removed successfully`);
260333
260417
  });
@@ -260389,7 +260473,10 @@ function addHooksToCommand(cmd2, rootCmd, argv) {
260389
260473
  rootCmd._lastCommand = thisCommand;
260390
260474
  rootCmd._lastCommand._commandPath = commandPath;
260391
260475
  }
260392
- if (isLeafCommand(thisCommand) && !isJsonOrYamlOutput(thisCommand)) {
260476
+ if (isJsonOrYamlOutput(thisCommand)) {
260477
+ process.env.SETTLEMINT_DISABLE_TERMINAL = "true";
260478
+ }
260479
+ if (isLeafCommand(thisCommand)) {
260393
260480
  ascii();
260394
260481
  await validateSdkVersionFromCommand(thisCommand);
260395
260482
  }
@@ -260473,4 +260560,4 @@ async function sdkCliCommand(argv = process.argv) {
260473
260560
  // src/cli.ts
260474
260561
  sdkCliCommand();
260475
260562
 
260476
- //# debugId=802596FD48A8DC2864756E2164756E21
260563
+ //# debugId=50DD7090435F558D64756E2164756E21