import { Column, Entity, Index, ManyToOne, PrimaryColumn } from "typeorm";
import { id } from "../id.js";
import { User } from "./user.js";
@Entity()
export class App {
@PrimaryColumn(id())
public id: string;
@Index()
@Column("timestamp with time zone", {
comment: "The created date of the App.",
})
public createdAt: Date;
@Column({
...id(),
nullable: true,
comment: "The owner ID.",
public userId: User["id"] | null;
@ManyToOne((type) => User, {
onDelete: "SET NULL",
public user: User | null;
@Column("varchar", {
length: 64,
comment: "The secret key of the App.",
public secret: string;
length: 128,
comment: "The name of the App.",
public name: string;
length: 512,
comment: "The description of the App.",
public description: string;
array: true,
comment: "The permission of the App.",
public permission: string[];
comment: "The callbackUrl of the App.",
public callbackUrl: string | null;
}