@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.
- package/CHANGELOG.md +12 -0
- package/compodoc/changelog.html +10 -0
- package/compodoc/dependencies.html +2 -2
- package/compodoc/injectables/ConfigService.html +106 -38
- package/compodoc/interfaces/ConfigLoadOptions.html +175 -3
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/functions.html +482 -1
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +1233 -545
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/ConfigLoaderService.html +2 -2
- package/docs/html/classes/ConfigService.html +6 -6
- package/docs/html/classes/ConfigTestingService.html +2 -2
- package/docs/html/functions/ProvideConfig.html +1 -1
- package/docs/html/functions/dnsLookup.html +1 -0
- package/docs/html/functions/dnsResolver.html +1 -0
- package/docs/html/functions/fetchCidContent.html +1 -0
- package/docs/html/functions/fetchCidContentAsJson.html +1 -0
- package/docs/html/functions/fetchCidContentViaHttp.html +1 -0
- package/docs/html/functions/fetchContentViaHttp.html +1 -0
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/AppsNavigationConfig.html +2 -2
- package/docs/html/interfaces/Config.html +2 -2
- package/docs/html/interfaces/ConfigLoadOptions.html +9 -3
- package/docs/html/interfaces/LogoConfig.html +2 -2
- package/docs/html/interfaces/NavigationConfig.html +2 -2
- package/docs/html/interfaces/Oauth2Config.html +2 -2
- package/docs/html/interfaces/i18nConfig.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/AnySchema.html +1 -1
- package/docs/html/types/Join.html +1 -1
- package/docs/html/types/LanguagesConfig.html +1 -1
- package/docs/html/types/Leaves.html +1 -1
- package/docs/html/types/NoInferType.html +1 -1
- package/docs/html/types/Paths.html +1 -1
- package/docs/html/variables/RXAP_CONFIG.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/ConfigLoaderService.md +7 -7
- package/docs/markdown/classes/ConfigService.md +22 -22
- package/docs/markdown/classes/ConfigTestingService.md +8 -8
- package/docs/markdown/functions/ProvideConfig.md +2 -2
- package/docs/markdown/functions/dnsLookup.md +29 -0
- package/docs/markdown/functions/dnsResolver.md +29 -0
- package/docs/markdown/functions/fetchCidContent.md +25 -0
- package/docs/markdown/functions/fetchCidContentAsJson.md +25 -0
- package/docs/markdown/functions/fetchCidContentViaHttp.md +25 -0
- package/docs/markdown/functions/fetchContentViaHttp.md +21 -0
- package/docs/markdown/globals.md +8 -2
- package/docs/markdown/interfaces/AppsNavigationConfig.md +12 -12
- package/docs/markdown/interfaces/Config.md +6 -6
- package/docs/markdown/interfaces/ConfigLoadOptions.md +29 -7
- package/docs/markdown/interfaces/LogoConfig.md +5 -5
- package/docs/markdown/interfaces/NavigationConfig.md +8 -8
- package/docs/markdown/interfaces/Oauth2Config.md +3 -3
- package/docs/markdown/interfaces/i18nConfig.md +4 -4
- package/docs/markdown/type-aliases/AnySchema.md +2 -2
- package/docs/markdown/type-aliases/Join.md +2 -2
- package/docs/markdown/type-aliases/LanguagesConfig.md +2 -2
- package/docs/markdown/type-aliases/Leaves.md +2 -2
- package/docs/markdown/type-aliases/NoInferType.md +2 -2
- package/docs/markdown/type-aliases/Paths.md +2 -2
- package/docs/markdown/variables/RXAP_CONFIG.md +2 -2
- package/docs/wiki/Class.ConfigLoaderService.md +6 -6
- package/docs/wiki/Class.ConfigService.md +21 -21
- package/docs/wiki/Class.ConfigTestingService.md +7 -7
- package/docs/wiki/Function.ProvideConfig.md +1 -1
- package/docs/wiki/Function.dnsLookup.md +25 -0
- package/docs/wiki/Function.dnsResolver.md +25 -0
- package/docs/wiki/Function.fetchCidContent.md +21 -0
- package/docs/wiki/Function.fetchCidContentAsJson.md +21 -0
- package/docs/wiki/Function.fetchCidContentViaHttp.md +21 -0
- package/docs/wiki/Function.fetchContentViaHttp.md +17 -0
- package/docs/wiki/Interface.AppsNavigationConfig.md +11 -11
- package/docs/wiki/Interface.Config.md +5 -5
- package/docs/wiki/Interface.ConfigLoadOptions.md +28 -6
- package/docs/wiki/Interface.LogoConfig.md +4 -4
- package/docs/wiki/Interface.NavigationConfig.md +7 -7
- package/docs/wiki/Interface.Oauth2Config.md +2 -2
- package/docs/wiki/Interface.i18nConfig.md +3 -3
- package/docs/wiki/TypeAlias.AnySchema.md +1 -1
- package/docs/wiki/TypeAlias.Join.md +1 -1
- package/docs/wiki/TypeAlias.LanguagesConfig.md +1 -1
- package/docs/wiki/TypeAlias.Leaves.md +1 -1
- package/docs/wiki/TypeAlias.NoInferType.md +1 -1
- package/docs/wiki/TypeAlias.Paths.md +1 -1
- package/docs/wiki/Variable.RXAP_CONFIG.md +1 -1
- package/docs/wiki/_Sidebar.md +6 -0
- package/docs/wiki/globals.md +7 -1
- package/fesm2022/rxap-config.mjs +165 -5
- package/fesm2022/rxap-config.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/config.service.d.ts +12 -0
- package/lib/utilities.d.ts +7 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [19.1.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/config@19.0.4-dev.1...@rxap/config@19.1.0-dev.0) (2025-05-06)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **config:** add support for loading configuration from DNS and CID ([1af98c4](https://gitlab.com/rxap/packages/commit/1af98c442b3fdd45b61053b2163f0446fa4a66d0))
|
|
11
|
+
|
|
12
|
+
## [19.0.4-dev.1](https://gitlab.com/rxap/packages/compare/@rxap/config@19.0.4-dev.0...@rxap/config@19.0.4-dev.1) (2025-05-06)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **config.service:** improve path handling and property access validation ([645c46c](https://gitlab.com/rxap/packages/commit/645c46ca609bb731e9abdfd1a0e7e35132b4d127))
|
|
17
|
+
|
|
6
18
|
## [19.0.4-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/config@19.0.3...@rxap/config@19.0.4-dev.0) (2025-03-12)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @rxap/config
|
package/compodoc/changelog.html
CHANGED
|
@@ -85,6 +85,16 @@
|
|
|
85
85
|
<h1>Change Log</h1>
|
|
86
86
|
<p>All notable changes to this project will be documented in this file.
|
|
87
87
|
See <a href="https://conventionalcommits.org">Conventional Commits</a> for commit guidelines.</p>
|
|
88
|
+
<h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/config@19.0.4-dev.1...@rxap/config@19.1.0-dev.0">19.1.0-dev.0</a> (2025-05-06)</h1>
|
|
89
|
+
<h3>Features</h3>
|
|
90
|
+
<ul>
|
|
91
|
+
<li><strong>config:</strong> add support for loading configuration from DNS and CID (<a href="https://gitlab.com/rxap/packages/commit/1af98c442b3fdd45b61053b2163f0446fa4a66d0">1af98c4</a>)</li>
|
|
92
|
+
</ul>
|
|
93
|
+
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/config@19.0.4-dev.0...@rxap/config@19.0.4-dev.1">19.0.4-dev.1</a> (2025-05-06)</h2>
|
|
94
|
+
<h3>Bug Fixes</h3>
|
|
95
|
+
<ul>
|
|
96
|
+
<li><strong>config.service:</strong> improve path handling and property access validation (<a href="https://gitlab.com/rxap/packages/commit/645c46ca609bb731e9abdfd1a0e7e35132b4d127">645c46c</a>)</li>
|
|
97
|
+
</ul>
|
|
88
98
|
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/config@19.0.3...@rxap/config@19.0.4-dev.0">19.0.4-dev.0</a> (2025-03-12)</h2>
|
|
89
99
|
<p><strong>Note:</strong> Version bump only for package @rxap/config</p>
|
|
90
100
|
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/config@19.0.3-dev.0...@rxap/config@19.0.3">19.0.3</a> (2025-03-07)</h2>
|
|
@@ -117,9 +117,9 @@
|
|
|
117
117
|
<li>
|
|
118
118
|
<b>@angular/core</b> : ^19.2.1</li>
|
|
119
119
|
<li>
|
|
120
|
-
<b>@rxap/environment</b> : ^19.0.
|
|
120
|
+
<b>@rxap/environment</b> : ^19.0.4-dev.0</li>
|
|
121
121
|
<li>
|
|
122
|
-
<b>@rxap/utilities</b> : ^16.4.
|
|
122
|
+
<b>@rxap/utilities</b> : ^16.4.4-dev.0</li>
|
|
123
123
|
<li>
|
|
124
124
|
<b>rxjs</b> : ^7.8.1</li>
|
|
125
125
|
</ul>
|
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
</tr>
|
|
261
261
|
<tr>
|
|
262
262
|
<td class="col-md-4">
|
|
263
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
263
|
+
<div class="io-line">Defined in <a href="" data-line="76" class="link-to-prism">src/lib/config.service.ts:76</a></div>
|
|
264
264
|
</td>
|
|
265
265
|
</tr>
|
|
266
266
|
|
|
@@ -325,8 +325,8 @@
|
|
|
325
325
|
|
|
326
326
|
<tr>
|
|
327
327
|
<td class="col-md-4">
|
|
328
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
329
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
328
|
+
<div class="io-line">Defined in <a href="" data-line="414"
|
|
329
|
+
class="link-to-prism">src/lib/config.service.ts:414</a></div>
|
|
330
330
|
</td>
|
|
331
331
|
</tr>
|
|
332
332
|
|
|
@@ -364,8 +364,8 @@
|
|
|
364
364
|
|
|
365
365
|
<tr>
|
|
366
366
|
<td class="col-md-4">
|
|
367
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
368
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
367
|
+
<div class="io-line">Defined in <a href="" data-line="418"
|
|
368
|
+
class="link-to-prism">src/lib/config.service.ts:418</a></div>
|
|
369
369
|
</td>
|
|
370
370
|
</tr>
|
|
371
371
|
|
|
@@ -441,8 +441,8 @@
|
|
|
441
441
|
|
|
442
442
|
<tr>
|
|
443
443
|
<td class="col-md-4">
|
|
444
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
445
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
444
|
+
<div class="io-line">Defined in <a href="" data-line="419"
|
|
445
|
+
class="link-to-prism">src/lib/config.service.ts:419</a></div>
|
|
446
446
|
</td>
|
|
447
447
|
</tr>
|
|
448
448
|
|
|
@@ -530,8 +530,8 @@
|
|
|
530
530
|
|
|
531
531
|
<tr>
|
|
532
532
|
<td class="col-md-4">
|
|
533
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
534
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
533
|
+
<div class="io-line">Defined in <a href="" data-line="420"
|
|
534
|
+
class="link-to-prism">src/lib/config.service.ts:420</a></div>
|
|
535
535
|
</td>
|
|
536
536
|
</tr>
|
|
537
537
|
|
|
@@ -619,8 +619,8 @@
|
|
|
619
619
|
|
|
620
620
|
<tr>
|
|
621
621
|
<td class="col-md-4">
|
|
622
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
623
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
622
|
+
<div class="io-line">Defined in <a href="" data-line="352"
|
|
623
|
+
class="link-to-prism">src/lib/config.service.ts:352</a></div>
|
|
624
624
|
</td>
|
|
625
625
|
</tr>
|
|
626
626
|
|
|
@@ -721,8 +721,8 @@
|
|
|
721
721
|
|
|
722
722
|
<tr>
|
|
723
723
|
<td class="col-md-4">
|
|
724
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
725
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
724
|
+
<div class="io-line">Defined in <a href="" data-line="358"
|
|
725
|
+
class="link-to-prism">src/lib/config.service.ts:358</a></div>
|
|
726
726
|
</td>
|
|
727
727
|
</tr>
|
|
728
728
|
|
|
@@ -831,8 +831,8 @@
|
|
|
831
831
|
|
|
832
832
|
<tr>
|
|
833
833
|
<td class="col-md-4">
|
|
834
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
835
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
834
|
+
<div class="io-line">Defined in <a href="" data-line="424"
|
|
835
|
+
class="link-to-prism">src/lib/config.service.ts:424</a></div>
|
|
836
836
|
</td>
|
|
837
837
|
</tr>
|
|
838
838
|
|
|
@@ -908,8 +908,8 @@
|
|
|
908
908
|
|
|
909
909
|
<tr>
|
|
910
910
|
<td class="col-md-4">
|
|
911
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
912
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
911
|
+
<div class="io-line">Defined in <a href="" data-line="425"
|
|
912
|
+
class="link-to-prism">src/lib/config.service.ts:425</a></div>
|
|
913
913
|
</td>
|
|
914
914
|
</tr>
|
|
915
915
|
|
|
@@ -997,8 +997,8 @@
|
|
|
997
997
|
|
|
998
998
|
<tr>
|
|
999
999
|
<td class="col-md-4">
|
|
1000
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1001
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
1000
|
+
<div class="io-line">Defined in <a href="" data-line="426"
|
|
1001
|
+
class="link-to-prism">src/lib/config.service.ts:426</a></div>
|
|
1002
1002
|
</td>
|
|
1003
1003
|
</tr>
|
|
1004
1004
|
|
|
@@ -1087,8 +1087,8 @@
|
|
|
1087
1087
|
|
|
1088
1088
|
<tr>
|
|
1089
1089
|
<td class="col-md-4">
|
|
1090
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1091
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
1090
|
+
<div class="io-line">Defined in <a href="" data-line="96"
|
|
1091
|
+
class="link-to-prism">src/lib/config.service.ts:96</a></div>
|
|
1092
1092
|
</td>
|
|
1093
1093
|
</tr>
|
|
1094
1094
|
|
|
@@ -1173,8 +1173,8 @@
|
|
|
1173
1173
|
|
|
1174
1174
|
<tr>
|
|
1175
1175
|
<td class="col-md-4">
|
|
1176
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1177
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
1176
|
+
<div class="io-line">Defined in <a href="" data-line="410"
|
|
1177
|
+
class="link-to-prism">src/lib/config.service.ts:410</a></div>
|
|
1178
1178
|
</td>
|
|
1179
1179
|
</tr>
|
|
1180
1180
|
|
|
@@ -1243,8 +1243,8 @@
|
|
|
1243
1243
|
|
|
1244
1244
|
<tr>
|
|
1245
1245
|
<td class="col-md-4">
|
|
1246
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1247
|
-
class="link-to-prism">src/lib/config.service.ts:
|
|
1246
|
+
<div class="io-line">Defined in <a href="" data-line="333"
|
|
1247
|
+
class="link-to-prism">src/lib/config.service.ts:333</a></div>
|
|
1248
1248
|
</td>
|
|
1249
1249
|
</tr>
|
|
1250
1250
|
|
|
@@ -1353,7 +1353,7 @@
|
|
|
1353
1353
|
</tr>
|
|
1354
1354
|
<tr>
|
|
1355
1355
|
<td class="col-md-4">
|
|
1356
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1356
|
+
<div class="io-line">Defined in <a href="" data-line="76" class="link-to-prism">src/lib/config.service.ts:76</a></div>
|
|
1357
1357
|
</td>
|
|
1358
1358
|
</tr>
|
|
1359
1359
|
|
|
@@ -1385,7 +1385,7 @@
|
|
|
1385
1385
|
</tr>
|
|
1386
1386
|
<tr>
|
|
1387
1387
|
<td class="col-md-4">
|
|
1388
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1388
|
+
<div class="io-line">Defined in <a href="" data-line="55" class="link-to-prism">src/lib/config.service.ts:55</a></div>
|
|
1389
1389
|
</td>
|
|
1390
1390
|
</tr>
|
|
1391
1391
|
|
|
@@ -1417,7 +1417,7 @@
|
|
|
1417
1417
|
</tr>
|
|
1418
1418
|
<tr>
|
|
1419
1419
|
<td class="col-md-4">
|
|
1420
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1420
|
+
<div class="io-line">Defined in <a href="" data-line="62" class="link-to-prism">src/lib/config.service.ts:62</a></div>
|
|
1421
1421
|
</td>
|
|
1422
1422
|
</tr>
|
|
1423
1423
|
|
|
@@ -1457,7 +1457,7 @@ the Urls array.</p>
|
|
|
1457
1457
|
</tr>
|
|
1458
1458
|
<tr>
|
|
1459
1459
|
<td class="col-md-4">
|
|
1460
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1460
|
+
<div class="io-line">Defined in <a href="" data-line="70" class="link-to-prism">src/lib/config.service.ts:70</a></div>
|
|
1461
1461
|
</td>
|
|
1462
1462
|
</tr>
|
|
1463
1463
|
|
|
@@ -1483,7 +1483,7 @@ the Urls array.</p>
|
|
|
1483
1483
|
</tr>
|
|
1484
1484
|
<tr>
|
|
1485
1485
|
<td class="col-md-4">
|
|
1486
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1486
|
+
<div class="io-line">Defined in <a href="" data-line="49" class="link-to-prism">src/lib/config.service.ts:49</a></div>
|
|
1487
1487
|
</td>
|
|
1488
1488
|
</tr>
|
|
1489
1489
|
|
|
@@ -1515,7 +1515,7 @@ the Urls array.</p>
|
|
|
1515
1515
|
</tr>
|
|
1516
1516
|
<tr>
|
|
1517
1517
|
<td class="col-md-4">
|
|
1518
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1518
|
+
<div class="io-line">Defined in <a href="" data-line="52" class="link-to-prism">src/lib/config.service.ts:52</a></div>
|
|
1519
1519
|
</td>
|
|
1520
1520
|
</tr>
|
|
1521
1521
|
|
|
@@ -1541,7 +1541,7 @@ the Urls array.</p>
|
|
|
1541
1541
|
</tr>
|
|
1542
1542
|
<tr>
|
|
1543
1543
|
<td class="col-md-4">
|
|
1544
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1544
|
+
<div class="io-line">Defined in <a href="" data-line="50" class="link-to-prism">src/lib/config.service.ts:50</a></div>
|
|
1545
1545
|
</td>
|
|
1546
1546
|
</tr>
|
|
1547
1547
|
|
|
@@ -1573,7 +1573,7 @@ the Urls array.</p>
|
|
|
1573
1573
|
</tr>
|
|
1574
1574
|
<tr>
|
|
1575
1575
|
<td class="col-md-4">
|
|
1576
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1576
|
+
<div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/config.service.ts:53</a></div>
|
|
1577
1577
|
</td>
|
|
1578
1578
|
</tr>
|
|
1579
1579
|
|
|
@@ -1605,7 +1605,7 @@ the Urls array.</p>
|
|
|
1605
1605
|
</tr>
|
|
1606
1606
|
<tr>
|
|
1607
1607
|
<td class="col-md-4">
|
|
1608
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1608
|
+
<div class="io-line">Defined in <a href="" data-line="68" class="link-to-prism">src/lib/config.service.ts:68</a></div>
|
|
1609
1609
|
</td>
|
|
1610
1610
|
</tr>
|
|
1611
1611
|
|
|
@@ -1649,7 +1649,7 @@ value form the Defaults values or dynamic config files</p>
|
|
|
1649
1649
|
</tr>
|
|
1650
1650
|
<tr>
|
|
1651
1651
|
<td class="col-md-4">
|
|
1652
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
1652
|
+
<div class="io-line">Defined in <a href="" data-line="75" class="link-to-prism">src/lib/config.service.ts:75</a></div>
|
|
1653
1653
|
</td>
|
|
1654
1654
|
</tr>
|
|
1655
1655
|
|
|
@@ -1670,12 +1670,17 @@ value form the Defaults values or dynamic config files</p>
|
|
|
1670
1670
|
import { Environment } from '@rxap/environment';
|
|
1671
1671
|
import {
|
|
1672
1672
|
coerceArray,
|
|
1673
|
+
CoercePrefix,
|
|
1673
1674
|
deepMerge,
|
|
1674
1675
|
SetObjectValue,
|
|
1675
1676
|
} from '@rxap/utilities';
|
|
1676
1677
|
import { ReplaySubject } from 'rxjs';
|
|
1677
1678
|
import { RXAP_CONFIG } from './tokens';
|
|
1678
1679
|
import { NoInferType } from './types';
|
|
1680
|
+
import {
|
|
1681
|
+
dnsLookup,
|
|
1682
|
+
fetchCidContentAsJson,
|
|
1683
|
+
} from './utilities';
|
|
1679
1684
|
|
|
1680
1685
|
export type AnySchema = { validateAsync: (...args: any[]) => any };
|
|
1681
1686
|
|
|
@@ -1688,6 +1693,16 @@ export interface ConfigLoadOptions {
|
|
|
1688
1693
|
* static config values
|
|
1689
1694
|
*/
|
|
1690
1695
|
static?: Record<string, any>;
|
|
1696
|
+
/**
|
|
1697
|
+
* Load additional configuration based on a CID found in a DNS TXT record.
|
|
1698
|
+
* If true, uses `location.hostname`. If a string, uses that domain.
|
|
1699
|
+
*/
|
|
1700
|
+
fromDns?: string | boolean;
|
|
1701
|
+
/**
|
|
1702
|
+
* Load additional configuration directly from the given Content Identifier (CID).
|
|
1703
|
+
* This takes precedence over `fromDns` if both are provided.
|
|
1704
|
+
*/
|
|
1705
|
+
fromCid?: string;
|
|
1691
1706
|
}
|
|
1692
1707
|
|
|
1693
1708
|
@Injectable({
|
|
@@ -1796,11 +1811,65 @@ export class ConfigService<Config extends Record<string, any> = Re
|
|
|
1796
1811
|
config = deepMerge(config, this.LoadConfigDefaultFromUrlParam(param));
|
|
1797
1812
|
}
|
|
1798
1813
|
|
|
1814
|
+
if (options?.fromDns) {
|
|
1815
|
+
await this.loadConfigFromDns(options as any);
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
if (options?.fromCid) {
|
|
1819
|
+
config = deepMerge(config, await this.loadConfigFromCid(options as any));
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1799
1822
|
console.debug('app config', config);
|
|
1800
1823
|
|
|
1801
1824
|
this.Config = config;
|
|
1802
1825
|
}
|
|
1803
1826
|
|
|
1827
|
+
private static async loadConfigFromCid(options: ConfigLoadOptions & { fromCid: string | boolean }) {
|
|
1828
|
+
console.debug('Loading config from CID: ', options.fromCid);
|
|
1829
|
+
try {
|
|
1830
|
+
const cidContent = await fetchCidContentAsJson(options.fromCid);
|
|
1831
|
+
if (cidContent && typeof cidContent === 'object') {
|
|
1832
|
+
console.log(`Merging configuration from CID ${options.fromCid}.`, cidContent);
|
|
1833
|
+
// Merge CID content into the existing config object
|
|
1834
|
+
console.log('Configuration merged successfully.');
|
|
1835
|
+
return cidContent;
|
|
1836
|
+
} else if (cidContent) {
|
|
1837
|
+
console.warn(`Content fetched from CID ${options.fromCid} is not a mergeable object, skipping merge.`);
|
|
1838
|
+
} else {
|
|
1839
|
+
console.warn(`No content fetched or content was null for CID ${options.fromCid}.`);
|
|
1840
|
+
}
|
|
1841
|
+
} catch (error) {
|
|
1842
|
+
console.error(`Failed to fetch or process content for CID ${options.fromCid}:`, error);
|
|
1843
|
+
// Decide how to handle fetch/processing errors
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
private static async loadConfigFromDns(options: ConfigLoadOptions & { fromDns: string | boolean }) {
|
|
1848
|
+
console.debug('Loading config from DNS');
|
|
1849
|
+
let domain = location.hostname;
|
|
1850
|
+
if (typeof options.fromDns === 'string') {
|
|
1851
|
+
domain = options.fromDns;
|
|
1852
|
+
}
|
|
1853
|
+
domain = CoercePrefix(domain, '_config.');
|
|
1854
|
+
try {
|
|
1855
|
+
console.log(`Attempting DNS lookup for domain: ${domain}`);
|
|
1856
|
+
const txtData = await dnsLookup(domain, 'TXT');
|
|
1857
|
+
console.log(`DNS TXT record data found: ${txtData}`);
|
|
1858
|
+
// Example CID extraction logic (adapt to your TXT record format)
|
|
1859
|
+
// This looks for IPFS CIDs (v0 'Qm...' or v1 'b...') potentially after 'ipfs://' or '/'
|
|
1860
|
+
const cidMatch = txtData.match(/(?:ipfs:\/\/|\/|^)([a-zA-Z0-9]{40,})$/);
|
|
1861
|
+
if (cidMatch && cidMatch[1]) {
|
|
1862
|
+
options.fromCid = cidMatch[1];
|
|
1863
|
+
console.log(`Extracted CID from DNS: ${options.fromCid}`);
|
|
1864
|
+
} else {
|
|
1865
|
+
console.warn(`Could not extract a valid CID format from DNS TXT data: "${txtData}"`);
|
|
1866
|
+
}
|
|
1867
|
+
} catch (error) {
|
|
1868
|
+
console.error(`DNS lookup for ${domain} failed:`, error);
|
|
1869
|
+
// Decide if failure is critical or recoverable
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1804
1873
|
private static handleError(error: any) {
|
|
1805
1874
|
this.onError.next(error);
|
|
1806
1875
|
for (const fnc of this.onErrorFnc) {
|
|
@@ -1962,9 +2031,8 @@ export class ConfigService<Config extends Record<string, any> = Re
|
|
|
1962
2031
|
if (typeof path !== 'string') {
|
|
1963
2032
|
throw new Error('The config property path is not a string');
|
|
1964
2033
|
}
|
|
1965
|
-
for (const fragment of
|
|
1966
|
-
|
|
1967
|
-
if (configValue.hasOwnProperty(fragment)) {
|
|
2034
|
+
for (const fragment of path.split('.')) {
|
|
2035
|
+
if (configValue && typeof configValue === 'object' && fragment in configValue) {
|
|
1968
2036
|
configValue = configValue[fragment];
|
|
1969
2037
|
} else {
|
|
1970
2038
|
if (defaultValue !== undefined) {
|
|
@@ -140,6 +140,20 @@
|
|
|
140
140
|
<tr>
|
|
141
141
|
<td class="col-md-4">
|
|
142
142
|
<ul class="index-list">
|
|
143
|
+
<li>
|
|
144
|
+
<span class="modifier">Optional</span>
|
|
145
|
+
<a href="#fromCid"
|
|
146
|
+
>
|
|
147
|
+
fromCid
|
|
148
|
+
</a>
|
|
149
|
+
</li>
|
|
150
|
+
<li>
|
|
151
|
+
<span class="modifier">Optional</span>
|
|
152
|
+
<a href="#fromDns"
|
|
153
|
+
>
|
|
154
|
+
fromDns
|
|
155
|
+
</a>
|
|
156
|
+
</li>
|
|
143
157
|
<li>
|
|
144
158
|
<span class="modifier">Optional</span>
|
|
145
159
|
<a href="#fromLocalStorage"
|
|
@@ -186,6 +200,96 @@
|
|
|
186
200
|
|
|
187
201
|
<section data-compodoc="block-properties">
|
|
188
202
|
<h3 id="inputs">Properties</h3>
|
|
203
|
+
<table class="table table-sm table-bordered">
|
|
204
|
+
<tbody>
|
|
205
|
+
<tr>
|
|
206
|
+
<td class="col-md-4">
|
|
207
|
+
<a name="fromCid"></a>
|
|
208
|
+
<span class="name "><b>fromCid</b>
|
|
209
|
+
<a href="#fromCid">
|
|
210
|
+
<span class="icon ion-ios-link"></span>
|
|
211
|
+
</a>
|
|
212
|
+
</span>
|
|
213
|
+
</td>
|
|
214
|
+
</tr>
|
|
215
|
+
<tr>
|
|
216
|
+
<td class="col-md-4">
|
|
217
|
+
<code>fromCid: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
218
|
+
</code>
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
<tr>
|
|
224
|
+
<td class="col-md-4">
|
|
225
|
+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
226
|
+
|
|
227
|
+
</td>
|
|
228
|
+
</tr>
|
|
229
|
+
|
|
230
|
+
<tr>
|
|
231
|
+
<td class="col-md-4">
|
|
232
|
+
<i>Optional</i>
|
|
233
|
+
</td>
|
|
234
|
+
</tr>
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
<tr>
|
|
240
|
+
<td class="col-md-4">
|
|
241
|
+
<div class="io-description"><p>Load additional configuration directly from the given Content Identifier (CID).
|
|
242
|
+
This takes precedence over <code>fromDns</code> if both are provided.</p>
|
|
243
|
+
</div>
|
|
244
|
+
</td>
|
|
245
|
+
</tr>
|
|
246
|
+
</tbody>
|
|
247
|
+
</table>
|
|
248
|
+
<table class="table table-sm table-bordered">
|
|
249
|
+
<tbody>
|
|
250
|
+
<tr>
|
|
251
|
+
<td class="col-md-4">
|
|
252
|
+
<a name="fromDns"></a>
|
|
253
|
+
<span class="name "><b>fromDns</b>
|
|
254
|
+
<a href="#fromDns">
|
|
255
|
+
<span class="icon ion-ios-link"></span>
|
|
256
|
+
</a>
|
|
257
|
+
</span>
|
|
258
|
+
</td>
|
|
259
|
+
</tr>
|
|
260
|
+
<tr>
|
|
261
|
+
<td class="col-md-4">
|
|
262
|
+
<code>fromDns: <code>string | boolean</code>
|
|
263
|
+
</code>
|
|
264
|
+
</td>
|
|
265
|
+
</tr>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<tr>
|
|
269
|
+
<td class="col-md-4">
|
|
270
|
+
<i>Type : </i> <code>string | boolean</code>
|
|
271
|
+
|
|
272
|
+
</td>
|
|
273
|
+
</tr>
|
|
274
|
+
|
|
275
|
+
<tr>
|
|
276
|
+
<td class="col-md-4">
|
|
277
|
+
<i>Optional</i>
|
|
278
|
+
</td>
|
|
279
|
+
</tr>
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
<tr>
|
|
285
|
+
<td class="col-md-4">
|
|
286
|
+
<div class="io-description"><p>Load additional configuration based on a CID found in a DNS TXT record.
|
|
287
|
+
If true, uses <code>location.hostname</code>. If a string, uses that domain.</p>
|
|
288
|
+
</div>
|
|
289
|
+
</td>
|
|
290
|
+
</tr>
|
|
291
|
+
</tbody>
|
|
292
|
+
</table>
|
|
189
293
|
<table class="table table-sm table-bordered">
|
|
190
294
|
<tbody>
|
|
191
295
|
<tr>
|
|
@@ -395,12 +499,17 @@
|
|
|
395
499
|
import { Environment } from '@rxap/environment';
|
|
396
500
|
import {
|
|
397
501
|
coerceArray,
|
|
502
|
+
CoercePrefix,
|
|
398
503
|
deepMerge,
|
|
399
504
|
SetObjectValue,
|
|
400
505
|
} from '@rxap/utilities';
|
|
401
506
|
import { ReplaySubject } from 'rxjs';
|
|
402
507
|
import { RXAP_CONFIG } from './tokens';
|
|
403
508
|
import { NoInferType } from './types';
|
|
509
|
+
import {
|
|
510
|
+
dnsLookup,
|
|
511
|
+
fetchCidContentAsJson,
|
|
512
|
+
} from './utilities';
|
|
404
513
|
|
|
405
514
|
export type AnySchema = { validateAsync: (...args: any[]) => any };
|
|
406
515
|
|
|
@@ -413,6 +522,16 @@ export interface ConfigLoadOptions {
|
|
|
413
522
|
* static config values
|
|
414
523
|
*/
|
|
415
524
|
static?: Record<string, any>;
|
|
525
|
+
/**
|
|
526
|
+
* Load additional configuration based on a CID found in a DNS TXT record.
|
|
527
|
+
* If true, uses `location.hostname`. If a string, uses that domain.
|
|
528
|
+
*/
|
|
529
|
+
fromDns?: string | boolean;
|
|
530
|
+
/**
|
|
531
|
+
* Load additional configuration directly from the given Content Identifier (CID).
|
|
532
|
+
* This takes precedence over `fromDns` if both are provided.
|
|
533
|
+
*/
|
|
534
|
+
fromCid?: string;
|
|
416
535
|
}
|
|
417
536
|
|
|
418
537
|
@Injectable({
|
|
@@ -521,11 +640,65 @@ export class ConfigService<Config extends Record<string, any> = Re
|
|
|
521
640
|
config = deepMerge(config, this.LoadConfigDefaultFromUrlParam(param));
|
|
522
641
|
}
|
|
523
642
|
|
|
643
|
+
if (options?.fromDns) {
|
|
644
|
+
await this.loadConfigFromDns(options as any);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
if (options?.fromCid) {
|
|
648
|
+
config = deepMerge(config, await this.loadConfigFromCid(options as any));
|
|
649
|
+
}
|
|
650
|
+
|
|
524
651
|
console.debug('app config', config);
|
|
525
652
|
|
|
526
653
|
this.Config = config;
|
|
527
654
|
}
|
|
528
655
|
|
|
656
|
+
private static async loadConfigFromCid(options: ConfigLoadOptions & { fromCid: string | boolean }) {
|
|
657
|
+
console.debug('Loading config from CID: ', options.fromCid);
|
|
658
|
+
try {
|
|
659
|
+
const cidContent = await fetchCidContentAsJson(options.fromCid);
|
|
660
|
+
if (cidContent && typeof cidContent === 'object') {
|
|
661
|
+
console.log(`Merging configuration from CID ${options.fromCid}.`, cidContent);
|
|
662
|
+
// Merge CID content into the existing config object
|
|
663
|
+
console.log('Configuration merged successfully.');
|
|
664
|
+
return cidContent;
|
|
665
|
+
} else if (cidContent) {
|
|
666
|
+
console.warn(`Content fetched from CID ${options.fromCid} is not a mergeable object, skipping merge.`);
|
|
667
|
+
} else {
|
|
668
|
+
console.warn(`No content fetched or content was null for CID ${options.fromCid}.`);
|
|
669
|
+
}
|
|
670
|
+
} catch (error) {
|
|
671
|
+
console.error(`Failed to fetch or process content for CID ${options.fromCid}:`, error);
|
|
672
|
+
// Decide how to handle fetch/processing errors
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
private static async loadConfigFromDns(options: ConfigLoadOptions & { fromDns: string | boolean }) {
|
|
677
|
+
console.debug('Loading config from DNS');
|
|
678
|
+
let domain = location.hostname;
|
|
679
|
+
if (typeof options.fromDns === 'string') {
|
|
680
|
+
domain = options.fromDns;
|
|
681
|
+
}
|
|
682
|
+
domain = CoercePrefix(domain, '_config.');
|
|
683
|
+
try {
|
|
684
|
+
console.log(`Attempting DNS lookup for domain: ${domain}`);
|
|
685
|
+
const txtData = await dnsLookup(domain, 'TXT');
|
|
686
|
+
console.log(`DNS TXT record data found: ${txtData}`);
|
|
687
|
+
// Example CID extraction logic (adapt to your TXT record format)
|
|
688
|
+
// This looks for IPFS CIDs (v0 'Qm...' or v1 'b...') potentially after 'ipfs://' or '/'
|
|
689
|
+
const cidMatch = txtData.match(/(?:ipfs:\/\/|\/|^)([a-zA-Z0-9]{40,})$/);
|
|
690
|
+
if (cidMatch && cidMatch[1]) {
|
|
691
|
+
options.fromCid = cidMatch[1];
|
|
692
|
+
console.log(`Extracted CID from DNS: ${options.fromCid}`);
|
|
693
|
+
} else {
|
|
694
|
+
console.warn(`Could not extract a valid CID format from DNS TXT data: "${txtData}"`);
|
|
695
|
+
}
|
|
696
|
+
} catch (error) {
|
|
697
|
+
console.error(`DNS lookup for ${domain} failed:`, error);
|
|
698
|
+
// Decide if failure is critical or recoverable
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
529
702
|
private static handleError(error: any) {
|
|
530
703
|
this.onError.next(error);
|
|
531
704
|
for (const fnc of this.onErrorFnc) {
|
|
@@ -687,9 +860,8 @@ export class ConfigService<Config extends Record<string, any> = Re
|
|
|
687
860
|
if (typeof path !== 'string') {
|
|
688
861
|
throw new Error('The config property path is not a string');
|
|
689
862
|
}
|
|
690
|
-
for (const fragment of
|
|
691
|
-
|
|
692
|
-
if (configValue.hasOwnProperty(fragment)) {
|
|
863
|
+
for (const fragment of path.split('.')) {
|
|
864
|
+
if (configValue && typeof configValue === 'object' && fragment in configValue) {
|
|
693
865
|
configValue = configValue[fragment];
|
|
694
866
|
} else {
|
|
695
867
|
if (defaultValue !== undefined) {
|