@rxap/config 19.3.0-dev.3 → 19.3.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 (154) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +53 -0
  3. package/compodoc/changelog.html +11 -0
  4. package/compodoc/dependencies.html +2 -2
  5. package/compodoc/index.html +69 -1
  6. package/compodoc/injectables/ConfigService.html +210 -102
  7. package/compodoc/interfaces/ConfigLoadError.html +610 -0
  8. package/compodoc/interfaces/ConfigLoadOptions.html +213 -66
  9. package/compodoc/js/menu-wc.js +3 -0
  10. package/compodoc/js/menu-wc_es5.js +1 -1
  11. package/compodoc/js/search/search_index.js +2 -2
  12. package/compodoc/miscellaneous/functions.html +130 -1
  13. package/compodoc/miscellaneous/typealiases.html +78 -0
  14. package/compodoc/overview.html +1 -1
  15. package/compodoc/properties.html +1 -1
  16. package/docs/documentation.json +2441 -1293
  17. package/docs/html/assets/hierarchy.js +1 -1
  18. package/docs/html/assets/highlight.css +42 -0
  19. package/docs/html/assets/navigation.js +1 -1
  20. package/docs/html/assets/search.js +1 -1
  21. package/docs/html/classes/ConfigLoaderService.html +2 -2
  22. package/docs/html/classes/ConfigService.html +8 -6
  23. package/docs/html/classes/ConfigTestingService.html +2 -2
  24. package/docs/html/enums/ConfigLoadMethod.html +2 -2
  25. package/docs/html/enums/ConfigLoadingStrategy.html +2 -2
  26. package/docs/html/functions/ProvideConfig.html +1 -1
  27. package/docs/html/functions/defaultConfigLoadErrorHandler.html +4 -0
  28. package/docs/html/functions/dnsLookup.html +1 -1
  29. package/docs/html/functions/dnsResolver.html +1 -1
  30. package/docs/html/functions/fetchCidContent.html +1 -1
  31. package/docs/html/functions/fetchCidContentAsJson.html +1 -1
  32. package/docs/html/functions/fetchCidContentViaHttp.html +1 -1
  33. package/docs/html/functions/fetchContentViaHttp.html +1 -1
  34. package/docs/html/functions/localPathIpfsGateway.html +1 -1
  35. package/docs/html/functions/localSubDomainIpfsGateway.html +1 -1
  36. package/docs/html/functions/raceSuccess.html +2 -2
  37. package/docs/html/functions/showConfigLoadError.html +2 -0
  38. package/docs/html/functions/storachaIpfsGateway.html +1 -1
  39. package/docs/html/functions/w3sIpfsGateway.html +1 -1
  40. package/docs/html/hierarchy.html +1 -1
  41. package/docs/html/index.html +54 -2
  42. package/docs/html/interfaces/AppsNavigationConfig.html +2 -2
  43. package/docs/html/interfaces/Config.html +2 -2
  44. package/docs/html/interfaces/ConfigLoadError.html +11 -0
  45. package/docs/html/interfaces/ConfigLoadOptions.html +13 -6
  46. package/docs/html/interfaces/LogoConfig.html +2 -2
  47. package/docs/html/interfaces/NavigationConfig.html +2 -2
  48. package/docs/html/interfaces/Oauth2Config.html +2 -2
  49. package/docs/html/interfaces/i18nConfig.html +2 -2
  50. package/docs/html/modules.html +1 -1
  51. package/docs/html/types/AnySchema.html +1 -1
  52. package/docs/html/types/ConfigLoadErrorHandler.html +2 -0
  53. package/docs/html/types/ConfigLoadErrorKind.html +9 -0
  54. package/docs/html/types/ConfigRequestOptions.html +1 -0
  55. package/docs/html/types/IpfsGatewayFunction.html +1 -1
  56. package/docs/html/types/Join.html +1 -1
  57. package/docs/html/types/LanguagesConfig.html +1 -1
  58. package/docs/html/types/Leaves.html +1 -1
  59. package/docs/html/types/NoInferType.html +1 -1
  60. package/docs/html/types/Paths.html +1 -1
  61. package/docs/html/variables/RXAP_CONFIG.html +1 -1
  62. package/docs/html/variables/defaultDnsServers.html +1 -1
  63. package/docs/html/variables/defaultIpfsGatewayServers.html +1 -1
  64. package/docs/markdown/README.md +54 -1
  65. package/docs/markdown/classes/ConfigLoaderService.md +7 -7
  66. package/docs/markdown/classes/ConfigService.md +37 -23
  67. package/docs/markdown/classes/ConfigTestingService.md +8 -8
  68. package/docs/markdown/enumerations/ConfigLoadMethod.md +6 -6
  69. package/docs/markdown/enumerations/ConfigLoadingStrategy.md +4 -4
  70. package/docs/markdown/functions/ProvideConfig.md +2 -2
  71. package/docs/markdown/functions/defaultConfigLoadErrorHandler.md +26 -0
  72. package/docs/markdown/functions/dnsLookup.md +2 -2
  73. package/docs/markdown/functions/dnsResolver.md +2 -2
  74. package/docs/markdown/functions/fetchCidContent.md +2 -2
  75. package/docs/markdown/functions/fetchCidContentAsJson.md +2 -2
  76. package/docs/markdown/functions/fetchCidContentViaHttp.md +2 -2
  77. package/docs/markdown/functions/fetchContentViaHttp.md +2 -2
  78. package/docs/markdown/functions/localPathIpfsGateway.md +2 -2
  79. package/docs/markdown/functions/localSubDomainIpfsGateway.md +2 -2
  80. package/docs/markdown/functions/raceSuccess.md +2 -2
  81. package/docs/markdown/functions/showConfigLoadError.md +23 -0
  82. package/docs/markdown/functions/storachaIpfsGateway.md +2 -2
  83. package/docs/markdown/functions/w3sIpfsGateway.md +2 -2
  84. package/docs/markdown/globals.md +8 -2
  85. package/docs/markdown/interfaces/AppsNavigationConfig.md +12 -12
  86. package/docs/markdown/interfaces/Config.md +6 -6
  87. package/docs/markdown/interfaces/ConfigLoadError.md +70 -0
  88. package/docs/markdown/interfaces/ConfigLoadOptions.md +39 -15
  89. package/docs/markdown/interfaces/LogoConfig.md +5 -5
  90. package/docs/markdown/interfaces/NavigationConfig.md +9 -9
  91. package/docs/markdown/interfaces/Oauth2Config.md +3 -3
  92. package/docs/markdown/interfaces/i18nConfig.md +4 -4
  93. package/docs/markdown/type-aliases/AnySchema.md +2 -2
  94. package/docs/markdown/type-aliases/ConfigLoadErrorHandler.md +23 -0
  95. package/docs/markdown/type-aliases/ConfigLoadErrorKind.md +19 -0
  96. package/docs/markdown/type-aliases/ConfigRequestOptions.md +11 -0
  97. package/docs/markdown/type-aliases/IpfsGatewayFunction.md +2 -2
  98. package/docs/markdown/type-aliases/Join.md +2 -2
  99. package/docs/markdown/type-aliases/LanguagesConfig.md +2 -2
  100. package/docs/markdown/type-aliases/Leaves.md +2 -2
  101. package/docs/markdown/type-aliases/NoInferType.md +2 -2
  102. package/docs/markdown/type-aliases/Paths.md +2 -2
  103. package/docs/markdown/variables/RXAP_CONFIG.md +2 -2
  104. package/docs/markdown/variables/defaultDnsServers.md +2 -2
  105. package/docs/markdown/variables/defaultIpfsGatewayServers.md +2 -2
  106. package/docs/wiki/Class.ConfigLoaderService.md +6 -6
  107. package/docs/wiki/Class.ConfigService.md +36 -22
  108. package/docs/wiki/Class.ConfigTestingService.md +7 -7
  109. package/docs/wiki/Enumeration.ConfigLoadMethod.md +5 -5
  110. package/docs/wiki/Enumeration.ConfigLoadingStrategy.md +3 -3
  111. package/docs/wiki/Function.ProvideConfig.md +1 -1
  112. package/docs/wiki/Function.defaultConfigLoadErrorHandler.md +22 -0
  113. package/docs/wiki/Function.dnsLookup.md +1 -1
  114. package/docs/wiki/Function.dnsResolver.md +1 -1
  115. package/docs/wiki/Function.fetchCidContent.md +1 -1
  116. package/docs/wiki/Function.fetchCidContentAsJson.md +1 -1
  117. package/docs/wiki/Function.fetchCidContentViaHttp.md +1 -1
  118. package/docs/wiki/Function.fetchContentViaHttp.md +1 -1
  119. package/docs/wiki/Function.localPathIpfsGateway.md +1 -1
  120. package/docs/wiki/Function.localSubDomainIpfsGateway.md +1 -1
  121. package/docs/wiki/Function.raceSuccess.md +1 -1
  122. package/docs/wiki/Function.showConfigLoadError.md +19 -0
  123. package/docs/wiki/Function.storachaIpfsGateway.md +1 -1
  124. package/docs/wiki/Function.w3sIpfsGateway.md +1 -1
  125. package/docs/wiki/Home.md +53 -0
  126. package/docs/wiki/Interface.AppsNavigationConfig.md +11 -11
  127. package/docs/wiki/Interface.Config.md +5 -5
  128. package/docs/wiki/Interface.ConfigLoadError.md +66 -0
  129. package/docs/wiki/Interface.ConfigLoadOptions.md +38 -14
  130. package/docs/wiki/Interface.LogoConfig.md +4 -4
  131. package/docs/wiki/Interface.NavigationConfig.md +8 -8
  132. package/docs/wiki/Interface.Oauth2Config.md +2 -2
  133. package/docs/wiki/Interface.i18nConfig.md +3 -3
  134. package/docs/wiki/TypeAlias.AnySchema.md +1 -1
  135. package/docs/wiki/TypeAlias.ConfigLoadErrorHandler.md +19 -0
  136. package/docs/wiki/TypeAlias.ConfigLoadErrorKind.md +15 -0
  137. package/docs/wiki/TypeAlias.ConfigRequestOptions.md +7 -0
  138. package/docs/wiki/TypeAlias.IpfsGatewayFunction.md +1 -1
  139. package/docs/wiki/TypeAlias.Join.md +1 -1
  140. package/docs/wiki/TypeAlias.LanguagesConfig.md +1 -1
  141. package/docs/wiki/TypeAlias.Leaves.md +1 -1
  142. package/docs/wiki/TypeAlias.NoInferType.md +1 -1
  143. package/docs/wiki/TypeAlias.Paths.md +1 -1
  144. package/docs/wiki/Variable.RXAP_CONFIG.md +1 -1
  145. package/docs/wiki/Variable.defaultDnsServers.md +1 -1
  146. package/docs/wiki/Variable.defaultIpfsGatewayServers.md +1 -1
  147. package/docs/wiki/_Sidebar.md +6 -0
  148. package/docs/wiki/globals.md +7 -1
  149. package/fesm2022/rxap-config.mjs +125 -70
  150. package/fesm2022/rxap-config.mjs.map +1 -1
  151. package/index.d.ts +1 -0
  152. package/lib/config-load-error.d.ts +41 -0
  153. package/lib/config.service.d.ts +24 -2
  154. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## 19.3.0 (2026-11-20)
