use crate::error::CollabError;
use crate::types::{DekEnvelope, InviteToken, MemberEntry};
pub trait CollabRemote {
fn join(&self, team_id: &str, pubkey: &str) -> Result<(), CollabError>;
fn members(&self, team_id: &str) -> Result<Vec<MemberEntry>, CollabError>;
fn deliver_dek(
&self,
team_id: &str,
recipient_pubkey: &str,
envelope: DekEnvelope,
) -> Result<(), CollabError>;
fn fetch_dek(
&self,
team_id: &str,
recipient_pubkey: &str,
) -> Result<Option<DekEnvelope>, CollabError>;
fn create_invite(
&self,
team_id: &str,
invitee_pubkey: &str,
) -> Result<InviteToken, CollabError>;
fn confirm_invite(
&self,
team_id: &str,
token: &InviteToken,
confirming_pubkey: &str,
) -> Result<(), CollabError>;
fn deliver_recovery_share(
&self,
team_id: &str,
custodian_pubkey: &str,
share_ciphertext: &str,
) -> Result<(), CollabError>;
fn fetch_recovery_share(
&self,
team_id: &str,
custodian_pubkey: &str,
) -> Result<Option<String>, CollabError>;
}