import type { Role } from './AuthStore'; /** A project as the user management lists it under its owner. */ export interface OwnedProject { id: string; name: string; updatedAt: string; } /** One account as an administrator sees it – never the password. */ export interface Account { username: string; role: Role; /** ISO date; empty for the accounts from before #179, which were made without one. */ createdAt: string; projects: OwnedProject[]; } /** What an administrator changes about an account in one go; a field left out stays. */ export interface AccountChange { username?: string; role?: Role; password?: string; } /** * The accounts, for administrators only (#179). The server checks the role on every call: a user * who got hold of this would get 403s, nothing else. A refusal rejects with the server's own * sentence as the message, so a dialog can show it as it stands. */ export interface UsersStore { list(): Promise; create(username: string, password: string, role: Role): Promise; update(username: string, change: AccountChange): Promise; remove(username: string): Promise; }