import {
  AuthenticatedCommand
} from "./chunk-G2JISDKX.js";
import {
  require_lib
} from "./chunk-XECLOG6B.js";
import {
  require_source
} from "./chunk-M5OAS5QZ.js";
import {
  __toESM,
  init_cjs_shims
} from "./chunk-7GH3YGSC.js";

// src/commands/reverse-ledger-entry.ts
init_cjs_shims();
var import_core = __toESM(require_lib(), 1);
var import_chalk = __toESM(require_source(), 1);
var ReverseLedgerEntry = class extends AuthenticatedCommand {
  static {
    this.summary = "Reverse a Ledger Entry.";
  }
  static {
    this.description = `This mirrors the ${import_chalk.default.magentaBright(
      "reverseLedgerEntry"
    )} mutation in the GraphQL API.`;
  }
  static {
    this.examples = ["<%= config.bin %> <%= command.id %>"];
  }
  static {
    this.flags = {
      id: import_core.Flags.string({
        description: "Fragment ID of the Ledger Entry to reverse.",
        required: true
      })
    };
  }
  async run() {
    const res = await this.sdk.ReverseLedgerEntry({
      id: this.flags.id
    });
    if (res.reverseLedgerEntry.__typename !== "ReverseLedgerEntryResult") {
      this.logToStderr(`Received error: ${res.reverseLedgerEntry.__typename}`);
      this.logToStderr(`Message: ${res.reverseLedgerEntry.message}`);
      this.logToStderr(`Code: ${res.reverseLedgerEntry.code}`);
      this.logToStderr(`Retryable: ${res.reverseLedgerEntry.retryable}`);
      this.exit(1);
    }
  }
};

export {
  ReverseLedgerEntry
};
