summaryrefslogtreecommitdiff
path: root/src/models/entities/instance.ts
blob: 5fedfc0956c7c7ac39b4b08b5005d4f4745c8bbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import { Entity, PrimaryColumn, Index, Column } from 'typeorm';
import { id } from '../id';

@Entity()
export class Instance {
	@PrimaryColumn(id())
	public id: string;

	/**
	 * このインスタンスを捕捉した日時
	 */
	@Index()
	@Column('timestamp with time zone', {
		comment: 'The caught date of the Instance.'
	})
	public caughtAt: Date;

	/**
	 * ホスト
	 */
	@Index({ unique: true })
	@Column('varchar', {
		length: 128,
		comment: 'The host of the Instance.'
	})
	public host: string;

	/**
	 * インスタンスのユーザー数
	 */
	@Column('integer', {
		default: 0,
		comment: 'The count of the users of the Instance.'
	})
	public usersCount: number;

	/**
	 * インスタンスの投稿数
	 */
	@Column('integer', {
		default: 0,
		comment: 'The count of the notes of the Instance.'
	})
	public notesCount: number;

	/**
	 * このインスタンスのユーザーからフォローされている、自インスタンスのユーザーの数
	 */
	@Column('integer', {
		default: 0,
	})
	public followingCount: number;

	/**
	 * このインスタンスのユーザーをフォローしている、自インスタンスのユーザーの数
	 */
	@Column('integer', {
		default: 0,
	})
	public followersCount: number;

	/**
	 * ドライブ使用量
	 */
	@Column('bigint', {
		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', {
		default: false
	})
	public isNotResponding: boolean;

	/**
	 * このインスタンスへの配信を停止するか
	 */
	@Index()
	@Column('boolean', {
		default: false
	})
	public isSuspended: boolean;

	@Column('varchar', {
		length: 64, nullable: true, default: null,
		comment: 'The software of the Instance.'
	})
	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;

	@Column('varchar', {
		length: 256, nullable: true, default: null,
	})
	public iconUrl: string | null;

	@Column('timestamp with time zone', {
		nullable: true,
	})
	public infoUpdatedAt: Date | null;
}