@shakerquiz/utilities 0.4.15 → 0.4.17

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/source/index.js CHANGED
@@ -1,14 +1,3 @@
1
- /// <reference path='./globals.d.ts' />
2
-
3
- /// <reference path='./city.d.ts' />
4
- /// <reference path='./game.d.ts' />
5
- /// <reference path='./registration.d.ts' />
6
- /// <reference path='./role.d.ts' />
7
- /// <reference path='./media.d.ts' />
8
- /// <reference path='./theme.d.ts' />
9
- /// <reference path='./user.d.ts' />
10
- /// <reference path='./venue.d.ts' />
11
-
12
1
  export * from './enumerations/core/features.js'
13
2
  export * from './enumerations/core/kinds.js'
14
3
  export * from './enumerations/core/methods.js'
@@ -25,15 +14,3 @@ export * from './enumerations/entities/game-statuses.js'
25
14
  export * from './enumerations/entities/lineups.js'
26
15
  export * from './enumerations/entities/registration-statuses.js'
27
16
  export * from './enumerations/entities/roles.js'
28
-
29
- export * from './enumerations/schemas.js'
30
-
31
- export * from './functions/schema.js'
32
-
33
- export * from './schemas/city.js'
34
- export * from './schemas/game.js'
35
- export * from './schemas/registration.js'
36
- export * from './schemas/role.js'
37
- export * from './schemas/theme.js'
38
- export * from './schemas/user.js'
39
- export * from './schemas/venue.js'
@@ -1,9 +0,0 @@
1
- type CheckinResponse = {
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 DELETED
@@ -1,191 +0,0 @@
1
- type CityTable = {
2
- /**
3
- * @description "timestamp with time zone"
4
- */
5
- time_created: string
6
- /**
7
- * @description "integer"
8
- */
9
- timezone: number | null
10
- /**
11
- * @description "boolean"
12
- */
13
- is_default: boolean | null
14
- /**
15
- * @description "boolean"
16
- */
17
- is_franchise: boolean | null
18
- /**
19
- * @description "integer"
20
- */
21
- min_members_count: number | null
22
- /**
23
- * @description "integer"
24
- */
25
- max_members_count: number | null
26
- /**
27
- * @description "boolean"
28
- */
29
- chatapp_legacy: boolean | null
30
- /**
31
- * @description "timestamp with time zone"
32
- */
33
- time_updated: string | null
34
- /**
35
- * @description "double precision"
36
- */
37
- price: number | null
38
- /**
39
- * @description "uuid"
40
- */
41
- id: string
42
- /**
43
- * @description "character varying"
44
- */
45
- inst_login: string | null
46
- /**
47
- * @description "character varying"
48
- */
49
- inst_password: string | null
50
- /**
51
- * @description "character varying"
52
- */
53
- inst_comment: string | null
54
- /**
55
- * @description "character varying"
56
- */
57
- custom_script: string | null
58
- /**
59
- * @description "character varying"
60
- */
61
- custom_html: string | null
62
- /**
63
- * @description "character varying"
64
- */
65
- alias: string | null
66
- /**
67
- * @description "character varying"
68
- */
69
- vk_group_id: string | null
70
- /**
71
- * @description "character varying"
72
- */
73
- chatapp_line: string | null
74
- /**
75
- * @description "character varying"
76
- */
77
- chatapp_user: string | null
78
- /**
79
- * @description "character varying"
80
- */
81
- chatapp_tag: string | null
82
- /**
83
- * @description "character varying"
84
- */
85
- chatapp_category: string | null
86
- /**
87
- * @description "character varying"
88
- */
89
- telegram_chat_id: string | null
90
- /**
91
- * @description "character varying"
92
- */
93
- title: string | null
94
- /**
95
- * @description "character varying"
96
- */
97
- description: string | null
98
- /**
99
- * @description "character varying"
100
- */
101
- region: string | null
102
- /**
103
- * @description "character varying"
104
- */
105
- country: string | null
106
- /**
107
- * @description "character varying"
108
- */
109
- yandex_metrica: string | null
110
- /**
111
- * @description "character varying"
112
- */
113
- meta_title: string | null
114
- /**
115
- * @description "character varying"
116
- */
117
- meta_description: string | null
118
- /**
119
- * @description "character varying"
120
- */
121
- phone: string | null
122
- /**
123
- * @description "character varying"
124
- */
125
- email: string | null
126
- /**
127
- * @description "character varying"
128
- */
129
- name: string | null
130
- /**
131
- * @description "character varying"
132
- */
133
- address: string | null
134
- /**
135
- * @description "character varying"
136
- */
137
- currency: string | null
138
- /**
139
- * @description "character varying"
140
- */
141
- game_time: string | null
142
- /**
143
- * @description "character varying"
144
- */
145
- vk_link: string | null
146
- /**
147
- * @description "character varying"
148
- */
149
- vk_comment: string | null
150
- /**
151
- * @description "character varying"
152
- */
153
- tg_link: string | null
154
- /**
155
- * @description "character varying"
156
- */
157
- tg_login: string | null
158
- /**
159
- * @description "character varying"
160
- */
161
- tg_password: string | null
162
- /**
163
- * @description "character varying"
164
- */
165
- tg_comment: string | null
166
- /**
167
- * @description "character varying"
168
- */
169
- inst_link: string | null
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,16 +0,0 @@
1
- export namespace DomainSchema {
2
- export { UserSchema as User };
3
- export { RoleSchema as Role };
4
- export { CitySchema as City };
5
- export { VenueSchema as Venue };
6
- export { ThemeSchema as Theme };
7
- export { GameSchema as Game };
8
- export { RegistrationSchema as Registration };
9
- }
10
- import { UserSchema } from '../schemas/user.js';
11
- import { RoleSchema } from '../schemas/role.js';
12
- import { CitySchema } from '../schemas/city.js';
13
- import { VenueSchema } from '../schemas/venue.js';
14
- import { ThemeSchema } from '../schemas/theme.js';
15
- import { GameSchema } from '../schemas/game.js';
16
- import { RegistrationSchema } from '../schemas/registration.js';
@@ -1,17 +0,0 @@
1
- import { CitySchema } from '../schemas/city.js'
2
- import { GameSchema } from '../schemas/game.js'
3
- import { RegistrationSchema } from '../schemas/registration.js'
4
- import { RoleSchema } from '../schemas/role.js'
5
- import { ThemeSchema } from '../schemas/theme.js'
6
- import { UserSchema } from '../schemas/user.js'
7
- import { VenueSchema } from '../schemas/venue.js'
8
-
9
- export var DomainSchema = /** @type {const} */ ({
10
- 'User': UserSchema,
11
- 'Role': RoleSchema,
12
- 'City': CitySchema,
13
- 'Venue': VenueSchema,
14
- 'Theme': ThemeSchema,
15
- 'Game': GameSchema,
16
- 'Registration': RegistrationSchema,
17
- })
@@ -1,5 +0,0 @@
1
- /**
2
- * @param {Feature} feature
3
- * @param {*} object
4
- */
5
- export function validateSchema(feature: Feature, object: any): void;
@@ -1,59 +0,0 @@
1
- import { DomainSchema } from '../enumerations/schemas.js'
2
-
3
- /**
4
- * @param {Feature} feature
5
- * @param {*} object
6
- */
7
- export function validateSchema(feature, object) {
8
- if (!(feature in DomainSchema))
9
- throw TypeError(
10
- `[validateSchema] Parameter 'feature' '${feature}' must be a member of 'Schemas'.`,
11
- )
12
-
13
- let schema = DomainSchema[feature]
14
-
15
- for (let property in object)
16
- if (!(property in schema))
17
- throw TypeError(
18
- `[validateSchema] Property '${property}' must be a member of '${columns}'.`,
19
- )
20
-
21
- for (let property in object) {
22
- let descriptor = schema[property]
23
- let value = value[property]
24
-
25
- if (!is(descriptor.type, value))
26
- throw TypeError(
27
- `[validateSchema] Property '${property}' must be of type '${descriptor.type}'.`,
28
- )
29
-
30
- switch (descriptor.type) {
31
- case 'String':
32
- if ('minLength' in descriptor) {
33
- if (!is('Number', descriptor.minLength))
34
- throw TypeError(
35
- `[validateSchema] Descriptor 'minLength' must be a 'Number' when presented.`,
36
- )
37
-
38
- if (value.length < descriptor.minLength)
39
- throw TypeError(
40
- `[validateSchema] String '${value}' length should not be less than '${descriptor.minLength}'.`,
41
- )
42
- }
43
-
44
- if ('maxLength' in descriptor) {
45
- if (!is('Number', descriptor.maxLength))
46
- throw TypeError(
47
- `[validateSchema] Descriptor 'maxLength' must be a 'Number' when presented.`,
48
- )
49
-
50
- if (value.length > descriptor.maxLength)
51
- throw TypeError(
52
- `[validateSchema] String '${value}' length should not be more than '${descriptor.maxLength}'.`,
53
- )
54
- }
55
-
56
- break
57
- }
58
- }
59
- }
package/source/game.d.ts DELETED
@@ -1,188 +0,0 @@
1
- type GameAdminResult = {
2
- // City
3
- city_alias: CityTable['alias']
4
- city_id: CityTable['id']
5
- city_is_franchise: CityTable['is_franchise']
6
- city_name: CityTable['name']
7
- // Event
8
- event_alias: GameRow['alias']
9
- event_id: GameRow['id']
10
- event_number: GameRow['number']
11
- event_status: GameRow['status']
12
- event_time: GameRow['event_time']
13
- // Location
14
- location_id: VenueTable['id']
15
- location_name: VenueTable['name']
16
- // Media
17
- media_id: ImageMediaTable['id']
18
- media_path: ImageMediaTable['path']
19
- media_title: ImageMediaTable['title']
20
- // Custom
21
- people_amount: number
22
- people_reserve_amount: number
23
- teams_amount: number
24
- teams_reserve_amount: number
25
- // Theme
26
- theme_id: ThemeTable['id']
27
- theme_name: ThemeTable['name']
28
- }
29
-
30
- type GameDefaultResult = {
31
- // City
32
- city_alias: CityTable['alias']
33
- city_id: CityTable['id']
34
- // Event
35
- event_alias: GameRow['alias']
36
- event_currency: GameRow['currency']
37
- event_id: GameRow['id']
38
- event_max_members_count: GameRow['max_members_count']
39
- event_min_members_count: GameRow['min_members_count']
40
- event_number: GameRow['number']
41
- event_price: GameRow['price']
42
- event_status: GameRow['status']
43
- event_time: GameRow['event_time']
44
- // Image
45
- image_id: ImageMediaTable['id']
46
- // Location
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
- // Media
53
- media_id: MediaTable['id']
54
- media_path: MediaTable['path']
55
- // Theme
56
- theme_description: ThemeTable['description']
57
- theme_id: ThemeTable['id']
58
- theme_name: ThemeTable['name']
59
- theme_short_description: ThemeTable['short_description']
60
- }
61
-
62
- type GameOrginizerResult = {
63
- // City
64
- city_alias: CityTable['alias']
65
- city_id: CityTable['id']
66
- city_is_franchise: CityTable['is_franchise']
67
- city_name: CityTable['name']
68
- // Event
69
- event_alias: GameRow['alias']
70
- event_id: GameRow['id']
71
- event_number: GameRow['number']
72
- event_status: GameRow['status']
73
- event_time: GameRow['event_time']
74
- // Location
75
- location_id: VenueTable['id']
76
- location_name: VenueTable['name']
77
- // Media
78
- media_id: ImageMediaTable['id']
79
- media_path: ImageMediaTable['path']
80
- media_title: ImageMediaTable['title']
81
- // Custom
82
- people_amount: number
83
- people_reserve_amount: number
84
- teams_amount: number
85
- teams_reserve_amount: number
86
- // Theme
87
- theme_id: ThemeTable['id']
88
- theme_name: ThemeTable['name']
89
- }
90
-
91
- type GameRow = {
92
- /**
93
- * @description "uuid"
94
- */
95
- city_id: string | null
96
- /**
97
- * @description "uuid"
98
- */
99
- game_pack_id: string | null
100
- /**
101
- * @description "uuid"
102
- */
103
- id: string
104
- /**
105
- * @description "timestamp with time zone"
106
- */
107
- time_created: string
108
- /**
109
- * @description "timestamp with time zone"
110
- */
111
- time_updated: string | null
112
- /**
113
- * @description "uuid"
114
- */
115
- owner_id: string
116
- /**
117
- * @description "integer"
118
- */
119
- timezone: number | null
120
- /**
121
- * @description "integer"
122
- */
123
- min_members_count: number | null
124
- /**
125
- * @description "integer"
126
- */
127
- max_members_count: number | null
128
- /**
129
- * @description "USER-DEFINED"
130
- */
131
- status: GameStatus
132
- /**
133
- * @description "timestamp without time zone"
134
- */
135
- event_time: string | null
136
- /**
137
- * @description "double precision"
138
- */
139
- price: number | null
140
- /**
141
- * @description "uuid"
142
- */
143
- created_by_id: string
144
- /**
145
- * @description "uuid"
146
- */
147
- image_id: string | null
148
- /**
149
- * @description "uuid"
150
- */
151
- location_id: string
152
- /**
153
- * @description "uuid"
154
- */
155
- theme_id: string
156
- /**
157
- * @description "character varying"
158
- */
159
- description: string | null
160
- /**
161
- * @description "character varying"
162
- */
163
- number: string | null
164
- /**
165
- * @description "character varying"
166
- */
167
- short_description: string | null
168
- /**
169
- * @description "character varying"
170
- */
171
- personal_comment: string | null
172
- /**
173
- * @description "character varying"
174
- */
175
- weekday: string | null
176
- /**
177
- * @description "character varying"
178
- */
179
- alias: string | null
180
- /**
181
- * @description "character varying"
182
- */
183
- name: string | null
184
- /**
185
- * @description "character varying"
186
- */
187
- currency: string | null
188
- }
@@ -1,89 +0,0 @@
1
- /**
2
- * Mixins
3
- */
4
-
5
- interface RequestInit {
6
- /**
7
- * @description A method string defined by RFC7231 @see {@link https://datatracker.ietf.org/doc/html/rfc7231#section-4.3}
8
- */
9
- method?: Method
10
- }
11
-
12
- /**
13
- * React
14
- */
15
-
16
- type UseState<T> = [
17
- T,
18
- import('react').Dispatch<import('react').SetStateAction<T>>,
19
- ]
20
-
21
- /**
22
- * Core
23
- */
24
-
25
- type Method = (typeof import('./enumerations/core/methods.js').Methods)[number]
26
-
27
- type Domain = (typeof import('./enumerations/core/features.js').Domains)[number]
28
-
29
- type Procedure =
30
- (typeof import('./enumerations/core/features.js').Procedures)[number]
31
-
32
- type Feature = Domain | Procedure
33
-
34
- type Kind = (typeof import('./enumerations/core/kinds.js').Kinds)[number]
35
-
36
- type Scope = `${Method}/${Feature}/${Kind}`
37
-
38
- type Role = (typeof import('./enumerations/entities/roles.js').Roles)[number]
39
-
40
- type GameStatus =
41
- (typeof import('./enumerations/entities/game-statuses.js').GameStatuses)[
42
- number
43
- ]
44
-
45
- type RegistrationStatus =
46
- (typeof import('./enumerations/entities/registration-statuses.js').RegistrationStatuses)[
47
- number
48
- ]
49
-
50
- type Lineup =
51
- (typeof import('./enumerations/entities/lineups.js').Lineups)[number]
52
-
53
- type Affilation =
54
- (typeof import('./enumerations/entities/affilations.js').Affilations)[number]
55
-
56
- /**
57
- * Misc
58
- */
59
-
60
- type Icon = (typeof import('./enumerations/misc/icons.js').Icons)[number]
61
-
62
- type Phase = (typeof import('./enumerations/misc/phases.js').Phases)[number]
63
-
64
- /**
65
- * Products
66
- */
67
-
68
- type ScopePhase = Record<Scope, Phase>
69
-
70
- type ScopeState = Record<Scope, any>
71
-
72
- type ScopeController = Record<Scope, AbortController | null>
73
-
74
- /**
75
- * Schemas
76
- */
77
-
78
- type CityColumn = keyof typeof import('./schemas/city.js').CityColumns
79
-
80
- type GameColumn = keyof typeof import('./schemas/game.js').GameColumns
81
-
82
- type RegistrationColumn =
83
- keyof typeof import('./schemas/registration.js').RegistrationColumns
84
-
85
- type ThemeColumn = keyof typeof import('./schemas/theme.js').ThemeColumns
86
-
87
- type UserColumn = keyof typeof import('./schemas/user.js').UserColumns
88
-
89
- type VenueColumn = keyof typeof import('./schemas/venue.js').VenueColumns
@@ -1,30 +0,0 @@
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/media.d.ts DELETED
@@ -1,30 +0,0 @@
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
- }