import { z } from 'zod'; import { WorkflowBubble } from '../../types/workflow-bubble-class.js'; import type { BubbleContext } from '../../types/bubble.js'; import { CredentialType } from '@bubblelab/shared-schemas'; declare const DatabaseAnalyzerParamsSchema: z.ZodObject<{ /** * The data source service to analyze (currently supports 'postgresql') */ dataSourceType: z.ZodEnum<["postgresql"]>; /** * Whether to ignore SSL certificate errors when connecting */ ignoreSSLErrors: z.ZodDefault; /** * Include additional metadata like enum values and constraints */ includeMetadata: z.ZodDefault; /** * Injected credentials from the system */ credentials: z.ZodOptional, z.ZodString>>; /** * Injected metadata from user credentials (database schema notes and rules) */ injectedMetadata: z.ZodOptional>>; tableNotes: z.ZodOptional>; rules: z.ZodOptional>; }, "strip", z.ZodTypeAny, { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; }, { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { dataSourceType: "postgresql"; ignoreSSLErrors: boolean; includeMetadata: boolean; credentials?: Partial> | undefined; injectedMetadata?: { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; } | undefined; }, { dataSourceType: "postgresql"; credentials?: Partial> | undefined; ignoreSSLErrors?: boolean | undefined; includeMetadata?: boolean | undefined; injectedMetadata?: { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; } | undefined; }>; declare const DatabaseAnalyzerResultSchema: z.ZodObject<{ success: z.ZodBoolean; error: z.ZodString; /** * The analyzed database schema in structured format */ databaseSchema: z.ZodOptional, "many">>; /** * Cleaned JSON string representation of the schema */ cleanedJSON: z.ZodOptional; /** * Number of tables found */ tableCount: z.ZodOptional; /** * List of table names */ tableNames: z.ZodOptional>; }, "strip", z.ZodTypeAny, { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; }, { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; }>>; /** * Summary of the analysis operation */ analysisSummary: z.ZodOptional>; }, "strip", z.ZodTypeAny, { error: string; success: boolean; databaseSchema?: { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; } | undefined; analysisSummary?: { dataSourceType: string; connectionSuccessful: boolean; analysisTimestamp: Date; } | undefined; }, { error: string; success: boolean; databaseSchema?: { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; } | undefined; analysisSummary?: { dataSourceType: string; connectionSuccessful: boolean; analysisTimestamp: Date; } | undefined; }>; type DatabaseAnalyzerResult = z.output; type DatabaseAnalyzerParamsInput = z.input; type DatabaseAnalyzerParams = z.output; /** * DatabaseAnalyzerWorkflowBubble - Analyzes database schema structure * * This workflow bubble simplifies database schema analysis by: * 1. Connecting to the specified database * 2. Querying the information schema to get table/column structure * 3. Extracting metadata like enum values and constraints * 4. Returning structured schema information ready for AI analysis * * Common use cases: * - Data discovery and cataloging * - Generating queries based on schema structure * - Database documentation generation * - AI-powered data analysis preparation */ export declare class DatabaseAnalyzerWorkflowBubble extends WorkflowBubble { static readonly type: "workflow"; static readonly bubbleName = "database-analyzer"; static readonly schema: z.ZodObject<{ /** * The data source service to analyze (currently supports 'postgresql') */ dataSourceType: z.ZodEnum<["postgresql"]>; /** * Whether to ignore SSL certificate errors when connecting */ ignoreSSLErrors: z.ZodDefault; /** * Include additional metadata like enum values and constraints */ includeMetadata: z.ZodDefault; /** * Injected credentials from the system */ credentials: z.ZodOptional, z.ZodString>>; /** * Injected metadata from user credentials (database schema notes and rules) */ injectedMetadata: z.ZodOptional>>; tableNotes: z.ZodOptional>; rules: z.ZodOptional>; }, "strip", z.ZodTypeAny, { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; }, { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { dataSourceType: "postgresql"; ignoreSSLErrors: boolean; includeMetadata: boolean; credentials?: Partial> | undefined; injectedMetadata?: { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; } | undefined; }, { dataSourceType: "postgresql"; credentials?: Partial> | undefined; ignoreSSLErrors?: boolean | undefined; includeMetadata?: boolean | undefined; injectedMetadata?: { tables?: Record> | undefined; tableNotes?: Record | undefined; rules?: string[] | undefined; } | undefined; }>; static readonly resultSchema: z.ZodObject<{ success: z.ZodBoolean; error: z.ZodString; /** * The analyzed database schema in structured format */ databaseSchema: z.ZodOptional, "many">>; /** * Cleaned JSON string representation of the schema */ cleanedJSON: z.ZodOptional; /** * Number of tables found */ tableCount: z.ZodOptional; /** * List of table names */ tableNames: z.ZodOptional>; }, "strip", z.ZodTypeAny, { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; }, { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; }>>; /** * Summary of the analysis operation */ analysisSummary: z.ZodOptional>; }, "strip", z.ZodTypeAny, { error: string; success: boolean; databaseSchema?: { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; } | undefined; analysisSummary?: { dataSourceType: string; connectionSuccessful: boolean; analysisTimestamp: Date; } | undefined; }, { error: string; success: boolean; databaseSchema?: { rawData?: Record[] | undefined; cleanedJSON?: string | undefined; tableCount?: number | undefined; tableNames?: string[] | undefined; } | undefined; analysisSummary?: { dataSourceType: string; connectionSuccessful: boolean; analysisTimestamp: Date; } | undefined; }>; static readonly shortDescription = "Analyzes database schema structure and metadata"; static readonly longDescription = "Connects to a database and extracts comprehensive schema information including tables, columns, data types, constraints, and enum values. Perfect for AI-powered data analysis, query generation, and database documentation. Currently supports PostgreSQL with plans for additional database types."; static readonly alias = "analyze-db"; constructor(params: DatabaseAnalyzerParamsInput, context?: BubbleContext); protected performAction(_context?: BubbleContext): Promise; /** * Builds the PostgreSQL schema query based on metadata requirements */ private buildPostgreSQLSchemaQuery; } export {}; //# sourceMappingURL=database-analyzer.workflow.d.ts.map