summaryrefslogtreecommitdiff
path: root/packages/backend/src/models/App.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/models/App.ts')
-rw-r--r--packages/backend/src/models/App.ts65
1 files changed, 65 insertions, 0 deletions
diff --git a/packages/backend/src/models/App.ts b/packages/backend/src/models/App.ts
new file mode 100644
index 0000000000..c599ef8be0
--- /dev/null
+++ b/packages/backend/src/models/App.ts
@@ -0,0 +1,65 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and other misskey contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import { Entity, PrimaryColumn, Column, Index, ManyToOne } from 'typeorm';
+import { id } from './util/id.js';
+import { MiUser } from './User.js';
+
+@Entity('app')
+export class MiApp {
+ @PrimaryColumn(id())
+ public id: string;
+
+ @Index()
+ @Column('timestamp with time zone', {
+ comment: 'The created date of the App.',
+ })
+ public createdAt: Date;
+
+ @Index()
+ @Column({
+ ...id(),
+ nullable: true,
+ comment: 'The owner ID.',
+ })
+ public userId: MiUser['id'] | null;
+
+ @ManyToOne(type => MiUser, {
+ onDelete: 'SET NULL',
+ nullable: true,
+ })
+ public user: MiUser | null;
+
+ @Index()
+ @Column('varchar', {
+ length: 64,
+ comment: 'The secret key of the App.',
+ })
+ public secret: string;
+
+ @Column('varchar', {
+ length: 128,
+ comment: 'The name of the App.',
+ })
+ public name: string;
+
+ @Column('varchar', {
+ length: 512,
+ comment: 'The description of the App.',
+ })
+ public description: string;
+
+ @Column('varchar', {
+ length: 64, array: true,
+ comment: 'The permission of the App.',
+ })
+ public permission: string[];
+
+ @Column('varchar', {
+ length: 512, nullable: true,
+ comment: 'The callbackUrl of the App.',
+ })
+ public callbackUrl: string | null;
+}