import { packageName } from '../../util/pkg-name'; import { formatOption, jsonOption, yesOption } from '../../util/arg-common'; export const listSubcommand = { name: 'list', aliases: ['ls'], description: 'Show all webhooks', default: true, arguments: [], options: [formatOption, jsonOption], examples: [ { name: 'List all webhooks as JSON', value: `${packageName} webhooks list --json`, }, ], } as const; export const getSubcommand = { name: 'inspect', aliases: ['get'], description: 'Displays information related to a webhook', arguments: [ { name: 'id', required: true, }, ], options: [formatOption, jsonOption], examples: [], } as const; export const createSubcommand = { name: 'create', aliases: ['add'], description: 'Create a new webhook', arguments: [ { name: 'url', required: true, }, ], options: [ { name: 'event', shorthand: null, deprecatedShorthand: 'e', type: [String], argument: 'EVENT', deprecated: false, description: 'Webhook event to subscribe to (can be used multiple times)', }, { name: 'project', shorthand: 'p', type: [String], argument: 'PROJECT_ID', deprecated: false, description: 'Project ID to associate with the webhook (can be used multiple times)', }, ], examples: [ { name: 'Create a webhook for deployment events', value: `${packageName} webhooks create https://example.com/webhook --event deployment.created --event deployment.ready`, }, ], } as const; export const removeSubcommand = { name: 'delete', aliases: ['rm', 'del', 'remove'], description: 'Delete a webhook', arguments: [ { name: 'id', required: true, }, ], options: [ { ...yesOption, description: 'Skip the confirmation prompt when deleting a webhook', }, ], examples: [], } as const; export const webhooksCommand = { name: 'webhooks', aliases: ['webhook'], description: 'Manage webhooks', arguments: [], subcommands: [ listSubcommand, getSubcommand, createSubcommand, removeSubcommand, ], options: [], examples: [], } as const;