@settlemint/sdk-cli 0.7.4-pr906d1dd → 0.7.4-pr9660ede

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 +1004 -975
  2. package/dist/cli.js.map +47 -47
  3. package/package.json +3 -3
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.pDVMonMjS3:/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.tAliif7iow:/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-pr906d1dd",
200567
+ binaryVersion: "0.7.4-pr9660ede",
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.pDVMonMjS3:/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.tAliif7iow:/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.pDVMonMjS3:/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.tAliif7iow:/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.pDVMonMjS3:/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.tAliif7iow:/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.pDVMonMjS3:/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.tAliif7iow:/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,256 @@ 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
271285
- }
271286
- }
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");
271294
- }
271295
- return applicationAccessToken.token;
271296
- };
271297
- };
271298
271284
  var ApplicationFragment = graphql(`
271299
271285
  fragment Application on Application {
271300
271286
  id
271287
+ uniqueName
271301
271288
  name
271302
- workspace { id }
271289
+ workspace {
271290
+ id
271291
+ uniqueName
271292
+ }
271303
271293
  }
271304
271294
  `);
271305
- var listApplications = graphql(`
271306
- query ListApplications($workspaceId: ID!) {
271307
- workspace (workspaceId: $workspaceId) {
271295
+ var WorkspaceFragment = graphql(`
271296
+ fragment Workspace on Workspace {
271297
+ id
271298
+ uniqueName
271299
+ name
271308
271300
  applications {
271309
271301
  ...Application
271310
271302
  }
271311
271303
  }
271312
- }
271304
+ `, [ApplicationFragment]);
271305
+ var getWorkspacesAndApplications = graphql(`
271306
+ query getWorkspacesAndApplications {
271307
+ workspaces {
271308
+ ...Workspace
271309
+ applications {
271310
+ ...Application
271311
+ }
271312
+ childWorkspaces {
271313
+ ...Workspace
271314
+ }
271315
+ }
271316
+ }
271317
+ `, [WorkspaceFragment, ApplicationFragment]);
271318
+ var getWorkspace = graphql(`
271319
+ query getWorkspace($uniqueName: String!) {
271320
+ workspaceByUniqueName(uniqueName: $uniqueName) {
271321
+ ...Workspace
271322
+ applications {
271323
+ ...Application
271324
+ }
271325
+ }
271326
+ }
271327
+ `, [WorkspaceFragment, ApplicationFragment]);
271328
+ var createWorkspace = graphql(`
271329
+ mutation CreateWorkspace(
271330
+ $addressLine1: String
271331
+ $addressLine2: String
271332
+ $city: String
271333
+ $companyName: String
271334
+ $country: String
271335
+ $name: String!
271336
+ $parentId: String
271337
+ $paymentMethodId: String
271338
+ $postalCode: String
271339
+ $taxIdType: String
271340
+ $taxIdValue: String
271341
+ ) {
271342
+ createWorkspace(
271343
+ addressLine1: $addressLine1
271344
+ addressLine2: $addressLine2
271345
+ city: $city
271346
+ companyName: $companyName
271347
+ country: $country
271348
+ name: $name
271349
+ parentId: $parentId
271350
+ paymentMethodId: $paymentMethodId
271351
+ postalCode: $postalCode
271352
+ taxIdType: $taxIdType
271353
+ taxIdValue: $taxIdValue
271354
+ ) {
271355
+ ...Workspace
271356
+ applications {
271357
+ ...Application
271358
+ }
271359
+ }
271360
+ }
271361
+ `, [WorkspaceFragment, ApplicationFragment]);
271362
+ var deleteWorkspace = graphql(`
271363
+ mutation deleteWorkspace($id: ID!) {
271364
+ deleteWorkspace(workspaceId: $id) {
271365
+ ...Workspace
271366
+ applications {
271367
+ ...Application
271368
+ }
271369
+ }
271370
+ }
271371
+ `, [WorkspaceFragment, ApplicationFragment]);
271372
+ var addCredits = graphql(`
271373
+ mutation addCredits($workspaceId: String!, $amount: Float!) {
271374
+ addCredits(workspaceId: $workspaceId, amount: $amount)
271375
+ }
271376
+ `);
271377
+ var workspaceList = (gqlClient, options) => {
271378
+ return async () => {
271379
+ const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
271380
+ const allWorkspaces = workspaces.reduce((acc, workspace) => {
271381
+ acc.push(workspace);
271382
+ if (workspace.childWorkspaces) {
271383
+ acc.push(...workspace.childWorkspaces);
271384
+ }
271385
+ return acc;
271386
+ }, []);
271387
+ return allWorkspaces.sort((a8, b4) => a8.name.localeCompare(b4.name));
271388
+ };
271389
+ };
271390
+ var workspaceRead = (gqlClient, options) => {
271391
+ return async (workspaceUniqueName) => {
271392
+ const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });
271393
+ return workspaceByUniqueName;
271394
+ };
271395
+ };
271396
+ var workspaceCreate = (gqlClient, options) => {
271397
+ return async (createWorkspaceArgs) => {
271398
+ const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);
271399
+ return workspace;
271400
+ };
271401
+ };
271402
+ var workspaceDelete = (gqlClient, options) => {
271403
+ return async (workspaceUniqueName) => {
271404
+ const workspaceToDelete = await workspaceRead(gqlClient, options)(workspaceUniqueName);
271405
+ const { deleteWorkspace: workspace } = await gqlClient.request(deleteWorkspace, { id: workspaceToDelete.id });
271406
+ return workspace;
271407
+ };
271408
+ };
271409
+ var workspaceAddCredits = (gqlClient, options) => {
271410
+ return async (workspaceId, amount) => {
271411
+ const id = validate3(IdSchema3, workspaceId);
271412
+ if (amount <= 0) {
271413
+ throw new Error("Credit amount must be a positive number");
271414
+ }
271415
+ const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });
271416
+ return result;
271417
+ };
271418
+ };
271419
+ var listApplications = graphql(`
271420
+ query ListApplications($workspaceUniqueName: String!) {
271421
+ workspaceByUniqueName(uniqueName: $workspaceUniqueName) {
271422
+ applications {
271423
+ ...Application
271424
+ }
271425
+ }
271426
+ }
271313
271427
  `, [ApplicationFragment]);
271314
271428
  var readApplication = graphql(`
