import { SupabaseManagementAPI } from 'supabase-management-js'; import { S as StripeSchemaComment } from '../schemaComment-CfQVwFKa.js'; export { I as INSTALLATION_ERROR_SUFFIX, a as INSTALLATION_INSTALLED_SUFFIX, b as INSTALLATION_STARTED_SUFFIX, c as STRIPE_SCHEMA_COMMENT_PREFIX, d as SchemaInstallationStatus, U as UNINSTALLATION_ERROR_SUFFIX, e as UNINSTALLATION_STARTED_SUFFIX, p as parseSchemaComment } from '../schemaComment-CfQVwFKa.js'; interface DeployClientOptions { accessToken: string; projectRef: string; projectBaseUrl?: string; supabaseManagementUrl?: string; } interface ProjectInfo { id: string; name: string; region: string; } declare class SupabaseSetupClient { api: SupabaseManagementAPI; private projectRef; private projectBaseUrl; private supabaseManagementUrl?; private accessToken; private workerSecret; constructor(options: DeployClientOptions); /** * Deploy an Edge Function */ deployFunction(name: string, code: string, verifyJwt?: boolean): Promise; /** * Inject package version into Edge Function code */ private injectPackageVersion; /** * Set secrets for Edge Functions */ setSecrets(secrets: { name: string; value: string; }[]): Promise; /** * Run SQL against the database */ runSQL(sql: string): Promise; /** * Setup pg_cron job to invoke worker function * @param intervalSeconds - How often to run the worker (default: 60 seconds) */ setupPgCronJob(intervalSeconds?: number): Promise; /** * Setup pg_cron job for Sigma data worker (every 12 hours) * Creates secret, self-trigger function, and cron job */ setupSigmaPgCronJob(): Promise; /** * Get the webhook URL for this project */ getWebhookUrl(): string; /** * Get the anon key for this project (needed for Realtime subscriptions) */ getAnonKey(): Promise; /** * Get the project URL */ getProjectUrl(): string; /** * Invoke an Edge Function */ invokeFunction(slug: string, method: string, bearerToken: string): Promise<{ success: boolean; error?: string; }>; /** * Check if a schema exists in the database * @param schema The schema name to check (defaults to 'stripe') * @returns true if schema exists, false otherwise */ private schemaExists; /** * Reads and parses comment from a schema * @param schema schema to read comment from * @returns parsed comment or null if either schema or the comment doesn't exist */ private readAndParseComment; /** * Check if stripe-sync is installed in the database. * * Uses the Supabase Management API to run SQL queries. * Uses duck typing (schema + migrations table) combined with comment validation. * Throws error for legacy installations to prevent accidental corruption. * * @param schema The schema name to check (defaults to 'stripe') * @returns true if properly installed with comment marker, false if not installed * @throws Error if legacy installation detected (schema exists without comment) */ isInstalled(schema?: string): Promise; /** * Update installation progress comment on the stripe schema */ updateComment(comment: StripeSchemaComment): Promise; /** * Uninstall stripe-sync from a Supabase project * Invokes the stripe-setup edge function's DELETE endpoint which handles cleanup * Tracks uninstallation progress via schema comments */ uninstall(startTime?: number): Promise; install(stripeKey: string, packageVersion?: string, workerIntervalSeconds?: number, enableSigma?: boolean, rateLimit?: number, syncIntervalSeconds?: number, startTime?: number): Promise; } declare function install(params: { supabaseAccessToken: string; supabaseProjectRef: string; stripeKey: string; packageVersion?: string; workerIntervalSeconds?: number; baseProjectUrl?: string; supabaseManagementUrl?: string; enableSigma?: boolean; rateLimit?: number; syncIntervalSeconds?: number; startTime?: number; }): Promise; declare function uninstall(params: { supabaseAccessToken: string; supabaseProjectRef: string; baseProjectUrl?: string; supabaseManagementUrl?: string; startTime?: number; }): Promise; declare function getCurrentVersion(): string; declare const setupFunctionCode: string; declare const webhookFunctionCode: string; declare const workerFunctionCode: string; declare const sigmaWorkerFunctionCode: string; export { type DeployClientOptions, type ProjectInfo, StripeSchemaComment, SupabaseSetupClient as SupabaseDeployClient, SupabaseSetupClient, getCurrentVersion, install, setupFunctionCode, sigmaWorkerFunctionCode, uninstall, webhookFunctionCode, workerFunctionCode };