2
+
3
+ This was a version bump only for angular-config to align it with other projects, there were no code changes.
4
+
5
+ ## 19.3.0-dev.4 (2026-09-25)
6
+
7
+ ### 🚀 Features
8
+
9
+ - **config:** allow a custom error handler for failed config requests
10
+
11
+ ### ❤️ Thank You
12
+
13
+ - Merzough Münker
14
+
1
15
  ## 19.3.0-dev.3 (2026-06-19)
2
16
 
3
17
  ### 🚀 Features
package/README.md CHANGED
@@ -8,6 +8,7 @@ Provides a configuration service for Angular applications, allowing you to load
8
8
  ![NPM](https://img.shields.io/npm/l/@rxap/config)
9
9
 
10
10
  - [Installation](#installation)
11
+ - [Guides](#guides)
11
12
  - [Generators](#generators)
12
13
  - [init](#init)
13
14
 
@@ -25,6 +26,58 @@ yarn add @angular/common @angular/core @rxap/environment @rxap/utilities rxjs
25
26
  ```bash
26
27
  yarn nx g @rxap/config:init
27
28
  ```
29
+ # Guides
30
+
31
+ ## Custom error handling for failed config requests
32
+
33
+ By default a failed required config url request shows an error overlay and reloads the page after
34
+ 30 s. Pass `errorHandler` in the `ConfigLoadOptions` to replace this behavior. The handler gets a
35
+ structured `ConfigLoadError`:
36
+
37
+ | `kind` | When |
38
+ |------------|-------------------------------------------------------------------------|
39
+ | `network` | `fetch()` rejected (offline, DNS, CORS without a redirect) |
40
+ | `redirect` | the response is an `opaqueredirect` (only with `redirect: 'manual'`) |
41
+ | `http` | the response is not ok (`status` and `response` are set) |
42
+ | `parse` | the response body is not valid JSON |
43
+ | `schema` | the schema validation failed |
44
+
45
+ `requestInit` is passed to every config url `fetch()` call. Use `{ redirect: 'manual' }` to detect a
46
+ redirect to a login page instead of getting a CORS error.
47
+
48
+ ```ts
49
+ import {
50
+ ConfigService,
51
+ defaultConfigLoadErrorHandler,
52
+ } from '@rxap/config';
53
+
54
+ await ConfigService.Load({
55
+ url: '/config.json',
56
+ requestInit: { redirect: 'manual' },
57
+ errorHandler: (error) => {
58
+ if (error.kind === 'redirect' || error.status === 401) {
59
+ location.href = '/oauth2/sign_in';
60
+ // never resolve - the browser navigates away
61
+ return new Promise<void>(() => undefined);
62
+ }
63
+ // fall back to the default overlay + reload
64
+ return defaultConfigLoadErrorHandler(error);
65
+ },
66
+ });
67
+ ```
68
+
69
+ - The handler is called **instead of** the default overlay and reload - no DOM changes, no reload.
70
+ - After the handler resolves a required url still throws and an optional url resolves with `null`.
71
+ - The `onError` / `onRequestError` subjects and the `onErrorFnc` / `onRequestErrorFnc` hooks are
72
+ still called for required urls.
73
+ - The handler and `requestInit` of the last `ConfigService.Load` call are also used by
74
+ `ConfigService.SideLoad`. Pass the fifth `options` argument of `SideLoad` to override them.
75
+ - The handler only covers config url sources (`url` / `fromUrls` and `SideLoad`). The CID and DNS
76
+ sources (`fromCid`, `fromDns`) fetch through their own paths, only log failures and never show the
77
+ overlay.
78
+ - `StandaloneApplication` from `@rxap/ngx-bootstrap` forwards its `configLoadOptions` unchanged, so
79
+ the options can be passed as its fourth constructor argument.
80
+
28
81
  # Generators
29
82
 
30
83
  ## init
@@ -82,6 +82,17 @@
82
82
  <div class="content getting-started">
83
83
  <div class="content-data">
84
84
 
85
+ <h2>19.3.0 (2026-11-20)</h2>
86
+ <p>This was a version bump only for angular-config to align it with other projects, there were no code changes.</p>
87
+ <h2>19.3.0-dev.4 (2026-09-25)</h2>
88
+ <h3>🚀 Features</h3>
89
+ <ul>
90
+ <li><strong>config:</strong> allow a custom error handler for failed config requests</li>
91
+ </ul>
92
+ <h3>❤️ Thank You</h3>
93
+ <ul>
94
+ <li>Merzough Münker</li>
95
+ </ul>
85
96
  <h2>19.3.0-dev.3 (2026-06-19)</h2>
86
97
  <h3>🚀 Features</h3>
87
98
  <ul>
@@ -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.2.0-dev.0</li>
120
+ <b>@rxap/environment</b> : ^19.2.0</li>
121
121
  <li>
122
- <b>@rxap/utilities</b> : ^16.5.1-dev.1</li>
122
+ <b>@rxap/utilities</b> : ^16.5.1</li>
123
123
  <li>
124
124
  <b>rxjs</b> : ^7.8.1</li>
125
125
  </ul>
@@ -91,6 +91,7 @@
91
91
  <img src="https://img.shields.io/npm/l/@rxap/config" alt="NPM" class="img-responsive"></p>
92
92
  <ul>
93
93
  <li><a href="#installation">Installation</a></li>
94
+ <li><a href="#guides">Guides</a></li>
94
95
  <li><a href="#generators">Generators</a><ul>
95
96
  <li><a href="#init">init</a></li>
96
97
  </ul>
@@ -100,7 +101,74 @@
100
101
  <p><strong>Add the package to your workspace:</strong></p>
101
102
  <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add &#64;rxap/config</code></pre></div><p><strong>Install peer dependencies:</strong></p>
102
103
  <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn add &#64;angular/common &#64;angular/core &#64;rxap/environment &#64;rxap/utilities rxjs </code></pre></div><p><strong>Execute the init generator:</strong></p>
103
- <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn nx g &#64;rxap/config:init</code></pre></div><h1>Generators</h1>
104
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-bash">yarn nx g &#64;rxap/config:init</code></pre></div><h1>Guides</h1>
105
+ <h2>Custom error handling for failed config requests</h2>
106
+ <p>By default a failed required config url request shows an error overlay and reloads the page after
107
+ 30 s. Pass <code>errorHandler</code> in the <code>ConfigLoadOptions</code> to replace this behavior. The handler gets a
108
+ structured <code>ConfigLoadError</code>:</p>
109
+ <table class="table table-bordered compodoc-table">
110
+ <thead>
111
+ <tr>
112
+ <th><code>kind</code></th>
113
+ <th>When</th>
114
+ </tr>
115
+ </thead>
116
+ <tbody>
117
+ <tr>
118
+ <td><code>network</code></td>
119
+ <td><code>fetch()</code> rejected (offline, DNS, CORS without a redirect)</td>
120
+ </tr>
121
+ <tr>
122
+ <td><code>redirect</code></td>
123
+ <td>the response is an <code>opaqueredirect</code> (only with <code>redirect: &#39;manual&#39;</code>)</td>
124
+ </tr>
125
+ <tr>
126
+ <td><code>http</code></td>
127
+ <td>the response is not ok (<code>status</code> and <code>response</code> are set)</td>
128
+ </tr>
129
+ <tr>
130
+ <td><code>parse</code></td>
131
+ <td>the response body is not valid JSON</td>
132
+ </tr>
133
+ <tr>
134
+ <td><code>schema</code></td>
135
+ <td>the schema validation failed</td>
136
+ </tr>
137
+ </tbody>
138
+ </table>
139
+ <p><code>requestInit</code> is passed to every config url <code>fetch()</code> call. Use <code>{ redirect: &#39;manual&#39; }</code> to detect a
140
+ redirect to a login page instead of getting a CORS error.</p>
141
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-ts">import {
142
+ ConfigService,
143
+ defaultConfigLoadErrorHandler,
144
+ } from &#39;&#64;rxap/config&#39;;
145
+
146
+ await ConfigService.Load({
147
+ url: &#39;/config.json&#39;,
148
+ requestInit: { redirect: &#39;manual&#39; },
149
+ errorHandler: (error) =&gt; {
150
+ if (error.kind === &#39;redirect&#39; || error.status === 401) {
151
+ location.href = &#39;/oauth2/sign_in&#39;;
152
+ // never resolve - the browser navigates away
153
+ return new Promise&lt;void&gt;(() =&gt; undefined);
154
+ }
155
+ // fall back to the default overlay + reload
156
+ return defaultConfigLoadErrorHandler(error);
157
+ },
158
+ });</code></pre></div><ul>
159
+ <li>The handler is called <strong>instead of</strong> the default overlay and reload - no DOM changes, no reload.</li>
160
+ <li>After the handler resolves a required url still throws and an optional url resolves with <code>null</code>.</li>
161
+ <li>The <code>onError</code> / <code>onRequestError</code> subjects and the <code>onErrorFnc</code> / <code>onRequestErrorFnc</code> hooks are
162
+ still called for required urls.</li>
163
+ <li>The handler and <code>requestInit</code> of the last <code>ConfigService.Load</code> call are also used by
164
+ <code>ConfigService.SideLoad</code>. Pass the fifth <code>options</code> argument of <code>SideLoad</code> to override them.</li>
165
+ <li>The handler only covers config url sources (<code>url</code> / <code>fromUrls</code> and <code>SideLoad</code>). The CID and DNS
166
+ sources (<code>fromCid</code>, <code>fromDns</code>) fetch through their own paths, only log failures and never show the
167
+ overlay.</li>
168
+ <li><code>StandaloneApplication</code> from <code>@rxap/ngx-bootstrap</code> forwards its <code>configLoadOptions</code> unchanged, so
169
+ the options can be passed as its fourth constructor argument.</li>
170
+ </ul>
171
+ <h1>Generators</h1>
104
172
  <h2>init</h2>
105
173
  <blockquote>
106
174
  <p>Initialize the package in the workspace</p>