@shakerquiz/utilities 4.0.41 → 4.0.42

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.41",
4
+ "version": "4.0.42",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -21,14 +21,27 @@ let parameters = pathname =>
21
21
  .split('/')
22
22
  .filter(x => x.includes(':'))
23
23
 
24
- let breakdown = route => {
25
- let segments = route.split('/')
24
+ // let breakdown = route => {
25
+ // let segments = route.split('/')
26
26
 
27
- return segments
28
- .slice(segments.length >= 3 ? -2 : 0)
29
- .map(x => Segment[x].cardinality === '1' ? x : Segment[x].relation)
27
+ // return segments
28
+ // .slice(segments.length >= 3 ? -2 : 0)
29
+ // .map(x => Segment[x].cardinality === '1' ? x : Segment[x].relation)
30
+ // .join('/')
31
+ // }
32
+
33
+ let breakdown = route =>
34
+ route
35
+ .split('/')
36
+ .map((x, i) => {
37
+ if (i > 0)
38
+ return x
39
+ else if (Segment[x].cardinality === '1')
40
+ return x
41
+ else
42
+ return Segment[x].relation
43
+ })
30
44
  .join('/')
31
- }
32
45
 
33
46
  let service = route =>
34
47
  route
@@ -44,9 +44,12 @@ export const RouteExcessiveCardinality = Object.freeze(
44
44
  'themes/cover': 'n/1',
45
45
  'themes/games': 'n/n',
46
46
  'game': '1',
47
+ 'game/id': '1/1',
47
48
  'game/status': '1/1',
48
49
  'game/city': '1/1',
49
50
  'game/registration': '1/1',
51
+ 'game/registration/status': '1/1/1',
52
+ 'game/registration/lineup': '1/1/1',
50
53
  'game/registrations': '1/n',
51
54
  'game/registrations/status': '1/n/1',
52
55
  'game/registrations/lineup': '1/n/1',
@@ -139,9 +142,12 @@ export const RouteCardinality = Object.freeze(
139
142
  'themes/cover': 'n/1',
140
143
  'themes/games': 'n/n',
141
144
  'game': '1',
145
+ 'game/id': '1/1',
142
146
  'game/status': '1/1',
143
147
  'game/city': '1/1',
144
148
  'game/registration': '1/1',
149
+ 'game/registration/status': '1/1',
150
+ 'game/registration/lineup': '1/1',
145
151
  'game/registrations': '1/n',
146
152
  'game/registrations/status': '1/1',
147
153
  'game/registrations/lineup': '1/1',
@@ -234,9 +240,12 @@ export const RoutePathname = Object.freeze(
234
240
  'themes/cover': 'themes/cover/:cover',
235
241
  'themes/games': 'themes/games',
236
242
  'game': 'game/:game',
243
+ 'game/id': 'game/:game/id',
237
244
  'game/status': 'game/:game/status/:status',
238
245
  'game/city': 'game/:game/city/:city',
239
246
  'game/registration': 'game/:game/registration/:registration',
247
+ 'game/registration/status': 'game/:game/registration/:registration/status/:status',
248
+ 'game/registration/lineup': 'game/:game/registration/:registration/lineup',
240
249
  'game/registrations': 'game/:game/registrations',
241
250
  'game/registrations/status': 'game/:game/registrations/status/:status',
242
251
  'game/registrations/lineup': 'game/:game/registrations/lineup',
@@ -395,6 +404,9 @@ export const RouteParameters = Object.freeze(
395
404
  'game': [
396
405
  ':game',
397
406
  ],
407
+ 'game/id': [
408
+ ':game',
409
+ ],
398
410
  'game/status': [
399
411
  ':game',
400
412
  ':status',
@@ -407,6 +419,15 @@ export const RouteParameters = Object.freeze(
407
419
  ':game',
408
420
  ':registration',
409
421
  ],
422
+ 'game/registration/status': [
423
+ ':game',
424
+ ':registration',
425
+ ':status',
426
+ ],
427
+ 'game/registration/lineup': [
428
+ ':game',
429
+ ':registration',
430
+ ],
410
431
  'game/registrations': [
411
432
  ':game',
412
433
  ],
@@ -587,9 +608,12 @@ export const PathnameRoute = Object.freeze(
587
608
  'themes/cover/:cover': 'themes/cover',
588
609
  'themes/games': 'themes/games',
589
610
  'game/:game': 'game',
611
+ 'game/:game/id': 'game/id',
590
612
  'game/:game/status/:status': 'game/status',
591
613
  'game/:game/city/:city': 'game/city',
592
614
  'game/:game/registration/:registration': 'game/registration',
615
+ 'game/:game/registration/:registration/status/:status': 'game/registration/status',
616
+ 'game/:game/registration/:registration/lineup': 'game/registration/lineup',
593
617
  'game/:game/registrations': 'game/registrations',
594
618
  'game/:game/registrations/status/:status': 'game/registrations/status',
595
619
  'game/:game/registrations/lineup': 'game/registrations/lineup',
@@ -748,6 +772,9 @@ export const PathnameParameters = Object.freeze(
748
772
  'game/:game': [
749
773
  ':game',
750
774
  ],
775
+ 'game/:game/id': [
776
+ ':game',
777
+ ],
751
778
  'game/:game/status/:status': [
752
779
  ':game',
753
780
  ':status',
@@ -760,6 +787,15 @@ export const PathnameParameters = Object.freeze(
760
787
  ':game',
761
788
  ':registration',
762
789
  ],
790
+ 'game/:game/registration/:registration/status/:status': [
791
+ ':game',
792
+ ':registration',
793
+ ':status',
794
+ ],
795
+ 'game/:game/registration/:registration/lineup': [
796
+ ':game',
797
+ ':registration',
798
+ ],
763
799
  'game/:game/registrations': [
764
800
  ':game',
765
801
  ],
@@ -922,24 +958,24 @@ export const RouteBreakdown = Object.freeze(
922
958
  'user/password': 'user/password',
923
959
  'user/role': 'user/role',
924
960
  'user/city': 'user/city',
925
- 'user/cities': 'user/city',
961
+ 'user/cities': 'user/cities',
926
962
  'users': 'user',
927
963
  'users/password': 'user/password',
928
964
  'users/role': 'user/role',
929
- 'users/cities': 'user/city',
965
+ 'users/cities': 'user/cities',
930
966
  'checkin': 'checkin',
931
967
  'cities': 'city',
932
968
  'cities/country': 'city/country',
933
969
  'cities/currency': 'city/currency',
934
970
  'cities/timezone': 'city/timezone',
935
- 'cities/venues': 'city/venue',
971
+ 'cities/venues': 'city/venues',
936
972
  'city': 'city',
937
973
  'city/vk_group_token': 'city/vk_group_token',
938
974
  'city/country': 'city/country',
939
975
  'city/currency': 'city/currency',
940
976
  'city/timezone': 'city/timezone',
941
977
  'city/venue': 'city/venue',
942
- 'city/venues': 'city/venue',
978
+ 'city/venues': 'city/venues',
943
979
  'country': 'country',
944
980
  'countries': 'country',
945
981
  'currency': 'currency',
@@ -955,27 +991,30 @@ export const RouteBreakdown = Object.freeze(
955
991
  'theme/cover': 'theme/cover',
956
992
  'themes': 'theme',
957
993
  'themes/cover': 'theme/cover',
958
- 'themes/games': 'theme/game',
994
+ 'themes/games': 'theme/games',
959
995
  'game': 'game',
996
+ 'game/id': 'game/id',
960
997
  'game/status': 'game/status',
961
998
  'game/city': 'game/city',
962
999
  'game/registration': 'game/registration',
963
- 'game/registrations': 'game/registration',
964
- 'game/registrations/status': 'registration/status',
965
- 'game/registrations/lineup': 'registration/lineup',
966
- 'game/registrations/export': 'registration/export',
1000
+ 'game/registration/status': 'game/registration/status',
1001
+ 'game/registration/lineup': 'game/registration/lineup',
1002
+ 'game/registrations': 'game/registrations',
1003
+ 'game/registrations/status': 'game/registrations/status',
1004
+ 'game/registrations/lineup': 'game/registrations/lineup',
1005
+ 'game/registrations/export': 'game/registrations/export',
967
1006
  'game/summary': 'game/summary',
968
1007
  'game/theme': 'game/theme',
969
- 'game/theme/cover': 'theme/cover',
1008
+ 'game/theme/cover': 'game/theme/cover',
970
1009
  'game/venue': 'game/venue',
971
1010
  'games': 'game',
972
1011
  'games/status': 'game/status',
973
1012
  'games/city': 'game/city',
974
- 'games/registrations': 'game/registration',
975
- 'games/registrations/export': 'registration/export',
1013
+ 'games/registrations': 'game/registrations',
1014
+ 'games/registrations/export': 'game/registrations/export',
976
1015
  'games/summary': 'game/summary',
977
1016
  'games/theme': 'game/theme',
978
- 'games/theme/cover': 'theme/cover',
1017
+ 'games/theme/cover': 'game/theme/cover',
979
1018
  'games/venue': 'game/venue',
980
1019
  'registration': 'registration',
981
1020
  'registration/status': 'registration/status',
@@ -987,22 +1026,22 @@ export const RouteBreakdown = Object.freeze(
987
1026
  'registration/export': 'registration/export',
988
1027
  'registration/city': 'registration/city',
989
1028
  'registration/game': 'registration/game',
990
- 'registration/game/theme': 'game/theme',
991
- 'registration/game/theme/cover': 'theme/cover',
992
- 'registration/game/venue': 'game/venue',
1029
+ 'registration/game/theme': 'registration/game/theme',
1030
+ 'registration/game/theme/cover': 'registration/game/theme/cover',
1031
+ 'registration/game/venue': 'registration/game/venue',
993
1032
  'registrations': 'registration',
994
1033
  'registrations/status': 'registration/status',
995
1034
  'registrations/lineup': 'registration/lineup',
996
1035
  'registrations/city': 'registration/city',
997
1036
  'registrations/game': 'registration/game',
998
- 'registrations/game/status': 'game/status',
999
- 'registrations/game/theme': 'game/theme',
1037
+ 'registrations/game/status': 'registration/game/status',
1038
+ 'registrations/game/theme': 'registration/game/theme',
1000
1039
  'registrations/export': 'registration/export',
1001
1040
  'telegram/webhook': 'telegram/webhook',
1002
- 'telegram/registration/mailing': 'registration/mailing',
1041
+ 'telegram/registration/mailing': 'telegram/registration/mailing',
1003
1042
  'chatapp/webhook': 'chatapp/webhook',
1004
1043
  'chatapp/registration': 'chatapp/registration',
1005
- 'chatapp/registration/mailing': 'registration/mailing',
1044
+ 'chatapp/registration/mailing': 'chatapp/registration/mailing',
1006
1045
  'bitrix/registration': 'bitrix/registration',
1007
1046
  'source': 'source',
1008
1047
  }),
@@ -1052,9 +1091,12 @@ export const RouteService = Object.freeze(
1052
1091
  'themes/cover': 'Themes',
1053
1092
  'themes/games': 'Themes',
1054
1093
  'game': 'Games',
1094
+ 'game/id': 'Games',
1055
1095
  'game/status': 'Games',
1056
1096
  'game/city': 'Games',
1057
1097
  'game/registration': 'Games',
1098
+ 'game/registration/status': 'Games',
1099
+ 'game/registration/lineup': 'Games',
1058
1100
  'game/registrations': 'Games',
1059
1101
  'game/registrations/status': 'Games',
1060
1102
  'game/registrations/lineup': 'Games',
@@ -1164,9 +1206,12 @@ export const ServiceRoutes = Object.freeze(
1164
1206
  ],
1165
1207
  'Games': [
1166
1208
  'game',
1209
+ 'game/id',
1167
1210
  'game/status',
1168
1211
  'game/city',
1169
1212
  'game/registration',
1213
+ 'game/registration/status',
1214
+ 'game/registration/lineup',
1170
1215
  'game/registrations',
1171
1216
  'game/registrations/status',
1172
1217
  'game/registrations/lineup',
@@ -42,9 +42,12 @@ export const Routes = Object.freeze(
42
42
  'themes/cover',
43
43
  'themes/games',
44
44
  'game',
45
+ 'game/id',
45
46
  'game/status',
46
47
  'game/city',
47
48
  'game/registration',
49
+ 'game/registration/status',
50
+ 'game/registration/lineup',
48
51
  'game/registrations',
49
52
  'game/registrations/status',
50
53
  'game/registrations/lineup',