@shakerquiz/utilities 4.0.7 → 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.7",
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,87 +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
- 'registrations': 'registrations',
72
- 'registrations/city': 'registrations/city',
73
- 'registrations/game': 'registrations/game',
74
- 'registrations/game/theme': 'registrations/game/theme',
75
- 'registrations/export': 'registrations/export',
76
- 'telegram/webhook': 'telegram/webhook',
77
- 'telegram/registration/mailing': 'telegram/registration/mailing',
78
- 'chatapp/webhook': 'chatapp/webhook',
79
- 'chatapp/registration': 'chatapp/registration',
80
- 'chatapp/registration/mailing': 'chatapp/registration/mailing',
81
- 'bitrix/registration': 'bitrix/registration',
82
- }),
83
- )
84
-
85
3
  export const RouteCardinality = Object.freeze(
86
4
  /** @type {const} */ ({
87
5
  'role': '1',
@@ -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
+ )
@@ -79,3 +79,12 @@ export const Routes = Object.freeze(
79
79
  'bitrix/registration',
80
80
  ]),
81
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
+ )