feat(P3.T2): DeviceRecord.revokedAt + revokeDevice wrapper

Extend DeviceRecord with revokedAt field, update registerDevice and
listOwnDevices selects to include revoked_at, add revokeDevice RPC
helper, update db-types to reflect T1 migration schema, and add
vitest coverage for all new behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
byGalax
2026-05-16 18:52:34 +02:00
parent 540b506f91
commit 5b0aa24a8d
3 changed files with 69 additions and 2 deletions
+4
View File
@@ -119,6 +119,7 @@ export type Database = {
name: string
platform: Database["public"]["Enums"]["device_platform"]
public_key: string | null
revoked_at: string | null
user_id: string
}
Insert: {
@@ -128,6 +129,7 @@ export type Database = {
name: string
platform: Database["public"]["Enums"]["device_platform"]
public_key?: string | null
revoked_at?: string | null
user_id: string
}
Update: {
@@ -137,6 +139,7 @@ export type Database = {
name?: string
platform?: Database["public"]["Enums"]["device_platform"]
public_key?: string | null
revoked_at?: string | null
user_id?: string
}
Relationships: []
@@ -481,6 +484,7 @@ export type Database = {
Functions: {
accept_dm: { Args: { conversation_id: string }; Returns: undefined }
are_friends: { Args: { a: string; b: string }; Returns: boolean }
revoke_device: { Args: { p_device_id: string }; Returns: undefined }
attachment_object_conv_id: {
Args: { object_name: string }
Returns: string