@settlemint/sdk-cli 0.7.4-pr9660ede → 0.7.4-prb83b0981
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +975 -1004
- package/dist/cli.js.map +47 -47
- 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.
|
|
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.3HwssRficx:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
|
|
197431
197431
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
197432
197432
|
var a5 = nr ? n6.split(r6) : [""];
|
|
197433
197433
|
if (nr) {
|
|
@@ -200564,7 +200564,7 @@ ${whileRunning(e9)}`;
|
|
|
200564
200564
|
};
|
|
200565
200565
|
ni = Object.assign(async function _main() {
|
|
200566
200566
|
var e9 = new Cli({
|
|
200567
|
-
binaryVersion: "0.7.4-
|
|
200567
|
+
binaryVersion: "0.7.4-prb83b0981",
|
|
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.
|
|
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.3HwssRficx:/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.
|
|
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.3HwssRficx:/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.
|
|
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.3HwssRficx:/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.
|
|
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.3HwssRficx:/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,7 +267675,10 @@ 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
|
|
267678
|
+
var IdSchema = z3.union([
|
|
267679
|
+
z3.string().uuid(),
|
|
267680
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
267681
|
+
]);
|
|
267679
267682
|
var UrlSchema = z3.string().url();
|
|
267680
267683
|
var UrlPathSchema = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
267681
267684
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -267685,33 +267688,33 @@ var DotEnvSchema = z3.object({
|
|
|
267685
267688
|
SETTLEMINT_INSTANCE: UrlSchema.default("https://console.settlemint.com"),
|
|
267686
267689
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema.optional(),
|
|
267687
267690
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema.optional(),
|
|
267688
|
-
SETTLEMINT_WORKSPACE:
|
|
267689
|
-
SETTLEMINT_APPLICATION:
|
|
267690
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
267691
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
267692
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
267693
|
-
SETTLEMINT_HASURA:
|
|
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(),
|
|
267694
267697
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema.optional(),
|
|
267695
267698
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
267696
267699
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
267697
|
-
SETTLEMINT_THEGRAPH:
|
|
267700
|
+
SETTLEMINT_THEGRAPH: IdSchema.optional(),
|
|
267698
267701
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson(value4, []), z3.array(UrlSchema).optional()),
|
|
267699
267702
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
267700
|
-
SETTLEMINT_PORTAL:
|
|
267703
|
+
SETTLEMINT_PORTAL: IdSchema.optional(),
|
|
267701
267704
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
|
267702
267705
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
|
|
267703
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
267704
|
-
SETTLEMINT_MINIO:
|
|
267706
|
+
SETTLEMINT_HD_PRIVATE_KEY: z3.string().optional(),
|
|
267707
|
+
SETTLEMINT_MINIO: IdSchema.optional(),
|
|
267705
267708
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema.optional(),
|
|
267706
267709
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
267707
267710
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
267708
|
-
SETTLEMINT_IPFS:
|
|
267711
|
+
SETTLEMINT_IPFS: IdSchema.optional(),
|
|
267709
267712
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema.optional(),
|
|
267710
267713
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema.optional(),
|
|
267711
267714
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema.optional(),
|
|
267712
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
267715
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: IdSchema.optional(),
|
|
267713
267716
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema.optional(),
|
|
267714
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
267717
|
+
SETTLEMINT_BLOCKSCOUT: IdSchema.optional(),
|
|
267715
267718
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
|
267716
267719
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema.optional(),
|
|
267717
267720
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -267719,10 +267722,6 @@ var DotEnvSchema = z3.object({
|
|
|
267719
267722
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
267720
267723
|
});
|
|
267721
267724
|
var DotEnvSchemaPartial = DotEnvSchema.partial();
|
|
267722
|
-
var IdSchema = z3.union([
|
|
267723
|
-
z3.string().uuid(),
|
|
267724
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
267725
|
-
]);
|
|
267726
267725
|
function validate(schema, value4) {
|
|
267727
267726
|
try {
|
|
267728
267727
|
return schema.parse(value4);
|
|
@@ -269970,7 +269969,10 @@ function tryParseJson2(value4, defaultValue = null) {
|
|
|
269970
269969
|
return defaultValue;
|
|
269971
269970
|
}
|
|
269972
269971
|
}
|
|
269973
|
-
var
|
|
269972
|
+
var IdSchema2 = z3.union([
|
|
269973
|
+
z3.string().uuid(),
|
|
269974
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
269975
|
+
]);
|
|
269974
269976
|
var UrlSchema2 = z3.string().url();
|
|
269975
269977
|
var UrlPathSchema2 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
269976
269978
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -269980,33 +269982,33 @@ var DotEnvSchema2 = z3.object({
|
|
|
269980
269982
|
SETTLEMINT_INSTANCE: UrlSchema2.default("https://console.settlemint.com"),
|
|
269981
269983
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema2.optional(),
|
|
269982
269984
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema2.optional(),
|
|
269983
|
-
SETTLEMINT_WORKSPACE:
|
|
269984
|
-
SETTLEMINT_APPLICATION:
|
|
269985
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
269986
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
269987
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
269988
|
-
SETTLEMINT_HASURA:
|
|
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(),
|
|
269989
269991
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema2.optional(),
|
|
269990
269992
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
269991
269993
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
269992
|
-
SETTLEMINT_THEGRAPH:
|
|
269994
|
+
SETTLEMINT_THEGRAPH: IdSchema2.optional(),
|
|
269993
269995
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson2(value4, []), z3.array(UrlSchema2).optional()),
|
|
269994
269996
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
269995
|
-
SETTLEMINT_PORTAL:
|
|
269997
|
+
SETTLEMINT_PORTAL: IdSchema2.optional(),
|
|
269996
269998
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
269997
269999
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
|
|
269998
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
269999
|
-
SETTLEMINT_MINIO:
|
|
270000
|
+
SETTLEMINT_HD_PRIVATE_KEY: z3.string().optional(),
|
|
270001
|
+
SETTLEMINT_MINIO: IdSchema2.optional(),
|
|
270000
270002
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema2.optional(),
|
|
270001
270003
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
270002
270004
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
270003
|
-
SETTLEMINT_IPFS:
|
|
270005
|
+
SETTLEMINT_IPFS: IdSchema2.optional(),
|
|
270004
270006
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema2.optional(),
|
|
270005
270007
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema2.optional(),
|
|
270006
270008
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema2.optional(),
|
|
270007
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
270009
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: IdSchema2.optional(),
|
|
270008
270010
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema2.optional(),
|
|
270009
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
270011
|
+
SETTLEMINT_BLOCKSCOUT: IdSchema2.optional(),
|
|
270010
270012
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
270011
270013
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema2.optional(),
|
|
270012
270014
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -270014,10 +270016,6 @@ var DotEnvSchema2 = z3.object({
|
|
|
270014
270016
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
270015
270017
|
});
|
|
270016
270018
|
var DotEnvSchemaPartial2 = DotEnvSchema2.partial();
|
|
270017
|
-
var IdSchema2 = z3.union([
|
|
270018
|
-
z3.string().uuid(),
|
|
270019
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270020
|
-
]);
|
|
270021
270019
|
function validate2(schema, value4) {
|
|
270022
270020
|
try {
|
|
270023
270021
|
return schema.parse(value4);
|
|
@@ -270629,7 +270627,10 @@ function tryParseJson3(value4, defaultValue = null) {
|
|
|
270629
270627
|
return defaultValue;
|
|
270630
270628
|
}
|
|
270631
270629
|
}
|
|
270632
|
-
var
|
|
270630
|
+
var IdSchema3 = z3.union([
|
|
270631
|
+
z3.string().uuid(),
|
|
270632
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270633
|
+
]);
|
|
270633
270634
|
var UrlSchema3 = z3.string().url();
|
|
270634
270635
|
var UrlPathSchema3 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
270635
270636
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -270639,33 +270640,33 @@ var DotEnvSchema3 = z3.object({
|
|
|
270639
270640
|
SETTLEMINT_INSTANCE: UrlSchema3.default("https://console.settlemint.com"),
|
|
270640
270641
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema3.optional(),
|
|
270641
270642
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema3.optional(),
|
|
270642
|
-
SETTLEMINT_WORKSPACE:
|
|
270643
|
-
SETTLEMINT_APPLICATION:
|
|
270644
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
270645
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
270646
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
270647
|
-
SETTLEMINT_HASURA:
|
|
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(),
|
|
270648
270649
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema3.optional(),
|
|
270649
270650
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
270650
270651
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
270651
|
-
SETTLEMINT_THEGRAPH:
|
|
270652
|
+
SETTLEMINT_THEGRAPH: IdSchema3.optional(),
|
|
270652
270653
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson3(value4, []), z3.array(UrlSchema3).optional()),
|
|
270653
270654
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
270654
|
-
SETTLEMINT_PORTAL:
|
|
270655
|
+
SETTLEMINT_PORTAL: IdSchema3.optional(),
|
|
270655
270656
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
|
|
270656
270657
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema3.optional(),
|
|
270657
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
270658
|
-
SETTLEMINT_MINIO:
|
|
270658
|
+
SETTLEMINT_HD_PRIVATE_KEY: z3.string().optional(),
|
|
270659
|
+
SETTLEMINT_MINIO: IdSchema3.optional(),
|
|
270659
270660
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema3.optional(),
|
|
270660
270661
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
270661
270662
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
270662
|
-
SETTLEMINT_IPFS:
|
|
270663
|
+
SETTLEMINT_IPFS: IdSchema3.optional(),
|
|
270663
270664
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema3.optional(),
|
|
270664
270665
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema3.optional(),
|
|
270665
270666
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema3.optional(),
|
|
270666
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
270667
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: IdSchema3.optional(),
|
|
270667
270668
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema3.optional(),
|
|
270668
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
270669
|
+
SETTLEMINT_BLOCKSCOUT: IdSchema3.optional(),
|
|
270669
270670
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
|
|
270670
270671
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema3.optional(),
|
|
270671
270672
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -270673,10 +270674,6 @@ var DotEnvSchema3 = z3.object({
|
|
|
270673
270674
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
270674
270675
|
});
|
|
270675
270676
|
var DotEnvSchemaPartial3 = DotEnvSchema3.partial();
|
|
270676
|
-
var IdSchema3 = z3.union([
|
|
270677
|
-
z3.string().uuid(),
|
|
270678
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270679
|
-
]);
|
|
270680
270677
|
function validate3(schema, value4) {
|
|
270681
270678
|
try {
|
|
270682
270679
|
return schema.parse(value4);
|
|
@@ -271281,256 +271278,95 @@ var t7 = initGraphQLTada();
|
|
|
271281
271278
|
|
|
271282
271279
|
// ../js/dist/settlemint.mjs
|
|
271283
271280
|
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
|
+
};
|
|
271284
271298
|
var ApplicationFragment = graphql(`
|
|
271285
271299
|
fragment Application on Application {
|
|
271286
271300
|
id
|
|
271287
|
-
uniqueName
|
|
271288
271301
|
name
|
|
271289
|
-
workspace {
|
|
271290
|
-
id
|
|
271291
|
-
uniqueName
|
|
271292
|
-
}
|
|
271302
|
+
workspace { id }
|
|
271293
271303
|
}
|
|
271294
271304
|
`);
|
|
271295
|
-
var
|
|
271296
|
-
|
|
271297
|
-
|
|
271298
|
-
uniqueName
|
|
271299
|
-
name
|
|
271305
|
+
var listApplications = graphql(`
|
|
271306
|
+
query ListApplications($workspaceId: ID!) {
|
|
271307
|
+
workspace (workspaceId: $workspaceId) {
|
|
271300
271308
|
applications {
|
|
271301
271309
|
...Application
|
|
271302
271310
|
}
|
|
271303
271311
|
}
|
|
271304
|
-
|
|
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
|
-
}
|
|
271312
|
+
}
|
|
271427
271313
|
`, [ApplicationFragment]);
|
|
271428
271314
|
var readApplication = graphql(`
|
|
271429
|
-
|
|
271430
|
-
|
|
271431
|
-
|
|
271432
|
-
}
|
|
271315
|
+
query ReadApplication($id: ID!) {
|
|
271316
|
+
application(applicationId: $id) {
|
|
271317
|
+
...Application
|
|
271433
271318
|
}
|
|
271319
|
+
}
|
|
271434
271320
|
`, [ApplicationFragment]);
|
|
271435
271321
|
var createApplication = graphql(`
|
|
271436
|
-
|
|
271437
|
-
|
|
271438
|
-
|
|
271439
|
-
|
|
271322
|
+
mutation CreateApplication(
|
|
271323
|
+
$name: String!
|
|
271324
|
+
$workspaceId: ID!
|
|
271325
|
+
) {
|
|
271326
|
+
createApplication(
|
|
271327
|
+
name: $name
|
|
271328
|
+
workspaceId: $workspaceId
|
|
271329
|
+
) {
|
|
271330
|
+
...Application
|
|
271440
271331
|
}
|
|
271332
|
+
}
|
|
271441
271333
|
`, [ApplicationFragment]);
|
|
271442
271334
|
var deleteApplication = graphql(`
|
|
271443
|
-
|
|
271444
|
-
|
|
271445
|
-
|
|
271446
|
-
}
|
|
271335
|
+
mutation DeleteApplication($id: ID!) {
|
|
271336
|
+
deleteApplication(id: $id) {
|
|
271337
|
+
...Application
|
|
271447
271338
|
}
|
|
271339
|
+
}
|
|
271448
271340
|
`, [ApplicationFragment]);
|
|
271449
271341
|
var applicationList = (gqlClient, options) => {
|
|
271450
|
-
return async (
|
|
271342
|
+
return async (workspaceId) => {
|
|
271343
|
+
const id = validate3(IdSchema3, workspaceId);
|
|
271451
271344
|
const {
|
|
271452
|
-
|
|
271453
|
-
} = await gqlClient.request(listApplications, {
|
|
271345
|
+
workspace: { applications }
|
|
271346
|
+
} = await gqlClient.request(listApplications, { workspaceId: id });
|
|
271454
271347
|
return applications;
|
|
271455
271348
|
};
|
|
271456
271349
|
};
|
|
271457
271350
|
var applicationRead = (gqlClient, options) => {
|
|
271458
|
-
return async (
|
|
271459
|
-
const
|
|
271460
|
-
|
|
271461
|
-
});
|
|
271351
|
+
return async (applicationId) => {
|
|
271352
|
+
const id = validate3(IdSchema3, applicationId);
|
|
271353
|
+
const { application } = await gqlClient.request(readApplication, { id });
|
|
271462
271354
|
return application;
|
|
271463
271355
|
};
|
|
271464
271356
|
};
|
|
271465
271357
|
var applicationCreate = (gqlClient, options) => {
|
|
271466
271358
|
return async (args) => {
|
|
271467
|
-
const {
|
|
271468
|
-
const workspace = await workspaceRead(gqlClient, options)(workspaceUniqueName);
|
|
271469
|
-
const { createApplication: application } = await gqlClient.request(createApplication, {
|
|
271470
|
-
...otherArgs,
|
|
271471
|
-
workspaceId: workspace.id
|
|
271472
|
-
});
|
|
271359
|
+
const { createApplication: application } = await gqlClient.request(createApplication, args);
|
|
271473
271360
|
return application;
|
|
271474
271361
|
};
|
|
271475
271362
|
};
|
|
271476
271363
|
var applicationDelete = (gqlClient, options) => {
|
|
271477
|
-
return async (
|
|
271478
|
-
const
|
|
271479
|
-
const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
|
|
271480
|
-
id: applicationToDelete.id
|
|
271481
|
-
});
|
|
271364
|
+
return async (applicationId) => {
|
|
271365
|
+
const id = validate3(IdSchema3, applicationId);
|
|
271366
|
+
const { deleteApplication: application } = await gqlClient.request(deleteApplication, { id });
|
|
271482
271367
|
return application;
|
|
271483
271368
|
};
|
|
271484
271369
|
};
|
|
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
|
-
};
|
|
271534
271370
|
function setClusterServiceDefaults(args) {
|
|
271535
271371
|
return {
|
|
271536
271372
|
...args,
|
|
@@ -271557,34 +271393,31 @@ var BlockchainNetworkFragment = graphql(`
|
|
|
271557
271393
|
fragment BlockchainNetwork on BlockchainNetwork {
|
|
271558
271394
|
__typename
|
|
271559
271395
|
id
|
|
271560
|
-
uniqueName
|
|
271561
271396
|
name
|
|
271562
271397
|
status
|
|
271563
271398
|
blockchainNodes {
|
|
271564
271399
|
... on BlockchainNode {
|
|
271565
271400
|
id
|
|
271566
271401
|
name
|
|
271567
|
-
uniqueName
|
|
271568
271402
|
}
|
|
271569
271403
|
}
|
|
271570
271404
|
}
|
|
271571
271405
|
`);
|
|
271572
271406
|
var getBlockchainNetworks = graphql(`
|
|
271573
|
-
|
|
271574
|
-
|
|
271575
|
-
|
|
271576
|
-
|
|
271577
|
-
}
|
|
271578
|
-
}
|
|
271407
|
+
query getBlockchainNetworks($id: ID!) {
|
|
271408
|
+
blockchainNetworks(applicationId: $id) {
|
|
271409
|
+
items {
|
|
271410
|
+
...BlockchainNetwork
|
|
271579
271411
|
}
|
|
271580
|
-
|
|
271412
|
+
}
|
|
271413
|
+
}`, [BlockchainNetworkFragment]);
|
|
271581
271414
|
var getBlockchainNetwork = graphql(`
|
|
271582
|
-
|
|
271583
|
-
|
|
271584
|
-
|
|
271585
|
-
}
|
|
271415
|
+
query getBlockchainNetwork($id: ID!) {
|
|
271416
|
+
blockchainNetwork(entityId: $id) {
|
|
271417
|
+
...BlockchainNetwork
|
|
271586
271418
|
}
|
|
271587
|
-
|
|
271419
|
+
}
|
|
271420
|
+
`, [BlockchainNetworkFragment]);
|
|
271588
271421
|
var createBlockchainNetwork = graphql(`
|
|
271589
271422
|
mutation createBlockchainNetwork(
|
|
271590
271423
|
$applicationId: ID!
|
|
@@ -271645,67 +271478,65 @@ var createBlockchainNetwork = graphql(`
|
|
|
271645
271478
|
...BlockchainNetwork
|
|
271646
271479
|
}
|
|
271647
271480
|
}
|
|
271648
|
-
|
|
271481
|
+
`, [BlockchainNetworkFragment]);
|
|
271649
271482
|
var deleteBlockchainNetwork = graphql(`
|
|
271650
|
-
mutation deleteBlockchainNetwork($
|
|
271651
|
-
|
|
271483
|
+
mutation deleteBlockchainNetwork($blockchainNetworkId: ID!) {
|
|
271484
|
+
deleteBlockchainNetwork(entityId: $blockchainNetworkId) {
|
|
271652
271485
|
...BlockchainNetwork
|
|
271653
271486
|
}
|
|
271654
271487
|
}
|
|
271655
|
-
|
|
271488
|
+
`, [BlockchainNetworkFragment]);
|
|
271656
271489
|
var restartBlockchainNetwork = graphql(`
|
|
271657
|
-
mutation RestartBlockchainNetwork($
|
|
271658
|
-
|
|
271490
|
+
mutation RestartBlockchainNetwork($id: ID!) {
|
|
271491
|
+
restartBlockchainNetwork(entityId: $id) {
|
|
271659
271492
|
...BlockchainNetwork
|
|
271660
271493
|
}
|
|
271661
271494
|
}
|
|
271662
|
-
|
|
271495
|
+
`, [BlockchainNetworkFragment]);
|
|
271663
271496
|
var blockchainNetworkList = (gqlClient, options) => {
|
|
271664
|
-
return async (
|
|
271497
|
+
return async (applicationId) => {
|
|
271498
|
+
const id = validate3(IdSchema3, applicationId);
|
|
271665
271499
|
const {
|
|
271666
|
-
|
|
271667
|
-
} = await gqlClient.request(getBlockchainNetworks, {
|
|
271500
|
+
blockchainNetworks: { items }
|
|
271501
|
+
} = await gqlClient.request(getBlockchainNetworks, { id });
|
|
271668
271502
|
return items;
|
|
271669
271503
|
};
|
|
271670
271504
|
};
|
|
271671
271505
|
var blockchainNetworkRead = (gqlClient, options) => {
|
|
271672
|
-
return async (
|
|
271673
|
-
const
|
|
271674
|
-
|
|
271675
|
-
|
|
271676
|
-
return blockchainNetworkByUniqueName;
|
|
271506
|
+
return async (blockchainNetworkId) => {
|
|
271507
|
+
const id = validate3(IdSchema3, blockchainNetworkId);
|
|
271508
|
+
const { blockchainNetwork } = await gqlClient.request(getBlockchainNetwork, { id });
|
|
271509
|
+
return blockchainNetwork;
|
|
271677
271510
|
};
|
|
271678
271511
|
};
|
|
271679
271512
|
var blockchainNetworkCreate = (gqlClient, options) => {
|
|
271680
271513
|
return async (args) => {
|
|
271681
|
-
const
|
|
271682
|
-
|
|
271683
|
-
const
|
|
271684
|
-
const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {
|
|
271685
|
-
...blockchainNetworkArgs,
|
|
271686
|
-
applicationId: application.id
|
|
271687
|
-
});
|
|
271514
|
+
const blockchainNetworkArgs = setNetworkDefaults(args);
|
|
271515
|
+
validate3(IdSchema3, blockchainNetworkArgs.applicationId);
|
|
271516
|
+
const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, blockchainNetworkArgs);
|
|
271688
271517
|
return blockchainNetwork;
|
|
271689
271518
|
};
|
|
271690
271519
|
};
|
|
271691
271520
|
var blockchainNetworkDelete = (gqlClient, options) => {
|
|
271692
|
-
return async (
|
|
271693
|
-
const
|
|
271694
|
-
|
|
271521
|
+
return async (networkId) => {
|
|
271522
|
+
const id = validate3(IdSchema3, networkId);
|
|
271523
|
+
const { deleteBlockchainNetwork: blockchainNetwork } = await gqlClient.request(deleteBlockchainNetwork, {
|
|
271524
|
+
blockchainNetworkId: id
|
|
271695
271525
|
});
|
|
271696
271526
|
return blockchainNetwork;
|
|
271697
271527
|
};
|
|
271698
271528
|
};
|
|
271699
|
-
var blockchainNetworkRestart = (gqlClient, _options) => async (
|
|
271700
|
-
const
|
|
271529
|
+
var blockchainNetworkRestart = (gqlClient, _options) => async (networkId) => {
|
|
271530
|
+
const id = validate3(IdSchema3, networkId);
|
|
271531
|
+
const { restartBlockchainNetwork: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { id });
|
|
271701
271532
|
return blockchainNetwork;
|
|
271702
271533
|
};
|
|
271703
271534
|
var BlockchainNodeFragment = graphql(`
|
|
271704
271535
|
fragment BlockchainNode on BlockchainNode {
|
|
271705
271536
|
__typename
|
|
271706
271537
|
id
|
|
271707
|
-
uniqueName
|
|
271708
271538
|
name
|
|
271539
|
+
uniqueName
|
|
271709
271540
|
status
|
|
271710
271541
|
isEvm
|
|
271711
271542
|
endpoints {
|
|
@@ -271722,7 +271553,6 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271722
271553
|
... on AbstractClusterService {
|
|
271723
271554
|
id
|
|
271724
271555
|
name
|
|
271725
|
-
uniqueName
|
|
271726
271556
|
}
|
|
271727
271557
|
}
|
|
271728
271558
|
privateKeys {
|
|
@@ -271736,96 +271566,86 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271736
271566
|
}
|
|
271737
271567
|
`);
|
|
271738
271568
|
var getBlockchainNodes = graphql(`
|
|
271739
|
-
|
|
271740
|
-
|
|
271741
|
-
|
|
271742
|
-
|
|
271743
|
-
|
|
271744
|
-
|
|
271745
|
-
|
|
271746
|
-
`, [BlockchainNodeFragment]);
|
|
271569
|
+
query getBlockchainNodes($id: ID!) {
|
|
271570
|
+
blockchainNodes(applicationId: $id) {
|
|
271571
|
+
items {
|
|
271572
|
+
...BlockchainNode
|
|
271573
|
+
}
|
|
271574
|
+
}
|
|
271575
|
+
}`, [BlockchainNodeFragment]);
|
|
271747
271576
|
var getBlockchainNode = graphql(`
|
|
271748
|
-
|
|
271749
|
-
|
|
271750
|
-
|
|
271751
|
-
|
|
271752
|
-
|
|
271753
|
-
|
|
271577
|
+
query getBlockchainNode($id: ID!) {
|
|
271578
|
+
blockchainNode(entityId: $id) {
|
|
271579
|
+
...BlockchainNode
|
|
271580
|
+
}
|
|
271581
|
+
}
|
|
271582
|
+
`, [BlockchainNodeFragment]);
|
|
271754
271583
|
var createBlockchainNode = graphql(`
|
|
271755
|
-
|
|
271756
|
-
|
|
271757
|
-
|
|
271758
|
-
|
|
271759
|
-
|
|
271760
|
-
|
|
271761
|
-
|
|
271762
|
-
|
|
271763
|
-
|
|
271764
|
-
|
|
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
|
|
271765
271605
|
) {
|
|
271766
|
-
|
|
271767
|
-
|
|
271768
|
-
|
|
271769
|
-
|
|
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]);
|
|
271606
|
+
...BlockchainNode
|
|
271607
|
+
}
|
|
271608
|
+
}
|
|
271609
|
+
`, [BlockchainNodeFragment]);
|
|
271781
271610
|
var restartBlockchainNode = graphql(`
|
|
271782
|
-
|
|
271783
|
-
|
|
271784
|
-
|
|
271785
|
-
}
|
|
271611
|
+
mutation RestartBlockchainNode($id: ID!) {
|
|
271612
|
+
restartBlockchainNode(entityId: $id) {
|
|
271613
|
+
...BlockchainNode
|
|
271786
271614
|
}
|
|
271787
|
-
|
|
271615
|
+
}
|
|
271616
|
+
`, [BlockchainNodeFragment]);
|
|
271788
271617
|
var blockchainNodeList = (gqlClient, options) => {
|
|
271789
|
-
return async (
|
|
271618
|
+
return async (applicationId) => {
|
|
271619
|
+
const id = validate3(IdSchema3, applicationId);
|
|
271790
271620
|
const {
|
|
271791
|
-
|
|
271792
|
-
} = await gqlClient.request(getBlockchainNodes, {
|
|
271621
|
+
blockchainNodes: { items }
|
|
271622
|
+
} = await gqlClient.request(getBlockchainNodes, { id });
|
|
271793
271623
|
return items;
|
|
271794
271624
|
};
|
|
271795
271625
|
};
|
|
271796
271626
|
var blockchainNodeRead = (gqlClient, options) => {
|
|
271797
|
-
return async (
|
|
271798
|
-
const
|
|
271799
|
-
|
|
271800
|
-
|
|
271801
|
-
return blockchainNodeByUniqueName;
|
|
271627
|
+
return async (blockchainNodeId) => {
|
|
271628
|
+
const id = validate3(IdSchema3, blockchainNodeId);
|
|
271629
|
+
const { blockchainNode } = await gqlClient.request(getBlockchainNode, { id });
|
|
271630
|
+
return blockchainNode;
|
|
271802
271631
|
};
|
|
271803
271632
|
};
|
|
271804
271633
|
var blockchainNodeCreate = (gqlClient, options) => {
|
|
271805
271634
|
return async (args) => {
|
|
271806
|
-
|
|
271807
|
-
|
|
271808
|
-
|
|
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
|
-
});
|
|
271635
|
+
validate3(IdSchema3, args.applicationId);
|
|
271636
|
+
validate3(IdSchema3, args.blockchainNetworkId);
|
|
271637
|
+
const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, args);
|
|
271816
271638
|
return blockchainNode;
|
|
271817
271639
|
};
|
|
271818
271640
|
};
|
|
271819
|
-
var blockchainNodeRestart = (gqlClient, _options) => async (
|
|
271820
|
-
const
|
|
271821
|
-
|
|
271822
|
-
});
|
|
271641
|
+
var blockchainNodeRestart = (gqlClient, _options) => async (nodeId) => {
|
|
271642
|
+
const id = validate3(IdSchema3, nodeId);
|
|
271643
|
+
const { restartBlockchainNode: blockchainNode } = await gqlClient.request(restartBlockchainNode, { id });
|
|
271823
271644
|
return blockchainNode;
|
|
271824
271645
|
};
|
|
271825
271646
|
var CustomDeploymentFragment = graphql(`
|
|
271826
271647
|
fragment CustomDeployment on CustomDeployment {
|
|
271827
271648
|
id
|
|
271828
|
-
uniqueName
|
|
271829
271649
|
name
|
|
271830
271650
|
status
|
|
271831
271651
|
endpoints {
|
|
@@ -271841,141 +271661,112 @@ var CustomDeploymentFragment = graphql(`
|
|
|
271841
271661
|
}
|
|
271842
271662
|
`);
|
|
271843
271663
|
var getCustomDeployments = graphql(`
|
|
271844
|
-
|
|
271845
|
-
|
|
271846
|
-
|
|
271847
|
-
|
|
271848
|
-
}
|
|
271849
|
-
}
|
|
271664
|
+
query getCustomDeployments($id: ID!) {
|
|
271665
|
+
customDeployments(applicationId: $id) {
|
|
271666
|
+
items {
|
|
271667
|
+
...CustomDeployment
|
|
271850
271668
|
}
|
|
271851
|
-
|
|
271669
|
+
}
|
|
271670
|
+
}`, [CustomDeploymentFragment]);
|
|
271852
271671
|
var getCustomDeployment = graphql(`
|
|
271853
|
-
|
|
271854
|
-
|
|
271855
|
-
|
|
271856
|
-
|
|
271857
|
-
|
|
271858
|
-
|
|
271672
|
+
query getCustomDeployment($id: ID!) {
|
|
271673
|
+
customDeployment(entityId: $id) {
|
|
271674
|
+
...CustomDeployment
|
|
271675
|
+
}
|
|
271676
|
+
}
|
|
271677
|
+
`, [CustomDeploymentFragment]);
|
|
271859
271678
|
var editCustomDeployment = graphql(`
|
|
271860
|
-
|
|
271861
|
-
|
|
271862
|
-
|
|
271863
|
-
|
|
271864
|
-
|
|
271865
|
-
|
|
271679
|
+
mutation EditCustomDeployment($entityId: ID!, $imageTag: String) {
|
|
271680
|
+
editCustomDeployment(entityId: $entityId, imageTag: $imageTag) {
|
|
271681
|
+
...CustomDeployment
|
|
271682
|
+
}
|
|
271683
|
+
}
|
|
271684
|
+
`, [CustomDeploymentFragment]);
|
|
271866
271685
|
var createCustomDeployment = graphql(`
|
|
271867
|
-
|
|
271868
|
-
|
|
271869
|
-
|
|
271870
|
-
|
|
271871
|
-
|
|
271872
|
-
|
|
271873
|
-
|
|
271874
|
-
|
|
271875
|
-
|
|
271876
|
-
|
|
271877
|
-
|
|
271878
|
-
|
|
271879
|
-
|
|
271880
|
-
|
|
271881
|
-
|
|
271882
|
-
|
|
271883
|
-
|
|
271884
|
-
|
|
271885
|
-
|
|
271886
|
-
|
|
271887
|
-
|
|
271888
|
-
|
|
271889
|
-
|
|
271890
|
-
|
|
271891
|
-
|
|
271892
|
-
|
|
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]);
|
|
271893
271712
|
var restartCustomDeployment = graphql(`
|
|
271894
|
-
|
|
271895
|
-
|
|
271896
|
-
|
|
271897
|
-
}
|
|
271713
|
+
mutation RestartCustomDeployment($id: ID!) {
|
|
271714
|
+
restartCustomDeployment(entityId: $id) {
|
|
271715
|
+
...CustomDeployment
|
|
271898
271716
|
}
|
|
271899
|
-
|
|
271717
|
+
}
|
|
271718
|
+
`, [CustomDeploymentFragment]);
|
|
271900
271719
|
var customdeploymentList = (gqlClient, options) => {
|
|
271901
|
-
return async (
|
|
271720
|
+
return async (applicationId) => {
|
|
271721
|
+
const id = validate3(IdSchema3, applicationId);
|
|
271902
271722
|
const {
|
|
271903
|
-
|
|
271904
|
-
} = await gqlClient.request(getCustomDeployments, {
|
|
271723
|
+
customDeployments: { items }
|
|
271724
|
+
} = await gqlClient.request(getCustomDeployments, { id });
|
|
271905
271725
|
return items;
|
|
271906
271726
|
};
|
|
271907
271727
|
};
|
|
271908
271728
|
var customdeploymentRead = (gqlClient, options) => {
|
|
271909
|
-
return async (
|
|
271910
|
-
const
|
|
271911
|
-
|
|
271912
|
-
});
|
|
271729
|
+
return async (customdeploymentId) => {
|
|
271730
|
+
const id = validate3(IdSchema3, customdeploymentId);
|
|
271731
|
+
const { customDeployment } = await gqlClient.request(getCustomDeployment, { id });
|
|
271913
271732
|
return customDeployment;
|
|
271914
271733
|
};
|
|
271915
271734
|
};
|
|
271916
271735
|
var customdeploymentUpdate = (gqlClient, options) => {
|
|
271917
|
-
return async (
|
|
271918
|
-
const
|
|
271919
|
-
|
|
271920
|
-
imageTag
|
|
271921
|
-
});
|
|
271736
|
+
return async (customdeploymentId, imageTag) => {
|
|
271737
|
+
const id = validate3(IdSchema3, customdeploymentId);
|
|
271738
|
+
const { editCustomDeployment: cd } = await gqlClient.request(editCustomDeployment, { entityId: id, imageTag });
|
|
271922
271739
|
return cd;
|
|
271923
271740
|
};
|
|
271924
271741
|
};
|
|
271925
271742
|
var customdeploymentCreate = (gqlClient, options) => {
|
|
271926
271743
|
return async (args) => {
|
|
271927
|
-
|
|
271928
|
-
const
|
|
271929
|
-
const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {
|
|
271930
|
-
...otherArgs,
|
|
271931
|
-
applicationId: application.id
|
|
271932
|
-
});
|
|
271744
|
+
validate3(IdSchema3, args.applicationId);
|
|
271745
|
+
const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, args);
|
|
271933
271746
|
return customDeployment;
|
|
271934
271747
|
};
|
|
271935
271748
|
};
|
|
271936
|
-
var customDeploymentRestart = (gqlClient, _options) => async (
|
|
271937
|
-
const
|
|
271938
|
-
|
|
271939
|
-
});
|
|
271749
|
+
var customDeploymentRestart = (gqlClient, _options) => async (deploymentId) => {
|
|
271750
|
+
const id = validate3(IdSchema3, deploymentId);
|
|
271751
|
+
const { restartCustomDeployment: customDeployment } = await gqlClient.request(restartCustomDeployment, { id });
|
|
271940
271752
|
return customDeployment;
|
|
271941
271753
|
};
|
|
271942
271754
|
var getFoundryEnvConfig = graphql(`
|
|
271943
|
-
|
|
271944
|
-
|
|
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
|
|
271755
|
+
query getFoundryEnvConfig($blockchainNodeId: String!) {
|
|
271756
|
+
foundryEnvConfig(blockchainNodeId: $blockchainNodeId)
|
|
271957
271757
|
}
|
|
271958
271758
|
`);
|
|
271959
|
-
|
|
271960
|
-
|
|
271961
|
-
|
|
271962
|
-
|
|
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;
|
|
271759
|
+
function getEnv(gqlClient, options) {
|
|
271760
|
+
return async (blockchainNodeId) => {
|
|
271761
|
+
validate3(IdSchema3, blockchainNodeId);
|
|
271762
|
+
const { foundryEnvConfig } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeId });
|
|
271763
|
+
return foundryEnvConfig;
|
|
271972
271764
|
};
|
|
271973
|
-
}
|
|
271765
|
+
}
|
|
271974
271766
|
var InsightsFragment = graphql(`
|
|
271975
271767
|
fragment Insights on Insights {
|
|
271976
271768
|
__typename
|
|
271977
271769
|
id
|
|
271978
|
-
uniqueName
|
|
271979
271770
|
name
|
|
271980
271771
|
status
|
|
271981
271772
|
insightsCategory
|
|
@@ -271992,97 +271783,86 @@ var InsightsFragment = graphql(`
|
|
|
271992
271783
|
}
|
|
271993
271784
|
`);
|
|
271994
271785
|
var getInsights = graphql(`
|
|
271995
|
-
|
|
271996
|
-
|
|
271997
|
-
|
|
271998
|
-
|
|
271999
|
-
}
|
|
272000
|
-
}
|
|
271786
|
+
query getInsights($id: ID!) {
|
|
271787
|
+
insightsList(applicationId: $id) {
|
|
271788
|
+
items {
|
|
271789
|
+
...Insights
|
|
272001
271790
|
}
|
|
272002
|
-
|
|
271791
|
+
}
|
|
271792
|
+
}`, [InsightsFragment]);
|
|
272003
271793
|
var getInsight = graphql(`
|
|
272004
|
-
|
|
272005
|
-
|
|
272006
|
-
|
|
272007
|
-
|
|
272008
|
-
|
|
272009
|
-
|
|
271794
|
+
query getInsights($id: ID!) {
|
|
271795
|
+
insights(entityId: $id) {
|
|
271796
|
+
...Insights
|
|
271797
|
+
}
|
|
271798
|
+
}
|
|
271799
|
+
`, [InsightsFragment]);
|
|
272010
271800
|
var createInsights = graphql(`
|
|
272011
|
-
|
|
272012
|
-
|
|
272013
|
-
|
|
272014
|
-
|
|
272015
|
-
|
|
272016
|
-
|
|
272017
|
-
|
|
272018
|
-
|
|
272019
|
-
|
|
272020
|
-
|
|
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
|
|
272021
271822
|
) {
|
|
272022
|
-
|
|
272023
|
-
|
|
272024
|
-
|
|
272025
|
-
|
|
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]);
|
|
271823
|
+
...Insights
|
|
271824
|
+
}
|
|
271825
|
+
}
|
|
271826
|
+
`, [InsightsFragment]);
|
|
272037
271827
|
var restartInsights = graphql(`
|
|
272038
|
-
|
|
272039
|
-
|
|
272040
|
-
|
|
272041
|
-
}
|
|
271828
|
+
mutation RestartInsights($id: ID!) {
|
|
271829
|
+
restartInsights(entityId: $id) {
|
|
271830
|
+
...Insights
|
|
272042
271831
|
}
|
|
272043
|
-
|
|
271832
|
+
}
|
|
271833
|
+
`, [InsightsFragment]);
|
|
272044
271834
|
var insightsList = (gqlClient, options) => {
|
|
272045
|
-
return async (
|
|
271835
|
+
return async (applicationId) => {
|
|
271836
|
+
const id = validate3(IdSchema3, applicationId);
|
|
272046
271837
|
const {
|
|
272047
|
-
|
|
272048
|
-
} = await gqlClient.request(getInsights, {
|
|
271838
|
+
insightsList: { items }
|
|
271839
|
+
} = await gqlClient.request(getInsights, { id });
|
|
272049
271840
|
return items;
|
|
272050
271841
|
};
|
|
272051
271842
|
};
|
|
272052
271843
|
var insightsRead = (gqlClient, options) => {
|
|
272053
|
-
return async (
|
|
272054
|
-
const
|
|
271844
|
+
return async (insightsId) => {
|
|
271845
|
+
const id = validate3(IdSchema3, insightsId);
|
|
271846
|
+
const { insights } = await gqlClient.request(getInsight, { id });
|
|
272055
271847
|
return insights;
|
|
272056
271848
|
};
|
|
272057
271849
|
};
|
|
272058
271850
|
var insightsCreate = (gqlClient, options) => {
|
|
272059
271851
|
return async (args) => {
|
|
272060
|
-
|
|
272061
|
-
const
|
|
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
|
-
});
|
|
271852
|
+
validate3(IdSchema3, args.applicationId);
|
|
271853
|
+
const { createInsights: insights } = await gqlClient.request(createInsights, args);
|
|
272072
271854
|
return insights;
|
|
272073
271855
|
};
|
|
272074
271856
|
};
|
|
272075
|
-
var insightsRestart = (gqlClient, _options) => async (
|
|
272076
|
-
const
|
|
272077
|
-
|
|
272078
|
-
});
|
|
271857
|
+
var insightsRestart = (gqlClient, _options) => async (insightsId) => {
|
|
271858
|
+
const id = validate3(IdSchema3, insightsId);
|
|
271859
|
+
const { restartInsights: insights } = await gqlClient.request(restartInsights, { id });
|
|
272079
271860
|
return insights;
|
|
272080
271861
|
};
|
|
272081
271862
|
var IntegrationFragment = graphql(`
|
|
272082
271863
|
fragment Integration on Integration {
|
|
272083
271864
|
__typename
|
|
272084
271865
|
id
|
|
272085
|
-
uniqueName
|
|
272086
271866
|
name
|
|
272087
271867
|
status
|
|
272088
271868
|
integrationType
|
|
@@ -272099,184 +271879,82 @@ var IntegrationFragment = graphql(`
|
|
|
272099
271879
|
}
|
|
272100
271880
|
`);
|
|
272101
271881
|
var getIntegrations = graphql(`
|
|
272102
|
-
|
|
272103
|
-
|
|
272104
|
-
|
|
272105
|
-
|
|
272106
|
-
}
|
|
272107
|
-
}
|
|
271882
|
+
query getIntegrations($id: ID!) {
|
|
271883
|
+
integrations(applicationId: $id) {
|
|
271884
|
+
items {
|
|
271885
|
+
...Integration
|
|
272108
271886
|
}
|
|
272109
|
-
|
|
271887
|
+
}
|
|
271888
|
+
}`, [IntegrationFragment]);
|
|
272110
271889
|
var getIntegration = graphql(`
|
|
272111
|
-
|
|
272112
|
-
|
|
272113
|
-
|
|
272114
|
-
|
|
272115
|
-
|
|
272116
|
-
|
|
271890
|
+
query getIntegration($id: ID!) {
|
|
271891
|
+
integration(entityId: $id) {
|
|
271892
|
+
...Integration
|
|
271893
|
+
}
|
|
271894
|
+
}
|
|
271895
|
+
`, [IntegrationFragment]);
|
|
272117
271896
|
var createIntegration = graphql(`
|
|
272118
|
-
|
|
272119
|
-
|
|
272120
|
-
|
|
272121
|
-
|
|
272122
|
-
|
|
272123
|
-
|
|
272124
|
-
|
|
272125
|
-
|
|
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
|
|
272126
271914
|
) {
|
|
272127
|
-
|
|
272128
|
-
|
|
272129
|
-
|
|
272130
|
-
|
|
272131
|
-
provider: $provider
|
|
272132
|
-
region: $region
|
|
272133
|
-
size: $size
|
|
272134
|
-
type: $type
|
|
272135
|
-
) {
|
|
272136
|
-
...Integration
|
|
272137
|
-
}
|
|
272138
|
-
}
|
|
272139
|
-
`, [IntegrationFragment]);
|
|
271915
|
+
...Integration
|
|
271916
|
+
}
|
|
271917
|
+
}
|
|
271918
|
+
`, [IntegrationFragment]);
|
|
272140
271919
|
var restartIntegrationTool = graphql(`
|
|
272141
|
-
|
|
272142
|
-
|
|
272143
|
-
|
|
272144
|
-
}
|
|
271920
|
+
mutation RestartIntegrationTool($id: ID!) {
|
|
271921
|
+
restartIntegration(entityId: $id) {
|
|
271922
|
+
...Integration
|
|
272145
271923
|
}
|
|
272146
|
-
|
|
271924
|
+
}
|
|
271925
|
+
`, [IntegrationFragment]);
|
|
272147
271926
|
var integrationToolList = (gqlClient, options) => {
|
|
272148
|
-
return async (
|
|
271927
|
+
return async (applicationId) => {
|
|
271928
|
+
const id = validate3(IdSchema3, applicationId);
|
|
272149
271929
|
const {
|
|
272150
|
-
|
|
272151
|
-
} = await gqlClient.request(getIntegrations, {
|
|
271930
|
+
integrations: { items }
|
|
271931
|
+
} = await gqlClient.request(getIntegrations, { id });
|
|
272152
271932
|
return items;
|
|
272153
271933
|
};
|
|
272154
271934
|
};
|
|
272155
271935
|
var integrationToolRead = (gqlClient, options) => {
|
|
272156
|
-
return async (
|
|
272157
|
-
const
|
|
272158
|
-
|
|
271936
|
+
return async (integrationId) => {
|
|
271937
|
+
const id = validate3(IdSchema3, integrationId);
|
|
271938
|
+
const { integration } = await gqlClient.request(getIntegration, { id });
|
|
271939
|
+
return integration;
|
|
272159
271940
|
};
|
|
272160
271941
|
};
|
|
272161
271942
|
var integrationToolCreate = (gqlClient, options) => {
|
|
272162
271943
|
return async (args) => {
|
|
272163
|
-
|
|
272164
|
-
const
|
|
272165
|
-
const { createIntegration: integration } = await gqlClient.request(createIntegration, {
|
|
272166
|
-
...otherArgs,
|
|
272167
|
-
applicationId: application.id
|
|
272168
|
-
});
|
|
271944
|
+
validate3(IdSchema3, args.applicationId);
|
|
271945
|
+
const { createIntegration: integration } = await gqlClient.request(createIntegration, args);
|
|
272169
271946
|
return integration;
|
|
272170
271947
|
};
|
|
272171
271948
|
};
|
|
272172
|
-
var integrationToolRestart = (gqlClient, _options) => async (
|
|
272173
|
-
const
|
|
272174
|
-
|
|
272175
|
-
});
|
|
271949
|
+
var integrationToolRestart = (gqlClient, _options) => async (toolId) => {
|
|
271950
|
+
const id = validate3(IdSchema3, toolId);
|
|
271951
|
+
const { restartIntegration: integration } = await gqlClient.request(restartIntegrationTool, { id });
|
|
272176
271952
|
return integration;
|
|
272177
271953
|
};
|
|
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
|
-
};
|
|
272275
271954
|
var MiddlewareFragment = graphql(`
|
|
272276
271955
|
fragment Middleware on Middleware {
|
|
272277
271956
|
__typename
|
|
272278
271957
|
id
|
|
272279
|
-
uniqueName
|
|
272280
271958
|
name
|
|
272281
271959
|
status
|
|
272282
271960
|
interface
|
|
@@ -272305,196 +271983,489 @@ var MiddlewareFragment = graphql(`
|
|
|
272305
271983
|
}
|
|
272306
271984
|
`);
|
|
272307
271985
|
var getMiddlewares = graphql(`
|
|
272308
|
-
|
|
272309
|
-
|
|
272310
|
-
|
|
272311
|
-
|
|
272312
|
-
}
|
|
272313
|
-
}
|
|
271986
|
+
query getMiddlewares($id: ID!, $noCache: Boolean = false) {
|
|
271987
|
+
middlewares(applicationId: $id) {
|
|
271988
|
+
items {
|
|
271989
|
+
...Middleware
|
|
272314
271990
|
}
|
|
272315
|
-
|
|
271991
|
+
}
|
|
271992
|
+
}`, [MiddlewareFragment]);
|
|
272316
271993
|
var getMiddleware = graphql(`
|
|
272317
|
-
|
|
272318
|
-
|
|
272319
|
-
|
|
272320
|
-
|
|
272321
|
-
|
|
272322
|
-
|
|
271994
|
+
query getMiddleware($id: ID!, $noCache: Boolean = true) {
|
|
271995
|
+
middleware(entityId: $id) {
|
|
271996
|
+
...Middleware
|
|
271997
|
+
}
|
|
271998
|
+
}
|
|
271999
|
+
`, [MiddlewareFragment]);
|
|
272323
272000
|
var createMiddleware = graphql(`
|
|
272324
|
-
|
|
272325
|
-
|
|
272326
|
-
|
|
272327
|
-
|
|
272328
|
-
|
|
272329
|
-
|
|
272330
|
-
|
|
272331
|
-
|
|
272332
|
-
|
|
272333
|
-
|
|
272334
|
-
|
|
272335
|
-
|
|
272336
|
-
|
|
272337
|
-
|
|
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
|
|
272338
272031
|
) {
|
|
272339
|
-
|
|
272340
|
-
|
|
272341
|
-
|
|
272342
|
-
|
|
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]);
|
|
272032
|
+
...Middleware
|
|
272033
|
+
}
|
|
272034
|
+
}
|
|
272035
|
+
`, [MiddlewareFragment]);
|
|
272357
272036
|
var restartMiddleware = graphql(`
|
|
272358
|
-
|
|
272359
|
-
|
|
272360
|
-
|
|
272361
|
-
}
|
|
272037
|
+
mutation RestartMiddleware($id: ID!, $noCache: Boolean = false) {
|
|
272038
|
+
restartMiddleware(entityId: $id) {
|
|
272039
|
+
...Middleware
|
|
272362
272040
|
}
|
|
272363
|
-
|
|
272041
|
+
}
|
|
272042
|
+
`, [MiddlewareFragment]);
|
|
272364
272043
|
var middlewareList = (gqlClient, options) => {
|
|
272365
|
-
return async (
|
|
272044
|
+
return async (applicationId) => {
|
|
272045
|
+
const id = validate3(IdSchema3, applicationId);
|
|
272366
272046
|
const {
|
|
272367
|
-
|
|
272368
|
-
} = await gqlClient.request(getMiddlewares, {
|
|
272047
|
+
middlewares: { items }
|
|
272048
|
+
} = await gqlClient.request(getMiddlewares, { id });
|
|
272369
272049
|
return items;
|
|
272370
272050
|
};
|
|
272371
272051
|
};
|
|
272372
272052
|
var middlewareRead = (gqlClient, options) => {
|
|
272373
|
-
return async (
|
|
272374
|
-
const
|
|
272375
|
-
|
|
272376
|
-
});
|
|
272053
|
+
return async (middlewareId) => {
|
|
272054
|
+
const id = validate3(IdSchema3, middlewareId);
|
|
272055
|
+
const { middleware } = await gqlClient.request(getMiddleware, { id });
|
|
272377
272056
|
return middleware;
|
|
272378
272057
|
};
|
|
272379
272058
|
};
|
|
272380
272059
|
var middlewareCreate = (gqlClient, options) => {
|
|
272381
272060
|
return async (args) => {
|
|
272382
|
-
|
|
272383
|
-
const
|
|
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
|
-
});
|
|
272061
|
+
validate3(IdSchema3, args.applicationId);
|
|
272062
|
+
const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, args);
|
|
272396
272063
|
return middleware;
|
|
272397
272064
|
};
|
|
272398
272065
|
};
|
|
272399
|
-
var middlewareRestart = (gqlClient, _options) => async (
|
|
272400
|
-
const
|
|
272401
|
-
|
|
272402
|
-
});
|
|
272066
|
+
var middlewareRestart = (gqlClient, _options) => async (middlewareId) => {
|
|
272067
|
+
const id = validate3(IdSchema3, middlewareId);
|
|
272068
|
+
const { restartMiddleware: middleware } = await gqlClient.request(restartMiddleware, { id });
|
|
272403
272069
|
return middleware;
|
|
272404
272070
|
};
|
|
272405
272071
|
var PrivateKeyFragment = graphql(`
|
|
272406
272072
|
fragment PrivateKey on PrivateKey {
|
|
272407
272073
|
__typename
|
|
272408
272074
|
id
|
|
272409
|
-
uniqueName
|
|
272410
272075
|
name
|
|
272076
|
+
uniqueName
|
|
272411
272077
|
privateKeyType
|
|
272412
272078
|
status
|
|
272413
272079
|
}
|
|
272414
272080
|
`);
|
|
272415
272081
|
var getPrivateKeys = graphql(`
|
|
272416
|
-
|
|
272417
|
-
|
|
272418
|
-
|
|
272419
|
-
|
|
272420
|
-
}
|
|
272421
|
-
}
|
|
272082
|
+
query getPrivateKeys($id: ID!) {
|
|
272083
|
+
privateKeys(applicationId: $id) {
|
|
272084
|
+
items {
|
|
272085
|
+
...PrivateKey
|
|
272422
272086
|
}
|
|
272423
|
-
|
|
272087
|
+
}
|
|
272088
|
+
}`, [PrivateKeyFragment]);
|
|
272424
272089
|
var getPrivateKey = graphql(`
|
|
272425
|
-
|
|
272426
|
-
|
|
272427
|
-
|
|
272428
|
-
|
|
272429
|
-
|
|
272430
|
-
|
|
272090
|
+
query getPrivateKey($id: ID!) {
|
|
272091
|
+
privateKey(entityId: $id) {
|
|
272092
|
+
...PrivateKey
|
|
272093
|
+
}
|
|
272094
|
+
}
|
|
272095
|
+
`, [PrivateKeyFragment]);
|
|
272431
272096
|
var createPrivateKey = graphql(`
|
|
272432
|
-
|
|
272433
|
-
|
|
272434
|
-
|
|
272435
|
-
|
|
272436
|
-
|
|
272437
|
-
|
|
272438
|
-
|
|
272439
|
-
|
|
272440
|
-
|
|
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
|
|
272441
272116
|
) {
|
|
272442
|
-
|
|
272443
|
-
|
|
272444
|
-
|
|
272445
|
-
|
|
272446
|
-
provider: $provider
|
|
272447
|
-
region: $region
|
|
272448
|
-
size: $size
|
|
272449
|
-
type: $type
|
|
272450
|
-
blockchainNodes: $blockchainNodes
|
|
272451
|
-
) {
|
|
272452
|
-
...PrivateKey
|
|
272453
|
-
}
|
|
272454
|
-
}
|
|
272455
|
-
`, [PrivateKeyFragment]);
|
|
272117
|
+
...PrivateKey
|
|
272118
|
+
}
|
|
272119
|
+
}
|
|
272120
|
+
`, [PrivateKeyFragment]);
|
|
272456
272121
|
var restartPrivateKey = graphql(`
|
|
272457
|
-
|
|
272458
|
-
|
|
272459
|
-
|
|
272460
|
-
}
|
|
272122
|
+
mutation RestartPrivateKey($id: ID!) {
|
|
272123
|
+
restartPrivateKey(entityId: $id) {
|
|
272124
|
+
...PrivateKey
|
|
272461
272125
|
}
|
|
272462
|
-
|
|
272126
|
+
}
|
|
272127
|
+
`, [PrivateKeyFragment]);
|
|
272463
272128
|
var privateKeyList = (gqlClient, options) => {
|
|
272464
|
-
return async (
|
|
272129
|
+
return async (applicationId) => {
|
|
272130
|
+
const id = validate3(IdSchema3, applicationId);
|
|
272465
272131
|
const {
|
|
272466
|
-
|
|
272467
|
-
} = await gqlClient.request(getPrivateKeys, {
|
|
272132
|
+
privateKeys: { items }
|
|
272133
|
+
} = await gqlClient.request(getPrivateKeys, { id });
|
|
272468
272134
|
return items;
|
|
272469
272135
|
};
|
|
272470
272136
|
};
|
|
272471
272137
|
var privatekeyRead = (gqlClient, options) => {
|
|
272472
|
-
return async (
|
|
272473
|
-
const
|
|
272474
|
-
|
|
272475
|
-
});
|
|
272138
|
+
return async (privatekeyId) => {
|
|
272139
|
+
const id = validate3(IdSchema3, privatekeyId);
|
|
272140
|
+
const { privateKey } = await gqlClient.request(getPrivateKey, { id });
|
|
272476
272141
|
return privateKey;
|
|
272477
272142
|
};
|
|
272478
272143
|
};
|
|
272479
272144
|
var privateKeyCreate = (gqlClient, options) => {
|
|
272480
272145
|
return async (args) => {
|
|
272481
|
-
|
|
272482
|
-
const
|
|
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
|
-
});
|
|
272146
|
+
validate3(IdSchema3, args.applicationId);
|
|
272147
|
+
const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, args);
|
|
272489
272148
|
return privateKey;
|
|
272490
272149
|
};
|
|
272491
272150
|
};
|
|
272492
|
-
var privateKeyRestart = (gqlClient, _options) => async (
|
|
272493
|
-
const
|
|
272494
|
-
|
|
272495
|
-
});
|
|
272151
|
+
var privateKeyRestart = (gqlClient, _options) => async (keyId) => {
|
|
272152
|
+
const id = validate3(IdSchema3, keyId);
|
|
272153
|
+
const { restartPrivateKey: privateKey } = await gqlClient.request(restartPrivateKey, { id });
|
|
272496
272154
|
return privateKey;
|
|
272497
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
|
|
272250
|
+
});
|
|
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
|
+
};
|
|
272468
|
+
};
|
|
272498
272469
|
var ClientOptionsSchema = z3.object({
|
|
272499
272470
|
accessToken: AccessTokenSchema3,
|
|
272500
272471
|
instance: UrlSchema3
|
|
@@ -272596,6 +272567,12 @@ function createSettleMintClient(options) {
|
|
|
272596
272567
|
update: customdeploymentUpdate(gqlClient, options),
|
|
272597
272568
|
restart: customDeploymentRestart(gqlClient, options)
|
|
272598
272569
|
},
|
|
272570
|
+
smartContractSet: {
|
|
272571
|
+
list: smartContractSetList(gqlClient, options),
|
|
272572
|
+
read: smartContractSetRead(gqlClient, options),
|
|
272573
|
+
create: smartContractSetCreate(gqlClient, options),
|
|
272574
|
+
restart: smartContractSetRestart(gqlClient, options)
|
|
272575
|
+
},
|
|
272599
272576
|
foundry: {
|
|
272600
272577
|
env: getEnv(gqlClient, options)
|
|
272601
272578
|
},
|
|
@@ -272800,7 +272777,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272800
272777
|
}
|
|
272801
272778
|
});
|
|
272802
272779
|
const aat = await settlemint.applicationAccessToken.create({
|
|
272803
|
-
|
|
272780
|
+
applicationId: application.id,
|
|
272804
272781
|
name: name2,
|
|
272805
272782
|
blockchainNetworkScope: {
|
|
272806
272783
|
type: "ALL",
|
|
@@ -272865,7 +272842,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272865
272842
|
|
|
272866
272843
|
// src/commands/connect/application.prompt.ts
|
|
272867
272844
|
async function applicationPrompt(env2, applications, accept) {
|
|
272868
|
-
const defaultApplication = applications.find((application2) => application2.
|
|
272845
|
+
const defaultApplication = applications.find((application2) => application2.id === env2.SETTLEMINT_APPLICATION);
|
|
272869
272846
|
const defaultPossible = accept && defaultApplication;
|
|
272870
272847
|
if (defaultPossible) {
|
|
272871
272848
|
return defaultApplication;
|
|
@@ -272892,7 +272869,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272892
272869
|
if (nodes.length === 0) {
|
|
272893
272870
|
return;
|
|
272894
272871
|
}
|
|
272895
|
-
const defaultNode = nodes.find((node2) => node2.
|
|
272872
|
+
const defaultNode = nodes.find((node2) => node2.id === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
|
|
272896
272873
|
const defaultPossible = accept;
|
|
272897
272874
|
if (defaultPossible) {
|
|
272898
272875
|
return defaultNode;
|
|
@@ -272920,7 +272897,7 @@ async function blockscoutPrompt(env2, insights, accept) {
|
|
|
272920
272897
|
if (possible.length === 0) {
|
|
272921
272898
|
return;
|
|
272922
272899
|
}
|
|
272923
|
-
const defaultBlockscout = insights.find((insight) => insight.
|
|
272900
|
+
const defaultBlockscout = insights.find((insight) => insight.id === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
|
|
272924
272901
|
const defaultPossible = accept;
|
|
272925
272902
|
if (defaultPossible) {
|
|
272926
272903
|
return defaultBlockscout;
|
|
@@ -272947,7 +272924,7 @@ async function customDeploymentPrompt(env2, customDeployments, accept) {
|
|
|
272947
272924
|
if (customDeployments.length === 0) {
|
|
272948
272925
|
return;
|
|
272949
272926
|
}
|
|
272950
|
-
const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.
|
|
272927
|
+
const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.id === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
|
|
272951
272928
|
const defaultPossible = accept;
|
|
272952
272929
|
if (defaultPossible) {
|
|
272953
272930
|
return defaultCustomDeployment;
|
|
@@ -272975,7 +272952,7 @@ async function hasuraPrompt(env2, integrations, accept) {
|
|
|
272975
272952
|
if (possible.length === 0) {
|
|
272976
272953
|
return;
|
|
272977
272954
|
}
|
|
272978
|
-
const defaultIntegration = possible.find((integration) => integration.
|
|
272955
|
+
const defaultIntegration = possible.find((integration) => integration.id === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
272979
272956
|
const defaultPossible = accept;
|
|
272980
272957
|
if (defaultPossible) {
|
|
272981
272958
|
return defaultIntegration;
|
|
@@ -273054,7 +273031,7 @@ async function ipfsPrompt(env2, storages, accept) {
|
|
|
273054
273031
|
if (possible.length === 0) {
|
|
273055
273032
|
return;
|
|
273056
273033
|
}
|
|
273057
|
-
const defaultStorage = possible.find((storage) => storage.
|
|
273034
|
+
const defaultStorage = possible.find((storage) => storage.id === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273058
273035
|
const defaultPossible = accept;
|
|
273059
273036
|
if (defaultPossible) {
|
|
273060
273037
|
return defaultStorage;
|
|
@@ -273082,7 +273059,7 @@ async function minioPrompt(env2, storages, accept) {
|
|
|
273082
273059
|
if (possible.length === 0) {
|
|
273083
273060
|
return;
|
|
273084
273061
|
}
|
|
273085
|
-
const defaultStorage = possible.find((storage) => storage.
|
|
273062
|
+
const defaultStorage = possible.find((storage) => storage.id === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273086
273063
|
const defaultPossible = accept;
|
|
273087
273064
|
if (defaultPossible) {
|
|
273088
273065
|
return defaultStorage;
|
|
@@ -273110,7 +273087,7 @@ async function portalPrompt(env2, middlewares, accept) {
|
|
|
273110
273087
|
if (possible.length === 0) {
|
|
273111
273088
|
return;
|
|
273112
273089
|
}
|
|
273113
|
-
const defaultMiddleware = possible.find((middleware2) => middleware2.
|
|
273090
|
+
const defaultMiddleware = possible.find((middleware2) => middleware2.id === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273114
273091
|
const defaultPossible = accept;
|
|
273115
273092
|
if (defaultPossible) {
|
|
273116
273093
|
return defaultMiddleware;
|
|
@@ -273177,7 +273154,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
|
|
|
273177
273154
|
if (possible.length === 0) {
|
|
273178
273155
|
return;
|
|
273179
273156
|
}
|
|
273180
|
-
const defaultMiddleware = possible.find((middleware2) => middleware2.
|
|
273157
|
+
const defaultMiddleware = possible.find((middleware2) => middleware2.id === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273181
273158
|
const defaultPossible = accept;
|
|
273182
273159
|
if (defaultPossible) {
|
|
273183
273160
|
return defaultMiddleware;
|
|
@@ -273201,7 +273178,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
|
|
|
273201
273178
|
|
|
273202
273179
|
// src/commands/connect/workspace.prompt.ts
|
|
273203
273180
|
async function workspacePrompt(env2, workspaces, accept) {
|
|
273204
|
-
const defaultWorkspace = workspaces.find((workspace2) => workspace2.
|
|
273181
|
+
const defaultWorkspace = workspaces.find((workspace2) => workspace2.id === env2.SETTLEMINT_WORKSPACE);
|
|
273205
273182
|
const defaultPossible = accept && defaultWorkspace;
|
|
273206
273183
|
if (defaultPossible) {
|
|
273207
273184
|
return defaultWorkspace;
|
|
@@ -273256,23 +273233,23 @@ function connectCommand() {
|
|
|
273256
273233
|
await writeEnvSpinner(!!prod, {
|
|
273257
273234
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273258
273235
|
SETTLEMINT_INSTANCE: instance,
|
|
273259
|
-
SETTLEMINT_WORKSPACE: workspace.
|
|
273260
|
-
SETTLEMINT_APPLICATION: application.
|
|
273261
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.
|
|
273262
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.
|
|
273263
|
-
SETTLEMINT_HASURA: hasura?.
|
|
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,
|
|
273264
273241
|
...getHasuraEndpoints(hasura),
|
|
273265
|
-
SETTLEMINT_THEGRAPH: thegraph?.
|
|
273242
|
+
SETTLEMINT_THEGRAPH: thegraph?.id,
|
|
273266
273243
|
...await getGraphEndpoint(thegraph, env2),
|
|
273267
273244
|
...getPortalEndpoints(portal),
|
|
273268
273245
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
273269
|
-
SETTLEMINT_MINIO: minio?.
|
|
273246
|
+
SETTLEMINT_MINIO: minio?.id,
|
|
273270
273247
|
...getMinioEndpoints(minio),
|
|
273271
|
-
SETTLEMINT_IPFS: ipfs?.
|
|
273248
|
+
SETTLEMINT_IPFS: ipfs?.id,
|
|
273272
273249
|
...getIpfsEndpoints(ipfs),
|
|
273273
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.
|
|
273250
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.id,
|
|
273274
273251
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
|
|
273275
|
-
SETTLEMINT_BLOCKSCOUT: blockscout?.
|
|
273252
|
+
SETTLEMINT_BLOCKSCOUT: blockscout?.id,
|
|
273276
273253
|
...getBlockscoutEndpoints(blockscout)
|
|
273277
273254
|
});
|
|
273278
273255
|
outro("Connected to SettleMint");
|
|
@@ -273282,7 +273259,7 @@ function connectCommand() {
|
|
|
273282
273259
|
var package_default = {
|
|
273283
273260
|
name: "@settlemint/sdk-cli",
|
|
273284
273261
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273285
|
-
version: "0.7.4-
|
|
273262
|
+
version: "0.7.4-prb83b0981",
|
|
273286
273263
|
type: "module",
|
|
273287
273264
|
private: false,
|
|
273288
273265
|
license: "FSL-1.1-MIT",
|
|
@@ -273333,8 +273310,8 @@ var package_default = {
|
|
|
273333
273310
|
"@inquirer/input": "4.1.1",
|
|
273334
273311
|
"@inquirer/password": "4.0.4",
|
|
273335
273312
|
"@inquirer/select": "4.0.4",
|
|
273336
|
-
"@settlemint/sdk-js": "0.7.4-
|
|
273337
|
-
"@settlemint/sdk-utils": "0.7.4-
|
|
273313
|
+
"@settlemint/sdk-js": "0.7.4-prb83b0981",
|
|
273314
|
+
"@settlemint/sdk-utils": "0.7.4-prb83b0981",
|
|
273338
273315
|
"get-tsconfig": "4.8.1",
|
|
273339
273316
|
giget: "1.2.3"
|
|
273340
273317
|
},
|
|
@@ -274331,6 +274308,7 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
|
274331
274308
|
"blockchain node": "blockchainNode",
|
|
274332
274309
|
"custom deployment": "customDeployment",
|
|
274333
274310
|
"private key": "privateKey",
|
|
274311
|
+
"smart contract set": "smartContractSet",
|
|
274334
274312
|
middleware: "middleware",
|
|
274335
274313
|
"integration tool": "integrationTool",
|
|
274336
274314
|
storage: "storage",
|
|
@@ -274342,7 +274320,7 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
|
274342
274320
|
async function waitForCompletion({
|
|
274343
274321
|
settlemint,
|
|
274344
274322
|
type: type4,
|
|
274345
|
-
|
|
274323
|
+
id,
|
|
274346
274324
|
action,
|
|
274347
274325
|
maxTimeout = 15 * 60 * 1000
|
|
274348
274326
|
}) {
|
|
@@ -274361,7 +274339,7 @@ async function waitForCompletion({
|
|
|
274361
274339
|
const startTime = Date.now();
|
|
274362
274340
|
while (true) {
|
|
274363
274341
|
try {
|
|
274364
|
-
const resource = await service.read(
|
|
274342
|
+
const resource = await service.read(id);
|
|
274365
274343
|
if (resource.status === "COMPLETED") {
|
|
274366
274344
|
note(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
|
|
274367
274345
|
return true;
|
|
@@ -274375,7 +274353,7 @@ async function waitForCompletion({
|
|
|
274375
274353
|
note(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
|
|
274376
274354
|
}
|
|
274377
274355
|
if (Date.now() - startTime > maxTimeout) {
|
|
274378
|
-
throw new Error(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with
|
|
274356
|
+
throw new Error(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with id ${id}`);
|
|
274379
274357
|
}
|
|
274380
274358
|
await new Promise((resolve6) => setTimeout(resolve6, 5000));
|
|
274381
274359
|
}
|
|
@@ -274454,7 +274432,7 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274454
274432
|
await waitForCompletion({
|
|
274455
274433
|
settlemint,
|
|
274456
274434
|
type: waitFor?.resourceType ?? type4,
|
|
274457
|
-
|
|
274435
|
+
id: waitFor?.id ?? result.id,
|
|
274458
274436
|
action: "deploy"
|
|
274459
274437
|
});
|
|
274460
274438
|
if (waitFor) {
|
|
@@ -274474,10 +274452,10 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274474
274452
|
...updatedEnv
|
|
274475
274453
|
};
|
|
274476
274454
|
if (isApplicationChanged && updatedEnv.SETTLEMINT_APPLICATION) {
|
|
274477
|
-
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.
|
|
274455
|
+
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.id;
|
|
274478
274456
|
}
|
|
274479
274457
|
if (newEnv.SETTLEMINT_BLOCKCHAIN_NODE && newEnv.SETTLEMINT_BLOCKCHAIN_NODE !== env2.SETTLEMINT_BLOCKCHAIN_NODE) {
|
|
274480
|
-
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.
|
|
274458
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.id;
|
|
274481
274459
|
}
|
|
274482
274460
|
await writeEnvSpinner(!!prod, newEnv);
|
|
274483
274461
|
note(`${capitalizeFirstLetter(type4)} ${result.name} set as default`);
|
|
@@ -274494,8 +274472,8 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274494
274472
|
type: "blockchain network",
|
|
274495
274473
|
alias: "b",
|
|
274496
274474
|
execute: (cmd2, baseAction) => {
|
|
274497
|
-
addClusterServiceArgs(cmd2).option("-a, --application <
|
|
274498
|
-
|
|
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,
|
|
274499
274477
|
chainId,
|
|
274500
274478
|
contractSizeLimit,
|
|
274501
274479
|
evmStackSize,
|
|
@@ -274510,10 +274488,10 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274510
274488
|
...defaultArgs
|
|
274511
274489
|
}) => {
|
|
274512
274490
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274513
|
-
const
|
|
274491
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274514
274492
|
const result = await settlemint.blockchainNetwork.create({
|
|
274515
274493
|
name: name2,
|
|
274516
|
-
|
|
274494
|
+
applicationId: application,
|
|
274517
274495
|
nodeName,
|
|
274518
274496
|
consensusAlgorithm: "BESU_QBFT",
|
|
274519
274497
|
chainId,
|
|
@@ -274537,8 +274515,8 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274537
274515
|
mapDefaultEnv: () => {
|
|
274538
274516
|
return {
|
|
274539
274517
|
SETTLEMINT_APPLICATION: application,
|
|
274540
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK: result.
|
|
274541
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.
|
|
274518
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: result.id,
|
|
274519
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.id
|
|
274542
274520
|
};
|
|
274543
274521
|
}
|
|
274544
274522
|
};
|
|
@@ -274552,7 +274530,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274552
274530
|
},
|
|
274553
274531
|
{
|
|
274554
274532
|
description: "Create a Besu blockchain network in a different application",
|
|
274555
|
-
command: "platform create blockchain-network besu my-network --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"
|
|
274556
274534
|
}
|
|
274557
274535
|
]
|
|
274558
274536
|
});
|
|
@@ -274683,7 +274661,7 @@ function workspaceCreateCommand() {
|
|
|
274683
274661
|
result,
|
|
274684
274662
|
mapDefaultEnv: () => {
|
|
274685
274663
|
return {
|
|
274686
|
-
SETTLEMINT_WORKSPACE: result.
|
|
274664
|
+
SETTLEMINT_WORKSPACE: result.id
|
|
274687
274665
|
};
|
|
274688
274666
|
}
|
|
274689
274667
|
};
|
|
@@ -274714,11 +274692,10 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274714
274692
|
type: "application access token",
|
|
274715
274693
|
alias: "aat",
|
|
274716
274694
|
execute: (cmd2, baseAction) => {
|
|
274717
|
-
cmd2.option("-a, --application <
|
|
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 }) => {
|
|
274718
274696
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274719
|
-
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274720
274697
|
const aatToken = await settlemint.applicationAccessToken.create({
|
|
274721
|
-
|
|
274698
|
+
applicationId: applicationId ?? env2.SETTLEMINT_APPLICATION,
|
|
274722
274699
|
name: name2,
|
|
274723
274700
|
blockchainNetworkScope: {
|
|
274724
274701
|
type: "ALL",
|
|
@@ -274765,8 +274742,7 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274765
274742
|
return {
|
|
274766
274743
|
result: {
|
|
274767
274744
|
id: "",
|
|
274768
|
-
name: name2
|
|
274769
|
-
uniqueName: ""
|
|
274745
|
+
name: name2
|
|
274770
274746
|
},
|
|
274771
274747
|
mapDefaultEnv: () => ({
|
|
274772
274748
|
SETTLEMINT_ACCESS_TOKEN: aatToken
|
|
@@ -274799,17 +274775,18 @@ function applicationCreateCommand() {
|
|
|
274799
274775
|
type: "application",
|
|
274800
274776
|
alias: "a",
|
|
274801
274777
|
execute: (cmd2, baseAction) => {
|
|
274802
|
-
cmd2.option("-w, --workspace <
|
|
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 }) => {
|
|
274803
274779
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274780
|
+
const workspace = workspaceId ?? env2.SETTLEMINT_WORKSPACE;
|
|
274804
274781
|
const result = await settlemint.application.create({
|
|
274805
274782
|
name: name2,
|
|
274806
|
-
|
|
274783
|
+
workspaceId: workspace
|
|
274807
274784
|
});
|
|
274808
274785
|
return {
|
|
274809
274786
|
result,
|
|
274810
274787
|
mapDefaultEnv: () => {
|
|
274811
274788
|
return {
|
|
274812
|
-
SETTLEMINT_APPLICATION: result.
|
|
274789
|
+
SETTLEMINT_APPLICATION: result.id
|
|
274813
274790
|
};
|
|
274814
274791
|
}
|
|
274815
274792
|
};
|
|
@@ -274827,7 +274804,7 @@ function applicationCreateCommand() {
|
|
|
274827
274804
|
},
|
|
274828
274805
|
{
|
|
274829
274806
|
description: "Create an application in a specific workspace",
|
|
274830
|
-
command: "platform create application my-app --workspace
|
|
274807
|
+
command: "platform create application my-app --workspace-id 123456789"
|
|
274831
274808
|
}
|
|
274832
274809
|
]
|
|
274833
274810
|
});
|
|
@@ -274945,28 +274922,28 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274945
274922
|
type: "insights",
|
|
274946
274923
|
alias: "bs",
|
|
274947
274924
|
execute: (cmd2, baseAction) => {
|
|
274948
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
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 }) => {
|
|
274949
274926
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274950
|
-
const
|
|
274951
|
-
const
|
|
274952
|
-
const
|
|
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);
|
|
274953
274930
|
const result = await settlemint.insights.create({
|
|
274954
274931
|
name: name2,
|
|
274955
|
-
|
|
274932
|
+
applicationId: application,
|
|
274956
274933
|
insightsCategory: "BLOCKCHAIN_EXPLORER",
|
|
274957
274934
|
provider,
|
|
274958
274935
|
region,
|
|
274959
274936
|
size,
|
|
274960
274937
|
type: type4,
|
|
274961
|
-
|
|
274962
|
-
|
|
274938
|
+
blockchainNode,
|
|
274939
|
+
loadBalancer
|
|
274963
274940
|
});
|
|
274964
274941
|
return {
|
|
274965
274942
|
result,
|
|
274966
274943
|
mapDefaultEnv: async () => {
|
|
274967
274944
|
return {
|
|
274968
274945
|
SETTLEMINT_APPLICATION: application,
|
|
274969
|
-
SETTLEMINT_BLOCKSCOUT: result.
|
|
274946
|
+
SETTLEMINT_BLOCKSCOUT: result.id,
|
|
274970
274947
|
...getBlockscoutEndpoints(result)
|
|
274971
274948
|
};
|
|
274972
274949
|
}
|
|
@@ -274981,7 +274958,7 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274981
274958
|
},
|
|
274982
274959
|
{
|
|
274983
274960
|
description: "Create a Blockscout insights service in a different application",
|
|
274984
|
-
command: "platform create insights blockscout my-blockscout --application
|
|
274961
|
+
command: "platform create insights blockscout my-blockscout --application-id 123456789"
|
|
274985
274962
|
}
|
|
274986
274963
|
]
|
|
274987
274964
|
});
|
|
@@ -275001,12 +274978,12 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275001
274978
|
type: "integration tool",
|
|
275002
274979
|
alias: "ha",
|
|
275003
274980
|
execute: (cmd2, baseAction) => {
|
|
275004
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
274981
|
+
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275005
274982
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275006
|
-
const
|
|
274983
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
275007
274984
|
const result = await settlemint.integrationTool.create({
|
|
275008
274985
|
name: name2,
|
|
275009
|
-
|
|
274986
|
+
applicationId: application,
|
|
275010
274987
|
integrationType: "HASURA",
|
|
275011
274988
|
provider,
|
|
275012
274989
|
region,
|
|
@@ -275018,7 +274995,7 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275018
274995
|
mapDefaultEnv: async () => {
|
|
275019
274996
|
return {
|
|
275020
274997
|
SETTLEMINT_APPLICATION: application,
|
|
275021
|
-
SETTLEMINT_HASURA: result.
|
|
274998
|
+
SETTLEMINT_HASURA: result.id,
|
|
275022
274999
|
...getHasuraEndpoints(result)
|
|
275023
275000
|
};
|
|
275024
275001
|
}
|
|
@@ -275033,7 +275010,7 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275033
275010
|
},
|
|
275034
275011
|
{
|
|
275035
275012
|
description: "Create a Hasura integration in a different application",
|
|
275036
|
-
command: "platform create integration-tool hasura my-hasura --application
|
|
275013
|
+
command: "platform create integration-tool hasura my-hasura --application-id 123456789"
|
|
275037
275014
|
}
|
|
275038
275015
|
]
|
|
275039
275016
|
});
|
|
@@ -275053,15 +275030,15 @@ function graphMiddlewareCreateCommand() {
|
|
|
275053
275030
|
type: "middleware",
|
|
275054
275031
|
alias: "gr",
|
|
275055
275032
|
execute: (cmd2, baseAction) => {
|
|
275056
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
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 }) => {
|
|
275057
275034
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275058
|
-
const
|
|
275059
|
-
const
|
|
275035
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
275036
|
+
const blockchainNode = blockchainNodeId ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275060
275037
|
const result = await settlemint.middleware.create({
|
|
275061
275038
|
name: name2,
|
|
275062
|
-
|
|
275039
|
+
applicationId: application,
|
|
275063
275040
|
interface: "HA_GRAPH",
|
|
275064
|
-
|
|
275041
|
+
blockchainNodeId: blockchainNode,
|
|
275065
275042
|
provider,
|
|
275066
275043
|
region,
|
|
275067
275044
|
size,
|
|
@@ -275070,11 +275047,11 @@ function graphMiddlewareCreateCommand() {
|
|
|
275070
275047
|
return {
|
|
275071
275048
|
result,
|
|
275072
275049
|
mapDefaultEnv: async () => {
|
|
275073
|
-
const
|
|
275050
|
+
const resource = await settlemint.middleware.read(result.id);
|
|
275074
275051
|
return {
|
|
275075
275052
|
SETTLEMINT_APPLICATION: application,
|
|
275076
|
-
SETTLEMINT_THEGRAPH: result.
|
|
275077
|
-
...await getGraphEndpoint(
|
|
275053
|
+
SETTLEMINT_THEGRAPH: result.id,
|
|
275054
|
+
...await getGraphEndpoint(resource, env2)
|
|
275078
275055
|
};
|
|
275079
275056
|
}
|
|
275080
275057
|
};
|
|
@@ -275088,7 +275065,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275088
275065
|
},
|
|
275089
275066
|
{
|
|
275090
275067
|
description: "Create a graph middleware in a different application",
|
|
275091
|
-
command: "platform create middleware graph my-graph --application
|
|
275068
|
+
command: "platform create middleware graph my-graph --application-id 123456789 --blockchain-node-id node-123 --storage-id storage-123"
|
|
275092
275069
|
}
|
|
275093
275070
|
]
|
|
275094
275071
|
});
|
|
@@ -275102,16 +275079,16 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275102
275079
|
type: "middleware",
|
|
275103
275080
|
alias: "scp",
|
|
275104
275081
|
execute: (cmd2, baseAction) => {
|
|
275105
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
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([
|
|
275106
275083
|
"StarterKitERC20Registry",
|
|
275107
275084
|
"StarterKitERC20Factory",
|
|
275108
275085
|
"StarterKitERC20",
|
|
275109
275086
|
"StarterKitERC20DexFactory",
|
|
275110
275087
|
"StarterKitERC20Dex"
|
|
275111
275088
|
])).action(async (name2, {
|
|
275112
|
-
|
|
275113
|
-
|
|
275114
|
-
|
|
275089
|
+
applicationId,
|
|
275090
|
+
blockchainNodeId,
|
|
275091
|
+
loadBalancerId,
|
|
275115
275092
|
provider,
|
|
275116
275093
|
region,
|
|
275117
275094
|
size,
|
|
@@ -275121,9 +275098,9 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275121
275098
|
...defaultArgs
|
|
275122
275099
|
}) => {
|
|
275123
275100
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275124
|
-
const
|
|
275125
|
-
const
|
|
275126
|
-
const
|
|
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);
|
|
275127
275104
|
const parsedAbis = [];
|
|
275128
275105
|
if (abis && abis.length > 0) {
|
|
275129
275106
|
try {
|
|
@@ -275140,10 +275117,10 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275140
275117
|
}
|
|
275141
275118
|
const result = await settlemint.middleware.create({
|
|
275142
275119
|
name: name2,
|
|
275143
|
-
|
|
275120
|
+
applicationId: application,
|
|
275144
275121
|
interface: "SMART_CONTRACT_PORTAL",
|
|
275145
|
-
|
|
275146
|
-
|
|
275122
|
+
blockchainNodeId: blockchainNode,
|
|
275123
|
+
loadBalancerId: loadBalancer,
|
|
275147
275124
|
abis: parsedAbis,
|
|
275148
275125
|
includePredeployedAbis,
|
|
275149
275126
|
provider,
|
|
@@ -275156,7 +275133,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275156
275133
|
mapDefaultEnv: async () => {
|
|
275157
275134
|
return {
|
|
275158
275135
|
SETTLEMINT_APPLICATION: application,
|
|
275159
|
-
SETTLEMINT_PORTAL: result.
|
|
275136
|
+
SETTLEMINT_PORTAL: result.id,
|
|
275160
275137
|
...getPortalEndpoints(result)
|
|
275161
275138
|
};
|
|
275162
275139
|
}
|
|
@@ -275171,7 +275148,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275171
275148
|
},
|
|
275172
275149
|
{
|
|
275173
275150
|
description: "Create a smart contract portal middleware in a different application",
|
|
275174
|
-
command: "platform create middleware smart-contract-portal my-portal --application
|
|
275151
|
+
command: "platform create middleware smart-contract-portal my-portal --application-id 123456789 --blockchain-node-id node-123"
|
|
275175
275152
|
}
|
|
275176
275153
|
]
|
|
275177
275154
|
});
|
|
@@ -275189,15 +275166,14 @@ function privateKeyHdCreateCommand() {
|
|
|
275189
275166
|
type: "private key",
|
|
275190
275167
|
alias: "hd",
|
|
275191
275168
|
execute: (cmd2, baseAction) => {
|
|
275192
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
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 }) => {
|
|
275193
275170
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275194
|
-
const
|
|
275195
|
-
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275171
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
275196
275172
|
const result = await settlemint.privateKey.create({
|
|
275197
275173
|
name: name2,
|
|
275198
|
-
|
|
275174
|
+
applicationId: application,
|
|
275199
275175
|
privateKeyType: "HD_ECDSA_P256",
|
|
275200
|
-
|
|
275176
|
+
blockchainNodes: blockchainNodeId ? [blockchainNodeId] : [],
|
|
275201
275177
|
provider,
|
|
275202
275178
|
region,
|
|
275203
275179
|
size,
|
|
@@ -275222,11 +275198,11 @@ function privateKeyHdCreateCommand() {
|
|
|
275222
275198
|
},
|
|
275223
275199
|
{
|
|
275224
275200
|
description: "Create a private key in a different application",
|
|
275225
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --application
|
|
275201
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --application-id 123456789"
|
|
275226
275202
|
},
|
|
275227
275203
|
{
|
|
275228
275204
|
description: "Create a private key linked to a blockchain node",
|
|
275229
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node
|
|
275205
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node-id node123"
|
|
275230
275206
|
}
|
|
275231
275207
|
]
|
|
275232
275208
|
});
|
|
@@ -275239,15 +275215,14 @@ function privateKeyHsmCreateCommand() {
|
|
|
275239
275215
|
type: "private key",
|
|
275240
275216
|
alias: "hd",
|
|
275241
275217
|
execute: (cmd2, baseAction) => {
|
|
275242
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
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 }) => {
|
|
275243
275219
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275244
|
-
const
|
|
275245
|
-
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275220
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
275246
275221
|
const result = await settlemint.privateKey.create({
|
|
275247
275222
|
name: name2,
|
|
275248
|
-
|
|
275223
|
+
applicationId: application,
|
|
275249
275224
|
privateKeyType: "HSM_ECDSA_P256",
|
|
275250
|
-
|
|
275225
|
+
blockchainNodes: blockchainNodeId ? [blockchainNodeId] : [],
|
|
275251
275226
|
provider,
|
|
275252
275227
|
region,
|
|
275253
275228
|
size,
|
|
@@ -275266,11 +275241,11 @@ function privateKeyHsmCreateCommand() {
|
|
|
275266
275241
|
},
|
|
275267
275242
|
{
|
|
275268
275243
|
description: "Create a private key in a different application",
|
|
275269
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --application 123456789"
|
|
275244
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --application-id 123456789"
|
|
275270
275245
|
},
|
|
275271
275246
|
{
|
|
275272
275247
|
description: "Create a private key linked to a blockchain node",
|
|
275273
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node
|
|
275248
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node-id node123"
|
|
275274
275249
|
}
|
|
275275
275250
|
]
|
|
275276
275251
|
});
|
|
@@ -275288,12 +275263,12 @@ function ipfsStorageCreateCommand() {
|
|
|
275288
275263
|
type: "storage",
|
|
275289
275264
|
alias: "ip",
|
|
275290
275265
|
execute: (cmd2, baseAction) => {
|
|
275291
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
275266
|
+
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275292
275267
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275293
|
-
const
|
|
275268
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
275294
275269
|
const result = await settlemint.storage.create({
|
|
275295
275270
|
name: name2,
|
|
275296
|
-
|
|
275271
|
+
applicationId: application,
|
|
275297
275272
|
storageProtocol: "IPFS",
|
|
275298
275273
|
provider,
|
|
275299
275274
|
region,
|
|
@@ -275304,7 +275279,8 @@ function ipfsStorageCreateCommand() {
|
|
|
275304
275279
|
result,
|
|
275305
275280
|
mapDefaultEnv: () => {
|
|
275306
275281
|
return {
|
|
275307
|
-
|
|
275282
|
+
SETTLEMINT_APPLICATION: application,
|
|
275283
|
+
SETTLEMINT_IPFS: result.id,
|
|
275308
275284
|
...getIpfsEndpoints(result)
|
|
275309
275285
|
};
|
|
275310
275286
|
}
|
|
@@ -275319,7 +275295,7 @@ function ipfsStorageCreateCommand() {
|
|
|
275319
275295
|
},
|
|
275320
275296
|
{
|
|
275321
275297
|
description: "Create an IPFS storage in a different application",
|
|
275322
|
-
command: "platform create storage ipfs my-storage --application app-123"
|
|
275298
|
+
command: "platform create storage ipfs my-storage --application-id app-123"
|
|
275323
275299
|
}
|
|
275324
275300
|
]
|
|
275325
275301
|
});
|
|
@@ -275332,12 +275308,12 @@ function minioStorageCreateCommand() {
|
|
|
275332
275308
|
type: "storage",
|
|
275333
275309
|
alias: "m",
|
|
275334
275310
|
execute: (cmd2, baseAction) => {
|
|
275335
|
-
addClusterServiceArgs(cmd2).option("--application <
|
|
275311
|
+
addClusterServiceArgs(cmd2).option("--application-id <applicationId>", "Application ID").action(async (name2, { applicationId, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275336
275312
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275337
|
-
const
|
|
275313
|
+
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
275338
275314
|
const result = await settlemint.storage.create({
|
|
275339
275315
|
name: name2,
|
|
275340
|
-
|
|
275316
|
+
applicationId: application,
|
|
275341
275317
|
storageProtocol: "MINIO",
|
|
275342
275318
|
provider,
|
|
275343
275319
|
region,
|
|
@@ -275349,7 +275325,7 @@ function minioStorageCreateCommand() {
|
|
|
275349
275325
|
mapDefaultEnv: () => {
|
|
275350
275326
|
return {
|
|
275351
275327
|
SETTLEMINT_APPLICATION: application,
|
|
275352
|
-
SETTLEMINT_MINIO: result.
|
|
275328
|
+
SETTLEMINT_MINIO: result.id,
|
|
275353
275329
|
...getMinioEndpoints(result)
|
|
275354
275330
|
};
|
|
275355
275331
|
}
|
|
@@ -275364,7 +275340,7 @@ function minioStorageCreateCommand() {
|
|
|
275364
275340
|
},
|
|
275365
275341
|
{
|
|
275366
275342
|
description: "Create a MinIO storage in a different application",
|
|
275367
|
-
command: "platform create storage minio my-storage --application app-123"
|
|
275343
|
+
command: "platform create storage minio my-storage --application-id app-123"
|
|
275368
275344
|
}
|
|
275369
275345
|
]
|
|
275370
275346
|
});
|
|
@@ -275410,11 +275386,11 @@ function getDeleteCommand({
|
|
|
275410
275386
|
deleteFunction,
|
|
275411
275387
|
usePersonalAccessToken = true
|
|
275412
275388
|
}) {
|
|
275413
|
-
return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4}
|
|
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.
|
|
275414
275390
|
${createExamples([
|
|
275415
275391
|
{
|
|
275416
|
-
description: `Deletes the specified ${type4} by
|
|
275417
|
-
command: `platform delete ${type4} <${type4}-
|
|
275392
|
+
description: `Deletes the specified ${type4} by id`,
|
|
275393
|
+
command: `platform delete ${type4} <${type4}-id>`
|
|
275418
275394
|
},
|
|
275419
275395
|
{
|
|
275420
275396
|
description: `Deletes the default ${type4} in the production environment`,
|
|
@@ -275422,9 +275398,9 @@ ${createExamples([
|
|
|
275422
275398
|
},
|
|
275423
275399
|
{
|
|
275424
275400
|
description: `Force deletes the specified ${type4} without confirmation`,
|
|
275425
|
-
command: `platform delete ${type4} <${type4}-
|
|
275401
|
+
command: `platform delete ${type4} <${type4}-id> --force`
|
|
275426
275402
|
}
|
|
275427
|
-
])}`).argument("<
|
|
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 }) => {
|
|
275428
275404
|
intro(`Deleting ${type4} in the SettleMint platform`);
|
|
275429
275405
|
if (!force) {
|
|
275430
275406
|
await deleteConfirmationPrompt(`this ${type4}`);
|
|
@@ -275442,19 +275418,19 @@ ${createExamples([
|
|
|
275442
275418
|
accessToken,
|
|
275443
275419
|
instance
|
|
275444
275420
|
});
|
|
275445
|
-
const
|
|
275446
|
-
const
|
|
275447
|
-
if (!
|
|
275421
|
+
const isDefaultId = id === "default";
|
|
275422
|
+
const serviceId = isDefaultId ? typeof env2[envKey] === "string" ? env2[envKey] : null : id;
|
|
275423
|
+
if (!serviceId) {
|
|
275448
275424
|
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} ID or set a default ${type4} first.`);
|
|
275449
275425
|
}
|
|
275450
275426
|
const result = await spinner({
|
|
275451
275427
|
startMessage: `Deleting ${type4}`,
|
|
275452
275428
|
task: async () => {
|
|
275453
|
-
return deleteFunction(settlemint,
|
|
275429
|
+
return deleteFunction(settlemint, serviceId);
|
|
275454
275430
|
},
|
|
275455
275431
|
stopMessage: `${capitalizeFirstLetter(type4)} deleted`
|
|
275456
275432
|
});
|
|
275457
|
-
if (
|
|
275433
|
+
if (isDefaultId) {
|
|
275458
275434
|
const newEnv = {
|
|
275459
275435
|
SETTLEMINT_ACCESS_TOKEN: usePersonalAccessToken ? env2.SETTLEMINT_ACCESS_TOKEN : accessToken,
|
|
275460
275436
|
SETTLEMINT_INSTANCE: instance,
|
|
@@ -275464,7 +275440,7 @@ ${createExamples([
|
|
|
275464
275440
|
note(`${capitalizeFirstLetter(type4)} removed as default`);
|
|
275465
275441
|
}
|
|
275466
275442
|
if (wait) {
|
|
275467
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275443
|
+
await waitForCompletion({ settlemint, type: type4, id: serviceId, action: "destroy" });
|
|
275468
275444
|
}
|
|
275469
275445
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} deleted successfully`);
|
|
275470
275446
|
});
|
|
@@ -275477,8 +275453,8 @@ function workspaceDeleteCommand() {
|
|
|
275477
275453
|
type: "workspace",
|
|
275478
275454
|
alias: "w",
|
|
275479
275455
|
envKey: "SETTLEMINT_WORKSPACE",
|
|
275480
|
-
deleteFunction: async (settlemint,
|
|
275481
|
-
return settlemint.workspace.delete(
|
|
275456
|
+
deleteFunction: async (settlemint, id) => {
|
|
275457
|
+
return settlemint.workspace.delete(id);
|
|
275482
275458
|
}
|
|
275483
275459
|
});
|
|
275484
275460
|
}
|
|
@@ -275527,7 +275503,7 @@ ${createExamples([
|
|
|
275527
275503
|
description: `Restarts the default ${type4} in the production environment`,
|
|
275528
275504
|
command: `platform restart ${commandName}${subType ? ` ${subType}` : ""} default --prod`
|
|
275529
275505
|
}
|
|
275530
|
-
])}`).argument("<
|
|
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 }) => {
|
|
275531
275507
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
|
275532
275508
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275533
275509
|
const env2 = await loadEnv2(false, !!prod);
|
|
@@ -275542,20 +275518,20 @@ ${createExamples([
|
|
|
275542
275518
|
accessToken,
|
|
275543
275519
|
instance
|
|
275544
275520
|
});
|
|
275545
|
-
const
|
|
275546
|
-
const
|
|
275547
|
-
if (!
|
|
275548
|
-
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4}
|
|
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.`);
|
|
275549
275525
|
}
|
|
275550
275526
|
const result = await spinner({
|
|
275551
275527
|
startMessage: `Restarting ${type4}`,
|
|
275552
275528
|
task: async () => {
|
|
275553
|
-
return restartFunction(settlemint,
|
|
275529
|
+
return restartFunction(settlemint, serviceId);
|
|
275554
275530
|
},
|
|
275555
275531
|
stopMessage: `${capitalizeFirstLetter(type4)} restart initiated`
|
|
275556
275532
|
});
|
|
275557
275533
|
if (wait) {
|
|
275558
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275534
|
+
await waitForCompletion({ settlemint, type: type4, id: serviceId, action: "restart" });
|
|
275559
275535
|
}
|
|
275560
275536
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} restart initiated successfully`);
|
|
275561
275537
|
});
|
|
@@ -275568,8 +275544,8 @@ function blockchainNetworkRestartCommand() {
|
|
|
275568
275544
|
type: "blockchain network",
|
|
275569
275545
|
alias: "bn",
|
|
275570
275546
|
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
|
275571
|
-
restartFunction: async (settlemint,
|
|
275572
|
-
return settlemint.blockchainNetwork.restart(
|
|
275547
|
+
restartFunction: async (settlemint, id) => {
|
|
275548
|
+
return settlemint.blockchainNetwork.restart(id);
|
|
275573
275549
|
}
|
|
275574
275550
|
});
|
|
275575
275551
|
}
|
|
@@ -275581,8 +275557,8 @@ function customDeploymentRestartCommand() {
|
|
|
275581
275557
|
type: "custom deployment",
|
|
275582
275558
|
alias: "cd",
|
|
275583
275559
|
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
|
275584
|
-
restartFunction: async (settlemint,
|
|
275585
|
-
return settlemint.customDeployment.restart(
|
|
275560
|
+
restartFunction: async (settlemint, id) => {
|
|
275561
|
+
return settlemint.customDeployment.restart(id);
|
|
275586
275562
|
},
|
|
275587
275563
|
usePersonalAccessToken: false
|
|
275588
275564
|
});
|
|
@@ -275596,8 +275572,8 @@ function blockscoutRestartCommand() {
|
|
|
275596
275572
|
subType: "blockscout",
|
|
275597
275573
|
alias: "bs",
|
|
275598
275574
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
|
275599
|
-
restartFunction: async (settlemint,
|
|
275600
|
-
return settlemint.insights.restart(
|
|
275575
|
+
restartFunction: async (settlemint, id) => {
|
|
275576
|
+
return settlemint.insights.restart(id);
|
|
275601
275577
|
}
|
|
275602
275578
|
});
|
|
275603
275579
|
}
|
|
@@ -275615,8 +275591,8 @@ function hasuraRestartCommand() {
|
|
|
275615
275591
|
subType: "hasura",
|
|
275616
275592
|
alias: "ha",
|
|
275617
275593
|
envKey: "SETTLEMINT_HASURA",
|
|
275618
|
-
restartFunction: async (settlemint,
|
|
275619
|
-
return settlemint.integrationTool.restart(
|
|
275594
|
+
restartFunction: async (settlemint, id) => {
|
|
275595
|
+
return settlemint.integrationTool.restart(id);
|
|
275620
275596
|
}
|
|
275621
275597
|
});
|
|
275622
275598
|
}
|
|
@@ -275648,8 +275624,8 @@ function smartContractPortalRestartCommand() {
|
|
|
275648
275624
|
subType: "smart-contract-portal",
|
|
275649
275625
|
alias: "scp",
|
|
275650
275626
|
envKey: "SETTLEMINT_PORTAL",
|
|
275651
|
-
restartFunction: async (settlemint,
|
|
275652
|
-
return settlemint.middleware.restart(
|
|
275627
|
+
restartFunction: async (settlemint, id) => {
|
|
275628
|
+
return settlemint.middleware.restart(id);
|
|
275653
275629
|
}
|
|
275654
275630
|
});
|
|
275655
275631
|
}
|
|
@@ -275667,8 +275643,8 @@ function hdEcdsaP256RestartCommand() {
|
|
|
275667
275643
|
subType: "hd-ecdsa-p256",
|
|
275668
275644
|
alias: "hd",
|
|
275669
275645
|
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
|
275670
|
-
restartFunction: async (settlemint,
|
|
275671
|
-
return settlemint.privateKey.restart(
|
|
275646
|
+
restartFunction: async (settlemint, id) => {
|
|
275647
|
+
return settlemint.privateKey.restart(id);
|
|
275672
275648
|
}
|
|
275673
275649
|
});
|
|
275674
275650
|
}
|
|
@@ -275685,8 +275661,8 @@ function ipfsRestartCommand() {
|
|
|
275685
275661
|
type: "storage",
|
|
275686
275662
|
alias: "ip",
|
|
275687
275663
|
envKey: "SETTLEMINT_IPFS",
|
|
275688
|
-
restartFunction: async (settlemint,
|
|
275689
|
-
return settlemint.storage.restart(
|
|
275664
|
+
restartFunction: async (settlemint, id) => {
|
|
275665
|
+
return settlemint.storage.restart(id);
|
|
275690
275666
|
}
|
|
275691
275667
|
});
|
|
275692
275668
|
}
|
|
@@ -275698,8 +275674,8 @@ function minioRestartCommand() {
|
|
|
275698
275674
|
type: "storage",
|
|
275699
275675
|
alias: "m",
|
|
275700
275676
|
envKey: "SETTLEMINT_MINIO",
|
|
275701
|
-
restartFunction: async (settlemint,
|
|
275702
|
-
return settlemint.storage.restart(
|
|
275677
|
+
restartFunction: async (settlemint, id) => {
|
|
275678
|
+
return settlemint.storage.restart(id);
|
|
275703
275679
|
}
|
|
275704
275680
|
});
|
|
275705
275681
|
}
|
|
@@ -275717,12 +275693,12 @@ function restartCommand() {
|
|
|
275717
275693
|
|
|
275718
275694
|
// src/commands/platform/custom-deployments/update.ts
|
|
275719
275695
|
function customDeploymentsUpdateCommand() {
|
|
275720
|
-
return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--
|
|
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 }) => {
|
|
275721
275697
|
intro("Updating custom deployment in the SettleMint platform");
|
|
275722
275698
|
const env2 = await loadEnv2(false, !!prod);
|
|
275723
|
-
const
|
|
275724
|
-
if (!
|
|
275725
|
-
throw new Error("No custom deployment
|
|
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");
|
|
275726
275702
|
}
|
|
275727
275703
|
const instance = await instancePrompt(env2, true);
|
|
275728
275704
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
@@ -275738,17 +275714,12 @@ function customDeploymentsUpdateCommand() {
|
|
|
275738
275714
|
const customDeployment = await spinner({
|
|
275739
275715
|
startMessage: "Updating custom deployment",
|
|
275740
275716
|
task: async () => {
|
|
275741
|
-
return settlemint.customDeployment.update(
|
|
275717
|
+
return settlemint.customDeployment.update(customDeploymentId, tag);
|
|
275742
275718
|
},
|
|
275743
275719
|
stopMessage: "Custom deployment updated"
|
|
275744
275720
|
});
|
|
275745
275721
|
if (wait) {
|
|
275746
|
-
await waitForCompletion({
|
|
275747
|
-
settlemint,
|
|
275748
|
-
type: "custom deployment",
|
|
275749
|
-
uniqueName: customDeployment.uniqueName,
|
|
275750
|
-
action: "deploy"
|
|
275751
|
-
});
|
|
275722
|
+
await waitForCompletion({ settlemint, type: "custom deployment", id: customDeployment.id, action: "deploy" });
|
|
275752
275723
|
}
|
|
275753
275724
|
outro(`${customDeployment.name} updated to ${tag}`);
|
|
275754
275725
|
});
|
|
@@ -276137,7 +276108,7 @@ function isHardhatConfig(config4) {
|
|
|
276137
276108
|
|
|
276138
276109
|
// src/commands/smart-contract-set/hardhat/deploy/remote.ts
|
|
276139
276110
|
function hardhatDeployRemoteCommand() {
|
|
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 <
|
|
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");
|
|
276141
276112
|
cmd2.action(async ({
|
|
276142
276113
|
module,
|
|
276143
276114
|
reset: reset2,
|
|
@@ -276148,7 +276119,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276148
276119
|
strategy,
|
|
276149
276120
|
prod,
|
|
276150
276121
|
acceptDefaults,
|
|
276151
|
-
|
|
276122
|
+
blockchainNodeId
|
|
276152
276123
|
}) => {
|
|
276153
276124
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276154
276125
|
const env2 = await loadEnv(false, !!prod);
|
|
@@ -276163,15 +276134,15 @@ function hardhatDeployRemoteCommand() {
|
|
|
276163
276134
|
accessToken,
|
|
276164
276135
|
instance
|
|
276165
276136
|
});
|
|
276166
|
-
const
|
|
276137
|
+
const nodeId = blockchainNodeId ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276167
276138
|
let node = undefined;
|
|
276168
|
-
if (!
|
|
276139
|
+
if (!nodeId) {
|
|
276169
276140
|
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276170
276141
|
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276171
276142
|
if (evmNodes.length === 0) {
|
|
276172
276143
|
cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276173
276144
|
}
|
|
276174
|
-
const nodesWithPrivateKey = await Promise.all(
|
|
276145
|
+
const nodesWithPrivateKey = await Promise.all(evmNodes.map((node2) => settlemint.blockchainNode.read(node2.id)));
|
|
276175
276146
|
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276176
276147
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276177
276148
|
cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
@@ -276182,12 +276153,12 @@ function hardhatDeployRemoteCommand() {
|
|
|
276182
276153
|
}
|
|
276183
276154
|
node = blockchainNode;
|
|
276184
276155
|
} else {
|
|
276185
|
-
node = await settlemint.blockchainNode.read(
|
|
276156
|
+
node = await settlemint.blockchainNode.read(nodeId);
|
|
276186
276157
|
if (!node.isEvm) {
|
|
276187
276158
|
cancel2("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276188
276159
|
}
|
|
276189
276160
|
}
|
|
276190
|
-
const envConfig = await settlemint.foundry.env(node.
|
|
276161
|
+
const envConfig = await settlemint.foundry.env(node.id);
|
|
276191
276162
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276192
276163
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
276193
276164
|
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");
|
|
@@ -276251,8 +276222,8 @@ function hardhatScriptLocalCommand() {
|
|
|
276251
276222
|
|
|
276252
276223
|
// src/commands/smart-contract-set/hardhat/script/remote.ts
|
|
276253
276224
|
function hardhatScriptRemoteCommand() {
|
|
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 <
|
|
276255
|
-
cmd2.action(async ({ script, prod,
|
|
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 }) => {
|
|
276256
276227
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276257
276228
|
const env2 = await loadEnv(false, !!prod);
|
|
276258
276229
|
const instance = await instancePrompt(env2, true);
|
|
@@ -276266,16 +276237,16 @@ function hardhatScriptRemoteCommand() {
|
|
|
276266
276237
|
accessToken,
|
|
276267
276238
|
instance
|
|
276268
276239
|
});
|
|
276269
|
-
let
|
|
276270
|
-
if (!
|
|
276240
|
+
let nodeId = blockchainNodeId;
|
|
276241
|
+
if (!nodeId) {
|
|
276271
276242
|
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276272
276243
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
276273
276244
|
if (!blockchainNode) {
|
|
276274
276245
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
276275
276246
|
}
|
|
276276
|
-
|
|
276247
|
+
nodeId = blockchainNode.id;
|
|
276277
276248
|
}
|
|
276278
|
-
const envConfig = await settlemint.foundry.env(
|
|
276249
|
+
const envConfig = await settlemint.foundry.env(nodeId);
|
|
276279
276250
|
const { command, args } = await getPackageManagerExecutable();
|
|
276280
276251
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276281
276252
|
});
|
|
@@ -276684,4 +276655,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276684
276655
|
cancel2(reason);
|
|
276685
276656
|
});
|
|
276686
276657
|
|
|
276687
|
-
//# debugId=
|
|
276658
|
+
//# debugId=6CF0D3B0549E1CCE64756E2164756E21
|