@settlemint/sdk-cli 0.8.3 → 0.8.4-mainb3e561b7
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 +183 -151
- package/dist/cli.js.map +13 -13
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -197427,7 +197427,7 @@ ${Bt.cyan(Yt)}
|
|
|
197427
197427
|
code: "ENOENT"
|
|
197428
197428
|
}), getPathInfo = (e9, t7) => {
|
|
197429
197429
|
var r6 = t7.colon || or;
|
|
197430
|
-
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
197430
|
+
var i6 = e9.match(/\//) || nr && e9.match(/\\/) ? [""] : [...nr ? [process.cwd()] : [], ...(t7.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.gT3dTj0tqe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(r6)];
|
|
197431
197431
|
var n6 = nr ? t7.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
197432
197432
|
var a5 = nr ? n6.split(r6) : [""];
|
|
197433
197433
|
if (nr) {
|
|
@@ -200564,7 +200564,7 @@ ${whileRunning(e9)}`;
|
|
|
200564
200564
|
};
|
|
200565
200565
|
ni = Object.assign(async function _main() {
|
|
200566
200566
|
var e9 = new Cli({
|
|
200567
|
-
binaryVersion: "0.8.
|
|
200567
|
+
binaryVersion: "0.8.4-mainb3e561b7",
|
|
200568
200568
|
binaryLabel: "gql.tada CLI",
|
|
200569
200569
|
binaryName: "gql.tada"
|
|
200570
200570
|
});
|
|
@@ -218401,7 +218401,7 @@ var require_lib4 = __commonJS((exports, module) => {
|
|
|
218401
218401
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
218402
218402
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
218403
218403
|
var getPathInfo2 = (cmd2, {
|
|
218404
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218404
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.gT3dTj0tqe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218405
218405
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
218406
218406
|
delimiter: optDelimiter = delimiter
|
|
218407
218407
|
}) => {
|
|
@@ -218605,7 +218605,7 @@ var require_lib5 = __commonJS((exports, module) => {
|
|
|
218605
218605
|
let pathToInitial;
|
|
218606
218606
|
try {
|
|
218607
218607
|
pathToInitial = which.sync(initialCmd, {
|
|
218608
|
-
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
218608
|
+
path: options.env && findInObject(options.env, "PATH") || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.gT3dTj0tqe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
218609
218609
|
pathext: options.env && findInObject(options.env, "PATHEXT") || process.env.PATHEXT
|
|
218610
218610
|
}).toLowerCase();
|
|
218611
218611
|
} catch (err) {
|
|
@@ -219322,7 +219322,7 @@ var require_lib6 = __commonJS((exports, module) => {
|
|
|
219322
219322
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
219323
219323
|
var getNotFoundError2 = (cmd2) => Object.assign(new Error(`not found: ${cmd2}`), { code: "ENOENT" });
|
|
219324
219324
|
var getPathInfo2 = (cmd2, {
|
|
219325
|
-
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
219325
|
+
path: optPath = "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.gT3dTj0tqe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
|
|
219326
219326
|
pathExt: optPathExt = process.env.PATHEXT,
|
|
219327
219327
|
delimiter: optDelimiter = delimiter
|
|
219328
219328
|
}) => {
|
|
@@ -235213,7 +235213,7 @@ var require_which2 = __commonJS((exports, module) => {
|
|
|
235213
235213
|
const colon = opt2.colon || COLON;
|
|
235214
235214
|
const pathEnv = cmd2.match(/\//) || isWindows2 && cmd2.match(/\\/) ? [""] : [
|
|
235215
235215
|
...isWindows2 ? [process.cwd()] : [],
|
|
235216
|
-
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.
|
|
235216
|
+
...(opt2.path || "/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/cli/node_modules/.bin:/home/runner/work/sdk/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/bunx-1001-turbo@latest/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/sdk/node_modules/.bin:/home/runner/work/sdk/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/22.12.0/x64/bin:/home/runner/.bun/bin:/tmp/tmp.gT3dTj0tqe:/nsc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/snap/bin/:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/home/runner/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin").split(colon)
|
|
235217
235217
|
];
|
|
235218
235218
|
const pathExtExe = isWindows2 ? opt2.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
235219
235219
|
const pathExt = isWindows2 ? pathExtExe.split(colon) : [""];
|
|
@@ -267669,6 +267669,10 @@ async function executeCommand(command, args, options) {
|
|
|
267669
267669
|
});
|
|
267670
267670
|
});
|
|
267671
267671
|
}
|
|
267672
|
+
var note = (message) => {
|
|
267673
|
+
console.log("");
|
|
267674
|
+
console.log(maskTokens(message));
|
|
267675
|
+
};
|
|
267672
267676
|
var ApplicationAccessTokenSchema = z3.string().regex(/^sm_aat_.*$/);
|
|
267673
267677
|
var PersonalAccessTokenSchema = z3.string().regex(/^sm_pat_.*$/);
|
|
267674
267678
|
var AccessTokenSchema = z3.string().regex(/^sm_pat_.*|sm_aat_.*$/);
|
|
@@ -267761,10 +267765,11 @@ async function loadEnvironmentEnv(validateEnv, prod, path5 = process.cwd()) {
|
|
|
267761
267765
|
if (!parsed) {
|
|
267762
267766
|
parsed = {};
|
|
267763
267767
|
}
|
|
267768
|
+
const defaultEnv = Object.fromEntries(Object.entries(process.env).filter(([_4, value4]) => typeof value4 === "string" && value4 !== ""));
|
|
267764
267769
|
try {
|
|
267765
267770
|
return validate(validateEnv ? DotEnvSchema : DotEnvSchemaPartial, {
|
|
267766
267771
|
...parsed,
|
|
267767
|
-
...
|
|
267772
|
+
...defaultEnv
|
|
267768
267773
|
});
|
|
267769
267774
|
} catch (error5) {
|
|
267770
267775
|
cancel(error5.message);
|
|
@@ -267821,7 +267826,7 @@ var intro = (msg) => {
|
|
|
267821
267826
|
console.log(magentaBright(maskTokens2(msg)));
|
|
267822
267827
|
console.log("");
|
|
267823
267828
|
};
|
|
267824
|
-
var
|
|
267829
|
+
var note2 = (message) => {
|
|
267825
267830
|
console.log("");
|
|
267826
267831
|
console.log(maskTokens2(message));
|
|
267827
267832
|
};
|
|
@@ -267841,7 +267846,7 @@ var spinner = async (options) => {
|
|
|
267841
267846
|
return result;
|
|
267842
267847
|
} catch (error5) {
|
|
267843
267848
|
spinner2.error(redBright(`${options.startMessage} --> Error!`));
|
|
267844
|
-
|
|
267849
|
+
note2(redBright(`${error5.message}
|
|
267845
267850
|
${error5.stack}`));
|
|
267846
267851
|
process.exit(1);
|
|
267847
267852
|
}
|
|
@@ -267864,7 +267869,7 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
|
267864
267869
|
return false;
|
|
267865
267870
|
}
|
|
267866
267871
|
if (subgraphNames && !subgraphNames.includes(name2)) {
|
|
267867
|
-
|
|
267872
|
+
note2(`[SKIPPED] Generating TheGraph subgraph ${name2}`);
|
|
267868
267873
|
return false;
|
|
267869
267874
|
}
|
|
267870
267875
|
template.push(`import type { introspection as ${name2}Introspection } from "@schemas/the-graph-env-${name2}"`);
|
|
@@ -267872,7 +267877,7 @@ async function codegenTheGraph(env2, subgraphNames) {
|
|
|
267872
267877
|
});
|
|
267873
267878
|
for (const gqlEndpoint of toGenerate) {
|
|
267874
267879
|
const name2 = gqlEndpoint.split("/").pop();
|
|
267875
|
-
|
|
267880
|
+
note2(`Generating TheGraph subgraph ${name2}`);
|
|
267876
267881
|
await generateSchema({
|
|
267877
267882
|
input: gqlEndpoint,
|
|
267878
267883
|
output: `the-graph-schema-${name2}.graphql`,
|
|
@@ -267908,7 +267913,7 @@ export const { client: theGraphClient${nameSuffix}, graphql: theGraphGraphql${na
|
|
|
267908
267913
|
}
|
|
267909
267914
|
|
|
267910
267915
|
// src/commands/codegen/codegen-tsconfig.ts
|
|
267911
|
-
import { writeFile as
|
|
267916
|
+
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
267912
267917
|
|
|
267913
267918
|
// src/commands/codegen/test-gql-endpoint.ts
|
|
267914
267919
|
async function testGqlEndpoint(accessToken, hasuraAdminSecret, gqlEndpoint, isHasura = false, maxRetries = 3) {
|
|
@@ -267955,6 +267960,108 @@ async function testGqlEndpoint(accessToken, hasuraAdminSecret, gqlEndpoint, isHa
|
|
|
267955
267960
|
return false;
|
|
267956
267961
|
}
|
|
267957
267962
|
|
|
267963
|
+
// src/error/missing-config-error.ts
|
|
267964
|
+
function missingAccessTokenError(personalAccessTokenExists) {
|
|
267965
|
+
if (personalAccessTokenExists) {
|
|
267966
|
+
return cancel2("No access token found, please run `settlemint connect` to connect to your instance.");
|
|
267967
|
+
}
|
|
267968
|
+
return cancel2("No personal access token found, please run `settlemint login`, then run `settlemint connect` to connect using an application access token.");
|
|
267969
|
+
}
|
|
267970
|
+
function missingPersonalAccessTokenError() {
|
|
267971
|
+
return cancel2("No personal access token found for instance, please run `settlemint login` to login to your instance");
|
|
267972
|
+
}
|
|
267973
|
+
|
|
267974
|
+
// src/utils/config.ts
|
|
267975
|
+
import { mkdir as mkdir3, readFile as readFile3, writeFile as writeFile3 } from "node:fs/promises";
|
|
267976
|
+
import { homedir } from "node:os";
|
|
267977
|
+
import { join as join4 } from "node:path";
|
|
267978
|
+
var CONFIG_DIR = join4(homedir(), ".config", "settlemint");
|
|
267979
|
+
var CONFIG_FILE = join4(CONFIG_DIR, "config.json");
|
|
267980
|
+
async function ensureConfigDir() {
|
|
267981
|
+
if (!await exists(CONFIG_DIR)) {
|
|
267982
|
+
await mkdir3(CONFIG_DIR, { recursive: true });
|
|
267983
|
+
}
|
|
267984
|
+
}
|
|
267985
|
+
async function readConfig() {
|
|
267986
|
+
await ensureConfigDir();
|
|
267987
|
+
try {
|
|
267988
|
+
const content = await readFile3(CONFIG_FILE, "utf-8");
|
|
267989
|
+
return tryParseJson(content, { instances: {} });
|
|
267990
|
+
} catch (error5) {
|
|
267991
|
+
return { instances: {} };
|
|
267992
|
+
}
|
|
267993
|
+
}
|
|
267994
|
+
async function writeConfig(config3) {
|
|
267995
|
+
await ensureConfigDir();
|
|
267996
|
+
await writeFile3(CONFIG_FILE, JSON.stringify(config3, null, 2));
|
|
267997
|
+
}
|
|
267998
|
+
async function storeCredentials(token, instance) {
|
|
267999
|
+
const config3 = await readConfig();
|
|
268000
|
+
if (!config3.instances) {
|
|
268001
|
+
config3.instances = {};
|
|
268002
|
+
}
|
|
268003
|
+
config3.instances[instance] = {
|
|
268004
|
+
personalAccessToken: token,
|
|
268005
|
+
lastUsed: new Date().toISOString()
|
|
268006
|
+
};
|
|
268007
|
+
if (!config3.defaultInstance || Object.keys(config3.instances).length === 1) {
|
|
268008
|
+
config3.defaultInstance = instance;
|
|
268009
|
+
}
|
|
268010
|
+
await writeConfig(config3);
|
|
268011
|
+
}
|
|
268012
|
+
async function getInstanceCredentials(instance) {
|
|
268013
|
+
const config3 = await readConfig();
|
|
268014
|
+
const instanceConfig = config3.instances[instance];
|
|
268015
|
+
if (!instanceConfig) {
|
|
268016
|
+
return;
|
|
268017
|
+
}
|
|
268018
|
+
return { personalAccessToken: instanceConfig.personalAccessToken };
|
|
268019
|
+
}
|
|
268020
|
+
async function getInstances() {
|
|
268021
|
+
const config3 = await readConfig();
|
|
268022
|
+
return Object.keys(config3.instances);
|
|
268023
|
+
}
|
|
268024
|
+
async function getDefaultInstance() {
|
|
268025
|
+
const config3 = await readConfig();
|
|
268026
|
+
return config3.defaultInstance;
|
|
268027
|
+
}
|
|
268028
|
+
async function setDefaultInstance(instance) {
|
|
268029
|
+
const config3 = await readConfig();
|
|
268030
|
+
if (!config3.instances[instance]) {
|
|
268031
|
+
throw new Error(`Instance ${instance} is not configured`);
|
|
268032
|
+
}
|
|
268033
|
+
config3.defaultInstance = instance;
|
|
268034
|
+
await writeConfig(config3);
|
|
268035
|
+
}
|
|
268036
|
+
async function removeCredentials(instance) {
|
|
268037
|
+
const config3 = await readConfig();
|
|
268038
|
+
delete config3.instances[instance];
|
|
268039
|
+
if (config3.defaultInstance === instance) {
|
|
268040
|
+
config3.defaultInstance = undefined;
|
|
268041
|
+
}
|
|
268042
|
+
await writeConfig(config3);
|
|
268043
|
+
}
|
|
268044
|
+
|
|
268045
|
+
// src/utils/get-app-or-personal-token.ts
|
|
268046
|
+
var getApplicationOrPersonalAccessToken = async ({
|
|
268047
|
+
env: env2,
|
|
268048
|
+
instance,
|
|
268049
|
+
prefer
|
|
268050
|
+
}) => {
|
|
268051
|
+
const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
268052
|
+
const personalAccessToken = (await getInstanceCredentials(instance))?.personalAccessToken;
|
|
268053
|
+
const preferredToken = prefer === "application" ? applicationAccessToken : personalAccessToken;
|
|
268054
|
+
const fallbackToken = prefer === "application" ? personalAccessToken : applicationAccessToken;
|
|
268055
|
+
const allowFallback = prefer === "application";
|
|
268056
|
+
if (preferredToken) {
|
|
268057
|
+
return preferredToken;
|
|
268058
|
+
}
|
|
268059
|
+
if (allowFallback && fallbackToken) {
|
|
268060
|
+
return fallbackToken;
|
|
268061
|
+
}
|
|
268062
|
+
return prefer === "personal" ? missingPersonalAccessTokenError() : missingAccessTokenError(!!personalAccessToken);
|
|
268063
|
+
};
|
|
268064
|
+
|
|
267958
268065
|
// ../../node_modules/get-tsconfig/dist/index.mjs
|
|
267959
268066
|
import a6 from "node:path";
|
|
267960
268067
|
import ee2 from "node:fs";
|
|
@@ -268836,7 +268943,11 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268836
268943
|
blockscout: false
|
|
268837
268944
|
};
|
|
268838
268945
|
}
|
|
268839
|
-
const accessToken =
|
|
268946
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
|
268947
|
+
env: env2,
|
|
268948
|
+
instance: env2.SETTLEMINT_INSTANCE,
|
|
268949
|
+
prefer: "application"
|
|
268950
|
+
});
|
|
268840
268951
|
if (!accessToken) {
|
|
268841
268952
|
return {
|
|
268842
268953
|
hasura: false,
|
|
@@ -268909,7 +269020,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
|
268909
269020
|
tsconfig.config.compilerOptions.paths = {};
|
|
268910
269021
|
}
|
|
268911
269022
|
tsconfig.config.compilerOptions.paths["@schemas/*"] = ["./*.d.ts"];
|
|
268912
|
-
await
|
|
269023
|
+
await writeFile4(tsconfig.path, JSON.stringify(tsconfig.config, null, 2), "utf8");
|
|
268913
269024
|
return {
|
|
268914
269025
|
hasura,
|
|
268915
269026
|
portal,
|
|
@@ -269964,9 +270075,9 @@ var {
|
|
|
269964
270075
|
} = import__.default;
|
|
269965
270076
|
|
|
269966
270077
|
// ../utils/dist/environment.mjs
|
|
269967
|
-
import { join as
|
|
270078
|
+
import { join as join5 } from "node:path";
|
|
269968
270079
|
var import_dotenvx3 = __toESM(require_main2(), 1);
|
|
269969
|
-
import { readFile as
|
|
270080
|
+
import { readFile as readFile4, writeFile as writeFile5 } from "node:fs/promises";
|
|
269970
270081
|
import { dirname as dirname32, join as join22 } from "node:path";
|
|
269971
270082
|
import { stat as stat7 } from "node:fs/promises";
|
|
269972
270083
|
import { dirname as dirname22 } from "node:path";
|
|
@@ -270067,15 +270178,16 @@ async function loadEnvironmentEnv2(validateEnv, prod, path5 = process.cwd()) {
|
|
|
270067
270178
|
logLevel: "error",
|
|
270068
270179
|
overload: true,
|
|
270069
270180
|
quiet: true,
|
|
270070
|
-
path:
|
|
270181
|
+
path: join5(path5, ".env")
|
|
270071
270182
|
});
|
|
270072
270183
|
if (!parsed) {
|
|
270073
270184
|
parsed = {};
|
|
270074
270185
|
}
|
|
270186
|
+
const defaultEnv = Object.fromEntries(Object.entries(process.env).filter(([_5, value4]) => typeof value4 === "string" && value4 !== ""));
|
|
270075
270187
|
try {
|
|
270076
270188
|
return validate2(validateEnv ? DotEnvSchema2 : DotEnvSchemaPartial2, {
|
|
270077
270189
|
...parsed,
|
|
270078
|
-
...
|
|
270190
|
+
...defaultEnv
|
|
270079
270191
|
});
|
|
270080
270192
|
} catch (error5) {
|
|
270081
270193
|
cancel3(error5.message);
|
|
@@ -270102,7 +270214,7 @@ async function findMonoRepoRoot(startDir) {
|
|
|
270102
270214
|
while (currentDir !== "/") {
|
|
270103
270215
|
const packageJsonPath = join22(currentDir, "package.json");
|
|
270104
270216
|
if (await exists3(packageJsonPath)) {
|
|
270105
|
-
const packageJson = tryParseJson2(await
|
|
270217
|
+
const packageJson = tryParseJson2(await readFile4(packageJsonPath, "utf-8"));
|
|
270106
270218
|
if (packageJson?.workspaces && Array.isArray(packageJson?.workspaces) && packageJson?.workspaces.length > 0) {
|
|
270107
270219
|
return currentDir;
|
|
270108
270220
|
}
|
|
@@ -270122,7 +270234,7 @@ async function findMonoRepoPackages(projectDir) {
|
|
|
270122
270234
|
return [projectDir];
|
|
270123
270235
|
}
|
|
270124
270236
|
const packageJsonPath = join22(monoRepoRoot, "package.json");
|
|
270125
|
-
const packageJson = tryParseJson2(await
|
|
270237
|
+
const packageJson = tryParseJson2(await readFile4(packageJsonPath, "utf-8"));
|
|
270126
270238
|
const workspaces = packageJson?.workspaces ?? [];
|
|
270127
270239
|
const packagePaths = await Promise.all(workspaces.map(async (workspace) => {
|
|
270128
270240
|
const matches = await glob(join22(monoRepoRoot, workspace, "package.json"));
|
|
@@ -270151,7 +270263,7 @@ async function writeEnv(prod, env2, secrets) {
|
|
|
270151
270263
|
currentEnv = {};
|
|
270152
270264
|
}
|
|
270153
270265
|
const mergedEnv = deepmerge(currentEnv, env2);
|
|
270154
|
-
await
|
|
270266
|
+
await writeFile5(envFile, stringify2(mergedEnv));
|
|
270155
270267
|
}));
|
|
270156
270268
|
}
|
|
270157
270269
|
var quote = /[\s"'#]/;
|
|
@@ -270180,7 +270292,7 @@ function stringify2(obj) {
|
|
|
270180
270292
|
}
|
|
270181
270293
|
|
|
270182
270294
|
// src/commands/codegen/codegen-blockscout.ts
|
|
270183
|
-
import { rm, writeFile as
|
|
270295
|
+
import { rm, writeFile as writeFile6 } from "node:fs/promises";
|
|
270184
270296
|
import { basename, resolve as resolve3 } from "node:path";
|
|
270185
270297
|
async function codegenBlockscout(env2) {
|
|
270186
270298
|
const endpoint = env2.SETTLEMINT_BLOCKSCOUT_GRAPHQL_ENDPOINT;
|
|
@@ -270308,7 +270420,7 @@ async function codegenBlockscout(env2) {
|
|
|
270308
270420
|
throw new Error("GraphQL errors in response");
|
|
270309
270421
|
}
|
|
270310
270422
|
const introspectionJsonPath = resolve3(process.cwd(), "__blockscout-introspection__.json");
|
|
270311
|
-
await
|
|
270423
|
+
await writeFile6(introspectionJsonPath, JSON.stringify(data.data));
|
|
270312
270424
|
try {
|
|
270313
270425
|
await generateSchema({
|
|
270314
270426
|
input: basename(introspectionJsonPath),
|
|
@@ -270398,34 +270510,36 @@ function codegenCommand() {
|
|
|
270398
270510
|
});
|
|
270399
270511
|
const promises = [];
|
|
270400
270512
|
if (hasura) {
|
|
270401
|
-
|
|
270513
|
+
note2("Generating Hasura resources");
|
|
270402
270514
|
promises.push(codegenHasura(env2));
|
|
270403
270515
|
}
|
|
270404
270516
|
if (portal) {
|
|
270405
|
-
|
|
270517
|
+
note2("Generating Portal resources");
|
|
270406
270518
|
promises.push(codegenPortal(env2));
|
|
270407
270519
|
}
|
|
270408
270520
|
if (thegraph) {
|
|
270409
|
-
|
|
270521
|
+
note2("Generating TheGraph resources");
|
|
270410
270522
|
promises.push(codegenTheGraph(env2, thegraphSubgraphNames));
|
|
270411
270523
|
}
|
|
270412
270524
|
if (blockscout) {
|
|
270413
|
-
|
|
270525
|
+
note2("Generating Blockscout resources");
|
|
270414
270526
|
promises.push(codegenBlockscout(env2));
|
|
270415
270527
|
}
|
|
270416
270528
|
if (shouldCodegenMinio(env2)) {
|
|
270417
|
-
|
|
270529
|
+
note2("Generating Minio resources");
|
|
270418
270530
|
promises.push(codegenMinio(env2));
|
|
270419
270531
|
}
|
|
270420
270532
|
if (shouldCodegenIpfs(env2)) {
|
|
270421
|
-
|
|
270533
|
+
note2("Generating IPFS resources");
|
|
270422
270534
|
promises.push(codegenIpfs(env2));
|
|
270423
270535
|
}
|
|
270424
270536
|
await Promise.all(promises);
|
|
270425
|
-
|
|
270426
|
-
|
|
270427
|
-
|
|
270428
|
-
|
|
270537
|
+
if (hasura || portal || thegraph || blockscout) {
|
|
270538
|
+
await generateOutput({
|
|
270539
|
+
output: undefined,
|
|
270540
|
+
tsconfig: undefined
|
|
270541
|
+
});
|
|
270542
|
+
}
|
|
270429
270543
|
outro("Codegen complete");
|
|
270430
270544
|
});
|
|
270431
270545
|
}
|
|
@@ -270488,88 +270602,6 @@ async function writeEnvSpinner(prod, env2) {
|
|
|
270488
270602
|
});
|
|
270489
270603
|
}
|
|
270490
270604
|
|
|
270491
|
-
// src/error/missing-config-error.ts
|
|
270492
|
-
function missingAccessTokenError(personalAccessTokenExists) {
|
|
270493
|
-
if (personalAccessTokenExists) {
|
|
270494
|
-
return cancel2("No access token found, please run `settlemint connect` to connect to your instance.");
|
|
270495
|
-
}
|
|
270496
|
-
return cancel2("No personal access token found, please run `settlemint login`, then run `settlemint connect` to connect using an application access token.");
|
|
270497
|
-
}
|
|
270498
|
-
function missingPersonalAccessTokenError() {
|
|
270499
|
-
return cancel2("No personal access token found for instance, please run `settlemint login` to login to your instance");
|
|
270500
|
-
}
|
|
270501
|
-
|
|
270502
|
-
// src/utils/config.ts
|
|
270503
|
-
import { mkdir as mkdir3, readFile as readFile4, writeFile as writeFile6 } from "node:fs/promises";
|
|
270504
|
-
import { homedir } from "node:os";
|
|
270505
|
-
import { join as join5 } from "node:path";
|
|
270506
|
-
var CONFIG_DIR = join5(homedir(), ".config", "settlemint");
|
|
270507
|
-
var CONFIG_FILE = join5(CONFIG_DIR, "config.json");
|
|
270508
|
-
async function ensureConfigDir() {
|
|
270509
|
-
if (!await exists(CONFIG_DIR)) {
|
|
270510
|
-
await mkdir3(CONFIG_DIR, { recursive: true });
|
|
270511
|
-
}
|
|
270512
|
-
}
|
|
270513
|
-
async function readConfig() {
|
|
270514
|
-
await ensureConfigDir();
|
|
270515
|
-
try {
|
|
270516
|
-
const content = await readFile4(CONFIG_FILE, "utf-8");
|
|
270517
|
-
return tryParseJson(content, { instances: {} });
|
|
270518
|
-
} catch (error5) {
|
|
270519
|
-
return { instances: {} };
|
|
270520
|
-
}
|
|
270521
|
-
}
|
|
270522
|
-
async function writeConfig(config4) {
|
|
270523
|
-
await ensureConfigDir();
|
|
270524
|
-
await writeFile6(CONFIG_FILE, JSON.stringify(config4, null, 2));
|
|
270525
|
-
}
|
|
270526
|
-
async function storeCredentials(token, instance) {
|
|
270527
|
-
const config4 = await readConfig();
|
|
270528
|
-
if (!config4.instances) {
|
|
270529
|
-
config4.instances = {};
|
|
270530
|
-
}
|
|
270531
|
-
config4.instances[instance] = {
|
|
270532
|
-
personalAccessToken: token,
|
|
270533
|
-
lastUsed: new Date().toISOString()
|
|
270534
|
-
};
|
|
270535
|
-
if (!config4.defaultInstance || Object.keys(config4.instances).length === 1) {
|
|
270536
|
-
config4.defaultInstance = instance;
|
|
270537
|
-
}
|
|
270538
|
-
await writeConfig(config4);
|
|
270539
|
-
}
|
|
270540
|
-
async function getInstanceCredentials(instance) {
|
|
270541
|
-
const config4 = await readConfig();
|
|
270542
|
-
const instanceConfig = config4.instances[instance];
|
|
270543
|
-
if (!instanceConfig) {
|
|
270544
|
-
return;
|
|
270545
|
-
}
|
|
270546
|
-
return { personalAccessToken: instanceConfig.personalAccessToken };
|
|
270547
|
-
}
|
|
270548
|
-
async function getInstances() {
|
|
270549
|
-
const config4 = await readConfig();
|
|
270550
|
-
return Object.keys(config4.instances);
|
|
270551
|
-
}
|
|
270552
|
-
async function getDefaultInstance() {
|
|
270553
|
-
const config4 = await readConfig();
|
|
270554
|
-
return config4.defaultInstance;
|
|
270555
|
-
}
|
|
270556
|
-
async function setDefaultInstance(instance) {
|
|
270557
|
-
const config4 = await readConfig();
|
|
270558
|
-
if (!config4.instances[instance]) {
|
|
270559
|
-
throw new Error(`Instance ${instance} is not configured`);
|
|
270560
|
-
}
|
|
270561
|
-
config4.defaultInstance = instance;
|
|
270562
|
-
await writeConfig(config4);
|
|
270563
|
-
}
|
|
270564
|
-
async function removeCredentials(instance) {
|
|
270565
|
-
const config4 = await readConfig();
|
|
270566
|
-
delete config4.instances[instance];
|
|
270567
|
-
if (config4.defaultInstance === instance) {
|
|
270568
|
-
config4.defaultInstance = undefined;
|
|
270569
|
-
}
|
|
270570
|
-
await writeConfig(config4);
|
|
270571
|
-
}
|
|
270572
|
-
|
|
270573
270605
|
// src/utils/get-cluster-service-endpoint.ts
|
|
270574
270606
|
async function getGraphEndpoint(service, env2) {
|
|
270575
270607
|
if (!service || service.__typename !== "HAGraphMiddleware") {
|
|
@@ -272789,7 +272821,7 @@ var esm_default5 = createPrompt((config4, done) => {
|
|
|
272789
272821
|
async function applicationAccessTokenPrompt(env2, application, settlemint, accept) {
|
|
272790
272822
|
const defaultAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
272791
272823
|
const defaultPossible = accept && defaultAccessToken;
|
|
272792
|
-
if (defaultPossible) {
|
|
272824
|
+
if (defaultPossible || is_in_ci_default) {
|
|
272793
272825
|
return defaultAccessToken;
|
|
272794
272826
|
}
|
|
272795
272827
|
if (defaultAccessToken) {
|
|
@@ -273273,6 +273305,26 @@ function connectCommand() {
|
|
|
273273
273305
|
const hdPrivateKey = await hdPrivateKeyPrompt(env2, privateKey, autoAccept);
|
|
273274
273306
|
const cDeployment = await customDeploymentPrompt(env2, customDeployment, autoAccept);
|
|
273275
273307
|
const blockscout = await blockscoutPrompt(env2, insights, autoAccept);
|
|
273308
|
+
if (autoAccept) {
|
|
273309
|
+
const selectedServices = [
|
|
273310
|
+
`Workspace: ${workspace.name}`,
|
|
273311
|
+
`Application: ${application.name}`,
|
|
273312
|
+
blockchainNode && `Blockchain Network: ${blockchainNode?.blockchainNetwork?.name}`,
|
|
273313
|
+
blockchainNode && `Blockchain Node: ${blockchainNode?.name}`,
|
|
273314
|
+
hasura && `Hasura: ${hasura?.name}`,
|
|
273315
|
+
thegraph && `TheGraph: ${thegraph?.name}`,
|
|
273316
|
+
portal && `Portal: ${portal?.name}`,
|
|
273317
|
+
ipfs && `IPFS: ${ipfs?.name}`,
|
|
273318
|
+
minio && `MinIO: ${minio?.name}`,
|
|
273319
|
+
hdPrivateKey && `HD Private Key: ${hdPrivateKey?.name}`,
|
|
273320
|
+
cDeployment && `Custom Deployment: ${cDeployment?.name}`,
|
|
273321
|
+
blockscout && `Blockscout: ${blockscout?.name}`
|
|
273322
|
+
];
|
|
273323
|
+
note(`Selected services:
|
|
273324
|
+
• ${selectedServices.filter(Boolean).join(`
|
|
273325
|
+
• `)}
|
|
273326
|
+
`);
|
|
273327
|
+
}
|
|
273276
273328
|
await writeEnvSpinner(!!prod, {
|
|
273277
273329
|
SETTLEMINT_ACCESS_TOKEN: aatToken,
|
|
273278
273330
|
SETTLEMINT_INSTANCE: instance,
|
|
@@ -273303,7 +273355,7 @@ function connectCommand() {
|
|
|
273303
273355
|
var package_default = {
|
|
273304
273356
|
name: "@settlemint/sdk-cli",
|
|
273305
273357
|
description: "SettleMint SDK, integrate SettleMint into your application with ease.",
|
|
273306
|
-
version: "0.8.
|
|
273358
|
+
version: "0.8.4-mainb3e561b7",
|
|
273307
273359
|
type: "module",
|
|
273308
273360
|
private: false,
|
|
273309
273361
|
license: "FSL-1.1-MIT",
|
|
@@ -273354,8 +273406,8 @@ var package_default = {
|
|
|
273354
273406
|
"@inquirer/input": "4.1.1",
|
|
273355
273407
|
"@inquirer/password": "4.0.4",
|
|
273356
273408
|
"@inquirer/select": "4.0.4",
|
|
273357
|
-
"@settlemint/sdk-js": "0.8.
|
|
273358
|
-
"@settlemint/sdk-utils": "0.8.
|
|
273409
|
+
"@settlemint/sdk-js": "0.8.4-mainb3e561b7",
|
|
273410
|
+
"@settlemint/sdk-utils": "0.8.4-mainb3e561b7",
|
|
273359
273411
|
"get-tsconfig": "4.8.1",
|
|
273360
273412
|
giget: "1.2.3"
|
|
273361
273413
|
},
|
|
@@ -274397,16 +274449,16 @@ async function waitForCompletion({
|
|
|
274397
274449
|
try {
|
|
274398
274450
|
const resource = await service.read(uniqueName);
|
|
274399
274451
|
if (resource.status === "COMPLETED") {
|
|
274400
|
-
|
|
274452
|
+
note2(`${capitalizeFirstLetter(type4)} is ${getActionLabel(action)}`);
|
|
274401
274453
|
return true;
|
|
274402
274454
|
}
|
|
274403
274455
|
if (resource.status === "FAILED") {
|
|
274404
|
-
|
|
274456
|
+
note2(`${capitalizeFirstLetter(type4)} failed to ${getActionLabel(action)}`);
|
|
274405
274457
|
return true;
|
|
274406
274458
|
}
|
|
274407
|
-
|
|
274459
|
+
note2(`${capitalizeFirstLetter(type4)} is not ready yet (status: ${resource.status})`);
|
|
274408
274460
|
} catch (error5) {
|
|
274409
|
-
|
|
274461
|
+
note2(`${capitalizeFirstLetter(type4)} is not ready yet (status: UNKNOWN)`);
|
|
274410
274462
|
}
|
|
274411
274463
|
if (Date.now() - startTime > maxTimeout) {
|
|
274412
274464
|
throw new TimeoutError(`Operation timed out after ${maxTimeout / 60000} minutes for ${type4} with unique name ${uniqueName}`);
|
|
@@ -274420,7 +274472,7 @@ async function waitForCompletion({
|
|
|
274420
274472
|
return await showSpinner();
|
|
274421
274473
|
} catch (error5) {
|
|
274422
274474
|
if (restartIfTimeout && error5 instanceof TimeoutError) {
|
|
274423
|
-
|
|
274475
|
+
note2(`Restarting ${capitalizeFirstLetter(type4)}`);
|
|
274424
274476
|
await service.restart(uniqueName);
|
|
274425
274477
|
return showSpinner();
|
|
274426
274478
|
}
|
|
@@ -274437,26 +274489,6 @@ function getActionLabel(action) {
|
|
|
274437
274489
|
return "deployed";
|
|
274438
274490
|
}
|
|
274439
274491
|
|
|
274440
|
-
// src/utils/get-app-or-personal-token.ts
|
|
274441
|
-
var getApplicationOrPersonalAccessToken = async ({
|
|
274442
|
-
env: env2,
|
|
274443
|
-
instance,
|
|
274444
|
-
prefer
|
|
274445
|
-
}) => {
|
|
274446
|
-
const applicationAccessToken = env2.SETTLEMINT_ACCESS_TOKEN;
|
|
274447
|
-
const personalAccessToken = (await getInstanceCredentials(instance))?.personalAccessToken;
|
|
274448
|
-
const preferredToken = prefer === "application" ? applicationAccessToken : personalAccessToken;
|
|
274449
|
-
const fallbackToken = prefer === "application" ? personalAccessToken : applicationAccessToken;
|
|
274450
|
-
const allowFallback = prefer === "application";
|
|
274451
|
-
if (preferredToken) {
|
|
274452
|
-
return preferredToken;
|
|
274453
|
-
}
|
|
274454
|
-
if (allowFallback && fallbackToken) {
|
|
274455
|
-
return fallbackToken;
|
|
274456
|
-
}
|
|
274457
|
-
return prefer === "personal" ? missingPersonalAccessTokenError() : missingAccessTokenError(!!personalAccessToken);
|
|
274458
|
-
};
|
|
274459
|
-
|
|
274460
274492
|
// src/utils/sanitize-command-name.ts
|
|
274461
274493
|
function sanitizeCommandName(name2) {
|
|
274462
274494
|
return name2.split(" ").join("-").toLowerCase();
|
|
@@ -274525,7 +274557,7 @@ ${createExamples(examples)}`).argument("<name>", `The ${type4} name`).option("-a
|
|
|
274525
274557
|
newEnv.SETTLEMINT_BLOCKCHAIN_NETWORK = (await settlemint.blockchainNode.read(newEnv.SETTLEMINT_BLOCKCHAIN_NODE)).blockchainNetwork.uniqueName;
|
|
274526
274558
|
}
|
|
274527
274559
|
await writeEnvSpinner(!!prod, newEnv);
|
|
274528
|
-
|
|
274560
|
+
note2(`${capitalizeFirstLetter(type4)} ${result.name} set as default`);
|
|
274529
274561
|
}
|
|
274530
274562
|
outro(`${capitalizeFirstLetter(type4)} ${result.name} created successfully`);
|
|
274531
274563
|
});
|
|
@@ -275506,7 +275538,7 @@ ${createExamples([
|
|
|
275506
275538
|
...mapDefaultEnv(env2)
|
|
275507
275539
|
};
|
|
275508
275540
|
await writeEnvSpinner(!!prod, newEnv);
|
|
275509
|
-
|
|
275541
|
+
note2(`${capitalizeFirstLetter(type4)} removed as default`);
|
|
275510
275542
|
}
|
|
275511
275543
|
if (wait) {
|
|
275512
275544
|
await waitForCompletion({ settlemint, type: type4, uniqueName: serviceUniqueName, action: "destroy" });
|
|
@@ -276070,7 +276102,7 @@ function foundryFormatCommand() {
|
|
|
276070
276102
|
return new Command2("format").description("Format the smart contracts using Foundry/forge").helpOption(false).option("-h, --help", "Get list of possible forge options").passThroughOptions().allowUnknownOption(true).action(async (passThroughOptions, cmd2) => {
|
|
276071
276103
|
const forgeOptions = mapPassthroughOptions(passThroughOptions, cmd2);
|
|
276072
276104
|
await executeCommand("forge", ["fmt", ...forgeOptions]);
|
|
276073
|
-
|
|
276105
|
+
note2("Smart contract set formatted successfully!");
|
|
276074
276106
|
});
|
|
276075
276107
|
}
|
|
276076
276108
|
|
|
@@ -276170,7 +276202,7 @@ console.log(JSON.stringify(hardhat.userConfig));`], {
|
|
|
276170
276202
|
throw new Error("Invalid hardhat config");
|
|
276171
276203
|
} catch (err) {
|
|
276172
276204
|
const error5 = err;
|
|
276173
|
-
|
|
276205
|
+
note2(`Error reading hardhat.config.ts: ${error5.message}`);
|
|
276174
276206
|
return {};
|
|
276175
276207
|
}
|
|
276176
276208
|
}
|
|
@@ -276428,7 +276460,7 @@ var getSubgraphConfig = async (path8 = process.cwd()) => {
|
|
|
276428
276460
|
return currentConfig;
|
|
276429
276461
|
} catch (err) {
|
|
276430
276462
|
const error5 = err;
|
|
276431
|
-
|
|
276463
|
+
note2(`Failed to read ${basename4(CONFIG_FILE_PATH)} file: ${error5.message}`);
|
|
276432
276464
|
return null;
|
|
276433
276465
|
}
|
|
276434
276466
|
};
|
|
@@ -276705,7 +276737,7 @@ sdkcli.addCommand(createCommand2());
|
|
|
276705
276737
|
sdkcli.addCommand(loginCommand());
|
|
276706
276738
|
sdkcli.addCommand(logoutCommand());
|
|
276707
276739
|
sdkcli.parseAsync(process.argv).catch((reason) => {
|
|
276708
|
-
cancel2(reason);
|
|
276740
|
+
cancel2(reason.message);
|
|
276709
276741
|
});
|
|
276710
276742
|
|
|
276711
|
-
//# debugId=
|
|
276743
|
+
//# debugId=216494A363DFD68764756E2164756E21
|