@shakerquiz/utilities 0.4.16 → 0.4.18

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.
@@ -1,187 +0,0 @@
1
- type User = {
2
- email: string | null
3
- first_name: string | null
4
- gmail_link: string | null
5
- hashed_password: string | null
6
- id: string
7
- image_id: string | null
8
- is_active: boolean | null
9
- is_superuser: boolean | null
10
- is_verified: boolean | null
11
- last_name: string | null
12
- mailru_link: string | null
13
- phone: string | null
14
- role_id: string
15
- telegram_data: string | null
16
- telegram_id: string | null
17
- third_name: string | null
18
- time_created: string
19
- time_updated: string | null
20
- }
21
-
22
- type Role = {
23
- description: string | null
24
- id: string
25
- name: Role
26
- time_created: string
27
- time_updated: string | null
28
- }
29
-
30
- type City = {
31
- address: string | null
32
- alias: string | null
33
- chatapp_category: string | null
34
- chatapp_legacy: boolean | null
35
- chatapp_line: string | null
36
- chatapp_tag: string | null
37
- chatapp_user: string | null
38
- country: string | null
39
- currency: string | null
40
- custom_html: string | null
41
- custom_script: string | null
42
- description: string | null
43
- email: string | null
44
- game_time: string | null
45
- id: string
46
- inst_comment: string | null
47
- inst_link: string | null
48
- inst_login: string | null
49
- inst_password: string | null
50
- is_default: boolean | null
51
- is_franchise: boolean | null
52
- max_members_count: number | null
53
- meta_description: string | null
54
- meta_title: string | null
55
- min_members_count: number | null
56
- name: string | null
57
- phone: string | null
58
- price: number | null
59
- region: string | null
60
- telegram_chat_id: string | null
61
- tg_comment: string | null
62
- tg_link: string | null
63
- tg_login: string | null
64
- tg_password: string | null
65
- time_created: string
66
- time_updated: string | null
67
- timezone: number | null
68
- title: string | null
69
- vk_comment: string | null
70
- vk_group_id: string | null
71
- vk_link: string | null
72
- yandex_metrica: string | null
73
- }
74
-
75
- type Venue = {
76
- city_id: string | null
77
- comment_equipment: string | null
78
- comment_responsible: string | null
79
- comment: string | null
80
- floor: string | null
81
- game_time: string | null
82
- house_number: string | null
83
- id: string
84
- is_adult: boolean | null
85
- latitude: number | null
86
- location_info: string | null
87
- longitude: number | null
88
- metro: string | null
89
- name: string | null
90
- people_capacity: number | null
91
- street: string | null
92
- team_capacity: number | null
93
- time_created: string
94
- time_updated: string
95
- }
96
-
97
- type Theme = {
98
- description: string | null
99
- id: string
100
- image_id: string
101
- name: string | null
102
- short_description: string | null
103
- time_created: string
104
- time_updated: string
105
- }
106
-
107
- type Game = {
108
- alias: string | null
109
- city_id: string | null
110
- created_by_id: string
111
- currency: string | null
112
- description: string | null
113
- event_time: string | null
114
- game_pack_id: string | null
115
- id: string
116
- image_id: string | null
117
- location_id: string
118
- max_members_count: number | null
119
- min_members_count: number | null
120
- name: string | null
121
- number: string | null
122
- owner_id: string
123
- personal_comment: string | null
124
- price: number | null
125
- short_description: string | null
126
- status: GameStatus
127
- theme_id: string
128
- time_created: string
129
- time_updated: string | null
130
- timezone: number | null
131
- weekday: string | null
132
- }
133
-
134
- type Registration = {
135
- ads_from: string | null
136
- change_people_count: number | null
137
- channel: string | null
138
- chatapp_id: string | null
139
- comment: string | null
140
- email: string | null
141
- event_id: string
142
- fact_people_count: number | null
143
- human_name: string | null
144
- id: string
145
- is_actual_presence: boolean | null
146
- is_alone: boolean | null
147
- is_birthday: boolean | null
148
- is_canceled: boolean | null
149
- is_confirm: boolean | null
150
- is_extensible: boolean | null
151
- is_first: boolean | null
152
- is_reserve: boolean | null
153
- last_broadcast: string | null
154
- people_count: number | null
155
- phone: string | null
156
- promocode: string | null
157
- team_name: string | null
158
- telegramBot: string | null
159
- time_created: string
160
- time_updated: string | null
161
- utm_campaign: string | null
162
- utm_content: string | null
163
- utm_medium: string | null
164
- utm_source: string | null
165
- utm_term: string | null
166
- vkontakte: string | null
167
- }
168
-
169
- type Media = {
170
- id: string
171
- time_created: string
172
- time_updated: string | null
173
- title: string | null
174
- cached_link: string | null
175
- description: string | null
176
- path: string | null
177
- }
178
-
179
- type ImageMedia = {
180
- file_format: string | null
181
- height: number | null
182
- id: string
183
- media_id: string
184
- time_created: string
185
- time_updated: string | null
186
- width: number | null
187
- }
@@ -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
- }
@@ -1,72 +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>
@@ -1,275 +0,0 @@
1
- export namespace CitySchema {
2
- namespace address {
3
- let type: "String";
4
- let minLength: 1;
5
- let maxLength: 255;
6
- }
7
- namespace alias {
8
- let type_1: "String";
9
- export { type_1 as type };
10
- let minLength_1: 1;
11
- export { minLength_1 as minLength };
12
- let maxLength_1: 255;
13
- export { maxLength_1 as maxLength };
14
- }
15
- namespace chatapp_category {
16
- let type_2: "String";
17
- export { type_2 as type };
18
- }
19
- namespace chatapp_legacy {
20
- let type_3: "Boolean";
21
- export { type_3 as type };
22
- }
23
- namespace chatapp_line {
24
- let type_4: "String";
25
- export { type_4 as type };
26
- let minLength_2: 1;
27
- export { minLength_2 as minLength };
28
- let maxLength_2: 255;
29
- export { maxLength_2 as maxLength };
30
- }
31
- namespace chatapp_tag {
32
- let type_5: "String";
33
- export { type_5 as type };
34
- let minLength_3: 1;
35
- export { minLength_3 as minLength };
36
- let maxLength_3: 255;
37
- export { maxLength_3 as maxLength };
38
- }
39
- namespace chatapp_user {
40
- let type_6: "String";
41
- export { type_6 as type };
42
- let minLength_4: 1;
43
- export { minLength_4 as minLength };
44
- let maxLength_4: 255;
45
- export { maxLength_4 as maxLength };
46
- }
47
- namespace country {
48
- let type_7: "String";
49
- export { type_7 as type };
50
- let minLength_5: 2;
51
- export { minLength_5 as minLength };
52
- let maxLength_5: 2;
53
- export { maxLength_5 as maxLength };
54
- }
55
- namespace currency {
56
- let type_8: "String";
57
- export { type_8 as type };
58
- let minLength_6: 3;
59
- export { minLength_6 as minLength };
60
- let maxLength_6: 3;
61
- export { maxLength_6 as maxLength };
62
- }
63
- namespace custom_html {
64
- let type_9: "String";
65
- export { type_9 as type };
66
- }
67
- namespace custom_script {
68
- let type_10: "String";
69
- export { type_10 as type };
70
- }
71
- namespace description {
72
- let type_11: "String";
73
- export { type_11 as type };
74
- let minLength_7: 1;
75
- export { minLength_7 as minLength };
76
- let maxLength_7: 255;
77
- export { maxLength_7 as maxLength };
78
- }
79
- namespace email {
80
- let type_12: "String";
81
- export { type_12 as type };
82
- let minLength_8: 1;
83
- export { minLength_8 as minLength };
84
- let maxLength_8: 255;
85
- export { maxLength_8 as maxLength };
86
- export let format: "email";
87
- }
88
- namespace game_time {
89
- let type_13: "String";
90
- export { type_13 as type };
91
- let format_1: "time";
92
- export { format_1 as format };
93
- }
94
- namespace id {
95
- let type_14: "String";
96
- export { type_14 as type };
97
- let format_2: "uuid";
98
- export { format_2 as format };
99
- }
100
- namespace inst_comment {
101
- let type_15: "String";
102
- export { type_15 as type };
103
- export let deprecated: true;
104
- }
105
- namespace inst_link {
106
- let type_16: "String";
107
- export { type_16 as type };
108
- let deprecated_1: true;
109
- export { deprecated_1 as deprecated };
110
- }
111
- namespace inst_login {
112
- let type_17: "String";
113
- export { type_17 as type };
114
- let deprecated_2: true;
115
- export { deprecated_2 as deprecated };
116
- }
117
- namespace inst_password {
118
- let type_18: "String";
119
- export { type_18 as type };
120
- let deprecated_3: true;
121
- export { deprecated_3 as deprecated };
122
- }
123
- namespace is_default {
124
- let type_19: "Boolean";
125
- export { type_19 as type };
126
- }
127
- namespace is_franchise {
128
- let type_20: "Boolean";
129
- export { type_20 as type };
130
- }
131
- namespace max_members_count {
132
- let type_21: "Number";
133
- export { type_21 as type };
134
- let format_3: "integer";
135
- export { format_3 as format };
136
- }
137
- namespace meta_description {
138
- let type_22: "String";
139
- export { type_22 as type };
140
- let minLength_9: 1;
141
- export { minLength_9 as minLength };
142
- let maxLength_9: 255;
143
- export { maxLength_9 as maxLength };
144
- }
145
- namespace meta_title {
146
- let type_23: "String";
147
- export { type_23 as type };
148
- let minLength_10: 1;
149
- export { minLength_10 as minLength };
150
- let maxLength_10: 255;
151
- export { maxLength_10 as maxLength };
152
- }
153
- namespace min_members_count {
154
- let type_24: "Number";
155
- export { type_24 as type };
156
- let format_4: "integer";
157
- export { format_4 as format };
158
- }
159
- namespace name {
160
- let type_25: "String";
161
- export { type_25 as type };
162
- let minLength_11: 1;
163
- export { minLength_11 as minLength };
164
- let maxLength_11: 255;
165
- export { maxLength_11 as maxLength };
166
- }
167
- namespace phone {
168
- let type_26: "String";
169
- export { type_26 as type };
170
- let minLength_12: 1;
171
- export { minLength_12 as minLength };
172
- let maxLength_12: 255;
173
- export { maxLength_12 as maxLength };
174
- }
175
- namespace price {
176
- let type_27: "Number";
177
- export { type_27 as type };
178
- let format_5: "float";
179
- export { format_5 as format };
180
- }
181
- namespace region {
182
- let type_28: "String";
183
- export { type_28 as type };
184
- let minLength_13: 1;
185
- export { minLength_13 as minLength };
186
- let maxLength_13: 255;
187
- export { maxLength_13 as maxLength };
188
- }
189
- namespace telegram_chat_id {
190
- let type_29: "String";
191
- export { type_29 as type };
192
- let minLength_14: 1;
193
- export { minLength_14 as minLength };
194
- let maxLength_14: 255;
195
- export { maxLength_14 as maxLength };
196
- }
197
- namespace tg_comment {
198
- let type_30: "String";
199
- export { type_30 as type };
200
- let minLength_15: 1;
201
- export { minLength_15 as minLength };
202
- let maxLength_15: 255;
203
- export { maxLength_15 as maxLength };
204
- }
205
- namespace tg_link {
206
- let type_31: "String";
207
- export { type_31 as type };
208
- let minLength_16: 1;
209
- export { minLength_16 as minLength };
210
- let maxLength_16: 255;
211
- export { maxLength_16 as maxLength };
212
- }
213
- namespace tg_login {
214
- let type_32: "String";
215
- export { type_32 as type };
216
- let deprecated_4: true;
217
- export { deprecated_4 as deprecated };
218
- let minLength_17: 1;
219
- export { minLength_17 as minLength };
220
- let maxLength_17: 255;
221
- export { maxLength_17 as maxLength };
222
- }
223
- namespace tg_password {
224
- let type_33: "String";
225
- export { type_33 as type };
226
- let deprecated_5: true;
227
- export { deprecated_5 as deprecated };
228
- let minLength_18: 1;
229
- export { minLength_18 as minLength };
230
- let maxLength_18: 255;
231
- export { maxLength_18 as maxLength };
232
- }
233
- namespace time_created {
234
- let type_34: "String";
235
- export { type_34 as type };
236
- let format_6: "Date";
237
- export { format_6 as format };
238
- }
239
- namespace time_updated {
240
- let type_35: "String";
241
- export { type_35 as type };
242
- let format_7: "Date";
243
- export { format_7 as format };
244
- }
245
- namespace timezone {
246
- let type_36: "String";
247
- export { type_36 as type };
248
- let format_8: "integer";
249
- export { format_8 as format };
250
- }
251
- namespace title {
252
- let type_37: "String";
253
- export { type_37 as type };
254
- let minLength_19: 1;
255
- export { minLength_19 as minLength };
256
- let maxLength_19: 255;
257
- export { maxLength_19 as maxLength };
258
- }
259
- namespace vk_comment {
260
- let type_38: "String";
261
- export { type_38 as type };
262
- }
263
- namespace vk_group_id {
264
- let type_39: "String";
265
- export { type_39 as type };
266
- }
267
- namespace vk_link {
268
- let type_40: "String";
269
- export { type_40 as type };
270
- }
271
- namespace yandex_metrica {
272
- let type_41: "String";
273
- export { type_41 as type };
274
- }
275
- }