@settlemint/sdk-cli 1.1.5-pr26da6b86 → 1.1.5-pr29ceadbe
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 +9 -75
- package/dist/cli.js.map +7 -8
- 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-pr29ceadbe",
         | 
| 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-pr29ceadbe",
         | 
| 274514 | 
            +
                "@settlemint/sdk-utils": "1.1.5-pr29ceadbe",
         | 
| 274515 274515 | 
             
                "@types/node": "22.13.1",
         | 
| 274516 274516 | 
             
                "@types/semver": "7.5.8",
         | 
| 274517 274517 | 
             
                "@types/which": "3.0.4",
         | 
| @@ -275760,11 +275760,6 @@ 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 | 
            -
              }
         | 
| 275768 275763 | 
             
            };
         | 
| 275769 275764 | 
             
            var spinner = async (options) => {
         | 
| 275770 275765 | 
             
              const handleError = (error) => {
         | 
| @@ -275772,7 +275767,7 @@ var spinner = async (options) => { | |
| 275772 275767 | 
             
                note(redBright(`${errorMessage}
         | 
| 275773 275768 |  | 
| 275774 275769 | 
             
            ${error.stack}`));
         | 
| 275775 | 
            -
                throw new SpinnerError(errorMessage | 
| 275770 | 
            +
                throw new SpinnerError(errorMessage);
         | 
| 275776 275771 | 
             
              };
         | 
| 275777 275772 | 
             
              if (is_in_ci_default) {
         | 
| 275778 275773 | 
             
                try {
         | 
| @@ -282427,8 +282422,7 @@ async function waitForCompletion({ | |
| 282427 282422 | 
             
              try {
         | 
| 282428 282423 | 
             
                return await showSpinner();
         | 
| 282429 282424 | 
             
              } catch (error5) {
         | 
| 282430 | 
            -
                 | 
| 282431 | 
            -
                if (restartIfTimeout && isTimeoutError) {
         | 
| 282425 | 
            +
                if (restartIfTimeout && error5 instanceof TimeoutError) {
         | 
| 282432 282426 | 
             
                  note(`Restarting ${capitalizeFirstLetter2(type4)}`);
         | 
| 282433 282427 | 
             
                  await service.restart(uniqueName);
         | 
| 282434 282428 | 
             
                  return showSpinner();
         | 
| @@ -285483,55 +285477,6 @@ async function updateSpecVersion(specVersion) { | |
| 285483 285477 | 
             
              await updateSubgraphYamlConfig(yamlConfig);
         | 
| 285484 285478 | 
             
            }
         | 
| 285485 285479 |  | 
| 285486 | 
            -
            // src/commands/smart-contract-set/subgraph/remove.ts
         | 
| 285487 | 
            -
            import { dirname as dirname13 } from "node:path";
         | 
| 285488 | 
            -
            function subgraphRemoveCommand() {
         | 
| 285489 | 
            -
              return new Command("remove").description("Remove a subgraph").usage(createExamples([
         | 
| 285490 | 
            -
                {
         | 
| 285491 | 
            -
                  description: "Remove a subgraph",
         | 
| 285492 | 
            -
                  command: "scs subgraph remove  my-subgraph"
         | 
| 285493 | 
            -
                }
         | 
| 285494 | 
            -
              ])).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 }) => {
         | 
| 285495 | 
            -
                intro("Removing subgraph");
         | 
| 285496 | 
            -
                await validateIfRequiredPackagesAreInstalled(["@graphprotocol/graph-cli"]);
         | 
| 285497 | 
            -
                if (!force) {
         | 
| 285498 | 
            -
                  await deleteConfirmationPrompt(`the subgraph ${subgraphName}`);
         | 
| 285499 | 
            -
                }
         | 
| 285500 | 
            -
                const autoAccept = !!acceptDefaults || is_in_ci_default;
         | 
| 285501 | 
            -
                const env2 = await loadEnv(false, !!prod);
         | 
| 285502 | 
            -
                const instance = await instancePrompt(env2, true);
         | 
| 285503 | 
            -
                const accessToken = await getApplicationOrPersonalAccessToken({
         | 
| 285504 | 
            -
                  env: env2,
         | 
| 285505 | 
            -
                  instance,
         | 
| 285506 | 
            -
                  prefer: "application"
         | 
| 285507 | 
            -
                });
         | 
| 285508 | 
            -
                const theGraphMiddleware = await getTheGraphMiddleware({ env: env2, instance, accessToken, autoAccept });
         | 
| 285509 | 
            -
                if (!theGraphMiddleware) {
         | 
| 285510 | 
            -
                  return nothingSelectedError("graph middleware");
         | 
| 285511 | 
            -
                }
         | 
| 285512 | 
            -
                if (theGraphMiddleware.status !== "COMPLETED") {
         | 
| 285513 | 
            -
                  serviceNotRunningError("graph middleware", theGraphMiddleware.status);
         | 
| 285514 | 
            -
                }
         | 
| 285515 | 
            -
                const subgraphYamlFile = await getSubgraphYamlFile();
         | 
| 285516 | 
            -
                const cwd2 = dirname13(subgraphYamlFile);
         | 
| 285517 | 
            -
                const { command, args } = await getPackageManagerExecutable();
         | 
| 285518 | 
            -
                const middlewareAdminUrl = new URL(`/${encodeURIComponent(accessToken)}/admin`, theGraphMiddleware.serviceUrl).toString();
         | 
| 285519 | 
            -
                await executeCommand(command, [...args, "graph", "remove", "--node", middlewareAdminUrl, subgraphName]);
         | 
| 285520 | 
            -
                const settlemintClient = createSettleMintClient({
         | 
| 285521 | 
            -
                  accessToken,
         | 
| 285522 | 
            -
                  instance
         | 
| 285523 | 
            -
                });
         | 
| 285524 | 
            -
                const middleware = await settlemintClient.middleware.read(theGraphMiddleware.uniqueName);
         | 
| 285525 | 
            -
                const graphEndpoints = await getGraphEndpoint(settlemintClient, middleware);
         | 
| 285526 | 
            -
                await writeEnvSpinner(!!prod, {
         | 
| 285527 | 
            -
                  ...env2,
         | 
| 285528 | 
            -
                  SETTLEMINT_THEGRAPH: theGraphMiddleware.uniqueName,
         | 
| 285529 | 
            -
                  ...graphEndpoints
         | 
| 285530 | 
            -
                });
         | 
| 285531 | 
            -
                outro(`Subgraph ${subgraphName} removed successfully`);
         | 
| 285532 | 
            -
              });
         | 
| 285533 | 
            -
            }
         | 
| 285534 | 
            -
             | 
| 285535 285480 | 
             
            // src/commands/smart-contract.set.ts
         | 
| 285536 285481 | 
             
            function smartContractSetCommand() {
         | 
| 285537 285482 | 
             
              const foundry = new Command("foundry").alias("f").description("Foundry commands for building and testing smart contracts");
         | 
| @@ -285549,7 +285494,6 @@ function smartContractSetCommand() { | |
| 285549 285494 | 
             
              subgraph.addCommand(subgraphBuildCommand());
         | 
| 285550 285495 | 
             
              subgraph.addCommand(subgraphCodegenCommand());
         | 
| 285551 285496 | 
             
              subgraph.addCommand(subgraphDeployCommand());
         | 
| 285552 | 
            -
              subgraph.addCommand(subgraphRemoveCommand());
         | 
| 285553 285497 | 
             
              return new Command("smart-contract-set").alias("scs").description("Manage smart contract sets and subgraphs").addCommand(createCommand4()).addCommand(foundry).addCommand(hardhat).addCommand(subgraph);
         | 
| 285554 285498 | 
             
            }
         | 
| 285555 285499 |  | 
| @@ -285607,22 +285551,12 @@ function addHooksToCommand(cmd2, rootCmd, argv) { | |
| 285607 285551 | 
             
                addHooksToCommand(subcmd, rootCmd, argv);
         | 
| 285608 285552 | 
             
              }
         | 
| 285609 285553 | 
             
            }
         | 
| 285610 | 
            -
            var ERRORS_TO_IGNORE = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
         | 
| 285611 | 
            -
            var ERROR_CODES_TO_IGNORE = [
         | 
| 285612 | 
            -
              "commander.help",
         | 
| 285613 | 
            -
              "commander.missingArgument",
         | 
| 285614 | 
            -
              "commander.optionMissingArgument",
         | 
| 285615 | 
            -
              "commander.missingMandatoryOptionValue",
         | 
| 285616 | 
            -
              "commander.conflictingOption",
         | 
| 285617 | 
            -
              "commander.unknownOption",
         | 
| 285618 | 
            -
              "commander.excessArguments",
         | 
| 285619 | 
            -
              "commander.unknownCommand"
         | 
| 285620 | 
            -
            ];
         | 
| 285621 285554 | 
             
            async function onError(sdkcli, argv, error5) {
         | 
| 285622 | 
            -
               | 
| 285555 | 
            +
              const errorsToIgnore = [ExitPromptError, AbortPromptError, ValidationError, CancelPromptError];
         | 
| 285556 | 
            +
              if (errorsToIgnore.some((errorToIgnore) => error5 instanceof errorToIgnore)) {
         | 
| 285623 285557 | 
             
                process.exit(0);
         | 
| 285624 285558 | 
             
              }
         | 
| 285625 | 
            -
              if (error5 instanceof CommanderError && (error5.exitCode === 0 ||  | 
| 285559 | 
            +
              if (error5 instanceof CommanderError && (error5.exitCode === 0 || error5.code === "commander.help")) {
         | 
| 285626 285560 | 
             
                process.exit(error5.exitCode);
         | 
| 285627 285561 | 
             
              }
         | 
| 285628 285562 | 
             
              if (!(error5 instanceof CancelError2 || error5 instanceof SpinnerError)) {
         | 
| @@ -285671,4 +285605,4 @@ async function sdkCliCommand(argv = process.argv) { | |
| 285671 285605 | 
             
            // src/cli.ts
         | 
| 285672 285606 | 
             
            sdkCliCommand();
         | 
| 285673 285607 |  | 
| 285674 | 
            -
            //# debugId= | 
| 285608 | 
            +
            //# debugId=FD37FECAF3A5E55A64756E2164756E21
         |