@shakerquiz/utilities 4.0.77 → 4.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/source/entities/game-status.js +162 -171
- package/source/entities/registration-channel.js +15 -15
- package/source/entities/role.js +8 -19
package/package.json
CHANGED
|
@@ -2,213 +2,204 @@ import { Category } from './category.js'
|
|
|
2
2
|
import { Mode } from './mode.js'
|
|
3
3
|
import { Role } from './role.js'
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
]),
|
|
17
|
-
)
|
|
5
|
+
export const GameStatus = /** @type {const} */ ({
|
|
6
|
+
'Approve': 'Approve',
|
|
7
|
+
'Archive': 'Archive',
|
|
8
|
+
'Close': 'Close',
|
|
9
|
+
'Finish': 'Finish',
|
|
10
|
+
'Invite': 'Invite',
|
|
11
|
+
'Reserve': 'Reserve',
|
|
12
|
+
'Moderate': 'Moderate',
|
|
13
|
+
'Publish': 'Publish',
|
|
14
|
+
'Reject': 'Reject',
|
|
15
|
+
})
|
|
18
16
|
|
|
19
|
-
export const
|
|
20
|
-
/** @type {{ [x in typeof GameStatuses[number]]: x }} */ (
|
|
21
|
-
GameStatuses.reduce(
|
|
22
|
-
(o, x) => (o[x] = x, o),
|
|
23
|
-
{},
|
|
24
|
-
)
|
|
25
|
-
),
|
|
26
|
-
)
|
|
17
|
+
export const GameStatuses = Object.values(GameStatus)
|
|
27
18
|
|
|
28
19
|
export const RoleGameStatusGameStatuses = Object.freeze({
|
|
29
|
-
[Role['
|
|
30
|
-
[GameStatus['
|
|
31
|
-
GameStatus['
|
|
32
|
-
GameStatus['
|
|
33
|
-
GameStatus['
|
|
34
|
-
GameStatus['
|
|
35
|
-
GameStatus['
|
|
36
|
-
GameStatus['
|
|
37
|
-
GameStatus['
|
|
38
|
-
GameStatus['
|
|
39
|
-
GameStatus['
|
|
20
|
+
[Role['Admin']]: Object.freeze({
|
|
21
|
+
[GameStatus['Approve']]: Object.freeze([
|
|
22
|
+
GameStatus['Approve'],
|
|
23
|
+
GameStatus['Archive'],
|
|
24
|
+
GameStatus['Close'],
|
|
25
|
+
GameStatus['Finish'],
|
|
26
|
+
GameStatus['Invite'],
|
|
27
|
+
GameStatus['Reserve'],
|
|
28
|
+
GameStatus['Moderate'],
|
|
29
|
+
GameStatus['Publish'],
|
|
30
|
+
GameStatus['Reject'],
|
|
40
31
|
]),
|
|
41
32
|
|
|
42
|
-
[GameStatus['
|
|
43
|
-
GameStatus['
|
|
44
|
-
GameStatus['
|
|
45
|
-
GameStatus['
|
|
46
|
-
GameStatus['
|
|
47
|
-
GameStatus['
|
|
48
|
-
GameStatus['
|
|
49
|
-
GameStatus['
|
|
50
|
-
GameStatus['
|
|
51
|
-
GameStatus['
|
|
33
|
+
[GameStatus['Archive']]: Object.freeze([
|
|
34
|
+
GameStatus['Approve'],
|
|
35
|
+
GameStatus['Archive'],
|
|
36
|
+
GameStatus['Close'],
|
|
37
|
+
GameStatus['Finish'],
|
|
38
|
+
GameStatus['Invite'],
|
|
39
|
+
GameStatus['Reserve'],
|
|
40
|
+
GameStatus['Moderate'],
|
|
41
|
+
GameStatus['Publish'],
|
|
42
|
+
GameStatus['Reject'],
|
|
52
43
|
]),
|
|
53
44
|
|
|
54
|
-
[GameStatus['
|
|
55
|
-
GameStatus['
|
|
56
|
-
GameStatus['
|
|
57
|
-
GameStatus['
|
|
58
|
-
GameStatus['
|
|
59
|
-
GameStatus['
|
|
60
|
-
GameStatus['
|
|
61
|
-
GameStatus['
|
|
62
|
-
GameStatus['
|
|
63
|
-
GameStatus['
|
|
45
|
+
[GameStatus['Close']]: Object.freeze([
|
|
46
|
+
GameStatus['Approve'],
|
|
47
|
+
GameStatus['Archive'],
|
|
48
|
+
GameStatus['Close'],
|
|
49
|
+
GameStatus['Finish'],
|
|
50
|
+
GameStatus['Invite'],
|
|
51
|
+
GameStatus['Reserve'],
|
|
52
|
+
GameStatus['Moderate'],
|
|
53
|
+
GameStatus['Publish'],
|
|
54
|
+
GameStatus['Reject'],
|
|
64
55
|
]),
|
|
65
56
|
|
|
66
|
-
[GameStatus['
|
|
67
|
-
GameStatus['
|
|
68
|
-
GameStatus['
|
|
69
|
-
GameStatus['
|
|
70
|
-
GameStatus['
|
|
71
|
-
GameStatus['
|
|
72
|
-
GameStatus['
|
|
73
|
-
GameStatus['
|
|
74
|
-
GameStatus['
|
|
75
|
-
GameStatus['
|
|
57
|
+
[GameStatus['Finish']]: Object.freeze([
|
|
58
|
+
GameStatus['Approve'],
|
|
59
|
+
GameStatus['Archive'],
|
|
60
|
+
GameStatus['Close'],
|
|
61
|
+
GameStatus['Finish'],
|
|
62
|
+
GameStatus['Invite'],
|
|
63
|
+
GameStatus['Reserve'],
|
|
64
|
+
GameStatus['Moderate'],
|
|
65
|
+
GameStatus['Publish'],
|
|
66
|
+
GameStatus['Reject'],
|
|
76
67
|
]),
|
|
77
68
|
|
|
78
|
-
[GameStatus['
|
|
79
|
-
GameStatus['
|
|
80
|
-
GameStatus['
|
|
81
|
-
GameStatus['
|
|
82
|
-
GameStatus['
|
|
83
|
-
GameStatus['
|
|
84
|
-
GameStatus['
|
|
85
|
-
GameStatus['
|
|
86
|
-
GameStatus['
|
|
87
|
-
GameStatus['
|
|
69
|
+
[GameStatus['Invite']]: Object.freeze([
|
|
70
|
+
GameStatus['Approve'],
|
|
71
|
+
GameStatus['Archive'],
|
|
72
|
+
GameStatus['Close'],
|
|
73
|
+
GameStatus['Finish'],
|
|
74
|
+
GameStatus['Invite'],
|
|
75
|
+
GameStatus['Reserve'],
|
|
76
|
+
GameStatus['Moderate'],
|
|
77
|
+
GameStatus['Publish'],
|
|
78
|
+
GameStatus['Reject'],
|
|
88
79
|
]),
|
|
89
80
|
|
|
90
|
-
[GameStatus['
|
|
91
|
-
GameStatus['
|
|
92
|
-
GameStatus['
|
|
93
|
-
GameStatus['
|
|
94
|
-
GameStatus['
|
|
95
|
-
GameStatus['
|
|
96
|
-
GameStatus['
|
|
97
|
-
GameStatus['
|
|
98
|
-
GameStatus['
|
|
99
|
-
GameStatus['
|
|
81
|
+
[GameStatus['Reserve']]: Object.freeze([
|
|
82
|
+
GameStatus['Approve'],
|
|
83
|
+
GameStatus['Archive'],
|
|
84
|
+
GameStatus['Close'],
|
|
85
|
+
GameStatus['Finish'],
|
|
86
|
+
GameStatus['Invite'],
|
|
87
|
+
GameStatus['Reserve'],
|
|
88
|
+
GameStatus['Moderate'],
|
|
89
|
+
GameStatus['Publish'],
|
|
90
|
+
GameStatus['Reject'],
|
|
100
91
|
]),
|
|
101
92
|
|
|
102
|
-
[GameStatus['
|
|
103
|
-
GameStatus['
|
|
104
|
-
GameStatus['
|
|
105
|
-
GameStatus['
|
|
106
|
-
GameStatus['
|
|
107
|
-
GameStatus['
|
|
108
|
-
GameStatus['
|
|
109
|
-
GameStatus['
|
|
110
|
-
GameStatus['
|
|
111
|
-
GameStatus['
|
|
93
|
+
[GameStatus['Moderate']]: Object.freeze([
|
|
94
|
+
GameStatus['Approve'],
|
|
95
|
+
GameStatus['Archive'],
|
|
96
|
+
GameStatus['Close'],
|
|
97
|
+
GameStatus['Finish'],
|
|
98
|
+
GameStatus['Invite'],
|
|
99
|
+
GameStatus['Reserve'],
|
|
100
|
+
GameStatus['Moderate'],
|
|
101
|
+
GameStatus['Publish'],
|
|
102
|
+
GameStatus['Reject'],
|
|
112
103
|
]),
|
|
113
104
|
|
|
114
|
-
[GameStatus['
|
|
115
|
-
GameStatus['
|
|
116
|
-
GameStatus['
|
|
117
|
-
GameStatus['
|
|
118
|
-
GameStatus['
|
|
119
|
-
GameStatus['
|
|
120
|
-
GameStatus['
|
|
121
|
-
GameStatus['
|
|
122
|
-
GameStatus['
|
|
123
|
-
GameStatus['
|
|
105
|
+
[GameStatus['Publish']]: Object.freeze([
|
|
106
|
+
GameStatus['Approve'],
|
|
107
|
+
GameStatus['Archive'],
|
|
108
|
+
GameStatus['Close'],
|
|
109
|
+
GameStatus['Finish'],
|
|
110
|
+
GameStatus['Invite'],
|
|
111
|
+
GameStatus['Reserve'],
|
|
112
|
+
GameStatus['Moderate'],
|
|
113
|
+
GameStatus['Publish'],
|
|
114
|
+
GameStatus['Reject'],
|
|
124
115
|
]),
|
|
125
116
|
|
|
126
|
-
[GameStatus['
|
|
127
|
-
GameStatus['
|
|
128
|
-
GameStatus['
|
|
129
|
-
GameStatus['
|
|
130
|
-
GameStatus['
|
|
131
|
-
GameStatus['
|
|
132
|
-
GameStatus['
|
|
133
|
-
GameStatus['
|
|
134
|
-
GameStatus['
|
|
135
|
-
GameStatus['
|
|
117
|
+
[GameStatus['Reject']]: Object.freeze([
|
|
118
|
+
GameStatus['Approve'],
|
|
119
|
+
GameStatus['Archive'],
|
|
120
|
+
GameStatus['Close'],
|
|
121
|
+
GameStatus['Finish'],
|
|
122
|
+
GameStatus['Invite'],
|
|
123
|
+
GameStatus['Reserve'],
|
|
124
|
+
GameStatus['Moderate'],
|
|
125
|
+
GameStatus['Publish'],
|
|
126
|
+
GameStatus['Reject'],
|
|
136
127
|
]),
|
|
137
128
|
}),
|
|
138
129
|
|
|
139
|
-
[Role['
|
|
140
|
-
[GameStatus['
|
|
141
|
-
GameStatus['
|
|
142
|
-
GameStatus['
|
|
143
|
-
GameStatus['
|
|
144
|
-
GameStatus['
|
|
130
|
+
[Role['Organizer']]: Object.freeze({
|
|
131
|
+
[GameStatus['Approve']]: Object.freeze([
|
|
132
|
+
GameStatus['Close'],
|
|
133
|
+
GameStatus['Invite'],
|
|
134
|
+
GameStatus['Publish'],
|
|
135
|
+
GameStatus['Reserve'],
|
|
145
136
|
]),
|
|
146
137
|
|
|
147
|
-
[GameStatus['
|
|
138
|
+
[GameStatus['Archive']]: Object.freeze([]),
|
|
148
139
|
|
|
149
|
-
[GameStatus['
|
|
140
|
+
[GameStatus['Close']]: Object.freeze([]),
|
|
150
141
|
|
|
151
|
-
[GameStatus['
|
|
142
|
+
[GameStatus['Finish']]: Object.freeze([]),
|
|
152
143
|
|
|
153
|
-
[GameStatus['
|
|
144
|
+
[GameStatus['Invite']]: Object.freeze([]),
|
|
154
145
|
|
|
155
|
-
[GameStatus['
|
|
146
|
+
[GameStatus['Reserve']]: Object.freeze([]),
|
|
156
147
|
|
|
157
|
-
[GameStatus['
|
|
148
|
+
[GameStatus['Moderate']]: Object.freeze([]),
|
|
158
149
|
|
|
159
|
-
[GameStatus['
|
|
160
|
-
GameStatus['
|
|
161
|
-
GameStatus['
|
|
162
|
-
GameStatus['
|
|
150
|
+
[GameStatus['Publish']]: Object.freeze([
|
|
151
|
+
GameStatus['Close'],
|
|
152
|
+
GameStatus['Invite'],
|
|
153
|
+
GameStatus['Reserve'],
|
|
163
154
|
]),
|
|
164
155
|
|
|
165
|
-
[GameStatus['
|
|
166
|
-
GameStatus['
|
|
156
|
+
[GameStatus['Reject']]: Object.freeze([
|
|
157
|
+
GameStatus['Moderate'],
|
|
167
158
|
]),
|
|
168
159
|
}),
|
|
169
160
|
|
|
170
161
|
[Mode['Unknown']]: Object.freeze({
|
|
171
|
-
[GameStatus['
|
|
162
|
+
[GameStatus['Approve']]: Object.freeze([]),
|
|
172
163
|
|
|
173
|
-
[GameStatus['
|
|
164
|
+
[GameStatus['Archive']]: Object.freeze([]),
|
|
174
165
|
|
|
175
|
-
[GameStatus['
|
|
166
|
+
[GameStatus['Close']]: Object.freeze([]),
|
|
176
167
|
|
|
177
|
-
[GameStatus['
|
|
168
|
+
[GameStatus['Finish']]: Object.freeze([]),
|
|
178
169
|
|
|
179
|
-
[GameStatus['
|
|
170
|
+
[GameStatus['Invite']]: Object.freeze([]),
|
|
180
171
|
|
|
181
|
-
[GameStatus['
|
|
172
|
+
[GameStatus['Reserve']]: Object.freeze([]),
|
|
182
173
|
|
|
183
|
-
[GameStatus['
|
|
174
|
+
[GameStatus['Moderate']]: Object.freeze([]),
|
|
184
175
|
|
|
185
|
-
[GameStatus['
|
|
176
|
+
[GameStatus['Publish']]: Object.freeze([]),
|
|
186
177
|
|
|
187
|
-
[GameStatus['
|
|
178
|
+
[GameStatus['Reject']]: Object.freeze([]),
|
|
188
179
|
}),
|
|
189
180
|
})
|
|
190
181
|
|
|
191
182
|
export const RoleGameStatuses = Object.freeze({
|
|
192
|
-
[Role['
|
|
193
|
-
GameStatus['
|
|
194
|
-
GameStatus['
|
|
195
|
-
GameStatus['
|
|
196
|
-
GameStatus['
|
|
197
|
-
GameStatus['
|
|
198
|
-
GameStatus['
|
|
199
|
-
GameStatus['
|
|
200
|
-
GameStatus['
|
|
201
|
-
GameStatus['
|
|
183
|
+
[Role['Admin']]: Object.freeze([
|
|
184
|
+
GameStatus['Approve'],
|
|
185
|
+
GameStatus['Archive'],
|
|
186
|
+
GameStatus['Close'],
|
|
187
|
+
GameStatus['Finish'],
|
|
188
|
+
GameStatus['Invite'],
|
|
189
|
+
GameStatus['Reserve'],
|
|
190
|
+
GameStatus['Moderate'],
|
|
191
|
+
GameStatus['Publish'],
|
|
192
|
+
GameStatus['Reject'],
|
|
202
193
|
]),
|
|
203
194
|
|
|
204
|
-
[Role['
|
|
205
|
-
GameStatus['
|
|
206
|
-
GameStatus['
|
|
207
|
-
GameStatus['
|
|
208
|
-
GameStatus['
|
|
209
|
-
GameStatus['
|
|
210
|
-
GameStatus['
|
|
211
|
-
GameStatus['
|
|
195
|
+
[Role['Organizer']]: Object.freeze([
|
|
196
|
+
GameStatus['Archive'],
|
|
197
|
+
GameStatus['Close'],
|
|
198
|
+
GameStatus['Finish'],
|
|
199
|
+
GameStatus['Invite'],
|
|
200
|
+
GameStatus['Reserve'],
|
|
201
|
+
GameStatus['Moderate'],
|
|
202
|
+
GameStatus['Publish'],
|
|
212
203
|
]),
|
|
213
204
|
|
|
214
205
|
[Mode['Unknown']]: Object.freeze([]),
|
|
@@ -216,29 +207,29 @@ export const RoleGameStatuses = Object.freeze({
|
|
|
216
207
|
|
|
217
208
|
export const CategoryGameStatuses = Object.freeze({
|
|
218
209
|
[Category['Active']]: Object.freeze([
|
|
219
|
-
GameStatus['
|
|
220
|
-
GameStatus['
|
|
221
|
-
GameStatus['
|
|
222
|
-
GameStatus['
|
|
210
|
+
GameStatus['Close'],
|
|
211
|
+
GameStatus['Invite'],
|
|
212
|
+
GameStatus['Reserve'],
|
|
213
|
+
GameStatus['Publish'],
|
|
223
214
|
]),
|
|
224
215
|
|
|
225
|
-
[GameStatus['
|
|
226
|
-
GameStatus['
|
|
216
|
+
[GameStatus['Reject']]: Object.freeze([
|
|
217
|
+
GameStatus['Reject'],
|
|
227
218
|
]),
|
|
228
219
|
|
|
229
|
-
[GameStatus['
|
|
230
|
-
GameStatus['
|
|
220
|
+
[GameStatus['Moderate']]: Object.freeze([
|
|
221
|
+
GameStatus['Moderate'],
|
|
231
222
|
]),
|
|
232
223
|
|
|
233
|
-
[GameStatus['
|
|
234
|
-
GameStatus['
|
|
224
|
+
[GameStatus['Approve']]: Object.freeze([
|
|
225
|
+
GameStatus['Approve'],
|
|
235
226
|
]),
|
|
236
227
|
|
|
237
|
-
[GameStatus['
|
|
238
|
-
GameStatus['
|
|
228
|
+
[GameStatus['Finish']]: Object.freeze([
|
|
229
|
+
GameStatus['Finish'],
|
|
239
230
|
]),
|
|
240
231
|
|
|
241
|
-
[GameStatus['
|
|
242
|
-
GameStatus['
|
|
232
|
+
[GameStatus['Archive']]: Object.freeze([
|
|
233
|
+
GameStatus['Archive'],
|
|
243
234
|
]),
|
|
244
235
|
})
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
]),
|
|
7
|
-
)
|
|
1
|
+
export const RegistrationChannel = /** @type {const} */ ({
|
|
2
|
+
'Vkontakte': 'Vkontakte',
|
|
3
|
+
'Telegram': 'Telegram',
|
|
4
|
+
'Email': 'Email',
|
|
5
|
+
})
|
|
8
6
|
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
7
|
+
export const RegistrationChannels = Object.values(RegistrationChannel)
|
|
8
|
+
|
|
9
|
+
export const RegistrationConfirmedChannel = /** @type {const} */ ({
|
|
10
|
+
'Vkontakte': 'Vkontakte',
|
|
11
|
+
'Telegram': 'Telegram',
|
|
12
|
+
'Email': 'Email',
|
|
13
|
+
'Unspecified': 'Unspecified',
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export const RegistrationConfirmedChannels = Object.values(RegistrationConfirmedChannel)
|
package/source/entities/role.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
export const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'manager',
|
|
9
|
-
'Service',
|
|
10
|
-
]),
|
|
11
|
-
)
|
|
1
|
+
export const Role = /** @type {const} */ ({
|
|
2
|
+
'Admin': 'Admin',
|
|
3
|
+
'Organizer': 'Organizer',
|
|
4
|
+
'Captain': 'Captain',
|
|
5
|
+
'Player': 'Player',
|
|
6
|
+
'Service': 'Service',
|
|
7
|
+
})
|
|
12
8
|
|
|
13
|
-
export const
|
|
14
|
-
/** @type {{ [x in typeof Roles[number]]: x }} */ (
|
|
15
|
-
Roles.reduce(
|
|
16
|
-
(o, x) => (o[x] = x, o),
|
|
17
|
-
{},
|
|
18
|
-
)
|
|
19
|
-
),
|
|
20
|
-
)
|
|
9
|
+
export const Roles = Object.values(Role)
|