@fragment-dev/cli
Version:
57 lines (54 loc) • 1.44 kB
JavaScript
import {
AuthenticatedCommand
} from "./chunk-W7HG2VEH.js";
import {
require_lib
} from "./chunk-UD22EIAP.js";
import {
require_source
} from "./chunk-M5OAS5QZ.js";
import {
__toESM,
init_cjs_shims
} from "./chunk-7GH3YGSC.js";
// src/commands/delete-custom-txs.ts
init_cjs_shims();
var import_core = __toESM(require_lib(), 1);
var import_chalk = __toESM(require_source(), 1);
var DeleteCustomTxs = class extends AuthenticatedCommand {
static {
this.summary = "Delete Custom Txs.";
}
static {
this.description = `This mirrors the ${import_chalk.default.magentaBright(
"deleteCustomTxs"
)} 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 Custom Tx to delete.",
multiple: true,
required: true
})
};
}
async run() {
const res = await this.sdk.DeleteCustomTxs({
txs: this.flags.id
});
if (res.deleteCustomTxs.__typename !== "DeleteCustomTxsResult") {
this.logToStderr(`Received error: ${res.deleteCustomTxs.__typename}`);
this.logToStderr(`Message: ${res.deleteCustomTxs.message}`);
this.logToStderr(`Code: ${res.deleteCustomTxs.code}`);
this.logToStderr(`Retryable: ${res.deleteCustomTxs.retryable}`);
this.exit(1);
}
}
};
export {
DeleteCustomTxs
};