@shakerquiz/utilities 4.0.40 → 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.40",
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
@@ -5,9 +5,9 @@ export const RouteExcessiveCardinality = Object.freeze(
5
5
  'role': '1',
6
6
  'roles': 'n',
7
7
  'user': '1',
8
+ 'user/id': '1/1',
8
9
  'user/password': '1/1',
9
10
  'user/role': '1/1',
10
- 'user/role/id': '1/1/1',
11
11
  'user/city': '1/1',
12
12
  'user/cities': '1/n',
13
13
  'users': 'n',
@@ -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',
@@ -100,9 +103,9 @@ export const RouteCardinality = Object.freeze(
100
103
  'role': '1',
101
104
  'roles': 'n',
102
105
  'user': '1',
106
+ 'user/id': '1/1',
103
107
  'user/password': '1/1',
104
108
  'user/role': '1/1',
105
- 'user/role/id': '1/1',
106
109
  'user/city': '1/1',
107
110
  'user/cities': '1/n',
108
111
  'users': 'n',
@@ -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',
@@ -195,9 +201,9 @@ export const RoutePathname = Object.freeze(
195
201
  'role': 'role/:role',
196
202
  'roles': 'roles',
197
203
  'user': 'user/:user',
204
+ 'user/id': 'user/:user/id',
198
205
  'user/password': 'user/:user/password',
199
206
  'user/role': 'user/:user/role/:role',
200
- 'user/role/id': 'user/:user/role/:role/id',
201
207
  'user/city': 'user/:user/city/:city',
202
208
  'user/cities': 'user/:user/cities',
203
209
  'users': 'users',
@@ -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',
@@ -294,14 +303,13 @@ export const RouteParameters = Object.freeze(
294
303
  'user': [
295
304
  ':user',
296
305
  ],
297
- 'user/password': [
306
+ 'user/id': [
298
307
  ':user',
299
308
  ],
300
- 'user/role': [
309
+ 'user/password': [
301
310
  ':user',
302
- ':role',
303
311
  ],
304
- 'user/role/id': [
312
+ 'user/role': [
305
313
  ':user',
306
314
  ':role',
307
315
  ],
@@ -396,6 +404,9 @@ export const RouteParameters = Object.freeze(
396
404
  'game': [
397
405
  ':game',
398
406
  ],
407
+ 'game/id': [
408
+ ':game',
409
+ ],
399
410
  'game/status': [
400
411
  ':game',
401
412
  ':status',
@@ -408,6 +419,15 @@ export const RouteParameters = Object.freeze(
408
419
  ':game',
409
420
  ':registration',
410
421
  ],
422
+ 'game/registration/status': [
423
+ ':game',
424
+ ':registration',
425
+ ':status',
426
+ ],
427
+ 'game/registration/lineup': [
428
+ ':game',
429
+ ':registration',
430
+ ],
411
431
  'game/registrations': [
412
432
  ':game',
413
433
  ],
@@ -549,9 +569,9 @@ export const PathnameRoute = Object.freeze(
549
569
  'role/:role': 'role',
550
570
  'roles': 'roles',
551
571
  'user/:user': 'user',
572
+ 'user/:user/id': 'user/id',
552
573
  'user/:user/password': 'user/password',
553
574
  'user/:user/role/:role': 'user/role',
554
- 'user/:user/role/:role/id': 'user/role/id',
555
575
  'user/:user/city/:city': 'user/city',
556
576
  'user/:user/cities': 'user/cities',
557
577
  'users': 'users',
@@ -588,9 +608,12 @@ export const PathnameRoute = Object.freeze(
588
608
  'themes/cover/:cover': 'themes/cover',
589
609
  'themes/games': 'themes/games',
590
610
  'game/:game': 'game',
611
+ 'game/:game/id': 'game/id',
591
612
  'game/:game/status/:status': 'game/status',
592
613
  'game/:game/city/:city': 'game/city',
593
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',
594
617
  'game/:game/registrations': 'game/registrations',
595
618
  'game/:game/registrations/status/:status': 'game/registrations/status',
596
619
  'game/:game/registrations/lineup': 'game/registrations/lineup',
@@ -648,14 +671,13 @@ export const PathnameParameters = Object.freeze(
648
671
  'user/:user': [
649
672
  ':user',
650
673
  ],
651
- 'user/:user/password': [
674
+ 'user/:user/id': [
652
675
  ':user',
653
676
  ],
654
- 'user/:user/role/:role': [
677
+ 'user/:user/password': [
655
678
  ':user',
656
- ':role',
657
679
  ],
658
- 'user/:user/role/:role/id': [
680
+ 'user/:user/role/:role': [
659
681
  ':user',
660
682
  ':role',
661
683
  ],
@@ -750,6 +772,9 @@ export const PathnameParameters = Object.freeze(
750
772
  'game/:game': [
751
773
  ':game',
752
774
  ],
775
+ 'game/:game/id': [
776
+ ':game',
777
+ ],
753
778
  'game/:game/status/:status': [
754
779
  ':game',
755
780
  ':status',
@@ -762,6 +787,15 @@ export const PathnameParameters = Object.freeze(
762
787
  ':game',
763
788
  ':registration',
764
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
+ ],
765
799
  'game/:game/registrations': [
766
800
  ':game',
767
801
  ],
@@ -920,28 +954,28 @@ export const RouteBreakdown = Object.freeze(
920
954
  'role': 'role',
921
955
  'roles': 'role',
922
956
  'user': 'user',
957
+ 'user/id': 'user/id',
923
958
  'user/password': 'user/password',
924
959
  'user/role': 'user/role',
925
- 'user/role/id': 'role/id',
926
960
  'user/city': 'user/city',
927
- 'user/cities': 'user/city',
961
+ 'user/cities': 'user/cities',
928
962
  'users': 'user',
929
963
  'users/password': 'user/password',
930
964
  'users/role': 'user/role',
931
- 'users/cities': 'user/city',
965
+ 'users/cities': 'user/cities',
932
966
  'checkin': 'checkin',
933
967
  'cities': 'city',
934
968
  'cities/country': 'city/country',
935
969
  'cities/currency': 'city/currency',
936
970
  'cities/timezone': 'city/timezone',
937
- 'cities/venues': 'city/venue',
971
+ 'cities/venues': 'city/venues',
938
972
  'city': 'city',
939
973
  'city/vk_group_token': 'city/vk_group_token',
940
974
  'city/country': 'city/country',
941
975
  'city/currency': 'city/currency',
942
976
  'city/timezone': 'city/timezone',
943
977
  'city/venue': 'city/venue',
944
- 'city/venues': 'city/venue',
978
+ 'city/venues': 'city/venues',
945
979
  'country': 'country',
946
980
  'countries': 'country',
947
981
  'currency': 'currency',
@@ -957,27 +991,30 @@ export const RouteBreakdown = Object.freeze(
957
991
  'theme/cover': 'theme/cover',
958
992
  'themes': 'theme',
959
993
  'themes/cover': 'theme/cover',
960
- 'themes/games': 'theme/game',
994
+ 'themes/games': 'theme/games',
961
995
  'game': 'game',
996
+ 'game/id': 'game/id',
962
997
  'game/status': 'game/status',
963
998
  'game/city': 'game/city',
964
999
  'game/registration': 'game/registration',
965
- 'game/registrations': 'game/registration',
966
- 'game/registrations/status': 'registration/status',
967
- 'game/registrations/lineup': 'registration/lineup',
968
- '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',
969
1006
  'game/summary': 'game/summary',
970
1007
  'game/theme': 'game/theme',
971
- 'game/theme/cover': 'theme/cover',
1008
+ 'game/theme/cover': 'game/theme/cover',
972
1009
  'game/venue': 'game/venue',
973
1010
  'games': 'game',
974
1011
  'games/status': 'game/status',
975
1012
  'games/city': 'game/city',
976
- 'games/registrations': 'game/registration',
977
- 'games/registrations/export': 'registration/export',
1013
+ 'games/registrations': 'game/registrations',
1014
+ 'games/registrations/export': 'game/registrations/export',
978
1015
  'games/summary': 'game/summary',
979
1016
  'games/theme': 'game/theme',
980
- 'games/theme/cover': 'theme/cover',
1017
+ 'games/theme/cover': 'game/theme/cover',
981
1018
  'games/venue': 'game/venue',
982
1019
  'registration': 'registration',
983
1020
  'registration/status': 'registration/status',
@@ -989,22 +1026,22 @@ export const RouteBreakdown = Object.freeze(
989
1026
  'registration/export': 'registration/export',
990
1027
  'registration/city': 'registration/city',
991
1028
  'registration/game': 'registration/game',
992
- 'registration/game/theme': 'game/theme',
993
- 'registration/game/theme/cover': 'theme/cover',
994
- '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',
995
1032
  'registrations': 'registration',
996
1033
  'registrations/status': 'registration/status',
997
1034
  'registrations/lineup': 'registration/lineup',
998
1035
  'registrations/city': 'registration/city',
999
1036
  'registrations/game': 'registration/game',
1000
- 'registrations/game/status': 'game/status',
1001
- 'registrations/game/theme': 'game/theme',
1037
+ 'registrations/game/status': 'registration/game/status',
1038
+ 'registrations/game/theme': 'registration/game/theme',
1002
1039
  'registrations/export': 'registration/export',
1003
1040
  'telegram/webhook': 'telegram/webhook',
1004
- 'telegram/registration/mailing': 'registration/mailing',
1041
+ 'telegram/registration/mailing': 'telegram/registration/mailing',
1005
1042
  'chatapp/webhook': 'chatapp/webhook',
1006
1043
  'chatapp/registration': 'chatapp/registration',
1007
- 'chatapp/registration/mailing': 'registration/mailing',
1044
+ 'chatapp/registration/mailing': 'chatapp/registration/mailing',
1008
1045
  'bitrix/registration': 'bitrix/registration',
1009
1046
  'source': 'source',
1010
1047
  }),
@@ -1015,9 +1052,9 @@ export const RouteService = Object.freeze(
1015
1052
  'role': 'Roles',
1016
1053
  'roles': 'Roles',
1017
1054
  'user': 'Users',
1055
+ 'user/id': 'Users',
1018
1056
  'user/password': 'Users',
1019
1057
  'user/role': 'Users',
1020
- 'user/role/id': 'Users',
1021
1058
  'user/city': 'Users',
1022
1059
  'user/cities': 'Users',
1023
1060
  'users': 'Users',
@@ -1054,9 +1091,12 @@ export const RouteService = Object.freeze(
1054
1091
  'themes/cover': 'Themes',
1055
1092
  'themes/games': 'Themes',
1056
1093
  'game': 'Games',
1094
+ 'game/id': 'Games',
1057
1095
  'game/status': 'Games',
1058
1096
  'game/city': 'Games',
1059
1097
  'game/registration': 'Games',
1098
+ 'game/registration/status': 'Games',
1099
+ 'game/registration/lineup': 'Games',
1060
1100
  'game/registrations': 'Games',
1061
1101
  'game/registrations/status': 'Games',
1062
1102
  'game/registrations/lineup': 'Games',
@@ -1113,9 +1153,9 @@ export const ServiceRoutes = Object.freeze(
1113
1153
  ],
1114
1154
  'Users': [
1115
1155
  'user',
1156
+ 'user/id',
1116
1157
  'user/password',
1117
1158
  'user/role',
1118
- 'user/role/id',
1119
1159
  'user/city',
1120
1160
  'user/cities',
1121
1161
  'users',
@@ -1166,9 +1206,12 @@ export const ServiceRoutes = Object.freeze(
1166
1206
  ],
1167
1207
  'Games': [
1168
1208
  'game',
1209
+ 'game/id',
1169
1210
  'game/status',
1170
1211
  'game/city',
1171
1212
  'game/registration',
1213
+ 'game/registration/status',
1214
+ 'game/registration/lineup',
1172
1215
  'game/registrations',
1173
1216
  'game/registrations/status',
1174
1217
  'game/registrations/lineup',
@@ -3,9 +3,9 @@ export const Routes = Object.freeze(
3
3
  'role',
4
4
  'roles',
5
5
  'user',
6
+ 'user/id',
6
7
  'user/password',
7
8
  'user/role',
8
- 'user/role/id',
9
9
  'user/city',
10
10
  'user/cities',
11
11
  'users',
@@ -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',