@shakerquiz/utilities 0.4.3 → 0.4.5

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@shakerquiz/utilities",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "author": "yurkimus <yurkimus@gmail.com>",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -3,25 +3,101 @@ export const Domains: readonly ["Asset", "User", "Role", "City", "Venue", "Theme
3
3
  * @type {Record<Domains[number], Icon>}
4
4
  */
5
5
  export const DomainIcon: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Icon>;
6
- /**
7
- * @type {Record<Domains[number], Record<Kind, string>>}
8
- */
9
- export const DomainKindPathname: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Record<Kind, string>>;
6
+ export namespace DomainKindPathname {
7
+ namespace User {
8
+ let Unit: "/user/:user?";
9
+ let Set: "/users";
10
+ }
11
+ namespace Role {
12
+ let Unit_1: "/role/:role?";
13
+ export { Unit_1 as Unit };
14
+ let Set_1: "/roles";
15
+ export { Set_1 as Set };
16
+ }
17
+ namespace City {
18
+ let Unit_2: "/city/:city?";
19
+ export { Unit_2 as Unit };
20
+ let Set_2: "/cities";
21
+ export { Set_2 as Set };
22
+ }
23
+ namespace Venue {
24
+ let Unit_3: "/venue/:venue?";
25
+ export { Unit_3 as Unit };
26
+ let Set_3: "/venues";
27
+ export { Set_3 as Set };
28
+ }
29
+ namespace Theme {
30
+ let Unit_4: "/theme/:theme?";
31
+ export { Unit_4 as Unit };
32
+ let Set_4: "/themes";
33
+ export { Set_4 as Set };
34
+ }
35
+ namespace Game {
36
+ let Unit_5: "/game/:game?";
37
+ export { Unit_5 as Unit };
38
+ let Set_5: "/games";
39
+ export { Set_5 as Set };
40
+ }
41
+ namespace Registration {
42
+ let Unit_6: "/registration/:registration?";
43
+ export { Unit_6 as Unit };
44
+ let Set_6: "/registrations";
45
+ export { Set_6 as Set };
46
+ }
47
+ namespace Mailing {
48
+ let Unit_7: "/mailing/:mailing?";
49
+ export { Unit_7 as Unit };
50
+ let Set_7: "/mailings";
51
+ export { Set_7 as Set };
52
+ }
53
+ }
10
54
  export const Procedures: readonly ["Checkin", "Redirect"];
11
55
  /**
12
56
  * @type {Record<Procedures[number], Icon>}
13
57
  */
14
58
  export const ProcedureIcon: Record<"Checkin" | "Redirect", Icon>;
15
- /**
16
- * @type {Record<Procedures[number], Record<Kind, string>>}
17
- */
18
- export const ProcedureKindPathname: Record<"Checkin" | "Redirect", Record<Kind, string>>;
59
+ export namespace ProcedureKindPathname {
60
+ namespace Checkin {
61
+ let Unit_8: "/checkin";
62
+ export { Unit_8 as Unit };
63
+ let Set_8: "/checkins";
64
+ export { Set_8 as Set };
65
+ }
66
+ namespace Redirect {
67
+ let Unit_9: "/redirect";
68
+ export { Unit_9 as Unit };
69
+ let Set_9: "/redirects";
70
+ export { Set_9 as Set };
71
+ }
72
+ }
19
73
  export const Features: ("Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing")[];
20
74
  /**
21
75
  * @type {Record<Features[number], Icon>}
22
76
  */
23
77
  export const FeatureIcon: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Icon>;
78
+ export namespace FeatureKindPathname {
79
+ export namespace Checkin_1 { }
80
+ export { Checkin_1 as Checkin };
81
+ export namespace Redirect_1 { }
82
+ export { Redirect_1 as Redirect };
83
+ export namespace User_1 { }
84
+ export { User_1 as User };
85
+ export namespace Role_1 { }
86
+ export { Role_1 as Role };
87
+ export namespace City_1 { }
88
+ export { City_1 as City };
89
+ export namespace Venue_1 { }
90
+ export { Venue_1 as Venue };
91
+ export namespace Theme_1 { }
92
+ export { Theme_1 as Theme };
93
+ export namespace Game_1 { }
94
+ export { Game_1 as Game };
95
+ export namespace Registration_1 { }
96
+ export { Registration_1 as Registration };
97
+ export namespace Mailing_1 { }
98
+ export { Mailing_1 as Mailing };
99
+ }
24
100
  /**
25
- * @type {Record<Features[number], Record<Kind, string>>}
101
+ * @type {Array<[feature: Features[number], kind: Kind, pathname: string]>}
26
102
  */
