/** * Unified WorkOS client for CLI commands. * * Wraps @workos-inc/node SDK for documented endpoints and extends with * raw-fetch methods for undocumented/write-only endpoints (webhooks, redirect URIs, etc.). * Commands import one client; they don't care whether a method is SDK-backed or raw fetch. */ import { WorkOS } from '@workos-inc/node'; import { type WorkOSListResponse } from './workos-api.js'; export interface WebhookEndpoint { id: string; endpoint_url: string; events: string[]; secret?: string; created_at: string; updated_at: string; } export interface AuditLogAction { action: string; } export interface AuditLogRetention { retention_period_in_days: number; } export interface WorkOSCLIClient { sdk: WorkOS; webhooks: { list(): Promise>; create(endpointUrl: string, events: string[]): Promise; delete(id: string): Promise; }; redirectUris: { add(uri: string): Promise<{ success: boolean; alreadyExists: boolean; }>; }; corsOrigins: { add(origin: string): Promise<{ success: boolean; alreadyExists: boolean; }>; }; homepageUrl: { set(url: string): Promise; }; auditLogs: { listActions(): Promise>; getSchema(action: string): Promise; getRetention(orgId: string): Promise; }; } /** * Create a unified WorkOS client. * * @param apiKey - Explicit API key; falls back to resolveApiKey() * @param baseUrl - Explicit base URL; falls back to resolveApiBaseUrl() */ export declare function createWorkOSClient(apiKey?: string, baseUrl?: string): WorkOSCLIClient;