@shakerquiz/utilities 4.0.12 → 4.0.14

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": "4.0.12",
4
+ "version": "4.0.14",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -1,10 +1,15 @@
1
- export const CityAffilation = Object.freeze({
2
- 'Branch': 'Branch',
3
- 'Franchise': 'Franchise',
4
- })
1
+ export const CityAffilations = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'Branch',
4
+ 'Franchise',
5
+ ]),
6
+ )
5
7
 
6
- /** @satisfies {Array<keyof typeof CityAffilation>} */
7
- export const CityAffilations = Object.freeze([
8
- 'Branch',
9
- 'Franchise',
10
- ])
8
+ export const CityAffilation = Object.freeze(
9
+ /** @type {{ [x in typeof CityAffilations[number]]: x }} */ (
10
+ CityAffilations.reduce(
11
+ (o, x) => (o[x] = x, o),
12
+ {},
13
+ )
14
+ ),
15
+ )
@@ -1,9 +1,15 @@
1
- export const CityChatappVersion = Object.freeze({
2
- 'Latest': 'Latest',
3
- 'Legacy': 'Legacy',
4
- })
1
+ export const CityChatappVersions = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'Latest',
4
+ 'Legacy',
5
+ ]),
6
+ )
5
7
 
6
- export const CityChatappVersions = Object.freeze([
7
- 'Latest',
8
- 'Legacy',
9
- ])
8
+ export const CityChatappVersion = Object.freeze(
9
+ /** @type {{ [x in typeof CityChatappVersions[number]]: x }} */ (
10
+ CityChatappVersions.reduce(
11
+ (o, x) => (o[x] = x, o),
12
+ {},
13
+ )
14
+ ),
15
+ )
@@ -2,19 +2,28 @@ import { Category } from './category.js'
2
2
  import { Mode } from './mode.js'
3
3
  import { Role } from './role.js'
4
4
 
5
- export const GameStatus = Object.freeze({
6
- 'REJECTED': 'REJECTED',
7
- 'MODERATION': 'MODERATION',
8
- 'APPROVED': 'APPROVED',
9
- 'CLOSED': 'CLOSED',
10
- 'FORINVITES': 'FORINVITES',
11
- 'PUBLISHED': 'PUBLISHED',
12
- 'IS_RESERVE': 'IS_RESERVE',
13
- 'FINISHED': 'FINISHED',
14
- 'ARCHIVE': 'ARCHIVE',
15
- })
16
-
17
- export const GameStatuses = Object.freeze(Object.values(GameStatus))
5
+ export const GameStatuses = Object.freeze(
6
+ /** @type {const} */ ([
7
+ 'APPROVED',
8
+ 'ARCHIVE',
9
+ 'CLOSED',
10
+ 'FINISHED',
11
+ 'FORINVITES',
12
+ 'IS_RESERVE',
13
+ 'MODERATION',
14
+ 'PUBLISHED',
15
+ 'REJECTED',
16
+ ]),
17
+ )
18
+
19
+ export const GameStatus = Object.freeze(
20
+ /** @type {{ [x in typeof GameStatuses[number]]: x }} */ (
21
+ GameStatuses.reduce(
22
+ (o, x) => (o[x] = x, o),
23
+ {},
24
+ )
25
+ ),
26
+ )
18
27
 
19
28
  export const RoleGameStatusGameStatuses = Object.freeze({
20
29
  [Role['admin']]: Object.freeze({}),
@@ -1,11 +1,16 @@
1
- export const RegistrationChannel = Object.freeze({
2
- 'vkontakte': 'vkontakte',
3
- 'telegramBot': 'telegramBot',
4
- 'email': 'email',
5
- })
1
+ export const RegistrationChannels = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'vkontakte',
4
+ 'telegramBot',
5
+ 'email',
6
+ ]),
7
+ )
6
8
 
7
- export const RegistrationChannels = Object.freeze([
8
- 'vkontakte',
9
- 'telegramBot',
10
- 'email',
11
- ])
9
+ export const RegistrationChannel = Object.freeze(
10
+ /** @type {{ [x in typeof RegistrationChannels[number]]: x }} */ (
11
+ RegistrationChannels.reduce(
12
+ (o, x) => (o[x] = x, o),
13
+ {},
14
+ )
15
+ ),
16
+ )
@@ -1,12 +1,18 @@
1
- export const RegistrationLineup = Object.freeze({
2
- 'Main': 'Main',
3
- 'Reserve': 'Reserve',
4
- })
1
+ export const RegistrationLineups = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'Main',
4
+ 'Reserve',
5
+ ]),
6
+ )
5
7
 
6
- export const RegistrationLineups = Object.freeze([
7
- 'Main',
8
- 'Reserve',
9
- ])
8
+ export const RegistrationLineup = Object.freeze(
9
+ /** @type {{ [x in typeof RegistrationLineups[number]]: x }} */ (
10
+ RegistrationLineups.reduce(
11
+ (o, x) => (o[x] = x, o),
12
+ {},
13
+ )
14
+ ),
15
+ )
10
16
 
11
17
  export const RegistrationLineupEmoji = Object.freeze({
12
18
  'Main': '🟢',
@@ -1,16 +1,20 @@
1
- export const RegistrationMailing = Object.freeze({
2
- 'Idle': 'Idle',
3
- 'Pending': 'Pending',
4
- 'Delivered': 'Delivered',
5
- 'Failed': 'Failed',
6
- })
1
+ export const RegistrationMailings = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'Idle',
4
+ 'Pending',
5
+ 'Delivered',
6
+ 'Failed',
7
+ ]),
8
+ )
7
9
 
8
- export const RegistrationMailings = Object.freeze([
9
- 'Idle',
10
- 'Pending',
11
- 'Delivered',
12
- 'Failed',
13
- ])
10
+ export const RegistrationMailing = Object.freeze(
11
+ /** @type {{ [x in typeof RegistrationMailings[number]]: x }} */ (
12
+ RegistrationMailings.reduce(
13
+ (o, x) => (o[x] = x, o),
14
+ {},
15
+ )
16
+ ),
17
+ )
14
18
 
15
19
  export const RegistrationMailingColor = Object.freeze({
16
20
  'Idle': 'default',
@@ -1,15 +1,19 @@
1
- export const RegistrationStatus = Object.freeze({
2
- 'Created': 'Created',
3
- 'Confirmed': 'Confirmed',
4
- 'Cancelled': 'Cancelled',
5
- })
1
+ export const RegistrationStatuses = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'Created',
4
+ 'Confirmed',
5
+ 'Cancelled',
6
+ ]),
7
+ )
6
8
 
7
- /** @satisfies {Array<keyof typeof RegistrationStatus>} */
8
- export const RegistrationStatuses = Object.freeze([
9
- 'Created',
10
- 'Confirmed',
11
- 'Cancelled',
12
- ])
9
+ export const RegistrationStatus = Object.freeze(
10
+ /** @type {{ [x in typeof RegistrationStatuses[number]]: x }} */ (
11
+ RegistrationStatuses.reduce(
12
+ (o, x) => (o[x] = x, o),
13
+ {},
14
+ )
15
+ ),
16
+ )
13
17
 
14
18
  /** @satisfies {Record<keyof typeof RegistrationStatus, string>} */
15
19
  export const RegistrationStatusEmoji = Object.freeze({
@@ -162,7 +162,7 @@ export const Segments = Object.freeze(
162
162
  key: Key['cover'],
163
163
  cardinality: '1',
164
164
  relation: undefined,
165
- service: undefined,
165
+ service: Service['Minio'],
166
166
  pattern: Pattern.UUID.source,
167
167
  }),
168
168
  ),