@shakerquiz/utilities 4.0.6 → 4.0.8

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.6",
4
+ "version": "4.0.8",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -41,10 +41,6 @@ let service = route =>
41
41
  .map(x => Segment[x].service)
42
42
  .at(0)
43
43
 
44
- let Route = Routes
45
- .map(x => `'${x}': '${x}'`)
46
- .join(',\n ')
47
-
48
44
  let RouteCardinality = Routes
49
45
  .map(route => [
50
46
  route,
@@ -92,7 +88,6 @@ let ServiceRoutes = Object
92
88
  Bun.write(
93
89
  './source/codegen/autogenerated.js',
94
90
  template
95
- .replace('/* route */', Route)
96
91
  .replace('/* route -> cardinality */', RouteCardinality)
97
92
  .replace('/* route -> pathname */', RoutePathname)
98
93
  .replace('/* pathname -> route */', PathnameRoute)
@@ -1,11 +1,5 @@
1
1
  /* --- Autogenerated --- */
2
2
 
3
- export const Route = Object.freeze(
4
- /** @type {const} */ ({
5
- /* route */
6
- }),
7
- )
8
-
9
3
  export const RouteCardinality = Object.freeze(
10
4
  /** @type {const} */ ({
11
5
  /* route -> cardinality */
@@ -1,88 +1,5 @@
1
1
  /* --- Autogenerated --- */
2
2
 
3
- export const Route = Object.freeze(
4
- /** @type {const} */ ({
5
- 'role': 'role',
6
- 'roles': 'roles',
7
- 'user': 'user',
8
- 'user/password': 'user/password',
9
- 'user/role': 'user/role',
10
- 'user/city': 'user/city',
11
- 'user/cities': 'user/cities',
12
- 'users': 'users',
13
- 'users/password': 'users/password',
14
- 'users/role': 'users/role',
15
- 'users/cities': 'users/cities',
16
- 'checkin': 'checkin',
17
- 'cities': 'cities',
18
- 'cities/country': 'cities/country',
19
- 'cities/currency': 'cities/currency',
20
- 'cities/timezone': 'cities/timezone',
21
- 'cities/venues': 'cities/venues',
22
- 'city': 'city',
23
- 'city/vk_group_token': 'city/vk_group_token',
24
- 'city/country': 'city/country',
25
- 'city/currency': 'city/currency',
26
- 'city/timezone': 'city/timezone',
27
- 'city/venue': 'city/venue',
28
- 'city/venues': 'city/venues',
29
- 'country': 'country',
30
- 'countries': 'countries',
31
- 'currency': 'currency',
32
- 'currencies': 'currencies',
33
- 'timezone': 'timezone',
34
- 'timezones': 'timezones',
35
- 'venue': 'venue',
36
- 'venue/city': 'venue/city',
37
- 'venues': 'venues',
38
- 'venues/city': 'venues/city',
39
- 'theme': 'theme',
40
- 'theme/cover': 'theme/cover',
41
- 'themes': 'themes',
42
- 'themes/cover': 'themes/cover',
43
- 'themes/games': 'themes/games',
44
- 'game': 'game',
45
- 'game/city': 'game/city',
46
- 'game/registration': 'game/registration',
47
- 'game/registrations': 'game/registrations',
48
- 'game/registrations/export': 'game/registrations/export',
49
- 'game/summary': 'game/summary',
50
- 'game/theme': 'game/theme',
51
- 'game/theme/cover': 'game/theme/cover',
52
- 'game/venue': 'game/venue',
53
- 'games': 'games',
54
- 'games/city': 'games/city',
55
- 'games/registrations': 'games/registrations',
56
- 'games/registrations/export': 'games/registrations/export',
57
- 'games/summary': 'games/summary',
58
- 'games/theme': 'games/theme',
59
- 'games/theme/cover': 'games/theme/cover',
60
- 'games/venue': 'games/venue',
61
- 'registration': 'registration',
62
- 'registration/cancellation': 'registration/cancellation',
63
- 'registration/channel': 'registration/channel',
64
- 'registration/confirmation': 'registration/confirmation',
65
- 'registration/export': 'registration/export',
66
- 'registration/city': 'registration/city',
67
- 'registration/game': 'registration/game',
68
- 'registration/game/theme': 'registration/game/theme',
69
- 'registration/game/theme/cover': 'registration/game/theme/cover',
70
- 'registration/game/venue': 'registration/game/venue',
71
- 'registration/mailing': 'registration/mailing',
72
- 'registrations': 'registrations',
73
- 'registrations/city': 'registrations/city',
74
- 'registrations/game': 'registrations/game',
75
- 'registrations/game/theme': 'registrations/game/theme',
76
- 'registrations/export': 'registrations/export',
77
- 'telegram/webhook': 'telegram/webhook',
78
- 'telegram/registration/mailing': 'telegram/registration/mailing',
79
- 'chatapp/webhook': 'chatapp/webhook',
80
- 'chatapp/registration': 'chatapp/registration',
81
- 'chatapp/registration/mailing': 'chatapp/registration/mailing',
82
- 'bitrix/registration': 'bitrix/registration',
83
- }),
84
- )
85
-
86
3
  export const RouteCardinality = Object.freeze(
87
4
  /** @type {const} */ ({
88
5
  'role': '1',
@@ -151,7 +68,6 @@ export const RouteCardinality = Object.freeze(
151
68
  'registration/game/theme': '1/1',
152
69
  'registration/game/theme/cover': '1/1',
153
70
  'registration/game/venue': '1/1',
154
- 'registration/mailing': '1/1',
155
71
  'registrations': 'n',
156
72
  'registrations/city': 'n/1',
157
73
  'registrations/game': 'n/1',
@@ -234,7 +150,6 @@ export const RoutePathname = Object.freeze(
234
150
  'registration/game/theme': 'registration/:registration/game/:game/theme/:theme',
235
151
  'registration/game/theme/cover': 'registration/:registration/game/:game/theme/:theme/cover/:cover',
236
152
  'registration/game/venue': 'registration/:registration/game/:game/venue/:venue',
237
- 'registration/mailing': 'registration/:registration/mailing',
238
153
  'registrations': 'registrations',
239
154
  'registrations/city': 'registrations/city/:city',
240
155
  'registrations/game': 'registrations/game/:game',
@@ -317,7 +232,6 @@ export const PathnameRoute = Object.freeze(
317
232
  'registration/:registration/game/:game/theme/:theme': 'registration/game/theme',
318
233
  'registration/:registration/game/:game/theme/:theme/cover/:cover': 'registration/game/theme/cover',
319
234
  'registration/:registration/game/:game/venue/:venue': 'registration/game/venue',
320
- 'registration/:registration/mailing': 'registration/mailing',
321
235
  'registrations': 'registrations',
322
236
  'registrations/city/:city': 'registrations/city',
323
237
  'registrations/game/:game': 'registrations/game',
@@ -522,9 +436,6 @@ export const PathnameParameters = Object.freeze(
522
436
  ':game',
523
437
  ':venue',
524
438
  ],
525
- 'registration/:registration/mailing': [
526
- ':registration',
527
- ],
528
439
  'registrations': [],
529
440
  'registrations/city/:city': [
530
441
  ':city',
@@ -638,7 +549,6 @@ export const RouteBreakdown = Object.freeze(
638
549
  'registration/game/theme': 'registration/game/theme',
639
550
  'registration/game/theme/cover': 'registration/game/theme/cover',
640
551
  'registration/game/venue': 'registration/game/venue',
641
- 'registration/mailing': 'registration/mailing',
642
552
  'registrations': 'registration',
643
553
  'registrations/city': 'registration/city',
644
554
  'registrations/game': 'registration/game',
@@ -721,7 +631,6 @@ export const RouteService = Object.freeze(
721
631
  'registration/game/theme': 'Registrations',
722
632
  'registration/game/theme/cover': 'Registrations',
723
633
  'registration/game/venue': 'Registrations',
724
- 'registration/mailing': 'Registrations',
725
634
  'registrations': 'Registrations',
726
635
  'registrations/city': 'Registrations',
727
636
  'registrations/game': 'Registrations',
@@ -821,7 +730,6 @@ export const ServiceRoutes = Object.freeze(
821
730
  'registration/game/theme',
822
731
  'registration/game/theme/cover',
823
732
  'registration/game/venue',
824
- 'registration/mailing',
825
733
  'registrations',
826
734
  'registrations/city',
827
735
  'registrations/game',
@@ -3,20 +3,22 @@
3
3
  * - HTTP/1.1 (Core Methods): {@link https://datatracker.ietf.org/doc/html/rfc7231#section-4.3}
4
4
  * - PATCH: {@link https://datatracker.ietf.org/doc/html/rfc5789}
5
5
  */
6
- export const Method = Object.freeze({
7
- 'DELETE': 'DELETE',
8
- 'GET': 'GET',
9
- 'OPTIONS': 'OPTIONS',
10
- 'PATCH': 'PATCH',
11
- 'POST': 'POST',
12
- 'PUT': 'PUT',
13
- })
6
+ export const Methods = Object.freeze(
7
+ /** @type {const} */ ([
8
+ 'DELETE',
9
+ 'GET',
10
+ 'OPTIONS',
11
+ 'PATCH',
12
+ 'POST',
13
+ 'PUT',
14
+ ]),
15
+ )
14
16
 
15
- export const Methods = Object.freeze([
16
- 'DELETE',
17
- 'GET',
18
- 'OPTIONS',
19
- 'PATCH',
20
- 'POST',
21
- 'PUT',
22
- ])
17
+ export const Method = Object.freeze(
18
+ /** @type {{ [x in typeof Methods[number]]: x }} */ (
19
+ Methods.reduce(
20
+ (o, x) => (o[x] = x, o),
21
+ {},
22
+ )
23
+ ),
24
+ )
@@ -1,9 +1,15 @@
1
- export const Network = Object.freeze({
2
- 'Docker': 'Docker',
3
- 'Public': 'Public',
4
- })
1
+ export const Networks = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'Docker',
4
+ 'Public',
5
+ ]),
6
+ )
5
7
 
6
- export const Networks = Object.freeze([
7
- 'Docker',
8
- 'Public',
9
- ])
8
+ export const Network = Object.freeze(
9
+ /** @type {{ [x in typeof Networks[number]]: x }} */ (
10
+ Networks.reduce(
11
+ (o, x) => (o[x] = x, o),
12
+ {},
13
+ )
14
+ ),
15
+ )
@@ -66,7 +66,6 @@ export const Routes = Object.freeze(
66
66
  'registration/game/theme',
67
67
  'registration/game/theme/cover',
68
68
  'registration/game/venue',
69
- 'registration/mailing',
70
69
  'registrations',
71
70
  'registrations/city',
72
71
  'registrations/game',
@@ -80,3 +79,12 @@ export const Routes = Object.freeze(
80
79
  'bitrix/registration',
81
80
  ]),
82
81
  )
82
+
83
+ export const Route = Object.freeze(
84
+ /** @type {{ [x in typeof Routes[number]]: x }} */ (
85
+ Routes.reduce(
86
+ (o, x) => (o[x] = x, o),
87
+ {},
88
+ )
89
+ ),
90
+ )