@shakerquiz/utilities 0.5.221 → 0.6.0
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 +3 -5
- package/source/entities/blend.js +5 -0
- package/source/entities/cardinality-routes.js +82 -0
- package/source/entities/cardinality.js +8 -0
- package/source/entities/category.js +4 -0
- package/source/entities/city-affilation.js +16 -0
- package/source/entities/city-chatapp-version.js +9 -0
- package/source/entities/game-status.js +110 -0
- package/source/{enumerations → entities}/gender.js +7 -0
- package/source/entities/icon.js +654 -0
- package/source/entities/method.js +22 -0
- package/source/entities/mode.js +14 -0
- package/source/entities/network.js +9 -0
- package/source/entities/numerosity.js +5 -0
- package/source/entities/phase.js +23 -0
- package/source/entities/quantifier.js +41 -0
- package/source/entities/registration-attribute.js +68 -0
- package/source/entities/registration-channel.js +17 -0
- package/source/entities/registration-lineup.js +19 -0
- package/source/entities/registration-mailing.js +20 -0
- package/source/{enumerations/registration/status.js → entities/registration-status.js} +1 -13
- package/source/entities/role.js +25 -0
- package/source/entities/route-cardinality-route.js +112 -0
- package/source/entities/route-cardinality.js +175 -0
- package/source/entities/route-pathname-params.js +12 -0
- package/source/entities/route-pathname.js +70 -0
- package/source/entities/route-service.js +65 -0
- package/source/entities/route.js +70 -0
- package/source/entities/service-routes.js +34 -0
- package/source/entities/service-runtime.js +22 -0
- package/source/entities/service.js +39 -0
- package/source/entities/theme-status.js +14 -0
- package/source/entities/venue-audience.js +14 -0
- package/source/entities/venue-status.js +15 -0
- package/source/helpers/hydrate-route-pathname.js +32 -0
- package/source/helpers/string-tag.js +7 -0
- package/source/helpers/tag.js +37 -0
- package/source/index.js +41 -38
- package/source/prototypes/reflection.js +53 -0
- package/source/enumerations/blend.js +0 -11
- package/source/enumerations/cardinality.js +0 -13
- package/source/enumerations/category.js +0 -9
- package/source/enumerations/entities/affilation.js +0 -29
- package/source/enumerations/entities/game-status.js +0 -122
- package/source/enumerations/entities/registration-attribute.js +0 -83
- package/source/enumerations/entities/registration-channel.js +0 -26
- package/source/enumerations/entities/registration-mailing.js +0 -24
- package/source/enumerations/entities/role.js +0 -40
- package/source/enumerations/entities/version.js +0 -23
- package/source/enumerations/icon.js +0 -655
- package/source/enumerations/method.js +0 -31
- package/source/enumerations/mode.js +0 -48
- package/source/enumerations/network.js +0 -9
- package/source/enumerations/numerosity.js +0 -5
- package/source/enumerations/phase.js +0 -31
- package/source/enumerations/quantifier.js +0 -87
- package/source/enumerations/registration/lineup.js +0 -33
- package/source/enumerations/route.js +0 -515
- package/source/enumerations/service.js +0 -62
- package/source/enumerations/theme/status.js +0 -27
- package/source/enumerations/venue/audience.js +0 -27
- package/source/enumerations/venue/status.js +0 -27
- package/source/functions/hydrate-route-params.js +0 -18
- package/source/functions/hydrate-route-pathname.js +0 -26
- package/source/functions/key.js +0 -37
- package/source/functions/string-tag.js +0 -5
- /package/source/{enumerations → entities}/constants.js +0 -0
- /package/source/{enumerations → entities}/display.js +0 -0
- /package/source/{enumerations → entities}/pattern.js +0 -0
- /package/source/{enumerations → entities}/runtime.js +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Route } from './route.js'
|
|
2
|
+
import { Service } from './service.js'
|
|
3
|
+
|
|
4
|
+
export const DefaultRouteService = Object.freeze({
|
|
5
|
+
[Route['checkin']]: Service['Checkin'],
|
|
6
|
+
[Route['user']]: Service['Users'],
|
|
7
|
+
[Route['user/cities']]: Service['Users'],
|
|
8
|
+
[Route['user/password']]: Service['Users'],
|
|
9
|
+
[Route['user/role']]: Service['Users'],
|
|
10
|
+
[Route['users']]: Service['Users'],
|
|
11
|
+
[Route['users/cities']]: Service['Users'],
|
|
12
|
+
[Route['users/role']]: Service['Users'],
|
|
13
|
+
[Route['role']]: Service['Roles'],
|
|
14
|
+
[Route['roles']]: Service['Roles'],
|
|
15
|
+
[Route['cities']]: Service['Cities'],
|
|
16
|
+
[Route['cities/country']]: Service['Cities'],
|
|
17
|
+
[Route['cities/currency']]: Service['Cities'],
|
|
18
|
+
[Route['cities/timezone']]: Service['Cities'],
|
|
19
|
+
[Route['cities/venues']]: Service['Cities'],
|
|
20
|
+
[Route['city']]: Service['Cities'],
|
|
21
|
+
[Route['city/country']]: Service['Cities'],
|
|
22
|
+
[Route['city/currency']]: Service['Cities'],
|
|
23
|
+
[Route['city/timezone']]: Service['Cities'],
|
|
24
|
+
[Route['city/venues']]: Service['Cities'],
|
|
25
|
+
[Route['countries']]: Service['Locations'],
|
|
26
|
+
[Route['country']]: Service['Locations'],
|
|
27
|
+
[Route['currencies']]: Service['Locations'],
|
|
28
|
+
[Route['currency']]: Service['Locations'],
|
|
29
|
+
[Route['game']]: Service['Games'],
|
|
30
|
+
[Route['game/city']]: Service['Games'],
|
|
31
|
+
[Route['game/registrations']]: Service['Games'],
|
|
32
|
+
[Route['game/registrations/export']]: Service['Games'],
|
|
33
|
+
[Route['game/summary']]: Service['Games'],
|
|
34
|
+
[Route['game/theme']]: Service['Games'],
|
|
35
|
+
[Route['game/venue']]: Service['Games'],
|
|
36
|
+
[Route['games']]: Service['Games'],
|
|
37
|
+
[Route['games/city']]: Service['Games'],
|
|
38
|
+
[Route['games/registrations']]: Service['Games'],
|
|
39
|
+
[Route['games/registrations/export']]: Service['Games'],
|
|
40
|
+
[Route['games/summary']]: Service['Games'],
|
|
41
|
+
[Route['games/theme']]: Service['Games'],
|
|
42
|
+
[Route['games/venue']]: Service['Games'],
|
|
43
|
+
[Route['registration']]: Service['Registrations'],
|
|
44
|
+
[Route['registration/cancellation']]: Service['Registrations'],
|
|
45
|
+
[Route['registration/channel']]: Service['Registrations'],
|
|
46
|
+
[Route['registration/confirmation']]: Service['Registrations'],
|
|
47
|
+
[Route['registration/city']]: Service['Registrations'],
|
|
48
|
+
[Route['registration/game']]: Service['Registrations'],
|
|
49
|
+
[Route['registration/mailing']]: Service['Registrations'],
|
|
50
|
+
[Route['registrations']]: Service['Registrations'],
|
|
51
|
+
[Route['registrations/city']]: Service['Registrations'],
|
|
52
|
+
[Route['registrations/game']]: Service['Registrations'],
|
|
53
|
+
[Route['registrations/game/theme']]: Service['Registrations'],
|
|
54
|
+
[Route['registrations/export']]: Service['Registrations'],
|
|
55
|
+
[Route['theme']]: Service['Themes'],
|
|
56
|
+
[Route['theme/cover']]: Service['Themes'],
|
|
57
|
+
[Route['themes']]: Service['Themes'],
|
|
58
|
+
[Route['themes/cover']]: Service['Themes'],
|
|
59
|
+
[Route['timezone']]: Service['Locations'],
|
|
60
|
+
[Route['timezones']]: Service['Locations'],
|
|
61
|
+
[Route['venue']]: Service['Venues'],
|
|
62
|
+
[Route['venue/city']]: Service['Venues'],
|
|
63
|
+
[Route['venues']]: Service['Venues'],
|
|
64
|
+
[Route['venues/city']]: Service['Venues'],
|
|
65
|
+
})
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const Route = Object.freeze({
|
|
2
|
+
'checkin': 'checkin',
|
|
3
|
+
'cities': 'cities',
|
|
4
|
+
'cities/country': 'cities/country',
|
|
5
|
+
'cities/currency': 'cities/currency',
|
|
6
|
+
'cities/timezone': 'cities/timezone',
|
|
7
|
+
'cities/venues': 'cities/venues',
|
|
8
|
+
'city': 'city',
|
|
9
|
+
'city/country': 'city/country',
|
|
10
|
+
'city/currency': 'city/currency',
|
|
11
|
+
'city/timezone': 'city/timezone',
|
|
12
|
+
'city/venue': 'city/venue',
|
|
13
|
+
'city/venues': 'city/venues',
|
|
14
|
+
'countries': 'countries',
|
|
15
|
+
'country': 'country',
|
|
16
|
+
'currencies': 'currencies',
|
|
17
|
+
'currency': 'currency',
|
|
18
|
+
'game': 'game',
|
|
19
|
+
'game/city': 'game/city',
|
|
20
|
+
'game/registration': 'game/registration',
|
|
21
|
+
'game/registrations': 'game/registrations',
|
|
22
|
+
'game/registrations/export': 'game/registrations/export',
|
|
23
|
+
'game/summary': 'game/summary',
|
|
24
|
+
'game/theme': 'game/theme',
|
|
25
|
+
'game/venue': 'game/venue',
|
|
26
|
+
'games': 'games',
|
|
27
|
+
'games/city': 'games/city',
|
|
28
|
+
'games/registrations': 'games/registrations',
|
|
29
|
+
'games/registrations/export': 'games/registrations/export',
|
|
30
|
+
'games/summary': 'games/summary',
|
|
31
|
+
'games/theme': 'games/theme',
|
|
32
|
+
'games/venue': 'games/venue',
|
|
33
|
+
'registration': 'registration',
|
|
34
|
+
'registration/cancellation': 'registration/cancellation',
|
|
35
|
+
'registration/channel': 'registration/channel',
|
|
36
|
+
'registration/confirmation': 'registration/confirmation',
|
|
37
|
+
'registration/export': 'registration/export',
|
|
38
|
+
'registration/city': 'registration/city',
|
|
39
|
+
'registration/game': 'registration/game',
|
|
40
|
+
'registration/game/theme': 'registration/game/theme',
|
|
41
|
+
'registration/mailing': 'registration/mailing',
|
|
42
|
+
'registrations': 'registrations',
|
|
43
|
+
'registrations/city': 'registrations/city',
|
|
44
|
+
'registrations/game': 'registrations/game',
|
|
45
|
+
'registrations/game/theme': 'registrations/game/theme',
|
|
46
|
+
'registrations/export': 'registrations/export',
|
|
47
|
+
'role': 'role',
|
|
48
|
+
'roles': 'roles',
|
|
49
|
+
'theme': 'theme',
|
|
50
|
+
'theme/cover': 'theme/cover',
|
|
51
|
+
'themes': 'themes',
|
|
52
|
+
'themes/cover': 'themes/cover',
|
|
53
|
+
'timezone': 'timezone',
|
|
54
|
+
'timezones': 'timezones',
|
|
55
|
+
'user': 'user',
|
|
56
|
+
'user/cities': 'user/cities',
|
|
57
|
+
'user/city': 'user/city',
|
|
58
|
+
'user/password': 'user/password',
|
|
59
|
+
'user/role': 'user/role',
|
|
60
|
+
'users': 'users',
|
|
61
|
+
'users/cities': 'users/cities',
|
|
62
|
+
'users/password': 'users/password',
|
|
63
|
+
'users/role': 'users/role',
|
|
64
|
+
'venue': 'venue',
|
|
65
|
+
'venue/city': 'venue/city',
|
|
66
|
+
'venues': 'venues',
|
|
67
|
+
'venues/city': 'venues/city',
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
export const Routes = Object.freeze(Object.values(Route))
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DefaultRouteService } from './route-service.js'
|
|
2
|
+
import { Service } from './service.js'
|
|
3
|
+
|
|
4
|
+
export let ServiceRoutes = (() => {
|
|
5
|
+
let object = {}
|
|
6
|
+
|
|
7
|
+
for (const service in Service)
|
|
8
|
+
object[service] = []
|
|
9
|
+
|
|
10
|
+
for (const route in DefaultRouteService)
|
|
11
|
+
object[DefaultRouteService[route]].push(route)
|
|
12
|
+
|
|
13
|
+
return Object.freeze(object)
|
|
14
|
+
})()
|
|
15
|
+
|
|
16
|
+
export let ServiceRoutes = {
|
|
17
|
+
'Checkin': [
|
|
18
|
+
'checkin',
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
'Users': [
|
|
22
|
+
'user',
|
|
23
|
+
'user/cities',
|
|
24
|
+
'user/password',
|
|
25
|
+
'user/role',
|
|
26
|
+
'users',
|
|
27
|
+
'users/cities',
|
|
28
|
+
'users/role',
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
'Landing': [
|
|
32
|
+
''
|
|
33
|
+
],
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Mode } from './mode.js'
|
|
2
|
+
import { Runtime } from './runtime.js'
|
|
3
|
+
|
|
4
|
+
export const ServiceRuntime = Object.freeze({
|
|
5
|
+
'Users': Runtime['Deno'],
|
|
6
|
+
'Roles': Runtime['Deno'],
|
|
7
|
+
'Checkin': Runtime['Deno'],
|
|
8
|
+
'Locations': Runtime['Deno'],
|
|
9
|
+
'Cities': Runtime['Deno'],
|
|
10
|
+
'Venues': Runtime['Deno'],
|
|
11
|
+
'Themes': Runtime['Deno'],
|
|
12
|
+
'Games': Runtime['Deno'],
|
|
13
|
+
'Registrations': Runtime['Deno'],
|
|
14
|
+
'Files': Runtime['Bun'],
|
|
15
|
+
'Procedures': Runtime['Bun'],
|
|
16
|
+
'Integrations': Runtime['Bun'],
|
|
17
|
+
'Updates': Runtime['Bun'],
|
|
18
|
+
'Hub': Runtime['Node'],
|
|
19
|
+
'Landing': Runtime['Node'],
|
|
20
|
+
'Vkma': Runtime['Vite'],
|
|
21
|
+
'Minio': Mode['Unknown'],
|
|
22
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const Service = Object.freeze({
|
|
2
|
+
'Users': 'Users',
|
|
3
|
+
'Roles': 'Roles',
|
|
4
|
+
'Checkin': 'Checkin',
|
|
5
|
+
'Locations': 'Locations',
|
|
6
|
+
'Cities': 'Cities',
|
|
7
|
+
'Venues': 'Venues',
|
|
8
|
+
'Themes': 'Themes',
|
|
9
|
+
'Games': 'Games',
|
|
10
|
+
'Registrations': 'Registrations',
|
|
11
|
+
'Files': 'Files',
|
|
12
|
+
'Procedures': 'Procedures',
|
|
13
|
+
'Integrations': 'Integrations',
|
|
14
|
+
'Updates': 'Updates',
|
|
15
|
+
'Hub': 'Hub',
|
|
16
|
+
'Landing': 'Landing',
|
|
17
|
+
'Vkma': 'Vkma',
|
|
18
|
+
'Minio': 'Minio',
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export const Services = Object.freeze([
|
|
22
|
+
'Users',
|
|
23
|
+
'Roles',
|
|
24
|
+
'Checkin',
|
|
25
|
+
'Locations',
|
|
26
|
+
'Cities',
|
|
27
|
+
'Venues',
|
|
28
|
+
'Themes',
|
|
29
|
+
'Games',
|
|
30
|
+
'Registrations',
|
|
31
|
+
'Files',
|
|
32
|
+
'Procedures',
|
|
33
|
+
'Integrations',
|
|
34
|
+
'Updates',
|
|
35
|
+
'Hub',
|
|
36
|
+
'Landing',
|
|
37
|
+
'Vkma',
|
|
38
|
+
'Minio',
|
|
39
|
+
])
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const ThemeStatus = Object.freeze({
|
|
2
|
+
'Active': 'Active',
|
|
3
|
+
'Archive': 'Archive',
|
|
4
|
+
})
|
|
5
|
+
|
|
6
|
+
export const ThemeStatuses = Object.freeze([
|
|
7
|
+
'Active',
|
|
8
|
+
'Archive',
|
|
9
|
+
])
|
|
10
|
+
|
|
11
|
+
export const ThemeStatusIcon = Object.freeze({
|
|
12
|
+
'Active': 'hero/outline/check',
|
|
13
|
+
'Archive': 'hero/outline/archive-box',
|
|
14
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const VenueAudience = Object.freeze({
|
|
2
|
+
'Open': 'Open',
|
|
3
|
+
'Adults': 'Adults',
|
|
4
|
+
})
|
|
5
|
+
|
|
6
|
+
export const VenueAudiences = Object.freeze([
|
|
7
|
+
'Open',
|
|
8
|
+
'Adults',
|
|
9
|
+
])
|
|
10
|
+
|
|
11
|
+
export const VenueAudienceIcon = Object.freeze({
|
|
12
|
+
'Open': 'hero/outline/lock-open',
|
|
13
|
+
'Adults': 'hero/outline/lock-closed',
|
|
14
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const VenueStatus = Object.freeze({
|
|
2
|
+
'Active': 'Active',
|
|
3
|
+
'Archive': 'Archive',
|
|
4
|
+
})
|
|
5
|
+
|
|
6
|
+
export const VenueStatuses = Object.freeze([
|
|
7
|
+
'Active',
|
|
8
|
+
'Archive',
|
|
9
|
+
])
|
|
10
|
+
|
|
11
|
+
/** @satisfies {Record<keyof typeof VenueStatus, string>} */
|
|
12
|
+
export const VenueStatusIcon = Object.freeze({
|
|
13
|
+
'Active': 'hero/outline/check',
|
|
14
|
+
'Archive': 'hero/outline/archive-box',
|
|
15
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { checkRoute } from '../application/route.js'
|
|
2
|
+
import { inferRouteParams, inferRoutePathname } from '../system/route.js'
|
|
3
|
+
|
|
4
|
+
export const hydrateRoutePathname = Object.freeze(
|
|
5
|
+
/**
|
|
6
|
+
* @template {keyof typeof import('../system/route.js').Route} RouteTemplate
|
|
7
|
+
*
|
|
8
|
+
* @param {RouteTemplate} route
|
|
9
|
+
* @param {any[]} params
|
|
10
|
+
*/
|
|
11
|
+
(route, params) => {
|
|
12
|
+
if (!Array.isArray(params))
|
|
13
|
+
throw TypeError(`Parameter 'params' must be 'Array'.`)
|
|
14
|
+
|
|
15
|
+
var $route = checkRoute(route)
|
|
16
|
+
|
|
17
|
+
var $routePathname = inferRoutePathname($route)
|
|
18
|
+
|
|
19
|
+
if ($routePathname === 'Unknown')
|
|
20
|
+
throw TypeError(`Could not infer route pathname of: '${$route}'.`)
|
|
21
|
+
|
|
22
|
+
var rpm = inferRouteParams($route)
|
|
23
|
+
|
|
24
|
+
if (rpm === 'Unknown')
|
|
25
|
+
throw TypeError(`Could not infer route params of: '${$route}'.`)
|
|
26
|
+
|
|
27
|
+
return rpm.reduce(
|
|
28
|
+
(pathname, param, index) => pathname.replace(param, params[index]),
|
|
29
|
+
$routePathname,
|
|
30
|
+
)
|
|
31
|
+
},
|
|
32
|
+
)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { inferMethod } from '../system/method.js'
|
|
2
|
+
|
|
3
|
+
import { hydrateRoutePathname } from './hydrate-route-pathname.js'
|
|
4
|
+
|
|
5
|
+
export const tag = Object.freeze(
|
|
6
|
+
/**
|
|
7
|
+
* @template {keyof typeof import('../system/method.js').Method} MethodTemplate
|
|
8
|
+
* @template {keyof typeof import('../system/route.js').Route} RouteTemplate
|
|
9
|
+
* @template {typeof import('../system/route.js').RoutePathname[RouteTemplate]} RoutePathnameTemplate
|
|
10
|
+
*
|
|
11
|
+
* @param {MethodTemplate} method
|
|
12
|
+
* @param {RouteTemplate} route
|
|
13
|
+
* @param {any[]} params
|
|
14
|
+
*
|
|
15
|
+
* @returns {`${MethodTemplate}/${RoutePathnameTemplate}`}
|
|
16
|
+
*/
|
|
17
|
+
(method, route, params) => {
|
|
18
|
+
var m = inferMethod(method)
|
|
19
|
+
|
|
20
|
+
if (m === 'Unknown')
|
|
21
|
+
throw TypeError(`Could not infer method of: '${method}'.`)
|
|
22
|
+
|
|
23
|
+
return m + '/' + hydrateRoutePathname(route, params)
|
|
24
|
+
},
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
export const tagexp = Object.freeze(
|
|
28
|
+
/**
|
|
29
|
+
* @template {keyof typeof import('../system/method.js').Method} MethodTemplate
|
|
30
|
+
* @template {keyof typeof import('../system/route.js').Route} RouteTemplate
|
|
31
|
+
*
|
|
32
|
+
* @param {MethodTemplate} method
|
|
33
|
+
* @param {RouteTemplate} route
|
|
34
|
+
* @param {any[]} params
|
|
35
|
+
*/
|
|
36
|
+
(method, route, params) => new RegExp(`^${tag(method, route, params)}$`),
|
|
37
|
+
)
|
package/source/index.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
|
|
30
|
-
export * from './
|
|
31
|
-
|
|
32
|
-
export * from './
|
|
33
|
-
export * from './
|
|
34
|
-
|
|
35
|
-
export * from './
|
|
36
|
-
export * from './
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './
|
|
1
|
+
export * from './entities/blend.js'
|
|
2
|
+
export * from './entities/cardinality-routes.js'
|
|
3
|
+
export * from './entities/cardinality.js'
|
|
4
|
+
export * from './entities/category.js'
|
|
5
|
+
export * from './entities/city-affilation.js'
|
|
6
|
+
export * from './entities/city-chatapp-version.js'
|
|
7
|
+
export * from './entities/constants.js'
|
|
8
|
+
export * from './entities/display.js'
|
|
9
|
+
export * from './entities/game-status.js'
|
|
10
|
+
export * from './entities/gender.js'
|
|
11
|
+
export * from './entities/icon.js'
|
|
12
|
+
export * from './entities/method.js'
|
|
13
|
+
export * from './entities/mode.js'
|
|
14
|
+
export * from './entities/network.js'
|
|
15
|
+
export * from './entities/numerosity.js'
|
|
16
|
+
export * from './entities/pattern.js'
|
|
17
|
+
export * from './entities/phase.js'
|
|
18
|
+
export * from './entities/quantifier.js'
|
|
19
|
+
export * from './entities/registration-attribute.js'
|
|
20
|
+
export * from './entities/registration-channel.js'
|
|
21
|
+
export * from './entities/registration-lineup.js'
|
|
22
|
+
export * from './entities/registration-mailing.js'
|
|
23
|
+
export * from './entities/registration-status.js'
|
|
24
|
+
export * from './entities/role.js'
|
|
25
|
+
export * from './entities/route-cardinality-route.js'
|
|
26
|
+
export * from './entities/route-cardinality.js'
|
|
27
|
+
export * from './entities/route-pathname-params.js'
|
|
28
|
+
export * from './entities/route-pathname.js'
|
|
29
|
+
export * from './entities/route-service.js'
|
|
30
|
+
export * from './entities/route.js'
|
|
31
|
+
export * from './entities/runtime.js'
|
|
32
|
+
export * from './entities/service-routes.js'
|
|
33
|
+
export * from './entities/service-runtime.js'
|
|
34
|
+
export * from './entities/service.js'
|
|
35
|
+
export * from './entities/theme-status.js'
|
|
36
|
+
export * from './entities/venue-audience.js'
|
|
37
|
+
export * from './entities/venue-status.js'
|
|
38
|
+
export * from './helpers/hydrate-route-pathname.js'
|
|
39
|
+
export * from './helpers/string-tag.js'
|
|
40
|
+
export * from './helpers/tag.js'
|
|
41
|
+
export * from './prototypes/reflection.js'
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @template {*} Value
|
|
3
|
+
*
|
|
4
|
+
* @param {Value} value
|
|
5
|
+
*/
|
|
6
|
+
export function Relation(value) {
|
|
7
|
+
this.value = value
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @template {*} Value
|
|
12
|
+
*
|
|
13
|
+
* @param {Value} value
|
|
14
|
+
*/
|
|
15
|
+
Relation.of = function(value) {
|
|
16
|
+
return new Relation(value)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @template {keyof Value} Key
|
|
21
|
+
*
|
|
22
|
+
* @this {Relation<Value>}
|
|
23
|
+
*
|
|
24
|
+
* @param {*} key
|
|
25
|
+
*
|
|
26
|
+
* @returns {Value[Key] | 'Unknown'}
|
|
27
|
+
*/
|
|
28
|
+
Relation.prototype.expect = function(key) {
|
|
29
|
+
if (Object.hasOwn(this.value, key))
|
|
30
|
+
return this.value[key]
|
|
31
|
+
else
|
|
32
|
+
return 'Unknown'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @template {keyof Value} Key
|
|
37
|
+
*
|
|
38
|
+
* @this {Relation<Value>}
|
|
39
|
+
*
|
|
40
|
+
* @param {*} key
|
|
41
|
+
*
|
|
42
|
+
* @returns {Value[Key]}
|
|
43
|
+
*
|
|
44
|
+
* @throws {TypeError}
|
|
45
|
+
*/
|
|
46
|
+
Relation.prototype.require = function(key) {
|
|
47
|
+
if (Object.hasOwn(this.value, key))
|
|
48
|
+
return this.value[key]
|
|
49
|
+
else
|
|
50
|
+
throw TypeError(`Could not require key '${key}' from Relation '${JSON.stringify(this.value)}'.`)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Relation.prototype[Symbol.toStringTag] = 'Relation'
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const Blend = Object.freeze({
|
|
2
|
-
'Unset': 'Unset',
|
|
3
|
-
'Domain': 'Domain',
|
|
4
|
-
'System': 'System',
|
|
5
|
-
'Indifferent': 'Indifferent',
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export const inferBlend = Object.freeze(
|
|
9
|
-
/** @returns {typeof Blend[keyof typeof Blend]} */
|
|
10
|
-
value => Blend[value] ?? 'Unset',
|
|
11
|
-
)
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const Cardinality = Object.freeze({
|
|
2
|
-
'1': '1',
|
|
3
|
-
'1-1': '1-1',
|
|
4
|
-
'1-N': '1-N',
|
|
5
|
-
'N': 'N',
|
|
6
|
-
'N-1': 'N-1',
|
|
7
|
-
'N-N': 'N-N',
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export const inferCardinality = Object.freeze(
|
|
11
|
-
/** @returns {keyof typeof Cardinality | 'Unknown'} */
|
|
12
|
-
x => Cardinality[x] ?? 'Unknown',
|
|
13
|
-
)
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const Affilation = Object.freeze({
|
|
2
|
-
'Branch': 'Branch',
|
|
3
|
-
'Franchise': 'Franchise',
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
/** @satisfies {Array<keyof typeof Affilation>} */
|
|
7
|
-
export const Affilations = Object.freeze([
|
|
8
|
-
'Branch',
|
|
9
|
-
'Franchise',
|
|
10
|
-
])
|
|
11
|
-
|
|
12
|
-
/** @satisfies {Record<keyof typeof Affilation, string>} */
|
|
13
|
-
export const AffilationTitle = Object.freeze({
|
|
14
|
-
'Branch': 'Филиал',
|
|
15
|
-
'Franchise': 'Франшиза',
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
/** @satisfies {Record<keyof typeof Affilation, string>} */
|
|
19
|
-
export const AffilationIcon = Object.freeze({
|
|
20
|
-
'Branch': 'hero/outline/building-office-2',
|
|
21
|
-
'Franchise': 'hero/outline/building-storefront',
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
/** @returns {keyof typeof Affilation | 'Unknown'} */
|
|
25
|
-
export const inferAffilation = Object.freeze(value =>
|
|
26
|
-
Affilation[value?.affilation]
|
|
27
|
-
?? Affilation[value]
|
|
28
|
-
?? 'Unknown'
|
|
29
|
-
)
|