feat: Integrate auth.sessions with RPC functions

This commit is contained in:
gpt-engineer-app[bot]
2025-10-14 18:26:22 +00:00
parent 098ca9f3b0
commit b129f88f3a
3 changed files with 121 additions and 80 deletions

View File

@@ -2659,45 +2659,6 @@ export type Database = {
}
Relationships: []
}
user_sessions: {
Row: {
created_at: string
device_info: Json | null
expires_at: string
id: string
ip_address: unknown | null
ip_address_hash: string | null
last_activity: string
session_token: string
user_agent: string | null
user_id: string
}
Insert: {
created_at?: string
device_info?: Json | null
expires_at?: string
id?: string
ip_address?: unknown | null
ip_address_hash?: string | null
last_activity?: string
session_token: string
user_agent?: string | null
user_id: string
}
Update: {
created_at?: string
device_info?: Json | null
expires_at?: string
id?: string
ip_address?: unknown | null
ip_address_hash?: string | null
last_activity?: string
session_token?: string
user_agent?: string | null
user_id?: string
}
Relationships: []
}
user_top_list_items: {
Row: {
created_at: string
@@ -3000,6 +2961,19 @@ export type Database = {
Args: { _profile_user_id: string; _viewer_id?: string }
Returns: Json
}
get_my_sessions: {
Args: Record<PropertyKey, never>
Returns: {
aal: "aal1" | "aal2" | "aal3"
created_at: string
id: string
ip: unknown
not_after: string
refreshed_at: string
updated_at: string
user_agent: string
}[]
}
get_submission_item_dependencies: {
Args: { item_id: string }
Returns: {
@@ -3068,6 +3042,10 @@ export type Database = {
Args: { moderator_id: string; submission_id: string }
Returns: boolean
}
revoke_my_session: {
Args: { session_id: string }
Returns: undefined
}
rollback_to_version: {
Args: {
p_changed_by: string