@settlemint/sdk-cli 0.9.3-pr928eae3a → 0.9.3-pr957d92e9
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 +152 -119
- package/dist/cli.js.map +20 -19
- 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.RqHvTefXfR:/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.RqHvTefXfR:/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.RqHvTefXfR:/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.RqHvTefXfR:/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-pr957d92e9",
|
|
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.RqHvTefXfR:/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-pr957d92e9",
|
|
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-pr957d92e9",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-pr957d92e9",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -267738,57 +267738,6 @@ 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
|
-
|
|
267792
267741
|
// src/commands/codegen/codegen-hasura.ts
|
|
267793
267742
|
async function codegenHasura(env2) {
|
|
267794
267743
|
const gqlEndpoint = env2.SETTLEMINT_HASURA_ENDPOINT;
|
|
@@ -267804,12 +267753,6 @@ async function codegenHasura(env2) {
|
|
|
267804
267753
|
return;
|
|
267805
267754
|
}
|
|
267806
267755
|
if (gqlEndpoint && accessToken && adminSecret) {
|
|
267807
|
-
await testGqlEndpoint({
|
|
267808
|
-
accessToken,
|
|
267809
|
-
hasuraAdminSecret: adminSecret,
|
|
267810
|
-
gqlEndpoint,
|
|
267811
|
-
isHasura: true
|
|
267812
|
-
});
|
|
267813
267756
|
await generateSchema({
|
|
267814
267757
|
input: gqlEndpoint,
|
|
267815
267758
|
output: "hasura-schema.graphql",
|
|
@@ -267865,10 +267808,6 @@ async function codegenPortal(env2) {
|
|
|
267865
267808
|
if (!accessToken) {
|
|
267866
267809
|
return;
|
|
267867
267810
|
}
|
|
267868
|
-
await testGqlEndpoint({
|
|
267869
|
-
accessToken,
|
|
267870
|
-
gqlEndpoint
|
|
267871
|
-
});
|
|
267872
267811
|
await generateSchema({
|
|
267873
267812
|
input: gqlEndpoint,
|
|
267874
267813
|
output: "portal-schema.graphql",
|
|
@@ -267929,10 +267868,6 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
|
267929
267868
|
for (const gqlEndpoint of toGenerate) {
|
|
267930
267869
|
const name2 = gqlEndpoint.split("/").pop();
|
|
267931
267870
|
note(`Generating TheGraph subgraph ${name2}`);
|
|
267932
|
-
await testGqlEndpoint({
|
|
267933
|
-
accessToken,
|
|
267934
|
-
gqlEndpoint
|
|
267935
|
-
});
|
|
267936
267871
|
await generateSchema({
|
|
267937
267872
|
input: gqlEndpoint,
|
|
267938
267873
|
output: `the-graph-schema-${name2}.graphql`,
|
|
@@ -267970,6 +267905,57 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267970
267905
|
// src/commands/codegen/codegen-tsconfig.ts
|
|
267971
267906
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
267972
267907
|
|
|
267908
|
+
// src/commands/codegen/test-gql-endpoint.ts
|
|
267909
|
+
async function testGqlEndpoint({
|
|
267910
|
+
accessToken,
|
|
267911
|
+
hasuraAdminSecret,
|
|
267912
|
+
gqlEndpoint,
|
|
267913
|
+
isHasura = false,
|
|
267914
|
+
maxRetries = 3
|
|
267915
|
+
}) {
|
|
267916
|
+
if (!gqlEndpoint) {
|
|
267917
|
+
return false;
|
|
267918
|
+
}
|
|
267919
|
+
for (let attempt = 0;attempt < maxRetries; attempt++) {
|
|
267920
|
+
try {
|
|
267921
|
+
const response = await fetch(gqlEndpoint, {
|
|
267922
|
+
method: "POST",
|
|
267923
|
+
headers: {
|
|
267924
|
+
"x-auth-token": accessToken,
|
|
267925
|
+
...isHasura ? { "x-hasura-admin-secret": hasuraAdminSecret ?? "" } : {},
|
|
267926
|
+
"Content-Type": "application/json"
|
|
267927
|
+
},
|
|
267928
|
+
body: JSON.stringify({
|
|
267929
|
+
query: `
|
|
267930
|
+
query {
|
|
267931
|
+
__schema {
|
|
267932
|
+
types {
|
|
267933
|
+
name
|
|
267934
|
+
}
|
|
267935
|
+
}
|
|
267936
|
+
}
|
|
267937
|
+
`
|
|
267938
|
+
})
|
|
267939
|
+
});
|
|
267940
|
+
if (!response.ok) {
|
|
267941
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
267942
|
+
}
|
|
267943
|
+
const data = await response.json();
|
|
267944
|
+
if (data.errors) {
|
|
267945
|
+
throw new Error("GraphQL errors in response");
|
|
267946
|
+
}
|
|
267947
|
+
return true;
|
|
267948
|
+
} catch (error5) {
|
|
267949
|
+
if (attempt === maxRetries - 1) {
|
|
267950
|
+
return false;
|
|
267951
|
+
}
|
|
267952
|
+
const delay2 = 2 ** attempt * 1000;
|
|
267953
|
+
await new Promise((resolve3) => setTimeout(resolve3, delay2));
|
|
267954
|
+
}
|
|
267955
|
+
}
|
|
267956
|
+
return false;
|
|
267957
|
+
}
|
|
267958
|
+
|
|
267973
267959
|
// ../../node_modules/get-tsconfig/dist/index.mjs
|
|
267974
267960
|
import a6 from "node:path";
|
|
267975
267961
|
import ee2 from "node:fs";
|
|
@@ -268868,7 +268854,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268868
268854
|
const name2 = gqlEndpoint.split("/").pop();
|
|
268869
268855
|
return name2 && (!thegraphSubgraphNames || thegraphSubgraphNames.includes(name2));
|
|
268870
268856
|
});
|
|
268871
|
-
const [hasura, portal,
|
|
268857
|
+
const [hasura, portal, blockscout] = await Promise.all([
|
|
268872
268858
|
testGqlEndpoint({
|
|
268873
268859
|
accessToken,
|
|
268874
268860
|
hasuraAdminSecret: env2.SETTLEMINT_HASURA_ADMIN_SECRET,
|
|
@@ -268879,15 +268865,18 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268879
268865
|
accessToken,
|
|
268880
268866
|
gqlEndpoint: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT
|
|
268881
268867
|
}),
|
|
268882
|
-
testGqlEndpoint({
|
|
268883
|
-
accessToken,
|
|
268884
|
-
gqlEndpoint: theGraphEndpoints[0]
|
|
268885
|
-
}),
|
|
268886
268868
|
testGqlEndpoint({
|
|
268887
268869
|
accessToken,
|
|
268888
268870
|
gqlEndpoint: env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT
|
|
268889
268871
|
})
|
|
268890
268872
|
]);
|
|
268873
|
+
const thegraph = await Promise.all(theGraphEndpoints.map((endpoint) => {
|
|
268874
|
+
const success = testGqlEndpoint({
|
|
268875
|
+
accessToken,
|
|
268876
|
+
gqlEndpoint: endpoint
|
|
268877
|
+
});
|
|
268878
|
+
return { success, endpoint };
|
|
268879
|
+
}));
|
|
268891
268880
|
if (!tsconfig.config.compilerOptions) {
|
|
268892
268881
|
tsconfig.config.compilerOptions = {};
|
|
268893
268882
|
}
|
|
@@ -268906,7 +268895,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268906
268895
|
tadaTurboLocation: "hasura-cache.d.ts"
|
|
268907
268896
|
}
|
|
268908
268897
|
] : [],
|
|
268909
|
-
...thegraph ?
|
|
268898
|
+
...thegraph ? thegraph.filter((endpoint) => endpoint.success).map(({ endpoint }) => {
|
|
268910
268899
|
const name2 = endpoint.split("/").pop();
|
|
268911
268900
|
return {
|
|
268912
268901
|
name: `thegraph-${name2}`,
|
|
@@ -270604,6 +270593,17 @@ function getMinioEndpoints(service) {
|
|
|
270604
270593
|
};
|
|
270605
270594
|
}
|
|
270606
270595
|
|
|
270596
|
+
// src/utils/instance-url-utils.ts
|
|
270597
|
+
function sanitizeInstanceUrl(url) {
|
|
270598
|
+
const instanceUrl = new URL(url);
|
|
270599
|
+
return instanceUrl.origin;
|
|
270600
|
+
}
|
|
270601
|
+
function sanitizeAndValidateInstanceUrl(url) {
|
|
270602
|
+
const sanitizedUrl = sanitizeInstanceUrl(url);
|
|
270603
|
+
validate(UrlSchema, sanitizedUrl);
|
|
270604
|
+
return sanitizedUrl;
|
|
270605
|
+
}
|
|
270606
|
+
|
|
270607
270607
|
// ../utils/dist/runtime.mjs
|
|
270608
270608
|
function ensureServer() {
|
|
270609
270609
|
if (isBrowser) {
|
|
@@ -272950,7 +272950,8 @@ async function servicePrompt({
|
|
|
272950
272950
|
}
|
|
272951
272951
|
|
|
272952
272952
|
// src/commands/connect/blockchain-node.prompt.ts
|
|
272953
|
-
async function blockchainNodePrompt(env2, nodes, accept) {
|
|
272953
|
+
async function blockchainNodePrompt(env2, nodes, accept, filterRunningOnly = false) {
|
|
272954
|
+
const choices = filterRunningOnly ? nodes.filter((node) => node.status === "COMPLETED") : nodes;
|
|
272954
272955
|
return servicePrompt({
|
|
272955
272956
|
env: env2,
|
|
272956
272957
|
services: nodes,
|
|
@@ -272960,7 +272961,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272960
272961
|
return esm_default2({
|
|
272961
272962
|
message: "Which blockchain node do you want to connect to?",
|
|
272962
272963
|
choices: [
|
|
272963
|
-
...
|
|
272964
|
+
...choices.map((node) => ({
|
|
272964
272965
|
name: node.name,
|
|
272965
272966
|
value: node
|
|
272966
272967
|
})),
|
|
@@ -273085,26 +273086,46 @@ async function hdPrivateKeyPrompt(env2, privateKeys, accept) {
|
|
|
273085
273086
|
}
|
|
273086
273087
|
|
|
273087
273088
|
// src/commands/connect/instance.prompt.ts
|
|
273088
|
-
async function instancePrompt(env2, accept) {
|
|
273089
|
+
async function instancePrompt(env2, accept, freeTextInput = false) {
|
|
273090
|
+
const knownInstances = await getInstances();
|
|
273089
273091
|
const autoAccept = !!accept || is_in_ci_default;
|
|
273090
|
-
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? "https://console.settlemint.com";
|
|
273091
|
-
const defaultPossible =
|
|
273092
|
+
const defaultInstance = env2.SETTLEMINT_INSTANCE ?? knownInstances[0] ?? "https://console.settlemint.com";
|
|
273093
|
+
const defaultPossible = autoAccept && defaultInstance;
|
|
273092
273094
|
if (defaultPossible) {
|
|
273093
273095
|
return defaultInstance;
|
|
273094
273096
|
}
|
|
273095
|
-
|
|
273096
|
-
|
|
273097
|
-
|
|
273098
|
-
|
|
273099
|
-
|
|
273100
|
-
|
|
273101
|
-
|
|
273102
|
-
|
|
273103
|
-
|
|
273104
|
-
|
|
273105
|
-
|
|
273106
|
-
|
|
273107
|
-
|
|
273097
|
+
if (freeTextInput) {
|
|
273098
|
+
const instance = await esm_default4({
|
|
273099
|
+
message: "What is the URL of your SettleMint instance?",
|
|
273100
|
+
default: defaultInstance,
|
|
273101
|
+
required: true,
|
|
273102
|
+
validate(value4) {
|
|
273103
|
+
try {
|
|
273104
|
+
validate3(UrlSchema3, value4);
|
|
273105
|
+
return true;
|
|
273106
|
+
} catch (error5) {
|
|
273107
|
+
return "Invalid URL";
|
|
273108
|
+
}
|
|
273109
|
+
},
|
|
273110
|
+
transformer: (value4) => value4.trim()
|
|
273111
|
+
});
|
|
273112
|
+
return sanitizeInstanceUrl(instance);
|
|
273113
|
+
}
|
|
273114
|
+
if (knownInstances.length === 0) {
|
|
273115
|
+
cancel2("No instances found. Please run `settlemint login` to configure an instance.");
|
|
273116
|
+
}
|
|
273117
|
+
if (knownInstances.length === 1) {
|
|
273118
|
+
return knownInstances[0];
|
|
273119
|
+
}
|
|
273120
|
+
return esm_default2({
|
|
273121
|
+
message: "What SettleMint instance do you want to connect to?",
|
|
273122
|
+
choices: [
|
|
273123
|
+
...knownInstances.map((instance) => ({
|
|
273124
|
+
name: instance,
|
|
273125
|
+
value: instance
|
|
273126
|
+
}))
|
|
273127
|
+
],
|
|
273128
|
+
default: defaultInstance
|
|
273108
273129
|
});
|
|
273109
273130
|
}
|
|
273110
273131
|
|
|
@@ -273229,18 +273250,19 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273229
273250
|
}
|
|
273230
273251
|
|
|
273231
273252
|
// src/commands/connect/thegraph.prompt.ts
|
|
273232
|
-
async function theGraphPrompt(env2, middlewares, accept) {
|
|
273233
|
-
const
|
|
273253
|
+
async function theGraphPrompt(env2, middlewares, accept, filterRunningOnly = false) {
|
|
273254
|
+
const graphMiddlewares = middlewares.filter((middleware) => middleware.__typename === "HAGraphMiddleware");
|
|
273255
|
+
const choices = filterRunningOnly ? graphMiddlewares.filter((middleware) => middleware.status === "COMPLETED") : graphMiddlewares;
|
|
273234
273256
|
return servicePrompt({
|
|
273235
273257
|
env: env2,
|
|
273236
|
-
services:
|
|
273258
|
+
services: graphMiddlewares,
|
|
273237
273259
|
accept,
|
|
273238
273260
|
envKey: "SETTLEMINT_THEGRAPH",
|
|
273239
273261
|
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273240
273262
|
return esm_default2({
|
|
273241
273263
|
message: "Which The Graph instance do you want to connect to?",
|
|
273242
273264
|
choices: [
|
|
273243
|
-
...
|
|
273265
|
+
...choices.map((middleware) => ({
|
|
273244
273266
|
name: middleware.name,
|
|
273245
273267
|
value: middleware
|
|
273246
273268
|
})),
|
|
@@ -273285,18 +273307,18 @@ async function workspacePrompt(env2, workspaces, accept) {
|
|
|
273285
273307
|
|
|
273286
273308
|
// src/commands/connect.ts
|
|
273287
273309
|
function connectCommand() {
|
|
273288
|
-
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod }) => {
|
|
273310
|
+
return new Command("connect").option("--prod", "Connect to your production environment").option("-a, --accept-defaults", "Accept the default and previously set values").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").description("Connects your project to your application on SettleMint").action(async ({ acceptDefaults, prod, instance }) => {
|
|
273289
273311
|
intro("Connecting your dApp to SettleMint");
|
|
273290
273312
|
const env2 = await loadEnv2(false, !!prod);
|
|
273291
|
-
const
|
|
273292
|
-
const personalAccessToken = await getInstanceCredentials(
|
|
273313
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
273314
|
+
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
273293
273315
|
if (!personalAccessToken) {
|
|
273294
273316
|
return missingPersonalAccessTokenError();
|
|
273295
273317
|
}
|
|
273296
273318
|
const accessToken = personalAccessToken.personalAccessToken;
|
|
273297
273319
|
const settlemint = createSettleMintClient({
|
|
273298
273320
|
accessToken,
|
|
273299
|
-
instance
|
|
273321
|
+
instance: selectedInstance
|
|
273300
273322
|
});
|
|
273301
273323
|
const workspaces = await workspaceSpinner(settlemint);
|
|
273302
273324
|
const workspace = await workspacePrompt(env2, workspaces, acceptDefaults);
|
|
@@ -273334,7 +273356,7 @@ function connectCommand() {
|
|
|
273334
273356
|
}
|
|
273335
273357
|
await writeEnvSpinner(!!prod, {
|
|
273336
273358
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273337
|
-
SETTLEMINT_INSTANCE:
|
|
273359
|
+
SETTLEMINT_INSTANCE: selectedInstance,
|
|
273338
273360
|
SETTLEMINT_WORKSPACE: workspace.uniqueName,
|
|
273339
273361
|
SETTLEMINT_APPLICATION: application.uniqueName,
|
|
273340
273362
|
SETTLEMINT_BLOCKCHAIN_NETWORK: blockchainNode?.blockchainNetwork?.uniqueName,
|
|
@@ -274253,7 +274275,10 @@ function loginCommand() {
|
|
|
274253
274275
|
intro("Login to your SettleMint account");
|
|
274254
274276
|
const autoAccept = !!acceptDefaults || !!tokenStdin;
|
|
274255
274277
|
const env2 = await loadEnv2(false, false);
|
|
274256
|
-
|
|
274278
|
+
if (instance) {
|
|
274279
|
+
validate3(UrlSchema, instance);
|
|
274280
|
+
}
|
|
274281
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
274257
274282
|
let personalAccessToken = "";
|
|
274258
274283
|
if (tokenStdin) {
|
|
274259
274284
|
if (cmd2.args.length > 0) {
|
|
@@ -274498,9 +274523,8 @@ function getCreateCommand({
|
|
|
274498
274523
|
}
|
|
274499
274524
|
execute2(cmd2, async ({ acceptDefaults, prod, default: isDefault, wait, restartIfTimeout, provider, region }, createFunction) => {
|
|
274500
274525
|
intro(`Creating ${type4} in the SettleMint platform`);
|
|
274501
|
-
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
|
274502
274526
|
const env2 = await loadEnv2(false, !!prod);
|
|
274503
|
-
const instance = await instancePrompt(env2,
|
|
274527
|
+
const instance = await instancePrompt(env2, acceptDefaults);
|
|
274504
274528
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
274505
274529
|
env: env2,
|
|
274506
274530
|
instance,
|
|
@@ -275926,7 +275950,7 @@ function customDeploymentsUpdateCommand() {
|
|
|
275926
275950
|
const env2 = await loadEnv2(false, !!prod);
|
|
275927
275951
|
const customDeploymentUniqueName = uniqueName ?? env2.SETTLEMINT_CUSTOM_DEPLOYMENT;
|
|
275928
275952
|
if (!customDeploymentUniqueName) {
|
|
275929
|
-
|
|
275953
|
+
cancel("No custom deployment unique name specified. Please provide it either via the --unique-name flag or by setting the SETTLEMINT_CUSTOM_DEPLOYMENT environment variable");
|
|
275930
275954
|
}
|
|
275931
275955
|
const instance = await instancePrompt(env2, true);
|
|
275932
275956
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
@@ -275964,18 +275988,18 @@ function updateCommand() {
|
|
|
275964
275988
|
|
|
275965
275989
|
// src/commands/platform/config.ts
|
|
275966
275990
|
function configCommand() {
|
|
275967
|
-
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").action(async ({ prod }) => {
|
|
275991
|
+
return new Command("config").alias("c").description("Get platform configuration").option("--prod", "Connect to your production environment").option("-i, --instance <instance>", "The instance to connect to (defaults to the instance in the .env file)").action(async ({ prod, instance }) => {
|
|
275968
275992
|
intro("Getting platform configuration");
|
|
275969
275993
|
const env2 = await loadEnv2(false, !!prod);
|
|
275970
|
-
const
|
|
275994
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
275971
275995
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275972
275996
|
env: env2,
|
|
275973
|
-
instance,
|
|
275997
|
+
instance: selectedInstance,
|
|
275974
275998
|
prefer: "personal"
|
|
275975
275999
|
});
|
|
275976
276000
|
const settlemint = createSettleMintClient({
|
|
275977
276001
|
accessToken,
|
|
275978
|
-
instance
|
|
276002
|
+
instance: selectedInstance
|
|
275979
276003
|
});
|
|
275980
276004
|
const platformConfig = await settlemint.platform.config();
|
|
275981
276005
|
note2(`Providers and regions:
|
|
@@ -276238,7 +276262,16 @@ function hardhatDeployLocalCommand() {
|
|
|
276238
276262
|
|
|
276239
276263
|
// src/error/service-not-running-error.ts
|
|
276240
276264
|
function serviceNotRunningError(service, status) {
|
|
276241
|
-
return cancel2(`The ${service} service is not in a Running state (status: ${status})
|
|
276265
|
+
return cancel2(`The ${service} service is not in a Running state (status: ${status}). ${getStatusAction(status)}`);
|
|
276266
|
+
}
|
|
276267
|
+
function getStatusAction(status) {
|
|
276268
|
+
if (status === "PAUSED" || status === "AUTO_PAUSED") {
|
|
276269
|
+
return "Please resume the service.";
|
|
276270
|
+
}
|
|
276271
|
+
if (status === "FAILED") {
|
|
276272
|
+
return "Please try restarting the service or contact support.";
|
|
276273
|
+
}
|
|
276274
|
+
return "Please try again later.";
|
|
276242
276275
|
}
|
|
276243
276276
|
|
|
276244
276277
|
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
|
@@ -276264,7 +276297,7 @@ async function selectTargetNode({
|
|
|
276264
276297
|
if (nodesWithActivePrivateKey.length === 0) {
|
|
276265
276298
|
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276266
276299
|
}
|
|
276267
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept);
|
|
276300
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept, true);
|
|
276268
276301
|
if (!blockchainNode) {
|
|
276269
276302
|
return nothingSelectedError("EVM blockchain node");
|
|
276270
276303
|
}
|
|
@@ -276708,7 +276741,7 @@ async function getTheGraphMiddleware({
|
|
|
276708
276741
|
return missingApplication();
|
|
276709
276742
|
}
|
|
276710
276743
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
276711
|
-
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
276744
|
+
return theGraphPrompt(env2, middlewares, autoAccept, true);
|
|
276712
276745
|
}
|
|
276713
276746
|
async function getTheGraphNetwork({
|
|
276714
276747
|
theGraphMiddleware,
|
|
@@ -276922,4 +276955,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276922
276955
|
ascii();
|
|
276923
276956
|
sdkCliCommand();
|
|
276924
276957
|
|
|
276925
|
-
//# debugId=
|
|
276958
|
+
//# debugId=3D8C362E9BFF301064756E2164756E21
|