@settlemint/sdk-cli 0.7.4 → 0.8.0

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 +1061 -1024
  2. package/dist/cli.js.map +51 -51
  3. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -197427,7 +197427,7 @@ ${Bt.cyan(Yt)}
197427
197427
  code: "ENOENT"
197428
197428
  }), getPathInfo = (e9, t7) => {
197429
197429
  var r6 = t7.colon || or;
197430
- 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.Q7nndfb3gP:/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)];
197430
+ 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.kCMc0k2dcn:/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)];
197431
197431
  var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
197432
197432
  var a5 = nr ? n6.split(r6) : [""];
197433
197433
  if (nr) {
@@ -200564,7 +200564,7 @@ ${whileRunning(e9)}`;
200564
200564
  };
200565
200565
  ni = Object.assign(async function _main() {
200566
200566
  var e9 = new Cli({
200567
- binaryVersion: "0.7.4",
200567
+ binaryVersion: "0.8.0",
200568
200568
  binaryLabel: "gql.tada CLI",
200569
200569
  binaryName: "gql.tada"
200570
200570
  });
@@ -218401,7 +218401,7 @@ var require_lib4 = __commonJS((exports, module) => {
218401
218401
  var rRel = new RegExp(`^\\.${rSlash.source}`);
218402
218402
  var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
218403
218403
  var getPathInfo2 = (cmd2, {
218404
- 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.Q7nndfb3gP:/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",
218404
+ 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.kCMc0k2dcn:/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",
218405
218405
  pathExt: optPathExt = process.env.PATHEXT,
218406
218406
  delimiter: optDelimiter = delimiter
218407
218407
  }) => {
@@ -218605,7 +218605,7 @@ var require_lib5 = __commonJS((exports, module) => {
218605
218605
  let pathToInitial;
218606
218606
  try {
218607
218607
  pathToInitial = which.sync(initialCmd, {
218608
- 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.Q7nndfb3gP:/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",
218608
+ 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.kCMc0k2dcn:/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",
218609
218609
  pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
218610
218610
  }).toLowerCase();
218611
218611
  } catch (err) {
@@ -219322,7 +219322,7 @@ var require_lib6 = __commonJS((exports, module) => {
219322
219322
  var rRel = new RegExp(`^\\.${rSlash.source}`);
219323
219323
  var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
219324
219324
  var getPathInfo2 = (cmd2, {
219325
- 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.Q7nndfb3gP:/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",
219325
+ 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.kCMc0k2dcn:/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",
219326
219326
  pathExt: optPathExt = process.env.PATHEXT,
219327
219327
  delimiter: optDelimiter = delimiter
219328
219328
  }) => {
@@ -235213,7 +235213,7 @@ var require_which2 = __commonJS((exports, module) => {
235213
235213
  const colon = opt2.colon || COLON;
235214
235214
  const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
235215
235215
  ...isWindows2 ? [process.cwd()] : [],
235216
- ...(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.Q7nndfb3gP:/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)
235216
+ ...(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.kCMc0k2dcn:/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)
235217
235217
  ];
235218
235218
  const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
235219
235219
  const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
@@ -267675,10 +267675,7 @@ var cancel = (msg) => {
267675
267675
  var ApplicationAccessTokenSchema = z3.string().regex(/^sm_aat_.*$/);
267676
267676
  var PersonalAccessTokenSchema = z3.string().regex(/^sm_pat_.*$/);
267677
267677
  var AccessTokenSchema = z3.string().regex(/^sm_pat_.*|sm_aat_.*$/);
267678
- var IdSchema = z3.union([
267679
- z3.string().uuid(),
267680
- z3.string().regex(/^[0-9a-fA-F]{24}$/)
267681
- ]);
267678
+ var UniqueNameSchema = z3.string().regex(/^[a-z0-9-]+$/);
267682
267679
  var UrlSchema = z3.string().url();
267683
267680
  var UrlPathSchema = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
267684
267681
  message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
@@ -267688,33 +267685,33 @@ var DotEnvSchema = z3.object({
267688
267685
  SETTLEMINT_INSTANCE: UrlSchema.default("https://console.settlemint.com"),
267689
267686
  SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema.optional(),
267690
267687
  SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema.optional(),
267691
- SETTLEMINT_WORKSPACE: IdSchema.optional(),
267692
- SETTLEMINT_APPLICATION: IdSchema.optional(),
267693
- SETTLEMINT_BLOCKCHAIN_NETWORK: IdSchema.optional(),
267694
- SETTLEMINT_BLOCKCHAIN_NODE: IdSchema.optional(),
267695
- SETTLEMINT_LOAD_BALANCER: IdSchema.optional(),
267696
- SETTLEMINT_HASURA: IdSchema.optional(),
267688
+ SETTLEMINT_WORKSPACE: UniqueNameSchema.optional(),
267689
+ SETTLEMINT_APPLICATION: UniqueNameSchema.optional(),
267690
+ SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema.optional(),
267691
+ SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema.optional(),
267692
+ SETTLEMINT_LOAD_BALANCER: UniqueNameSchema.optional(),
267693
+ SETTLEMINT_HASURA: UniqueNameSchema.optional(),
267697
267694
  SETTLEMINT_HASURA_ENDPOINT: UrlSchema.optional(),
267698
267695
  SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
267699
267696
  SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
267700
- SETTLEMINT_THEGRAPH: IdSchema.optional(),
267697
+ SETTLEMINT_THEGRAPH: UniqueNameSchema.optional(),
267701
267698
  SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson(value4, []), z3.array(UrlSchema).optional()),
267702
267699
  SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
267703
- SETTLEMINT_PORTAL: IdSchema.optional(),
267700
+ SETTLEMINT_PORTAL: UniqueNameSchema.optional(),
267704
267701
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
267705
267702
  SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
267706
- SETTLEMINT_HD_PRIVATE_KEY: z3.string().optional(),
267707
- SETTLEMINT_MINIO: IdSchema.optional(),
267703
+ SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema.optional(),
267704
+ SETTLEMINT_MINIO: UniqueNameSchema.optional(),
267708
267705
  SETTLEMINT_MINIO_ENDPOINT: UrlSchema.optional(),
267709
267706
  SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
267710
267707
  SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
267711
- SETTLEMINT_IPFS: IdSchema.optional(),
267708
+ SETTLEMINT_IPFS: UniqueNameSchema.optional(),
267712
267709
  SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema.optional(),
267713
267710
  SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema.optional(),
267714
267711
  SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema.optional(),
267715
- SETTLEMINT_CUSTOM_DEPLOYMENT: IdSchema.optional(),
267712
+ SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema.optional(),
267716
267713
  SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema.optional(),
267717
- SETTLEMINT_BLOCKSCOUT: IdSchema.optional(),
267714
+ SETTLEMINT_BLOCKSCOUT: UniqueNameSchema.optional(),
267718
267715
  SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema.optional(),
267719
267716
  SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema.optional(),
267720
267717
  SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
@@ -267722,6 +267719,10 @@ var DotEnvSchema = z3.object({
267722
267719
  SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
267723
267720
  });
267724
267721
  var DotEnvSchemaPartial = DotEnvSchema.partial();
267722
+ var IdSchema = z3.union([
267723
+ z3.string().uuid(),
267724
+ z3.string().regex(/^[0-9a-fA-F]{24}$/)
267725
+ ]);
267725
267726
  function validate(schema, value4) {
267726
267727
  try {
267727
267728
  return schema.parse(value4);
@@ -269969,10 +269970,7 @@ function tryParseJson2(value4, defaultValue = null) {
269969
269970
  return defaultValue;
269970
269971
  }
269971
269972
  }
269972
- var IdSchema2 = z3.union([
269973
- z3.string().uuid(),
269974
- z3.string().regex(/^[0-9a-fA-F]{24}$/)
269975
- ]);
269973
+ var UniqueNameSchema2 = z3.string().regex(/^[a-z0-9-]+$/);
269976
269974
  var UrlSchema2 = z3.string().url();
269977
269975
  var UrlPathSchema2 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
269978
269976
  message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
@@ -269982,33 +269980,33 @@ var DotEnvSchema2 = z3.object({
269982
269980
  SETTLEMINT_INSTANCE: UrlSchema2.default("https://console.settlemint.com"),
269983
269981
  SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema2.optional(),
269984
269982
  SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema2.optional(),
269985
- SETTLEMINT_WORKSPACE: IdSchema2.optional(),
269986
- SETTLEMINT_APPLICATION: IdSchema2.optional(),
269987
- SETTLEMINT_BLOCKCHAIN_NETWORK: IdSchema2.optional(),
269988
- SETTLEMINT_BLOCKCHAIN_NODE: IdSchema2.optional(),
269989
- SETTLEMINT_LOAD_BALANCER: IdSchema2.optional(),
269990
- SETTLEMINT_HASURA: IdSchema2.optional(),
269983
+ SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
269984
+ SETTLEMINT_APPLICATION: UniqueNameSchema2.optional(),
269985
+ SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema2.optional(),
269986
+ SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema2.optional(),
269987
+ SETTLEMINT_LOAD_BALANCER: UniqueNameSchema2.optional(),
269988
+ SETTLEMINT_HASURA: UniqueNameSchema2.optional(),
269991
269989
  SETTLEMINT_HASURA_ENDPOINT: UrlSchema2.optional(),
269992
269990
  SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
269993
269991
  SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
269994
- SETTLEMINT_THEGRAPH: IdSchema2.optional(),
269992
+ SETTLEMINT_THEGRAPH: UniqueNameSchema2.optional(),
269995
269993
  SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson2(value4, []), z3.array(UrlSchema2).optional()),
269996
269994
  SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
269997
- SETTLEMINT_PORTAL: IdSchema2.optional(),
269995
+ SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
269998
269996
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
269999
269997
  SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
270000
- SETTLEMINT_HD_PRIVATE_KEY: z3.string().optional(),
270001
- SETTLEMINT_MINIO: IdSchema2.optional(),
269998
+ SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema2.optional(),
269999
+ SETTLEMINT_MINIO: UniqueNameSchema2.optional(),
270002
270000
  SETTLEMINT_MINIO_ENDPOINT: UrlSchema2.optional(),
270003
270001
  SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
270004
270002
  SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
270005
- SETTLEMINT_IPFS: IdSchema2.optional(),
270003
+ SETTLEMINT_IPFS: UniqueNameSchema2.optional(),
270006
270004
  SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema2.optional(),
270007
270005
  SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema2.optional(),
270008
270006
  SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema2.optional(),
270009
- SETTLEMINT_CUSTOM_DEPLOYMENT: IdSchema2.optional(),
270007
+ SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema2.optional(),
270010
270008
  SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema2.optional(),
270011
- SETTLEMINT_BLOCKSCOUT: IdSchema2.optional(),
270009
+ SETTLEMINT_BLOCKSCOUT: UniqueNameSchema2.optional(),
270012
270010
  SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
270013
270011
  SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema2.optional(),
270014
270012
  SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
@@ -270016,6 +270014,10 @@ var DotEnvSchema2 = z3.object({
270016
270014
  SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
270017
270015
  });
270018
270016
  var DotEnvSchemaPartial2 = DotEnvSchema2.partial();
270017
+ var IdSchema2 = z3.union([
270018
+ z3.string().uuid(),
270019
+ z3.string().regex(/^[0-9a-fA-F]{24}$/)
270020
+ ]);
270019
270021
  function validate2(schema, value4) {
270020
270022
  try {
270021
270023
  return schema.parse(value4);
@@ -270627,10 +270629,7 @@ function tryParseJson3(value4, defaultValue = null) {
270627
270629
  return defaultValue;
270628
270630
  }
270629
270631
  }
270630
- var IdSchema3 = z3.union([
270631
- z3.string().uuid(),
270632
- z3.string().regex(/^[0-9a-fA-F]{24}$/)
270633
- ]);
270632
+ var UniqueNameSchema3 = z3.string().regex(/^[a-z0-9-]+$/);
270634
270633
  var UrlSchema3 = z3.string().url();
270635
270634
  var UrlPathSchema3 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
270636
270635
  message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
@@ -270640,33 +270639,33 @@ var DotEnvSchema3 = z3.object({
270640
270639
  SETTLEMINT_INSTANCE: UrlSchema3.default("https://console.settlemint.com"),
270641
270640
  SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema3.optional(),
270642
270641
  SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema3.optional(),
270643
- SETTLEMINT_WORKSPACE: IdSchema3.optional(),
270644
- SETTLEMINT_APPLICATION: IdSchema3.optional(),
270645
- SETTLEMINT_BLOCKCHAIN_NETWORK: IdSchema3.optional(),
270646
- SETTLEMINT_BLOCKCHAIN_NODE: IdSchema3.optional(),
270647
- SETTLEMINT_LOAD_BALANCER: IdSchema3.optional(),
270648
- SETTLEMINT_HASURA: IdSchema3.optional(),
270642
+ SETTLEMINT_WORKSPACE: UniqueNameSchema3.optional(),
270643
+ SETTLEMINT_APPLICATION: UniqueNameSchema3.optional(),
270644
+ SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema3.optional(),
270645
+ SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema3.optional(),
270646
+ SETTLEMINT_LOAD_BALANCER: UniqueNameSchema3.optional(),
270647
+ SETTLEMINT_HASURA: UniqueNameSchema3.optional(),
270649
270648
  SETTLEMINT_HASURA_ENDPOINT: UrlSchema3.optional(),
270650
270649
  SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
270651
270650
  SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
270652
- SETTLEMINT_THEGRAPH: IdSchema3.optional(),
270651
+ SETTLEMINT_THEGRAPH: UniqueNameSchema3.optional(),
270653
270652
  SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson3(value4, []), z3.array(UrlSchema3).optional()),
270654
270653
  SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
270655
- SETTLEMINT_PORTAL: IdSchema3.optional(),
270654
+ SETTLEMINT_PORTAL: UniqueNameSchema3.optional(),
270656
270655
  SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
270657
270656
  SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema3.optional(),
270658
- SETTLEMINT_HD_PRIVATE_KEY: z3.string().optional(),
270659
- SETTLEMINT_MINIO: IdSchema3.optional(),
270657
+ SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema3.optional(),
270658
+ SETTLEMINT_MINIO: UniqueNameSchema3.optional(),
270660
270659
  SETTLEMINT_MINIO_ENDPOINT: UrlSchema3.optional(),
270661
270660
  SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
270662
270661
  SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
270663
- SETTLEMINT_IPFS: IdSchema3.optional(),
270662
+ SETTLEMINT_IPFS: UniqueNameSchema3.optional(),
270664
270663
  SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema3.optional(),
270665
270664
  SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema3.optional(),
270666
270665
  SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema3.optional(),
270667
- SETTLEMINT_CUSTOM_DEPLOYMENT: IdSchema3.optional(),
270666
+ SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema3.optional(),
270668
270667
  SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema3.optional(),
270669
- SETTLEMINT_BLOCKSCOUT: IdSchema3.optional(),
270668
+ SETTLEMINT_BLOCKSCOUT: UniqueNameSchema3.optional(),
270670
270669
  SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
270671
270670
  SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema3.optional(),
270672
270671
  SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
@@ -270674,6 +270673,10 @@ var DotEnvSchema3 = z3.object({
270674
270673
  SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
270675
270674
  });
270676
270675
  var DotEnvSchemaPartial3 = DotEnvSchema3.partial();
270676
+ var IdSchema3 = z3.union([
270677
+ z3.string().uuid(),
270678
+ z3.string().regex(/^[0-9a-fA-F]{24}$/)
270679
+ ]);
270677
270680
  function validate3(schema, value4) {
270678
270681
  try {
270679
270682
  return schema.parse(value4);
@@ -271278,95 +271281,246 @@ var t7 = initGraphQLTada();
271278
271281
 
271279
271282
  // ../js/dist/settlemint.mjs
271280
271283
  var graphql = initGraphQLTada();
271281
- var createApplicationAccessToken = graphql(`
271282
- mutation CreateApplicationAccessToken($applicationId: ID!, $blockchainNetworkScope: BlockchainNetworkScopeInputType!, $blockchainNodeScope: BlockchainNodeScopeInputType!, $customDeploymentScope: CustomDeploymentScopeInputType!, $insightsScope: InsightsScopeInputType!, $integrationScope: IntegrationScopeInputType!, $loadBalancerScope: LoadBalancerScopeInputType!, $middlewareScope: MiddlewareScopeInputType!, $name: String!, $privateKeyScope: PrivateKeyScopeInputType!, $smartContractSetScope: SmartContractSetScopeInputType!, $storageScope: StorageScopeInputType!, $validityPeriod: AccessTokenValidityPeriod!) {
271283
- createApplicationAccessToken(applicationId: $applicationId, blockchainNetworkScope: $blockchainNetworkScope, blockchainNodeScope: $blockchainNodeScope, customDeploymentScope: $customDeploymentScope, insightsScope: $insightsScope, integrationScope: $integrationScope, loadBalancerScope: $loadBalancerScope, middlewareScope: $middlewareScope, name: $name, privateKeyScope: $privateKeyScope, smartContractSetScope: $smartContractSetScope, storageScope: $storageScope, validityPeriod: $validityPeriod) {
271284
- token
271284
+ var WorkspaceFragment = graphql(`
271285
+ fragment Workspace on Workspace {
271286
+ id
271287
+ uniqueName
271288
+ name
271289
+ applications {
271290
+ id
271291
+ uniqueName
271292
+ name
271285
271293
  }
271286
271294
  }
271287
- `, []);
271288
- var applicationAccessTokenCreate = (gqlClient, options) => {
271289
- return async (args) => {
271290
- validate3(IdSchema3, args.applicationId);
271291
- const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, args);
271292
- if (!applicationAccessToken.token) {
271293
- throw new Error("Failed to create application access token");
271295
+ `);
271296
+ var getWorkspacesAndApplications = graphql(`
271297
+ query getWorkspacesAndApplications {
271298
+ workspaces {
271299
+ ...Workspace
271300
+ childWorkspaces {
271301
+ ...Workspace
271302
+ }
271303
+ }
271294
271304
  }
271295
- return applicationAccessToken.token;
271305
+ `, [WorkspaceFragment]);
271306
+ var getWorkspace = graphql(`
271307
+ query getWorkspace($uniqueName: String!) {
271308
+ workspaceByUniqueName(uniqueName: $uniqueName) {
271309
+ ...Workspace
271310
+ }
271311
+ }
271312
+ `, [WorkspaceFragment]);
271313
+ var createWorkspace = graphql(`
271314
+ mutation CreateWorkspace(
271315
+ $addressLine1: String
271316
+ $addressLine2: String
271317
+ $city: String
271318
+ $companyName: String
271319
+ $country: String
271320
+ $name: String!
271321
+ $parentId: String
271322
+ $paymentMethodId: String
271323
+ $postalCode: String
271324
+ $taxIdType: String
271325
+ $taxIdValue: String
271326
+ ) {
271327
+ createWorkspace(
271328
+ addressLine1: $addressLine1
271329
+ addressLine2: $addressLine2
271330
+ city: $city
271331
+ companyName: $companyName
271332
+ country: $country
271333
+ name: $name
271334
+ parentId: $parentId
271335
+ paymentMethodId: $paymentMethodId
271336
+ postalCode: $postalCode
271337
+ taxIdType: $taxIdType
271338
+ taxIdValue: $taxIdValue
271339
+ ) {
271340
+ ...Workspace
271341
+ }
271342
+ }
271343
+ `, [WorkspaceFragment]);
271344
+ var deleteWorkspace = graphql(`
271345
+ mutation deleteWorkspace($id: ID!) {
271346
+ deleteWorkspace(workspaceId: $id) {
271347
+ ...Workspace
271348
+ }
271349
+ }
271350
+ `, [WorkspaceFragment]);
271351
+ var addCredits = graphql(`
271352
+ mutation addCredits($workspaceId: String!, $amount: Float!) {
271353
+ addCredits(workspaceId: $workspaceId, amount: $amount)
271354
+ }
271355
+ `);
271356
+ var workspaceList = (gqlClient, options) => {
271357
+ return async () => {
271358
+ const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
271359
+ const allWorkspaces = workspaces.reduce((acc, workspace) => {
271360
+ acc.push(workspace);
271361
+ if (workspace.childWorkspaces) {
271362
+ acc.push(...workspace.childWorkspaces);
271363
+ }
271364
+ return acc;
271365
+ }, []);
271366
+ return allWorkspaces.sort((a8, b4) => a8.name.localeCompare(b4.name));
271367
+ };
271368
+ };
271369
+ var workspaceRead = (gqlClient, options) => {
271370
+ return async (workspaceUniqueName) => {
271371
+ const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });
271372
+ return workspaceByUniqueName;
271373
+ };
271374
+ };
271375
+ var workspaceCreate = (gqlClient, options) => {
271376
+ return async (createWorkspaceArgs) => {
271377
+ const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);
271378
+ return workspace;
271379
+ };
271380
+ };
271381
+ var workspaceDelete = (gqlClient, options) => {
271382
+ return async (workspaceUniqueName) => {
271383
+ const workspaceToDelete = await workspaceRead(gqlClient, options)(workspaceUniqueName);
271384
+ const { deleteWorkspace: workspace } = await gqlClient.request(deleteWorkspace, { id: workspaceToDelete.id });
271385
+ return workspace;
271386
+ };
271387
+ };
271388
+ var workspaceAddCredits = (gqlClient, options) => {
271389
+ return async (workspaceId, amount) => {
271390
+ const id = validate3(IdSchema3, workspaceId);
271391
+ if (amount <= 0) {
271392
+ throw new Error("Credit amount must be a positive number");
271393
+ }
271394
+ const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });
271395
+ return result;
271296
271396
  };
271297
271397
  };
271298
271398
  var ApplicationFragment = graphql(`
271299
271399
  fragment Application on Application {
271300
271400
  id
271401
+ uniqueName
271301
271402
  name
271302
- workspace { id }
271403
+ workspace {
271404
+ id
271405
+ uniqueName
271406
+ }
271303
271407
  }
271304
271408
  `);
271305
271409
  var listApplications = graphql(`
271306
- query ListApplications($workspaceId: ID!) {
271307
- workspace (workspaceId: $workspaceId) {
271308
- applications {
271309
- ...Application
271410
+ query ListApplications($workspaceUniqueName: String!) {
271411
+ workspaceByUniqueName(uniqueName: $workspaceUniqueName) {
271412
+ applications {
271413
+ ...Application
271414
+ }
271310
271415
  }
271311
271416
  }
271312
- }
271313
271417
  `, [ApplicationFragment]);
271314
271418
  var readApplication = graphql(`
271315
- query ReadApplication($id: ID!) {
271316
- application(applicationId: $id) {
271317
- ...Application
271419
+ query ReadApplication($applicationUniqueName: String!) {
271420
+ applicationByUniqueName(uniqueName: $applicationUniqueName) {
271421
+ ...Application
271422
+ }
271318
271423
  }
271319
- }
271320
271424
  `, [ApplicationFragment]);
271321
271425
  var createApplication = graphql(`
271322
- mutation CreateApplication(
271323
- $name: String!
271324
- $workspaceId: ID!
271325
- ) {
271326
- createApplication(
271327
- name: $name
271328
- workspaceId: $workspaceId
271329
- ) {
271330
- ...Application
271426
+ mutation CreateApplication($name: String!, $workspaceId: ID!) {
271427
+ createApplication(name: $name, workspaceId: $workspaceId) {
271428
+ ...Application
271429
+ }
271331
271430
  }
271332
- }
271333
271431
  `, [ApplicationFragment]);
271334
271432
  var deleteApplication = graphql(`
271335
- mutation DeleteApplication($id: ID!) {
271336
- deleteApplication(id: $id) {
271337
- ...Application
271433
+ mutation DeleteApplication($id: ID!) {
271434
+ deleteApplication(id: $id) {
271435
+ ...Application
271436
+ }
271338
271437
  }
271339
- }
271340
271438
  `, [ApplicationFragment]);
271341
271439
  var applicationList = (gqlClient, options) => {
271342
- return async (workspaceId) => {
271343
- const id = validate3(IdSchema3, workspaceId);
271440
+ return async (workspaceUniqueName) => {
271344
271441
  const {
271345
- workspace: { applications }
271346
- } = await gqlClient.request(listApplications, { workspaceId: id });
271442
+ workspaceByUniqueName: { applications }
271443
+ } = await gqlClient.request(listApplications, { workspaceUniqueName });
271347
271444
  return applications;
271348
271445
  };
271349
271446
  };
271350
271447
  var applicationRead = (gqlClient, options) => {
271351
- return async (applicationId) => {
271352
- const id = validate3(IdSchema3, applicationId);
271353
- const { application } = await gqlClient.request(readApplication, { id });
271448
+ return async (applicationUniqueName) => {
271449
+ const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {
271450
+ applicationUniqueName
271451
+ });
271354
271452
  return application;
271355
271453
  };
271356
271454
  };
271357
271455
  var applicationCreate = (gqlClient, options) => {
271358
271456
  return async (args) => {
271359
- const { createApplication: application } = await gqlClient.request(createApplication, args);
271457
+ const { workspaceUniqueName, ...otherArgs } = args;
271458
+ const workspace = await workspaceRead(gqlClient, options)(workspaceUniqueName);
271459
+ const { createApplication: application } = await gqlClient.request(createApplication, {
271460
+ ...otherArgs,
271461
+ workspaceId: workspace.id
271462
+ });
271360
271463
  return application;
271361
271464
  };
271362
271465
  };
271363
271466
  var applicationDelete = (gqlClient, options) => {
271364
- return async (applicationId) => {
271365
- const id = validate3(IdSchema3, applicationId);
271366
- const { deleteApplication: application } = await gqlClient.request(deleteApplication, { id });
271467
+ return async (applicationUniqueName) => {
271468
+ const applicationToDelete = await applicationRead(gqlClient, options)(applicationUniqueName);
271469
+ const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
271470
+ id: applicationToDelete.id
271471
+ });
271367
271472
  return application;
271368
271473
  };
271369
271474
  };
271475
+ var createApplicationAccessToken = graphql(`
271476
+ mutation CreateApplicationAccessToken(
271477
+ $applicationId: ID!,
271478
+ $blockchainNetworkScope: BlockchainNetworkScopeInputType!,
271479
+ $blockchainNodeScope: BlockchainNodeScopeInputType!,
271480
+ $customDeploymentScope: CustomDeploymentScopeInputType!,
271481
+ $insightsScope: InsightsScopeInputType!,
271482
+ $integrationScope: IntegrationScopeInputType!,
271483
+ $loadBalancerScope: LoadBalancerScopeInputType!,
271484
+ $middlewareScope: MiddlewareScopeInputType!,
271485
+ $name: String!,
271486
+ $privateKeyScope: PrivateKeyScopeInputType!,
271487
+ $smartContractSetScope: SmartContractSetScopeInputType!,
271488
+ $storageScope: StorageScopeInputType!,
271489
+ $validityPeriod: AccessTokenValidityPeriod!
271490
+ ) {
271491
+ createApplicationAccessToken(
271492
+ applicationId: $applicationId,
271493
+ blockchainNetworkScope: $blockchainNetworkScope,
271494
+ blockchainNodeScope: $blockchainNodeScope,
271495
+ customDeploymentScope: $customDeploymentScope,
271496
+ insightsScope: $insightsScope,
271497
+ integrationScope: $integrationScope,
271498
+ loadBalancerScope: $loadBalancerScope,
271499
+ middlewareScope: $middlewareScope,
271500
+ name: $name,
271501
+ privateKeyScope: $privateKeyScope,
271502
+ smartContractSetScope: $smartContractSetScope,
271503
+ storageScope: $storageScope,
271504
+ validityPeriod: $validityPeriod
271505
+ ) {
271506
+ token
271507
+ }
271508
+ }
271509
+ `, []);
271510
+ var applicationAccessTokenCreate = (gqlClient, options) => {
271511
+ return async (args) => {
271512
+ const { applicationUniqueName, ...otherArgs } = args;
271513
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
271514
+ const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, {
271515
+ ...otherArgs,
271516
+ applicationId: application.id
271517
+ });
271518
+ if (!applicationAccessToken.token) {
271519
+ throw new Error("Failed to create application access token");
271520
+ }
271521
+ return applicationAccessToken.token;
271522
+ };
271523
+ };
271370
271524
  function setClusterServiceDefaults(args) {
271371
271525
  return {
271372
271526
  ...args,
@@ -271393,31 +271547,34 @@ var BlockchainNetworkFragment = graphql(`
271393
271547
  fragment BlockchainNetwork on BlockchainNetwork {
271394
271548
  __typename
271395
271549
  id
271550
+ uniqueName
271396
271551
  name
271397
271552
  status
271398
271553
  blockchainNodes {
271399
271554
  ... on BlockchainNode {
271400
271555
  id
271401
271556
  name
271557
+ uniqueName
271402
271558
  }
271403
271559
  }
271404
271560
  }
271405
271561
  `);
271406
271562
  var getBlockchainNetworks = graphql(`
271407
- query getBlockchainNetworks($id: ID!) {
271408
- blockchainNetworks(applicationId: $id) {
271409
- items {
271410
- ...BlockchainNetwork
271563
+ query getBlockchainNetworks($applicationUniqueName: String!) {
271564
+ blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {
271565
+ items {
271566
+ ...BlockchainNetwork
271567
+ }
271568
+ }
271411
271569
  }
271412
- }
271413
- }`, [BlockchainNetworkFragment]);
271570
+ `, [BlockchainNetworkFragment]);
271414
271571
  var getBlockchainNetwork = graphql(`
271415
- query getBlockchainNetwork($id: ID!) {
271416
- blockchainNetwork(entityId: $id) {
271417
- ...BlockchainNetwork
271572
+ query getBlockchainNetwork($uniqueName: String!) {
271573
+ blockchainNetworkByUniqueName(uniqueName: $uniqueName) {
271574
+ ...BlockchainNetwork
271575
+ }
271418
271576
  }
271419
- }
271420
- `, [BlockchainNetworkFragment]);
271577
+ `, [BlockchainNetworkFragment]);
271421
271578
  var createBlockchainNetwork = graphql(`
271422
271579
  mutation createBlockchainNetwork(
271423
271580
  $applicationId: ID!
@@ -271478,65 +271635,67 @@ var createBlockchainNetwork = graphql(`
271478
271635
  ...BlockchainNetwork
271479
271636
  }
271480
271637
  }
271481
- `, [BlockchainNetworkFragment]);
271638
+ `, [BlockchainNetworkFragment]);
271482
271639
  var deleteBlockchainNetwork = graphql(`
271483
- mutation deleteBlockchainNetwork($blockchainNetworkId: ID!) {
271484
- deleteBlockchainNetwork(entityId: $blockchainNetworkId) {
271640
+ mutation deleteBlockchainNetwork($uniqueName: String!) {
271641
+ deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
271485
271642
  ...BlockchainNetwork
271486
271643
  }
271487
271644
  }
271488
- `, [BlockchainNetworkFragment]);
271645
+ `, [BlockchainNetworkFragment]);
271489
271646
  var restartBlockchainNetwork = graphql(`
271490
- mutation RestartBlockchainNetwork($id: ID!) {
271491
- restartBlockchainNetwork(entityId: $id) {
271647
+ mutation RestartBlockchainNetwork($uniqueName: String!) {
271648
+ restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
271492
271649
  ...BlockchainNetwork
271493
271650
  }
271494
271651
  }
271495
- `, [BlockchainNetworkFragment]);
271652
+ `, [BlockchainNetworkFragment]);
271496
271653
  var blockchainNetworkList = (gqlClient, options) => {
271497
- return async (applicationId) => {
271498
- const id = validate3(IdSchema3, applicationId);
271654
+ return async (applicationUniqueName) => {
271499
271655
  const {
271500
- blockchainNetworks: { items }
271501
- } = await gqlClient.request(getBlockchainNetworks, { id });
271656
+ blockchainNetworksByUniqueName: { items }
271657
+ } = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });
271502
271658
  return items;
271503
271659
  };
271504
271660
  };
271505
271661
  var blockchainNetworkRead = (gqlClient, options) => {
271506
- return async (blockchainNetworkId) => {
271507
- const id = validate3(IdSchema3, blockchainNetworkId);
271508
- const { blockchainNetwork } = await gqlClient.request(getBlockchainNetwork, { id });
271509
- return blockchainNetwork;
271662
+ return async (blockchainNetworkUniqueName) => {
271663
+ const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {
271664
+ uniqueName: blockchainNetworkUniqueName
271665
+ });
271666
+ return blockchainNetworkByUniqueName;
271510
271667
  };
271511
271668
  };
271512
271669
  var blockchainNetworkCreate = (gqlClient, options) => {
271513
271670
  return async (args) => {
271514
- const blockchainNetworkArgs = setNetworkDefaults(args);
271515
- validate3(IdSchema3, blockchainNetworkArgs.applicationId);
271516
- const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, blockchainNetworkArgs);
271671
+ const { applicationUniqueName, ...otherArgs } = args;
271672
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
271673
+ const blockchainNetworkArgs = setNetworkDefaults(otherArgs);
271674
+ const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {
271675
+ ...blockchainNetworkArgs,
271676
+ applicationId: application.id
271677
+ });
271517
271678
  return blockchainNetwork;
271518
271679
  };
271519
271680
  };
271520
271681
  var blockchainNetworkDelete = (gqlClient, options) => {
271521
- return async (networkId) => {
271522
- const id = validate3(IdSchema3, networkId);
271523
- const { deleteBlockchainNetwork: blockchainNetwork } = await gqlClient.request(deleteBlockchainNetwork, {
271524
- blockchainNetworkId: id
271682
+ return async (blockchainNetworkUniqueName) => {
271683
+ const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(deleteBlockchainNetwork, {
271684
+ uniqueName: blockchainNetworkUniqueName
271525
271685
  });
271526
271686
  return blockchainNetwork;
271527
271687
  };
271528
271688
  };
271529
- var blockchainNetworkRestart = (gqlClient, _options) => async (networkId) => {
271530
- const id = validate3(IdSchema3, networkId);
271531
- const { restartBlockchainNetwork: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { id });
271689
+ var blockchainNetworkRestart = (gqlClient, _options) => async (blockchainNetworkUniqueName) => {
271690
+ const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
271532
271691
  return blockchainNetwork;
271533
271692
  };
271534
271693
  var BlockchainNodeFragment = graphql(`
271535
271694
  fragment BlockchainNode on BlockchainNode {
271536
271695
  __typename
271537
271696
  id
271538
- name
271539
271697
  uniqueName
271698
+ name
271540
271699
  status
271541
271700
  isEvm
271542
271701
  endpoints {
@@ -271553,6 +271712,7 @@ var BlockchainNodeFragment = graphql(`
271553
271712
  ... on AbstractClusterService {
271554
271713
  id
271555
271714
  name
271715
+ uniqueName
271556
271716
  }
271557
271717
  }
271558
271718
  privateKeys {
@@ -271566,86 +271726,96 @@ var BlockchainNodeFragment = graphql(`
271566
271726
  }
271567
271727
  `);
271568
271728
  var getBlockchainNodes = graphql(`
271569
- query getBlockchainNodes($id: ID!) {
271570
- blockchainNodes(applicationId: $id) {
271571
- items {
271572
- ...BlockchainNode
271573
- }
271574
- }
271575
- }`, [BlockchainNodeFragment]);
271729
+ query getBlockchainNodes($applicationUniqueName: String!) {
271730
+ blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {
271731
+ items {
271732
+ ...BlockchainNode
271733
+ }
271734
+ }
271735
+ }
271736
+ `, [BlockchainNodeFragment]);
271576
271737
  var getBlockchainNode = graphql(`
271577
- query getBlockchainNode($id: ID!) {
271578
- blockchainNode(entityId: $id) {
271579
- ...BlockchainNode
271580
- }
271581
- }
271582
- `, [BlockchainNodeFragment]);
271738
+ query getBlockchainNode($uniqueName: String!) {
271739
+ blockchainNodeByUniqueName(uniqueName: $uniqueName) {
271740
+ ...BlockchainNode
271741
+ }
271742
+ }
271743
+ `, [BlockchainNodeFragment]);
271583
271744
  var createBlockchainNode = graphql(`
271584
- mutation createBlockchainNode(
271585
- $applicationId: ID!
271586
- $blockchainNetworkId: ID!
271587
- $name: String!
271588
- $provider: String!
271589
- $region: String!
271590
- $size: ClusterServiceSize
271591
- $type: ClusterServiceType
271592
- $nodeType: NodeType
271593
- $keyMaterial: ID
271594
- ) {
271595
- createBlockchainNode(
271596
- applicationId: $applicationId
271597
- blockchainNetworkId: $blockchainNetworkId
271598
- name: $name
271599
- provider: $provider
271600
- region: $region
271601
- size: $size
271602
- type: $type
271603
- nodeType: $nodeType
271604
- keyMaterial: $keyMaterial
271745
+ mutation createBlockchainNode(
271746
+ $applicationId: ID!
271747
+ $blockchainNetworkId: ID!
271748
+ $name: String!
271749
+ $provider: String!
271750
+ $region: String!
271751
+ $size: ClusterServiceSize
271752
+ $type: ClusterServiceType
271753
+ $nodeType: NodeType
271754
+ $keyMaterial: ID
271605
271755
  ) {
271606
- ...BlockchainNode
271607
- }
271608
- }
271609
- `, [BlockchainNodeFragment]);
271756
+ createBlockchainNode(
271757
+ applicationId: $applicationId
271758
+ blockchainNetworkId: $blockchainNetworkId
271759
+ name: $name
271760
+ provider: $provider
271761
+ region: $region
271762
+ size: $size
271763
+ type: $type
271764
+ nodeType: $nodeType
271765
+ keyMaterial: $keyMaterial
271766
+ ) {
271767
+ ...BlockchainNode
271768
+ }
271769
+ }
271770
+ `, [BlockchainNodeFragment]);
271610
271771
  var restartBlockchainNode = graphql(`
271611
- mutation RestartBlockchainNode($id: ID!) {
271612
- restartBlockchainNode(entityId: $id) {
271613
- ...BlockchainNode
271772
+ mutation RestartBlockchainNode($uniqueName: String!) {
271773
+ restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
271774
+ ...BlockchainNode
271775
+ }
271614
271776
  }
271615
- }
271616
- `, [BlockchainNodeFragment]);
271777
+ `, [BlockchainNodeFragment]);
271617
271778
  var blockchainNodeList = (gqlClient, options) => {
271618
- return async (applicationId) => {
271619
- const id = validate3(IdSchema3, applicationId);
271779
+ return async (applicationUniqueName) => {
271620
271780
  const {
271621
- blockchainNodes: { items }
271622
- } = await gqlClient.request(getBlockchainNodes, { id });
271781
+ blockchainNodesByUniqueName: { items }
271782
+ } = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });
271623
271783
  return items;
271624
271784
  };
271625
271785
  };
271626
271786
  var blockchainNodeRead = (gqlClient, options) => {
271627
- return async (blockchainNodeId) => {
271628
- const id = validate3(IdSchema3, blockchainNodeId);
271629
- const { blockchainNode } = await gqlClient.request(getBlockchainNode, { id });
271630
- return blockchainNode;
271787
+ return async (blockchainNodeUniqueName) => {
271788
+ const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {
271789
+ uniqueName: blockchainNodeUniqueName
271790
+ });
271791
+ return blockchainNodeByUniqueName;
271631
271792
  };
271632
271793
  };
271633
271794
  var blockchainNodeCreate = (gqlClient, options) => {
271634
271795
  return async (args) => {
271635
- validate3(IdSchema3, args.applicationId);
271636
- validate3(IdSchema3, args.blockchainNetworkId);
271637
- const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, args);
271796
+ const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;
271797
+ const [application, blockchainNetwork] = await Promise.all([
271798
+ applicationRead(gqlClient, options)(applicationUniqueName),
271799
+ blockchainNetworkRead(gqlClient, options)(blockchainNetworkUniqueName)
271800
+ ]);
271801
+ const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {
271802
+ ...otherArgs,
271803
+ applicationId: application.id,
271804
+ blockchainNetworkId: blockchainNetwork.id
271805
+ });
271638
271806
  return blockchainNode;
271639
271807
  };
271640
271808
  };
271641
- var blockchainNodeRestart = (gqlClient, _options) => async (nodeId) => {
271642
- const id = validate3(IdSchema3, nodeId);
271643
- const { restartBlockchainNode: blockchainNode } = await gqlClient.request(restartBlockchainNode, { id });
271809
+ var blockchainNodeRestart = (gqlClient, _options) => async (blockchainNodeUniqueName) => {
271810
+ const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {
271811
+ uniqueName: blockchainNodeUniqueName
271812
+ });
271644
271813
  return blockchainNode;
271645
271814
  };
271646
271815
  var CustomDeploymentFragment = graphql(`
271647
271816
  fragment CustomDeployment on CustomDeployment {
271648
271817
  id
271818
+ uniqueName
271649
271819
  name
271650
271820
  status
271651
271821
  endpoints {
@@ -271661,112 +271831,141 @@ var CustomDeploymentFragment = graphql(`
271661
271831
  }
271662
271832
  `);
271663
271833
  var getCustomDeployments = graphql(`
271664
- query getCustomDeployments($id: ID!) {
271665
- customDeployments(applicationId: $id) {
271666
- items {
271667
- ...CustomDeployment
271834
+ query getCustomDeployments($applicationUniqueName: String!) {
271835
+ customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {
271836
+ items {
271837
+ ...CustomDeployment
271838
+ }
271839
+ }
271668
271840
  }
271669
- }
271670
- }`, [CustomDeploymentFragment]);
271841
+ `, [CustomDeploymentFragment]);
271671
271842
  var getCustomDeployment = graphql(`
271672
- query getCustomDeployment($id: ID!) {
271673
- customDeployment(entityId: $id) {
271674
- ...CustomDeployment
271675
- }
271676
- }
271677
- `, [CustomDeploymentFragment]);
271843
+ query getCustomDeployment($uniqueName: String!) {
271844
+ customDeploymentByUniqueName(uniqueName: $uniqueName) {
271845
+ ...CustomDeployment
271846
+ }
271847
+ }
271848
+ `, [CustomDeploymentFragment]);
271678
271849
  var editCustomDeployment = graphql(`
271679
- mutation EditCustomDeployment($entityId: ID!, $imageTag: String) {
271680
- editCustomDeployment(entityId: $entityId, imageTag: $imageTag) {
271681
- ...CustomDeployment
271682
- }
271683
- }
271684
- `, [CustomDeploymentFragment]);
271850
+ mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {
271851
+ editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {
271852
+ ...CustomDeployment
271853
+ }
271854
+ }
271855
+ `, [CustomDeploymentFragment]);
271685
271856
  var createCustomDeployment = graphql(`
271686
- mutation CreateCustomDeployment(
271687
- $applicationId: ID!,
271688
- $name: String!,
271689
- $imageTag: String!,
271690
- $imageName: String!,
271691
- $imageRepository: String!,
271692
- $environmentVariables: JSON,
271693
- $port: Int!,
271694
- $provider: String!,
271695
- $region: String!
271696
- ) {
271697
- createCustomDeployment(
271698
- applicationId: $applicationId,
271699
- name: $name,
271700
- imageTag: $imageTag,
271701
- imageName: $imageName,
271702
- imageRepository: $imageRepository,
271703
- port: $port,
271704
- environmentVariables: $environmentVariables,
271705
- provider: $provider,
271706
- region: $region
271707
- ) {
271708
- ...CustomDeployment
271709
- }
271710
- }
271711
- `, [CustomDeploymentFragment]);
271857
+ mutation CreateCustomDeployment(
271858
+ $applicationId: ID!
271859
+ $name: String!
271860
+ $imageTag: String!
271861
+ $imageName: String!
271862
+ $imageRepository: String!
271863
+ $environmentVariables: JSON
271864
+ $port: Int!
271865
+ $provider: String!
271866
+ $region: String!
271867
+ ) {
271868
+ createCustomDeployment(
271869
+ applicationId: $applicationId
271870
+ name: $name
271871
+ imageTag: $imageTag
271872
+ imageName: $imageName
271873
+ imageRepository: $imageRepository
271874
+ port: $port
271875
+ environmentVariables: $environmentVariables
271876
+ provider: $provider
271877
+ region: $region
271878
+ ) {
271879
+ ...CustomDeployment
271880
+ }
271881
+ }
271882
+ `, [CustomDeploymentFragment]);
271712
271883
  var restartCustomDeployment = graphql(`
271713
- mutation RestartCustomDeployment($id: ID!) {
271714
- restartCustomDeployment(entityId: $id) {
271715
- ...CustomDeployment
271884
+ mutation RestartCustomDeployment($uniqueName: String!) {
271885
+ restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
271886
+ ...CustomDeployment
271887
+ }
271716
271888
  }
271717
- }
271718
- `, [CustomDeploymentFragment]);
271889
+ `, [CustomDeploymentFragment]);
271719
271890
  var customdeploymentList = (gqlClient, options) => {
271720
- return async (applicationId) => {
271721
- const id = validate3(IdSchema3, applicationId);
271891
+ return async (applicationUniqueName) => {
271722
271892
  const {
271723
- customDeployments: { items }
271724
- } = await gqlClient.request(getCustomDeployments, { id });
271893
+ customDeploymentsByUniqueName: { items }
271894
+ } = await gqlClient.request(getCustomDeployments, { applicationUniqueName });
271725
271895
  return items;
271726
271896
  };
271727
271897
  };
271728
271898
  var customdeploymentRead = (gqlClient, options) => {
271729
- return async (customdeploymentId) => {
271730
- const id = validate3(IdSchema3, customdeploymentId);
271731
- const { customDeployment } = await gqlClient.request(getCustomDeployment, { id });
271899
+ return async (customDeploymentUniqueName) => {
271900
+ const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {
271901
+ uniqueName: customDeploymentUniqueName
271902
+ });
271732
271903
  return customDeployment;
271733
271904
  };
271734
271905
  };
271735
271906
  var customdeploymentUpdate = (gqlClient, options) => {
271736
- return async (customdeploymentId, imageTag) => {
271737
- const id = validate3(IdSchema3, customdeploymentId);
271738
- const { editCustomDeployment: cd } = await gqlClient.request(editCustomDeployment, { entityId: id, imageTag });
271907
+ return async (customDeploymentUniqueName, imageTag) => {
271908
+ const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {
271909
+ uniqueName: customDeploymentUniqueName,
271910
+ imageTag
271911
+ });
271739
271912
  return cd;
271740
271913
  };
271741
271914
  };
271742
271915
  var customdeploymentCreate = (gqlClient, options) => {
271743
271916
  return async (args) => {
271744
- validate3(IdSchema3, args.applicationId);
271745
- const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, args);
271917
+ const { applicationUniqueName, ...otherArgs } = args;
271918
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
271919
+ const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {
271920
+ ...otherArgs,
271921
+ applicationId: application.id
271922
+ });
271746
271923
  return customDeployment;
271747
271924
  };
271748
271925
  };
271749
- var customDeploymentRestart = (gqlClient, _options) => async (deploymentId) => {
271750
- const id = validate3(IdSchema3, deploymentId);
271751
- const { restartCustomDeployment: customDeployment } = await gqlClient.request(restartCustomDeployment, { id });
271926
+ var customDeploymentRestart = (gqlClient, _options) => async (customDeploymentUniqueName) => {
271927
+ const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {
271928
+ uniqueName: customDeploymentUniqueName
271929
+ });
271752
271930
  return customDeployment;
271753
271931
  };
271754
271932
  var getFoundryEnvConfig = graphql(`
271755
- query getFoundryEnvConfig($blockchainNodeId: String!) {
271756
- foundryEnvConfig(blockchainNodeId: $blockchainNodeId)
271933
+ query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {
271934
+ foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)
271935
+ }
271936
+ `);
271937
+ var getEnv = (gqlClient, _options) => {
271938
+ return async (blockchainNodeUniqueName) => {
271939
+ const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });
271940
+ return foundryEnvConfigByUniqueName;
271941
+ };
271942
+ };
271943
+ var LoadBalancerFragment = graphql(`
271944
+ fragment LoadBalancer on LoadBalancer {
271945
+ id
271946
+ uniqueName
271757
271947
  }
271758
271948
  `);
271759
- function getEnv(gqlClient, options) {
271760
- return async (blockchainNodeId) => {
271761
- validate3(IdSchema3, blockchainNodeId);
271762
- const { foundryEnvConfig } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeId });
271763
- return foundryEnvConfig;
271949
+ var getLoadBalancer = graphql(`
271950
+ query GetLoadBalancer($uniqueName: String!) {
271951
+ loadBalancerByUniqueName(uniqueName: $uniqueName) {
271952
+ ...LoadBalancer
271953
+ }
271954
+ }
271955
+ `, [LoadBalancerFragment]);
271956
+ var loadBalancerRead = (gqlClient, options) => {
271957
+ return async (loadBalancerUniqueName) => {
271958
+ const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
271959
+ uniqueName: loadBalancerUniqueName
271960
+ });
271961
+ return loadBalancer;
271764
271962
  };
271765
- }
271963
+ };
271766
271964
  var InsightsFragment = graphql(`
271767
271965
  fragment Insights on Insights {
271768
271966
  __typename
271769
271967
  id
271968
+ uniqueName
271770
271969
  name
271771
271970
  status
271772
271971
  insightsCategory
@@ -271783,86 +271982,97 @@ var InsightsFragment = graphql(`
271783
271982
  }
271784
271983
  `);
271785
271984
  var getInsights = graphql(`
271786
- query getInsights($id: ID!) {
271787
- insightsList(applicationId: $id) {
271788
- items {
271789
- ...Insights
271985
+ query GetInsights($applicationUniqueName: String!) {
271986
+ insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {
271987
+ items {
271988
+ ...Insights
271989
+ }
271990
+ }
271790
271991
  }
271791
- }
271792
- }`, [InsightsFragment]);
271992
+ `, [InsightsFragment]);
271793
271993
  var getInsight = graphql(`
271794
- query getInsights($id: ID!) {
271795
- insights(entityId: $id) {
271796
- ...Insights
271797
- }
271798
- }
271799
- `, [InsightsFragment]);
271994
+ query GetInsight($uniqueName: String!) {
271995
+ insightsByUniqueName(uniqueName: $uniqueName) {
271996
+ ...Insights
271997
+ }
271998
+ }
271999
+ `, [InsightsFragment]);
271800
272000
  var createInsights = graphql(`
271801
- mutation createInsights(
271802
- $applicationId: ID!
271803
- $name: String!
271804
- $insightsCategory: InsightsCategory!
271805
- $provider: String!
271806
- $region: String!
271807
- $size: ClusterServiceSize
271808
- $type: ClusterServiceType
271809
- $blockchainNode: ID
271810
- $loadBalancer: ID
271811
- ) {
271812
- createInsights(
271813
- applicationId: $applicationId
271814
- name: $name
271815
- insightsCategory: $insightsCategory
271816
- provider: $provider
271817
- region: $region
271818
- size: $size
271819
- type: $type
271820
- blockchainNode: $blockchainNode
271821
- loadBalancer: $loadBalancer
272001
+ mutation CreateInsights(
272002
+ $applicationId: ID!
272003
+ $name: String!
272004
+ $insightsCategory: InsightsCategory!
272005
+ $provider: String!
272006
+ $region: String!
272007
+ $size: ClusterServiceSize
272008
+ $type: ClusterServiceType
272009
+ $blockchainNode: ID
272010
+ $loadBalancer: ID
271822
272011
  ) {
271823
- ...Insights
271824
- }
271825
- }
271826
- `, [InsightsFragment]);
272012
+ createInsights(
272013
+ applicationId: $applicationId
272014
+ name: $name
272015
+ insightsCategory: $insightsCategory
272016
+ provider: $provider
272017
+ region: $region
272018
+ size: $size
272019
+ type: $type
272020
+ blockchainNode: $blockchainNode
272021
+ loadBalancer: $loadBalancer
272022
+ ) {
272023
+ ...Insights
272024
+ }
272025
+ }
272026
+ `, [InsightsFragment]);
271827
272027
  var restartInsights = graphql(`
271828
- mutation RestartInsights($id: ID!) {
271829
- restartInsights(entityId: $id) {
271830
- ...Insights
272028
+ mutation RestartInsights($uniqueName: String!) {
272029
+ restartInsightsByUniqueName(uniqueName: $uniqueName) {
272030
+ ...Insights
272031
+ }
271831
272032
  }
271832
- }
271833
- `, [InsightsFragment]);
272033
+ `, [InsightsFragment]);
271834
272034
  var insightsList = (gqlClient, options) => {
271835
- return async (applicationId) => {
271836
- const id = validate3(IdSchema3, applicationId);
272035
+ return async (applicationUniqueName) => {
271837
272036
  const {
271838
- insightsList: { items }
271839
- } = await gqlClient.request(getInsights, { id });
272037
+ insightsListByUniqueName: { items }
272038
+ } = await gqlClient.request(getInsights, { applicationUniqueName });
271840
272039
  return items;
271841
272040
  };
271842
272041
  };
271843
272042
  var insightsRead = (gqlClient, options) => {
271844
- return async (insightsId) => {
271845
- const id = validate3(IdSchema3, insightsId);
271846
- const { insights } = await gqlClient.request(getInsight, { id });
272043
+ return async (insightsUniqueName) => {
272044
+ const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });
271847
272045
  return insights;
271848
272046
  };
271849
272047
  };
271850
272048
  var insightsCreate = (gqlClient, options) => {
271851
272049
  return async (args) => {
271852
- validate3(IdSchema3, args.applicationId);
271853
- const { createInsights: insights } = await gqlClient.request(createInsights, args);
272050
+ const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;
272051
+ const [application, blockchainNode, loadBalancer] = await Promise.all([
272052
+ applicationRead(gqlClient, options)(applicationUniqueName),
272053
+ blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
272054
+ loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined)
272055
+ ]);
272056
+ const { createInsights: insights } = await gqlClient.request(createInsights, {
272057
+ ...otherArgs,
272058
+ applicationId: application.id,
272059
+ blockchainNode: blockchainNode?.id,
272060
+ loadBalancer: loadBalancer?.id
272061
+ });
271854
272062
  return insights;
271855
272063
  };
271856
272064
  };
271857
- var insightsRestart = (gqlClient, _options) => async (insightsId) => {
271858
- const id = validate3(IdSchema3, insightsId);
271859
- const { restartInsights: insights } = await gqlClient.request(restartInsights, { id });
272065
+ var insightsRestart = (gqlClient, _options) => async (insightsUniqueName) => {
272066
+ const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {
272067
+ uniqueName: insightsUniqueName
272068
+ });
271860
272069
  return insights;
271861
272070
  };
271862
272071
  var IntegrationFragment = graphql(`
271863
272072
  fragment Integration on Integration {
271864
272073
  __typename
271865
272074
  id
272075
+ uniqueName
271866
272076
  name
271867
272077
  status
271868
272078
  integrationType
@@ -271879,82 +272089,184 @@ var IntegrationFragment = graphql(`
271879
272089
  }
271880
272090
  `);
271881
272091
  var getIntegrations = graphql(`
271882
- query getIntegrations($id: ID!) {
271883
- integrations(applicationId: $id) {
271884
- items {
271885
- ...Integration
272092
+ query GetIntegrations($applicationUniqueName: String!) {
272093
+ integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {
272094
+ items {
272095
+ ...Integration
272096
+ }
272097
+ }
271886
272098
  }
271887
- }
271888
- }`, [IntegrationFragment]);
272099
+ `, [IntegrationFragment]);
271889
272100
  var getIntegration = graphql(`
271890
- query getIntegration($id: ID!) {
271891
- integration(entityId: $id) {
271892
- ...Integration
271893
- }
271894
- }
271895
- `, [IntegrationFragment]);
272101
+ query GetIntegration($uniqueName: String!) {
272102
+ integrationByUniqueName(uniqueName: $uniqueName) {
272103
+ ...Integration
272104
+ }
272105
+ }
272106
+ `, [IntegrationFragment]);
271896
272107
  var createIntegration = graphql(`
271897
- mutation createIntegration(
271898
- $applicationId: ID!
271899
- $name: String!
271900
- $integrationType: IntegrationType!
271901
- $provider: String!
271902
- $region: String!
271903
- $size: ClusterServiceSize
271904
- $type: ClusterServiceType
271905
- ) {
271906
- createIntegration(
271907
- applicationId: $applicationId
271908
- name: $name
271909
- integrationType: $integrationType
271910
- provider: $provider
271911
- region: $region
271912
- size: $size
271913
- type: $type
272108
+ mutation CreateIntegration(
272109
+ $applicationId: ID!
272110
+ $name: String!
272111
+ $integrationType: IntegrationType!
272112
+ $provider: String!
272113
+ $region: String!
272114
+ $size: ClusterServiceSize
272115
+ $type: ClusterServiceType
271914
272116
  ) {
271915
- ...Integration
271916
- }
271917
- }
271918
- `, [IntegrationFragment]);
272117
+ createIntegration(
272118
+ applicationId: $applicationId
272119
+ name: $name
272120
+ integrationType: $integrationType
272121
+ provider: $provider
272122
+ region: $region
272123
+ size: $size
272124
+ type: $type
272125
+ ) {
272126
+ ...Integration
272127
+ }
272128
+ }
272129
+ `, [IntegrationFragment]);
271919
272130
  var restartIntegrationTool = graphql(`
271920
- mutation RestartIntegrationTool($id: ID!) {
271921
- restartIntegration(entityId: $id) {
271922
- ...Integration
272131
+ mutation RestartIntegrationTool($uniqueName: String!) {
272132
+ restartIntegrationByUniqueName(uniqueName: $uniqueName) {
272133
+ ...Integration
272134
+ }
271923
272135
  }
271924
- }
271925
- `, [IntegrationFragment]);
272136
+ `, [IntegrationFragment]);
271926
272137
  var integrationToolList = (gqlClient, options) => {
271927
- return async (applicationId) => {
271928
- const id = validate3(IdSchema3, applicationId);
272138
+ return async (applicationUniqueName) => {
271929
272139
  const {
271930
- integrations: { items }
271931
- } = await gqlClient.request(getIntegrations, { id });
272140
+ integrationsByUniqueName: { items }
272141
+ } = await gqlClient.request(getIntegrations, { applicationUniqueName });
271932
272142
  return items;
271933
272143
  };
271934
272144
  };
271935
272145
  var integrationToolRead = (gqlClient, options) => {
271936
- return async (integrationId) => {
271937
- const id = validate3(IdSchema3, integrationId);
271938
- const { integration } = await gqlClient.request(getIntegration, { id });
271939
- return integration;
272146
+ return async (integrationUniqueName) => {
272147
+ const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });
272148
+ return integrationByUniqueName;
271940
272149
  };
271941
272150
  };
271942
272151
  var integrationToolCreate = (gqlClient, options) => {
271943
272152
  return async (args) => {
271944
- validate3(IdSchema3, args.applicationId);
271945
- const { createIntegration: integration } = await gqlClient.request(createIntegration, args);
272153
+ const { applicationUniqueName, ...otherArgs } = args;
272154
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
272155
+ const { createIntegration: integration } = await gqlClient.request(createIntegration, {
272156
+ ...otherArgs,
272157
+ applicationId: application.id
272158
+ });
271946
272159
  return integration;
271947
272160
  };
271948
272161
  };
271949
- var integrationToolRestart = (gqlClient, _options) => async (toolId) => {
271950
- const id = validate3(IdSchema3, toolId);
271951
- const { restartIntegration: integration } = await gqlClient.request(restartIntegrationTool, { id });
272162
+ var integrationToolRestart = (gqlClient, _options) => async (integrationUniqueName) => {
272163
+ const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {
272164
+ uniqueName: integrationUniqueName
272165
+ });
271952
272166
  return integration;
271953
272167
  };
272168
+ var StorageFragment = graphql(`
272169
+ fragment Storage on Storage {
272170
+ __typename
272171
+ id
272172
+ uniqueName
272173
+ name
272174
+ status
272175
+ storageProtocol
272176
+ endpoints {
272177
+ id
272178
+ label
272179
+ displayValue
272180
+ }
272181
+ credentials {
272182
+ id
272183
+ label
272184
+ displayValue
272185
+ }
272186
+ }
272187
+ `);
272188
+ var getStorages = graphql(`
272189
+ query GetStorages($applicationUniqueName: String!) {
272190
+ storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {
272191
+ items {
272192
+ ...Storage
272193
+ }
272194
+ }
272195
+ }
272196
+ `, [StorageFragment]);
272197
+ var getStorage = graphql(`
272198
+ query GetStorage($uniqueName: String!) {
272199
+ storageByUniqueName(uniqueName: $uniqueName) {
272200
+ ...Storage
272201
+ }
272202
+ }
272203
+ `, [StorageFragment]);
272204
+ var createStorage = graphql(`
272205
+ mutation CreateStorage(
272206
+ $applicationId: ID!
272207
+ $name: String!
272208
+ $storageProtocol: StorageProtocol!
272209
+ $provider: String!
272210
+ $region: String!
272211
+ $size: ClusterServiceSize
272212
+ $type: ClusterServiceType
272213
+ ) {
272214
+ createStorage(
272215
+ applicationId: $applicationId
272216
+ name: $name
272217
+ storageProtocol: $storageProtocol
272218
+ provider: $provider
272219
+ region: $region
272220
+ size: $size
272221
+ type: $type
272222
+ ) {
272223
+ ...Storage
272224
+ }
272225
+ }
272226
+ `, [StorageFragment]);
272227
+ var restartStorage = graphql(`
272228
+ mutation RestartStorage($uniqueName: String!) {
272229
+ restartStorageByUniqueName(uniqueName: $uniqueName) {
272230
+ ...Storage
272231
+ }
272232
+ }
272233
+ `, [StorageFragment]);
272234
+ var storageList = (gqlClient, options) => {
272235
+ return async (applicationUniqueName) => {
272236
+ const {
272237
+ storagesByUniqueName: { items }
272238
+ } = await gqlClient.request(getStorages, { applicationUniqueName });
272239
+ return items;
272240
+ };
272241
+ };
272242
+ var storageRead = (gqlClient, options) => {
272243
+ return async (storageUniqueName) => {
272244
+ const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });
272245
+ return storage;
272246
+ };
272247
+ };
272248
+ var storageCreate = (gqlClient, options) => {
272249
+ return async (args) => {
272250
+ const { applicationUniqueName, ...otherArgs } = args;
272251
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
272252
+ const { createStorage: storage } = await gqlClient.request(createStorage, {
272253
+ ...otherArgs,
272254
+ applicationId: application.id
272255
+ });
272256
+ return storage;
272257
+ };
272258
+ };
272259
+ var storageRestart = (gqlClient, _options) => async (storageUniqueName) => {
272260
+ const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {
272261
+ uniqueName: storageUniqueName
272262
+ });
272263
+ return storage;
272264
+ };
271954
272265
  var MiddlewareFragment = graphql(`
271955
272266
  fragment Middleware on Middleware {
271956
272267
  __typename
271957
272268
  id
272269
+ uniqueName
271958
272270
  name
271959
272271
  status
271960
272272
  interface
@@ -271983,488 +272295,195 @@ var MiddlewareFragment = graphql(`
271983
272295
  }
271984
272296
  `);
271985
272297
  var getMiddlewares = graphql(`
271986
- query getMiddlewares($id: ID!, $noCache: Boolean = false) {
271987
- middlewares(applicationId: $id) {
271988
- items {
271989
- ...Middleware
272298
+ query GetMiddlewares($applicationUniqueName: String!, $noCache: Boolean = false) {
272299
+ middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {
272300
+ items {
272301
+ ...Middleware
272302
+ }
272303
+ }
271990
272304
  }
271991
- }
271992
- }`, [MiddlewareFragment]);
272305
+ `, [MiddlewareFragment]);
271993
272306
  var getMiddleware = graphql(`
271994
- query getMiddleware($id: ID!, $noCache: Boolean = true) {
271995
- middleware(entityId: $id) {
271996
- ...Middleware
271997
- }
271998
- }
271999
- `, [MiddlewareFragment]);
272307
+ query GetMiddleware($uniqueName: String!, $noCache: Boolean = true) {
272308
+ middlewareByUniqueName(uniqueName: $uniqueName) {
272309
+ ...Middleware
272310
+ }
272311
+ }
272312
+ `, [MiddlewareFragment]);
272000
272313
  var createMiddleware = graphql(`
272001
- mutation createMiddleware(
272002
- $applicationId: ID!
272003
- $name: String!
272004
- $provider: String!
272005
- $region: String!
272006
- $size: ClusterServiceSize
272007
- $type: ClusterServiceType
272008
- $interface: MiddlewareType!
272009
- $storageId: ID
272010
- $smartContractSetId: ID
272011
- $blockchainNodeId: ID
272012
- $loadBalancerId: ID
272013
- $abis: [SmartContractPortalMiddlewareAbiInputDto!]
272014
- $includePredeployedAbis: [String!]
272015
- $noCache: Boolean = false
272016
- ) {
272017
- createMiddleware(
272018
- applicationId: $applicationId
272019
- name: $name
272020
- provider: $provider
272021
- region: $region
272022
- size: $size
272023
- type: $type
272024
- interface: $interface
272025
- storageId: $storageId
272026
- smartContractSetId: $smartContractSetId
272027
- blockchainNodeId: $blockchainNodeId
272028
- loadBalancerId: $loadBalancerId
272029
- abis: $abis
272030
- includePredeployedAbis: $includePredeployedAbis
272314
+ mutation CreateMiddleware(
272315
+ $applicationId: ID!
272316
+ $name: String!
272317
+ $provider: String!
272318
+ $region: String!
272319
+ $size: ClusterServiceSize
272320
+ $type: ClusterServiceType
272321
+ $interface: MiddlewareType!
272322
+ $storageId: ID
272323
+ $blockchainNodeId: ID
272324
+ $loadBalancerId: ID
272325
+ $abis: [SmartContractPortalMiddlewareAbiInputDto!]
272326
+ $includePredeployedAbis: [String!]
272327
+ $noCache: Boolean = false
272031
272328
  ) {
272032
- ...Middleware
272033
- }
272034
- }
272035
- `, [MiddlewareFragment]);
272329
+ createMiddleware(
272330
+ applicationId: $applicationId
272331
+ name: $name
272332
+ provider: $provider
272333
+ region: $region
272334
+ size: $size
272335
+ type: $type
272336
+ interface: $interface
272337
+ storageId: $storageId
272338
+ blockchainNodeId: $blockchainNodeId
272339
+ loadBalancerId: $loadBalancerId
272340
+ abis: $abis
272341
+ includePredeployedAbis: $includePredeployedAbis
272342
+ ) {
272343
+ ...Middleware
272344
+ }
272345
+ }
272346
+ `, [MiddlewareFragment]);
272036
272347
  var restartMiddleware = graphql(`
272037
- mutation RestartMiddleware($id: ID!, $noCache: Boolean = false) {
272038
- restartMiddleware(entityId: $id) {
272039
- ...Middleware
272348
+ mutation RestartMiddleware($uniqueName: String!, $noCache: Boolean = false) {
272349
+ restartMiddlewareByUniqueName(uniqueName: $uniqueName) {
272350
+ ...Middleware
272351
+ }
272040
272352
  }
272041
- }
272042
- `, [MiddlewareFragment]);
272353
+ `, [MiddlewareFragment]);
272043
272354
  var middlewareList = (gqlClient, options) => {
272044
- return async (applicationId) => {
272045
- const id = validate3(IdSchema3, applicationId);
272355
+ return async (applicationUniqueName) => {
272046
272356
  const {
272047
- middlewares: { items }
272048
- } = await gqlClient.request(getMiddlewares, { id });
272357
+ middlewaresByUniqueName: { items }
272358
+ } = await gqlClient.request(getMiddlewares, { applicationUniqueName });
272049
272359
  return items;
272050
272360
  };
272051
272361
  };
272052
272362
  var middlewareRead = (gqlClient, options) => {
272053
- return async (middlewareId) => {
272054
- const id = validate3(IdSchema3, middlewareId);
272055
- const { middleware } = await gqlClient.request(getMiddleware, { id });
272363
+ return async (middlewareUniqueName) => {
272364
+ const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {
272365
+ uniqueName: middlewareUniqueName
272366
+ });
272056
272367
  return middleware;
272057
272368
  };
272058
272369
  };
272059
272370
  var middlewareCreate = (gqlClient, options) => {
272060
272371
  return async (args) => {
272061
- validate3(IdSchema3, args.applicationId);
272062
- const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, args);
272372
+ const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } = args;
272373
+ const [application, blockchainNode, loadBalancer, storage] = await Promise.all([
272374
+ applicationRead(gqlClient, options)(applicationUniqueName),
272375
+ blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
272376
+ loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined),
272377
+ storageUniqueName ? storageRead(gqlClient, options)(storageUniqueName) : Promise.resolve(undefined)
272378
+ ]);
272379
+ const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {
272380
+ ...otherArgs,
272381
+ applicationId: application.id,
272382
+ blockchainNodeId: blockchainNode?.id,
272383
+ loadBalancerId: loadBalancer?.id,
272384
+ storageId: storage?.id
272385
+ });
272063
272386
  return middleware;
272064
272387
  };
272065
272388
  };
272066
- var middlewareRestart = (gqlClient, _options) => async (middlewareId) => {
272067
- const id = validate3(IdSchema3, middlewareId);
272068
- const { restartMiddleware: middleware } = await gqlClient.request(restartMiddleware, { id });
272389
+ var middlewareRestart = (gqlClient, _options) => async (middlewareUniqueName) => {
272390
+ const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {
272391
+ uniqueName: middlewareUniqueName
272392
+ });
272069
272393
  return middleware;
272070
272394
  };
272071
272395
  var PrivateKeyFragment = graphql(`
272072
272396
  fragment PrivateKey on PrivateKey {
272073
272397
  __typename
272074
272398
  id
272075
- name
272076
272399
  uniqueName
272400
+ name
272077
272401
  privateKeyType
272078
272402
  status
272079
272403
  }
272080
272404
  `);
272081
272405
  var getPrivateKeys = graphql(`
272082
- query getPrivateKeys($id: ID!) {
272083
- privateKeys(applicationId: $id) {
272084
- items {
272085
- ...PrivateKey
272406
+ query GetPrivateKeys($applicationUniqueName: String!) {
272407
+ privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {
272408
+ items {
272409
+ ...PrivateKey
272410
+ }
272411
+ }
272086
272412
  }
272087
- }
272088
- }`, [PrivateKeyFragment]);
272413
+ `, [PrivateKeyFragment]);
272089
272414
  var getPrivateKey = graphql(`
272090
- query getPrivateKey($id: ID!) {
272091
- privateKey(entityId: $id) {
272092
- ...PrivateKey
272093
- }
272094
- }
272095
- `, [PrivateKeyFragment]);
272415
+ query GetPrivateKey($uniqueName: String!) {
272416
+ privateKeyByUniqueName(uniqueName: $uniqueName) {
272417
+ ...PrivateKey
272418
+ }
272419
+ }
272420
+ `, [PrivateKeyFragment]);
272096
272421
  var createPrivateKey = graphql(`
272097
- mutation CreatePrivateKey(
272098
- $applicationId: ID!,
272099
- $name: String!,
272100
- $privateKeyType: PrivateKeyType!,
272101
- $provider: String!
272102
- $region: String!
272103
- $size: ClusterServiceSize
272104
- $type: ClusterServiceType
272105
- $blockchainNodes: [ID!]
272106
- ) {
272107
- createPrivateKey(
272108
- applicationId: $applicationId,
272109
- name: $name,
272110
- privateKeyType: $privateKeyType,
272111
- provider: $provider,
272112
- region: $region
272113
- size: $size
272114
- type: $type
272115
- blockchainNodes: $blockchainNodes
272422
+ mutation CreatePrivateKey(
272423
+ $applicationId: ID!
272424
+ $name: String!
272425
+ $privateKeyType: PrivateKeyType!
272426
+ $provider: String!
272427
+ $region: String!
272428
+ $size: ClusterServiceSize
272429
+ $type: ClusterServiceType
272430
+ $blockchainNodes: [ID!]
272116
272431
  ) {
272117
- ...PrivateKey
272118
- }
272119
- }
272120
- `, [PrivateKeyFragment]);
272432
+ createPrivateKey(
272433
+ applicationId: $applicationId
272434
+ name: $name
272435
+ privateKeyType: $privateKeyType
272436
+ provider: $provider
272437
+ region: $region
272438
+ size: $size
272439
+ type: $type
272440
+ blockchainNodes: $blockchainNodes
272441
+ ) {
272442
+ ...PrivateKey
272443
+ }
272444
+ }
272445
+ `, [PrivateKeyFragment]);
272121
272446
  var restartPrivateKey = graphql(`
272122
- mutation RestartPrivateKey($id: ID!) {
272123
- restartPrivateKey(entityId: $id) {
272124
- ...PrivateKey
272447
+ mutation RestartPrivateKey($uniqueName: String!) {
272448
+ restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {
272449
+ ...PrivateKey
272450
+ }
272125
272451
  }
272126
- }
272127
- `, [PrivateKeyFragment]);
272452
+ `, [PrivateKeyFragment]);
272128
272453
  var privateKeyList = (gqlClient, options) => {
272129
- return async (applicationId) => {
272130
- const id = validate3(IdSchema3, applicationId);
272454
+ return async (applicationUniqueName) => {
272131
272455
  const {
272132
- privateKeys: { items }
272133
- } = await gqlClient.request(getPrivateKeys, { id });
272456
+ privateKeysByUniqueName: { items }
272457
+ } = await gqlClient.request(getPrivateKeys, { applicationUniqueName });
272134
272458
  return items;
272135
272459
  };
272136
272460
  };
272137
272461
  var privatekeyRead = (gqlClient, options) => {
272138
- return async (privatekeyId) => {
272139
- const id = validate3(IdSchema3, privatekeyId);
272140
- const { privateKey } = await gqlClient.request(getPrivateKey, { id });
272462
+ return async (privateKeyUniqueName) => {
272463
+ const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {
272464
+ uniqueName: privateKeyUniqueName
272465
+ });
272141
272466
  return privateKey;
272142
272467
  };
272143
272468
  };
272144
272469
  var privateKeyCreate = (gqlClient, options) => {
272145
272470
  return async (args) => {
272146
- validate3(IdSchema3, args.applicationId);
272147
- const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, args);
272471
+ const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
272472
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
272473
+ const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient, options)(uniqueName))) : [];
272474
+ const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {
272475
+ ...otherArgs,
272476
+ applicationId: application.id,
272477
+ blockchainNodes: blockchainNodes.map((node) => node?.id)
272478
+ });
272148
272479
  return privateKey;
