@shakerquiz/utilities 0.5.188 → 0.5.189
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
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Mode } from '../mode.js'
|
|
1
2
|
import { Role } from './role.js'
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
+
export const GameStatus = Object.freeze({
|
|
4
5
|
'REJECTED': 'REJECTED',
|
|
5
6
|
'MODERATION': 'MODERATION',
|
|
6
7
|
'APPROVED': 'APPROVED',
|
|
@@ -12,119 +13,80 @@ export var GameStatus = /** @type {const} */ ({
|
|
|
12
13
|
'ARCHIVE': 'ARCHIVE',
|
|
13
14
|
})
|
|
14
15
|
|
|
15
|
-
export
|
|
16
|
+
export const GameStatuses = Object.freeze(Object.values(GameStatus))
|
|
16
17
|
|
|
17
|
-
export
|
|
18
|
-
[GameStatus
|
|
19
|
-
[GameStatus
|
|
20
|
-
[GameStatus
|
|
21
|
-
[GameStatus
|
|
22
|
-
[GameStatus
|
|
23
|
-
[GameStatus
|
|
24
|
-
[GameStatus
|
|
25
|
-
[GameStatus
|
|
26
|
-
[GameStatus
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export var GameStatusTitle = {
|
|
30
|
-
[GameStatus.REJECTED]: 'Отклонено',
|
|
31
|
-
[GameStatus.MODERATION]: 'На проверке',
|
|
32
|
-
[GameStatus.APPROVED]: 'Одобрено',
|
|
33
|
-
[GameStatus.CLOSED]: 'Закрыта',
|
|
34
|
-
[GameStatus.FORINVITES]: 'По приглашению',
|
|
35
|
-
[GameStatus.PUBLISHED]: 'Опубликовано',
|
|
36
|
-
[GameStatus.IS_RESERVE]: 'В резерве',
|
|
37
|
-
[GameStatus.FINISHED]: 'Завершено',
|
|
38
|
-
[GameStatus.ARCHIVE]: 'В архиве',
|
|
39
|
-
}
|
|
40
|
-
|
|
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',
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export var GameStatusTextColor = {
|
|
54
|
-
[GameStatus.REJECTED]: 'text-danger',
|
|
55
|
-
[GameStatus.MODERATION]: 'text-primary',
|
|
56
|
-
[GameStatus.APPROVED]: 'text-success',
|
|
57
|
-
[GameStatus.CLOSED]: 'text-warning',
|
|
58
|
-
[GameStatus.FORINVITES]: 'text-current',
|
|
59
|
-
[GameStatus.PUBLISHED]: 'text-secondary',
|
|
60
|
-
[GameStatus.IS_RESERVE]: 'text-blue-900',
|
|
61
|
-
[GameStatus.FINISHED]: 'text-success',
|
|
62
|
-
[GameStatus.ARCHIVE]: 'text-current',
|
|
63
|
-
}
|
|
18
|
+
export const GameStatusTitle = Object.freeze({
|
|
19
|
+
[GameStatus['REJECTED']]: 'Отклонено',
|
|
20
|
+
[GameStatus['MODERATION']]: 'На проверке',
|
|
21
|
+
[GameStatus['APPROVED']]: 'Одобрено',
|
|
22
|
+
[GameStatus['CLOSED']]: 'Закрыта',
|
|
23
|
+
[GameStatus['FORINVITES']]: 'По приглашению',
|
|
24
|
+
[GameStatus['PUBLISHED']]: 'Опубликовано',
|
|
25
|
+
[GameStatus['IS_RESERVE']]: 'В резерве',
|
|
26
|
+
[GameStatus['FINISHED']]: 'Завершено',
|
|
27
|
+
[GameStatus['ARCHIVE']]: 'В архиве',
|
|
28
|
+
})
|
|
64
29
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[GameStatus
|
|
68
|
-
[GameStatus
|
|
69
|
-
[GameStatus
|
|
70
|
-
[GameStatus
|
|
71
|
-
[GameStatus
|
|
72
|
-
[GameStatus
|
|
73
|
-
[GameStatus
|
|
74
|
-
[GameStatus
|
|
75
|
-
|
|
76
|
-
}
|
|
30
|
+
export const GameStatusIcon = Object.freeze({
|
|
31
|
+
[GameStatus['REJECTED']]: 'hero/outline/x-mark',
|
|
32
|
+
[GameStatus['MODERATION']]: 'hero/outline/clock',
|
|
33
|
+
[GameStatus['APPROVED']]: 'hero/outline/hand-thumb-up',
|
|
34
|
+
[GameStatus['CLOSED']]: 'hero/outline/exclamation-triangle',
|
|
35
|
+
[GameStatus['FORINVITES']]: 'hero/outline/lock-closed',
|
|
36
|
+
[GameStatus['PUBLISHED']]: 'hero/outline/check-circle',
|
|
37
|
+
[GameStatus['IS_RESERVE']]: 'hero/outline/user-plus',
|
|
38
|
+
[GameStatus['FINISHED']]: 'hero/outline/check',
|
|
39
|
+
[GameStatus['ARCHIVE']]: 'hero/outline/archive-box',
|
|
40
|
+
})
|
|
77
41
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
[Role.admin]: {},
|
|
42
|
+
export const RoleGameStatusGameStatuses = Object.freeze({
|
|
43
|
+
[Role['admin']]: Object.freeze({}),
|
|
81
44
|
|
|
82
|
-
[Role
|
|
83
|
-
[GameStatus
|
|
84
|
-
GameStatus
|
|
85
|
-
GameStatus
|
|
86
|
-
GameStatus
|
|
87
|
-
GameStatus
|
|
88
|
-
GameStatus
|
|
89
|
-
GameStatus
|
|
90
|
-
GameStatus
|
|
91
|
-
],
|
|
45
|
+
[Role['organizer']]: Object.freeze({
|
|
46
|
+
[GameStatus['APPROVED']]: Object.freeze([
|
|
47
|
+
GameStatus['APPROVED'],
|
|
48
|
+
GameStatus['CLOSED'],
|
|
49
|
+
GameStatus['FORINVITES'],
|
|
50
|
+
GameStatus['PUBLISHED'],
|
|
51
|
+
GameStatus['IS_RESERVE'],
|
|
52
|
+
GameStatus['FINISHED'],
|
|
53
|
+
GameStatus['ARCHIVE'],
|
|
54
|
+
]),
|
|
92
55
|
|
|
93
|
-
[GameStatus
|
|
94
|
-
GameStatus
|
|
95
|
-
],
|
|
56
|
+
[GameStatus['MODERATION']]: Object.freeze([
|
|
57
|
+
GameStatus['MODERATION'],
|
|
58
|
+
]),
|
|
96
59
|
|
|
97
|
-
[GameStatus
|
|
98
|
-
GameStatus
|
|
99
|
-
GameStatus
|
|
100
|
-
],
|
|
101
|
-
},
|
|
60
|
+
[GameStatus['REJECTED']]: Object.freeze([
|
|
61
|
+
GameStatus['REJECTED'],
|
|
62
|
+
GameStatus['MODERATION'],
|
|
63
|
+
]),
|
|
64
|
+
}),
|
|
102
65
|
|
|
103
|
-
[
|
|
104
|
-
}
|
|
66
|
+
[Mode['Unknown']]: Object.freeze({}),
|
|
67
|
+
})
|
|
105
68
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
'
|
|
110
|
-
'
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'
|
|
117
|
-
|
|
118
|
-
],
|
|
69
|
+
export const RoleDefaultGameStatuses = Object.freeze({
|
|
70
|
+
[Role['admin']]: Object.freeze([
|
|
71
|
+
GameStatus['APPROVED'],
|
|
72
|
+
GameStatus['ARCHIVE'],
|
|
73
|
+
GameStatus['CLOSED'],
|
|
74
|
+
GameStatus['FINISHED'],
|
|
75
|
+
GameStatus['FORINVITES'],
|
|
76
|
+
GameStatus['IS_RESERVE'],
|
|
77
|
+
GameStatus['MODERATION'],
|
|
78
|
+
GameStatus['PUBLISHED'],
|
|
79
|
+
GameStatus['REJECTED'],
|
|
80
|
+
]),
|
|
119
81
|
|
|
120
|
-
[Role
|
|
121
|
-
'ARCHIVE',
|
|
122
|
-
'CLOSED',
|
|
123
|
-
'FINISHED',
|
|
124
|
-
'FORINVITES',
|
|
125
|
-
'IS_RESERVE',
|
|
126
|
-
'PUBLISHED',
|
|
127
|
-
],
|
|
82
|
+
[Role['organizer']]: Object.freeze([
|
|
83
|
+
GameStatus['ARCHIVE'],
|
|
84
|
+
GameStatus['CLOSED'],
|
|
85
|
+
GameStatus['FINISHED'],
|
|
86
|
+
GameStatus['FORINVITES'],
|
|
87
|
+
GameStatus['IS_RESERVE'],
|
|
88
|
+
GameStatus['PUBLISHED'],
|
|
89
|
+
]),
|
|
128
90
|
|
|
129
|
-
[
|
|
130
|
-
}
|
|
91
|
+
[Mode['Unknown']]: Object.freeze([]),
|
|
92
|
+
})
|
package/source/index.js
CHANGED