@rxap/config 19.0.4-dev.0 → 19.1.0-dev.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 (97) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/compodoc/changelog.html +10 -0
  3. package/compodoc/dependencies.html +2 -2
  4. package/compodoc/injectables/ConfigService.html +106 -38
  5. package/compodoc/interfaces/ConfigLoadOptions.html +175 -3
  6. package/compodoc/js/search/search_index.js +2 -2
  7. package/compodoc/miscellaneous/functions.html +482 -1
  8. package/compodoc/properties.html +1 -1
  9. package/docs/documentation.json +1233 -545
  10. package/docs/html/assets/hierarchy.js +1 -1
  11. package/docs/html/assets/navigation.js +1 -1
  12. package/docs/html/assets/search.js +1 -1
  13. package/docs/html/classes/ConfigLoaderService.html +2 -2
  14. package/docs/html/classes/ConfigService.html +6 -6
  15. package/docs/html/classes/ConfigTestingService.html +2 -2
  16. package/docs/html/functions/ProvideConfig.html +1 -1
  17. package/docs/html/functions/dnsLookup.html +1 -0
  18. package/docs/html/functions/dnsResolver.html +1 -0
  19. package/docs/html/functions/fetchCidContent.html +1 -0
  20. package/docs/html/functions/fetchCidContentAsJson.html +1 -0
  21. package/docs/html/functions/fetchCidContentViaHttp.html +1 -0
  22. package/docs/html/functions/fetchContentViaHttp.html +1 -0
  23. package/docs/html/hierarchy.html +1 -1
  24. package/docs/html/index.html +2 -2
  25. package/docs/html/interfaces/AppsNavigationConfig.html +2 -2
  26. package/docs/html/interfaces/Config.html +2 -2
  27. package/docs/html/interfaces/ConfigLoadOptions.html +9 -3
  28. package/docs/html/interfaces/LogoConfig.html +2 -2
  29. package/docs/html/interfaces/NavigationConfig.html +2 -2
  30. package/docs/html/interfaces/Oauth2Config.html +2 -2
  31. package/docs/html/interfaces/i18nConfig.html +2 -2
  32. package/docs/html/modules.html +1 -1
  33. package/docs/html/types/AnySchema.html +1 -1
  34. package/docs/html/types/Join.html +1 -1
  35. package/docs/html/types/LanguagesConfig.html +1 -1
  36. package/docs/html/types/Leaves.html +1 -1
  37. package/docs/html/types/NoInferType.html +1 -1
  38. package/docs/html/types/Paths.html +1 -1
  39. package/docs/html/variables/RXAP_CONFIG.html +1 -1
  40. package/docs/markdown/README.md +1 -1
  41. package/docs/markdown/classes/ConfigLoaderService.md +7 -7
  42. package/docs/markdown/classes/ConfigService.md +22 -22
  43. package/docs/markdown/classes/ConfigTestingService.md +8 -8
  44. package/docs/markdown/functions/ProvideConfig.md +2 -2
  45. package/docs/markdown/functions/dnsLookup.md +29 -0
  46. package/docs/markdown/functions/dnsResolver.md +29 -0
  47. package/docs/markdown/functions/fetchCidContent.md +25 -0
  48. package/docs/markdown/functions/fetchCidContentAsJson.md +25 -0
  49. package/docs/markdown/functions/fetchCidContentViaHttp.md +25 -0
  50. package/docs/markdown/functions/fetchContentViaHttp.md +21 -0
  51. package/docs/markdown/globals.md +8 -2
  52. package/docs/markdown/interfaces/AppsNavigationConfig.md +12 -12
  53. package/docs/markdown/interfaces/Config.md +6 -6
  54. package/docs/markdown/interfaces/ConfigLoadOptions.md +29 -7
  55. package/docs/markdown/interfaces/LogoConfig.md +5 -5
  56. package/docs/markdown/interfaces/NavigationConfig.md +8 -8
  57. package/docs/markdown/interfaces/Oauth2Config.md +3 -3
  58. package/docs/markdown/interfaces/i18nConfig.md +4 -4
  59. package/docs/markdown/type-aliases/AnySchema.md +2 -2
  60. package/docs/markdown/type-aliases/Join.md +2 -2
  61. package/docs/markdown/type-aliases/LanguagesConfig.md +2 -2
  62. package/docs/markdown/type-aliases/Leaves.md +2 -2
  63. package/docs/markdown/type-aliases/NoInferType.md +2 -2
  64. package/docs/markdown/type-aliases/Paths.md +2 -2
  65. package/docs/markdown/variables/RXAP_CONFIG.md +2 -2
  66. package/docs/wiki/Class.ConfigLoaderService.md +6 -6
  67. package/docs/wiki/Class.ConfigService.md +21 -21
  68. package/docs/wiki/Class.ConfigTestingService.md +7 -7
  69. package/docs/wiki/Function.ProvideConfig.md +1 -1
  70. package/docs/wiki/Function.dnsLookup.md +25 -0
  71. package/docs/wiki/Function.dnsResolver.md +25 -0
  72. package/docs/wiki/Function.fetchCidContent.md +21 -0
  73. package/docs/wiki/Function.fetchCidContentAsJson.md +21 -0
  74. package/docs/wiki/Function.fetchCidContentViaHttp.md +21 -0
  75. package/docs/wiki/Function.fetchContentViaHttp.md +17 -0
  76. package/docs/wiki/Interface.AppsNavigationConfig.md +11 -11
  77. package/docs/wiki/Interface.Config.md +5 -5
  78. package/docs/wiki/Interface.ConfigLoadOptions.md +28 -6
  79. package/docs/wiki/Interface.LogoConfig.md +4 -4
  80. package/docs/wiki/Interface.NavigationConfig.md +7 -7
  81. package/docs/wiki/Interface.Oauth2Config.md +2 -2
  82. package/docs/wiki/Interface.i18nConfig.md +3 -3
  83. package/docs/wiki/TypeAlias.AnySchema.md +1 -1
  84. package/docs/wiki/TypeAlias.Join.md +1 -1
  85. package/docs/wiki/TypeAlias.LanguagesConfig.md +1 -1
  86. package/docs/wiki/TypeAlias.Leaves.md +1 -1
  87. package/docs/wiki/TypeAlias.NoInferType.md +1 -1
  88. package/docs/wiki/TypeAlias.Paths.md +1 -1
  89. package/docs/wiki/Variable.RXAP_CONFIG.md +1 -1
  90. package/docs/wiki/_Sidebar.md +6 -0
  91. package/docs/wiki/globals.md +7 -1
  92. package/fesm2022/rxap-config.mjs +165 -5
  93. package/fesm2022/rxap-config.mjs.map +1 -1
  94. package/index.d.ts +1 -0
  95. package/lib/config.service.d.ts +12 -0
  96. package/lib/utilities.d.ts +7 -0
  97. package/package.json +6 -6