271315
- query ReadApplication($id: ID!) {
271316
- application(applicationId: $id) {
271317
- ...Application
271429
+ query ReadApplication($applicationUniqueName: String!) {
271430
+ applicationByUniqueName(uniqueName: $applicationUniqueName) {
271431
+ ...Application
271432
+ }
271318
271433
  }
271319
- }
271320
271434
  `, [ApplicationFragment]);
271321
271435
  var createApplication = graphql(`
271322
- mutation CreateApplication(
271323
- $name: String!
271324
- $workspaceId: ID!
271325
- ) {
271326
- createApplication(
271327
- name: $name
271328
- workspaceId: $workspaceId
271329
- ) {
271330
- ...Application
271436
+ mutation CreateApplication($name: String!, $workspaceId: ID!) {
271437
+ createApplication(name: $name, workspaceId: $workspaceId) {
271438
+ ...Application
271439
+ }
271331
271440
  }
271332
- }
271333
271441
  `, [ApplicationFragment]);
271334
271442
  var deleteApplication = graphql(`
271335
- mutation DeleteApplication($id: ID!) {
271336
- deleteApplication(id: $id) {
271337
- ...Application
271443
+ mutation DeleteApplication($id: ID!) {
271444
+ deleteApplication(id: $id) {
271445
+ ...Application
271446
+ }
271338
271447
  }
271339
- }
271340
271448
  `, [ApplicationFragment]);
271341
271449
  var applicationList = (gqlClient, options) => {
271342
- return async (workspaceId) => {
271343
- const id = validate3(IdSchema3, workspaceId);
271450
+ return async (workspaceUniqueName) => {
271344
271451
  const {
271345
- workspace: { applications }
271346
- } = await gqlClient.request(listApplications, { workspaceId: id });
271452
+ workspaceByUniqueName: { applications }
271453
+ } = await gqlClient.request(listApplications, { workspaceUniqueName });
271347
271454
  return applications;
271348
271455
  };
271349
271456
  };
271350
271457
  var applicationRead = (gqlClient, options) => {
271351
- return async (applicationId) => {
271352
- const id = validate3(IdSchema3, applicationId);
271353
- const { application } = await gqlClient.request(readApplication, { id });
271458
+ return async (applicationUniqueName) => {
271459
+ const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {
271460
+ applicationUniqueName
271461
+ });
271354
271462
  return application;
271355
271463
  };
271356
271464
  };
271357
271465
  var applicationCreate = (gqlClient, options) => {
271358
271466
  return async (args) => {
271359
- const { createApplication: application } = await gqlClient.request(createApplication, args);
271467
+ const { workspaceUniqueName, ...otherArgs } = args;
271468
+ const workspace = await workspaceRead(gqlClient, options)(workspaceUniqueName);
271469
+ const { createApplication: application } = await gqlClient.request(createApplication, {
271470
+ ...otherArgs,
271471
+ workspaceId: workspace.id
271472
+ });
271360
271473
  return application;
271361
271474
  };
271362
271475
  };
271363
271476
  var applicationDelete = (gqlClient, options) => {
271364
- return async (applicationId) => {
271365
- const id = validate3(IdSchema3, applicationId);
271366
- const { deleteApplication: application } = await gqlClient.request(deleteApplication, { id });
271477
+ return async (applicationUniqueName) => {
271478
+ const applicationToDelete = await applicationRead(gqlClient, options)(applicationUniqueName);
271479
+ const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
271480
+ id: applicationToDelete.id
271481
+ });
271367
271482
  return application;
271368
271483
  };
271369
271484
  };
271485
+ var createApplicationAccessToken = graphql(`
271486
+ mutation CreateApplicationAccessToken(
271487
+ $applicationId: ID!,
271488
+ $blockchainNetworkScope: BlockchainNetworkScopeInputType!,
271489
+ $blockchainNodeScope: BlockchainNodeScopeInputType!,
271490
+ $customDeploymentScope: CustomDeploymentScopeInputType!,
271491
+ $insightsScope: InsightsScopeInputType!,
271492
+ $integrationScope: IntegrationScopeInputType!,
271493
+ $loadBalancerScope: LoadBalancerScopeInputType!,
271494
+ $middlewareScope: MiddlewareScopeInputType!,
271495
+ $name: String!,
271496
+ $privateKeyScope: PrivateKeyScopeInputType!,
271497
+ $smartContractSetScope: SmartContractSetScopeInputType!,
271498
+ $storageScope: StorageScopeInputType!,
271499
+ $validityPeriod: AccessTokenValidityPeriod!
271500
+ ) {
271501
+ createApplicationAccessToken(
271502
+ applicationId: $applicationId,
271503
+ blockchainNetworkScope: $blockchainNetworkScope,
271504
+ blockchainNodeScope: $blockchainNodeScope,
271505
+ customDeploymentScope: $customDeploymentScope,
271506
+ insightsScope: $insightsScope,
271507
+ integrationScope: $integrationScope,
271508
+ loadBalancerScope: $loadBalancerScope,
271509
+ middlewareScope: $middlewareScope,
271510
+ name: $name,
271511
+ privateKeyScope: $privateKeyScope,
271512
+ smartContractSetScope: $smartContractSetScope,
271513
+ storageScope: $storageScope,
271514
+ validityPeriod: $validityPeriod
271515
+ ) {
271516
+ token
271517
+ }
271518
+ }
271519
+ `, []);
271520
+ var applicationAccessTokenCreate = (gqlClient, options) => {
271521
+ return async (args) => {
271522
+ const { applicationUniqueName, ...otherArgs } = args;
271523
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
271524
+ const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, {
271525
+ ...otherArgs,
271526
+ applicationId: application.id
271527
+ });
271528
+ if (!applicationAccessToken.token) {
271529
+ throw new Error("Failed to create application access token");
271530
+ }
271531
+ return applicationAccessToken.token;
271532
+ };
271533
+ };
271370
271534
  function setClusterServiceDefaults(args) {
271371
271535
  return {
271372
271536
  ...args,
@@ -271393,31 +271557,34 @@ var BlockchainNetworkFragment = graphql(`
271393
271557
  fragment BlockchainNetwork on BlockchainNetwork {
271394
271558
  __typename
271395
271559
  id
271560
+ uniqueName
271396
271561
  name
271397
271562
  status
271398
271563
  blockchainNodes {
271399
271564
  ... on BlockchainNode {
271400
271565
  id
271401
271566
  name
271567
+ uniqueName
271402
271568
  }
271403
271569
  }
271404
271570
  }
271405
271571
  `);
271406
271572
  var getBlockchainNetworks = graphql(`
271407
- query getBlockchainNetworks($id: ID!) {
271408
- blockchainNetworks(applicationId: $id) {
271409
- items {
271410
- ...BlockchainNetwork
271573
+ query getBlockchainNetworks($applicationUniqueName: String!) {
271574
+ blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {
271575
+ items {
271576
+ ...BlockchainNetwork
271577
+ }
271578
+ }
271411
271579
  }
271412
- }
271413
- }`, [BlockchainNetworkFragment]);
271580
+ `, [BlockchainNetworkFragment]);
271414
271581
  var getBlockchainNetwork = graphql(`
271415
- query getBlockchainNetwork($id: ID!) {
271416
- blockchainNetwork(entityId: $id) {
271417
- ...BlockchainNetwork
271582
+ query getBlockchainNetwork($uniqueName: String!) {
271583
+ blockchainNetworkByUniqueName(uniqueName: $uniqueName) {
271584
+ ...BlockchainNetwork
271585
+ }
271418
271586
  }
271419
- }
271420
- `, [BlockchainNetworkFragment]);
271587
+ `, [BlockchainNetworkFragment]);
271421
271588
  var createBlockchainNetwork = graphql(`
271422
271589
  mutation createBlockchainNetwork(
271423
271590
  $applicationId: ID!
@@ -271478,65 +271645,67 @@ var createBlockchainNetwork = graphql(`
271478
271645
  ...BlockchainNetwork
271479
271646
  }
271480
271647
  }
271481
- `, [BlockchainNetworkFragment]);
271648
+ `, [BlockchainNetworkFragment]);
271482
271649
  var deleteBlockchainNetwork = graphql(`
271483
- mutation deleteBlockchainNetwork($blockchainNetworkId: ID!) {
271484
- deleteBlockchainNetwork(entityId: $blockchainNetworkId) {
271650
+ mutation deleteBlockchainNetwork($uniqueName: String!) {
271651
+ deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
271485
271652
  ...BlockchainNetwork
271486
271653
  }
271487
271654
  }
271488
- `, [BlockchainNetworkFragment]);
271655
+ `, [BlockchainNetworkFragment]);
271489
271656
  var restartBlockchainNetwork = graphql(`
271490
- mutation RestartBlockchainNetwork($id: ID!) {
271491
- restartBlockchainNetwork(entityId: $id) {
271657
+ mutation RestartBlockchainNetwork($uniqueName: String!) {
271658
+ restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
271492
271659
  ...BlockchainNetwork
271493
271660
  }
271494
271661
  }
271495
- `, [BlockchainNetworkFragment]);
271662
+ `, [BlockchainNetworkFragment]);
271496
271663
  var blockchainNetworkList = (gqlClient, options) => {
271497
- return async (applicationId) => {
271498
- const id = validate3(IdSchema3, applicationId);
271664
+ return async (applicationUniqueName) => {
271499
271665
  const {
271500
- blockchainNetworks: { items }
271501
- } = await gqlClient.request(getBlockchainNetworks, { id });
271666
+ blockchainNetworksByUniqueName: { items }
271667
+ } = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });
271502
271668
  return items;
271503
271669
  };
271504
271670
  };
271505
271671
  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;
271672
+ return async (blockchainNetworkUniqueName) => {
271673
+ const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {
271674
+ uniqueName: blockchainNetworkUniqueName
271675
+ });
271676
+ return blockchainNetworkByUniqueName;
271510
271677
  };
271511
271678
  };
271512
271679
  var blockchainNetworkCreate = (gqlClient, options) => {
271513
271680
  return async (args) => {
271514
- const blockchainNetworkArgs = setNetworkDefaults(args);
271515
- validate3(IdSchema3, blockchainNetworkArgs.applicationId);
271516
- const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, blockchainNetworkArgs);
271681
+ const { applicationUniqueName, ...otherArgs } = args;
271682
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
271683
+ const blockchainNetworkArgs = setNetworkDefaults(otherArgs);
271684
+ const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {
271685
+ ...blockchainNetworkArgs,
271686
+ applicationId: application.id
271687
+ });
271517
271688
  return blockchainNetwork;
271518
271689
  };
271519
271690
  };
271520
271691
  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
271692
+ return async (blockchainNetworkUniqueName) => {
271693
+ const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(deleteBlockchainNetwork, {
271694
+ uniqueName: blockchainNetworkUniqueName
271525
271695
  });
271526
271696
  return blockchainNetwork;
271527
271697
  };
271528
271698
  };
271529
- var blockchainNetworkRestart = (gqlClient, _options) => async (networkId) => {
271530
- const id = validate3(IdSchema3, networkId);
271531
- const { restartBlockchainNetwork: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { id });
271699
+ var blockchainNetworkRestart = (gqlClient, _options) => async (blockchainNetworkUniqueName) => {
271700
+ const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
271532
271701
  return blockchainNetwork;
271533
271702
  };
271534
271703
  var BlockchainNodeFragment = graphql(`
271535
271704
  fragment BlockchainNode on BlockchainNode {
271536
271705
  __typename
271537
271706
  id
271538
- name
271539
271707
  uniqueName
271708
+ name
271540
271709
  status
271541
271710
  isEvm
271542
271711
  endpoints {
@@ -271553,6 +271722,7 @@ var BlockchainNodeFragment = graphql(`
271553
271722
  ... on AbstractClusterService {
271554
271723
  id
271555
271724
  name
271725
+ uniqueName
271556
271726
  }
271557
271727
  }
271558
271728
  privateKeys {
@@ -271566,86 +271736,96 @@ var BlockchainNodeFragment = graphql(`
271566
271736
  }
271567
271737
  `);
271568
271738
  var getBlockchainNodes = graphql(`
271569
- query getBlockchainNodes($id: ID!) {
271570
- blockchainNodes(applicationId: $id) {
271571
- items {
271572
- ...BlockchainNode
271573
- }
271574
- }
271575
- }`, [BlockchainNodeFragment]);
271739
+ query getBlockchainNodes($applicationUniqueName: String!) {
271740
+ blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {
271741
+ items {
271742
+ ...BlockchainNode
271743
+ }
271744
+ }
271745
+ }
271746
+ `, [BlockchainNodeFragment]);
271576
271747
  var getBlockchainNode = graphql(`
271577
- query getBlockchainNode($id: ID!) {
271578
- blockchainNode(entityId: $id) {
271579
- ...BlockchainNode
271580
- }
271581
- }
271582
- `, [BlockchainNodeFragment]);
271748
+ query getBlockchainNode($uniqueName: String!) {
271749
+ blockchainNodeByUniqueName(uniqueName: $uniqueName) {
271750
+ ...BlockchainNode
271751
+ }
271752
+ }
271753
+ `, [BlockchainNodeFragment]);
271583
271754
  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
271755
+ mutation createBlockchainNode(
271756
+ $applicationId: ID!
271757
+ $blockchainNetworkId: ID!
271758
+ $name: String!
271759
+ $provider: String!
271760
+ $region: String!
271761
+ $size: ClusterServiceSize
271762
+ $type: ClusterServiceType
271763
+ $nodeType: NodeType
271764
+ $keyMaterial: ID
271605
271765
  ) {
271606
- ...BlockchainNode
271607
- }
271608
- }
271609
- `, [BlockchainNodeFragment]);
271766
+ createBlockchainNode(
271767
+ applicationId: $applicationId
271768
+ blockchainNetworkId: $blockchainNetworkId
271769
+ name: $name
271770
+ provider: $provider
271771
+ region: $region
271772
+ size: $size
271773
+ type: $type
271774
+ nodeType: $nodeType
271775
+ keyMaterial: $keyMaterial
271776
+ ) {
271777
+ ...BlockchainNode
271778
+ }
271779
+ }
271780
+ `, [BlockchainNodeFragment]);
271610
271781
  var restartBlockchainNode = graphql(`
271611
- mutation RestartBlockchainNode($id: ID!) {
271612
- restartBlockchainNode(entityId: $id) {
271613
- ...BlockchainNode
271782
+ mutation RestartBlockchainNode($uniqueName: String!) {
271783
+ restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
271784
+ ...BlockchainNode
271785
+ }
271614
271786
  }
271615
- }
271616
- `, [BlockchainNodeFragment]);
271787
+ `, [BlockchainNodeFragment]);
271617
271788
  var blockchainNodeList = (gqlClient, options) => {
271618
- return async (applicationId) => {
271619
- const id = validate3(IdSchema3, applicationId);
271789
+ return async (applicationUniqueName) => {
271620
271790
  const {
271621
- blockchainNodes: { items }
271622
- } = await gqlClient.request(getBlockchainNodes, { id });
271791
+ blockchainNodesByUniqueName: { items }
271792
+ } = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });
271623
271793
  return items;
271624
271794
  };
271625
271795
  };
271626
271796
  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;
271797
+ return async (blockchainNodeUniqueName) => {
271798
+ const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {
271799
+ uniqueName: blockchainNodeUniqueName
271800
+ });
271801
+ return blockchainNodeByUniqueName;
271631
271802
  };
271632
271803
  };
271633
271804
  var blockchainNodeCreate = (gqlClient, options) => {
271634
271805
  return async (args) => {
271635
- validate3(IdSchema3, args.applicationId);
271636
- validate3(IdSchema3, args.blockchainNetworkId);
271637
- const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, args);
271806
+ const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;
271807
+ const [application, blockchainNetwork] = await Promise.all([
271808
+ applicationRead(gqlClient, options)(applicationUniqueName),
271809
+ blockchainNetworkRead(gqlClient, options)(blockchainNetworkUniqueName)
271810
+ ]);
271811
+ const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {
271812
+ ...otherArgs,
271813
+ applicationId: application.id,
271814
+ blockchainNetworkId: blockchainNetwork.id
271815
+ });
271638
271816
  return blockchainNode;
271639
271817
  };
271640
271818
  };
271641
- var blockchainNodeRestart = (gqlClient, _options) => async (nodeId) => {
271642
- const id = validate3(IdSchema3, nodeId);
271643
- const { restartBlockchainNode: blockchainNode } = await gqlClient.request(restartBlockchainNode, { id });
271819
+ var blockchainNodeRestart = (gqlClient, _options) => async (blockchainNodeUniqueName) => {
271820
+ const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {
271821
+ uniqueName: blockchainNodeUniqueName
271822
+ });
271644
271823
  return blockchainNode;
271645
271824
  };
271646
271825
  var CustomDeploymentFragment = graphql(`
271647
271826
  fragment CustomDeployment on CustomDeployment {
271648
271827
  id
271828
+ uniqueName
271649
271829
  name
271650
271830
  status
271651
271831
  endpoints {
@@ -271661,112 +271841,141 @@ var CustomDeploymentFragment = graphql(`
271661
271841
  }
271662
271842
  `);
271663
271843
  var getCustomDeployments = graphql(`
271664
- query getCustomDeployments($id: ID!) {
271665
- customDeployments(applicationId: $id) {
271666
- items {
271667
- ...CustomDeployment
271844
+ query getCustomDeployments($applicationUniqueName: String!) {
271845
+ customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {
271846
+ items {
271847
+ ...CustomDeployment
271848
+ }
271849
+ }
271668
271850
  }
271669
- }
271670
- }`, [CustomDeploymentFragment]);
271851
+ `, [CustomDeploymentFragment]);
271671
271852
  var getCustomDeployment = graphql(`
271672
- query getCustomDeployment($id: ID!) {
271673
- customDeployment(entityId: $id) {
271674
- ...CustomDeployment
271675
- }
271676
- }
271677
- `, [CustomDeploymentFragment]);
271853
+ query getCustomDeployment($uniqueName: String!) {
271854
+ customDeploymentByUniqueName(uniqueName: $uniqueName) {
271855
+ ...CustomDeployment
271856
+ }
271857
+ }
271858
+ `, [CustomDeploymentFragment]);
271678
271859
  var editCustomDeployment = graphql(`
