@shakerquiz/utilities 0.4.7 → 0.4.9

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@shakerquiz/utilities",
3
- "version": "0.4.7",
3
+ "version": "0.4.9",
4
4
  "author": "yurkimus <yurkimus@gmail.com>",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -0,0 +1,9 @@
1
+ type Checkin = {
2
+ email: UserTable['email']
3
+ first_name: UserTable['first_name']
4
+ id: UserTable['id']
5
+ last_name: UserTable['last_name']
6
+ phone: UserTable['phone']
7
+ third_name: UserTable['third_name']
8
+ role: RoleResponse
9
+ }
package/source/city.d.ts CHANGED
@@ -1,29 +1,4 @@
1
- type CityAdminResult = CityRow
2
-
3
- type CityOrganizerResult = CityRow
4
-
5
- type CityDefaultResult = {
6
- address: CityRow['address']
7
- alias: CityRow['alias']
8
- country: CityRow['country']
9
- custom_html: CityRow['custom_html']
10
- custom_script: CityRow['custom_script']
11
- email: CityRow['email']
12
- id: CityRow['id']
13
- inst_link: CityRow['inst_link']
14
- max_members_count: CityRow['max_members_count']
15
- meta_description: CityRow['meta_description']
16
- meta_title: CityRow['meta_title']
17
- min_members_count: CityRow['min_members_count']
18
- name: CityRow['name']
19
- phone: CityRow['phone']
20
- tg_link: CityRow['tg_link']
21
- vk_group_id: CityRow['vk_group_id']
22
- vk_link: CityRow['vk_link']
23
- yandex_metrica: CityRow['yandex_metrica']
24
- }
25
-
26
- type CityRow = {
1
+ type CityTable = {
27
2
  /**
28
3
  * @description "timestamp with time zone"
29
4
  */
@@ -193,3 +168,24 @@ type CityRow = {
193
168
  */
194
169
  inst_link: string | null
195
170
  }
171
+
172
+ type CityResponse = {
173
+ address: CityTable['address']
174
+ alias: CityTable['alias']
175
+ country: CityTable['country']
176
+ custom_html: CityTable['custom_html']
177
+ custom_script: CityTable['custom_script']
178
+ email: CityTable['email']
179
+ id: CityTable['id']
180
+ inst_link: CityTable['inst_link']
181
+ max_members_count: CityTable['max_members_count']
182
+ meta_description: CityTable['meta_description']
183
+ meta_title: CityTable['meta_title']
184
+ min_members_count: CityTable['min_members_count']
185
+ name: CityTable['name']
186
+ phone: CityTable['phone']
187
+ tg_link: CityTable['tg_link']
188
+ vk_group_id: CityTable['vk_group_id']
189
+ vk_link: CityTable['vk_link']
190
+ yandex_metrica: CityTable['yandex_metrica']
191
+ }
@@ -1,8 +1,8 @@
1
1
  export const Domains: readonly ["Asset", "User", "Role", "City", "Venue", "Theme", "ThemeAsset", "Game", "GameAsset", "Registration", "Mailing"];
2
2
  /**
3
- * @type {Record<Domains[number], Icon>}
3
+ * @type {Record<Domain, Icon>}
4
4
  */
5
- export const DomainIcon: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Icon>;
5
+ export const DomainIcon: Record<Domain, Icon>;
6
6
  export namespace DomainKindPathname {
7
7
  namespace User {
8
8
  let Unit: "/user/:user?";
@@ -53,9 +53,9 @@ export namespace DomainKindPathname {
53
53
  }
54
54
  export const Procedures: readonly ["Checkin", "Redirect"];
55
55
  /**
56
- * @type {Record<Procedures[number], Icon>}
56
+ * @type {Record<Procedure, Icon>}
57
57
  */
58
- export const ProcedureIcon: Record<"Checkin" | "Redirect", Icon>;
58
+ export const ProcedureIcon: Record<Procedure, Icon>;
59
59
  export namespace ProcedureKindPathname {
60
60
  namespace Checkin {
61
61
  let Unit_8: "/checkin";
@@ -70,11 +70,14 @@ export namespace ProcedureKindPathname {
70
70
  export { Set_9 as Set };
71
71
  }
72
72
  }
73
- export const Features: ("Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing")[];
74
73
  /**
75
- * @type {Record<Features[number], Icon>}
74
+ * @type {Array<Domain | Procedure>}
76
75
  */
77
- export const FeatureIcon: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Icon>;
76
+ export const Features: Array<Domain | Procedure>;
77
+ /**
78
+ * @type {Record<Feature, Icon>}
79
+ */
80
+ export const FeatureIcon: Record<Feature, Icon>;
78
81
  export namespace FeatureKindPathname {
79
82
  export namespace Checkin_1 { }
80
83
  export { Checkin_1 as Checkin };
@@ -98,6 +101,10 @@ export namespace FeatureKindPathname {
98
101
  export { Mailing_1 as Mailing };
99
102
  }
100
103
  /**
101
- * @type {Array<[feature: Features[number], kind: Kind, pathname: string]>}
104
+ * @type {Array<[feature: Feature, kind: Kind, pathname: string]>}
105
+ */
106
+ export const FeatureKindPathnames: Array<[feature: Feature, kind: Kind, pathname: string]>;
107
+ /**
108
+ * @type {Array<[feature: Feature, kind: Kind, pattern: URLPattern]>}
102
109
  */
103
- export const FeatureKindPathnames: Array<[feature: "Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", kind: Kind, pathname: string]>;
110
+ export const FeatureKindPatterns: Array<[feature: Feature, kind: Kind, pattern: URLPattern]>;
@@ -13,7 +13,7 @@ export var Domains = /** @type {const} */ ([
13
13
  ])
14
14
 
15
15
  /**
16
- * @type {Record<Domains[number], Icon>}
16
+ * @type {Record<Domain, Icon>}
17
17
  */
18
18
  export var DomainIcon = {
19
19
  'User': 'users',
@@ -27,7 +27,7 @@ export var DomainIcon = {
27
27
  }
28
28
 
29
29
  /**
30
- * @satisfies {Record<Domains[number], Record<Kind, string>>}
30
+ * @satisfies {Record<Domain, Record<Kind, string>>}
31
31
  */
32
32
  export var DomainKindPathname = /** @type {const} */ ({
33
33
  'User': {
@@ -77,7 +77,7 @@ export var Procedures = /** @type {const} */ ([
77
77
  ])
78
78
 
79
79
  /**
80
- * @type {Record<Procedures[number], Icon>}
80
+ * @type {Record<Procedure, Icon>}
81
81
  */
82
82
  export var ProcedureIcon = {
83
83
  'Checkin': 'arrow-right-end-on-rectangle',
@@ -85,7 +85,7 @@ export var ProcedureIcon = {
85
85
  }
86
86
 
87
87
  /**
88
- * @satisfies {Record<Procedures[number], Record<Kind, string>>}
88
+ * @satisfies {Record<Procedure, Record<Kind, string>>}
89
89
  */
90
90
  export var ProcedureKindPathname = /** @type {const} */ ({
91
91
  'Checkin': {
@@ -99,10 +99,13 @@ export var ProcedureKindPathname = /** @type {const} */ ({
99
99
  },
100
100
  })
101
101
 
102
+ /**
103
+ * @type {Array<Domain | Procedure>}
104
+ */
102
105
  export var Features = Domains.concat(Procedures)
103
106
 
104
107
  /**
105
- * @type {Record<Features[number], Icon>}
108
+ * @type {Record<Feature, Icon>}
106
109
  */
107
110
  export var FeatureIcon = {
108
111
  ...DomainIcon,
@@ -110,7 +113,7 @@ export var FeatureIcon = {
110
113
  }
111
114
 
112
115
  /**
113
- * @satisfies {Record<Features[number], Record<Kind, string>>}
116
+ * @satisfies {Record<Feature, Record<Kind, string>>}
114
117
  */
115
118
  export var FeatureKindPathname = {
116
119
  ...DomainKindPathname,
@@ -118,7 +121,7 @@ export var FeatureKindPathname = {
118
121
  }
119
122
 
120
123
  /**
121
- * @type {Array<[feature: Features[number], kind: Kind, pathname: string]>}
124
+ * @type {Array<[feature: Feature, kind: Kind, pathname: string]>}
122
125
  */
123
126
  export var FeatureKindPathnames = Object
124
127
  .keys(FeatureKindPathname)
@@ -127,3 +130,13 @@ export var FeatureKindPathnames = Object
127
130
  .keys(FeatureKindPathname[feature])
128
131
  .map(kind => [feature, kind, FeatureKindPathname[feature][kind]])
129
132
  )
133
+
134
+ /**
135
+ * @type {Array<[feature: Feature, kind: Kind, pattern: URLPattern]>}
136
+ */
137
+ export var FeatureKindPatterns = FeatureKindPathnames
138
+ .map(([feature, kind, pathname]) => [
139
+ feature,
140
+ kind,
141
+ new URLPattern({ pathname }),
142
+ ])
@@ -1 +1 @@
1
- export const Roles: readonly ["admin", "organizer"];
1
+ export const Roles: readonly ["admin", "default", "organizer"];
@@ -1,4 +1,5 @@
1
1
  export var Roles = /** @type {const} */ ([
2
2
  'admin',
3
+ 'default',
3
4
  'organizer',
4
5
  ])
package/source/game.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  type GameAdminResult = {
2
2
  // City
3
- city_alias: CityRow['alias']
4
- city_id: CityRow['id']
5
- city_is_franchise: CityRow['is_franchise']
6
- city_name: CityRow['name']
3
+ city_alias: CityTable['alias']
4
+ city_id: CityTable['id']
5
+ city_is_franchise: CityTable['is_franchise']
6
+ city_name: CityTable['name']
7
7
  // Event
8
8
  event_alias: GameRow['alias']
9
9
  event_id: GameRow['id']
@@ -11,26 +11,26 @@ type GameAdminResult = {
11
11
  event_status: GameRow['status']
12
12
  event_time: GameRow['event_time']
13
13
  // Location
14
- location_id: VenueRow['id']
15
- location_name: VenueRow['name']
14
+ location_id: VenueTable['id']
15
+ location_name: VenueTable['name']
16
16
  // Media
17
- media_id: ImageMediaRow['id']
18
- media_path: ImageMediaRow['path']
19
- media_title: ImageMediaRow['title']
17
+ media_id: ImageMediaTable['id']
18
+ media_path: ImageMediaTable['path']
19
+ media_title: ImageMediaTable['title']
20
20
  // Custom
21
21
  people_amount: number
22
22
  people_reserve_amount: number
23
23
  teams_amount: number
24
24
  teams_reserve_amount: number
25
25
  // Theme
26
- theme_id: ThemeRow['id']
27
- theme_name: ThemeRow['name']
26
+ theme_id: ThemeTable['id']
27
+ theme_name: ThemeTable['name']
28
28
  }
29
29
 
30
30
  type GameDefaultResult = {
31
31
  // City
32
- city_alias: CityRow['alias']
33
- city_id: CityRow['id']
32
+ city_alias: CityTable['alias']
33
+ city_id: CityTable['id']
34
34
  // Event
35
35
  event_alias: GameRow['alias']
36
36
  event_currency: GameRow['currency']
@@ -42,29 +42,29 @@ type GameDefaultResult = {
42
42
  event_status: GameRow['status']
43
43
  event_time: GameRow['event_time']
44
44
  // Image
45
- image_id: ImageMediaRow['id']
45
+ image_id: ImageMediaTable['id']
46
46
  // Location
47
- location_house_number: VenueRow['house_number']
48
- location_id: VenueRow['id']
49
- location_info: VenueRow['location_info']
50
- location_name: VenueRow['name']
51
- location_street: VenueRow['street']
47
+ location_house_number: VenueTable['house_number']
48
+ location_id: VenueTable['id']
49
+ location_info: VenueTable['location_info']
50
+ location_name: VenueTable['name']
51
+ location_street: VenueTable['street']
52
52
  // Media
53
- media_id: MediaRow['id']
54
- media_path: MediaRow['path']
53
+ media_id: MediaTable['id']
54
+ media_path: MediaTable['path']
55
55
  // Theme
56
- theme_description: ThemeRow['description']
57
- theme_id: ThemeRow['id']
58
- theme_name: ThemeRow['name']
59
- theme_short_description: ThemeRow['short_description']
56
+ theme_description: ThemeTable['description']
57
+ theme_id: ThemeTable['id']
58
+ theme_name: ThemeTable['name']
59
+ theme_short_description: ThemeTable['short_description']
60
60
  }
61
61
 
62
62
  type GameOrginizerResult = {
63
63
  // City
64
- city_alias: CityRow['alias']
65
- city_id: CityRow['id']
66
- city_is_franchise: CityRow['is_franchise']
67
- city_name: CityRow['name']
64
+ city_alias: CityTable['alias']
65
+ city_id: CityTable['id']
66
+ city_is_franchise: CityTable['is_franchise']
67
+ city_name: CityTable['name']
68
68
  // Event
69
69
  event_alias: GameRow['alias']
70
70
  event_id: GameRow['id']
@@ -72,20 +72,20 @@ type GameOrginizerResult = {
72
72
  event_status: GameRow['status']
73
73
  event_time: GameRow['event_time']
74
74
  // Location
75
- location_id: VenueRow['id']
76
- location_name: VenueRow['name']
75
+ location_id: VenueTable['id']
76
+ location_name: VenueTable['name']
77
77
  // Media
78
- media_id: ImageMediaRow['id']
79
- media_path: ImageMediaRow['path']
80
- media_title: ImageMediaRow['title']
78
+ media_id: ImageMediaTable['id']
79
+ media_path: ImageMediaTable['path']
80
+ media_title: ImageMediaTable['title']
81
81
  // Custom
82
82
  people_amount: number
83
83
  people_reserve_amount: number
84
84
  teams_amount: number
85
85
  teams_reserve_amount: number
86
86
  // Theme
87
- theme_id: ThemeRow['id']
88
- theme_name: ThemeRow['name']
87
+ theme_id: ThemeTable['id']
88
+ theme_name: ThemeTable['name']
89
89
  }
90
90
 
91
91
  type GameRow = {
@@ -13,9 +13,9 @@ interface RequestInit {
13
13
  * React
14
14
  */
15
15
 
16
- type UseState<Type> = [
17
- Type,
18
- import('react').Dispatch<import('react').SetStateAction<Type>>,
16
+ type UseState<T> = [
17
+ T,
18
+ import('react').Dispatch<import('react').SetStateAction<T>>,
19
19
  ]
20
20
 
21
21
  /**
@@ -0,0 +1,30 @@
1
+ type ImageMediaTable = {
2
+ /**
3
+ * @description "uuid"
4
+ */
5
+ media_id: string
6
+ /**
7
+ * @description "integer"
8
+ */
9
+ width: number | null
10
+ /**
11
+ * @description "integer"
12
+ */
13
+ height: number | null
14
+ /**
15
+ * @description "timestamp with time zone"
16
+ */
17
+ time_updated: string | null
18
+ /**
19
+ * @description "uuid"
20
+ */
21
+ id: string
22
+ /**
23
+ * @description "timestamp with time zone"
24
+ */
25
+ time_created: string
26
+ /**
27
+ * @description "character varying"
28
+ */
29
+ file_format: string | null
30
+ }
package/source/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  /// <reference path='./globals.d.ts' />
2
2
 
3
+ /// <reference path='./checkin.d.ts' />
3
4
  /// <reference path='./city.d.ts' />
4
5
  /// <reference path='./game.d.ts' />
6
+ /// <reference path='./image-media.d.ts' />
7
+ /// <reference path='./media.d.ts' />
5
8
  /// <reference path='./registration.d.ts' />
6
9
  /// <reference path='./role.d.ts' />
7
- /// <reference path='./rows.d.ts' />
8
10
  /// <reference path='./theme.d.ts' />
9
11
  /// <reference path='./user.d.ts' />
10
12
  /// <reference path='./venue.d.ts' />
@@ -28,7 +30,6 @@ export * from './enumerations/entities/roles.js'
28
30
 
29
31
  export * from './enumerations/schemas.js'
30
32
 
31
- export * from './functions/pathname.js'
32
33
  export * from './functions/schema.js'
33
34
 
34
35
  export * from './schemas/city.js'
package/source/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  /// <reference path='./game.d.ts' />
5
5
  /// <reference path='./registration.d.ts' />
6
6
  /// <reference path='./role.d.ts' />
7
- /// <reference path='./rows.d.ts' />
7
+ /// <reference path='./media.d.ts' />
8
8
  /// <reference path='./theme.d.ts' />
9
9
  /// <reference path='./user.d.ts' />
10
10
  /// <reference path='./venue.d.ts' />
@@ -28,7 +28,6 @@ export * from './enumerations/entities/roles.js'
28
28
 
29
29
  export * from './enumerations/schemas.js'
30
30
 
31
- export * from './functions/pathname.js'
32
31
  export * from './functions/schema.js'
33
32
 
34
33
  export * from './schemas/city.js'
@@ -0,0 +1,30 @@
1
+ type MediaTable = {
2
+ /**
3
+ * @description "uuid"
4
+ */
5
+ id: string
6
+ /**
7
+ * @description "timestamp with time zone"
8
+ */
9
+ time_created: string
10
+ /**
11
+ * @description "timestamp with time zone"
12
+ */
13
+ time_updated: string | null
14
+ /**
15
+ * @description "character varying"
16
+ */
17
+ title: string | null
18
+ /**
19
+ * @description "character varying"
20
+ */
21
+ cached_link: string | null
22
+ /**
23
+ * @description "character varying"
24
+ */
25
+ description: string | null
26
+ /**
27
+ * @description "character varying"
28
+ */
29
+ path: string | null
30
+ }
@@ -1,26 +1,4 @@
1
- type RegistrationAdminResult = unknown
2
-
3
- type RegistrationDefaultResult = {
4
- id: RegistrationRow['id']
5
- event_id: RegistrationRow['event_id']
6
- team_name: RegistrationRow['team_name']
7
- is_canceled: RegistrationRow['is_canceled']
8
- is_confirm: RegistrationRow['is_confirm']
9
- is_reserve: RegistrationRow['is_reserve']
10
- change_people_count: RegistrationRow['change_people_count']
11
- people_count: RegistrationRow['people_count']
12
- channel: RegistrationRow['channel']
13
- event_time_utc: GameRow['event_time']
14
- event_timezone: GameRow['timezone']
15
- max_members_count: GameRow['max_members_count']
16
- can_cancel: boolean
17
- can_confirm: boolean
18
- can_change_people_count: boolean
19
- }
20
-
21
- type RegistrationOrganizerResult = unknown
22
-
23
- type RegistrationRow = {
1
+ type RegistrationTable = {
24
2
  /**
25
3
  * @description "boolean"
26
4
  */
@@ -150,3 +128,21 @@ type RegistrationRow = {
150
128
  */
151
129
  utm_content: string | null
152
130
  }
131
+
132
+ type RegistrationResponse = {
133
+ can_cancel: boolean
134
+ can_change_people_count: boolean
135
+ can_confirm: boolean
136
+ change_people_count: RegistrationTable['change_people_count']
137
+ channel: RegistrationTable['channel']
138
+ event_id: RegistrationTable['event_id']
139
+ event_time_utc: GameRow['event_time']
140
+ event_timezone: GameRow['timezone']
141
+ id: RegistrationTable['id']
142
+ is_canceled: RegistrationTable['is_canceled']
143
+ is_confirm: RegistrationTable['is_confirm']
144
+ is_reserve: RegistrationTable['is_reserve']
145
+ max_members_count: GameRow['max_members_count']
146
+ people_count: RegistrationTable['people_count']
147
+ team_name: RegistrationTable['team_name']
148
+ }
package/source/role.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type RoleRow = {
1
+ type RoleTable = {
2
2
  /**
3
3
  * @description "uuid"
4
4
  */
@@ -20,3 +20,11 @@ type RoleRow = {
20
20
  */
21
21
  description: string | null
22
22
  }
23
+
24
+ type RoleResponse = {
25
+ id: RoleTable['id']
26
+ time_created: RoleTable['time_created']
27
+ time_updated: RoleTable['time_updated']
28
+ name: RoleTable['name']
29
+ description: RoleTable['description']
30
+ }
package/source/theme.d.ts CHANGED
@@ -1,28 +1,4 @@
1
- type ThemeAdminResult = {
2
- id: ThemeRow['id']
3
- time_created: ThemeRow['time_created']
4
- name: ThemeRow['name']
5
- description: ThemeRow['description']
6
- short_description: ThemeRow['short_description']
7
- image_id: ImageMediaRow['id']
8
- media_title: MediaRow['title']
9
- media_path: MediaRow['path']
10
- }
11
-
12
- type ThemeDefaultResult = unknown
13
-
14
- type ThemeOrganizerResult = {
15
- id: ThemeRow['id']
16
- time_created: ThemeRow['time_created']
17
- name: ThemeRow['name']
18
- description: ThemeRow['description']
19
- short_description: ThemeRow['short_description']
20
- image_id: ImageMediaRow['id']
21
- media_title: MediaRow['title']
22
- media_path: MediaRow['path']
23
- }
24
-
25
- type ThemeRow = {
1
+ type ThemeTable = {
26
2
  /**
27
3
  * @description "timestamp with time zone"
28
4
  */
@@ -52,3 +28,14 @@ type ThemeRow = {
52
28
  */
53
29
  name: string | null
54
30
  }
31
+
32
+ type ThemeResponse = {
33
+ description: ThemeTable['description']
34
+ id: ThemeTable['id']
35
+ image_id: ImageMediaTable['id']
36
+ media_path: MediaTable['path']
37
+ media_title: MediaTable['title']
38
+ name: ThemeTable['name']
39
+ short_description: ThemeTable['short_description']
40
+ time_created: ThemeTable['time_created']
41
+ }
package/source/user.d.ts CHANGED
@@ -1,55 +1,4 @@
1
- type CheckinAdminResult = {
2
- id: UserRow['id']
3
- first_name: UserRow['first_name']
4
- last_name: UserRow['last_name']
5
- third_name: UserRow['third_name']
6
- phone: UserRow['phone']
7
- email: UserRow['email']
8
- image_id: ImageMediaRow['id']
9
- role_id: RoleRow['id']
10
- role_name: RoleRow['name']
11
- }
12
-
13
- type CheckinDefaultResult = {
14
- id: '00000000-0000-0000-0000-000000000000'
15
- role_id: '00000000-0000-0000-0000-000000000000'
16
- role_name: 'default'
17
- }
18
-
19
- type CheckinOrganizerResult = {
20
- id: UserRow['id']
21
- first_name: UserRow['first_name']
22
- last_name: UserRow['last_name']
23
- third_name: UserRow['third_name']
24
- phone: UserRow['phone']
25
- email: UserRow['email']
26
- image_id: ImageMediaRow['id']
27
- role_id: RoleRow['id']
28
- role_name: RoleRow['name']
29
- }
30
-
31
- type UserAdminResult = {
32
- id: UserRow['id']
33
- email: UserRow['email']
34
- phone: UserRow['phone']
35
- first_name: UserRow['first_name']
36
- last_name: UserRow['last_name']
37
- is_active: UserRow['is_active']
38
- gmail_link: UserRow['gmail_link']
39
- mailru_link: UserRow['mailru_link']
40
- role_id: RoleRow['id']
41
- role_name: RoleRow['name']
42
- cities: {
43
- id: CityRow['id']
44
- name: CityRow['name']
45
- }[]
46
- }
47
-
48
- type UserDefaultResult = unknown
49
-
50
- type UserOrganizerResult = unknown
51
-
52
- type UserRow = {
1
+ type UserTable = {
53
2
  /**
54
3
  * @description "uuid"
55
4
  */
@@ -140,3 +89,16 @@ type UserRow = {
140
89
  */
141
90
  gmail_link: string | null
142
91
  }
92
+
93
+ type UserResponse = {
94
+ email: UserTable['email']
95
+ first_name: UserTable['first_name']
96
+ gmail_link: UserTable['gmail_link']
97
+ id: UserTable['id']
98
+ is_active: UserTable['is_active']
99
+ last_name: UserTable['last_name']
100
+ mailru_link: UserTable['mailru_link']
101
+ phone: UserTable['phone']
102
+ role: RoleResponse
103
+ cities: CityResponse[]
104
+ }
package/source/venue.d.ts CHANGED
@@ -1,66 +1,4 @@
1
- type VenueAdminResult = {
2
- // Venue
3
- id: VenueRow['id']
4
- time_created: VenueRow['time_created']
5
- time_updated: VenueRow['time_updated']
6
- longitude: VenueRow['longitude']
7
- latitude: VenueRow['latitude']
8
- people_capacity: VenueRow['people_capacity']
9
- team_capacity: VenueRow['team_capacity']
10
- is_adult: VenueRow['is_adult']
11
- name: VenueRow['name']
12
- house_number: VenueRow['house_number']
13
- comment: VenueRow['comment']
14
- comment_responsible: VenueRow['comment_responsible']
15
- comment_equipment: VenueRow['comment_equipment']
16
- street: VenueRow['street']
17
- game_time: VenueRow['game_time']
18
- floor: VenueRow['floor']
19
- metro: VenueRow['metro']
20
- location_info: VenueRow['location_info']
21
- // City
22
- city_id: CityRow['id']
23
- city_name: CityRow['name']
24
- city_timezone: CityRow['timezone']
25
- city_price: CityRow['price']
26
- city_currency: CityRow['currency']
27
- city_min_members_count: CityRow['min_members_count']
28
- city_max_members_count: CityRow['max_members_count']
29
- }
30
-
31
- type VenueDefaultResult = unknown
32
-
33
- type VenueOrganizerResult = {
34
- // Venue
35
- id: VenueRow['id']
36
- time_created: VenueRow['time_created']
37
- time_updated: VenueRow['time_updated']
38
- longitude: VenueRow['longitude']
39
- latitude: VenueRow['latitude']
40
- people_capacity: VenueRow['people_capacity']
41
- team_capacity: VenueRow['team_capacity']
42
- is_adult: VenueRow['is_adult']
43
- name: VenueRow['name']
44
- house_number: VenueRow['house_number']
45
- comment: VenueRow['comment']
46
- comment_responsible: VenueRow['comment_responsible']
47
- comment_equipment: VenueRow['comment_equipment']
48
- street: VenueRow['street']
49
- game_time: VenueRow['game_time']
50
- floor: VenueRow['floor']
51
- metro: VenueRow['metro']
52
- location_info: VenueRow['location_info']
53
- // City
54
- city_id: CityRow['id']
55
- city_name: CityRow['name']
56
- city_timezone: CityRow['timezone']
57
- city_price: CityRow['price']
58
- city_currency: CityRow['currency']
59
- city_min_members_count: CityRow['min_members_count']
60
- city_max_members_count: CityRow['max_members_count']
61
- }
62
-
63
- type VenueRow = {
1
+ type VenueTable = {
64
2
  /**
65
3
  * @description "uuid"
66
4
  */
@@ -138,3 +76,25 @@ type VenueRow = {
138
76
  */
139
77
  location_info: string | null
140
78
  }
79
+
80
+ type VenueResponse = {
81
+ id: VenueTable['id']
82
+ time_created: VenueTable['time_created']
83
+ time_updated: VenueTable['time_updated']
84
+ longitude: VenueTable['longitude']
85
+ latitude: VenueTable['latitude']
86
+ people_capacity: VenueTable['people_capacity']
87
+ team_capacity: VenueTable['team_capacity']
88
+ is_adult: VenueTable['is_adult']
89
+ name: VenueTable['name']
90
+ house_number: VenueTable['house_number']
91
+ comment: VenueTable['comment']
92
+ comment_responsible: VenueTable['comment_responsible']
93
+ comment_equipment: VenueTable['comment_equipment']
94
+ street: VenueTable['street']
95
+ game_time: VenueTable['game_time']
96
+ floor: VenueTable['floor']
97
+ metro: VenueTable['metro']
98
+ location_info: VenueTable['location_info']
99
+ city: CityResponse
100
+ }
@@ -1 +0,0 @@
1
- export function scopePathname(scope: Scope): string;
@@ -1,35 +0,0 @@
1
- import { is } from '@yurkimus/types'
2
-
3
- import { FeatureKindPathname } from '../enumerations/core/features.js'
4
- import { Scopes } from '../enumerations/core/scopes.js'
5
-
6
- /**
7
- * @param {Scope} scope
8
- */
9
- export var scopePathname = scope => {
10
- if (!Scopes.includes(scope))
11
- throw TypeError(
12
- `[scopePathname] Unknown scope '${scope}': not present in 'Scopes'.`,
13
- )
14
-
15
- var [method, feature, kind] = scope.split('/')
16
-
17
- if (!(feature in FeatureKindPathname))
18
- throw TypeError(
19
- `[scopePathname] Feature '${feature}' is not defined in 'FeatureKindPathname'.`,
20
- )
21
-
22
- if (!(kind in FeatureKindPathname[feature]))
23
- throw TypeError(
24
- `[scopePathname] Kind '${kind}' is not defined under Feature '${feature}' in 'FeatureKindPathname'.`,
25
- )
26
-
27
- if (!is('String', FeatureKindPathname[feature][kind]))
28
- throw TypeError(
29
- `[scopePathname] Invalid value at FeatureKindPathname['${feature}']['${kind}']: expected a string, got '${typeof FeatureKindPathname[
30
- feature
31
- ][kind]}'.`,
32
- )
33
-
34
- return FeatureKindPathname[feature][kind]
35
- }
package/source/rows.d.ts DELETED
@@ -1,61 +0,0 @@
1
- type ImageMediaRow = {
2
- /**
3
- * @description "uuid"
4
- */
5
- media_id: string
6
- /**
7
- * @description "integer"
8
- */
9
- width: number | null
10
- /**
11
- * @description "integer"
12
- */
13
- height: number | null
14
- /**
15
- * @description "timestamp with time zone"
16
- */
17
- time_updated: string | null
18
- /**
19
- * @description "uuid"
20
- */
21
- id: string
22
- /**
23
- * @description "timestamp with time zone"
24
- */
25
- time_created: string
26
- /**
27
- * @description "character varying"
28
- */
29
- file_format: string | null
30
- }
31
-
32
- type MediaRow = {
33
- /**
34
- * @description "uuid"
35
- */
36
- id: string
37
- /**
38
- * @description "timestamp with time zone"
39
- */
40
- time_created: string
41
- /**
42
- * @description "timestamp with time zone"
43
- */
44
- time_updated: string | null
45
- /**
46
- * @description "character varying"
47
- */
48
- title: string | null
49
- /**
50
- * @description "character varying"
51
- */
52
- cached_link: string | null
53
- /**
54
- * @description "character varying"
55
- */
56
- description: string | null
57
- /**
58
- * @description "character varying"
59
- */
60
- path: string | null
61
- }