6
6
import { Entity , Column , PrimaryColumn } from 'typeorm' ;
7
7
import { id } from './util/id.js' ;
8
8
9
+ /**
10
+ * ~かつ~
11
+ * 複数の条件を同時に満たす場合のみ成立とする
12
+ */
9
13
type CondFormulaValueAnd = {
10
14
type : 'and' ;
11
15
values : RoleCondFormulaValue [ ] ;
12
16
} ;
13
17
18
+ /**
19
+ * ~または~
20
+ * 複数の条件のうち、いずれかを満たす場合のみ成立とする
21
+ */
14
22
type CondFormulaValueOr = {
15
23
type : 'or' ;
16
24
values : RoleCondFormulaValue [ ] ;
17
25
} ;
18
26
27
+ /**
28
+ * ~ではない
29
+ * 条件を満たさない場合のみ成立とする
30
+ */
19
31
type CondFormulaValueNot = {
20
32
type : 'not' ;
21
33
value : RoleCondFormulaValue ;
22
34
} ;
23
35
36
+ /**
37
+ * ローカルユーザーのみ成立とする
38
+ */
24
39
type CondFormulaValueIsLocal = {
25
40
type : 'isLocal' ;
26
41
} ;
27
42
43
+ /**
44
+ * リモートユーザーのみ成立とする
45
+ */
28
46
type CondFormulaValueIsRemote = {
29
47
type : 'isRemote' ;
30
48
} ;
31
49
50
+ /**
51
+ * 既に指定のマニュアルロールにアサインされている場合のみ成立とする
52
+ */
32
53
type CondFormulaValueRoleAssignedTo = {
33
54
type : 'roleAssignedTo' ;
34
55
roleId : string ;
35
56
} ;
36
57
58
+ /**
59
+ * サスペンド済みアカウントの場合のみ成立とする
60
+ */
61
+ type CondFormulaValueIsSuspended = {
62
+ type : 'isSuspended' ;
63
+ } ;
64
+
65
+ /**
66
+ * 鍵アカウントの場合のみ成立とする
67
+ */
68
+ type CondFormulaValueIsLocked = {
69
+ type : 'isLocked' ;
70
+ } ;
71
+
72
+ /**
73
+ * botアカウントの場合のみ成立とする
74
+ */
75
+ type CondFormulaValueIsBot = {
76
+ type : 'isBot' ;
77
+ } ;
78
+
79
+ /**
80
+ * 猫アカウントの場合のみ成立とする
81
+ */
82
+ type CondFormulaValueIsCat = {
83
+ type : 'isCat' ;
84
+ } ;
85
+
86
+ /**
87
+ * 「ユーザを見つけやすくする」が有効なアカウントの場合のみ成立とする
88
+ */
89
+ type CondFormulaValueIsExplorable = {
90
+ type : 'isExplorable' ;
91
+ } ;
92
+
93
+ /**
94
+ * ユーザが作成されてから指定期間経過した場合のみ成立とする
95
+ */
37
96
type CondFormulaValueCreatedLessThan = {
38
97
type : 'createdLessThan' ;
39
98
sec : number ;
40
99
} ;
41
100
101
+ /**
102
+ * ユーザが作成されてから指定期間経っていない場合のみ成立とする
103
+ */
42
104
type CondFormulaValueCreatedMoreThan = {
43
105
type : 'createdMoreThan' ;
44
106
sec : number ;
45
107
} ;
46
108
109
+ /**
110
+ * フォロワー数が指定値以下の場合のみ成立とする
111
+ */
47
112
type CondFormulaValueFollowersLessThanOrEq = {
48
113
type : 'followersLessThanOrEq' ;
49
114
value : number ;
50
115
} ;
51
116
117
+ /**
118
+ * フォロワー数が指定値以上の場合のみ成立とする
119
+ */
52
120
type CondFormulaValueFollowersMoreThanOrEq = {
53
121
type : 'followersMoreThanOrEq' ;
54
122
value : number ;
55
123
} ;
56
124
125
+ /**
126
+ * フォロー数が指定値以下の場合のみ成立とする
127
+ */
57
128
type CondFormulaValueFollowingLessThanOrEq = {
58
129
type : 'followingLessThanOrEq' ;
59
130
value : number ;
60
131
} ;
61
132
133
+ /**
134
+ * フォロー数が指定値以上の場合のみ成立とする
135
+ */
62
136
type CondFormulaValueFollowingMoreThanOrEq = {
63
137
type : 'followingMoreThanOrEq' ;
64
138
value : number ;
65
139
} ;
66
140
141
+ /**
142
+ * 投稿数が指定値以下の場合のみ成立とする
143
+ */
67
144
type CondFormulaValueNotesLessThanOrEq = {
68
145
type : 'notesLessThanOrEq' ;
69
146
value : number ;
70
147
} ;
71
148
149
+ /**
150
+ * 投稿数が指定値以上の場合のみ成立とする
151
+ */
72
152
type CondFormulaValueNotesMoreThanOrEq = {
73
153
type : 'notesMoreThanOrEq' ;
74
154
value : number ;
@@ -80,6 +160,11 @@ export type RoleCondFormulaValue = { id: string } & (
80
160
CondFormulaValueNot |
81
161
CondFormulaValueIsLocal |
82
162
CondFormulaValueIsRemote |
163
+ CondFormulaValueIsSuspended |
164
+ CondFormulaValueIsLocked |
165
+ CondFormulaValueIsBot |
166
+ CondFormulaValueIsCat |
167
+ CondFormulaValueIsExplorable |
83
168
CondFormulaValueRoleAssignedTo |
84
169
CondFormulaValueCreatedLessThan |
85
170
CondFormulaValueCreatedMoreThan |
0 commit comments