@settlemint/sdk-cli 0.7.4-main550d0c83 → 0.7.4-main7ff0aba7
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 +1021 -1001
- 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.wEHDAvnMzW:/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-main7ff0aba7",
|
|
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.wEHDAvnMzW:/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.wEHDAvnMzW:/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.wEHDAvnMzW:/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.wEHDAvnMzW:/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,246 @@ var t7 = initGraphQLTada();
|
|
|
271278
271281
|
|
|
271279
271282
|
// ../js/dist/settlemint.mjs
|
|
271280
271283
|
var graphql = initGraphQLTada();
|
|
271281
|
-
var
|
|
271282
|
-
|
|
271283
|
-
|
|
271284
|
-
|
|
271284
|
+
var WorkspaceFragment = graphql(`
|
|
271285
|
+
fragment Workspace on Workspace {
|
|
271286
|
+
id
|
|
271287
|
+
uniqueName
|
|
271288
|
+
name
|
|
271289
|
+
applications {
|
|
271290
|
+
id
|
|
271291
|
+
uniqueName
|
|
271292
|
+
name
|
|
271285
271293
|
}
|
|
271286
271294
|
}
|
|
271287
|
-
|
|
271288
|
-
var
|
|
271289
|
-
|
|
271290
|
-
|
|
271291
|
-
|
|
271292
|
-
|
|
271293
|
-
|
|
271295
|
+
`);
|
|
271296
|
+
var getWorkspacesAndApplications = graphql(`
|
|
271297
|
+
query getWorkspacesAndApplications {
|
|
271298
|
+
workspaces {
|
|
271299
|
+
...Workspace
|
|
271300
|
+
childWorkspaces {
|
|
271301
|
+
...Workspace
|
|
271302
|
+
}
|
|
271303
|
+
}
|
|
271294
271304
|
}
|
|
271295
|
-
|
|
271305
|
+
`, [WorkspaceFragment]);
|
|
271306
|
+
var getWorkspace = graphql(`
|
|
271307
|
+
query getWorkspace($uniqueName: String!) {
|
|
271308
|
+
workspaceByUniqueName(uniqueName: $uniqueName) {
|
|
271309
|
+
...Workspace
|
|
271310
|
+
}
|
|
271311
|
+
}
|
|
271312
|
+
`, [WorkspaceFragment]);
|
|
271313
|
+
var createWorkspace = graphql(`
|
|
271314
|
+
mutation CreateWorkspace(
|
|
271315
|
+
$addressLine1: String
|
|
271316
|
+
$addressLine2: String
|
|
271317
|
+
$city: String
|
|
271318
|
+
$companyName: String
|
|
271319
|
+
$country: String
|
|
271320
|
+
$name: String!
|
|
271321
|
+
$parentId: String
|
|
271322
|
+
$paymentMethodId: String
|
|
271323
|
+
$postalCode: String
|
|
271324
|
+
$taxIdType: String
|
|
271325
|
+
$taxIdValue: String
|
|
271326
|
+
) {
|
|
271327
|
+
createWorkspace(
|
|
271328
|
+
addressLine1: $addressLine1
|
|
271329
|
+
addressLine2: $addressLine2
|
|
271330
|
+
city: $city
|
|
271331
|
+
companyName: $companyName
|
|
271332
|
+
country: $country
|
|
271333
|
+
name: $name
|
|
271334
|
+
parentId: $parentId
|
|
271335
|
+
paymentMethodId: $paymentMethodId
|
|
271336
|
+
postalCode: $postalCode
|
|
271337
|
+
taxIdType: $taxIdType
|
|
271338
|
+
taxIdValue: $taxIdValue
|
|
271339
|
+
) {
|
|
271340
|
+
...Workspace
|
|
271341
|
+
}
|
|
271342
|
+
}
|
|
271343
|
+
`, [WorkspaceFragment]);
|
|
271344
|
+
var deleteWorkspace = graphql(`
|
|
271345
|
+
mutation deleteWorkspace($id: ID!) {
|
|
271346
|
+
deleteWorkspace(workspaceId: $id) {
|
|
271347
|
+
...Workspace
|
|
271348
|
+
}
|
|
271349
|
+
}
|
|
271350
|
+
`, [WorkspaceFragment]);
|
|
271351
|
+
var addCredits = graphql(`
|
|
271352
|
+
mutation addCredits($workspaceId: String!, $amount: Float!) {
|
|
271353
|
+
addCredits(workspaceId: $workspaceId, amount: $amount)
|
|
271354
|
+
}
|
|
271355
|
+
`);
|
|
271356
|
+
var workspaceList = (gqlClient, options) => {
|
|
271357
|
+
return async () => {
|
|
271358
|
+
const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
|
|
271359
|
+
const allWorkspaces = workspaces.reduce((acc, workspace) => {
|
|
271360
|
+
acc.push(workspace);
|
|
271361
|
+
if (workspace.childWorkspaces) {
|
|
271362
|
+
acc.push(...workspace.childWorkspaces);
|
|
271363
|
+
}
|
|
271364
|
+
return acc;
|
|
271365
|
+
}, []);
|
|
271366
|
+
return allWorkspaces.sort((a8, b4) => a8.name.localeCompare(b4.name));
|
|
271367
|
+
};
|
|
271368
|
+
};
|
|
271369
|
+
var workspaceRead = (gqlClient, options) => {
|
|
271370
|
+
return async (workspaceUniqueName) => {
|
|
271371
|
+
const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });
|
|
271372
|
+
return workspaceByUniqueName;
|
|
271373
|
+
};
|
|
271374
|
+
};
|
|
271375
|
+
var workspaceCreate = (gqlClient, options) => {
|
|
271376
|
+
return async (createWorkspaceArgs) => {
|
|
271377
|
+
const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);
|
|
271378
|
+
return workspace;
|
|
271379
|
+
};
|
|
271380
|
+
};
|
|
271381
|
+
var workspaceDelete = (gqlClient, options) => {
|
|
271382
|
+
return async (workspaceUniqueName) => {
|
|
271383
|
+
const workspaceToDelete = await workspaceRead(gqlClient, options)(workspaceUniqueName);
|
|
271384
|
+
const { deleteWorkspace: workspace } = await gqlClient.request(deleteWorkspace, { id: workspaceToDelete.id });
|
|
271385
|
+
return workspace;
|
|
271386
|
+
};
|
|
271387
|
+
};
|
|
271388
|
+
var workspaceAddCredits = (gqlClient, options) => {
|
|
271389
|
+
return async (workspaceId, amount) => {
|
|
271390
|
+
const id = validate3(IdSchema3, workspaceId);
|
|
271391
|
+
if (amount <= 0) {
|
|
271392
|
+
throw new Error("Credit amount must be a positive number");
|
|
271393
|
+
}
|
|
271394
|
+
const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });
|
|
271395
|
+
return result;
|
|
271296
271396
|
};
|
|
271297
271397
|
};
|
|
271298
271398
|
var ApplicationFragment = graphql(`
|
|
271299
271399
|
fragment Application on Application {
|
|
271300
271400
|
id
|
|
271401
|
+
uniqueName
|
|
271301
271402
|
name
|
|
271302
|
-
workspace {
|
|
271403
|
+
workspace {
|
|
271404
|
+
id
|
|
271405
|
+
uniqueName
|
|
271406
|
+
}
|
|
271303
271407
|
}
|
|
271304
271408
|
`);
|
|
271305
271409
|
var listApplications = graphql(`
|
|
271306
|
-
|
|
271307
|
-
|
|
271308
|
-
|
|
271309
|
-
|
|
271410
|
+
query ListApplications($workspaceUniqueName: String!) {
|
|
271411
|
+
workspaceByUniqueName(uniqueName: $workspaceUniqueName) {
|
|
271412
|
+
applications {
|
|
271413
|
+
...Application
|
|
271414
|
+
}
|
|
271310
271415
|
}
|
|
271311
271416
|
}
|
|
271312
|
-
}
|
|
271313
271417
|
`, [ApplicationFragment]);
|
|
271314
271418
|
var readApplication = graphql(`
|
|
271315
|
-
|
|
271316
|
-
|
|
271317
|
-
|
|
271419
|
+
query ReadApplication($applicationUniqueName: String!) {
|
|
271420
|
+
applicationByUniqueName(uniqueName: $applicationUniqueName) {
|
|
271421
|
+
...Application
|
|
271422
|
+
}
|
|
271318
271423
|
}
|
|
271319
|
-
}
|
|
271320
271424
|
`, [ApplicationFragment]);
|
|
271321
271425
|
var createApplication = graphql(`
|
|
271322
|
-
|
|
271323
|
-
|
|
271324
|
-
|
|
271325
|
-
|
|
271326
|
-
createApplication(
|
|
271327
|
-
name: $name
|
|
271328
|
-
workspaceId: $workspaceId
|
|
271329
|
-
) {
|
|
271330
|
-
...Application
|
|
271426
|
+
mutation CreateApplication($name: String!, $workspaceId: ID!) {
|
|
271427
|
+
createApplication(name: $name, workspaceId: $workspaceId) {
|
|
271428
|
+
...Application
|
|
271429
|
+
}
|
|
271331
271430
|
}
|
|
271332
|
-
}
|
|
271333
271431
|
`, [ApplicationFragment]);
|
|
271334
271432
|
var deleteApplication = graphql(`
|
|
271335
|
-
|
|
271336
|
-
|
|
271337
|
-
|
|
271433
|
+
mutation DeleteApplication($id: ID!) {
|
|
271434
|
+
deleteApplication(id: $id) {
|
|
271435
|
+
...Application
|
|
271436
|
+
}
|
|
271338
271437
|
}
|
|
271339
|
-
}
|
|
271340
271438
|
`, [ApplicationFragment]);
|
|
271341
271439
|
var applicationList = (gqlClient, options) => {
|
|
271342
|
-
return async (
|
|
271343
|
-
const id = validate3(IdSchema3, workspaceId);
|
|
271440
|
+
return async (workspaceUniqueName) => {
|
|
271344
271441
|
const {
|
|
271345
|
-
|
|
271346
|
-
} = await gqlClient.request(listApplications, {
|
|
271442
|
+
workspaceByUniqueName: { applications }
|
|
271443
|
+
} = await gqlClient.request(listApplications, { workspaceUniqueName });
|
|
271347
271444
|
return applications;
|
|
271348
271445
|
};
|
|
271349
271446
|
};
|
|
271350
271447
|
var applicationRead = (gqlClient, options) => {
|
|
271351
|
-
return async (
|
|
271352
|
-
const
|
|
271353
|
-
|
|
271448
|
+
return async (applicationUniqueName) => {
|
|
271449
|
+
const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {
|
|
271450
|
+
applicationUniqueName
|
|
271451
|
+
});
|
|
271354
271452
|
return application;
|
|
271355
271453
|
};
|
|
271356
271454
|
};
|
|
271357
271455
|
var applicationCreate = (gqlClient, options) => {
|
|
271358
271456
|
return async (args) => {
|
|
271359
|
-
const {
|
|
271457
|
+
const { workspaceUniqueName, ...otherArgs } = args;
|
|
271458
|
+
const workspace = await workspaceRead(gqlClient, options)(workspaceUniqueName);
|
|
271459
|
+
const { createApplication: application } = await gqlClient.request(createApplication, {
|
|
271460
|
+
...otherArgs,
|
|
271461
|
+
workspaceId: workspace.id
|
|
271462
|
+
});
|
|
271360
271463
|
return application;
|
|
271361
271464
|
};
|
|
271362
271465
|
};
|
|
271363
271466
|
var applicationDelete = (gqlClient, options) => {
|
|
271364
|
-
return async (
|
|
271365
|
-
const
|
|
271366
|
-
const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
|
|
271467
|
+
return async (applicationUniqueName) => {
|
|
271468
|
+
const applicationToDelete = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271469
|
+
const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
|
|
271470
|
+
id: applicationToDelete.id
|
|
271471
|
+
});
|
|
271367
271472
|
return application;
|
|
271368
271473
|
};
|
|
271369
271474
|
};
|
|
271475
|
+
var createApplicationAccessToken = graphql(`
|
|
271476
|
+
mutation CreateApplicationAccessToken(
|
|
271477
|
+
$applicationId: ID!,
|
|
271478
|
+
$blockchainNetworkScope: BlockchainNetworkScopeInputType!,
|
|
271479
|
+
$blockchainNodeScope: BlockchainNodeScopeInputType!,
|
|
271480
|
+
$customDeploymentScope: CustomDeploymentScopeInputType!,
|
|
271481
|
+
$insightsScope: InsightsScopeInputType!,
|
|
271482
|
+
$integrationScope: IntegrationScopeInputType!,
|
|
271483
|
+
$loadBalancerScope: LoadBalancerScopeInputType!,
|
|
271484
|
+
$middlewareScope: MiddlewareScopeInputType!,
|
|
271485
|
+
$name: String!,
|
|
271486
|
+
$privateKeyScope: PrivateKeyScopeInputType!,
|
|
271487
|
+
$smartContractSetScope: SmartContractSetScopeInputType!,
|
|
271488
|
+
$storageScope: StorageScopeInputType!,
|
|
271489
|
+
$validityPeriod: AccessTokenValidityPeriod!
|
|
271490
|
+
) {
|
|
271491
|
+
createApplicationAccessToken(
|
|
271492
|
+
applicationId: $applicationId,
|
|
271493
|
+
blockchainNetworkScope: $blockchainNetworkScope,
|
|
271494
|
+
blockchainNodeScope: $blockchainNodeScope,
|
|
271495
|
+
customDeploymentScope: $customDeploymentScope,
|
|
271496
|
+
insightsScope: $insightsScope,
|
|
271497
|
+
integrationScope: $integrationScope,
|
|
271498
|
+
loadBalancerScope: $loadBalancerScope,
|
|
271499
|
+
middlewareScope: $middlewareScope,
|
|
271500
|
+
name: $name,
|
|
271501
|
+
privateKeyScope: $privateKeyScope,
|
|
271502
|
+
smartContractSetScope: $smartContractSetScope,
|
|
271503
|
+
storageScope: $storageScope,
|
|
271504
|
+
validityPeriod: $validityPeriod
|
|
271505
|
+
) {
|
|
271506
|
+
token
|
|
271507
|
+
}
|
|
271508
|
+
}
|
|
271509
|
+
`, []);
|
|
271510
|
+
var applicationAccessTokenCreate = (gqlClient, options) => {
|
|
271511
|
+
return async (args) => {
|
|
271512
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271513
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271514
|
+
const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, {
|
|
271515
|
+
...otherArgs,
|
|
271516
|
+
applicationId: application.id
|
|
271517
|
+
});
|
|
271518
|
+
if (!applicationAccessToken.token) {
|
|
271519
|
+
throw new Error("Failed to create application access token");
|
|
271520
|
+
}
|
|
271521
|
+
return applicationAccessToken.token;
|
|
271522
|
+
};
|
|
271523
|
+
};
|
|
271370
271524
|
function setClusterServiceDefaults(args) {
|
|
271371
271525
|
return {
|
|
271372
271526
|
...args,
|
|
@@ -271393,31 +271547,34 @@ var BlockchainNetworkFragment = graphql(`
|
|
|
271393
271547
|
fragment BlockchainNetwork on BlockchainNetwork {
|
|
271394
271548
|
__typename
|
|
271395
271549
|
id
|
|
271550
|
+
uniqueName
|
|
271396
271551
|
name
|
|
271397
271552
|
status
|
|
271398
271553
|
blockchainNodes {
|
|
271399
271554
|
... on BlockchainNode {
|
|
271400
271555
|
id
|
|
271401
271556
|
name
|
|
271557
|
+
uniqueName
|
|
271402
271558
|
}
|
|
271403
271559
|
}
|
|
271404
271560
|
}
|
|
271405
271561
|
`);
|
|
271406
271562
|
var getBlockchainNetworks = graphql(`
|
|
271407
|
-
query getBlockchainNetworks($
|
|
271408
|
-
|
|
271409
|
-
|
|
271410
|
-
|
|
271563
|
+
query getBlockchainNetworks($applicationUniqueName: String!) {
|
|
271564
|
+
blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271565
|
+
items {
|
|
271566
|
+
...BlockchainNetwork
|
|
271567
|
+
}
|
|
271568
|
+
}
|
|
271411
271569
|
}
|
|
271412
|
-
|
|
271413
|
-
}`, [BlockchainNetworkFragment]);
|
|
271570
|
+
`, [BlockchainNetworkFragment]);
|
|
271414
271571
|
var getBlockchainNetwork = graphql(`
|
|
271415
|
-
query getBlockchainNetwork($
|
|
271416
|
-
|
|
271417
|
-
|
|
271572
|
+
query getBlockchainNetwork($uniqueName: String!) {
|
|
271573
|
+
blockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271574
|
+
...BlockchainNetwork
|
|
271575
|
+
}
|
|
271418
271576
|
}
|
|
271419
|
-
|
|
271420
|
-
`, [BlockchainNetworkFragment]);
|
|
271577
|
+
`, [BlockchainNetworkFragment]);
|
|
271421
271578
|
var createBlockchainNetwork = graphql(`
|
|
271422
271579
|
mutation createBlockchainNetwork(
|
|
271423
271580
|
$applicationId: ID!
|
|
@@ -271478,65 +271635,67 @@ var createBlockchainNetwork = graphql(`
|
|
|
271478
271635
|
...BlockchainNetwork
|
|
271479
271636
|
}
|
|
271480
271637
|
}
|
|
271481
|
-
`, [BlockchainNetworkFragment]);
|
|
271638
|
+
`, [BlockchainNetworkFragment]);
|
|
271482
271639
|
var deleteBlockchainNetwork = graphql(`
|
|
271483
|
-
mutation deleteBlockchainNetwork($
|
|
271484
|
-
|
|
271640
|
+
mutation deleteBlockchainNetwork($uniqueName: String!) {
|
|
271641
|
+
deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271485
271642
|
...BlockchainNetwork
|
|
271486
271643
|
}
|
|
271487
271644
|
}
|
|
271488
|
-
`, [BlockchainNetworkFragment]);
|
|
271645
|
+
`, [BlockchainNetworkFragment]);
|
|
271489
271646
|
var restartBlockchainNetwork = graphql(`
|
|
271490
|
-
mutation RestartBlockchainNetwork($
|
|
271491
|
-
|
|
271647
|
+
mutation RestartBlockchainNetwork($uniqueName: String!) {
|
|
271648
|
+
restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271492
271649
|
...BlockchainNetwork
|
|
271493
271650
|
}
|
|
271494
271651
|
}
|
|
271495
|
-
`, [BlockchainNetworkFragment]);
|
|
271652
|
+
`, [BlockchainNetworkFragment]);
|
|
271496
271653
|
var blockchainNetworkList = (gqlClient, options) => {
|
|
271497
|
-
return async (
|
|
271498
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271654
|
+
return async (applicationUniqueName) => {
|
|
271499
271655
|
const {
|
|
271500
|
-
|
|
271501
|
-
} = await gqlClient.request(getBlockchainNetworks, {
|
|
271656
|
+
blockchainNetworksByUniqueName: { items }
|
|
271657
|
+
} = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });
|
|
271502
271658
|
return items;
|
|
271503
271659
|
};
|
|
271504
271660
|
};
|
|
271505
271661
|
var blockchainNetworkRead = (gqlClient, options) => {
|
|
271506
|
-
return async (
|
|
271507
|
-
const
|
|
271508
|
-
|
|
271509
|
-
|
|
271662
|
+
return async (blockchainNetworkUniqueName) => {
|
|
271663
|
+
const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {
|
|
271664
|
+
uniqueName: blockchainNetworkUniqueName
|
|
271665
|
+
});
|
|
271666
|
+
return blockchainNetworkByUniqueName;
|
|
271510
271667
|
};
|
|
271511
271668
|
};
|
|
271512
271669
|
var blockchainNetworkCreate = (gqlClient, options) => {
|
|
271513
271670
|
return async (args) => {
|
|
271514
|
-
const
|
|
271515
|
-
|
|
271516
|
-
const
|
|
271671
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271672
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271673
|
+
const blockchainNetworkArgs = setNetworkDefaults(otherArgs);
|
|
271674
|
+
const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {
|
|
271675
|
+
...blockchainNetworkArgs,
|
|
271676
|
+
applicationId: application.id
|
|
271677
|
+
});
|
|
271517
271678
|
return blockchainNetwork;
|
|
271518
271679
|
};
|
|
271519
271680
|
};
|
|
271520
271681
|
var blockchainNetworkDelete = (gqlClient, options) => {
|
|
271521
|
-
return async (
|
|
271522
|
-
const
|
|
271523
|
-
|
|
271524
|
-
blockchainNetworkId: id
|
|
271682
|
+
return async (blockchainNetworkUniqueName) => {
|
|
271683
|
+
const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(deleteBlockchainNetwork, {
|
|
271684
|
+
uniqueName: blockchainNetworkUniqueName
|
|
271525
271685
|
});
|
|
271526
271686
|
return blockchainNetwork;
|
|
271527
271687
|
};
|
|
271528
271688
|
};
|
|
271529
|
-
var blockchainNetworkRestart = (gqlClient, _options) => async (
|
|
271530
|
-
const
|
|
271531
|
-
const { restartBlockchainNetwork: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { id });
|
|
271689
|
+
var blockchainNetworkRestart = (gqlClient, _options) => async (blockchainNetworkUniqueName) => {
|
|
271690
|
+
const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
|
271532
271691
|
return blockchainNetwork;
|
|
271533
271692
|
};
|
|
271534
271693
|
var BlockchainNodeFragment = graphql(`
|
|
271535
271694
|
fragment BlockchainNode on BlockchainNode {
|
|
271536
271695
|
__typename
|
|
271537
271696
|
id
|
|
271538
|
-
name
|
|
271539
271697
|
uniqueName
|
|
271698
|
+
name
|
|
271540
271699
|
status
|
|
271541
271700
|
isEvm
|
|
271542
271701
|
endpoints {
|
|
@@ -271553,6 +271712,7 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271553
271712
|
... on AbstractClusterService {
|
|
271554
271713
|
id
|
|
271555
271714
|
name
|
|
271715
|
+
uniqueName
|
|
271556
271716
|
}
|
|
271557
271717
|
}
|
|
271558
271718
|
privateKeys {
|
|
@@ -271566,86 +271726,96 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271566
271726
|
}
|
|
271567
271727
|
`);
|
|
271568
271728
|
var getBlockchainNodes = graphql(`
|
|
271569
|
-
query getBlockchainNodes($
|
|
271570
|
-
|
|
271571
|
-
|
|
271572
|
-
|
|
271573
|
-
|
|
271574
|
-
}
|
|
271575
|
-
}
|
|
271729
|
+
query getBlockchainNodes($applicationUniqueName: String!) {
|
|
271730
|
+
blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271731
|
+
items {
|
|
271732
|
+
...BlockchainNode
|
|
271733
|
+
}
|
|
271734
|
+
}
|
|
271735
|
+
}
|
|
271736
|
+
`, [BlockchainNodeFragment]);
|
|
271576
271737
|
var getBlockchainNode = graphql(`
|
|
271577
|
-
query getBlockchainNode($
|
|
271578
|
-
|
|
271579
|
-
|
|
271580
|
-
|
|
271581
|
-
}
|
|
271582
|
-
`, [BlockchainNodeFragment]);
|
|
271738
|
+
query getBlockchainNode($uniqueName: String!) {
|
|
271739
|
+
blockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
271740
|
+
...BlockchainNode
|
|
271741
|
+
}
|
|
271742
|
+
}
|
|
271743
|
+
`, [BlockchainNodeFragment]);
|
|
271583
271744
|
var createBlockchainNode = graphql(`
|
|
271584
|
-
|
|
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
|
|
271745
|
+
mutation createBlockchainNode(
|
|
271746
|
+
$applicationId: ID!
|
|
271747
|
+
$blockchainNetworkId: ID!
|
|
271748
|
+
$name: String!
|
|
271749
|
+
$provider: String!
|
|
271750
|
+
$region: String!
|
|
271751
|
+
$size: ClusterServiceSize
|
|
271752
|
+
$type: ClusterServiceType
|
|
271753
|
+
$nodeType: NodeType
|
|
271754
|
+
$keyMaterial: ID
|
|
271605
271755
|
) {
|
|
271606
|
-
|
|
271607
|
-
|
|
271608
|
-
|
|
271609
|
-
|
|
271756
|
+
createBlockchainNode(
|
|
271757
|
+
applicationId: $applicationId
|
|
271758
|
+
blockchainNetworkId: $blockchainNetworkId
|
|
271759
|
+
name: $name
|
|
271760
|
+
provider: $provider
|
|
271761
|
+
region: $region
|
|
271762
|
+
size: $size
|
|
271763
|
+
type: $type
|
|
271764
|
+
nodeType: $nodeType
|
|
271765
|
+
keyMaterial: $keyMaterial
|
|
271766
|
+
) {
|
|
271767
|
+
...BlockchainNode
|
|
271768
|
+
}
|
|
271769
|
+
}
|
|
271770
|
+
`, [BlockchainNodeFragment]);
|
|
271610
271771
|
var restartBlockchainNode = graphql(`
|
|
271611
|
-
|
|
271612
|
-
|
|
271613
|
-
|
|
271772
|
+
mutation RestartBlockchainNode($uniqueName: String!) {
|
|
271773
|
+
restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
271774
|
+
...BlockchainNode
|
|
271775
|
+
}
|
|
271614
271776
|
}
|
|
271615
|
-
|
|
271616
|
-
`, [BlockchainNodeFragment]);
|
|
271777
|
+
`, [BlockchainNodeFragment]);
|
|
271617
271778
|
var blockchainNodeList = (gqlClient, options) => {
|
|
271618
|
-
return async (
|
|
271619
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271779
|
+
return async (applicationUniqueName) => {
|
|
271620
271780
|
const {
|
|
271621
|
-
|
|
271622
|
-
} = await gqlClient.request(getBlockchainNodes, {
|
|
271781
|
+
blockchainNodesByUniqueName: { items }
|
|
271782
|
+
} = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });
|
|
271623
271783
|
return items;
|
|
271624
271784
|
};
|
|
271625
271785
|
};
|
|
271626
271786
|
var blockchainNodeRead = (gqlClient, options) => {
|
|
271627
|
-
return async (
|
|
271628
|
-
const
|
|
271629
|
-
|
|
271630
|
-
|
|
271787
|
+
return async (blockchainNodeUniqueName) => {
|
|
271788
|
+
const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {
|
|
271789
|
+
uniqueName: blockchainNodeUniqueName
|
|
271790
|
+
});
|
|
271791
|
+
return blockchainNodeByUniqueName;
|
|
271631
271792
|
};
|
|
271632
271793
|
};
|
|
271633
271794
|
var blockchainNodeCreate = (gqlClient, options) => {
|
|
271634
271795
|
return async (args) => {
|
|
271635
|
-
|
|
271636
|
-
|
|
271637
|
-
|
|
271796
|
+
const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;
|
|
271797
|
+
const [application, blockchainNetwork] = await Promise.all([
|
|
271798
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
271799
|
+
blockchainNetworkRead(gqlClient, options)(blockchainNetworkUniqueName)
|
|
271800
|
+
]);
|
|
271801
|
+
const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {
|
|
271802
|
+
...otherArgs,
|
|
271803
|
+
applicationId: application.id,
|
|
271804
|
+
blockchainNetworkId: blockchainNetwork.id
|
|
271805
|
+
});
|
|
271638
271806
|
return blockchainNode;
|
|
271639
271807
|
};
|
|
271640
271808
|
};
|
|
271641
|
-
var blockchainNodeRestart = (gqlClient, _options) => async (
|
|
271642
|
-
const
|
|
271643
|
-
|
|
271809
|
+
var blockchainNodeRestart = (gqlClient, _options) => async (blockchainNodeUniqueName) => {
|
|
271810
|
+
const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {
|
|
271811
|
+
uniqueName: blockchainNodeUniqueName
|
|
271812
|
+
});
|
|
271644
271813
|
return blockchainNode;
|
|
271645
271814
|
};
|
|
271646
271815
|
var CustomDeploymentFragment = graphql(`
|
|
271647
271816
|
fragment CustomDeployment on CustomDeployment {
|
|
271648
271817
|
id
|
|
271818
|
+
uniqueName
|
|
271649
271819
|
name
|
|
271650
271820
|
status
|
|
271651
271821
|
endpoints {
|
|
@@ -271661,112 +271831,141 @@ var CustomDeploymentFragment = graphql(`
|
|
|
271661
271831
|
}
|
|
271662
271832
|
`);
|
|
271663
271833
|
var getCustomDeployments = graphql(`
|
|
271664
|
-
query getCustomDeployments($
|
|
271665
|
-
|
|
271666
|
-
|
|
271667
|
-
|
|
271834
|
+
query getCustomDeployments($applicationUniqueName: String!) {
|
|
271835
|
+
customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271836
|
+
items {
|
|
271837
|
+
...CustomDeployment
|
|
271838
|
+
}
|
|
271839
|
+
}
|
|
271668
271840
|
}
|
|
271669
|
-
|
|
271670
|
-
}`, [CustomDeploymentFragment]);
|
|
271841
|
+
`, [CustomDeploymentFragment]);
|
|
271671
271842
|
var getCustomDeployment = graphql(`
|
|
271672
|
-
query getCustomDeployment($
|
|
271673
|
-
|
|
271674
|
-
|
|
271675
|
-
|
|
271676
|
-
}
|
|
271677
|
-
`, [CustomDeploymentFragment]);
|
|
271843
|
+
query getCustomDeployment($uniqueName: String!) {
|
|
271844
|
+
customDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
271845
|
+
...CustomDeployment
|
|
271846
|
+
}
|
|
271847
|
+
}
|
|
271848
|
+
`, [CustomDeploymentFragment]);
|
|
271678
271849
|
var editCustomDeployment = graphql(`
|
|
271679
|
-
mutation EditCustomDeployment($
|
|
271680
|
-
|
|
271681
|
-
|
|
271682
|
-
|
|
271683
|
-
}
|
|
271684
|
-
`, [CustomDeploymentFragment]);
|
|
271850
|
+
mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {
|
|
271851
|
+
editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {
|
|
271852
|
+
...CustomDeployment
|
|
271853
|
+
}
|
|
271854
|
+
}
|
|
271855
|
+
`, [CustomDeploymentFragment]);
|
|
271685
271856
|
var createCustomDeployment = graphql(`
|
|
271686
|
-
mutation CreateCustomDeployment(
|
|
271687
|
-
|
|
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]);
|
|
271857
|
+
mutation CreateCustomDeployment(
|
|
271858
|
+
$applicationId: ID!
|
|
271859
|
+
$name: String!
|
|
271860
|
+
$imageTag: String!
|
|
271861
|
+
$imageName: String!
|
|
271862
|
+
$imageRepository: String!
|
|
271863
|
+
$environmentVariables: JSON
|
|
271864
|
+
$port: Int!
|
|
271865
|
+
$provider: String!
|
|
271866
|
+
$region: String!
|
|
271867
|
+
) {
|
|
271868
|
+
createCustomDeployment(
|
|
271869
|
+
applicationId: $applicationId
|
|
271870
|
+
name: $name
|
|
271871
|
+
imageTag: $imageTag
|
|
271872
|
+
imageName: $imageName
|
|
271873
|
+
imageRepository: $imageRepository
|
|
271874
|
+
port: $port
|
|
271875
|
+
environmentVariables: $environmentVariables
|
|
271876
|
+
provider: $provider
|
|
271877
|
+
region: $region
|
|
271878
|
+
) {
|
|
271879
|
+
...CustomDeployment
|
|
271880
|
+
}
|
|
271881
|
+
}
|
|
271882
|
+
`, [CustomDeploymentFragment]);
|
|
271712
271883
|
var restartCustomDeployment = graphql(`
|
|
271713
|
-
|
|
271714
|
-
|
|
271715
|
-
|
|
271884
|
+
mutation RestartCustomDeployment($uniqueName: String!) {
|
|
271885
|
+
restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
271886
|
+
...CustomDeployment
|
|
271887
|
+
}
|
|
271716
271888
|
}
|
|
271717
|
-
|
|
271718
|
-
`, [CustomDeploymentFragment]);
|
|
271889
|
+
`, [CustomDeploymentFragment]);
|
|
271719
271890
|
var customdeploymentList = (gqlClient, options) => {
|
|
271720
|
-
return async (
|
|
271721
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271891
|
+
return async (applicationUniqueName) => {
|
|
271722
271892
|
const {
|
|
271723
|
-
|
|
271724
|
-
} = await gqlClient.request(getCustomDeployments, {
|
|
271893
|
+
customDeploymentsByUniqueName: { items }
|
|
271894
|
+
} = await gqlClient.request(getCustomDeployments, { applicationUniqueName });
|
|
271725
271895
|
return items;
|
|
271726
271896
|
};
|
|
271727
271897
|
};
|
|
271728
271898
|
var customdeploymentRead = (gqlClient, options) => {
|
|
271729
|
-
return async (
|
|
271730
|
-
const
|
|
271731
|
-
|
|
271899
|
+
return async (customDeploymentUniqueName) => {
|
|
271900
|
+
const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {
|
|
271901
|
+
uniqueName: customDeploymentUniqueName
|
|
271902
|
+
});
|
|
271732
271903
|
return customDeployment;
|
|
271733
271904
|
};
|
|
271734
271905
|
};
|
|
271735
271906
|
var customdeploymentUpdate = (gqlClient, options) => {
|
|
271736
|
-
return async (
|
|
271737
|
-
const
|
|
271738
|
-
|
|
271907
|
+
return async (customDeploymentUniqueName, imageTag) => {
|
|
271908
|
+
const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {
|
|
271909
|
+
uniqueName: customDeploymentUniqueName,
|
|
271910
|
+
imageTag
|
|
271911
|
+
});
|
|
271739
271912
|
return cd;
|
|
271740
271913
|
};
|
|
271741
271914
|
};
|
|
271742
271915
|
var customdeploymentCreate = (gqlClient, options) => {
|
|
271743
271916
|
return async (args) => {
|
|
271744
|
-
|
|
271745
|
-
const
|
|
271917
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271918
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271919
|
+
const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {
|
|
271920
|
+
...otherArgs,
|
|
271921
|
+
applicationId: application.id
|
|
271922
|
+
});
|
|
271746
271923
|
return customDeployment;
|
|
271747
271924
|
};
|
|
271748
271925
|
};
|
|
271749
|
-
var customDeploymentRestart = (gqlClient, _options) => async (
|
|
271750
|
-
const
|
|
271751
|
-
|
|
271926
|
+
var customDeploymentRestart = (gqlClient, _options) => async (customDeploymentUniqueName) => {
|
|
271927
|
+
const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {
|
|
271928
|
+
uniqueName: customDeploymentUniqueName
|
|
271929
|
+
});
|
|
271752
271930
|
return customDeployment;
|
|
271753
271931
|
};
|
|
271754
271932
|
var getFoundryEnvConfig = graphql(`
|
|
271755
|
-
|
|
271756
|
-
|
|
271933
|
+
query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {
|
|
271934
|
+
foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)
|
|
271935
|
+
}
|
|
271936
|
+
`);
|
|
271937
|
+
var getEnv = (gqlClient, _options) => {
|
|
271938
|
+
return async (blockchainNodeUniqueName) => {
|
|
271939
|
+
const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });
|
|
271940
|
+
return foundryEnvConfigByUniqueName;
|
|
271941
|
+
};
|
|
271942
|
+
};
|
|
271943
|
+
var LoadBalancerFragment = graphql(`
|
|
271944
|
+
fragment LoadBalancer on LoadBalancer {
|
|
271945
|
+
id
|
|
271946
|
+
uniqueName
|
|
271757
271947
|
}
|
|
271758
271948
|
`);
|
|
271759
|
-
|
|
271760
|
-
|
|
271761
|
-
|
|
271762
|
-
|
|
271763
|
-
|
|
271949
|
+
var getLoadBalancer = graphql(`
|
|
271950
|
+
query GetLoadBalancer($uniqueName: String!) {
|
|
271951
|
+
loadBalancerByUniqueName(uniqueName: $uniqueName) {
|
|
271952
|
+
...LoadBalancer
|
|
271953
|
+
}
|
|
271954
|
+
}
|
|
271955
|
+
`, [LoadBalancerFragment]);
|
|
271956
|
+
var loadBalancerRead = (gqlClient, options) => {
|
|
271957
|
+
return async (loadBalancerUniqueName) => {
|
|
271958
|
+
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
|
|
271959
|
+
uniqueName: loadBalancerUniqueName
|
|
271960
|
+
});
|
|
271961
|
+
return loadBalancer;
|
|
271764
271962
|
};
|
|
271765
|
-
}
|
|
271963
|
+
};
|
|
271766
271964
|
var InsightsFragment = graphql(`
|
|
271767
271965
|
fragment Insights on Insights {
|
|
271768
271966
|
__typename
|
|
271769
271967
|
id
|
|
271968
|
+
uniqueName
|
|
271770
271969
|
name
|
|
271771
271970
|
status
|
|
271772
271971
|
insightsCategory
|
|
@@ -271783,86 +271982,97 @@ var InsightsFragment = graphql(`
|
|
|
271783
271982
|
}
|
|
271784
271983
|
`);
|
|
271785
271984
|
var getInsights = graphql(`
|
|
271786
|
-
query
|
|
271787
|
-
|
|
271788
|
-
|
|
271789
|
-
|
|
271985
|
+
query GetInsights($applicationUniqueName: String!) {
|
|
271986
|
+
insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271987
|
+
items {
|
|
271988
|
+
...Insights
|
|
271989
|
+
}
|
|
271990
|
+
}
|
|
271790
271991
|
}
|
|
271791
|
-
|
|
271792
|
-
}`, [InsightsFragment]);
|
|
271992
|
+
`, [InsightsFragment]);
|
|
271793
271993
|
var getInsight = graphql(`
|
|
271794
|
-
query
|
|
271795
|
-
|
|
271796
|
-
|
|
271797
|
-
|
|
271798
|
-
}
|
|
271799
|
-
`, [InsightsFragment]);
|
|
271994
|
+
query GetInsight($uniqueName: String!) {
|
|
271995
|
+
insightsByUniqueName(uniqueName: $uniqueName) {
|
|
271996
|
+
...Insights
|
|
271997
|
+
}
|
|
271998
|
+
}
|
|
271999
|
+
`, [InsightsFragment]);
|
|
271800
272000
|
var createInsights = graphql(`
|
|
271801
|
-
|
|
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
|
|
272001
|
+
mutation CreateInsights(
|
|
272002
|
+
$applicationId: ID!
|
|
272003
|
+
$name: String!
|
|
272004
|
+
$insightsCategory: InsightsCategory!
|
|
272005
|
+
$provider: String!
|
|
272006
|
+
$region: String!
|
|
272007
|
+
$size: ClusterServiceSize
|
|
272008
|
+
$type: ClusterServiceType
|
|
272009
|
+
$blockchainNode: ID
|
|
272010
|
+
$loadBalancer: ID
|
|
271822
272011
|
) {
|
|
271823
|
-
|
|
271824
|
-
|
|
271825
|
-
|
|
271826
|
-
|
|
272012
|
+
createInsights(
|
|
272013
|
+
applicationId: $applicationId
|
|
272014
|
+
name: $name
|
|
272015
|
+
insightsCategory: $insightsCategory
|
|
272016
|
+
provider: $provider
|
|
272017
|
+
region: $region
|
|
272018
|
+
size: $size
|
|
272019
|
+
type: $type
|
|
272020
|
+
blockchainNode: $blockchainNode
|
|
272021
|
+
loadBalancer: $loadBalancer
|
|
272022
|
+
) {
|
|
272023
|
+
...Insights
|
|
272024
|
+
}
|
|
272025
|
+
}
|
|
272026
|
+
`, [InsightsFragment]);
|
|
271827
272027
|
var restartInsights = graphql(`
|
|
271828
|
-
|
|
271829
|
-
|
|
271830
|
-
|
|
272028
|
+
mutation RestartInsights($uniqueName: String!) {
|
|
272029
|
+
restartInsightsByUniqueName(uniqueName: $uniqueName) {
|
|
272030
|
+
...Insights
|
|
272031
|
+
}
|
|
271831
272032
|
}
|
|
271832
|
-
|
|
271833
|
-
`, [InsightsFragment]);
|
|
272033
|
+
`, [InsightsFragment]);
|
|
271834
272034
|
var insightsList = (gqlClient, options) => {
|
|
271835
|
-
return async (
|
|
271836
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272035
|
+
return async (applicationUniqueName) => {
|
|
271837
272036
|
const {
|
|
271838
|
-
|
|
271839
|
-
} = await gqlClient.request(getInsights, {
|
|
272037
|
+
insightsListByUniqueName: { items }
|
|
272038
|
+
} = await gqlClient.request(getInsights, { applicationUniqueName });
|
|
271840
272039
|
return items;
|
|
271841
272040
|
};
|
|
271842
272041
|
};
|
|
271843
272042
|
var insightsRead = (gqlClient, options) => {
|
|
271844
|
-
return async (
|
|
271845
|
-
const
|
|
271846
|
-
const { insights } = await gqlClient.request(getInsight, { id });
|
|
272043
|
+
return async (insightsUniqueName) => {
|
|
272044
|
+
const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });
|
|
271847
272045
|
return insights;
|
|
271848
272046
|
};
|
|
271849
272047
|
};
|
|
271850
272048
|
var insightsCreate = (gqlClient, options) => {
|
|
271851
272049
|
return async (args) => {
|
|
271852
|
-
|
|
271853
|
-
const
|
|
272050
|
+
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;
|
|
272051
|
+
const [application, blockchainNode, loadBalancer] = await Promise.all([
|
|
272052
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
272053
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
|
|
272054
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined)
|
|
272055
|
+
]);
|
|
272056
|
+
const { createInsights: insights } = await gqlClient.request(createInsights, {
|
|
272057
|
+
...otherArgs,
|
|
272058
|
+
applicationId: application.id,
|
|
272059
|
+
blockchainNode: blockchainNode?.id,
|
|
272060
|
+
loadBalancer: loadBalancer?.id
|
|
272061
|
+
});
|
|
271854
272062
|
return insights;
|
|
271855
272063
|
};
|
|
271856
272064
|
};
|
|
271857
|
-
var insightsRestart = (gqlClient, _options) => async (
|
|
271858
|
-
const
|
|
271859
|
-
|
|
272065
|
+
var insightsRestart = (gqlClient, _options) => async (insightsUniqueName) => {
|
|
272066
|
+
const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {
|
|
272067
|
+
uniqueName: insightsUniqueName
|
|
272068
|
+
});
|
|
271860
272069
|
return insights;
|
|
271861
272070
|
};
|
|
271862
272071
|
var IntegrationFragment = graphql(`
|
|
271863
272072
|
fragment Integration on Integration {
|
|
271864
272073
|
__typename
|
|
271865
272074
|
id
|
|
272075
|
+
uniqueName
|
|
271866
272076
|
name
|
|
271867
272077
|
status
|
|
271868
272078
|
integrationType
|
|
@@ -271879,82 +272089,184 @@ var IntegrationFragment = graphql(`
|
|
|
271879
272089
|
}
|
|
271880
272090
|
`);
|
|
271881
272091
|
var getIntegrations = graphql(`
|
|
271882
|
-
query
|
|
271883
|
-
|
|
271884
|
-
|
|
271885
|
-
|
|
272092
|
+
query GetIntegrations($applicationUniqueName: String!) {
|
|
272093
|
+
integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272094
|
+
items {
|
|
272095
|
+
...Integration
|
|
272096
|
+
}
|
|
272097
|
+
}
|
|
271886
272098
|
}
|
|
271887
|
-
|
|
271888
|
-
}`, [IntegrationFragment]);
|
|
272099
|
+
`, [IntegrationFragment]);
|
|
271889
272100
|
var getIntegration = graphql(`
|
|
271890
|
-
query
|
|
271891
|
-
|
|
271892
|
-
|
|
271893
|
-
|
|
271894
|
-
}
|
|
271895
|
-
`, [IntegrationFragment]);
|
|
272101
|
+
query GetIntegration($uniqueName: String!) {
|
|
272102
|
+
integrationByUniqueName(uniqueName: $uniqueName) {
|
|
272103
|
+
...Integration
|
|
272104
|
+
}
|
|
272105
|
+
}
|
|
272106
|
+
`, [IntegrationFragment]);
|
|
271896
272107
|
var createIntegration = graphql(`
|
|
271897
|
-
|
|
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
|
|
272108
|
+
mutation CreateIntegration(
|
|
272109
|
+
$applicationId: ID!
|
|
272110
|
+
$name: String!
|
|
272111
|
+
$integrationType: IntegrationType!
|
|
272112
|
+
$provider: String!
|
|
272113
|
+
$region: String!
|
|
272114
|
+
$size: ClusterServiceSize
|
|
272115
|
+
$type: ClusterServiceType
|
|
271914
272116
|
) {
|
|
271915
|
-
|
|
271916
|
-
|
|
271917
|
-
|
|
271918
|
-
|
|
272117
|
+
createIntegration(
|
|
272118
|
+
applicationId: $applicationId
|
|
272119
|
+
name: $name
|
|
272120
|
+
integrationType: $integrationType
|
|
272121
|
+
provider: $provider
|
|
272122
|
+
region: $region
|
|
272123
|
+
size: $size
|
|
272124
|
+
type: $type
|
|
272125
|
+
) {
|
|
272126
|
+
...Integration
|
|
272127
|
+
}
|
|
272128
|
+
}
|
|
272129
|
+
`, [IntegrationFragment]);
|
|
271919
272130
|
var restartIntegrationTool = graphql(`
|
|
271920
|
-
|
|
271921
|
-
|
|
271922
|
-
|
|
272131
|
+
mutation RestartIntegrationTool($uniqueName: String!) {
|
|
272132
|
+
restartIntegrationByUniqueName(uniqueName: $uniqueName) {
|
|
272133
|
+
...Integration
|
|
272134
|
+
}
|
|
271923
272135
|
}
|
|
271924
|
-
|
|
271925
|
-
`, [IntegrationFragment]);
|
|
272136
|
+
`, [IntegrationFragment]);
|
|
271926
272137
|
var integrationToolList = (gqlClient, options) => {
|
|
271927
|
-
return async (
|
|
271928
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272138
|
+
return async (applicationUniqueName) => {
|
|
271929
272139
|
const {
|
|
271930
|
-
|
|
271931
|
-
} = await gqlClient.request(getIntegrations, {
|
|
272140
|
+
integrationsByUniqueName: { items }
|
|
272141
|
+
} = await gqlClient.request(getIntegrations, { applicationUniqueName });
|
|
271932
272142
|
return items;
|
|
271933
272143
|
};
|
|
271934
272144
|
};
|
|
271935
272145
|
var integrationToolRead = (gqlClient, options) => {
|
|
271936
|
-
return async (
|
|
271937
|
-
const
|
|
271938
|
-
|
|
271939
|
-
return integration;
|
|
272146
|
+
return async (integrationUniqueName) => {
|
|
272147
|
+
const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });
|
|
272148
|
+
return integrationByUniqueName;
|
|
271940
272149
|
};
|
|
271941
272150
|
};
|
|
271942
272151
|
var integrationToolCreate = (gqlClient, options) => {
|
|
271943
272152
|
return async (args) => {
|
|
271944
|
-
|
|
271945
|
-
const
|
|
272153
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
272154
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272155
|
+
const { createIntegration: integration } = await gqlClient.request(createIntegration, {
|
|
272156
|
+
...otherArgs,
|
|
272157
|
+
applicationId: application.id
|
|
272158
|
+
});
|
|
271946
272159
|
return integration;
|
|
271947
272160
|
};
|
|
271948
272161
|
};
|
|
271949
|
-
var integrationToolRestart = (gqlClient, _options) => async (
|
|
271950
|
-
const
|
|
271951
|
-
|
|
272162
|
+
var integrationToolRestart = (gqlClient, _options) => async (integrationUniqueName) => {
|
|
272163
|
+
const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {
|
|
272164
|
+
uniqueName: integrationUniqueName
|
|
272165
|
+
});
|
|
271952
272166
|
return integration;
|
|
271953
272167
|
};
|
|
272168
|
+
var StorageFragment = graphql(`
|
|
272169
|
+
fragment Storage on Storage {
|
|
272170
|
+
__typename
|
|
272171
|
+
id
|
|
272172
|
+
uniqueName
|
|
272173
|
+
name
|
|
272174
|
+
status
|
|
272175
|
+
storageProtocol
|
|
272176
|
+
endpoints {
|
|
272177
|
+
id
|
|
272178
|
+
label
|
|
272179
|
+
displayValue
|
|
272180
|
+
}
|
|
272181
|
+
credentials {
|
|
272182
|
+
id
|
|
272183
|
+
label
|
|
272184
|
+
displayValue
|
|
272185
|
+
}
|
|
272186
|
+
}
|
|
272187
|
+
`);
|
|
272188
|
+
var getStorages = graphql(`
|
|
272189
|
+
query GetStorages($applicationUniqueName: String!) {
|
|
272190
|
+
storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272191
|
+
items {
|
|
272192
|
+
...Storage
|
|
272193
|
+
}
|
|
272194
|
+
}
|
|
272195
|
+
}
|
|
272196
|
+
`, [StorageFragment]);
|
|
272197
|
+
var getStorage = graphql(`
|
|
272198
|
+
query GetStorage($uniqueName: String!) {
|
|
272199
|
+
storageByUniqueName(uniqueName: $uniqueName) {
|
|
272200
|
+
...Storage
|
|
272201
|
+
}
|
|
272202
|
+
}
|
|
272203
|
+
`, [StorageFragment]);
|
|
272204
|
+
var createStorage = graphql(`
|
|
272205
|
+
mutation CreateStorage(
|
|
272206
|
+
$applicationId: ID!
|
|
272207
|
+
$name: String!
|
|
272208
|
+
$storageProtocol: StorageProtocol!
|
|
272209
|
+
$provider: String!
|
|
272210
|
+
$region: String!
|
|
272211
|
+
$size: ClusterServiceSize
|
|
272212
|
+
$type: ClusterServiceType
|
|
272213
|
+
) {
|
|
272214
|
+
createStorage(
|
|
272215
|
+
applicationId: $applicationId
|
|
272216
|
+
name: $name
|
|
272217
|
+
storageProtocol: $storageProtocol
|
|
272218
|
+
provider: $provider
|
|
272219
|
+
region: $region
|
|
272220
|
+
size: $size
|
|
272221
|
+
type: $type
|
|
272222
|
+
) {
|
|
272223
|
+
...Storage
|
|
272224
|
+
}
|
|
272225
|
+
}
|
|
272226
|
+
`, [StorageFragment]);
|
|
272227
|
+
var restartStorage = graphql(`
|
|
272228
|
+
mutation RestartStorage($uniqueName: String!) {
|
|
272229
|
+
restartStorageByUniqueName(uniqueName: $uniqueName) {
|
|
272230
|
+
...Storage
|
|
272231
|
+
}
|
|
272232
|
+
}
|
|
272233
|
+
`, [StorageFragment]);
|
|
272234
|
+
var storageList = (gqlClient, options) => {
|
|
272235
|
+
return async (applicationUniqueName) => {
|
|
272236
|
+
const {
|
|
272237
|
+
storagesByUniqueName: { items }
|
|
272238
|
+
} = await gqlClient.request(getStorages, { applicationUniqueName });
|
|
272239
|
+
return items;
|
|
272240
|
+
};
|
|
272241
|
+
};
|
|
272242
|
+
var storageRead = (gqlClient, options) => {
|
|
272243
|
+
return async (storageUniqueName) => {
|
|
272244
|
+
const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });
|
|
272245
|
+
return storage;
|
|
272246
|
+
};
|
|
272247
|
+
};
|
|
272248
|
+
var storageCreate = (gqlClient, options) => {
|
|
272249
|
+
return async (args) => {
|
|
272250
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
272251
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272252
|
+
const { createStorage: storage } = await gqlClient.request(createStorage, {
|
|
272253
|
+
...otherArgs,
|
|
272254
|
+
applicationId: application.id
|
|
272255
|
+
});
|
|
272256
|
+
return storage;
|
|
272257
|
+
};
|
|
272258
|
+
};
|
|
272259
|
+
var storageRestart = (gqlClient, _options) => async (storageUniqueName) => {
|
|
272260
|
+
const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {
|
|
272261
|
+
uniqueName: storageUniqueName
|
|
272262
|
+
});
|
|
272263
|
+
return storage;
|
|
272264
|
+
};
|
|
271954
272265
|
var MiddlewareFragment = graphql(`
|
|
271955
272266
|
fragment Middleware on Middleware {
|
|
271956
272267
|
__typename
|
|
271957
272268
|
id
|
|
272269
|
+
uniqueName
|
|
271958
272270
|
name
|
|
271959
272271
|
status
|
|
271960
272272
|
interface
|
|
@@ -271983,488 +272295,195 @@ var MiddlewareFragment = graphql(`
|
|
|
271983
272295
|
}
|
|
271984
272296
|
`);
|
|
271985
272297
|
var getMiddlewares = graphql(`
|
|
271986
|
-
query
|
|
271987
|
-
|
|
271988
|
-
|
|
271989
|
-
|
|
272298
|
+
query GetMiddlewares($applicationUniqueName: String!, $noCache: Boolean = false) {
|
|
272299
|
+
middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272300
|
+
items {
|
|
272301
|
+
...Middleware
|
|
272302
|
+
}
|
|
272303
|
+
}
|
|
271990
272304
|
}
|
|
271991
|
-
|
|
271992
|
-
}`, [MiddlewareFragment]);
|
|
272305
|
+
`, [MiddlewareFragment]);
|
|
271993
272306
|
var getMiddleware = graphql(`
|
|
271994
|
-
query
|
|
271995
|
-
|
|
271996
|
-
|
|
271997
|
-
|
|
271998
|
-
}
|
|
271999
|
-
`, [MiddlewareFragment]);
|
|
272307
|
+
query GetMiddleware($uniqueName: String!, $noCache: Boolean = true) {
|
|
272308
|
+
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272309
|
+
...Middleware
|
|
272310
|
+
}
|
|
272311
|
+
}
|
|
272312
|
+
`, [MiddlewareFragment]);
|
|
272000
272313
|
var createMiddleware = graphql(`
|
|
272001
|
-
|
|
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
|
|
272314
|
+
mutation CreateMiddleware(
|
|
272315
|
+
$applicationId: ID!
|
|
272316
|
+
$name: String!
|
|
272317
|
+
$provider: String!
|
|
272318
|
+
$region: String!
|
|
272319
|
+
$size: ClusterServiceSize
|
|
272320
|
+
$type: ClusterServiceType
|
|
272321
|
+
$interface: MiddlewareType!
|
|
272322
|
+
$storageId: ID
|
|
272323
|
+
$blockchainNodeId: ID
|
|
272324
|
+
$loadBalancerId: ID
|
|
272325
|
+
$abis: [SmartContractPortalMiddlewareAbiInputDto!]
|
|
272326
|
+
$includePredeployedAbis: [String!]
|
|
272327
|
+
$noCache: Boolean = false
|
|
272031
272328
|
) {
|
|
272032
|
-
|
|
272033
|
-
|
|
272034
|
-
|
|
272035
|
-
|
|
272329
|
+
createMiddleware(
|
|
272330
|
+
applicationId: $applicationId
|
|
272331
|
+
name: $name
|
|
272332
|
+
provider: $provider
|
|
272333
|
+
region: $region
|
|
272334
|
+
size: $size
|
|
272335
|
+
type: $type
|
|
272336
|
+
interface: $interface
|
|
272337
|
+
storageId: $storageId
|
|
272338
|
+
blockchainNodeId: $blockchainNodeId
|
|
272339
|
+
loadBalancerId: $loadBalancerId
|
|
272340
|
+
abis: $abis
|
|
272341
|
+
includePredeployedAbis: $includePredeployedAbis
|
|
272342
|
+
) {
|
|
272343
|
+
...Middleware
|
|
272344
|
+
}
|
|
272345
|
+
}
|
|
272346
|
+
`, [MiddlewareFragment]);
|
|
272036
272347
|
var restartMiddleware = graphql(`
|
|
272037
|
-
|
|
272038
|
-
|
|
272039
|
-
|
|
272348
|
+
mutation RestartMiddleware($uniqueName: String!, $noCache: Boolean = false) {
|
|
272349
|
+
restartMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272350
|
+
...Middleware
|
|
272351
|
+
}
|
|
272040
272352
|
}
|
|
272041
|
-
|
|
272042
|
-
`, [MiddlewareFragment]);
|
|
272353
|
+
`, [MiddlewareFragment]);
|
|
272043
272354
|
var middlewareList = (gqlClient, options) => {
|
|
272044
|
-
return async (
|
|
272045
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272355
|
+
return async (applicationUniqueName) => {
|
|
272046
272356
|
const {
|
|
272047
|
-
|
|
272048
|
-
} = await gqlClient.request(getMiddlewares, {
|
|
272357
|
+
middlewaresByUniqueName: { items }
|
|
272358
|
+
} = await gqlClient.request(getMiddlewares, { applicationUniqueName });
|
|
272049
272359
|
return items;
|
|
272050
272360
|
};
|
|
272051
272361
|
};
|
|
272052
272362
|
var middlewareRead = (gqlClient, options) => {
|
|
272053
|
-
return async (
|
|
272054
|
-
const
|
|
272055
|
-
|
|
272363
|
+
return async (middlewareUniqueName) => {
|
|
272364
|
+
const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {
|
|
272365
|
+
uniqueName: middlewareUniqueName
|
|
272366
|
+
});
|
|
272056
272367
|
return middleware;
|
|
272057
272368
|
};
|
|
272058
272369
|
};
|
|
272059
272370
|
var middlewareCreate = (gqlClient, options) => {
|
|
272060
272371
|
return async (args) => {
|
|
272061
|
-
|
|
272062
|
-
const
|
|
272372
|
+
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } = args;
|
|
272373
|
+
const [application, blockchainNode, loadBalancer, storage] = await Promise.all([
|
|
272374
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
272375
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
|
|
272376
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined),
|
|
272377
|
+
storageUniqueName ? storageRead(gqlClient, options)(storageUniqueName) : Promise.resolve(undefined)
|
|
272378
|
+
]);
|
|
272379
|
+
const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {
|
|
272380
|
+
...otherArgs,
|
|
272381
|
+
applicationId: application.id,
|
|
272382
|
+
blockchainNodeId: blockchainNode?.id,
|
|
272383
|
+
loadBalancerId: loadBalancer?.id,
|
|
272384
|
+
storageId: storage?.id
|
|
272385
|
+
});
|
|
272063
272386
|
return middleware;
|
|
272064
272387
|
};
|
|
272065
272388
|
};
|
|
272066
|
-
var middlewareRestart = (gqlClient, _options) => async (
|
|
272067
|
-
const
|
|
272068
|
-
|
|
272389
|
+
var middlewareRestart = (gqlClient, _options) => async (middlewareUniqueName) => {
|
|
272390
|
+
const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {
|
|
272391
|
+
uniqueName: middlewareUniqueName
|
|
272392
|
+
});
|
|
272069
272393
|
return middleware;
|
|
272070
272394
|
};
|
|
272071
272395
|
var PrivateKeyFragment = graphql(`
|
|
272072
272396
|
fragment PrivateKey on PrivateKey {
|
|
272073
272397
|
__typename
|
|
272074
272398
|
id
|
|
272075
|
-
name
|
|
272076
272399
|
uniqueName
|
|
272400
|
+
name
|
|
272077
272401
|
privateKeyType
|
|
272078
272402
|
status
|
|
272079
272403
|
}
|
|
272080
272404
|
`);
|
|
272081
272405
|
var getPrivateKeys = graphql(`
|
|
272082
|
-
query
|
|
272083
|
-
|
|
272084
|
-
|
|
272085
|
-
|
|
272406
|
+
query GetPrivateKeys($applicationUniqueName: String!) {
|
|
272407
|
+
privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272408
|
+
items {
|
|
272409
|
+
...PrivateKey
|
|
272410
|
+
}
|
|
272411
|
+
}
|
|
272086
272412
|
}
|
|
272087
|
-
|
|
272088
|
-
}`, [PrivateKeyFragment]);
|
|
272413
|
+
`, [PrivateKeyFragment]);
|
|
272089
272414
|
var getPrivateKey = graphql(`
|
|
272090
|
-
query
|
|
272091
|
-
|
|
272092
|
-
|
|
272093
|
-
|
|
272094
|
-
}
|
|
272095
|
-
`, [PrivateKeyFragment]);
|
|
272415
|
+
query GetPrivateKey($uniqueName: String!) {
|
|
272416
|
+
privateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
272417
|
+
...PrivateKey
|
|
272418
|
+
}
|
|
272419
|
+
}
|
|
272420
|
+
`, [PrivateKeyFragment]);
|
|
272096
272421
|
var createPrivateKey = graphql(`
|
|
272097
|
-
|
|
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
|
|
272422
|
+
mutation CreatePrivateKey(
|
|
272423
|
+
$applicationId: ID!
|
|
272424
|
+
$name: String!
|
|
272425
|
+
$privateKeyType: PrivateKeyType!
|
|
272426
|
+
$provider: String!
|
|
272427
|
+
$region: String!
|
|
272428
|
+
$size: ClusterServiceSize
|
|
272429
|
+
$type: ClusterServiceType
|
|
272430
|
+
$blockchainNodes: [ID!]
|
|
272116
272431
|
) {
|
|
272117
|
-
|
|
272118
|
-
|
|
272119
|
-
|
|
272120
|
-
|
|
272432
|
+
createPrivateKey(
|
|
272433
|
+
applicationId: $applicationId
|
|
272434
|
+
name: $name
|
|
272435
|
+
privateKeyType: $privateKeyType
|
|
272436
|
+
provider: $provider
|
|
272437
|
+
region: $region
|
|
272438
|
+
size: $size
|
|
272439
|
+
type: $type
|
|
272440
|
+
blockchainNodes: $blockchainNodes
|
|
272441
|
+
) {
|
|
272442
|
+
...PrivateKey
|
|
272443
|
+
}
|
|
272444
|
+
}
|
|
272445
|
+
`, [PrivateKeyFragment]);
|
|
272121
272446
|
var restartPrivateKey = graphql(`
|
|
272122
|
-
|
|
272123
|
-
|
|
272124
|
-
|
|
272447
|
+
mutation RestartPrivateKey($uniqueName: String!) {
|
|
272448
|
+
restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
272449
|
+
...PrivateKey
|
|
272450
|
+
}
|
|
272125
272451
|
}
|
|
272126
|
-
|
|
272127
|
-
`, [PrivateKeyFragment]);
|
|
272452
|
+
`, [PrivateKeyFragment]);
|
|
272128
272453
|
var privateKeyList = (gqlClient, options) => {
|
|
272129
|
-
return async (
|
|
272130
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272454
|
+
return async (applicationUniqueName) => {
|
|
272131
272455
|
const {
|
|
272132
|
-
|
|
272133
|
-
} = await gqlClient.request(getPrivateKeys, {
|
|
272456
|
+
privateKeysByUniqueName: { items }
|
|
272457
|
+
} = await gqlClient.request(getPrivateKeys, { applicationUniqueName });
|
|
272134
272458
|
return items;
|
|
272135
272459
|
};
|
|
272136
272460
|
};
|
|
272137
272461
|
var privatekeyRead = (gqlClient, options) => {
|
|
272138
|
-
return async (
|
|
272139
|
-
const
|
|
272140
|
-
|
|
272462
|
+
return async (privateKeyUniqueName) => {
|
|
272463
|
+
const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {
|
|
272464
|
+
uniqueName: privateKeyUniqueName
|
|
272465
|
+
});
|
|
272141
272466
|
return privateKey;
|
|
272142
272467
|
};
|
|
272143
272468
|
};
|
|
272144
272469
|
var privateKeyCreate = (gqlClient, options) => {
|
|
272145
272470
|
return async (args) => {
|
|
272146
|
-
|
|
272147
|
-
const
|
|
272471
|
+
const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
|
|
272472
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272473
|
+
const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient, options)(uniqueName))) : [];
|
|
272474
|
+
const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {
|
|
272475
|
+
...otherArgs,
|
|
272476
|
+
applicationId: application.id,
|
|
272477
|
+
blockchainNodes: blockchainNodes.map((node) => node?.id)
|
|
272478
|
+
});
|
|
272148
272479
|
return privateKey;
|
|
272149
272480
|
};
|
|
272150
272481
|
};
|
|
272151
|
-
var privateKeyRestart = (gqlClient, _options) => async (
|
|
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
|
|
272482
|
+
var privateKeyRestart = (gqlClient, _options) => async (privateKeyUniqueName) => {
|
|
272483
|
+
const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {
|
|
272484
|
+
uniqueName: privateKeyUniqueName
|
|
272250
272485
|
});
|
|
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
|
-
};
|
|
272486
|
+
return privateKey;
|
|
272468
272487
|
};
|
|
272469
272488
|
var ClientOptionsSchema = z3.object({
|
|
272470
272489
|
accessToken: AccessTokenSchema3,
|
|
@@ -272567,12 +272586,6 @@ function createSettleMintClient(options) {
|
|
|
272567
272586
|
update: customdeploymentUpdate(gqlClient, options),
|
|
272568
272587
|
restart: customDeploymentRestart(gqlClient, options)
|
|
272569
272588
|
},
|
|
272570
|
-
smartContractSet: {
|
|
272571
|
-
list: smartContractSetList(gqlClient, options),
|
|
272572
|
-
read: smartContractSetRead(gqlClient, options),
|
|
272573
|
-
create: smartContractSetCreate(gqlClient, options),
|
|
272574
|
-
restart: smartContractSetRestart(gqlClient, options)
|
|
272575
|
-
},
|
|
272576
272589
|
foundry: {
|
|
272577
272590
|
env: getEnv(gqlClient, options)
|
|
272578
272591
|
},
|
|
@@ -272777,7 +272790,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272777
272790
|
}
|
|
272778
272791
|
});
|
|
272779
272792
|
const aat = await settlemint.applicationAccessToken.create({
|
|
272780
|
-
|
|
272793
|
+
applicationUniqueName: application.uniqueName,
|
|
272781
272794
|
name: name2,
|
|
272782
272795
|
blockchainNetworkScope: {
|
|
272783
272796
|
type: "ALL",
|
|
@@ -272842,7 +272855,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272842
272855
|
|
|
272843
272856
|
// src/commands/connect/application.prompt.ts
|
|
272844
272857
|
async function applicationPrompt(env2, applications, accept) {
|
|
272845
|
-
const defaultApplication = applications.find((application2) => application2.
|
|
272858
|
+
const defaultApplication = applications.find((application2) => application2.uniqueName === env2.SETTLEMINT_APPLICATION);
|
|
272846
272859
|
const defaultPossible = accept && defaultApplication;
|
|
272847
272860
|
if (defaultPossible) {
|
|
272848
272861
|
return defaultApplication;
|
|
@@ -272869,7 +272882,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272869
272882
|
if (nodes.length === 0) {
|
|
272870
272883
|
return;
|
|
272871
272884
|
}
|
|
272872
|
-
const defaultNode = nodes.find((node2) => node2.
|
|
272885
|
+
const defaultNode = nodes.find((node2) => node2.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NODE) ?? (nodes.length === 1 ? nodes[0] : undefined);
|
|
272873
272886
|
const defaultPossible = accept;
|
|
272874
272887
|
if (defaultPossible) {
|
|
272875
272888
|
return defaultNode;
|
|
@@ -272897,7 +272910,7 @@ async function blockscoutPrompt(env2, insights, accept) {
|
|
|
272897
272910
|
if (possible.length === 0) {
|
|
272898
272911
|
return;
|
|
272899
272912
|
}
|
|
272900
|
-
const defaultBlockscout = insights.find((insight) => insight.
|
|
272913
|
+
const defaultBlockscout = insights.find((insight) => insight.uniqueName === env2.SETTLEMINT_BLOCKSCOUT) ?? (insights.length === 1 ? insights[0] : undefined);
|
|
272901
272914
|
const defaultPossible = accept;
|
|
272902
272915
|
if (defaultPossible) {
|
|
272903
272916
|
return defaultBlockscout;
|
|
@@ -272924,7 +272937,7 @@ async function customDeploymentPrompt(env2, customDeployments, accept) {
|
|
|
272924
272937
|
if (customDeployments.length === 0) {
|
|
272925
272938
|
return;
|
|
272926
272939
|
}
|
|
272927
|
-
const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.
|
|
272940
|
+
const defaultCustomDeployment = customDeployments.find((customDeployment) => customDeployment.uniqueName === env2.SETTLEMINT_CUSTOM_DEPLOYMENT) ?? (customDeployments.length === 1 ? customDeployments[0] : undefined);
|
|
272928
272941
|
const defaultPossible = accept;
|
|
272929
272942
|
if (defaultPossible) {
|
|
272930
272943
|
return defaultCustomDeployment;
|
|
@@ -272952,7 +272965,7 @@ async function hasuraPrompt(env2, integrations, accept) {
|
|
|
272952
272965
|
if (possible.length === 0) {
|
|
272953
272966
|
return;
|
|
272954
272967
|
}
|
|
272955
|
-
const defaultIntegration = possible.find((integration) => integration.
|
|
272968
|
+
const defaultIntegration = possible.find((integration) => integration.uniqueName === env2.SETTLEMINT_HASURA) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
272956
272969
|
const defaultPossible = accept;
|
|
272957
272970
|
if (defaultPossible) {
|
|
272958
272971
|
return defaultIntegration;
|
|
@@ -273031,7 +273044,7 @@ async function ipfsPrompt(env2, storages, accept) {
|
|
|
273031
273044
|
if (possible.length === 0) {
|
|
273032
273045
|
return;
|
|
273033
273046
|
}
|
|
273034
|
-
const defaultStorage = possible.find((storage) => storage.
|
|
273047
|
+
const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_IPFS) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273035
273048
|
const defaultPossible = accept;
|
|
273036
273049
|
if (defaultPossible) {
|
|
273037
273050
|
return defaultStorage;
|
|
@@ -273059,7 +273072,7 @@ async function minioPrompt(env2, storages, accept) {
|
|
|
273059
273072
|
if (possible.length === 0) {
|
|
273060
273073
|
return;
|
|
273061
273074
|
}
|
|
273062
|
-
const defaultStorage = possible.find((storage) => storage.
|
|
273075
|
+
const defaultStorage = possible.find((storage) => storage.uniqueName === env2.SETTLEMINT_MINIO) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273063
273076
|
const defaultPossible = accept;
|
|
273064
273077
|
if (defaultPossible) {
|
|
273065
273078
|
return defaultStorage;
|
|
@@ -273087,7 +273100,7 @@ async function portalPrompt(env2, middlewares, accept) {
|
|
|
273087
273100
|
if (possible.length === 0) {
|
|
273088
273101
|
return;
|
|
273089
273102
|
}
|
|
273090
|
-
const defaultMiddleware = possible.find((middleware2) => middleware2.
|
|
273103
|
+
const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_PORTAL) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273091
273104
|
const defaultPossible = accept;
|
|
273092
273105
|
if (defaultPossible) {
|
|
273093
273106
|
return defaultMiddleware;
|
|
@@ -273125,14 +273138,14 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273125
273138
|
insights,
|
|
273126
273139
|
customDeployment
|
|
273127
273140
|
] = await Promise.all([
|
|
273128
|
-
settlemint.blockchainNetwork.list(application.
|
|
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.
|
|
273141
|
+
settlemint.blockchainNetwork.list(application.uniqueName),
|
|
273142
|
+
settlemint.blockchainNode.list(application.uniqueName),
|
|
273143
|
+
settlemint.middleware.list(application.uniqueName),
|
|
273144
|
+
settlemint.integrationTool.list(application.uniqueName),
|
|
273145
|
+
settlemint.storage.list(application.uniqueName),
|
|
273146
|
+
settlemint.privateKey.list(application.uniqueName),
|
|
273147
|
+
settlemint.insights.list(application.uniqueName),
|
|
273148
|
+
settlemint.customDeployment.list(application.uniqueName)
|
|
273136
273149
|
]);
|
|
273137
273150
|
return {
|
|
273138
273151
|
blockchainNetworks,
|
|
@@ -273154,7 +273167,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
|
|
|
273154
273167
|
if (possible.length === 0) {
|
|
273155
273168
|
return;
|
|
273156
273169
|
}
|
|
273157
|
-
const defaultMiddleware = possible.find((middleware2) => middleware2.
|
|
273170
|
+
const defaultMiddleware = possible.find((middleware2) => middleware2.uniqueName === env2.SETTLEMINT_THEGRAPH) ?? (possible.length === 1 ? possible[0] : undefined);
|
|
273158
273171
|
const defaultPossible = accept;
|
|
273159
273172
|
if (defaultPossible) {
|
|
273160
273173
|
return defaultMiddleware;
|
|
@@ -273178,7 +273191,7 @@ async function theGraphPrompt(env2, middlewares, accept) {
|
|
|
273178
273191
|
|
|
273179
273192
|
// src/commands/connect/workspace.prompt.ts
|
|
273180
273193
|
async function workspacePrompt(env2, workspaces, accept) {
|
|
273181
|
-
const defaultWorkspace = workspaces.find((workspace2) => workspace2.
|
|
273194
|
+
const defaultWorkspace = workspaces.find((workspace2) => workspace2.uniqueName === env2.SETTLEMINT_WORKSPACE);
|
|
273182
273195
|
const defaultPossible = accept && defaultWorkspace;
|
|
273183
273196
|
if (defaultPossible) {
|
|
273184
273197
|
return defaultWorkspace;
|
|
@@ -273233,24 +273246,24 @@ function connectCommand() {
|
|
|
273233
273246
|
await writeEnvSpinner(!!prod, {
|
|
273234
273247
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273235
273248
|
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?.
|
|
273249
|
+
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
273250
|
+
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
273251
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
273252
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
|
273253
|
+
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
273241
273254
|
...getHasuraEndpoints(hasura),
|
|
273242
|
-
SETTLEMINT_THEGRAPH: thegraph?.
|
|
273255
|
+
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
273243
273256
|
...await getGraphEndpoint(thegraph, env2),
|
|
273244
|
-
SETTLEMINT_PORTAL: portal?.
|
|
273257
|
+
SETTLEMINT_PORTAL: portal?.uniqueName,
|
|
273245
273258
|
...getPortalEndpoints(portal),
|
|
273246
273259
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
273247
|
-
SETTLEMINT_MINIO: minio?.
|
|
273260
|
+
SETTLEMINT_MINIO: minio?.uniqueName,
|
|
273248
273261
|
...getMinioEndpoints(minio),
|
|
273249
|
-
SETTLEMINT_IPFS: ipfs?.
|
|
273262
|
+
SETTLEMINT_IPFS: ipfs?.uniqueName,
|
|
273250
273263
|
...getIpfsEndpoints(ipfs),
|
|
273251
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.
|
|
273264
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
|
|
273252
273265
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
|
|
273253
|
-
SETTLEMINT_BLOCKSCOUT: blockscout?.
|
|
273266
|
+
SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
|
|
273254
273267
|
...getBlockscoutEndpoints(blockscout)
|
|
273255
273268
|
});
|
|
273256
273269
|
outro("Connected to SettleMint");
|
|
@@ -273260,7 +273273,7 @@ function connectCommand() {
|
|
|
273260
273273
|
var package_default = {
|
|
273261
273274
|
name: "@settlemint/sdk-cli",
|
|
273262
273275
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273263
|
-
version: "0.7.4-
|
|
273276
|
+
version: "0.7.4-main7ff0aba7",
|
|
273264
273277
|
type: "module",
|
|
273265
273278
|
private: false,
|
|
273266
273279
|
license: "FSL-1.1-MIT",
|
|
@@ -273311,8 +273324,8 @@ var package_default = {
|
|
|
273311
273324
|
"@inquirer/input": "4.1.1",
|
|
273312
273325
|
"@inquirer/password": "4.0.4",
|
|
273313
273326
|
"@inquirer/select": "4.0.4",
|
|
273314
|
-
"@settlemint/sdk-js": "0.7.4-
|
|
273315
|
-
"@settlemint/sdk-utils": "0.7.4-
|
|
273327
|
+
"@settlemint/sdk-js": "0.7.4-main7ff0aba7",
|
|
273328
|
+
"@settlemint/sdk-utils": "0.7.4-main7ff0aba7",
|
|
273316
273329
|
"get-tsconfig": "4.8.1",
|
|
273317
273330
|
giget: "1.2.3"
|
|
273318
273331
|
},
|
|
@@ -274309,7 +274322,6 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
|
274309
274322
|
"blockchain node": "blockchainNode",
|
|
274310
274323
|
"custom deployment": "customDeployment",
|
|
274311
274324
|
"private key": "privateKey",
|
|
274312
|
-
"smart contract set": "smartContractSet",
|
|
274313
274325
|
middleware: "middleware",
|
|
274314
274326
|
"integration tool": "integrationTool",
|
|
274315
274327
|
storage: "storage",
|
|
@@ -274323,7 +274335,7 @@ class TimeoutError extends Error {
|
|
|
274323
274335
|
async function waitForCompletion({
|
|
274324
274336
|
settlemint,
|
|
274325
274337
|
type: type4,
|
|
274326
|
-
|
|
274338
|
+
uniqueName,
|
|
274327
274339
|
action,
|
|
274328
274340
|
maxTimeout = 10 * 60 * 1000,
|
|
274329
274341
|
restartIfTimeout = false
|
|
@@ -274344,7 +274356,7 @@ async function waitForCompletion({
|
|
|
274344
274356
|
const startTime = Date.now();
|
|
274345
274357
|
while (true) {
|
|
274346
274358
|
try {
|
|
274347
|
-
const resource = await service.read(
|
|
274359
|
+
const resource = await service.read(uniqueName);
|
|
274348
274360
|
if (resource.status === "COMPLETED") {
|
|
274349
274361
|
note(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
|
|
274350
274362
|
return true;
|
|
@@ -274358,7 +274370,7 @@ async function waitForCompletion({
|
|
|
274358
274370
|
note(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
|
|
274359
274371
|
}
|
|
274360
274372
|
if (Date.now() - startTime > maxTimeout) {
|
|
274361
|
-
throw new TimeoutError(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with
|
|
274373
|
+
throw new TimeoutError(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
|
|
274362
274374
|
}
|
|
274363
274375
|
await new Promise((resolve6) => setTimeout(resolve6, 5000));
|
|
274364
274376
|
}
|
|
@@ -274370,7 +274382,7 @@ async function waitForCompletion({
|
|
|
274370
274382
|
} catch (error5) {
|
|
274371
274383
|
if (restartIfTimeout && error5 instanceof TimeoutError) {
|
|
274372
274384
|
note(`Restarting ${capitalizeFirstLetter(type4)}`);
|
|
274373
|
-
await service.restart(
|
|
274385
|
+
await service.restart(uniqueName);
|
|
274374
274386
|
return showSpinner();
|
|
274375
274387
|
}
|
|
274376
274388
|
throw error5;
|
|
@@ -274448,7 +274460,7 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274448
274460
|
await waitForCompletion({
|
|
274449
274461
|
settlemint,
|
|
274450
274462
|
type: waitFor?.resourceType ?? type4,
|
|
274451
|
-
|
|
274463
|
+
uniqueName: waitFor?.uniqueName ?? result.uniqueName,
|
|
274452
274464
|
action: "deploy",
|
|
274453
274465
|
restartIfTimeout
|
|
274454
274466
|
});
|
|
@@ -274469,10 +274481,10 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274469
274481
|
...updatedEnv
|
|
274470
274482
|
};
|
|
274471
274483
|
if (isApplicationChanged && updatedEnv.SETTLEMINT_APPLICATION) {
|
|
274472
|
-
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.
|
|
274484
|
+
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.uniqueName;
|
|
274473
274485
|
}
|
|
274474
274486
|
if (newEnv.SETTLEMINT_BLOCKCHAIN_NODE && newEnv.SETTLEMINT_BLOCKCHAIN_NODE !== env2.SETTLEMINT_BLOCKCHAIN_NODE) {
|
|
274475
|
-
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.
|
|
274487
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.uniqueName;
|
|
274476
274488
|
}
|
|
274477
274489
|
await writeEnvSpinner(!!prod, newEnv);
|
|
274478
274490
|
note(`${capitalizeFirstLetter(type4)} ${result.name} set as default`);
|
|
@@ -274489,8 +274501,8 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274489
274501
|
type: "blockchain network",
|
|
274490
274502
|
alias: "b",
|
|
274491
274503
|
execute: (cmd2, baseAction) => {
|
|
274492
|
-
addClusterServiceArgs(cmd2).option("-a, --application
|
|
274493
|
-
|
|
274504
|
+
addClusterServiceArgs(cmd2).option("-a, --application <application>", "The unique name of the application to create the network in (defaults to application from env)").requiredOption("--node-name <name>", "Name of the node").option("--chain-id <chainId>", "The chain ID for the network", parseNumber).option("--contract-size-limit <limit>", "Maximum contract size limit", parseNumber).option("--evm-stack-size <size>", "EVM stack size", parseNumber).option("--gas-limit <limit>", "Block gas limit").option("--gas-price <price>", "Gas price in wei", parseNumber).option("--seconds-per-block <seconds>", "Block time in seconds", parseNumber).action(async (name2, {
|
|
274505
|
+
application,
|
|
274494
274506
|
chainId,
|
|
274495
274507
|
contractSizeLimit,
|
|
274496
274508
|
evmStackSize,
|
|
@@ -274505,10 +274517,10 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274505
274517
|
...defaultArgs
|
|
274506
274518
|
}) => {
|
|
274507
274519
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274508
|
-
const
|
|
274520
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274509
274521
|
const result = await settlemint.blockchainNetwork.create({
|
|
274510
274522
|
name: name2,
|
|
274511
|
-
|
|
274523
|
+
applicationUniqueName,
|
|
274512
274524
|
nodeName,
|
|
274513
274525
|
consensusAlgorithm: "BESU_QBFT",
|
|
274514
274526
|
chainId,
|
|
@@ -274531,9 +274543,9 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274531
274543
|
} : undefined,
|
|
274532
274544
|
mapDefaultEnv: () => {
|
|
274533
274545
|
return {
|
|
274534
|
-
SETTLEMINT_APPLICATION:
|
|
274535
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK: result.
|
|
274536
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.
|
|
274546
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274547
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
|
|
274548
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName
|
|
274537
274549
|
};
|
|
274538
274550
|
}
|
|
274539
274551
|
};
|
|
@@ -274547,7 +274559,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274547
274559
|
},
|
|
274548
274560
|
{
|
|
274549
274561
|
description: "Create a Besu blockchain network in a different application",
|
|
274550
|
-
command: "platform create blockchain-network besu my-network --application-
|
|
274562
|
+
command: "platform create blockchain-network besu my-network --application app-123 --node-name validator-1 --chain-id 12345 --gas-limit 10000000 --seconds-per-block 5"
|
|
274551
274563
|
}
|
|
274552
274564
|
]
|
|
274553
274565
|
});
|
|
@@ -274678,7 +274690,7 @@ function workspaceCreateCommand() {
|
|
|
274678
274690
|
result,
|
|
274679
274691
|
mapDefaultEnv: () => {
|
|
274680
274692
|
return {
|
|
274681
|
-
SETTLEMINT_WORKSPACE: result.
|
|
274693
|
+
SETTLEMINT_WORKSPACE: result.uniqueName
|
|
274682
274694
|
};
|
|
274683
274695
|
}
|
|
274684
274696
|
};
|
|
@@ -274709,10 +274721,11 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274709
274721
|
type: "application access token",
|
|
274710
274722
|
alias: "aat",
|
|
274711
274723
|
execute: (cmd2, baseAction) => {
|
|
274712
|
-
cmd2.option("-a, --application
|
|
274724
|
+
cmd2.option("-a, --application <application>", "The application unique name to create the application access token for (defaults to application from env)").addOption(new Option("-v, --validity-period <period>", "The validity period for the token").choices(["DAYS_7", "DAYS_30", "DAYS_60", "DAYS_90", "NONE"]).default("DAYS_7")).action(async (name2, { application, validityPeriod, ...defaultArgs }) => {
|
|
274713
274725
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274726
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274714
274727
|
const aatToken = await settlemint.applicationAccessToken.create({
|
|
274715
|
-
|
|
274728
|
+
applicationUniqueName,
|
|
274716
274729
|
name: name2,
|
|
274717
274730
|
blockchainNetworkScope: {
|
|
274718
274731
|
type: "ALL",
|
|
@@ -274759,7 +274772,8 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274759
274772
|
return {
|
|
274760
274773
|
result: {
|
|
274761
274774
|
id: "",
|
|
274762
|
-
name: name2
|
|
274775
|
+
name: name2,
|
|
274776
|
+
uniqueName: ""
|
|
274763
274777
|
},
|
|
274764
274778
|
mapDefaultEnv: () => ({
|
|
274765
274779
|
SETTLEMINT_ACCESS_TOKEN: aatToken
|
|
@@ -274792,18 +274806,17 @@ function applicationCreateCommand() {
|
|
|
274792
274806
|
type: "application",
|
|
274793
274807
|
alias: "a",
|
|
274794
274808
|
execute: (cmd2, baseAction) => {
|
|
274795
|
-
cmd2.option("-w, --workspace
|
|
274809
|
+
cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, ...defaultArgs }) => {
|
|
274796
274810
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274797
|
-
const workspace = workspaceId ?? env2.SETTLEMINT_WORKSPACE;
|
|
274798
274811
|
const result = await settlemint.application.create({
|
|
274799
274812
|
name: name2,
|
|
274800
|
-
|
|
274813
|
+
workspaceUniqueName: workspace ?? env2.SETTLEMINT_WORKSPACE
|
|
274801
274814
|
});
|
|
274802
274815
|
return {
|
|
274803
274816
|
result,
|
|
274804
274817
|
mapDefaultEnv: () => {
|
|
274805
274818
|
return {
|
|
274806
|
-
SETTLEMINT_APPLICATION: result.
|
|
274819
|
+
SETTLEMINT_APPLICATION: result.uniqueName
|
|
274807
274820
|
};
|
|
274808
274821
|
}
|
|
274809
274822
|
};
|
|
@@ -274821,7 +274834,7 @@ function applicationCreateCommand() {
|
|
|
274821
274834
|
},
|
|
274822
274835
|
{
|
|
274823
274836
|
description: "Create an application in a specific workspace",
|
|
274824
|
-
command: "platform create application my-app --workspace-
|
|
274837
|
+
command: "platform create application my-app --workspace my-workspace"
|
|
274825
274838
|
}
|
|
274826
274839
|
]
|
|
274827
274840
|
});
|
|
@@ -274832,7 +274845,7 @@ async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
|
274832
274845
|
if (networks.length === 0) {
|
|
274833
274846
|
return;
|
|
274834
274847
|
}
|
|
274835
|
-
const defaultNetwork = networks.find((network) => network.
|
|
274848
|
+
const defaultNetwork = networks.find((network) => network.uniqueName === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
|
|
274836
274849
|
const defaultPossible = accept;
|
|
274837
274850
|
if (defaultPossible) {
|
|
274838
274851
|
return defaultNetwork;
|
|
@@ -274860,13 +274873,13 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274860
274873
|
type: "blockchain node",
|
|
274861
274874
|
alias: "b",
|
|
274862
274875
|
execute: (cmd2, baseAction) => {
|
|
274863
|
-
addClusterServiceArgs(cmd2).option("-a, --application
|
|
274864
|
-
|
|
274876
|
+
addClusterServiceArgs(cmd2).option("-a, --application <application>", "The application unique name to create the node in (defaults to application from env)").option("--blockchain-network <blockchainNetwork>", "Blockchain network unique name to add this node to").option("--node-identity <nodeIdentity>", "EC DSA P256 private key to use as the node identity").addOption(new Option("--node-type <nodeType>", "Type of the node").choices(["VALIDATOR", "NON_VALIDATOR"]).makeOptionMandatory()).action(async (name2, {
|
|
274877
|
+
application,
|
|
274865
274878
|
provider,
|
|
274866
274879
|
region,
|
|
274867
274880
|
size,
|
|
274868
274881
|
type: type4,
|
|
274869
|
-
|
|
274882
|
+
blockchainNetwork,
|
|
274870
274883
|
nodeType,
|
|
274871
274884
|
nodeIdentity,
|
|
274872
274885
|
acceptDefaults,
|
|
@@ -274874,23 +274887,23 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274874
274887
|
}) => {
|
|
274875
274888
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274876
274889
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274877
|
-
const
|
|
274878
|
-
if (!
|
|
274890
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274891
|
+
if (!applicationUniqueName) {
|
|
274879
274892
|
cancel2("No application found. Please specify an application or run `settlemint connect` to continue.");
|
|
274880
274893
|
}
|
|
274881
|
-
let
|
|
274882
|
-
if (!
|
|
274883
|
-
const networks = await settlemint.blockchainNetwork.list(
|
|
274894
|
+
let networkUniqueName = blockchainNetwork ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
|
|
274895
|
+
if (!networkUniqueName) {
|
|
274896
|
+
const networks = await settlemint.blockchainNetwork.list(applicationUniqueName);
|
|
274884
274897
|
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults ?? false);
|
|
274885
274898
|
if (!network) {
|
|
274886
274899
|
cancel2("No network found. Please specify a network to continue.");
|
|
274887
274900
|
}
|
|
274888
|
-
|
|
274901
|
+
networkUniqueName = network?.id;
|
|
274889
274902
|
}
|
|
274890
274903
|
const result = await settlemint.blockchainNode.create({
|
|
274891
|
-
|
|
274904
|
+
applicationUniqueName,
|
|
274892
274905
|
name: name2,
|
|
274893
|
-
|
|
274906
|
+
blockchainNetworkUniqueName: networkUniqueName,
|
|
274894
274907
|
nodeType,
|
|
274895
274908
|
keyMaterial: nodeIdentity,
|
|
274896
274909
|
provider,
|
|
@@ -274902,7 +274915,7 @@ function blockchainNodeBesuCreateCommand() {
|
|
|
274902
274915
|
result,
|
|
274903
274916
|
mapDefaultEnv: () => {
|
|
274904
274917
|
return {
|
|
274905
|
-
SETTLEMINT_APPLICATION:
|
|
274918
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274906
274919
|
SETTLEMINT_BLOCKCHAIN_NODE: result.id
|
|
274907
274920
|
};
|
|
274908
274921
|
}
|
|
@@ -274939,28 +274952,28 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274939
274952
|
type: "insights",
|
|
274940
274953
|
alias: "bs",
|
|
274941
274954
|
execute: (cmd2, baseAction) => {
|
|
274942
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
274955
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").action(async (name2, { application, provider, region, size, type: type4, blockchainNode, loadBalancer, ...defaultArgs }) => {
|
|
274943
274956
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274944
|
-
const
|
|
274945
|
-
const
|
|
274946
|
-
const
|
|
274957
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274958
|
+
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274959
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
274947
274960
|
const result = await settlemint.insights.create({
|
|
274948
274961
|
name: name2,
|
|
274949
|
-
|
|
274962
|
+
applicationUniqueName,
|
|
274950
274963
|
insightsCategory: "BLOCKCHAIN_EXPLORER",
|
|
274951
274964
|
provider,
|
|
274952
274965
|
region,
|
|
274953
274966
|
size,
|
|
274954
274967
|
type: type4,
|
|
274955
|
-
|
|
274956
|
-
|
|
274968
|
+
blockchainNodeUniqueName,
|
|
274969
|
+
loadBalancerUniqueName
|
|
274957
274970
|
});
|
|
274958
274971
|
return {
|
|
274959
274972
|
result,
|
|
274960
274973
|
mapDefaultEnv: async () => {
|
|
274961
274974
|
return {
|
|
274962
|
-
SETTLEMINT_APPLICATION:
|
|
274963
|
-
SETTLEMINT_BLOCKSCOUT: result.
|
|
274975
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
274976
|
+
SETTLEMINT_BLOCKSCOUT: result.uniqueName,
|
|
274964
274977
|
...getBlockscoutEndpoints(result)
|
|
274965
274978
|
};
|
|
274966
274979
|
}
|
|
@@ -274975,7 +274988,7 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274975
274988
|
},
|
|
274976
274989
|
{
|
|
274977
274990
|
description: "Create a Blockscout insights service in a different application",
|
|
274978
|
-
command: "platform create insights blockscout my-blockscout --application-
|
|
274991
|
+
command: "platform create insights blockscout my-blockscout --application app-123"
|
|
274979
274992
|
}
|
|
274980
274993
|
]
|
|
274981
274994
|
});
|
|
@@ -274995,12 +275008,12 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274995
275008
|
type: "integration tool",
|
|
274996
275009
|
alias: "ha",
|
|
274997
275010
|
execute: (cmd2, baseAction) => {
|
|
274998
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275011
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274999
275012
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275000
|
-
const
|
|
275013
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275001
275014
|
const result = await settlemint.integrationTool.create({
|
|
275002
275015
|
name: name2,
|
|
275003
|
-
|
|
275016
|
+
applicationUniqueName,
|
|
275004
275017
|
integrationType: "HASURA",
|
|
275005
275018
|
provider,
|
|
275006
275019
|
region,
|
|
@@ -275011,8 +275024,8 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275011
275024
|
result,
|
|
275012
275025
|
mapDefaultEnv: async () => {
|
|
275013
275026
|
return {
|
|
275014
|
-
SETTLEMINT_APPLICATION:
|
|
275015
|
-
SETTLEMINT_HASURA: result.
|
|
275027
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275028
|
+
SETTLEMINT_HASURA: result.uniqueName,
|
|
275016
275029
|
...getHasuraEndpoints(result)
|
|
275017
275030
|
};
|
|
275018
275031
|
}
|
|
@@ -275027,7 +275040,7 @@ function hasuraIntegrationCreateCommand() {
|
|
|
275027
275040
|
},
|
|
275028
275041
|
{
|
|
275029
275042
|
description: "Create a Hasura integration in a different application",
|
|
275030
|
-
command: "platform create integration-tool hasura my-hasura --application-
|
|
275043
|
+
command: "platform create integration-tool hasura my-hasura --application app-123"
|
|
275031
275044
|
}
|
|
275032
275045
|
]
|
|
275033
275046
|
});
|
|
@@ -275047,15 +275060,15 @@ function graphMiddlewareCreateCommand() {
|
|
|
275047
275060
|
type: "middleware",
|
|
275048
275061
|
alias: "gr",
|
|
275049
275062
|
execute: (cmd2, baseAction) => {
|
|
275050
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275063
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275051
275064
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275052
|
-
const
|
|
275053
|
-
const
|
|
275065
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275066
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275054
275067
|
const result = await settlemint.middleware.create({
|
|
275055
275068
|
name: name2,
|
|
275056
|
-
|
|
275069
|
+
applicationUniqueName,
|
|
275057
275070
|
interface: "HA_GRAPH",
|
|
275058
|
-
|
|
275071
|
+
blockchainNodeUniqueName,
|
|
275059
275072
|
provider,
|
|
275060
275073
|
region,
|
|
275061
275074
|
size,
|
|
@@ -275064,11 +275077,11 @@ function graphMiddlewareCreateCommand() {
|
|
|
275064
275077
|
return {
|
|
275065
275078
|
result,
|
|
275066
275079
|
mapDefaultEnv: async () => {
|
|
275067
|
-
const
|
|
275080
|
+
const graphMiddleware = await settlemint.middleware.read(result.uniqueName);
|
|
275068
275081
|
return {
|
|
275069
|
-
SETTLEMINT_APPLICATION:
|
|
275070
|
-
SETTLEMINT_THEGRAPH: result.
|
|
275071
|
-
...await getGraphEndpoint(
|
|
275082
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275083
|
+
SETTLEMINT_THEGRAPH: result.uniqueName,
|
|
275084
|
+
...await getGraphEndpoint(graphMiddleware, env2)
|
|
275072
275085
|
};
|
|
275073
275086
|
}
|
|
275074
275087
|
};
|
|
@@ -275082,7 +275095,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275082
275095
|
},
|
|
275083
275096
|
{
|
|
275084
275097
|
description: "Create a graph middleware in a different application",
|
|
275085
|
-
command: "platform create middleware graph my-graph --application-
|
|
275098
|
+
command: "platform create middleware graph my-graph --application my-app --blockchain-node node-123"
|
|
275086
275099
|
}
|
|
275087
275100
|
]
|
|
275088
275101
|
});
|
|
@@ -275096,16 +275109,16 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275096
275109
|
type: "middleware",
|
|
275097
275110
|
alias: "scp",
|
|
275098
275111
|
execute: (cmd2, baseAction) => {
|
|
275099
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275112
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--load-balancer <loadBalancer>", "Load Balancer unique name (mutually exclusive with blockchain-node)").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (mutually exclusive with load-balancer)").option("--abis <abis...>", "Path to abi file(s)").addOption(new Option("--include-predeployed-abis <includePredeployedAbis...>", "Include pre-deployed abis").choices([
|
|
275100
275113
|
"StarterKitERC20Registry",
|
|
275101
275114
|
"StarterKitERC20Factory",
|
|
275102
275115
|
"StarterKitERC20",
|
|
275103
275116
|
"StarterKitERC20DexFactory",
|
|
275104
275117
|
"StarterKitERC20Dex"
|
|
275105
275118
|
])).action(async (name2, {
|
|
275106
|
-
|
|
275107
|
-
|
|
275108
|
-
|
|
275119
|
+
application,
|
|
275120
|
+
blockchainNode,
|
|
275121
|
+
loadBalancer,
|
|
275109
275122
|
provider,
|
|
275110
275123
|
region,
|
|
275111
275124
|
size,
|
|
@@ -275115,9 +275128,9 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275115
275128
|
...defaultArgs
|
|
275116
275129
|
}) => {
|
|
275117
275130
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275118
|
-
const
|
|
275119
|
-
const
|
|
275120
|
-
const
|
|
275131
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275132
|
+
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275133
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
275121
275134
|
const parsedAbis = [];
|
|
275122
275135
|
if (abis && abis.length > 0) {
|
|
275123
275136
|
try {
|
|
@@ -275134,10 +275147,10 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275134
275147
|
}
|
|
275135
275148
|
const result = await settlemint.middleware.create({
|
|
275136
275149
|
name: name2,
|
|
275137
|
-
|
|
275150
|
+
applicationUniqueName,
|
|
275138
275151
|
interface: "SMART_CONTRACT_PORTAL",
|
|
275139
|
-
|
|
275140
|
-
|
|
275152
|
+
blockchainNodeUniqueName,
|
|
275153
|
+
loadBalancerUniqueName,
|
|
275141
275154
|
abis: parsedAbis,
|
|
275142
275155
|
includePredeployedAbis,
|
|
275143
275156
|
provider,
|
|
@@ -275149,8 +275162,8 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275149
275162
|
result,
|
|
275150
275163
|
mapDefaultEnv: async () => {
|
|
275151
275164
|
return {
|
|
275152
|
-
SETTLEMINT_APPLICATION:
|
|
275153
|
-
SETTLEMINT_PORTAL: result.
|
|
275165
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275166
|
+
SETTLEMINT_PORTAL: result.uniqueName,
|
|
275154
275167
|
...getPortalEndpoints(result)
|
|
275155
275168
|
};
|
|
275156
275169
|
}
|
|
@@ -275165,7 +275178,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275165
275178
|
},
|
|
275166
275179
|
{
|
|
275167
275180
|
description: "Create a smart contract portal middleware in a different application",
|
|
275168
|
-
command: "platform create middleware smart-contract-portal my-portal --application-
|
|
275181
|
+
command: "platform create middleware smart-contract-portal my-portal --application my-app --blockchain-node node-123"
|
|
275169
275182
|
}
|
|
275170
275183
|
]
|
|
275171
275184
|
});
|
|
@@ -275183,14 +275196,15 @@ function privateKeyHdCreateCommand() {
|
|
|
275183
275196
|
type: "private key",
|
|
275184
275197
|
alias: "hd",
|
|
275185
275198
|
execute: (cmd2, baseAction) => {
|
|
275186
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275199
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275187
275200
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275188
|
-
const
|
|
275201
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275202
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275189
275203
|
const result = await settlemint.privateKey.create({
|
|
275190
275204
|
name: name2,
|
|
275191
|
-
|
|
275205
|
+
applicationUniqueName,
|
|
275192
275206
|
privateKeyType: "HD_ECDSA_P256",
|
|
275193
|
-
|
|
275207
|
+
blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
|
|
275194
275208
|
provider,
|
|
275195
275209
|
region,
|
|
275196
275210
|
size,
|
|
@@ -275200,7 +275214,7 @@ function privateKeyHdCreateCommand() {
|
|
|
275200
275214
|
result,
|
|
275201
275215
|
mapDefaultEnv: () => {
|
|
275202
275216
|
return {
|
|
275203
|
-
SETTLEMINT_APPLICATION:
|
|
275217
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275204
275218
|
SETTLEMINT_HD_PRIVATE_KEY: result.uniqueName
|
|
275205
275219
|
};
|
|
275206
275220
|
}
|
|
@@ -275215,11 +275229,11 @@ function privateKeyHdCreateCommand() {
|
|
|
275215
275229
|
},
|
|
275216
275230
|
{
|
|
275217
275231
|
description: "Create a private key in a different application",
|
|
275218
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --application-
|
|
275232
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --application my-app"
|
|
275219
275233
|
},
|
|
275220
275234
|
{
|
|
275221
275235
|
description: "Create a private key linked to a blockchain node",
|
|
275222
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node-
|
|
275236
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node node-123"
|
|
275223
275237
|
}
|
|
275224
275238
|
]
|
|
275225
275239
|
});
|
|
@@ -275232,14 +275246,15 @@ function privateKeyHsmCreateCommand() {
|
|
|
275232
275246
|
type: "private key",
|
|
275233
275247
|
alias: "hd",
|
|
275234
275248
|
execute: (cmd2, baseAction) => {
|
|
275235
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275249
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").option("--blockchain-node <blockchainNode>", "Blockchain Node unique name").action(async (name2, { application, blockchainNode, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275236
275250
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275237
|
-
const
|
|
275251
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275252
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275238
275253
|
const result = await settlemint.privateKey.create({
|
|
275239
275254
|
name: name2,
|
|
275240
|
-
|
|
275255
|
+
applicationUniqueName,
|
|
275241
275256
|
privateKeyType: "HSM_ECDSA_P256",
|
|
275242
|
-
|
|
275257
|
+
blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
|
|
275243
275258
|
provider,
|
|
275244
275259
|
region,
|
|
275245
275260
|
size,
|
|
@@ -275258,11 +275273,11 @@ function privateKeyHsmCreateCommand() {
|
|
|
275258
275273
|
},
|
|
275259
275274
|
{
|
|
275260
275275
|
description: "Create a private key in a different application",
|
|
275261
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --application
|
|
275276
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --application 123456789"
|
|
275262
275277
|
},
|
|
275263
275278
|
{
|
|
275264
275279
|
description: "Create a private key linked to a blockchain node",
|
|
275265
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node-
|
|
275280
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node node-123"
|
|
275266
275281
|
}
|
|
275267
275282
|
]
|
|
275268
275283
|
});
|
|
@@ -275280,12 +275295,12 @@ function ipfsStorageCreateCommand() {
|
|
|
275280
275295
|
type: "storage",
|
|
275281
275296
|
alias: "ip",
|
|
275282
275297
|
execute: (cmd2, baseAction) => {
|
|
275283
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275298
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275284
275299
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275285
|
-
const
|
|
275300
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275286
275301
|
const result = await settlemint.storage.create({
|
|
275287
275302
|
name: name2,
|
|
275288
|
-
|
|
275303
|
+
applicationUniqueName,
|
|
275289
275304
|
storageProtocol: "IPFS",
|
|
275290
275305
|
provider,
|
|
275291
275306
|
region,
|
|
@@ -275296,8 +275311,8 @@ function ipfsStorageCreateCommand() {
|
|
|
275296
275311
|
result,
|
|
275297
275312
|
mapDefaultEnv: () => {
|
|
275298
275313
|
return {
|
|
275299
|
-
SETTLEMINT_APPLICATION:
|
|
275300
|
-
SETTLEMINT_IPFS: result.
|
|
275314
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275315
|
+
SETTLEMINT_IPFS: result.uniqueName,
|
|
275301
275316
|
...getIpfsEndpoints(result)
|
|
275302
275317
|
};
|
|
275303
275318
|
}
|
|
@@ -275312,7 +275327,7 @@ function ipfsStorageCreateCommand() {
|
|
|
275312
275327
|
},
|
|
275313
275328
|
{
|
|
275314
275329
|
description: "Create an IPFS storage in a different application",
|
|
275315
|
-
command: "platform create storage ipfs my-storage --application
|
|
275330
|
+
command: "platform create storage ipfs my-storage --application app-123"
|
|
275316
275331
|
}
|
|
275317
275332
|
]
|
|
275318
275333
|
});
|
|
@@ -275325,12 +275340,12 @@ function minioStorageCreateCommand() {
|
|
|
275325
275340
|
type: "storage",
|
|
275326
275341
|
alias: "m",
|
|
275327
275342
|
execute: (cmd2, baseAction) => {
|
|
275328
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275343
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275329
275344
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275330
|
-
const
|
|
275345
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275331
275346
|
const result = await settlemint.storage.create({
|
|
275332
275347
|
name: name2,
|
|
275333
|
-
|
|
275348
|
+
applicationUniqueName,
|
|
275334
275349
|
storageProtocol: "MINIO",
|
|
275335
275350
|
provider,
|
|
275336
275351
|
region,
|
|
@@ -275341,8 +275356,8 @@ function minioStorageCreateCommand() {
|
|
|
275341
275356
|
result,
|
|
275342
275357
|
mapDefaultEnv: () => {
|
|
275343
275358
|
return {
|
|
275344
|
-
SETTLEMINT_APPLICATION:
|
|
275345
|
-
SETTLEMINT_MINIO: result.
|
|
275359
|
+
SETTLEMINT_APPLICATION: applicationUniqueName,
|
|
275360
|
+
SETTLEMINT_MINIO: result.uniqueName,
|
|
275346
275361
|
...getMinioEndpoints(result)
|
|
275347
275362
|
};
|
|
275348
275363
|
}
|
|
@@ -275357,7 +275372,7 @@ function minioStorageCreateCommand() {
|
|
|
275357
275372
|
},
|
|
275358
275373
|
{
|
|
275359
275374
|
description: "Create a MinIO storage in a different application",
|
|
275360
|
-
command: "platform create storage minio my-storage --application
|
|
275375
|
+
command: "platform create storage minio my-storage --application app-123"
|
|
275361
275376
|
}
|
|
275362
275377
|
]
|
|
275363
275378
|
});
|
|
@@ -275403,11 +275418,11 @@ function getDeleteCommand({
|
|
|
275403
275418
|
deleteFunction,
|
|
275404
275419
|
usePersonalAccessToken = true
|
|
275405
275420
|
}) {
|
|
275406
|
-
return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4}
|
|
275421
|
+
return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4} unique name or use 'default' to delete the default ${type4} from your .env file.
|
|
275407
275422
|
${createExamples([
|
|
275408
275423
|
{
|
|
275409
|
-
description: `Deletes the specified ${type4} by
|
|
275410
|
-
command: `platform delete ${type4} <${type4}-
|
|
275424
|
+
description: `Deletes the specified ${type4} by unique name`,
|
|
275425
|
+
command: `platform delete ${type4} <${type4}-unique-name>`
|
|
275411
275426
|
},
|
|
275412
275427
|
{
|
|
275413
275428
|
description: `Deletes the default ${type4} in the production environment`,
|
|
@@ -275415,9 +275430,9 @@ ${createExamples([
|
|
|
275415
275430
|
},
|
|
275416
275431
|
{
|
|
275417
275432
|
description: `Force deletes the specified ${type4} without confirmation`,
|
|
275418
|
-
command: `platform delete ${type4} <${type4}-
|
|
275433
|
+
command: `platform delete ${type4} <${type4}-unique-name> --force`
|
|
275419
275434
|
}
|
|
275420
|
-
])}`).argument("<
|
|
275435
|
+
])}`).argument("<uniqueName>", `The unique name of the ${type4}, use 'default' to delete the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until destroyed").option("-f, --force", `Force delete the ${type4} without confirmation`).action(async (uniqueName, { acceptDefaults, prod, force, wait }) => {
|
|
275421
275436
|
intro(`Deleting ${type4} in the SettleMint platform`);
|
|
275422
275437
|
if (!force) {
|
|
275423
275438
|
await deleteConfirmationPrompt(`this ${type4}`);
|
|
@@ -275435,19 +275450,19 @@ ${createExamples([
|
|
|
275435
275450
|
accessToken,
|
|
275436
275451
|
instance
|
|
275437
275452
|
});
|
|
275438
|
-
const
|
|
275439
|
-
const
|
|
275440
|
-
if (!
|
|
275453
|
+
const isDefaultUniqueName = uniqueName === "default";
|
|
275454
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
|
275455
|
+
if (!serviceUniqueName) {
|
|
275441
275456
|
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} ID or set a default ${type4} first.`);
|
|
275442
275457
|
}
|
|
275443
275458
|
const result = await spinner({
|
|
275444
275459
|
startMessage: `Deleting ${type4}`,
|
|
275445
275460
|
task: async () => {
|
|
275446
|
-
return deleteFunction(settlemint,
|
|
275461
|
+
return deleteFunction(settlemint, serviceUniqueName);
|
|
275447
275462
|
},
|
|
275448
275463
|
stopMessage: `${capitalizeFirstLetter(type4)} deleted`
|
|
275449
275464
|
});
|
|
275450
|
-
if (
|
|
275465
|
+
if (isDefaultUniqueName) {
|
|
275451
275466
|
const newEnv = {
|
|
275452
275467
|
SETTLEMINT_ACCESS_TOKEN: usePersonalAccessToken ? env2.SETTLEMINT_ACCESS_TOKEN : accessToken,
|
|
275453
275468
|
SETTLEMINT_INSTANCE: instance,
|
|
@@ -275457,7 +275472,7 @@ ${createExamples([
|
|
|
275457
275472
|
note(`${capitalizeFirstLetter(type4)} removed as default`);
|
|
275458
275473
|
}
|
|
275459
275474
|
if (wait) {
|
|
275460
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275475
|
+
await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "destroy" });
|
|
275461
275476
|
}
|
|
275462
275477
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} deleted successfully`);
|
|
275463
275478
|
});
|
|
@@ -275470,8 +275485,8 @@ function workspaceDeleteCommand() {
|
|
|
275470
275485
|
type: "workspace",
|
|
275471
275486
|
alias: "w",
|
|
275472
275487
|
envKey: "SETTLEMINT_WORKSPACE",
|
|
275473
|
-
deleteFunction: async (settlemint,
|
|
275474
|
-
return settlemint.workspace.delete(
|
|
275488
|
+
deleteFunction: async (settlemint, uniqueName) => {
|
|
275489
|
+
return settlemint.workspace.delete(uniqueName);
|
|
275475
275490
|
}
|
|
275476
275491
|
});
|
|
275477
275492
|
}
|
|
@@ -275520,7 +275535,7 @@ ${createExamples([
|
|
|
275520
275535
|
description: `Restarts the default ${type4} in the production environment`,
|
|
275521
275536
|
command: `platform restart ${commandName}${subType ? ` ${subType}` : ""} default --prod`
|
|
275522
275537
|
}
|
|
275523
|
-
])}`).argument("<
|
|
275538
|
+
])}`).argument("<uniqueName>", `The unique name of the ${type4}, use 'default' to restart the default one from your .env file`).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-w, --wait", "Wait until restarted").action(async (uniqueName, { acceptDefaults, prod, wait }) => {
|
|
275524
275539
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
|
275525
275540
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275526
275541
|
const env2 = await loadEnv2(false, !!prod);
|
|
@@ -275535,20 +275550,20 @@ ${createExamples([
|
|
|
275535
275550
|
accessToken,
|
|
275536
275551
|
instance
|
|
275537
275552
|
});
|
|
275538
|
-
const
|
|
275539
|
-
const
|
|
275540
|
-
if (!
|
|
275541
|
-
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4}
|
|
275553
|
+
const isDefaultUniqueName = uniqueName === "default";
|
|
275554
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
|
275555
|
+
if (!serviceUniqueName) {
|
|
275556
|
+
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
|
|
275542
275557
|
}
|
|
275543
275558
|
const result = await spinner({
|
|
275544
275559
|
startMessage: `Restarting ${type4}`,
|
|
275545
275560
|
task: async () => {
|
|
275546
|
-
return restartFunction(settlemint,
|
|
275561
|
+
return restartFunction(settlemint, serviceUniqueName);
|
|
275547
275562
|
},
|
|
275548
275563
|
stopMessage: `${capitalizeFirstLetter(type4)} restart initiated`
|
|
275549
275564
|
});
|
|
275550
275565
|
if (wait) {
|
|
275551
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275566
|
+
await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "restart" });
|
|
275552
275567
|
}
|
|
275553
275568
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} restart initiated successfully`);
|
|
275554
275569
|
});
|
|
@@ -275561,8 +275576,8 @@ function blockchainNetworkRestartCommand() {
|
|
|
275561
275576
|
type: "blockchain network",
|
|
275562
275577
|
alias: "bn",
|
|
275563
275578
|
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
|
275564
|
-
restartFunction: async (settlemint,
|
|
275565
|
-
return settlemint.blockchainNetwork.restart(
|
|
275579
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275580
|
+
return settlemint.blockchainNetwork.restart(uniqueName);
|
|
275566
275581
|
}
|
|
275567
275582
|
});
|
|
275568
275583
|
}
|
|
@@ -275574,8 +275589,8 @@ function customDeploymentRestartCommand() {
|
|
|
275574
275589
|
type: "custom deployment",
|
|
275575
275590
|
alias: "cd",
|
|
275576
275591
|
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
|
275577
|
-
restartFunction: async (settlemint,
|
|
275578
|
-
return settlemint.customDeployment.restart(
|
|
275592
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275593
|
+
return settlemint.customDeployment.restart(uniqueName);
|
|
275579
275594
|
},
|
|
275580
275595
|
usePersonalAccessToken: false
|
|
275581
275596
|
});
|
|
@@ -275589,8 +275604,8 @@ function blockscoutRestartCommand() {
|
|
|
275589
275604
|
subType: "blockscout",
|
|
275590
275605
|
alias: "bs",
|
|
275591
275606
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
|
275592
|
-
restartFunction: async (settlemint,
|
|
275593
|
-
return settlemint.insights.restart(
|
|
275607
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275608
|
+
return settlemint.insights.restart(uniqueName);
|
|
275594
275609
|
}
|
|
275595
275610
|
});
|
|
275596
275611
|
}
|
|
@@ -275608,8 +275623,8 @@ function hasuraRestartCommand() {
|
|
|
275608
275623
|
subType: "hasura",
|
|
275609
275624
|
alias: "ha",
|
|
275610
275625
|
envKey: "SETTLEMINT_HASURA",
|
|
275611
|
-
restartFunction: async (settlemint,
|
|
275612
|
-
return settlemint.integrationTool.restart(
|
|
275626
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275627
|
+
return settlemint.integrationTool.restart(uniqueName);
|
|
275613
275628
|
}
|
|
275614
275629
|
});
|
|
275615
275630
|
}
|
|
@@ -275641,8 +275656,8 @@ function smartContractPortalRestartCommand() {
|
|
|
275641
275656
|
subType: "smart-contract-portal",
|
|
275642
275657
|
alias: "scp",
|
|
275643
275658
|
envKey: "SETTLEMINT_PORTAL",
|
|
275644
|
-
restartFunction: async (settlemint,
|
|
275645
|
-
return settlemint.middleware.restart(
|
|
275659
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275660
|
+
return settlemint.middleware.restart(uniqueName);
|
|
275646
275661
|
}
|
|
275647
275662
|
});
|
|
275648
275663
|
}
|
|
@@ -275660,8 +275675,8 @@ function hdEcdsaP256RestartCommand() {
|
|
|
275660
275675
|
subType: "hd-ecdsa-p256",
|
|
275661
275676
|
alias: "hd",
|
|
275662
275677
|
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
|
275663
|
-
restartFunction: async (settlemint,
|
|
275664
|
-
return settlemint.privateKey.restart(
|
|
275678
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275679
|
+
return settlemint.privateKey.restart(uniqueName);
|
|
275665
275680
|
}
|
|
275666
275681
|
});
|
|
275667
275682
|
}
|
|
@@ -275678,8 +275693,8 @@ function ipfsRestartCommand() {
|
|
|
275678
275693
|
type: "storage",
|
|
275679
275694
|
alias: "ip",
|
|
275680
275695
|
envKey: "SETTLEMINT_IPFS",
|
|
275681
|
-
restartFunction: async (settlemint,
|
|
275682
|
-
return settlemint.storage.restart(
|
|
275696
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275697
|
+
return settlemint.storage.restart(uniqueName);
|
|
275683
275698
|
}
|
|
275684
275699
|
});
|
|
275685
275700
|
}
|
|
@@ -275691,8 +275706,8 @@ function minioRestartCommand() {
|
|
|
275691
275706
|
type: "storage",
|
|
275692
275707
|
alias: "m",
|
|
275693
275708
|
envKey: "SETTLEMINT_MINIO",
|
|
275694
|
-
restartFunction: async (settlemint,
|
|
275695
|
-
return settlemint.storage.restart(
|
|
275709
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275710
|
+
return settlemint.storage.restart(uniqueName);
|
|
275696
275711
|
}
|
|
275697
275712
|
});
|
|
275698
275713
|
}
|
|
@@ -275710,12 +275725,12 @@ function restartCommand() {
|
|
|
275710
275725
|
|
|
275711
275726
|
// src/commands/platform/custom-deployments/update.ts
|
|
275712
275727
|
function customDeploymentsUpdateCommand() {
|
|
275713
|
-
return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--
|
|
275728
|
+
return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--unique-name <uniqueName>", "The unique name of the custom deployment to update. If not provided, will use SETTLEMINT_CUSTOM_DEPLOYMENT from env").option("--prod", "Connect to your production environment").option("--wait", "Wait for the custom deployment to be redeployed").description("Update a custom deployment in the SettleMint platform").action(async (tag, { uniqueName, prod, wait }) => {
|
|
275714
275729
|
intro("Updating custom deployment in the SettleMint platform");
|
|
275715
275730
|
const env2 = await loadEnv2(false, !!prod);
|
|
275716
|
-
const
|
|
275717
|
-
if (!
|
|
275718
|
-
throw new Error("No custom deployment
|
|
275731
|
+
const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
|
|
275732
|
+
if (!customDeploymentUniqueName) {
|
|
275733
|
+
throw new Error("No custom deployment unique name specified. Please provide it either via the --unique-name flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
|
275719
275734
|
}
|
|
275720
275735
|
const instance = await instancePrompt(env2, true);
|
|
275721
275736
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
@@ -275731,12 +275746,17 @@ function customDeploymentsUpdateCommand() {
|
|
|
275731
275746
|
const customDeployment = await spinner({
|
|
275732
275747
|
startMessage: "Updating custom deployment",
|
|
275733
275748
|
task: async () => {
|
|
275734
|
-
return settlemint.customDeployment.update(
|
|
275749
|
+
return settlemint.customDeployment.update(customDeploymentUniqueName, tag);
|
|
275735
275750
|
},
|
|
275736
275751
|
stopMessage: "Custom deployment updated"
|
|
275737
275752
|
});
|
|
275738
275753
|
if (wait) {
|
|
275739
|
-
await waitForCompletion({
|
|
275754
|
+
await waitForCompletion({
|
|
275755
|
+
settlemint,
|
|
275756
|
+
type: "custom deployment",
|
|
275757
|
+
uniqueName: customDeployment.uniqueName,
|
|
275758
|
+
action: "deploy"
|
|
275759
|
+
});
|
|
275740
275760
|
}
|
|
275741
275761
|
outro(`${customDeployment.name} updated to ${tag}`);
|
|
275742
275762
|
});
|
|
@@ -276125,7 +276145,7 @@ function isHardhatConfig(config4) {
|
|
|
276125
276145
|
|
|
276126
276146
|
// src/commands/smart-contract-set/hardhat/deploy/remote.ts
|
|
276127
276147
|
function hardhatDeployRemoteCommand() {
|
|
276128
|
-
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
|
|
276148
|
+
const cmd2 = new Command2("remote").description("Deploy the smart contracts using Hardhat/ignition to the remote network on the platform").option("-m, --module <ignitionmodule>", 'The module to deploy with Ignition, defaults to "ignition/modules/main.ts"').option("--deployment-id <deploymentId>", "Set the id of the deployment").option("-r, --reset", "Wipes the existing deployment state before deploying").option("-v, --verify", "Verify the deployment on Etherscan").option("--default-sender <defaultSender>", "Set the default sender for the deployment").option("--parameters <parameters>", "A relative path to a JSON file to use for the module parameters").option("--strategy <strategy>", `Set the deployment strategy to use (default: "basic")`).option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values");
|
|
276129
276149
|
cmd2.action(async ({
|
|
276130
276150
|
module,
|
|
276131
276151
|
reset: reset2,
|
|
@@ -276136,7 +276156,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276136
276156
|
strategy,
|
|
276137
276157
|
prod,
|
|
276138
276158
|
acceptDefaults,
|
|
276139
|
-
|
|
276159
|
+
blockchainNode: blockchainNodeUniqueName
|
|
276140
276160
|
}) => {
|
|
276141
276161
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276142
276162
|
const env2 = await loadEnv(false, !!prod);
|
|
@@ -276151,15 +276171,15 @@ function hardhatDeployRemoteCommand() {
|
|
|
276151
276171
|
accessToken,
|
|
276152
276172
|
instance
|
|
276153
276173
|
});
|
|
276154
|
-
const
|
|
276174
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276155
276175
|
let node = undefined;
|
|
276156
|
-
if (!
|
|
276176
|
+
if (!nodeUniqueName) {
|
|
276157
276177
|
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276158
276178
|
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276159
276179
|
if (evmNodes.length === 0) {
|
|
276160
276180
|
cancel2("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276161
276181
|
}
|
|
276162
|
-
const nodesWithPrivateKey = await Promise.all(
|
|
276182
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276163
276183
|
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276164
276184
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276165
276185
|
cancel2("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
@@ -276170,12 +276190,12 @@ function hardhatDeployRemoteCommand() {
|
|
|
276170
276190
|
}
|
|
276171
276191
|
node = blockchainNode;
|
|
276172
276192
|
} else {
|
|
276173
|
-
node = await settlemint.blockchainNode.read(
|
|
276193
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276174
276194
|
if (!node.isEvm) {
|
|
276175
276195
|
cancel2("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276176
276196
|
}
|
|
276177
276197
|
}
|
|
276178
|
-
const envConfig = await settlemint.foundry.env(node.
|
|
276198
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276179
276199
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276180
276200
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
276181
276201
|
cancel2("It is not possible to verify the deployment on this network unless you supply an Etherscan API key in the hardhat.config.ts file");
|
|
@@ -276239,8 +276259,8 @@ function hardhatScriptLocalCommand() {
|
|
|
276239
276259
|
|
|
276240
276260
|
// src/commands/smart-contract-set/hardhat/script/remote.ts
|
|
276241
276261
|
function hardhatScriptRemoteCommand() {
|
|
276242
|
-
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
|
|
276243
|
-
cmd2.action(async ({ script, prod,
|
|
276262
|
+
const cmd2 = new Command2("remote").description("Run a Hardhat script to deploy a contract on the platform or interact with a deployed contract.").requiredOption("-s, --script <script>", 'The script to run with Hardhat , e.g. "scripts/deploy.ts"').option("--blockchain-node <blockchainNode>", "Blockchain Node unique name (optional, defaults to the blockchain node in the environment)").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("--no-compile", "Don't compile before running this task");
|
|
276263
|
+
cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
|
|
276244
276264
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276245
276265
|
const env2 = await loadEnv(false, !!prod);
|
|
276246
276266
|
const instance = await instancePrompt(env2, true);
|
|
@@ -276254,16 +276274,16 @@ function hardhatScriptRemoteCommand() {
|
|
|
276254
276274
|
accessToken,
|
|
276255
276275
|
instance
|
|
276256
276276
|
});
|
|
276257
|
-
let
|
|
276258
|
-
if (!
|
|
276277
|
+
let nodeUniqueName = blockchainNodeUniqueName;
|
|
276278
|
+
if (!nodeUniqueName) {
|
|
276259
276279
|
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276260
276280
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
276261
276281
|
if (!blockchainNode) {
|
|
276262
276282
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
276263
276283
|
}
|
|
276264
|
-
|
|
276284
|
+
nodeUniqueName = blockchainNode.uniqueName;
|
|
276265
276285
|
}
|
|
276266
|
-
const envConfig = await settlemint.foundry.env(
|
|
276286
|
+
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276267
276287
|
const { command, args } = await getPackageManagerExecutable();
|
|
276268
276288
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276269
276289
|
});
|
|
@@ -276672,4 +276692,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276672
276692
|
cancel2(reason);
|
|
276673
276693
|
});
|
|
276674
276694
|
|
|
276675
|
-
//# debugId=
|
|
276695
|
+
//# debugId=BED5141867B2586A64756E2164756E21
|