271679
- mutation EditCustomDeployment($entityId: ID!, $imageTag: String) {
271680
- editCustomDeployment(entityId: $entityId, imageTag: $imageTag) {
271681
- ...CustomDeployment
271682
- }
271683
- }
271684
- `, [CustomDeploymentFragment]);
271860
+ mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {
271861
+ editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {
271862
+ ...CustomDeployment
271863
+ }
271864
+ }
271865
+ `, [CustomDeploymentFragment]);
271685
271866
  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]);
271867
+ mutation CreateCustomDeployment(
271868
+ $applicationId: ID!
271869
+ $name: String!
271870
+ $imageTag: String!
271871
+ $imageName: String!
271872
+ $imageRepository: String!
271873
+ $environmentVariables: JSON
271874
+ $port: Int!
271875
+ $provider: String!
271876
+ $region: String!
271877
+ ) {
271878
+ createCustomDeployment(
271879
+ applicationId: $applicationId
271880
+ name: $name
271881
+ imageTag: $imageTag
271882
+ imageName: $imageName
271883
+ imageRepository: $imageRepository
271884
+ port: $port
271885
+ environmentVariables: $environmentVariables
271886
+ provider: $provider
271887
+ region: $region
271888
+ ) {
271889
+ ...CustomDeployment
271890
+ }
271891
+ }
271892
+ `, [CustomDeploymentFragment]);
271712
271893
  var restartCustomDeployment = graphql(`
271713
- mutation RestartCustomDeployment($id: ID!) {
271714
- restartCustomDeployment(entityId: $id) {
271715
- ...CustomDeployment
271894
+ mutation RestartCustomDeployment($uniqueName: String!) {
271895
+ restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
271896
+ ...CustomDeployment
271897
+ }
271716
271898
  }
271717
- }
271718
- `, [CustomDeploymentFragment]);
271899
+ `, [CustomDeploymentFragment]);
271719
271900
  var customdeploymentList = (gqlClient, options) => {
271720
- return async (applicationId) => {
271721
- const id = validate3(IdSchema3, applicationId);
271901
+ return async (applicationUniqueName) => {
271722
271902
  const {
271723
- customDeployments: { items }
271724
- } = await gqlClient.request(getCustomDeployments, { id });
271903
+ customDeploymentsByUniqueName: { items }
271904
+ } = await gqlClient.request(getCustomDeployments, { applicationUniqueName });
271725
271905
  return items;
271726
271906
  };
271727
271907
  };
271728
271908
  var customdeploymentRead = (gqlClient, options) => {
271729
- return async (customdeploymentId) => {
271730
- const id = validate3(IdSchema3, customdeploymentId);
271731
- const { customDeployment } = await gqlClient.request(getCustomDeployment, { id });
271909
+ return async (customDeploymentUniqueName) => {
271910
+ const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {
271911
+ uniqueName: customDeploymentUniqueName
271912
+ });
271732
271913
  return customDeployment;
271733
271914
  };
271734
271915
  };
271735
271916
  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 });
271917
+ return async (customDeploymentUniqueName, imageTag) => {
271918
+ const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {
271919
+ uniqueName: customDeploymentUniqueName,
271920
+ imageTag
271921
+ });
271739
271922
  return cd;
271740
271923
  };
271741
271924
  };
271742
271925
  var customdeploymentCreate = (gqlClient, options) => {
271743
271926
  return async (args) => {
271744
- validate3(IdSchema3, args.applicationId);
271745
- const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, args);
271927
+ const { applicationUniqueName, ...otherArgs } = args;
271928
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
271929
+ const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {
271930
+ ...otherArgs,
271931
+ applicationId: application.id
271932
+ });
271746
271933
  return customDeployment;
271747
271934
  };
271748
271935
  };
271749
- var customDeploymentRestart = (gqlClient, _options) => async (deploymentId) => {
271750
- const id = validate3(IdSchema3, deploymentId);
271751
- const { restartCustomDeployment: customDeployment } = await gqlClient.request(restartCustomDeployment, { id });
271936
+ var customDeploymentRestart = (gqlClient, _options) => async (customDeploymentUniqueName) => {
271937
+ const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {
271938
+ uniqueName: customDeploymentUniqueName
271939
+ });
271752
271940
  return customDeployment;
271753
271941
  };
271754
271942
  var getFoundryEnvConfig = graphql(`
271755
- query getFoundryEnvConfig($blockchainNodeId: String!) {
271756
- foundryEnvConfig(blockchainNodeId: $blockchainNodeId)
271943
+ query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {
271944
+ foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)
271945
+ }
271946
+ `);
271947
+ var getEnv = (gqlClient, _options) => {
271948
+ return async (blockchainNodeUniqueName) => {
271949
+ const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });
271950
+ return foundryEnvConfigByUniqueName;
271951
+ };
271952
+ };
271953
+ var LoadBalancerFragment = graphql(`
271954
+ fragment LoadBalancer on LoadBalancer {
271955
+ id
271956
+ uniqueName
271757
271957
  }
271758
271958
  `);
271759
- function getEnv(gqlClient, options) {
271760
- return async (blockchainNodeId) => {
271761
- validate3(IdSchema3, blockchainNodeId);
271762
- const { foundryEnvConfig } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeId });
271763
- return foundryEnvConfig;
271959
+ var getLoadBalancer = graphql(`
271960
+ query GetLoadBalancer($uniqueName: String!) {
271961
+ loadBalancerByUniqueName(uniqueName: $uniqueName) {
271962
+ ...LoadBalancer
271963
+ }
271964
+ }
271965
+ `, [LoadBalancerFragment]);
271966
+ var loadBalancerRead = (gqlClient, options) => {
271967
+ return async (loadBalancerUniqueName) => {
271968
+ const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
271969
+ uniqueName: loadBalancerUniqueName
271970
+ });
271971
+ return loadBalancer;
271764
271972
  };
271765
- }
271973
+ };
271766
271974
  var InsightsFragment = graphql(`
271767
271975
  fragment Insights on Insights {
271768
271976
  __typename
271769
271977
  id
271978
+ uniqueName
271770
271979
  name
271771
271980
  status
271772
271981
  insightsCategory
@@ -271783,86 +271992,97 @@ var InsightsFragment = graphql(`
271783
271992
  }
271784
271993
  `);
271785
271994
  var getInsights = graphql(`
271786
- query getInsights($id: ID!) {
271787
- insightsList(applicationId: $id) {
271788
- items {
271789
- ...Insights
271995
+ query GetInsights($applicationUniqueName: String!) {
271996
+ insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {
271997
+ items {
271998
+ ...Insights
271999
+ }
272000
+ }
271790
272001
  }
271791
- }
271792
- }`, [InsightsFragment]);
272002
+ `, [InsightsFragment]);
271793
272003
  var getInsight = graphql(`
271794
- query getInsights($id: ID!) {
271795
- insights(entityId: $id) {
271796
- ...Insights
271797
- }
271798
- }
271799
- `, [InsightsFragment]);
272004
+ query GetInsight($uniqueName: String!) {
272005
+ insightsByUniqueName(uniqueName: $uniqueName) {
272006
+ ...Insights
272007
+ }
272008
+ }
272009
+ `, [InsightsFragment]);
271800
272010
  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
272011
+ mutation CreateInsights(
272012
+ $applicationId: ID!
272013
+ $name: String!
272014
+ $insightsCategory: InsightsCategory!
272015
+ $provider: String!
272016
+ $region: String!
272017
+ $size: ClusterServiceSize
272018
+ $type: ClusterServiceType
272019
+ $blockchainNode: ID
272020
+ $loadBalancer: ID
271822
272021
  ) {
271823
- ...Insights
271824
- }
271825
- }
271826
- `, [InsightsFragment]);
272022
+ createInsights(
272023
+ applicationId: $applicationId
272024
+ name: $name
272025
+ insightsCategory: $insightsCategory
272026
+ provider: $provider
272027
+ region: $region
272028
+ size: $size
272029
+ type: $type
272030
+ blockchainNode: $blockchainNode
272031
+ loadBalancer: $loadBalancer
272032
+ ) {
272033
+ ...Insights
272034
+ }
272035
+ }
272036
+ `, [InsightsFragment]);
271827
272037
  var restartInsights = graphql(`
271828
- mutation RestartInsights($id: ID!) {
271829
- restartInsights(entityId: $id) {
271830
- ...Insights
272038
+ mutation RestartInsights($uniqueName: String!) {
272039
+ restartInsightsByUniqueName(uniqueName: $uniqueName) {
272040
+ ...Insights
272041
+ }
271831
272042
  }
271832
- }
271833
- `, [InsightsFragment]);
272043
+ `, [InsightsFragment]);
271834
272044
  var insightsList = (gqlClient, options) => {
271835
- return async (applicationId) => {
271836
- const id = validate3(IdSchema3, applicationId);
272045
+ return async (applicationUniqueName) => {
271837
272046
  const {
271838
- insightsList: { items }
271839
- } = await gqlClient.request(getInsights, { id });
272047
+ insightsListByUniqueName: { items }
272048
+ } = await gqlClient.request(getInsights, { applicationUniqueName });
271840
272049
  return items;
271841
272050
  };
271842
272051
  };
271843
272052
  var insightsRead = (gqlClient, options) => {
271844
- return async (insightsId) => {
271845
- const id = validate3(IdSchema3, insightsId);
271846
- const { insights } = await gqlClient.request(getInsight, { id });
272053
+ return async (insightsUniqueName) => {
272054
+ const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });
271847
272055
  return insights;
271848
272056
  };
271849
272057
  };
271850
272058
  var insightsCreate = (gqlClient, options) => {
271851
272059
  return async (args) => {
271852
- validate3(IdSchema3, args.applicationId);
271853
- const { createInsights: insights } = await gqlClient.request(createInsights, args);
272060
+ const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;
272061
+ const [application, blockchainNode, loadBalancer] = await Promise.all([
272062
+ applicationRead(gqlClient, options)(applicationUniqueName),
272063
+ blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
272064
+ loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined)
272065
+ ]);
272066
+ const { createInsights: insights } = await gqlClient.request(createInsights, {
272067
+ ...otherArgs,
272068
+ applicationId: application.id,
272069
+ blockchainNode: blockchainNode?.id,
272070
+ loadBalancer: loadBalancer?.id
272071
+ });
271854
272072
  return insights;
271855
272073
  };
271856
272074
  };
271857
- var insightsRestart = (gqlClient, _options) => async (insightsId) => {
271858
- const id = validate3(IdSchema3, insightsId);
271859
- const { restartInsights: insights } = await gqlClient.request(restartInsights, { id });
272075
+ var insightsRestart = (gqlClient, _options) => async (insightsUniqueName) => {
272076
+ const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {
272077
+ uniqueName: insightsUniqueName
272078
+ });
271860
272079
  return insights;
271861
272080
  };
271862
272081
  var IntegrationFragment = graphql(`
271863
272082
  fragment Integration on Integration {
271864
272083
  __typename
271865
272084
  id
272085
+ uniqueName
271866
272086
  name
271867
272087
  status
271868
272088
  integrationType
@@ -271879,82 +272099,184 @@ var IntegrationFragment = graphql(`
271879
272099
  }
271880
272100
  `);
271881
272101
  var getIntegrations = graphql(`
