UNPKG

@fragment-dev/cli

Version:
63 lines (60 loc) 1.51 kB
import { AuthenticatedCommand } from "./chunk-SHTFFJEV.js"; import { require_lib } from "./chunk-IH6BCA6S.js"; import { require_source } from "./chunk-M5OAS5QZ.js"; import { __toESM, init_cjs_shims } from "./chunk-7GH3YGSC.js"; // src/commands/create-custom-link.ts init_cjs_shims(); var import_chalk = __toESM(require_source(), 1); var import_core = __toESM(require_lib(), 1); var CreateCustomLink = class extends AuthenticatedCommand { static { this.summary = "Create a Custom Link"; } static { this.description = `This mirrors the ${import_chalk.default.magentaBright( "CreateCustomLink" )} API endpoint. Read ${import_chalk.default.blueBright( "https://fragment.dev/docs/sync-payments#custom-link-onboarding" )} to learn more about Custom Links.`; } static { this.examples = [ "<%= config.bin %> <%= command.id %> --ik <ik> --name <name>" ]; } static { this.flags = { ik: import_core.Flags.string({ char: "i", description: "The Idempotency Key for the Custom Link creation.", required: true }), name: import_core.Flags.string({ description: "The name for the Custom Link.", required: true }) }; } async run() { const res = await this.sdk.CreateCustomLink({ ik: this.flags.ik, name: this.flags.name }); if (res.createCustomLink.__typename !== "CreateCustomLinkResult") { this.exit(1); } } }; export { CreateCustomLink };