@shakerquiz/utilities 1.0.0 → 3.0.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.
Files changed (94) hide show
  1. package/dprint.json +4 -12
  2. package/jsconfig.json +13 -6
  3. package/package.json +9 -12
  4. package/source/enumerations/core/features.js +56 -0
  5. package/source/enumerations/core/methods.js +16 -0
  6. package/source/enumerations/core/networks.js +6 -0
  7. package/source/enumerations/core/runtimes.js +6 -0
  8. package/source/enumerations/entities/affilation.js +91 -0
  9. package/source/enumerations/entities/cities-mode.js +49 -0
  10. package/source/enumerations/entities/city/timezone-mode.js +44 -0
  11. package/source/enumerations/entities/city/venues-mode.js +60 -0
  12. package/source/enumerations/entities/game-status.js +130 -0
  13. package/source/enumerations/entities/password-mode.js +40 -0
  14. package/source/enumerations/entities/registration-attribute.js +83 -0
  15. package/source/enumerations/entities/registration-channel.js +26 -0
  16. package/source/enumerations/entities/registration-lineup.js +75 -0
  17. package/source/enumerations/entities/registration-mailing.js +24 -0
  18. package/source/enumerations/entities/registration-status.js +89 -0
  19. package/source/enumerations/entities/role-mode.js +40 -0
  20. package/source/enumerations/entities/role.js +82 -0
  21. package/source/enumerations/entities/venue/audience.js +100 -0
  22. package/source/enumerations/entities/venue/city-mode.js +44 -0
  23. package/source/enumerations/entities/venue/status.js +53 -0
  24. package/source/enumerations/entities/version.js +76 -0
  25. package/source/enumerations/{constants.js → misc/constants.js} +2 -2
  26. package/source/enumerations/misc/icons.js +655 -0
  27. package/source/enumerations/misc/keys.js +15 -0
  28. package/source/enumerations/misc/phases.js +42 -0
  29. package/source/enumerations/misc/regexps.js +5 -0
  30. package/source/enumerations/misc/routes.js +610 -0
  31. package/source/functions/tag.d.ts +1 -0
  32. package/source/functions/tag.js +5 -0
  33. package/source/index.js +34 -11
  34. package/source/schemas/PATCH/city/admin.json +126 -0
  35. package/source/schemas/PATCH/city/currency/admin.json +173 -0
  36. package/source/schemas/PATCH/city/timezone/admin.json +501 -0
  37. package/source/schemas/PATCH/game/admin.json +30 -0
  38. package/source/schemas/PATCH/game/organizer.json +30 -0
  39. package/source/schemas/PATCH/registration/admin.json +43 -0
  40. package/source/schemas/PATCH/registration/cancellation/default.json +12 -0
  41. package/source/schemas/PATCH/registration/channel/default.json +22 -0
  42. package/source/schemas/PATCH/registration/confirmation/default.json +12 -0
  43. package/source/schemas/PATCH/registration/default.json +10 -0
  44. package/source/schemas/PATCH/registration/organizer.json +43 -0
  45. package/source/schemas/PATCH/theme/admin.json +19 -0
  46. package/source/schemas/PATCH/user/admin.json +30 -0
  47. package/source/schemas/PATCH/user/cities/admin.json +17 -0
  48. package/source/schemas/PATCH/user/password/admin.json +12 -0
  49. package/source/schemas/PATCH/user/role/admin.json +13 -0
  50. package/source/schemas/PATCH/venue/admin.json +44 -0
  51. package/source/schemas/PATCH/venue/organizer.json +44 -0
  52. package/source/schemas/POST/checkin/default.json +16 -0
  53. package/source/schemas/POST/city/admin.json +696 -0
  54. package/source/schemas/POST/game/admin.json +27 -0
  55. package/source/schemas/POST/game/organizer.json +27 -0
  56. package/source/schemas/POST/game/registrations/export/admin.json +17 -0
  57. package/source/schemas/POST/game/registrations/export/organizer.json +17 -0
  58. package/source/schemas/POST/registration/default.json +125 -0
  59. package/source/schemas/POST/registration/mailing/admin.json +16 -0
  60. package/source/schemas/POST/registration/mailing/organizer.json +16 -0
  61. package/source/schemas/POST/registrations/export/admin.json +17 -0
  62. package/source/schemas/POST/registrations/export/organizer.json +17 -0
  63. package/source/schemas/POST/theme/admin.json +24 -0
  64. package/source/schemas/POST/user/admin.json +12 -0
  65. package/source/schemas/POST/user/cities/admin.json +17 -0
  66. package/source/schemas/POST/user/password/admin.json +12 -0
  67. package/source/schemas/POST/user/role/admin.json +13 -0
  68. package/source/schemas/POST/venue/admin.json +38 -0
  69. package/source/schemas/POST/venue/organizer.json +38 -0
  70. package/source/enumerations/constants.d.ts +0 -3
  71. package/source/enumerations/cookies.d.ts +0 -5
  72. package/source/enumerations/cookies.js +0 -5
  73. package/source/enumerations/features.d.ts +0 -58
  74. package/source/enumerations/features.js +0 -49
  75. package/source/enumerations/game-statuses.d.ts +0 -39
  76. package/source/enumerations/game-statuses.js +0 -39
  77. package/source/enumerations/kinds.d.ts +0 -4
  78. package/source/enumerations/kinds.js +0 -4
  79. package/source/enumerations/methods.d.ts +0 -7
  80. package/source/enumerations/methods.js +0 -7
  81. package/source/enumerations/networks.d.ts +0 -4
  82. package/source/enumerations/networks.js +0 -4
  83. package/source/enumerations/phases.d.ts +0 -7
  84. package/source/enumerations/phases.js +0 -7
  85. package/source/enumerations/regexps.d.ts +0 -4
  86. package/source/enumerations/regexps.js +0 -6
  87. package/source/enumerations/roles.d.ts +0 -5
  88. package/source/enumerations/roles.js +0 -5
  89. package/source/functions/request.d.ts +0 -131
  90. package/source/functions/request.js +0 -202
  91. package/source/globals.d.ts +0 -14
  92. package/source/index.d.ts +0 -15
  93. package/source/results.d.ts +0 -137
  94. package/source/rows.d.ts +0 -533
