mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-05-09 22:40:50 +00:00
Add support for Supabase database operations, including migrations and queries. Implement new Supabase-related types, actions, and components to handle database interactions. Enhance the prompt system to include Supabase-specific instructions and constraints. Ensure data integrity and security by enforcing row-level security and proper migration practices.
65 lines
1.3 KiB
TypeScript
65 lines
1.3 KiB
TypeScript
import type { Change } from 'diff';
|
|
|
|
export type ActionType = 'file' | 'shell' | 'supabase';
|
|
|
|
export interface BaseAction {
|
|
content: string;
|
|
}
|
|
|
|
export interface FileAction extends BaseAction {
|
|
type: 'file';
|
|
filePath: string;
|
|
}
|
|
|
|
export interface ShellAction extends BaseAction {
|
|
type: 'shell';
|
|
}
|
|
|
|
export interface StartAction extends BaseAction {
|
|
type: 'start';
|
|
}
|
|
|
|
export interface BuildAction extends BaseAction {
|
|
type: 'build';
|
|
}
|
|
|
|
export interface SupabaseAction extends BaseAction {
|
|
type: 'supabase';
|
|
operation: 'migration' | 'query';
|
|
filePath?: string;
|
|
projectId?: string;
|
|
}
|
|
|
|
export type BoltAction = FileAction | ShellAction | StartAction | BuildAction | SupabaseAction;
|
|
|
|
export type BoltActionData = BoltAction | BaseAction;
|
|
|
|
export interface ActionAlert {
|
|
type: string;
|
|
title: string;
|
|
description: string;
|
|
content: string;
|
|
source?: 'terminal' | 'preview'; // Add source to differentiate between terminal and preview errors
|
|
}
|
|
|
|
export interface SupabaseAlert {
|
|
type: string;
|
|
title: string;
|
|
description: string;
|
|
content: string;
|
|
source?: 'supabase';
|
|
}
|
|
|
|
export interface FileHistory {
|
|
originalContent: string;
|
|
lastModified: number;
|
|
changes: Change[];
|
|
versions: {
|
|
timestamp: number;
|
|
content: string;
|
|
}[];
|
|
|
|
// Novo campo para rastrear a origem das mudanças
|
|
changeSource?: 'user' | 'auto-save' | 'external';
|
|
}
|