@settlemint/sdk-cli 1.1.5-pr2e0c7976 → 1.1.5-pr4291d9c1
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 +54 -4
- package/dist/cli.js.map +5 -4
- 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-pr4291d9c1",
|
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-pr4291d9c1",
|
274514
|
+
"@settlemint/sdk-utils": "1.1.5-pr4291d9c1",
|
274515
274515
|
"@types/node": "22.13.1",
|
274516
274516
|
"@types/semver": "7.5.8",
|
274517
274517
|
"@types/which": "3.0.4",
|
@@ -285452,6 +285452,55 @@ async function updateSpecVersion(specVersion) {
|
|
285452
285452
|
await updateSubgraphYamlConfig(yamlConfig);
|
285453
285453
|
}
|
285454
285454
|
|
285455
|
+
// src/commands/smart-contract-set/subgraph/remove.ts
|
285456
|
+
import { dirname as dirname13 } from "node:path";
|
285457
|
+
function subgraphRemoveCommand() {
|
285458
|
+
return new Command("remove").description("Remove a subgraph").usage(createExamples([
|
285459
|
+
{
|
285460
|
+
description: "Remove a subgraph",
|
285461
|
+
command: "scs subgraph remove my-subgraph"
|
285462
|
+
}
|
285463
|
+
])).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 }) => {
|
285464
|
+
intro("Removing subgraph");
|
285465
|
+
await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
|
285466
|
+
if (!force) {
|
285467
|
+
await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
|
285468
|
+
}
|
285469
|
+
const autoAccept = !!acceptDefaults || is_in_ci_default;
|
285470
|
+
const env2 = await loadEnv(false, !!prod);
|
285471
|
+
const instance = await instancePrompt(env2, true);
|
285472
|
+
const accessToken = await getApplicationOrPersonalAccessToken({
|
285473
|
+
env: env2,
|
285474
|
+
instance,
|
285475
|
+
prefer: "application"
|
285476
|
+
});
|
285477
|
+
const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
|
285478
|
+
if (!theGraphMiddleware) {
|
285479
|
+
return nothingSelectedError("graph middleware");
|
285480
|
+
}
|
285481
|
+
if (theGraphMiddleware.status !== "COMPLETED") {
|
285482
|
+
serviceNotRunningError("graph middleware", theGraphMiddleware.status);
|
285483
|
+
}
|
285484
|
+
const subgraphYamlFile = await getSubgraphYamlFile();
|
285485
|
+
const cwd2 = dirname13(subgraphYamlFile);
|
285486
|
+
const { command, args } = await getPackageManagerExecutable();
|
285487
|
+
const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
|
285488
|
+
await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, subgraphName]);
|
285489
|
+
const settlemintClient = createSettleMintClient({
|
285490
|
+
accessToken,
|
285491
|
+
instance
|
285492
|
+
});
|
285493
|
+
const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
|
285494
|
+
const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware);
|
285495
|
+
await writeEnvSpinner(!!prod, {
|
285496
|
+
...env2,
|
285497
|
+
SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
|
285498
|
+
...graphEndpoints
|
285499
|
+
});
|
285500
|
+
outro(`Subgraph ${subgraphName} removed successfully`);
|
285501
|
+
});
|
285502
|
+
}
|
285503
|
+
|
285455
285504
|
// src/commands/smart-contract.set.ts
|
285456
285505
|
function smartContractSetCommand() {
|
285457
285506
|
const foundry = new Command("foundry").alias("f").description("Foundry commands for building and testing smart contracts");
|
@@ -285469,6 +285518,7 @@ function smartContractSetCommand() {
|
|
285469
285518
|
subgraph.addCommand(subgraphBuildCommand());
|
285470
285519
|
subgraph.addCommand(subgraphCodegenCommand());
|
285471
285520
|
subgraph.addCommand(subgraphDeployCommand());
|
285521
|
+
subgraph.addCommand(subgraphRemoveCommand());
|
285472
285522
|
return new Command("smart-contract-set").alias("scs").description("Manage smart contract sets and subgraphs").addCommand(createCommand4()).addCommand(foundry).addCommand(hardhat).addCommand(subgraph);
|
285473
285523
|
}
|
285474
285524
|
|
@@ -285580,4 +285630,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
285580
285630
|
// src/cli.ts
|
285581
285631
|
sdkCliCommand();
|
285582
285632
|
|
285583
|
-
//# debugId=
|
285633
|
+
//# debugId=CB24240B55532F7B64756E2164756E21
|