27
- export const FeatureKindPathname: Record<"Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", Record<Kind, string>>;
103
+ export const FeatureKindPathnames: Array<[feature: "Asset" | "User" | "Role" | "City" | "Venue" | "Theme" | "ThemeAsset" | "Game" | "GameAsset" | "Registration" | "Mailing", kind: Kind, pathname: string]>;
@@ -27,9 +27,9 @@ export var DomainIcon = {
27
27
  }
28
28
 
29
29
  /**
30
- * @type {Record<Domains[number], Record<Kind, string>>}
30
+ * @satisfies {Record<Domains[number], Record<Kind, string>>}
31
31
  */
32
- export var DomainKindPathname = {
32
+ export var DomainKindPathname = /** @type {const} */ ({
33
33
  'User': {
34
34
  'Unit': '/user/:user?',
35
35
  'Set': '/users',
@@ -69,7 +69,7 @@ export var DomainKindPathname = {
69
69
  'Unit': '/mailing/:mailing?',
70
70
  'Set': '/mailings',
71
71
  },
72
- }
72
+ })
73
73
 
74
74
  export var Procedures = /** @type {const} */ ([
75
75
  'Checkin',
@@ -85,9 +85,9 @@ export var ProcedureIcon = {
85
85
  }
86
86
 
87
87
  /**
88
- * @type {Record<Procedures[number], Record<Kind, string>>}
88
+ * @satisfies {Record<Procedures[number], Record<Kind, string>>}
89
89
  */
90
- export var ProcedureKindPathname = {
90
+ export var ProcedureKindPathname = /** @type {const} */ ({
91
91
  'Checkin': {
92
92
  'Unit': '/checkin',
93
93
  'Set': '/checkins',
@@ -97,7 +97,7 @@ export var ProcedureKindPathname = {
97
97
  'Unit': '/redirect',
98
98
  'Set': '/redirects',
99
99
  },
100
- }
100
+ })
101
101
 
102
102
  export var Features = Domains.concat(Procedures)
103
103
 
@@ -110,9 +110,20 @@ export var FeatureIcon = {
110
110
  }
111
111
 
112
112
  /**
113
- * @type {Record<Features[number], Record<Kind, string>>}
113
+ * @satisfies {Record<Features[number], Record<Kind, string>>}
114
114
  */
115
115
  export var FeatureKindPathname = {
116
116
  ...DomainKindPathname,
117
117
  ...ProcedureKindPathname,
118
118
  }
119
+
120
+ /**
121
+ * @type {Array<[feature: Features[number], kind: Kind, pathname: string]>}
122
+ */
123
+ export var FeatureKindPathnames = Object
124
+ .keys(FeatureKindPathname)
125
+ .flatMap(feature =>
126
+ Object
127
+ .keys(FeatureKindPathname[feature])
128
+ .map(kind => [feature, kind, FeatureKindPathname[feature][kind]])
129
+ )
@@ -24,10 +24,10 @@ type UseState<Type> = [
24
24
 
25
25
  type Method = typeof import('./enumerations/core/methods.js').Methods[number]
26
26
 
27
- type Domain = typeof import('./enumerations/core/domains.js').Domains[number]
27
+ type Domain = typeof import('./enumerations/core/features.js').Domains[number]
28
28
 
29
29
  type Procedure =
30
- typeof import('./enumerations/core/procedures.js').Procedures[number]
30
+ typeof import('./enumerations/core/features.js').Procedures[number]
31
31
 
32
32
  type Feature = Domain | Procedure
33
33
 
package/source/index.d.ts CHANGED
@@ -30,7 +30,6 @@ export * from './enumerations/entities/roles.js'
30
30
  export * from './enumerations/schemas.js'
31
31
 
32
32
  export * from './functions/pathname.js'
33
- export * from './functions/request.js'
34
33
  export * from './functions/schema.js'
35
34
 
36
35
  export * from './schemas/city.js'
package/source/index.js CHANGED
@@ -30,7 +30,6 @@ export * from './enumerations/entities/roles.js'
30
30
  export * from './enumerations/schemas.js'
31
31
 
32
32
  export * from './functions/pathname.js'
33
- export * from './functions/request.js'
34
33
  export * from './functions/schema.js'
35
34
 
36
35
  export * from './schemas/city.js'