@shakerquiz/utilities 3.0.0 → 4.0.1

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.
Files changed (116) hide show
  1. package/.github/workflows/publish.yml +32 -0
  2. package/package.json +5 -5
  3. package/scripts/route-cardinality.js +23 -0
  4. package/scripts/route-parameter.js +29 -0
  5. package/scripts/route-pathname.js +37 -0
  6. package/scripts/route-relation.js +26 -0
  7. package/scripts/route-service.js +25 -0
  8. package/scripts/templates/route-cardinality.js +5 -0
  9. package/scripts/templates/route-parameter.js +5 -0
  10. package/scripts/templates/route-pathname.js +7 -0
  11. package/scripts/templates/route-relation.js +5 -0
  12. package/scripts/templates/route-service.js +7 -0
  13. package/source/entities/blend.js +5 -0
  14. package/source/entities/cardinality.js +4 -0
  15. package/source/entities/category.js +4 -0
  16. package/source/entities/city-affilation.js +10 -0
  17. package/source/entities/city-chatapp-version.js +9 -0
  18. package/source/{enumerations/misc → entities}/constants.js +1 -1
  19. package/source/entities/display.js +4 -0
  20. package/source/entities/game-status.js +98 -0
  21. package/source/entities/gender.js +13 -0
  22. package/source/entities/icon.js +654 -0
  23. package/source/entities/key.js +41 -0
  24. package/source/{enumerations/core/methods.js → entities/method.js} +10 -4
  25. package/source/entities/mode.js +9 -0
  26. package/source/entities/network.js +9 -0
  27. package/source/entities/numerosity.js +5 -0
  28. package/source/entities/pattern.js +7 -0
  29. package/source/entities/phase.js +15 -0
  30. package/source/entities/quantifier.js +41 -0
  31. package/source/entities/registration-attribute.js +61 -0
  32. package/source/entities/registration-channel.js +11 -0
  33. package/source/entities/registration-lineup.js +14 -0
  34. package/source/entities/registration-mailing.js +20 -0
  35. package/source/entities/registration-status.js +19 -0
  36. package/source/entities/role.js +16 -0
  37. package/source/entities/route-cardinality.js +151 -0
  38. package/source/entities/route-parameter.js +151 -0
  39. package/source/entities/route-pathname.js +226 -0
  40. package/source/entities/route-relation.js +151 -0
  41. package/source/entities/route-service.js +181 -0
  42. package/source/entities/route.js +83 -0
  43. package/source/entities/runtime.js +6 -0
  44. package/source/entities/segment.js +255 -0
  45. package/source/entities/service-runtime.js +22 -0
  46. package/source/entities/service.js +22 -0
  47. package/source/entities/theme-status.js +9 -0
  48. package/source/entities/venue-audience.js +9 -0
  49. package/source/entities/venue-status.js +9 -0
  50. package/source/helpers/access.js +161 -0
  51. package/source/helpers/hydrate-route-pathname.js +29 -0
  52. package/source/helpers/tag.js +35 -0
  53. package/source/index.js +40 -34
  54. package/source/enumerations/core/features.js +0 -56
  55. package/source/enumerations/core/networks.js +0 -6
  56. package/source/enumerations/core/runtimes.js +0 -6
  57. package/source/enumerations/entities/affilation.js +0 -91
  58. package/source/enumerations/entities/cities-mode.js +0 -49
  59. package/source/enumerations/entities/city/timezone-mode.js +0 -44
  60. package/source/enumerations/entities/city/venues-mode.js +0 -60
  61. package/source/enumerations/entities/game-status.js +0 -130
  62. package/source/enumerations/entities/password-mode.js +0 -40
  63. package/source/enumerations/entities/registration-attribute.js +0 -83
  64. package/source/enumerations/entities/registration-channel.js +0 -26
  65. package/source/enumerations/entities/registration-lineup.js +0 -75
  66. package/source/enumerations/entities/registration-mailing.js +0 -24
  67. package/source/enumerations/entities/registration-status.js +0 -89
  68. package/source/enumerations/entities/role-mode.js +0 -40
  69. package/source/enumerations/entities/role.js +0 -82
  70. package/source/enumerations/entities/venue/audience.js +0 -100
  71. package/source/enumerations/entities/venue/city-mode.js +0 -44
  72. package/source/enumerations/entities/venue/status.js +0 -53
  73. package/source/enumerations/entities/version.js +0 -76
  74. package/source/enumerations/misc/icons.js +0 -655
  75. package/source/enumerations/misc/keys.js +0 -15
  76. package/source/enumerations/misc/phases.js +0 -42
  77. package/source/enumerations/misc/regexps.js +0 -5
  78. package/source/enumerations/misc/routes.js +0 -610
  79. package/source/functions/tag.d.ts +0 -1
  80. package/source/functions/tag.js +0 -5
  81. package/source/schemas/PATCH/city/admin.json +0 -126
  82. package/source/schemas/PATCH/city/currency/admin.json +0 -173
  83. package/source/schemas/PATCH/city/timezone/admin.json +0 -501
  84. package/source/schemas/PATCH/game/admin.json +0 -30
  85. package/source/schemas/PATCH/game/organizer.json +0 -30
  86. package/source/schemas/PATCH/registration/admin.json +0 -43
  87. package/source/schemas/PATCH/registration/cancellation/default.json +0 -12
  88. package/source/schemas/PATCH/registration/channel/default.json +0 -22
  89. package/source/schemas/PATCH/registration/confirmation/default.json +0 -12
  90. package/source/schemas/PATCH/registration/default.json +0 -10
  91. package/source/schemas/PATCH/registration/organizer.json +0 -43
  92. package/source/schemas/PATCH/theme/admin.json +0 -19
  93. package/source/schemas/PATCH/user/admin.json +0 -30
  94. package/source/schemas/PATCH/user/cities/admin.json +0 -17
  95. package/source/schemas/PATCH/user/password/admin.json +0 -12
  96. package/source/schemas/PATCH/user/role/admin.json +0 -13
  97. package/source/schemas/PATCH/venue/admin.json +0 -44
  98. package/source/schemas/PATCH/venue/organizer.json +0 -44
  99. package/source/schemas/POST/checkin/default.json +0 -16
  100. package/source/schemas/POST/city/admin.json +0 -696
  101. package/source/schemas/POST/game/admin.json +0 -27
  102. package/source/schemas/POST/game/organizer.json +0 -27
  103. package/source/schemas/POST/game/registrations/export/admin.json +0 -17
  104. package/source/schemas/POST/game/registrations/export/organizer.json +0 -17
  105. package/source/schemas/POST/registration/default.json +0 -125
  106. package/source/schemas/POST/registration/mailing/admin.json +0 -16
  107. package/source/schemas/POST/registration/mailing/organizer.json +0 -16
  108. package/source/schemas/POST/registrations/export/admin.json +0 -17
  109. package/source/schemas/POST/registrations/export/organizer.json +0 -17
  110. package/source/schemas/POST/theme/admin.json +0 -24
  111. package/source/schemas/POST/user/admin.json +0 -12
  112. package/source/schemas/POST/user/cities/admin.json +0 -17
  113. package/source/schemas/POST/user/password/admin.json +0 -12
  114. package/source/schemas/POST/user/role/admin.json +0 -13
  115. package/source/schemas/POST/venue/admin.json +0 -38
  116. package/source/schemas/POST/venue/organizer.json +0 -38
