@shakerquiz/utilities 0.5.68 → 0.5.70
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,16 +1,20 @@
|
|
|
1
1
|
export var Service = /** @type {const} */ ({
|
|
2
2
|
'Users': 'Users',
|
|
3
3
|
'Roles': 'Roles',
|
|
4
|
-
'Checkin': 'Checkin',
|
|
5
4
|
'Locations': 'Locations',
|
|
6
5
|
'Cities': 'Cities',
|
|
7
6
|
'Venues': 'Venues',
|
|
8
7
|
'Themes': 'Themes',
|
|
9
8
|
'Games': 'Games',
|
|
10
9
|
'Registrations': 'Registrations',
|
|
10
|
+
'Files': 'Files',
|
|
11
|
+
'Checkin': 'Checkin',
|
|
11
12
|
'Procedures': 'Procedures',
|
|
12
13
|
'Integrations': 'Integrations',
|
|
13
14
|
'Updates': 'Updates',
|
|
15
|
+
'Hub': 'Hub',
|
|
16
|
+
'Landing': 'Landing',
|
|
17
|
+
'Vkma': 'Vkma',
|
|
14
18
|
})
|
|
15
19
|
|
|
16
20
|
export var Services = Object.values(Service)
|
|
@@ -410,10 +414,6 @@ export var ServiceRoutes = {
|
|
|
410
414
|
Route['roles'],
|
|
411
415
|
],
|
|
412
416
|
|
|
413
|
-
[Service.Checkin]: [
|
|
414
|
-
Route['checkin'],
|
|
415
|
-
],
|
|
416
|
-
|
|
417
417
|
[Service.Locations]: [
|
|
418
418
|
Route['country'],
|
|
419
419
|
Route['countries'],
|
|
@@ -477,11 +477,21 @@ export var ServiceRoutes = {
|
|
|
477
477
|
Route['registrations/export'],
|
|
478
478
|
],
|
|
479
479
|
|
|
480
|
+
[Service.Checkin]: [
|
|
481
|
+
Route['checkin'],
|
|
482
|
+
],
|
|
483
|
+
|
|
480
484
|
[Service.Procedures]: [],
|
|
481
485
|
|
|
482
486
|
[Service.Integrations]: [],
|
|
483
487
|
|
|
484
488
|
[Service.Updates]: [],
|
|
489
|
+
|
|
490
|
+
[Service.Hub]: [],
|
|
491
|
+
|
|
492
|
+
[Service.Landing]: [],
|
|
493
|
+
|
|
494
|
+
[Service.Vkma]: [],
|
|
485
495
|
}
|
|
486
496
|
|
|
487
497
|
/**
|
|
@@ -545,9 +555,21 @@ export var getRoutePathname = value => {
|
|
|
545
555
|
return RoutePathname[route]
|
|
546
556
|
}
|
|
547
557
|
|
|
558
|
+
/**
|
|
559
|
+
* @param {keyof Route} value
|
|
560
|
+
*/
|
|
561
|
+
export var getRoutePathnamePattern = value => {
|
|
562
|
+
var route = getRoute(value)
|
|
563
|
+
|
|
564
|
+
if (!(route in RoutePathname))
|
|
565
|
+
throw TypeError(`[getRoutePathname] Route '${route}' must be a member of RoutePathname.`)
|
|
566
|
+
|
|
567
|
+
return new URLPattern({ pathname: '/' + RoutePathname[route] })
|
|
568
|
+
}
|
|
569
|
+
|
|
548
570
|
export var hydrateRoutePathname = (value, parameters) => {
|
|
549
571
|
var route = getRoute(value)
|
|
550
|
-
var pathname =
|
|
572
|
+
var pathname = getRoutePathnamePattern(route)
|
|
551
573
|
var params = getRouteParams(route)
|
|
552
574
|
|
|
553
575
|
return params.reduce(
|