271882
- query getIntegrations($id: ID!) {
271883
- integrations(applicationId: $id) {
271884
- items {
271885
- ...Integration
272102
+ query GetIntegrations($applicationUniqueName: String!) {
272103
+ integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {
272104
+ items {
272105
+ ...Integration
272106
+ }
272107
+ }
271886
272108
  }
271887
- }
271888
- }`, [IntegrationFragment]);
272109
+ `, [IntegrationFragment]);
271889
272110
  var getIntegration = graphql(`
271890
- query getIntegration($id: ID!) {
271891
- integration(entityId: $id) {
271892
- ...Integration
271893
- }
271894
- }
271895
- `, [IntegrationFragment]);
272111
+ query GetIntegration($uniqueName: String!) {
272112
+ integrationByUniqueName(uniqueName: $uniqueName) {
272113
+ ...Integration
272114
+ }
272115
+ }
272116
+ `, [IntegrationFragment]);
271896
272117
  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
272118
+ mutation CreateIntegration(
272119
+ $applicationId: ID!
272120
+ $name: String!
272121
+ $integrationType: IntegrationType!
272122
+ $provider: String!
272123
+ $region: String!
272124
+ $size: ClusterServiceSize
272125
+ $type: ClusterServiceType
271914
272126
  ) {
271915
- ...Integration
271916
- }
271917
- }
271918
- `, [IntegrationFragment]);
272127
+ createIntegration(
272128
+ applicationId: $applicationId
272129
+ name: $name
272130
+ integrationType: $integrationType
272131
+ provider: $provider
272132
+ region: $region
272133
+ size: $size
272134
+ type: $type
272135
+ ) {
272136
+ ...Integration
272137
+ }
272138
+ }
272139
+ `, [IntegrationFragment]);
271919
272140
  var restartIntegrationTool = graphql(`
271920
- mutation RestartIntegrationTool($id: ID!) {
271921
- restartIntegration(entityId: $id) {
271922
- ...Integration
272141
+ mutation RestartIntegrationTool($uniqueName: String!) {
272142
+ restartIntegrationByUniqueName(uniqueName: $uniqueName) {
272143
+ ...Integration
272144
+ }
271923
272145
  }
271924
- }
271925
- `, [IntegrationFragment]);
272146
+ `, [IntegrationFragment]);
271926
272147
  var integrationToolList = (gqlClient, options) => {
271927
- return async (applicationId) => {
271928
- const id = validate3(IdSchema3, applicationId);
272148
+ return async (applicationUniqueName) => {
271929
272149
  const {
271930
- integrations: { items }
271931
- } = await gqlClient.request(getIntegrations, { id });
272150
+ integrationsByUniqueName: { items }
272151
+ } = await gqlClient.request(getIntegrations, { applicationUniqueName });
271932
272152
  return items;
271933
272153
  };
271934
272154
  };
271935
272155
  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;
272156
+ return async (integrationUniqueName) => {
272157
+ const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });
272158
+ return integrationByUniqueName;
271940
272159
  };
271941
272160
  };
271942
272161
  var integrationToolCreate = (gqlClient, options) => {
271943
272162
  return async (args) => {
271944
- validate3(IdSchema3, args.applicationId);
271945
- const { createIntegration: integration } = await gqlClient.request(createIntegration, args);
272163
+ const { applicationUniqueName, ...otherArgs } = args;
272164
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
272165
+ const { createIntegration: integration } = await gqlClient.request(createIntegration, {
272166
+ ...otherArgs,
272167
+ applicationId: application.id
272168
+ });
271946
272169
  return integration;
271947
272170
  };
271948
272171
  };
271949
- var integrationToolRestart = (gqlClient, _options) => async (toolId) => {
271950
- const id = validate3(IdSchema3, toolId);
271951
- const { restartIntegration: integration } = await gqlClient.request(restartIntegrationTool, { id });
272172
+ var integrationToolRestart = (gqlClient, _options) => async (integrationUniqueName) => {
272173
+ const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {
272174
+ uniqueName: integrationUniqueName
272175
+ });
271952
272176
  return integration;
271953
272177
  };
272178
+ var StorageFragment = graphql(`
272179
+ fragment Storage on Storage {
272180
+ __typename
272181
+ id
272182
+ uniqueName
272183
+ name
272184
+ status
272185
+ storageProtocol
272186
+ endpoints {
272187
+ id
272188
+ label
272189
+ displayValue
272190
+ }
272191
+ credentials {
272192
+ id
272193
+ label
272194
+ displayValue
272195
+ }
272196
+ }
272197
+ `);
272198
+ var getStorages = graphql(`
272199
+ query GetStorages($applicationUniqueName: String!) {
272200
+ storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {
272201
+ items {
272202
+ ...Storage
272203
+ }
272204
+ }
272205
+ }
272206
+ `, [StorageFragment]);
272207
+ var getStorage = graphql(`
272208
+ query GetStorage($uniqueName: String!) {
272209
+ storageByUniqueName(uniqueName: $uniqueName) {
272210
+ ...Storage
272211
+ }
272212
+ }
272213
+ `, [StorageFragment]);
272214
+ var createStorage = graphql(`
272215
+ mutation CreateStorage(
272216
+ $applicationId: ID!
272217
+ $name: String!
272218
+ $storageProtocol: StorageProtocol!
272219
+ $provider: String!
272220
+ $region: String!
272221
+ $size: ClusterServiceSize
272222
+ $type: ClusterServiceType
272223
+ ) {
272224
+ createStorage(
272225
+ applicationId: $applicationId
272226
+ name: $name
272227
+ storageProtocol: $storageProtocol
272228
+ provider: $provider
272229
+ region: $region
272230
+ size: $size
272231
+ type: $type
272232
+ ) {
272233
+ ...Storage
272234
+ }
272235
+ }
272236
+ `, [StorageFragment]);
272237
+ var restartStorage = graphql(`
272238
+ mutation RestartStorage($uniqueName: String!) {
272239
+ restartStorageByUniqueName(uniqueName: $uniqueName) {
272240
+ ...Storage
272241
+ }
272242
+ }
272243
+ `, [StorageFragment]);
272244
+ var storageList = (gqlClient, options) => {
272245
+ return async (applicationUniqueName) => {
272246
+ const {
272247
+ storagesByUniqueName: { items }
272248
+ } = await gqlClient.request(getStorages, { applicationUniqueName });
272249
+ return items;
272250
+ };
272251
+ };
272252
+ var storageRead = (gqlClient, options) => {
272253
+ return async (storageUniqueName) => {
272254
+ const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });
272255
+ return storage;
272256
+ };
272257
+ };
272258
+ var storageCreate = (gqlClient, options) => {
272259
+ return async (args) => {
272260
+ const { applicationUniqueName, ...otherArgs } = args;
272261
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
272262
+ const { createStorage: storage } = await gqlClient.request(createStorage, {
272263
+ ...otherArgs,
272264
+ applicationId: application.id
272265
+ });
272266
+ return storage;
272267
+ };
272268
+ };
272269
+ var storageRestart = (gqlClient, _options) => async (storageUniqueName) => {
272270
+ const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {
272271
+ uniqueName: storageUniqueName
272272
+ });
272273
+ return storage;
272274
+ };
271954
272275
  var MiddlewareFragment = graphql(`
271955
272276
  fragment Middleware on Middleware {
271956
272277
  __typename
271957
272278
  id
272279
+ uniqueName
271958
272280
  name
271959
272281
  status
271960
272282
  interface
@@ -271983,488 +272305,195 @@ var MiddlewareFragment = graphql(`
271983
272305
  }
271984
272306
  `);
271985
272307
  var getMiddlewares = graphql(`
271986
- query getMiddlewares($id: ID!, $noCache: Boolean = false) {
271987
- middlewares(applicationId: $id) {
271988
- items {
271989
- ...Middleware
272308
+ query GetMiddlewares($applicationUniqueName: String!, $noCache: Boolean = false) {
272309
+ middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {
272310
+ items {
272311
+ ...Middleware
272312
+ }
272313
+ }
271990
272314
  }
271991
- }
271992
- }`, [MiddlewareFragment]);
272315
+ `, [MiddlewareFragment]);
271993
272316
  var getMiddleware = graphql(`
271994
- query getMiddleware($id: ID!, $noCache: Boolean = true) {
271995
- middleware(entityId: $id) {
271996
- ...Middleware
271997
- }
271998
- }
271999
- `, [MiddlewareFragment]);
272317
+ query GetMiddleware($uniqueName: String!, $noCache: Boolean = true) {
272318
+ middlewareByUniqueName(uniqueName: $uniqueName) {
272319
+ ...Middleware
272320
+ }
272321
+ }
272322
+ `, [MiddlewareFragment]);
272000
272323
  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
272324
+ mutation CreateMiddleware(
272325
+ $applicationId: ID!
272326
+ $name: String!
272327
+ $provider: String!
272328
+ $region: String!
272329
+ $size: ClusterServiceSize
272330
+ $type: ClusterServiceType
272331
+ $interface: MiddlewareType!
272332
+ $storageId: ID
272333
+ $blockchainNodeId: ID
272334
+ $loadBalancerId: ID
272335
+ $abis: [SmartContractPortalMiddlewareAbiInputDto!]
272336
+ $includePredeployedAbis: [String!]
272337
+ $noCache: Boolean = false
272031
272338
  ) {
272032
- ...Middleware
272033
- }
272034
- }
272035
- `, [MiddlewareFragment]);
272339
+ createMiddleware(
272340
+ applicationId: $applicationId
272341
+ name: $name
272342
+ provider: $provider
272343
+ region: $region
272344
+ size: $size
272345
+ type: $type
272346
+ interface: $interface
272347
+ storageId: $storageId
272348
+ blockchainNodeId: $blockchainNodeId
272349
+ loadBalancerId: $loadBalancerId
272350
+ abis: $abis
272351
+ includePredeployedAbis: $includePredeployedAbis
272352
+ ) {
272353
+ ...Middleware
272354
+ }
272355
+ }
272356
+ `, [MiddlewareFragment]);
272036
272357
  var restartMiddleware = graphql(`
272037
- mutation RestartMiddleware($id: ID!, $noCache: Boolean = false) {
272038
- restartMiddleware(entityId: $id) {
272039
- ...Middleware
272358
+ mutation RestartMiddleware($uniqueName: String!, $noCache: Boolean = false) {
272359
+ restartMiddlewareByUniqueName(uniqueName: $uniqueName) {
272360
+ ...Middleware
272361
+ }
272040
272362
  }
272041
- }
272042
- `, [MiddlewareFragment]);
272363
+ `, [MiddlewareFragment]);
272043
272364
  var middlewareList = (gqlClient, options) => {
272044
- return async (applicationId) => {
272045
- const id = validate3(IdSchema3, applicationId);
272365
+ return async (applicationUniqueName) => {
272046
272366
  const {
272047
- middlewares: { items }
272048
- } = await gqlClient.request(getMiddlewares, { id });
272367
+ middlewaresByUniqueName: { items }
272368
+ } = await gqlClient.request(getMiddlewares, { applicationUniqueName });
272049
272369
  return items;
272050
272370
  };
272051
272371
  };
272052
272372
  var middlewareRead = (gqlClient, options) => {
272053
- return async (middlewareId) => {
272054
- const id = validate3(IdSchema3, middlewareId);
272055
- const { middleware } = await gqlClient.request(getMiddleware, { id });
272373
+ return async (middlewareUniqueName) => {
272374
+ const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {
272375
+ uniqueName: middlewareUniqueName
272376
+ });
272056
272377
  return middleware;
272057
272378
  };
272058
272379
  };
272059
272380
  var middlewareCreate = (gqlClient, options) => {
272060
272381
  return async (args) => {
272061
- validate3(IdSchema3, args.applicationId);
272062
- const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, args);
272382
+ const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } = args;
272383
+ const [application, blockchainNode, loadBalancer, storage] = await Promise.all([
272384
+ applicationRead(gqlClient, options)(applicationUniqueName),
272385
+ blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
272386
+ loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined),
272387
+ storageUniqueName ? storageRead(gqlClient, options)(storageUniqueName) : Promise.resolve(undefined)
272388
+ ]);
272389
+ const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {
272390
+ ...otherArgs,
272391
+ applicationId: application.id,
272392
+ blockchainNodeId: blockchainNode?.id,
272393
+ loadBalancerId: loadBalancer?.id,
272394
+ storageId: storage?.id
272395
+ });
272063
272396
  return middleware;
272064
272397
  };
272065
272398
  };
