@settlemint/sdk-cli 0.9.3-pr79efb0e3 → 0.9.3-pr928eae3a
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 +145 -114
- package/dist/cli.js.map +14 -12
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -19613,7 +19613,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
19613
19613
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
19614
19614
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
19615
19615
|
var getPathInfo = (cmd, {
|
|
19616
|
-
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.
|
|
19616
|
+
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.LQXdwujUdZ:/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",
|
|
19617
19617
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
19618
19618
|
delimiter: optDelimiter = delimiter
|
|
19619
19619
|
}) => {
|
|
@@ -19817,7 +19817,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
19817
19817
|
let pathToInitial;
|
|
19818
19818
|
try {
|
|
19819
19819
|
pathToInitial = which.sync(initialCmd, {
|
|
19820
|
-
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.
|
|
19820
|
+
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.LQXdwujUdZ:/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",
|
|
19821
19821
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
19822
19822
|
}).toLowerCase();
|
|
19823
19823
|
} catch (err) {
|
|
@@ -20534,7 +20534,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
20534
20534
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
20535
20535
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
20536
20536
|
var getPathInfo = (cmd, {
|
|
20537
|
-
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.
|
|
20537
|
+
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.LQXdwujUdZ:/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",
|
|
20538
20538
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
20539
20539
|
delimiter: optDelimiter = delimiter
|
|
20540
20540
|
}) => {
|
|
@@ -223327,7 +223327,7 @@ ${Bt.cyan(Yt)}
|
|
|
223327
223327
|
code: "ENOENT"
|
|
223328
223328
|
}), getPathInfo = (e9, t7) => {
|
|
223329
223329
|
var r6 = t7.colon || or;
|
|
223330
|
-
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.
|
|
223330
|
+
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.LQXdwujUdZ:/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)];
|
|
223331
223331
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
223332
223332
|
var a5 = nr ? n6.split(r6) : [""];
|
|
223333
223333
|
if (nr) {
|
|
@@ -226464,7 +226464,7 @@ ${whileRunning(e9)}`;
|
|
|
226464
226464
|
};
|
|
226465
226465
|
ni = Object.assign(async function _main() {
|
|
226466
226466
|
var e9 = new Cli({
|
|
226467
|
-
binaryVersion: "0.9.3-
|
|
226467
|
+
binaryVersion: "0.9.3-pr928eae3a",
|
|
226468
226468
|
binaryLabel: "gql.tada CLI",
|
|
226469
226469
|
binaryName: "gql.tada"
|
|
226470
226470
|
});
|
|
@@ -234964,7 +234964,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
234964
234964
|
const colon = opt2.colon || COLON;
|
|
234965
234965
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
234966
234966
|
...isWindows2 ? [process.cwd()] : [],
|
|
234967
|
-
...(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.
|
|
234967
|
+
...(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.LQXdwujUdZ:/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)
|
|
234968
234968
|
];
|
|
234969
234969
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
234970
234970
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -256788,7 +256788,7 @@ ${error.stack}`));
|
|
|
256788
256788
|
var package_default = {
|
|
256789
256789
|
name: "@settlemint/sdk-cli",
|
|
256790
256790
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
256791
|
-
version: "0.9.3-
|
|
256791
|
+
version: "0.9.3-pr928eae3a",
|
|
256792
256792
|
type: "module",
|
|
256793
256793
|
private: false,
|
|
256794
256794
|
license: "FSL-1.1-MIT",
|
|
@@ -256841,8 +256841,8 @@ var package_default = {
|
|
|
256841
256841
|
"@inquirer/input": "4.1.1",
|
|
256842
256842
|
"@inquirer/password": "4.0.4",
|
|
256843
256843
|
"@inquirer/select": "4.0.4",
|
|
256844
|
-
"@settlemint/sdk-js": "0.9.3-
|
|
256845
|
-
"@settlemint/sdk-utils": "0.9.3-
|
|
256844
|
+
"@settlemint/sdk-js": "0.9.3-pr928eae3a",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-pr928eae3a",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -267738,6 +267738,57 @@ var getApplicationOrPersonalAccessToken = async ({
|
|
|
267738
267738
|
// ../../node_modules/@gql.tada/cli-utils/dist/gql-tada-cli.mjs
|
|
267739
267739
|
init_index_chunk();
|
|
267740
267740
|
|
|
267741
|
+
// src/commands/codegen/test-gql-endpoint.ts
|
|
267742
|
+
async function testGqlEndpoint({
|
|
267743
|
+
accessToken,
|
|
267744
|
+
hasuraAdminSecret,
|
|
267745
|
+
gqlEndpoint,
|
|
267746
|
+
isHasura = false,
|
|
267747
|
+
maxRetries = 3
|
|
267748
|
+
}) {
|
|
267749
|
+
if (!gqlEndpoint) {
|
|
267750
|
+
return false;
|
|
267751
|
+
}
|
|
267752
|
+
for (let attempt = 0;attempt < maxRetries; attempt++) {
|
|
267753
|
+
try {
|
|
267754
|
+
const response = await fetch(gqlEndpoint, {
|
|
267755
|
+
method: "POST",
|
|
267756
|
+
headers: {
|
|
267757
|
+
"x-auth-token": accessToken,
|
|
267758
|
+
...isHasura ? { "x-hasura-admin-secret": hasuraAdminSecret ?? "" } : {},
|
|
267759
|
+
"Content-Type": "application/json"
|
|
267760
|
+
},
|
|
267761
|
+
body: JSON.stringify({
|
|
267762
|
+
query: `
|
|
267763
|
+
query {
|
|
267764
|
+
__schema {
|
|
267765
|
+
types {
|
|
267766
|
+
name
|
|
267767
|
+
}
|
|
267768
|
+
}
|
|
267769
|
+
}
|
|
267770
|
+
`
|
|
267771
|
+
})
|
|
267772
|
+
});
|
|
267773
|
+
if (!response.ok) {
|
|
267774
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
267775
|
+
}
|
|
267776
|
+
const data = await response.json();
|
|
267777
|
+
if (data.errors) {
|
|
267778
|
+
throw new Error("GraphQL errors in response");
|
|
267779
|
+
}
|
|
267780
|
+
return true;
|
|
267781
|
+
} catch (error5) {
|
|
267782
|
+
if (attempt === maxRetries - 1) {
|
|
267783
|
+
return false;
|
|
267784
|
+
}
|
|
267785
|
+
const delay2 = 2 ** attempt * 1000;
|
|
267786
|
+
await new Promise((resolve3) => setTimeout(resolve3, delay2));
|
|
267787
|
+
}
|
|
267788
|
+
}
|
|
267789
|
+
return false;
|
|
267790
|
+
}
|
|
267791
|
+
|
|
267741
267792
|
// src/commands/codegen/codegen-hasura.ts
|
|
267742
267793
|
async function codegenHasura(env2) {
|
|
267743
267794
|
const gqlEndpoint = env2.SETTLEMINT_HASURA_ENDPOINT;
|
|
@@ -267753,6 +267804,12 @@ async function codegenHasura(env2) {
|
|
|
267753
267804
|
return;
|
|
267754
267805
|
}
|
|
267755
267806
|
if (gqlEndpoint && accessToken && adminSecret) {
|
|
267807
|
+
await testGqlEndpoint({
|
|
267808
|
+
accessToken,
|
|
267809
|
+
hasuraAdminSecret: adminSecret,
|
|
267810
|
+
gqlEndpoint,
|
|
267811
|
+
isHasura: true
|
|
267812
|
+
});
|
|
267756
267813
|
await generateSchema({
|
|
267757
267814
|
input: gqlEndpoint,
|
|
267758
267815
|
output: "hasura-schema.graphql",
|
|
@@ -267808,6 +267865,10 @@ async function codegenPortal(env2) {
|
|
|
267808
267865
|
if (!accessToken) {
|
|
267809
267866
|
return;
|
|
267810
267867
|
}
|
|
267868
|
+
await testGqlEndpoint({
|
|
267869
|
+
accessToken,
|
|
267870
|
+
gqlEndpoint
|
|
267871
|
+
});
|
|
267811
267872
|
await generateSchema({
|
|
267812
267873
|
input: gqlEndpoint,
|
|
267813
267874
|
output: "portal-schema.graphql",
|
|
@@ -267868,6 +267929,10 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
|
267868
267929
|
for (const gqlEndpoint of toGenerate) {
|
|
267869
267930
|
const name2 = gqlEndpoint.split("/").pop();
|
|
267870
267931
|
note(`Generating TheGraph subgraph ${name2}`);
|
|
267932
|
+
await testGqlEndpoint({
|
|
267933
|
+
accessToken,
|
|
267934
|
+
gqlEndpoint
|
|
267935
|
+
});
|
|
267871
267936
|
await generateSchema({
|
|
267872
267937
|
input: gqlEndpoint,
|
|
267873
267938
|
output: `the-graph-schema-${name2}.graphql`,
|
|
@@ -267905,51 +267970,6 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267905
267970
|
// src/commands/codegen/codegen-tsconfig.ts
|
|
267906
267971
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
267907
267972
|
|
|
267908
|
-
// src/commands/codegen/test-gql-endpoint.ts
|
|
267909
|
-
async function testGqlEndpoint(accessToken, hasuraAdminSecret, gqlEndpoint, isHasura = false, maxRetries = 3) {
|
|
267910
|
-
if (!gqlEndpoint) {
|
|
267911
|
-
return false;
|
|
267912
|
-
}
|
|
267913
|
-
for (let attempt = 0;attempt < maxRetries; attempt++) {
|
|
267914
|
-
try {
|
|
267915
|
-
const response = await fetch(gqlEndpoint, {
|
|
267916
|
-
method: "POST",
|
|
267917
|
-
headers: {
|
|
267918
|
-
"x-auth-token": accessToken,
|
|
267919
|
-
...isHasura ? { "x-hasura-admin-secret": hasuraAdminSecret ?? "" } : {},
|
|
267920
|
-
"Content-Type": "application/json"
|
|
267921
|
-
},
|
|
267922
|
-
body: JSON.stringify({
|
|
267923
|
-
query: `
|
|
267924
|
-
query {
|
|
267925
|
-
__schema {
|
|
267926
|
-
types {
|
|
267927
|
-
name
|
|
267928
|
-
}
|
|
267929
|
-
}
|
|
267930
|
-
}
|
|
267931
|
-
`
|
|
267932
|
-
})
|
|
267933
|
-
});
|
|
267934
|
-
if (!response.ok) {
|
|
267935
|
-
throw new Error(`HTTP error! status: ${response.status}`);
|
|
267936
|
-
}
|
|
267937
|
-
const data = await response.json();
|
|
267938
|
-
if (data.errors) {
|
|
267939
|
-
throw new Error("GraphQL errors in response");
|
|
267940
|
-
}
|
|
267941
|
-
return true;
|
|
267942
|
-
} catch (error5) {
|
|
267943
|
-
if (attempt === maxRetries - 1) {
|
|
267944
|
-
return false;
|
|
267945
|
-
}
|
|
267946
|
-
const delay2 = 2 ** attempt * 1000;
|
|
267947
|
-
await new Promise((resolve3) => setTimeout(resolve3, delay2));
|
|
267948
|
-
}
|
|
267949
|
-
}
|
|
267950
|
-
return false;
|
|
267951
|
-
}
|
|
267952
|
-
|
|
267953
267973
|
// ../../node_modules/get-tsconfig/dist/index.mjs
|
|
267954
267974
|
import a6 from "node:path";
|
|
267955
267975
|
import ee2 from "node:fs";
|
|
@@ -268849,10 +268869,24 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268849
268869
|
return name2 && (!thegraphSubgraphNames || thegraphSubgraphNames.includes(name2));
|
|
268850
268870
|
});
|
|
268851
268871
|
const [hasura, portal, thegraph, blockscout] = await Promise.all([
|
|
268852
|
-
testGqlEndpoint(
|
|
268853
|
-
|
|
268854
|
-
|
|
268855
|
-
|
|
268872
|
+
testGqlEndpoint({
|
|
268873
|
+
accessToken,
|
|
268874
|
+
hasuraAdminSecret: env2.SETTLEMINT_HASURA_ADMIN_SECRET,
|
|
268875
|
+
gqlEndpoint: env2.SETTLEMINT_HASURA_ENDPOINT,
|
|
268876
|
+
isHasura: true
|
|
268877
|
+
}),
|
|
268878
|
+
testGqlEndpoint({
|
|
268879
|
+
accessToken,
|
|
268880
|
+
gqlEndpoint: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT
|
|
268881
|
+
}),
|
|
268882
|
+
testGqlEndpoint({
|
|
268883
|
+
accessToken,
|
|
268884
|
+
gqlEndpoint: theGraphEndpoints[0]
|
|
268885
|
+
}),
|
|
268886
|
+
testGqlEndpoint({
|
|
268887
|
+
accessToken,
|
|
268888
|
+
gqlEndpoint: env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT
|
|
268889
|
+
})
|
|
268856
268890
|
]);
|
|
268857
268891
|
if (!tsconfig.config.compilerOptions) {
|
|
268858
268892
|
tsconfig.config.compilerOptions = {};
|
|
@@ -270511,7 +270545,7 @@ async function getGraphEndpoint(service, env2) {
|
|
|
270511
270545
|
const isStarterKit = (id) => id.endsWith("-starterkits");
|
|
270512
270546
|
const testEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => !isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
270513
270547
|
const starterKitEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
270514
|
-
const hasEndpoint = testEndpoint && env2.SETTLEMINT_ACCESS_TOKEN ? await testGqlEndpoint(env2.SETTLEMINT_ACCESS_TOKEN,
|
|
270548
|
+
const hasEndpoint = testEndpoint && env2.SETTLEMINT_ACCESS_TOKEN ? await testGqlEndpoint({ accessToken: env2.SETTLEMINT_ACCESS_TOKEN, gqlEndpoint: testEndpoint }) : false;
|
|
270515
270549
|
const endpoints = hasEndpoint ? service.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue) : starterKitEndpoint ? [starterKitEndpoint] : [];
|
|
270516
270550
|
if (endpoints.length === 0) {
|
|
270517
270551
|
return {};
|
|
@@ -276202,6 +276236,51 @@ function hardhatDeployLocalCommand() {
|
|
|
276202
276236
|
});
|
|
276203
276237
|
}
|
|
276204
276238
|
|
|
276239
|
+
// src/error/service-not-running-error.ts
|
|
276240
|
+
function serviceNotRunningError(service, status) {
|
|
276241
|
+
return cancel2(`The ${service} service is not in a Running state (status: ${status}).`);
|
|
276242
|
+
}
|
|
276243
|
+
|
|
276244
|
+
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
|
276245
|
+
async function selectTargetNode({
|
|
276246
|
+
env: env2,
|
|
276247
|
+
blockchainNodeUniqueName,
|
|
276248
|
+
autoAccept,
|
|
276249
|
+
settlemint
|
|
276250
|
+
}) {
|
|
276251
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276252
|
+
let node = undefined;
|
|
276253
|
+
if (!nodeUniqueName) {
|
|
276254
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276255
|
+
return missingApplication();
|
|
276256
|
+
}
|
|
276257
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276258
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276259
|
+
if (evmNodes.length === 0) {
|
|
276260
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276261
|
+
}
|
|
276262
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276263
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276264
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276265
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276266
|
+
}
|
|
276267
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept);
|
|
276268
|
+
if (!blockchainNode) {
|
|
276269
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276270
|
+
}
|
|
276271
|
+
node = blockchainNode;
|
|
276272
|
+
} else {
|
|
276273
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276274
|
+
if (!node.isEvm) {
|
|
276275
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276276
|
+
}
|
|
276277
|
+
}
|
|
276278
|
+
if (node.status !== "COMPLETED") {
|
|
276279
|
+
serviceNotRunningError("blockchain node", node.status);
|
|
276280
|
+
}
|
|
276281
|
+
return node;
|
|
276282
|
+
}
|
|
276283
|
+
|
|
276205
276284
|
// src/commands/smart-contract-set/prompts/address.prompt.ts
|
|
276206
276285
|
async function addressPrompt({
|
|
276207
276286
|
env: env2,
|
|
@@ -276315,33 +276394,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276315
276394
|
accessToken,
|
|
276316
276395
|
instance
|
|
276317
276396
|
});
|
|
276318
|
-
const
|
|
276319
|
-
let node = undefined;
|
|
276320
|
-
if (!nodeUniqueName) {
|
|
276321
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276322
|
-
return missingApplication();
|
|
276323
|
-
}
|
|
276324
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276325
|
-
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276326
|
-
if (evmNodes.length === 0) {
|
|
276327
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276328
|
-
}
|
|
276329
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276330
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276331
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276332
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276333
|
-
}
|
|
276334
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276335
|
-
if (!blockchainNode) {
|
|
276336
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276337
|
-
}
|
|
276338
|
-
node = blockchainNode;
|
|
276339
|
-
} else {
|
|
276340
|
-
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276341
|
-
if (!node.isEvm) {
|
|
276342
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276343
|
-
}
|
|
276344
|
-
}
|
|
276397
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276345
276398
|
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276346
276399
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276347
276400
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
@@ -276433,33 +276486,8 @@ function hardhatScriptRemoteCommand() {
|
|
|
276433
276486
|
accessToken,
|
|
276434
276487
|
instance
|
|
276435
276488
|
});
|
|
276436
|
-
|
|
276437
|
-
|
|
276438
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276439
|
-
return missingApplication();
|
|
276440
|
-
}
|
|
276441
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276442
|
-
const evmNodes = nodes.filter((node) => node.isEvm);
|
|
276443
|
-
if (evmNodes.length === 0) {
|
|
276444
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276445
|
-
}
|
|
276446
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node) => settlemint.blockchainNode.read(node.uniqueName)));
|
|
276447
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node) => node.privateKeys && node.privateKeys.length > 0);
|
|
276448
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276449
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276450
|
-
}
|
|
276451
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276452
|
-
if (!blockchainNode) {
|
|
276453
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276454
|
-
}
|
|
276455
|
-
nodeUniqueName = blockchainNode.uniqueName;
|
|
276456
|
-
} else {
|
|
276457
|
-
const node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276458
|
-
if (!node.isEvm) {
|
|
276459
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276460
|
-
}
|
|
276461
|
-
}
|
|
276462
|
-
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276489
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276490
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276463
276491
|
const { command, args } = await getPackageManagerExecutable();
|
|
276464
276492
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276465
276493
|
});
|
|
@@ -276790,6 +276818,9 @@ function subgraphDeployCommand() {
|
|
|
276790
276818
|
if (!theGraphMiddleware) {
|
|
276791
276819
|
return nothingSelectedError("graph middleware");
|
|
276792
276820
|
}
|
|
276821
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
|
276822
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
|
276823
|
+
}
|
|
276793
276824
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276794
276825
|
await subgraphSetup({
|
|
276795
276826
|
network
|
|
@@ -276891,4 +276922,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276891
276922
|
ascii();
|
|
276892
276923
|
sdkCliCommand();
|
|
276893
276924
|
|
|
276894
|
-
//# debugId=
|
|
276925
|
+
//# debugId=1C924CF2E2DC954664756E2164756E21
|