owltide/shared/types/account.d.ts
Hornwitser 52dfde95d1 Tie push subscriptions to current session
If a user logs out from a device the expectation should be that device
no longer having any association with the user's account.  Any existing
push notifications should thefore be removed on server.  For this reason
tie push notifications to a session, and remove them when the session is
deleted.
2025-03-07 15:47:48 +01:00

23 lines
419 B
TypeScript

export interface Account {
id: number,
type: "anonymous" | "regular" | "crew" | "admin",
/** Name of the account. Not present on anonymous accounts */
name?: string,
}
export interface Subscription {
type: "push",
sessionId: number,
push: PushSubscriptionJSON,
}
export interface Session {
id: number,
accountId: number,
}
export interface AccountSession {
id: number,
account: Account,
push: boolean,
}