272066
- var middlewareRestart = (gqlClient, _options) => async (middlewareId) => {
272067
- const id = validate3(IdSchema3, middlewareId);
272068
- const { restartMiddleware: middleware } = await gqlClient.request(restartMiddleware, { id });
272399
+ var middlewareRestart = (gqlClient, _options) => async (middlewareUniqueName) => {
272400
+ const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {
272401
+ uniqueName: middlewareUniqueName
272402
+ });
272069
272403
  return middleware;
272070
272404
  };
272071
272405
  var PrivateKeyFragment = graphql(`
272072
272406
  fragment PrivateKey on PrivateKey {
272073
272407
  __typename
272074
272408
  id
272075
- name
272076
272409
  uniqueName
272410
+ name
272077
272411
  privateKeyType
272078
272412
  status
272079
272413
  }
272080
272414
  `);
272081
272415
  var getPrivateKeys = graphql(`
272082
- query getPrivateKeys($id: ID!) {
272083
- privateKeys(applicationId: $id) {
272084
- items {
272085
- ...PrivateKey
272416
+ query GetPrivateKeys($applicationUniqueName: String!) {
272417
+ privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {
272418
+ items {
272419
+ ...PrivateKey
272420
+ }
272421
+ }
272086
272422
  }
272087
- }
272088
- }`, [PrivateKeyFragment]);
272423
+ `, [PrivateKeyFragment]);
272089
272424
  var getPrivateKey = graphql(`
272090
- query getPrivateKey($id: ID!) {
272091
- privateKey(entityId: $id) {
272092
- ...PrivateKey
272093
- }
272094
- }
272095
- `, [PrivateKeyFragment]);
272425
+ query GetPrivateKey($uniqueName: String!) {
272426
+ privateKeyByUniqueName(uniqueName: $uniqueName) {
272427
+ ...PrivateKey
272428
+ }
272429
+ }
272430
+ `, [PrivateKeyFragment]);
272096
272431
  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
272432
+ mutation CreatePrivateKey(
272433
+ $applicationId: ID!
272434
+ $name: String!
272435
+ $privateKeyType: PrivateKeyType!
272436
+ $provider: String!
272437
+ $region: String!
272438
+ $size: ClusterServiceSize
272439
+ $type: ClusterServiceType
272440
+ $blockchainNodes: [ID!]
272116
272441
  ) {
272117
- ...PrivateKey
272118
- }
272119
- }
272120
- `, [PrivateKeyFragment]);
272442
+ createPrivateKey(
272443
+ applicationId: $applicationId
272444
+ name: $name
272445
+ privateKeyType: $privateKeyType
272446
+ provider: $provider
272447
+ region: $region
272448
+ size: $size
272449
+ type: $type
272450
+ blockchainNodes: $blockchainNodes
272451
+ ) {
272452
+ ...PrivateKey
272453
+ }
272454
+ }
272455
+ `, [PrivateKeyFragment]);
272121
272456
  var restartPrivateKey = graphql(`
272122
- mutation RestartPrivateKey($id: ID!) {
272123
- restartPrivateKey(entityId: $id) {
272124
- ...PrivateKey
272457
+ mutation RestartPrivateKey($uniqueName: String!) {
272458
+ restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {
272459
+ ...PrivateKey
272460
+ }
272125
272461
  }
272126
- }
272127
- `, [PrivateKeyFragment]);
272462
+ `, [PrivateKeyFragment]);
272128
272463
  var privateKeyList = (gqlClient, options) => {
272129
- return async (applicationId) => {
272130
- const id = validate3(IdSchema3, applicationId);
272464
+ return async (applicationUniqueName) => {
272131
272465
  const {
272132
- privateKeys: { items }
272133
- } = await gqlClient.request(getPrivateKeys, { id });
272466
+ privateKeysByUniqueName: { items }
272467
+ } = await gqlClient.request(getPrivateKeys, { applicationUniqueName });
272134
272468
  return items;
272135
272469
  };
272136
272470
  };
272137
272471
  var privatekeyRead = (gqlClient, options) => {
272138
- return async (privatekeyId) => {
272139
- const id = validate3(IdSchema3, privatekeyId);
272140
- const { privateKey } = await gqlClient.request(getPrivateKey, { id });
272472
+ return async (privateKeyUniqueName) => {
272473
+ const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {
272474
+ uniqueName: privateKeyUniqueName
272475
+ });
272141
272476
  return privateKey;
272142
272477
  };
272143
272478
  };
272144
272479
  var privateKeyCreate = (gqlClient, options) => {
272145
272480
  return async (args) => {
272146
- validate3(IdSchema3, args.applicationId);
272147
- const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, args);
272481
+ const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
272482
+ const application = await applicationRead(gqlClient, options)(applicationUniqueName);
272483
+ const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient, options)(uniqueName))) : [];
272484
+ const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {
272485
+ ...otherArgs,
272486
+ applicationId: application.id,
272487
+ blockchainNodes: blockchainNodes.map((node) => node?.id)
272488
+ });
272148
272489
  return privateKey;
272149
272490
  };
272150
272491
  };
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
272492
+ var privateKeyRestart = (gqlClient, _options) => async (privateKeyUniqueName) => {
272493
+ const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {
272494
+ uniqueName: privateKeyUniqueName
272250
272495
  });
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
- };
272496
+ return privateKey;
272468
272497
  };
272469
272498
  var ClientOptionsSchema = z3.object({
272470
272499
  accessToken: AccessTokenSchema3,
@@ -272567,12 +272596,6 @@ function createSettleMintClient(options) {
272567
272596
  update: customdeploymentUpdate(gqlClient, options),
272568
272597
  restart: customDeploymentRestart(gqlClient, options)
272569
272598
  },
272570
- smartContractSet: {
272571
- list: smartContractSetList(gqlClient, options),
272572
- read: smartContractSetRead(gqlClient, options),
272573
- create: smartContractSetCreate(gqlClient, options),
272574
- restart: smartContractSetRestart(gqlClient, options)
272575
- },
272576
272599
  foundry: {
272577
272600
  env: getEnv(gqlClient, options)
272578
272601
  },
@@ -272777,7 +272800,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
272777
272800
  }
272778
272801
  });
272779
272802
  const aat = await settlemint.applicationAccessToken.create({
272780
- applicationId: application.id,
272803
+ applicationUniqueName: application.uniqueName,
272781
272804
  name: name2,
272782
272805
  blockchainNetworkScope: {
272783
272806
  type: "ALL",
@@ -272842,7 +272865,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
272842
272865
 
272843
272866
  // src/commands/connect/application.prompt.ts
272844
272867
  async function applicationPrompt(env2, applications, accept) {
272845
- const defaultApplication = applications.find((application2) => application2.id === env2.SETTLEMINT_APPLICATION);
272868
+ const defaultApplication = applications.find((application2) => application2.uniqueName === env2.SETTLEMINT_APPLICATION);
272846
272869
  const defaultPossible = accept && defaultApplication;
272847
272870
  if (defaultPossible) {
272848
272871
  return defaultApplication;
@@ -272869,7 +272892,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
272869
272892
  if (nodes.length === 0) {
272870
272893
  return;
272871
272894
  }
272872
- const defaultNode = nodes.find((node2) => node2.id === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
272895
+ const defaultNode = nodes.find((node2) => node2.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
272873
272896
  const defaultPossible = accept;
272874
272897
  if (defaultPossible) {
272875
272898
  return defaultNode;
@@ -272897,7 +272920,7 @@ async function blockscoutPrompt(env2, insights, accept) {
272897
272920
  if (possible.length === 0) {
272898
272921
  return;
272899
272922
  }
272900
- const defaultBlockscout = insights.find((insight) => insight.id === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
272923
+ const defaultBlockscout = insights.find((insight) => insight.uniqueName === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
272901
272924
  const defaultPossible = accept;
272902
272925
  if (defaultPossible) {
272903
272926
  return defaultBlockscout;
@@ -272924,7 +272947,7 @@ async function customDeploymentPrompt(env2, customDeployments, accept) {
272924
272947
  if (customDeployments.length === 0) {
272925
272948
  return;
272926
272949
  }
272927
- const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.id === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
272950
+ const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.uniqueName === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
272928
272951
  const defaultPossible = accept;
272929
272952
  if (defaultPossible) {
272930
272953
  return defaultCustomDeployment;
@@ -272952,7 +272975,7 @@ async function hasuraPrompt(env2, integrations, accept) {
272952
272975
  if (possible.length === 0) {
272953
272976
  return;
272954
272977
  }
272955
- const defaultIntegration = possible.find((integration) => integration.id === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
272978
+ const defaultIntegration = possible.find((integration) => integration.uniqueName === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
272956
272979
  const defaultPossible = accept;
272957
272980
  if (defaultPossible) {
272958
272981
  return defaultIntegration;
@@ -273031,7 +273054,7 @@ async function ipfsPrompt(env2, storages, accept) {
273031
273054
  if (possible.length === 0) {
273032
273055
  return;
273033
273056
  }
273034
- const defaultStorage = possible.find((storage) => storage.id === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
273057
+ const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
273035
273058
  const defaultPossible = accept;
273036
273059
  if (defaultPossible) {
273037
273060
  return defaultStorage;
@@ -273059,7 +273082,7 @@ async function minioPrompt(env2, storages, accept) {
273059
273082
  if (possible.length === 0) {
273060
273083
  return;
273061
273084
  }
273062
- const defaultStorage = possible.find((storage) => storage.id === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
273085
+ const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
273063
273086
  const defaultPossible = accept;
273064
273087
  if (defaultPossible) {
273065
273088
  return defaultStorage;
@@ -273087,7 +273110,7 @@ async function portalPrompt(env2, middlewares, accept) {
273087
273110
  if (possible.length === 0) {
273088
273111
  return;
273089
273112
  }
273090
- const defaultMiddleware = possible.find((middleware2) => middleware2.id === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
273113
+ const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
273091
273114
  const defaultPossible = accept;
273092
273115
  if (defaultPossible) {
273093
273116
  return defaultMiddleware;
@@ -273154,7 +273177,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
273154
273177
  if (possible.length === 0) {
273155
273178
  return;
273156
273179
  }
273157
- const defaultMiddleware = possible.find((middleware2) => middleware2.id === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
273180
+ const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
273158
273181
  const defaultPossible = accept;
273159
273182
  if (defaultPossible) {
273160
273183
  return defaultMiddleware;
@@ -273178,7 +273201,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
273178
273201
 
273179
273202
  // src/commands/connect/workspace.prompt.ts
273180
273203
  async function workspacePrompt(env2, workspaces, accept) {
273181
- const defaultWorkspace = workspaces.find((workspace2) => workspace2.id === env2.SETTLEMINT_WORKSPACE);
273204
+ const defaultWorkspace = workspaces.find((workspace2) => workspace2.uniqueName === env2.SETTLEMINT_WORKSPACE);
273182
273205
  const defaultPossible = accept && defaultWorkspace;
273183
273206
  if (defaultPossible) {
273184
273207
  return defaultWorkspace;
@@ -273233,23 +273256,23 @@ function connectCommand() {
273233
273256
  await writeEnvSpinner(!!prod, {
273234
273257
  SETTLEMINT_ACCESS_TOKEN: aatToken,
273235
273258
  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,
273259
+ SETTLEMINT_WORKSPACE: workspace.uniqueName,
273260
+ SETTLEMINT_APPLICATION: application.uniqueName,
273261
+ SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
273262
+ SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
273263
+ SETTLEMINT_HASURA: hasura?.uniqueName,
273241
273264
  ...getHasuraEndpoints(hasura),
273242
- SETTLEMINT_THEGRAPH: thegraph?.id,
273265
+ SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
273243
273266
  ...await getGraphEndpoint(thegraph, env2),
273244
273267
  ...getPortalEndpoints(portal),
273245
273268
  SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
273246
- SETTLEMINT_MINIO: minio?.id,
273269
+ SETTLEMINT_MINIO: minio?.uniqueName,
273247
273270
  ...getMinioEndpoints(minio),
273248
- SETTLEMINT_IPFS: ipfs?.id,
273271
+ SETTLEMINT_IPFS: ipfs?.uniqueName,
273249
273272
  ...getIpfsEndpoints(ipfs),
273250
- SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.id,
273273
+ SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
273251
273274
  SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
273252
- SETTLEMINT_BLOCKSCOUT: blockscout?.id,
273275
+ SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
273253
273276
  ...getBlockscoutEndpoints(blockscout)
273254
273277
  });
273255
273278
  outro("Connected to SettleMint");
@@ -273259,7 +273282,7 @@ function connectCommand() {
273259
273282
  var package_default = {
273260
273283
  name: "@settlemint/sdk-cli",
273261
273284
  description: "SettleMint SDK, integrate SettleMint into your application with ease.",
273262
- version: "0.7.4-pr906d1dd",
273285
+ version: "0.7.4-pr9660ede",
273263
273286
  type: "module",
273264
273287
  private: false,
273265
273288
  license: "FSL-1.1-MIT",
@@ -273310,8 +273333,8 @@ var package_default = {
273310
273333
  "@inquirer/input": "4.1.1",
273311
273334
  "@inquirer/password": "4.0.4",
273312
273335
  "@inquirer/select": "4.0.4",
273313
- "@settlemint/sdk-js": "0.7.4-pr906d1dd",
273314
- "@settlemint/sdk-utils": "0.7.4-pr906d1dd",
273336
+ "@settlemint/sdk-js": "0.7.4-pr9660ede",
273337
+ "@settlemint/sdk-utils": "0.7.4-pr9660ede",
273315
273338
  "get-tsconfig": "4.8.1",
273316
273339
  giget: "1.2.3"
273317
273340
  },
@@ -274308,7 +274331,6 @@ var SETTLEMINT_CLIENT_MAP = {
274308
274331
  "blockchain node": "blockchainNode",
274309
274332
  "custom deployment": "customDeployment",
274310
274333
  "private key": "privateKey",
274311
- "smart contract set": "smartContractSet",
274312
274334
  middleware: "middleware",
274313
274335
  "integration tool": "integrationTool",
274314
274336
  storage: "storage",
@@ -274320,7 +274342,7 @@ var SETTLEMINT_CLIENT_MAP = {
274320
274342
  async function waitForCompletion({
274321
274343
  settlemint,
274322
274344
  type: type4,
274323
- id,
274345
+ uniqueName,
274324
274346
  action,
274325
274347
  maxTimeout = 15 * 60 * 1000
274326
274348
  }) {
@@ -274339,7 +274361,7 @@ async function waitForCompletion({
274339
274361
  const startTime = Date.now();
274340
274362
  while (true) {
274341
274363
  try {
274342
- const resource = await service.read(id);
274364
+ const resource = await service.read(uniqueName);
274343
274365
  if (resource.status === "COMPLETED") {
274344
274366
  note(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
274345
274367
  return true;
@@ -274353,7 +274375,7 @@ async function waitForCompletion({
274353
274375
  note(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
274354
274376
  }
274355
274377
  if (Date.now() - startTime > maxTimeout) {
274356
- throw new Error(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with id ${id}`);
274378
+ throw new Error(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
274357
274379
  }
