import { z } from 'zod'; import { ServiceBubble } from '../../types/service-bubble-class.js'; import type { BubbleContext } from '../../types/bubble.js'; import { CredentialType } from '@bubblelab/shared-schemas'; export declare const SqlOperations: z.ZodEnum<["SELECT", "INSERT", "UPDATE", "DELETE", "CREATE", "WITH", "EXPLAIN"]>; declare const InsForgeDbParamsSchema: z.ZodObject<{ query: z.ZodString; allowedOperations: z.ZodDefault, "many">>; parameters: z.ZodDefault>>; timeout: z.ZodDefault; maxRows: z.ZodDefault; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { parameters: unknown[]; timeout: number; query: string; allowedOperations: ("SELECT" | "INSERT" | "UPDATE" | "DELETE" | "WITH" | "EXPLAIN" | "CREATE")[]; maxRows: number; credentials?: Partial> | undefined; }, { query: string; parameters?: unknown[] | undefined; credentials?: Partial> | undefined; timeout?: number | undefined; allowedOperations?: ("SELECT" | "INSERT" | "UPDATE" | "DELETE" | "WITH" | "EXPLAIN" | "CREATE")[] | undefined; maxRows?: number | undefined; }>; type InsForgeDbParamsInput = z.input; type InsForgeDbParams = z.output; declare const InsForgeDbResultSchema: z.ZodObject<{ rows: z.ZodArray, "many">; rowCount: z.ZodNullable; command: z.ZodString; executionTime: z.ZodNumber; success: z.ZodBoolean; error: z.ZodString; cleanedJSONString: z.ZodString; }, "strip", z.ZodTypeAny, { executionTime: number; error: string; success: boolean; rows: Record[]; rowCount: number | null; command: string; cleanedJSONString: string; }, { executionTime: number; error: string; success: boolean; rows: Record[]; rowCount: number | null; command: string; cleanedJSONString: string; }>; type InsForgeDbResult = z.output; export type { InsForgeDbParamsInput }; /** * InsForge Database Bubble * * Execute SQL queries against an InsForge backend database. * Works similarly to the PostgreSQL bubble but uses InsForge's REST API. * * @example * ```typescript * const result = await new InsForgeDbBubble({ * query: 'SELECT * FROM users WHERE active = $1', * parameters: [true], * allowedOperations: ['SELECT'], * maxRows: 100, * }).action(); * * console.log(result.data.rows); * ``` */ export declare class InsForgeDbBubble extends ServiceBubble { static readonly type: "service"; static readonly service = "insforge"; static readonly authType: "apikey"; static readonly bubbleName = "insforge-db"; static readonly schema: z.ZodObject<{ query: z.ZodString; allowedOperations: z.ZodDefault, "many">>; parameters: z.ZodDefault>>; timeout: z.ZodDefault; maxRows: z.ZodDefault; credentials: z.ZodOptional, z.ZodString>>; }, "strip", z.ZodTypeAny, { parameters: unknown[]; timeout: number; query: string; allowedOperations: ("SELECT" | "INSERT" | "UPDATE" | "DELETE" | "WITH" | "EXPLAIN" | "CREATE")[]; maxRows: number; credentials?: Partial> | undefined; }, { query: string; parameters?: unknown[] | undefined; credentials?: Partial> | undefined; timeout?: number | undefined; allowedOperations?: ("SELECT" | "INSERT" | "UPDATE" | "DELETE" | "WITH" | "EXPLAIN" | "CREATE")[] | undefined; maxRows?: number | undefined; }>; static readonly resultSchema: z.ZodObject<{ rows: z.ZodArray, "many">; rowCount: z.ZodNullable; command: z.ZodString; executionTime: z.ZodNumber; success: z.ZodBoolean; error: z.ZodString; cleanedJSONString: z.ZodString; }, "strip", z.ZodTypeAny, { executionTime: number; error: string; success: boolean; rows: Record[]; rowCount: number | null; command: string; cleanedJSONString: string; }, { executionTime: number; error: string; success: boolean; rows: Record[]; rowCount: number | null; command: string; cleanedJSONString: string; }>; static readonly shortDescription = "InsForge is the backend built for AI-assisted development. Connect InsForge with any agent. Add authentication, database, storage, functions, and AI integrations to your app in seconds."; static readonly longDescription = "\n Authentication - Complete user management system\n Database - Flexible data storage and retrieval\n Storage - File management and organization\n AI Integration - Chat completions and image generation (OpenAI-compatible)\n Serverless Functions - Scalable compute power\n Site Deployment (coming soon) - Easy application deployment\n "; static readonly alias = "insforge"; constructor(params?: InsForgeDbParamsInput, context?: BubbleContext); testCredential(): Promise; protected chooseCredential(): string | undefined; private getCredentials; /** * Validate that the SQL query operation is allowed */ private validateSqlOperation; protected performAction(context?: BubbleContext): Promise; } //# sourceMappingURL=insforge-db.d.ts.map