@@ -1,24 +0,0 @@
1
- export var RegistrationMailing = /** @type {const} */ ({
2
- 'Idle': 'Idle',
3
- 'Pending': 'Pending',
4
- 'Delivered': 'Delivered',
5
- 'Failed': 'Failed',
6
- })
7
-
8
- export var RegistrationMailings = Object.values(RegistrationMailing)
9
-
10
- /** @type {Record<RegistrationMailing, number>} */
11
- export var RegistrationMailingWeight = {
12
- [RegistrationMailing.Idle]: 0,
13
- [RegistrationMailing.Pending]: 1,
14
- [RegistrationMailing.Delivered]: 2,
15
- [RegistrationMailing.Failed]: 3,
16
- }
17
-
18
- /** @type {Record<RegistrationMailing, string>} */
19
- export var RegistrationMailingColor = {
20
- [RegistrationMailing.Idle]: 'default',
21
- [RegistrationMailing.Pending]: 'warning',
22
- [RegistrationMailing.Delivered]: 'success',
23
- [RegistrationMailing.Failed]: 'danger',
24
- }
@@ -1,89 +0,0 @@
1
- export var RegistrationStatus = /** @type {const} */ ({
2
- 'Confirmed': 'Confirmed',
3
- 'Created': 'Created',
4
- 'Cancelled': 'Cancelled',
5
- })
6
-
7
- export var RegistrationStatuses = Object.values(RegistrationStatus)
8
-
9
- export var RegistrationStatusWeight = {
10
- [RegistrationStatus.Confirmed]: 0,
11
- [RegistrationStatus.Created]: 1,
12
- [RegistrationStatus.Cancelled]: 2,
13
- }
14
-
15
- export var RegistrationStatusTitle = {
16
- [RegistrationStatus.Confirmed]: 'Подтверждена',
17
- [RegistrationStatus.Created]: 'Создана',
18
- [RegistrationStatus.Cancelled]: 'Отменена',
19
- }
20
-
21
- /** @type {Record<RegistrationStatus, Icon>} */
22
- export var RegistrationStatusIcon = {
23
- [RegistrationStatus.Confirmed]: 'hero/outline/check-circle',
24
- [RegistrationStatus.Created]: 'hero/outline/check',
25
- [RegistrationStatus.Cancelled]: 'hero/outline/x-mark',
26
- }
27
-
28
- /** @type {Record<RegistrationStatus, Icon>} */
29
- export var RegistrationStatusEmoji = {
30
- [RegistrationStatus.Confirmed]: '✅',
31
- [RegistrationStatus.Created]: '📝',
32
- [RegistrationStatus.Cancelled]: '❌',
33
- }
34
-
35
- /** @type {Record<RegistrationStatus, string>} */
36
- export var RegistrationStatusColor = {
37
- [RegistrationStatus.Confirmed]: 'text-success',
38
- [RegistrationStatus.Created]: 'text-default-700',
39
- [RegistrationStatus.Cancelled]: 'text-danger',
40
- }
41
-
42
- /** @type {Record<RegistrationStatus, Pick<RegistrationTable, 'is_canceled' | 'is_confirm'>>} */
43
- export var RegistrationStatusShape = {
44
- [RegistrationStatus.Confirmed]: {
45
- is_canceled: false,
46
- is_confirm: true,
47
- },
48
-
49
- [RegistrationStatus.Created]: {
50
- is_canceled: false,
51
- is_confirm: false,
52
- },
53
-
54
- [RegistrationStatus.Cancelled]: {
55
- is_canceled: true,
56
- is_confirm: false,
57
- },
58
- }
59
-
60
- /**
61
- * @param {RegistrationStatus | typeof RegistrationStatusShape[RegistrationStatus]} value
62
- */
63
- export var getRegistrationStatus = value => {
64
- switch (typeof value) {
65
- case 'object':
66
- let found = Object
67
- .entries(RegistrationStatusShape)
68
- .find(([, object]) =>
69
- object.is_canceled === value.is_canceled
70
- && object.is_confirm === value.is_confirm
71
- )
72
- ?.at(0)
73
-
74
- if (!RegistrationStatuses.includes(found))
75
- throw TypeError(
76
- `[Function: getRegistrationStatus] Parameter 'found': '${found}' must be a member of 'RegistrationStatuses'.`,
77
- )
78
-
79
- return found
80
-
81
- case 'string':
82
- if (!RegistrationStatuses.includes(value))
83
- throw TypeError(
84
- `[Function: getRegistrationStatus] Parameter 'value': '${value}' must be a member of 'RegistrationStatuses'.`,
85
- )
86
-
87
- return RegistrationStatusShape[value]
88
- }
89
- }
@@ -1,40 +0,0 @@
1
- export var RoleMode = /** @type {const} */ ({
2
- 'known': 'known',
3
- 'unknown': 'unknown',
4
- })
5
-
6
- export var RoleModes = Object.values(RoleMode)
7
-
8
- export var RoleModeTitle = {
9
- [RoleMode.known]: 'Любая',
10
- [RoleMode.unknown]: 'Не назначено',
11
- }
12
-
13
- export var RoleModeWeight = {
14
- [RoleMode.known]: 0,
15
- [RoleMode.unknown]: 1,
16
- }
17
-
18
- /**
19
- * @param {keyof typeof RoleMode} value
20
- */
21
- var getter = value =>
22
- value in RoleMode
23
- ? value
24
- : RoleMode['unknown']
25
-
26
- export var getRoleMode = value => {
27
- if (value === null)
28
- return getter(undefined)
29
-
30
- switch (typeof value) {
31
- case 'string':
32
- return getter(value)
33
-
34
- case 'object':
35
- return getter(value?.mode)
36
-
37
- default:
38
- return getter(undefined)
39
- }
40
- }
@@ -1,82 +0,0 @@
1
- export var Role = /** @type {const} */ ({
2
- 'admin': 'admin',
3
- 'organizer': 'organizer',
4
- 'captain': 'captain',
5
- 'player': 'player',
6
- 'user': 'user',
7
- 'manager': 'manager',
8
- 'default': 'default',
9
- })
10
-
11
- export var Roles = Object.values(Role)
12
-
13
- export var RoleWeight = {
14
- [Role.admin]: 0,
15
- [Role.organizer]: 1,
16
- [Role.captain]: 2,
17
- [Role.player]: 3,
18
- [Role.user]: 4,
19
- [Role.manager]: 5,
20
- [Role.default]: 6,
21
- }
22
-
23
- export var RoleTitle = {
24
- [Role.admin]: 'Админ',
25
- [Role.organizer]: 'Организатор',
26
- [Role.captain]: 'Капитан',
27
- [Role.player]: 'Игрок',
28
- [Role.user]: 'Пользователь',
29
- [Role.manager]: 'Менеджер',
30
- [Role.default]: 'Неавторизован',
31
- }
32
-
33
- export var RoleActionTitle = {
34
- [Role.admin]: 'Сделать админом',
35
- [Role.organizer]: 'Сделать организатором',
36
- [Role.captain]: 'Сделать капитаном',
37
- [Role.player]: 'Сделать игрокок',
38
- [Role.user]: 'Сделать пользователем',
39
- [Role.manager]: 'Сделать менеджером',
40
- [Role.default]: 'Сделать неавторизованым',
41
- }
42
-
43
- export var RoleActionDescription = {
44
- [Role.admin]: 'Назначить роль: Админ',
45
- [Role.organizer]: 'Назначить роль: Организатор',
46
- [Role.captain]: 'Назначить роль: Капитан',
47
- [Role.player]: 'Назначить роль: Игрок',
48
- [Role.user]: 'Назначить роль: Пользователь',
49
- [Role.manager]: 'Назначить роль: Менеджер',
50
- [Role.default]: 'Назначить роль: Неавторизован',
51
- }
52
-
53
- export var RoleColor = {
54
- [Role.admin]: 'danger',
55
- [Role.organizer]: 'warning',
56
- [Role.captain]: 'primary',
57
- [Role.player]: 'secondary',
58
- [Role.user]: 'default',
59
- [Role.manager]: 'default',
60
- [Role.default]: 'default',
61
- }
62
-
63
- export var RoleTextColor = {
64
- [Role.admin]: 'text-danger',
65
- [Role.organizer]: 'text-warning',
66
- [Role.captain]: 'text-primary',
67
- [Role.player]: 'text-secondary',
68
- [Role.user]: 'text-default',
69
- [Role.manager]: 'text-default',
70
- [Role.default]: 'text-default',
71
- }
72
-
73
- /** @type {Record<Role, Icon>} */
74
- export var RoleIcon = {
75
- [Role.admin]: 'hero/outline/user',
76
- [Role.organizer]: 'hero/outline/user',
77
- [Role.captain]: 'hero/outline/user',
78
- [Role.player]: 'hero/outline/user',
79
- [Role.user]: 'hero/outline/user',
80
- [Role.manager]: 'hero/outline/user',
81
- [Role.default]: 'hero/outline/user',
82
- }
@@ -1,100 +0,0 @@
1
- export var VenueAudience = /** @type {const} */ ({
2
- 'Any': 'Any',
3
- 'All': 'All',
4
- 'Restricted': 'Restricted',
5
- 'Unknown': 'Unknown',
6
- })
7
-
8
- export var VenueAudiences = [
9
- VenueAudience['Any'],
10
- VenueAudience['All'],
11
- VenueAudience['Restricted'],
12
- VenueAudience['Unknown'],
13
- ]
14
-
15
- export var PersistedVenueAudiences = [
16
- VenueAudience['All'],
17
- VenueAudience['Restricted'],
18
- ]
19
-
20
- var VenueAudienceShape = {
21
- [VenueAudience['All']]: {
22
- is_adult: false,
23
- },
24
-
25
- [VenueAudience['Restricted']]: {
26
- is_adult: true,
27
- },
28
-
29
- [VenueAudience['Unknown']]: {
30
- is_adult: null,
31
- },
32
- }
33
-
34
- var VenueAudienceShapes = Object.entries(VenueAudienceShape)
35
-
36
- export var VenueAudienceTitle = {
37
- [VenueAudience['Any']]: 'Любая',
38
- [VenueAudience['All']]: 'Открытая',
39
- [VenueAudience['Restricted']]: 'Закрытая',
40
- [VenueAudience['Unknown']]: 'Неизвестно',
41
- }
42
-
43
- export var VenueAudienceIcon = {
44
- [VenueAudience['Any']]: 'hero/outline/square-2-stack',
45
- [VenueAudience['All']]: 'hero/outline/lock-open',
46
- [VenueAudience['Restricted']]: 'hero/outline/lock-closed',
47
- [VenueAudience['Unknown']]: 'hero/outline/no-symbol',
48
- }
49
-
50
- /**
51
- * @returns {keyof typeof VenueAudience}
52
- */
53
- var fromString = value =>
54
- value in VenueAudience
55
- ? value
56
- : VenueAudience['Unknown']
57
-
58
- /**
59
- * @returns {keyof typeof VenueAudience}
60
- */
61
- var fromObject = value =>
62
- VenueAudienceShapes
63
- .find(([, shape]) => shape.is_adult === value?.is_adult)
64
- ?.at(0)
65
- ?? VenueAudience['Unknown']
66
-
67
- /**
68
- * @returns {typeof VenueAudienceShape[keyof typeof VenueAudienceShape]}
69
- */
70
- var toObject = value =>
71
- VenueAudienceShapes
72
- .find(([venueAudience, shape]) => venueAudience === value)
73
- ?.at(1)
74
- ?? VenueAudienceShape[VenueAudience['Unknown']]
75
-
76
- /**
77
- * @returns {keyof typeof VenueAudience}
78
- */
79
- export var inferVenueAudience = value => {
80
- switch (typeof value) {
81
- case 'string':
82
- return fromString(value)
83
-
84
- case 'object':
85
- return fromObject(value)
86
-
87
- default:
88
- return VenueAudience['Unknown']
89
- }
90
- }
91
-
92
- export var inferVenueAudienceShape = value => {
93
- switch (typeof value) {
94
- case 'string':
95
- return toObject(value)
96
-
97
- default:
98
- return VenueAudienceShape[VenueAudience['Unknown']]
99
- }
100
- }
@@ -1,44 +0,0 @@
1
- export var VenueCityMode = /** @type {const} */ ({
2
- 'Any': 'Any',
3
- 'Known': 'Known',
4
- 'Unknown': 'Unknown',
5
- })
6
-
7
- export var VenueCityModes = [
8
- VenueCityMode['Any'],
9
- VenueCityMode['Known'],
10
- VenueCityMode['Unknown'],
11
- ]
12
-
13
- export var VenueCityModeTitle = /** @type {const} */ ({
14
- [VenueCityMode['Any']]: 'Любой',
15
- [VenueCityMode['Known']]: 'Назначен',
16
- [VenueCityMode['Unknown']]: 'Неизвестно',
17
- })
18
-
19
- export var VenueCityModeIcon = {
20
- [VenueCityMode['Any']]: 'hero/outline/square-2-stack',
21
- [VenueCityMode['Known']]: 'hero/outline/check',
22
- [VenueCityMode['Unknown']]: 'hero/outline/no-symbol',
23
- }
24
-
25
- /**
26
- * @returns {keyof typeof VenueCityMode}
27
- */
28
- var inferString = value =>
29
- value in VenueCityMode
30
- ? value
31
- : VenueCityMode['Unknown']
32
-
33
- export var inferVenueCityMode = value => {
34
- switch (typeof value) {
35
- case 'string':
36
- return inferString(value)
37
-
38
- case 'object':
39
- return inferString(value?.mode)
40
-
41
- default:
42
- return VenueCityMode['Unknown']
43
- }
44
- }
@@ -1,53 +0,0 @@
1
- export var VenueStatus = /** @type {const} */ ({
2
- 'ANY': 'ANY',
3
- 'ACTIVE': 'ACTIVE',
4
- 'ARCHIVE': 'ARCHIVE',
5
- 'UNKNOWN': 'UNKNOWN',
6
- })
7
-
8
- export var VenueStatuses = [
9
- VenueStatus['ANY'],
10
- VenueStatus['ACTIVE'],
11
- VenueStatus['ARCHIVE'],
12
- VenueStatus['UNKNOWN'],
13
- ]
14
-
15
- export var PersistedVenueStatuses = [
16
- VenueStatus['ACTIVE'],
17
- VenueStatus['ARCHIVE'],
18
- ]
19
-
20
- export var VenueStatusTitle = {
21
- [VenueStatus['ANY']]: 'Любой',
22
- [VenueStatus['ACTIVE']]: 'Активно',
23
- [VenueStatus['ARCHIVE']]: 'Архив',
24
- [VenueStatus['UNKNOWN']]: 'Неизвестно',
25
- }
26
-
27
- export var VenueStatusIcon = {
28
- [VenueStatus['ANY']]: 'hero/outline/square-2-stack',
29
- [VenueStatus['ACTIVE']]: 'hero/outline/check',
30
- [VenueStatus['ARCHIVE']]: 'hero/outline/archive-box',
31
- [VenueStatus['UNKNOWN']]: 'hero/outline/no-symbol',
32
- }
33
-
34
- /**
35
- * @returns {keyof typeof VenueStatus}
36
- */
37
- var get = value =>
38
- value in VenueStatus
39
- ? value
40
- : VenueStatus['UNKNOWN']
41
-
42
- export var getVenueStatus = value => {
43
- switch (typeof value) {
44
- case 'string':
45
- return get(value)
46
-
47
- case 'object':
48
- return get(value?.status)
49
-
50
- default:
51
- return get(undefined)
52
- }
53
- }
@@ -1,76 +0,0 @@
1
- export var Version = /** @type {const} */ ({
2
- 'Actual': 'Actual',
3
- 'Legacy': 'Legacy',
4
- 'Unknown': 'Unknown',
5
- })
6
-
7
- export var Versions = Object.values(Version)
8
-
9
- export var VersionWeight = {
10
- [Version['Actual']]: 0,
11
- [Version['Legacy']]: 1,
12
- [Version['Unknown']]: 2,
13
- }
14
-
15
- export var VersionTitle = {
16
- [Version['Actual']]: 'Актуальная',
17
- [Version['Legacy']]: 'Старая',
18
- [Version['Unknown']]: 'Неизвестно',
19
- }
20
-
21
- export var ChatappVersion = {
22
- [Version['Actual']]: Version['Actual'],
23
- [Version['Legacy']]: Version['Legacy'],
24
- [Version['Unknown']]: Version['Unknown'],
25
- }
26
-
27
- export var ChatappVersions = Object.values(ChatappVersion)
28
-
29
- export var ChatappVersionWeight = {
30
- [Version['Actual']]: 0,
31
- [Version['Legacy']]: 1,
32
- [Version['Unknown']]: 2,
33
- }
34
-
35
- export var ChatappVersionTitle = {
36
- [Version['Actual']]: VersionTitle['Actual'],
37
- [Version['Legacy']]: VersionTitle['Legacy'],
38
- [Version['Unknown']]: VersionTitle['Unknown'],
39
- }
40
-
41
- export var ChatappVersionShape = /** @type {const} */ ({
42
- [Version['Actual']]: {
43
- chatapp_legacy: false,
44
- },
45
-
46
- [Version['Legacy']]: {
47
- chatapp_legacy: true,
48
- },
49
-
50
- [Version['Unknown']]: {
51
- chatapp_legacy: null,
52
- },
53
- })
54
-
55
- export var ChatappVersionShapes = Object.entries(ChatappVersionShape)
56
-
57
- export var getChatappVersion = value => {
58
- if (value === null)
59
- return ChatappVersion['Unknown']
60
-
61
- switch (typeof value) {
62
- case 'object':
63
- return ChatappVersionShapes
64
- .find(([, shape]) => shape.chatapp_legacy === value.chatapp_legacy)
65
- ?.at(0)
66
- ?? ChatappVersion['Unknown']
67
-
68
- case 'string':
69
- return value in ChatappVersionShape
70
- ? ChatappVersionShape[value]
71
- : ChatappVersionShape[ChatappVersion['Unknown']]
72
-
73
- default:
74
- return ChatappVersion['Unknown']
75
- }
76
- }