@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,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@shakerquiz/utilities",
4
- "version": "0.5.188",
4
+ "version": "0.5.189",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -0,0 +1,4 @@
1
+ export const Category = Object.freeze({
2
+ 'Active': 'Active',
3
+ 'Rest': 'Rest',
4
+ })
@@ -1,6 +1,7 @@
1
+ import { Mode } from '../mode.js'
1
2
  import { Role } from './role.js'
2
3
 
3
- export var GameStatus = /** @type {const} */ ({
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 var GameStatuses = Object.values(GameStatus)
16
+ export const GameStatuses = Object.freeze(Object.values(GameStatus))
16
17
 
17
- export var GameStatusWeight = {
18
- [GameStatus.REJECTED]: 0,
19
- [GameStatus.MODERATION]: 1,
20
- [GameStatus.APPROVED]: 2,
21
- [GameStatus.CLOSED]: 3,
22
- [GameStatus.FORINVITES]: 4,
23
- [GameStatus.PUBLISHED]: 5,
24
- [GameStatus.IS_RESERVE]: 6,
25
- [GameStatus.FINISHED]: 7,
26
- [GameStatus.ARCHIVE]: 8,
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
- /** @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
- }
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
- /** @type {{ [Key in Role]: Partial<Record<GameStatus, GameStatus[]>> }} */
79
- export var RoleGameStatusGameStatuses = {
80
- [Role.admin]: {},
42
+ export const RoleGameStatusGameStatuses = Object.freeze({
43
+ [Role['admin']]: Object.freeze({}),
81
44
 
82
- [Role.organizer]: {
83
- [GameStatus.APPROVED]: [
84
- GameStatus.APPROVED,
85
- GameStatus.CLOSED,
86
- GameStatus.FORINVITES,
87
- GameStatus.PUBLISHED,
88
- GameStatus.IS_RESERVE,
89
- GameStatus.FINISHED,
90
- GameStatus.ARCHIVE,
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.MODERATION]: [
94
- GameStatus.MODERATION,
95
- ],
56
+ [GameStatus['MODERATION']]: Object.freeze([
57
+ GameStatus['MODERATION'],
58
+ ]),
96
59
 
97
- [GameStatus.REJECTED]: [
98
- GameStatus.REJECTED,
99
- GameStatus.MODERATION,
100
- ],
101
- },
60
+ [GameStatus['REJECTED']]: Object.freeze([
61
+ GameStatus['REJECTED'],
62
+ GameStatus['MODERATION'],
63
+ ]),
64
+ }),
102
65
 
103
- [Role.default]: {},
104
- }
66
+ [Mode['Unknown']]: Object.freeze({}),
67
+ })
105
68
 
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
- ],
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.organizer]: [
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
- [Role.default]: [],
130
- }
91
+ [Mode['Unknown']]: Object.freeze([]),
92
+ })
package/source/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './enumerations/blend.js'
2
2
  export * from './enumerations/cardinality.js'
3
+ export * from './enumerations/category.js'
3
4
  export * from './enumerations/constants.js'
4
5
  export * from './enumerations/display.js'
5
6
  export * from './enumerations/gender.js'