@@ -0,0 +1,27 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "location_id": {
5
+ "type": "string",
6
+ "format": "uuid"
7
+ },
8
+ "theme_id": {
9
+ "type": "string",
10
+ "format": "uuid"
11
+ },
12
+ "number": {
13
+ "type": "string"
14
+ },
15
+ "event_time": {
16
+ "type": "string",
17
+ "format": "iso-date-time"
18
+ }
19
+ },
20
+ "required": [
21
+ "location_id",
22
+ "theme_id",
23
+ "number",
24
+ "event_time"
25
+ ],
26
+ "additionalProperties": false
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "location_id": {
5
+ "type": "string",
6
+ "format": "uuid"
7
+ },
8
+ "theme_id": {
9
+ "type": "string",
10
+ "format": "uuid"
11
+ },
12
+ "number": {
13
+ "type": "string"
14
+ },
15
+ "event_time": {
16
+ "type": "string",
17
+ "format": "iso-date-time"
18
+ }
19
+ },
20
+ "required": [
21
+ "location_id",
22
+ "theme_id",
23
+ "number",
24
+ "event_time"
25
+ ],
26
+ "additionalProperties": false
27
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type": "array",
3
+ "items": {
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "format": "uuid"
9
+ }
10
+ },
11
+ "required": [
12
+ "id"
13
+ ],
14
+ "additionalProperties": false
15
+ },
16
+ "uniqueItems": true
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type": "array",
3
+ "items": {
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "format": "uuid"
9
+ }
10
+ },
11
+ "required": [
12
+ "id"
13
+ ],
14
+ "additionalProperties": false
15
+ },
16
+ "uniqueItems": true
17
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "ads_from": {
5
+ "type": "string"
6
+ },
7
+ "channel": {
8
+ "type": "string"
9
+ },
10
+ "confirmed_channel": {
11
+ "type": "string"
12
+ },
13
+ "comment": {
14
+ "type": "string"
15
+ },
16
+ "email": {
17
+ "type": "string"
18
+ },
19
+ "event_id": {
20
+ "type": "string",
21
+ "format": "uuid"
22
+ },
23
+ "human_name": {
24
+ "type": "string"
25
+ },
26
+ "is_alone": {
27
+ "type": "boolean"
28
+ },
29
+ "is_birthday": {
30
+ "type": "boolean"
31
+ },
32
+ "is_extensible": {
33
+ "type": "boolean"
34
+ },
35
+ "is_first": {
36
+ "type": "boolean"
37
+ },
38
+ "people_count": {
39
+ "type": "integer"
40
+ },
41
+ "phone": {
42
+ "type": "string"
43
+ },
44
+ "promocode": {
45
+ "type": "string"
46
+ },
47
+ "team_name": {
48
+ "type": "string"
49
+ },
50
+ "telegramBot": {
51
+ "type": "string"
52
+ },
53
+ "utm_campaign": {
54
+ "type": "string"
55
+ },
56
+ "utm_content": {
57
+ "type": "string"
58
+ },
59
+ "utm_medium": {
60
+ "type": "string"
61
+ },
62
+ "utm_source": {
63
+ "type": "string"
64
+ },
65
+ "utm_term": {
66
+ "type": "string"
67
+ },
68
+ "vkontakte": {
69
+ "type": "string"
70
+ }
71
+ },
72
+ "required": [
73
+ "event_id",
74
+ "human_name",
75
+ "is_alone",
76
+ "is_birthday",
77
+ "is_extensible",
78
+ "is_first",
79
+ "people_count",
80
+ "team_name",
81
+ "channel",
82
+ "email"
83
+ ],
84
+ "additionalProperties": false,
85
+ "allOf": [
86
+ {
87
+ "if": {
88
+ "properties": {
89
+ "channel": {
90
+ "const": "telegramBot"
91
+ }
92
+ },
93
+ "required": [
94
+ "channel"
95
+ ]
96
+ },
97
+ "then": {
98
+ "required": [
99
+ "channel",
100
+ "confirmed_channel",
101
+ "telegramBot"
102
+ ]
103
+ }
104
+ },
105
+ {
106
+ "if": {
107
+ "properties": {
108
+ "channel": {
109
+ "const": "vkontakte"
110
+ }
111
+ },
112
+ "required": [
113
+ "channel"
114
+ ]
115
+ },
116
+ "then": {
117
+ "required": [
118
+ "channel",
119
+ "confirmed_channel",
120
+ "vkontakte"
121
+ ]
122
+ }
123
+ }
124
+ ]
125
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "template": {
5
+ "type": "string"
6
+ },
7
+ "text": {
8
+ "type": "string"
9
+ }
10
+ },
11
+ "required": [
12
+ "template",
13
+ "text"
14
+ ],
15
+ "additionalProperties": false
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "template": {
5
+ "type": "string"
6
+ },
7
+ "text": {
8
+ "type": "string"
9
+ }
10
+ },
11
+ "required": [
12
+ "template",
13
+ "text"
14
+ ],
15
+ "additionalProperties": false
16
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type": "array",
3
+ "items": {
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "format": "uuid"
9
+ }
10
+ },
11
+ "required": [
12
+ "id"
13
+ ],
14
+ "additionalProperties": false
15
+ },
16
+ "uniqueItems": true
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type": "array",
3
+ "items": {
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "format": "uuid"
9
+ }
10
+ },
11
+ "required": [
12
+ "id"
13
+ ],
14
+ "additionalProperties": false
15
+ },
16
+ "uniqueItems": true
17
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "name": {
5
+ "type": "string"
6
+ },
7
+ "short_description": {
8
+ "type": "string"
9
+ },
10
+ "description": {
11
+ "type": "string"
12
+ },
13
+ "alias": {
14
+ "type": "string"
15
+ }
16
+ },
17
+ "required": [
18
+ "name",
19
+ "short_description",
20
+ "description",
21
+ "alias"
22
+ ],
23
+ "additionalProperties": false
24
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "email": {
5
+ "type": "string"
6
+ }
7
+ },
8
+ "required": [
9
+ "email"
10
+ ],
11
+ "additionalProperties": false
12
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type": "array",
3
+ "items": {
4
+ "type": "object",
5
+ "properties": {
6
+ "id": {
7
+ "type": "string",
8
+ "format": "uuid"
9
+ }
10
+ },
11
+ "required": [
12
+ "id"
13
+ ],
14
+ "additionalProperties": false
15
+ },
16
+ "uniqueItems": true
17
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "password": {
5
+ "type": "string"
6
+ }
7
+ },
8
+ "required": [
9
+ "password"
10
+ ],
11
+ "additionalProperties": false
12
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "id": {
5
+ "type": "string",
6
+ "format": "uuid"
7
+ }
8
+ },
9
+ "required": [
10
+ "id"
11
+ ],
12
+ "additionalProperties": false
13
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "name": {
5
+ "type": "string"
6
+ },
7
+ "street": {
8
+ "type": "string"
9
+ },
10
+ "house_number": {
11
+ "type": "string"
12
+ },
13
+ "people_capacity": {
14
+ "type": "integer"
15
+ },
16
+ "team_capacity": {
17
+ "type": "integer"
18
+ },
19
+ "game_time": {
20
+ "type": "string",
21
+ "format": "iso-time"
22
+ },
23
+ "city_id": {
24
+ "type": "string",
25
+ "format": "uuid"
26
+ }
27
+ },
28
+ "required": [
29
+ "name",
30
+ "street",
31
+ "house_number",
32
+ "people_capacity",
33
+ "team_capacity",
34
+ "game_time",
35
+ "city_id"
36
+ ],
37
+ "additionalProperties": false
38
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "name": {
5
+ "type": "string"
6
+ },
7
+ "street": {
8
+ "type": "string"
9
+ },
10
+ "house_number": {
11
+ "type": "string"
12
+ },
13
+ "people_capacity": {
14
+ "type": "integer"
15
+ },
16
+ "team_capacity": {
17
+ "type": "integer"
18
+ },
19
+ "game_time": {
20
+ "type": "string",
21
+ "format": "iso-time"
22
+ },
23
+ "city_id": {
24
+ "type": "string",
25
+ "format": "uuid"
26
+ }
27
+ },
28
+ "required": [
29
+ "name",
30
+ "street",
31
+ "house_number",
32
+ "people_capacity",
33
+ "team_capacity",
34
+ "game_time",
35
+ "city_id"
36
+ ],
37
+ "additionalProperties": false
38
+ }
@@ -1,3 +0,0 @@
1
- export let Constants: {
2
- NilUuid: '00000000-0000-0000-0000-000000000000'
3
- }
@@ -1,5 +0,0 @@
1
- export let Cookies: {
2
- Token: 'shaker-quiz-token',
3
- Refresh: 'shaker-quiz-refresh-token',
4
- Role: 'shaker-quiz-user-role',
5
- }
@@ -1,5 +0,0 @@
1
- export let Cookies = {
2
- Token: 'shaker-quiz-token',
3
- Refresh: 'shaker-quiz-refresh-token',
4
- Role: 'shaker-quiz-user-role',
5
- }
@@ -1,58 +0,0 @@
1
- import { URLOptions } from '@yurkimus/url'
2
-
3
- import { Kinds } from './kinds'
4
- import { Networks } from './networks'
5
-
6
- export let Features: {
7
- Checkin: 'Checkin'
8
-
9
- City: 'City'
10
- Cities: 'Cities'
11
-
12
- CityPublic: 'CityPublic'
13
- CitiesPublic: 'CitiesPublic'
14
-
15
- Game: 'Game'
16
- Games: 'Games'
17
-
18
- GamePublic: 'GamePublic'
19
- GamesPublic: 'GamesPublic'
20
-
21
- Theme: 'Theme'
22
- Themes: 'Themes'
23
-
24
- User: 'User'
25
- Users: 'Users'
26
- }
27
-
28
- export let FeatureKinds: {
29
- [Features.Checkin]: Kinds.Item
30
-
31
- [Features.City]: Kinds.Item
32
- [Features.Cities]: Kinds.List
33
-
34
- [Features.CityPublic]: Kinds.Item
35
- [Features.CitiesPublic]: Kinds.List
36
-
37
- [Features.Game]: Kinds.Item
38
- [Features.Games]: Kinds.List
39
-
40
- [Features.GamePublic]: Kinds.Item
41
- [Features.GamesPublic]: Kinds.List
42
-
43
- [Features.Theme]: Kinds.Item
44
- [Features.Themes]: Kinds.List
45
-
46
- [Features.User]: Kinds.Item
47
- [Features.Users]: Kinds.List
48
- }
49
-
50
- export let FeatureRequests: Map<
51
- keyof typeof Features,
52
- Set<'DELETE' | 'GET' | 'OPTIONS' | 'POST' | 'PATCH'>
53
- >
54
-
55
- export let FeatureUrls: Map<
56
- keyof typeof Features,
57
- Map<keyof typeof Networks, (options: URLOptions) => URL>
58
- >
@@ -1,49 +0,0 @@
1
- import { Kinds } from './kinds.js'
2
-
3
- export let Features = {
4
- Checkin: 'Checkin',
5
-
6
- City: 'City',
7
- Cities: 'Cities',
8
-
9
- CityPublic: 'CityPublic',
10
- CitiesPublic: 'CitiesPublic',
11
-
12
- Game: 'Game',
13
- Games: 'Games',
14
-
15
- GamePublic: 'GamePublic',
16
- GamesPublic: 'GamesPublic',
17
-
18
- Theme: 'Theme',
19
- Themes: 'Themes',
20
-
21
- User: 'User',
22
- Users: 'Users',
23
- }
24
-
25
- export let FeatureKinds = {
26
- [Features.Checkin]: Kinds.Item,
27
-
28
- [Features.City]: Kinds.Item,
29
- [Features.Cities]: Kinds.List,
30
-
31
- [Features.CityPublic]: Kinds.Item,
32
- [Features.CitiesPublic]: Kinds.List,
33
-
34
- [Features.Game]: Kinds.Item,
35
- [Features.Games]: Kinds.List,
36
-
37
- [Features.GamePublic]: Kinds.Item,
38
- [Features.GamesPublic]: Kinds.List,
39
-
40
- [Features.Theme]: Kinds.Item,
41
- [Features.Themes]: Kinds.List,
42
-
43
- [Features.User]: Kinds.Item,
44
- [Features.Users]: Kinds.List,
45
- }
46
-
47
- export let FeatureRequests = new Map()
48
-
49
- export let FeatureUrls = new Map()
@@ -1,39 +0,0 @@
1
- import { Roles } from './roles.js'
2
-
3
- export let GameStatuses: {
4
- Approved: 'APPROVED'
5
- Archive: 'ARCHIVE'
6
- Closed: 'CLOSED'
7
- Finished: 'FINISHED'
8
- Invitation: 'FORINVITES'
9
- Moderation: 'MODERATION'
10
- Published: 'PUBLISHED'
11
- Rejected: 'REJECTED'
12
- Reserved: 'IS_RESERVE'
13
- }
14
-
15
- export let RoleGameStatuses: {
16
- [Roles.Admin]: [
17
- typeof GameStatuses.Approved,
18
- typeof GameStatuses.Moderation,
19
- typeof GameStatuses.Published,
20
- typeof GameStatuses.Rejected,
21
- typeof GameStatuses.Finished,
22
- typeof GameStatuses.Archive,
23
- typeof GameStatuses.Invitation,
24
- typeof GameStatuses.Reserved,
25
- typeof GameStatuses.Closed,
26
- ]
27
-
28
- [Roles.Organizer]: [
29
- typeof GameStatuses.Approved,
30
- typeof GameStatuses.Published,
31
- typeof GameStatuses.Finished,
32
- typeof GameStatuses.Archive,
33
- typeof GameStatuses.Invitation,
34
- typeof GameStatuses.Reserved,
35
- typeof GameStatuses.Closed,
36
- ]
37
-
38
- [Roles.Default]: []
39
- }
@@ -1,39 +0,0 @@
1
- import { Roles } from './roles.js'
2
-
3
- export let GameStatuses = {
4
- Approved: 'APPROVED',
5
- Archive: 'ARCHIVE',
6
- Closed: 'CLOSED',
7
- Finished: 'FINISHED',
8
- Invitation: 'FORINVITES',
9
- Moderation: 'MODERATION',
10
- Published: 'PUBLISHED',
11
- Rejected: 'REJECTED',
12
- Reserved: 'IS_RESERVE',
13
- }
14
-
15
- export let RoleGameStatuses = {
16
- [Roles.Admin]: [
17
- GameStatuses.Approved,
18
- GameStatuses.Moderation,
19
- GameStatuses.Published,
20
- GameStatuses.Rejected,
21
- GameStatuses.Finished,
22
- GameStatuses.Archive,
23
- GameStatuses.Invitation,
24
- GameStatuses.Reserved,
25
- GameStatuses.Closed,
26
- ],
27
-
28
- [Roles.Organizer]: [
29
- GameStatuses.Approved,
30
- GameStatuses.Published,
31
- GameStatuses.Finished,
32
- GameStatuses.Archive,
33
- GameStatuses.Invitation,
34
- GameStatuses.Reserved,
35
- GameStatuses.Closed,
36
- ],
37
-
38
- [Roles.Default]: [],
39
- }
@@ -1,4 +0,0 @@
1
- export let Kinds: {
2
- Item: 'Item'
3
- List: 'List'
4
- }
@@ -1,4 +0,0 @@
1
- export let Kinds = {
2
- Item: 'Item',
3
- List: 'List',
4
- }
@@ -1,7 +0,0 @@
1
- export let Methods: {
2
- DELETE: 'DELETE'
3
- GET: 'GET'
4
- OPTIONS: 'OPTIONS'
5
- PATCH: 'PATCH'
6
- POST: 'POST'
7
- }
@@ -1,7 +0,0 @@
1
- export let Methods = {
2
- DELETE: 'DELETE',
3
- GET: 'GET',
4
- OPTIONS: 'OPTIONS',
5
- PATCH: 'PATCH',
6
- POST: 'POST',
7
- }