Files
WebDrop/web/src/core-bridge/protocol/account.ts
T

28 lines
1.1 KiB
TypeScript

import type { AccountProfile } from '../generated/api';
export interface InvitationKeyPair { publicKey: JsonWebKey; privateKey: JsonWebKey }
export interface SigningKeyPair { publicKey: JsonWebKey; privateKey: JsonWebKey }
/** Account vault v2: credentials and cached metadata, encrypted before transport. */
export type PersonalProfile = Pick<AccountProfile, 'displayName' | 'modifiedAt'> & { avatar?: string };
export interface ResourceDelete { id: string; modifiedAt: number }
export interface VaultResource {
domainKeys?: Record<string, string>;
id: string;
kind: 'channel' | 'share';
mode: 'enc' | 'raw';
role: 'owner' | 'member';
link: string;
ownerLink?: string;
modifiedAt?: number;
createdAt: number;
expiresAt: number;
creatorAccount?: string;
name?: string;
seats: number;
ttlSeconds?: number;
maxDownloads?: number | null;
maxVisitors?: number;
mine?: boolean;
state?: 'draft' | 'sealed';
}
export interface VaultProfile { v: 3; keys: InvitationKeyPair & { signing: SigningKeyPair }; resources: VaultResource[]; deletes: ResourceDelete[] }