@settlemint/sdk-cli 1.1.5-pr9a741b34 → 1.1.5-pr9ee04c7b
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 +77 -10
- package/dist/cli.js.map +10 -9
- package/package.json +3 -3
package/dist/cli.js
CHANGED
@@ -274462,7 +274462,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
274462
274462
|
var package_default = {
|
274463
274463
|
name: "@settlemint/sdk-cli",
|
274464
274464
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
274465
|
-
version: "1.1.5-
|
274465
|
+
version: "1.1.5-pr9ee04c7b",
|
274466
274466
|
type: "module",
|
274467
274467
|
private: false,
|
274468
274468
|
license: "FSL-1.1-MIT",
|
@@ -274510,8 +274510,8 @@ var package_default = {
|
|
274510
274510
|
"@inquirer/input": "4.1.5",
|
274511
274511
|
"@inquirer/password": "4.0.8",
|
274512
274512
|
"@inquirer/select": "4.0.8",
|
274513
|
-
"@settlemint/sdk-js": "1.1.5-
|
274514
|
-
"@settlemint/sdk-utils": "1.1.5-
|
274513
|
+
"@settlemint/sdk-js": "1.1.5-pr9ee04c7b",
|
274514
|
+
"@settlemint/sdk-utils": "1.1.5-pr9ee04c7b",
|
274515
274515
|
"@types/node": "22.13.1",
|
274516
274516
|
"@types/semver": "7.5.8",
|
274517
274517
|
"@types/which": "3.0.4",
|
@@ -275760,6 +275760,11 @@ var outro = (msg) => {
|
|
275760
275760
|
console.log("");
|
275761
275761
|
};
|
275762
275762
|
var SpinnerError = class extends Error {
|
275763
|
+
constructor(message, originalError) {
|
275764
|
+
super(message);
|
275765
|
+
this.originalError = originalError;
|
275766
|
+
this.name = "SpinnerError";
|
275767
|
+
}
|
275763
275768
|
};
|
275764
275769
|
var spinner = async (options) => {
|
275765
275770
|
const handleError = (error) => {
|
@@ -275767,7 +275772,7 @@ var spinner = async (options) => {
|
|
275767
275772
|
note(redBright(`${errorMessage}
|
275768
275773
|
|
275769
275774
|
${error.stack}`));
|
275770
|
-
throw new SpinnerError(errorMessage);
|
275775
|
+
throw new SpinnerError(errorMessage, error);
|
275771
275776
|
};
|
275772
275777
|
if (is_in_ci_default) {
|
275773
275778
|
try {
|
@@ -279773,6 +279778,7 @@ async function codegenTsconfig(env2, thegraphSubgraphNames) {
|
|
279773
279778
|
const tadaConfig = {
|
279774
279779
|
name: "gql.tada/ts-plugin",
|
279775
279780
|
trackFieldUsage: false,
|
279781
|
+
shouldCheckForColocatedFragments: false,
|
279776
279782
|
schemas: [
|
279777
279783
|
...hasura ? [
|
279778
279784
|
{
|
@@ -282422,7 +282428,8 @@ async function waitForCompletion({
|
|
282422
282428
|
try {
|
282423
282429
|
return await showSpinner();
|
282424
282430
|
} catch (error5) {
|
282425
|
-
|
282431
|
+
const isTimeoutError = error5 instanceof SpinnerError && error5.originalError instanceof TimeoutError;
|
282432
|
+
if (restartIfTimeout && isTimeoutError) {
|
282426
282433
|
note(`Restarting ${capitalizeFirstLetter2(type4)}`);
|
282427
282434
|
await service.restart(uniqueName);
|
282428
282435
|
return showSpinner();
|
@@ -285468,7 +285475,7 @@ function subgraphDeployCommand() {
|
|
285468
285475
|
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
285469
285476
|
...graphEndpoints
|
285470
285477
|
});
|
285471
|
-
outro(
|
285478
|
+
outro(`Subgraph ${graphName} deployed successfully`);
|
285472
285479
|
});
|
285473
285480
|
}
|
285474
285481
|
async function updateSpecVersion(specVersion) {
|
@@ -285477,6 +285484,55 @@ async function updateSpecVersion(specVersion) {
|
|
285477
285484
|
await updateSubgraphYamlConfig(yamlConfig);
|
285478
285485
|
}
|
285479
285486
|
|
285487
|
+
// src/commands/smart-contract-set/subgraph/remove.ts
|
285488
|
+
import { dirname as dirname13 } from "node:path";
|
285489
|
+
function subgraphRemoveCommand() {
|
285490
|
+
return new Command("remove").description("Remove a subgraph").usage(createExamples([
|
285491
|
+
{
|
285492
|
+
description: "Remove a subgraph",
|
285493
|
+
command: "scs subgraph remove my-subgraph"
|
285494
|
+
}
|
285495
|
+
])).option("-a, --accept-defaults", "Accept the default and previously set values").option("--prod", "Connect to your production environment").option("-f, --force", "Force remove the subgraph without confirmation").argument("<subgraph-name>", "The name of the subgraph to remove").action(async (subgraphName, { prod, acceptDefaults, force }) => {
|
285496
|
+
intro("Removing subgraph");
|
285497
|
+
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
285498
|
+
if (!force) {
|
285499
|
+
await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
|
285500
|
+
}
|
285501
|
+
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
285502
|
+
const env2 = await loadEnv(false, !!prod);
|
285503
|
+
const instance = await instancePrompt(env2, true);
|
285504
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
285505
|
+
env: env2,
|
285506
|
+
instance,
|
285507
|
+
prefer: "application"
|
285508
|
+
});
|
285509
|
+
const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
285510
|
+
if (!theGraphMiddleware) {
|
285511
|
+
return nothingSelectedError("graph middleware");
|
285512
|
+
}
|
285513
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
285514
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
285515
|
+
}
|
285516
|
+
const subgraphYamlFile = await getSubgraphYamlFile();
|
285517
|
+
const cwd2 = dirname13(subgraphYamlFile);
|
285518
|
+
const { command, args } = await getPackageManagerExecutable();
|
285519
|
+
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
285520
|
+
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, subgraphName]);
|
285521
|
+
const settlemintClient = createSettleMintClient({
|
285522
|
+
accessToken,
|
285523
|
+
instance
|
285524
|
+
});
|
285525
|
+
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
285526
|
+
const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware);
|
285527
|
+
await writeEnvSpinner(!!prod, {
|
285528
|
+
...env2,
|
285529
|
+
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
285530
|
+
...graphEndpoints
|
285531
|
+
});
|
285532
|
+
outro(`Subgraph ${subgraphName} removed successfully`);
|
285533
|
+
});
|
285534
|
+
}
|
285535
|
+
|
285480
285536
|
// src/commands/smart-contract.set.ts
|
285481
285537
|
function smartContractSetCommand() {
|
285482
285538
|
const foundry = new Command("foundry").alias("f").description("Foundry commands for building and testing smart contracts");
|
@@ -285494,6 +285550,7 @@ function smartContractSetCommand() {
|
|
285494
285550
|
subgraph.addCommand(subgraphBuildCommand());
|
285495
285551
|
subgraph.addCommand(subgraphCodegenCommand());
|
285496
285552
|
subgraph.addCommand(subgraphDeployCommand());
|
285553
|
+
subgraph.addCommand(subgraphRemoveCommand());
|
285497
285554
|
return new Command("smart-contract-set").alias("scs").description("Manage smart contract sets and subgraphs").addCommand(createCommand4()).addCommand(foundry).addCommand(hardhat).addCommand(subgraph);
|
285498
285555
|
}
|
285499
285556
|
|
@@ -285551,12 +285608,22 @@ function addHooksToCommand(cmd2, rootCmd, argv) {
|
|
285551
285608
|
addHooksToCommand(subcmd, rootCmd, argv);
|
285552
285609
|
}
|
285553
285610
|
}
|
285611
|
+
var ERRORS_TO_IGNORE = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
|
285612
|
+
var ERROR_CODES_TO_IGNORE = [
|
285613
|
+
"commander.help",
|
285614
|
+
"commander.missingArgument",
|
285615
|
+
"commander.optionMissingArgument",
|
285616
|
+
"commander.missingMandatoryOptionValue",
|
285617
|
+
"commander.conflictingOption",
|
285618
|
+
"commander.unknownOption",
|
285619
|
+
"commander.excessArguments",
|
285620
|
+
"commander.unknownCommand"
|
285621
|
+
];
|
285554
285622
|
async function onError(sdkcli, argv, error5) {
|
285555
|
-
|
285556
|
-
if (errorsToIgnore.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
|
285623
|
+
if (ERRORS_TO_IGNORE.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
|
285557
285624
|
process.exit(0);
|
285558
285625
|
}
|
285559
|
-
if (error5 instanceof CommanderError && (error5.exitCode === 0 || error5.code
|
285626
|
+
if (error5 instanceof CommanderError && (error5.exitCode === 0 || ERROR_CODES_TO_IGNORE.includes(error5.code))) {
|
285560
285627
|
process.exit(error5.exitCode);
|
285561
285628
|
}
|
285562
285629
|
if (!(error5 instanceof CancelError2 || error5 instanceof SpinnerError)) {
|
@@ -285605,4 +285672,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
285605
285672
|
// src/cli.ts
|
285606
285673
|
sdkCliCommand();
|
285607
285674
|
|
285608
|
-
//# debugId=
|
285675
|
+
//# debugId=8C4F74735566A4ED64756E2164756E21
|