2019-04-07 15:50:36 +03:00
|
|
|
import { Entity, PrimaryColumn, Index, Column } from 'typeorm';
|
2021-08-19 15:55:45 +03:00
|
|
|
import { id } from '../id';
|
2019-04-07 15:50:36 +03:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class Instance {
|
|
|
|
@PrimaryColumn(id())
|
|
|
|
public id: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* このインスタンスを捕捉した日時
|
|
|
|
*/
|
|
|
|
@Index()
|
|
|
|
@Column('timestamp with time zone', {
|
2021-12-09 16:58:30 +02:00
|
|
|
comment: 'The caught date of the Instance.',
|
2019-04-07 15:50:36 +03:00
|
|
|
})
|
|
|
|
public caughtAt: Date;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ホスト
|
|
|
|
*/
|
|
|
|
@Index({ unique: true })
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128,
|
2021-12-09 16:58:30 +02:00
|
|
|
comment: 'The host of the Instance.',
|
2019-04-07 15:50:36 +03:00
|
|
|
})
|
|
|
|
public host: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* インスタンスのユーザー数
|
|
|
|
*/
|
|
|
|
@Column('integer', {
|
|
|
|
default: 0,
|
2021-12-09 16:58:30 +02:00
|
|
|
comment: 'The count of the users of the Instance.',
|
2019-04-07 15:50:36 +03:00
|
|
|
})
|
|
|
|
public usersCount: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* インスタンスの投稿数
|
|
|
|
*/
|
|
|
|
@Column('integer', {
|
|
|
|
default: 0,
|
2021-12-09 16:58:30 +02:00
|
|
|
comment: 'The count of the notes of the Instance.',
|
2019-04-07 15:50:36 +03:00
|
|
|
})
|
|
|
|
public notesCount: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* このインスタンスのユーザーからフォローされている、自インスタンスのユーザーの数
|
|
|
|
*/
|
|
|
|
@Column('integer', {
|
|
|
|
default: 0,
|
|
|
|
})
|
|
|
|
public followingCount: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* このインスタンスのユーザーをフォローしている、自インスタンスのユーザーの数
|
|
|
|
*/
|
|
|
|
@Column('integer', {
|
|
|
|
default: 0,
|
|
|
|
})
|
|
|
|
public followersCount: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ドライブ使用量
|
|
|
|
*/
|
2019-04-29 11:38:31 +03:00
|
|
|
@Column('bigint', {
|
2019-04-07 15:50:36 +03:00
|
|
|
default: 0,
|
|
|
|
})
|
|
|
|
public driveUsage: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ドライブのファイル数
|
|
|
|
*/
|
|
|
|
@Column('integer', {
|
|
|
|
default: 0,
|
|
|
|
})
|
|
|
|
public driveFiles: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 直近のリクエスト送信日時
|
|
|
|
*/
|
|
|
|
@Column('timestamp with time zone', {
|
|
|
|
nullable: true,
|
|
|
|
})
|
|
|
|
public latestRequestSentAt: Date | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 直近のリクエスト送信時のHTTPステータスコード
|
|
|
|
*/
|
|
|
|
@Column('integer', {
|
|
|
|
nullable: true,
|
|
|
|
})
|
|
|
|
public latestStatus: number | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 直近のリクエスト受信日時
|
|
|
|
*/
|
|
|
|
@Column('timestamp with time zone', {
|
|
|
|
nullable: true,
|
|
|
|
})
|
|
|
|
public latestRequestReceivedAt: Date | null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* このインスタンスと最後にやり取りした日時
|
|
|
|
*/
|
|
|
|
@Column('timestamp with time zone')
|
|
|
|
public lastCommunicatedAt: Date;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* このインスタンスと不通かどうか
|
|
|
|
*/
|
|
|
|
@Column('boolean', {
|
2021-12-09 16:58:30 +02:00
|
|
|
default: false,
|
2019-04-07 15:50:36 +03:00
|
|
|
})
|
|
|
|
public isNotResponding: boolean;
|
|
|
|
|
|
|
|
/**
|
2020-01-29 22:56:14 +02:00
|
|
|
* このインスタンスへの配信を停止するか
|
2019-04-07 15:50:36 +03:00
|
|
|
*/
|
2020-01-29 22:56:14 +02:00
|
|
|
@Index()
|
2019-04-07 15:50:36 +03:00
|
|
|
@Column('boolean', {
|
2021-12-09 16:58:30 +02:00
|
|
|
default: false,
|
2019-04-07 15:50:36 +03:00
|
|
|
})
|
2020-01-29 22:56:14 +02:00
|
|
|
public isSuspended: boolean;
|
2019-11-05 15:14:42 +02:00
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 64, nullable: true, default: null,
|
2021-12-09 16:58:30 +02:00
|
|
|
comment: 'The software of the Instance.',
|
2019-11-05 15:14:42 +02:00
|
|
|
})
|
|
|
|
public softwareName: string | null;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 64, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public softwareVersion: string | null;
|
|
|
|
|
|
|
|
@Column('boolean', {
|
|
|
|
nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public openRegistrations: boolean | null;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 256, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public name: string | null;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 4096, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public description: string | null;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 128, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public maintainerName: string | null;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 256, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public maintainerEmail: string | null;
|
|
|
|
|
2020-07-26 05:04:07 +03:00
|
|
|
@Column('varchar', {
|
|
|
|
length: 256, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public iconUrl: string | null;
|
|
|
|
|
2020-10-27 09:16:59 +02:00
|
|
|
@Column('varchar', {
|
|
|
|
length: 256, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public faviconUrl: string | null;
|
|
|
|
|
|
|
|
@Column('varchar', {
|
|
|
|
length: 64, nullable: true, default: null,
|
|
|
|
})
|
|
|
|
public themeColor: string | null;
|
|
|
|
|
2019-11-05 15:14:42 +02:00
|
|
|
@Column('timestamp with time zone', {
|
|
|
|
nullable: true,
|
|
|
|
})
|
|
|
|
public infoUpdatedAt: Date | null;
|
2019-04-07 15:50:36 +03:00
|
|
|
}
|