@shakerquiz/utilities 0.3.16 → 0.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shakerquiz/utilities",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "author": "yurkimus <yurkimus@gmail.com>",
5
5
  "license": "ISC",
6
6
  "scripts": {
@@ -1,5 +1,8 @@
1
1
  export const Features: {
2
2
  Checkin: "Checkin";
3
+ '404': "404";
4
+ Exception: "Exception";
5
+ Home: "Home";
3
6
  City: "City";
4
7
  Game: "Game";
5
8
  Registration: "Registration";
@@ -7,6 +10,10 @@ export const Features: {
7
10
  User: "User";
8
11
  Venue: "Venue";
9
12
  };
13
+ /**
14
+ * @type {Record<Feature, Icon>}
15
+ */
16
+ export const FeatureIcons: Record<Feature, Icon>;
10
17
  /**
11
18
  * @type {Record<Feature, Record<Kind, string>>}
12
19
  */
@@ -15,6 +22,10 @@ export const FeatureKindPathnames: Record<Feature, Record<Kind, string>>;
15
22
  * @type {Record<Domain, Service>}
16
23
  */
17
24
  export const DomainServiceDefaults: Record<Domain, Service>;
25
+ /**
26
+ * @type {Record<Page, Service>}
27
+ */
28
+ export const PageServiceDefaults: Record<Page, Service>;
18
29
  /**
19
30
  * @type {Record<Procedure, Service>}
20
31
  */
@@ -27,6 +38,10 @@ export const FeatureServiceDefaults: Record<Feature, Service>;
27
38
  * @type {Record<Domain, Record<Service, Record<Network, string>>>}
28
39
  */
29
40
  export const DomainServiceNetworkOrigins: Record<Domain, Record<Service, Record<Network, string>>>;
41
+ /**
42
+ * @type {Record<Page, Record<Service, Record<Network, string>>>}
43
+ */
44
+ export const PageServiceNetworkOrigins: Record<Page, Record<Service, Record<Network, string>>>;
30
45
  /**
31
46
  * @type {Record<Procedure, Record<Service, Record<Network, string>>>}
32
47
  */
@@ -1,9 +1,13 @@
1
1
  import { Backends } from './backends.js'
2
- import { DomainKindPathnames, Domains } from './domains.js'
2
+ import { DomainIcons, DomainKindPathnames, Domains } from './domains.js'
3
3
  import { Frontends } from './frontends.js'
4
4
  import { Networks } from './networks.js'
5
- import { PageKindPathnames, Pages } from './pages.js'
6
- import { ProcedureKindPathnames, Procedures } from './procedures.js'
5
+ import { PageIcons, PageKindPathnames, Pages } from './pages.js'
6
+ import {
7
+ ProcedureIcons,
8
+ ProcedureKindPathnames,
9
+ Procedures,
10
+ } from './procedures.js'
7
11
 
8
12
  export var Features = {
9
13
  ...Domains,
@@ -11,6 +15,15 @@ export var Features = {
11
15
  ...Procedures,
12
16
  }
13
17
 
18
+ /**
19
+ * @type {Record<Feature, Icon>}
20
+ */
21
+ export var FeatureIcons = {
22
+ ...DomainIcons,
23
+ ...PageIcons,
24
+ ...ProcedureIcons,
25
+ }
26
+
14
27
  /**
15
28
  * @type {Record<Feature, Record<Kind, string>>}
16
29
  */
@@ -46,21 +46,21 @@ var fulfillment = (kind, [response, body]) => {
46
46
  * @param {F | { feature: F, kind?: K, service?: S, network?: N }} configuration
47
47
  */
48
48
  export var getFeatureFetch = configuration => {
49
- var feature,
50
- kind = Kinds.Unit,
51
- service = FeatureServiceDefaults[feature],
52
- network = Networks.Public
49
+ var feature, kind, service, network
53
50
 
54
51
  switch (type(configuration)) {
55
52
  case 'String':
56
53
  feature = configuration
54
+ kind = Kinds.Unit
55
+ service = FeatureServiceDefaults[feature]
56
+ network = Networks.Public
57
57
  break
58
58
 
59
59
  case 'Object':
60
60
  feature = configuration.feature
61
- kind = configuration.kind ?? kind
62
- service = configuration.service ?? service
63
- network = configuration.network ?? network
61
+ kind = configuration.kind ?? Kinds.Unit
62
+ service = configuration.service ?? FeatureServiceDefaults[feature]
63
+ network = configuration.network ?? Networks.Public
64
64
  break
65
65
 
66
66
  default: