@shakerquiz/utilities 0.4.85 → 0.5.0
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 +2 -5
- package/source/enumerations/core/features.js +0 -348
- package/source/enumerations/core/methods.js +9 -18
- package/source/enumerations/core/networks.js +6 -4
- package/source/enumerations/core/runtimes.js +6 -4
- package/source/enumerations/entities/{game-statuses.js → game-status.js} +56 -39
- package/source/enumerations/entities/{registration-statuses.js → registration-status.js} +1 -3
- package/source/enumerations/entities/role.js +50 -0
- package/source/enumerations/entities/{venue-statuses.js → venue-status.js} +10 -8
- package/source/enumerations/misc/icons.js +2 -1
- package/source/index.js +9 -14
- package/source/misc.d.ts +13 -50
- package/source/enumerations/core/kinds.js +0 -4
- package/source/enumerations/core/scopes.js +0 -27
- package/source/enumerations/entities/roles.js +0 -13
- package/source/enumerations/misc/constants.d.ts +0 -3
- package/source/enumerations/misc/cookies.d.ts +0 -5
- package/source/enumerations/misc/cookies.js +0 -5
- package/source/enumerations/misc/regexps.d.ts +0 -5
- package/source/scope.d.ts +0 -874
- package/source/server.d.ts +0 -8
- /package/source/enumerations/entities/{city-affilations.js → city-affilation.js} +0 -0
- /package/source/enumerations/entities/{registration-attributes.js → registration-attribute.js} +0 -0
- /package/source/enumerations/entities/{registration-channels.js → registration-channel.js} +0 -0
- /package/source/enumerations/entities/{registration-lineups.js → registration-lineup.js} +0 -0
- /package/source/enumerations/entities/{registration-mailings.js → registration-mailing.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@shakerquiz/utilities",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"author": "yurkimus <yurkimus@gmail.com>",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"scripts": {
|
|
@@ -13,10 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"./schemas/*.json": "./source/schemas/*.json"
|
|
15
15
|
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"urlpattern-polyfill": "10.1.0"
|
|
18
|
-
},
|
|
19
16
|
"devDependencies": {
|
|
20
|
-
"typescript": "5.
|
|
17
|
+
"typescript": "5.9.2"
|
|
21
18
|
}
|
|
22
19
|
}
|
|
@@ -1,237 +1,3 @@
|
|
|
1
|
-
import { Kinds } from './kinds.js'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated
|
|
5
|
-
*/
|
|
6
|
-
export var Domains = /** @type {const} */ ([
|
|
7
|
-
// 'Asset',
|
|
8
|
-
'User',
|
|
9
|
-
'Role',
|
|
10
|
-
'Country',
|
|
11
|
-
'Currency',
|
|
12
|
-
'City',
|
|
13
|
-
'Venue',
|
|
14
|
-
'Theme',
|
|
15
|
-
// 'ThemeAsset',
|
|
16
|
-
'Game',
|
|
17
|
-
// 'GameAsset',
|
|
18
|
-
'Registration',
|
|
19
|
-
'Mailing',
|
|
20
|
-
])
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @type {Record<Domain, Icon>}
|
|
24
|
-
*
|
|
25
|
-
* @deprecated
|
|
26
|
-
*/
|
|
27
|
-
export var DomainIcon = {
|
|
28
|
-
'User': 'users',
|
|
29
|
-
'Role': 'identification',
|
|
30
|
-
'Country': 'no-symbol',
|
|
31
|
-
'Currency': 'no-symbol',
|
|
32
|
-
'City': 'building-office',
|
|
33
|
-
'Venue': 'map-pin',
|
|
34
|
-
'Theme': 'document-text',
|
|
35
|
-
'Game': 'newspaper',
|
|
36
|
-
'Registration': 'user-group',
|
|
37
|
-
'Mailing': 'envelope',
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @type {Record<Domain, Record<Kind, string>>}
|
|
42
|
-
*
|
|
43
|
-
* @deprecated
|
|
44
|
-
*/
|
|
45
|
-
export var DomainKindPathname = /** @type {const} */ ({
|
|
46
|
-
'User': {
|
|
47
|
-
'Unit': '/user/:user?',
|
|
48
|
-
'Set': '/users',
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
'Role': {
|
|
52
|
-
'Unit': '/role/:role?',
|
|
53
|
-
'Set': '/roles',
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
'Country': {
|
|
57
|
-
'Unit': '/country/:country?',
|
|
58
|
-
'Set': '/countries',
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
'Currency': {
|
|
62
|
-
'Unit': '/currency/:currency?',
|
|
63
|
-
'Set': '/currencies',
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
'City': {
|
|
67
|
-
'Unit': '/city/:city?',
|
|
68
|
-
'Set': '/cities',
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
'Venue': {
|
|
72
|
-
'Unit': '/venue/:venue?',
|
|
73
|
-
'Set': '/venues',
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
'Theme': {
|
|
77
|
-
'Unit': '/theme/:theme?',
|
|
78
|
-
'Set': '/themes',
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
'Game': {
|
|
82
|
-
/**
|
|
83
|
-
* Parameter "game" can be one of:
|
|
84
|
-
* - UUID of a Game,
|
|
85
|
-
* - Game alias combined with City (UUID, alias or VK group ID),
|
|
86
|
-
* - UUID of a Registration
|
|
87
|
-
*/
|
|
88
|
-
'Unit': '/game/:game?',
|
|
89
|
-
'Set': '/games',
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
'Registration': {
|
|
93
|
-
/**
|
|
94
|
-
* Parameter "registration" can be one of:
|
|
95
|
-
* - UUID of a Registration,
|
|
96
|
-
* - VK identifier of a Registration
|
|
97
|
-
*/
|
|
98
|
-
'Unit': '/registration/:registration?',
|
|
99
|
-
'Set': '/registrations',
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
'Mailing': {
|
|
103
|
-
'Unit': '/mailing/:mailing?',
|
|
104
|
-
'Set': '/mailings',
|
|
105
|
-
},
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated
|
|
110
|
-
*/
|
|
111
|
-
export var Procedures = /** @type {const} */ ([
|
|
112
|
-
'Checkin',
|
|
113
|
-
'Redirect',
|
|
114
|
-
])
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @type {Record<Procedure, Icon>}
|
|
118
|
-
*
|
|
119
|
-
* @deprecated
|
|
120
|
-
*/
|
|
121
|
-
export var ProcedureIcon = {
|
|
122
|
-
'Checkin': 'arrow-right-end-on-rectangle',
|
|
123
|
-
'Redirect': 'no-symbol',
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @type {Record<Procedure, Record<Kind, string>>}
|
|
128
|
-
*
|
|
129
|
-
* @deprecated
|
|
130
|
-
*/
|
|
131
|
-
export var ProcedureKindPathname = /** @type {const} */ ({
|
|
132
|
-
'Checkin': {
|
|
133
|
-
'Unit': '/checkin',
|
|
134
|
-
'Set': '/checkins',
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
'Redirect': {
|
|
138
|
-
'Unit': '/redirect',
|
|
139
|
-
'Set': '/redirects',
|
|
140
|
-
},
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* @type {Array<Domain | Procedure>}
|
|
145
|
-
*
|
|
146
|
-
* @deprecated
|
|
147
|
-
*/
|
|
148
|
-
export var Features = Domains.concat(Procedures)
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* @type {Record<Feature, Icon>}
|
|
152
|
-
*
|
|
153
|
-
* @deprecated
|
|
154
|
-
*/
|
|
155
|
-
export var FeatureIcon = {
|
|
156
|
-
...DomainIcon,
|
|
157
|
-
...ProcedureIcon,
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* @type {Record<Feature, Record<Kind, string>>}
|
|
162
|
-
*
|
|
163
|
-
* @deprecated
|
|
164
|
-
*/
|
|
165
|
-
export var FeatureKindPathname = {
|
|
166
|
-
...DomainKindPathname,
|
|
167
|
-
...ProcedureKindPathname,
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* @type {Array<[feature: Feature, kind: Kind, pathname: string]>}
|
|
172
|
-
*
|
|
173
|
-
* @deprecated
|
|
174
|
-
*/
|
|
175
|
-
export var FeatureKindPathnames = Object
|
|
176
|
-
.keys(FeatureKindPathname)
|
|
177
|
-
.flatMap(feature =>
|
|
178
|
-
Object
|
|
179
|
-
.keys(FeatureKindPathname[feature])
|
|
180
|
-
.map(kind => [feature, kind, FeatureKindPathname[feature][kind]])
|
|
181
|
-
)
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* @type {Array<[feature: Feature, kind: Kind, pattern: URLPattern]>}
|
|
185
|
-
*
|
|
186
|
-
* @deprecated
|
|
187
|
-
*/
|
|
188
|
-
export var FeatureKindPatterns = FeatureKindPathnames
|
|
189
|
-
.map(([feature, kind, pathname]) => [
|
|
190
|
-
feature,
|
|
191
|
-
kind,
|
|
192
|
-
new URLPattern({ pathname }),
|
|
193
|
-
])
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* @param {Feature} feature
|
|
197
|
-
* @param {Kind} kind
|
|
198
|
-
*
|
|
199
|
-
* @deprecated
|
|
200
|
-
*/
|
|
201
|
-
export var getPathname = (feature, kind) => {
|
|
202
|
-
if (!Features.includes(feature))
|
|
203
|
-
throw TypeError(
|
|
204
|
-
`[getPathname] Feature '${feature}' must be listed in 'Features'.`,
|
|
205
|
-
)
|
|
206
|
-
|
|
207
|
-
if (!Kinds.includes(kind))
|
|
208
|
-
throw TypeError(
|
|
209
|
-
`[getPathname] Kind '${kind}' must be listed in 'Kinds'.`,
|
|
210
|
-
)
|
|
211
|
-
|
|
212
|
-
return FeatureKindPathname[feature][kind]
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* @param {Feature} feature
|
|
217
|
-
* @param {Kind} kind
|
|
218
|
-
*
|
|
219
|
-
* @deprecated
|
|
220
|
-
*/
|
|
221
|
-
export var getPattern = (feature, kind) => {
|
|
222
|
-
if (!Features.includes(feature))
|
|
223
|
-
throw TypeError(
|
|
224
|
-
`[getPattern] Feature '${feature}' must be listed in 'Features'.`,
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
if (!Kinds.includes(kind))
|
|
228
|
-
throw TypeError(
|
|
229
|
-
`[getPattern] Kind '${kind}' must be listed in 'Kinds'.`,
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
return FeatureKindPatterns.find(([f, k]) => f == feature && k == kind)[2]
|
|
233
|
-
}
|
|
234
|
-
|
|
235
1
|
export var Feature = /** @type {const} */ ({
|
|
236
2
|
'Users': 'Users',
|
|
237
3
|
'User': 'User',
|
|
@@ -282,117 +48,3 @@ export var FeatureIcon = {
|
|
|
282
48
|
[Feature.Mailings]: 'hero/outline/envelope',
|
|
283
49
|
[Feature.Mailing]: 'hero/outline/envelope',
|
|
284
50
|
}
|
|
285
|
-
|
|
286
|
-
export var RoutePathname = /** @type {const} */ ({
|
|
287
|
-
Users: '/users',
|
|
288
|
-
User: '/users/:user?',
|
|
289
|
-
|
|
290
|
-
Roles: '/roles',
|
|
291
|
-
Role: '/roles/:role?',
|
|
292
|
-
|
|
293
|
-
Checkins: '/checkins',
|
|
294
|
-
Checkin: '/checkins/:checkin?',
|
|
295
|
-
|
|
296
|
-
Countries: '/countries',
|
|
297
|
-
Country: '/countries/:country?',
|
|
298
|
-
|
|
299
|
-
Currencies: '/currencies',
|
|
300
|
-
Currency: '/currencies/:currency?',
|
|
301
|
-
|
|
302
|
-
Cities: '/cities',
|
|
303
|
-
City: '/cities/:city?',
|
|
304
|
-
|
|
305
|
-
Venues: '/venues',
|
|
306
|
-
Venue: '/venues/:venue?',
|
|
307
|
-
|
|
308
|
-
Games: '/games',
|
|
309
|
-
GamesAttendance: '/games/attendance',
|
|
310
|
-
GamesAmounts: '/games/amounts',
|
|
311
|
-
Game: '/games/:game?',
|
|
312
|
-
GameAttendance: '/games/:game/attendance',
|
|
313
|
-
|
|
314
|
-
Themes: '/themes',
|
|
315
|
-
Theme: '/themes/:theme?',
|
|
316
|
-
|
|
317
|
-
Registrations: '/registrations',
|
|
318
|
-
Registration: '/registrations/:registration?',
|
|
319
|
-
|
|
320
|
-
Mailings: '/mailings',
|
|
321
|
-
Mailing: '/mailings/:mailing?',
|
|
322
|
-
})
|
|
323
|
-
|
|
324
|
-
export var RoutePathParams = /** @type {const} */ ({
|
|
325
|
-
Users: [],
|
|
326
|
-
User: [':user?'],
|
|
327
|
-
|
|
328
|
-
Roles: [],
|
|
329
|
-
Role: [':role?'],
|
|
330
|
-
|
|
331
|
-
Checkins: [],
|
|
332
|
-
Checkin: [':checkin?'],
|
|
333
|
-
|
|
334
|
-
Countries: [],
|
|
335
|
-
Country: [':country?'],
|
|
336
|
-
|
|
337
|
-
Currencies: [],
|
|
338
|
-
Currency: [':currency?'],
|
|
339
|
-
|
|
340
|
-
Cities: [],
|
|
341
|
-
City: [':city?'],
|
|
342
|
-
|
|
343
|
-
Venues: [],
|
|
344
|
-
Venue: [':venue?'],
|
|
345
|
-
|
|
346
|
-
Games: [],
|
|
347
|
-
GamesAttendance: [],
|
|
348
|
-
GamesAmounts: [],
|
|
349
|
-
Game: [':game?'],
|
|
350
|
-
GameAttendance: [],
|
|
351
|
-
|
|
352
|
-
Themes: [],
|
|
353
|
-
Theme: [':theme?'],
|
|
354
|
-
|
|
355
|
-
Registrations: [],
|
|
356
|
-
Registration: [':registration?'],
|
|
357
|
-
|
|
358
|
-
Mailings: [],
|
|
359
|
-
Mailing: [':mailing?'],
|
|
360
|
-
})
|
|
361
|
-
|
|
362
|
-
export var RouteSearchParams = /** @type {const} */ ({
|
|
363
|
-
Users: [],
|
|
364
|
-
User: [],
|
|
365
|
-
|
|
366
|
-
Roles: [],
|
|
367
|
-
Role: [],
|
|
368
|
-
|
|
369
|
-
Checkins: [],
|
|
370
|
-
Checkin: [],
|
|
371
|
-
|
|
372
|
-
Countries: [],
|
|
373
|
-
Country: [],
|
|
374
|
-
|
|
375
|
-
Currencies: [],
|
|
376
|
-
Currency: [],
|
|
377
|
-
|
|
378
|
-
Cities: [],
|
|
379
|
-
City: [],
|
|
380
|
-
|
|
381
|
-
Venues: [],
|
|
382
|
-
Venue: [],
|
|
383
|
-
|
|
384
|
-
Games: ['city', 'status'],
|
|
385
|
-
GamesAttendance: [],
|
|
386
|
-
GamesAmounts: [],
|
|
387
|
-
Game: ['city'],
|
|
388
|
-
GameAttendance: [],
|
|
389
|
-
|
|
390
|
-
Themes: [],
|
|
391
|
-
Theme: [],
|
|
392
|
-
|
|
393
|
-
Registrations: ['game', 'city'],
|
|
394
|
-
Registration: [],
|
|
395
|
-
|
|
396
|
-
Mailings: [],
|
|
397
|
-
Mailing: [],
|
|
398
|
-
})
|
|
@@ -5,21 +5,12 @@
|
|
|
5
5
|
* - CONNECT: {@link https://datatracker.ietf.org/doc/html/rfc9110}
|
|
6
6
|
* - WebDAV Extensions {@link https://datatracker.ietf.org/doc/html/rfc4918}
|
|
7
7
|
*/
|
|
8
|
-
export var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'OPTIONS',
|
|
18
|
-
'PATCH',
|
|
19
|
-
'POST',
|
|
20
|
-
// 'PROPFIND',
|
|
21
|
-
// 'PROPPATCH',
|
|
22
|
-
'PUT',
|
|
23
|
-
// 'TRACE',
|
|
24
|
-
// 'UNLOCK',
|
|
25
|
-
])
|
|
8
|
+
export var Method = /** @type {const} */ ({
|
|
9
|
+
'DELETE': 'DELETE',
|
|
10
|
+
'GET': 'GET',
|
|
11
|
+
'OPTIONS': 'OPTIONS',
|
|
12
|
+
'PATCH': 'PATCH',
|
|
13
|
+
'POST': 'POST',
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export var Methods = Object.values(Method)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Role } from './role.js'
|
|
2
|
+
|
|
1
3
|
export var GameStatus = /** @type {const} */ ({
|
|
2
4
|
'REJECTED': 'REJECTED',
|
|
3
5
|
'MODERATION': 'MODERATION',
|
|
@@ -36,20 +38,19 @@ export var GameStatusTitle = {
|
|
|
36
38
|
[GameStatus.ARCHIVE]: 'В архиве',
|
|
37
39
|
}
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
[GameStatus.
|
|
42
|
-
[GameStatus.
|
|
43
|
-
[GameStatus.
|
|
44
|
-
[GameStatus.
|
|
45
|
-
[GameStatus.
|
|
46
|
-
[GameStatus.
|
|
47
|
-
[GameStatus.
|
|
48
|
-
[GameStatus.
|
|
49
|
-
[GameStatus.ARCHIVE]: 'hero/outline/archive-box',
|
|
41
|
+
export var GameStatusColor = {
|
|
42
|
+
[GameStatus.REJECTED]: 'danger',
|
|
43
|
+
[GameStatus.MODERATION]: 'primary',
|
|
44
|
+
[GameStatus.APPROVED]: 'success',
|
|
45
|
+
[GameStatus.CLOSED]: 'warning',
|
|
46
|
+
[GameStatus.FORINVITES]: 'current',
|
|
47
|
+
[GameStatus.PUBLISHED]: 'secondary',
|
|
48
|
+
[GameStatus.IS_RESERVE]: 'blue-900',
|
|
49
|
+
[GameStatus.FINISHED]: 'success',
|
|
50
|
+
[GameStatus.ARCHIVE]: 'current',
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
export var
|
|
53
|
+
export var GameStatusTextColor = {
|
|
53
54
|
[GameStatus.REJECTED]: 'text-danger',
|
|
54
55
|
[GameStatus.MODERATION]: 'text-primary',
|
|
55
56
|
[GameStatus.APPROVED]: 'text-success',
|
|
@@ -61,23 +62,24 @@ export var GameStatusColor = {
|
|
|
61
62
|
[GameStatus.ARCHIVE]: 'text-current',
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
/** @type {Record<
|
|
65
|
+
/** @type {Record<GameStatus, Icon>} */
|
|
66
|
+
export var GameStatusIcon = {
|
|
67
|
+
[GameStatus.REJECTED]: 'hero/outline/x-mark',
|
|
68
|
+
[GameStatus.MODERATION]: 'hero/outline/clock',
|
|
69
|
+
[GameStatus.APPROVED]: 'hero/outline/hand-thumb-up',
|
|
70
|
+
[GameStatus.CLOSED]: 'hero/outline/exclamation-triangle',
|
|
71
|
+
[GameStatus.FORINVITES]: 'hero/outline/lock-closed',
|
|
72
|
+
[GameStatus.PUBLISHED]: 'hero/outline/check-circle',
|
|
73
|
+
[GameStatus.IS_RESERVE]: 'hero/outline/user-plus',
|
|
74
|
+
[GameStatus.FINISHED]: 'hero/outline/check',
|
|
75
|
+
[GameStatus.ARCHIVE]: 'hero/outline/archive-box',
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** @type {{ [Key in Role]: Partial<Record<GameStatus, GameStatus[]>> }} */
|
|
65
79
|
export var RoleGameStatusGameStatuses = {
|
|
66
|
-
|
|
67
|
-
'DEFAULT': [
|
|
68
|
-
GameStatus.REJECTED,
|
|
69
|
-
GameStatus.MODERATION,
|
|
70
|
-
GameStatus.APPROVED,
|
|
71
|
-
GameStatus.CLOSED,
|
|
72
|
-
GameStatus.FORINVITES,
|
|
73
|
-
GameStatus.PUBLISHED,
|
|
74
|
-
GameStatus.IS_RESERVE,
|
|
75
|
-
GameStatus.FINISHED,
|
|
76
|
-
GameStatus.ARCHIVE,
|
|
77
|
-
],
|
|
78
|
-
},
|
|
80
|
+
[Role.admin]: {},
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
[Role.organizer]: {
|
|
81
83
|
[GameStatus.APPROVED]: [
|
|
82
84
|
GameStatus.APPROVED,
|
|
83
85
|
GameStatus.CLOSED,
|
|
@@ -96,18 +98,33 @@ export var RoleGameStatusGameStatuses = {
|
|
|
96
98
|
GameStatus.REJECTED,
|
|
97
99
|
GameStatus.MODERATION,
|
|
98
100
|
],
|
|
99
|
-
|
|
100
|
-
'DEFAULT': [
|
|
101
|
-
GameStatus.CLOSED,
|
|
102
|
-
GameStatus.FORINVITES,
|
|
103
|
-
GameStatus.PUBLISHED,
|
|
104
|
-
GameStatus.IS_RESERVE,
|
|
105
|
-
GameStatus.FINISHED,
|
|
106
|
-
GameStatus.ARCHIVE,
|
|
107
|
-
],
|
|
108
101
|
},
|
|
109
102
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
[Role.default]: {},
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** @type {{ [Key in Role]: GameStatus[] }} */
|
|
107
|
+
export var RoleDefaultGameStatuses = {
|
|
108
|
+
[Role.admin]: [
|
|
109
|
+
'APPROVED',
|
|
110
|
+
'ARCHIVE',
|
|
111
|
+
'CLOSED',
|
|
112
|
+
'FINISHED',
|
|
113
|
+
'FORINVITES',
|
|
114
|
+
'IS_RESERVE',
|
|
115
|
+
'MODERATION',
|
|
116
|
+
'PUBLISHED',
|
|
117
|
+
'REJECTED',
|
|
118
|
+
],
|
|
119
|
+
|
|
120
|
+
[Role.organizer]: [
|
|
121
|
+
'ARCHIVE',
|
|
122
|
+
'CLOSED',
|
|
123
|
+
'FINISHED',
|
|
124
|
+
'FORINVITES',
|
|
125
|
+
'IS_RESERVE',
|
|
126
|
+
'PUBLISHED',
|
|
127
|
+
],
|
|
128
|
+
|
|
129
|
+
[Role.default]: [],
|
|
113
130
|
}
|
|
@@ -6,17 +6,15 @@ export var RegistrationStatus = /** @type {const} */ ({
|
|
|
6
6
|
|
|
7
7
|
export var RegistrationStatuses = Object.values(RegistrationStatus)
|
|
8
8
|
|
|
9
|
-
/** @type {Record<RegistrationStatus, number>} */
|
|
10
9
|
export var RegistrationStatusWeight = {
|
|
11
10
|
[RegistrationStatus.Confirmed]: 0,
|
|
12
11
|
[RegistrationStatus.Created]: 1,
|
|
13
12
|
[RegistrationStatus.Cancelled]: 2,
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
/** @type {Record<RegistrationStatus, string>} */
|
|
17
15
|
export var RegistrationStatusTitle = {
|
|
18
16
|
[RegistrationStatus.Confirmed]: 'Подтверждена',
|
|
19
|
-
[RegistrationStatus.Created]: '
|
|
17
|
+
[RegistrationStatus.Created]: 'Создана',
|
|
20
18
|
[RegistrationStatus.Cancelled]: 'Отменена',
|
|
21
19
|
}
|
|
22
20
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export var Role = /** @type {const} */ ({
|
|
2
|
+
'admin': 'admin',
|
|
3
|
+
'organizer': 'organizer',
|
|
4
|
+
'captain': 'captain',
|
|
5
|
+
'player': 'player',
|
|
6
|
+
'default': 'default',
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
export var Roles = Object.values(Role)
|
|
10
|
+
|
|
11
|
+
export var RoleWeight = {
|
|
12
|
+
[Role.admin]: 0,
|
|
13
|
+
[Role.organizer]: 1,
|
|
14
|
+
[Role.captain]: 2,
|
|
15
|
+
[Role.player]: 3,
|
|
16
|
+
[Role.default]: 2,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export var RoleTitle = {
|
|
20
|
+
[Role.admin]: 'Админ',
|
|
21
|
+
[Role.organizer]: 'Организатор',
|
|
22
|
+
[Role.captain]: 'Капитан',
|
|
23
|
+
[Role.player]: 'Игрок',
|
|
24
|
+
[Role.default]: 'Пользователь',
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export var RoleColor = {
|
|
28
|
+
[Role.admin]: 'danger',
|
|
29
|
+
[Role.organizer]: 'warning',
|
|
30
|
+
[Role.captain]: 'primary',
|
|
31
|
+
[Role.player]: 'secondary',
|
|
32
|
+
[Role.default]: 'default',
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export var RoleTextColor = {
|
|
36
|
+
[Role.admin]: 'text-danger',
|
|
37
|
+
[Role.organizer]: 'text-warning',
|
|
38
|
+
[Role.captain]: 'text-primary',
|
|
39
|
+
[Role.player]: 'text-secondary',
|
|
40
|
+
[Role.default]: 'text-default',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** @type {Record<Role, Icon>} */
|
|
44
|
+
export var RoleIcon = {
|
|
45
|
+
[Role.admin]: 'hero/outline/user',
|
|
46
|
+
[Role.organizer]: 'hero/outline/user',
|
|
47
|
+
[Role.captain]: 'hero/outline/user',
|
|
48
|
+
[Role.player]: 'hero/outline/user',
|
|
49
|
+
[Role.default]: 'hero/outline/user',
|
|
50
|
+
}
|
|
@@ -5,26 +5,28 @@ export var VenueStatus = /** @type {const} */ ({
|
|
|
5
5
|
|
|
6
6
|
export var VenueStatuses = Object.values(VenueStatus)
|
|
7
7
|
|
|
8
|
-
/** @type {Record<VenueStatus, number>} */
|
|
9
8
|
export var VenueStatusWeight = {
|
|
10
9
|
[VenueStatus.ACTIVE]: 0,
|
|
11
10
|
[VenueStatus.ARCHIVE]: 1,
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
/** @type {Record<VenueStatus, string>} */
|
|
15
13
|
export var VenueStatusTitle = {
|
|
16
14
|
[VenueStatus.ACTIVE]: 'В пользовании',
|
|
17
15
|
[VenueStatus.ARCHIVE]: 'В архиве',
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
[VenueStatus.
|
|
23
|
-
[VenueStatus.ARCHIVE]: 'hero/outline/archive-box',
|
|
18
|
+
export var VenueStatusColor = {
|
|
19
|
+
[VenueStatus.ACTIVE]: 'success',
|
|
20
|
+
[VenueStatus.ARCHIVE]: 'current',
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
export var VenueStatusColor = {
|
|
23
|
+
export var VenueStatusTextColor = {
|
|
28
24
|
[VenueStatus.ACTIVE]: 'text-success',
|
|
29
25
|
[VenueStatus.ARCHIVE]: 'text-current',
|
|
30
26
|
}
|
|
27
|
+
|
|
28
|
+
/** @type {Record<VenueStatus, Icon>} */
|
|
29
|
+
export var VenueStatusIcon = {
|
|
30
|
+
[VenueStatus.ACTIVE]: 'hero/outline/check',
|
|
31
|
+
[VenueStatus.ARCHIVE]: 'hero/outline/archive-box',
|
|
32
|
+
}
|