@shakerquiz/utilities 0.3.9 → 0.3.11

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 (45) hide show
  1. package/jsconfig.json +11 -8
  2. package/package.json +1 -4
  3. package/source/city.d.ts +40 -40
  4. package/source/enumerations/backends.d.ts +44 -0
  5. package/source/enumerations/backends.js +60 -0
  6. package/source/enumerations/default.d.ts +1 -0
  7. package/source/enumerations/default.js +1 -0
  8. package/source/enumerations/domains.d.ts +469 -0
  9. package/source/enumerations/domains.js +346 -0
  10. package/source/enumerations/features.d.ts +260 -401
  11. package/source/enumerations/features.js +26 -852
  12. package/source/enumerations/frontends.d.ts +34 -0
  13. package/source/enumerations/frontends.js +48 -0
  14. package/source/enumerations/game-statuses.d.ts +0 -6
  15. package/source/enumerations/game-statuses.js +0 -28
  16. package/source/enumerations/icons.d.ts +326 -0
  17. package/source/enumerations/icons.js +326 -0
  18. package/source/enumerations/kinds.d.ts +2 -2
  19. package/source/enumerations/kinds.js +2 -2
  20. package/source/enumerations/{request-methods.d.ts → methods.d.ts} +1 -1
  21. package/source/enumerations/{request-methods.js → methods.js} +1 -1
  22. package/source/enumerations/procedures.d.ts +74 -0
  23. package/source/enumerations/procedures.js +76 -0
  24. package/source/enumerations/roles.d.ts +2 -4
  25. package/source/enumerations/roles.js +0 -1
  26. package/source/enumerations/services.d.ts +48 -9
  27. package/source/enumerations/services.js +21 -30
  28. package/source/functions/fetch.d.ts +9 -15
  29. package/source/functions/fetch.js +76 -120
  30. package/source/functions/origin.d.ts +213 -1
  31. package/source/functions/origin.js +78 -40
  32. package/source/functions/pathname.d.ts +1 -0
  33. package/source/functions/pathname.js +40 -0
  34. package/source/functions/url.d.ts +1 -0
  35. package/source/functions/url.js +48 -0
  36. package/source/game.d.ts +17 -17
  37. package/source/globals.d.ts +22 -669
  38. package/source/index.d.ts +33 -14
  39. package/source/index.js +20 -1
  40. package/source/registration.d.ts +29 -29
  41. package/source/role.d.ts +3 -3
  42. package/source/rows.d.ts +9 -9
  43. package/source/theme.d.ts +3 -3
  44. package/source/user.d.ts +15 -15
  45. package/source/venue.d.ts +17 -17
@@ -0,0 +1,48 @@
1
+ import { DomainServiceDefaults } from '../enumerations/domains.js'
2
+ import { Features } from '../enumerations/features.js'
3
+ import { Kinds } from '../enumerations/kinds.js'
4
+ import { Networks } from '../enumerations/networks.js'
5
+ import { ProcedureServiceDefaults } from '../enumerations/procedures.js'
6
+ import { Services } from '../enumerations/services.js'
7
+
8
+ import { getFeatureOrigin } from './origin.js'
9
+ import { getFeaturePathname } from './pathname.js'
10
+
11
+ /**
12
+ * @param {Feature} feature
13
+ * @param {Service} service
14
+ * @param {Network} [network]
15
+ * @param {Kind} [kind]
16
+ */
17
+ export var getFeatureUrl = (
18
+ feature,
19
+ service = DomainServiceDefaults[feature]
20
+ ?? ProcedureServiceDefaults[feature],
21
+ network = Networks.Public,
22
+ kind = Kinds.Unit,
23
+ ) => {
24
+ if (!(feature in Features))
25
+ throw TypeError(
26
+ `Parameter 'feature' must be a member of 'Features'.`,
27
+ )
28
+
29
+ if (!(service in Services))
30
+ throw TypeError(
31
+ `Parameter 'service' must be a member of 'Services'.`,
32
+ )
33
+
34
+ if (!(network in Networks))
35
+ throw TypeError(
36
+ `Parameter 'network' must be a member of 'Networks'.`,
37
+ )
38
+
39
+ if (!(kind in Kinds))
40
+ throw TypeError(
41
+ `Parameter 'kind' must be a member of 'Kinds'.`,
42
+ )
43
+
44
+ return new URL(
45
+ getFeaturePathname(feature, kind),
46
+ getFeatureOrigin(feature, service, network),
47
+ )
48
+ }
package/source/game.d.ts CHANGED
@@ -92,11 +92,11 @@ type GameRow = {
92
92
  /**
93
93
  * @description "uuid"
94
94
  */
95
- city_id: Nullable<string>
95
+ city_id: string | null
96
96
  /**
97
97
  * @description "uuid"
98
98
  */
99
- game_pack_id: Nullable<string>
99
+ game_pack_id: string | null
100
100
  /**
101
101
  * @description "uuid"
102
102
  */
@@ -108,7 +108,7 @@ type GameRow = {
108
108
  /**
109
109
  * @description "timestamp with time zone"
110
110
  */
111
- time_updated: Nullable<string>
111
+ time_updated: string | null
112
112
  /**
113
113
  * @description "uuid"
114
114
  */
@@ -116,15 +116,15 @@ type GameRow = {
116
116
  /**
117
117
  * @description "integer"
118
118
  */
119
- timezone: Nullable<number>
119
+ timezone: number | null
120
120
  /**
121
121
  * @description "integer"
122
122
  */
123
- min_members_count: Nullable<number>
123
+ min_members_count: number | null
124
124
  /**
125
125
  * @description "integer"
126
126
  */
127
- max_members_count: Nullable<number>
127
+ max_members_count: number | null
128
128
  /**
129
129
  * @description "USER-DEFINED"
130
130
  */
@@ -141,11 +141,11 @@ type GameRow = {
141
141
  /**
142
142
  * @description "timestamp without time zone"
143
143
  */
144
- event_time: Nullable<string>
144
+ event_time: string | null
145
145
  /**
146
146
  * @description "double precision"
147
147
  */
148
- price: Nullable<number>
148
+ price: number | null
149
149
  /**
150
150
  * @description "uuid"
151
151
  */
@@ -153,7 +153,7 @@ type GameRow = {
153
153
  /**
154
154
  * @description "uuid"
155
155
  */
156
- image_id: Nullable<string>
156
+ image_id: string | null
157
157
  /**
158
158
  * @description "uuid"
159
159
  */
@@ -165,33 +165,33 @@ type GameRow = {
165
165
  /**
166
166
  * @description "character varying"
167
167
  */
168
- description: Nullable<string>
168
+ description: string | null
169
169
  /**
170
170
  * @description "character varying"
171
171
  */
172
- number: Nullable<string>
172
+ number: string | null
173
173
  /**
174
174
  * @description "character varying"
175
175
  */
176
- short_description: Nullable<string>
176
+ short_description: string | null
177
177
  /**
178
178
  * @description "character varying"
179
179
  */
180
- personal_comment: Nullable<string>
180
+ personal_comment: string | null
181
181
  /**
182
182
  * @description "character varying"
183
183
  */
184
- weekday: Nullable<string>
184
+ weekday: string | null
185
185
  /**
186
186
  * @description "character varying"
187
187
  */
188
- alias: Nullable<string>
188
+ alias: string | null
189
189
  /**
190
190
  * @description "character varying"
191
191
  */
192
- name: Nullable<string>
192
+ name: string | null
193
193
  /**
194
194
  * @description "character varying"
195
195
  */
196
- currency: Nullable<string>
196
+ currency: string | null
197
197
  }