360 lines
11 KiB
TypeScript
360 lines
11 KiB
TypeScript
export type Json =
|
|
| string
|
|
| number
|
|
| boolean
|
|
| null
|
|
| { [key: string]: Json }
|
|
| Json[];
|
|
|
|
export type Database = {
|
|
public: {
|
|
Tables: {
|
|
agencies: {
|
|
Row: { id: string; name: string; created_at: string };
|
|
Insert: { id?: string; name: string; created_at?: string };
|
|
Update: { id?: string; name?: string; created_at?: string };
|
|
};
|
|
agency_members: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
user_id: string;
|
|
role: "owner" | "admin" | "member";
|
|
created_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
user_id: string;
|
|
role: "owner" | "admin" | "member";
|
|
created_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
user_id?: string;
|
|
role?: "owner" | "admin" | "member";
|
|
created_at?: string;
|
|
};
|
|
};
|
|
clients: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
name: string;
|
|
email: string | null;
|
|
phone: string | null;
|
|
notes: string | null;
|
|
created_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
name: string;
|
|
email?: string | null;
|
|
phone?: string | null;
|
|
notes?: string | null;
|
|
created_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
name?: string;
|
|
email?: string | null;
|
|
phone?: string | null;
|
|
notes?: string | null;
|
|
created_at?: string;
|
|
};
|
|
};
|
|
plesk_instances: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
name: string;
|
|
base_url: string;
|
|
auth_type: "api_key" | "basic";
|
|
encrypted_secret: string;
|
|
secret_kid: string | null;
|
|
status: "connected" | "error" | "disabled" | "syncing";
|
|
error_message: string | null;
|
|
last_connected_at: string | null;
|
|
last_sync_at: string | null;
|
|
last_sync_status: string | null;
|
|
last_sync_error: string | null;
|
|
last_sync_subscriptions: number;
|
|
last_sync_domains: number;
|
|
auto_sync_enabled: boolean;
|
|
auto_sync_frequency_minutes: number;
|
|
last_auto_sync_at: string | null;
|
|
next_auto_sync_at: string | null;
|
|
auto_sync_lock_until: string | null;
|
|
auto_sync_lock_token: string | null;
|
|
health_enabled: boolean;
|
|
health_status: "ok" | "degraded" | "down" | "unknown";
|
|
health_last_checked_at: string | null;
|
|
health_last_ok_at: string | null;
|
|
health_last_error: string | null;
|
|
health_last_latency_ms: number | null;
|
|
health_check_frequency_minutes: number;
|
|
health_next_check_at: string | null;
|
|
health_lock_until: string | null;
|
|
health_lock_token: string | null;
|
|
created_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
name: string;
|
|
base_url: string;
|
|
auth_type: "api_key" | "basic";
|
|
encrypted_secret: string;
|
|
secret_kid?: string | null;
|
|
status?: "connected" | "error" | "disabled" | "syncing";
|
|
error_message?: string | null;
|
|
last_connected_at?: string | null;
|
|
last_sync_at?: string | null;
|
|
last_sync_status?: string | null;
|
|
last_sync_error?: string | null;
|
|
last_sync_subscriptions?: number;
|
|
last_sync_domains?: number;
|
|
auto_sync_enabled?: boolean;
|
|
auto_sync_frequency_minutes?: number;
|
|
last_auto_sync_at?: string | null;
|
|
next_auto_sync_at?: string | null;
|
|
auto_sync_lock_until?: string | null;
|
|
auto_sync_lock_token?: string | null;
|
|
health_enabled?: boolean;
|
|
health_status?: "ok" | "degraded" | "down" | "unknown";
|
|
health_last_checked_at?: string | null;
|
|
health_last_ok_at?: string | null;
|
|
health_last_error?: string | null;
|
|
health_last_latency_ms?: number | null;
|
|
health_check_frequency_minutes?: number;
|
|
health_next_check_at?: string | null;
|
|
health_lock_until?: string | null;
|
|
health_lock_token?: string | null;
|
|
created_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
name?: string;
|
|
base_url?: string;
|
|
auth_type?: "api_key" | "basic";
|
|
encrypted_secret?: string;
|
|
secret_kid?: string | null;
|
|
status?: "connected" | "error" | "disabled" | "syncing";
|
|
error_message?: string | null;
|
|
last_connected_at?: string | null;
|
|
last_sync_at?: string | null;
|
|
last_sync_status?: string | null;
|
|
last_sync_error?: string | null;
|
|
last_sync_subscriptions?: number;
|
|
last_sync_domains?: number;
|
|
auto_sync_enabled?: boolean;
|
|
auto_sync_frequency_minutes?: number;
|
|
last_auto_sync_at?: string | null;
|
|
next_auto_sync_at?: string | null;
|
|
auto_sync_lock_until?: string | null;
|
|
auto_sync_lock_token?: string | null;
|
|
health_enabled?: boolean;
|
|
health_status?: "ok" | "degraded" | "down" | "unknown";
|
|
health_last_checked_at?: string | null;
|
|
health_last_ok_at?: string | null;
|
|
health_last_error?: string | null;
|
|
health_last_latency_ms?: number | null;
|
|
health_check_frequency_minutes?: number;
|
|
health_next_check_at?: string | null;
|
|
health_lock_until?: string | null;
|
|
health_lock_token?: string | null;
|
|
created_at?: string;
|
|
};
|
|
};
|
|
plesk_subscriptions: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
plesk_instance_id: string;
|
|
client_id: string | null;
|
|
plesk_subscription_id: string;
|
|
name: string | null;
|
|
status: string | null;
|
|
owner_login: string | null;
|
|
plan_name: string | null;
|
|
created_at: string;
|
|
updated_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
plesk_instance_id: string;
|
|
client_id?: string | null;
|
|
plesk_subscription_id: string;
|
|
name?: string | null;
|
|
status?: string | null;
|
|
owner_login?: string | null;
|
|
plan_name?: string | null;
|
|
created_at?: string;
|
|
updated_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
plesk_instance_id?: string;
|
|
client_id?: string | null;
|
|
plesk_subscription_id?: string;
|
|
name?: string | null;
|
|
status?: string | null;
|
|
owner_login?: string | null;
|
|
plan_name?: string | null;
|
|
created_at?: string;
|
|
updated_at?: string;
|
|
};
|
|
};
|
|
plesk_domains: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
plesk_instance_id: string;
|
|
subscription_id: string | null;
|
|
external_subscription_id: string | null;
|
|
plesk_domain_id: string;
|
|
domain_name: string;
|
|
status: string | null;
|
|
hosting_type: string | null;
|
|
source_created_at: string | null;
|
|
aliases_count: number | null;
|
|
updated_at: string;
|
|
created_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
plesk_instance_id: string;
|
|
subscription_id?: string | null;
|
|
external_subscription_id?: string | null;
|
|
plesk_domain_id: string;
|
|
domain_name: string;
|
|
status?: string | null;
|
|
hosting_type?: string | null;
|
|
source_created_at?: string | null;
|
|
aliases_count?: number | null;
|
|
updated_at?: string;
|
|
created_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
plesk_instance_id?: string;
|
|
subscription_id?: string | null;
|
|
external_subscription_id?: string | null;
|
|
plesk_domain_id?: string;
|
|
domain_name?: string;
|
|
status?: string | null;
|
|
hosting_type?: string | null;
|
|
source_created_at?: string | null;
|
|
aliases_count?: number | null;
|
|
updated_at?: string;
|
|
created_at?: string;
|
|
};
|
|
};
|
|
actions_log: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
actor_user_id: string | null;
|
|
target_type: string;
|
|
target_id: string | null;
|
|
action: string;
|
|
status: "pending" | "success" | "failed";
|
|
error_message: string | null;
|
|
metadata: Json;
|
|
created_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
actor_user_id?: string | null;
|
|
target_type: string;
|
|
target_id?: string | null;
|
|
action: string;
|
|
status?: "pending" | "success" | "failed";
|
|
error_message?: string | null;
|
|
metadata?: Json;
|
|
created_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
actor_user_id?: string | null;
|
|
target_type?: string;
|
|
target_id?: string | null;
|
|
action?: string;
|
|
status?: "pending" | "success" | "failed";
|
|
error_message?: string | null;
|
|
metadata?: Json;
|
|
created_at?: string;
|
|
};
|
|
};
|
|
billing_accounts: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
stripe_customer_id: string | null;
|
|
stripe_subscription_id: string | null;
|
|
plan_id: string | null;
|
|
subscription_status: string | null;
|
|
current_period_end: string | null;
|
|
created_at: string;
|
|
updated_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
stripe_customer_id?: string | null;
|
|
stripe_subscription_id?: string | null;
|
|
plan_id?: string | null;
|
|
subscription_status?: string | null;
|
|
current_period_end?: string | null;
|
|
created_at?: string;
|
|
updated_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
stripe_customer_id?: string | null;
|
|
stripe_subscription_id?: string | null;
|
|
plan_id?: string | null;
|
|
subscription_status?: string | null;
|
|
current_period_end?: string | null;
|
|
created_at?: string;
|
|
updated_at?: string;
|
|
};
|
|
};
|
|
entitlements: {
|
|
Row: {
|
|
id: string;
|
|
agency_id: string;
|
|
key: string;
|
|
value: Json;
|
|
created_at: string;
|
|
};
|
|
Insert: {
|
|
id?: string;
|
|
agency_id: string;
|
|
key: string;
|
|
value?: Json;
|
|
created_at?: string;
|
|
};
|
|
Update: {
|
|
id?: string;
|
|
agency_id?: string;
|
|
key?: string;
|
|
value?: Json;
|
|
created_at?: string;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|