@settlemint/sdk-cli 0.7.4-prdfc1a4de → 0.7.4-pre024885e
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 +1035 -1004
- package/dist/cli.js.map +50 -50
- 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.qRtc5bakoO:/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-pre024885e",
|
|
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.qRtc5bakoO:/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.qRtc5bakoO:/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.qRtc5bakoO:/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.qRtc5bakoO:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
|
|
235217
235217
|
];
|
|
235218
235218
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
235219
235219
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -267675,10 +267675,7 @@ var cancel = (msg) => {
|
|
|
267675
267675
|
var ApplicationAccessTokenSchema = z3.string().regex(/^sm_aat_.*$/);
|
|
267676
267676
|
var PersonalAccessTokenSchema = z3.string().regex(/^sm_pat_.*$/);
|
|
267677
267677
|
var AccessTokenSchema = z3.string().regex(/^sm_pat_.*|sm_aat_.*$/);
|
|
267678
|
-
var
|
|
267679
|
-
z3.string().uuid(),
|
|
267680
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
267681
|
-
]);
|
|
267678
|
+
var UniqueNameSchema = z3.string().regex(/^[a-z0-9-]+$/);
|
|
267682
267679
|
var UrlSchema = z3.string().url();
|
|
267683
267680
|
var UrlPathSchema = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
267684
267681
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -267688,33 +267685,33 @@ var DotEnvSchema = z3.object({
|
|
|
267688
267685
|
SETTLEMINT_INSTANCE: UrlSchema.default("https://console.settlemint.com"),
|
|
267689
267686
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema.optional(),
|
|
267690
267687
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema.optional(),
|
|
267691
|
-
SETTLEMINT_WORKSPACE:
|
|
267692
|
-
SETTLEMINT_APPLICATION:
|
|
267693
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
267694
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
267695
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
267696
|
-
SETTLEMINT_HASURA:
|
|
267688
|
+
SETTLEMINT_WORKSPACE: UniqueNameSchema.optional(),
|
|
267689
|
+
SETTLEMINT_APPLICATION: UniqueNameSchema.optional(),
|
|
267690
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema.optional(),
|
|
267691
|
+
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema.optional(),
|
|
267692
|
+
SETTLEMINT_LOAD_BALANCER: UniqueNameSchema.optional(),
|
|
267693
|
+
SETTLEMINT_HASURA: UniqueNameSchema.optional(),
|
|
267697
267694
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema.optional(),
|
|
267698
267695
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
267699
267696
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
267700
|
-
SETTLEMINT_THEGRAPH:
|
|
267697
|
+
SETTLEMINT_THEGRAPH: UniqueNameSchema.optional(),
|
|
267701
267698
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson(value4, []), z3.array(UrlSchema).optional()),
|
|
267702
267699
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
267703
|
-
SETTLEMINT_PORTAL:
|
|
267700
|
+
SETTLEMINT_PORTAL: UniqueNameSchema.optional(),
|
|
267704
267701
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
|
267705
267702
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema.optional(),
|
|
267706
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
267707
|
-
SETTLEMINT_MINIO:
|
|
267703
|
+
SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema.optional(),
|
|
267704
|
+
SETTLEMINT_MINIO: UniqueNameSchema.optional(),
|
|
267708
267705
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema.optional(),
|
|
267709
267706
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
267710
267707
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
267711
|
-
SETTLEMINT_IPFS:
|
|
267708
|
+
SETTLEMINT_IPFS: UniqueNameSchema.optional(),
|
|
267712
267709
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema.optional(),
|
|
267713
267710
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema.optional(),
|
|
267714
267711
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema.optional(),
|
|
267715
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
267712
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema.optional(),
|
|
267716
267713
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema.optional(),
|
|
267717
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
267714
|
+
SETTLEMINT_BLOCKSCOUT: UniqueNameSchema.optional(),
|
|
267718
267715
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema.optional(),
|
|
267719
267716
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema.optional(),
|
|
267720
267717
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -267722,6 +267719,10 @@ var DotEnvSchema = z3.object({
|
|
|
267722
267719
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
267723
267720
|
});
|
|
267724
267721
|
var DotEnvSchemaPartial = DotEnvSchema.partial();
|
|
267722
|
+
var IdSchema = z3.union([
|
|
267723
|
+
z3.string().uuid(),
|
|
267724
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
267725
|
+
]);
|
|
267725
267726
|
function validate(schema, value4) {
|
|
267726
267727
|
try {
|
|
267727
267728
|
return schema.parse(value4);
|
|
@@ -269969,10 +269970,7 @@ function tryParseJson2(value4, defaultValue = null) {
|
|
|
269969
269970
|
return defaultValue;
|
|
269970
269971
|
}
|
|
269971
269972
|
}
|
|
269972
|
-
var
|
|
269973
|
-
z3.string().uuid(),
|
|
269974
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
269975
|
-
]);
|
|
269973
|
+
var UniqueNameSchema2 = z3.string().regex(/^[a-z0-9-]+$/);
|
|
269976
269974
|
var UrlSchema2 = z3.string().url();
|
|
269977
269975
|
var UrlPathSchema2 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
269978
269976
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -269982,33 +269980,33 @@ var DotEnvSchema2 = z3.object({
|
|
|
269982
269980
|
SETTLEMINT_INSTANCE: UrlSchema2.default("https://console.settlemint.com"),
|
|
269983
269981
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema2.optional(),
|
|
269984
269982
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema2.optional(),
|
|
269985
|
-
SETTLEMINT_WORKSPACE:
|
|
269986
|
-
SETTLEMINT_APPLICATION:
|
|
269987
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
269988
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
269989
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
269990
|
-
SETTLEMINT_HASURA:
|
|
269983
|
+
SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
|
|
269984
|
+
SETTLEMINT_APPLICATION: UniqueNameSchema2.optional(),
|
|
269985
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema2.optional(),
|
|
269986
|
+
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema2.optional(),
|
|
269987
|
+
SETTLEMINT_LOAD_BALANCER: UniqueNameSchema2.optional(),
|
|
269988
|
+
SETTLEMINT_HASURA: UniqueNameSchema2.optional(),
|
|
269991
269989
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema2.optional(),
|
|
269992
269990
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
269993
269991
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
269994
|
-
SETTLEMINT_THEGRAPH:
|
|
269992
|
+
SETTLEMINT_THEGRAPH: UniqueNameSchema2.optional(),
|
|
269995
269993
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson2(value4, []), z3.array(UrlSchema2).optional()),
|
|
269996
269994
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
269997
|
-
SETTLEMINT_PORTAL:
|
|
269995
|
+
SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
|
|
269998
269996
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
269999
269997
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
|
|
270000
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
270001
|
-
SETTLEMINT_MINIO:
|
|
269998
|
+
SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema2.optional(),
|
|
269999
|
+
SETTLEMINT_MINIO: UniqueNameSchema2.optional(),
|
|
270002
270000
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema2.optional(),
|
|
270003
270001
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
270004
270002
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
270005
|
-
SETTLEMINT_IPFS:
|
|
270003
|
+
SETTLEMINT_IPFS: UniqueNameSchema2.optional(),
|
|
270006
270004
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema2.optional(),
|
|
270007
270005
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema2.optional(),
|
|
270008
270006
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema2.optional(),
|
|
270009
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
270007
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema2.optional(),
|
|
270010
270008
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema2.optional(),
|
|
270011
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
270009
|
+
SETTLEMINT_BLOCKSCOUT: UniqueNameSchema2.optional(),
|
|
270012
270010
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
270013
270011
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema2.optional(),
|
|
270014
270012
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -270016,6 +270014,10 @@ var DotEnvSchema2 = z3.object({
|
|
|
270016
270014
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
270017
270015
|
});
|
|
270018
270016
|
var DotEnvSchemaPartial2 = DotEnvSchema2.partial();
|
|
270017
|
+
var IdSchema2 = z3.union([
|
|
270018
|
+
z3.string().uuid(),
|
|
270019
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270020
|
+
]);
|
|
270019
270021
|
function validate2(schema, value4) {
|
|
270020
270022
|
try {
|
|
270021
270023
|
return schema.parse(value4);
|
|
@@ -270627,10 +270629,7 @@ function tryParseJson3(value4, defaultValue = null) {
|
|
|
270627
270629
|
return defaultValue;
|
|
270628
270630
|
}
|
|
270629
270631
|
}
|
|
270630
|
-
var
|
|
270631
|
-
z3.string().uuid(),
|
|
270632
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270633
|
-
]);
|
|
270632
|
+
var UniqueNameSchema3 = z3.string().regex(/^[a-z0-9-]+$/);
|
|
270634
270633
|
var UrlSchema3 = z3.string().url();
|
|
270635
270634
|
var UrlPathSchema3 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
270636
270635
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -270640,33 +270639,33 @@ var DotEnvSchema3 = z3.object({
|
|
|
270640
270639
|
SETTLEMINT_INSTANCE: UrlSchema3.default("https://console.settlemint.com"),
|
|
270641
270640
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema3.optional(),
|
|
270642
270641
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema3.optional(),
|
|
270643
|
-
SETTLEMINT_WORKSPACE:
|
|
270644
|
-
SETTLEMINT_APPLICATION:
|
|
270645
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
270646
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
270647
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
270648
|
-
SETTLEMINT_HASURA:
|
|
270642
|
+
SETTLEMINT_WORKSPACE: UniqueNameSchema3.optional(),
|
|
270643
|
+
SETTLEMINT_APPLICATION: UniqueNameSchema3.optional(),
|
|
270644
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema3.optional(),
|
|
270645
|
+
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema3.optional(),
|
|
270646
|
+
SETTLEMINT_LOAD_BALANCER: UniqueNameSchema3.optional(),
|
|
270647
|
+
SETTLEMINT_HASURA: UniqueNameSchema3.optional(),
|
|
270649
270648
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema3.optional(),
|
|
270650
270649
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
270651
270650
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
270652
|
-
SETTLEMINT_THEGRAPH:
|
|
270651
|
+
SETTLEMINT_THEGRAPH: UniqueNameSchema3.optional(),
|
|
270653
270652
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson3(value4, []), z3.array(UrlSchema3).optional()),
|
|
270654
270653
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
270655
|
-
SETTLEMINT_PORTAL:
|
|
270654
|
+
SETTLEMINT_PORTAL: UniqueNameSchema3.optional(),
|
|
270656
270655
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
|
|
270657
270656
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema3.optional(),
|
|
270658
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
270659
|
-
SETTLEMINT_MINIO:
|
|
270657
|
+
SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema3.optional(),
|
|
270658
|
+
SETTLEMINT_MINIO: UniqueNameSchema3.optional(),
|
|
270660
270659
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema3.optional(),
|
|
270661
270660
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
270662
270661
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
270663
|
-
SETTLEMINT_IPFS:
|
|
270662
|
+
SETTLEMINT_IPFS: UniqueNameSchema3.optional(),
|
|
270664
270663
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema3.optional(),
|
|
270665
270664
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema3.optional(),
|
|
270666
270665
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema3.optional(),
|
|
270667
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
270666
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema3.optional(),
|
|
270668
270667
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema3.optional(),
|
|
270669
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
270668
|
+
SETTLEMINT_BLOCKSCOUT: UniqueNameSchema3.optional(),
|
|
270670
270669
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
|
|
270671
270670
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema3.optional(),
|
|
270672
270671
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -270674,6 +270673,10 @@ var DotEnvSchema3 = z3.object({
|
|
|
270674
270673
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
270675
270674
|
});
|
|
270676
270675
|
var DotEnvSchemaPartial3 = DotEnvSchema3.partial();
|
|
270676
|
+
var IdSchema3 = z3.union([
|
|
270677
|
+
z3.string().uuid(),
|
|
270678
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270679
|
+
]);
|
|
270677
270680
|
function validate3(schema, value4) {
|
|
270678
270681
|
try {
|
|
270679
270682
|
return schema.parse(value4);
|
|
@@ -271278,95 +271281,256 @@ var t7 = initGraphQLTada();
|
|
|
271278
271281
|
|
|
271279
271282
|
// ../js/dist/settlemint.mjs
|
|
271280
271283
|
var graphql = initGraphQLTada();
|
|
271281
|
-
var createApplicationAccessToken = graphql(`
|
|
271282
|
-
mutation CreateApplicationAccessToken($applicationId: ID!, $blockchainNetworkScope: BlockchainNetworkScopeInputType!, $blockchainNodeScope: BlockchainNodeScopeInputType!, $customDeploymentScope: CustomDeploymentScopeInputType!, $insightsScope: InsightsScopeInputType!, $integrationScope: IntegrationScopeInputType!, $loadBalancerScope: LoadBalancerScopeInputType!, $middlewareScope: MiddlewareScopeInputType!, $name: String!, $privateKeyScope: PrivateKeyScopeInputType!, $smartContractSetScope: SmartContractSetScopeInputType!, $storageScope: StorageScopeInputType!, $validityPeriod: AccessTokenValidityPeriod!) {
|
|
271283
|
-
createApplicationAccessToken(applicationId: $applicationId, blockchainNetworkScope: $blockchainNetworkScope, blockchainNodeScope: $blockchainNodeScope, customDeploymentScope: $customDeploymentScope, insightsScope: $insightsScope, integrationScope: $integrationScope, loadBalancerScope: $loadBalancerScope, middlewareScope: $middlewareScope, name: $name, privateKeyScope: $privateKeyScope, smartContractSetScope: $smartContractSetScope, storageScope: $storageScope, validityPeriod: $validityPeriod) {
|
|
271284
|
-
token
|
|
271285
|
-
}
|
|
271286
|
-
}
|
|
271287
|
-
`, []);
|
|
271288
|
-
var applicationAccessTokenCreate = (gqlClient, options) => {
|
|
271289
|
-
return async (args) => {
|
|
271290
|
-
validate3(IdSchema3, args.applicationId);
|
|
271291
|
-
const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, args);
|
|
271292
|
-
if (!applicationAccessToken.token) {
|
|
271293
|
-
throw new Error("Failed to create application access token");
|
|
271294
|
-
}
|
|
271295
|
-
return applicationAccessToken.token;
|
|
271296
|
-
};
|
|
271297
|
-
};
|
|
271298
271284
|
var ApplicationFragment = graphql(`
|
|
271299
271285
|
fragment Application on Application {
|
|
271300
271286
|
id
|
|
271287
|
+
uniqueName
|
|
271301
271288
|
name
|
|
271302
|
-
workspace {
|
|
271289
|
+
workspace {
|
|
271290
|
+
id
|
|
271291
|
+
uniqueName
|
|
271292
|
+
}
|
|
271303
271293
|
}
|
|
271304
271294
|
`);
|
|
271305
|
-
var
|
|
271306
|
-
|
|
271307
|
-
|
|
271295
|
+
var WorkspaceFragment = graphql(`
|
|
271296
|
+
fragment Workspace on Workspace {
|
|
271297
|
+
id
|
|
271298
|
+
uniqueName
|
|
271299
|
+
name
|
|
271308
271300
|
applications {
|
|
271309
271301
|
...Application
|
|
271310
271302
|
}
|
|
271311
271303
|
}
|
|
271312
|
-
|
|
271304
|
+
`, [ApplicationFragment]);
|
|
271305
|
+
var getWorkspacesAndApplications = graphql(`
|
|
271306
|
+
query getWorkspacesAndApplications {
|
|
271307
|
+
workspaces {
|
|
271308
|
+
...Workspace
|
|
271309
|
+
applications {
|
|
271310
|
+
...Application
|
|
271311
|
+
}
|
|
271312
|
+
childWorkspaces {
|
|
271313
|
+
...Workspace
|
|
271314
|
+
}
|
|
271315
|
+
}
|
|
271316
|
+
}
|
|
271317
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271318
|
+
var getWorkspace = graphql(`
|
|
271319
|
+
query getWorkspace($uniqueName: String!) {
|
|
271320
|
+
workspaceByUniqueName(uniqueName: $uniqueName) {
|
|
271321
|
+
...Workspace
|
|
271322
|
+
applications {
|
|
271323
|
+
...Application
|
|
271324
|
+
}
|
|
271325
|
+
}
|
|
271326
|
+
}
|
|
271327
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271328
|
+
var createWorkspace = graphql(`
|
|
271329
|
+
mutation CreateWorkspace(
|
|
271330
|
+
$addressLine1: String
|
|
271331
|
+
$addressLine2: String
|
|
271332
|
+
$city: String
|
|
271333
|
+
$companyName: String
|
|
271334
|
+
$country: String
|
|
271335
|
+
$name: String!
|
|
271336
|
+
$parentId: String
|
|
271337
|
+
$paymentMethodId: String
|
|
271338
|
+
$postalCode: String
|
|
271339
|
+
$taxIdType: String
|
|
271340
|
+
$taxIdValue: String
|
|
271341
|
+
) {
|
|
271342
|
+
createWorkspace(
|
|
271343
|
+
addressLine1: $addressLine1
|
|
271344
|
+
addressLine2: $addressLine2
|
|
271345
|
+
city: $city
|
|
271346
|
+
companyName: $companyName
|
|
271347
|
+
country: $country
|
|
271348
|
+
name: $name
|
|
271349
|
+
parentId: $parentId
|
|
271350
|
+
paymentMethodId: $paymentMethodId
|
|
271351
|
+
postalCode: $postalCode
|
|
271352
|
+
taxIdType: $taxIdType
|
|
271353
|
+
taxIdValue: $taxIdValue
|
|
271354
|
+
) {
|
|
271355
|
+
...Workspace
|
|
271356
|
+
applications {
|
|
271357
|
+
...Application
|
|
271358
|
+
}
|
|
271359
|
+
}
|
|
271360
|
+
}
|
|
271361
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271362
|
+
var deleteWorkspace = graphql(`
|
|
271363
|
+
mutation deleteWorkspace($id: ID!) {
|
|
271364
|
+
deleteWorkspace(workspaceId: $id) {
|
|
271365
|
+
...Workspace
|
|
271366
|
+
applications {
|
|
271367
|
+
...Application
|
|
271368
|
+
}
|
|
271369
|
+
}
|
|
271370
|
+
}
|
|
271371
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271372
|
+
var addCredits = graphql(`
|
|
271373
|
+
mutation addCredits($workspaceId: String!, $amount: Float!) {
|
|
271374
|
+
addCredits(workspaceId: $workspaceId, amount: $amount)
|
|
271375
|
+
}
|
|
271376
|
+
`);
|
|
271377
|
+
var workspaceList = (gqlClient, options) => {
|
|
271378
|
+
return async () => {
|
|
271379
|
+
const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
|
|
271380
|
+
const allWorkspaces = workspaces.reduce((acc, workspace) => {
|
|
271381
|
+
acc.push(workspace);
|
|
271382
|
+
if (workspace.childWorkspaces) {
|
|
271383
|
+
acc.push(...workspace.childWorkspaces);
|
|
271384
|
+
}
|
|
271385
|
+
return acc;
|
|
271386
|
+
}, []);
|
|
271387
|
+
return allWorkspaces.sort((a8, b4) => a8.name.localeCompare(b4.name));
|
|
271388
|
+
};
|
|
271389
|
+
};
|
|
271390
|
+
var workspaceRead = (gqlClient, options) => {
|
|
271391
|
+
return async (workspaceUniqueName) => {
|
|
271392
|
+
const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });
|
|
271393
|
+
return workspaceByUniqueName;
|
|
271394
|
+
};
|
|
271395
|
+
};
|
|
271396
|
+
var workspaceCreate = (gqlClient, options) => {
|
|
271397
|
+
return async (createWorkspaceArgs) => {
|
|
271398
|
+
const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);
|
|
271399
|
+
return workspace;
|
|
271400
|
+
};
|
|
271401
|
+
};
|
|
271402
|
+
var workspaceDelete = (gqlClient, options) => {
|
|
271403
|
+
return async (workspaceUniqueName) => {
|
|
271404
|
+
const workspaceToDelete = await workspaceRead(gqlClient, options)(workspaceUniqueName);
|
|
271405
|
+
const { deleteWorkspace: workspace } = await gqlClient.request(deleteWorkspace, { id: workspaceToDelete.id });
|
|
271406
|
+
return workspace;
|
|
271407
|
+
};
|
|
271408
|
+
};
|
|
271409
|
+
var workspaceAddCredits = (gqlClient, options) => {
|
|
271410
|
+
return async (workspaceId, amount) => {
|
|
271411
|
+
const id = validate3(IdSchema3, workspaceId);
|
|
271412
|
+
if (amount <= 0) {
|
|
271413
|
+
throw new Error("Credit amount must be a positive number");
|
|
271414
|
+
}
|
|
271415
|
+
const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });
|
|
271416
|
+
return result;
|
|
271417
|
+
};
|
|
271418
|
+
};
|
|
271419
|
+
var listApplications = graphql(`
|
|
271420
|
+
query ListApplications($workspaceUniqueName: String!) {
|
|
271421
|
+
workspaceByUniqueName(uniqueName: $workspaceUniqueName) {
|
|
271422
|
+
applications {
|
|
271423
|
+
...Application
|
|
271424
|
+
}
|
|
271425
|
+
}
|
|
271426
|
+
}
|
|
271313
271427
|
`, [ApplicationFragment]);
|
|
271314
271428
|
var readApplication = graphql(`
|
|
271315
|
-
|
|
271316
|
-
|
|
271317
|
-
|
|
271429
|
+
query ReadApplication($applicationUniqueName: String!) {
|
|
271430
|
+
applicationByUniqueName(uniqueName: $applicationUniqueName) {
|
|
271431
|
+
...Application
|
|
271432
|
+
}
|
|
271318
271433
|
}
|
|
271319
|
-
}
|
|
271320
271434
|
`, [ApplicationFragment]);
|
|
271321
271435
|
var createApplication = graphql(`
|
|
271322
|
-
|
|
271323
|
-
|
|
271324
|
-
|
|
271325
|
-
|
|
271326
|
-
createApplication(
|
|
271327
|
-
name: $name
|
|
271328
|
-
workspaceId: $workspaceId
|
|
271329
|
-
) {
|
|
271330
|
-
...Application
|
|
271436
|
+
mutation CreateApplication($name: String!, $workspaceId: ID!) {
|
|
271437
|
+
createApplication(name: $name, workspaceId: $workspaceId) {
|
|
271438
|
+
...Application
|
|
271439
|
+
}
|
|
271331
271440
|
}
|
|
271332
|
-
}
|
|
271333
271441
|
`, [ApplicationFragment]);
|
|
271334
271442
|
var deleteApplication = graphql(`
|
|
271335
|
-
|
|
271336
|
-
|
|
271337
|
-
|
|
271443
|
+
mutation DeleteApplication($id: ID!) {
|
|
271444
|
+
deleteApplication(id: $id) {
|
|
271445
|
+
...Application
|
|
271446
|
+
}
|
|
271338
271447
|
}
|
|
271339
|
-
}
|
|
271340
271448
|
`, [ApplicationFragment]);
|
|
271341
271449
|
var applicationList = (gqlClient, options) => {
|
|
271342
|
-
return async (
|
|
271343
|
-
const id = validate3(IdSchema3, workspaceId);
|
|
271450
|
+
return async (workspaceUniqueName) => {
|
|
271344
271451
|
const {
|
|
271345
|
-
|
|
271346
|
-
} = await gqlClient.request(listApplications, {
|
|
271452
|
+
workspaceByUniqueName: { applications }
|
|
271453
|
+
} = await gqlClient.request(listApplications, { workspaceUniqueName });
|
|
271347
271454
|
return applications;
|
|
271348
271455
|
};
|
|
271349
271456
|
};
|
|
271350
271457
|
var applicationRead = (gqlClient, options) => {
|
|
271351
|
-
return async (
|
|
271352
|
-
const
|
|
271353
|
-
|
|
271458
|
+
return async (applicationUniqueName) => {
|
|
271459
|
+
const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {
|
|
271460
|
+
applicationUniqueName
|
|
271461
|
+
});
|
|
271354
271462
|
return application;
|
|
271355
271463
|
};
|
|
271356
271464
|
};
|
|
271357
271465
|
var applicationCreate = (gqlClient, options) => {
|
|
271358
271466
|
return async (args) => {
|
|
271359
|
-
const {
|
|
271467
|
+
const { workspaceUniqueName, ...otherArgs } = args;
|
|
271468
|
+
const workspace = await workspaceRead(gqlClient, options)(workspaceUniqueName);
|
|
271469
|
+
const { createApplication: application } = await gqlClient.request(createApplication, {
|
|
271470
|
+
...otherArgs,
|
|
271471
|
+
workspaceId: workspace.id
|
|
271472
|
+
});
|
|
271360
271473
|
return application;
|
|
271361
271474
|
};
|
|
271362
271475
|
};
|
|
271363
271476
|
var applicationDelete = (gqlClient, options) => {
|
|
271364
|
-
return async (
|
|
271365
|
-
const
|
|
271366
|
-
const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
|
|
271477
|
+
return async (applicationUniqueName) => {
|
|
271478
|
+
const applicationToDelete = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271479
|
+
const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
|
|
271480
|
+
id: applicationToDelete.id
|
|
271481
|
+
});
|
|
271367
271482
|
return application;
|
|
271368
271483
|
};
|
|
271369
271484
|
};
|
|
271485
|
+
var createApplicationAccessToken = graphql(`
|
|
271486
|
+
mutation CreateApplicationAccessToken(
|
|
271487
|
+
$applicationId: ID!,
|
|
271488
|
+
$blockchainNetworkScope: BlockchainNetworkScopeInputType!,
|
|
271489
|
+
$blockchainNodeScope: BlockchainNodeScopeInputType!,
|
|
271490
|
+
$customDeploymentScope: CustomDeploymentScopeInputType!,
|
|
271491
|
+
$insightsScope: InsightsScopeInputType!,
|
|
271492
|
+
$integrationScope: IntegrationScopeInputType!,
|
|
271493
|
+
$loadBalancerScope: LoadBalancerScopeInputType!,
|
|
271494
|
+
$middlewareScope: MiddlewareScopeInputType!,
|
|
271495
|
+
$name: String!,
|
|
271496
|
+
$privateKeyScope: PrivateKeyScopeInputType!,
|
|
271497
|
+
$smartContractSetScope: SmartContractSetScopeInputType!,
|
|
271498
|
+
$storageScope: StorageScopeInputType!,
|
|
271499
|
+
$validityPeriod: AccessTokenValidityPeriod!
|
|
271500
|
+
) {
|
|
271501
|
+
createApplicationAccessToken(
|
|
271502
|
+
applicationId: $applicationId,
|
|
271503
|
+
blockchainNetworkScope: $blockchainNetworkScope,
|
|
271504
|
+
blockchainNodeScope: $blockchainNodeScope,
|
|
271505
|
+
customDeploymentScope: $customDeploymentScope,
|
|
271506
|
+
insightsScope: $insightsScope,
|
|
271507
|
+
integrationScope: $integrationScope,
|
|
271508
|
+
loadBalancerScope: $loadBalancerScope,
|
|
271509
|
+
middlewareScope: $middlewareScope,
|
|
271510
|
+
name: $name,
|
|
271511
|
+
privateKeyScope: $privateKeyScope,
|
|
271512
|
+
smartContractSetScope: $smartContractSetScope,
|
|
271513
|
+
storageScope: $storageScope,
|
|
271514
|
+
validityPeriod: $validityPeriod
|
|
271515
|
+
) {
|
|
271516
|
+
token
|
|
271517
|
+
}
|
|
271518
|
+
}
|
|
271519
|
+
`, []);
|
|
271520
|
+
var applicationAccessTokenCreate = (gqlClient, options) => {
|
|
271521
|
+
return async (args) => {
|
|
271522
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271523
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271524
|
+
const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, {
|
|
271525
|
+
...otherArgs,
|
|
271526
|
+
applicationId: application.id
|
|
271527
|
+
});
|
|
271528
|
+
if (!applicationAccessToken.token) {
|
|
271529
|
+
throw new Error("Failed to create application access token");
|
|
271530
|
+
}
|
|
271531
|
+
return applicationAccessToken.token;
|
|
271532
|
+
};
|
|
271533
|
+
};
|
|
271370
271534
|
function setClusterServiceDefaults(args) {
|
|
271371
271535
|
return {
|
|
271372
271536
|
...args,
|
|
@@ -271393,31 +271557,34 @@ var BlockchainNetworkFragment = graphql(`
|
|
|
271393
271557
|
fragment BlockchainNetwork on BlockchainNetwork {
|
|
271394
271558
|
__typename
|
|
271395
271559
|
id
|
|
271560
|
+
uniqueName
|
|
271396
271561
|
name
|
|
271397
271562
|
status
|
|
271398
271563
|
blockchainNodes {
|
|
271399
271564
|
... on BlockchainNode {
|
|
271400
271565
|
id
|
|
271401
271566
|
name
|
|
271567
|
+
uniqueName
|
|
271402
271568
|
}
|
|
271403
271569
|
}
|
|
271404
271570
|
}
|
|
271405
271571
|
`);
|
|
271406
271572
|
var getBlockchainNetworks = graphql(`
|
|
271407
|
-
query getBlockchainNetworks($
|
|
271408
|
-
|
|
271409
|
-
|
|
271410
|
-
|
|
271573
|
+
query getBlockchainNetworks($applicationUniqueName: String!) {
|
|
271574
|
+
blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271575
|
+
items {
|
|
271576
|
+
...BlockchainNetwork
|
|
271577
|
+
}
|
|
271578
|
+
}
|
|
271411
271579
|
}
|
|
271412
|
-
|
|
271413
|
-
}`, [BlockchainNetworkFragment]);
|
|
271580
|
+
`, [BlockchainNetworkFragment]);
|
|
271414
271581
|
var getBlockchainNetwork = graphql(`
|
|
271415
|
-
query getBlockchainNetwork($
|
|
271416
|
-
|
|
271417
|
-
|
|
271582
|
+
query getBlockchainNetwork($uniqueName: String!) {
|
|
271583
|
+
blockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271584
|
+
...BlockchainNetwork
|
|
271585
|
+
}
|
|
271418
271586
|
}
|
|
271419
|
-
|
|
271420
|
-
`, [BlockchainNetworkFragment]);
|
|
271587
|
+
`, [BlockchainNetworkFragment]);
|
|
271421
271588
|
var createBlockchainNetwork = graphql(`
|
|
271422
271589
|
mutation createBlockchainNetwork(
|
|
271423
271590
|
$applicationId: ID!
|
|
@@ -271478,65 +271645,67 @@ var createBlockchainNetwork = graphql(`
|
|
|
271478
271645
|
...BlockchainNetwork
|
|
271479
271646
|
}
|
|
271480
271647
|
}
|
|
271481
|
-
`, [BlockchainNetworkFragment]);
|
|
271648
|
+
`, [BlockchainNetworkFragment]);
|
|
271482
271649
|
var deleteBlockchainNetwork = graphql(`
|
|
271483
|
-
mutation deleteBlockchainNetwork($
|
|
271484
|
-
|
|
271650
|
+
mutation deleteBlockchainNetwork($uniqueName: String!) {
|
|
271651
|
+
deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271485
271652
|
...BlockchainNetwork
|
|
271486
271653
|
}
|
|
271487
271654
|
}
|
|
271488
|
-
`, [BlockchainNetworkFragment]);
|
|
271655
|
+
`, [BlockchainNetworkFragment]);
|
|
271489
271656
|
var restartBlockchainNetwork = graphql(`
|
|
271490
|
-
mutation RestartBlockchainNetwork($
|
|
271491
|
-
|
|
271657
|
+
mutation RestartBlockchainNetwork($uniqueName: String!) {
|
|
271658
|
+
restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271492
271659
|
...BlockchainNetwork
|
|
271493
271660
|
}
|
|
271494
271661
|
}
|
|
271495
|
-
`, [BlockchainNetworkFragment]);
|
|
271662
|
+
`, [BlockchainNetworkFragment]);
|
|
271496
271663
|
var blockchainNetworkList = (gqlClient, options) => {
|
|
271497
|
-
return async (
|
|
271498
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271664
|
+
return async (applicationUniqueName) => {
|
|
271499
271665
|
const {
|
|
271500
|
-
|
|
271501
|
-
} = await gqlClient.request(getBlockchainNetworks, {
|
|
271666
|
+
blockchainNetworksByUniqueName: { items }
|
|
271667
|
+
} = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });
|
|
271502
271668
|
return items;
|
|
271503
271669
|
};
|
|
271504
271670
|
};
|
|
271505
271671
|
var blockchainNetworkRead = (gqlClient, options) => {
|
|
271506
|
-
return async (
|
|
271507
|
-
const
|
|
271508
|
-
|
|
271509
|
-
|
|
271672
|
+
return async (blockchainNetworkUniqueName) => {
|
|
271673
|
+
const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {
|
|
271674
|
+
uniqueName: blockchainNetworkUniqueName
|
|
271675
|
+
});
|
|
271676
|
+
return blockchainNetworkByUniqueName;
|
|
271510
271677
|
};
|
|
271511
271678
|
};
|
|
271512
271679
|
var blockchainNetworkCreate = (gqlClient, options) => {
|
|
271513
271680
|
return async (args) => {
|
|
271514
|
-
const
|
|
271515
|
-
|
|
271516
|
-
const
|
|
271681
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271682
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271683
|
+
const blockchainNetworkArgs = setNetworkDefaults(otherArgs);
|
|
271684
|
+
const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {
|
|
271685
|
+
...blockchainNetworkArgs,
|
|
271686
|
+
applicationId: application.id
|
|
271687
|
+
});
|
|
271517
271688
|
return blockchainNetwork;
|
|
271518
271689
|
};
|
|
271519
271690
|
};
|
|
271520
271691
|
var blockchainNetworkDelete = (gqlClient, options) => {
|
|
271521
|
-
return async (
|
|
271522
|
-
const
|
|
271523
|
-
|
|
271524
|
-
blockchainNetworkId: id
|
|
271692
|
+
return async (blockchainNetworkUniqueName) => {
|
|
271693
|
+
const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(deleteBlockchainNetwork, {
|
|
271694
|
+
uniqueName: blockchainNetworkUniqueName
|
|
271525
271695
|
});
|
|
271526
271696
|
return blockchainNetwork;
|
|
271527
271697
|
};
|
|
271528
271698
|
};
|
|
271529
|
-
var blockchainNetworkRestart = (gqlClient, _options) => async (
|
|
271530
|
-
const
|
|
271531
|
-
const { restartBlockchainNetwork: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { id });
|
|
271699
|
+
var blockchainNetworkRestart = (gqlClient, _options) => async (blockchainNetworkUniqueName) => {
|
|
271700
|
+
const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
|
271532
271701
|
return blockchainNetwork;
|
|
271533
271702
|
};
|
|
271534
271703
|
var BlockchainNodeFragment = graphql(`
|
|
271535
271704
|
fragment BlockchainNode on BlockchainNode {
|
|
271536
271705
|
__typename
|
|
271537
271706
|
id
|
|
271538
|
-
name
|
|
271539
271707
|
uniqueName
|
|
271708
|
+
name
|
|
271540
271709
|
status
|
|
271541
271710
|
isEvm
|
|
271542
271711
|
endpoints {
|
|
@@ -271553,6 +271722,7 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271553
271722
|
... on AbstractClusterService {
|
|
271554
271723
|
id
|
|
271555
271724
|
name
|
|
271725
|
+
uniqueName
|
|
271556
271726
|
}
|
|
271557
271727
|
}
|
|
271558
271728
|
privateKeys {
|
|
@@ -271566,86 +271736,96 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271566
271736
|
}
|
|
271567
271737
|
`);
|
|
271568
271738
|
var getBlockchainNodes = graphql(`
|
|
271569
|
-
query getBlockchainNodes($
|
|
271570
|
-
|
|
271571
|
-
|
|
271572
|
-
|
|
271573
|
-
|
|
271574
|
-
}
|
|
271575
|
-
}
|
|
271739
|
+
query getBlockchainNodes($applicationUniqueName: String!) {
|
|
271740
|
+
blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271741
|
+
items {
|
|
271742
|
+
...BlockchainNode
|
|
271743
|
+
}
|
|
271744
|
+
}
|
|
271745
|
+
}
|
|
271746
|
+
`, [BlockchainNodeFragment]);
|
|
271576
271747
|
var getBlockchainNode = graphql(`
|
|
271577
|
-
query getBlockchainNode($
|
|
271578
|
-
|
|
271579
|
-
|
|
271580
|
-
|
|
271581
|
-
}
|
|
271582
|
-
`, [BlockchainNodeFragment]);
|
|
271748
|
+
query getBlockchainNode($uniqueName: String!) {
|
|
271749
|
+
blockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
271750
|
+
...BlockchainNode
|
|
271751
|
+
}
|
|
271752
|
+
}
|
|
271753
|
+
`, [BlockchainNodeFragment]);
|
|
271583
271754
|
var createBlockchainNode = graphql(`
|
|
271584
|
-
|
|
271585
|
-
|
|
271586
|
-
|
|
271587
|
-
|
|
271588
|
-
|
|
271589
|
-
|
|
271590
|
-
|
|
271591
|
-
|
|
271592
|
-
|
|
271593
|
-
|
|
271594
|
-
) {
|
|
271595
|
-
createBlockchainNode(
|
|
271596
|
-
applicationId: $applicationId
|
|
271597
|
-
blockchainNetworkId: $blockchainNetworkId
|
|
271598
|
-
name: $name
|
|
271599
|
-
provider: $provider
|
|
271600
|
-
region: $region
|
|
271601
|
-
size: $size
|
|
271602
|
-
type: $type
|
|
271603
|
-
nodeType: $nodeType
|
|
271604
|
-
keyMaterial: $keyMaterial
|
|
271755
|
+
mutation createBlockchainNode(
|
|
271756
|
+
$applicationId: ID!
|
|
271757
|
+
$blockchainNetworkId: ID!
|
|
271758
|
+
$name: String!
|
|
271759
|
+
$provider: String!
|
|
271760
|
+
$region: String!
|
|
271761
|
+
$size: ClusterServiceSize
|
|
271762
|
+
$type: ClusterServiceType
|
|
271763
|
+
$nodeType: NodeType
|
|
271764
|
+
$keyMaterial: ID
|
|
271605
271765
|
) {
|
|
271606
|
-
|
|
271607
|
-
|
|
271608
|
-
|
|
271609
|
-
|
|
271766
|
+
createBlockchainNode(
|
|
271767
|
+
applicationId: $applicationId
|
|
271768
|
+
blockchainNetworkId: $blockchainNetworkId
|
|
271769
|
+
name: $name
|
|
271770
|
+
provider: $provider
|
|
271771
|
+
region: $region
|
|
271772
|
+
size: $size
|
|
271773
|
+
type: $type
|
|
271774
|
+
nodeType: $nodeType
|
|
271775
|
+
keyMaterial: $keyMaterial
|
|
271776
|
+
) {
|
|
271777
|
+
...BlockchainNode
|
|
271778
|
+
}
|
|
271779
|
+
}
|
|
271780
|
+
`, [BlockchainNodeFragment]);
|
|
271610
271781
|
var restartBlockchainNode = graphql(`
|
|
271611
|
-
|
|
271612
|
-
|
|
271613
|
-
|
|
271782
|
+
mutation RestartBlockchainNode($uniqueName: String!) {
|
|
271783
|
+
restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
271784
|
+
...BlockchainNode
|
|
271785
|
+
}
|
|
271614
271786
|
}
|
|
271615
|
-
|
|
271616
|
-
`, [BlockchainNodeFragment]);
|
|
271787
|
+
`, [BlockchainNodeFragment]);
|
|
271617
271788
|
var blockchainNodeList = (gqlClient, options) => {
|
|
271618
|
-
return async (
|
|
271619
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271789
|
+
return async (applicationUniqueName) => {
|
|
271620
271790
|
const {
|
|
271621
|
-
|
|
271622
|
-
} = await gqlClient.request(getBlockchainNodes, {
|
|
271791
|
+
blockchainNodesByUniqueName: { items }
|
|
271792
|
+
} = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });
|
|
271623
271793
|
return items;
|
|
271624
271794
|
};
|
|
271625
271795
|
};
|
|
271626
271796
|
var blockchainNodeRead = (gqlClient, options) => {
|
|
271627
|
-
return async (
|
|
271628
|
-
const
|
|
271629
|
-
|
|
271630
|
-
|
|
271797
|
+
return async (blockchainNodeUniqueName) => {
|
|
271798
|
+
const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {
|
|
271799
|
+
uniqueName: blockchainNodeUniqueName
|
|
271800
|
+
});
|
|
271801
|
+
return blockchainNodeByUniqueName;
|
|
271631
271802
|
};
|
|
271632
271803
|
};
|
|
271633
271804
|
var blockchainNodeCreate = (gqlClient, options) => {
|
|
271634
271805
|
return async (args) => {
|
|
271635
|
-
|
|
271636
|
-
|
|
271637
|
-
|
|
271806
|
+
const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;
|
|
271807
|
+
const [application, blockchainNetwork] = await Promise.all([
|
|
271808
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
271809
|
+
blockchainNetworkRead(gqlClient, options)(blockchainNetworkUniqueName)
|
|
271810
|
+
]);
|
|
271811
|
+
const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {
|
|
271812
|
+
...otherArgs,
|
|
271813
|
+
applicationId: application.id,
|
|
271814
|
+
blockchainNetworkId: blockchainNetwork.id
|
|
271815
|
+
});
|
|
271638
271816
|
return blockchainNode;
|
|
271639
271817
|
};
|
|
271640
271818
|
};
|
|
271641
|
-
var blockchainNodeRestart = (gqlClient, _options) => async (
|
|
271642
|
-
const
|
|
271643
|
-
|
|
271819
|
+
var blockchainNodeRestart = (gqlClient, _options) => async (blockchainNodeUniqueName) => {
|
|
271820
|
+
const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {
|
|
271821
|
+
uniqueName: blockchainNodeUniqueName
|
|
271822
|
+
});
|
|
271644
271823
|
return blockchainNode;
|
|
271645
271824
|
};
|
|
271646
271825
|
var CustomDeploymentFragment = graphql(`
|
|
271647
271826
|
fragment CustomDeployment on CustomDeployment {
|
|
271648
271827
|
id
|
|
271828
|
+
uniqueName
|
|
271649
271829
|
name
|
|
271650
271830
|
status
|
|
271651
271831
|
endpoints {
|
|
@@ -271661,112 +271841,141 @@ var CustomDeploymentFragment = graphql(`
|
|
|
271661
271841
|
}
|
|
271662
271842
|
`);
|
|
271663
271843
|
var getCustomDeployments = graphql(`
|
|
271664
|
-
query getCustomDeployments($
|
|
271665
|
-
|
|
271666
|
-
|
|
271667
|
-
|
|
271844
|
+
query getCustomDeployments($applicationUniqueName: String!) {
|
|
271845
|
+
customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271846
|
+
items {
|
|
271847
|
+
...CustomDeployment
|
|
271848
|
+
}
|
|
271849
|
+
}
|
|
271668
271850
|
}
|
|
271669
|
-
|
|
271670
|
-
}`, [CustomDeploymentFragment]);
|
|
271851
|
+
`, [CustomDeploymentFragment]);
|
|
271671
271852
|
var getCustomDeployment = graphql(`
|
|
271672
|
-
query getCustomDeployment($
|
|
271673
|
-
|
|
271674
|
-
|
|
271675
|
-
|
|
271676
|
-
}
|
|
271677
|
-
`, [CustomDeploymentFragment]);
|
|
271853
|
+
query getCustomDeployment($uniqueName: String!) {
|
|
271854
|
+
customDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
271855
|
+
...CustomDeployment
|
|
271856
|
+
}
|
|
271857
|
+
}
|
|
271858
|
+
`, [CustomDeploymentFragment]);
|
|
271678
271859
|
var editCustomDeployment = graphql(`
|
|
271679
|
-
mutation EditCustomDeployment($
|
|
271680
|
-
|
|
271681
|
-
|
|
271682
|
-
|
|
271683
|
-
}
|
|
271684
|
-
`, [CustomDeploymentFragment]);
|
|
271860
|
+
mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {
|
|
271861
|
+
editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {
|
|
271862
|
+
...CustomDeployment
|
|
271863
|
+
}
|
|
271864
|
+
}
|
|
271865
|
+
`, [CustomDeploymentFragment]);
|
|
271685
271866
|
var createCustomDeployment = graphql(`
|
|
271686
|
-
mutation CreateCustomDeployment(
|
|
271687
|
-
|
|
271688
|
-
|
|
271689
|
-
|
|
271690
|
-
|
|
271691
|
-
|
|
271692
|
-
|
|
271693
|
-
|
|
271694
|
-
|
|
271695
|
-
|
|
271696
|
-
) {
|
|
271697
|
-
|
|
271698
|
-
|
|
271699
|
-
|
|
271700
|
-
|
|
271701
|
-
|
|
271702
|
-
|
|
271703
|
-
|
|
271704
|
-
|
|
271705
|
-
|
|
271706
|
-
|
|
271707
|
-
|
|
271708
|
-
|
|
271709
|
-
|
|
271710
|
-
}
|
|
271711
|
-
`, [CustomDeploymentFragment]);
|
|
271867
|
+
mutation CreateCustomDeployment(
|
|
271868
|
+
$applicationId: ID!
|
|
271869
|
+
$name: String!
|
|
271870
|
+
$imageTag: String!
|
|
271871
|
+
$imageName: String!
|
|
271872
|
+
$imageRepository: String!
|
|
271873
|
+
$environmentVariables: JSON
|
|
271874
|
+
$port: Int!
|
|
271875
|
+
$provider: String!
|
|
271876
|
+
$region: String!
|
|
271877
|
+
) {
|
|
271878
|
+
createCustomDeployment(
|
|
271879
|
+
applicationId: $applicationId
|
|
271880
|
+
name: $name
|
|
271881
|
+
imageTag: $imageTag
|
|
271882
|
+
imageName: $imageName
|
|
271883
|
+
imageRepository: $imageRepository
|
|
271884
|
+
port: $port
|
|
271885
|
+
environmentVariables: $environmentVariables
|
|
271886
|
+
provider: $provider
|
|
271887
|
+
region: $region
|
|
271888
|
+
) {
|
|
271889
|
+
...CustomDeployment
|
|
271890
|
+
}
|
|
271891
|
+
}
|
|
271892
|
+
`, [CustomDeploymentFragment]);
|
|
271712
271893
|
var restartCustomDeployment = graphql(`
|
|
271713
|
-
|
|
271714
|
-
|
|
271715
|
-
|
|
271894
|
+
mutation RestartCustomDeployment($uniqueName: String!) {
|
|
271895
|
+
restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
271896
|
+
...CustomDeployment
|
|
271897
|
+
}
|
|
271716
271898
|
}
|
|
271717
|
-
|
|
271718
|
-
`, [CustomDeploymentFragment]);
|
|
271899
|
+
`, [CustomDeploymentFragment]);
|
|
271719
271900
|
var customdeploymentList = (gqlClient, options) => {
|
|
271720
|
-
return async (
|
|
271721
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271901
|
+
return async (applicationUniqueName) => {
|
|
271722
271902
|
const {
|
|
271723
|
-
|
|
271724
|
-
} = await gqlClient.request(getCustomDeployments, {
|
|
271903
|
+
customDeploymentsByUniqueName: { items }
|
|
271904
|
+
} = await gqlClient.request(getCustomDeployments, { applicationUniqueName });
|
|
271725
271905
|
return items;
|
|
271726
271906
|
};
|
|
271727
271907
|
};
|
|
271728
271908
|
var customdeploymentRead = (gqlClient, options) => {
|
|
271729
|
-
return async (
|
|
271730
|
-
const
|
|
271731
|
-
|
|
271909
|
+
return async (customDeploymentUniqueName) => {
|
|
271910
|
+
const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {
|
|
271911
|
+
uniqueName: customDeploymentUniqueName
|
|
271912
|
+
});
|
|
271732
271913
|
return customDeployment;
|
|
271733
271914
|
};
|
|
271734
271915
|
};
|
|
271735
271916
|
var customdeploymentUpdate = (gqlClient, options) => {
|
|
271736
|
-
return async (
|
|
271737
|
-
const
|
|
271738
|
-
|
|
271917
|
+
return async (customDeploymentUniqueName, imageTag) => {
|
|
271918
|
+
const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {
|
|
271919
|
+
uniqueName: customDeploymentUniqueName,
|
|
271920
|
+
imageTag
|
|
271921
|
+
});
|
|
271739
271922
|
return cd;
|
|
271740
271923
|
};
|
|
271741
271924
|
};
|
|
271742
271925
|
var customdeploymentCreate = (gqlClient, options) => {
|
|
271743
271926
|
return async (args) => {
|
|
271744
|
-
|
|
271745
|
-
const
|
|
271927
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271928
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271929
|
+
const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {
|
|
271930
|
+
...otherArgs,
|
|
271931
|
+
applicationId: application.id
|
|
271932
|
+
});
|
|
271746
271933
|
return customDeployment;
|
|
271747
271934
|
};
|
|
271748
271935
|
};
|
|
271749
|
-
var customDeploymentRestart = (gqlClient, _options) => async (
|
|
271750
|
-
const
|
|
271751
|
-
|
|
271936
|
+
var customDeploymentRestart = (gqlClient, _options) => async (customDeploymentUniqueName) => {
|
|
271937
|
+
const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {
|
|
271938
|
+
uniqueName: customDeploymentUniqueName
|
|
271939
|
+
});
|
|
271752
271940
|
return customDeployment;
|
|
271753
271941
|
};
|
|
271754
271942
|
var getFoundryEnvConfig = graphql(`
|
|
271755
|
-
|
|
271756
|
-
|
|
271943
|
+
query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {
|
|
271944
|
+
foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)
|
|
271945
|
+
}
|
|
271946
|
+
`);
|
|
271947
|
+
var getEnv = (gqlClient, _options) => {
|
|
271948
|
+
return async (blockchainNodeUniqueName) => {
|
|
271949
|
+
const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });
|
|
271950
|
+
return foundryEnvConfigByUniqueName;
|
|
271951
|
+
};
|
|
271952
|
+
};
|
|
271953
|
+
var LoadBalancerFragment = graphql(`
|
|
271954
|
+
fragment LoadBalancer on LoadBalancer {
|
|
271955
|
+
id
|
|
271956
|
+
uniqueName
|
|
271757
271957
|
}
|
|
271758
271958
|
`);
|
|
271759
|
-
|
|
271760
|
-
|
|
271761
|
-
|
|
271762
|
-
|
|
271763
|
-
|
|
271959
|
+
var getLoadBalancer = graphql(`
|
|
271960
|
+
query GetLoadBalancer($uniqueName: String!) {
|
|
271961
|
+
loadBalancerByUniqueName(uniqueName: $uniqueName) {
|
|
271962
|
+
...LoadBalancer
|
|
271963
|
+
}
|
|
271964
|
+
}
|
|
271965
|
+
`, [LoadBalancerFragment]);
|
|
271966
|
+
var loadBalancerRead = (gqlClient, options) => {
|
|
271967
|
+
return async (loadBalancerUniqueName) => {
|
|
271968
|
+
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
|
|
271969
|
+
uniqueName: loadBalancerUniqueName
|
|
271970
|
+
});
|
|
271971
|
+
return loadBalancer;
|
|
271764
271972
|
};
|
|
271765
|
-
}
|
|
271973
|
+
};
|
|
271766
271974
|
var InsightsFragment = graphql(`
|
|
271767
271975
|
fragment Insights on Insights {
|
|
271768
271976
|
__typename
|
|
271769
271977
|
id
|
|
271978
|
+
uniqueName
|
|
271770
271979
|
name
|
|
271771
271980
|
status
|
|
271772
271981
|
insightsCategory
|
|
@@ -271783,86 +271992,97 @@ var InsightsFragment = graphql(`
|
|
|
271783
271992
|
}
|
|
271784
271993
|
`);
|
|
271785
271994
|
var getInsights = graphql(`
|
|
271786
|
-
query
|
|
271787
|
-
|
|
271788
|
-
|
|
271789
|
-
|
|
271995
|
+
query GetInsights($applicationUniqueName: String!) {
|
|
271996
|
+
insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271997
|
+
items {
|
|
271998
|
+
...Insights
|
|
271999
|
+
}
|
|
272000
|
+
}
|
|
271790
272001
|
}
|
|
271791
|
-
|
|
271792
|
-
}`, [InsightsFragment]);
|
|
272002
|
+
`, [InsightsFragment]);
|
|
271793
272003
|
var getInsight = graphql(`
|
|
271794
|
-
query
|
|
271795
|
-
|
|
271796
|
-
|
|
271797
|
-
|
|
271798
|
-
}
|
|
271799
|
-
`, [InsightsFragment]);
|
|
272004
|
+
query GetInsight($uniqueName: String!) {
|
|
272005
|
+
insightsByUniqueName(uniqueName: $uniqueName) {
|
|
272006
|
+
...Insights
|
|
272007
|
+
}
|
|
272008
|
+
}
|
|
272009
|
+
`, [InsightsFragment]);
|
|
271800
272010
|
var createInsights = graphql(`
|
|
271801
|
-
|
|
271802
|
-
|
|
271803
|
-
|
|
271804
|
-
|
|
271805
|
-
|
|
271806
|
-
|
|
271807
|
-
|
|
271808
|
-
|
|
271809
|
-
|
|
271810
|
-
|
|
271811
|
-
) {
|
|
271812
|
-
createInsights(
|
|
271813
|
-
applicationId: $applicationId
|
|
271814
|
-
name: $name
|
|
271815
|
-
insightsCategory: $insightsCategory
|
|
271816
|
-
provider: $provider
|
|
271817
|
-
region: $region
|
|
271818
|
-
size: $size
|
|
271819
|
-
type: $type
|
|
271820
|
-
blockchainNode: $blockchainNode
|
|
271821
|
-
loadBalancer: $loadBalancer
|
|
272011
|
+
mutation CreateInsights(
|
|
272012
|
+
$applicationId: ID!
|
|
272013
|
+
$name: String!
|
|
272014
|
+
$insightsCategory: InsightsCategory!
|
|
272015
|
+
$provider: String!
|
|
272016
|
+
$region: String!
|
|
272017
|
+
$size: ClusterServiceSize
|
|
272018
|
+
$type: ClusterServiceType
|
|
272019
|
+
$blockchainNode: ID
|
|
272020
|
+
$loadBalancer: ID
|
|
271822
272021
|
) {
|
|
271823
|
-
|
|
271824
|
-
|
|
271825
|
-
|
|
271826
|
-
|
|
272022
|
+
createInsights(
|
|
272023
|
+
applicationId: $applicationId
|
|
272024
|
+
name: $name
|
|
272025
|
+
insightsCategory: $insightsCategory
|
|
272026
|
+
provider: $provider
|
|
272027
|
+
region: $region
|
|
272028
|
+
size: $size
|
|
272029
|
+
type: $type
|
|
272030
|
+
blockchainNode: $blockchainNode
|
|
272031
|
+
loadBalancer: $loadBalancer
|
|
272032
|
+
) {
|
|
272033
|
+
...Insights
|
|
272034
|
+
}
|
|
272035
|
+
}
|
|
272036
|
+
`, [InsightsFragment]);
|
|
271827
272037
|
var restartInsights = graphql(`
|
|
271828
|
-
|
|
271829
|
-
|
|
271830
|
-
|
|
272038
|
+
mutation RestartInsights($uniqueName: String!) {
|
|
272039
|
+
restartInsightsByUniqueName(uniqueName: $uniqueName) {
|
|
272040
|
+
...Insights
|
|
272041
|
+
}
|
|
271831
272042
|
}
|
|
271832
|
-
|
|
271833
|
-
`, [InsightsFragment]);
|
|
272043
|
+
`, [InsightsFragment]);
|
|
271834
272044
|
var insightsList = (gqlClient, options) => {
|
|
271835
|
-
return async (
|
|
271836
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272045
|
+
return async (applicationUniqueName) => {
|
|
271837
272046
|
const {
|
|
271838
|
-
|
|
271839
|
-
} = await gqlClient.request(getInsights, {
|
|
272047
|
+
insightsListByUniqueName: { items }
|
|
272048
|
+
} = await gqlClient.request(getInsights, { applicationUniqueName });
|
|
271840
272049
|
return items;
|
|
271841
272050
|
};
|
|
271842
272051
|
};
|
|
271843
272052
|
var insightsRead = (gqlClient, options) => {
|
|
271844
|
-
return async (
|
|
271845
|
-
const
|
|
271846
|
-
const { insights } = await gqlClient.request(getInsight, { id });
|
|
272053
|
+
return async (insightsUniqueName) => {
|
|
272054
|
+
const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });
|
|
271847
272055
|
return insights;
|
|
271848
272056
|
};
|
|
271849
272057
|
};
|
|
271850
272058
|
var insightsCreate = (gqlClient, options) => {
|
|
271851
272059
|
return async (args) => {
|
|
271852
|
-
|
|
271853
|
-
const
|
|
272060
|
+
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;
|
|
272061
|
+
const [application, blockchainNode, loadBalancer] = await Promise.all([
|
|
272062
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
272063
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
|
|
272064
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined)
|
|
272065
|
+
]);
|
|
272066
|
+
const { createInsights: insights } = await gqlClient.request(createInsights, {
|
|
272067
|
+
...otherArgs,
|
|
272068
|
+
applicationId: application.id,
|
|
272069
|
+
blockchainNode: blockchainNode?.id,
|
|
272070
|
+
loadBalancer: loadBalancer?.id
|
|
272071
|
+
});
|
|
271854
272072
|
return insights;
|
|
271855
272073
|
};
|
|
271856
272074
|
};
|
|
271857
|
-
var insightsRestart = (gqlClient, _options) => async (
|
|
271858
|
-
const
|
|
271859
|
-
|
|
272075
|
+
var insightsRestart = (gqlClient, _options) => async (insightsUniqueName) => {
|
|
272076
|
+
const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {
|
|
272077
|
+
uniqueName: insightsUniqueName
|
|
272078
|
+
});
|
|
271860
272079
|
return insights;
|
|
271861
272080
|
};
|
|
271862
272081
|
var IntegrationFragment = graphql(`
|
|
271863
272082
|
fragment Integration on Integration {
|
|
271864
272083
|
__typename
|
|
271865
272084
|
id
|
|
272085
|
+
uniqueName
|
|
271866
272086
|
name
|
|
271867
272087
|
status
|
|
271868
272088
|
integrationType
|
|
@@ -271879,82 +272099,184 @@ var IntegrationFragment = graphql(`
|
|
|
271879
272099
|
}
|
|
271880
272100
|
`);
|
|
271881
272101
|
var getIntegrations = graphql(`
|
|
271882
|
-
query
|
|
271883
|
-
|
|
271884
|
-
|
|
271885
|
-
|
|
272102
|
+
query GetIntegrations($applicationUniqueName: String!) {
|
|
272103
|
+
integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272104
|
+
items {
|
|
272105
|
+
...Integration
|
|
272106
|
+
}
|
|
272107
|
+
}
|
|
271886
272108
|
}
|
|
271887
|
-
|
|
271888
|
-
}`, [IntegrationFragment]);
|
|
272109
|
+
`, [IntegrationFragment]);
|
|
271889
272110
|
var getIntegration = graphql(`
|
|
271890
|
-
query
|
|
271891
|
-
|
|
271892
|
-
|
|
271893
|
-
|
|
271894
|
-
}
|
|
271895
|
-
`, [IntegrationFragment]);
|
|
272111
|
+
query GetIntegration($uniqueName: String!) {
|
|
272112
|
+
integrationByUniqueName(uniqueName: $uniqueName) {
|
|
272113
|
+
...Integration
|
|
272114
|
+
}
|
|
272115
|
+
}
|
|
272116
|
+
`, [IntegrationFragment]);
|
|
271896
272117
|
var createIntegration = graphql(`
|
|
271897
|
-
|
|
271898
|
-
|
|
271899
|
-
|
|
271900
|
-
|
|
271901
|
-
|
|
271902
|
-
|
|
271903
|
-
|
|
271904
|
-
|
|
271905
|
-
) {
|
|
271906
|
-
createIntegration(
|
|
271907
|
-
applicationId: $applicationId
|
|
271908
|
-
name: $name
|
|
271909
|
-
integrationType: $integrationType
|
|
271910
|
-
provider: $provider
|
|
271911
|
-
region: $region
|
|
271912
|
-
size: $size
|
|
271913
|
-
type: $type
|
|
272118
|
+
mutation CreateIntegration(
|
|
272119
|
+
$applicationId: ID!
|
|
272120
|
+
$name: String!
|
|
272121
|
+
$integrationType: IntegrationType!
|
|
272122
|
+
$provider: String!
|
|
272123
|
+
$region: String!
|
|
272124
|
+
$size: ClusterServiceSize
|
|
272125
|
+
$type: ClusterServiceType
|
|
271914
272126
|
) {
|
|
271915
|
-
|
|
271916
|
-
|
|
271917
|
-
|
|
271918
|
-
|
|
272127
|
+
createIntegration(
|
|
272128
|
+
applicationId: $applicationId
|
|
272129
|
+
name: $name
|
|
272130
|
+
integrationType: $integrationType
|
|
272131
|
+
provider: $provider
|
|
272132
|
+
region: $region
|
|
272133
|
+
size: $size
|
|
272134
|
+
type: $type
|
|
272135
|
+
) {
|
|
272136
|
+
...Integration
|
|
272137
|
+
}
|
|
272138
|
+
}
|
|
272139
|
+
`, [IntegrationFragment]);
|
|
271919
272140
|
var restartIntegrationTool = graphql(`
|
|
271920
|
-
|
|
271921
|
-
|
|
271922
|
-
|
|
272141
|
+
mutation RestartIntegrationTool($uniqueName: String!) {
|
|
272142
|
+
restartIntegrationByUniqueName(uniqueName: $uniqueName) {
|
|
272143
|
+
...Integration
|
|
272144
|
+
}
|
|
271923
272145
|
}
|
|
271924
|
-
|
|
271925
|
-
`, [IntegrationFragment]);
|
|
272146
|
+
`, [IntegrationFragment]);
|
|
271926
272147
|
var integrationToolList = (gqlClient, options) => {
|
|
271927
|
-
return async (
|
|
271928
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272148
|
+
return async (applicationUniqueName) => {
|
|
271929
272149
|
const {
|
|
271930
|
-
|
|
271931
|
-
} = await gqlClient.request(getIntegrations, {
|
|
272150
|
+
integrationsByUniqueName: { items }
|
|
272151
|
+
} = await gqlClient.request(getIntegrations, { applicationUniqueName });
|
|
271932
272152
|
return items;
|
|
271933
272153
|
};
|
|
271934
272154
|
};
|
|
271935
272155
|
var integrationToolRead = (gqlClient, options) => {
|
|
271936
|
-
return async (
|
|
271937
|
-
const
|
|
271938
|
-
|
|
271939
|
-
return integration;
|
|
272156
|
+
return async (integrationUniqueName) => {
|
|
272157
|
+
const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });
|
|
272158
|
+
return integrationByUniqueName;
|
|
271940
272159
|
};
|
|
271941
272160
|
};
|
|
271942
272161
|
var integrationToolCreate = (gqlClient, options) => {
|
|
271943
272162
|
return async (args) => {
|
|
271944
|
-
|
|
271945
|
-
const
|
|
272163
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
272164
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272165
|
+
const { createIntegration: integration } = await gqlClient.request(createIntegration, {
|
|
272166
|
+
...otherArgs,
|
|
272167
|
+
applicationId: application.id
|
|
272168
|
+
});
|
|
271946
272169
|
return integration;
|
|
271947
272170
|
};
|
|
271948
272171
|
};
|
|
271949
|
-
var integrationToolRestart = (gqlClient, _options) => async (
|
|
271950
|
-
const
|
|
271951
|
-
|
|
272172
|
+
var integrationToolRestart = (gqlClient, _options) => async (integrationUniqueName) => {
|
|
272173
|
+
const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {
|
|
272174
|
+
uniqueName: integrationUniqueName
|
|
272175
|
+
});
|
|
271952
272176
|
return integration;
|
|
271953
272177
|
};
|
|
272178
|
+
var StorageFragment = graphql(`
|
|
272179
|
+
fragment Storage on Storage {
|
|
272180
|
+
__typename
|
|
272181
|
+
id
|
|
272182
|
+
uniqueName
|
|
272183
|
+
name
|
|
272184
|
+
status
|
|
272185
|
+
storageProtocol
|
|
272186
|
+
endpoints {
|
|
272187
|
+
id
|
|
272188
|
+
label
|
|
272189
|
+
displayValue
|
|
272190
|
+
}
|
|
272191
|
+
credentials {
|
|
272192
|
+
id
|
|
272193
|
+
label
|
|
272194
|
+
displayValue
|
|
272195
|
+
}
|
|
272196
|
+
}
|
|
272197
|
+
`);
|
|
272198
|
+
var getStorages = graphql(`
|
|
272199
|
+
query GetStorages($applicationUniqueName: String!) {
|
|
272200
|
+
storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272201
|
+
items {
|
|
272202
|
+
...Storage
|
|
272203
|
+
}
|
|
272204
|
+
}
|
|
272205
|
+
}
|
|
272206
|
+
`, [StorageFragment]);
|
|
272207
|
+
var getStorage = graphql(`
|
|
272208
|
+
query GetStorage($uniqueName: String!) {
|
|
272209
|
+
storageByUniqueName(uniqueName: $uniqueName) {
|
|
272210
|
+
...Storage
|
|
272211
|
+
}
|
|
272212
|
+
}
|
|
272213
|
+
`, [StorageFragment]);
|
|
272214
|
+
var createStorage = graphql(`
|
|
272215
|
+
mutation CreateStorage(
|
|
272216
|
+
$applicationId: ID!
|
|
272217
|
+
$name: String!
|
|
272218
|
+
$storageProtocol: StorageProtocol!
|
|
272219
|
+
$provider: String!
|
|
272220
|
+
$region: String!
|
|
272221
|
+
$size: ClusterServiceSize
|
|
272222
|
+
$type: ClusterServiceType
|
|
272223
|
+
) {
|
|
272224
|
+
createStorage(
|
|
272225
|
+
applicationId: $applicationId
|
|
272226
|
+
name: $name
|
|
272227
|
+
storageProtocol: $storageProtocol
|
|
272228
|
+
provider: $provider
|
|
272229
|
+
region: $region
|
|
272230
|
+
size: $size
|
|
272231
|
+
type: $type
|
|
272232
|
+
) {
|
|
272233
|
+
...Storage
|
|
272234
|
+
}
|
|
272235
|
+
}
|
|
272236
|
+
`, [StorageFragment]);
|
|
272237
|
+
var restartStorage = graphql(`
|
|
272238
|
+
mutation RestartStorage($uniqueName: String!) {
|
|
272239
|
+
restartStorageByUniqueName(uniqueName: $uniqueName) {
|
|
272240
|
+
...Storage
|
|
272241
|
+
}
|
|
272242
|
+
}
|
|
272243
|
+
`, [StorageFragment]);
|
|
272244
|
+
var storageList = (gqlClient, options) => {
|
|
272245
|
+
return async (applicationUniqueName) => {
|
|
272246
|
+
const {
|
|
272247
|
+
storagesByUniqueName: { items }
|
|
272248
|
+
} = await gqlClient.request(getStorages, { applicationUniqueName });
|
|
272249
|
+
return items;
|
|
272250
|
+
};
|
|
272251
|
+
};
|
|
272252
|
+
var storageRead = (gqlClient, options) => {
|
|
272253
|
+
return async (storageUniqueName) => {
|
|
272254
|
+
const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });
|
|
272255
|
+
return storage;
|
|
272256
|
+
};
|
|
272257
|
+
};
|
|
272258
|
+
var storageCreate = (gqlClient, options) => {
|
|
272259
|
+
return async (args) => {
|
|
272260
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
272261
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272262
|
+
const { createStorage: storage } = await gqlClient.request(createStorage, {
|
|
272263
|
+
...otherArgs,
|
|
272264
|
+
applicationId: application.id
|
|
272265
|
+
});
|
|
272266
|
+
return storage;
|
|
272267
|
+
};
|
|
272268
|
+
};
|
|
272269
|
+
var storageRestart = (gqlClient, _options) => async (storageUniqueName) => {
|
|
272270
|
+
const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {
|
|
272271
|
+
uniqueName: storageUniqueName
|
|
272272
|
+
});
|
|
272273
|
+
return storage;
|
|
272274
|
+
};
|
|
271954
272275
|
var MiddlewareFragment = graphql(`
|
|
271955
272276
|
fragment Middleware on Middleware {
|
|
271956
272277
|
__typename
|
|
271957
272278
|
id
|
|
272279
|
+
uniqueName
|
|
271958
272280
|
name
|
|
271959
272281
|
status
|
|
271960
272282
|
interface
|
|
@@ -271983,488 +272305,195 @@ var MiddlewareFragment = graphql(`
|
|
|
271983
272305
|
}
|
|
271984
272306
|
`);
|
|
271985
272307
|
var getMiddlewares = graphql(`
|
|
271986
|
-
query
|
|
271987
|
-
|
|
271988
|
-
|
|
271989
|
-
|
|
272308
|
+
query GetMiddlewares($applicationUniqueName: String!, $noCache: Boolean = false) {
|
|
272309
|
+
middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272310
|
+
items {
|
|
272311
|
+
...Middleware
|
|
272312
|
+
}
|
|
272313
|
+
}
|
|
271990
272314
|
}
|
|
271991
|
-
|
|
271992
|
-
}`, [MiddlewareFragment]);
|
|
272315
|
+
`, [MiddlewareFragment]);
|
|
271993
272316
|
var getMiddleware = graphql(`
|
|
271994
|
-
query
|
|
271995
|
-
|
|
271996
|
-
|
|
271997
|
-
|
|
271998
|
-
}
|
|
271999
|
-
`, [MiddlewareFragment]);
|
|
272317
|
+
query GetMiddleware($uniqueName: String!, $noCache: Boolean = true) {
|
|
272318
|
+
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272319
|
+
...Middleware
|
|
272320
|
+
}
|
|
272321
|
+
}
|
|
272322
|
+
`, [MiddlewareFragment]);
|
|
272000
272323
|
var createMiddleware = graphql(`
|
|
272001
|
-
|
|
272002
|
-
|
|
272003
|
-
|
|
272004
|
-
|
|
272005
|
-
|
|
272006
|
-
|
|
272007
|
-
|
|
272008
|
-
|
|
272009
|
-
|
|
272010
|
-
|
|
272011
|
-
|
|
272012
|
-
|
|
272013
|
-
|
|
272014
|
-
|
|
272015
|
-
$noCache: Boolean = false
|
|
272016
|
-
) {
|
|
272017
|
-
createMiddleware(
|
|
272018
|
-
applicationId: $applicationId
|
|
272019
|
-
name: $name
|
|
272020
|
-
provider: $provider
|
|
272021
|
-
region: $region
|
|
272022
|
-
size: $size
|
|
272023
|
-
type: $type
|
|
272024
|
-
interface: $interface
|
|
272025
|
-
storageId: $storageId
|
|
272026
|
-
smartContractSetId: $smartContractSetId
|
|
272027
|
-
blockchainNodeId: $blockchainNodeId
|
|
272028
|
-
loadBalancerId: $loadBalancerId
|
|
272029
|
-
abis: $abis
|
|
272030
|
-
includePredeployedAbis: $includePredeployedAbis
|
|
272324
|
+
mutation CreateMiddleware(
|
|
272325
|
+
$applicationId: ID!
|
|
272326
|
+
$name: String!
|
|
272327
|
+
$provider: String!
|
|
272328
|
+
$region: String!
|
|
272329
|
+
$size: ClusterServiceSize
|
|
272330
|
+
$type: ClusterServiceType
|
|
272331
|
+
$interface: MiddlewareType!
|
|
272332
|
+
$storageId: ID
|
|
272333
|
+
$blockchainNodeId: ID
|
|
272334
|
+
$loadBalancerId: ID
|
|
272335
|
+
$abis: [SmartContractPortalMiddlewareAbiInputDto!]
|
|
272336
|
+
$includePredeployedAbis: [String!]
|
|
272337
|
+
$noCache: Boolean = false
|
|
272031
272338
|
) {
|
|
272032
|
-
|
|
272033
|
-
|
|
272034
|
-
|
|
272035
|
-
|
|
272339
|
+
createMiddleware(
|
|
272340
|
+
applicationId: $applicationId
|
|
272341
|
+
name: $name
|
|
272342
|
+
provider: $provider
|
|
272343
|
+
region: $region
|
|
272344
|
+
size: $size
|
|
272345
|
+
type: $type
|
|
272346
|
+
interface: $interface
|
|
272347
|
+
storageId: $storageId
|
|
272348
|
+
blockchainNodeId: $blockchainNodeId
|
|
272349
|
+
loadBalancerId: $loadBalancerId
|
|
272350
|
+
abis: $abis
|
|
272351
|
+
includePredeployedAbis: $includePredeployedAbis
|
|
272352
|
+
) {
|
|
272353
|
+
...Middleware
|
|
272354
|
+
}
|
|
272355
|
+
}
|
|
272356
|
+
`, [MiddlewareFragment]);
|
|
272036
272357
|
var restartMiddleware = graphql(`
|
|
272037
|
-
|
|
272038
|
-
|
|
272039
|
-
|
|
272358
|
+
mutation RestartMiddleware($uniqueName: String!, $noCache: Boolean = false) {
|
|
272359
|
+
restartMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272360
|
+
...Middleware
|
|
272361
|
+
}
|
|
272040
272362
|
}
|
|
272041
|
-
|
|
272042
|
-
`, [MiddlewareFragment]);
|
|
272363
|
+
`, [MiddlewareFragment]);
|
|
272043
272364
|
var middlewareList = (gqlClient, options) => {
|
|
272044
|
-
return async (
|
|
272045
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272365
|
+
return async (applicationUniqueName) => {
|
|
272046
272366
|
const {
|
|
272047
|
-
|
|
272048
|
-
} = await gqlClient.request(getMiddlewares, {
|
|
272367
|
+
middlewaresByUniqueName: { items }
|
|
272368
|
+
} = await gqlClient.request(getMiddlewares, { applicationUniqueName });
|
|
272049
272369
|
return items;
|
|
272050
272370
|
};
|
|
272051
272371
|
};
|
|
272052
272372
|
var middlewareRead = (gqlClient, options) => {
|
|
272053
|
-
return async (
|
|
272054
|
-
const
|
|
272055
|
-
|
|
272373
|
+
return async (middlewareUniqueName) => {
|
|
272374
|
+
const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {
|
|
272375
|
+
uniqueName: middlewareUniqueName
|
|
272376
|
+
});
|
|
272056
272377
|
return middleware;
|
|
272057
272378
|
};
|
|
272058
272379
|
};
|
|
272059
272380
|
var middlewareCreate = (gqlClient, options) => {
|
|
272060
272381
|
return async (args) => {
|
|
272061
|
-
|
|
272062
|
-
const
|
|
272382
|
+
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } = args;
|
|
272383
|
+
const [application, blockchainNode, loadBalancer, storage] = await Promise.all([
|
|
272384
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
272385
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
|
|
272386
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined),
|
|
272387
|
+
storageUniqueName ? storageRead(gqlClient, options)(storageUniqueName) : Promise.resolve(undefined)
|
|
272388
|
+
]);
|
|
272389
|
+
const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {
|
|
272390
|
+
...otherArgs,
|
|
272391
|
+
applicationId: application.id,
|
|
272392
|
+
blockchainNodeId: blockchainNode?.id,
|
|
272393
|
+
loadBalancerId: loadBalancer?.id,
|
|
272394
|
+
storageId: storage?.id
|
|
272395
|
+
});
|
|
272063
272396
|
return middleware;
|
|
272064
272397
|
};
|
|
272065
272398
|
};
|
|
272066
|
-
var middlewareRestart = (gqlClient, _options) => async (
|
|
272067
|
-
const
|
|
272068
|
-
|
|
272399
|
+
var middlewareRestart = (gqlClient, _options) => async (middlewareUniqueName) => {
|
|
272400
|
+
const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {
|
|
272401
|
+
uniqueName: middlewareUniqueName
|
|
272402
|
+
});
|
|
272069
272403
|
return middleware;
|
|
272070
272404
|
};
|
|
272071
272405
|
var PrivateKeyFragment = graphql(`
|
|
272072
272406
|
fragment PrivateKey on PrivateKey {
|
|
272073
272407
|
__typename
|
|
272074
272408
|
id
|
|
272075
|
-
name
|
|
272076
272409
|
uniqueName
|
|
272410
|
+
name
|
|
272077
272411
|
privateKeyType
|
|
272078
272412
|
status
|
|
272079
272413
|
}
|
|
272080
272414
|
`);
|
|
272081
272415
|
var getPrivateKeys = graphql(`
|
|
272082
|
-
query
|
|
272083
|
-
|
|
272084
|
-
|
|
272085
|
-
|
|
272416
|
+
query GetPrivateKeys($applicationUniqueName: String!) {
|
|
272417
|
+
privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272418
|
+
items {
|
|
272419
|
+
...PrivateKey
|
|
272420
|
+
}
|
|
272421
|
+
}
|
|
272086
272422
|
}
|
|
272087
|
-
|
|
272088
|
-
}`, [PrivateKeyFragment]);
|
|
272423
|
+
`, [PrivateKeyFragment]);
|
|
272089
272424
|
var getPrivateKey = graphql(`
|
|
272090
|
-
query
|
|
272091
|
-
|
|
272092
|
-
|
|
272093
|
-
|
|
272094
|
-
}
|
|
272095
|
-
`, [PrivateKeyFragment]);
|
|
272425
|
+
query GetPrivateKey($uniqueName: String!) {
|
|
272426
|
+
privateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
272427
|
+
...PrivateKey
|
|
272428
|
+
}
|
|
272429
|
+
}
|
|
272430
|
+
`, [PrivateKeyFragment]);
|
|
272096
272431
|
var createPrivateKey = graphql(`
|
|
272097
|
-
|
|
272098
|
-
|
|
272099
|
-
|
|
272100
|
-
|
|
272101
|
-
|
|
272102
|
-
|
|
272103
|
-
|
|
272104
|
-
|
|
272105
|
-
|
|
272106
|
-
) {
|
|
272107
|
-
createPrivateKey(
|
|
272108
|
-
applicationId: $applicationId,
|
|
272109
|
-
name: $name,
|
|
272110
|
-
privateKeyType: $privateKeyType,
|
|
272111
|
-
provider: $provider,
|
|
272112
|
-
region: $region
|
|
272113
|
-
size: $size
|
|
272114
|
-
type: $type
|
|
272115
|
-
blockchainNodes: $blockchainNodes
|
|
272432
|
+
mutation CreatePrivateKey(
|
|
272433
|
+
$applicationId: ID!
|
|
272434
|
+
$name: String!
|
|
272435
|
+
$privateKeyType: PrivateKeyType!
|
|
272436
|
+
$provider: String!
|
|
272437
|
+
$region: String!
|
|
272438
|
+
$size: ClusterServiceSize
|
|
272439
|
+
$type: ClusterServiceType
|
|
272440
|
+
$blockchainNodes: [ID!]
|
|
272116
272441
|
) {
|
|
272117
|
-
|
|
272118
|
-
|
|
272119
|
-
|
|
272120
|
-
|
|
272442
|
+
createPrivateKey(
|
|
272443
|
+
applicationId: $applicationId
|
|
272444
|
+
name: $name
|
|
272445
|
+
privateKeyType: $privateKeyType
|
|
272446
|
+
provider: $provider
|
|
272447
|
+
region: $region
|
|
272448
|
+
size: $size
|
|
272449
|
+
type: $type
|
|
272450
|
+
blockchainNodes: $blockchainNodes
|
|
272451
|
+
) {
|
|
272452
|
+
...PrivateKey
|
|
272453
|
+
}
|
|
272454
|
+
}
|
|
272455
|
+
`, [PrivateKeyFragment]);
|
|
272121
272456
|
var restartPrivateKey = graphql(`
|
|
272122
|
-
|
|
272123
|
-
|
|
272124
|
-
|
|
272457
|
+
mutation RestartPrivateKey($uniqueName: String!) {
|
|
272458
|
+
restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
272459
|
+
...PrivateKey
|
|
272460
|
+
}
|
|
272125
272461
|
}
|
|
272126
|
-
|
|
272127
|
-
`, [PrivateKeyFragment]);
|
|
272462
|
+
`, [PrivateKeyFragment]);
|
|
272128
272463
|
var privateKeyList = (gqlClient, options) => {
|
|
272129
|
-
return async (
|
|
272130
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272464
|
+
return async (applicationUniqueName) => {
|
|
272131
272465
|
const {
|
|
272132
|
-
|
|
272133
|
-
} = await gqlClient.request(getPrivateKeys, {
|
|
272466
|
+
privateKeysByUniqueName: { items }
|
|
272467
|
+
} = await gqlClient.request(getPrivateKeys, { applicationUniqueName });
|
|
272134
272468
|
return items;
|
|
272135
272469
|
};
|
|
272136
272470
|
};
|
|
272137
272471
|
var privatekeyRead = (gqlClient, options) => {
|
|
272138
|
-
return async (
|
|
272139
|
-
const
|
|
272140
|
-
|
|
272472
|
+
return async (privateKeyUniqueName) => {
|
|
272473
|
+
const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {
|
|
272474
|
+
uniqueName: privateKeyUniqueName
|
|
272475
|
+
});
|
|
272141
272476
|
return privateKey;
|
|
272142
272477
|
};
|
|
272143
272478
|
};
|
|
272144
272479
|
var privateKeyCreate = (gqlClient, options) => {
|
|
272145
272480
|
return async (args) => {
|
|
272146
|
-
|
|
272147
|
-
const
|
|
272481
|
+
const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
|
|
272482
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272483
|
+
const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient, options)(uniqueName))) : [];
|
|
272484
|
+
const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {
|
|
272485
|
+
...otherArgs,
|
|
272486
|
+
applicationId: application.id,
|
|
272487
|
+
blockchainNodes: blockchainNodes.map((node) => node?.id)
|
|
272488
|
+
});
|
|
272148
272489
|
return privateKey;
|
|
272149
272490
|
};
|
|
272150
272491
|
};
|
|
272151
|
-
var privateKeyRestart = (gqlClient, _options) => async (
|
|
272152
|
-
const
|
|
272153
|
-
|
|
272154
|
-
return privateKey;
|
|
272155
|
-
};
|
|
272156
|
-
var SmartContractSetFragment = graphql(`
|
|
272157
|
-
fragment SmartContractSet on SmartContractSet {
|
|
272158
|
-
__typename
|
|
272159
|
-
id
|
|
272160
|
-
name
|
|
272161
|
-
application {
|
|
272162
|
-
id
|
|
272163
|
-
}
|
|
272164
|
-
status
|
|
272165
|
-
useCase
|
|
272166
|
-
user {
|
|
272167
|
-
id
|
|
272168
|
-
firstname
|
|
272169
|
-
lastname
|
|
272170
|
-
}
|
|
272171
|
-
}
|
|
272172
|
-
`);
|
|
272173
|
-
var getSmartContractSets = graphql(`
|
|
272174
|
-
query getSmartContractSets($id: ID!) {
|
|
272175
|
-
smartContractSets(applicationId: $id) {
|
|
272176
|
-
items {
|
|
272177
|
-
...SmartContractSet
|
|
272178
|
-
}
|
|
272179
|
-
}
|
|
272180
|
-
}`, [SmartContractSetFragment]);
|
|
272181
|
-
var getSmartContractSet = graphql(`
|
|
272182
|
-
query getSmartContractSet($id: ID!) {
|
|
272183
|
-
smartContractSet(entityId: $id) {
|
|
272184
|
-
...SmartContractSet
|
|
272185
|
-
}
|
|
272186
|
-
}`, [SmartContractSetFragment]);
|
|
272187
|
-
var createSmartContractSet = graphql(`
|
|
272188
|
-
mutation CreateSmartContractSet(
|
|
272189
|
-
$applicationId: ID!
|
|
272190
|
-
$name: String!
|
|
272191
|
-
$blockchainNodeId: ID!
|
|
272192
|
-
$useCase: String!
|
|
272193
|
-
$userId: ID
|
|
272194
|
-
$provider: String!
|
|
272195
|
-
$region: String!
|
|
272196
|
-
$size: ClusterServiceSize
|
|
272197
|
-
$type: ClusterServiceType
|
|
272198
|
-
) {
|
|
272199
|
-
createSmartContractSet(
|
|
272200
|
-
applicationId: $applicationId,
|
|
272201
|
-
name: $name,
|
|
272202
|
-
blockchainNodeId: $blockchainNodeId
|
|
272203
|
-
useCase: $useCase
|
|
272204
|
-
userId: $userId
|
|
272205
|
-
provider: $provider,
|
|
272206
|
-
region: $region
|
|
272207
|
-
size: $size
|
|
272208
|
-
type: $type
|
|
272209
|
-
) {
|
|
272210
|
-
...SmartContractSet
|
|
272211
|
-
}
|
|
272212
|
-
}`, [SmartContractSetFragment]);
|
|
272213
|
-
var restartSmartContractSet = graphql(`
|
|
272214
|
-
mutation RestartSmartContractSet($entityId: ID!) {
|
|
272215
|
-
restartSmartContractSet(entityId: $entityId) {
|
|
272216
|
-
...SmartContractSet
|
|
272217
|
-
}
|
|
272218
|
-
}`, [SmartContractSetFragment]);
|
|
272219
|
-
var smartContractSetList = (gqlClient, options) => {
|
|
272220
|
-
return async (applicationId) => {
|
|
272221
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272222
|
-
const {
|
|
272223
|
-
smartContractSets: { items }
|
|
272224
|
-
} = await gqlClient.request(getSmartContractSets, { id });
|
|
272225
|
-
return items;
|
|
272226
|
-
};
|
|
272227
|
-
};
|
|
272228
|
-
var smartContractSetRead = (gqlClient, options) => {
|
|
272229
|
-
return async (smartContractSetId) => {
|
|
272230
|
-
const id = validate3(IdSchema3, smartContractSetId);
|
|
272231
|
-
const { smartContractSet } = await gqlClient.request(getSmartContractSet, { id });
|
|
272232
|
-
return smartContractSet;
|
|
272233
|
-
};
|
|
272234
|
-
};
|
|
272235
|
-
var smartContractSetCreate = (gqlClient, options) => {
|
|
272236
|
-
return async (args) => {
|
|
272237
|
-
validate3(IdSchema3, args.applicationId);
|
|
272238
|
-
validate3(IdSchema3, args.blockchainNodeId);
|
|
272239
|
-
if (typeof args.userId === "string") {
|
|
272240
|
-
validate3(IdSchema3, args.userId);
|
|
272241
|
-
}
|
|
272242
|
-
const { createSmartContractSet: smartContractSet } = await gqlClient.request(createSmartContractSet, args);
|
|
272243
|
-
return smartContractSet;
|
|
272244
|
-
};
|
|
272245
|
-
};
|
|
272246
|
-
var smartContractSetRestart = (gqlClient, _options) => async (smartContractSetId) => {
|
|
272247
|
-
const id = validate3(IdSchema3, smartContractSetId);
|
|
272248
|
-
const { restartSmartContractSet: smartContractSet } = await gqlClient.request(restartSmartContractSet, {
|
|
272249
|
-
entityId: id
|
|
272492
|
+
var privateKeyRestart = (gqlClient, _options) => async (privateKeyUniqueName) => {
|
|
272493
|
+
const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {
|
|
272494
|
+
uniqueName: privateKeyUniqueName
|
|
272250
272495
|
});
|
|
272251
|
-
return
|
|
272252
|
-
};
|
|
272253
|
-
var StorageFragment = graphql(`
|
|
272254
|
-
fragment Storage on Storage {
|
|
272255
|
-
__typename
|
|
272256
|
-
id
|
|
272257
|
-
name
|
|
272258
|
-
status
|
|
272259
|
-
storageProtocol
|
|
272260
|
-
endpoints {
|
|
272261
|
-
id
|
|
272262
|
-
label
|
|
272263
|
-
displayValue
|
|
272264
|
-
}
|
|
272265
|
-
credentials {
|
|
272266
|
-
id
|
|
272267
|
-
label
|
|
272268
|
-
displayValue
|
|
272269
|
-
}
|
|
272270
|
-
}
|
|
272271
|
-
`);
|
|
272272
|
-
var getStorages = graphql(`
|
|
272273
|
-
query getStorages($id: ID!) {
|
|
272274
|
-
storages(applicationId: $id) {
|
|
272275
|
-
items {
|
|
272276
|
-
...Storage
|
|
272277
|
-
}
|
|
272278
|
-
}
|
|
272279
|
-
}`, [StorageFragment]);
|
|
272280
|
-
var getStorage = graphql(`
|
|
272281
|
-
query getStorage($id: ID!) {
|
|
272282
|
-
storage(entityId: $id) {
|
|
272283
|
-
...Storage
|
|
272284
|
-
}
|
|
272285
|
-
}
|
|
272286
|
-
`, [StorageFragment]);
|
|
272287
|
-
var createStorage = graphql(`
|
|
272288
|
-
mutation CreateStorage(
|
|
272289
|
-
$applicationId: ID!,
|
|
272290
|
-
$name: String!,
|
|
272291
|
-
$storageProtocol: StorageProtocol!,
|
|
272292
|
-
$provider: String!,
|
|
272293
|
-
$region: String!,
|
|
272294
|
-
$size: ClusterServiceSize
|
|
272295
|
-
$type: ClusterServiceType
|
|
272296
|
-
) {
|
|
272297
|
-
createStorage(
|
|
272298
|
-
applicationId: $applicationId,
|
|
272299
|
-
name: $name,
|
|
272300
|
-
storageProtocol: $storageProtocol,
|
|
272301
|
-
provider: $provider,
|
|
272302
|
-
region: $region,
|
|
272303
|
-
size: $size,
|
|
272304
|
-
type: $type
|
|
272305
|
-
) {
|
|
272306
|
-
...Storage
|
|
272307
|
-
}
|
|
272308
|
-
}
|
|
272309
|
-
`, [StorageFragment]);
|
|
272310
|
-
var restartStorage = graphql(`
|
|
272311
|
-
mutation RestartStorage($id: ID!) {
|
|
272312
|
-
restartStorage(entityId: $id) {
|
|
272313
|
-
...Storage
|
|
272314
|
-
}
|
|
272315
|
-
}
|
|
272316
|
-
`, [StorageFragment]);
|
|
272317
|
-
var storageList = (gqlClient, options) => {
|
|
272318
|
-
return async (applicationId) => {
|
|
272319
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272320
|
-
const {
|
|
272321
|
-
storages: { items }
|
|
272322
|
-
} = await gqlClient.request(getStorages, { id });
|
|
272323
|
-
return items;
|
|
272324
|
-
};
|
|
272325
|
-
};
|
|
272326
|
-
var storageRead = (gqlClient, options) => {
|
|
272327
|
-
return async (storageId) => {
|
|
272328
|
-
const id = validate3(IdSchema3, storageId);
|
|
272329
|
-
const { storage } = await gqlClient.request(getStorage, { id });
|
|
272330
|
-
return storage;
|
|
272331
|
-
};
|
|
272332
|
-
};
|
|
272333
|
-
var storageCreate = (gqlClient, options) => {
|
|
272334
|
-
return async (args) => {
|
|
272335
|
-
validate3(IdSchema3, args.applicationId);
|
|
272336
|
-
const { createStorage: storage } = await gqlClient.request(createStorage, args);
|
|
272337
|
-
return storage;
|
|
272338
|
-
};
|
|
272339
|
-
};
|
|
272340
|
-
var storageRestart = (gqlClient, _options) => async (storageId) => {
|
|
272341
|
-
const id = validate3(IdSchema3, storageId);
|
|
272342
|
-
const { restartStorage: storage } = await gqlClient.request(restartStorage, { id });
|
|
272343
|
-
return storage;
|
|
272344
|
-
};
|
|
272345
|
-
var WorkspaceFragment = graphql(`
|
|
272346
|
-
fragment Workspace on Workspace {
|
|
272347
|
-
id
|
|
272348
|
-
name
|
|
272349
|
-
applications {
|
|
272350
|
-
...Application
|
|
272351
|
-
}
|
|
272352
|
-
}
|
|
272353
|
-
`, [ApplicationFragment]);
|
|
272354
|
-
var getWorkspacesAndApplications = graphql(`
|
|
272355
|
-
query getWorkspacesAndApplications {
|
|
272356
|
-
workspaces {
|
|
272357
|
-
...Workspace
|
|
272358
|
-
applications {
|
|
272359
|
-
...Application
|
|
272360
|
-
}
|
|
272361
|
-
childWorkspaces {
|
|
272362
|
-
...Workspace
|
|
272363
|
-
}
|
|
272364
|
-
}
|
|
272365
|
-
}
|
|
272366
|
-
`, [WorkspaceFragment, ApplicationFragment]);
|
|
272367
|
-
var getWorkspace = graphql(`
|
|
272368
|
-
query getWorkspace($id: ID!) {
|
|
272369
|
-
workspace(workspaceId: $id) {
|
|
272370
|
-
...Workspace
|
|
272371
|
-
applications {
|
|
272372
|
-
...Application
|
|
272373
|
-
}
|
|
272374
|
-
}
|
|
272375
|
-
}
|
|
272376
|
-
`, [WorkspaceFragment, ApplicationFragment]);
|
|
272377
|
-
var createWorkspace = graphql(`
|
|
272378
|
-
mutation CreateWorkspace(
|
|
272379
|
-
$addressLine1: String
|
|
272380
|
-
$addressLine2: String
|
|
272381
|
-
$city: String
|
|
272382
|
-
$companyName: String
|
|
272383
|
-
$country: String
|
|
272384
|
-
$name: String!
|
|
272385
|
-
$parentId: String
|
|
272386
|
-
$paymentMethodId: String
|
|
272387
|
-
$postalCode: String
|
|
272388
|
-
$taxIdType: String
|
|
272389
|
-
$taxIdValue: String
|
|
272390
|
-
) {
|
|
272391
|
-
createWorkspace(
|
|
272392
|
-
addressLine1: $addressLine1
|
|
272393
|
-
addressLine2: $addressLine2
|
|
272394
|
-
city: $city
|
|
272395
|
-
companyName: $companyName
|
|
272396
|
-
country: $country
|
|
272397
|
-
name: $name
|
|
272398
|
-
parentId: $parentId
|
|
272399
|
-
paymentMethodId: $paymentMethodId
|
|
272400
|
-
postalCode: $postalCode
|
|
272401
|
-
taxIdType: $taxIdType
|
|
272402
|
-
taxIdValue: $taxIdValue
|
|
272403
|
-
) {
|
|
272404
|
-
...Workspace
|
|
272405
|
-
applications {
|
|
272406
|
-
...Application
|
|
272407
|
-
}
|
|
272408
|
-
}
|
|
272409
|
-
}
|
|
272410
|
-
`, [WorkspaceFragment, ApplicationFragment]);
|
|
272411
|
-
var deleteWorkspace = graphql(`
|
|
272412
|
-
mutation deleteWorkspace($id: ID!) {
|
|
272413
|
-
deleteWorkspace(workspaceId: $id) {
|
|
272414
|
-
...Workspace
|
|
272415
|
-
applications {
|
|
272416
|
-
...Application
|
|
272417
|
-
}
|
|
272418
|
-
}
|
|
272419
|
-
}
|
|
272420
|
-
`, [WorkspaceFragment, ApplicationFragment]);
|
|
272421
|
-
var addCredits = graphql(`
|
|
272422
|
-
mutation addCredits($workspaceId: String!, $amount: Float!) {
|
|
272423
|
-
addCredits(workspaceId: $workspaceId, amount: $amount)
|
|
272424
|
-
}
|
|
272425
|
-
`);
|
|
272426
|
-
var workspaceList = (gqlClient, options) => {
|
|
272427
|
-
return async () => {
|
|
272428
|
-
const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
|
|
272429
|
-
const allWorkspaces = workspaces.reduce((acc, workspace) => {
|
|
272430
|
-
acc.push(workspace);
|
|
272431
|
-
if (workspace.childWorkspaces) {
|
|
272432
|
-
acc.push(...workspace.childWorkspaces);
|
|
272433
|
-
}
|
|
272434
|
-
return acc;
|
|
272435
|
-
}, []);
|
|
272436
|
-
return allWorkspaces.sort((a8, b4) => a8.name.localeCompare(b4.name));
|
|
272437
|
-
};
|
|
272438
|
-
};
|
|
272439
|
-
var workspaceRead = (gqlClient, options) => {
|
|
272440
|
-
return async (workspaceId) => {
|
|
272441
|
-
const id = validate3(IdSchema3, workspaceId);
|
|
272442
|
-
const { workspace } = await gqlClient.request(getWorkspace, { id });
|
|
272443
|
-
return workspace;
|
|
272444
|
-
};
|
|
272445
|
-
};
|
|
272446
|
-
var workspaceCreate = (gqlClient, options) => {
|
|
272447
|
-
return async (createWorkspaceArgs) => {
|
|
272448
|
-
const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);
|
|
272449
|
-
return workspace;
|
|
272450
|
-
};
|
|
272451
|
-
};
|
|
272452
|
-
var workspaceDelete = (gqlClient, options) => {
|
|
272453
|
-
return async (workspaceId) => {
|
|
272454
|
-
const id = validate3(IdSchema3, workspaceId);
|
|
272455
|
-
const { deleteWorkspace: workspace } = await gqlClient.request(deleteWorkspace, { id });
|
|
272456
|
-
return workspace;
|
|
272457
|
-
};
|
|
272458
|
-
};
|
|
272459
|
-
var workspaceAddCredits = (gqlClient, options) => {
|
|
272460
|
-
return async (workspaceId, amount) => {
|
|
272461
|
-
const id = validate3(IdSchema3, workspaceId);
|
|
272462
|
-
if (amount <= 0) {
|
|
272463
|
-
throw new Error("Credit amount must be a positive number");
|
|
272464
|
-
}
|
|
272465
|
-
const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });
|
|
272466
|
-
return result;
|
|
272467
|
-
};
|
|
272496
|
+
return privateKey;
|
|
272468
272497
|
};
|
|
272469
272498
|
var ClientOptionsSchema = z3.object({
|
|
272470
272499
|
accessToken: AccessTokenSchema3,
|
|
@@ -272567,12 +272596,6 @@ function createSettleMintClient(options) {
|
|
|
272567
272596
|
update: customdeploymentUpdate(gqlClient, options),
|
|
272568
272597
|
restart: customDeploymentRestart(gqlClient, options)
|
|
272569
272598
|
},
|
|
272570
|
-
smartContractSet: {
|
|
272571
|
-
list: smartContractSetList(gqlClient, options),
|
|
272572
|
-
read: smartContractSetRead(gqlClient, options),
|
|
272573
|
-
create: smartContractSetCreate(gqlClient, options),
|
|
272574
|
-
restart: smartContractSetRestart(gqlClient, options)
|
|
272575
|
-
},
|
|
272576
272599
|
foundry: {
|
|
272577
272600
|
env: getEnv(gqlClient, options)
|
|
272578
272601
|
},
|
|
@@ -272777,7 +272800,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272777
272800
|
}
|
|
272778
272801
|
});
|
|
272779
272802
|
const aat = await settlemint.applicationAccessToken.create({
|
|
272780
|
-
|
|
272803
|
+
applicationUniqueName: application.uniqueName,
|
|
272781
272804
|
name: name2,
|
|
272782
272805
|
blockchainNetworkScope: {
|
|
272783
272806
|
type: "ALL",
|
|
@@ -272842,7 +272865,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272842
272865
|
|
|
272843
272866
|
// src/commands/connect/application.prompt.ts
|
|
272844
272867
|
async function applicationPrompt(env2, applications, accept) {
|
|
272845
|
-
const defaultApplication = applications.find((application2) => application2.
|
|
272868
|
+
const defaultApplication = applications.find((application2) => application2.uniqueName === env2.SETTLEMINT_APPLICATION);
|
|
272846
272869
|
const defaultPossible = accept && defaultApplication;
|
|
272847
272870
|
if (defaultPossible) {
|
|
272848
272871
|
return defaultApplication;
|
|
@@ -272869,7 +272892,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272869
272892
|
if (nodes.length === 0) {
|
|
272870
272893
|
return;
|
|
272871
272894
|
}
|
|
272872
|
-
const defaultNode = nodes.find((node2) => node2.
|
|
272895
|
+
const defaultNode = nodes.find((node2) => node2.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
|
|
272873
272896
|
const defaultPossible = accept;
|
|
272874
272897
|
if (defaultPossible) {
|
|
272875
272898
|
return defaultNode;
|
|
@@ -272897,7 +272920,7 @@ async function blockscoutPrompt(env2, insights, accept) {
|
|
|
272897
272920
|
if (possible.length === 0) {
|
|
272898
272921
|
return;
|
|
272899
272922
|
}
|
|
272900
|
-
const defaultBlockscout = insights.find((insight) => insight.
|
|
272923
|
+
const defaultBlockscout = insights.find((insight) => insight.uniqueName === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
|
|
272901
272924
|
const defaultPossible = accept;
|
|
272902
272925
|
if (defaultPossible) {
|
|
272903
272926
|
return defaultBlockscout;
|
|
@@ -272924,7 +272947,7 @@ async function customDeploymentPrompt(env2, customDeployments, accept) {
|
|
|
272924
272947
|
if (customDeployments.length === 0) {
|
|
272925
272948
|
return;
|
|
272926
272949
|
}
|
|
272927
|
-
const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.
|
|
272950
|
+
const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.uniqueName === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
|
|
272928
272951
|
const defaultPossible = accept;
|
|
272929
272952
|
if (defaultPossible) {
|
|
272930
272953
|
return defaultCustomDeployment;
|
|
@@ -272952,7 +272975,7 @@ async function hasuraPrompt(env2, integrations, accept) {
|
|
|
272952
272975
|
if (possible.length === 0) {
|
|
272953
272976
|
return;
|
|
272954
272977
|
}
|
|
272955
|
-
const defaultIntegration = possible.find((integration) => integration.
|
|
272978
|
+
const defaultIntegration = possible.find((integration) => integration.uniqueName === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
272956
272979
|
const defaultPossible = accept;
|
|
272957
272980
|
if (defaultPossible) {
|
|
272958
272981
|
return defaultIntegration;
|
|
@@ -273031,7 +273054,7 @@ async function ipfsPrompt(env2, storages, accept) {
|
|
|
273031
273054
|
if (possible.length === 0) {
|
|
273032
273055
|
return;
|
|
273033
273056
|
}
|
|
273034
|
-
const defaultStorage = possible.find((storage) => storage.
|
|
273057
|
+
const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273035
273058
|
const defaultPossible = accept;
|
|
273036
273059
|
if (defaultPossible) {
|
|
273037
273060
|
return defaultStorage;
|
|
@@ -273059,7 +273082,7 @@ async function minioPrompt(env2, storages, accept) {
|
|
|
273059
273082
|
if (possible.length === 0) {
|
|
273060
273083
|
return;
|
|
273061
273084
|
}
|
|
273062
|
-
const defaultStorage = possible.find((storage) => storage.
|
|
273085
|
+
const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273063
273086
|
const defaultPossible = accept;
|
|
273064
273087
|
if (defaultPossible) {
|
|
273065
273088
|
return defaultStorage;
|
|
@@ -273087,7 +273110,7 @@ async function portalPrompt(env2, middlewares, accept) {
|
|
|
273087
273110
|
if (possible.length === 0) {
|
|
273088
273111
|
return;
|
|
273089
273112
|
}
|
|
273090
|
-
const defaultMiddleware = possible.find((middleware2) => middleware2.
|
|
273113
|
+
const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273091
273114
|
const defaultPossible = accept;
|
|
273092
273115
|
if (defaultPossible) {
|
|
273093
273116
|
return defaultMiddleware;
|
|
@@ -273125,14 +273148,14 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273125
273148
|
insights,
|
|
273126
273149
|
customDeployment
|
|
273127
273150
|
] = await Promise.all([
|
|
273128
|
-
settlemint.blockchainNetwork.list(application.
|
|
273129
|
-
settlemint.blockchainNode.list(application.
|
|
273130
|
-
settlemint.middleware.list(application.
|
|
273131
|
-
settlemint.integrationTool.list(application.
|
|
273132
|
-
settlemint.storage.list(application.
|
|
273133
|
-
settlemint.privateKey.list(application.
|
|
273134
|
-
settlemint.insights.list(application.
|
|
273135
|
-
settlemint.customDeployment.list(application.
|
|
273151
|
+
settlemint.blockchainNetwork.list(application.uniqueName),
|
|
273152
|
+
settlemint.blockchainNode.list(application.uniqueName),
|
|
273153
|
+
settlemint.middleware.list(application.uniqueName),
|
|
273154
|
+
settlemint.integrationTool.list(application.uniqueName),
|
|
273155
|
+
settlemint.storage.list(application.uniqueName),
|
|
273156
|
+
settlemint.privateKey.list(application.uniqueName),
|
|
273157
|
+
settlemint.insights.list(application.uniqueName),
|
|
273158
|
+
settlemint.customDeployment.list(application.uniqueName)
|
|
273136
273159
|
]);
|
|
273137
273160
|
return {
|
|
273138
273161
|
blockchainNetworks,
|
|
@@ -273154,7 +273177,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
|
|
|
273154
273177
|
if (possible.length === 0) {
|
|
273155
273178
|
return;
|
|
273156
273179
|
}
|
|
273157
|
-
const defaultMiddleware = possible.find((middleware2) => middleware2.
|
|
273180
|
+
const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273158
273181
|
const defaultPossible = accept;
|
|
273159
273182
|
if (defaultPossible) {
|
|
273160
273183
|
return defaultMiddleware;
|
|
@@ -273178,7 +273201,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
|
|
|
273178
273201
|
|
|
273179
273202
|
// src/commands/connect/workspace.prompt.ts
|
|
273180
273203
|
async function workspacePrompt(env2, workspaces, accept) {
|
|
273181
|
-
const defaultWorkspace = workspaces.find((workspace2) => workspace2.
|
|
273204
|
+
const defaultWorkspace = workspaces.find((workspace2) => workspace2.uniqueName === env2.SETTLEMINT_WORKSPACE);
|
|
273182
273205
|
const defaultPossible = accept && defaultWorkspace;
|
|
273183
273206
|
if (defaultPossible) {
|
|
273184
273207
|
return defaultWorkspace;
|
|
@@ -273233,23 +273256,24 @@ function connectCommand() {
|
|
|
273233
273256
|
await writeEnvSpinner(!!prod, {
|
|
273234
273257
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273235
273258
|
SETTLEMINT_INSTANCE: instance,
|
|
273236
|
-
SETTLEMINT_WORKSPACE: workspace.
|
|
273237
|
-
SETTLEMINT_APPLICATION: application.
|
|
273238
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.
|
|
273239
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.
|
|
273240
|
-
SETTLEMINT_HASURA: hasura?.
|
|
273259
|
+
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
273260
|
+
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
273261
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
273262
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
|
273263
|
+
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
273241
273264
|
...getHasuraEndpoints(hasura),
|
|
273242
|
-
SETTLEMINT_THEGRAPH: thegraph?.
|
|
273265
|
+
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
273243
273266
|
...await getGraphEndpoint(thegraph, env2),
|
|
273267
|
+
SETTLEMINT_PORTAL: portal?.uniqueName,
|
|
273244
273268
|
...getPortalEndpoints(portal),
|
|
273245
273269
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
273246
|
-
SETTLEMINT_MINIO: minio?.
|
|
273270
|
+
SETTLEMINT_MINIO: minio?.uniqueName,
|
|
273247
273271
|
...getMinioEndpoints(minio),
|
|
273248
|
-
SETTLEMINT_IPFS: ipfs?.
|
|
273272
|
+
SETTLEMINT_IPFS: ipfs?.uniqueName,
|
|
273249
273273
|
...getIpfsEndpoints(ipfs),
|
|
273250
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.
|
|
273274
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
|
|
273251
273275
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
|
|
273252
|
-
SETTLEMINT_BLOCKSCOUT: blockscout?.
|
|
273276
|
+
SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
|
|
273253
273277
|
...getBlockscoutEndpoints(blockscout)
|
|
273254
273278
|
});
|
|
273255
273279
|
outro("Connected to SettleMint");
|
|
@@ -273259,7 +273283,7 @@ function connectCommand() {
|
|
|
273259
273283
|
var package_default = {
|
|
273260
273284
|
name: "@settlemint/sdk-cli",
|
|
273261
273285
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273262
|
-
version: "0.7.4-
|
|
273286
|
+
version: "0.7.4-pre024885e",
|
|
273263
273287
|
type: "module",
|
|
273264
273288
|
private: false,
|
|
273265
273289
|
license: "FSL-1.1-MIT",
|
|
@@ -273310,8 +273334,8 @@ var package_default = {
|
|
|
273310
273334
|
"@inquirer/input": "4.1.1",
|
|
273311
273335
|
"@inquirer/password": "4.0.4",
|
|
273312
273336
|
"@inquirer/select": "4.0.4",
|
|
273313
|
-
"@settlemint/sdk-js": "0.7.4-
|
|
273314
|
-
"@settlemint/sdk-utils": "0.7.4-
|
|
273337
|
+
"@settlemint/sdk-js": "0.7.4-pre024885e",
|
|
273338
|
+
"@settlemint/sdk-utils": "0.7.4-pre024885e",
|
|
273315
273339
|
"get-tsconfig": "4.8.1",
|
|
273316
273340
|
giget: "1.2.3"
|
|
273317
273341
|
},
|
|
@@ -274308,7 +274332,6 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
|
274308
274332
|
"blockchain node": "blockchainNode",
|
|
274309
274333
|
"custom deployment": "customDeployment",
|
|
274310
274334
|
"private key": "privateKey",
|
|
274311
|
-
"smart contract set": "smartContractSet",
|
|
274312
274335
|
middleware: "middleware",
|
|
274313
274336
|
"integration tool": "integrationTool",
|
|
274314
274337
|
storage: "storage",
|
|
@@ -274322,7 +274345,7 @@ class TimeoutError extends Error {
|
|
|
274322
274345
|
async function waitForCompletion({
|
|
274323
274346
|
settlemint,
|
|
274324
274347
|
type: type4,
|
|
274325
|
-
|
|
274348
|
+
uniqueName,
|
|
274326
274349
|
action,
|
|
274327
274350
|
maxTimeout = 10 * 60 * 1000,
|
|
274328
274351
|
restartIfTimeout = false
|
|
@@ -274343,7 +274366,7 @@ async function waitForCompletion({
|
|
|
274343
274366
|
const startTime = Date.now();
|
|
274344
274367
|
while (true) {
|
|
274345
274368
|
try {
|
|
274346
|
-
const resource = await service.read(
|
|
274369
|
+
const resource = await service.read(uniqueName);
|
|
274347
274370
|
if (resource.status === "COMPLETED") {
|
|
274348
274371
|
note(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
|
|
274349
274372
|
return true;
|
|
@@ -274357,7 +274380,7 @@ async function waitForCompletion({
|
|
|
274357
274380
|
note(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
|
|
274358
274381
|
}
|
|
274359
274382
|
if (Date.now() - startTime > maxTimeout) {
|
|
274360
|
-
throw new TimeoutError(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with
|
|
274383
|
+
throw new TimeoutError(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
|
|
274361
274384
|
}
|
|
274362
274385
|
await new Promise((resolve6) => setTimeout(resolve6, 5000));
|
|
274363
274386
|
}
|
|
@@ -274369,7 +274392,7 @@ async function waitForCompletion({
|
|
|
274369
274392
|
} catch (error5) {
|
|
274370
274393
|
if (restartIfTimeout && error5 instanceof TimeoutError) {
|
|
274371
274394
|
note(`Restarting ${capitalizeFirstLetter(type4)}`);
|
|
274372
|
-
await service.restart(
|
|
274395
|
+
await service.restart(uniqueName);
|
|
274373
274396
|
return showSpinner();
|
|
274374
274397
|
}
|
|
274375
274398
|
throw error5;
|
|
@@ -274447,7 +274470,7 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274447
274470
|
await waitForCompletion({
|
|
274448
274471
|
settlemint,
|
|
274449
274472
|
type: waitFor?.resourceType ?? type4,
|
|
274450
|
-
|
|
274473
|
+
uniqueName: waitFor?.uniqueName ?? result.uniqueName,
|
|
274451
274474
|
action: "deploy",
|
|
274452
274475
|
restartIfTimeout
|
|
274453
274476
|
});
|
|
@@ -274468,10 +274491,10 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274468
274491
|
...updatedEnv
|
|
274469
274492
|
};
|
|
274470
274493
|
if (isApplicationChanged && updatedEnv.SETTLEMINT_APPLICATION) {
|
|
274471
|
-
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.
|
|
274494
|
+
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.uniqueName;
|
|
274472
274495
|
}
|
|
274473
274496
|
if (newEnv.SETTLEMINT_BLOCKCHAIN_NODE && newEnv.SETTLEMINT_BLOCKCHAIN_NODE !== env2.SETTLEMINT_BLOCKCHAIN_NODE) {
|
|
274474
|
-
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.
|
|
274497
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.uniqueName;
|
|
274475
274498
|
}
|
|
274476
274499
|
await writeEnvSpinner(!!prod, newEnv);
|
|
274477
274500
|
note(`${capitalizeFirstLetter(type4)} ${result.name} set as default`);
|
|
@@ -274488,8 +274511,8 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274488
274511
|
type: "blockchain network",
|
|
274489
274512
|
alias: "b",
|
|
274490
274513
|
execute: (cmd2, baseAction) => {
|
|
274491
|
-
addClusterServiceArgs(cmd2).option("-a, --application
|
|
274492
|
-
|
|
274514
|
+
addClusterServiceArgs(cmd2).option("-a, --application <application>", "The unique name of the application to create the network in (defaults to application from env)").requiredOption("--node-name <name>", "Name of the node").option("--chain-id <chainId>", "The chain ID for the network", parseNumber).option("--contract-size-limit <limit>", "Maximum contract size limit", parseNumber).option("--evm-stack-size <size>", "EVM stack size", parseNumber).option("--gas-limit <limit>", "Block gas limit").option("--gas-price <price>", "Gas price in wei", parseNumber).option("--seconds-per-block <seconds>", "Block time in seconds", parseNumber).action(async (name2, {
|
|
274515
|
+
application,
|
|
274493
274516
|
chainId,
|
|
274494
274517
|
contractSizeLimit,
|
|
274495
274518
|
evmStackSize,
|
|
@@ -274504,10 +274527,10 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274504
274527
|
...defaultArgs
|
|
274505
274528
|
}) => {
|
|
274506
274529
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274507
|
-
const
|
|
274530
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274508
274531
|
const result = await settlemint.blockchainNetwork.create({
|
|
274509
274532
|
name: name2,
|
|
274510
|
-
|
|
274533
|
+
applicationUniqueName,
|
|
274511
274534
|
nodeName,
|
|
274512
274535
|
consensusAlgorithm: "BESU_QBFT",
|
|
274513
274536
|
chainId,
|
|
@@ -274530,9 +274553,9 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274530
274553
|
} : undefined,
|
|
274531
274554
|
mapDefaultEnv: () => {
|
|
274532
274555
|
return {
|
|
274533
|
-
SETTLEMINT_APPLICATION:
|
|
274534
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK: result.
|
|
274535
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.
|
|
274556
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274557
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
|
|
274558
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName
|
|
274536
274559
|
};
|
|
274537
274560
|
}
|
|
274538
274561
|
};
|
|
@@ -274546,7 +274569,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274546
274569
|
},
|
|
274547
274570
|
{
|
|
274548
274571
|
description: "Create a Besu blockchain network in a different application",
|
|
274549
|
-
command: "platform create blockchain-network besu my-network --application-
|
|
274572
|
+
command: "platform create blockchain-network besu my-network --application app-123 --node-name validator-1 --chain-id 12345 --gas-limit 10000000 --seconds-per-block 5"
|
|
274550
274573
|
}
|
|
274551
274574
|
]
|
|
274552
274575
|
});
|
|
@@ -274677,7 +274700,7 @@ function workspaceCreateCommand() {
|
|
|
274677
274700
|
result,
|
|
274678
274701
|
mapDefaultEnv: () => {
|
|
274679
274702
|
return {
|
|
274680
|
-
SETTLEMINT_WORKSPACE: result.
|
|
274703
|
+
SETTLEMINT_WORKSPACE: result.uniqueName
|
|
274681
274704
|
};
|
|
274682
274705
|
}
|
|
274683
274706
|
};
|
|
@@ -274708,10 +274731,11 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274708
274731
|
type: "application access token",
|
|
274709
274732
|
alias: "aat",
|
|
274710
274733
|
execute: (cmd2, baseAction) => {
|
|
274711
|
-
cmd2.option("-a, --application
|
|
274734
|
+
cmd2.option("-a, --application <application>", "The application unique name to create the application access token for (defaults to application from env)").addOption(new Option("-v, --validity-period <period>", "The validity period for the token").choices(["DAYS_7", "DAYS_30", "DAYS_60", "DAYS_90", "NONE"]).default("DAYS_7")).action(async (name2, { application, validityPeriod, ...defaultArgs }) => {
|
|
274712
274735
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274736
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274713
274737
|
const aatToken = await settlemint.applicationAccessToken.create({
|
|
274714
|
-
|
|
274738
|
+
applicationUniqueName,
|
|
274715
274739
|
name: name2,
|
|
274716
274740
|
blockchainNetworkScope: {
|
|
274717
274741
|
type: "ALL",
|
|
@@ -274758,7 +274782,8 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274758
274782
|
return {
|
|
274759
274783
|
result: {
|
|
274760
274784
|
id: "",
|
|
274761
|
-
name: name2
|
|
274785
|
+
name: name2,
|
|
274786
|
+
uniqueName: ""
|
|
274762
274787
|
},
|
|
274763
274788
|
mapDefaultEnv: () => ({
|
|
274764
274789
|
SETTLEMINT_ACCESS_TOKEN: aatToken
|
|
@@ -274791,18 +274816,17 @@ function applicationCreateCommand() {
|
|
|
274791
274816
|
type: "application",
|
|
274792
274817
|
alias: "a",
|
|
274793
274818
|
execute: (cmd2, baseAction) => {
|
|
274794
|
-
cmd2.option("-w, --workspace
|
|
274819
|
+
cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, ...defaultArgs }) => {
|
|
274795
274820
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274796
|
-
const workspace = workspaceId ?? env2.SETTLEMINT_WORKSPACE;
|
|
274797
274821
|
const result = await settlemint.application.create({
|
|
274798
274822
|
name: name2,
|
|
274799
|
-
|
|
274823
|
+
workspaceUniqueName: workspace ?? env2.SETTLEMINT_WORKSPACE
|
|
274800
274824
|
});
|
|
274801
274825
|
return {
|
|
274802
274826
|
result,
|
|
274803
274827
|
mapDefaultEnv: () => {
|
|
274804
274828
|
return {
|
|
274805
|
-
SETTLEMINT_APPLICATION: result.
|
|
274829
|
+
SETTLEMINT_APPLICATION: result.uniqueName
|
|
274806
274830
|
};
|
|
274807
274831
|
}
|
|
274808
274832
|
};
|
|
@@ -274820,7 +274844,7 @@ function applicationCreateCommand() {
|
|
|
274820
274844
|
},
|
|
274821
274845
|
{
|
|
274822
274846
|
description: "Create an application in a specific workspace",
|
|
274823
|
-
command: "platform create application my-app --workspace-
|
|
274847
|
+
command: "platform create application my-app --workspace my-workspace"
|
|
274824
274848
|
}
|
|
274825
274849
|
]
|
|
274826
274850
|
});
|
|
@@ -274831,7 +274855,7 @@ async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
|
274831
274855
|
if (networks.length === 0) {
|
|
274832
274856
|
return;
|
|
274833
274857
|
}
|
|
274834
|
-
const defaultNetwork = networks.find((network) => network.
|
|
274858
|
+
const defaultNetwork = networks.find((network) => network.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
|
|
274835
274859
|
const defaultPossible = accept;
|
|
274836
274860
|
if (defaultPossible) {
|
|
274837
274861
|
return defaultNetwork;
|
|
@@ -274859,13 +274883,13 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274859
274883
|
type: "blockchain node",
|
|
274860
274884
|
alias: "b",
|
|
274861
274885
|
execute: (cmd2, baseAction) => {
|
|
274862
|
-
addClusterServiceArgs(cmd2).option("-a, --application
|
|
274863
|
-
|
|
274886
|
+
addClusterServiceArgs(cmd2).option("-a, --application <application>", "The application unique name to create the node in (defaults to application from env)").option("--blockchain-network <blockchainNetwork>", "Blockchain network unique name to add this node to").option("--node-identity <nodeIdentity>", "EC DSA P256 private key to use as the node identity").addOption(new Option("--node-type <nodeType>", "Type of the node").choices(["VALIDATOR", "NON_VALIDATOR"]).makeOptionMandatory()).action(async (name2, {
|
|
274887
|
+
application,
|
|
274864
274888
|
provider,
|
|
274865
274889
|
region,
|
|
274866
274890
|
size,
|
|
274867
274891
|
type: type4,
|
|
274868
|
-
|
|
274892
|
+
blockchainNetwork,
|
|
274869
274893
|
nodeType,
|
|
274870
274894
|
nodeIdentity,
|
|
274871
274895
|
acceptDefaults,
|
|
@@ -274873,23 +274897,23 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274873
274897
|
}) => {
|
|
274874
274898
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274875
274899
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274876
|
-
const
|
|
274877
|
-
if (!
|
|
274900
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274901
|
+
if (!applicationUniqueName) {
|
|
274878
274902
|
cancel2("No application found. Please specify an application or run `settlemint connect` to continue.");
|
|
274879
274903
|
}
|
|
274880
|
-
let
|
|
274881
|
-
if (!
|
|
274882
|
-
const networks = await settlemint.blockchainNetwork.list(
|
|
274904
|
+
let networkUniqueName = blockchainNetwork ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
|
|
274905
|
+
if (!networkUniqueName) {
|
|
274906
|
+
const networks = await settlemint.blockchainNetwork.list(applicationUniqueName);
|
|
274883
274907
|
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults ?? false);
|
|
274884
274908
|
if (!network) {
|
|
274885
274909
|
cancel2("No network found. Please specify a network to continue.");
|
|
274886
274910
|
}
|
|
274887
|
-
|
|
274911
|
+
networkUniqueName = network?.id;
|
|
274888
274912
|
}
|
|
274889
274913
|
const result = await settlemint.blockchainNode.create({
|
|
274890
|
-
|
|
274914
|
+
applicationUniqueName,
|
|
274891
274915
|
name: name2,
|
|
274892
|
-
|
|
274916
|
+
blockchainNetworkUniqueName: networkUniqueName,
|
|
274893
274917
|
nodeType,
|
|
274894
274918
|
keyMaterial: nodeIdentity,
|
|
274895
274919
|
provider,
|
|
@@ -274901,7 +274925,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274901
274925
|
result,
|
|
274902
274926
|
mapDefaultEnv: () => {
|
|
274903
274927
|
return {
|
|
274904
|
-
SETTLEMINT_APPLICATION:
|
|
274928
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274905
274929
|
SETTLEMINT_BLOCKCHAIN_NODE: result.id
|
|
274906
274930
|
};
|
|
274907
274931
|
}
|
|
@@ -274938,28 +274962,28 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274938
274962
|
type: "insights",
|
|
274939
274963
|
alias: "bs",
|
|
274940
274964
|
execute: (cmd2, baseAction) => {
|
|
274941
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
274965
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").action(async (name2, { application, provider, region, size, type: type4, blockchainNode, loadBalancer, ...defaultArgs }) => {
|
|
274942
274966
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274943
|
-
const
|
|
274944
|
-
const
|
|
274945
|
-
const
|
|
274967
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274968
|
+
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274969
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
274946
274970
|
const result = await settlemint.insights.create({
|
|
274947
274971
|
name: name2,
|
|
274948
|
-
|
|
274972
|
+
applicationUniqueName,
|
|
274949
274973
|
insightsCategory: "BLOCKCHAIN_EXPLORER",
|
|
274950
274974
|
provider,
|
|
274951
274975
|
region,
|
|
274952
274976
|
size,
|
|
274953
274977
|
type: type4,
|
|
274954
|
-
|
|
274955
|
-
|
|
274978
|
+
blockchainNodeUniqueName,
|
|
274979
|
+
loadBalancerUniqueName
|
|
274956
274980
|
});
|
|
274957
274981
|
return {
|
|
274958
274982
|
result,
|
|
274959
274983
|
mapDefaultEnv: async () => {
|
|
274960
274984
|
return {
|
|
274961
|
-
SETTLEMINT_APPLICATION:
|
|
274962
|
-
SETTLEMINT_BLOCKSCOUT: result.
|
|
274985
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274986
|
+
SETTLEMINT_BLOCKSCOUT: result.uniqueName,
|
|
274963
274987
|
...getBlockscoutEndpoints(result)
|
|
274964
274988
|
};
|
|
274965
274989
|
}
|
|
@@ -274974,7 +274998,7 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274974
274998
|
},
|
|
274975
274999
|
{
|
|
274976
275000
|
description: "Create a Blockscout insights service in a different application",
|
|
274977
|
-
command: "platform create insights blockscout my-blockscout --application-
|
|
275001
|
+
command: "platform create insights blockscout my-blockscout --application app-123"
|
|
274978
275002
|
}
|
|
274979
275003
|
]
|
|
274980
275004
|
});
|
|
@@ -274994,12 +275018,12 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274994
275018
|
type: "integration tool",
|
|
274995
275019
|
alias: "ha",
|
|
274996
275020
|
execute: (cmd2, baseAction) => {
|
|
274997
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275021
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274998
275022
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274999
|
-
const
|
|
275023
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275000
275024
|
const result = await settlemint.integrationTool.create({
|
|
275001
275025
|
name: name2,
|
|
275002
|
-
|
|
275026
|
+
applicationUniqueName,
|
|
275003
275027
|
integrationType: "HASURA",
|
|
275004
275028
|
provider,
|
|
275005
275029
|
region,
|
|
@@ -275010,8 +275034,8 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275010
275034
|
result,
|
|
275011
275035
|
mapDefaultEnv: async () => {
|
|
275012
275036
|
return {
|
|
275013
|
-
SETTLEMINT_APPLICATION:
|
|
275014
|
-
SETTLEMINT_HASURA: result.
|
|
275037
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275038
|
+
SETTLEMINT_HASURA: result.uniqueName,
|
|
275015
275039
|
...getHasuraEndpoints(result)
|
|
275016
275040
|
};
|
|
275017
275041
|
}
|
|
@@ -275026,7 +275050,7 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275026
275050
|
},
|
|
275027
275051
|
{
|
|
275028
275052
|
description: "Create a Hasura integration in a different application",
|
|
275029
|
-
command: "platform create integration-tool hasura my-hasura --application-
|
|
275053
|
+
command: "platform create integration-tool hasura my-hasura --application app-123"
|
|
275030
275054
|
}
|
|
275031
275055
|
]
|
|
275032
275056
|
});
|
|
@@ -275046,15 +275070,15 @@ function graphMiddlewareCreateCommand() {
|
|
|
275046
275070
|
type: "middleware",
|
|
275047
275071
|
alias: "gr",
|
|
275048
275072
|
execute: (cmd2, baseAction) => {
|
|
275049
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275073
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275050
275074
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275051
|
-
const
|
|
275052
|
-
const
|
|
275075
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275076
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275053
275077
|
const result = await settlemint.middleware.create({
|
|
275054
275078
|
name: name2,
|
|
275055
|
-
|
|
275079
|
+
applicationUniqueName,
|
|
275056
275080
|
interface: "HA_GRAPH",
|
|
275057
|
-
|
|
275081
|
+
blockchainNodeUniqueName,
|
|
275058
275082
|
provider,
|
|
275059
275083
|
region,
|
|
275060
275084
|
size,
|
|
@@ -275063,11 +275087,11 @@ function graphMiddlewareCreateCommand() {
|
|
|
275063
275087
|
return {
|
|
275064
275088
|
result,
|
|
275065
275089
|
mapDefaultEnv: async () => {
|
|
275066
|
-
const
|
|
275090
|
+
const graphMiddleware = await settlemint.middleware.read(result.uniqueName);
|
|
275067
275091
|
return {
|
|
275068
|
-
SETTLEMINT_APPLICATION:
|
|
275069
|
-
SETTLEMINT_THEGRAPH: result.
|
|
275070
|
-
...await getGraphEndpoint(
|
|
275092
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275093
|
+
SETTLEMINT_THEGRAPH: result.uniqueName,
|
|
275094
|
+
...await getGraphEndpoint(graphMiddleware, env2)
|
|
275071
275095
|
};
|
|
275072
275096
|
}
|
|
275073
275097
|
};
|
|
@@ -275081,7 +275105,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275081
275105
|
},
|
|
275082
275106
|
{
|
|
275083
275107
|
description: "Create a graph middleware in a different application",
|
|
275084
|
-
command: "platform create middleware graph my-graph --application-
|
|
275108
|
+
command: "platform create middleware graph my-graph --application my-app --blockchain-node node-123"
|
|
275085
275109
|
}
|
|
275086
275110
|
]
|
|
275087
275111
|
});
|
|
@@ -275095,16 +275119,16 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275095
275119
|
type: "middleware",
|
|
275096
275120
|
alias: "scp",
|
|
275097
275121
|
execute: (cmd2, baseAction) => {
|
|
275098
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275122
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").option("--abis <abis...>", "Path to abi file(s)").addOption(new Option("--include-predeployed-abis <includePredeployedAbis...>", "Include pre-deployed abis").choices([
|
|
275099
275123
|
"StarterKitERC20Registry",
|
|
275100
275124
|
"StarterKitERC20Factory",
|
|
275101
275125
|
"StarterKitERC20",
|
|
275102
275126
|
"StarterKitERC20DexFactory",
|
|
275103
275127
|
"StarterKitERC20Dex"
|
|
275104
275128
|
])).action(async (name2, {
|
|
275105
|
-
|
|
275106
|
-
|
|
275107
|
-
|
|
275129
|
+
application,
|
|
275130
|
+
blockchainNode,
|
|
275131
|
+
loadBalancer,
|
|
275108
275132
|
provider,
|
|
275109
275133
|
region,
|
|
275110
275134
|
size,
|
|
@@ -275114,9 +275138,9 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275114
275138
|
...defaultArgs
|
|
275115
275139
|
}) => {
|
|
275116
275140
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275117
|
-
const
|
|
275118
|
-
const
|
|
275119
|
-
const
|
|
275141
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275142
|
+
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275143
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
275120
275144
|
const parsedAbis = [];
|
|
275121
275145
|
if (abis && abis.length > 0) {
|
|
275122
275146
|
try {
|
|
@@ -275133,10 +275157,10 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275133
275157
|
}
|
|
275134
275158
|
const result = await settlemint.middleware.create({
|
|
275135
275159
|
name: name2,
|
|
275136
|
-
|
|
275160
|
+
applicationUniqueName,
|
|
275137
275161
|
interface: "SMART_CONTRACT_PORTAL",
|
|
275138
|
-
|
|
275139
|
-
|
|
275162
|
+
blockchainNodeUniqueName,
|
|
275163
|
+
loadBalancerUniqueName,
|
|
275140
275164
|
abis: parsedAbis,
|
|
275141
275165
|
includePredeployedAbis,
|
|
275142
275166
|
provider,
|
|
@@ -275148,8 +275172,8 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275148
275172
|
result,
|
|
275149
275173
|
mapDefaultEnv: async () => {
|
|
275150
275174
|
return {
|
|
275151
|
-
SETTLEMINT_APPLICATION:
|
|
275152
|
-
SETTLEMINT_PORTAL: result.
|
|
275175
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275176
|
+
SETTLEMINT_PORTAL: result.uniqueName,
|
|
275153
275177
|
...getPortalEndpoints(result)
|
|
275154
275178
|
};
|
|
275155
275179
|
}
|
|
@@ -275164,7 +275188,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275164
275188
|
},
|
|
275165
275189
|
{
|
|
275166
275190
|
description: "Create a smart contract portal middleware in a different application",
|
|
275167
|
-
command: "platform create middleware smart-contract-portal my-portal --application-
|
|
275191
|
+
command: "platform create middleware smart-contract-portal my-portal --application my-app --blockchain-node node-123"
|
|
275168
275192
|
}
|
|
275169
275193
|
]
|
|
275170
275194
|
});
|
|
@@ -275182,14 +275206,15 @@ function privateKeyHdCreateCommand() {
|
|
|
275182
275206
|
type: "private key",
|
|
275183
275207
|
alias: "hd",
|
|
275184
275208
|
execute: (cmd2, baseAction) => {
|
|
275185
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275209
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275186
275210
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275187
|
-
const
|
|
275211
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275212
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275188
275213
|
const result = await settlemint.privateKey.create({
|
|
275189
275214
|
name: name2,
|
|
275190
|
-
|
|
275215
|
+
applicationUniqueName,
|
|
275191
275216
|
privateKeyType: "HD_ECDSA_P256",
|
|
275192
|
-
|
|
275217
|
+
blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
|
|
275193
275218
|
provider,
|
|
275194
275219
|
region,
|
|
275195
275220
|
size,
|
|
@@ -275199,7 +275224,7 @@ function privateKeyHdCreateCommand() {
|
|
|
275199
275224
|
result,
|
|
275200
275225
|
mapDefaultEnv: () => {
|
|
275201
275226
|
return {
|
|
275202
|
-
SETTLEMINT_APPLICATION:
|
|
275227
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275203
275228
|
SETTLEMINT_HD_PRIVATE_KEY: result.uniqueName
|
|
275204
275229
|
};
|
|
275205
275230
|
}
|
|
@@ -275214,11 +275239,11 @@ function privateKeyHdCreateCommand() {
|
|
|
275214
275239
|
},
|
|
275215
275240
|
{
|
|
275216
275241
|
description: "Create a private key in a different application",
|
|
275217
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --application-
|
|
275242
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --application my-app"
|
|
275218
275243
|
},
|
|
275219
275244
|
{
|
|
275220
275245
|
description: "Create a private key linked to a blockchain node",
|
|
275221
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node-
|
|
275246
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node node-123"
|
|
275222
275247
|
}
|
|
275223
275248
|
]
|
|
275224
275249
|
});
|
|
@@ -275231,14 +275256,15 @@ function privateKeyHsmCreateCommand() {
|
|
|
275231
275256
|
type: "private key",
|
|
275232
275257
|
alias: "hd",
|
|
275233
275258
|
execute: (cmd2, baseAction) => {
|
|
275234
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275259
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275235
275260
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275236
|
-
const
|
|
275261
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275262
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275237
275263
|
const result = await settlemint.privateKey.create({
|
|
275238
275264
|
name: name2,
|
|
275239
|
-
|
|
275265
|
+
applicationUniqueName,
|
|
275240
275266
|
privateKeyType: "HSM_ECDSA_P256",
|
|
275241
|
-
|
|
275267
|
+
blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
|
|
275242
275268
|
provider,
|
|
275243
275269
|
region,
|
|
275244
275270
|
size,
|
|
@@ -275257,11 +275283,11 @@ function privateKeyHsmCreateCommand() {
|
|
|
275257
275283
|
},
|
|
275258
275284
|
{
|
|
275259
275285
|
description: "Create a private key in a different application",
|
|
275260
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --application
|
|
275286
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --application 123456789"
|
|
275261
275287
|
},
|
|
275262
275288
|
{
|
|
275263
275289
|
description: "Create a private key linked to a blockchain node",
|
|
275264
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node-
|
|
275290
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node node-123"
|
|
275265
275291
|
}
|
|
275266
275292
|
]
|
|
275267
275293
|
});
|
|
@@ -275279,12 +275305,12 @@ function ipfsStorageCreateCommand() {
|
|
|
275279
275305
|
type: "storage",
|
|
275280
275306
|
alias: "ip",
|
|
275281
275307
|
execute: (cmd2, baseAction) => {
|
|
275282
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275308
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275283
275309
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275284
|
-
const
|
|
275310
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275285
275311
|
const result = await settlemint.storage.create({
|
|
275286
275312
|
name: name2,
|
|
275287
|
-
|
|
275313
|
+
applicationUniqueName,
|
|
275288
275314
|
storageProtocol: "IPFS",
|
|
275289
275315
|
provider,
|
|
275290
275316
|
region,
|
|
@@ -275295,8 +275321,8 @@ function ipfsStorageCreateCommand() {
|
|
|
275295
275321
|
result,
|
|
275296
275322
|
mapDefaultEnv: () => {
|
|
275297
275323
|
return {
|
|
275298
|
-
SETTLEMINT_APPLICATION:
|
|
275299
|
-
SETTLEMINT_IPFS: result.
|
|
275324
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275325
|
+
SETTLEMINT_IPFS: result.uniqueName,
|
|
275300
275326
|
...getIpfsEndpoints(result)
|
|
275301
275327
|
};
|
|
275302
275328
|
}
|
|
@@ -275311,7 +275337,7 @@ function ipfsStorageCreateCommand() {
|
|
|
275311
275337
|
},
|
|
275312
275338
|
{
|
|
275313
275339
|
description: "Create an IPFS storage in a different application",
|
|
275314
|
-
command: "platform create storage ipfs my-storage --application
|
|
275340
|
+
command: "platform create storage ipfs my-storage --application app-123"
|
|
275315
275341
|
}
|
|
275316
275342
|
]
|
|
275317
275343
|
});
|
|
@@ -275324,12 +275350,12 @@ function minioStorageCreateCommand() {
|
|
|
275324
275350
|
type: "storage",
|
|
275325
275351
|
alias: "m",
|
|
275326
275352
|
execute: (cmd2, baseAction) => {
|
|
275327
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275353
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275328
275354
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275329
|
-
const
|
|
275355
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275330
275356
|
const result = await settlemint.storage.create({
|
|
275331
275357
|
name: name2,
|
|
275332
|
-
|
|
275358
|
+
applicationUniqueName,
|
|
275333
275359
|
storageProtocol: "MINIO",
|
|
275334
275360
|
provider,
|
|
275335
275361
|
region,
|
|
@@ -275340,8 +275366,8 @@ function minioStorageCreateCommand() {
|
|
|
275340
275366
|
result,
|
|
275341
275367
|
mapDefaultEnv: () => {
|
|
275342
275368
|
return {
|
|
275343
|
-
SETTLEMINT_APPLICATION:
|
|
275344
|
-
SETTLEMINT_MINIO: result.
|
|
275369
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275370
|
+
SETTLEMINT_MINIO: result.uniqueName,
|
|
275345
275371
|
...getMinioEndpoints(result)
|
|
275346
275372
|
};
|
|
275347
275373
|
}
|
|
@@ -275356,7 +275382,7 @@ function minioStorageCreateCommand() {
|
|
|
275356
275382
|
},
|
|
275357
275383
|
{
|
|
275358
275384
|
description: "Create a MinIO storage in a different application",
|
|
275359
|
-
command: "platform create storage minio my-storage --application
|
|
275385
|
+
command: "platform create storage minio my-storage --application app-123"
|
|
275360
275386
|
}
|
|
275361
275387
|
]
|
|
275362
275388
|
});
|
|
@@ -275402,11 +275428,11 @@ function getDeleteCommand({
|
|
|
275402
275428
|
deleteFunction,
|
|
275403
275429
|
usePersonalAccessToken = true
|
|
275404
275430
|
}) {
|
|
275405
|
-
return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4}
|
|
275431
|
+
return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to delete the default ${type4} from your .env file.
|
|
275406
275432
|
${createExamples([
|
|
275407
275433
|
{
|
|
275408
|
-
description: `Deletes the specified ${type4} by
|
|
275409
|
-
command: `platform delete ${type4} <${type4}-
|
|
275434
|
+
description: `Deletes the specified ${type4} by unique name`,
|
|
275435
|
+
command: `platform delete ${type4} <${type4}-unique-name>`
|
|
275410
275436
|
},
|
|
275411
275437
|
{
|
|
275412
275438
|
description: `Deletes the default ${type4} in the production environment`,
|
|
@@ -275414,9 +275440,9 @@ ${createExamples([
|
|
|
275414
275440
|
},
|
|
275415
275441
|
{
|
|
275416
275442
|
description: `Force deletes the specified ${type4} without confirmation`,
|
|
275417
|
-
command: `platform delete ${type4} <${type4}-
|
|
275443
|
+
command: `platform delete ${type4} <${type4}-unique-name> --force`
|
|
275418
275444
|
}
|
|
275419
|
-
])}`).argument("<
|
|
275445
|
+
])}`).argument("<uniqueName>", `The unique name of the ${type4}, use 'default' to delete the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until destroyed").option("-f, --force", `Force delete the ${type4} without confirmation`).action(async (uniqueName, { acceptDefaults, prod, force, wait }) => {
|
|
275420
275446
|
intro(`Deleting ${type4} in the SettleMint platform`);
|
|
275421
275447
|
if (!force) {
|
|
275422
275448
|
await deleteConfirmationPrompt(`this ${type4}`);
|
|
@@ -275434,19 +275460,19 @@ ${createExamples([
|
|
|
275434
275460
|
accessToken,
|
|
275435
275461
|
instance
|
|
275436
275462
|
});
|
|
275437
|
-
const
|
|
275438
|
-
const
|
|
275439
|
-
if (!
|
|
275463
|
+
const isDefaultUniqueName = uniqueName === "default";
|
|
275464
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
|
275465
|
+
if (!serviceUniqueName) {
|
|
275440
275466
|
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} ID or set a default ${type4} first.`);
|
|
275441
275467
|
}
|
|
275442
275468
|
const result = await spinner({
|
|
275443
275469
|
startMessage: `Deleting ${type4}`,
|
|
275444
275470
|
task: async () => {
|
|
275445
|
-
return deleteFunction(settlemint,
|
|
275471
|
+
return deleteFunction(settlemint, serviceUniqueName);
|
|
275446
275472
|
},
|
|
275447
275473
|
stopMessage: `${capitalizeFirstLetter(type4)} deleted`
|
|
275448
275474
|
});
|
|
275449
|
-
if (
|
|
275475
|
+
if (isDefaultUniqueName) {
|
|
275450
275476
|
const newEnv = {
|
|
275451
275477
|
SETTLEMINT_ACCESS_TOKEN: usePersonalAccessToken ? env2.SETTLEMINT_ACCESS_TOKEN : accessToken,
|
|
275452
275478
|
SETTLEMINT_INSTANCE: instance,
|
|
@@ -275456,7 +275482,7 @@ ${createExamples([
|
|
|
275456
275482
|
note(`${capitalizeFirstLetter(type4)} removed as default`);
|
|
275457
275483
|
}
|
|
275458
275484
|
if (wait) {
|
|
275459
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275485
|
+
await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "destroy" });
|
|
275460
275486
|
}
|
|
275461
275487
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} deleted successfully`);
|
|
275462
275488
|
});
|
|
@@ -275469,8 +275495,8 @@ function workspaceDeleteCommand() {
|
|
|
275469
275495
|
type: "workspace",
|
|
275470
275496
|
alias: "w",
|
|
275471
275497
|
envKey: "SETTLEMINT_WORKSPACE",
|
|
275472
|
-
deleteFunction: async (settlemint,
|
|
275473
|
-
return settlemint.workspace.delete(
|
|
275498
|
+
deleteFunction: async (settlemint, uniqueName) => {
|
|
275499
|
+
return settlemint.workspace.delete(uniqueName);
|
|
275474
275500
|
}
|
|
275475
275501
|
});
|
|
275476
275502
|
}
|
|
@@ -275519,7 +275545,7 @@ ${createExamples([
|
|
|
275519
275545
|
description: `Restarts the default ${type4} in the production environment`,
|
|
275520
275546
|
command: `platform restart ${commandName}${subType ? ` ${subType}` : ""} default --prod`
|
|
275521
275547
|
}
|
|
275522
|
-
])}`).argument("<
|
|
275548
|
+
])}`).argument("<uniqueName>", `The unique name of the ${type4}, use 'default' to restart the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until restarted").action(async (uniqueName, { acceptDefaults, prod, wait }) => {
|
|
275523
275549
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
|
275524
275550
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275525
275551
|
const env2 = await loadEnv2(false, !!prod);
|
|
@@ -275534,20 +275560,20 @@ ${createExamples([
|
|
|
275534
275560
|
accessToken,
|
|
275535
275561
|
instance
|
|
275536
275562
|
});
|
|
275537
|
-
const
|
|
275538
|
-
const
|
|
275539
|
-
if (!
|
|
275540
|
-
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4}
|
|
275563
|
+
const isDefaultUniqueName = uniqueName === "default";
|
|
275564
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
|
275565
|
+
if (!serviceUniqueName) {
|
|
275566
|
+
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
|
|
275541
275567
|
}
|
|
275542
275568
|
const result = await spinner({
|
|
275543
275569
|
startMessage: `Restarting ${type4}`,
|
|
275544
275570
|
task: async () => {
|
|
275545
|
-
return restartFunction(settlemint,
|
|
275571
|
+
return restartFunction(settlemint, serviceUniqueName);
|
|
275546
275572
|
},
|
|
275547
275573
|
stopMessage: `${capitalizeFirstLetter(type4)} restart initiated`
|
|
275548
275574
|
});
|
|
275549
275575
|
if (wait) {
|
|
275550
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275576
|
+
await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "restart" });
|
|
275551
275577
|
}
|
|
275552
275578
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} restart initiated successfully`);
|
|
275553
275579
|
});
|
|
@@ -275560,8 +275586,8 @@ function blockchainNetworkRestartCommand() {
|
|
|
275560
275586
|
type: "blockchain network",
|
|
275561
275587
|
alias: "bn",
|
|
275562
275588
|
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
|
275563
|
-
restartFunction: async (settlemint,
|
|
275564
|
-
return settlemint.blockchainNetwork.restart(
|
|
275589
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275590
|
+
return settlemint.blockchainNetwork.restart(uniqueName);
|
|
275565
275591
|
}
|
|
275566
275592
|
});
|
|
275567
275593
|
}
|
|
@@ -275573,8 +275599,8 @@ function customDeploymentRestartCommand() {
|
|
|
275573
275599
|
type: "custom deployment",
|
|
275574
275600
|
alias: "cd",
|
|
275575
275601
|
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
|
275576
|
-
restartFunction: async (settlemint,
|
|
275577
|
-
return settlemint.customDeployment.restart(
|
|
275602
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275603
|
+
return settlemint.customDeployment.restart(uniqueName);
|
|
275578
275604
|
},
|
|
275579
275605
|
usePersonalAccessToken: false
|
|
275580
275606
|
});
|
|
@@ -275588,8 +275614,8 @@ function blockscoutRestartCommand() {
|
|
|
275588
275614
|
subType: "blockscout",
|
|
275589
275615
|
alias: "bs",
|
|
275590
275616
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
|
275591
|
-
restartFunction: async (settlemint,
|
|
275592
|
-
return settlemint.insights.restart(
|
|
275617
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275618
|
+
return settlemint.insights.restart(uniqueName);
|
|
275593
275619
|
}
|
|
275594
275620
|
});
|
|
275595
275621
|
}
|
|
@@ -275607,8 +275633,8 @@ function hasuraRestartCommand() {
|
|
|
275607
275633
|
subType: "hasura",
|
|
275608
275634
|
alias: "ha",
|
|
275609
275635
|
envKey: "SETTLEMINT_HASURA",
|
|
275610
|
-
restartFunction: async (settlemint,
|
|
275611
|
-
return settlemint.integrationTool.restart(
|
|
275636
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275637
|
+
return settlemint.integrationTool.restart(uniqueName);
|
|
275612
275638
|
}
|
|
275613
275639
|
});
|
|
275614
275640
|
}
|
|
@@ -275640,8 +275666,8 @@ function smartContractPortalRestartCommand() {
|
|
|
275640
275666
|
subType: "smart-contract-portal",
|
|
275641
275667
|
alias: "scp",
|
|
275642
275668
|
envKey: "SETTLEMINT_PORTAL",
|
|
275643
|
-
restartFunction: async (settlemint,
|
|
275644
|
-
return settlemint.middleware.restart(
|
|
275669
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275670
|
+
return settlemint.middleware.restart(uniqueName);
|
|
275645
275671
|
}
|
|
275646
275672
|
});
|
|
275647
275673
|
}
|
|
@@ -275659,8 +275685,8 @@ function hdEcdsaP256RestartCommand() {
|
|
|
275659
275685
|
subType: "hd-ecdsa-p256",
|
|
275660
275686
|
alias: "hd",
|
|
275661
275687
|
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
|
275662
|
-
restartFunction: async (settlemint,
|
|
275663
|
-
return settlemint.privateKey.restart(
|
|
275688
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275689
|
+
return settlemint.privateKey.restart(uniqueName);
|
|
275664
275690
|
}
|
|
275665
275691
|
});
|
|
275666
275692
|
}
|
|
@@ -275677,8 +275703,8 @@ function ipfsRestartCommand() {
|
|
|
275677
275703
|
type: "storage",
|
|
275678
275704
|
alias: "ip",
|
|
275679
275705
|
envKey: "SETTLEMINT_IPFS",
|
|
275680
|
-
restartFunction: async (settlemint,
|
|
275681
|
-
return settlemint.storage.restart(
|
|
275706
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275707
|
+
return settlemint.storage.restart(uniqueName);
|
|
275682
275708
|
}
|
|
275683
275709
|
});
|
|
275684
275710
|
}
|
|
@@ -275690,8 +275716,8 @@ function minioRestartCommand() {
|
|
|
275690
275716
|
type: "storage",
|
|
275691
275717
|
alias: "m",
|
|
275692
275718
|
envKey: "SETTLEMINT_MINIO",
|
|
275693
|
-
restartFunction: async (settlemint,
|
|
275694
|
-
return settlemint.storage.restart(
|
|
275719
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275720
|
+
return settlemint.storage.restart(uniqueName);
|
|
275695
275721
|
}
|
|
275696
275722
|
});
|
|
275697
275723
|
}
|
|
@@ -275709,12 +275735,12 @@ function restartCommand() {
|
|
|
275709
275735
|
|
|
275710
275736
|
// src/commands/platform/custom-deployments/update.ts
|
|
275711
275737
|
function customDeploymentsUpdateCommand() {
|
|
275712
|
-
return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--
|
|
275738
|
+
return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--unique-name <uniqueName>", "The unique name of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").action(async (tag, { uniqueName, prod, wait }) => {
|
|
275713
275739
|
intro("Updating custom deployment in the SettleMint platform");
|
|
275714
275740
|
const env2 = await loadEnv2(false, !!prod);
|
|
275715
|
-
const
|
|
275716
|
-
if (!
|
|
275717
|
-
throw new Error("No custom deployment
|
|
275741
|
+
const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
|
|
275742
|
+
if (!customDeploymentUniqueName) {
|
|
275743
|
+
throw new Error("No custom deployment unique name specified. Please provide it either via the --unique-name flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
|
275718
275744
|
}
|
|
275719
275745
|
const instance = await instancePrompt(env2, true);
|
|
275720
275746
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
@@ -275730,12 +275756,17 @@ function customDeploymentsUpdateCommand() {
|
|
|
275730
275756
|
const customDeployment = await spinner({
|
|
275731
275757
|
startMessage: "Updating custom deployment",
|
|
275732
275758
|
task: async () => {
|
|
275733
|
-
return settlemint.customDeployment.update(
|
|
275759
|
+
return settlemint.customDeployment.update(customDeploymentUniqueName, tag);
|
|
275734
275760
|
},
|
|
275735
275761
|
stopMessage: "Custom deployment updated"
|
|
275736
275762
|
});
|
|
275737
275763
|
if (wait) {
|
|
275738
|
-
await waitForCompletion({
|
|
275764
|
+
await waitForCompletion({
|
|
275765
|
+
settlemint,
|
|
275766
|
+
type: "custom deployment",
|
|
275767
|
+
uniqueName: customDeployment.uniqueName,
|
|
275768
|
+
action: "deploy"
|
|
275769
|
+
});
|
|
275739
275770
|
}
|
|
275740
275771
|
outro(`${customDeployment.name} updated to ${tag}`);
|
|
275741
275772
|
});
|
|
@@ -276124,7 +276155,7 @@ function isHardhatConfig(config4) {
|
|
|
276124
276155
|
|
|
276125
276156
|
// src/commands/smart-contract-set/hardhat/deploy/remote.ts
|
|
276126
276157
|
function hardhatDeployRemoteCommand() {
|
|
276127
|
-
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
|
|
276158
|
+
const cmd2 = new Command2("remote").description("Deploy the smart contracts using Hardhat/ignition to the remote network on the platform").option("-m, --module <ignitionmodule>", 'The module to deploy with Ignition, defaults to "ignition/modules/main.ts"').option("--deployment-id <deploymentId>", "Set the id of the deployment").option("-r, --reset", "Wipes the existing deployment state before deploying").option("-v, --verify", "Verify the deployment on Etherscan").option("--default-sender <defaultSender>", "Set the default sender for the deployment").option("--parameters <parameters>", "A relative path to a JSON file to use for the module parameters").option("--strategy <strategy>", `Set the deployment strategy to use (default: "basic")`).option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values");
|
|
276128
276159
|
cmd2.action(async ({
|
|
276129
276160
|
module,
|
|
276130
276161
|
reset: reset2,
|
|
@@ -276135,7 +276166,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276135
276166
|
strategy,
|
|
276136
276167
|
prod,
|
|
276137
276168
|
acceptDefaults,
|
|
276138
|
-
|
|
276169
|
+
blockchainNode: blockchainNodeUniqueName
|
|
276139
276170
|
}) => {
|
|
276140
276171
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276141
276172
|
const env2 = await loadEnv(false, !!prod);
|
|
@@ -276150,15 +276181,15 @@ function hardhatDeployRemoteCommand() {
|
|
|
276150
276181
|
accessToken,
|
|
276151
276182
|
instance
|
|
276152
276183
|
});
|
|
276153
|
-
const
|
|
276184
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276154
276185
|
let node = undefined;
|
|
276155
|
-
if (!
|
|
276186
|
+
if (!nodeUniqueName) {
|
|
276156
276187
|
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276157
276188
|
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276158
276189
|
if (evmNodes.length === 0) {
|
|
276159
276190
|
cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276160
276191
|
}
|
|
276161
|
-
const nodesWithPrivateKey = await Promise.all(
|
|
276192
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276162
276193
|
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276163
276194
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276164
276195
|
cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
@@ -276169,12 +276200,12 @@ function hardhatDeployRemoteCommand() {
|
|
|
276169
276200
|
}
|
|
276170
276201
|
node = blockchainNode;
|
|
276171
276202
|
} else {
|
|
276172
|
-
node = await settlemint.blockchainNode.read(
|
|
276203
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276173
276204
|
if (!node.isEvm) {
|
|
276174
276205
|
cancel2("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276175
276206
|
}
|
|
276176
276207
|
}
|
|
276177
|
-
const envConfig = await settlemint.foundry.env(node.
|
|
276208
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276178
276209
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276179
276210
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
276180
276211
|
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");
|
|
@@ -276238,8 +276269,8 @@ function hardhatScriptLocalCommand() {
|
|
|
276238
276269
|
|
|
276239
276270
|
// src/commands/smart-contract-set/hardhat/script/remote.ts
|
|
276240
276271
|
function hardhatScriptRemoteCommand() {
|
|
276241
|
-
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
|
|
276242
|
-
cmd2.action(async ({ script, prod,
|
|
276272
|
+
const cmd2 = new Command2("remote").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("--no-compile", "Don't compile before running this task");
|
|
276273
|
+
cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
|
|
276243
276274
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276244
276275
|
const env2 = await loadEnv(false, !!prod);
|
|
276245
276276
|
const instance = await instancePrompt(env2, true);
|
|
@@ -276253,16 +276284,16 @@ function hardhatScriptRemoteCommand() {
|
|
|
276253
276284
|
accessToken,
|
|
276254
276285
|
instance
|
|
276255
276286
|
});
|
|
276256
|
-
let
|
|
276257
|
-
if (!
|
|
276287
|
+
let nodeUniqueName = blockchainNodeUniqueName;
|
|
276288
|
+
if (!nodeUniqueName) {
|
|
276258
276289
|
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276259
276290
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
276260
276291
|
if (!blockchainNode) {
|
|
276261
276292
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
276262
276293
|
}
|
|
276263
|
-
|
|
276294
|
+
nodeUniqueName = blockchainNode.uniqueName;
|
|
276264
276295
|
}
|
|
276265
|
-
const envConfig = await settlemint.foundry.env(
|
|
276296
|
+
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276266
276297
|
const { command, args } = await getPackageManagerExecutable();
|
|
276267
276298
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276268
276299
|
});
|
|
@@ -276671,4 +276702,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276671
276702
|
cancel2(reason);
|
|
276672
276703
|
});
|
|
276673
276704
|
|
|
276674
|
-
//# debugId=
|
|
276705
|
+
//# debugId=3C46929310A0957164756E2164756E21
|