@shakerquiz/utilities 4.0.14 → 4.0.16

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.14",
4
+ "version": "4.0.16",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -42,15 +42,19 @@ export const RouteCardinality = Object.freeze(
42
42
  'themes/cover': 'n/1',
43
43
  'themes/games': 'n/n',
44
44
  'game': '1',
45
+ 'game/status': '1/1',
46
+ 'game/statuses': '1/n',
45
47
  'game/city': '1/1',
46
- 'game/registration': '1/1',
47
48
  'game/registrations': '1/n',
49
+ 'game/registrations/status': '1/1',
50
+ 'game/registrations/lineup': '1/1',
48
51
  'game/registrations/export': '1/1',
49
52
  'game/summary': '1/1',
50
53
  'game/theme': '1/1',
51
54
  'game/theme/cover': '1/1',
52
55
  'game/venue': '1/1',
53
56
  'games': 'n',
57
+ 'games/status': 'n/1',
54
58
  'games/city': 'n/1',
55
59
  'games/registrations': 'n/n',
56
60
  'games/registrations/export': 'n/1',
@@ -59,9 +63,13 @@ export const RouteCardinality = Object.freeze(
59
63
  'games/theme/cover': 'n/1',
60
64
  'games/venue': 'n/1',
61
65
  'registration': '1',
66
+ 'registration/status': '1/1',
67
+ 'registration/statuses': '1/n',
62
68
  'registration/creation': '1/1',
63
69
  'registration/confirmation': '1/1',
64
70
  'registration/cancellation': '1/1',
71
+ 'registration/lineup': '1/1',
72
+ 'registration/lineups': '1/n',
65
73
  'registration/allocation': '1/1',
66
74
  'registration/reservation': '1/1',
67
75
  'registration/channel': '1/1',
@@ -72,8 +80,11 @@ export const RouteCardinality = Object.freeze(
72
80
  'registration/game/theme/cover': '1/1',
73
81
  'registration/game/venue': '1/1',
74
82
  'registrations': 'n',
83
+ 'registrations/status': 'n/1',
84
+ 'registrations/lineup': 'n/1',
75
85
  'registrations/city': 'n/1',
76
86
  'registrations/game': 'n/1',
87
+ 'registrations/game/status': 'n/1',
77
88
  'registrations/game/theme': 'n/1',
78
89
  'registrations/export': 'n/1',
79
90
  'telegram/webhook': '1/1',
@@ -127,15 +138,19 @@ export const RoutePathname = Object.freeze(
127
138
  'themes/cover': 'themes/cover/:cover',
128
139
  'themes/games': 'themes/games',
129
140
  'game': 'game/:game',
141
+ 'game/status': 'game/:game/status',
142
+ 'game/statuses': 'game/:game/statuses',
130
143
  'game/city': 'game/:game/city/:city',
131
- 'game/registration': 'game/:game/registration/:registration',
132
144
  'game/registrations': 'game/:game/registrations',
145
+ 'game/registrations/status': 'game/:game/registrations/status',
146
+ 'game/registrations/lineup': 'game/:game/registrations/lineup',
133
147
  'game/registrations/export': 'game/:game/registrations/export',
134
148
  'game/summary': 'game/:game/summary',
135
149
  'game/theme': 'game/:game/theme/:theme',
136
150
  'game/theme/cover': 'game/:game/theme/:theme/cover/:cover',
137
151
  'game/venue': 'game/:game/venue/:venue',
138
152
  'games': 'games',
153
+ 'games/status': 'games/status',
139
154
  'games/city': 'games/city/:city',
140
155
  'games/registrations': 'games/registrations',
141
156
  'games/registrations/export': 'games/registrations/export',
@@ -144,9 +159,13 @@ export const RoutePathname = Object.freeze(
144
159
  'games/theme/cover': 'games/theme/:theme/cover/:cover',
145
160
  'games/venue': 'games/venue/:venue',
146
161
  'registration': 'registration/:registration',
162
+ 'registration/status': 'registration/:registration/status',
163
+ 'registration/statuses': 'registration/:registration/statuses',
147
164
  'registration/creation': 'registration/:registration/creation',
148
165
  'registration/confirmation': 'registration/:registration/confirmation',
149
166
  'registration/cancellation': 'registration/:registration/cancellation',
167
+ 'registration/lineup': 'registration/:registration/lineup',
168
+ 'registration/lineups': 'registration/:registration/lineups',
150
169
  'registration/allocation': 'registration/:registration/allocation',
151
170
  'registration/reservation': 'registration/:registration/reservation',
152
171
  'registration/channel': 'registration/:registration/channel',
@@ -157,8 +176,11 @@ export const RoutePathname = Object.freeze(
157
176
  'registration/game/theme/cover': 'registration/:registration/game/:game/theme/:theme/cover/:cover',
158
177
  'registration/game/venue': 'registration/:registration/game/:game/venue/:venue',
159
178
  'registrations': 'registrations',
179
+ 'registrations/status': 'registrations/status',
180
+ 'registrations/lineup': 'registrations/lineup',
160
181
  'registrations/city': 'registrations/city/:city',
161
182
  'registrations/game': 'registrations/game/:game',
183
+ 'registrations/game/status': 'registrations/game/:game/status',
162
184
  'registrations/game/theme': 'registrations/game/:game/theme/:theme',
163
185
  'registrations/export': 'registrations/export',
164
186
  'telegram/webhook': 'telegram/webhook',
@@ -212,15 +234,19 @@ export const PathnameRoute = Object.freeze(
212
234
  'themes/cover/:cover': 'themes/cover',
213
235
  'themes/games': 'themes/games',
214
236
  'game/:game': 'game',
237
+ 'game/:game/status': 'game/status',
238
+ 'game/:game/statuses': 'game/statuses',
215
239
  'game/:game/city/:city': 'game/city',
216
- 'game/:game/registration/:registration': 'game/registration',
217
240
  'game/:game/registrations': 'game/registrations',
241
+ 'game/:game/registrations/status': 'game/registrations/status',
242
+ 'game/:game/registrations/lineup': 'game/registrations/lineup',
218
243
  'game/:game/registrations/export': 'game/registrations/export',
219
244
  'game/:game/summary': 'game/summary',
220
245
  'game/:game/theme/:theme': 'game/theme',
221
246
  'game/:game/theme/:theme/cover/:cover': 'game/theme/cover',
222
247
  'game/:game/venue/:venue': 'game/venue',
223
248
  'games': 'games',
249
+ 'games/status': 'games/status',
224
250
  'games/city/:city': 'games/city',
225
251
  'games/registrations': 'games/registrations',
226
252
  'games/registrations/export': 'games/registrations/export',
@@ -229,9 +255,13 @@ export const PathnameRoute = Object.freeze(
229
255
  'games/theme/:theme/cover/:cover': 'games/theme/cover',
230
256
  'games/venue/:venue': 'games/venue',
231
257
  'registration/:registration': 'registration',
258
+ 'registration/:registration/status': 'registration/status',
259
+ 'registration/:registration/statuses': 'registration/statuses',
232
260
  'registration/:registration/creation': 'registration/creation',
233
261
  'registration/:registration/confirmation': 'registration/confirmation',
234
262
  'registration/:registration/cancellation': 'registration/cancellation',
263
+ 'registration/:registration/lineup': 'registration/lineup',
264
+ 'registration/:registration/lineups': 'registration/lineups',
235
265
  'registration/:registration/allocation': 'registration/allocation',
236
266
  'registration/:registration/reservation': 'registration/reservation',
237
267
  'registration/:registration/channel': 'registration/channel',
@@ -242,8 +272,11 @@ export const PathnameRoute = Object.freeze(
242
272
  'registration/:registration/game/:game/theme/:theme/cover/:cover': 'registration/game/theme/cover',
243
273
  'registration/:registration/game/:game/venue/:venue': 'registration/game/venue',
244
274
  'registrations': 'registrations',
275
+ 'registrations/status': 'registrations/status',
276
+ 'registrations/lineup': 'registrations/lineup',
245
277
  'registrations/city/:city': 'registrations/city',
246
278
  'registrations/game/:game': 'registrations/game',
279
+ 'registrations/game/:game/status': 'registrations/game/status',
247
280
  'registrations/game/:game/theme/:theme': 'registrations/game/theme',
248
281
  'registrations/export': 'registrations/export',
249
282
  'telegram/webhook': 'telegram/webhook',
@@ -359,15 +392,23 @@ export const PathnameParameters = Object.freeze(
359
392
  'game/:game': [
360
393
  ':game',
361
394
  ],
395
+ 'game/:game/status': [
396
+ ':game',
397
+ ],
398
+ 'game/:game/statuses': [
399
+ ':game',
400
+ ],
362
401
  'game/:game/city/:city': [
363
402
  ':game',
364
403
  ':city',
365
404
  ],
366
- 'game/:game/registration/:registration': [
405
+ 'game/:game/registrations': [
406
+ ':game',
407
+ ],
408
+ 'game/:game/registrations/status': [
367
409
  ':game',
368
- ':registration',
369
410
  ],
370
- 'game/:game/registrations': [
411
+ 'game/:game/registrations/lineup': [
371
412
  ':game',
372
413
  ],
373
414
  'game/:game/registrations/export': [
@@ -390,6 +431,7 @@ export const PathnameParameters = Object.freeze(
390
431
  ':venue',
391
432
  ],
392
433
  'games': [],
434
+ 'games/status': [],
393
435
  'games/city/:city': [
394
436
  ':city',
395
437
  ],
@@ -409,6 +451,12 @@ export const PathnameParameters = Object.freeze(
409
451
  'registration/:registration': [
410
452
  ':registration',
411
453
  ],
454
+ 'registration/:registration/status': [
455
+ ':registration',
456
+ ],
457
+ 'registration/:registration/statuses': [
458
+ ':registration',
459
+ ],
412
460
  'registration/:registration/creation': [
413
461
  ':registration',
414
462
  ],
@@ -418,6 +466,12 @@ export const PathnameParameters = Object.freeze(
418
466
  'registration/:registration/cancellation': [
419
467
  ':registration',
420
468
  ],
469
+ 'registration/:registration/lineup': [
470
+ ':registration',
471
+ ],
472
+ 'registration/:registration/lineups': [
473
+ ':registration',
474
+ ],
421
475
  'registration/:registration/allocation': [
422
476
  ':registration',
423
477
  ],
@@ -455,12 +509,17 @@ export const PathnameParameters = Object.freeze(
455
509
  ':venue',
456
510
  ],
457
511
  'registrations': [],
512
+ 'registrations/status': [],
513
+ 'registrations/lineup': [],
458
514
  'registrations/city/:city': [
459
515
  ':city',
460
516
  ],
461
517
  'registrations/game/:game': [
462
518
  ':game',
463
519
  ],
520
+ 'registrations/game/:game/status': [
521
+ ':game',
522
+ ],
464
523
  'registrations/game/:game/theme/:theme': [
465
524
  ':game',
466
525
  ':theme',
@@ -541,15 +600,19 @@ export const RouteBreakdown = Object.freeze(
541
600
  'themes/cover': 'theme/cover',
542
601
  'themes/games': 'theme/games',
543
602
  'game': 'game',
603
+ 'game/status': 'game/status',
604
+ 'game/statuses': 'game/statuses',
544
605
  'game/city': 'game/city',
545
- 'game/registration': 'game/registration',
546
606
  'game/registrations': 'game/registrations',
607
+ 'game/registrations/status': 'game/registrations/status',
608
+ 'game/registrations/lineup': 'game/registrations/lineup',
547
609
  'game/registrations/export': 'game/registrations/export',
548
610
  'game/summary': 'game/summary',
549
611
  'game/theme': 'game/theme',
550
612
  'game/theme/cover': 'game/theme/cover',
551
613
  'game/venue': 'game/venue',
552
614
  'games': 'game',
615
+ 'games/status': 'game/status',
553
616
  'games/city': 'game/city',
554
617
  'games/registrations': 'game/registrations',
555
618
  'games/registrations/export': 'game/registrations/export',
@@ -558,9 +621,13 @@ export const RouteBreakdown = Object.freeze(
558
621
  'games/theme/cover': 'game/theme/cover',
559
622
  'games/venue': 'game/venue',
560
623
  'registration': 'registration',
624
+ 'registration/status': 'registration/status',
625
+ 'registration/statuses': 'registration/statuses',
561
626
  'registration/creation': 'registration/creation',
562
627
  'registration/confirmation': 'registration/confirmation',
563
628
  'registration/cancellation': 'registration/cancellation',
629
+ 'registration/lineup': 'registration/lineup',
630
+ 'registration/lineups': 'registration/lineups',
564
631
  'registration/allocation': 'registration/allocation',
565
632
  'registration/reservation': 'registration/reservation',
566
633
  'registration/channel': 'registration/channel',
@@ -571,8 +638,11 @@ export const RouteBreakdown = Object.freeze(
571
638
  'registration/game/theme/cover': 'registration/game/theme/cover',
572
639
  'registration/game/venue': 'registration/game/venue',
573
640
  'registrations': 'registration',
641
+ 'registrations/status': 'registration/status',
642
+ 'registrations/lineup': 'registration/lineup',
574
643
  'registrations/city': 'registration/city',
575
644
  'registrations/game': 'registration/game',
645
+ 'registrations/game/status': 'registration/game/status',
576
646
  'registrations/game/theme': 'registration/game/theme',
577
647
  'registrations/export': 'registration/export',
578
648
  'telegram/webhook': 'telegram/webhook',
@@ -626,15 +696,19 @@ export const RouteService = Object.freeze(
626
696
  'themes/cover': 'Themes',
627
697
  'themes/games': 'Themes',
628
698
  'game': 'Games',
699
+ 'game/status': 'Games',
700
+ 'game/statuses': 'Games',
629
701
  'game/city': 'Games',
630
- 'game/registration': 'Games',
631
702
  'game/registrations': 'Games',
703
+ 'game/registrations/status': 'Games',
704
+ 'game/registrations/lineup': 'Games',
632
705
  'game/registrations/export': 'Games',
633
706
  'game/summary': 'Games',
634
707
  'game/theme': 'Games',
635
708
  'game/theme/cover': 'Games',
636
709
  'game/venue': 'Games',
637
710
  'games': 'Games',
711
+ 'games/status': 'Games',
638
712
  'games/city': 'Games',
639
713
  'games/registrations': 'Games',
640
714
  'games/registrations/export': 'Games',
@@ -643,9 +717,13 @@ export const RouteService = Object.freeze(
643
717
  'games/theme/cover': 'Games',
644
718
  'games/venue': 'Games',
645
719
  'registration': 'Registrations',
720
+ 'registration/status': 'Registrations',
721
+ 'registration/statuses': 'Registrations',
646
722
  'registration/creation': 'Registrations',
647
723
  'registration/confirmation': 'Registrations',
648
724
  'registration/cancellation': 'Registrations',
725
+ 'registration/lineup': 'Registrations',
726
+ 'registration/lineups': 'Registrations',
649
727
  'registration/allocation': 'Registrations',
650
728
  'registration/reservation': 'Registrations',
651
729
  'registration/channel': 'Registrations',
@@ -656,8 +734,11 @@ export const RouteService = Object.freeze(
656
734
  'registration/game/theme/cover': 'Registrations',
657
735
  'registration/game/venue': 'Registrations',
658
736
  'registrations': 'Registrations',
737
+ 'registrations/status': 'Registrations',
738
+ 'registrations/lineup': 'Registrations',
659
739
  'registrations/city': 'Registrations',
660
740
  'registrations/game': 'Registrations',
741
+ 'registrations/game/status': 'Registrations',
661
742
  'registrations/game/theme': 'Registrations',
662
743
  'registrations/export': 'Registrations',
663
744
  'telegram/webhook': 'Telegram',
@@ -726,15 +807,19 @@ export const ServiceRoutes = Object.freeze(
726
807
  ],
727
808
  'Games': [
728
809
  'game',
810
+ 'game/status',
811
+ 'game/statuses',
729
812
  'game/city',
730
- 'game/registration',
731
813
  'game/registrations',
814
+ 'game/registrations/status',
815
+ 'game/registrations/lineup',
732
816
  'game/registrations/export',
733
817
  'game/summary',
734
818
  'game/theme',
735
819
  'game/theme/cover',
736
820
  'game/venue',
737
821
  'games',
822
+ 'games/status',
738
823
  'games/city',
739
824
  'games/registrations',
740
825
  'games/registrations/export',
@@ -745,9 +830,13 @@ export const ServiceRoutes = Object.freeze(
745
830
  ],
746
831
  'Registrations': [
747
832
  'registration',
833
+ 'registration/status',
834
+ 'registration/statuses',
748
835
  'registration/creation',
749
836
  'registration/confirmation',
750
837
  'registration/cancellation',
838
+ 'registration/lineup',
839
+ 'registration/lineups',
751
840
  'registration/allocation',
752
841
  'registration/reservation',
753
842
  'registration/channel',
@@ -758,8 +847,11 @@ export const ServiceRoutes = Object.freeze(
758
847
  'registration/game/theme/cover',
759
848
  'registration/game/venue',
760
849
  'registrations',
850
+ 'registrations/status',
851
+ 'registrations/lineup',
761
852
  'registrations/city',
762
853
  'registrations/game',
854
+ 'registrations/game/status',
763
855
  'registrations/game/theme',
764
856
  'registrations/export',
765
857
  ],
@@ -28,9 +28,13 @@ export const Keys = Object.freeze(
28
28
  'summary',
29
29
  'mailing',
30
30
  'channel',
31
+ 'status',
32
+ 'statuses',
31
33
  'creation',
32
34
  'confirmation',
33
35
  'cancellation',
36
+ 'lineup',
37
+ 'lineups',
34
38
  'allocation',
35
39
  'reservation',
36
40
  'telegram',
@@ -1,16 +1,19 @@
1
- export const Role = Object.freeze({
2
- 'admin': 'admin',
3
- 'organizer': 'organizer',
4
- 'captain': 'captain',
5
- 'player': 'player',
6
- 'user': 'user',
7
- 'manager': 'manager',
8
- })
1
+ export const Roles = Object.freeze(
2
+ /** @type {const} */ ([
3
+ 'admin',
4
+ 'captain',
5
+ 'player',
6
+ 'user',
7
+ 'manager',
8
+ 'Service',
9
+ ]),
10
+ )
9
11
 
10
- export const Roles = Object.freeze([
11
- 'admin',
12
- 'captain',
13
- 'player',
14
- 'user',
15
- 'manager',
16
- ])
12
+ export const Role = Object.freeze(
13
+ /** @type {{ [x in typeof Roles[number]]: x }} */ (
14
+ Roles.reduce(
15
+ (o, x) => (o[x] = x, o),
16
+ {},
17
+ )
18
+ ),
19
+ )
@@ -40,15 +40,19 @@ export const Routes = Object.freeze(
40
40
  'themes/cover',
41
41
  'themes/games',
42
42
  'game',
43
+ 'game/status',
44
+ 'game/statuses',
43
45
  'game/city',
44
- 'game/registration',
45
46
  'game/registrations',
47
+ 'game/registrations/status',
48
+ 'game/registrations/lineup',
46
49
  'game/registrations/export',
47
50
  'game/summary',
48
51
  'game/theme',
49
52
  'game/theme/cover',
50
53
  'game/venue',
51
54
  'games',
55
+ 'games/status',
52
56
  'games/city',
53
57
  'games/registrations',
54
58
  'games/registrations/export',
@@ -57,9 +61,13 @@ export const Routes = Object.freeze(
57
61
  'games/theme/cover',
58
62
  'games/venue',
59
63
  'registration',
64
+ 'registration/status',
65
+ 'registration/statuses',
60
66
  'registration/creation',
61
67
  'registration/confirmation',
62
68
  'registration/cancellation',
69
+ 'registration/lineup',
70
+ 'registration/lineups',
63
71
  'registration/allocation',
64
72
  'registration/reservation',
65
73
  'registration/channel',
@@ -70,8 +78,11 @@ export const Routes = Object.freeze(
70
78
  'registration/game/theme/cover',
71
79
  'registration/game/venue',
72
80
  'registrations',
81
+ 'registrations/status',
82
+ 'registrations/lineup',
73
83
  'registrations/city',
74
84
  'registrations/game',
85
+ 'registrations/game/status',
75
86
  'registrations/game/theme',
76
87
  'registrations/export',
77
88
  'telegram/webhook',
@@ -256,6 +256,24 @@ export const Segments = Object.freeze(
256
256
  pattern: undefined,
257
257
  }),
258
258
  ),
259
+ Object.freeze(
260
+ /** @type {const} */ ({
261
+ key: Key['status'],
262
+ cardinality: '1',
263
+ relation: Key['statuses'],
264
+ service: undefined,
265
+ pattern: undefined,
266
+ }),
267
+ ),
268
+ Object.freeze(
269
+ /** @type {const} */ ({
270
+ key: Key['statuses'],
271
+ cardinality: 'n',
272
+ relation: Key['status'],
273
+ service: undefined,
274
+ pattern: undefined,
275
+ }),
276
+ ),
259
277
  Object.freeze(
260
278
  /** @type {const} */ ({
261
279
  key: Key['creation'],
@@ -283,6 +301,24 @@ export const Segments = Object.freeze(
283
301
  pattern: undefined,
284
302
  }),
285
303
  ),
304
+ Object.freeze(
305
+ /** @type {const} */ ({
306
+ key: Key['lineup'],
307
+ cardinality: '1',
308
+ relation: Key['lineups'],
309
+ service: undefined,
310
+ pattern: undefined,
311
+ }),
312
+ ),
313
+ Object.freeze(
314
+ /** @type {const} */ ({
315
+ key: Key['lineups'],
316
+ cardinality: 'n',
317
+ relation: Key['lineup'],
318
+ service: undefined,
319
+ pattern: undefined,
320
+ }),
321
+ ),
286
322
  Object.freeze(
287
323
  /** @type {const} */ ({
288
324
  key: Key['allocation'],