272149
272480
  };
272150
272481
  };
272151
- var privateKeyRestart = (gqlClient, _options) => async (keyId) => {
272152
- const id = validate3(IdSchema3, keyId);
272153
- const { restartPrivateKey: privateKey } = await gqlClient.request(restartPrivateKey, { id });
272154
- return privateKey;
272155
- };
272156
- var SmartContractSetFragment = graphql(`
272157
- fragment SmartContractSet on SmartContractSet {
272158
- __typename
272159
- id
272160
- name
272161
- application {
272162
- id
272163
- }
272164
- status
272165
- useCase
272166
- user {
272167
- id
272168
- firstname
272169
- lastname
272170
- }
272171
- }
272172
- `);
272173
- var getSmartContractSets = graphql(`
272174
- query getSmartContractSets($id: ID!) {
272175
- smartContractSets(applicationId: $id) {
272176
- items {
272177
- ...SmartContractSet
272178
- }
272179
- }
272180
- }`, [SmartContractSetFragment]);
272181
- var getSmartContractSet = graphql(`
272182
- query getSmartContractSet($id: ID!) {
272183
- smartContractSet(entityId: $id) {
272184
- ...SmartContractSet
272185
- }
272186
- }`, [SmartContractSetFragment]);
272187
- var createSmartContractSet = graphql(`
272188
- mutation CreateSmartContractSet(
272189
- $applicationId: ID!
272190
- $name: String!
272191
- $blockchainNodeId: ID!
272192
- $useCase: String!
272193
- $userId: ID
272194
- $provider: String!
272195
- $region: String!
272196
- $size: ClusterServiceSize
272197
- $type: ClusterServiceType
272198
- ) {
272199
- createSmartContractSet(
272200
- applicationId: $applicationId,
272201
- name: $name,
272202
- blockchainNodeId: $blockchainNodeId
272203
- useCase: $useCase
272204
- userId: $userId
272205
- provider: $provider,
272206
- region: $region
272207
- size: $size
272208
- type: $type
272209
- ) {
272210
- ...SmartContractSet
272211
- }
272212
- }`, [SmartContractSetFragment]);
272213
- var restartSmartContractSet = graphql(`
272214
- mutation RestartSmartContractSet($entityId: ID!) {
272215
- restartSmartContractSet(entityId: $entityId) {
272216
- ...SmartContractSet
272217
- }
272218
- }`, [SmartContractSetFragment]);
272219
- var smartContractSetList = (gqlClient, options) => {
272220
- return async (applicationId) => {
272221
- const id = validate3(IdSchema3, applicationId);
272222
- const {
272223
- smartContractSets: { items }
272224
- } = await gqlClient.request(getSmartContractSets, { id });
272225
- return items;
272226
- };
272227
- };
272228
- var smartContractSetRead = (gqlClient, options) => {
272229
- return async (smartContractSetId) => {
272230
- const id = validate3(IdSchema3, smartContractSetId);
272231
- const { smartContractSet } = await gqlClient.request(getSmartContractSet, { id });
272232
- return smartContractSet;
272233
- };
272234
- };
272235
- var smartContractSetCreate = (gqlClient, options) => {
272236
- return async (args) => {
272237
- validate3(IdSchema3, args.applicationId);
272238
- validate3(IdSchema3, args.blockchainNodeId);
272239
- if (typeof args.userId === "string") {
272240
- validate3(IdSchema3, args.userId);
272241
- }
272242
- const { createSmartContractSet: smartContractSet } = await gqlClient.request(createSmartContractSet, args);
272243
- return smartContractSet;
272244
- };
272245
- };
272246
- var smartContractSetRestart = (gqlClient, _options) => async (smartContractSetId) => {
272247
- const id = validate3(IdSchema3, smartContractSetId);
272248
- const { restartSmartContractSet: smartContractSet } = await gqlClient.request(restartSmartContractSet, {
272249
- entityId: id
272482
+ var privateKeyRestart = (gqlClient, _options) => async (privateKeyUniqueName) => {
272483
+ const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {
272484
+ uniqueName: privateKeyUniqueName
272250
272485
  });
272251
- return smartContractSet;
272252
- };
272253
- var StorageFragment = graphql(`
272254
- fragment Storage on Storage {
272255
- __typename
272256
- id
272257
- name
272258
- status
272259
- storageProtocol
272260
- endpoints {
272261
- id
272262
- label
272263
- displayValue
272264
- }
272265
- credentials {
272266
- id
272267
- label
272268
- displayValue
272269
- }
272270
- }
272271
- `);
272272
- var getStorages = graphql(`
272273
- query getStorages($id: ID!) {
272274
- storages(applicationId: $id) {
272275
- items {
272276
- ...Storage
272277
- }
272278
- }
272279
- }`, [StorageFragment]);
272280
- var getStorage = graphql(`
272281
- query getStorage($id: ID!) {
272282
- storage(entityId: $id) {
272283
- ...Storage
272284
- }
272285
- }
272286
- `, [StorageFragment]);
272287
- var createStorage = graphql(`
272288
- mutation CreateStorage(
272289
- $applicationId: ID!,
272290
- $name: String!,
272291
- $storageProtocol: StorageProtocol!,
272292
- $provider: String!,
272293
- $region: String!,
272294
- $size: ClusterServiceSize
272295
- $type: ClusterServiceType
272296
- ) {
272297
- createStorage(
272298
- applicationId: $applicationId,
272299
- name: $name,
272300
- storageProtocol: $storageProtocol,
272301
- provider: $provider,
272302
- region: $region,
272303
- size: $size,
272304
- type: $type
272305
- ) {
272306
- ...Storage
272307
- }
272308
- }
272309
- `, [StorageFragment]);
272310
- var restartStorage = graphql(`
272311
- mutation RestartStorage($id: ID!) {
272312
- restartStorage(entityId: $id) {
272313
- ...Storage
272314
- }
272315
- }
272316
- `, [StorageFragment]);
272317
- var storageList = (gqlClient, options) => {
272318
- return async (applicationId) => {
272319
- const id = validate3(IdSchema3, applicationId);
272320
- const {
272321
- storages: { items }
272322
- } = await gqlClient.request(getStorages, { id });
272323
- return items;
272324
- };
272325
- };
272326
- var storageRead = (gqlClient, options) => {
272327
- return async (storageId) => {
272328
- const id = validate3(IdSchema3, storageId);
272329
- const { storage } = await gqlClient.request(getStorage, { id });
272330
- return storage;
272331
- };
272332
- };
272333
- var storageCreate = (gqlClient, options) => {
272334
- return async (args) => {
272335
- validate3(IdSchema3, args.applicationId);
272336
- const { createStorage: storage } = await gqlClient.request(createStorage, args);
272337
- return storage;
272338
- };
272339
- };
272340
- var storageRestart = (gqlClient, _options) => async (storageId) => {
272341
- const id = validate3(IdSchema3, storageId);
272342
- const { restartStorage: storage } = await gqlClient.request(restartStorage, { id });
272343
- return storage;
272344
- };
272345
- var WorkspaceFragment = graphql(`
272346
- fragment Workspace on Workspace {
272347
- id
272348
- name
272349
- applications {
272350
- ...Application
272351
- }
272352
- }
272353
- `, [ApplicationFragment]);
272354
- var getWorkspacesAndApplications = graphql(`
272355
- query getWorkspacesAndApplications {
272356
- workspaces {
272357
- ...Workspace
272358
- applications {
272359
- ...Application
272360
- }
272361
- childWorkspaces {
272362
- ...Workspace
272363
- }
272364
- }
272365
- }
272366
- `, [WorkspaceFragment, ApplicationFragment]);
272367
- var getWorkspace = graphql(`
272368
- query getWorkspace($id: ID!) {
272369
- workspace(workspaceId: $id) {
272370
- ...Workspace
272371
- applications {
272372
- ...Application
272373
- }
272374
- }
272375
- }
272376
- `, [WorkspaceFragment, ApplicationFragment]);
272377
- var createWorkspace = graphql(`
272378
- mutation CreateWorkspace(
272379
- $addressLine1: String
272380
- $addressLine2: String
272381
- $city: String
272382
- $companyName: String
272383
- $country: String
272384
- $name: String!
272385
- $parentId: String
272386
- $paymentMethodId: String
272387
- $postalCode: String
272388
- $taxIdType: String
272389
- $taxIdValue: String
272390
- ) {
272391
- createWorkspace(
272392
- addressLine1: $addressLine1
272393
- addressLine2: $addressLine2
272394
- city: $city
272395
- companyName: $companyName
272396
- country: $country
272397
- name: $name
272398
- parentId: $parentId
272399
- paymentMethodId: $paymentMethodId
272400
- postalCode: $postalCode
272401
- taxIdType: $taxIdType
272402
- taxIdValue: $taxIdValue
272403
- ) {
272404
- ...Workspace
272405
- applications {
272406
- ...Application
272407
- }
272408
- }
272409
- }
272410
- `, [WorkspaceFragment, ApplicationFragment]);
272411
- var deleteWorkspace = graphql(`
272412
- mutation deleteWorkspace($id: ID!) {
272413
- deleteWorkspace(workspaceId: $id) {
272414
- ...Workspace
272415
- applications {
272416
- ...Application
272417
- }
272418
- }
272419
- }
272420
- `, [WorkspaceFragment, ApplicationFragment]);
272421
- var addCredits = graphql(`
272422
- mutation addCredits($workspaceId: String!, $amount: Float!) {
272423
- addCredits(workspaceId: $workspaceId, amount: $amount)
272424
- }
272425
- `);
272426
- var workspaceList = (gqlClient, options) => {
272427
- return async () => {
272428
- const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
272429
- const allWorkspaces = workspaces.reduce((acc, workspace) => {
272430
- acc.push(workspace);
272431
- if (workspace.childWorkspaces) {
272432
- acc.push(...workspace.childWorkspaces);
272433
- }
272434
- return acc;
272435
- }, []);
272436
- return allWorkspaces.sort((a8, b4) => a8.name.localeCompare(b4.name));
272437
- };
272438
- };
272439
- var workspaceRead = (gqlClient, options) => {
272440
- return async (workspaceId) => {
272441
- const id = validate3(IdSchema3, workspaceId);
272442
- const { workspace } = await gqlClient.request(getWorkspace, { id });
272443
- return workspace;
272444
- };
272445
- };
272446
- var workspaceCreate = (gqlClient, options) => {
272447
- return async (createWorkspaceArgs) => {
272448
- const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);
272449
- return workspace;
272450
- };
272451
- };
272452
- var workspaceDelete = (gqlClient, options) => {
272453
- return async (workspaceId) => {
272454
- const id = validate3(IdSchema3, workspaceId);
272455
- const { deleteWorkspace: workspace } = await gqlClient.request(deleteWorkspace, { id });
272456
- return workspace;
272457
- };
272458
- };
272459
- var workspaceAddCredits = (gqlClient, options) => {
272460
- return async (workspaceId, amount) => {
272461
- const id = validate3(IdSchema3, workspaceId);
272462
- if (amount <= 0) {
272463
- throw new Error("Credit amount must be a positive number");
272464
- }
272465
- const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });
272466
- return result;
272467
- };
272486
+ return privateKey;
272468
272487
  };
