@settlemint/sdk-cli 0.9.3-pr14f171b0 → 0.9.3-pr2f4dbd76
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 +119 -86
- package/dist/cli.js.map +19 -17
- 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.ULILRYrj0X:/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.ULILRYrj0X:/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.ULILRYrj0X:/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.ULILRYrj0X:/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-pr2f4dbd76",
|
|
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.ULILRYrj0X:/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-pr2f4dbd76",
|
|
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-pr2f4dbd76",
|
|
256845
|
+
"@settlemint/sdk-utils": "0.9.3-pr2f4dbd76",
|
|
256846
256846
|
"get-tsconfig": "4.8.1",
|
|
256847
256847
|
giget: "1.2.3"
|
|
256848
256848
|
},
|
|
@@ -267906,7 +267906,13 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267906
267906
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
267907
267907
|
|
|
267908
267908
|
// src/commands/codegen/test-gql-endpoint.ts
|
|
267909
|
-
async function testGqlEndpoint(
|
|
267909
|
+
async function testGqlEndpoint({
|
|
267910
|
+
accessToken,
|
|
267911
|
+
hasuraAdminSecret,
|
|
267912
|
+
gqlEndpoint,
|
|
267913
|
+
isHasura = false,
|
|
267914
|
+
maxRetries = 3
|
|
267915
|
+
}) {
|
|
267910
267916
|
if (!gqlEndpoint) {
|
|
267911
267917
|
return false;
|
|
267912
267918
|
}
|
|
@@ -268848,12 +268854,29 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268848
268854
|
const name2 = gqlEndpoint.split("/").pop();
|
|
268849
268855
|
return name2 && (!thegraphSubgraphNames || thegraphSubgraphNames.includes(name2));
|
|
268850
268856
|
});
|
|
268851
|
-
const [hasura, portal,
|
|
268852
|
-
testGqlEndpoint(
|
|
268853
|
-
|
|
268854
|
-
|
|
268855
|
-
|
|
268857
|
+
const [hasura, portal, blockscout] = await Promise.all([
|
|
268858
|
+
testGqlEndpoint({
|
|
268859
|
+
accessToken,
|
|
268860
|
+
hasuraAdminSecret: env2.SETTLEMINT_HASURA_ADMIN_SECRET,
|
|
268861
|
+
gqlEndpoint: env2.SETTLEMINT_HASURA_ENDPOINT,
|
|
268862
|
+
isHasura: true
|
|
268863
|
+
}),
|
|
268864
|
+
testGqlEndpoint({
|
|
268865
|
+
accessToken,
|
|
268866
|
+
gqlEndpoint: env2.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT
|
|
268867
|
+
}),
|
|
268868
|
+
testGqlEndpoint({
|
|
268869
|
+
accessToken,
|
|
268870
|
+
gqlEndpoint: env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT
|
|
268871
|
+
})
|
|
268856
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
|
+
}));
|
|
268857
268880
|
if (!tsconfig.config.compilerOptions) {
|
|
268858
268881
|
tsconfig.config.compilerOptions = {};
|
|
268859
268882
|
}
|
|
@@ -268872,7 +268895,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268872
268895
|
tadaTurboLocation: "hasura-cache.d.ts"
|
|
268873
268896
|
}
|
|
268874
268897
|
] : [],
|
|
268875
|
-
...thegraph ?
|
|
268898
|
+
...thegraph ? thegraph.filter((endpoint) => endpoint.success).map(({ endpoint }) => {
|
|
268876
268899
|
const name2 = endpoint.split("/").pop();
|
|
268877
268900
|
return {
|
|
268878
268901
|
name: `thegraph-${name2}`,
|
|
@@ -270511,7 +270534,7 @@ async function getGraphEndpoint(service, env2) {
|
|
|
270511
270534
|
const isStarterKit = (id) => id.endsWith("-starterkits");
|
|
270512
270535
|
const testEndpoint = service.subgraphs.find(({ graphqlQueryEndpoint }) => !isStarterKit(graphqlQueryEndpoint?.id))?.graphqlQueryEndpoint?.displayValue;
|
|
270513
270536
|
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,
|
|
270537
|
+
const hasEndpoint = testEndpoint && env2.SETTLEMINT_ACCESS_TOKEN ? await testGqlEndpoint({ accessToken: env2.SETTLEMINT_ACCESS_TOKEN, gqlEndpoint: testEndpoint }) : false;
|
|
270515
270538
|
const endpoints = hasEndpoint ? service.subgraphs.map(({ graphqlQueryEndpoint }) => graphqlQueryEndpoint?.displayValue) : starterKitEndpoint ? [starterKitEndpoint] : [];
|
|
270516
270539
|
if (endpoints.length === 0) {
|
|
270517
270540
|
return {};
|
|
@@ -270570,11 +270593,16 @@ function getMinioEndpoints(service) {
|
|
|
270570
270593
|
};
|
|
270571
270594
|
}
|
|
270572
270595
|
|
|
270573
|
-
// src/utils/
|
|
270596
|
+
// src/utils/instance-url-utils.ts
|
|
270574
270597
|
function sanitizeInstanceUrl(url) {
|
|
270575
270598
|
const instanceUrl = new URL(url);
|
|
270576
270599
|
return instanceUrl.origin;
|
|
270577
270600
|
}
|
|
270601
|
+
function sanitizeAndValidateInstanceUrl(url) {
|
|
270602
|
+
const sanitizedUrl = sanitizeInstanceUrl(url);
|
|
270603
|
+
validate(UrlSchema, sanitizedUrl);
|
|
270604
|
+
return sanitizedUrl;
|
|
270605
|
+
}
|
|
270578
270606
|
|
|
270579
270607
|
// ../utils/dist/runtime.mjs
|
|
270580
270608
|
function ensureServer() {
|
|
@@ -272922,7 +272950,8 @@ async function servicePrompt({
|
|
|
272922
272950
|
}
|
|
272923
272951
|
|
|
272924
272952
|
// src/commands/connect/blockchain-node.prompt.ts
|
|
272925
|
-
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;
|
|
272926
272955
|
return servicePrompt({
|
|
272927
272956
|
env: env2,
|
|
272928
272957
|
services: nodes,
|
|
@@ -272932,7 +272961,7 @@ async function blockchainNodePrompt(env2, nodes, accept) {
|
|
|
272932
272961
|
return esm_default2({
|
|
272933
272962
|
message: "Which blockchain node do you want to connect to?",
|
|
272934
272963
|
choices: [
|
|
272935
|
-
...
|
|
272964
|
+
...choices.map((node) => ({
|
|
272936
272965
|
name: node.name,
|
|
272937
272966
|
value: node
|
|
272938
272967
|
})),
|
|
@@ -273221,18 +273250,19 @@ async function servicesSpinner(settlemint, application) {
|
|
|
273221
273250
|
}
|
|
273222
273251
|
|
|
273223
273252
|
// src/commands/connect/thegraph.prompt.ts
|
|
273224
|
-
async function theGraphPrompt(env2, middlewares, accept) {
|
|
273225
|
-
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;
|
|
273226
273256
|
return servicePrompt({
|
|
273227
273257
|
env: env2,
|
|
273228
|
-
services:
|
|
273258
|
+
services: graphMiddlewares,
|
|
273229
273259
|
accept,
|
|
273230
273260
|
envKey: "SETTLEMINT_THEGRAPH",
|
|
273231
273261
|
defaultHandler: async ({ defaultService: defaultMiddleware }) => {
|
|
273232
273262
|
return esm_default2({
|
|
273233
273263
|
message: "Which The Graph instance do you want to connect to?",
|
|
273234
273264
|
choices: [
|
|
273235
|
-
...
|
|
273265
|
+
...choices.map((middleware) => ({
|
|
273236
273266
|
name: middleware.name,
|
|
273237
273267
|
value: middleware
|
|
273238
273268
|
})),
|
|
@@ -273280,10 +273310,7 @@ function connectCommand() {
|
|
|
273280
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 }) => {
|
|
273281
273311
|
intro("Connecting your dApp to SettleMint");
|
|
273282
273312
|
const env2 = await loadEnv2(false, !!prod);
|
|
273283
|
-
|
|
273284
|
-
validate(UrlSchema, instance);
|
|
273285
|
-
}
|
|
273286
|
-
const selectedInstance = instance ? sanitizeInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
273313
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
273287
273314
|
const personalAccessToken = await getInstanceCredentials(selectedInstance);
|
|
273288
273315
|
if (!personalAccessToken) {
|
|
273289
273316
|
return missingPersonalAccessTokenError();
|
|
@@ -274251,7 +274278,7 @@ function loginCommand() {
|
|
|
274251
274278
|
if (instance) {
|
|
274252
274279
|
validate3(UrlSchema, instance);
|
|
274253
274280
|
}
|
|
274254
|
-
const selectedInstance = instance ?
|
|
274281
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, autoAccept, true);
|
|
274255
274282
|
let personalAccessToken = "";
|
|
274256
274283
|
if (tokenStdin) {
|
|
274257
274284
|
if (cmd2.args.length > 0) {
|
|
@@ -275964,7 +275991,7 @@ function configCommand() {
|
|
|
275964
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 }) => {
|
|
275965
275992
|
intro("Getting platform configuration");
|
|
275966
275993
|
const env2 = await loadEnv2(false, !!prod);
|
|
275967
|
-
const selectedInstance = instance ?
|
|
275994
|
+
const selectedInstance = instance ? sanitizeAndValidateInstanceUrl(instance) : await instancePrompt(env2, true);
|
|
275968
275995
|
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
275969
275996
|
env: env2,
|
|
275970
275997
|
instance: selectedInstance,
|
|
@@ -276233,6 +276260,60 @@ function hardhatDeployLocalCommand() {
|
|
|
276233
276260
|
});
|
|
276234
276261
|
}
|
|
276235
276262
|
|
|
276263
|
+
// src/error/service-not-running-error.ts
|
|
276264
|
+
function serviceNotRunningError(service, 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.";
|
|
276275
|
+
}
|
|
276276
|
+
|
|
276277
|
+
// src/commands/smart-contract-set/hardhat/utils/select-target-node.ts
|
|
276278
|
+
async function selectTargetNode({
|
|
276279
|
+
env: env2,
|
|
276280
|
+
blockchainNodeUniqueName,
|
|
276281
|
+
autoAccept,
|
|
276282
|
+
settlemint
|
|
276283
|
+
}) {
|
|
276284
|
+
const nodeUniqueName = blockchainNodeUniqueName ?? (autoAccept ? env2.SETTLEMINT_BLOCKCHAIN_NODE : undefined);
|
|
276285
|
+
let node = undefined;
|
|
276286
|
+
if (!nodeUniqueName) {
|
|
276287
|
+
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276288
|
+
return missingApplication();
|
|
276289
|
+
}
|
|
276290
|
+
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276291
|
+
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276292
|
+
if (evmNodes.length === 0) {
|
|
276293
|
+
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276294
|
+
}
|
|
276295
|
+
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276296
|
+
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276297
|
+
if (nodesWithActivePrivateKey.length === 0) {
|
|
276298
|
+
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276299
|
+
}
|
|
276300
|
+
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, autoAccept, true);
|
|
276301
|
+
if (!blockchainNode) {
|
|
276302
|
+
return nothingSelectedError("EVM blockchain node");
|
|
276303
|
+
}
|
|
276304
|
+
node = blockchainNode;
|
|
276305
|
+
} else {
|
|
276306
|
+
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276307
|
+
if (!node.isEvm) {
|
|
276308
|
+
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276309
|
+
}
|
|
276310
|
+
}
|
|
276311
|
+
if (node.status !== "COMPLETED") {
|
|
276312
|
+
serviceNotRunningError("blockchain node", node.status);
|
|
276313
|
+
}
|
|
276314
|
+
return node;
|
|
276315
|
+
}
|
|
276316
|
+
|
|
276236
276317
|
// src/commands/smart-contract-set/prompts/address.prompt.ts
|
|
276237
276318
|
async function addressPrompt({
|
|
276238
276319
|
env: env2,
|
|
@@ -276346,33 +276427,7 @@ function hardhatDeployRemoteCommand() {
|
|
|
276346
276427
|
accessToken,
|
|
276347
276428
|
instance
|
|
276348
276429
|
});
|
|
276349
|
-
const
|
|
276350
|
-
let node = undefined;
|
|
276351
|
-
if (!nodeUniqueName) {
|
|
276352
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276353
|
-
return missingApplication();
|
|
276354
|
-
}
|
|
276355
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276356
|
-
const evmNodes = nodes.filter((node2) => node2.isEvm);
|
|
276357
|
-
if (evmNodes.length === 0) {
|
|
276358
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276359
|
-
}
|
|
276360
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node2) => settlemint.blockchainNode.read(node2.uniqueName)));
|
|
276361
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node2) => node2.privateKeys && node2.privateKeys.length > 0);
|
|
276362
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276363
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276364
|
-
}
|
|
276365
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276366
|
-
if (!blockchainNode) {
|
|
276367
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276368
|
-
}
|
|
276369
|
-
node = blockchainNode;
|
|
276370
|
-
} else {
|
|
276371
|
-
node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276372
|
-
if (!node.isEvm) {
|
|
276373
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276374
|
-
}
|
|
276375
|
-
}
|
|
276430
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276376
276431
|
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276377
276432
|
const hardhatConfig = await getHardhatConfigData(envConfig);
|
|
276378
276433
|
if (verify && !hardhatConfig?.etherscan?.apiKey) {
|
|
@@ -276464,33 +276519,8 @@ function hardhatScriptRemoteCommand() {
|
|
|
276464
276519
|
accessToken,
|
|
276465
276520
|
instance
|
|
276466
276521
|
});
|
|
276467
|
-
|
|
276468
|
-
|
|
276469
|
-
if (!env2.SETTLEMINT_APPLICATION) {
|
|
276470
|
-
return missingApplication();
|
|
276471
|
-
}
|
|
276472
|
-
const nodes = await settlemint.blockchainNode.list(env2.SETTLEMINT_APPLICATION);
|
|
276473
|
-
const evmNodes = nodes.filter((node) => node.isEvm);
|
|
276474
|
-
if (evmNodes.length === 0) {
|
|
276475
|
-
cancel("No EVM blockchain nodes found. Please create an EVM blockchain node and try again.");
|
|
276476
|
-
}
|
|
276477
|
-
const nodesWithPrivateKey = await Promise.all(nodes.map((node) => settlemint.blockchainNode.read(node.uniqueName)));
|
|
276478
|
-
const nodesWithActivePrivateKey = nodesWithPrivateKey.filter((node) => node.privateKeys && node.privateKeys.length > 0);
|
|
276479
|
-
if (nodesWithActivePrivateKey.length === 0) {
|
|
276480
|
-
cancel("No EVM blockchain nodes with private keys found. Please activate a private key on your EVM blockchain node and try again.");
|
|
276481
|
-
}
|
|
276482
|
-
const blockchainNode = await blockchainNodePrompt(env2, nodesWithActivePrivateKey, acceptDefaults);
|
|
276483
|
-
if (!blockchainNode) {
|
|
276484
|
-
return nothingSelectedError("EVM blockchain node");
|
|
276485
|
-
}
|
|
276486
|
-
nodeUniqueName = blockchainNode.uniqueName;
|
|
276487
|
-
} else {
|
|
276488
|
-
const node = await settlemint.blockchainNode.read(nodeUniqueName);
|
|
276489
|
-
if (!node.isEvm) {
|
|
276490
|
-
cancel("The specified blockchain node is not an EVM blockchain node. Please specify an EVM blockchain node to continue.");
|
|
276491
|
-
}
|
|
276492
|
-
}
|
|
276493
|
-
const envConfig = await settlemint.foundry.env(nodeUniqueName);
|
|
276522
|
+
const node = await selectTargetNode({ env: env2, blockchainNodeUniqueName, autoAccept, settlemint });
|
|
276523
|
+
const envConfig = await settlemint.foundry.env(node.uniqueName);
|
|
276494
276524
|
const { command, args } = await getPackageManagerExecutable();
|
|
276495
276525
|
await executeCommand(command, [...args, "hardhat", "run", script, "--network", "btp", ...compile ? ["--no-compile"] : []], { env: envConfig });
|
|
276496
276526
|
});
|
|
@@ -276711,7 +276741,7 @@ async function getTheGraphMiddleware({
|
|
|
276711
276741
|
return missingApplication();
|
|
276712
276742
|
}
|
|
276713
276743
|
const middlewares = await settlemintClient.middleware.list(env2.SETTLEMINT_APPLICATION);
|
|
276714
|
-
return theGraphPrompt(env2, middlewares, autoAccept);
|
|
276744
|
+
return theGraphPrompt(env2, middlewares, autoAccept, true);
|
|
276715
276745
|
}
|
|
276716
276746
|
async function getTheGraphNetwork({
|
|
276717
276747
|
theGraphMiddleware,
|
|
@@ -276821,6 +276851,9 @@ function subgraphDeployCommand() {
|
|
|
276821
276851
|
if (!theGraphMiddleware) {
|
|
276822
276852
|
return nothingSelectedError("graph middleware");
|
|
276823
276853
|
}
|
|
276854
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
|
276855
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
|
276856
|
+
}
|
|
276824
276857
|
const network = await getTheGraphNetwork({ theGraphMiddleware, env: env2, instance, accessToken });
|
|
276825
276858
|
await subgraphSetup({
|
|
276826
276859
|
network
|
|
@@ -276922,4 +276955,4 @@ function sdkCliCommand(exitOverride = undefined) {
|
|
|
276922
276955
|
ascii();
|
|
276923
276956
|
sdkCliCommand();
|
|
276924
276957
|
|
|
276925
|
-
//# debugId=
|
|
276958
|
+
//# debugId=567FE2EF0915565064756E2164756E21
|