@shakerquiz/utilities 0.4.76 → 0.4.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/enumerations/core/features.d.ts +64 -83
- package/source/enumerations/core/features.js +69 -66
- package/source/enumerations/entities/city-affilations.js +11 -4
- package/source/enumerations/entities/game-statuses.js +113 -11
- package/source/enumerations/entities/registration-attributes.js +50 -24
- package/source/enumerations/entities/registration-channels.js +26 -5
- package/source/enumerations/entities/registration-lineups.js +39 -7
- package/source/enumerations/entities/registration-mailings.js +24 -6
- package/source/enumerations/entities/registration-statuses.js +49 -12
- package/source/enumerations/entities/roles.js +13 -5
- package/source/enumerations/entities/venue-statuses.js +30 -4
- package/source/enumerations/misc/icons.js +652 -324
- package/source/enumerations/misc/phases.js +42 -7
- package/source/misc.d.ts +34 -18
- package/source/enumerations/entities/city-affilations.d.ts +0 -1
- package/source/enumerations/entities/game-statuses.d.ts +0 -1
- package/source/enumerations/entities/registration-attributes.d.ts +0 -2
- package/source/enumerations/entities/registration-channels.d.ts +0 -1
- package/source/enumerations/entities/registration-lineups.d.ts +0 -5
- package/source/enumerations/entities/registration-mailings.d.ts +0 -1
- package/source/enumerations/entities/registration-statuses.d.ts +0 -5
- package/source/enumerations/entities/roles.d.ts +0 -1
- package/source/enumerations/entities/venue-statuses.d.ts +0 -1
- package/source/enumerations/misc/icons.d.ts +0 -1
- package/source/enumerations/misc/phases.d.ts +0 -1
|
@@ -1,15 +1,47 @@
|
|
|
1
|
-
export var
|
|
2
|
-
'Main',
|
|
3
|
-
'Reserve',
|
|
4
|
-
|
|
1
|
+
export var RegistrationLineup = /** @type {const} */ ({
|
|
2
|
+
'Main': 'Main',
|
|
3
|
+
'Reserve': 'Reserve',
|
|
4
|
+
})
|
|
5
|
+
|
|
6
|
+
export var RegistrationLineups = Object.values(RegistrationLineup)
|
|
7
|
+
|
|
8
|
+
/** @type {Record<RegistrationLineup, number>} */
|
|
9
|
+
export var RegistrationLineupWeight = {
|
|
10
|
+
[RegistrationLineup.Main]: 0,
|
|
11
|
+
[RegistrationLineup.Reserve]: 1,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** @type {Record<RegistrationLineup, string>} */
|
|
15
|
+
export var RegistrationLineupTitle = {
|
|
16
|
+
[RegistrationLineup.Main]: 'Основа',
|
|
17
|
+
[RegistrationLineup.Reserve]: 'Резерв',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** @type {Record<RegistrationLineup, Icon>} */
|
|
21
|
+
export var RegistrationLineupIcon = {
|
|
22
|
+
[RegistrationLineup.Main]: 'hero/outline/user-circle',
|
|
23
|
+
[RegistrationLineup.Reserve]: 'hero/outline/pause-circle',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** @type {Record<RegistrationLineup, string>} */
|
|
27
|
+
export var RegistrationLineupEmoji = {
|
|
28
|
+
[RegistrationLineup.Main]: '🟢',
|
|
29
|
+
[RegistrationLineup.Reserve]: '🟡',
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** @type {Record<RegistrationLineup, string>} */
|
|
33
|
+
export var RegistrationLineupColor = {
|
|
34
|
+
[RegistrationLineup.Main]: 'text-primary',
|
|
35
|
+
[RegistrationLineup.Reserve]: 'text-secondary',
|
|
36
|
+
}
|
|
5
37
|
|
|
6
38
|
/** @type {Record<RegistrationLineup, Pick<RegistrationTable, 'is_reserve'>>} */
|
|
7
|
-
|
|
8
|
-
|
|
39
|
+
export var RegistrationLineupShape = {
|
|
40
|
+
[RegistrationLineup.Main]: {
|
|
9
41
|
is_reserve: false,
|
|
10
42
|
},
|
|
11
43
|
|
|
12
|
-
|
|
44
|
+
[RegistrationLineup.Reserve]: {
|
|
13
45
|
is_reserve: true,
|
|
14
46
|
},
|
|
15
47
|
}
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
export var
|
|
2
|
-
'Idle',
|
|
3
|
-
'Pending',
|
|
4
|
-
'Delivered',
|
|
5
|
-
'Failed',
|
|
6
|
-
|
|
1
|
+
export var RegistrationMailing = /** @type {const} */ ({
|
|
2
|
+
'Idle': 'Idle',
|
|
3
|
+
'Pending': 'Pending',
|
|
4
|
+
'Delivered': 'Delivered',
|
|
5
|
+
'Failed': 'Failed',
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export var RegistrationMailings = Object.values(RegistrationMailing)
|
|
9
|
+
|
|
10
|
+
/** @type {Record<RegistrationMailing, number>} */
|
|
11
|
+
export var RegistrationMailingWeight = {
|
|
12
|
+
[RegistrationMailing.Idle]: 0,
|
|
13
|
+
[RegistrationMailing.Pending]: 1,
|
|
14
|
+
[RegistrationMailing.Delivered]: 2,
|
|
15
|
+
[RegistrationMailing.Failed]: 3,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** @type {Record<RegistrationMailing, string>} */
|
|
19
|
+
export var RegistrationMailingColor = {
|
|
20
|
+
[RegistrationMailing.Idle]: 'default',
|
|
21
|
+
[RegistrationMailing.Pending]: 'warning',
|
|
22
|
+
[RegistrationMailing.Delivered]: 'success',
|
|
23
|
+
[RegistrationMailing.Failed]: 'danger',
|
|
24
|
+
}
|
|
@@ -1,22 +1,59 @@
|
|
|
1
|
-
export var
|
|
2
|
-
'
|
|
3
|
-
'
|
|
4
|
-
'Cancelled',
|
|
5
|
-
|
|
1
|
+
export var RegistrationStatus = /** @type {const} */ ({
|
|
2
|
+
'Confirmed': 'Confirmed',
|
|
3
|
+
'Created': 'Created',
|
|
4
|
+
'Cancelled': 'Cancelled',
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
export var RegistrationStatuses = Object.values(RegistrationStatus)
|
|
8
|
+
|
|
9
|
+
/** @type {Record<RegistrationStatus, number>} */
|
|
10
|
+
export var RegistrationStatusWeight = {
|
|
11
|
+
[RegistrationStatus.Confirmed]: 0,
|
|
12
|
+
[RegistrationStatus.Created]: 1,
|
|
13
|
+
[RegistrationStatus.Cancelled]: 2,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** @type {Record<RegistrationStatus, string>} */
|
|
17
|
+
export var RegistrationStatusTitle = {
|
|
18
|
+
[RegistrationStatus.Confirmed]: 'Подтверждена',
|
|
19
|
+
[RegistrationStatus.Created]: 'Пройдена',
|
|
20
|
+
[RegistrationStatus.Cancelled]: 'Отменена',
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** @type {Record<RegistrationStatus, Icon>} */
|
|
24
|
+
export var RegistrationStatusIcon = {
|
|
25
|
+
[RegistrationStatus.Confirmed]: 'hero/outline/check-circle',
|
|
26
|
+
[RegistrationStatus.Created]: 'hero/outline/check',
|
|
27
|
+
[RegistrationStatus.Cancelled]: 'hero/outline/x-mark',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** @type {Record<RegistrationStatus, Icon>} */
|
|
31
|
+
export var RegistrationStatusEmoji = {
|
|
32
|
+
[RegistrationStatus.Confirmed]: '✅',
|
|
33
|
+
[RegistrationStatus.Created]: '📝',
|
|
34
|
+
[RegistrationStatus.Cancelled]: '❌',
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** @type {Record<RegistrationStatus, string>} */
|
|
38
|
+
export var RegistrationStatusColor = {
|
|
39
|
+
[RegistrationStatus.Confirmed]: 'text-success',
|
|
40
|
+
[RegistrationStatus.Created]: 'text-default-700',
|
|
41
|
+
[RegistrationStatus.Cancelled]: 'text-danger',
|
|
42
|
+
}
|
|
6
43
|
|
|
7
44
|
/** @type {Record<RegistrationStatus, Pick<RegistrationTable, 'is_canceled' | 'is_confirm'>>} */
|
|
8
|
-
|
|
9
|
-
|
|
45
|
+
export var RegistrationStatusShape = {
|
|
46
|
+
[RegistrationStatus.Confirmed]: {
|
|
10
47
|
is_canceled: false,
|
|
11
|
-
is_confirm:
|
|
48
|
+
is_confirm: true,
|
|
12
49
|
},
|
|
13
50
|
|
|
14
|
-
|
|
51
|
+
[RegistrationStatus.Created]: {
|
|
15
52
|
is_canceled: false,
|
|
16
|
-
is_confirm:
|
|
53
|
+
is_confirm: false,
|
|
17
54
|
},
|
|
18
55
|
|
|
19
|
-
|
|
56
|
+
[RegistrationStatus.Cancelled]: {
|
|
20
57
|
is_canceled: true,
|
|
21
58
|
is_confirm: false,
|
|
22
59
|
},
|
|
@@ -25,7 +62,7 @@ let RegistrationStatusShape = {
|
|
|
25
62
|
/**
|
|
26
63
|
* @param {RegistrationStatus | typeof RegistrationStatusShape[RegistrationStatus]} value
|
|
27
64
|
*/
|
|
28
|
-
export
|
|
65
|
+
export var getRegistrationStatus = value => {
|
|
29
66
|
switch (typeof value) {
|
|
30
67
|
case 'object':
|
|
31
68
|
let found = Object
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
export var
|
|
2
|
-
'admin',
|
|
3
|
-
'
|
|
4
|
-
'
|
|
5
|
-
|
|
1
|
+
export var Role = /** @type {const} */ ({
|
|
2
|
+
'admin': 'admin',
|
|
3
|
+
'organizer': 'organizer',
|
|
4
|
+
'default': 'default',
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
export var RoleWeight = {
|
|
8
|
+
[Role.admin]: 0,
|
|
9
|
+
[Role.organizer]: 1,
|
|
10
|
+
[Role.default]: 2,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export var Roles = Object.values(Role)
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
export var
|
|
2
|
-
'ACTIVE',
|
|
3
|
-
'ARCHIVE',
|
|
4
|
-
|
|
1
|
+
export var VenueStatus = /** @type {const} */ ({
|
|
2
|
+
'ACTIVE': 'ACTIVE',
|
|
3
|
+
'ARCHIVE': 'ARCHIVE',
|
|
4
|
+
})
|
|
5
|
+
|
|
6
|
+
export var VenueStatuses = Object.values(VenueStatus)
|
|
7
|
+
|
|
8
|
+
/** @type {Record<VenueStatus, number>} */
|
|
9
|
+
export var VenueStatusWeight = {
|
|
10
|
+
[VenueStatus.ACTIVE]: 0,
|
|
11
|
+
[VenueStatus.ARCHIVE]: 1,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** @type {Record<VenueStatus, string>} */
|
|
15
|
+
export var VenueStatusTitle = {
|
|
16
|
+
[VenueStatus.ACTIVE]: 'В пользовании',
|
|
17
|
+
[VenueStatus.ARCHIVE]: 'В архиве',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** @type {Record<VenueStatus, Icon>} */
|
|
21
|
+
export var VenueStatusIcon = {
|
|
22
|
+
[VenueStatus.ACTIVE]: 'hero/outline/check',
|
|
23
|
+
[VenueStatus.ARCHIVE]: 'hero/outline/archive-box',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** @type {Record<VenueStatus, string>} */
|
|
27
|
+
export var VenueStatusColor = {
|
|
28
|
+
[VenueStatus.ACTIVE]: 'text-success',
|
|
29
|
+
[VenueStatus.ARCHIVE]: 'text-current',
|
|
30
|
+
}
|