272469
272488
  var ClientOptionsSchema = z3.object({
272470
272489
  accessToken: AccessTokenSchema3,
@@ -272567,12 +272586,6 @@ function createSettleMintClient(options) {
272567
272586
  update: customdeploymentUpdate(gqlClient, options),
272568
272587
  restart: customDeploymentRestart(gqlClient, options)
272569
272588
  },
272570
- smartContractSet: {
272571
- list: smartContractSetList(gqlClient, options),
272572
- read: smartContractSetRead(gqlClient, options),
272573
- create: smartContractSetCreate(gqlClient, options),
272574
- restart: smartContractSetRestart(gqlClient, options)
272575
- },
272576
272589
  foundry: {
272577
272590
  env: getEnv(gqlClient, options)
272578
272591
  },
@@ -272777,7 +272790,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
272777
272790
  }
272778
272791
  });
272779
272792
  const aat = await settlemint.applicationAccessToken.create({
272780
- applicationId: application.id,
272793
+ applicationUniqueName: application.uniqueName,
272781
272794
  name: name2,
272782
272795
  blockchainNetworkScope: {
272783
272796
  type: "ALL",
@@ -272842,7 +272855,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
272842
272855
 
272843
272856
  // src/commands/connect/application.prompt.ts
272844
272857
  async function applicationPrompt(env2, applications, accept) {
272845
- const defaultApplication = applications.find((application2) => application2.id === env2.SETTLEMINT_APPLICATION);
272858
+ const defaultApplication = applications.find((application2) => application2.uniqueName === env2.SETTLEMINT_APPLICATION);
272846
272859
  const defaultPossible = accept && defaultApplication;
272847
272860
  if (defaultPossible) {
272848
272861
  return defaultApplication;
@@ -272869,7 +272882,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
272869
272882
  if (nodes.length === 0) {
272870
272883
  return;
272871
272884
  }
272872
- const defaultNode = nodes.find((node2) => node2.id === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
272885
+ const defaultNode = nodes.find((node2) => node2.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
272873
272886
  const defaultPossible = accept;
272874
272887
  if (defaultPossible) {
272875
272888
  return defaultNode;
@@ -272897,7 +272910,7 @@ async function blockscoutPrompt(env2, insights, accept) {
272897
272910
  if (possible.length === 0) {
272898
272911
  return;
272899
272912
  }
272900
- const defaultBlockscout = insights.find((insight) => insight.id === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
272913
+ const defaultBlockscout = insights.find((insight) => insight.uniqueName === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
272901
272914
  const defaultPossible = accept;
272902
272915
  if (defaultPossible) {
272903
272916
  return defaultBlockscout;
@@ -272924,7 +272937,7 @@ async function customDeploymentPrompt(env2, customDeployments, accept) {
272924
272937
  if (customDeployments.length === 0) {
272925
272938
  return;
272926
272939
  }
272927
- const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.id === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
272940
+ const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.uniqueName === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
272928
272941
  const defaultPossible = accept;
272929
272942
  if (defaultPossible) {
272930
272943
  return defaultCustomDeployment;
@@ -272952,7 +272965,7 @@ async function hasuraPrompt(env2, integrations, accept) {
272952
272965
  if (possible.length === 0) {
272953
272966
  return;
272954
272967
  }
272955
- const defaultIntegration = possible.find((integration) => integration.id === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
272968
+ const defaultIntegration = possible.find((integration) => integration.uniqueName === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
272956
272969
  const defaultPossible = accept;
272957
272970
  if (defaultPossible) {
272958
272971
  return defaultIntegration;
@@ -273031,7 +273044,7 @@ async function ipfsPrompt(env2, storages, accept) {
273031
273044
  if (possible.length === 0) {
273032
273045
  return;
273033
273046
  }
273034
- const defaultStorage = possible.find((storage) => storage.id === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
273047
+ const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
273035
273048
  const defaultPossible = accept;
273036
273049
  if (defaultPossible) {
273037
273050
  return defaultStorage;
@@ -273059,7 +273072,7 @@ async function minioPrompt(env2, storages, accept) {
273059
273072
  if (possible.length === 0) {
273060
273073
  return;
273061
273074
  }
273062
- const defaultStorage = possible.find((storage) => storage.id === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
273075
+ const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
273063
273076
  const defaultPossible = accept;
273064
273077
  if (defaultPossible) {
273065
273078
  return defaultStorage;
@@ -273087,7 +273100,7 @@ async function portalPrompt(env2, middlewares, accept) {
273087
273100
  if (possible.length === 0) {
273088
273101
  return;
273089
273102
  }
273090
- const defaultMiddleware = possible.find((middleware2) => middleware2.id === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
273103
+ const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
273091
273104
  const defaultPossible = accept;
273092
273105
  if (defaultPossible) {
273093
273106
  return defaultMiddleware;
@@ -273125,14 +273138,14 @@ async function servicesSpinner(settlemint, application) {
273125
273138
  insights,
273126
273139
  customDeployment
273127
273140
  ] = await Promise.all([
273128
- settlemint.blockchainNetwork.list(application.id),
273129
- settlemint.blockchainNode.list(application.id),
273130
- settlemint.middleware.list(application.id),
273131
- settlemint.integrationTool.list(application.id),
273132
- settlemint.storage.list(application.id),
273133
- settlemint.privateKey.list(application.id),
273134
- settlemint.insights.list(application.id),
273135
- settlemint.customDeployment.list(application.id)
273141
+ settlemint.blockchainNetwork.list(application.uniqueName),
273142
+ settlemint.blockchainNode.list(application.uniqueName),
273143
+ settlemint.middleware.list(application.uniqueName),
273144
+ settlemint.integrationTool.list(application.uniqueName),
273145
+ settlemint.storage.list(application.uniqueName),
273146
+ settlemint.privateKey.list(application.uniqueName),
273147
+ settlemint.insights.list(application.uniqueName),
273148
+ settlemint.customDeployment.list(application.uniqueName)
273136
273149
  ]);
273137
273150
  return {
273138
273151
  blockchainNetworks,
@@ -273154,7 +273167,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
273154
273167
  if (possible.length === 0) {
273155
273168
  return;
273156
273169
  }
273157
- const defaultMiddleware = possible.find((middleware2) => middleware2.id === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
273170
+ const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
273158
273171
  const defaultPossible = accept;
273159
273172
  if (defaultPossible) {
273160
273173
  return defaultMiddleware;
@@ -273178,7 +273191,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
273178
273191
 
273179
273192
  // src/commands/connect/workspace.prompt.ts
273180
273193
  async function workspacePrompt(env2, workspaces, accept) {
273181
- const defaultWorkspace = workspaces.find((workspace2) => workspace2.id === env2.SETTLEMINT_WORKSPACE);
273194
+ const defaultWorkspace = workspaces.find((workspace2) => workspace2.uniqueName === env2.SETTLEMINT_WORKSPACE);
273182
273195
  const defaultPossible = accept && defaultWorkspace;
273183
273196
  if (defaultPossible) {
273184
273197
  return defaultWorkspace;
@@ -273233,23 +273246,24 @@ function connectCommand() {
273233
273246
  await writeEnvSpinner(!!prod, {
273234
273247
  SETTLEMINT_ACCESS_TOKEN: aatToken,
273235
273248
  SETTLEMINT_INSTANCE: instance,
273236
- SETTLEMINT_WORKSPACE: workspace.id,
273237
- SETTLEMINT_APPLICATION: application.id,
273238
- SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.id,
273239
- SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.id,
273240
- SETTLEMINT_HASURA: hasura?.id,
273249
+ SETTLEMINT_WORKSPACE: workspace.uniqueName,
273250
+ SETTLEMINT_APPLICATION: application.uniqueName,
273251
+ SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
273252
+ SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
273253
+ SETTLEMINT_HASURA: hasura?.uniqueName,
273241
273254
  ...getHasuraEndpoints(hasura),
273242
- SETTLEMINT_THEGRAPH: thegraph?.id,
273255
+ SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
273243
273256
  ...await getGraphEndpoint(thegraph, env2),
273257
+ SETTLEMINT_PORTAL: portal?.uniqueName,
273244
273258
  ...getPortalEndpoints(portal),
273245
273259
  SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
273246
- SETTLEMINT_MINIO: minio?.id,
273260
+ SETTLEMINT_MINIO: minio?.uniqueName,
273247
273261
  ...getMinioEndpoints(minio),
273248
- SETTLEMINT_IPFS: ipfs?.id,
273262
+ SETTLEMINT_IPFS: ipfs?.uniqueName,
273249
273263
  ...getIpfsEndpoints(ipfs),
273250
- SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.id,
273264
+ SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
273251
273265
  SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
273252
- SETTLEMINT_BLOCKSCOUT: blockscout?.id,
273266
+ SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
273253
273267
  ...getBlockscoutEndpoints(blockscout)
273254
273268
  });
273255
273269
  outro("Connected to SettleMint");
@@ -273259,7 +273273,7 @@ function connectCommand() {
273259
273273
  var package_default = {
273260
273274
  name: "@settlemint/sdk-cli",
273261
273275
  description: "SettleMint SDK, integrate SettleMint into your application with ease.",
273262
- version: "0.7.4",
273276
+ version: "0.8.0",
273263
273277
  type: "module",
273264
273278
  private: false,
273265
273279
  license: "FSL-1.1-MIT",
@@ -273305,13 +273319,13 @@ var package_default = {
273305
273319
  semver: "7.6.3",
273306
273320
  slugify: "1.6.6",
273307
273321
  yoctocolors: "2.1.1",
273308
- "@commander-js/extra-typings": "12.1.0",
273322
+ "@commander-js/extra-typings": "13.0.0",
273309
273323
  "@inquirer/confirm": "5.1.1",
273310
273324
  "@inquirer/input": "4.1.1",
273311
273325
  "@inquirer/password": "4.0.4",
273312
273326
  "@inquirer/select": "4.0.4",
273313
- "@settlemint/sdk-js": "0.7.4",
273314
- "@settlemint/sdk-utils": "0.7.4",
273327
+ "@settlemint/sdk-js": "0.8.0",
273328
+ "@settlemint/sdk-utils": "0.8.0",
273315
273329
  "get-tsconfig": "4.8.1",
273316
273330
  giget: "1.2.3"
273317
273331
  },
@@ -274308,7 +274322,6 @@ var SETTLEMINT_CLIENT_MAP = {
274308
274322
  "blockchain node": "blockchainNode",
274309
274323
  "custom deployment": "customDeployment",
274310
274324
  "private key": "privateKey",
274311
- "smart contract set": "smartContractSet",
274312
274325
  middleware: "middleware",
274313
274326
  "integration tool": "integrationTool",
274314
274327
  storage: "storage",
@@ -274317,12 +274330,15 @@ var SETTLEMINT_CLIENT_MAP = {
274317
274330
  };
274318
274331
 
274319
274332
  // src/commands/platform/utils/wait-for-completion.ts
274333
+ class TimeoutError extends Error {
274334
+ }
274320
274335
  async function waitForCompletion({
274321
274336
  settlemint,
274322
274337
  type: type4,
274323
- id,
274338
+ uniqueName,
274324
274339
  action,
274325
- maxTimeout = 15 * 60 * 1000
274340
+ maxTimeout = 10 * 60 * 1000,
274341
+ restartIfTimeout = false
274326
274342
  }) {
274327
274343
  const serviceType = SETTLEMINT_CLIENT_MAP[type4];
274328
274344
  if (serviceType === "workspace" || serviceType === "application" || serviceType === "foundry" || serviceType === "applicationAccessToken") {
@@ -274332,33 +274348,45 @@ async function waitForCompletion({
274332
274348
  if (!service || !("read" in service)) {
274333
274349
  throw new Error(`Service ${serviceType} does not support status checking`);
274334
274350
  }
274335
- return spinner({
274336
- startMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
274337
- stopMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
274338
- task: async () => {
274339
- const startTime = Date.now();
274340
- while (true) {
274341
- try {
274342
- const resource = await service.read(id);
274343
- if (resource.status === "COMPLETED") {
274344
- note(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
274345
- return true;
274351
+ function showSpinner() {
274352
+ return spinner({
274353
+ startMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
274354
+ stopMessage: `Waiting for ${type4} to be ${getActionLabel(action)}`,
274355
+ task: async () => {
274356
+ const startTime = Date.now();
274357
+ while (true) {
274358
+ try {
274359
+ const resource = await service.read(uniqueName);
274360
+ if (resource.status === "COMPLETED") {
274361
+ note(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
274362
+ return true;
274363
+ }
274364
+ if (resource.status === "FAILED") {
274365
+ note(`${capitalizeFirstLetter(type4)} failed to ${getActionLabel(action)}`);
274366
+ return true;
274367
+ }
274368
+ note(`${capitalizeFirstLetter(type4)} is not ready yet (status: ${resource.status})`);
274369
+ } catch (error5) {
274370
+ note(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
274346
274371
  }
274347
- if (resource.status === "FAILED") {
274348
- note(`${capitalizeFirstLetter(type4)} failed to ${getActionLabel(action)}`);
274349
- return true;
274372
+ if (Date.now() - startTime > maxTimeout) {
274373
+ throw new TimeoutError(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
274350
274374
  }
274351
- note(`${capitalizeFirstLetter(type4)} is not ready yet (status: ${resource.status})`);
274352
- } catch (error5) {
274353
- note(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
274354
- }
274355
- if (Date.now() - startTime > maxTimeout) {
274356
- throw new Error(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with id ${id}`);
274375
+ await new Promise((resolve6) => setTimeout(resolve6, 5000));
274357
274376
  }
274358
- await new Promise((resolve6) => setTimeout(resolve6, 5000));
274359
274377
  }
274378
+ });
274379
+ }
274380
+ try {
274381
+ return await showSpinner();
274382
+ } catch (error5) {
274383
+ if (restartIfTimeout && error5 instanceof TimeoutError) {
274384
+ note(`Restarting ${capitalizeFirstLetter(type4)}`);
274385
+ await service.restart(uniqueName);
274386
+ return showSpinner();
274360
274387
  }
274361
- });
274388
+ throw error5;
274389
+ }
274362
274390
  }
274363
274391
  function getActionLabel(action) {
274364
274392
  if (action === "restart") {
@@ -274405,8 +274433,8 @@ function getCreateCommand({
274405
274433
  usePersonalAccessToken = true
274406
274434
  }) {
274407
274435
  const cmd2 = new Command2(sanitizeCommandName(name2)).alias(alias).description(`Create a new ${type4} in the SettleMint platform.
274408
- ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a, --accept-defaults", "Accept the default values").option("-d, --default", `Save as default ${type4}`).option("-w, --wait", "Wait until deployed").option("--prod", "Connect to production environment");
274409
- execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait }, createFunction) => {
274436
+ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a, --accept-defaults", "Accept the default values").option("-d, --default", `Save as default ${type4}`).option("-w, --wait", "Wait until deployed").option("-r, --restart-if-timeout", "Restart if wait time is exceeded").option("--prod", "Connect to production environment");
274437
+ execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout }, createFunction) => {
274410
274438
  intro(`Creating ${type4} in the SettleMint platform`);
274411
274439
  const autoAccept = !!acceptDefaults || is_in_ci_default;
274412
274440
  const env2 = await loadEnv2(false, !!prod);
@@ -274432,8 +274460,9 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
274432
274460
  await waitForCompletion({
274433
274461
  settlemint,
274434
274462
  type: waitFor?.resourceType ?? type4,
274435
- id: waitFor?.id ?? result.id,
274436
- action: "deploy"
274463
+ uniqueName: waitFor?.uniqueName ?? result.uniqueName,
274464
+ action: "deploy",
274465
+ restartIfTimeout
274437
274466
  });
274438
274467
  if (waitFor) {
274439
274468
  outro(`${capitalizeFirstLetter(waitFor.resourceType)} ${waitFor.name} created successfully`);
@@ -274452,10 +274481,10 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
274452
274481
  ...updatedEnv
274453
274482
  };
274454
274483
  if (isApplicationChanged && updatedEnv.SETTLEMINT_APPLICATION) {
274455
- newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.id;
274484
+ newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.uniqueName;
274456
274485
  }
274457
274486
  if (newEnv.SETTLEMINT_BLOCKCHAIN_NODE && newEnv.SETTLEMINT_BLOCKCHAIN_NODE !== env2.SETTLEMINT_BLOCKCHAIN_NODE) {
274458
- newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.id;
274487
+ newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.uniqueName;
274459
274488
  }
274460
274489
  await writeEnvSpinner(!!prod, newEnv);
274461
274490
  note(`${capitalizeFirstLetter(type4)} ${result.name} set as default`);
@@ -274472,8 +274501,8 @@ function blockchainNetworkBesuCreateCommand() {
274472
274501
  type: "blockchain network",
274473
274502
  alias: "b",
274474
274503
  execute: (cmd2, baseAction) => {
274475
- addClusterServiceArgs(cmd2).option("-a, --application-id <applicationId>", "The application ID to create the network in (defaults to application from env)").requiredOption("--node-name <name>", "Name of the node").option("--chain-id <chainId>", "The chain ID for the network", parseNumber).option("--contract-size-limit <limit>", "Maximum contract size limit", parseNumber).option("--evm-stack-size <size>", "EVM stack size", parseNumber).option("--gas-limit <limit>", "Block gas limit").option("--gas-price <price>", "Gas price in wei", parseNumber).option("--seconds-per-block <seconds>", "Block time in seconds", parseNumber).action(async (name2, {
274476
- applicationId,
274504
+ addClusterServiceArgs(cmd2).option("-a, --application <application>", "The unique name of the application to create the network in (defaults to application from env)").requiredOption("--node-name <name>", "Name of the node").option("--chain-id <chainId>", "The chain ID for the network", parseNumber).option("--contract-size-limit <limit>", "Maximum contract size limit", parseNumber).option("--evm-stack-size <size>", "EVM stack size", parseNumber).option("--gas-limit <limit>", "Block gas limit").option("--gas-price <price>", "Gas price in wei", parseNumber).option("--seconds-per-block <seconds>", "Block time in seconds", parseNumber).action(async (name2, {
274505
+ application,
274477
274506
  chainId,
274478
274507
  contractSizeLimit,
274479
274508
  evmStackSize,
@@ -274488,10 +274517,10 @@ function blockchainNetworkBesuCreateCommand() {
274488
274517
  ...defaultArgs
274489
274518
  }) => {
274490
274519
  return baseAction(defaultArgs, async (settlemint, env2) => {
274491
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
274520
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274492
274521
  const result = await settlemint.blockchainNetwork.create({
274493
274522
  name: name2,
274494
- applicationId: application,
274523
+ applicationUniqueName,
274495
274524
  nodeName,
274496
274525
  consensusAlgorithm: "BESU_QBFT",
274497
274526
  chainId,
@@ -274514,9 +274543,9 @@ function blockchainNetworkBesuCreateCommand() {
274514
274543
  } : undefined,
274515
274544
  mapDefaultEnv: () => {
274516
274545
  return {
274517
- SETTLEMINT_APPLICATION: application,
274518
- SETTLEMINT_BLOCKCHAIN_NETWORK: result.id,
274519
- SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.id
274546
+ SETTLEMINT_APPLICATION: applicationUniqueName,
274547
+ SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
274548
+ SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName
274520
274549
  };
274521
274550
  }
274522
274551
  };
@@ -274530,7 +274559,7 @@ function blockchainNetworkBesuCreateCommand() {
274530
274559
  },
274531
274560
  {
274532
274561
  description: "Create a Besu blockchain network in a different application",
274533
- command: "platform create blockchain-network besu my-network --application-id 123456789 --node-name validator-1 --chain-id 12345 --gas-limit 10000000 --seconds-per-block 5"
274562
+ command: "platform create blockchain-network besu my-network --application app-123 --node-name validator-1 --chain-id 12345 --gas-limit 10000000 --seconds-per-block 5"
274534
274563
  }
274535
274564
  ]
274536
274565
  });
@@ -274661,7 +274690,7 @@ function workspaceCreateCommand() {
274661
274690
  result,
274662
274691
  mapDefaultEnv: () => {
274663
274692
  return {
274664
- SETTLEMINT_WORKSPACE: result.id
274693
+ SETTLEMINT_WORKSPACE: result.uniqueName
274665
274694
  };
274666
274695
  }
274667
274696
  };
@@ -274692,10 +274721,11 @@ function applicationAccessTokenCreateCommand() {
274692
274721
  type: "application access token",
274693
274722
  alias: "aat",
274694
274723
  execute: (cmd2, baseAction) => {
274695
- cmd2.option("-a, --application-id <applicationId>", "The application ID 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, { applicationId, validityPeriod, ...defaultArgs }) => {
274724
+ 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 }) => {
274696
274725
  return baseAction(defaultArgs, async (settlemint, env2) => {
274726
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274697
274727
  const aatToken = await settlemint.applicationAccessToken.create({
274698
- applicationId: applicationId ?? env2.SETTLEMINT_APPLICATION,
274728
+ applicationUniqueName,
274699
274729
  name: name2,
274700
274730
  blockchainNetworkScope: {
274701
274731
  type: "ALL",
@@ -274742,7 +274772,8 @@ function applicationAccessTokenCreateCommand() {
274742
274772
  return {
274743
274773
  result: {
274744
274774
  id: "",
274745
- name: name2
274775
+ name: name2,
274776
+ uniqueName: ""
274746
274777
  },
274747
274778
  mapDefaultEnv: () => ({
274748
274779
  SETTLEMINT_ACCESS_TOKEN: aatToken
@@ -274775,18 +274806,17 @@ function applicationCreateCommand() {
274775
274806
  type: "application",
274776
274807
  alias: "a",
274777
274808
  execute: (cmd2, baseAction) => {
274778
- cmd2.option("-w, --workspace-id <workspaceId>", "The workspace ID to create the application in (defaults to workspace from env)").action(async (name2, { workspaceId, ...defaultArgs }) => {
274809
+ cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, ...defaultArgs }) => {
274779
274810
  return baseAction(defaultArgs, async (settlemint, env2) => {
274780
- const workspace = workspaceId ?? env2.SETTLEMINT_WORKSPACE;
274781
274811
  const result = await settlemint.application.create({
274782
274812
  name: name2,
274783
- workspaceId: workspace
274813
+ workspaceUniqueName: workspace ?? env2.SETTLEMINT_WORKSPACE
274784
274814
  });
274785
274815
  return {
274786
274816
  result,
274787
274817
  mapDefaultEnv: () => {
274788
274818
  return {
274789
- SETTLEMINT_APPLICATION: result.id
274819
+ SETTLEMINT_APPLICATION: result.uniqueName
274790
274820
  };
274791
274821
  }
274792
274822
  };
@@ -274804,7 +274834,7 @@ function applicationCreateCommand() {
274804
274834
  },
274805
274835
  {
274806
274836
  description: "Create an application in a specific workspace",
274807
- command: "platform create application my-app --workspace-id 123456789"
274837
+ command: "platform create application my-app --workspace my-workspace"
274808
274838
  }
274809
274839
  ]
274810
274840
  });
@@ -274815,7 +274845,7 @@ async function blockchainNetworkPrompt(env2, networks, accept) {
274815
274845
  if (networks.length === 0) {
274816
274846
  return;
274817
274847
  }
274818
- const defaultNetwork = networks.find((network) => network.id === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
274848
+ const defaultNetwork = networks.find((network) => network.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
274819
274849
  const defaultPossible = accept;
274820
274850
  if (defaultPossible) {
274821
274851
  return defaultNetwork;
@@ -274843,13 +274873,13 @@ function blockchainNodeBesuCreateCommand() {
274843
274873
  type: "blockchain node",
274844
274874
  alias: "b",
274845
274875
  execute: (cmd2, baseAction) => {
274846
- addClusterServiceArgs(cmd2).option("-a, --application-id <applicationId>", "The application ID to create the node in (defaults to application from env)").option("--blockchain-network-id <blockchainNetworkId>", "Blockchain network to add this node to").option("--node-identity <nodeIdentity>", "EC DSA P256 private key to use as the node identity").addOption(new Option("--node-type <nodeType>", "Type of the node").choices(["VALIDATOR", "NON_VALIDATOR"]).makeOptionMandatory()).action(async (name2, {
274847
- applicationId,
274876
+ addClusterServiceArgs(cmd2).option("-a, --application <application>", "The application unique name to create the node in (defaults to application from env)").option("--blockchain-network <blockchainNetwork>", "Blockchain network unique name to add this node to").option("--node-identity <nodeIdentity>", "EC DSA P256 private key to use as the node identity").addOption(new Option("--node-type <nodeType>", "Type of the node").choices(["VALIDATOR", "NON_VALIDATOR"]).makeOptionMandatory()).action(async (name2, {
274877
+ application,
274848
274878
  provider,
274849
274879
  region,
274850
274880
  size,
274851
274881
  type: type4,
274852
- blockchainNetworkId,
274882
+ blockchainNetwork,
274853
274883
  nodeType,
274854
274884
  nodeIdentity,
274855
274885
  acceptDefaults,
@@ -274857,23 +274887,23 @@ function blockchainNodeBesuCreateCommand() {
274857
274887
  }) => {
274858
274888
  return baseAction(defaultArgs, async (settlemint, env2) => {
274859
274889
  const autoAccept = !!acceptDefaults || is_in_ci_default;
274860
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
274861
- if (!application) {
274890
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274891
+ if (!applicationUniqueName) {
274862
274892
  cancel2("No application found. Please specify an application or run `settlemint connect` to continue.");
274863
274893
  }
274864
- let networkId = blockchainNetworkId ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
274865
- if (!networkId) {
274866
- const networks = await settlemint.blockchainNetwork.list(application);
274894
+ let networkUniqueName = blockchainNetwork ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
274895
+ if (!networkUniqueName) {
274896
+ const networks = await settlemint.blockchainNetwork.list(applicationUniqueName);
274867
274897
  const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults ?? false);
274868
274898
  if (!network) {
274869
274899
  cancel2("No network found. Please specify a network to continue.");
274870
274900
  }
274871
- networkId = network?.id;
274901
+ networkUniqueName = network?.id;
274872
274902
  }
274873
274903
  const result = await settlemint.blockchainNode.create({
274874
- applicationId: application,
274904
+ applicationUniqueName,
274875
274905
  name: name2,
274876
- blockchainNetworkId: networkId,
274906
+ blockchainNetworkUniqueName: networkUniqueName,
274877
274907
  nodeType,
274878
274908
  keyMaterial: nodeIdentity,
274879
274909
  provider,
@@ -274885,7 +274915,7 @@ function blockchainNodeBesuCreateCommand() {
274885
274915
  result,
274886
274916
  mapDefaultEnv: () => {
274887
274917
  return {
274888
- SETTLEMINT_APPLICATION: application,
274918
+ SETTLEMINT_APPLICATION: applicationUniqueName,
274889
274919
  SETTLEMINT_BLOCKCHAIN_NODE: result.id
274890
274920
  };
274891
274921
  }
@@ -274922,28 +274952,28 @@ function blockscoutInsightsCreateCommand() {
274922
274952
  type: "insights",
274923
274953
  alias: "bs",
274924
274954
  execute: (cmd2, baseAction) => {
274925
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--load-balancer-id <loadBalancerId>", "Load Balancer ID (mutually exclusive with blockchain-node-id)").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID (mutually exclusive with load-balancer-id)").action(async (name2, { applicationId, provider, region, size, type: type4, blockchainNodeId, loadBalancerId, ...defaultArgs }) => {
274955
+ 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 }) => {
274926
274956
  return baseAction(defaultArgs, async (settlemint, env2) => {
274927
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
274928
- const blockchainNode = loadBalancerId ? undefined : blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
274929
- const loadBalancer = loadBalancerId ?? (blockchainNode ? undefined : env2.SETTLEMINT_LOAD_BALANCER);
274957
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274958
+ const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
274959
+ const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
274930
274960
  const result = await settlemint.insights.create({
274931
274961
  name: name2,
274932
- applicationId: application,
274962
+ applicationUniqueName,
274933
274963
  insightsCategory: "BLOCKCHAIN_EXPLORER",
274934
274964
  provider,
274935
274965
  region,
274936
274966
  size,
274937
274967
  type: type4,
274938
- blockchainNode,
274939
- loadBalancer
274968
+ blockchainNodeUniqueName,
274969
+ loadBalancerUniqueName
274940
274970
  });
274941
274971
  return {
274942
274972
  result,
274943
274973
  mapDefaultEnv: async () => {
274944
274974
  return {
274945
- SETTLEMINT_APPLICATION: application,
274946
- SETTLEMINT_BLOCKSCOUT: result.id,
274975
+ SETTLEMINT_APPLICATION: applicationUniqueName,
274976
+ SETTLEMINT_BLOCKSCOUT: result.uniqueName,
274947
274977
  ...getBlockscoutEndpoints(result)
274948
274978
  };
274949
274979
  }
@@ -274958,7 +274988,7 @@ function blockscoutInsightsCreateCommand() {
274958
274988
  },
274959
274989
  {
274960
274990
  description: "Create a Blockscout insights service in a different application",
274961
- command: "platform create insights blockscout my-blockscout --application-id 123456789"
274991
+ command: "platform create insights blockscout my-blockscout --application app-123"
274962
274992
  }
274963
274993
  ]
274964
274994
  });
@@ -274978,12 +275008,12 @@ function hasuraIntegrationCreateCommand() {
274978
275008
  type: "integration tool",
274979
275009
  alias: "ha",
274980
275010
  execute: (cmd2, baseAction) => {
274981
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
275011
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
274982
275012
  return baseAction(defaultArgs, async (settlemint, env2) => {
274983
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275013
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274984
275014
  const result = await settlemint.integrationTool.create({
274985
275015
  name: name2,
274986
- applicationId: application,
275016
+ applicationUniqueName,
274987
275017
  integrationType: "HASURA",
274988
275018
  provider,
274989
275019
  region,
@@ -274994,8 +275024,8 @@ function hasuraIntegrationCreateCommand() {
274994
275024
  result,
274995
275025
  mapDefaultEnv: async () => {
274996
275026
  return {
274997
- SETTLEMINT_APPLICATION: application,
274998
- SETTLEMINT_HASURA: result.id,
275027
+ SETTLEMINT_APPLICATION: applicationUniqueName,
275028
+ SETTLEMINT_HASURA: result.uniqueName,
274999
275029
  ...getHasuraEndpoints(result)
275000
275030
  };
275001
275031
  }
@@ -275010,7 +275040,7 @@ function hasuraIntegrationCreateCommand() {
275010
275040
  },
275011
275041
  {
275012
275042
  description: "Create a Hasura integration in a different application",
275013
- command: "platform create integration-tool hasura my-hasura --application-id 123456789"
275043
+ command: "platform create integration-tool hasura my-hasura --application app-123"
275014
275044
  }
275015
275045
  ]
275016
275046
  });
@@ -275030,15 +275060,15 @@ function graphMiddlewareCreateCommand() {
275030
275060
  type: "middleware",
275031
275061
  alias: "gr",
275032
275062
  execute: (cmd2, baseAction) => {
275033
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID").action(async (name2, { applicationId, blockchainNodeId, provider, region, size, type: type4, ...defaultArgs }) => {
275063
+ 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 }) => {
275034
275064
  return baseAction(defaultArgs, async (settlemint, env2) => {
275035
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275036
- const blockchainNode = blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275065
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275066
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275037
275067
  const result = await settlemint.middleware.create({
275038
275068
  name: name2,
275039
- applicationId: application,
275069
+ applicationUniqueName,
275040
275070
  interface: "HA_GRAPH",
275041
- blockchainNodeId: blockchainNode,
275071
+ blockchainNodeUniqueName,
275042
275072
  provider,
275043
275073
  region,
275044
275074
  size,
@@ -275047,11 +275077,11 @@ function graphMiddlewareCreateCommand() {
275047
275077
  return {
275048
275078
  result,
275049
275079
  mapDefaultEnv: async () => {
275050
- const resource = await settlemint.middleware.read(result.id);
275080
+ const graphMiddleware = await settlemint.middleware.read(result.uniqueName);
275051
275081
  return {
275052
- SETTLEMINT_APPLICATION: application,
275053
- SETTLEMINT_THEGRAPH: result.id,
275054
- ...await getGraphEndpoint(resource, env2)
275082
+ SETTLEMINT_APPLICATION: applicationUniqueName,
275083
+ SETTLEMINT_THEGRAPH: result.uniqueName,
275084
+ ...await getGraphEndpoint(graphMiddleware, env2)
275055
275085
  };
275056
275086
  }
275057
275087
  };
@@ -275065,7 +275095,7 @@ function graphMiddlewareCreateCommand() {
275065
275095
  },
275066
275096
  {
275067
275097
  description: "Create a graph middleware in a different application",
275068
- command: "platform create middleware graph my-graph --application-id 123456789 --blockchain-node-id node-123 --storage-id storage-123"
275098
+ command: "platform create middleware graph my-graph --application my-app --blockchain-node node-123"
275069
275099
  }
275070
275100
  ]
275071
275101
  });
@@ -275079,16 +275109,16 @@ function smartContractPortalMiddlewareCreateCommand() {
275079
275109
  type: "middleware",
275080
275110
  alias: "scp",
275081
275111
  execute: (cmd2, baseAction) => {
275082
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--load-balancer-id <loadBalancerId>", "Load Balancer ID (mutually exclusive with blockchain-node-id)").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID (mutually exclusive with load-balancer-id)").option("--abis <abis...>", "Path to abi file(s)").addOption(new Option("--include-predeployed-abis <includePredeployedAbis...>", "Include pre-deployed abis").choices([
275112
+ 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)").option("--abis <abis...>", "Path to abi file(s)").addOption(new Option("--include-predeployed-abis <includePredeployedAbis...>", "Include pre-deployed abis").choices([
275083
275113
  "StarterKitERC20Registry",
275084
275114
  "StarterKitERC20Factory",
275085
275115
  "StarterKitERC20",
275086
275116
  "StarterKitERC20DexFactory",
275087
275117
  "StarterKitERC20Dex"
275088
275118
  ])).action(async (name2, {
275089
- applicationId,
275090
- blockchainNodeId,
275091
- loadBalancerId,
275119
+ application,
275120
+ blockchainNode,
275121
+ loadBalancer,
275092
275122
  provider,
275093
275123
  region,
275094
275124
  size,
@@ -275098,9 +275128,9 @@ function smartContractPortalMiddlewareCreateCommand() {
275098
275128
  ...defaultArgs
275099
275129
  }) => {
275100
275130
  return baseAction(defaultArgs, async (settlemint, env2) => {
275101
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275102
- const blockchainNode = loadBalancerId ? undefined : blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275103
- const loadBalancer = loadBalancerId ?? (blockchainNode ? undefined : env2.SETTLEMINT_LOAD_BALANCER);
275131
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275132
+ const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275133
+ const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
275104
275134
  const parsedAbis = [];
275105
275135
  if (abis && abis.length > 0) {
275106
275136
  try {
@@ -275117,10 +275147,10 @@ function smartContractPortalMiddlewareCreateCommand() {
275117
275147
  }
275118
275148
  const result = await settlemint.middleware.create({
275119
275149
  name: name2,
275120
- applicationId: application,
275150
+ applicationUniqueName,
275121
275151
  interface: "SMART_CONTRACT_PORTAL",
275122
- blockchainNodeId: blockchainNode,
275123
- loadBalancerId: loadBalancer,
275152
+ blockchainNodeUniqueName,
275153
+ loadBalancerUniqueName,
275124
275154
  abis: parsedAbis,
275125
275155
  includePredeployedAbis,
275126
275156
  provider,
@@ -275132,8 +275162,8 @@ function smartContractPortalMiddlewareCreateCommand() {
275132
275162
  result,
275133
275163
  mapDefaultEnv: async () => {
275134
275164
  return {
275135
- SETTLEMINT_APPLICATION: application,
275136
- SETTLEMINT_PORTAL: result.id,
275165
+ SETTLEMINT_APPLICATION: applicationUniqueName,
275166
+ SETTLEMINT_PORTAL: result.uniqueName,
275137
275167
  ...getPortalEndpoints(result)
275138
275168
  };
275139
275169
  }
@@ -275148,7 +275178,7 @@ function smartContractPortalMiddlewareCreateCommand() {
275148
275178
  },
275149
275179
  {
275150
275180
  description: "Create a smart contract portal middleware in a different application",
275151
- command: "platform create middleware smart-contract-portal my-portal --application-id 123456789 --blockchain-node-id node-123"
275181
+ command: "platform create middleware smart-contract-portal my-portal --application my-app --blockchain-node node-123"
275152
275182
  }
275153
275183
  ]
275154
275184
  });
@@ -275166,14 +275196,15 @@ function privateKeyHdCreateCommand() {
275166
275196
  type: "private key",
275167
275197
  alias: "hd",
275168
275198
  execute: (cmd2, baseAction) => {
275169
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID").action(async (name2, { applicationId, blockchainNodeId, provider, region, size, type: type4, ...defaultArgs }) => {
275199
+ 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 }) => {
275170
275200
  return baseAction(defaultArgs, async (settlemint, env2) => {
275171
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275201
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275202
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275172
275203
  const result = await settlemint.privateKey.create({
275173
275204
  name: name2,
275174
- applicationId: application,
275205
+ applicationUniqueName,
275175
275206
  privateKeyType: "HD_ECDSA_P256",
275176
- blockchainNodes: blockchainNodeId ? [blockchainNodeId] : [],
275207
+ blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
275177
275208
  provider,
275178
275209
  region,
275179
275210
  size,
@@ -275183,7 +275214,7 @@ function privateKeyHdCreateCommand() {
275183
275214
  result,
275184
275215
  mapDefaultEnv: () => {
275185
275216
  return {
275186
- SETTLEMINT_APPLICATION: application,
275217
+ SETTLEMINT_APPLICATION: applicationUniqueName,
275187
275218
  SETTLEMINT_HD_PRIVATE_KEY: result.uniqueName
275188
275219
  };
275189
275220
  }
@@ -275198,11 +275229,11 @@ function privateKeyHdCreateCommand() {
275198
275229
  },
275199
275230
  {
275200
275231
  description: "Create a private key in a different application",
275201
- command: "platform create private-key hd-ecdsa-p256 my-key --application-id 123456789"
275232
+ command: "platform create private-key hd-ecdsa-p256 my-key --application my-app"
275202
275233
  },
275203
275234
  {
275204
275235
  description: "Create a private key linked to a blockchain node",
275205
- command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node-id node123"
275236
+ command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node node-123"
275206
275237
  }
275207
275238
  ]
275208
275239
  });
@@ -275215,14 +275246,15 @@ function privateKeyHsmCreateCommand() {
275215
275246
  type: "private key",
275216
275247
  alias: "hd",
275217
275248
  execute: (cmd2, baseAction) => {
275218
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID").action(async (name2, { applicationId, blockchainNodeId, provider, region, size, type: type4, ...defaultArgs }) => {
275249
+ 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 }) => {
275219
275250
  return baseAction(defaultArgs, async (settlemint, env2) => {
275220
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275251
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275252
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275221
275253
  const result = await settlemint.privateKey.create({
275222
275254
  name: name2,
275223
- applicationId: application,
275255
+ applicationUniqueName,
275224
275256
  privateKeyType: "HSM_ECDSA_P256",
275225
- blockchainNodes: blockchainNodeId ? [blockchainNodeId] : [],
275257
+ blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
275226
275258
  provider,
275227
275259
  region,
275228
275260
  size,
@@ -275241,11 +275273,11 @@ function privateKeyHsmCreateCommand() {
275241
275273
  },
275242
275274
  {
275243
275275
  description: "Create a private key in a different application",
275244
- command: "platform create private-key hsm-ecdsa-p256 my-key --application-id 123456789"
275276
+ command: "platform create private-key hsm-ecdsa-p256 my-key --application 123456789"
275245
275277
  },
275246
275278
  {
275247
275279
  description: "Create a private key linked to a blockchain node",
275248
- command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node-id node123"
275280
+ command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node node-123"
275249
275281
  }
275250
275282
  ]
275251
275283
  });
@@ -275263,12 +275295,12 @@ function ipfsStorageCreateCommand() {
275263
275295
  type: "storage",
275264
275296
  alias: "ip",
275265
275297
  execute: (cmd2, baseAction) => {
275266
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
275298
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
275267
275299
  return baseAction(defaultArgs, async (settlemint, env2) => {
275268
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275300
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275269
275301
  const result = await settlemint.storage.create({
275270
275302
  name: name2,
275271
- applicationId: application,
275303
+ applicationUniqueName,
275272
275304
  storageProtocol: "IPFS",
275273
275305
  provider,
275274
275306
  region,
@@ -275279,8 +275311,8 @@ function ipfsStorageCreateCommand() {
275279
275311
  result,
275280
275312
  mapDefaultEnv: () => {
275281
275313
  return {
275282
- SETTLEMINT_APPLICATION: application,
275283
- SETTLEMINT_IPFS: result.id,
275314
+ SETTLEMINT_APPLICATION: applicationUniqueName,
275315
+ SETTLEMINT_IPFS: result.uniqueName,
275284
275316
  ...getIpfsEndpoints(result)
275285
275317
  };
275286
275318
  }
@@ -275295,7 +275327,7 @@ function ipfsStorageCreateCommand() {
275295
275327
  },
275296
275328
  {
275297
275329
  description: "Create an IPFS storage in a different application",
275298
- command: "platform create storage ipfs my-storage --application-id app-123"
275330
+ command: "platform create storage ipfs my-storage --application app-123"
275299
275331
  }
275300
275332
  ]
275301
275333
  });
@@ -275308,12 +275340,12 @@ function minioStorageCreateCommand() {
275308
275340
  type: "storage",
275309
275341
  alias: "m",
275310
275342
  execute: (cmd2, baseAction) => {
275311
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
275343
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
275312
275344
  return baseAction(defaultArgs, async (settlemint, env2) => {
275313
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275345
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275314
275346
  const result = await settlemint.storage.create({
275315
275347
  name: name2,
275316
- applicationId: application,
275348
+ applicationUniqueName,
275317
275349
  storageProtocol: "MINIO",
275318
275350
  provider,
275319
275351
  region,
@@ -275324,8 +275356,8 @@ function minioStorageCreateCommand() {
275324
275356
  result,
275325
275357
  mapDefaultEnv: () => {
275326
275358
  return {
275327
- SETTLEMINT_APPLICATION: application,
275328
- SETTLEMINT_MINIO: result.id,
275359
+ SETTLEMINT_APPLICATION: applicationUniqueName,
275360
+ SETTLEMINT_MINIO: result.uniqueName,
275329
275361
  ...getMinioEndpoints(result)
275330
275362
  };
275331
275363
  }
@@ -275340,7 +275372,7 @@ function minioStorageCreateCommand() {
275340
275372
  },
275341
275373
  {
275342
275374
  description: "Create a MinIO storage in a different application",
275343
- command: "platform create storage minio my-storage --application-id app-123"
275375
+ command: "platform create storage minio my-storage --application app-123"
275344
275376
  }
275345
275377
  ]
275346
275378
  });
@@ -275386,11 +275418,11 @@ function getDeleteCommand({
275386
275418
  deleteFunction,
275387
275419
  usePersonalAccessToken = true
275388
275420
  }) {
275389
- return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4} ID or use 'default' to delete the default ${type4} from your .env file.
275421
+ return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to delete the default ${type4} from your .env file.
275390
275422
  ${createExamples([
275391
275423
  {
275392
- description: `Deletes the specified ${type4} by id`,
275393
- command: `platform delete ${type4} <${type4}-id>`
275424
+ description: `Deletes the specified ${type4} by unique name`,
275425
+ command: `platform delete ${type4} <${type4}-unique-name>`
275394
275426
  },
275395
275427
  {
275396
275428
  description: `Deletes the default ${type4} in the production environment`,
@@ -275398,9 +275430,9 @@ ${createExamples([
275398
275430
  },
275399
275431
  {
275400
275432
  description: `Force deletes the specified ${type4} without confirmation`,
275401
- command: `platform delete ${type4} <${type4}-id> --force`
275433
+ command: `platform delete ${type4} <${type4}-unique-name> --force`
275402
275434
  }
275403
- ])}`).argument("<id>", `The id of the ${type4}, use 'default' to delete 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 destroyed").option("-f, --force", `Force delete the ${type4} without confirmation`).action(async (id, { acceptDefaults, prod, force, wait }) => {
275435
+ ])}`).argument("<uniqueName>", `The unique name of the ${type4}, use 'default' to delete 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 destroyed").option("-f, --force", `Force delete the ${type4} without confirmation`).action(async (uniqueName, { acceptDefaults, prod, force, wait }) => {
275404
275436
  intro(`Deleting ${type4} in the SettleMint platform`);
275405
275437
  if (!force) {
275406
275438
  await deleteConfirmationPrompt(`this ${type4}`);
@@ -275418,19 +275450,19 @@ ${createExamples([
275418
275450
  accessToken,
275419
275451
  instance
275420
275452
  });
275421
- const isDefaultId = id === "default";
275422
- const serviceId = isDefaultId ? typeof env2[envKey] === "string" ? env2[envKey] : null : id;
275423
- if (!serviceId) {
275453
+ const isDefaultUniqueName = uniqueName === "default";
275454
+ const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
275455
+ if (!serviceUniqueName) {
275424
275456
  throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} ID or set a default ${type4} first.`);
275425
275457
  }
275426
275458
  const result = await spinner({
275427
275459
  startMessage: `Deleting ${type4}`,
275428
275460
  task: async () => {
275429
- return deleteFunction(settlemint, serviceId);
275461
+ return deleteFunction(settlemint, serviceUniqueName);
275430
275462
  },
275431
275463
  stopMessage: `${capitalizeFirstLetter(type4)} deleted`
275432
275464
  });
275433
- if (isDefaultId) {
275465
+ if (isDefaultUniqueName) {
275434
275466
  const newEnv = {
275435
275467
  SETTLEMINT_ACCESS_TOKEN: usePersonalAccessToken ? env2.SETTLEMINT_ACCESS_TOKEN : accessToken,
275436
275468
  SETTLEMINT_INSTANCE: instance,
@@ -275440,7 +275472,7 @@ ${createExamples([
275440
275472
  note(`${capitalizeFirstLetter(type4)} removed as default`);
275441
275473
  }
275442
275474
  if (wait) {
275443
- await waitForCompletion({ settlemint, type: type4, id: serviceId, action: "destroy" });
275475
+ await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "destroy" });
275444
275476
  }
275445
275477
  outro(`${capitalizeFirstLetter(type4)} ${result.name} deleted successfully`);
275446
275478
  });
@@ -275453,8 +275485,8 @@ function workspaceDeleteCommand() {
275453
275485
  type: "workspace",
275454
275486
  alias: "w",
275455
275487
  envKey: "SETTLEMINT_WORKSPACE",
275456
- deleteFunction: async (settlemint, id) => {
275457
- return settlemint.workspace.delete(id);
275488
+ deleteFunction: async (settlemint, uniqueName) => {
275489
+ return settlemint.workspace.delete(uniqueName);
275458
275490
  }
275459
275491
  });
275460
275492
  }
@@ -275503,7 +275535,7 @@ ${createExamples([
275503
275535
  description: `Restarts the default ${type4} in the production environment`,
275504
275536
  command: `platform restart ${commandName}${subType ? ` ${subType}` : ""} default --prod`
275505
275537
  }
275506
- ])}`).argument("<id>", `The id 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 (id, { acceptDefaults, prod, wait }) => {
275538
+ ])}`).argument("<uniqueName>", `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 }) => {
275507
275539
  intro(`Restarting ${type4} in the SettleMint platform`);
275508
275540
  const autoAccept = !!acceptDefaults || is_in_ci_default;
275509
275541
  const env2 = await loadEnv2(false, !!prod);
@@ -275518,20 +275550,20 @@ ${createExamples([
275518
275550
  accessToken,
275519
275551
  instance
275520
275552
  });
275521
- const isDefaultId = id === "default";
275522
- const serviceId = isDefaultId ? typeof env2[envKey] === "string" ? env2[envKey] : null : id;
275523
- if (!serviceId) {
275524
- throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} ID or set a default ${type4} first.`);
275553
+ const isDefaultUniqueName = uniqueName === "default";
275554
+ const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
275555
+ if (!serviceUniqueName) {
275556
+ throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
275525
275557
  }
275526
275558
  const result = await spinner({
275527
275559
  startMessage: `Restarting ${type4}`,
275528
275560
  task: async () => {
275529
- return restartFunction(settlemint, serviceId);
275561
+ return restartFunction(settlemint, serviceUniqueName);
275530
275562
  },
275531
275563
  stopMessage: `${capitalizeFirstLetter(type4)} restart initiated`
275532
275564
  });
275533
275565
  if (wait) {
275534
- await waitForCompletion({ settlemint, type: type4, id: serviceId, action: "restart" });
275566
+ await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "restart" });
275535
275567
  }
275536
275568
  outro(`${capitalizeFirstLetter(type4)} ${result.name} restart initiated successfully`);
275537
275569
  });
@@ -275544,8 +275576,8 @@ function blockchainNetworkRestartCommand() {
275544
275576
  type: "blockchain network",
275545
275577
  alias: "bn",
275546
275578
  envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
275547
- restartFunction: async (settlemint, id) => {
275548
- return settlemint.blockchainNetwork.restart(id);
275579
+ restartFunction: async (settlemint, uniqueName) => {
275580
+ return settlemint.blockchainNetwork.restart(uniqueName);
275549
275581
  }
275550
275582
  });
275551
275583
  }
@@ -275557,8 +275589,8 @@ function customDeploymentRestartCommand() {
275557
275589
  type: "custom deployment",
275558
275590
  alias: "cd",
275559
275591
  envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
275560
- restartFunction: async (settlemint, id) => {
275561
- return settlemint.customDeployment.restart(id);
275592
+ restartFunction: async (settlemint, uniqueName) => {
275593
+ return settlemint.customDeployment.restart(uniqueName);
275562
275594
  },
275563
275595
  usePersonalAccessToken: false
275564
275596
  });
@@ -275572,8 +275604,8 @@ function blockscoutRestartCommand() {
275572
275604
  subType: "blockscout",
275573
275605
  alias: "bs",
275574
275606
  envKey: "SETTLEMINT_BLOCKSCOUT",
275575
- restartFunction: async (settlemint, id) => {
275576
- return settlemint.insights.restart(id);
275607
+ restartFunction: async (settlemint, uniqueName) => {
275608
+ return settlemint.insights.restart(uniqueName);
275577
275609
  }
275578
275610
  });
275579
275611
  }
@@ -275591,8 +275623,8 @@ function hasuraRestartCommand() {
275591
275623
  subType: "hasura",
275592
275624
  alias: "ha",
275593
275625
  envKey: "SETTLEMINT_HASURA",
275594
- restartFunction: async (settlemint, id) => {
275595
- return settlemint.integrationTool.restart(id);
275626
+ restartFunction: async (settlemint, uniqueName) => {
275627
+ return settlemint.integrationTool.restart(uniqueName);
275596
275628
  }
275597
275629
  });
275598
275630
  }
@@ -275624,8 +275656,8 @@ function smartContractPortalRestartCommand() {
275624
275656
  subType: "smart-contract-portal",
275625
275657
  alias: "scp",
275626
275658
  envKey: "SETTLEMINT_PORTAL",
275627
- restartFunction: async (settlemint, id) => {
275628
- return settlemint.middleware.restart(id);
275659
+ restartFunction: async (settlemint, uniqueName) => {
275660
+ return settlemint.middleware.restart(uniqueName);
275629
275661
  }
275630
275662
  });
275631
275663
  }
@@ -275643,8 +275675,8 @@ function hdEcdsaP256RestartCommand() {
275643
275675
  subType: "hd-ecdsa-p256",
275644
275676
  alias: "hd",
275645
275677
  envKey: "SETTLEMINT_HD_PRIVATE_KEY",
275646
- restartFunction: async (settlemint, id) => {
275647
- return settlemint.privateKey.restart(id);
275678
+ restartFunction: async (settlemint, uniqueName) => {
275679
+ return settlemint.privateKey.restart(uniqueName);
275648
275680
  }
275649
275681
  });
275650
275682
  }
@@ -275661,8 +275693,8 @@ function ipfsRestartCommand() {
275661
275693
  type: "storage",
275662
275694
  alias: "ip",
275663
275695
  envKey: "SETTLEMINT_IPFS",
275664
- restartFunction: async (settlemint, id) => {
275665
- return settlemint.storage.restart(id);
275696
+ restartFunction: async (settlemint, uniqueName) => {
275697
+ return settlemint.storage.restart(uniqueName);
275666
275698
  }
275667
275699
  });
275668
275700
  }
@@ -275674,8 +275706,8 @@ function minioRestartCommand() {
275674
275706
  type: "storage",
275675
275707
  alias: "m",
275676
275708
  envKey: "SETTLEMINT_MINIO",
275677
- restartFunction: async (settlemint, id) => {
275678
- return settlemint.storage.restart(id);
275709
+ restartFunction: async (settlemint, uniqueName) => {
275710
+ return settlemint.storage.restart(uniqueName);
275679
275711
  }
275680
275712
  });
275681
275713
  }
@@ -275693,12 +275725,12 @@ function restartCommand() {
275693
275725
 
275694
275726
  // src/commands/platform/custom-deployments/update.ts
275695
275727
  function customDeploymentsUpdateCommand() {
275696
- return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--id <id>", "The ID of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").action(async (tag, { id, prod, wait }) => {
275728
+ return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--unique-name <uniqueName>", "The unique name of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").action(async (tag, { uniqueName, prod, wait }) => {
275697
275729
  intro("Updating custom deployment in the SettleMint platform");
275698
275730
  const env2 = await loadEnv2(false, !!prod);
275699
- const customDeploymentId = id ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
275700
- if (!customDeploymentId) {
275701
- throw new Error("No custom deployment ID specified. Please provide it either via the --id flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
275731
+ const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
275732
+ if (!customDeploymentUniqueName) {
275733
+ throw new Error("No custom deployment unique name specified. Please provide it either via the --unique-name flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
275702
275734
  }
275703
275735
  const instance = await instancePrompt(env2, true);
275704
275736
  const accessToken = await getApplicationOrPersonalAccessToken({
@@ -275714,12 +275746,17 @@ function customDeploymentsUpdateCommand() {
275714
275746
  const customDeployment = await spinner({
275715
275747
  startMessage: "Updating custom deployment",
275716
275748
  task: async () => {
275717
- return settlemint.customDeployment.update(customDeploymentId, tag);
275749
+ return settlemint.customDeployment.update(customDeploymentUniqueName, tag);
275718
275750
  },
275719
275751
  stopMessage: "Custom deployment updated"
275720
275752
  });
275721
275753
  if (wait) {
275722
- await waitForCompletion({ settlemint, type: "custom deployment", id: customDeployment.id, action: "deploy" });
275754
+ await waitForCompletion({
275755
+ settlemint,
275756
+ type: "custom deployment",
275757
+ uniqueName: customDeployment.uniqueName,
275758
+ action: "deploy"
275759
+ });
275723
275760
  }
275724
275761
  outro(`${customDeployment.name} updated to ${tag}`);
275725
275762
  });
@@ -276108,7 +276145,7 @@ function isHardhatConfig(config4) {
276108
276145
 
276109
276146
  // src/commands/smart-contract-set/hardhat/deploy/remote.ts
276110
276147
  function hardhatDeployRemoteCommand() {
276111
- const cmd2 = new Command2("remote").description("Deploy the smart contracts using Hardhat/ignition to the remote network on the platform").option("-m, --module <ignitionmodule>", 'The module to deploy with Ignition, defaults to "ignition/modules/main.ts"').option("--deployment-id <deploymentId>", "Set the id of the deployment").option("-r, --reset", "Wipes the existing deployment state before deploying").option("-v, --verify", "Verify the deployment on Etherscan").option("--default-sender <defaultSender>", "Set the default sender for the deployment").option("--parameters <parameters>", "A relative path to a JSON file to use for the module parameters").option("--strategy <strategy>", `Set the deployment strategy to use (default: "basic")`).option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values");
276148
+ const cmd2 = new Command2("remote").description("Deploy the smart contracts using Hardhat/ignition to the remote network on the platform").option("-m, --module <ignitionmodule>", 'The module to deploy with Ignition, defaults to "ignition/modules/main.ts"').option("--deployment-id <deploymentId>", "Set the id of the deployment").option("-r, --reset", "Wipes the existing deployment state before deploying").option("-v, --verify", "Verify the deployment on Etherscan").option("--default-sender <defaultSender>", "Set the default sender for the deployment").option("--parameters <parameters>", "A relative path to a JSON file to use for the module parameters").option("--strategy <strategy>", `Set the deployment strategy to use (default: "basic")`).option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values");
276112
276149
  cmd2.action(async ({
276113
276150
  module,
276114
276151
  reset: reset2,
@@ -276119,7 +276156,7 @@ function hardhatDeployRemoteCommand() {
276119
276156
  strategy,
276120
276157
  prod,
276121
276158
  acceptDefaults,
276122
- blockchainNodeId
276159
+ blockchainNode: blockchainNodeUniqueName
276123
276160
  }) => {
276124
276161
  const autoAccept = !!acceptDefaults || is_in_ci_default;
276125
276162
  const env2 = await loadEnv(false, !!prod);
@@ -276134,15 +276171,15 @@ function hardhatDeployRemoteCommand() {
276134
276171
  accessToken,
276135
276172
  instance
276136
276173
  });
276137
- const nodeId = blockchainNodeId ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
276174
+ const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
276138
276175
  let node = undefined;
276139
- if (!nodeId) {
276176
+ if (!nodeUniqueName) {
276140
276177
  const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
276141
276178
  const evmNodes = nodes.filter((node2) => node2.isEvm);
276142
276179
  if (evmNodes.length === 0) {
276143
276180
  cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
276144
276181
  }
276145
- const nodesWithPrivateKey = await Promise.all(evmNodes.map((node2) => settlemint.blockchainNode.read(node2.id)));
276182
+ const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
276146
276183
  const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
276147
276184
  if (nodesWithActivePrivateKey.length === 0) {
276148
276185
  cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
@@ -276153,12 +276190,12 @@ function hardhatDeployRemoteCommand() {
276153
276190
  }
276154
276191
  node = blockchainNode;
276155
276192
  } else {
276156
- node = await settlemint.blockchainNode.read(nodeId);
276193
+ node = await settlemint.blockchainNode.read(nodeUniqueName);
276157
276194
  if (!node.isEvm) {
276158
276195
  cancel2("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
276159
276196
  }
276160
276197
  }
276161
- const envConfig = await settlemint.foundry.env(node.id);
276198
+ const envConfig = await settlemint.foundry.env(node.uniqueName);
276162
276199
  const hardhatConfig = await getHardhatConfigData(envConfig);
276163
276200
  if (verify && !hardhatConfig?.etherscan?.apiKey) {
276164
276201
  cancel2("It is not possible to verify the deployment on this network unless you supply an Etherscan API key in the hardhat.config.ts file");
@@ -276222,8 +276259,8 @@ function hardhatScriptLocalCommand() {
276222
276259
 
276223
276260
  // src/commands/smart-contract-set/hardhat/script/remote.ts
276224
276261
  function hardhatScriptRemoteCommand() {
276225
- const cmd2 = new Command2("remote").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--blockchain-node-id <blockchainNodeId>", "Blockchain Node ID (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("--no-compile", "Don't compile before running this task");
276226
- cmd2.action(async ({ script, prod, blockchainNodeId, acceptDefaults, compile }) => {
276262
+ const cmd2 = new Command2("remote").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("--no-compile", "Don't compile before running this task");
276263
+ cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
276227
276264
  const autoAccept = !!acceptDefaults || is_in_ci_default;
276228
276265
  const env2 = await loadEnv(false, !!prod);
276229
276266
  const instance = await instancePrompt(env2, true);
@@ -276237,16 +276274,16 @@ function hardhatScriptRemoteCommand() {
276237
276274
  accessToken,
276238
276275
  instance
276239
276276
  });
276240
- let nodeId = blockchainNodeId;
276241
- if (!nodeId) {
276277
+ let nodeUniqueName = blockchainNodeUniqueName;
276278
+ if (!nodeUniqueName) {
276242
276279
  const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
276243
276280
  const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
276244
276281
  if (!blockchainNode) {
276245
276282
  cancel2("No Blockchain Node selected. Please select one to continue.");
276246
276283
  }
276247
- nodeId = blockchainNode.id;
276284
+ nodeUniqueName = blockchainNode.uniqueName;
276248
276285
  }
276249
- const envConfig = await settlemint.foundry.env(nodeId);
276286
+ const envConfig = await settlemint.foundry.env(nodeUniqueName);
276250
276287
  const { command, args } = await getPackageManagerExecutable();
276251
276288
  await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
276252
276289
  });
@@ -276655,4 +276692,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
276655
276692
  cancel2(reason);
276656
276693
  });
276657
276694
 
276658
- //# debugId=6C0392D78459146664756E2164756E21
276695
+ //# debugId=661C8B60B993AC8E64756E2164756E21