import { db } from './' ; export interface Owner { id ? : number ; email ? : string ; name ? : string ; privateKey ? : string ; publicKey ? : string ; setupPublicKey ? : string ; } export async function getOwner ( ownerId ) { const owner = await db . owners . get ( ownerId ) ; return owner ; } export async function addOwner ( newOwner ) { await db . owners . add ( newOwner ) ; const owner = await getOwner ( newOwner . id ) ; return owner ; } export async function updateOwner ( updatedOwner ) { const { id , ... changes } = updatedOwner ; await db . owners . update ( id , changes ) ; const owner = await getOwner ( id ) ; return owner ; }