export interface GoodOSClientOptions { apiKey?: string; accessToken?: string; attestationToken?: string; baseUrl?: string; rootUrl?: string; headers?: Record; maxRetries?: number; timeoutMs?: number; } export interface GoodOSApiKeyContext { id: string; name: string; type: string; scopes: string[]; allowedAppIds: string[]; } export interface GoodOSResponse { success: boolean; data?: T; message?: string; [key: string]: unknown; } export interface GoodOSApp { id: string; name: string; domain?: string; status: string; memberCount?: number; } export interface GoodOSFunctionRun { id: string; status: string; durationMs?: number; startedAt?: string; completedAt?: string; } export class GoodOSError extends Error { status: number; payload: unknown; response: Response | null; } export class GoodOSClient { constructor(options?: GoodOSClientOptions); setApiKey(apiKey: string): this; setAccessToken(accessToken: string): this; setAttestationToken(attestationToken: string): this; platformRequest(path: string, options?: RequestInit & { body?: unknown }): Promise; issueDataToken(): Promise<{ success: true; token: string; tokenType: "Bearer"; expiresIn: string; endpoint: string }>; dataRows>(resource: string, params?: Record): Promise; createDataRow>(resource: string, row?: Record): Promise; updateDataRows>(resource: string, filters?: Record, changes?: Record): Promise; deleteDataRows>(resource: string, filters?: Record): Promise; request(path: string, options?: RequestInit & { body?: unknown }): Promise>; health(): Promise; apps(): Promise>; dbTables(): Promise; dbRows(tableSlug: string, params?: { limit?: number; offset?: number; search?: string }): Promise; dbRow(tableSlug: string, id: string): Promise; createDbRow(tableSlug: string, row?: Record): Promise; updateDbRow(tableSlug: string, id: string, row?: Record): Promise; deleteDbRow(tableSlug: string, id: string): Promise; notifications(): Promise; createNotification(input?: Record): Promise; billingPlans(): Promise; usage(): Promise; authSession(): Promise; authRoles(): Promise; setupMfa(label?: string): Promise; verifyMfa(factorId: string, token: string): Promise; requestPasswordReset(email: string): Promise; completePasswordReset(token: string, password: string): Promise; startPasswordless(email: string, type?: "email_otp" | "magic_link"): Promise; verifyPasswordless(email: string, secret: string, type?: "email_otp" | "magic_link"): Promise; consumerAuthProviders(): Promise; createAnonymousAccount(appId?: string): Promise; startPhoneOtp(phone: string): Promise; verifyPhoneOtp(phone: string, code: string): Promise; exchangeAttestation(appId: string, platform: "ios" | "android" | "web" | "flutter" | "custom", assertion: Record): Promise; registerMessagingDevice(input: { appId: string; platform: "ios" | "android" | "web" | "flutter"; deviceToken: string; locale?: string; timezone?: string }): Promise; revokeMessagingDevice(deviceId: string): Promise; assuranceOverview(): Promise; queues(): Promise; sendQueueMessage(queueId: string, payload: unknown, options?: { idempotencyKey?: string; delaySeconds?: number; priority?: number }): Promise; migrationPlans(): Promise; validateMigration(input: { name: string; fileName: string; sql: string; rollbackGuidance?: string; sourceRevision?: string }): Promise; previewEnvironments(): Promise; createPreview(input: { name: string; slug?: string; sourceRevision: string; pullRequestRef?: string; ttlHours?: number }): Promise; enterpriseOverview(): Promise; queryLogs(filters?: { query?: string; service?: string; severity?: string; hours?: number; limit?: number; requestId?: string; traceId?: string; regex?: boolean }): Promise; customDomains(): Promise; addCustomDomain(input: { hostname: string; type?: "api" | "auth" | "storage" | "functions" | "vanity"; targetHostname?: string }): Promise; vectorCollections(): Promise; createVectorCollection(input: { name: string; dimensions: number; distanceMetric?: "cosine" | "inner_product" | "euclidean"; indexType?: "hnsw" | "ivfflat" | "exact"; provider?: string; model?: string; providerSecretRef?: string }): Promise; upsertVectorDocument(collectionId: string, input: { externalId?: string; content: string; metadata?: Record; embedding?: number[] }): Promise; searchVectors(collectionId: string, input: { mode?: "keyword" | "semantic" | "hybrid"; query?: string; embedding?: number[]; limit?: number; minimumScore?: number }): Promise; infrastructureStatus(): Promise; productionOverview(): Promise; productionVerificationRuns(limit?: number): Promise; runProductionVerification(): Promise; recoveryStatus(): Promise; officialSdkReleases(): Promise; syncCollections(): Promise; createSyncCollection(input: { name: string; conflictPolicy?: "reject" | "last_write_wins" | "merge"; retentionDays?: number }): Promise; syncChanges(collectionId: string, options?: { cursor?: number; limit?: number }): Promise; syncMutations(collectionId: string, input: { deviceId: string; mutations: Array<{ idempotencyKey: string; recordKey: string; operation: "upsert" | "delete"; expectedVersion?: number; value?: unknown; baseValue?: unknown }> }): Promise; productionControllers(): Promise; requestManagementOperation(type: string, parameters?: Record, idempotencyKey?: string): Promise; realtimeChannels(): Promise; realtimeEvents(params?: { channel?: string; limit?: number; offset?: number }): Promise; publishRealtimeEvent(channel?: string, event?: { eventType?: string; event_type?: string; message?: string; payload?: Record }): Promise; realtimeStreamUrl(channel?: string, rootUrl?: string): string; realtimeWebSocketUrl(channel?: string, options?: { rootUrl?: string; apiKey?: string }): string; connectRealtimeWebSocket(channel?: string, options?: { rootUrl?: string; apiKey?: string }): WebSocket; track(appId: string, events: Record | Array>, context?: Record): Promise; recordSession(appId: string, lifecycle: Record): Promise; captureCrash(appId: string, crash: Record): Promise; recordTrace(appId: string, trace: Record): Promise; remoteConfig(appId: string, context?: Record): Promise; experimentAssignments(appId: string, anonymousId?: string): Promise; storageBuckets(): Promise; storagePublicUrl(bucketName: string, objectKey: string, rootUrl?: string): string; storageFiles(params?: { bucket?: string }): Promise; callFunction, TOutput = unknown>( slug: string, input?: TInput, options?: { method?: "GET" | "POST" } ): Promise>; } export function createClient(options?: GoodOSClientOptions): GoodOSClient;