274358
274380
  await new Promise((resolve6) => setTimeout(resolve6, 5000));
274359
274381
  }
@@ -274432,7 +274454,7 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
274432
274454
  await waitForCompletion({
274433
274455
  settlemint,
274434
274456
  type: waitFor?.resourceType ?? type4,
274435
- id: waitFor?.id ?? result.id,
274457
+ uniqueName: waitFor?.uniqueName ?? result.uniqueName,
274436
274458
  action: "deploy"
274437
274459
  });
274438
274460
  if (waitFor) {
@@ -274452,10 +274474,10 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
274452
274474
  ...updatedEnv
274453
274475
  };
274454
274476
  if (isApplicationChanged && updatedEnv.SETTLEMINT_APPLICATION) {
274455
- newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.id;
274477
+ newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.uniqueName;
274456
274478
  }
274457
274479
  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;
274480
+ newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.uniqueName;
274459
274481
  }
274460
274482
  await writeEnvSpinner(!!prod, newEnv);
274461
274483
  note(`${capitalizeFirstLetter(type4)} ${result.name} set as default`);
@@ -274472,8 +274494,8 @@ function blockchainNetworkBesuCreateCommand() {
274472
274494
  type: "blockchain network",
274473
274495
  alias: "b",
274474
274496
  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,
274497
+ addClusterServiceArgs(cmd2).option("-a, --application <uniqueName>", "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, {
274498
+ application,
274477
274499
  chainId,
274478
274500
  contractSizeLimit,
274479
274501
  evmStackSize,
@@ -274488,10 +274510,10 @@ function blockchainNetworkBesuCreateCommand() {
274488
274510
  ...defaultArgs
274489
274511
  }) => {
274490
274512
  return baseAction(defaultArgs, async (settlemint, env2) => {
274491
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
274513
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274492
274514
  const result = await settlemint.blockchainNetwork.create({
274493
274515
  name: name2,
274494
- applicationId: application,
274516
+ applicationUniqueName,
274495
274517
  nodeName,
274496
274518
  consensusAlgorithm: "BESU_QBFT",
274497
274519
  chainId,
@@ -274515,8 +274537,8 @@ function blockchainNetworkBesuCreateCommand() {
274515
274537
  mapDefaultEnv: () => {
274516
274538
  return {
274517
274539
  SETTLEMINT_APPLICATION: application,
274518
- SETTLEMINT_BLOCKCHAIN_NETWORK: result.id,
274519
- SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.id
274540
+ SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
274541
+ SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName
274520
274542
  };
274521
274543
  }
274522
274544
  };
@@ -274530,7 +274552,7 @@ function blockchainNetworkBesuCreateCommand() {
274530
274552
  },
274531
274553
  {
274532
274554
  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"
274555
+ 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
274556
  }
274535
274557
  ]
274536
274558
  });
@@ -274661,7 +274683,7 @@ function workspaceCreateCommand() {
274661
274683
  result,
274662
274684
  mapDefaultEnv: () => {
274663
274685
  return {
274664
- SETTLEMINT_WORKSPACE: result.id
274686
+ SETTLEMINT_WORKSPACE: result.uniqueName
274665
274687
  };
274666
274688
  }
274667
274689
  };
@@ -274692,10 +274714,11 @@ function applicationAccessTokenCreateCommand() {
274692
274714
  type: "application access token",
274693
274715
  alias: "aat",
274694
274716
  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 }) => {
274717
+ 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
274718
  return baseAction(defaultArgs, async (settlemint, env2) => {
274719
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274697
274720
  const aatToken = await settlemint.applicationAccessToken.create({
274698
- applicationId: applicationId ?? env2.SETTLEMINT_APPLICATION,
274721
+ applicationUniqueName,
274699
274722
  name: name2,
274700
274723
  blockchainNetworkScope: {
274701
274724
  type: "ALL",
@@ -274742,7 +274765,8 @@ function applicationAccessTokenCreateCommand() {
274742
274765
  return {
274743
274766
  result: {
274744
274767
  id: "",
274745
- name: name2
274768
+ name: name2,
274769
+ uniqueName: ""
274746
274770
  },
274747
274771
  mapDefaultEnv: () => ({
274748
274772
  SETTLEMINT_ACCESS_TOKEN: aatToken
@@ -274775,18 +274799,17 @@ function applicationCreateCommand() {
274775
274799
  type: "application",
274776
274800
  alias: "a",
274777
274801
  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 }) => {
274802
+ 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
274803
  return baseAction(defaultArgs, async (settlemint, env2) => {
274780
- const workspace = workspaceId ?? env2.SETTLEMINT_WORKSPACE;
274781
274804
  const result = await settlemint.application.create({
274782
274805
  name: name2,
274783
- workspaceId: workspace
274806
+ workspaceUniqueName: workspace ?? env2.SETTLEMINT_WORKSPACE
274784
274807
  });
274785
274808
  return {
274786
274809
  result,
274787
274810
  mapDefaultEnv: () => {
274788
274811
  return {
274789
- SETTLEMINT_APPLICATION: result.id
274812
+ SETTLEMINT_APPLICATION: result.uniqueName
274790
274813
  };
274791
274814
  }
274792
274815
  };
@@ -274804,7 +274827,7 @@ function applicationCreateCommand() {
274804
274827
  },
274805
274828
  {
274806
274829
  description: "Create an application in a specific workspace",
274807
- command: "platform create application my-app --workspace-id 123456789"
274830
+ command: "platform create application my-app --workspace my-workspace"
274808
274831
  }
274809
274832
  ]
274810
274833
  });
@@ -274922,28 +274945,28 @@ function blockscoutInsightsCreateCommand() {
274922
274945
  type: "insights",
274923
274946
  alias: "bs",
274924
274947
  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 }) => {
274948
+ 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
274949
  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);
274950
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274951
+ const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
274952
+ const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
274930
274953
  const result = await settlemint.insights.create({
274931
274954
  name: name2,
274932
- applicationId: application,
274955
+ applicationUniqueName,
274933
274956
  insightsCategory: "BLOCKCHAIN_EXPLORER",
274934
274957
  provider,
274935
274958
  region,
274936
274959
  size,
274937
274960
  type: type4,
274938
- blockchainNode,
274939
- loadBalancer
274961
+ blockchainNodeUniqueName,
274962
+ loadBalancerUniqueName
274940
274963
  });
274941
274964
  return {
274942
274965
  result,
274943
274966
  mapDefaultEnv: async () => {
274944
274967
  return {
274945
274968
  SETTLEMINT_APPLICATION: application,
274946
- SETTLEMINT_BLOCKSCOUT: result.id,
274969
+ SETTLEMINT_BLOCKSCOUT: result.uniqueName,
274947
274970
  ...getBlockscoutEndpoints(result)
274948
274971
  };
274949
274972
  }
@@ -274958,7 +274981,7 @@ function blockscoutInsightsCreateCommand() {
274958
274981
  },
274959
274982
  {
274960
274983
  description: "Create a Blockscout insights service in a different application",
274961
- command: "platform create insights blockscout my-blockscout --application-id 123456789"
274984
+ command: "platform create insights blockscout my-blockscout --application app-123"
274962
274985
  }
274963
274986
  ]
274964
274987
  });
@@ -274978,12 +275001,12 @@ function hasuraIntegrationCreateCommand() {
274978
275001
  type: "integration tool",
274979
275002
  alias: "ha",
274980
275003
  execute: (cmd2, baseAction) => {
274981
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
275004
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
274982
275005
  return baseAction(defaultArgs, async (settlemint, env2) => {
274983
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275006
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
274984
275007
  const result = await settlemint.integrationTool.create({
274985
275008
  name: name2,
274986
- applicationId: application,
275009
+ applicationUniqueName,
274987
275010
  integrationType: "HASURA",
274988
275011
  provider,
274989
275012
  region,
@@ -274995,7 +275018,7 @@ function hasuraIntegrationCreateCommand() {
274995
275018
  mapDefaultEnv: async () => {
274996
275019
  return {
274997
275020
  SETTLEMINT_APPLICATION: application,
274998
- SETTLEMINT_HASURA: result.id,
275021
+ SETTLEMINT_HASURA: result.uniqueName,
274999
275022
  ...getHasuraEndpoints(result)
275000
275023
  };
275001
275024
  }
@@ -275010,7 +275033,7 @@ function hasuraIntegrationCreateCommand() {
275010
275033
  },
275011
275034
  {
275012
275035
  description: "Create a Hasura integration in a different application",
275013
- command: "platform create integration-tool hasura my-hasura --application-id 123456789"
275036
+ command: "platform create integration-tool hasura my-hasura --application app-123"
275014
275037
  }
275015
275038
  ]
275016
275039
  });
@@ -275030,15 +275053,15 @@ function graphMiddlewareCreateCommand() {
275030
275053
  type: "middleware",
275031
275054
  alias: "gr",
275032
275055
  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 }) => {
275056
+ 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
275057
  return baseAction(defaultArgs, async (settlemint, env2) => {
275035
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275036
- const blockchainNode = blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275058
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275059
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275037
275060
  const result = await settlemint.middleware.create({
275038
275061
  name: name2,
275039
- applicationId: application,
275062
+ applicationUniqueName,
275040
275063
  interface: "HA_GRAPH",
275041
- blockchainNodeId: blockchainNode,
275064
+ blockchainNodeUniqueName,
275042
275065
  provider,
275043
275066
  region,
275044
275067
  size,
@@ -275047,11 +275070,11 @@ function graphMiddlewareCreateCommand() {
275047
275070
  return {
275048
275071
  result,
275049
275072
  mapDefaultEnv: async () => {
275050
- const resource = await settlemint.middleware.read(result.id);
275073
+ const graphMiddleware = await settlemint.middleware.read(result.uniqueName);
275051
275074
  return {
275052
275075
  SETTLEMINT_APPLICATION: application,
275053
- SETTLEMINT_THEGRAPH: result.id,
275054
- ...await getGraphEndpoint(resource, env2)
275076
+ SETTLEMINT_THEGRAPH: result.uniqueName,
275077
+ ...await getGraphEndpoint(graphMiddleware, env2)
275055
275078
  };
275056
275079
  }
275057
275080
  };
@@ -275065,7 +275088,7 @@ function graphMiddlewareCreateCommand() {
275065
275088
  },
275066
275089
  {
275067
275090
  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"
275091
+ command: "platform create middleware graph my-graph --application my-app --blockchain-node node-123"
275069
275092
  }
275070
275093
  ]
275071
275094
  });
@@ -275079,16 +275102,16 @@ function smartContractPortalMiddlewareCreateCommand() {
275079
275102
  type: "middleware",
275080
275103
  alias: "scp",
275081
275104
  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([
275105
+ 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
275106
  "StarterKitERC20Registry",
275084
275107
  "StarterKitERC20Factory",
275085
275108
  "StarterKitERC20",
275086
275109
  "StarterKitERC20DexFactory",
275087
275110
  "StarterKitERC20Dex"
275088
275111
  ])).action(async (name2, {
275089
- applicationId,
275090
- blockchainNodeId,
275091
- loadBalancerId,
275112
+ application,
275113
+ blockchainNode,
275114
+ loadBalancer,
275092
275115
  provider,
275093
275116
  region,
275094
275117
  size,
@@ -275098,9 +275121,9 @@ function smartContractPortalMiddlewareCreateCommand() {
275098
275121
  ...defaultArgs
275099
275122
  }) => {
275100
275123
  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);
275124
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275125
+ const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275126
+ const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
275104
275127
  const parsedAbis = [];
275105
275128
  if (abis && abis.length > 0) {
275106
275129
  try {
@@ -275117,10 +275140,10 @@ function smartContractPortalMiddlewareCreateCommand() {
275117
275140
  }
275118
275141
  const result = await settlemint.middleware.create({
275119
275142
  name: name2,
275120
- applicationId: application,
275143
+ applicationUniqueName,
275121
275144
  interface: "SMART_CONTRACT_PORTAL",
275122
- blockchainNodeId: blockchainNode,
275123
- loadBalancerId: loadBalancer,
275145
+ blockchainNodeUniqueName,
275146
+ loadBalancerUniqueName,
275124
275147
  abis: parsedAbis,
275125
275148
  includePredeployedAbis,
275126
275149
  provider,
@@ -275133,7 +275156,7 @@ function smartContractPortalMiddlewareCreateCommand() {
275133
275156
  mapDefaultEnv: async () => {
275134
275157
  return {
275135
275158
  SETTLEMINT_APPLICATION: application,
275136
- SETTLEMINT_PORTAL: result.id,
275159
+ SETTLEMINT_PORTAL: result.uniqueName,
275137
275160
  ...getPortalEndpoints(result)
275138
275161
  };
275139
275162
  }
@@ -275148,7 +275171,7 @@ function smartContractPortalMiddlewareCreateCommand() {
275148
275171
  },
275149
275172
  {
275150
275173
  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"
275174
+ command: "platform create middleware smart-contract-portal my-portal --application my-app --blockchain-node node-123"
275152
275175
  }
275153
275176
  ]
275154
275177
  });
@@ -275166,14 +275189,15 @@ function privateKeyHdCreateCommand() {
275166
275189
  type: "private key",
275167
275190
  alias: "hd",
275168
275191
  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 }) => {
275192
+ 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
275193
  return baseAction(defaultArgs, async (settlemint, env2) => {
275171
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275194
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275195
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275172
275196
  const result = await settlemint.privateKey.create({
275173
275197
  name: name2,
275174
- applicationId: application,
275198
+ applicationUniqueName,
275175
275199
  privateKeyType: "HD_ECDSA_P256",
275176
- blockchainNodes: blockchainNodeId ? [blockchainNodeId] : [],
275200
+ blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
275177
275201
  provider,
275178
275202
  region,
275179
275203
  size,
@@ -275198,11 +275222,11 @@ function privateKeyHdCreateCommand() {
275198
275222
  },
275199
275223
  {
275200
275224
  description: "Create a private key in a different application",
275201
- command: "platform create private-key hd-ecdsa-p256 my-key --application-id 123456789"
275225
+ command: "platform create private-key hd-ecdsa-p256 my-key --application my-app"
275202
275226
  },
275203
275227
  {
275204
275228
  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"
275229
+ command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node node-123"
275206
275230
  }
275207
275231
  ]
275208
275232
  });
@@ -275215,14 +275239,15 @@ function privateKeyHsmCreateCommand() {
275215
275239
  type: "private key",
275216
275240
  alias: "hd",
275217
275241
  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 }) => {
275242
+ 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
275243
  return baseAction(defaultArgs, async (settlemint, env2) => {
275220
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275244
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275245
+ const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
275221
275246
  const result = await settlemint.privateKey.create({
275222
275247
  name: name2,
275223
- applicationId: application,
275248
+ applicationUniqueName,
275224
275249
  privateKeyType: "HSM_ECDSA_P256",
275225
- blockchainNodes: blockchainNodeId ? [blockchainNodeId] : [],
275250
+ blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
275226
275251
  provider,
275227
275252
  region,
275228
275253
  size,
@@ -275241,11 +275266,11 @@ function privateKeyHsmCreateCommand() {
275241
275266
  },
275242
275267
  {
275243
275268
  description: "Create a private key in a different application",
275244
- command: "platform create private-key hsm-ecdsa-p256 my-key --application-id 123456789"
275269
+ command: "platform create private-key hsm-ecdsa-p256 my-key --application 123456789"
275245
275270
  },
275246
275271
  {
275247
275272
  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"
275273
+ command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node node-123"
275249
275274
  }
275250
275275
  ]
275251
275276
  });
@@ -275263,12 +275288,12 @@ function ipfsStorageCreateCommand() {
275263
275288
  type: "storage",
275264
275289
  alias: "ip",
275265
275290
  execute: (cmd2, baseAction) => {
275266
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
275291
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
275267
275292
  return baseAction(defaultArgs, async (settlemint, env2) => {
275268
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275293
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275269
275294
  const result = await settlemint.storage.create({
275270
275295
  name: name2,
275271
- applicationId: application,
275296
+ applicationUniqueName,
275272
275297
  storageProtocol: "IPFS",
275273
275298
  provider,
275274
275299
  region,
@@ -275279,8 +275304,7 @@ function ipfsStorageCreateCommand() {
275279
275304
  result,
275280
275305
  mapDefaultEnv: () => {
275281
275306
  return {
275282
- SETTLEMINT_APPLICATION: application,
275283
- SETTLEMINT_IPFS: result.id,
275307
+ SETTLEMINT_IPFS: result.uniqueName,
275284
275308
  ...getIpfsEndpoints(result)
275285
275309
  };
275286
275310
  }
@@ -275295,7 +275319,7 @@ function ipfsStorageCreateCommand() {
275295
275319
  },
275296
275320
  {
275297
275321
  description: "Create an IPFS storage in a different application",
275298
- command: "platform create storage ipfs my-storage --application-id app-123"
275322
+ command: "platform create storage ipfs my-storage --application app-123"
275299
275323
  }
275300
275324
  ]
275301
275325
  });
@@ -275308,12 +275332,12 @@ function minioStorageCreateCommand() {
275308
275332
  type: "storage",
275309
275333
  alias: "m",
275310
275334
  execute: (cmd2, baseAction) => {
275311
- addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
275335
+ addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
275312
275336
  return baseAction(defaultArgs, async (settlemint, env2) => {
275313
- const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
275337
+ const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
275314
275338
  const result = await settlemint.storage.create({
275315
275339
  name: name2,
275316
- applicationId: application,
275340
+ applicationUniqueName,
275317
275341
  storageProtocol: "MINIO",
275318
275342
  provider,
275319
275343
  region,
@@ -275325,7 +275349,7 @@ function minioStorageCreateCommand() {
275325
275349
  mapDefaultEnv: () => {
275326
275350
  return {
275327
275351
  SETTLEMINT_APPLICATION: application,
275328
- SETTLEMINT_MINIO: result.id,
275352
+ SETTLEMINT_MINIO: result.uniqueName,
275329
275353
  ...getMinioEndpoints(result)
275330
275354
  };
275331
275355
  }
@@ -275340,7 +275364,7 @@ function minioStorageCreateCommand() {
275340
275364
  },
275341
275365
  {
275342
275366
  description: "Create a MinIO storage in a different application",
275343
- command: "platform create storage minio my-storage --application-id app-123"
275367
+ command: "platform create storage minio my-storage --application app-123"
275344
275368
  }
275345
275369
  ]
275346
275370
  });
@@ -275386,11 +275410,11 @@ function getDeleteCommand({
275386
275410
  deleteFunction,
275387
275411
  usePersonalAccessToken = true
275388
275412
  }) {
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.
275413
+ 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
275414
  ${createExamples([
275391
275415
  {
275392
- description: `Deletes the specified ${type4} by id`,
275393
- command: `platform delete ${type4} <${type4}-id>`
275416
+ description: `Deletes the specified ${type4} by unique name`,
275417
+ command: `platform delete ${type4} <${type4}-unique-name>`
275394
275418
  },
275395
275419
  {
275396
275420
  description: `Deletes the default ${type4} in the production environment`,
@@ -275398,9 +275422,9 @@ ${createExamples([
275398
275422
  },
275399
275423
  {
275400
275424
  description: `Force deletes the specified ${type4} without confirmation`,
275401
- command: `platform delete ${type4} <${type4}-id> --force`
275425
+ command: `platform delete ${type4} <${type4}-unique-name> --force`
275402
275426
  }
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 }) => {
275427
+ ])}`).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
275428
  intro(`Deleting ${type4} in the SettleMint platform`);
275405
275429
  if (!force) {
275406
275430
  await deleteConfirmationPrompt(`this ${type4}`);
@@ -275418,19 +275442,19 @@ ${createExamples([
275418
275442
  accessToken,
275419
275443
  instance
275420
275444
  });
275421
- const isDefaultId = id === "default";
275422
- const serviceId = isDefaultId ? typeof env2[envKey] === "string" ? env2[envKey] : null : id;
275423
- if (!serviceId) {
275445
+ const isDefaultUniqueName = uniqueName === "default";
275446
+ const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
275447
+ if (!serviceUniqueName) {
275424
275448
  throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} ID or set a default ${type4} first.`);
275425
275449
  }
275426
275450
  const result = await spinner({
275427
275451
  startMessage: `Deleting ${type4}`,
275428
275452
  task: async () => {
275429
- return deleteFunction(settlemint, serviceId);
275453
+ return deleteFunction(settlemint, serviceUniqueName);
275430
275454
  },
275431
275455
  stopMessage: `${capitalizeFirstLetter(type4)} deleted`
275432
275456
  });
275433
- if (isDefaultId) {
275457
+ if (isDefaultUniqueName) {
275434
275458
  const newEnv = {
275435
275459
  SETTLEMINT_ACCESS_TOKEN: usePersonalAccessToken ? env2.SETTLEMINT_ACCESS_TOKEN : accessToken,
275436
275460
  SETTLEMINT_INSTANCE: instance,
@@ -275440,7 +275464,7 @@ ${createExamples([
275440
275464
  note(`${capitalizeFirstLetter(type4)} removed as default`);
275441
275465
  }
275442
275466
  if (wait) {
275443
- await waitForCompletion({ settlemint, type: type4, id: serviceId, action: "destroy" });
275467
+ await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "destroy" });
275444
275468
  }
275445
275469
  outro(`${capitalizeFirstLetter(type4)} ${result.name} deleted successfully`);
275446
275470
  });
@@ -275453,8 +275477,8 @@ function workspaceDeleteCommand() {
275453
275477
  type: "workspace",
275454
275478
  alias: "w",
275455
275479
  envKey: "SETTLEMINT_WORKSPACE",
275456
- deleteFunction: async (settlemint, id) => {
275457
- return settlemint.workspace.delete(id);
275480
+ deleteFunction: async (settlemint, uniqueName) => {
275481
+ return settlemint.workspace.delete(uniqueName);
275458
275482
  }
275459
275483
  });
275460
275484
  }
@@ -275503,7 +275527,7 @@ ${createExamples([
275503
275527
  description: `Restarts the default ${type4} in the production environment`,
275504
275528
  command: `platform restart ${commandName}${subType ? ` ${subType}` : ""} default --prod`
275505
275529
  }
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 }) => {
275530
+ ])}`).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
275531
  intro(`Restarting ${type4} in the SettleMint platform`);
275508
275532
  const autoAccept = !!acceptDefaults || is_in_ci_default;
275509
275533
  const env2 = await loadEnv2(false, !!prod);
@@ -275518,20 +275542,20 @@ ${createExamples([
275518
275542
  accessToken,
275519
275543
  instance
275520
275544
  });
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.`);
275545
+ const isDefaultUniqueName = uniqueName === "default";
275546
+ const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
275547
+ if (!serviceUniqueName) {
275548
+ 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
275549
  }
275526
275550
  const result = await spinner({
275527
275551
  startMessage: `Restarting ${type4}`,
275528
275552
  task: async () => {
275529
- return restartFunction(settlemint, serviceId);
275553
+ return restartFunction(settlemint, serviceUniqueName);
275530
275554
  },
275531
275555
  stopMessage: `${capitalizeFirstLetter(type4)} restart initiated`
275532
275556
  });
275533
275557
  if (wait) {
275534
- await waitForCompletion({ settlemint, type: type4, id: serviceId, action: "restart" });
275558
+ await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "restart" });
275535
275559
  }
275536
275560
  outro(`${capitalizeFirstLetter(type4)} ${result.name} restart initiated successfully`);
275537
275561
  });
@@ -275544,8 +275568,8 @@ function blockchainNetworkRestartCommand() {
275544
275568
  type: "blockchain network",
275545
275569
  alias: "bn",
275546
275570
  envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
275547
- restartFunction: async (settlemint, id) => {
275548
- return settlemint.blockchainNetwork.restart(id);
275571
+ restartFunction: async (settlemint, uniqueName) => {
275572
+ return settlemint.blockchainNetwork.restart(uniqueName);
275549
275573
  }
275550
275574
  });
275551
275575
  }
@@ -275557,8 +275581,8 @@ function customDeploymentRestartCommand() {
275557
275581
  type: "custom deployment",
275558
275582
  alias: "cd",
275559
275583
  envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
275560
- restartFunction: async (settlemint, id) => {
275561
- return settlemint.customDeployment.restart(id);
275584
+ restartFunction: async (settlemint, uniqueName) => {
275585
+ return settlemint.customDeployment.restart(uniqueName);
275562
275586
  },
275563
275587
  usePersonalAccessToken: false
275564
275588
  });
@@ -275572,8 +275596,8 @@ function blockscoutRestartCommand() {
275572
275596
  subType: "blockscout",
275573
275597
  alias: "bs",
275574
275598
  envKey: "SETTLEMINT_BLOCKSCOUT",
275575
- restartFunction: async (settlemint, id) => {
275576
- return settlemint.insights.restart(id);
275599
+ restartFunction: async (settlemint, uniqueName) => {
275600
+ return settlemint.insights.restart(uniqueName);
275577
275601
  }
275578
275602
  });
275579
275603
  }
@@ -275591,8 +275615,8 @@ function hasuraRestartCommand() {
275591
275615
  subType: "hasura",
275592
275616
  alias: "ha",
275593
275617
  envKey: "SETTLEMINT_HASURA",
275594
- restartFunction: async (settlemint, id) => {
275595
- return settlemint.integrationTool.restart(id);
275618
+ restartFunction: async (settlemint, uniqueName) => {
275619
+ return settlemint.integrationTool.restart(uniqueName);
275596
275620
  }
275597
275621
  });
275598
275622
  }
@@ -275624,8 +275648,8 @@ function smartContractPortalRestartCommand() {
275624
275648
  subType: "smart-contract-portal",
275625
275649
  alias: "scp",
275626
275650
  envKey: "SETTLEMINT_PORTAL",
275627
- restartFunction: async (settlemint, id) => {
275628
- return settlemint.middleware.restart(id);
275651
+ restartFunction: async (settlemint, uniqueName) => {
275652
+ return settlemint.middleware.restart(uniqueName);
275629
275653
  }
275630
275654
  });
275631
275655
  }
@@ -275643,8 +275667,8 @@ function hdEcdsaP256RestartCommand() {
275643
275667
  subType: "hd-ecdsa-p256",
275644
275668
  alias: "hd",
275645
275669
  envKey: "SETTLEMINT_HD_PRIVATE_KEY",
275646
- restartFunction: async (settlemint, id) => {
275647
- return settlemint.privateKey.restart(id);
275670
+ restartFunction: async (settlemint, uniqueName) => {
275671
+ return settlemint.privateKey.restart(uniqueName);
275648
275672
  }
275649
275673
  });
275650
275674
  }
@@ -275661,8 +275685,8 @@ function ipfsRestartCommand() {
275661
275685
  type: "storage",
275662
275686
  alias: "ip",
275663
275687
  envKey: "SETTLEMINT_IPFS",
275664
- restartFunction: async (settlemint, id) => {
275665
- return settlemint.storage.restart(id);
275688
+ restartFunction: async (settlemint, uniqueName) => {
275689
+ return settlemint.storage.restart(uniqueName);
275666
275690
  }
275667
275691
  });
275668
275692
  }
@@ -275674,8 +275698,8 @@ function minioRestartCommand() {
275674
275698
  type: "storage",
275675
275699
  alias: "m",
275676
275700
  envKey: "SETTLEMINT_MINIO",
275677
- restartFunction: async (settlemint, id) => {
275678
- return settlemint.storage.restart(id);
275701
+ restartFunction: async (settlemint, uniqueName) => {
275702
+ return settlemint.storage.restart(uniqueName);
275679
275703
  }
275680
275704
  });
275681
275705
  }
@@ -275693,12 +275717,12 @@ function restartCommand() {
275693
275717
 
275694
275718
  // src/commands/platform/custom-deployments/update.ts
275695
275719
  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 }) => {
275720
+ 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
275721
  intro("Updating custom deployment in the SettleMint platform");
275698
275722
  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");
275723
+ const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
275724
+ if (!customDeploymentUniqueName) {
275725
+ 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
275726
  }
275703
275727
  const instance = await instancePrompt(env2, true);
275704
275728
  const accessToken = await getApplicationOrPersonalAccessToken({
@@ -275714,12 +275738,17 @@ function customDeploymentsUpdateCommand() {
275714
275738
  const customDeployment = await spinner({
275715
275739
  startMessage: "Updating custom deployment",
275716
275740
  task: async () => {
275717
- return settlemint.customDeployment.update(customDeploymentId, tag);
275741
+ return settlemint.customDeployment.update(customDeploymentUniqueName, tag);
275718
275742
  },
275719
275743
  stopMessage: "Custom deployment updated"
275720
275744
  });
275721
275745
  if (wait) {
275722
- await waitForCompletion({ settlemint, type: "custom deployment", id: customDeployment.id, action: "deploy" });
275746
+ await waitForCompletion({
275747
+ settlemint,
275748
+ type: "custom deployment",
275749
+ uniqueName: customDeployment.uniqueName,
275750
+ action: "deploy"
275751
+ });
275723
275752
  }
275724
275753
  outro(`${customDeployment.name} updated to ${tag}`);
275725
275754
  });
@@ -276108,7 +276137,7 @@ function isHardhatConfig(config4) {
276108
276137
 
276109
276138
  // src/commands/smart-contract-set/hardhat/deploy/remote.ts
276110
276139
  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");
276140
+ 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
276141
  cmd2.action(async ({
276113
276142
  module,
276114
276143
  reset: reset2,
@@ -276119,7 +276148,7 @@ function hardhatDeployRemoteCommand() {
276119
276148
  strategy,
276120
276149
  prod,
276121
276150
  acceptDefaults,
276122
- blockchainNodeId
276151
+ blockchainNode: blockchainNodeUniqueName
276123
276152
  }) => {
276124
276153
  const autoAccept = !!acceptDefaults || is_in_ci_default;
276125
276154
  const env2 = await loadEnv(false, !!prod);
@@ -276134,15 +276163,15 @@ function hardhatDeployRemoteCommand() {
276134
276163
  accessToken,
276135
276164
  instance
276136
276165
  });
276137
- const nodeId = blockchainNodeId ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
276166
+ const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
276138
276167
  let node = undefined;
276139
- if (!nodeId) {
276168
+ if (!nodeUniqueName) {
276140
276169
  const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
276141
276170
  const evmNodes = nodes.filter((node2) => node2.isEvm);
276142
276171
  if (evmNodes.length === 0) {
276143
276172
  cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
276144
276173
  }
276145
- const nodesWithPrivateKey = await Promise.all(evmNodes.map((node2) => settlemint.blockchainNode.read(node2.id)));
276174
+ const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
276146
276175
  const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
276147
276176
  if (nodesWithActivePrivateKey.length === 0) {
276148
276177
  cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
@@ -276153,12 +276182,12 @@ function hardhatDeployRemoteCommand() {
276153
276182
  }
276154
276183
  node = blockchainNode;
276155
276184
  } else {
276156
- node = await settlemint.blockchainNode.read(nodeId);
276185
+ node = await settlemint.blockchainNode.read(nodeUniqueName);
276157
276186
  if (!node.isEvm) {
276158
276187
  cancel2("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
276159
276188
  }
276160
276189
  }
276161
- const envConfig = await settlemint.foundry.env(node.id);
276190
+ const envConfig = await settlemint.foundry.env(node.uniqueName);
276162
276191
  const hardhatConfig = await getHardhatConfigData(envConfig);
276163
276192
  if (verify && !hardhatConfig?.etherscan?.apiKey) {
276164
276193
  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 +276251,8 @@ function hardhatScriptLocalCommand() {
276222
276251
 
276223
276252
  // src/commands/smart-contract-set/hardhat/script/remote.ts
276224
276253
  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 }) => {
276254
+ 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");
276255
+ cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
276227
276256
  const autoAccept = !!acceptDefaults || is_in_ci_default;
276228
276257
  const env2 = await loadEnv(false, !!prod);
276229
276258
  const instance = await instancePrompt(env2, true);
@@ -276237,16 +276266,16 @@ function hardhatScriptRemoteCommand() {
276237
276266
  accessToken,
276238
276267
  instance
276239
276268
  });
276240
- let nodeId = blockchainNodeId;
276241
- if (!nodeId) {
276269
+ let nodeUniqueName = blockchainNodeUniqueName;
276270
+ if (!nodeUniqueName) {
276242
276271
  const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
276243
276272
  const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
276244
276273
  if (!blockchainNode) {
276245
276274
  cancel2("No Blockchain Node selected. Please select one to continue.");
276246
276275
  }
276247
- nodeId = blockchainNode.id;
276276
+ nodeUniqueName = blockchainNode.uniqueName;
276248
276277
  }
276249
- const envConfig = await settlemint.foundry.env(nodeId);
276278
+ const envConfig = await settlemint.foundry.env(nodeUniqueName);
276250
276279
  const { command, args } = await getPackageManagerExecutable();
276251
276280
  await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
276252
276281
  });
@@ -276655,4 +276684,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
276655
276684
  cancel2(reason);
276656
276685
  });
276657
276686
 
276658
- //# debugId=A12F1BE9D0881FF564756E2164756E21
276687
+ //# debugId=5C6F942709D5130564756E2164756E21