@settlemint/sdk-cli 0.7.0-pr0ab001d → 0.7.0-pr24cdbac
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 +993 -1070
- package/dist/cli.js.map +41 -44
- 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.x2CRR3emRZ:/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.0-
|
|
200567
|
+
binaryVersion: "0.7.0-pr24cdbac",
|
|
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.x2CRR3emRZ:/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.x2CRR3emRZ:/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.x2CRR3emRZ:/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.x2CRR3emRZ:/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);
|
|
@@ -267876,7 +267877,7 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267876
267877
|
Timestamp: string;
|
|
267877
267878
|
};
|
|
267878
267879
|
}>({
|
|
267879
|
-
instances: JSON.parse(process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS
|
|
267880
|
+
instances: JSON.parse(process.env.SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS || '[]'),
|
|
267880
267881
|
accessToken: process.env.SETTLEMINT_ACCESS_TOKEN!, // undefined in browser, by design to not leak the secrets
|
|
267881
267882
|
subgraphName: "${name2}",
|
|
267882
267883
|
});`
|
|
@@ -269972,10 +269973,7 @@ function tryParseJson2(value4, defaultValue = null) {
|
|
|
269972
269973
|
return defaultValue;
|
|
269973
269974
|
}
|
|
269974
269975
|
}
|
|
269975
|
-
var
|
|
269976
|
-
z3.string().uuid(),
|
|
269977
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
269978
|
-
]);
|
|
269976
|
+
var UniqueNameSchema2 = z3.string().regex(/^[a-z0-9-]+$/);
|
|
269979
269977
|
var UrlSchema2 = z3.string().url();
|
|
269980
269978
|
var UrlPathSchema2 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
269981
269979
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -269985,33 +269983,33 @@ var DotEnvSchema2 = z3.object({
|
|
|
269985
269983
|
SETTLEMINT_INSTANCE: UrlSchema2.default("https://console.settlemint.com"),
|
|
269986
269984
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema2.optional(),
|
|
269987
269985
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema2.optional(),
|
|
269988
|
-
SETTLEMINT_WORKSPACE:
|
|
269989
|
-
SETTLEMINT_APPLICATION:
|
|
269990
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
269991
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
269992
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
269993
|
-
SETTLEMINT_HASURA:
|
|
269986
|
+
SETTLEMINT_WORKSPACE: UniqueNameSchema2.optional(),
|
|
269987
|
+
SETTLEMINT_APPLICATION: UniqueNameSchema2.optional(),
|
|
269988
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema2.optional(),
|
|
269989
|
+
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema2.optional(),
|
|
269990
|
+
SETTLEMINT_LOAD_BALANCER: UniqueNameSchema2.optional(),
|
|
269991
|
+
SETTLEMINT_HASURA: UniqueNameSchema2.optional(),
|
|
269994
269992
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema2.optional(),
|
|
269995
269993
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
269996
269994
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
269997
|
-
SETTLEMINT_THEGRAPH:
|
|
269995
|
+
SETTLEMINT_THEGRAPH: UniqueNameSchema2.optional(),
|
|
269998
269996
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson2(value4, []), z3.array(UrlSchema2).optional()),
|
|
269999
269997
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
270000
|
-
SETTLEMINT_PORTAL:
|
|
269998
|
+
SETTLEMINT_PORTAL: UniqueNameSchema2.optional(),
|
|
270001
269999
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
270002
270000
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema2.optional(),
|
|
270003
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
270004
|
-
SETTLEMINT_MINIO:
|
|
270001
|
+
SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema2.optional(),
|
|
270002
|
+
SETTLEMINT_MINIO: UniqueNameSchema2.optional(),
|
|
270005
270003
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema2.optional(),
|
|
270006
270004
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
270007
270005
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
270008
|
-
SETTLEMINT_IPFS:
|
|
270006
|
+
SETTLEMINT_IPFS: UniqueNameSchema2.optional(),
|
|
270009
270007
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema2.optional(),
|
|
270010
270008
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema2.optional(),
|
|
270011
270009
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema2.optional(),
|
|
270012
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
270010
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema2.optional(),
|
|
270013
270011
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema2.optional(),
|
|
270014
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
270012
|
+
SETTLEMINT_BLOCKSCOUT: UniqueNameSchema2.optional(),
|
|
270015
270013
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema2.optional(),
|
|
270016
270014
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema2.optional(),
|
|
270017
270015
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -270019,6 +270017,10 @@ var DotEnvSchema2 = z3.object({
|
|
|
270019
270017
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
270020
270018
|
});
|
|
270021
270019
|
var DotEnvSchemaPartial2 = DotEnvSchema2.partial();
|
|
270020
|
+
var IdSchema2 = z3.union([
|
|
270021
|
+
z3.string().uuid(),
|
|
270022
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270023
|
+
]);
|
|
270022
270024
|
function validate2(schema, value4) {
|
|
270023
270025
|
try {
|
|
270024
270026
|
return schema.parse(value4);
|
|
@@ -270627,10 +270629,7 @@ function tryParseJson3(value4, defaultValue = null) {
|
|
|
270627
270629
|
return defaultValue;
|
|
270628
270630
|
}
|
|
270629
270631
|
}
|
|
270630
|
-
var
|
|
270631
|
-
z3.string().uuid(),
|
|
270632
|
-
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270633
|
-
]);
|
|
270632
|
+
var UniqueNameSchema3 = z3.string().regex(/^[a-z0-9-]+$/);
|
|
270634
270633
|
var UrlSchema3 = z3.string().url();
|
|
270635
270634
|
var UrlPathSchema3 = z3.string().regex(/^\/(?:[a-zA-Z0-9-_]+(?:\/[a-zA-Z0-9-_]+)*\/?)?$/, {
|
|
270636
270635
|
message: "Invalid URL path format. Must start with '/' and can contain letters, numbers, hyphens, and underscores."
|
|
@@ -270640,33 +270639,33 @@ var DotEnvSchema3 = z3.object({
|
|
|
270640
270639
|
SETTLEMINT_INSTANCE: UrlSchema3.default("https://console.settlemint.com"),
|
|
270641
270640
|
SETTLEMINT_ACCESS_TOKEN: ApplicationAccessTokenSchema3.optional(),
|
|
270642
270641
|
SETTLEMINT_PERSONAL_ACCESS_TOKEN: PersonalAccessTokenSchema3.optional(),
|
|
270643
|
-
SETTLEMINT_WORKSPACE:
|
|
270644
|
-
SETTLEMINT_APPLICATION:
|
|
270645
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK:
|
|
270646
|
-
SETTLEMINT_BLOCKCHAIN_NODE:
|
|
270647
|
-
SETTLEMINT_LOAD_BALANCER:
|
|
270648
|
-
SETTLEMINT_HASURA:
|
|
270642
|
+
SETTLEMINT_WORKSPACE: UniqueNameSchema3.optional(),
|
|
270643
|
+
SETTLEMINT_APPLICATION: UniqueNameSchema3.optional(),
|
|
270644
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: UniqueNameSchema3.optional(),
|
|
270645
|
+
SETTLEMINT_BLOCKCHAIN_NODE: UniqueNameSchema3.optional(),
|
|
270646
|
+
SETTLEMINT_LOAD_BALANCER: UniqueNameSchema3.optional(),
|
|
270647
|
+
SETTLEMINT_HASURA: UniqueNameSchema3.optional(),
|
|
270649
270648
|
SETTLEMINT_HASURA_ENDPOINT: UrlSchema3.optional(),
|
|
270650
270649
|
SETTLEMINT_HASURA_ADMIN_SECRET: z3.string().optional(),
|
|
270651
270650
|
SETTLEMINT_HASURA_DATABASE_URL: z3.string().optional(),
|
|
270652
|
-
SETTLEMINT_THEGRAPH:
|
|
270651
|
+
SETTLEMINT_THEGRAPH: UniqueNameSchema3.optional(),
|
|
270653
270652
|
SETTLEMINT_THEGRAPH_SUBGRAPHS_ENDPOINTS: z3.preprocess((value4) => tryParseJson3(value4, []), z3.array(UrlSchema3).optional()),
|
|
270654
270653
|
SETTLEMINT_THEGRAPH_SUBGRAPH_NAME: z3.string().optional(),
|
|
270655
|
-
SETTLEMINT_PORTAL:
|
|
270654
|
+
SETTLEMINT_PORTAL: UniqueNameSchema3.optional(),
|
|
270656
270655
|
SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
|
|
270657
270656
|
SETTLEMINT_PORTAL_REST_ENDPOINT: UrlSchema3.optional(),
|
|
270658
|
-
SETTLEMINT_HD_PRIVATE_KEY:
|
|
270659
|
-
SETTLEMINT_MINIO:
|
|
270657
|
+
SETTLEMINT_HD_PRIVATE_KEY: UniqueNameSchema3.optional(),
|
|
270658
|
+
SETTLEMINT_MINIO: UniqueNameSchema3.optional(),
|
|
270660
270659
|
SETTLEMINT_MINIO_ENDPOINT: UrlSchema3.optional(),
|
|
270661
270660
|
SETTLEMINT_MINIO_ACCESS_KEY: z3.string().optional(),
|
|
270662
270661
|
SETTLEMINT_MINIO_SECRET_KEY: z3.string().optional(),
|
|
270663
|
-
SETTLEMINT_IPFS:
|
|
270662
|
+
SETTLEMINT_IPFS: UniqueNameSchema3.optional(),
|
|
270664
270663
|
SETTLEMINT_IPFS_API_ENDPOINT: UrlSchema3.optional(),
|
|
270665
270664
|
SETTLEMINT_IPFS_PINNING_ENDPOINT: UrlSchema3.optional(),
|
|
270666
270665
|
SETTLEMINT_IPFS_GATEWAY_ENDPOINT: UrlSchema3.optional(),
|
|
270667
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT:
|
|
270666
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: UniqueNameSchema3.optional(),
|
|
270668
270667
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: UrlSchema3.optional(),
|
|
270669
|
-
SETTLEMINT_BLOCKSCOUT:
|
|
270668
|
+
SETTLEMINT_BLOCKSCOUT: UniqueNameSchema3.optional(),
|
|
270670
270669
|
SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT: UrlSchema3.optional(),
|
|
270671
270670
|
SETTLEMINT_BLOCKSCOUT_UI_ENDPOINT: UrlSchema3.optional(),
|
|
270672
270671
|
SETTLEMINT_NEW_PROJECT_NAME: z3.string().optional(),
|
|
@@ -270674,6 +270673,10 @@ var DotEnvSchema3 = z3.object({
|
|
|
270674
270673
|
SETTLEMINT_SMART_CONTRACT_DEPLOYMENT_ID: z3.string().optional()
|
|
270675
270674
|
});
|
|
270676
270675
|
var DotEnvSchemaPartial3 = DotEnvSchema3.partial();
|
|
270676
|
+
var IdSchema3 = z3.union([
|
|
270677
|
+
z3.string().uuid(),
|
|
270678
|
+
z3.string().regex(/^[0-9a-fA-F]{24}$/)
|
|
270679
|
+
]);
|
|
270677
270680
|
function validate3(schema, value4) {
|
|
270678
270681
|
try {
|
|
270679
270682
|
return schema.parse(value4);
|
|
@@ -271278,95 +271281,256 @@ var t7 = initGraphQLTada();
|
|
|
271278
271281
|
|
|
271279
271282
|
// ../js/dist/settlemint.mjs
|
|
271280
271283
|
var graphql = initGraphQLTada();
|
|
271281
|
-
var createApplicationAccessToken = graphql(`
|
|
271282
|
-
mutation CreateApplicationAccessToken($applicationId: ID!, $blockchainNetworkScope: BlockchainNetworkScopeInputType!, $blockchainNodeScope: BlockchainNodeScopeInputType!, $customDeploymentScope: CustomDeploymentScopeInputType!, $insightsScope: InsightsScopeInputType!, $integrationScope: IntegrationScopeInputType!, $loadBalancerScope: LoadBalancerScopeInputType!, $middlewareScope: MiddlewareScopeInputType!, $name: String!, $privateKeyScope: PrivateKeyScopeInputType!, $smartContractSetScope: SmartContractSetScopeInputType!, $storageScope: StorageScopeInputType!, $validityPeriod: AccessTokenValidityPeriod!) {
|
|
271283
|
-
createApplicationAccessToken(applicationId: $applicationId, blockchainNetworkScope: $blockchainNetworkScope, blockchainNodeScope: $blockchainNodeScope, customDeploymentScope: $customDeploymentScope, insightsScope: $insightsScope, integrationScope: $integrationScope, loadBalancerScope: $loadBalancerScope, middlewareScope: $middlewareScope, name: $name, privateKeyScope: $privateKeyScope, smartContractSetScope: $smartContractSetScope, storageScope: $storageScope, validityPeriod: $validityPeriod) {
|
|
271284
|
-
token
|
|
271285
|
-
}
|
|
271286
|
-
}
|
|
271287
|
-
`, []);
|
|
271288
|
-
var applicationAccessTokenCreate = (gqlClient, options) => {
|
|
271289
|
-
return async (args) => {
|
|
271290
|
-
validate3(IdSchema3, args.applicationId);
|
|
271291
|
-
const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, args);
|
|
271292
|
-
if (!applicationAccessToken.token) {
|
|
271293
|
-
throw new Error("Failed to create application access token");
|
|
271294
|
-
}
|
|
271295
|
-
return applicationAccessToken.token;
|
|
271296
|
-
};
|
|
271297
|
-
};
|
|
271298
271284
|
var ApplicationFragment = graphql(`
|
|
271299
271285
|
fragment Application on Application {
|
|
271300
271286
|
id
|
|
271287
|
+
uniqueName
|
|
271301
271288
|
name
|
|
271302
|
-
workspace {
|
|
271289
|
+
workspace {
|
|
271290
|
+
id
|
|
271291
|
+
uniqueName
|
|
271292
|
+
}
|
|
271303
271293
|
}
|
|
271304
271294
|
`);
|
|
271305
|
-
var
|
|
271306
|
-
|
|
271307
|
-
|
|
271295
|
+
var WorkspaceFragment = graphql(`
|
|
271296
|
+
fragment Workspace on Workspace {
|
|
271297
|
+
id
|
|
271298
|
+
uniqueName
|
|
271299
|
+
name
|
|
271308
271300
|
applications {
|
|
271309
271301
|
...Application
|
|
271310
271302
|
}
|
|
271311
271303
|
}
|
|
271312
|
-
|
|
271304
|
+
`, [ApplicationFragment]);
|
|
271305
|
+
var getWorkspacesAndApplications = graphql(`
|
|
271306
|
+
query getWorkspacesAndApplications {
|
|
271307
|
+
workspaces {
|
|
271308
|
+
...Workspace
|
|
271309
|
+
applications {
|
|
271310
|
+
...Application
|
|
271311
|
+
}
|
|
271312
|
+
childWorkspaces {
|
|
271313
|
+
...Workspace
|
|
271314
|
+
}
|
|
271315
|
+
}
|
|
271316
|
+
}
|
|
271317
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271318
|
+
var getWorkspace = graphql(`
|
|
271319
|
+
query getWorkspace($uniqueName: String!) {
|
|
271320
|
+
workspaceByUniqueName(uniqueName: $uniqueName) {
|
|
271321
|
+
...Workspace
|
|
271322
|
+
applications {
|
|
271323
|
+
...Application
|
|
271324
|
+
}
|
|
271325
|
+
}
|
|
271326
|
+
}
|
|
271327
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271328
|
+
var createWorkspace = graphql(`
|
|
271329
|
+
mutation CreateWorkspace(
|
|
271330
|
+
$addressLine1: String
|
|
271331
|
+
$addressLine2: String
|
|
271332
|
+
$city: String
|
|
271333
|
+
$companyName: String
|
|
271334
|
+
$country: String
|
|
271335
|
+
$name: String!
|
|
271336
|
+
$parentId: String
|
|
271337
|
+
$paymentMethodId: String
|
|
271338
|
+
$postalCode: String
|
|
271339
|
+
$taxIdType: String
|
|
271340
|
+
$taxIdValue: String
|
|
271341
|
+
) {
|
|
271342
|
+
createWorkspace(
|
|
271343
|
+
addressLine1: $addressLine1
|
|
271344
|
+
addressLine2: $addressLine2
|
|
271345
|
+
city: $city
|
|
271346
|
+
companyName: $companyName
|
|
271347
|
+
country: $country
|
|
271348
|
+
name: $name
|
|
271349
|
+
parentId: $parentId
|
|
271350
|
+
paymentMethodId: $paymentMethodId
|
|
271351
|
+
postalCode: $postalCode
|
|
271352
|
+
taxIdType: $taxIdType
|
|
271353
|
+
taxIdValue: $taxIdValue
|
|
271354
|
+
) {
|
|
271355
|
+
...Workspace
|
|
271356
|
+
applications {
|
|
271357
|
+
...Application
|
|
271358
|
+
}
|
|
271359
|
+
}
|
|
271360
|
+
}
|
|
271361
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271362
|
+
var deleteWorkspace = graphql(`
|
|
271363
|
+
mutation deleteWorkspace($id: ID!) {
|
|
271364
|
+
deleteWorkspace(workspaceId: $id) {
|
|
271365
|
+
...Workspace
|
|
271366
|
+
applications {
|
|
271367
|
+
...Application
|
|
271368
|
+
}
|
|
271369
|
+
}
|
|
271370
|
+
}
|
|
271371
|
+
`, [WorkspaceFragment, ApplicationFragment]);
|
|
271372
|
+
var addCredits = graphql(`
|
|
271373
|
+
mutation addCredits($workspaceId: String!, $amount: Float!) {
|
|
271374
|
+
addCredits(workspaceId: $workspaceId, amount: $amount)
|
|
271375
|
+
}
|
|
271376
|
+
`);
|
|
271377
|
+
var workspaceList = (gqlClient, options) => {
|
|
271378
|
+
return async () => {
|
|
271379
|
+
const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);
|
|
271380
|
+
const allWorkspaces = workspaces.reduce((acc, workspace) => {
|
|
271381
|
+
acc.push(workspace);
|
|
271382
|
+
if (workspace.childWorkspaces) {
|
|
271383
|
+
acc.push(...workspace.childWorkspaces);
|
|
271384
|
+
}
|
|
271385
|
+
return acc;
|
|
271386
|
+
}, []);
|
|
271387
|
+
return allWorkspaces.sort((a8, b4) => a8.name.localeCompare(b4.name));
|
|
271388
|
+
};
|
|
271389
|
+
};
|
|
271390
|
+
var workspaceRead = (gqlClient, options) => {
|
|
271391
|
+
return async (workspaceUniqueName) => {
|
|
271392
|
+
const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });
|
|
271393
|
+
return workspaceByUniqueName;
|
|
271394
|
+
};
|
|
271395
|
+
};
|
|
271396
|
+
var workspaceCreate = (gqlClient, options) => {
|
|
271397
|
+
return async (createWorkspaceArgs) => {
|
|
271398
|
+
const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);
|
|
271399
|
+
return workspace;
|
|
271400
|
+
};
|
|
271401
|
+
};
|
|
271402
|
+
var workspaceDelete = (gqlClient, options) => {
|
|
271403
|
+
return async (workspaceUniqueName) => {
|
|
271404
|
+
const workspaceToDelete = await workspaceRead(gqlClient, options)(workspaceUniqueName);
|
|
271405
|
+
const { deleteWorkspace: workspace } = await gqlClient.request(deleteWorkspace, { id: workspaceToDelete.id });
|
|
271406
|
+
return workspace;
|
|
271407
|
+
};
|
|
271408
|
+
};
|
|
271409
|
+
var workspaceAddCredits = (gqlClient, options) => {
|
|
271410
|
+
return async (workspaceId, amount) => {
|
|
271411
|
+
const id = validate3(IdSchema3, workspaceId);
|
|
271412
|
+
if (amount <= 0) {
|
|
271413
|
+
throw new Error("Credit amount must be a positive number");
|
|
271414
|
+
}
|
|
271415
|
+
const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });
|
|
271416
|
+
return result;
|
|
271417
|
+
};
|
|
271418
|
+
};
|
|
271419
|
+
var listApplications = graphql(`
|
|
271420
|
+
query ListApplications($workspaceUniqueName: String!) {
|
|
271421
|
+
workspaceByUniqueName(uniqueName: $workspaceUniqueName) {
|
|
271422
|
+
applications {
|
|
271423
|
+
...Application
|
|
271424
|
+
}
|
|
271425
|
+
}
|
|
271426
|
+
}
|
|
271313
271427
|
`, [ApplicationFragment]);
|
|
271314
271428
|
var readApplication = graphql(`
|
|
271315
|
-
|
|
271316
|
-
|
|
271317
|
-
|
|
271429
|
+
query ReadApplication($applicationUniqueName: String!) {
|
|
271430
|
+
applicationByUniqueName(uniqueName: $applicationUniqueName) {
|
|
271431
|
+
...Application
|
|
271432
|
+
}
|
|
271318
271433
|
}
|
|
271319
|
-
}
|
|
271320
271434
|
`, [ApplicationFragment]);
|
|
271321
271435
|
var createApplication = graphql(`
|
|
271322
|
-
|
|
271323
|
-
|
|
271324
|
-
|
|
271325
|
-
|
|
271326
|
-
createApplication(
|
|
271327
|
-
name: $name
|
|
271328
|
-
workspaceId: $workspaceId
|
|
271329
|
-
) {
|
|
271330
|
-
...Application
|
|
271436
|
+
mutation CreateApplication($name: String!, $workspaceId: ID!) {
|
|
271437
|
+
createApplication(name: $name, workspaceId: $workspaceId) {
|
|
271438
|
+
...Application
|
|
271439
|
+
}
|
|
271331
271440
|
}
|
|
271332
|
-
}
|
|
271333
271441
|
`, [ApplicationFragment]);
|
|
271334
271442
|
var deleteApplication = graphql(`
|
|
271335
|
-
|
|
271336
|
-
|
|
271337
|
-
|
|
271443
|
+
mutation DeleteApplication($id: ID!) {
|
|
271444
|
+
deleteApplication(id: $id) {
|
|
271445
|
+
...Application
|
|
271446
|
+
}
|
|
271338
271447
|
}
|
|
271339
|
-
}
|
|
271340
271448
|
`, [ApplicationFragment]);
|
|
271341
271449
|
var applicationList = (gqlClient, options) => {
|
|
271342
|
-
return async (
|
|
271343
|
-
const id = validate3(IdSchema3, workspaceId);
|
|
271450
|
+
return async (workspaceUniqueName) => {
|
|
271344
271451
|
const {
|
|
271345
|
-
|
|
271346
|
-
} = await gqlClient.request(listApplications, {
|
|
271452
|
+
workspaceByUniqueName: { applications }
|
|
271453
|
+
} = await gqlClient.request(listApplications, { workspaceUniqueName });
|
|
271347
271454
|
return applications;
|
|
271348
271455
|
};
|
|
271349
271456
|
};
|
|
271350
271457
|
var applicationRead = (gqlClient, options) => {
|
|
271351
|
-
return async (
|
|
271352
|
-
const
|
|
271353
|
-
|
|
271458
|
+
return async (applicationUniqueName) => {
|
|
271459
|
+
const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {
|
|
271460
|
+
applicationUniqueName
|
|
271461
|
+
});
|
|
271354
271462
|
return application;
|
|
271355
271463
|
};
|
|
271356
271464
|
};
|
|
271357
271465
|
var applicationCreate = (gqlClient, options) => {
|
|
271358
271466
|
return async (args) => {
|
|
271359
|
-
const {
|
|
271467
|
+
const { workspaceUniqueName, ...otherArgs } = args;
|
|
271468
|
+
const workspace = await workspaceRead(gqlClient, options)(workspaceUniqueName);
|
|
271469
|
+
const { createApplication: application } = await gqlClient.request(createApplication, {
|
|
271470
|
+
...otherArgs,
|
|
271471
|
+
workspaceId: workspace.id
|
|
271472
|
+
});
|
|
271360
271473
|
return application;
|
|
271361
271474
|
};
|
|
271362
271475
|
};
|
|
271363
271476
|
var applicationDelete = (gqlClient, options) => {
|
|
271364
|
-
return async (
|
|
271365
|
-
const
|
|
271366
|
-
const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
|
|
271477
|
+
return async (applicationUniqueName) => {
|
|
271478
|
+
const applicationToDelete = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271479
|
+
const { deleteApplication: application } = await gqlClient.request(deleteApplication, {
|
|
271480
|
+
id: applicationToDelete.id
|
|
271481
|
+
});
|
|
271367
271482
|
return application;
|
|
271368
271483
|
};
|
|
271369
271484
|
};
|
|
271485
|
+
var createApplicationAccessToken = graphql(`
|
|
271486
|
+
mutation CreateApplicationAccessToken(
|
|
271487
|
+
$applicationId: ID!,
|
|
271488
|
+
$blockchainNetworkScope: BlockchainNetworkScopeInputType!,
|
|
271489
|
+
$blockchainNodeScope: BlockchainNodeScopeInputType!,
|
|
271490
|
+
$customDeploymentScope: CustomDeploymentScopeInputType!,
|
|
271491
|
+
$insightsScope: InsightsScopeInputType!,
|
|
271492
|
+
$integrationScope: IntegrationScopeInputType!,
|
|
271493
|
+
$loadBalancerScope: LoadBalancerScopeInputType!,
|
|
271494
|
+
$middlewareScope: MiddlewareScopeInputType!,
|
|
271495
|
+
$name: String!,
|
|
271496
|
+
$privateKeyScope: PrivateKeyScopeInputType!,
|
|
271497
|
+
$smartContractSetScope: SmartContractSetScopeInputType!,
|
|
271498
|
+
$storageScope: StorageScopeInputType!,
|
|
271499
|
+
$validityPeriod: AccessTokenValidityPeriod!
|
|
271500
|
+
) {
|
|
271501
|
+
createApplicationAccessToken(
|
|
271502
|
+
applicationId: $applicationId,
|
|
271503
|
+
blockchainNetworkScope: $blockchainNetworkScope,
|
|
271504
|
+
blockchainNodeScope: $blockchainNodeScope,
|
|
271505
|
+
customDeploymentScope: $customDeploymentScope,
|
|
271506
|
+
insightsScope: $insightsScope,
|
|
271507
|
+
integrationScope: $integrationScope,
|
|
271508
|
+
loadBalancerScope: $loadBalancerScope,
|
|
271509
|
+
middlewareScope: $middlewareScope,
|
|
271510
|
+
name: $name,
|
|
271511
|
+
privateKeyScope: $privateKeyScope,
|
|
271512
|
+
smartContractSetScope: $smartContractSetScope,
|
|
271513
|
+
storageScope: $storageScope,
|
|
271514
|
+
validityPeriod: $validityPeriod
|
|
271515
|
+
) {
|
|
271516
|
+
token
|
|
271517
|
+
}
|
|
271518
|
+
}
|
|
271519
|
+
`, []);
|
|
271520
|
+
var applicationAccessTokenCreate = (gqlClient, options) => {
|
|
271521
|
+
return async (args) => {
|
|
271522
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271523
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271524
|
+
const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(createApplicationAccessToken, {
|
|
271525
|
+
...otherArgs,
|
|
271526
|
+
applicationId: application.id
|
|
271527
|
+
});
|
|
271528
|
+
if (!applicationAccessToken.token) {
|
|
271529
|
+
throw new Error("Failed to create application access token");
|
|
271530
|
+
}
|
|
271531
|
+
return applicationAccessToken.token;
|
|
271532
|
+
};
|
|
271533
|
+
};
|
|
271370
271534
|
function setClusterServiceDefaults(args) {
|
|
271371
271535
|
return {
|
|
271372
271536
|
...args,
|
|
@@ -271393,31 +271557,34 @@ var BlockchainNetworkFragment = graphql(`
|
|
|
271393
271557
|
fragment BlockchainNetwork on BlockchainNetwork {
|
|
271394
271558
|
__typename
|
|
271395
271559
|
id
|
|
271560
|
+
uniqueName
|
|
271396
271561
|
name
|
|
271397
271562
|
status
|
|
271398
271563
|
blockchainNodes {
|
|
271399
271564
|
... on BlockchainNode {
|
|
271400
271565
|
id
|
|
271401
271566
|
name
|
|
271567
|
+
uniqueName
|
|
271402
271568
|
}
|
|
271403
271569
|
}
|
|
271404
271570
|
}
|
|
271405
271571
|
`);
|
|
271406
271572
|
var getBlockchainNetworks = graphql(`
|
|
271407
|
-
query getBlockchainNetworks($
|
|
271408
|
-
|
|
271409
|
-
|
|
271410
|
-
|
|
271573
|
+
query getBlockchainNetworks($applicationUniqueName: String!) {
|
|
271574
|
+
blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271575
|
+
items {
|
|
271576
|
+
...BlockchainNetwork
|
|
271577
|
+
}
|
|
271578
|
+
}
|
|
271411
271579
|
}
|
|
271412
|
-
|
|
271413
|
-
}`, [BlockchainNetworkFragment]);
|
|
271580
|
+
`, [BlockchainNetworkFragment]);
|
|
271414
271581
|
var getBlockchainNetwork = graphql(`
|
|
271415
|
-
query getBlockchainNetwork($
|
|
271416
|
-
|
|
271417
|
-
|
|
271582
|
+
query getBlockchainNetwork($uniqueName: String!) {
|
|
271583
|
+
blockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271584
|
+
...BlockchainNetwork
|
|
271585
|
+
}
|
|
271418
271586
|
}
|
|
271419
|
-
|
|
271420
|
-
`, [BlockchainNetworkFragment]);
|
|
271587
|
+
`, [BlockchainNetworkFragment]);
|
|
271421
271588
|
var createBlockchainNetwork = graphql(`
|
|
271422
271589
|
mutation createBlockchainNetwork(
|
|
271423
271590
|
$applicationId: ID!
|
|
@@ -271478,67 +271645,68 @@ var createBlockchainNetwork = graphql(`
|
|
|
271478
271645
|
...BlockchainNetwork
|
|
271479
271646
|
}
|
|
271480
271647
|
}
|
|
271481
|
-
`, [BlockchainNetworkFragment]);
|
|
271648
|
+
`, [BlockchainNetworkFragment]);
|
|
271482
271649
|
var deleteBlockchainNetwork = graphql(`
|
|
271483
|
-
mutation deleteBlockchainNetwork($
|
|
271484
|
-
|
|
271650
|
+
mutation deleteBlockchainNetwork($uniqueName: String!) {
|
|
271651
|
+
deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271485
271652
|
...BlockchainNetwork
|
|
271486
271653
|
}
|
|
271487
271654
|
}
|
|
271488
|
-
`, [BlockchainNetworkFragment]);
|
|
271655
|
+
`, [BlockchainNetworkFragment]);
|
|
271489
271656
|
var restartBlockchainNetwork = graphql(`
|
|
271490
|
-
mutation RestartBlockchainNetwork($
|
|
271491
|
-
|
|
271657
|
+
mutation RestartBlockchainNetwork($uniqueName: String!) {
|
|
271658
|
+
restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {
|
|
271492
271659
|
...BlockchainNetwork
|
|
271493
271660
|
}
|
|
271494
271661
|
}
|
|
271495
|
-
`, [BlockchainNetworkFragment]);
|
|
271662
|
+
`, [BlockchainNetworkFragment]);
|
|
271496
271663
|
var blockchainNetworkList = (gqlClient, options) => {
|
|
271497
|
-
return async (
|
|
271498
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271664
|
+
return async (applicationUniqueName) => {
|
|
271499
271665
|
const {
|
|
271500
|
-
|
|
271501
|
-
} = await gqlClient.request(getBlockchainNetworks, {
|
|
271666
|
+
blockchainNetworksByUniqueName: { items }
|
|
271667
|
+
} = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });
|
|
271502
271668
|
return items;
|
|
271503
271669
|
};
|
|
271504
271670
|
};
|
|
271505
271671
|
var blockchainNetworkRead = (gqlClient, options) => {
|
|
271506
|
-
return async (
|
|
271507
|
-
const
|
|
271508
|
-
|
|
271509
|
-
|
|
271672
|
+
return async (blockchainNetworkUniqueName) => {
|
|
271673
|
+
const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {
|
|
271674
|
+
uniqueName: blockchainNetworkUniqueName
|
|
271675
|
+
});
|
|
271676
|
+
return blockchainNetworkByUniqueName;
|
|
271510
271677
|
};
|
|
271511
271678
|
};
|
|
271512
271679
|
var blockchainNetworkCreate = (gqlClient, options) => {
|
|
271513
271680
|
return async (args) => {
|
|
271514
|
-
const
|
|
271515
|
-
|
|
271516
|
-
const
|
|
271681
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271682
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271683
|
+
const blockchainNetworkArgs = setNetworkDefaults(otherArgs);
|
|
271684
|
+
const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {
|
|
271685
|
+
...blockchainNetworkArgs,
|
|
271686
|
+
applicationId: application.id
|
|
271687
|
+
});
|
|
271517
271688
|
return blockchainNetwork;
|
|
271518
271689
|
};
|
|
271519
271690
|
};
|
|
271520
271691
|
var blockchainNetworkDelete = (gqlClient, options) => {
|
|
271521
|
-
return async (
|
|
271522
|
-
const
|
|
271523
|
-
|
|
271524
|
-
blockchainNetworkId: id
|
|
271692
|
+
return async (blockchainNetworkUniqueName) => {
|
|
271693
|
+
const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(deleteBlockchainNetwork, {
|
|
271694
|
+
uniqueName: blockchainNetworkUniqueName
|
|
271525
271695
|
});
|
|
271526
271696
|
return blockchainNetwork;
|
|
271527
271697
|
};
|
|
271528
271698
|
};
|
|
271529
|
-
var blockchainNetworkRestart = (gqlClient, _options) => async (
|
|
271530
|
-
const
|
|
271531
|
-
const { restartBlockchainNetwork: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { id });
|
|
271699
|
+
var blockchainNetworkRestart = (gqlClient, _options) => async (blockchainNetworkUniqueName) => {
|
|
271700
|
+
const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(restartBlockchainNetwork, { uniqueName: blockchainNetworkUniqueName });
|
|
271532
271701
|
return blockchainNetwork;
|
|
271533
271702
|
};
|
|
271534
271703
|
var BlockchainNodeFragment = graphql(`
|
|
271535
271704
|
fragment BlockchainNode on BlockchainNode {
|
|
271536
271705
|
__typename
|
|
271537
271706
|
id
|
|
271538
|
-
name
|
|
271539
271707
|
uniqueName
|
|
271708
|
+
name
|
|
271540
271709
|
status
|
|
271541
|
-
blockchainClient
|
|
271542
271710
|
endpoints {
|
|
271543
271711
|
id
|
|
271544
271712
|
label
|
|
@@ -271553,6 +271721,7 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271553
271721
|
... on AbstractClusterService {
|
|
271554
271722
|
id
|
|
271555
271723
|
name
|
|
271724
|
+
uniqueName
|
|
271556
271725
|
}
|
|
271557
271726
|
}
|
|
271558
271727
|
privateKeys {
|
|
@@ -271566,86 +271735,96 @@ var BlockchainNodeFragment = graphql(`
|
|
|
271566
271735
|
}
|
|
271567
271736
|
`);
|
|
271568
271737
|
var getBlockchainNodes = graphql(`
|
|
271569
|
-
query getBlockchainNodes($
|
|
271570
|
-
|
|
271571
|
-
|
|
271572
|
-
|
|
271573
|
-
|
|
271574
|
-
}
|
|
271575
|
-
}
|
|
271738
|
+
query getBlockchainNodes($applicationUniqueName: String!) {
|
|
271739
|
+
blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271740
|
+
items {
|
|
271741
|
+
...BlockchainNode
|
|
271742
|
+
}
|
|
271743
|
+
}
|
|
271744
|
+
}
|
|
271745
|
+
`, [BlockchainNodeFragment]);
|
|
271576
271746
|
var getBlockchainNode = graphql(`
|
|
271577
|
-
query getBlockchainNode($
|
|
271578
|
-
|
|
271579
|
-
|
|
271580
|
-
|
|
271581
|
-
}
|
|
271582
|
-
`, [BlockchainNodeFragment]);
|
|
271747
|
+
query getBlockchainNode($uniqueName: String!) {
|
|
271748
|
+
blockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
271749
|
+
...BlockchainNode
|
|
271750
|
+
}
|
|
271751
|
+
}
|
|
271752
|
+
`, [BlockchainNodeFragment]);
|
|
271583
271753
|
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
|
|
271754
|
+
mutation createBlockchainNode(
|
|
271755
|
+
$applicationId: ID!
|
|
271756
|
+
$blockchainNetworkId: ID!
|
|
271757
|
+
$name: String!
|
|
271758
|
+
$provider: String!
|
|
271759
|
+
$region: String!
|
|
271760
|
+
$size: ClusterServiceSize
|
|
271761
|
+
$type: ClusterServiceType
|
|
271762
|
+
$nodeType: NodeType
|
|
271763
|
+
$keyMaterial: ID
|
|
271605
271764
|
) {
|
|
271606
|
-
|
|
271607
|
-
|
|
271608
|
-
|
|
271609
|
-
|
|
271765
|
+
createBlockchainNode(
|
|
271766
|
+
applicationId: $applicationId
|
|
271767
|
+
blockchainNetworkId: $blockchainNetworkId
|
|
271768
|
+
name: $name
|
|
271769
|
+
provider: $provider
|
|
271770
|
+
region: $region
|
|
271771
|
+
size: $size
|
|
271772
|
+
type: $type
|
|
271773
|
+
nodeType: $nodeType
|
|
271774
|
+
keyMaterial: $keyMaterial
|
|
271775
|
+
) {
|
|
271776
|
+
...BlockchainNode
|
|
271777
|
+
}
|
|
271778
|
+
}
|
|
271779
|
+
`, [BlockchainNodeFragment]);
|
|
271610
271780
|
var restartBlockchainNode = graphql(`
|
|
271611
|
-
|
|
271612
|
-
|
|
271613
|
-
|
|
271781
|
+
mutation RestartBlockchainNode($uniqueName: String!) {
|
|
271782
|
+
restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {
|
|
271783
|
+
...BlockchainNode
|
|
271784
|
+
}
|
|
271614
271785
|
}
|
|
271615
|
-
|
|
271616
|
-
`, [BlockchainNodeFragment]);
|
|
271786
|
+
`, [BlockchainNodeFragment]);
|
|
271617
271787
|
var blockchainNodeList = (gqlClient, options) => {
|
|
271618
|
-
return async (
|
|
271619
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271788
|
+
return async (applicationUniqueName) => {
|
|
271620
271789
|
const {
|
|
271621
|
-
|
|
271622
|
-
} = await gqlClient.request(getBlockchainNodes, {
|
|
271790
|
+
blockchainNodesByUniqueName: { items }
|
|
271791
|
+
} = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });
|
|
271623
271792
|
return items;
|
|
271624
271793
|
};
|
|
271625
271794
|
};
|
|
271626
271795
|
var blockchainNodeRead = (gqlClient, options) => {
|
|
271627
|
-
return async (
|
|
271628
|
-
const
|
|
271629
|
-
|
|
271630
|
-
|
|
271796
|
+
return async (blockchainNodeUniqueName) => {
|
|
271797
|
+
const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {
|
|
271798
|
+
uniqueName: blockchainNodeUniqueName
|
|
271799
|
+
});
|
|
271800
|
+
return blockchainNodeByUniqueName;
|
|
271631
271801
|
};
|
|
271632
271802
|
};
|
|
271633
271803
|
var blockchainNodeCreate = (gqlClient, options) => {
|
|
271634
271804
|
return async (args) => {
|
|
271635
|
-
|
|
271636
|
-
|
|
271637
|
-
|
|
271805
|
+
const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;
|
|
271806
|
+
const [application, blockchainNetwork] = await Promise.all([
|
|
271807
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
271808
|
+
blockchainNetworkRead(gqlClient, options)(blockchainNetworkUniqueName)
|
|
271809
|
+
]);
|
|
271810
|
+
const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {
|
|
271811
|
+
...otherArgs,
|
|
271812
|
+
applicationId: application.id,
|
|
271813
|
+
blockchainNetworkId: blockchainNetwork.id
|
|
271814
|
+
});
|
|
271638
271815
|
return blockchainNode;
|
|
271639
271816
|
};
|
|
271640
271817
|
};
|
|
271641
|
-
var blockchainNodeRestart = (gqlClient, _options) => async (
|
|
271642
|
-
const
|
|
271643
|
-
|
|
271818
|
+
var blockchainNodeRestart = (gqlClient, _options) => async (blockchainNodeUniqueName) => {
|
|
271819
|
+
const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {
|
|
271820
|
+
uniqueName: blockchainNodeUniqueName
|
|
271821
|
+
});
|
|
271644
271822
|
return blockchainNode;
|
|
271645
271823
|
};
|
|
271646
271824
|
var CustomDeploymentFragment = graphql(`
|
|
271647
271825
|
fragment CustomDeployment on CustomDeployment {
|
|
271648
271826
|
id
|
|
271827
|
+
uniqueName
|
|
271649
271828
|
name
|
|
271650
271829
|
status
|
|
271651
271830
|
endpoints {
|
|
@@ -271661,112 +271840,141 @@ var CustomDeploymentFragment = graphql(`
|
|
|
271661
271840
|
}
|
|
271662
271841
|
`);
|
|
271663
271842
|
var getCustomDeployments = graphql(`
|
|
271664
|
-
query getCustomDeployments($
|
|
271665
|
-
|
|
271666
|
-
|
|
271667
|
-
|
|
271843
|
+
query getCustomDeployments($applicationUniqueName: String!) {
|
|
271844
|
+
customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271845
|
+
items {
|
|
271846
|
+
...CustomDeployment
|
|
271847
|
+
}
|
|
271848
|
+
}
|
|
271668
271849
|
}
|
|
271669
|
-
|
|
271670
|
-
}`, [CustomDeploymentFragment]);
|
|
271850
|
+
`, [CustomDeploymentFragment]);
|
|
271671
271851
|
var getCustomDeployment = graphql(`
|
|
271672
|
-
query getCustomDeployment($
|
|
271673
|
-
|
|
271674
|
-
|
|
271675
|
-
|
|
271676
|
-
}
|
|
271677
|
-
`, [CustomDeploymentFragment]);
|
|
271852
|
+
query getCustomDeployment($uniqueName: String!) {
|
|
271853
|
+
customDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
271854
|
+
...CustomDeployment
|
|
271855
|
+
}
|
|
271856
|
+
}
|
|
271857
|
+
`, [CustomDeploymentFragment]);
|
|
271678
271858
|
var editCustomDeployment = graphql(`
|
|
271679
|
-
mutation EditCustomDeployment($
|
|
271680
|
-
|
|
271681
|
-
|
|
271682
|
-
|
|
271683
|
-
}
|
|
271684
|
-
`, [CustomDeploymentFragment]);
|
|
271859
|
+
mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {
|
|
271860
|
+
editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {
|
|
271861
|
+
...CustomDeployment
|
|
271862
|
+
}
|
|
271863
|
+
}
|
|
271864
|
+
`, [CustomDeploymentFragment]);
|
|
271685
271865
|
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]);
|
|
271866
|
+
mutation CreateCustomDeployment(
|
|
271867
|
+
$applicationId: ID!
|
|
271868
|
+
$name: String!
|
|
271869
|
+
$imageTag: String!
|
|
271870
|
+
$imageName: String!
|
|
271871
|
+
$imageRepository: String!
|
|
271872
|
+
$environmentVariables: JSON
|
|
271873
|
+
$port: Int!
|
|
271874
|
+
$provider: String!
|
|
271875
|
+
$region: String!
|
|
271876
|
+
) {
|
|
271877
|
+
createCustomDeployment(
|
|
271878
|
+
applicationId: $applicationId
|
|
271879
|
+
name: $name
|
|
271880
|
+
imageTag: $imageTag
|
|
271881
|
+
imageName: $imageName
|
|
271882
|
+
imageRepository: $imageRepository
|
|
271883
|
+
port: $port
|
|
271884
|
+
environmentVariables: $environmentVariables
|
|
271885
|
+
provider: $provider
|
|
271886
|
+
region: $region
|
|
271887
|
+
) {
|
|
271888
|
+
...CustomDeployment
|
|
271889
|
+
}
|
|
271890
|
+
}
|
|
271891
|
+
`, [CustomDeploymentFragment]);
|
|
271712
271892
|
var restartCustomDeployment = graphql(`
|
|
271713
|
-
|
|
271714
|
-
|
|
271715
|
-
|
|
271893
|
+
mutation RestartCustomDeployment($uniqueName: String!) {
|
|
271894
|
+
restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {
|
|
271895
|
+
...CustomDeployment
|
|
271896
|
+
}
|
|
271716
271897
|
}
|
|
271717
|
-
|
|
271718
|
-
`, [CustomDeploymentFragment]);
|
|
271898
|
+
`, [CustomDeploymentFragment]);
|
|
271719
271899
|
var customdeploymentList = (gqlClient, options) => {
|
|
271720
|
-
return async (
|
|
271721
|
-
const id = validate3(IdSchema3, applicationId);
|
|
271900
|
+
return async (applicationUniqueName) => {
|
|
271722
271901
|
const {
|
|
271723
|
-
|
|
271724
|
-
} = await gqlClient.request(getCustomDeployments, {
|
|
271902
|
+
customDeploymentsByUniqueName: { items }
|
|
271903
|
+
} = await gqlClient.request(getCustomDeployments, { applicationUniqueName });
|
|
271725
271904
|
return items;
|
|
271726
271905
|
};
|
|
271727
271906
|
};
|
|
271728
271907
|
var customdeploymentRead = (gqlClient, options) => {
|
|
271729
|
-
return async (
|
|
271730
|
-
const
|
|
271731
|
-
|
|
271908
|
+
return async (customDeploymentUniqueName) => {
|
|
271909
|
+
const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {
|
|
271910
|
+
uniqueName: customDeploymentUniqueName
|
|
271911
|
+
});
|
|
271732
271912
|
return customDeployment;
|
|
271733
271913
|
};
|
|
271734
271914
|
};
|
|
271735
271915
|
var customdeploymentUpdate = (gqlClient, options) => {
|
|
271736
|
-
return async (
|
|
271737
|
-
const
|
|
271738
|
-
|
|
271916
|
+
return async (customDeploymentUniqueName, imageTag) => {
|
|
271917
|
+
const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {
|
|
271918
|
+
uniqueName: customDeploymentUniqueName,
|
|
271919
|
+
imageTag
|
|
271920
|
+
});
|
|
271739
271921
|
return cd;
|
|
271740
271922
|
};
|
|
271741
271923
|
};
|
|
271742
271924
|
var customdeploymentCreate = (gqlClient, options) => {
|
|
271743
271925
|
return async (args) => {
|
|
271744
|
-
|
|
271745
|
-
const
|
|
271926
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
271927
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
271928
|
+
const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {
|
|
271929
|
+
...otherArgs,
|
|
271930
|
+
applicationId: application.id
|
|
271931
|
+
});
|
|
271746
271932
|
return customDeployment;
|
|
271747
271933
|
};
|
|
271748
271934
|
};
|
|
271749
|
-
var customDeploymentRestart = (gqlClient, _options) => async (
|
|
271750
|
-
const
|
|
271751
|
-
|
|
271935
|
+
var customDeploymentRestart = (gqlClient, _options) => async (customDeploymentUniqueName) => {
|
|
271936
|
+
const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {
|
|
271937
|
+
uniqueName: customDeploymentUniqueName
|
|
271938
|
+
});
|
|
271752
271939
|
return customDeployment;
|
|
271753
271940
|
};
|
|
271754
271941
|
var getFoundryEnvConfig = graphql(`
|
|
271755
|
-
|
|
271756
|
-
|
|
271942
|
+
query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {
|
|
271943
|
+
foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)
|
|
271944
|
+
}
|
|
271945
|
+
`);
|
|
271946
|
+
var getEnv = (gqlClient, _options) => {
|
|
271947
|
+
return async (blockchainNodeUniqueName) => {
|
|
271948
|
+
const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });
|
|
271949
|
+
return foundryEnvConfigByUniqueName;
|
|
271950
|
+
};
|
|
271951
|
+
};
|
|
271952
|
+
var LoadBalancerFragment = graphql(`
|
|
271953
|
+
fragment LoadBalancer on LoadBalancer {
|
|
271954
|
+
id
|
|
271955
|
+
uniqueName
|
|
271757
271956
|
}
|
|
271758
271957
|
`);
|
|
271759
|
-
|
|
271760
|
-
|
|
271761
|
-
|
|
271762
|
-
|
|
271763
|
-
|
|
271958
|
+
var getLoadBalancer = graphql(`
|
|
271959
|
+
query GetLoadBalancer($uniqueName: String!) {
|
|
271960
|
+
loadBalancerByUniqueName(uniqueName: $uniqueName) {
|
|
271961
|
+
...LoadBalancer
|
|
271962
|
+
}
|
|
271963
|
+
}
|
|
271964
|
+
`, [LoadBalancerFragment]);
|
|
271965
|
+
var loadBalancerRead = (gqlClient, options) => {
|
|
271966
|
+
return async (loadBalancerUniqueName) => {
|
|
271967
|
+
const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {
|
|
271968
|
+
uniqueName: loadBalancerUniqueName
|
|
271969
|
+
});
|
|
271970
|
+
return loadBalancer;
|
|
271764
271971
|
};
|
|
271765
|
-
}
|
|
271972
|
+
};
|
|
271766
271973
|
var InsightsFragment = graphql(`
|
|
271767
271974
|
fragment Insights on Insights {
|
|
271768
271975
|
__typename
|
|
271769
271976
|
id
|
|
271977
|
+
uniqueName
|
|
271770
271978
|
name
|
|
271771
271979
|
status
|
|
271772
271980
|
insightsCategory
|
|
@@ -271783,86 +271991,97 @@ var InsightsFragment = graphql(`
|
|
|
271783
271991
|
}
|
|
271784
271992
|
`);
|
|
271785
271993
|
var getInsights = graphql(`
|
|
271786
|
-
query
|
|
271787
|
-
|
|
271788
|
-
|
|
271789
|
-
|
|
271994
|
+
query GetInsights($applicationUniqueName: String!) {
|
|
271995
|
+
insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
271996
|
+
items {
|
|
271997
|
+
...Insights
|
|
271998
|
+
}
|
|
271999
|
+
}
|
|
271790
272000
|
}
|
|
271791
|
-
|
|
271792
|
-
}`, [InsightsFragment]);
|
|
272001
|
+
`, [InsightsFragment]);
|
|
271793
272002
|
var getInsight = graphql(`
|
|
271794
|
-
query
|
|
271795
|
-
|
|
271796
|
-
|
|
271797
|
-
|
|
271798
|
-
}
|
|
271799
|
-
`, [InsightsFragment]);
|
|
272003
|
+
query GetInsight($uniqueName: String!) {
|
|
272004
|
+
insightsByUniqueName(uniqueName: $uniqueName) {
|
|
272005
|
+
...Insights
|
|
272006
|
+
}
|
|
272007
|
+
}
|
|
272008
|
+
`, [InsightsFragment]);
|
|
271800
272009
|
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
|
|
272010
|
+
mutation CreateInsights(
|
|
272011
|
+
$applicationId: ID!
|
|
272012
|
+
$name: String!
|
|
272013
|
+
$insightsCategory: InsightsCategory!
|
|
272014
|
+
$provider: String!
|
|
272015
|
+
$region: String!
|
|
272016
|
+
$size: ClusterServiceSize
|
|
272017
|
+
$type: ClusterServiceType
|
|
272018
|
+
$blockchainNode: ID
|
|
272019
|
+
$loadBalancer: ID
|
|
271822
272020
|
) {
|
|
271823
|
-
|
|
271824
|
-
|
|
271825
|
-
|
|
271826
|
-
|
|
272021
|
+
createInsights(
|
|
272022
|
+
applicationId: $applicationId
|
|
272023
|
+
name: $name
|
|
272024
|
+
insightsCategory: $insightsCategory
|
|
272025
|
+
provider: $provider
|
|
272026
|
+
region: $region
|
|
272027
|
+
size: $size
|
|
272028
|
+
type: $type
|
|
272029
|
+
blockchainNode: $blockchainNode
|
|
272030
|
+
loadBalancer: $loadBalancer
|
|
272031
|
+
) {
|
|
272032
|
+
...Insights
|
|
272033
|
+
}
|
|
272034
|
+
}
|
|
272035
|
+
`, [InsightsFragment]);
|
|
271827
272036
|
var restartInsights = graphql(`
|
|
271828
|
-
|
|
271829
|
-
|
|
271830
|
-
|
|
272037
|
+
mutation RestartInsights($uniqueName: String!) {
|
|
272038
|
+
restartInsightsByUniqueName(uniqueName: $uniqueName) {
|
|
272039
|
+
...Insights
|
|
272040
|
+
}
|
|
271831
272041
|
}
|
|
271832
|
-
|
|
271833
|
-
`, [InsightsFragment]);
|
|
272042
|
+
`, [InsightsFragment]);
|
|
271834
272043
|
var insightsList = (gqlClient, options) => {
|
|
271835
|
-
return async (
|
|
271836
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272044
|
+
return async (applicationUniqueName) => {
|
|
271837
272045
|
const {
|
|
271838
|
-
|
|
271839
|
-
} = await gqlClient.request(getInsights, {
|
|
272046
|
+
insightsListByUniqueName: { items }
|
|
272047
|
+
} = await gqlClient.request(getInsights, { applicationUniqueName });
|
|
271840
272048
|
return items;
|
|
271841
272049
|
};
|
|
271842
272050
|
};
|
|
271843
272051
|
var insightsRead = (gqlClient, options) => {
|
|
271844
|
-
return async (
|
|
271845
|
-
const
|
|
271846
|
-
const { insights } = await gqlClient.request(getInsight, { id });
|
|
272052
|
+
return async (insightsUniqueName) => {
|
|
272053
|
+
const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });
|
|
271847
272054
|
return insights;
|
|
271848
272055
|
};
|
|
271849
272056
|
};
|
|
271850
272057
|
var insightsCreate = (gqlClient, options) => {
|
|
271851
272058
|
return async (args) => {
|
|
271852
|
-
|
|
271853
|
-
const
|
|
272059
|
+
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;
|
|
272060
|
+
const [application, blockchainNode, loadBalancer] = await Promise.all([
|
|
272061
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
272062
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
|
|
272063
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined)
|
|
272064
|
+
]);
|
|
272065
|
+
const { createInsights: insights } = await gqlClient.request(createInsights, {
|
|
272066
|
+
...otherArgs,
|
|
272067
|
+
applicationId: application.id,
|
|
272068
|
+
blockchainNode: blockchainNode?.id,
|
|
272069
|
+
loadBalancer: loadBalancer?.id
|
|
272070
|
+
});
|
|
271854
272071
|
return insights;
|
|
271855
272072
|
};
|
|
271856
272073
|
};
|
|
271857
|
-
var insightsRestart = (gqlClient, _options) => async (
|
|
271858
|
-
const
|
|
271859
|
-
|
|
272074
|
+
var insightsRestart = (gqlClient, _options) => async (insightsUniqueName) => {
|
|
272075
|
+
const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {
|
|
272076
|
+
uniqueName: insightsUniqueName
|
|
272077
|
+
});
|
|
271860
272078
|
return insights;
|
|
271861
272079
|
};
|
|
271862
272080
|
var IntegrationFragment = graphql(`
|
|
271863
272081
|
fragment Integration on Integration {
|
|
271864
272082
|
__typename
|
|
271865
272083
|
id
|
|
272084
|
+
uniqueName
|
|
271866
272085
|
name
|
|
271867
272086
|
status
|
|
271868
272087
|
integrationType
|
|
@@ -271879,82 +272098,184 @@ var IntegrationFragment = graphql(`
|
|
|
271879
272098
|
}
|
|
271880
272099
|
`);
|
|
271881
272100
|
var getIntegrations = graphql(`
|
|
271882
|
-
query
|
|
271883
|
-
|
|
271884
|
-
|
|
271885
|
-
|
|
272101
|
+
query GetIntegrations($applicationUniqueName: String!) {
|
|
272102
|
+
integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272103
|
+
items {
|
|
272104
|
+
...Integration
|
|
272105
|
+
}
|
|
272106
|
+
}
|
|
271886
272107
|
}
|
|
271887
|
-
|
|
271888
|
-
}`, [IntegrationFragment]);
|
|
272108
|
+
`, [IntegrationFragment]);
|
|
271889
272109
|
var getIntegration = graphql(`
|
|
271890
|
-
query
|
|
271891
|
-
|
|
271892
|
-
|
|
271893
|
-
|
|
271894
|
-
}
|
|
271895
|
-
`, [IntegrationFragment]);
|
|
272110
|
+
query GetIntegration($uniqueName: String!) {
|
|
272111
|
+
integrationByUniqueName(uniqueName: $uniqueName) {
|
|
272112
|
+
...Integration
|
|
272113
|
+
}
|
|
272114
|
+
}
|
|
272115
|
+
`, [IntegrationFragment]);
|
|
271896
272116
|
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
|
|
272117
|
+
mutation CreateIntegration(
|
|
272118
|
+
$applicationId: ID!
|
|
272119
|
+
$name: String!
|
|
272120
|
+
$integrationType: IntegrationType!
|
|
272121
|
+
$provider: String!
|
|
272122
|
+
$region: String!
|
|
272123
|
+
$size: ClusterServiceSize
|
|
272124
|
+
$type: ClusterServiceType
|
|
271914
272125
|
) {
|
|
271915
|
-
|
|
271916
|
-
|
|
271917
|
-
|
|
271918
|
-
|
|
272126
|
+
createIntegration(
|
|
272127
|
+
applicationId: $applicationId
|
|
272128
|
+
name: $name
|
|
272129
|
+
integrationType: $integrationType
|
|
272130
|
+
provider: $provider
|
|
272131
|
+
region: $region
|
|
272132
|
+
size: $size
|
|
272133
|
+
type: $type
|
|
272134
|
+
) {
|
|
272135
|
+
...Integration
|
|
272136
|
+
}
|
|
272137
|
+
}
|
|
272138
|
+
`, [IntegrationFragment]);
|
|
271919
272139
|
var restartIntegrationTool = graphql(`
|
|
271920
|
-
|
|
271921
|
-
|
|
271922
|
-
|
|
272140
|
+
mutation RestartIntegrationTool($uniqueName: String!) {
|
|
272141
|
+
restartIntegrationByUniqueName(uniqueName: $uniqueName) {
|
|
272142
|
+
...Integration
|
|
272143
|
+
}
|
|
271923
272144
|
}
|
|
271924
|
-
|
|
271925
|
-
`, [IntegrationFragment]);
|
|
272145
|
+
`, [IntegrationFragment]);
|
|
271926
272146
|
var integrationToolList = (gqlClient, options) => {
|
|
271927
|
-
return async (
|
|
271928
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272147
|
+
return async (applicationUniqueName) => {
|
|
271929
272148
|
const {
|
|
271930
|
-
|
|
271931
|
-
} = await gqlClient.request(getIntegrations, {
|
|
272149
|
+
integrationsByUniqueName: { items }
|
|
272150
|
+
} = await gqlClient.request(getIntegrations, { applicationUniqueName });
|
|
271932
272151
|
return items;
|
|
271933
272152
|
};
|
|
271934
272153
|
};
|
|
271935
272154
|
var integrationToolRead = (gqlClient, options) => {
|
|
271936
|
-
return async (
|
|
271937
|
-
const
|
|
271938
|
-
|
|
271939
|
-
return integration;
|
|
272155
|
+
return async (integrationUniqueName) => {
|
|
272156
|
+
const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });
|
|
272157
|
+
return integrationByUniqueName;
|
|
271940
272158
|
};
|
|
271941
272159
|
};
|
|
271942
272160
|
var integrationToolCreate = (gqlClient, options) => {
|
|
271943
272161
|
return async (args) => {
|
|
271944
|
-
|
|
271945
|
-
const
|
|
272162
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
272163
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272164
|
+
const { createIntegration: integration } = await gqlClient.request(createIntegration, {
|
|
272165
|
+
...otherArgs,
|
|
272166
|
+
applicationId: application.id
|
|
272167
|
+
});
|
|
271946
272168
|
return integration;
|
|
271947
272169
|
};
|
|
271948
272170
|
};
|
|
271949
|
-
var integrationToolRestart = (gqlClient, _options) => async (
|
|
271950
|
-
const
|
|
271951
|
-
|
|
272171
|
+
var integrationToolRestart = (gqlClient, _options) => async (integrationUniqueName) => {
|
|
272172
|
+
const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {
|
|
272173
|
+
uniqueName: integrationUniqueName
|
|
272174
|
+
});
|
|
271952
272175
|
return integration;
|
|
271953
272176
|
};
|
|
272177
|
+
var StorageFragment = graphql(`
|
|
272178
|
+
fragment Storage on Storage {
|
|
272179
|
+
__typename
|
|
272180
|
+
id
|
|
272181
|
+
uniqueName
|
|
272182
|
+
name
|
|
272183
|
+
status
|
|
272184
|
+
storageProtocol
|
|
272185
|
+
endpoints {
|
|
272186
|
+
id
|
|
272187
|
+
label
|
|
272188
|
+
displayValue
|
|
272189
|
+
}
|
|
272190
|
+
credentials {
|
|
272191
|
+
id
|
|
272192
|
+
label
|
|
272193
|
+
displayValue
|
|
272194
|
+
}
|
|
272195
|
+
}
|
|
272196
|
+
`);
|
|
272197
|
+
var getStorages = graphql(`
|
|
272198
|
+
query GetStorages($applicationUniqueName: String!) {
|
|
272199
|
+
storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272200
|
+
items {
|
|
272201
|
+
...Storage
|
|
272202
|
+
}
|
|
272203
|
+
}
|
|
272204
|
+
}
|
|
272205
|
+
`, [StorageFragment]);
|
|
272206
|
+
var getStorage = graphql(`
|
|
272207
|
+
query GetStorage($uniqueName: String!) {
|
|
272208
|
+
storageByUniqueName(uniqueName: $uniqueName) {
|
|
272209
|
+
...Storage
|
|
272210
|
+
}
|
|
272211
|
+
}
|
|
272212
|
+
`, [StorageFragment]);
|
|
272213
|
+
var createStorage = graphql(`
|
|
272214
|
+
mutation CreateStorage(
|
|
272215
|
+
$applicationId: ID!
|
|
272216
|
+
$name: String!
|
|
272217
|
+
$storageProtocol: StorageProtocol!
|
|
272218
|
+
$provider: String!
|
|
272219
|
+
$region: String!
|
|
272220
|
+
$size: ClusterServiceSize
|
|
272221
|
+
$type: ClusterServiceType
|
|
272222
|
+
) {
|
|
272223
|
+
createStorage(
|
|
272224
|
+
applicationId: $applicationId
|
|
272225
|
+
name: $name
|
|
272226
|
+
storageProtocol: $storageProtocol
|
|
272227
|
+
provider: $provider
|
|
272228
|
+
region: $region
|
|
272229
|
+
size: $size
|
|
272230
|
+
type: $type
|
|
272231
|
+
) {
|
|
272232
|
+
...Storage
|
|
272233
|
+
}
|
|
272234
|
+
}
|
|
272235
|
+
`, [StorageFragment]);
|
|
272236
|
+
var restartStorage = graphql(`
|
|
272237
|
+
mutation RestartStorage($uniqueName: String!) {
|
|
272238
|
+
restartStorageByUniqueName(uniqueName: $uniqueName) {
|
|
272239
|
+
...Storage
|
|
272240
|
+
}
|
|
272241
|
+
}
|
|
272242
|
+
`, [StorageFragment]);
|
|
272243
|
+
var storageList = (gqlClient, options) => {
|
|
272244
|
+
return async (applicationUniqueName) => {
|
|
272245
|
+
const {
|
|
272246
|
+
storagesByUniqueName: { items }
|
|
272247
|
+
} = await gqlClient.request(getStorages, { applicationUniqueName });
|
|
272248
|
+
return items;
|
|
272249
|
+
};
|
|
272250
|
+
};
|
|
272251
|
+
var storageRead = (gqlClient, options) => {
|
|
272252
|
+
return async (storageUniqueName) => {
|
|
272253
|
+
const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });
|
|
272254
|
+
return storage;
|
|
272255
|
+
};
|
|
272256
|
+
};
|
|
272257
|
+
var storageCreate = (gqlClient, options) => {
|
|
272258
|
+
return async (args) => {
|
|
272259
|
+
const { applicationUniqueName, ...otherArgs } = args;
|
|
272260
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272261
|
+
const { createStorage: storage } = await gqlClient.request(createStorage, {
|
|
272262
|
+
...otherArgs,
|
|
272263
|
+
applicationId: application.id
|
|
272264
|
+
});
|
|
272265
|
+
return storage;
|
|
272266
|
+
};
|
|
272267
|
+
};
|
|
272268
|
+
var storageRestart = (gqlClient, _options) => async (storageUniqueName) => {
|
|
272269
|
+
const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {
|
|
272270
|
+
uniqueName: storageUniqueName
|
|
272271
|
+
});
|
|
272272
|
+
return storage;
|
|
272273
|
+
};
|
|
271954
272274
|
var MiddlewareFragment = graphql(`
|
|
271955
272275
|
fragment Middleware on Middleware {
|
|
271956
272276
|
__typename
|
|
271957
272277
|
id
|
|
272278
|
+
uniqueName
|
|
271958
272279
|
name
|
|
271959
272280
|
status
|
|
271960
272281
|
interface
|
|
@@ -271983,488 +272304,195 @@ var MiddlewareFragment = graphql(`
|
|
|
271983
272304
|
}
|
|
271984
272305
|
`);
|
|
271985
272306
|
var getMiddlewares = graphql(`
|
|
271986
|
-
query
|
|
271987
|
-
|
|
271988
|
-
|
|
271989
|
-
|
|
272307
|
+
query GetMiddlewares($applicationUniqueName: String!, $noCache: Boolean = false) {
|
|
272308
|
+
middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272309
|
+
items {
|
|
272310
|
+
...Middleware
|
|
272311
|
+
}
|
|
272312
|
+
}
|
|
271990
272313
|
}
|
|
271991
|
-
|
|
271992
|
-
}`, [MiddlewareFragment]);
|
|
272314
|
+
`, [MiddlewareFragment]);
|
|
271993
272315
|
var getMiddleware = graphql(`
|
|
271994
|
-
query
|
|
271995
|
-
|
|
271996
|
-
|
|
271997
|
-
|
|
271998
|
-
}
|
|
271999
|
-
`, [MiddlewareFragment]);
|
|
272316
|
+
query GetMiddleware($uniqueName: String!, $noCache: Boolean = true) {
|
|
272317
|
+
middlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272318
|
+
...Middleware
|
|
272319
|
+
}
|
|
272320
|
+
}
|
|
272321
|
+
`, [MiddlewareFragment]);
|
|
272000
272322
|
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
|
|
272323
|
+
mutation CreateMiddleware(
|
|
272324
|
+
$applicationId: ID!
|
|
272325
|
+
$name: String!
|
|
272326
|
+
$provider: String!
|
|
272327
|
+
$region: String!
|
|
272328
|
+
$size: ClusterServiceSize
|
|
272329
|
+
$type: ClusterServiceType
|
|
272330
|
+
$interface: MiddlewareType!
|
|
272331
|
+
$storageId: ID
|
|
272332
|
+
$blockchainNodeId: ID
|
|
272333
|
+
$loadBalancerId: ID
|
|
272334
|
+
$abis: [SmartContractPortalMiddlewareAbiInputDto!]
|
|
272335
|
+
$includePredeployedAbis: [String!]
|
|
272336
|
+
$noCache: Boolean = false
|
|
272031
272337
|
) {
|
|
272032
|
-
|
|
272033
|
-
|
|
272034
|
-
|
|
272035
|
-
|
|
272338
|
+
createMiddleware(
|
|
272339
|
+
applicationId: $applicationId
|
|
272340
|
+
name: $name
|
|
272341
|
+
provider: $provider
|
|
272342
|
+
region: $region
|
|
272343
|
+
size: $size
|
|
272344
|
+
type: $type
|
|
272345
|
+
interface: $interface
|
|
272346
|
+
storageId: $storageId
|
|
272347
|
+
blockchainNodeId: $blockchainNodeId
|
|
272348
|
+
loadBalancerId: $loadBalancerId
|
|
272349
|
+
abis: $abis
|
|
272350
|
+
includePredeployedAbis: $includePredeployedAbis
|
|
272351
|
+
) {
|
|
272352
|
+
...Middleware
|
|
272353
|
+
}
|
|
272354
|
+
}
|
|
272355
|
+
`, [MiddlewareFragment]);
|
|
272036
272356
|
var restartMiddleware = graphql(`
|
|
272037
|
-
|
|
272038
|
-
|
|
272039
|
-
|
|
272357
|
+
mutation RestartMiddleware($uniqueName: String!, $noCache: Boolean = false) {
|
|
272358
|
+
restartMiddlewareByUniqueName(uniqueName: $uniqueName) {
|
|
272359
|
+
...Middleware
|
|
272360
|
+
}
|
|
272040
272361
|
}
|
|
272041
|
-
|
|
272042
|
-
`, [MiddlewareFragment]);
|
|
272362
|
+
`, [MiddlewareFragment]);
|
|
272043
272363
|
var middlewareList = (gqlClient, options) => {
|
|
272044
|
-
return async (
|
|
272045
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272364
|
+
return async (applicationUniqueName) => {
|
|
272046
272365
|
const {
|
|
272047
|
-
|
|
272048
|
-
} = await gqlClient.request(getMiddlewares, {
|
|
272366
|
+
middlewaresByUniqueName: { items }
|
|
272367
|
+
} = await gqlClient.request(getMiddlewares, { applicationUniqueName });
|
|
272049
272368
|
return items;
|
|
272050
272369
|
};
|
|
272051
272370
|
};
|
|
272052
272371
|
var middlewareRead = (gqlClient, options) => {
|
|
272053
|
-
return async (
|
|
272054
|
-
const
|
|
272055
|
-
|
|
272372
|
+
return async (middlewareUniqueName) => {
|
|
272373
|
+
const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {
|
|
272374
|
+
uniqueName: middlewareUniqueName
|
|
272375
|
+
});
|
|
272056
272376
|
return middleware;
|
|
272057
272377
|
};
|
|
272058
272378
|
};
|
|
272059
272379
|
var middlewareCreate = (gqlClient, options) => {
|
|
272060
272380
|
return async (args) => {
|
|
272061
|
-
|
|
272062
|
-
const
|
|
272381
|
+
const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } = args;
|
|
272382
|
+
const [application, blockchainNode, loadBalancer, storage] = await Promise.all([
|
|
272383
|
+
applicationRead(gqlClient, options)(applicationUniqueName),
|
|
272384
|
+
blockchainNodeUniqueName ? blockchainNodeRead(gqlClient, options)(blockchainNodeUniqueName) : Promise.resolve(undefined),
|
|
272385
|
+
loadBalancerUniqueName ? loadBalancerRead(gqlClient, options)(loadBalancerUniqueName) : Promise.resolve(undefined),
|
|
272386
|
+
storageUniqueName ? storageRead(gqlClient, options)(storageUniqueName) : Promise.resolve(undefined)
|
|
272387
|
+
]);
|
|
272388
|
+
const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {
|
|
272389
|
+
...otherArgs,
|
|
272390
|
+
applicationId: application.id,
|
|
272391
|
+
blockchainNodeId: blockchainNode?.id,
|
|
272392
|
+
loadBalancerId: loadBalancer?.id,
|
|
272393
|
+
storageId: storage?.id
|
|
272394
|
+
});
|
|
272063
272395
|
return middleware;
|
|
272064
272396
|
};
|
|
272065
272397
|
};
|
|
272066
|
-
var middlewareRestart = (gqlClient, _options) => async (
|
|
272067
|
-
const
|
|
272068
|
-
|
|
272398
|
+
var middlewareRestart = (gqlClient, _options) => async (middlewareUniqueName) => {
|
|
272399
|
+
const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {
|
|
272400
|
+
uniqueName: middlewareUniqueName
|
|
272401
|
+
});
|
|
272069
272402
|
return middleware;
|
|
272070
272403
|
};
|
|
272071
272404
|
var PrivateKeyFragment = graphql(`
|
|
272072
272405
|
fragment PrivateKey on PrivateKey {
|
|
272073
272406
|
__typename
|
|
272074
272407
|
id
|
|
272075
|
-
name
|
|
272076
272408
|
uniqueName
|
|
272409
|
+
name
|
|
272077
272410
|
privateKeyType
|
|
272078
272411
|
status
|
|
272079
272412
|
}
|
|
272080
272413
|
`);
|
|
272081
272414
|
var getPrivateKeys = graphql(`
|
|
272082
|
-
query
|
|
272083
|
-
|
|
272084
|
-
|
|
272085
|
-
|
|
272415
|
+
query GetPrivateKeys($applicationUniqueName: String!) {
|
|
272416
|
+
privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {
|
|
272417
|
+
items {
|
|
272418
|
+
...PrivateKey
|
|
272419
|
+
}
|
|
272420
|
+
}
|
|
272086
272421
|
}
|
|
272087
|
-
|
|
272088
|
-
}`, [PrivateKeyFragment]);
|
|
272422
|
+
`, [PrivateKeyFragment]);
|
|
272089
272423
|
var getPrivateKey = graphql(`
|
|
272090
|
-
query
|
|
272091
|
-
|
|
272092
|
-
|
|
272093
|
-
|
|
272094
|
-
}
|
|
272095
|
-
`, [PrivateKeyFragment]);
|
|
272424
|
+
query GetPrivateKey($uniqueName: String!) {
|
|
272425
|
+
privateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
272426
|
+
...PrivateKey
|
|
272427
|
+
}
|
|
272428
|
+
}
|
|
272429
|
+
`, [PrivateKeyFragment]);
|
|
272096
272430
|
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
|
|
272431
|
+
mutation CreatePrivateKey(
|
|
272432
|
+
$applicationId: ID!
|
|
272433
|
+
$name: String!
|
|
272434
|
+
$privateKeyType: PrivateKeyType!
|
|
272435
|
+
$provider: String!
|
|
272436
|
+
$region: String!
|
|
272437
|
+
$size: ClusterServiceSize
|
|
272438
|
+
$type: ClusterServiceType
|
|
272439
|
+
$blockchainNodes: [ID!]
|
|
272116
272440
|
) {
|
|
272117
|
-
|
|
272118
|
-
|
|
272119
|
-
|
|
272120
|
-
|
|
272441
|
+
createPrivateKey(
|
|
272442
|
+
applicationId: $applicationId
|
|
272443
|
+
name: $name
|
|
272444
|
+
privateKeyType: $privateKeyType
|
|
272445
|
+
provider: $provider
|
|
272446
|
+
region: $region
|
|
272447
|
+
size: $size
|
|
272448
|
+
type: $type
|
|
272449
|
+
blockchainNodes: $blockchainNodes
|
|
272450
|
+
) {
|
|
272451
|
+
...PrivateKey
|
|
272452
|
+
}
|
|
272453
|
+
}
|
|
272454
|
+
`, [PrivateKeyFragment]);
|
|
272121
272455
|
var restartPrivateKey = graphql(`
|
|
272122
|
-
|
|
272123
|
-
|
|
272124
|
-
|
|
272456
|
+
mutation RestartPrivateKey($uniqueName: String!) {
|
|
272457
|
+
restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {
|
|
272458
|
+
...PrivateKey
|
|
272459
|
+
}
|
|
272125
272460
|
}
|
|
272126
|
-
|
|
272127
|
-
`, [PrivateKeyFragment]);
|
|
272461
|
+
`, [PrivateKeyFragment]);
|
|
272128
272462
|
var privateKeyList = (gqlClient, options) => {
|
|
272129
|
-
return async (
|
|
272130
|
-
const id = validate3(IdSchema3, applicationId);
|
|
272463
|
+
return async (applicationUniqueName) => {
|
|
272131
272464
|
const {
|
|
272132
|
-
|
|
272133
|
-
} = await gqlClient.request(getPrivateKeys, {
|
|
272465
|
+
privateKeysByUniqueName: { items }
|
|
272466
|
+
} = await gqlClient.request(getPrivateKeys, { applicationUniqueName });
|
|
272134
272467
|
return items;
|
|
272135
272468
|
};
|
|
272136
272469
|
};
|
|
272137
272470
|
var privatekeyRead = (gqlClient, options) => {
|
|
272138
|
-
return async (
|
|
272139
|
-
const
|
|
272140
|
-
|
|
272471
|
+
return async (privateKeyUniqueName) => {
|
|
272472
|
+
const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {
|
|
272473
|
+
uniqueName: privateKeyUniqueName
|
|
272474
|
+
});
|
|
272141
272475
|
return privateKey;
|
|
272142
272476
|
};
|
|
272143
272477
|
};
|
|
272144
272478
|
var privateKeyCreate = (gqlClient, options) => {
|
|
272145
272479
|
return async (args) => {
|
|
272146
|
-
|
|
272147
|
-
const
|
|
272480
|
+
const { applicationUniqueName, blockchainNodeUniqueNames, ...otherArgs } = args;
|
|
272481
|
+
const application = await applicationRead(gqlClient, options)(applicationUniqueName);
|
|
272482
|
+
const blockchainNodes = blockchainNodeUniqueNames ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient, options)(uniqueName))) : [];
|
|
272483
|
+
const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {
|
|
272484
|
+
...otherArgs,
|
|
272485
|
+
applicationId: application.id,
|
|
272486
|
+
blockchainNodes: blockchainNodes.map((node) => node?.id)
|
|
272487
|
+
});
|
|
272148
272488
|
return privateKey;
|
|
272149
272489
|
};
|
|
272150
272490
|
};
|
|
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
|
|
272491
|
+
var privateKeyRestart = (gqlClient, _options) => async (privateKeyUniqueName) => {
|
|
272492
|
+
const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {
|
|
272493
|
+
uniqueName: privateKeyUniqueName
|
|
272250
272494
|
});
|
|
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
|
-
};
|
|
272495
|
+
return privateKey;
|
|
272468
272496
|
};
|
|
272469
272497
|
var ClientOptionsSchema = z3.object({
|
|
272470
272498
|
accessToken: AccessTokenSchema3,
|
|
@@ -272567,12 +272595,6 @@ function createSettleMintClient(options) {
|
|
|
272567
272595
|
update: customdeploymentUpdate(gqlClient, options),
|
|
272568
272596
|
restart: customDeploymentRestart(gqlClient, options)
|
|
272569
272597
|
},
|
|
272570
|
-
smartContractSet: {
|
|
272571
|
-
list: smartContractSetList(gqlClient, options),
|
|
272572
|
-
read: smartContractSetRead(gqlClient, options),
|
|
272573
|
-
create: smartContractSetCreate(gqlClient, options),
|
|
272574
|
-
restart: smartContractSetRestart(gqlClient, options)
|
|
272575
|
-
},
|
|
272576
272598
|
foundry: {
|
|
272577
272599
|
env: getEnv(gqlClient, options)
|
|
272578
272600
|
},
|
|
@@ -272777,7 +272799,7 @@ async function applicationAccessTokenPrompt(env2, application, settlemint, accep
|
|
|
272777
272799
|
}
|
|
272778
272800
|
});
|
|
272779
272801
|
const aat = await settlemint.applicationAccessToken.create({
|
|
272780
|
-
|
|
272802
|
+
applicationUniqueName: application.uniqueName,
|
|
272781
272803
|
name: name2,
|
|
272782
272804
|
blockchainNetworkScope: {
|
|
272783
272805
|
type: "ALL",
|
|
@@ -273233,23 +273255,23 @@ function connectCommand() {
|
|
|
273233
273255
|
await writeEnvSpinner(!!prod, {
|
|
273234
273256
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273235
273257
|
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?.
|
|
273258
|
+
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
273259
|
+
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
273260
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
273261
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName,
|
|
273262
|
+
SETTLEMINT_HASURA: hasura?.uniqueName,
|
|
273241
273263
|
...getHasuraEndpoints(hasura),
|
|
273242
|
-
SETTLEMINT_THEGRAPH: thegraph?.
|
|
273264
|
+
SETTLEMINT_THEGRAPH: thegraph?.uniqueName,
|
|
273243
273265
|
...await getGraphEndpoint(thegraph, env2),
|
|
273244
273266
|
...getPortalEndpoints(portal),
|
|
273245
273267
|
SETTLEMINT_HD_PRIVATE_KEY: hdPrivateKey?.uniqueName,
|
|
273246
|
-
SETTLEMINT_MINIO: minio?.
|
|
273268
|
+
SETTLEMINT_MINIO: minio?.uniqueName,
|
|
273247
273269
|
...getMinioEndpoints(minio),
|
|
273248
|
-
SETTLEMINT_IPFS: ipfs?.
|
|
273270
|
+
SETTLEMINT_IPFS: ipfs?.uniqueName,
|
|
273249
273271
|
...getIpfsEndpoints(ipfs),
|
|
273250
|
-
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.
|
|
273272
|
+
SETTLEMINT_CUSTOM_DEPLOYMENT: cDeployment?.uniqueName,
|
|
273251
273273
|
SETTLEMINT_CUSTOM_DEPLOYMENT_ENDPOINT: cDeployment?.endpoints.find((endpoint) => endpoint.id.includes("internal"))?.displayValue,
|
|
273252
|
-
SETTLEMINT_BLOCKSCOUT: blockscout?.
|
|
273274
|
+
SETTLEMINT_BLOCKSCOUT: blockscout?.uniqueName,
|
|
273253
273275
|
...getBlockscoutEndpoints(blockscout)
|
|
273254
273276
|
});
|
|
273255
273277
|
outro("Connected to SettleMint");
|
|
@@ -273259,7 +273281,7 @@ function connectCommand() {
|
|
|
273259
273281
|
var package_default = {
|
|
273260
273282
|
name: "@settlemint/sdk-cli",
|
|
273261
273283
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273262
|
-
version: "0.7.0-
|
|
273284
|
+
version: "0.7.0-pr24cdbac",
|
|
273263
273285
|
type: "module",
|
|
273264
273286
|
private: false,
|
|
273265
273287
|
license: "FSL-1.1-MIT",
|
|
@@ -273310,8 +273332,8 @@ var package_default = {
|
|
|
273310
273332
|
"@inquirer/input": "4.1.0",
|
|
273311
273333
|
"@inquirer/password": "4.0.3",
|
|
273312
273334
|
"@inquirer/select": "4.0.3",
|
|
273313
|
-
"@settlemint/sdk-js": "0.7.0-
|
|
273314
|
-
"@settlemint/sdk-utils": "0.7.0-
|
|
273335
|
+
"@settlemint/sdk-js": "0.7.0-pr24cdbac",
|
|
273336
|
+
"@settlemint/sdk-utils": "0.7.0-pr24cdbac",
|
|
273315
273337
|
"get-tsconfig": "4.8.1",
|
|
273316
273338
|
giget: "1.2.3"
|
|
273317
273339
|
},
|
|
@@ -274308,7 +274330,6 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
|
274308
274330
|
"blockchain node": "blockchainNode",
|
|
274309
274331
|
"custom deployment": "customDeployment",
|
|
274310
274332
|
"private key": "privateKey",
|
|
274311
|
-
"smart contract set": "smartContractSet",
|
|
274312
274333
|
middleware: "middleware",
|
|
274313
274334
|
"integration tool": "integrationTool",
|
|
274314
274335
|
storage: "storage",
|
|
@@ -274320,7 +274341,7 @@ var SETTLEMINT_CLIENT_MAP = {
|
|
|
274320
274341
|
async function waitForCompletion({
|
|
274321
274342
|
settlemint,
|
|
274322
274343
|
type: type4,
|
|
274323
|
-
|
|
274344
|
+
uniqueName,
|
|
274324
274345
|
action,
|
|
274325
274346
|
maxTimeout = 15 * 60 * 1000
|
|
274326
274347
|
}) {
|
|
@@ -274339,7 +274360,7 @@ async function waitForCompletion({
|
|
|
274339
274360
|
const startTime = Date.now();
|
|
274340
274361
|
while (true) {
|
|
274341
274362
|
try {
|
|
274342
|
-
const resource = await service.read(
|
|
274363
|
+
const resource = await service.read(uniqueName);
|
|
274343
274364
|
if (resource.status === "COMPLETED") {
|
|
274344
274365
|
note(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
|
|
274345
274366
|
return true;
|
|
@@ -274353,7 +274374,7 @@ async function waitForCompletion({
|
|
|
274353
274374
|
note(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
|
|
274354
274375
|
}
|
|
274355
274376
|
if (Date.now() - startTime > maxTimeout) {
|
|
274356
|
-
throw new Error(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with
|
|
274377
|
+
throw new Error(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
|
|
274357
274378
|
}
|
|
274358
274379
|
await new Promise((resolve6) => setTimeout(resolve6, 5000));
|
|
274359
274380
|
}
|
|
@@ -274390,7 +274411,7 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274390
274411
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274391
274412
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274392
274413
|
const env2 = await loadEnv2(false, !!prod);
|
|
274393
|
-
const instance =
|
|
274414
|
+
const instance = await instancePrompt(env2, autoAccept);
|
|
274394
274415
|
const accessToken = usePersonalAccessToken ? (await getInstanceCredentials(instance))?.personalAccessToken : env2.SETTLEMINT_ACCESS_TOKEN;
|
|
274395
274416
|
if (!accessToken) {
|
|
274396
274417
|
return missingAccessTokenError();
|
|
@@ -274410,7 +274431,7 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274410
274431
|
await waitForCompletion({
|
|
274411
274432
|
settlemint,
|
|
274412
274433
|
type: waitFor?.resourceType ?? type4,
|
|
274413
|
-
|
|
274434
|
+
uniqueName: waitFor?.uniqueName ?? result.uniqueName,
|
|
274414
274435
|
action: "deploy"
|
|
274415
274436
|
});
|
|
274416
274437
|
if (waitFor) {
|
|
@@ -274430,10 +274451,10 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274430
274451
|
...updatedEnv
|
|
274431
274452
|
};
|
|
274432
274453
|
if (isApplicationChanged && updatedEnv.SETTLEMINT_APPLICATION) {
|
|
274433
|
-
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.
|
|
274454
|
+
newEnv.SETTLEMINT_WORKSPACE = (await settlemint.application.read(updatedEnv.SETTLEMINT_APPLICATION)).workspace.uniqueName;
|
|
274434
274455
|
}
|
|
274435
274456
|
if (newEnv.SETTLEMINT_BLOCKCHAIN_NODE && newEnv.SETTLEMINT_BLOCKCHAIN_NODE !== env2.SETTLEMINT_BLOCKCHAIN_NODE) {
|
|
274436
|
-
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.
|
|
274457
|
+
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.uniqueName;
|
|
274437
274458
|
}
|
|
274438
274459
|
await writeEnvSpinner(!!prod, newEnv);
|
|
274439
274460
|
note(`${capitalizeFirstLetter(type4)} ${result.name} set as default`);
|
|
@@ -274450,8 +274471,8 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274450
274471
|
type: "blockchain network",
|
|
274451
274472
|
alias: "b",
|
|
274452
274473
|
execute: (cmd2, baseAction) => {
|
|
274453
|
-
addClusterServiceArgs(cmd2).option("-a, --application
|
|
274454
|
-
|
|
274474
|
+
addClusterServiceArgs(cmd2).option("-a, --application <uniqueName>", "The unique name of the application to create the network in (defaults to application from env)").requiredOption("--node-name <name>", "Name of the node").option("--chain-id <chainId>", "The chain ID for the network", parseNumber).option("--contract-size-limit <limit>", "Maximum contract size limit", parseNumber).option("--evm-stack-size <size>", "EVM stack size", parseNumber).option("--gas-limit <limit>", "Block gas limit").option("--gas-price <price>", "Gas price in wei", parseNumber).option("--seconds-per-block <seconds>", "Block time in seconds", parseNumber).action(async (name2, {
|
|
274475
|
+
application,
|
|
274455
274476
|
chainId,
|
|
274456
274477
|
contractSizeLimit,
|
|
274457
274478
|
evmStackSize,
|
|
@@ -274466,10 +274487,10 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274466
274487
|
...defaultArgs
|
|
274467
274488
|
}) => {
|
|
274468
274489
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274469
|
-
const
|
|
274490
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274470
274491
|
const result = await settlemint.blockchainNetwork.create({
|
|
274471
274492
|
name: name2,
|
|
274472
|
-
|
|
274493
|
+
applicationUniqueName,
|
|
274473
274494
|
nodeName,
|
|
274474
274495
|
consensusAlgorithm: "BESU_QBFT",
|
|
274475
274496
|
chainId,
|
|
@@ -274493,8 +274514,8 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274493
274514
|
mapDefaultEnv: () => {
|
|
274494
274515
|
return {
|
|
274495
274516
|
SETTLEMINT_APPLICATION: application,
|
|
274496
|
-
SETTLEMINT_BLOCKCHAIN_NETWORK: result.
|
|
274497
|
-
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.
|
|
274517
|
+
SETTLEMINT_BLOCKCHAIN_NETWORK: result.uniqueName,
|
|
274518
|
+
SETTLEMINT_BLOCKCHAIN_NODE: blockchainNode?.uniqueName
|
|
274498
274519
|
};
|
|
274499
274520
|
}
|
|
274500
274521
|
};
|
|
@@ -274508,7 +274529,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274508
274529
|
},
|
|
274509
274530
|
{
|
|
274510
274531
|
description: "Create a Besu blockchain network in a different application",
|
|
274511
|
-
command: "platform create blockchain-network besu my-network --application-
|
|
274532
|
+
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"
|
|
274512
274533
|
}
|
|
274513
274534
|
]
|
|
274514
274535
|
});
|
|
@@ -274516,7 +274537,7 @@ function blockchainNetworkBesuCreateCommand() {
|
|
|
274516
274537
|
|
|
274517
274538
|
// src/commands/platform/blockchain-network/create.ts
|
|
274518
274539
|
function blockchainNetworkCreateCommand() {
|
|
274519
|
-
return new Command2("blockchain-network").alias("
|
|
274540
|
+
return new Command2("blockchain-network").alias("bn").description("Create a blockchain network in the SettleMint platform").addCommand(blockchainNetworkBesuCreateCommand());
|
|
274520
274541
|
}
|
|
274521
274542
|
|
|
274522
274543
|
// src/commands/platform/workspace/create.ts
|
|
@@ -274639,7 +274660,7 @@ function workspaceCreateCommand() {
|
|
|
274639
274660
|
result,
|
|
274640
274661
|
mapDefaultEnv: () => {
|
|
274641
274662
|
return {
|
|
274642
|
-
SETTLEMINT_WORKSPACE: result.
|
|
274663
|
+
SETTLEMINT_WORKSPACE: result.uniqueName
|
|
274643
274664
|
};
|
|
274644
274665
|
}
|
|
274645
274666
|
};
|
|
@@ -274670,10 +274691,11 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274670
274691
|
type: "application access token",
|
|
274671
274692
|
alias: "aat",
|
|
274672
274693
|
execute: (cmd2, baseAction) => {
|
|
274673
|
-
cmd2.option("-a, --application
|
|
274694
|
+
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 }) => {
|
|
274674
274695
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274696
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274675
274697
|
const aatToken = await settlemint.applicationAccessToken.create({
|
|
274676
|
-
|
|
274698
|
+
applicationUniqueName,
|
|
274677
274699
|
name: name2,
|
|
274678
274700
|
blockchainNetworkScope: {
|
|
274679
274701
|
type: "ALL",
|
|
@@ -274720,7 +274742,8 @@ function applicationAccessTokenCreateCommand() {
|
|
|
274720
274742
|
return {
|
|
274721
274743
|
result: {
|
|
274722
274744
|
id: "",
|
|
274723
|
-
name: name2
|
|
274745
|
+
name: name2,
|
|
274746
|
+
uniqueName: ""
|
|
274724
274747
|
},
|
|
274725
274748
|
mapDefaultEnv: () => ({
|
|
274726
274749
|
SETTLEMINT_ACCESS_TOKEN: aatToken
|
|
@@ -274753,18 +274776,17 @@ function applicationCreateCommand() {
|
|
|
274753
274776
|
type: "application",
|
|
274754
274777
|
alias: "a",
|
|
274755
274778
|
execute: (cmd2, baseAction) => {
|
|
274756
|
-
cmd2.option("-w, --workspace
|
|
274779
|
+
cmd2.option("-w, --workspace <workspace>", "The workspace unique name to create the application in (defaults to workspace from env)").action(async (name2, { workspace, ...defaultArgs }) => {
|
|
274757
274780
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274758
|
-
const workspace = workspaceId ?? env2.SETTLEMINT_WORKSPACE;
|
|
274759
274781
|
const result = await settlemint.application.create({
|
|
274760
274782
|
name: name2,
|
|
274761
|
-
|
|
274783
|
+
workspaceUniqueName: workspace ?? env2.SETTLEMINT_WORKSPACE
|
|
274762
274784
|
});
|
|
274763
274785
|
return {
|
|
274764
274786
|
result,
|
|
274765
274787
|
mapDefaultEnv: () => {
|
|
274766
274788
|
return {
|
|
274767
|
-
SETTLEMINT_APPLICATION: result.
|
|
274789
|
+
SETTLEMINT_APPLICATION: result.uniqueName
|
|
274768
274790
|
};
|
|
274769
274791
|
}
|
|
274770
274792
|
};
|
|
@@ -274782,117 +274804,12 @@ function applicationCreateCommand() {
|
|
|
274782
274804
|
},
|
|
274783
274805
|
{
|
|
274784
274806
|
description: "Create an application in a specific workspace",
|
|
274785
|
-
command: "platform create application my-app --workspace-
|
|
274807
|
+
command: "platform create application my-app --workspace my-workspace"
|
|
274786
274808
|
}
|
|
274787
274809
|
]
|
|
274788
274810
|
});
|
|
274789
274811
|
}
|
|
274790
274812
|
|
|
274791
|
-
// src/commands/connect/blockchain-network.prompt.ts
|
|
274792
|
-
async function blockchainNetworkPrompt(env2, networks, accept) {
|
|
274793
|
-
if (networks.length === 0) {
|
|
274794
|
-
return;
|
|
274795
|
-
}
|
|
274796
|
-
const defaultNetwork = networks.find((network2) => network2.id === env2.SETTLEMINT_BLOCKCHAIN_NETWORK) ?? (networks.length === 1 ? networks[0] : undefined);
|
|
274797
|
-
const defaultPossible = accept;
|
|
274798
|
-
if (defaultPossible) {
|
|
274799
|
-
return defaultNetwork;
|
|
274800
|
-
}
|
|
274801
|
-
const network = await esm_default2({
|
|
274802
|
-
message: "Which blockchain network do you want to connect to?",
|
|
274803
|
-
choices: [
|
|
274804
|
-
...networks.map((network2) => ({
|
|
274805
|
-
name: network2.name,
|
|
274806
|
-
value: network2
|
|
274807
|
-
})),
|
|
274808
|
-
{
|
|
274809
|
-
name: "None",
|
|
274810
|
-
value: undefined
|
|
274811
|
-
}
|
|
274812
|
-
],
|
|
274813
|
-
default: defaultNetwork
|
|
274814
|
-
});
|
|
274815
|
-
return network;
|
|
274816
|
-
}
|
|
274817
|
-
|
|
274818
|
-
// src/commands/platform/blockchain-node/besu/create.ts
|
|
274819
|
-
function blockchainNodeBesuCreateCommand() {
|
|
274820
|
-
return getCreateCommand({
|
|
274821
|
-
name: "besu",
|
|
274822
|
-
type: "blockchain node",
|
|
274823
|
-
alias: "b",
|
|
274824
|
-
execute: (cmd2, baseAction) => {
|
|
274825
|
-
addClusterServiceArgs(cmd2).option("-a, --application-id <applicationId>", "The application ID to create the node in (defaults to application from env)").option("--blockchain-network-id <blockchainNetworkId>", "Blockchain network to add this node to").option("--node-identity <nodeIdentity>", "EC DSA P256 private key to use as the node identity").addOption(new Option("--node-type <nodeType>", "Type of the node").choices(["VALIDATOR", "NON_VALIDATOR", "NOTARY", "ORDERER", "PEER", "UNSPECIFIED"]).makeOptionMandatory()).action(async (name2, {
|
|
274826
|
-
applicationId,
|
|
274827
|
-
provider,
|
|
274828
|
-
region,
|
|
274829
|
-
size,
|
|
274830
|
-
type: type4,
|
|
274831
|
-
blockchainNetworkId,
|
|
274832
|
-
nodeType,
|
|
274833
|
-
nodeIdentity,
|
|
274834
|
-
acceptDefaults,
|
|
274835
|
-
...defaultArgs
|
|
274836
|
-
}) => {
|
|
274837
|
-
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274838
|
-
const application = applicationId ?? env2.SETTLEMINT_APPLICATION;
|
|
274839
|
-
if (!application) {
|
|
274840
|
-
cancel2("No application found");
|
|
274841
|
-
}
|
|
274842
|
-
let networkId = blockchainNetworkId ?? (acceptDefaults ? env2.SETTLEMINT_BLOCKCHAIN_NETWORK : undefined);
|
|
274843
|
-
if (!networkId) {
|
|
274844
|
-
const networks = await settlemint.blockchainNetwork.list(application);
|
|
274845
|
-
const network = await blockchainNetworkPrompt(env2, networks, acceptDefaults ?? false);
|
|
274846
|
-
if (!network) {
|
|
274847
|
-
cancel2("No network found");
|
|
274848
|
-
}
|
|
274849
|
-
networkId = network?.id;
|
|
274850
|
-
}
|
|
274851
|
-
const result = await settlemint.blockchainNode.create({
|
|
274852
|
-
applicationId: application,
|
|
274853
|
-
name: name2,
|
|
274854
|
-
blockchainNetworkId: networkId,
|
|
274855
|
-
nodeType,
|
|
274856
|
-
keyMaterial: nodeIdentity,
|
|
274857
|
-
provider,
|
|
274858
|
-
region,
|
|
274859
|
-
size,
|
|
274860
|
-
type: type4
|
|
274861
|
-
});
|
|
274862
|
-
return {
|
|
274863
|
-
result,
|
|
274864
|
-
mapDefaultEnv: () => {
|
|
274865
|
-
return {
|
|
274866
|
-
SETTLEMINT_APPLICATION: application,
|
|
274867
|
-
SETTLEMINT_BLOCKCHAIN_NODE: result.id
|
|
274868
|
-
};
|
|
274869
|
-
}
|
|
274870
|
-
};
|
|
274871
|
-
});
|
|
274872
|
-
});
|
|
274873
|
-
},
|
|
274874
|
-
examples: [
|
|
274875
|
-
{
|
|
274876
|
-
description: "Create a Besu blockchain node and save as default",
|
|
274877
|
-
command: "platform create blockchain-node besu my-node --node-type validator --accept-defaults -d"
|
|
274878
|
-
},
|
|
274879
|
-
{
|
|
274880
|
-
description: "Create a Besu blockchain node in a different network",
|
|
274881
|
-
command: "platform create blockchain-node besu my-node --blockchain-network-id 12345 --node-type non-validator --accept-defaults"
|
|
274882
|
-
},
|
|
274883
|
-
{
|
|
274884
|
-
description: "Create a Besu blockchain node in a different application",
|
|
274885
|
-
command: "platform create blockchain-node besu my-node --application-id 123456789 --node-type non-validator --accept-defaults"
|
|
274886
|
-
}
|
|
274887
|
-
]
|
|
274888
|
-
});
|
|
274889
|
-
}
|
|
274890
|
-
|
|
274891
|
-
// src/commands/platform/blockchain-node/create.ts
|
|
274892
|
-
function blockchainNodeCreateCommand() {
|
|
274893
|
-
return new Command2("blockchain-node").alias("bn").description("Create a blockchain node in the SettleMint platform").addCommand(blockchainNodeBesuCreateCommand());
|
|
274894
|
-
}
|
|
274895
|
-
|
|
274896
274813
|
// src/commands/platform/insights/blockscout/create.ts
|
|
274897
274814
|
function blockscoutInsightsCreateCommand() {
|
|
274898
274815
|
return getCreateCommand({
|
|
@@ -274900,28 +274817,28 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274900
274817
|
type: "insights",
|
|
274901
274818
|
alias: "bs",
|
|
274902
274819
|
execute: (cmd2, baseAction) => {
|
|
274903
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
274820
|
+
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 }) => {
|
|
274904
274821
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274905
|
-
const
|
|
274906
|
-
const
|
|
274907
|
-
const
|
|
274822
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274823
|
+
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274824
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
274908
274825
|
const result = await settlemint.insights.create({
|
|
274909
274826
|
name: name2,
|
|
274910
|
-
|
|
274827
|
+
applicationUniqueName,
|
|
274911
274828
|
insightsCategory: "BLOCKCHAIN_EXPLORER",
|
|
274912
274829
|
provider,
|
|
274913
274830
|
region,
|
|
274914
274831
|
size,
|
|
274915
274832
|
type: type4,
|
|
274916
|
-
|
|
274917
|
-
|
|
274833
|
+
blockchainNodeUniqueName,
|
|
274834
|
+
loadBalancerUniqueName
|
|
274918
274835
|
});
|
|
274919
274836
|
return {
|
|
274920
274837
|
result,
|
|
274921
274838
|
mapDefaultEnv: async () => {
|
|
274922
274839
|
return {
|
|
274923
274840
|
SETTLEMINT_APPLICATION: application,
|
|
274924
|
-
SETTLEMINT_BLOCKSCOUT: result.
|
|
274841
|
+
SETTLEMINT_BLOCKSCOUT: result.uniqueName,
|
|
274925
274842
|
...getBlockscoutEndpoints(result)
|
|
274926
274843
|
};
|
|
274927
274844
|
}
|
|
@@ -274936,7 +274853,7 @@ function blockscoutInsightsCreateCommand() {
|
|
|
274936
274853
|
},
|
|
274937
274854
|
{
|
|
274938
274855
|
description: "Create a Blockscout insights service in a different application",
|
|
274939
|
-
command: "platform create insights blockscout my-blockscout --application-
|
|
274856
|
+
command: "platform create insights blockscout my-blockscout --application app-123"
|
|
274940
274857
|
}
|
|
274941
274858
|
]
|
|
274942
274859
|
});
|
|
@@ -274956,12 +274873,12 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274956
274873
|
type: "integration tool",
|
|
274957
274874
|
alias: "ha",
|
|
274958
274875
|
execute: (cmd2, baseAction) => {
|
|
274959
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
274876
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
274960
274877
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
274961
|
-
const
|
|
274878
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274962
274879
|
const result = await settlemint.integrationTool.create({
|
|
274963
274880
|
name: name2,
|
|
274964
|
-
|
|
274881
|
+
applicationUniqueName,
|
|
274965
274882
|
integrationType: "HASURA",
|
|
274966
274883
|
provider,
|
|
274967
274884
|
region,
|
|
@@ -274973,7 +274890,7 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274973
274890
|
mapDefaultEnv: async () => {
|
|
274974
274891
|
return {
|
|
274975
274892
|
SETTLEMINT_APPLICATION: application,
|
|
274976
|
-
SETTLEMINT_HASURA: result.
|
|
274893
|
+
SETTLEMINT_HASURA: result.uniqueName,
|
|
274977
274894
|
...getHasuraEndpoints(result)
|
|
274978
274895
|
};
|
|
274979
274896
|
}
|
|
@@ -274988,7 +274905,7 @@ function hasuraIntegrationCreateCommand() {
|
|
|
274988
274905
|
},
|
|
274989
274906
|
{
|
|
274990
274907
|
description: "Create a Hasura integration in a different application",
|
|
274991
|
-
command: "platform create integration-tool hasura my-hasura --application-
|
|
274908
|
+
command: "platform create integration-tool hasura my-hasura --application app-123"
|
|
274992
274909
|
}
|
|
274993
274910
|
]
|
|
274994
274911
|
});
|
|
@@ -275008,15 +274925,15 @@ function graphMiddlewareCreateCommand() {
|
|
|
275008
274925
|
type: "middleware",
|
|
275009
274926
|
alias: "gr",
|
|
275010
274927
|
execute: (cmd2, baseAction) => {
|
|
275011
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
274928
|
+
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 }) => {
|
|
275012
274929
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275013
|
-
const
|
|
275014
|
-
const
|
|
274930
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274931
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275015
274932
|
const result = await settlemint.middleware.create({
|
|
275016
274933
|
name: name2,
|
|
275017
|
-
|
|
274934
|
+
applicationUniqueName,
|
|
275018
274935
|
interface: "HA_GRAPH",
|
|
275019
|
-
|
|
274936
|
+
blockchainNodeUniqueName,
|
|
275020
274937
|
provider,
|
|
275021
274938
|
region,
|
|
275022
274939
|
size,
|
|
@@ -275028,7 +274945,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275028
274945
|
const resource = await settlemint.middleware.read(result.id);
|
|
275029
274946
|
return {
|
|
275030
274947
|
SETTLEMINT_APPLICATION: application,
|
|
275031
|
-
SETTLEMINT_THEGRAPH: result.
|
|
274948
|
+
SETTLEMINT_THEGRAPH: result.uniqueName,
|
|
275032
274949
|
...await getGraphEndpoint(resource, env2)
|
|
275033
274950
|
};
|
|
275034
274951
|
}
|
|
@@ -275043,7 +274960,7 @@ function graphMiddlewareCreateCommand() {
|
|
|
275043
274960
|
},
|
|
275044
274961
|
{
|
|
275045
274962
|
description: "Create a graph middleware in a different application",
|
|
275046
|
-
command: "platform create middleware graph my-graph --application-
|
|
274963
|
+
command: "platform create middleware graph my-graph --application my-app --blockchain-node node-123"
|
|
275047
274964
|
}
|
|
275048
274965
|
]
|
|
275049
274966
|
});
|
|
@@ -275057,16 +274974,16 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275057
274974
|
type: "middleware",
|
|
275058
274975
|
alias: "scp",
|
|
275059
274976
|
execute: (cmd2, baseAction) => {
|
|
275060
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
274977
|
+
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([
|
|
275061
274978
|
"StarterKitERC20Registry",
|
|
275062
274979
|
"StarterKitERC20Factory",
|
|
275063
274980
|
"StarterKitERC20",
|
|
275064
274981
|
"StarterKitERC20DexFactory",
|
|
275065
274982
|
"StarterKitERC20Dex"
|
|
275066
274983
|
])).action(async (name2, {
|
|
275067
|
-
|
|
275068
|
-
|
|
275069
|
-
|
|
274984
|
+
application,
|
|
274985
|
+
blockchainNode,
|
|
274986
|
+
loadBalancer,
|
|
275070
274987
|
provider,
|
|
275071
274988
|
region,
|
|
275072
274989
|
size,
|
|
@@ -275076,9 +274993,9 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275076
274993
|
...defaultArgs
|
|
275077
274994
|
}) => {
|
|
275078
274995
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275079
|
-
const
|
|
275080
|
-
const
|
|
275081
|
-
const
|
|
274996
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
274997
|
+
const blockchainNodeUniqueName = loadBalancer ? undefined : blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
274998
|
+
const loadBalancerUniqueName = blockchainNodeUniqueName ? undefined : loadBalancer ?? env2.SETTLEMINT_LOAD_BALANCER;
|
|
275082
274999
|
const parsedAbis = [];
|
|
275083
275000
|
if (abis && abis.length > 0) {
|
|
275084
275001
|
try {
|
|
@@ -275095,10 +275012,10 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275095
275012
|
}
|
|
275096
275013
|
const result = await settlemint.middleware.create({
|
|
275097
275014
|
name: name2,
|
|
275098
|
-
|
|
275015
|
+
applicationUniqueName,
|
|
275099
275016
|
interface: "SMART_CONTRACT_PORTAL",
|
|
275100
|
-
|
|
275101
|
-
|
|
275017
|
+
blockchainNodeUniqueName,
|
|
275018
|
+
loadBalancerUniqueName,
|
|
275102
275019
|
abis: parsedAbis,
|
|
275103
275020
|
includePredeployedAbis,
|
|
275104
275021
|
provider,
|
|
@@ -275111,7 +275028,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275111
275028
|
mapDefaultEnv: async () => {
|
|
275112
275029
|
return {
|
|
275113
275030
|
SETTLEMINT_APPLICATION: application,
|
|
275114
|
-
SETTLEMINT_PORTAL: result.
|
|
275031
|
+
SETTLEMINT_PORTAL: result.uniqueName,
|
|
275115
275032
|
...getPortalEndpoints(result)
|
|
275116
275033
|
};
|
|
275117
275034
|
}
|
|
@@ -275126,7 +275043,7 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
|
275126
275043
|
},
|
|
275127
275044
|
{
|
|
275128
275045
|
description: "Create a smart contract portal middleware in a different application",
|
|
275129
|
-
command: "platform create middleware smart-contract-portal my-portal --application-
|
|
275046
|
+
command: "platform create middleware smart-contract-portal my-portal --application my-app --blockchain-node node-123"
|
|
275130
275047
|
}
|
|
275131
275048
|
]
|
|
275132
275049
|
});
|
|
@@ -275144,14 +275061,15 @@ function privateKeyHdCreateCommand() {
|
|
|
275144
275061
|
type: "private key",
|
|
275145
275062
|
alias: "hd",
|
|
275146
275063
|
execute: (cmd2, baseAction) => {
|
|
275147
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275064
|
+
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 }) => {
|
|
275148
275065
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275149
|
-
const
|
|
275066
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275067
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275150
275068
|
const result = await settlemint.privateKey.create({
|
|
275151
275069
|
name: name2,
|
|
275152
|
-
|
|
275070
|
+
applicationUniqueName,
|
|
275153
275071
|
privateKeyType: "HD_ECDSA_P256",
|
|
275154
|
-
|
|
275072
|
+
blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
|
|
275155
275073
|
provider,
|
|
275156
275074
|
region,
|
|
275157
275075
|
size,
|
|
@@ -275176,11 +275094,11 @@ function privateKeyHdCreateCommand() {
|
|
|
275176
275094
|
},
|
|
275177
275095
|
{
|
|
275178
275096
|
description: "Create a private key in a different application",
|
|
275179
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --application-
|
|
275097
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --application my-app"
|
|
275180
275098
|
},
|
|
275181
275099
|
{
|
|
275182
275100
|
description: "Create a private key linked to a blockchain node",
|
|
275183
|
-
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node-
|
|
275101
|
+
command: "platform create private-key hd-ecdsa-p256 my-key --blockchain-node node-123"
|
|
275184
275102
|
}
|
|
275185
275103
|
]
|
|
275186
275104
|
});
|
|
@@ -275193,14 +275111,15 @@ function privateKeyHsmCreateCommand() {
|
|
|
275193
275111
|
type: "private key",
|
|
275194
275112
|
alias: "hd",
|
|
275195
275113
|
execute: (cmd2, baseAction) => {
|
|
275196
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275114
|
+
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 }) => {
|
|
275197
275115
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275198
|
-
const
|
|
275116
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275117
|
+
const blockchainNodeUniqueName = blockchainNode ?? env2.SETTLEMINT_BLOCKCHAIN_NODE;
|
|
275199
275118
|
const result = await settlemint.privateKey.create({
|
|
275200
275119
|
name: name2,
|
|
275201
|
-
|
|
275120
|
+
applicationUniqueName,
|
|
275202
275121
|
privateKeyType: "HSM_ECDSA_P256",
|
|
275203
|
-
|
|
275122
|
+
blockchainNodeUniqueNames: blockchainNodeUniqueName ? [blockchainNodeUniqueName] : [],
|
|
275204
275123
|
provider,
|
|
275205
275124
|
region,
|
|
275206
275125
|
size,
|
|
@@ -275219,11 +275138,11 @@ function privateKeyHsmCreateCommand() {
|
|
|
275219
275138
|
},
|
|
275220
275139
|
{
|
|
275221
275140
|
description: "Create a private key in a different application",
|
|
275222
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --application
|
|
275141
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --application 123456789"
|
|
275223
275142
|
},
|
|
275224
275143
|
{
|
|
275225
275144
|
description: "Create a private key linked to a blockchain node",
|
|
275226
|
-
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node-
|
|
275145
|
+
command: "platform create private-key hsm-ecdsa-p256 my-key --blockchain-node node-123"
|
|
275227
275146
|
}
|
|
275228
275147
|
]
|
|
275229
275148
|
});
|
|
@@ -275241,12 +275160,12 @@ function ipfsStorageCreateCommand() {
|
|
|
275241
275160
|
type: "storage",
|
|
275242
275161
|
alias: "ip",
|
|
275243
275162
|
execute: (cmd2, baseAction) => {
|
|
275244
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275163
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275245
275164
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275246
|
-
const
|
|
275165
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275247
275166
|
const result = await settlemint.storage.create({
|
|
275248
275167
|
name: name2,
|
|
275249
|
-
|
|
275168
|
+
applicationUniqueName,
|
|
275250
275169
|
storageProtocol: "IPFS",
|
|
275251
275170
|
provider,
|
|
275252
275171
|
region,
|
|
@@ -275257,8 +275176,7 @@ function ipfsStorageCreateCommand() {
|
|
|
275257
275176
|
result,
|
|
275258
275177
|
mapDefaultEnv: () => {
|
|
275259
275178
|
return {
|
|
275260
|
-
|
|
275261
|
-
SETTLEMINT_IPFS: result.id,
|
|
275179
|
+
SETTLEMINT_IPFS: result.uniqueName,
|
|
275262
275180
|
...getIpfsEndpoints(result)
|
|
275263
275181
|
};
|
|
275264
275182
|
}
|
|
@@ -275273,7 +275191,7 @@ function ipfsStorageCreateCommand() {
|
|
|
275273
275191
|
},
|
|
275274
275192
|
{
|
|
275275
275193
|
description: "Create an IPFS storage in a different application",
|
|
275276
|
-
command: "platform create storage ipfs my-storage --application
|
|
275194
|
+
command: "platform create storage ipfs my-storage --application app-123"
|
|
275277
275195
|
}
|
|
275278
275196
|
]
|
|
275279
275197
|
});
|
|
@@ -275286,12 +275204,12 @@ function minioStorageCreateCommand() {
|
|
|
275286
275204
|
type: "storage",
|
|
275287
275205
|
alias: "m",
|
|
275288
275206
|
execute: (cmd2, baseAction) => {
|
|
275289
|
-
addClusterServiceArgs(cmd2).option("--application
|
|
275207
|
+
addClusterServiceArgs(cmd2).option("--application <application>", "Application unique name").action(async (name2, { application, provider, region, size, type: type4, ...defaultArgs }) => {
|
|
275290
275208
|
return baseAction(defaultArgs, async (settlemint, env2) => {
|
|
275291
|
-
const
|
|
275209
|
+
const applicationUniqueName = application ?? env2.SETTLEMINT_APPLICATION;
|
|
275292
275210
|
const result = await settlemint.storage.create({
|
|
275293
275211
|
name: name2,
|
|
275294
|
-
|
|
275212
|
+
applicationUniqueName,
|
|
275295
275213
|
storageProtocol: "MINIO",
|
|
275296
275214
|
provider,
|
|
275297
275215
|
region,
|
|
@@ -275303,7 +275221,7 @@ function minioStorageCreateCommand() {
|
|
|
275303
275221
|
mapDefaultEnv: () => {
|
|
275304
275222
|
return {
|
|
275305
275223
|
SETTLEMINT_APPLICATION: application,
|
|
275306
|
-
SETTLEMINT_MINIO: result.
|
|
275224
|
+
SETTLEMINT_MINIO: result.uniqueName,
|
|
275307
275225
|
...getMinioEndpoints(result)
|
|
275308
275226
|
};
|
|
275309
275227
|
}
|
|
@@ -275318,7 +275236,7 @@ function minioStorageCreateCommand() {
|
|
|
275318
275236
|
},
|
|
275319
275237
|
{
|
|
275320
275238
|
description: "Create a MinIO storage in a different application",
|
|
275321
|
-
command: "platform create storage minio my-storage --application
|
|
275239
|
+
command: "platform create storage minio my-storage --application app-123"
|
|
275322
275240
|
}
|
|
275323
275241
|
]
|
|
275324
275242
|
});
|
|
@@ -275331,7 +275249,7 @@ function storageCreateCommand() {
|
|
|
275331
275249
|
|
|
275332
275250
|
// src/commands/platform/create.ts
|
|
275333
275251
|
function createCommand3() {
|
|
275334
|
-
return new Command2("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(
|
|
275252
|
+
return new Command2("create").alias("c").description("Create a resource in the SettleMint platform").addCommand(workspaceCreateCommand()).addCommand(applicationCreateCommand()).addCommand(blockchainNetworkCreateCommand()).addCommand(privateKeyCreateCommand()).addCommand(middlewareCreateCommand()).addCommand(storageCreateCommand()).addCommand(integrationToolCreateCommand()).addCommand(insightsCreateCommand()).addCommand(applicationAccessTokenCreateCommand());
|
|
275335
275253
|
}
|
|
275336
275254
|
|
|
275337
275255
|
// src/commands/platform/prompts/delete-confirmation.prompt.ts
|
|
@@ -275364,11 +275282,11 @@ function getDeleteCommand({
|
|
|
275364
275282
|
deleteFunction,
|
|
275365
275283
|
usePersonalAccessToken = true
|
|
275366
275284
|
}) {
|
|
275367
|
-
return new Command2(sanitizeCommandName(name2)).alias(alias).description(`Delete a ${type4} in the SettleMint platform. Provide the ${type4}
|
|
275285
|
+
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.
|
|
275368
275286
|
${createExamples([
|
|
275369
275287
|
{
|
|
275370
|
-
description: `Deletes the specified ${type4} by
|
|
275371
|
-
command: `platform delete ${type4} <${type4}-
|
|
275288
|
+
description: `Deletes the specified ${type4} by unique name`,
|
|
275289
|
+
command: `platform delete ${type4} <${type4}-unique-name>`
|
|
275372
275290
|
},
|
|
275373
275291
|
{
|
|
275374
275292
|
description: `Deletes the default ${type4} in the production environment`,
|
|
@@ -275376,9 +275294,9 @@ ${createExamples([
|
|
|
275376
275294
|
},
|
|
275377
275295
|
{
|
|
275378
275296
|
description: `Force deletes the specified ${type4} without confirmation`,
|
|
275379
|
-
command: `platform delete ${type4} <${type4}-
|
|
275297
|
+
command: `platform delete ${type4} <${type4}-unique-name> --force`
|
|
275380
275298
|
}
|
|
275381
|
-
])}`).argument("<
|
|
275299
|
+
])}`).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 }) => {
|
|
275382
275300
|
intro(`Deleting ${type4} in the SettleMint platform`);
|
|
275383
275301
|
if (!force) {
|
|
275384
275302
|
await deleteConfirmationPrompt(`this ${type4}`);
|
|
@@ -275394,19 +275312,19 @@ ${createExamples([
|
|
|
275394
275312
|
accessToken,
|
|
275395
275313
|
instance
|
|
275396
275314
|
});
|
|
275397
|
-
const
|
|
275398
|
-
const
|
|
275399
|
-
if (!
|
|
275315
|
+
const isDefaultUniqueName = uniqueName === "default";
|
|
275316
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
|
275317
|
+
if (!serviceUniqueName) {
|
|
275400
275318
|
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} ID or set a default ${type4} first.`);
|
|
275401
275319
|
}
|
|
275402
275320
|
const result = await spinner({
|
|
275403
275321
|
startMessage: `Deleting ${type4}`,
|
|
275404
275322
|
task: async () => {
|
|
275405
|
-
return deleteFunction(settlemint,
|
|
275323
|
+
return deleteFunction(settlemint, serviceUniqueName);
|
|
275406
275324
|
},
|
|
275407
275325
|
stopMessage: `${capitalizeFirstLetter(type4)} deleted`
|
|
275408
275326
|
});
|
|
275409
|
-
if (
|
|
275327
|
+
if (isDefaultUniqueName) {
|
|
275410
275328
|
const newEnv = {
|
|
275411
275329
|
SETTLEMINT_ACCESS_TOKEN: usePersonalAccessToken ? env2.SETTLEMINT_ACCESS_TOKEN : accessToken,
|
|
275412
275330
|
SETTLEMINT_INSTANCE: instance,
|
|
@@ -275416,7 +275334,7 @@ ${createExamples([
|
|
|
275416
275334
|
note(`${capitalizeFirstLetter(type4)} removed as default`);
|
|
275417
275335
|
}
|
|
275418
275336
|
if (wait) {
|
|
275419
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275337
|
+
await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "destroy" });
|
|
275420
275338
|
}
|
|
275421
275339
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} deleted successfully`);
|
|
275422
275340
|
});
|
|
@@ -275429,8 +275347,8 @@ function workspaceDeleteCommand() {
|
|
|
275429
275347
|
type: "workspace",
|
|
275430
275348
|
alias: "w",
|
|
275431
275349
|
envKey: "SETTLEMINT_WORKSPACE",
|
|
275432
|
-
deleteFunction: async (settlemint,
|
|
275433
|
-
return settlemint.workspace.delete(
|
|
275350
|
+
deleteFunction: async (settlemint, uniqueName) => {
|
|
275351
|
+
return settlemint.workspace.delete(uniqueName);
|
|
275434
275352
|
}
|
|
275435
275353
|
});
|
|
275436
275354
|
}
|
|
@@ -275479,7 +275397,7 @@ ${createExamples([
|
|
|
275479
275397
|
description: `Restarts the default ${type4} in the production environment`,
|
|
275480
275398
|
command: `platform restart ${commandName}${subType ? ` ${subType}` : ""} default --prod`
|
|
275481
275399
|
}
|
|
275482
|
-
])}`).argument("<
|
|
275400
|
+
])}`).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 }) => {
|
|
275483
275401
|
intro(`Restarting ${type4} in the SettleMint platform`);
|
|
275484
275402
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
275485
275403
|
const env2 = await loadEnv2(false, !!prod);
|
|
@@ -275492,20 +275410,20 @@ ${createExamples([
|
|
|
275492
275410
|
accessToken,
|
|
275493
275411
|
instance
|
|
275494
275412
|
});
|
|
275495
|
-
const
|
|
275496
|
-
const
|
|
275497
|
-
if (!
|
|
275498
|
-
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4}
|
|
275413
|
+
const isDefaultUniqueName = uniqueName === "default";
|
|
275414
|
+
const serviceUniqueName = isDefaultUniqueName ? typeof env2[envKey] === "string" ? env2[envKey] : null : uniqueName;
|
|
275415
|
+
if (!serviceUniqueName) {
|
|
275416
|
+
throw new Error(`No default ${type4} found in your .env file. Please provide a valid ${type4} unique name or set a default ${type4} first.`);
|
|
275499
275417
|
}
|
|
275500
275418
|
const result = await spinner({
|
|
275501
275419
|
startMessage: `Restarting ${type4}`,
|
|
275502
275420
|
task: async () => {
|
|
275503
|
-
return restartFunction(settlemint,
|
|
275421
|
+
return restartFunction(settlemint, serviceUniqueName);
|
|
275504
275422
|
},
|
|
275505
275423
|
stopMessage: `${capitalizeFirstLetter(type4)} restart initiated`
|
|
275506
275424
|
});
|
|
275507
275425
|
if (wait) {
|
|
275508
|
-
await waitForCompletion({ settlemint, type: type4,
|
|
275426
|
+
await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "restart" });
|
|
275509
275427
|
}
|
|
275510
275428
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} restart initiated successfully`);
|
|
275511
275429
|
});
|
|
@@ -275518,8 +275436,8 @@ function blockchainNetworkRestartCommand() {
|
|
|
275518
275436
|
type: "blockchain network",
|
|
275519
275437
|
alias: "bn",
|
|
275520
275438
|
envKey: "SETTLEMINT_BLOCKCHAIN_NETWORK",
|
|
275521
|
-
restartFunction: async (settlemint,
|
|
275522
|
-
return settlemint.blockchainNetwork.restart(
|
|
275439
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275440
|
+
return settlemint.blockchainNetwork.restart(uniqueName);
|
|
275523
275441
|
}
|
|
275524
275442
|
});
|
|
275525
275443
|
}
|
|
@@ -275531,8 +275449,8 @@ function customDeploymentRestartCommand() {
|
|
|
275531
275449
|
type: "custom deployment",
|
|
275532
275450
|
alias: "cd",
|
|
275533
275451
|
envKey: "SETTLEMINT_CUSTOM_DEPLOYMENT",
|
|
275534
|
-
restartFunction: async (settlemint,
|
|
275535
|
-
return settlemint.customDeployment.restart(
|
|
275452
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275453
|
+
return settlemint.customDeployment.restart(uniqueName);
|
|
275536
275454
|
},
|
|
275537
275455
|
usePersonalAccessToken: false
|
|
275538
275456
|
});
|
|
@@ -275546,8 +275464,8 @@ function blockscoutRestartCommand() {
|
|
|
275546
275464
|
subType: "blockscout",
|
|
275547
275465
|
alias: "bs",
|
|
275548
275466
|
envKey: "SETTLEMINT_BLOCKSCOUT",
|
|
275549
|
-
restartFunction: async (settlemint,
|
|
275550
|
-
return settlemint.insights.restart(
|
|
275467
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275468
|
+
return settlemint.insights.restart(uniqueName);
|
|
275551
275469
|
}
|
|
275552
275470
|
});
|
|
275553
275471
|
}
|
|
@@ -275565,8 +275483,8 @@ function hasuraRestartCommand() {
|
|
|
275565
275483
|
subType: "hasura",
|
|
275566
275484
|
alias: "ha",
|
|
275567
275485
|
envKey: "SETTLEMINT_HASURA",
|
|
275568
|
-
restartFunction: async (settlemint,
|
|
275569
|
-
return settlemint.integrationTool.restart(
|
|
275486
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275487
|
+
return settlemint.integrationTool.restart(uniqueName);
|
|
275570
275488
|
}
|
|
275571
275489
|
});
|
|
275572
275490
|
}
|
|
@@ -275598,8 +275516,8 @@ function smartContractPortalRestartCommand() {
|
|
|
275598
275516
|
subType: "smart-contract-portal",
|
|
275599
275517
|
alias: "scp",
|
|
275600
275518
|
envKey: "SETTLEMINT_PORTAL",
|
|
275601
|
-
restartFunction: async (settlemint,
|
|
275602
|
-
return settlemint.middleware.restart(
|
|
275519
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275520
|
+
return settlemint.middleware.restart(uniqueName);
|
|
275603
275521
|
}
|
|
275604
275522
|
});
|
|
275605
275523
|
}
|
|
@@ -275617,8 +275535,8 @@ function hdEcdsaP256RestartCommand() {
|
|
|
275617
275535
|
subType: "hd-ecdsa-p256",
|
|
275618
275536
|
alias: "hd",
|
|
275619
275537
|
envKey: "SETTLEMINT_HD_PRIVATE_KEY",
|
|
275620
|
-
restartFunction: async (settlemint,
|
|
275621
|
-
return settlemint.privateKey.restart(
|
|
275538
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275539
|
+
return settlemint.privateKey.restart(uniqueName);
|
|
275622
275540
|
}
|
|
275623
275541
|
});
|
|
275624
275542
|
}
|
|
@@ -275635,8 +275553,8 @@ function ipfsRestartCommand() {
|
|
|
275635
275553
|
type: "storage",
|
|
275636
275554
|
alias: "ip",
|
|
275637
275555
|
envKey: "SETTLEMINT_IPFS",
|
|
275638
|
-
restartFunction: async (settlemint,
|
|
275639
|
-
return settlemint.storage.restart(
|
|
275556
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275557
|
+
return settlemint.storage.restart(uniqueName);
|
|
275640
275558
|
}
|
|
275641
275559
|
});
|
|
275642
275560
|
}
|
|
@@ -275648,8 +275566,8 @@ function minioRestartCommand() {
|
|
|
275648
275566
|
type: "storage",
|
|
275649
275567
|
alias: "m",
|
|
275650
275568
|
envKey: "SETTLEMINT_MINIO",
|
|
275651
|
-
restartFunction: async (settlemint,
|
|
275652
|
-
return settlemint.storage.restart(
|
|
275569
|
+
restartFunction: async (settlemint, uniqueName) => {
|
|
275570
|
+
return settlemint.storage.restart(uniqueName);
|
|
275653
275571
|
}
|
|
275654
275572
|
});
|
|
275655
275573
|
}
|
|
@@ -275667,12 +275585,12 @@ function restartCommand() {
|
|
|
275667
275585
|
|
|
275668
275586
|
// src/commands/platform/custom-deployments/update.ts
|
|
275669
275587
|
function customDeploymentsUpdateCommand() {
|
|
275670
|
-
return new Command2("custom-deployment").alias("custom-deployments").alias("cd").argument("<tag>", "The tag to update the custom deployment to").option("--
|
|
275588
|
+
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 }) => {
|
|
275671
275589
|
intro("Updating custom deployment in the SettleMint platform");
|
|
275672
275590
|
const env2 = await loadEnv2(false, !!prod);
|
|
275673
|
-
const
|
|
275674
|
-
if (!
|
|
275675
|
-
throw new Error("No custom deployment
|
|
275591
|
+
const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
|
|
275592
|
+
if (!customDeploymentUniqueName) {
|
|
275593
|
+
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");
|
|
275676
275594
|
}
|
|
275677
275595
|
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
275678
275596
|
if (!accessToken) {
|
|
@@ -275686,12 +275604,17 @@ function customDeploymentsUpdateCommand() {
|
|
|
275686
275604
|
const customDeployment = await spinner({
|
|
275687
275605
|
startMessage: "Updating custom deployment",
|
|
275688
275606
|
task: async () => {
|
|
275689
|
-
return settlemint.customDeployment.update(
|
|
275607
|
+
return settlemint.customDeployment.update(customDeploymentUniqueName, tag);
|
|
275690
275608
|
},
|
|
275691
275609
|
stopMessage: "Custom deployment updated"
|
|
275692
275610
|
});
|
|
275693
275611
|
if (wait) {
|
|
275694
|
-
await waitForCompletion({
|
|
275612
|
+
await waitForCompletion({
|
|
275613
|
+
settlemint,
|
|
275614
|
+
type: "custom deployment",
|
|
275615
|
+
uniqueName: customDeployment.uniqueName,
|
|
275616
|
+
action: "deploy"
|
|
275617
|
+
});
|
|
275695
275618
|
}
|
|
275696
275619
|
outro(`${customDeployment.name} updated to ${tag}`);
|
|
275697
275620
|
});
|
|
@@ -276080,7 +276003,7 @@ function isHardhatConfig(config4) {
|
|
|
276080
276003
|
|
|
276081
276004
|
// src/commands/smart-contract-set/hardhat/deploy/remote.ts
|
|
276082
276005
|
function hardhatDeployRemoteCommand() {
|
|
276083
|
-
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
|
|
276006
|
+
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");
|
|
276084
276007
|
cmd2.action(async ({
|
|
276085
276008
|
module,
|
|
276086
276009
|
reset: reset2,
|
|
@@ -276091,7 +276014,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276091
276014
|
strategy,
|
|
276092
276015
|
prod,
|
|
276093
276016
|
acceptDefaults,
|
|
276094
|
-
|
|
276017
|
+
blockchainNode: blockchainNodeUniqueName
|
|
276095
276018
|
}) => {
|
|
276096
276019
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276097
276020
|
const env2 = await loadEnv(false, !!prod);
|
|
@@ -276105,7 +276028,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276105
276028
|
instance
|
|
276106
276029
|
});
|
|
276107
276030
|
let node = undefined;
|
|
276108
|
-
if (!
|
|
276031
|
+
if (!blockchainNodeUniqueName) {
|
|
276109
276032
|
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276110
276033
|
if (blockchainNodes.length === 0) {
|
|
276111
276034
|
cancel2("No blockchain nodes found. Please create a blockchain node and try again.");
|
|
@@ -276121,7 +276044,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276121
276044
|
}
|
|
276122
276045
|
node = blockchainNode;
|
|
276123
276046
|
} else {
|
|
276124
|
-
node = await settlemint.blockchainNode.read(
|
|
276047
|
+
node = await settlemint.blockchainNode.read(blockchainNodeUniqueName);
|
|
276125
276048
|
}
|
|
276126
276049
|
const envConfig = await settlemint.foundry.env(node.id);
|
|
276127
276050
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
@@ -276187,8 +276110,8 @@ function hardhatScriptLocalCommand() {
|
|
|
276187
276110
|
|
|
276188
276111
|
// src/commands/smart-contract-set/hardhat/script/remote.ts
|
|
276189
276112
|
function hardhatScriptRemoteCommand() {
|
|
276190
|
-
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
|
|
276191
|
-
cmd2.action(async ({ script, prod,
|
|
276113
|
+
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");
|
|
276114
|
+
cmd2.action(async ({ script, prod, blockchainNode: blockchainNodeUniqueName, acceptDefaults, compile }) => {
|
|
276192
276115
|
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
276193
276116
|
const env2 = await loadEnv(false, !!prod);
|
|
276194
276117
|
const accessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
@@ -276200,16 +276123,16 @@ function hardhatScriptRemoteCommand() {
|
|
|
276200
276123
|
accessToken,
|
|
276201
276124
|
instance
|
|
276202
276125
|
});
|
|
276203
|
-
let
|
|
276204
|
-
if (!
|
|
276126
|
+
let nodeUniqueName = blockchainNodeUniqueName;
|
|
276127
|
+
if (!nodeUniqueName) {
|
|
276205
276128
|
const blockchainNodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276206
276129
|
const blockchainNode = await blockchainNodePrompt(env2, blockchainNodes, autoAccept);
|
|
276207
276130
|
if (!blockchainNode) {
|
|
276208
276131
|
cancel2("No Blockchain Node selected. Please select one to continue.");
|
|
276209
276132
|
}
|
|
276210
|
-
|
|
276133
|
+
nodeUniqueName = blockchainNode.uniqueName;
|
|
276211
276134
|
}
|
|
276212
|
-
const envConfig = await settlemint.foundry.env(
|
|
276135
|
+
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276213
276136
|
const { command, args } = await getPackageManagerExecutable();
|
|
276214
276137
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276215
276138
|
});
|
|
@@ -276612,4 +276535,4 @@ sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
|
276612
276535
|
cancel2(reason);
|
|
276613
276536
|
});
|
|
276614
276537
|
|
|
276615
|
-
//# debugId=
|
|
276538
|
+
//# debugId=09413FFEE267649A64756E2164756E21
|