@@ -2,15 +2,37 @@
2
2
 
3
3
  # Interface: ConfigLoadOptions
4
4
 
5
- Defined in: [config.service.ts:18](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.service.ts#L18)
5
+ Defined in: [config.service.ts:23](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L23)
6
6
 
7
7
  ## Properties
8
8
 
9
+ ### fromCid?
10
+
11
+ > `optional` **fromCid**: `string`
12
+
13
+ Defined in: [config.service.ts:41](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L41)
14
+
15
+ Load additional configuration directly from the given Content Identifier (CID).
16
+ This takes precedence over `fromDns` if both are provided.
17
+
18
+ ***
19
+
20
+ ### fromDns?
21
+
22
+ > `optional` **fromDns**: `string` \| `boolean`
23
+
24
+ Defined in: [config.service.ts:36](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L36)
25
+
26
+ Load additional configuration based on a CID found in a DNS TXT record.
27
+ If true, uses `location.hostname`. If a string, uses that domain.
28
+
29
+ ***
30
+
9
31
  ### fromLocalStorage?
10
32
 
11
33
  > `optional` **fromLocalStorage**: `boolean`
12
34
 
13
- Defined in: [config.service.ts:20](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.service.ts#L20)
35
+ Defined in: [config.service.ts:25](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L25)
14
36
 
15
37
  ***
16
38
 
@@ -18,7 +40,7 @@ Defined in: [config.service.ts:20](https://gitlab.com/rxap/packages/-/blob/e4552
18
40
 
19
41
  > `optional` **fromUrlParam**: `string` \| `boolean`
20
42
 
21
- Defined in: [config.service.ts:19](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.service.ts#L19)
43
+ Defined in: [config.service.ts:24](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L24)
22
44
 
23
45
  ***
24
46
 
@@ -26,7 +48,7 @@ Defined in: [config.service.ts:19](https://gitlab.com/rxap/packages/-/blob/e4552
26
48
 
27
49
  > `optional` **schema**: [`AnySchema`](../wiki/TypeAlias.AnySchema)
28
50
 
29
- Defined in: [config.service.ts:21](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.service.ts#L21)
51
+ Defined in: [config.service.ts:26](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L26)
30
52
 
31
53
  ***
32
54
 
@@ -34,7 +56,7 @@ Defined in: [config.service.ts:21](https://gitlab.com/rxap/packages/-/blob/e4552
34
56
 
35
57
  > `optional` **static**: `Record`\<`string`, `any`\>
36
58
 
37
- Defined in: [config.service.ts:26](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.service.ts#L26)
59
+ Defined in: [config.service.ts:31](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L31)
38
60
 
39
61
  static config values
40
62
 
@@ -44,4 +66,4 @@ static config values
44
66
 
45
67
  > `optional` **url**: `string` \| `string`[] \| (`environment`) => `string` \| `string`[]
46
68
 
47
- Defined in: [config.service.ts:22](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.service.ts#L22)
69
+ Defined in: [config.service.ts:27](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L27)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: LogoConfig
4
4
 
5
- Defined in: [config.ts:16](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L16)
5
+ Defined in: [config.ts:16](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L16)
6
6
 
7
7
  ## Properties
8
8
 
@@ -10,7 +10,7 @@ Defined in: [config.ts:16](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
10
10
 
11
11
  > `optional` **height**: `number`
12
12
 
13
- Defined in: [config.ts:19](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L19)
13
+ Defined in: [config.ts:19](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L19)
14
14
 
15
15
  ***
16
16
 
@@ -18,7 +18,7 @@ Defined in: [config.ts:19](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
18
18
 
19
19
  > `optional` **src**: `string`
20
20
 
21
- Defined in: [config.ts:17](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L17)
21
+ Defined in: [config.ts:17](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L17)
22
22
 
23
23
  ***
24
24
 
@@ -26,4 +26,4 @@ Defined in: [config.ts:17](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
26
26
 
27
27
  > `optional` **width**: `number`
28
28
 
29
- Defined in: [config.ts:18](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L18)
29
+ Defined in: [config.ts:18](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L18)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: NavigationConfig
4
4
 
5
- Defined in: [config.ts:22](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L22)
5
+ Defined in: [config.ts:22](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L22)
6
6
 
7
7
  ## Properties
8
8
 
@@ -10,7 +10,7 @@ Defined in: [config.ts:22](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
10
10
 
11
11
  > `optional` **apps**: [`AppsNavigationConfig`](../wiki/Interface.AppsNavigationConfig)[]
12
12
 
13
- Defined in: [config.ts:23](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L23)
13
+ Defined in: [config.ts:23](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L23)
14
14
 
15
15
  ***
16
16
 
@@ -18,7 +18,7 @@ Defined in: [config.ts:23](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
18
18
 
19
19
  > `optional` **collapsable**: `boolean`
20
20
 
21
- Defined in: [config.ts:24](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L24)
21
+ Defined in: [config.ts:24](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L24)
22
22
 
23
23
  ***
24
24
 
@@ -26,7 +26,7 @@ Defined in: [config.ts:24](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
26
26
 
27
27
  > `optional` **fixedInViewport**: `boolean`
28
28
 
29
- Defined in: [config.ts:28](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L28)
29
+ Defined in: [config.ts:28](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L28)
30
30
 
31
31
  ***
32
32
 
@@ -34,7 +34,7 @@ Defined in: [config.ts:28](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
34
34
 
35
35
  > `optional` **mode**: `"side"` \| `"over"`
36
36
 
37
- Defined in: [config.ts:26](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L26)
37
+ Defined in: [config.ts:26](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L26)
38
38
 
39
39
  ***
40
40
 
@@ -42,7 +42,7 @@ Defined in: [config.ts:26](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
42
42
 
43
43
  > `optional` **opened**: `boolean`
44
44
 
45
- Defined in: [config.ts:27](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L27)
45
+ Defined in: [config.ts:27](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L27)
46
46
 
47
47
  ***
48
48
 
@@ -50,4 +50,4 @@ Defined in: [config.ts:27](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
50
50
 
51
51
  > `optional` **pinned**: `boolean`
52
52
 
53
- Defined in: [config.ts:25](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L25)
53
+ Defined in: [config.ts:25](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L25)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: Oauth2Config
4
4
 
5
- Defined in: [config.ts:38](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L38)
5
+ Defined in: [config.ts:38](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L38)
6
6
 
7
7
  ## Properties
8
8
 
@@ -10,4 +10,4 @@ Defined in: [config.ts:38](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
10
10
 
11
11
  > `optional` **profileUrl**: `string`
12
12
 
13
- Defined in: [config.ts:39](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L39)
13
+ Defined in: [config.ts:39](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L39)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Interface: i18nConfig
4
4
 
5
- Defined in: [config.ts:33](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L33)
5
+ Defined in: [config.ts:33](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L33)
6
6
 
7
7
  ## Properties
8
8
 
@@ -10,7 +10,7 @@ Defined in: [config.ts:33](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
10
10
 
11
11
  > `optional` **defaultLanguage**: `string`
12
12
 
13
- Defined in: [config.ts:35](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L35)
13
+ Defined in: [config.ts:35](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L35)
14
14
 
15
15
  ***
16
16
 
@@ -18,4 +18,4 @@ Defined in: [config.ts:35](https://gitlab.com/rxap/packages/-/blob/e4552670b1799
18
18
 
19
19
  > `optional` **languages**: [`LanguagesConfig`](../wiki/TypeAlias.LanguagesConfig)
20
20
 
21
- Defined in: [config.ts:34](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L34)
21
+ Defined in: [config.ts:34](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L34)
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **AnySchema**: `object`
6
6
 
7
- Defined in: [config.service.ts:16](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.service.ts#L16)
7
+ Defined in: [config.service.ts:21](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.service.ts#L21)
8
8
 
9
9
  ## Type declaration
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **Join**\<`K`, `P`\>: `K` *extends* `string` \| `number` ? `P` *extends* `string` \| `number` ? `` `${K}${"" extends P ? "" : "."}${P}` `` : `never` : `never`
6
6
 
7
- Defined in: [types.ts:8](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/types.ts#L8)
7
+ Defined in: [types.ts:8](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/types.ts#L8)
8
8
 
9
9
  ## Type Parameters
10
10
 
@@ -4,4 +4,4 @@
4
4
 
5
5
  > **LanguagesConfig**: `Record`\<`string`, `string`\>
6
6
 
7
- Defined in: [config.ts:31](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/config.ts#L31)
7
+ Defined in: [config.ts:31](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/config.ts#L31)
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **Leaves**\<`T`, `D`\>: \[`D`\] *extends* \[`never`\] ? `never` : `T` *extends* `object` ? `{ [K in keyof T]-?: Join<K, Leaves<T[K], Prev[D]>> }`\[keyof `T`\] : `""`
6
6
 
7
- Defined in: [types.ts:20](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/types.ts#L20)
7
+ Defined in: [types.ts:20](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/types.ts#L20)
8
8
 
9
9
  ## Type Parameters
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **NoInferType**\<`T`\>: \[`T`\]\[`T` *extends* `any` ? `0` : `never`\]
6
6
 
7
- Defined in: [types.ts:1](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/types.ts#L1)
7
+ Defined in: [types.ts:1](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/types.ts#L1)
8
8
 
9
9
  ## Type Parameters
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  > **Paths**\<`T`, `D`\>: \[`D`\] *extends* \[`never`\] ? `never` : `T` *extends* `object` ? \{ \[K in keyof T\]-?: K extends string \| number ? \`$\{K\}\` \| Join\<K, Paths\<T\[K\], Prev\[D\]\>\> : never \}\[keyof `T`\] : `""`
6
6
 
7
- Defined in: [types.ts:13](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/types.ts#L13)
7
+ Defined in: [types.ts:13](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/types.ts#L13)
8
8
 
9
9
  ## Type Parameters
10
10
 
@@ -4,4 +4,4 @@
4
4
 
5
5
  > `const` **RXAP\_CONFIG**: `InjectionToken`\<`unknown`\>
6
6
 
7
- Defined in: [tokens.ts:3](https://gitlab.com/rxap/packages/-/blob/e4552670b179901abc7ce57cc3ff490ac705b867/packages/angular/config/src/lib/tokens.ts#L3)
7
+ Defined in: [tokens.ts:3](https://gitlab.com/rxap/packages/-/blob/866b7365240b548b3b9407b594ddd5dc9b9bfc59/packages/angular/config/src/lib/tokens.ts#L3)
@@ -31,4 +31,10 @@
31
31
 
32
32
  ### Functions
33
33
 
34
+ - [dnsLookup](../wiki/Function.dnsLookup)
35
+ - [dnsResolver](../wiki/Function.dnsResolver)
36
+ - [fetchCidContent](../wiki/Function.fetchCidContent)
37
+ - [fetchCidContentAsJson](../wiki/Function.fetchCidContentAsJson)
38
+ - [fetchCidContentViaHttp](../wiki/Function.fetchCidContentViaHttp)
39
+ - [fetchContentViaHttp](../wiki/Function.fetchContentViaHttp)
34
40
  - [ProvideConfig](../wiki/Function.ProvideConfig)
@@ -1,4 +1,4 @@
1
- # @rxap/config v19.0.4-dev.0
1
+ # @rxap/config v19.1.0-dev.0
2
2
 
3
3
  ## Classes
4
4
 
@@ -31,4 +31,10 @@
31
31
 
32
32
  ## Functions
33
33
 
34
+ - [dnsLookup](../wiki/Function.dnsLookup)
35
+ - [dnsResolver](../wiki/Function.dnsResolver)
36
+ - [fetchCidContent](../wiki/Function.fetchCidContent)
37
+ - [fetchCidContentAsJson](../wiki/Function.fetchCidContentAsJson)
38
+ - [fetchCidContentViaHttp](../wiki/Function.fetchCidContentViaHttp)
39
+ - [fetchContentViaHttp](../wiki/Function.fetchContentViaHttp)
34
40
  - [ProvideConfig](../wiki/Function.ProvideConfig)
@@ -1,10 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Inject, InjectionToken, Optional } from '@angular/core';
3
- import { firstValueFrom, ReplaySubject } from 'rxjs';
3
+ import { firstValueFrom, Observable, catchError, EMPTY, race, ReplaySubject } from 'rxjs';
4
4
  import * as i1 from '@angular/common/http';
5
5
  import { HttpClient } from '@angular/common/http';
6
6
  import { finalize, share } from 'rxjs/operators';
7
- import { SetToObject, getFromObject, deepMerge, coerceArray, SetObjectValue } from '@rxap/utilities';
7
+ import { SetToObject, getFromObject, JoinPath, deepMerge, coerceArray, CoercePrefix, SetObjectValue } from '@rxap/utilities';
8
+ import { log } from '@rxap/rxjs';
8
9
 
9
10
  class ConfigLoaderService {
10
11
  constructor(http) {
@@ -66,6 +67,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
66
67
 
67
68
  const RXAP_CONFIG = new InjectionToken('rxap/config');
68
69
 
70
+ // TODO : move to separate package
71
+ async function dnsResolver(endpoint, name, type) {
72
+ const response = await fetch(`${endpoint}?name=${name}&type=${type}`, {
73
+ method: 'GET',
74
+ headers: { 'Accept': 'application/dns-json' },
75
+ });
76
+ if (!response.ok) {
77
+ throw new Error(`Failed to resolve DNS via ${endpoint} (${response.status}): ${response.statusText}`);
78
+ }
79
+ const result = await response.json();
80
+ // Basic validation of the response structure
81
+ if (!result || !Array.isArray(result.Answer) || result.Answer.length === 0 || !result.Answer[0].data) {
82
+ throw new Error(`Invalid DNS response structure from ${endpoint} for ${name} ${type}`);
83
+ }
84
+ const data = result.Answer[0].data;
85
+ // Remove surrounding quotes often found in TXT records
86
+ return data.replace(/^"(.*)"$/, '$1');
87
+ }
88
+ async function dnsLookup(name, type, dnsServers = [
89
+ 'https://dns.google/resolve',
90
+ 'https://cloudflare-dns.com/dns-query'
91
+ ]) {
92
+ type = type.toUpperCase();
93
+ console.log(`Performing DNS lookup for ${type} record of ${name} using servers: ${dnsServers.join(', ')}`);
94
+ try {
95
+ // Use Promise.race to get the first successful response
96
+ return await Promise.race(dnsServers.map(server => dnsResolver(server, name, type)));
97
+ }
98
+ catch (error) {
99
+ console.error(`Failed to resolve DNS TXT record for ${name} using any server: ${error.message}`);
100
+ throw new Error(`DNS lookup failed for ${name} (${type})`); // Re-throw a more specific error
101
+ }
102
+ }
103
+ function fetchContentViaHttp(url) {
104
+ return new Observable((subscriber) => {
105
+ let controller = new AbortController(); // For cancellation
106
+ fetch(url)
107
+ .then(response => {
108
+ if (!response.ok) {
109
+ // Don't complete here, let catchError handle it
110
+ throw new Error(`HTTP error ${response.status} for ${url}: ${response.statusText}`);
111
+ }
112
+ return response.blob();
113
+ })
114
+ .then(blob => {
115
+ if (!subscriber.closed) {
116
+ subscriber.next(blob);
117
+ subscriber.complete();
118
+ }
119
+ })
120
+ .catch(error => {
121
+ if (error.name !== 'AbortError' && !subscriber.closed) {
122
+ console.warn(`Fetch error for ${url}:`, error);
123
+ }
124
+ });
125
+ // Cleanup function for when the observable is unsubscribed
126
+ return () => {
127
+ controller?.abort();
128
+ controller = null; // Release reference
129
+ };
130
+ }).pipe(catchError(error => {
131
+ // Log the error but return null to signal failure without stopping the race
132
+ console.error(`Fetch failed for ${url}: ${error.message}`);
133
+ return EMPTY; // Signal failure with null
134
+ }));
135
+ }
136
+ function fetchCidContentViaHttp(cid, path) {
137
+ return race(
138
+ // Attempt 1: w3s.link
139
+ fetchContentViaHttp(JoinPath(`https://${cid}.ipfs.w3s.link`, path)).pipe(log(`w3s fetch attempt for ${cid}`)),
140
+ // Attempt 2: Local gateway
141
+ fetchContentViaHttp(JoinPath(`${location.origin}/ipfs/${cid}`, path)).pipe(log(`local fetch attempt for ${cid}`))
142
+ // Add more sources here if needed
143
+ ).pipe(log(`Race winner for ${cid}`));
144
+ }
145
+ async function fetchCidContent(cid, path) {
146
+ console.log(`Fetching content for CID: ${cid}`);
147
+ // Example: Fetch from an IPFS gateway or other source
148
+ // const gatewayUrl = `https://ipfs.io/ipfs/${cid}`;
149
+ try {
150
+ return await firstValueFrom(race(fetchCidContentViaHttp(cid, path)), { defaultValue: null } // Return null if the stream completes empty
151
+ );
152
+ }
153
+ catch (error) {
154
+ console.error(`Error fetching or parsing content for CID ${cid}:`, error);
155
+ return null; // Return null on error
156
+ }
157
+ }
158
+ async function fetchCidContentAsJson(cid, path) {
159
+ console.log(`Fetching JSON content for CID: ${cid}`);
160
+ const blob = await fetchCidContent(cid, path);
161
+ if (blob) {
162
+ try {
163
+ const text = await blob.text();
164
+ return JSON.parse(text);
165
+ }
166
+ catch (error) {
167
+ console.error(`Error parsing JSON content for CID ${cid}:`, error);
168
+ return null; // Return null on error
169
+ }
170
+ }
171
+ console.warn(`No blob available for CID ${cid}, cannot parse as JSON.`);
172
+ return null; // Return null if blob is not available
173
+ }
174
+
69
175
  class ConfigService {
70
176
  static { this.onError = new ReplaySubject(1); }
71
177
  static { this.onRequestError = new ReplaySubject(1); }
@@ -149,9 +255,64 @@ class ConfigService {
149
255
  const param = typeof options.fromUrlParam === 'string' ? options.fromUrlParam : 'config';
150
256
  config = deepMerge(config, this.LoadConfigDefaultFromUrlParam(param));
151
257
  }
258
+ if (options?.fromDns) {
259
+ await this.loadConfigFromDns(options);
260
+ }
261
+ if (options?.fromCid) {
262
+ config = deepMerge(config, await this.loadConfigFromCid(options));
263
+ }
152
264
  console.debug('app config', config);
153
265
  this.Config = config;
154
266
  }
267
+ static async loadConfigFromCid(options) {
268
+ console.debug('Loading config from CID: ', options.fromCid);
269
+ try {
270
+ const cidContent = await fetchCidContentAsJson(options.fromCid);
271
+ if (cidContent && typeof cidContent === 'object') {
272
+ console.log(`Merging configuration from CID ${options.fromCid}.`, cidContent);
273
+ // Merge CID content into the existing config object
274
+ console.log('Configuration merged successfully.');
275
+ return cidContent;
276
+ }
277
+ else if (cidContent) {
278
+ console.warn(`Content fetched from CID ${options.fromCid} is not a mergeable object, skipping merge.`);
279
+ }
280
+ else {
281
+ console.warn(`No content fetched or content was null for CID ${options.fromCid}.`);
282
+ }
283
+ }
284
+ catch (error) {
285
+ console.error(`Failed to fetch or process content for CID ${options.fromCid}:`, error);
286
+ // Decide how to handle fetch/processing errors
287
+ }
288
+ }
289
+ static async loadConfigFromDns(options) {
290
+ console.debug('Loading config from DNS');
291
+ let domain = location.hostname;
292
+ if (typeof options.fromDns === 'string') {
293
+ domain = options.fromDns;
294
+ }
295
+ domain = CoercePrefix(domain, '_config.');
296
+ try {
297
+ console.log(`Attempting DNS lookup for domain: ${domain}`);
298
+ const txtData = await dnsLookup(domain, 'TXT');
299
+ console.log(`DNS TXT record data found: ${txtData}`);
300
+ // Example CID extraction logic (adapt to your TXT record format)
301
+ // This looks for IPFS CIDs (v0 'Qm...' or v1 'b...') potentially after 'ipfs://' or '/'
302
+ const cidMatch = txtData.match(/(?:ipfs:\/\/|\/|^)([a-zA-Z0-9]{40,})$/);
303
+ if (cidMatch && cidMatch[1]) {
304
+ options.fromCid = cidMatch[1];
305
+ console.log(`Extracted CID from DNS: ${options.fromCid}`);
306
+ }
307
+ else {
308
+ console.warn(`Could not extract a valid CID format from DNS TXT data: "${txtData}"`);
309
+ }
310
+ }
311
+ catch (error) {
312
+ console.error(`DNS lookup for ${domain} failed:`, error);
313
+ // Decide if failure is critical or recoverable
314
+ }
315
+ }
155
316
  static handleError(error) {
156
317
  this.onError.next(error);
157
318
  for (const fnc of this.onErrorFnc) {
@@ -285,8 +446,7 @@ class ConfigService {
285
446
  throw new Error('The config property path is not a string');
286
447
  }
287
448
  for (const fragment of path.split('.')) {
288
- // eslint-disable-next-line no-prototype-builtins
289
- if (configValue.hasOwnProperty(fragment)) {
449
+ if (configValue && typeof configValue === 'object' && fragment in configValue) {
290
450
  configValue = configValue[fragment];
291
451
  }
292
452
  else {
@@ -369,5 +529,5 @@ function ProvideConfig(config = {}) {
369
529
  * Generated bundle index. Do not edit.
370
530
  */
371
531
 
372
- export { ConfigLoaderService, ConfigService, ConfigTestingService, ProvideConfig, RXAP_CONFIG };
532
+ export { ConfigLoaderService, ConfigService, ConfigTestingService, ProvideConfig, RXAP_CONFIG, dnsLookup, dnsResolver, fetchCidContent, fetchCidContentAsJson, fetchCidContentViaHttp, fetchContentViaHttp };
373
533
  //# sourceMappingURL=rxap-config.mjs.map