import Column from "@entity-access/entity-access/dist/decorators/Column.js"; import { RelateTo } from "@entity-access/entity-access/dist/decorators/Relate.js"; import { User } from "./User.js"; import { JsonProperty } from "@entity-access/server-pages/dist/services/ModelService.js"; import DateTime from "@entity-access/entity-access/dist/types/DateTime.js"; import Sql from "@entity-access/entity-access/dist/sql/Sql.js"; import Table from "@entity-access/entity-access/dist/decorators/Table.js"; @Table("AppPasswords") export default class AppPassword { @Column({ dataType: "BigInt", key: true }) @RelateTo(User, { property: (x) => x.user, inverseProperty: (x) => x.appPasswords }) public userID: number; @Column({ dataType: "Char", length: 400, key: true }) public name: string; @Column({ dataType: "Char", length: 200 }) public passwordHash: string; @Column({ dataType: "DateTime", default: () => Sql.date.now()}) public dateCreated: DateTime; @Column({ dataType: "DateTime", nullable: true}) public lastUsed: DateTime; @Column({ dataType: "DateTime", nullable: true}) public expires: DateTime; @JsonProperty({ }) public password: string; user: User; }