@shakerquiz/utilities 0.5.74 → 0.5.76

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,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@shakerquiz/utilities",
4
- "version": "0.5.74",
4
+ "version": "0.5.76",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -1,8 +1,8 @@
1
1
  export var CitiesMode = /** @type {const} */ ({
2
- 'none': 'none',
3
- 'single': 'single',
4
- 'many': 'many',
5
2
  'all': 'all',
3
+ 'many': 'many',
4
+ 'single': 'single',
5
+ 'none': 'none',
6
6
  'unknown': 'unknown',
7
7
  })
8
8
 
@@ -0,0 +1,37 @@
1
+ export var PasswordMode = /** @type {const} */ ({
2
+ 'known': 'known',
3
+ 'unknown': 'unknown',
4
+ })
5
+
6
+ export var RoleModes = Object.values(PasswordMode)
7
+
8
+ export var RoleModeTitle = {
9
+ [PasswordMode.known]: 'Назначен',
10
+ [PasswordMode.unknown]: 'Неизвестно',
11
+ }
12
+
13
+ export var RoleModeWeight = {
14
+ [PasswordMode.known]: 0,
15
+ [PasswordMode.unknown]: 1,
16
+ }
17
+
18
+ /**
19
+ * @param {keyof typeof PasswordMode} value
20
+ */
21
+ var getter = value =>
22
+ value in PasswordMode
23
+ ? value
24
+ : PasswordMode['unknown']
25
+
26
+ export var getPasswordMode = value => {
27
+ switch (typeof value) {
28
+ case 'string':
29
+ return getter(value)
30
+
31
+ case 'object':
32
+ return getter(value?.mode)
33
+
34
+ default:
35
+ return getter(undefined)
36
+ }
37
+ }
package/source/index.js CHANGED
@@ -12,6 +12,7 @@ export * from './enumerations/misc/routes.js'
12
12
  export * from './enumerations/entities/cities-mode.js'
13
13
  export * from './enumerations/entities/city-affilation.js'
14
14
  export * from './enumerations/entities/game-status.js'
15
+ export * from './enumerations/entities/password-mode.js'
15
16
  export * from './enumerations/entities/registration-attribute.js'
16
17
  export * from './enumerations/entities/registration-channel.js'
17
18
  export * from './enumerations/entities/registration-lineup.js'
@@ -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,10 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "password": {
5
+ "type": "string"
6
+ }
7
+ },
8
+ "required": [],
9
+ "additionalProperties": false
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "role_id": {
5
+ "type": "string",
6
+ "format": "uuid"
7
+ }
8
+ },
9
+ "required": [],
10
+ "additionalProperties": false
11
+ }