@settlemint/sdk-cli 0.9.3-main0d722733 → 0.9.3-main60569eea

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.
Files changed (3) hide show
  1. package/dist/cli.js +284 -429
  2. package/dist/cli.js.map +40 -42
  3. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -19613,7 +19613,7 @@ var require_lib4 = __commonJS((exports, module) => {
19613
19613
  var rRel = new RegExp(`^\\.${rSlash.source}`);
19614
19614
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
19615
19615
  var getPathInfo = (cmd, {
19616
- path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.yXumBfN0lq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
19616
+ path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Ks5097XiXd:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
19617
19617
  pathExt: optPathExt = process.env.PATHEXT,
19618
19618
  delimiter: optDelimiter = delimiter
19619
19619
  }) => {
@@ -19817,7 +19817,7 @@ var require_lib5 = __commonJS((exports, module) => {
19817
19817
  let pathToInitial;
19818
19818
  try {
19819
19819
  pathToInitial = which.sync(initialCmd, {
19820
- path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.yXumBfN0lq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
19820
+ path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Ks5097XiXd:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
19821
19821
  pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
19822
19822
  }).toLowerCase();
19823
19823
  } catch (err) {
@@ -20534,7 +20534,7 @@ var require_lib6 = __commonJS((exports, module) => {
20534
20534
  var rRel = new RegExp(`^\\.${rSlash.source}`);
20535
20535
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
20536
20536
  var getPathInfo = (cmd, {
20537
- path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.yXumBfN0lq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
20537
+ path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Ks5097XiXd:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
20538
20538
  pathExt: optPathExt = process.env.PATHEXT,
20539
20539
  delimiter: optDelimiter = delimiter
20540
20540
  }) => {
@@ -223327,7 +223327,7 @@ ${Bt.cyan(Yt)}
223327
223327
  code: "ENOENT"
223328
223328
  }), getPathInfo = (e9, t7) => {
223329
223329
  var r6 = t7.colon || or;
223330
- var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.yXumBfN0lq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
223330
+ var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Ks5097XiXd:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
223331
223331
  var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
223332
223332
  var a5 = nr ? n6.split(r6) : [""];
223333
223333
  if (nr) {
@@ -226464,7 +226464,7 @@ ${whileRunning(e9)}`;
226464
226464
  };
226465
226465
  ni = Object.assign(async function _main() {
226466
226466
  var e9 = new Cli({
226467
- binaryVersion: "0.9.3-main0d722733",
226467
+ binaryVersion: "0.9.3-main60569eea",
226468
226468
  binaryLabel: "gql.tada CLI",
226469
226469
  binaryName: "gql.tada"
226470
226470
  });
@@ -234964,7 +234964,7 @@ var require_which2 = __commonJS((exports, module) => {
234964
234964
  const colon = opt2.colon || COLON;
234965
234965
  const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
234966
234966
  ...isWindows2 ? [process.cwd()] : [],
234967
- ...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.yXumBfN0lq:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
234967
+ ...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.Ks5097XiXd:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
234968
234968
  ];
234969
234969
  const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
234970
234970
  const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
@@ -256788,7 +256788,7 @@ ${error.stack}`));
256788
256788
  var package_default = {
256789
256789
  name: "@settlemint/sdk-cli",
256790
256790
  description: "SettleMint SDK, integrate SettleMint into your application with ease.",
256791
- version: "0.9.3-main0d722733",
256791
+ version: "0.9.3-main60569eea",
256792
256792
  type: "module",
256793
256793
  private: false,
256794
256794
  license: "FSL-1.1-MIT",
@@ -256841,8 +256841,8 @@ var package_default = {
256841
256841
  "@inquirer/input": "4.1.1",
256842
256842
  "@inquirer/password": "4.0.4",
256843
256843
  "@inquirer/select": "4.0.4",
256844
- "@settlemint/sdk-js": "0.9.3-main0d722733",
256845
- "@settlemint/sdk-utils": "0.9.3-main0d722733",
256844
+ "@settlemint/sdk-js": "0.9.3-main60569eea",
256845
+ "@settlemint/sdk-utils": "0.9.3-main60569eea",
256846
256846
  "get-tsconfig": "4.8.1",
256847
256847
  giget: "1.2.3"
256848
256848
  },
@@ -257143,9 +257143,6 @@ function missingAccessTokenError(personalAccessTokenExists) {
257143
257143
  function missingPersonalAccessTokenError() {
257144
257144
  return cancel("No personal access token found for instance, please run `settlemint login` to login to your instance");
257145
257145
  }
257146
- function missingApplication() {
257147
- return cancel("No application configured, please run `settlemint connect` to connect to your application");
257148
- }
257149
257146
 
257150
257147
  // src/utils/config.ts
257151
257148
  import { mkdir as mkdir2, readFile, writeFile as writeFile2 } from "node:fs/promises";
@@ -272759,9 +272756,8 @@ var esm_default5 = createPrompt((config4, done) => {
272759
272756
 
272760
272757
  // src/commands/connect/aat.prompt.ts
272761
272758
  async function applicationAccessTokenPrompt(env2, application, settlemint, accept) {
272762
- const autoAccept = !!accept || is_in_ci_default;
272763
272759
  const defaultAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
272764
- const defaultPossible = autoAccept && defaultAccessToken;
272760
+ const defaultPossible = accept && defaultAccessToken;
272765
272761
  if (defaultPossible || is_in_ci_default) {
272766
272762
  return defaultAccessToken;
272767
272763
  }
@@ -272856,25 +272852,16 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
272856
272852
  });
272857
272853
  }
272858
272854
 
272859
- // src/error/nothing-selected-error.ts
272860
- function nothingSelectedError(type4) {
272861
- return cancel2(`No ${type4} selected. Please select a ${type4} to continue.`);
272862
- }
272863
-
272864
272855
  // src/commands/connect/application.prompt.ts
272865
272856
  async function applicationPrompt(env2, applications, accept) {
272866
- const autoAccept = !!accept || is_in_ci_default;
272867
272857
  const defaultApplication = applications.find((application2) => application2.uniqueName === env2.SETTLEMINT_APPLICATION);
272868
- const defaultPossible = autoAccept && defaultApplication;
272858
+ const defaultPossible = accept && defaultApplication;
272869
272859
  if (defaultPossible) {
272870
272860
  return defaultApplication;
272871
272861
  }
272872
272862
  if (applications.length === 0) {
272873
272863
  cancel("No applications found");
272874
272864
  }
272875
- if (is_in_ci_default) {
272876
- nothingSelectedError("application");
272877
- }
272878
272865
  const application = await esm_default2({
272879
272866
  message: "Which application do you want to connect to?",
272880
272867
  choices: applications.map((applications2) => ({
@@ -272889,170 +272876,146 @@ async function applicationPrompt(env2, applications, accept) {
272889
272876
  return application;
272890
272877
  }
272891
272878
 
272892
- // src/commands/connect/service.prompt.ts
272893
- async function servicePrompt({
272894
- env: env2,
272895
- services,
272896
- accept,
272897
- envKey,
272898
- defaultHandler,
272899
- isCi = is_in_ci_default
272900
- }) {
272901
- if (services.length === 0) {
272902
- return;
272903
- }
272904
- const selectedService = services.find((service) => service.uniqueName === env2[envKey]);
272905
- const autoAccept = isCi || accept;
272906
- if (autoAccept && selectedService) {
272907
- return selectedService;
272908
- }
272909
- if (isCi) {
272879
+ // src/commands/connect/blockchain-node.prompt.ts
272880
+ async function blockchainNodePrompt(env2, nodes, accept) {
272881
+ if (nodes.length === 0) {
272910
272882
  return;
272911
272883
  }
272912
- if (services.length === 1) {
272913
- return services[0];
272884
+ const defaultNode = nodes.find((node2) => node2.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
272885
+ const defaultPossible = accept;
272886
+ if (defaultPossible) {
272887
+ return defaultNode;
272914
272888
  }
272915
- return defaultHandler({ defaultService: selectedService });
272916
- }
272917
-
272918
- // src/commands/connect/blockchain-node.prompt.ts
272919
- async function blockchainNodePrompt(env2, nodes, accept) {
272920
- return servicePrompt({
272921
- env: env2,
272922
- services: nodes,
272923
- accept,
272924
- envKey: "SETTLEMINT_BLOCKCHAIN_NODE",
272925
- defaultHandler: async ({ defaultService: defaultNode }) => {
272926
- return esm_default2({
272927
- message: "Which blockchain node do you want to connect to?",
272928
- choices: [
272929
- ...nodes.map((node) => ({
272930
- name: node.name,
272931
- value: node
272932
- })),
272933
- {
272934
- name: "None",
272935
- value: undefined
272936
- }
272937
- ],
272938
- default: defaultNode
272939
- });
272940
- }
272889
+ const node = await esm_default2({
272890
+ message: "Which blockchain node do you want to connect to?",
272891
+ choices: [
272892
+ ...nodes.map((node2) => ({
272893
+ name: node2.name,
272894
+ value: node2
272895
+ })),
272896
+ {
272897
+ name: "None",
272898
+ value: undefined
272899
+ }
272900
+ ],
272901
+ default: defaultNode
272941
272902
  });
272903
+ return node;
272942
272904
  }
272943
272905
 
272944
272906
  // src/commands/connect/blockscout.prompt.ts
272945
272907
  async function blockscoutPrompt(env2, insights, accept) {
272946
272908
  const possible = insights.filter((insight) => insight.insightsCategory === "BLOCKCHAIN_EXPLORER");
272947
- return servicePrompt({
272948
- env: env2,
272949
- services: possible,
272950
- accept,
272951
- envKey: "SETTLEMINT_BLOCKSCOUT",
272952
- defaultHandler: async ({ defaultService: defaultBlockscout }) => {
272953
- return esm_default2({
272954
- message: "Which blockscout instance do you want to connect to?",
272955
- choices: [
272956
- ...possible.map((insight) => ({
272957
- name: insight.name,
272958
- value: insight
272959
- })),
272960
- {
272961
- name: "None",
272962
- value: undefined
272963
- }
272964
- ],
272965
- default: defaultBlockscout
272966
- });
272967
- }
272909
+ if (possible.length === 0) {
272910
+ return;
272911
+ }
272912
+ const defaultBlockscout = insights.find((insight) => insight.uniqueName === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
272913
+ const defaultPossible = accept;
272914
+ if (defaultPossible) {
272915
+ return defaultBlockscout;
272916
+ }
272917
+ const blockscout = await esm_default2({
272918
+ message: "Which blockscout instance do you want to connect to?",
272919
+ choices: [
272920
+ ...insights.map((insight) => ({
272921
+ name: insight.name,
272922
+ value: insight
272923
+ })),
272924
+ {
272925
+ name: "None",
272926
+ value: undefined
272927
+ }
272928
+ ],
272929
+ default: defaultBlockscout
272968
272930
  });
272931
+ return blockscout;
272969
272932
  }
272970
272933
 
272971
272934
  // src/commands/connect/custom-deployment.prompt.ts
272972
272935
  async function customDeploymentPrompt(env2, customDeployments, accept) {
272973
- return servicePrompt({
272974
- env: env2,
272975
- services: customDeployments,
272976
- accept,
272977
- envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
272978
- defaultHandler: async ({
272979
- defaultService: defaultCustomDeployment
272980
- }) => {
272981
- return esm_default2({
272982
- message: "Which Custom Deployment do you want to connect to?",
272983
- choices: [
272984
- ...customDeployments.map((customDeployment) => ({
272985
- name: customDeployment.name,
272986
- value: customDeployment
272987
- })),
272988
- {
272989
- name: "None",
272990
- value: undefined
272991
- }
272992
- ],
272993
- default: defaultCustomDeployment
272994
- });
272995
- }
272936
+ if (customDeployments.length === 0) {
272937
+ return;
272938
+ }
272939
+ const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.uniqueName === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
272940
+ const defaultPossible = accept;
272941
+ if (defaultPossible) {
272942
+ return defaultCustomDeployment;
272943
+ }
272944
+ const middleware = await esm_default2({
272945
+ message: "Which Custom Deployment do you want to connect to?",
272946
+ choices: [
272947
+ ...customDeployments.map((customDeployment) => ({
272948
+ name: customDeployment.name,
272949
+ value: customDeployment
272950
+ })),
272951
+ {
272952
+ name: "None",
272953
+ value: undefined
272954
+ }
272955
+ ],
272956
+ default: defaultCustomDeployment
272996
272957
  });
272958
+ return middleware;
272997
272959
  }
272998
272960
 
272999
272961
  // src/commands/connect/hasura.prompt.ts
273000
272962
  async function hasuraPrompt(env2, integrations, accept) {
273001
272963
  const possible = integrations.filter((integration) => integration.integrationType === "HASURA");
273002
- return servicePrompt({
273003
- env: env2,
273004
- services: possible,
273005
- accept,
273006
- envKey: "SETTLEMINT_HASURA",
273007
- defaultHandler: async ({ defaultService: defaultHasura }) => {
273008
- return esm_default2({
273009
- message: "Which Hasura instance do you want to connect to?",
273010
- choices: [
273011
- ...possible.map((integration) => ({
273012
- name: integration.name,
273013
- value: integration
273014
- })),
273015
- {
273016
- name: "None",
273017
- value: undefined
273018
- }
273019
- ],
273020
- default: defaultHasura
273021
- });
273022
- }
272964
+ if (possible.length === 0) {
272965
+ return;
272966
+ }
272967
+ const defaultIntegration = possible.find((integration) => integration.uniqueName === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
272968
+ const defaultPossible = accept;
272969
+ if (defaultPossible) {
272970
+ return defaultIntegration;
272971
+ }
272972
+ const hasura = await esm_default2({
272973
+ message: "Which Hasura instance do you want to connect to?",
272974
+ choices: [
272975
+ ...possible.map((integration) => ({
272976
+ name: integration.name,
272977
+ value: integration
272978
+ })),
272979
+ {
272980
+ name: "None",
272981
+ value: undefined
272982
+ }
272983
+ ],
272984
+ default: defaultIntegration
273023
272985
  });
272986
+ return hasura;
273024
272987
  }
273025
272988
 
273026
272989
  // src/commands/connect/hd-private-keys.prompt.ts
273027
272990
  async function hdPrivateKeyPrompt(env2, privateKeys, accept) {
273028
- const possible = privateKeys.filter((privateKey) => privateKey.privateKeyType === "HD_ECDSA_P256");
273029
- return servicePrompt({
273030
- env: env2,
273031
- services: possible,
273032
- accept,
273033
- envKey: "SETTLEMINT_HD_PRIVATE_KEY",
273034
- defaultHandler: async ({ defaultService: defaultPrivateKey }) => {
273035
- return esm_default2({
273036
- message: "Which HD Private Key do you want to use?",
273037
- choices: [
273038
- ...possible.map((privateKey) => ({
273039
- name: privateKey.name,
273040
- value: privateKey
273041
- })),
273042
- {
273043
- name: "None",
273044
- value: undefined
273045
- }
273046
- ],
273047
- default: defaultPrivateKey
273048
- });
273049
- }
272991
+ const possible = privateKeys.filter((privateKey2) => privateKey2.privateKeyType === "HD_ECDSA_P256");
272992
+ if (possible.length === 0) {
272993
+ return;
272994
+ }
272995
+ const defaultPrivateKey = possible.find((privateKey2) => privateKey2.uniqueName === env2.SETTLEMINT_HD_PRIVATE_KEY) ?? (possible.length === 1 ? possible[0] : undefined);
272996
+ const defaultPossible = accept;
272997
+ if (defaultPossible) {
272998
+ return defaultPrivateKey;
272999
+ }
273000
+ const privateKey = await esm_default2({
273001
+ message: "Which HD Private Key do you want to use?",
273002
+ choices: [
273003
+ ...possible.map((privateKey2) => ({
273004
+ name: privateKey2.name,
273005
+ value: privateKey2
273006
+ })),
273007
+ {
273008
+ name: "None",
273009
+ value: undefined
273010
+ }
273011
+ ],
273012
+ default: defaultPrivateKey
273050
273013
  });
273014
+ return privateKey;
273051
273015
  }
273052
273016
 
273053
273017
  // src/commands/connect/instance.prompt.ts
273054
273018
  async function instancePrompt(env2, accept) {
273055
- const autoAccept = !!accept || is_in_ci_default;
273056
273019
  const defaultInstance = env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
273057
273020
  const defaultPossible = accept && defaultInstance;
273058
273021
  if (defaultPossible) {
@@ -273077,82 +273040,85 @@ async function instancePrompt(env2, accept) {
273077
273040
  // src/commands/connect/ipfs.prompt.ts
273078
273041
  async function ipfsPrompt(env2, storages, accept) {
273079
273042
  const possible = storages.filter((storage) => storage.storageProtocol === "IPFS");
273080
- return servicePrompt({
273081
- env: env2,
273082
- services: possible,
273083
- accept,
273084
- envKey: "SETTLEMINT_IPFS",
273085
- defaultHandler: async ({ defaultService: defaultStorage }) => {
273086
- return esm_default2({
273087
- message: "Which IPFS instance do you want to connect to?",
273088
- choices: [
273089
- ...possible.map((storage) => ({
273090
- name: storage.name,
273091
- value: storage
273092
- })),
273093
- {
273094
- name: "None",
273095
- value: undefined
273096
- }
273097
- ],
273098
- default: defaultStorage
273099
- });
273100
- }
273043
+ if (possible.length === 0) {
273044
+ return;
273045
+ }
273046
+ const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
273047
+ const defaultPossible = accept;
273048
+ if (defaultPossible) {
273049
+ return defaultStorage;
273050
+ }
273051
+ const minio = await esm_default2({
273052
+ message: "Which IPFS instance do you want to connect to?",
273053
+ choices: [
273054
+ ...possible.map((storage) => ({
273055
+ name: storage.name,
273056
+ value: storage
273057
+ })),
273058
+ {
273059
+ name: "None",
273060
+ value: undefined
273061
+ }
273062
+ ],
273063
+ default: defaultStorage
273101
273064
  });
273065
+ return minio;
273102
273066
  }
273103
273067
 
273104
273068
  // src/commands/connect/minio.prompt.ts
273105
273069
  async function minioPrompt(env2, storages, accept) {
273106
273070
  const possible = storages.filter((storage) => storage.storageProtocol === "MINIO");
273107
- return servicePrompt({
273108
- env: env2,
273109
- services: possible,
273110
- accept,
273111
- envKey: "SETTLEMINT_MINIO",
273112
- defaultHandler: async ({ defaultService: defaultStorage }) => {
273113
- return esm_default2({
273114
- message: "Which MinIO instance do you want to connect to?",
273115
- choices: [
273116
- ...possible.map((storage) => ({
273117
- name: storage.name,
273118
- value: storage
273119
- })),
273120
- {
273121
- name: "None",
273122
- value: undefined
273123
- }
273124
- ],
273125
- default: defaultStorage
273126
- });
273127
- }
273071
+ if (possible.length === 0) {
273072
+ return;
273073
+ }
273074
+ const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
273075
+ const defaultPossible = accept;
273076
+ if (defaultPossible) {
273077
+ return defaultStorage;
273078
+ }
273079
+ const minio = await esm_default2({
273080
+ message: "Which Minio instance do you want to connect to?",
273081
+ choices: [
273082
+ ...possible.map((storage) => ({
273083
+ name: storage.name,
273084
+ value: storage
273085
+ })),
273086
+ {
273087
+ name: "None",
273088
+ value: undefined
273089
+ }
273090
+ ],
273091
+ default: defaultStorage
273128
273092
  });
273093
+ return minio;
273129
273094
  }
273130
273095
 
273131
273096
  // src/commands/connect/portal.prompt.ts
273132
273097
  async function portalPrompt(env2, middlewares, accept) {
273133
- const possible = middlewares.filter((middleware) => middleware.interface === "SMART_CONTRACT_PORTAL");
273134
- return servicePrompt({
273135
- env: env2,
273136
- services: possible,
273137
- accept,
273138
- envKey: "SETTLEMINT_PORTAL",
273139
- defaultHandler: async ({ defaultService: defaultMiddleware }) => {
273140
- return esm_default2({
273141
- message: "Which Smart Contract Portal instance do you want to connect to?",
273142
- choices: [
273143
- ...possible.map((middleware) => ({
273144
- name: middleware.name,
273145
- value: middleware
273146
- })),
273147
- {
273148
- name: "None",
273149
- value: undefined
273150
- }
273151
- ],
273152
- default: defaultMiddleware
273153
- });
273154
- }
273098
+ const possible = middlewares.filter((middleware2) => middleware2.interface === "SMART_CONTRACT_PORTAL");
273099
+ if (possible.length === 0) {
273100
+ return;
273101
+ }
273102
+ const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
273103
+ const defaultPossible = accept;
273104
+ if (defaultPossible) {
273105
+ return defaultMiddleware;
273106
+ }
273107
+ const middleware = await esm_default2({
273108
+ message: "Which Smart Contract Portal instance do you want to connect to?",
273109
+ choices: [
273110
+ ...possible.map((middleware2) => ({
273111
+ name: middleware2.name,
273112
+ value: middleware2
273113
+ })),
273114
+ {
273115
+ name: "None",
273116
+ value: undefined
273117
+ }
273118
+ ],
273119
+ default: defaultMiddleware
273155
273120
  });
273121
+ return middleware;
273156
273122
  }
273157
273123
 
273158
273124
  // src/commands/connect/services.spinner.ts
@@ -273196,45 +273162,42 @@ async function servicesSpinner(settlemint, application) {
273196
273162
 
273197
273163
  // src/commands/connect/thegraph.prompt.ts
273198
273164
  async function theGraphPrompt(env2, middlewares, accept) {
273199
- const possible = middlewares.filter((middleware) => middleware.__typename === "HAGraphMiddleware");
273200
- return servicePrompt({
273201
- env: env2,
273202
- services: possible,
273203
- accept,
273204
- envKey: "SETTLEMINT_THEGRAPH",
273205
- defaultHandler: async ({ defaultService: defaultMiddleware }) => {
273206
- return esm_default2({
273207
- message: "Which The Graph instance do you want to connect to?",
273208
- choices: [
273209
- ...possible.map((middleware) => ({
273210
- name: middleware.name,
273211
- value: middleware
273212
- })),
273213
- {
273214
- name: "None",
273215
- value: undefined
273216
- }
273217
- ],
273218
- default: defaultMiddleware
273219
- });
273220
- }
273165
+ const possible = middlewares.filter((middleware2) => middleware2.__typename === "HAGraphMiddleware");
273166
+ if (possible.length === 0) {
273167
+ return;
273168
+ }
273169
+ const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
273170
+ const defaultPossible = accept;
273171
+ if (defaultPossible) {
273172
+ return defaultMiddleware;
273173
+ }
273174
+ const middleware = await esm_default2({
273175
+ message: "Which The Graph instance do you want to connect to?",
273176
+ choices: [
273177
+ ...possible.map((middleware2) => ({
273178
+ name: middleware2.name,
273179
+ value: middleware2
273180
+ })),
273181
+ {
273182
+ name: "None",
273183
+ value: undefined
273184
+ }
273185
+ ],
273186
+ default: defaultMiddleware
273221
273187
  });
273188
+ return middleware;
273222
273189
  }
273223
273190
 
273224
273191
  // src/commands/connect/workspace.prompt.ts
273225
273192
  async function workspacePrompt(env2, workspaces, accept) {
273226
- const autoAccept = !!accept || is_in_ci_default;
273227
273193
  const defaultWorkspace = workspaces.find((workspace2) => workspace2.uniqueName === env2.SETTLEMINT_WORKSPACE);
273228
- const defaultPossible = autoAccept && defaultWorkspace;
273194
+ const defaultPossible = accept && defaultWorkspace;
273229
273195
  if (defaultPossible) {
273230
273196
  return defaultWorkspace;
273231
273197
  }
273232
273198
  if (workspaces.length === 0) {
273233
273199
  cancel2("No workspaces found");
273234
273200
  }
273235
- if (is_in_ci_default) {
273236
- nothingSelectedError("workspace");
273237
- }
273238
273201
  const workspace = await esm_default2({
273239
273202
  message: "Which workspace do you want to connect to?",
273240
273203
  choices: workspaces.map((workspace2) => ({
@@ -273253,8 +273216,9 @@ async function workspacePrompt(env2, workspaces, accept) {
273253
273216
  function connectCommand() {
273254
273217
  return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod }) => {
273255
273218
  intro("Connecting your dApp to SettleMint");
273219
+ const autoAccept = !!acceptDefaults || is_in_ci_default;
273256
273220
  const env2 = await loadEnv2(false, !!prod);
273257
- const instance = await instancePrompt(env2, acceptDefaults);
273221
+ const instance = await instancePrompt(env2, autoAccept);
273258
273222
  const personalAccessToken = await getInstanceCredentials(instance);
273259
273223
  if (!personalAccessToken) {
273260
273224
  return missingPersonalAccessTokenError();
@@ -273265,20 +273229,20 @@ function connectCommand() {
273265
273229
  instance
273266
273230
  });
273267
273231
  const workspaces = await workspaceSpinner(settlemint);
273268
- const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
273269
- const application = await applicationPrompt(env2, workspace?.applications ?? [], acceptDefaults);
273270
- const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint, acceptDefaults);
273232
+ const workspace = await workspacePrompt(env2, workspaces, autoAccept);
273233
+ const application = await applicationPrompt(env2, workspace?.applications ?? [], autoAccept);
273234
+ const aatToken = await applicationAccessTokenPrompt(env2, application, settlemint, autoAccept);
273271
273235
  const { middleware, integrationTool, storage, privateKey, insights, customDeployment, blockchainNodes } = await servicesSpinner(settlemint, application);
273272
- const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
273273
- const hasura = await hasuraPrompt(env2, integrationTool, acceptDefaults);
273274
- const thegraph = await theGraphPrompt(env2, middleware, acceptDefaults);
273275
- const portal = await portalPrompt(env2, middleware, acceptDefaults);
273276
- const ipfs = await ipfsPrompt(env2, storage, acceptDefaults);
273277
- const minio = await minioPrompt(env2, storage, acceptDefaults);
273278
- const hdPrivateKey = await hdPrivateKeyPrompt(env2, privateKey, acceptDefaults);
273279
- const cDeployment = await customDeploymentPrompt(env2, customDeployment, acceptDefaults);
273280
- const blockscout = await blockscoutPrompt(env2, insights, acceptDefaults);
273281
- if (acceptDefaults) {
273236
+ const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
273237
+ const hasura = await hasuraPrompt(env2, integrationTool, autoAccept);
273238
+ const thegraph = await theGraphPrompt(env2, middleware, autoAccept);
273239
+ const portal = await portalPrompt(env2, middleware, autoAccept);
273240
+ const ipfs = await ipfsPrompt(env2, storage, autoAccept);
273241
+ const minio = await minioPrompt(env2, storage, autoAccept);
273242
+ const hdPrivateKey = await hdPrivateKeyPrompt(env2, privateKey, autoAccept);
273243
+ const cDeployment = await customDeploymentPrompt(env2, customDeployment, autoAccept);
273244
+ const blockscout = await blockscoutPrompt(env2, insights, autoAccept);
273245
+ if (autoAccept) {
273282
273246
  const selectedServices = [
273283
273247
  `Workspace: ${workspace.name}`,
273284
273248
  `Application: ${application.name}`,
@@ -274148,7 +274112,7 @@ function createCommand2() {
274148
274112
  }
274149
274113
  const selectedTemplate = await templatePrompt(templates, template);
274150
274114
  if (!selectedTemplate) {
274151
- return nothingSelectedError("template");
274115
+ cancel("No template selected. Please select a template to continue.");
274152
274116
  }
274153
274117
  await spinner({
274154
274118
  startMessage: "Scaffolding the project",
@@ -274480,11 +274444,11 @@ function getCreateCommand({
274480
274444
  if (requiresDeployment) {
274481
274445
  const selectedProvider = await providerPrompt(platformConfig, provider);
274482
274446
  if (!selectedProvider) {
274483
- return nothingSelectedError("provider");
274447
+ cancel("No provider selected. Please select a provider to continue.");
274484
274448
  }
274485
274449
  const selectedRegion = await regionPrompt(selectedProvider, region);
274486
274450
  if (!selectedRegion) {
274487
- return nothingSelectedError("region");
274451
+ cancel("No region selected. Please select a region to continue.");
274488
274452
  }
274489
274453
  }
274490
274454
  const { result, waitFor, mapDefaultEnv } = await spinner({
@@ -274560,9 +274524,6 @@ function blockchainNetworkBesuCreateCommand() {
274560
274524
  region
274561
274525
  }, async (settlemint, env2) => {
274562
274526
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274563
- if (!applicationUniqueName) {
274564
- return missingApplication();
274565
- }
274566
274527
  const result = await settlemint.blockchainNetwork.create({
274567
274528
  name: name2,
274568
274529
  applicationUniqueName,
@@ -274770,9 +274731,6 @@ function applicationAccessTokenCreateCommand() {
274770
274731
  cmd2.option("-a, --application <application>", "The application unique name to create the application access token for (defaults to application from env)").addOption(new Option("-v, --validity-period <period>", "The validity period for the token").choices(["DAYS_7", "DAYS_30", "DAYS_60", "DAYS_90", "NONE"]).default("DAYS_7")).action(async (name2, { application, validityPeriod, ...defaultArgs }) => {
274771
274732
  return baseAction(defaultArgs, async (settlemint, env2) => {
274772
274733
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274773
- if (!applicationUniqueName) {
274774
- return missingApplication();
274775
- }
274776
274734
  const aatToken = await settlemint.applicationAccessToken.create({
274777
274735
  applicationUniqueName,
274778
274736
  name: name2,
@@ -274825,7 +274783,6 @@ function applicationAccessTokenCreateCommand() {
274825
274783
  uniqueName: ""
274826
274784
  },
274827
274785
  mapDefaultEnv: () => ({
274828
- SETTLEMINT_APPLICATION: applicationUniqueName,
274829
274786
  SETTLEMINT_ACCESS_TOKEN: aatToken
274830
274787
  })
274831
274788
  };
@@ -274857,23 +274814,11 @@ function applicationCreateCommand() {
274857
274814
  type: "application",
274858
274815
  alias: "a",
274859
274816
  execute: (cmd2, baseAction) => {
274860
- cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, acceptDefaults, ...defaultArgs }) => {
274861
- return baseAction({
274862
- ...defaultArgs,
274863
- acceptDefaults
274864
- }, async (settlemint, env2) => {
274865
- let workspaceUniqueName = workspace;
274866
- if (!workspaceUniqueName) {
274867
- const workspaces = await settlemint.workspace.list();
274868
- const workspace2 = await workspacePrompt(env2, workspaces, acceptDefaults);
274869
- if (!workspace2) {
274870
- return nothingSelectedError("workspace");
274871
- }
274872
- workspaceUniqueName = workspace2.uniqueName;
274873
- }
274817
+ cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, ...defaultArgs }) => {
274818
+ return baseAction(defaultArgs, async (settlemint, env2) => {
274874
274819
  const result = await settlemint.application.create({
274875
274820
  name: name2,
274876
- workspaceUniqueName
274821
+ workspaceUniqueName: workspace ?? env2.SETTLEMINT_WORKSPACE
274877
274822
  });
274878
274823
  return {
274879
274824
  result,
@@ -274906,27 +274851,27 @@ function applicationCreateCommand() {
274906
274851
 
274907
274852
  // src/commands/connect/blockchain-network.prompt.ts
274908
274853
  async function blockchainNetworkPrompt(env2, networks, accept) {
274909
- return servicePrompt({
274910
- env: env2,
274911
- services: networks,
274912
- accept,
274913
- envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
274914
- defaultHandler: async ({ defaultService: defaultNetwork }) => {
274915
- return esm_default2({
274916
- message: "Which blockchain network do you want to connect to?",
274917
- choices: [
274918
- ...networks.map((network) => ({
274919
- name: network.name,
274920
- value: network
274921
- })),
274922
- {
274923
- name: "None",
274924
- value: undefined
274925
- }
274926
- ],
274927
- default: defaultNetwork
274928
- });
274929
- }
274854
+ if (networks.length === 0) {
274855
+ return;
274856
+ }
274857
+ const defaultNetwork = networks.find((network) => network.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
274858
+ const defaultPossible = accept;
274859
+ if (defaultPossible) {
274860
+ return defaultNetwork;
274861
+ }
274862
+ return esm_default2({
274863
+ message: "Which blockchain network do you want to connect to?",
274864
+ choices: [
274865
+ ...networks.map((network) => ({
274866
+ name: network.name,
274867
+ value: network
274868
+ })),
274869
+ {
274870
+ name: "None",
274871
+ value: undefined
274872
+ }
274873
+ ],
274874
+ default: defaultNetwork
274930
274875
  });
274931
274876
  }
274932
274877
 
@@ -274955,18 +274900,19 @@ function blockchainNodeBesuCreateCommand() {
274955
274900
  provider,
274956
274901
  region
274957
274902
  }, async (settlemint, env2) => {
274903
+ const autoAccept = !!acceptDefaults || is_in_ci_default;
274958
274904
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274959
274905
  if (!applicationUniqueName) {
274960
- return missingApplication();
274906
+ cancel("No application found. Please specify an application or run `settlemint connect` to continue.");
274961
274907
  }
274962
- let networkUniqueName = blockchainNetwork;
274908
+ let networkUniqueName = blockchainNetwork ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
274963
274909
  if (!networkUniqueName) {
274964
274910
  const networks = await settlemint.blockchainNetwork.list(applicationUniqueName);
274965
- const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults);
274911
+ const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults ?? false);
274966
274912
  if (!network) {
274967
- return nothingSelectedError("blockchain network");
274913
+ cancel("No network found. Please specify a network to continue.");
274968
274914
  }
274969
- networkUniqueName = network?.uniqueName;
274915
+ networkUniqueName = network?.id;
274970
274916
  }
274971
274917
  const result = await settlemint.blockchainNode.create({
274972
274918
  applicationUniqueName,
@@ -274984,7 +274930,7 @@ function blockchainNodeBesuCreateCommand() {
274984
274930
  mapDefaultEnv: () => {
274985
274931
  return {
274986
274932
  SETTLEMINT_APPLICATION: applicationUniqueName,
274987
- SETTLEMINT_BLOCKCHAIN_NODE: result.uniqueName
274933
+ SETTLEMINT_BLOCKCHAIN_NODE: result.id
274988
274934
  };
274989
274935
  }
274990
274936
  };
@@ -275020,27 +274966,15 @@ function blockscoutInsightsCreateCommand() {
275020
274966
  type: "insights",
275021
274967
  alias: "bs",
275022
274968
  execute: (cmd2, baseAction) => {
275023
- addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").action(async (name2, { application, provider, region, size, type: type4, blockchainNode, loadBalancer, acceptDefaults, ...defaultArgs }) => {
274969
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").action(async (name2, { application, provider, region, size, type: type4, blockchainNode, loadBalancer, ...defaultArgs }) => {
275024
274970
  return baseAction({
275025
274971
  ...defaultArgs,
275026
- acceptDefaults,
275027
274972
  provider,
275028
274973
  region
275029
274974
  }, async (settlemint, env2) => {
275030
274975
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275031
- if (!applicationUniqueName) {
275032
- return missingApplication();
275033
- }
275034
- let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
274976
+ const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275035
274977
  const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
275036
- if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
275037
- const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
275038
- const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
275039
- if (!node) {
275040
- return nothingSelectedError("blockchain node");
275041
- }
275042
- blockchainNodeUniqueName = node.uniqueName;
275043
- }
275044
274978
  const result = await settlemint.insights.create({
275045
274979
  name: name2,
275046
274980
  applicationUniqueName,
@@ -275099,9 +275033,6 @@ function hasuraIntegrationCreateCommand() {
275099
275033
  region
275100
275034
  }, async (settlemint, env2) => {
275101
275035
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275102
- if (!applicationUniqueName) {
275103
- return missingApplication();
275104
- }
275105
275036
  const result = await settlemint.integrationTool.create({
275106
275037
  name: name2,
275107
275038
  applicationUniqueName,
@@ -275151,26 +275082,14 @@ function graphMiddlewareCreateCommand() {
275151
275082
  type: "middleware",
275152
275083
  alias: "gr",
275153
275084
  execute: (cmd2, baseAction) => {
275154
- addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
275085
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
275155
275086
  return baseAction({
275156
275087
  ...defaultArgs,
275157
- acceptDefaults,
275158
275088
  provider,
275159
275089
  region
275160
275090
  }, async (settlemint, env2) => {
275161
275091
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275162
- if (!applicationUniqueName) {
275163
- return missingApplication();
275164
- }
275165
- let blockchainNodeUniqueName = blockchainNode;
275166
- if (!blockchainNodeUniqueName) {
275167
- const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
275168
- const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
275169
- if (!node) {
275170
- return nothingSelectedError("blockchain node");
275171
- }
275172
- blockchainNodeUniqueName = node.uniqueName;
275173
- }
275092
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275174
275093
  const result = await settlemint.middleware.create({
275175
275094
  name: name2,
275176
275095
  applicationUniqueName,
@@ -275226,29 +275145,16 @@ function smartContractPortalMiddlewareCreateCommand() {
275226
275145
  type: type4,
275227
275146
  includePredeployedAbis,
275228
275147
  abis,
275229
- acceptDefaults,
275230
275148
  ...defaultArgs
275231
275149
  }) => {
275232
275150
  return baseAction({
275233
275151
  ...defaultArgs,
275234
- acceptDefaults,
275235
275152
  provider,
275236
275153
  region
275237
275154
  }, async (settlemint, env2) => {
275238
275155
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275239
- if (!applicationUniqueName) {
275240
- return missingApplication();
275241
- }
275242
- let blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275156
+ const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275243
275157
  const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
275244
- if (!blockchainNodeUniqueName && !loadBalancerUniqueName) {
275245
- const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
275246
- const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
275247
- if (!node) {
275248
- return nothingSelectedError("blockchain node");
275249
- }
275250
- blockchainNodeUniqueName = node.uniqueName;
275251
- }
275252
275158
  const parsedAbis = [];
275253
275159
  if (abis && abis.length > 0) {
275254
275160
  try {
@@ -275321,26 +275227,14 @@ function privateKeyHdCreateCommand() {
275321
275227
  type: "private key",
275322
275228
  alias: "hd",
275323
275229
  execute: (cmd2, baseAction) => {
275324
- addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
275230
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
275325
275231
  return baseAction({
275326
275232
  ...defaultArgs,
275327
- acceptDefaults,
275328
275233
  provider,
275329
275234
  region
275330
275235
  }, async (settlemint, env2) => {
275331
275236
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275332
- if (!applicationUniqueName) {
275333
- return missingApplication();
275334
- }
275335
- let blockchainNodeUniqueName = blockchainNode;
275336
- if (!blockchainNodeUniqueName) {
275337
- const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
275338
- const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
275339
- if (!node) {
275340
- return nothingSelectedError("blockchain node");
275341
- }
275342
- blockchainNodeUniqueName = node.uniqueName;
275343
- }
275237
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275344
275238
  const result = await settlemint.privateKey.create({
275345
275239
  name: name2,
275346
275240
  applicationUniqueName,
@@ -275387,26 +275281,14 @@ function privateKeyHsmCreateCommand() {
275387
275281
  type: "private key",
275388
275282
  alias: "hd",
275389
275283
  execute: (cmd2, baseAction) => {
275390
- addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, acceptDefaults, ...defaultArgs }) => {
275284
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
275391
275285
  return baseAction({
275392
275286
  ...defaultArgs,
275393
- acceptDefaults,
275394
275287
  provider,
275395
275288
  region
275396
275289
  }, async (settlemint, env2) => {
275397
275290
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275398
- if (!applicationUniqueName) {
275399
- return missingApplication();
275400
- }
275401
- let blockchainNodeUniqueName = blockchainNode;
275402
- if (!blockchainNodeUniqueName) {
275403
- const blockchainNodes = await settlemint.blockchainNode.list(applicationUniqueName);
275404
- const node = await blockchainNodePrompt(env2, blockchainNodes, acceptDefaults);
275405
- if (!node) {
275406
- return nothingSelectedError("blockchain node");
275407
- }
275408
- blockchainNodeUniqueName = node.uniqueName;
275409
- }
275291
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275410
275292
  const result = await settlemint.privateKey.create({
275411
275293
  name: name2,
275412
275294
  applicationUniqueName,
@@ -275459,9 +275341,6 @@ function ipfsStorageCreateCommand() {
275459
275341
  region
275460
275342
  }, async (settlemint, env2) => {
275461
275343
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275462
- if (!applicationUniqueName) {
275463
- return missingApplication();
275464
- }
275465
275344
  const result = await settlemint.storage.create({
275466
275345
  name: name2,
275467
275346
  applicationUniqueName,
@@ -275511,9 +275390,6 @@ function minioStorageCreateCommand() {
275511
275390
  region
275512
275391
  }, async (settlemint, env2) => {
275513
275392
  const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275514
- if (!applicationUniqueName) {
275515
- return missingApplication();
275516
- }
275517
275393
  const result = await settlemint.storage.create({
275518
275394
  name: name2,
275519
275395
  applicationUniqueName,
@@ -275607,8 +275483,9 @@ function getDeleteCommand({
275607
275483
  if (!force) {
275608
275484
  await deleteConfirmationPrompt(`this ${type4}`);
275609
275485
  }
275486
+ const autoAccept = !!acceptDefaults || is_in_ci_default;
275610
275487
  const env2 = await loadEnv2(false, !!prod);
275611
- const instance = await instancePrompt(env2, acceptDefaults);
275488
+ const instance = await instancePrompt(env2, autoAccept);
275612
275489
  const accessToken = await getApplicationOrPersonalAccessToken({
275613
275490
  env: env2,
275614
275491
  instance,
@@ -275701,8 +275578,9 @@ function getRestartCommand({
275701
275578
  }
275702
275579
  ])).argument("<unique-name>", `The unique name of the ${type4}, use 'default' to restart the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until restarted").action(async (uniqueName, { acceptDefaults, prod, wait }) => {
275703
275580
  intro(`Restarting ${type4} in the SettleMint platform`);
275581
+ const autoAccept = !!acceptDefaults || is_in_ci_default;
275704
275582
  const env2 = await loadEnv2(false, !!prod);
275705
- const instance = await instancePrompt(env2, acceptDefaults);
275583
+ const instance = await instancePrompt(env2, autoAccept);
275706
275584
  const accessToken = await getApplicationOrPersonalAccessToken({
275707
275585
  env: env2,
275708
275586
  instance,
@@ -276016,7 +275894,7 @@ function createCommand4() {
276016
275894
  const platformConfig = await settlemint.platform.config();
276017
275895
  const selectedUseCase = await useCasePrompt(platformConfig, useCase);
276018
275896
  if (!selectedUseCase) {
276019
- return nothingSelectedError("use case");
275897
+ cancel("No use case selected. Please select a use case to continue.");
276020
275898
  }
276021
275899
  const targetDir = formatTargetDir(name2);
276022
275900
  const projectDir = join8(process.cwd(), targetDir);
@@ -276318,9 +276196,6 @@ function hardhatDeployRemoteCommand() {
276318
276196
  const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
276319
276197
  let node = undefined;
276320
276198
  if (!nodeUniqueName) {
276321
- if (!env2.SETTLEMINT_APPLICATION) {
276322
- return missingApplication();
276323
- }
276324
276199
  const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
276325
276200
  const evmNodes = nodes.filter((node2) => node2.isEvm);
276326
276201
  if (evmNodes.length === 0) {
@@ -276331,9 +276206,9 @@ function hardhatDeployRemoteCommand() {
276331
276206
  if (nodesWithActivePrivateKey.length === 0) {
276332
276207
  cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
276333
276208
  }
276334
- const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
276209
+ const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept);
276335
276210
  if (!blockchainNode) {
276336
- return nothingSelectedError("EVM blockchain node");
276211
+ cancel("No EVM blockchain node selected. Please select one to continue.");
276337
276212
  }
276338
276213
  node = blockchainNode;
276339
276214
  } else {
@@ -276349,7 +276224,7 @@ function hardhatDeployRemoteCommand() {
276349
276224
  }
276350
276225
  const address = await addressPrompt({ env: env2, accept: autoAccept, prod, node, hardhatConfig });
276351
276226
  if (!address) {
276352
- return nothingSelectedError("private key");
276227
+ cancel("No private key selected. Please select one to continue.");
276353
276228
  }
276354
276229
  const { command, args } = await getPackageManagerExecutable();
276355
276230
  await executeCommand(command, [
@@ -276433,31 +276308,14 @@ function hardhatScriptRemoteCommand() {
276433
276308
  accessToken,
276434
276309
  instance
276435
276310
  });
276436
- let nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
276311
+ let nodeUniqueName = blockchainNodeUniqueName;
276437
276312
  if (!nodeUniqueName) {
276438
- if (!env2.SETTLEMINT_APPLICATION) {
276439
- return missingApplication();
276440
- }
276441
- const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
276442
- const evmNodes = nodes.filter((node) => node.isEvm);
276443
- if (evmNodes.length === 0) {
276444
- cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
276445
- }
276446
- const nodesWithPrivateKey = await Promise.all(nodes.map((node) => settlemint.blockchainNode.read(node.uniqueName)));
276447
- const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node) => node.privateKeys && node.privateKeys.length > 0);
276448
- if (nodesWithActivePrivateKey.length === 0) {
276449
- cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
276450
- }
276451
- const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
276313
+ const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
276314
+ const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
276452
276315
  if (!blockchainNode) {
276453
- return nothingSelectedError("EVM blockchain node");
276316
+ cancel("No Blockchain Node selected. Please select one to continue.");
276454
276317
  }
276455
276318
  nodeUniqueName = blockchainNode.uniqueName;
276456
- } else {
276457
- const node = await settlemint.blockchainNode.read(nodeUniqueName);
276458
- if (!node.isEvm) {
276459
- cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
276460
- }
276461
276319
  }
276462
276320
  const envConfig = await settlemint.foundry.env(nodeUniqueName);
276463
276321
  const { command, args } = await getPackageManagerExecutable();
@@ -276676,9 +276534,6 @@ async function getTheGraphMiddleware({
276676
276534
  return defaultTheGraphMiddleware;
276677
276535
  }
276678
276536
  }
276679
- if (!env2.SETTLEMINT_APPLICATION) {
276680
- return missingApplication();
276681
- }
276682
276537
  const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
276683
276538
  return theGraphPrompt(env2, middlewares, autoAccept);
276684
276539
  }
@@ -276788,7 +276643,7 @@ function subgraphDeployCommand() {
276788
276643
  });
276789
276644
  const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
276790
276645
  if (!theGraphMiddleware) {
276791
- return nothingSelectedError("graph middleware");
276646
+ cancel("No Graph Middleware selected. Please select one to continue.");
276792
276647
  }
276793
276648
  const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
276794
276649
  await subgraphSetup({
@@ -276891,4 +276746,4 @@ function sdkCliCommand(exitOverride = undefined) {
276891
276746
  ascii();
276892
276747
  sdkCliCommand();
276893
276748
 
276894
- //# debugId=2FB88CE1A66FD83164756E2164756E21
276749
+ //# debugId=A97C376CB78E2CC864756E2164756E21