@shakerquiz/utilities 4.0.37 → 4.0.39

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.37",
4
+ "version": "4.0.39",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -21,18 +21,14 @@ let parameters = pathname =>
21
21
  .split('/')
22
22
  .filter(x => x.includes(':'))
23
23
 
24
- let breakdown = route =>
25
- route
26
- .split('/')
27
- .map((x, i) => {
28
- if (i > 0)
29
- return x
30
- else if (Segment[x].cardinality === '1')
31
- return x
32
- else
33
- return Segment[x].relation
34
- })
24
+ let breakdown = route => {
25
+ let segments = route.split('/')
26
+
27
+ return segments
28
+ .slice(segments.length >= 3 ? -2 : 0)
29
+ .map(x => Segment[x].cardinality === '1' ? x : Segment[x].relation)
35
30
  .join('/')
31
+ }
36
32
 
37
33
  let service = route =>
38
34
  route
@@ -44,8 +44,8 @@ export const RouteExcessiveCardinality = Object.freeze(
44
44
  'themes/games': 'n/n',
45
45
  'game': '1',
46
46
  'game/status': '1/1',
47
- 'game/statuses': '1/n',
48
47
  'game/city': '1/1',
48
+ 'game/registration': '1/1',
49
49
  'game/registrations': '1/n',
50
50
  'game/registrations/status': '1/n/1',
51
51
  'game/registrations/lineup': '1/n/1',
@@ -65,12 +65,10 @@ export const RouteExcessiveCardinality = Object.freeze(
65
65
  'games/venue': 'n/1',
66
66
  'registration': '1',
67
67
  'registration/status': '1/1',
68
- 'registration/statuses': '1/n',
69
68
  'registration/creation': '1/1',
70
69
  'registration/confirmation': '1/1',
71
70
  'registration/cancellation': '1/1',
72
71
  'registration/lineup': '1/1',
73
- 'registration/lineups': '1/n',
74
72
  'registration/channel': '1/1',
75
73
  'registration/export': '1/1',
76
74
  'registration/city': '1/1',
@@ -140,8 +138,8 @@ export const RouteCardinality = Object.freeze(
140
138
  'themes/games': 'n/n',
141
139
  'game': '1',
142
140
  'game/status': '1/1',
143
- 'game/statuses': '1/n',
144
141
  'game/city': '1/1',
142
+ 'game/registration': '1/1',
145
143
  'game/registrations': '1/n',
146
144
  'game/registrations/status': '1/1',
147
145
  'game/registrations/lineup': '1/1',
@@ -161,12 +159,10 @@ export const RouteCardinality = Object.freeze(
161
159
  'games/venue': 'n/1',
162
160
  'registration': '1',
163
161
  'registration/status': '1/1',
164
- 'registration/statuses': '1/n',
165
162
  'registration/creation': '1/1',
166
163
  'registration/confirmation': '1/1',
167
164
  'registration/cancellation': '1/1',
168
165
  'registration/lineup': '1/1',
169
- 'registration/lineups': '1/n',
170
166
  'registration/channel': '1/1',
171
167
  'registration/export': '1/1',
172
168
  'registration/city': '1/1',
@@ -236,8 +232,8 @@ export const RoutePathname = Object.freeze(
236
232
  'themes/games': 'themes/games',
237
233
  'game': 'game/:game',
238
234
  'game/status': 'game/:game/status/:status',
239
- 'game/statuses': 'game/:game/statuses',
240
235
  'game/city': 'game/:game/city/:city',
236
+ 'game/registration': 'game/:game/registration/:registration',
241
237
  'game/registrations': 'game/:game/registrations',
242
238
  'game/registrations/status': 'game/:game/registrations/status/:status',
243
239
  'game/registrations/lineup': 'game/:game/registrations/lineup',
@@ -257,12 +253,10 @@ export const RoutePathname = Object.freeze(
257
253
  'games/venue': 'games/venue/:venue',
258
254
  'registration': 'registration/:registration',
259
255
  'registration/status': 'registration/:registration/status/:status',
260
- 'registration/statuses': 'registration/:registration/statuses',
261
256
  'registration/creation': 'registration/:registration/creation',
262
257
  'registration/confirmation': 'registration/:registration/confirmation',
263
258
  'registration/cancellation': 'registration/:registration/cancellation',
264
259
  'registration/lineup': 'registration/:registration/lineup',
265
- 'registration/lineups': 'registration/:registration/lineups',
266
260
  'registration/channel': 'registration/:registration/channel',
267
261
  'registration/export': 'registration/:registration/export',
268
262
  'registration/city': 'registration/:registration/city/:city',
@@ -399,13 +393,14 @@ export const RouteParameters = Object.freeze(
399
393
  ':game',
400
394
  ':status',
401
395
  ],
402
- 'game/statuses': [
403
- ':game',
404
- ],
405
396
  'game/city': [
406
397
  ':game',
407
398
  ':city',
408
399
  ],
400
+ 'game/registration': [
401
+ ':game',
402
+ ':registration',
403
+ ],
409
404
  'game/registrations': [
410
405
  ':game',
411
406
  ],
@@ -462,9 +457,6 @@ export const RouteParameters = Object.freeze(
462
457
  ':registration',
463
458
  ':status',
464
459
  ],
465
- 'registration/statuses': [
466
- ':registration',
467
- ],
468
460
  'registration/creation': [
469
461
  ':registration',
470
462
  ],
@@ -477,9 +469,6 @@ export const RouteParameters = Object.freeze(
477
469
  'registration/lineup': [
478
470
  ':registration',
479
471
  ],
480
- 'registration/lineups': [
481
- ':registration',
482
- ],
483
472
  'registration/channel': [
484
473
  ':registration',
485
474
  ],
@@ -592,8 +581,8 @@ export const PathnameRoute = Object.freeze(
592
581
  'themes/games': 'themes/games',
593
582
  'game/:game': 'game',
594
583
  'game/:game/status/:status': 'game/status',
595
- 'game/:game/statuses': 'game/statuses',
596
584
  'game/:game/city/:city': 'game/city',
585
+ 'game/:game/registration/:registration': 'game/registration',
597
586
  'game/:game/registrations': 'game/registrations',
598
587
  'game/:game/registrations/status/:status': 'game/registrations/status',
599
588
  'game/:game/registrations/lineup': 'game/registrations/lineup',
@@ -613,12 +602,10 @@ export const PathnameRoute = Object.freeze(
613
602
  'games/venue/:venue': 'games/venue',
614
603
  'registration/:registration': 'registration',
615
604
  'registration/:registration/status/:status': 'registration/status',
616
- 'registration/:registration/statuses': 'registration/statuses',
617
605
  'registration/:registration/creation': 'registration/creation',
618
606
  'registration/:registration/confirmation': 'registration/confirmation',
619
607
  'registration/:registration/cancellation': 'registration/cancellation',
620
608
  'registration/:registration/lineup': 'registration/lineup',
621
- 'registration/:registration/lineups': 'registration/lineups',
622
609
  'registration/:registration/channel': 'registration/channel',
623
610
  'registration/:registration/export': 'registration/export',
624
611
  'registration/:registration/city/:city': 'registration/city',
@@ -755,13 +742,14 @@ export const PathnameParameters = Object.freeze(
755
742
  ':game',
756
743
  ':status',
757
744
  ],
758
- 'game/:game/statuses': [
759
- ':game',
760
- ],
761
745
  'game/:game/city/:city': [
762
746
  ':game',
763
747
  ':city',
764
748
  ],
749
+ 'game/:game/registration/:registration': [
750
+ ':game',
751
+ ':registration',
752
+ ],
765
753
  'game/:game/registrations': [
766
754
  ':game',
767
755
  ],
@@ -818,9 +806,6 @@ export const PathnameParameters = Object.freeze(
818
806
  ':registration',
819
807
  ':status',
820
808
  ],
821
- 'registration/:registration/statuses': [
822
- ':registration',
823
- ],
824
809
  'registration/:registration/creation': [
825
810
  ':registration',
826
811
  ],
@@ -833,9 +818,6 @@ export const PathnameParameters = Object.freeze(
833
818
  'registration/:registration/lineup': [
834
819
  ':registration',
835
820
  ],
836
- 'registration/:registration/lineups': [
837
- ':registration',
838
- ],
839
821
  'registration/:registration/channel': [
840
822
  ':registration',
841
823
  ],
@@ -929,24 +911,24 @@ export const RouteBreakdown = Object.freeze(
929
911
  'user/password': 'user/password',
930
912
  'user/role': 'user/role',
931
913
  'user/city': 'user/city',
932
- 'user/cities': 'user/cities',
914
+ 'user/cities': 'user/city',
933
915
  'users': 'user',
934
916
  'users/password': 'user/password',
935
917
  'users/role': 'user/role',
936
- 'users/cities': 'user/cities',
918
+ 'users/cities': 'user/city',
937
919
  'checkin': 'checkin',
938
920
  'cities': 'city',
939
921
  'cities/country': 'city/country',
940
922
  'cities/currency': 'city/currency',
941
923
  'cities/timezone': 'city/timezone',
942
- 'cities/venues': 'city/venues',
924
+ 'cities/venues': 'city/venue',
943
925
  'city': 'city',
944
926
  'city/vk_group_token': 'city/vk_group_token',
945
927
  'city/country': 'city/country',
946
928
  'city/currency': 'city/currency',
947
929
  'city/timezone': 'city/timezone',
948
930
  'city/venue': 'city/venue',
949
- 'city/venues': 'city/venues',
931
+ 'city/venues': 'city/venue',
950
932
  'country': 'country',
951
933
  'countries': 'country',
952
934
  'currency': 'currency',
@@ -962,56 +944,54 @@ export const RouteBreakdown = Object.freeze(
962
944
  'theme/cover': 'theme/cover',
963
945
  'themes': 'theme',
964
946
  'themes/cover': 'theme/cover',
965
- 'themes/games': 'theme/games',
947
+ 'themes/games': 'theme/game',
966
948
  'game': 'game',
967
949
  'game/status': 'game/status',
968
- 'game/statuses': 'game/statuses',
969
950
  'game/city': 'game/city',
970
- 'game/registrations': 'game/registrations',
971
- 'game/registrations/status': 'game/registrations/status',
972
- 'game/registrations/lineup': 'game/registrations/lineup',
973
- 'game/registrations/export': 'game/registrations/export',
951
+ 'game/registration': 'game/registration',
952
+ 'game/registrations': 'game/registration',
953
+ 'game/registrations/status': 'registration/status',
954
+ 'game/registrations/lineup': 'registration/lineup',
955
+ 'game/registrations/export': 'registration/export',
974
956
  'game/summary': 'game/summary',
975
957
  'game/theme': 'game/theme',
976
- 'game/theme/cover': 'game/theme/cover',
958
+ 'game/theme/cover': 'theme/cover',
977
959
  'game/venue': 'game/venue',
978
960
  'games': 'game',
979
961
  'games/status': 'game/status',
980
962
  'games/city': 'game/city',
981
- 'games/registrations': 'game/registrations',
982
- 'games/registrations/export': 'game/registrations/export',
963
+ 'games/registrations': 'game/registration',
964
+ 'games/registrations/export': 'registration/export',
983
965
  'games/summary': 'game/summary',
984
966
  'games/theme': 'game/theme',
985
- 'games/theme/cover': 'game/theme/cover',
967
+ 'games/theme/cover': 'theme/cover',
986
968
  'games/venue': 'game/venue',
987
969
  'registration': 'registration',
988
970
  'registration/status': 'registration/status',
989
- 'registration/statuses': 'registration/statuses',
990
971
  'registration/creation': 'registration/creation',
991
972
  'registration/confirmation': 'registration/confirmation',
992
973
  'registration/cancellation': 'registration/cancellation',
993
974
  'registration/lineup': 'registration/lineup',
994
- 'registration/lineups': 'registration/lineups',
995
975
  'registration/channel': 'registration/channel',
996
976
  'registration/export': 'registration/export',
997
977
  'registration/city': 'registration/city',
998
978
  'registration/game': 'registration/game',
999
- 'registration/game/theme': 'registration/game/theme',
1000
- 'registration/game/theme/cover': 'registration/game/theme/cover',
1001
- 'registration/game/venue': 'registration/game/venue',
979
+ 'registration/game/theme': 'game/theme',
980
+ 'registration/game/theme/cover': 'theme/cover',
981
+ 'registration/game/venue': 'game/venue',
1002
982
  'registrations': 'registration',
1003
983
  'registrations/status': 'registration/status',
1004
984
  'registrations/lineup': 'registration/lineup',
1005
985
  'registrations/city': 'registration/city',
1006
986
  'registrations/game': 'registration/game',
1007
- 'registrations/game/status': 'registration/game/status',
1008
- 'registrations/game/theme': 'registration/game/theme',
987
+ 'registrations/game/status': 'game/status',
988
+ 'registrations/game/theme': 'game/theme',
1009
989
  'registrations/export': 'registration/export',
1010
990
  'telegram/webhook': 'telegram/webhook',
1011
- 'telegram/registration/mailing': 'telegram/registration/mailing',
991
+ 'telegram/registration/mailing': 'registration/mailing',
1012
992
  'chatapp/webhook': 'chatapp/webhook',
1013
993
  'chatapp/registration': 'chatapp/registration',
1014
- 'chatapp/registration/mailing': 'chatapp/registration/mailing',
994
+ 'chatapp/registration/mailing': 'registration/mailing',
1015
995
  'bitrix/registration': 'bitrix/registration',
1016
996
  'source': 'source',
1017
997
  }),
@@ -1061,8 +1041,8 @@ export const RouteService = Object.freeze(
1061
1041
  'themes/games': 'Themes',
1062
1042
  'game': 'Games',
1063
1043
  'game/status': 'Games',
1064
- 'game/statuses': 'Games',
1065
1044
  'game/city': 'Games',
1045
+ 'game/registration': 'Games',
1066
1046
  'game/registrations': 'Games',
1067
1047
  'game/registrations/status': 'Games',
1068
1048
  'game/registrations/lineup': 'Games',
@@ -1082,12 +1062,10 @@ export const RouteService = Object.freeze(
1082
1062
  'games/venue': 'Games',
1083
1063
  'registration': 'Registrations',
1084
1064
  'registration/status': 'Registrations',
1085
- 'registration/statuses': 'Registrations',
1086
1065
  'registration/creation': 'Registrations',
1087
1066
  'registration/confirmation': 'Registrations',
1088
1067
  'registration/cancellation': 'Registrations',
1089
1068
  'registration/lineup': 'Registrations',
1090
- 'registration/lineups': 'Registrations',
1091
1069
  'registration/channel': 'Registrations',
1092
1070
  'registration/export': 'Registrations',
1093
1071
  'registration/city': 'Registrations',
@@ -1174,8 +1152,8 @@ export const ServiceRoutes = Object.freeze(
1174
1152
  'Games': [
1175
1153
  'game',
1176
1154
  'game/status',
1177
- 'game/statuses',
1178
1155
  'game/city',
1156
+ 'game/registration',
1179
1157
  'game/registrations',
1180
1158
  'game/registrations/status',
1181
1159
  'game/registrations/lineup',
@@ -1197,12 +1175,10 @@ export const ServiceRoutes = Object.freeze(
1197
1175
  'Registrations': [
1198
1176
  'registration',
1199
1177
  'registration/status',
1200
- 'registration/statuses',
1201
1178
  'registration/creation',
1202
1179
  'registration/confirmation',
1203
1180
  'registration/cancellation',
1204
1181
  'registration/lineup',
1205
- 'registration/lineups',
1206
1182
  'registration/channel',
1207
1183
  'registration/export',
1208
1184
  'registration/city',
@@ -42,8 +42,8 @@ export const Routes = Object.freeze(
42
42
  'themes/games',
43
43
  'game',
44
44
  'game/status',
45
- 'game/statuses',
46
45
  'game/city',
46
+ 'game/registration',
47
47
  'game/registrations',
48
48
  'game/registrations/status',
49
49
  'game/registrations/lineup',
@@ -63,12 +63,10 @@ export const Routes = Object.freeze(
63
63
  'games/venue',
64
64
  'registration',
65
65
  'registration/status',
66
- 'registration/statuses',
67
66
  'registration/creation',
68
67
  'registration/confirmation',
69
68
  'registration/cancellation',
70
69
  'registration/lineup',
71
- 'registration/lineups',
72
70
  'registration/channel',
73
71
  'registration/export',
74
72
  'registration/city',