UNPKG

@swell/cli

Version:

Swell's command line interface/utility

33 lines (32 loc) 1 kB
export interface CreateWebhookFileBody { $schema: string; description?: string; enabled?: boolean; events: string[]; url: string; } type ErrorHandler = (msg: string, options: { exit: number; }) => never; /** * Parse comma-separated events string to array * Input: "payment.succeeded,payment.failed" * Output: ["payment.succeeded", "payment.failed"] */ export declare function parseEvents(eventsInput: string): string[]; /** * Validate event format (model.action pattern) * Valid: "product.created", "payment.succeeded" * Invalid: "product", "created", "", ".created", "product." */ export declare function validateEventFormat(events: string[], onError: ErrorHandler): void; /** * Validate URL format (basic check for protocol) */ export declare function validateUrl(url: string, onError: ErrorHandler): void; /** * Convert name to webhook label * "payment-handler" => "Payment Handler" */ export declare const toWebhookLabel: (value: string) => string; export {};