User
Source: lyda-shared/src/Models/db/lyda/User.ts
Dependencies
import {Follow} from "./Follow.js";
import {UserBadge} from "./UserBadge.js";
import {Usersetting} from "./Usersetting.js";
import {Badge} from "./Badge.js";
import {Subscription} from "../finance/Subscription.js";
import {UserEmail} from "./UserEmail.js";
import {Permission} from "./Permission.js";
import {Entity} from "@targoninc/ts-search";
import {UserTotp} from "./UserTotp.ts";
import {PublicKey} from "./PublicKey.ts";
User
Represents a user entity with associated attributes and relationships.
The User interface extends the Entity interface from our search library and defines additional properties
related to the user, including information about permissions, subscriptions, settings, badges,
security credentials, and activity logs.
Type: interface
export interface User extends Entity {
permissions?: Permission[];
subscription?: Subscription;
settings?: Usersetting[];
badges?: Badge[];
userBadges?: UserBadge[];
follows?: Follow[];
following?: Follow[];
totp?: UserTotp[];
public_keys?: PublicKey[];
giftedSubscriptions?: Subscription[];
id: number;
username: string;
mfa_enabled: boolean;
emails: UserEmail[];
password_hash: string;
displayname: string;
description: string;
password_token: string|null;
verified: boolean;
verification_status: string;
created_at: Date;
updated_at: Date;
deleted_at: Date;
lastlogin?: Date;
secondlastlogin?: Date;
password_updated_at: Date;
tos_agreed_at: Date;
ip: string;
has_avatar: boolean;
has_banner: boolean;
email_mfa_code: string;
passkey_user_id: string;
}
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| permissions | Permission[] | No | - |
| subscription | Subscription | No | - |
| settings | Usersetting[] | No | - |
| badges | Badge[] | No | - |
| userBadges | UserBadge[] | No | - |
| follows | Follow[] | No | - |
| following | Follow[] | No | - |
| totp | UserTotp[] | No | - |
| public_keys | PublicKey[] | No | - |
| giftedSubscriptions | Subscription[] | No | - |
| id | number | Yes | - |
| username | string | Yes | - |
| mfa_enabled | boolean | Yes | - |
| emails | UserEmail[] | Yes | - |
| password_hash | string | Yes | - |
| displayname | string | Yes | - |
| description | string | Yes | - |
| password_token | string or null | Yes | - |
| verified | boolean | Yes | - |
| verification_status | string | Yes | - |
| created_at | Date | Yes | - |
| updated_at | Date | Yes | - |
| deleted_at | Date | Yes | - |
| lastlogin | Date | No | - |
| secondlastlogin | Date | No | - |
| password_updated_at | Date | Yes | - |
| tos_agreed_at | Date | Yes | - |
| ip | string | Yes | - |
| has_avatar | boolean | Yes | - |
| has_banner | boolean | Yes | - |
| email_mfa_code | string | Yes | - |
| passkey_user_id | string | Yes | - |