@rxap/config 21.0.1-dev.0 → 21.0.1

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 (141) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/compodoc/changelog.html +43 -0
  3. package/compodoc/dependencies.html +2 -2
  4. package/compodoc/injectables/ConfigLoaderService.html +10 -77
  5. package/compodoc/injectables/ConfigService.html +38 -42
  6. package/compodoc/interfaces/ConfigLoadOptions.html +2 -6
  7. package/compodoc/js/search/search_index.js +2 -2
  8. package/compodoc/properties.html +1 -1
  9. package/docs/documentation.json +901 -947
  10. package/docs/html/assets/hierarchy.js +1 -1
  11. package/docs/html/assets/search.js +1 -1
  12. package/docs/html/classes/ConfigLoaderService.html +2 -2
  13. package/docs/html/classes/ConfigService.html +7 -7
  14. package/docs/html/classes/ConfigTestingService.html +2 -2
  15. package/docs/html/enums/ConfigLoadMethod.html +2 -2
  16. package/docs/html/enums/ConfigLoadingStrategy.html +2 -2
  17. package/docs/html/functions/ProvideConfig.html +1 -1
  18. package/docs/html/functions/defaultConfigLoadErrorHandler.html +2 -2
  19. package/docs/html/functions/dnsLookup.html +1 -1
  20. package/docs/html/functions/dnsResolver.html +1 -1
  21. package/docs/html/functions/fetchCidContent.html +1 -1
  22. package/docs/html/functions/fetchCidContentAsJson.html +1 -1
  23. package/docs/html/functions/fetchCidContentViaHttp.html +1 -1
  24. package/docs/html/functions/fetchContentViaHttp.html +1 -1
  25. package/docs/html/functions/localPathIpfsGateway.html +1 -1
  26. package/docs/html/functions/localSubDomainIpfsGateway.html +1 -1
  27. package/docs/html/functions/raceSuccess.html +2 -2
  28. package/docs/html/functions/showConfigLoadError.html +2 -2
  29. package/docs/html/functions/storachaIpfsGateway.html +1 -1
  30. package/docs/html/functions/w3sIpfsGateway.html +1 -1
  31. package/docs/html/hierarchy.html +1 -1
  32. package/docs/html/index.html +2 -2
  33. package/docs/html/interfaces/AppsNavigationConfig.html +2 -2
  34. package/docs/html/interfaces/Config.html +2 -2
  35. package/docs/html/interfaces/ConfigLoadError.html +4 -4
  36. package/docs/html/interfaces/ConfigLoadOptions.html +8 -8
  37. package/docs/html/interfaces/LogoConfig.html +2 -2
  38. package/docs/html/interfaces/NavigationConfig.html +2 -2
  39. package/docs/html/interfaces/Oauth2Config.html +2 -2
  40. package/docs/html/interfaces/i18nConfig.html +2 -2
  41. package/docs/html/modules.html +1 -1
  42. package/docs/html/types/AnySchema.html +1 -1
  43. package/docs/html/types/ConfigLoadErrorHandler.html +2 -2
  44. package/docs/html/types/ConfigLoadErrorKind.html +2 -2
  45. package/docs/html/types/ConfigRequestOptions.html +1 -1
  46. package/docs/html/types/IpfsGatewayFunction.html +1 -1
  47. package/docs/html/types/Join.html +1 -1
  48. package/docs/html/types/LanguagesConfig.html +1 -1
  49. package/docs/html/types/Leaves.html +1 -1
  50. package/docs/html/types/NoInferType.html +1 -1
  51. package/docs/html/types/Paths.html +1 -1
  52. package/docs/html/variables/RXAP_CONFIG.html +1 -1
  53. package/docs/html/variables/defaultDnsServers.html +1 -1
  54. package/docs/html/variables/defaultIpfsGatewayServers.html +1 -1
  55. package/docs/markdown/README.md +1 -1
  56. package/docs/markdown/classes/ConfigLoaderService.md +7 -15
  57. package/docs/markdown/classes/ConfigService.md +23 -23
  58. package/docs/markdown/classes/ConfigTestingService.md +8 -8
  59. package/docs/markdown/enumerations/ConfigLoadMethod.md +6 -6
  60. package/docs/markdown/enumerations/ConfigLoadingStrategy.md +4 -4
  61. package/docs/markdown/functions/ProvideConfig.md +2 -2
  62. package/docs/markdown/functions/defaultConfigLoadErrorHandler.md +2 -2
  63. package/docs/markdown/functions/dnsLookup.md +2 -2
  64. package/docs/markdown/functions/dnsResolver.md +2 -2
  65. package/docs/markdown/functions/fetchCidContent.md +2 -2
  66. package/docs/markdown/functions/fetchCidContentAsJson.md +2 -2
  67. package/docs/markdown/functions/fetchCidContentViaHttp.md +2 -2
  68. package/docs/markdown/functions/fetchContentViaHttp.md +2 -2
  69. package/docs/markdown/functions/localPathIpfsGateway.md +2 -2
  70. package/docs/markdown/functions/localSubDomainIpfsGateway.md +2 -2
  71. package/docs/markdown/functions/raceSuccess.md +2 -2
  72. package/docs/markdown/functions/showConfigLoadError.md +2 -2
  73. package/docs/markdown/functions/storachaIpfsGateway.md +2 -2
  74. package/docs/markdown/functions/w3sIpfsGateway.md +2 -2
  75. package/docs/markdown/globals.md +2 -2
  76. package/docs/markdown/interfaces/AppsNavigationConfig.md +12 -12
  77. package/docs/markdown/interfaces/Config.md +6 -6
  78. package/docs/markdown/interfaces/ConfigLoadError.md +9 -9
  79. package/docs/markdown/interfaces/ConfigLoadOptions.md +17 -17
  80. package/docs/markdown/interfaces/LogoConfig.md +5 -5
  81. package/docs/markdown/interfaces/NavigationConfig.md +9 -9
  82. package/docs/markdown/interfaces/Oauth2Config.md +3 -3
  83. package/docs/markdown/interfaces/i18nConfig.md +4 -4
  84. package/docs/markdown/type-aliases/AnySchema.md +2 -2
  85. package/docs/markdown/type-aliases/ConfigLoadErrorHandler.md +2 -2
  86. package/docs/markdown/type-aliases/ConfigLoadErrorKind.md +2 -2
  87. package/docs/markdown/type-aliases/ConfigRequestOptions.md +2 -2
  88. package/docs/markdown/type-aliases/IpfsGatewayFunction.md +2 -2
  89. package/docs/markdown/type-aliases/Join.md +2 -2
  90. package/docs/markdown/type-aliases/LanguagesConfig.md +2 -2
  91. package/docs/markdown/type-aliases/Leaves.md +2 -2
  92. package/docs/markdown/type-aliases/NoInferType.md +2 -2
  93. package/docs/markdown/type-aliases/Paths.md +2 -2
  94. package/docs/markdown/variables/RXAP_CONFIG.md +2 -2
  95. package/docs/markdown/variables/defaultDnsServers.md +2 -2
  96. package/docs/markdown/variables/defaultIpfsGatewayServers.md +2 -2
  97. package/docs/wiki/Class.ConfigLoaderService.md +6 -14
  98. package/docs/wiki/Class.ConfigService.md +22 -22
  99. package/docs/wiki/Class.ConfigTestingService.md +7 -7
  100. package/docs/wiki/Enumeration.ConfigLoadMethod.md +5 -5
  101. package/docs/wiki/Enumeration.ConfigLoadingStrategy.md +3 -3
  102. package/docs/wiki/Function.ProvideConfig.md +1 -1
  103. package/docs/wiki/Function.defaultConfigLoadErrorHandler.md +1 -1
  104. package/docs/wiki/Function.dnsLookup.md +1 -1
  105. package/docs/wiki/Function.dnsResolver.md +1 -1
  106. package/docs/wiki/Function.fetchCidContent.md +1 -1
  107. package/docs/wiki/Function.fetchCidContentAsJson.md +1 -1
  108. package/docs/wiki/Function.fetchCidContentViaHttp.md +1 -1
  109. package/docs/wiki/Function.fetchContentViaHttp.md +1 -1
  110. package/docs/wiki/Function.localPathIpfsGateway.md +1 -1
  111. package/docs/wiki/Function.localSubDomainIpfsGateway.md +1 -1
  112. package/docs/wiki/Function.raceSuccess.md +1 -1
  113. package/docs/wiki/Function.showConfigLoadError.md +1 -1
  114. package/docs/wiki/Function.storachaIpfsGateway.md +1 -1
  115. package/docs/wiki/Function.w3sIpfsGateway.md +1 -1
  116. package/docs/wiki/Interface.AppsNavigationConfig.md +11 -11
  117. package/docs/wiki/Interface.Config.md +5 -5
  118. package/docs/wiki/Interface.ConfigLoadError.md +8 -8
  119. package/docs/wiki/Interface.ConfigLoadOptions.md +16 -16
  120. package/docs/wiki/Interface.LogoConfig.md +4 -4
  121. package/docs/wiki/Interface.NavigationConfig.md +8 -8
  122. package/docs/wiki/Interface.Oauth2Config.md +2 -2
  123. package/docs/wiki/Interface.i18nConfig.md +3 -3
  124. package/docs/wiki/TypeAlias.AnySchema.md +1 -1
  125. package/docs/wiki/TypeAlias.ConfigLoadErrorHandler.md +1 -1
  126. package/docs/wiki/TypeAlias.ConfigLoadErrorKind.md +1 -1
  127. package/docs/wiki/TypeAlias.ConfigRequestOptions.md +1 -1
  128. package/docs/wiki/TypeAlias.IpfsGatewayFunction.md +1 -1
  129. package/docs/wiki/TypeAlias.Join.md +1 -1
  130. package/docs/wiki/TypeAlias.LanguagesConfig.md +1 -1
  131. package/docs/wiki/TypeAlias.Leaves.md +1 -1
  132. package/docs/wiki/TypeAlias.NoInferType.md +1 -1
  133. package/docs/wiki/TypeAlias.Paths.md +1 -1
  134. package/docs/wiki/Variable.RXAP_CONFIG.md +1 -1
  135. package/docs/wiki/Variable.defaultDnsServers.md +1 -1
  136. package/docs/wiki/Variable.defaultIpfsGatewayServers.md +1 -1
  137. package/docs/wiki/globals.md +1 -1
  138. package/fesm2022/rxap-config.mjs +11 -14
  139. package/fesm2022/rxap-config.mjs.map +1 -1
  140. package/package.json +5 -5
  141. package/types/rxap-config.d.ts +0 -1
@@ -1,9 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';
2
+ import { inject, Injectable, InjectionToken, Optional, Inject } from '@angular/core';
3
3
  import { firstValueFrom, Observable, catchError, EMPTY, race, ReplaySubject } from 'rxjs';
4
- import * as i1 from '@angular/common/http';
5
4
  import { HttpClient } from '@angular/common/http';
6
- import { finalize, share } from 'rxjs/operators';
5
+ import { tap, finalize, share } from 'rxjs/operators';
7
6
  import { SetToObject, getFromObject, JoinPath, deepMerge, coerceArray, CoercePrefix, SetObjectValue } from '@rxap/utilities';
8
7
  import { log } from '@rxap/rxjs';
9
8
 
@@ -51,8 +50,8 @@ function showConfigLoadError(message) {
51
50
  }
52
51
 
53
52
  class ConfigLoaderService {
54
- constructor(http) {
55
- this.http = http;
53
+ constructor() {
54
+ this.http = inject(HttpClient);
56
55
  this.configs = new Map();
57
56
  this.configLoading = new Map();
58
57
  }
@@ -61,22 +60,19 @@ class ConfigLoaderService {
61
60
  return this.configs.get(url);
62
61
  }
63
62
  if (this.configLoading.has(url)) {
64
- return this.configLoading.get(url).toPromise();
63
+ return firstValueFrom(this.configLoading.get(url));
65
64
  }
66
- const loading$ = this.http.get(url).pipe(finalize(() => this.configLoading.delete(url)), share());
65
+ const loading$ = this.http.get(url).pipe(tap(config => this.configs.set(url, config)), finalize(() => this.configLoading.delete(url)), share());
67
66
  this.configLoading.set(url, loading$);
68
67
  return firstValueFrom(loading$);
69
68
  }
70
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfigLoaderService, deps: [{ token: HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
69
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfigLoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
71
70
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfigLoaderService, providedIn: 'root' }); }
72
71
  }
73
72
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfigLoaderService, decorators: [{
74
73
  type: Injectable,
75
74
  args: [{ providedIn: 'root' }]
76
- }], ctorParameters: () => [{ type: i1.HttpClient, decorators: [{
77
- type: Inject,
78
- args: [HttpClient]
79
- }] }] });
75
+ }] });
80
76
 
81
77
  class ConfigTestingService {
82
78
  constructor() {
@@ -177,7 +173,7 @@ async function dnsLookup(name, type, dnsServers = defaultDnsServers) {
177
173
  function fetchContentViaHttp(url) {
178
174
  return new Observable((subscriber) => {
179
175
  let controller = new AbortController(); // For cancellation
180
- fetch(url)
176
+ fetch(url, { signal: controller.signal })
181
177
  .then(response => {
182
178
  if (!response.ok) {
183
179
  // Don't complete here, let catchError handle it
@@ -194,6 +190,7 @@ function fetchContentViaHttp(url) {
194
190
  .catch(error => {
195
191
  if (error.name !== 'AbortError' && !subscriber.closed) {
196
192
  console.warn(`Fetch error for ${url}:`, error);
193
+ subscriber.error(error);
197
194
  }
198
195
  });
199
196
  // Cleanup function for when the observable is unsubscribed
@@ -649,7 +646,7 @@ class ConfigService {
649
646
  const queryString = window.location.search;
650
647
  const urlParams = new URLSearchParams(queryString);
651
648
  const configFromParams = {};
652
- for (const configParam of urlParams.getAll('config')) {
649
+ for (const configParam of urlParams.getAll(param)) {
653
650
  try {
654
651
  const split = configParam.split(';');
655
652
  if (split.length === 2) {
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-config.mjs","sources":["../../../../../packages/angular/config/src/lib/config-load-error.ts","../../../../../packages/angular/config/src/lib/config-loader.service.ts","../../../../../packages/angular/config/src/lib/config-testing-service.ts","../../../../../packages/angular/config/src/lib/tokens.ts","../../../../../packages/angular/config/src/lib/utilities.ts","../../../../../packages/angular/config/src/lib/config.service.ts","../../../../../packages/angular/config/src/lib/provide-config.ts","../../../../../packages/angular/config/src/index.ts","../../../../../packages/angular/config/src/rxap-config.ts"],"sourcesContent":["/**\n * The kind of failure that happened while loading a config url.\n *\n * - `network`: `fetch()` rejected (offline, DNS, CORS without a redirect)\n * - `redirect`: the response is an `opaqueredirect` (only with `requestInit.redirect === 'manual'`)\n * - `http`: the response is not ok - `status` and `response` are available\n * - `parse`: the response body is not valid JSON\n * - `schema`: the schema validation failed\n */\nexport type ConfigLoadErrorKind =\n | 'network'\n | 'redirect'\n | 'http'\n | 'parse'\n | 'schema';\n\nexport interface ConfigLoadError {\n kind: ConfigLoadErrorKind;\n url: string;\n /**\n * true if the config url is required. A required url throws after the error handler is called,\n * an optional url resolves with `null`.\n */\n required: boolean;\n status?: number;\n response?: Response;\n cause?: unknown;\n /**\n * The message the default handler would show.\n */\n message: string;\n}\n\n/**\n * Called for every failed config url request. May never resolve, e.g. if it navigates away.\n */\nexport type ConfigLoadErrorHandler = (error: ConfigLoadError) => void | Promise<void>;\n\n/**\n * The default config load error handler. Shows the error message in an overlay and reloads the\n * page after 30 s for required config urls. Logs a warning for optional config urls.\n *\n * Can be used as fallback in a custom error handler for error kinds it does not handle.\n */\nexport function defaultConfigLoadErrorHandler(error: ConfigLoadError): void {\n if (error.required) {\n showConfigLoadError(error.message);\n } else {\n console.warn(error.message);\n }\n}\n\n/**\n * Appends the message to the config error overlay and schedules a page reload in 30 s.\n */\nexport function showConfigLoadError(message: string) {\n const hasUl = document.getElementById('rxap-config-error') !== null;\n const ul = document.getElementById('rxap-config-error') ?? document.createElement('ul');\n ul.id = 'rxap-config-error';\n ul.style.position = 'fixed';\n ul.style.bottom = '16px';\n ul.style.right = '16px';\n ul.style.backgroundColor = 'white';\n ul.style.padding = '32px';\n ul.style.zIndex = '99999999';\n ul.style.color = 'black';\n const messageLi = document.createElement('li');\n messageLi.innerText = message;\n ul.appendChild(messageLi);\n const refreshHintLi = document.createElement('li');\n refreshHintLi.innerText = 'Please refresh the page to try again.';\n ul.appendChild(refreshHintLi);\n const autoRefreshHintLi = document.createElement('li');\n autoRefreshHintLi.innerText = 'The page will refresh automatically in 30 seconds.';\n ul.appendChild(autoRefreshHintLi);\n if (!hasUl) {\n document.body.appendChild(ul);\n }\n setTimeout(() => location.reload(), 30000);\n}\n","import {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n firstValueFrom,\n Observable,\n} from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\nimport {\n finalize,\n share,\n} from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigLoaderService {\n public readonly configs = new Map<string, any>();\n\n public readonly configLoading = new Map<string, Observable<any>>();\n\n constructor(\n @Inject(HttpClient)\n public readonly http: HttpClient,\n ) {\n }\n\n public async load$<T = any>(url: string): Promise<T> {\n if (this.configs.has(url)) {\n return this.configs.get(url);\n }\n\n if (this.configLoading.has(url)) {\n return this.configLoading.get(url)!.toPromise();\n }\n\n const loading$ = this.http.get<T>(url).pipe(\n finalize(() => this.configLoading.delete(url)),\n share(),\n );\n\n this.configLoading.set(url, loading$);\n\n return firstValueFrom(loading$);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n getFromObject,\n SetToObject,\n} from '@rxap/utilities';\nimport { ConfigService } from './config.service';\n\n@Injectable()\nexport class ConfigTestingService implements ConfigService {\n readonly config: Record<string, any> = {};\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n clearLocalConfig(): void {\n }\n\n set<T>(propertyPath: string, value: T): void {\n SetToObject(this.config, propertyPath, value);\n }\n\n get<T>(propertyPath: string, defaultValue?: T): T | undefined {\n return getFromObject<T, T>(this.config, propertyPath, defaultValue);\n }\n\n getOrThrow<T>(propertyPath: string): T {\n const value = this.get<T>(propertyPath);\n if (value === undefined) {\n throw new Error(`Could not find config in path '${ propertyPath }'`);\n }\n return value;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setLocalConfig(config: Record<string, any>): void {\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_CONFIG = new InjectionToken('rxap/config');\n","// TODO : move to separate package\n\nimport { log } from '@rxap/rxjs';\nimport { JoinPath } from '@rxap/utilities';\nimport {\n catchError,\n EMPTY,\n firstValueFrom,\n Observable,\n race,\n} from 'rxjs';\n\n/**\n * Similar to Promise.race() but only resolves with the first successful promise.\n * It will only reject if all promises reject.\n */\nexport async function raceSuccess<T>(promises: Promise<T>[]): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n let rejectionCount = 0;\n\n promises.forEach((promise) => {\n promise.then(\n // On success, resolve the entire raceSuccess promise\n (value) => resolve(value),\n // On rejection, count it and check if all promises rejected\n () => {\n rejectionCount++;\n if (rejectionCount === promises.length) {\n reject(new Error('All promises were rejected'));\n }\n // Otherwise continue waiting for other promises\n }\n );\n });\n });\n}\n\n\nexport async function dnsResolver(endpoint: string, name: string, type: string): Promise<string> {\n const response = await fetch(`${endpoint}?name=${name}&type=${type}`, {\n method: 'GET',\n headers: {\n 'Accept': 'application/dns-json',\n 'Cache-Control': 'no-cache, no-store, must-revalidate',\n 'Pragma': 'no-cache',\n 'Expires': '0',\n },\n });\n if (!response.ok) {\n throw new Error(`Failed to resolve DNS via ${endpoint} (${response.status}): ${response.statusText}`);\n }\n const result = await response.json();\n // Basic validation of the response structure\n if (!result || !Array.isArray(result.Answer) || result.Answer.length === 0 || !result.Answer[0].data) {\n throw new Error(`Invalid DNS response structure from ${endpoint} for ${name} ${type}`);\n }\n const data = result.Answer[0].data;\n // Remove surrounding quotes often found in TXT records\n return data.replace(/^\"(.*)\"$/, '$1');\n}\n\nexport const defaultDnsServers = [\n 'https://dns.google/resolve',\n 'https://cloudflare-dns.com/dns-query'\n];\n\nexport async function dnsLookup(\n name: string,\n type: string,\n dnsServers = defaultDnsServers\n): Promise<string> {\n if (!dnsServers.length) {\n throw new Error('No DNS servers provided for lookup');\n }\n type = type.toUpperCase();\n console.log(`Performing DNS lookup for ${type} record of ${name} using servers: ${dnsServers.join(', ')}`);\n try {\n // Use Promise.race to get the first successful response\n return await raceSuccess(dnsServers.map(server => dnsResolver(server, name, type)));\n } catch (error: any) {\n console.error(`Failed to resolve DNS TXT record for ${name} using any server: ${error.message}`);\n throw new Error(`DNS lookup failed for ${name} (${type})`); // Re-throw a more specific error\n }\n}\n\nexport function fetchContentViaHttp(url: string): Observable<Blob | null> {\n return new Observable<Blob>((subscriber) => {\n let controller: AbortController | null = new AbortController(); // For cancellation\n\n fetch(url)\n .then(response => {\n if (!response.ok) {\n // Don't complete here, let catchError handle it\n throw new Error(`HTTP error ${response.status} for ${url}: ${response.statusText}`);\n }\n return response.blob();\n })\n .then(blob => {\n if (!subscriber.closed) {\n subscriber.next(blob);\n subscriber.complete();\n }\n })\n .catch(error => {\n if (error.name !== 'AbortError' && !subscriber.closed) {\n console.warn(`Fetch error for ${url}:`, error);\n }\n });\n\n // Cleanup function for when the observable is unsubscribed\n return () => {\n controller?.abort();\n controller = null; // Release reference\n };\n\n }).pipe(\n catchError(error => {\n // Log the error but return null to signal failure without stopping the race\n console.error(`Fetch failed for ${url}: ${error.message}`);\n return EMPTY; // Signal failure with null\n }),\n );\n}\n\nexport type IpfsGatewayFunction = (cid: string) => string;\n\nexport const w3sIpfsGateway: IpfsGatewayFunction = cid => `https://${ cid }.ipfs.w3s.link`;\nexport const storachaIpfsGateway: IpfsGatewayFunction = cid => `https://${ cid }.ipfs.storacha.link`;\nexport const localPathIpfsGateway: IpfsGatewayFunction = cid => `${location.origin}/ipfs/${ cid }`;\nexport const localSubDomainIpfsGateway: IpfsGatewayFunction = cid => `https://${cid}.ipfs.${location.hostname.split('.').slice(-2).join('.')}`;\n\nexport const defaultIpfsGatewayServers: Array<IpfsGatewayFunction> = [\n w3sIpfsGateway,\n storachaIpfsGateway,\n localPathIpfsGateway,\n localSubDomainIpfsGateway\n];\n\nexport function fetchCidContentViaHttp(cid: string, path?: string, ipfsGatewayServers: Array<IpfsGatewayFunction> = defaultIpfsGatewayServers): Observable<Blob | null> {\n if (!ipfsGatewayServers.length) {\n throw new Error('No IPFS gateway servers provided for fetching content');\n }\n return race(\n ...ipfsGatewayServers.map(fnc => fetchContentViaHttp(JoinPath(fnc(cid), path)).pipe(\n log(`fetch attempt for ${cid} via ${fnc.name} - ${fnc(cid)}`),\n ))\n // Add more sources here if needed\n ).pipe(\n log(`Race winner for ${cid}`), // Log which source won (will show Blob or null)\n );\n}\n\nexport async function fetchCidContent(cid: string, path?: string, ipfsGatewayServers: Array<IpfsGatewayFunction> = defaultIpfsGatewayServers): Promise<Blob | null> {\n console.log(`Fetching content for CID: ${cid}`);\n // Example: Fetch from an IPFS gateway or other source\n // const gatewayUrl = `https://ipfs.io/ipfs/${cid}`;\n try {\n return await firstValueFrom(\n race(\n fetchCidContentViaHttp(cid, path, ipfsGatewayServers)\n ),\n { defaultValue: null } // Return null if the stream completes empty\n );\n } catch (error) {\n console.error(`Error fetching or parsing content for CID ${cid}:`, error);\n return null; // Return null on error\n }\n}\n\nexport async function fetchCidContentAsJson(\n cid: string,\n path?: string,\n _fetchCidContent = fetchCidContent,\n ipfsGatewayServers: Array<IpfsGatewayFunction> = defaultIpfsGatewayServers\n): Promise<any | null> {\n console.log(`Fetching JSON content for CID: ${cid}`);\n const blob = await _fetchCidContent(cid, path, ipfsGatewayServers);\n if (blob) {\n try {\n const text = await blob.text();\n return JSON.parse(text);\n } catch (error) {\n console.error(`Error parsing JSON content for CID ${cid}:`, error);\n return null; // Return null on error\n }\n }\n console.warn(`No blob available for CID ${cid}, cannot parse as JSON.`);\n return null; // Return null if blob is not available\n}\n","import {\n Inject,\n Injectable,\n Optional,\n} from '@angular/core';\nimport { Environment } from '@rxap/environment';\nimport {\n coerceArray,\n CoercePrefix,\n deepMerge,\n SetObjectValue,\n SetToObject,\n} from '@rxap/utilities';\nimport { ReplaySubject } from 'rxjs';\nimport {\n ConfigLoadError,\n ConfigLoadErrorHandler,\n defaultConfigLoadErrorHandler,\n} from './config-load-error';\nimport { RXAP_CONFIG } from './tokens';\nimport { NoInferType } from './types';\nimport {\n dnsLookup,\n fetchCidContentAsJson,\n} from './utilities';\n\nexport type AnySchema = { validateAsync: (...args: any[]) => any };\n\nexport enum ConfigLoadingStrategy {\n DEFAULT = 'default',\n FIFO = 'fifo',\n}\n\nexport enum ConfigLoadMethod {\n FROM_URLS = 'fromUrls',\n FROM_LOCAL_STORAGE = 'fromLocalStorage',\n FROM_URL_PARAM = 'fromUrlParam',\n FROM_CID = 'fromCid',\n}\n\nexport interface ConfigLoadOptions {\n fromUrlParam?: string | boolean;\n fromUrls?: boolean;\n fromLocalStorage?: boolean;\n schema?: AnySchema;\n url?: string | string[] | ((environment: Environment) => string | string[]);\n /**\n * static config values\n */\n static?: Record<string, any>;\n /**\n * Load additional configuration based on a CID found in a DNS TXT record.\n * If true, uses `location.hostname`. If a string, uses that domain.\n */\n fromDns?: string | boolean;\n /**\n * Load additional configuration directly from the given Content Identifier (CID).\n * This takes precedence over `fromDns` if both are provided.\n */\n fromCid?: string;\n fetchCidContent?: (cid: string, path?: string) => Promise<Blob | null>;\n ipfsGatewayServers?: Array<(cid: string) => string>;\n dnsServers?: string[];\n strategy?: ConfigLoadingStrategy;\n /**\n * Defines the order and subset of config sources to load.\n * If not specified, defaults to: [FROM_URLS, FROM_LOCAL_STORAGE, FROM_URL_PARAM, FROM_CID]\n *\n * Note: static config is always merged first, and Overwrites are always merged last.\n * Note: fromDns is not a source itself - it resolves the CID for FROM_CID.\n */\n order?: ConfigLoadMethod[];\n /**\n * Replaces the default error handling (error overlay + page reload after 30 s) for failed\n * config url requests. Used for the `url` / `fromUrls` source and for `SideLoad`.\n *\n * Afterwards a required url still throws and an optional url resolves with `null`. The\n * `onError` / `onRequestError` hooks are still called.\n */\n errorHandler?: ConfigLoadErrorHandler;\n /**\n * Passed to `fetch()` for config url requests, e.g. `{ redirect: 'manual' }`.\n */\n requestInit?: RequestInit;\n}\n\nexport type ConfigRequestOptions = Pick<ConfigLoadOptions, 'errorHandler' | 'requestInit'>;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ConfigService<Config extends Record<string, any> = Record<string, any>> {\n\n public static onError = new ReplaySubject<unknown>(1);\n public static onRequestError = new ReplaySubject<Response>(1);\n\n public static onErrorFnc: Array<(error: any) => void> = [];\n public static onRequestErrorFnc: Array<(response: Response) => void> = [];\n\n public static Config: any = null;\n\n /**\n * Static default values for the config object.\n * Will be overwritten by an dynamic config file specified in\n * the Urls array.\n */\n public static Defaults: any = {};\n\n /**\n * Any value definition in the Overwrites object will overwrite any\n * value form the Defaults values or dynamic config files\n */\n public static Overwrites: any = {};\n\n public static LocalStorageKey = 'rxap/config/local-config';\n\n /**\n * The errorHandler and requestInit of the last Load call. Used by SideLoad.\n */\n public static RequestOptions: ConfigRequestOptions = {};\n\n /**\n * @deprecated instead use the url property of the ConfigLoadOptions\n */\n public static Urls = [];\n public readonly config!: Config;\n\n constructor(@Optional() @Inject(RXAP_CONFIG) config: any | null = null) {\n this.config = ConfigService.Config;\n if (config) {\n this.config = deepMerge(this.config ?? {}, config);\n }\n if (!this.config) {\n throw new Error('config not available');\n }\n }\n\n /**\n * Used to load the app config from a remote resource.\n *\n * Promise.all([ ConfigService.Load() ])\n * .then(() => platformBrowserDynamic().bootstrapModule(AppModule))\n * .catch(err => console.error(err))\n *\n */\n public static async Load(options?: ConfigLoadOptions, environment?: Environment): Promise<void> {\n options ??= {};\n\n this.RequestOptions = {\n errorHandler: options.errorHandler,\n requestInit: options.requestInit,\n };\n\n let config: any = deepMerge(this.Defaults, {});\n\n if (environment?.config) {\n if (typeof environment.config === 'string') {\n options.url = environment.config;\n } else {\n options.static = environment.config.static;\n options.url = environment.config.url;\n options.fromUrlParam = environment.config.fromUrlParam;\n options.fromLocalStorage = environment.config.fromLocalStorage;\n options.schema = environment.config.schema;\n options.strategy = environment.config.strategy as ConfigLoadingStrategy ?? options.strategy;\n }\n }\n\n // Always merge static config first\n config = deepMerge(config, options?.static ?? {});\n\n // Determine the order of config sources to load\n const order = options.order ?? [\n ConfigLoadMethod.FROM_URLS,\n ConfigLoadMethod.FROM_LOCAL_STORAGE,\n ConfigLoadMethod.FROM_URL_PARAM,\n ConfigLoadMethod.FROM_CID,\n ];\n\n // If fromDns is enabled and FROM_CID is in the order, resolve CID first\n if (options.fromDns && order.includes(ConfigLoadMethod.FROM_CID) && !options.fromCid) {\n await this.loadConfigFromDns(options as any);\n }\n\n // Load configs from sources in the specified order\n let done = false;\n for (const method of order) {\n if (done) {\n break;\n }\n\n // Check if the source is enabled\n if (!this.isSourceEnabled(options, method)) {\n continue;\n }\n\n try {\n const loadedConfig = await this.loadConfigFromMethod(method, options, environment);\n if (loadedConfig) {\n config = deepMerge(config, loadedConfig);\n }\n\n // If using FIFO strategy, stop after first successful load\n if (options.strategy === ConfigLoadingStrategy.FIFO) {\n done = true;\n }\n } catch (error: any) {\n const methodName = this.getMethodName(method);\n if (options.strategy !== ConfigLoadingStrategy.FIFO) {\n console.error(`Could not load config from ${methodName}`, error);\n throw error;\n } else {\n console.warn(`Could not load config from ${methodName}: ${error.message}. Will try next strategy.`);\n }\n }\n }\n\n if (!done && order.length > 0) {\n console.warn('No config loading strategy succeeded. Using default config.');\n }\n\n // Always merge overwrites last\n config = deepMerge(config, this.Overwrites);\n\n console.debug('app config', config);\n\n this.Config = config;\n }\n\n private static isSourceEnabled(options: ConfigLoadOptions, method: ConfigLoadMethod): boolean {\n switch (method) {\n case ConfigLoadMethod.FROM_URLS:\n return options.fromUrls !== false;\n case ConfigLoadMethod.FROM_LOCAL_STORAGE:\n return options.fromLocalStorage !== false;\n case ConfigLoadMethod.FROM_URL_PARAM:\n return !!options.fromUrlParam;\n case ConfigLoadMethod.FROM_CID:\n return !!options.fromCid;\n default:\n return false;\n }\n }\n\n private static async loadConfigFromMethod(\n method: ConfigLoadMethod,\n options: ConfigLoadOptions,\n environment?: Environment,\n ): Promise<any> {\n switch (method) {\n case ConfigLoadMethod.FROM_URLS:\n return await this.loadConfigFromUrls(options, environment);\n case ConfigLoadMethod.FROM_LOCAL_STORAGE:\n return this.loadConfigFromLocalStorage(options);\n case ConfigLoadMethod.FROM_URL_PARAM:\n return this.loadConfigFromUrlParam(options as any);\n case ConfigLoadMethod.FROM_CID:\n return await this.loadConfigFromCid(options as any);\n default:\n return null;\n }\n }\n\n private static getMethodName(method: ConfigLoadMethod): string {\n switch (method) {\n case ConfigLoadMethod.FROM_URLS:\n return 'urls';\n case ConfigLoadMethod.FROM_LOCAL_STORAGE:\n return 'local storage';\n case ConfigLoadMethod.FROM_URL_PARAM:\n return 'url param';\n case ConfigLoadMethod.FROM_CID:\n return 'cid';\n default:\n return 'unknown';\n }\n }\n\n private static loadConfigFromUrlParam(options: ConfigLoadOptions & { fromUrlParam: string | true }) {\n const param = typeof options.fromUrlParam === 'string' ? options.fromUrlParam : 'config';\n return this.LoadConfigDefaultFromUrlParam(param);\n }\n\n private static loadConfigFromLocalStorage(options: ConfigLoadOptions) {\n const localConfig = localStorage.getItem(ConfigService.LocalStorageKey);\n if (localConfig) {\n return JSON.parse(localConfig);\n } else {\n return {};\n }\n }\n\n private static async loadConfigFromUrls(options: ConfigLoadOptions, environment?: Environment) {\n let config: any = {};\n const urls = (\n options?.url ? coerceArray(options.url) : ConfigService.Urls\n ).map(url => {\n if (typeof url === 'function') {\n if (!environment) {\n throw new Error('environment is required when url is a function');\n }\n return coerceArray(url(environment));\n }\n return coerceArray(url);\n }).flat();\n\n for (const url of urls) {\n const loadedConfig = await this.loadConfig(url, true, options?.schema, options);\n const match = url.match(/config\\.([a-zA-Z0-9.\\-_]+)\\.json/);\n if (match) {\n SetToObject(config, match[1], loadedConfig);\n } else {\n config = deepMerge(config, loadedConfig);\n }\n }\n return config;\n }\n\n private static async loadConfigFromCid(options: ConfigLoadOptions & { fromCid: string | boolean }) {\n console.debug('Loading config from CID: ', options.fromCid);\n const ipfsGatewayFunctions = options.ipfsGatewayServers ?? [];\n if (!ipfsGatewayFunctions.length) {\n console.warn('No IPFS gateway servers provided for fetching content from CID');\n return;\n }\n try {\n const cidContent = await fetchCidContentAsJson(\n options.fromCid,\n undefined,\n options.fetchCidContent,\n ipfsGatewayFunctions\n );\n if (cidContent && typeof cidContent === 'object') {\n console.log(`Merging configuration from CID ${options.fromCid}.`, cidContent);\n // Merge CID content into the existing config object\n console.log('Configuration merged successfully.');\n return cidContent;\n } else if (cidContent) {\n console.warn(`Content fetched from CID ${options.fromCid} is not a mergeable object, skipping merge.`);\n } else {\n console.warn(`No content fetched or content was null for CID ${options.fromCid}.`);\n }\n } catch (error: any) {\n console.error(`Failed to fetch or process content for CID ${options.fromCid}: ${error.message}`);\n // Decide how to handle fetch/processing errors\n }\n }\n\n private static async loadConfigFromDns(options: ConfigLoadOptions & { fromDns: string | boolean }) {\n console.debug('Loading config from DNS');\n const dnsServers = options.dnsServers ?? [];\n if (!dnsServers.length) {\n console.warn('No DNS servers provided for DNS lookup');\n return;\n }\n let domain = location.hostname;\n if (typeof options.fromDns === 'string') {\n domain = options.fromDns;\n }\n domain = CoercePrefix(domain, '_config.');\n try {\n console.log(`Attempting DNS lookup for domain: ${domain}`);\n const txtData = await dnsLookup(domain, 'TXT', dnsServers);\n console.log(`DNS TXT record data found: ${txtData}`);\n // Example CID extraction logic (adapt to your TXT record format)\n // This looks for IPFS CIDs (v0 'Qm...' or v1 'b...') potentially after 'ipfs://' or '/'\n const cidMatch = txtData.match(/(?:ipfs:\\/\\/|\\/|^)([a-zA-Z0-9]{40,})$/);\n if (cidMatch && cidMatch[1]) {\n options.fromCid = cidMatch[1];\n console.log(`Extracted CID from DNS: ${options.fromCid}`);\n } else {\n console.warn(`Could not extract a valid CID format from DNS TXT data: \"${txtData}\"`);\n }\n } catch (error: any) {\n console.error(`DNS lookup for ${domain} failed: ${error.message}`);\n // Decide if failure is critical or recoverable\n }\n }\n\n private static handleError(error: any) {\n this.onError.next(error);\n for (const fnc of this.onErrorFnc) {\n try {\n fnc(error);\n } catch (e: any) {\n console.error('Error in onErrorFnc', e);\n }\n }\n }\n\n private static handleRequestError(response: Response) {\n this.onRequestError.next(response);\n for (const fnc of this.onRequestErrorFnc) {\n try {\n fnc(response);\n } catch (e: any) {\n console.error('Error in onRequestErrorFnc', e);\n }\n }\n }\n\n private static async loadConfig<T = any>(\n url: string,\n required = false,\n schema?: AnySchema,\n options: ConfigRequestOptions = this.RequestOptions,\n ): Promise<T | null> {\n\n let config: any;\n let response: Response;\n\n try {\n response = await fetch(url, options.requestInit);\n } catch (error: any) {\n return this.handleLoadError({\n kind: 'network',\n url,\n required,\n cause: error,\n message: `Could not fetch config from '${ url }': ${ error.message }`,\n }, options);\n }\n\n if (response.type === 'opaqueredirect') {\n return this.handleLoadError({\n kind: 'redirect',\n url,\n required,\n status: response.status,\n response,\n message: `Config request for '${ url }' was redirected`,\n }, options);\n }\n\n if (!response.ok) {\n let message = `Config request results in non ok response for '${ url }': (${ response.status }) ${ response.statusText }`;\n switch (response.status) {\n case 404:\n message = `Config not found at '${ url }'`;\n break;\n case 405:\n message = `Config service is not started yet. Wait 30s and try again.`;\n break;\n case 401:\n message = `Unauthorized to fetch config from '${ url }'`;\n break;\n }\n return this.handleLoadError({\n kind: 'http',\n url,\n required,\n status: response.status,\n response,\n message,\n }, options);\n }\n\n try {\n config = await response.json();\n } catch (error: any) {\n return this.handleLoadError({\n kind: 'parse',\n url,\n required,\n status: response.status,\n response,\n cause: error,\n message: `Could not parse config from '${ url }' to a json object: ${ error.message }`,\n }, options);\n }\n\n if (schema) {\n try {\n config = await schema.validateAsync(config);\n } catch (error: any) {\n return this.handleLoadError({\n kind: 'schema',\n url,\n required,\n status: response.status,\n response,\n cause: error,\n message: `Config from '${ url }' is not valid: ${ error.message }`,\n }, options);\n }\n }\n\n return config;\n\n }\n\n /**\n * Notifies the onError/onRequestError hooks (required urls only), calls the error handler and\n * throws for required urls. Resolves with null for optional urls.\n */\n private static async handleLoadError(error: ConfigLoadError, options: ConfigRequestOptions): Promise<null> {\n if (error.required) {\n if (error.response && (error.kind === 'http' || error.kind === 'redirect')) {\n this.handleRequestError(error.response);\n } else {\n this.handleError(error.cause);\n }\n }\n const errorHandler = options.errorHandler ?? defaultConfigLoadErrorHandler;\n try {\n await errorHandler(error);\n } catch (e: any) {\n console.error('Error in config load error handler', e);\n }\n if (error.required) {\n throw new Error(error.message);\n }\n return null;\n }\n\n private static LoadConfigDefaultFromUrlParam(param = 'config') {\n\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n\n const configFromParams = {};\n\n for (const configParam of urlParams.getAll('config')) {\n\n try {\n const split = configParam.split(';');\n if (split.length === 2) {\n const keyPath = split[0];\n const value = split[1];\n SetObjectValue(configFromParams, keyPath, value);\n }\n } catch (e: any) {\n console.warn(`Parsing of url config param failed for '${ configParam }': ${ e.message }`);\n }\n\n }\n\n return configFromParams;\n\n }\n\n public static async SideLoad(\n url: string,\n propertyPath: string,\n required?: boolean,\n schema?: AnySchema,\n options: ConfigRequestOptions = this.RequestOptions,\n ): Promise<void> {\n\n if (!this.Config) {\n throw new Error('Config side load is only possible after the initial config load.');\n }\n\n const config = await this.loadConfig(url, required, schema, options);\n\n SetObjectValue(this.Config, propertyPath, config);\n\n console.debug(`Side loaded config for '${ propertyPath }' successful`, this.Config);\n\n }\n\n public static Get<T = any, K extends Record<string, any> = Record<string, any>>(\n path: string,\n defaultValue: T | undefined,\n config: Record<string, any>,\n ): T\n\n public static Get<T = any, K extends Record<string, any> = Record<string, any>>(\n path: string,\n defaultValue: NoInferType<T>,\n config: Record<string, any> = this.Config,\n ): T {\n if (!config) {\n throw new Error('config not loaded');\n }\n let configValue: any = config;\n if (typeof path !== 'string') {\n throw new Error('The config property path is not a string');\n }\n for (const fragment of path.split('.')) {\n if (configValue && typeof configValue === 'object' && fragment in configValue) {\n configValue = configValue[fragment];\n } else {\n if (defaultValue !== undefined) {\n return defaultValue;\n }\n console.debug(`Config with path '${ path }' not found`);\n return undefined as any;\n }\n }\n return configValue;\n }\n\n public setLocalConfig(config: Config): void {\n localStorage.setItem(ConfigService.LocalStorageKey, JSON.stringify(config));\n }\n\n public clearLocalConfig(): void {\n localStorage.removeItem(ConfigService.LocalStorageKey);\n }\n\n public get<T = any>(propertyPath: string): T | undefined;\n public get<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;\n public get<T = any>(propertyPath: string, defaultValue?: T): T | undefined {\n return ConfigService.Get(propertyPath, defaultValue, this.config);\n }\n\n public getOrThrow<T = any>(propertyPath: string): T;\n public getOrThrow<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;\n public getOrThrow<T = any>(propertyPath: string, defaultValue?: T): T {\n const value = ConfigService.Get(propertyPath, defaultValue, this.config);\n if (value === undefined) {\n throw new Error(`Could not find config in path '${ propertyPath }'`);\n }\n return value;\n }\n\n}\n","import { RXAP_CONFIG } from './tokens';\n\nexport function ProvideConfig(config: Record<string, unknown> = {}) {\n return {\n provide: RXAP_CONFIG,\n useValue: config,\n };\n}\n","// region \nexport * from './lib/config-load-error';\nexport * from './lib/config-loader.service';\nexport * from './lib/config-testing-service';\nexport * from './lib/config.service';\nexport * from './lib/config';\nexport * from './lib/provide-config';\nexport * from './lib/tokens';\nexport * from './lib/types';\nexport * from './lib/utilities';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAsCA;;;;;AAKG;AACG,SAAU,6BAA6B,CAAC,KAAsB,EAAA;AAClE,IAAA,IAAI,KAAK,CAAC,QAAQ,EAAE;AAClB,QAAA,mBAAmB,CAAC,K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qCc;;0BAAY,MAAM;2BAAC,WAAW;;;AC7HvC,SAAU,aAAa,CAAC,MAAA,GAAkC,EAAE,EAAA;IAChE,OAAO;AACL,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,QAAQ,EAAE,MAAM;KACjB;AACH;;ACPA;AAUA;;ACVA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxap-config.mjs","sources":["../../../../../packages/angular/config/src/lib/config-load-error.ts","../../../../../packages/angular/config/src/lib/config-loader.service.ts","../../../../../packages/angular/config/src/lib/config-testing-service.ts","../../../../../packages/angular/config/src/lib/tokens.ts","../../../../../packages/angular/config/src/lib/utilities.ts","../../../../../packages/angular/config/src/lib/config.service.ts","../../../../../packages/angular/config/src/lib/provide-config.ts","../../../../../packages/angular/config/src/index.ts","../../../../../packages/angular/config/src/rxap-config.ts"],"sourcesContent":["/**\n * The kind of failure that happened while loading a config url.\n *\n * - `network`: `fetch()` rejected (offline, DNS, CORS without a redirect)\n * - `redirect`: the response is an `opaqueredirect` (only with `requestInit.redirect === 'manual'`)\n * - `http`: the response is not ok - `status` and `response` are available\n * - `parse`: the response body is not valid JSON\n * - `schema`: the schema validation failed\n */\nexport type ConfigLoadErrorKind =\n | 'network'\n | 'redirect'\n | 'http'\n | 'parse'\n | 'schema';\n\nexport interface ConfigLoadError {\n kind: ConfigLoadErrorKind;\n url: string;\n /**\n * true if the config url is required. A required url throws after the error handler is called,\n * an optional url resolves with `null`.\n */\n required: boolean;\n status?: number;\n response?: Response;\n cause?: unknown;\n /**\n * The message the default handler would show.\n */\n message: string;\n}\n\n/**\n * Called for every failed config url request. May never resolve, e.g. if it navigates away.\n */\nexport type ConfigLoadErrorHandler = (error: ConfigLoadError) => void | Promise<void>;\n\n/**\n * The default config load error handler. Shows the error message in an overlay and reloads the\n * page after 30 s for required config urls. Logs a warning for optional config urls.\n *\n * Can be used as fallback in a custom error handler for error kinds it does not handle.\n */\nexport function defaultConfigLoadErrorHandler(error: ConfigLoadError): void {\n if (error.required) {\n showConfigLoadError(error.message);\n } else {\n console.warn(error.message);\n }\n}\n\n/**\n * Appends the message to the config error overlay and schedules a page reload in 30 s.\n */\nexport function showConfigLoadError(message: string) {\n const hasUl = document.getElementById('rxap-config-error') !== null;\n const ul = document.getElementById('rxap-config-error') ?? document.createElement('ul');\n ul.id = 'rxap-config-error';\n ul.style.position = 'fixed';\n ul.style.bottom = '16px';\n ul.style.right = '16px';\n ul.style.backgroundColor = 'white';\n ul.style.padding = '32px';\n ul.style.zIndex = '99999999';\n ul.style.color = 'black';\n const messageLi = document.createElement('li');\n messageLi.innerText = message;\n ul.appendChild(messageLi);\n const refreshHintLi = document.createElement('li');\n refreshHintLi.innerText = 'Please refresh the page to try again.';\n ul.appendChild(refreshHintLi);\n const autoRefreshHintLi = document.createElement('li');\n autoRefreshHintLi.innerText = 'The page will refresh automatically in 30 seconds.';\n ul.appendChild(autoRefreshHintLi);\n if (!hasUl) {\n document.body.appendChild(ul);\n }\n setTimeout(() => location.reload(), 30000);\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n firstValueFrom,\n Observable,\n} from 'rxjs';\nimport { HttpClient } from '@angular/common/http';\nimport {\n finalize,\n share,\n tap,\n} from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ConfigLoaderService {\n readonly http = inject<HttpClient>(HttpClient);\n\n public readonly configs = new Map<string, any>();\n\n public readonly configLoading = new Map<string, Observable<any>>();\n\n public async load$<T = any>(url: string): Promise<T> {\n if (this.configs.has(url)) {\n return this.configs.get(url);\n }\n\n if (this.configLoading.has(url)) {\n return firstValueFrom(this.configLoading.get(url)!);\n }\n\n const loading$ = this.http.get<T>(url).pipe(\n tap(config => this.configs.set(url, config)),\n finalize(() => this.configLoading.delete(url)),\n share(),\n );\n\n this.configLoading.set(url, loading$);\n\n return firstValueFrom(loading$);\n }\n}\n","import { Injectable } from '@angular/core';\nimport {\n getFromObject,\n SetToObject,\n} from '@rxap/utilities';\nimport { ConfigService } from './config.service';\n\n@Injectable()\nexport class ConfigTestingService implements ConfigService {\n readonly config: Record<string, any> = {};\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n clearLocalConfig(): void {\n }\n\n set<T>(propertyPath: string, value: T): void {\n SetToObject(this.config, propertyPath, value);\n }\n\n get<T>(propertyPath: string, defaultValue?: T): T | undefined {\n return getFromObject<T, T>(this.config, propertyPath, defaultValue);\n }\n\n getOrThrow<T>(propertyPath: string): T {\n const value = this.get<T>(propertyPath);\n if (value === undefined) {\n throw new Error(`Could not find config in path '${ propertyPath }'`);\n }\n return value;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setLocalConfig(config: Record<string, any>): void {\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const RXAP_CONFIG = new InjectionToken('rxap/config');\n","// TODO : move to separate package\n\nimport { log } from '@rxap/rxjs';\nimport { JoinPath } from '@rxap/utilities';\nimport {\n catchError,\n EMPTY,\n firstValueFrom,\n Observable,\n race,\n} from 'rxjs';\n\n/**\n * Similar to Promise.race() but only resolves with the first successful promise.\n * It will only reject if all promises reject.\n */\nexport async function raceSuccess<T>(promises: Promise<T>[]): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n let rejectionCount = 0;\n\n promises.forEach((promise) => {\n promise.then(\n // On success, resolve the entire raceSuccess promise\n (value) => resolve(value),\n // On rejection, count it and check if all promises rejected\n () => {\n rejectionCount++;\n if (rejectionCount === promises.length) {\n reject(new Error('All promises were rejected'));\n }\n // Otherwise continue waiting for other promises\n }\n );\n });\n });\n}\n\n\nexport async function dnsResolver(endpoint: string, name: string, type: string): Promise<string> {\n const response = await fetch(`${endpoint}?name=${name}&type=${type}`, {\n method: 'GET',\n headers: {\n 'Accept': 'application/dns-json',\n 'Cache-Control': 'no-cache, no-store, must-revalidate',\n 'Pragma': 'no-cache',\n 'Expires': '0',\n },\n });\n if (!response.ok) {\n throw new Error(`Failed to resolve DNS via ${endpoint} (${response.status}): ${response.statusText}`);\n }\n const result = await response.json();\n // Basic validation of the response structure\n if (!result || !Array.isArray(result.Answer) || result.Answer.length === 0 || !result.Answer[0].data) {\n throw new Error(`Invalid DNS response structure from ${endpoint} for ${name} ${type}`);\n }\n const data = result.Answer[0].data;\n // Remove surrounding quotes often found in TXT records\n return data.replace(/^\"(.*)\"$/, '$1');\n}\n\nexport const defaultDnsServers = [\n 'https://dns.google/resolve',\n 'https://cloudflare-dns.com/dns-query'\n];\n\nexport async function dnsLookup(\n name: string,\n type: string,\n dnsServers = defaultDnsServers\n): Promise<string> {\n if (!dnsServers.length) {\n throw new Error('No DNS servers provided for lookup');\n }\n type = type.toUpperCase();\n console.log(`Performing DNS lookup for ${type} record of ${name} using servers: ${dnsServers.join(', ')}`);\n try {\n // Use Promise.race to get the first successful response\n return await raceSuccess(dnsServers.map(server => dnsResolver(server, name, type)));\n } catch (error: any) {\n console.error(`Failed to resolve DNS TXT record for ${name} using any server: ${error.message}`);\n throw new Error(`DNS lookup failed for ${name} (${type})`); // Re-throw a more specific error\n }\n}\n\nexport function fetchContentViaHttp(url: string): Observable<Blob | null> {\n return new Observable<Blob>((subscriber) => {\n let controller: AbortController | null = new AbortController(); // For cancellation\n\n fetch(url, { signal: controller.signal })\n .then(response => {\n if (!response.ok) {\n // Don't complete here, let catchError handle it\n throw new Error(`HTTP error ${response.status} for ${url}: ${response.statusText}`);\n }\n return response.blob();\n })\n .then(blob => {\n if (!subscriber.closed) {\n subscriber.next(blob);\n subscriber.complete();\n }\n })\n .catch(error => {\n if (error.name !== 'AbortError' && !subscriber.closed) {\n console.warn(`Fetch error for ${url}:`, error);\n subscriber.error(error);\n }\n });\n\n // Cleanup function for when the observable is unsubscribed\n return () => {\n controller?.abort();\n controller = null; // Release reference\n };\n\n }).pipe(\n catchError(error => {\n // Log the error but return null to signal failure without stopping the race\n console.error(`Fetch failed for ${url}: ${error.message}`);\n return EMPTY; // Signal failure with null\n }),\n );\n}\n\nexport type IpfsGatewayFunction = (cid: string) => string;\n\nexport const w3sIpfsGateway: IpfsGatewayFunction = cid => `https://${ cid }.ipfs.w3s.link`;\nexport const storachaIpfsGateway: IpfsGatewayFunction = cid => `https://${ cid }.ipfs.storacha.link`;\nexport const localPathIpfsGateway: IpfsGatewayFunction = cid => `${location.origin}/ipfs/${ cid }`;\nexport const localSubDomainIpfsGateway: IpfsGatewayFunction = cid => `https://${cid}.ipfs.${location.hostname.split('.').slice(-2).join('.')}`;\n\nexport const defaultIpfsGatewayServers: Array<IpfsGatewayFunction> = [\n w3sIpfsGateway,\n storachaIpfsGateway,\n localPathIpfsGateway,\n localSubDomainIpfsGateway\n];\n\nexport function fetchCidContentViaHttp(cid: string, path?: string, ipfsGatewayServers: Array<IpfsGatewayFunction> = defaultIpfsGatewayServers): Observable<Blob | null> {\n if (!ipfsGatewayServers.length) {\n throw new Error('No IPFS gateway servers provided for fetching content');\n }\n return race(\n ...ipfsGatewayServers.map(fnc => fetchContentViaHttp(JoinPath(fnc(cid), path)).pipe(\n log(`fetch attempt for ${cid} via ${fnc.name} - ${fnc(cid)}`),\n ))\n // Add more sources here if needed\n ).pipe(\n log(`Race winner for ${cid}`), // Log which source won (will show Blob or null)\n );\n}\n\nexport async function fetchCidContent(cid: string, path?: string, ipfsGatewayServers: Array<IpfsGatewayFunction> = defaultIpfsGatewayServers): Promise<Blob | null> {\n console.log(`Fetching content for CID: ${cid}`);\n // Example: Fetch from an IPFS gateway or other source\n // const gatewayUrl = `https://ipfs.io/ipfs/${cid}`;\n try {\n return await firstValueFrom(\n race(\n fetchCidContentViaHttp(cid, path, ipfsGatewayServers)\n ),\n { defaultValue: null } // Return null if the stream completes empty\n );\n } catch (error) {\n console.error(`Error fetching or parsing content for CID ${cid}:`, error);\n return null; // Return null on error\n }\n}\n\nexport async function fetchCidContentAsJson(\n cid: string,\n path?: string,\n _fetchCidContent = fetchCidContent,\n ipfsGatewayServers: Array<IpfsGatewayFunction> = defaultIpfsGatewayServers\n): Promise<any | null> {\n console.log(`Fetching JSON content for CID: ${cid}`);\n const blob = await _fetchCidContent(cid, path, ipfsGatewayServers);\n if (blob) {\n try {\n const text = await blob.text();\n return JSON.parse(text);\n } catch (error) {\n console.error(`Error parsing JSON content for CID ${cid}:`, error);\n return null; // Return null on error\n }\n }\n console.warn(`No blob available for CID ${cid}, cannot parse as JSON.`);\n return null; // Return null if blob is not available\n}\n","import { Inject, Injectable, Optional } from '@angular/core';\nimport { Environment } from '@rxap/environment';\nimport {\n coerceArray,\n CoercePrefix,\n deepMerge,\n SetObjectValue,\n SetToObject,\n} from '@rxap/utilities';\nimport { ReplaySubject } from 'rxjs';\nimport {\n ConfigLoadError,\n ConfigLoadErrorHandler,\n defaultConfigLoadErrorHandler,\n} from './config-load-error';\nimport { RXAP_CONFIG } from './tokens';\nimport { NoInferType } from './types';\nimport {\n dnsLookup,\n fetchCidContentAsJson,\n} from './utilities';\n\nexport type AnySchema = { validateAsync: (...args: any[]) => any };\n\nexport enum ConfigLoadingStrategy {\n DEFAULT = 'default',\n FIFO = 'fifo',\n}\n\nexport enum ConfigLoadMethod {\n FROM_URLS = 'fromUrls',\n FROM_LOCAL_STORAGE = 'fromLocalStorage',\n FROM_URL_PARAM = 'fromUrlParam',\n FROM_CID = 'fromCid',\n}\n\nexport interface ConfigLoadOptions {\n fromUrlParam?: string | boolean;\n fromUrls?: boolean;\n fromLocalStorage?: boolean;\n schema?: AnySchema;\n url?: string | string[] | ((environment: Environment) => string | string[]);\n /**\n * static config values\n */\n static?: Record<string, any>;\n /**\n * Load additional configuration based on a CID found in a DNS TXT record.\n * If true, uses `location.hostname`. If a string, uses that domain.\n */\n fromDns?: string | boolean;\n /**\n * Load additional configuration directly from the given Content Identifier (CID).\n * This takes precedence over `fromDns` if both are provided.\n */\n fromCid?: string;\n fetchCidContent?: (cid: string, path?: string) => Promise<Blob | null>;\n ipfsGatewayServers?: Array<(cid: string) => string>;\n dnsServers?: string[];\n strategy?: ConfigLoadingStrategy;\n /**\n * Defines the order and subset of config sources to load.\n * If not specified, defaults to: [FROM_URLS, FROM_LOCAL_STORAGE, FROM_URL_PARAM, FROM_CID]\n *\n * Note: static config is always merged first, and Overwrites are always merged last.\n * Note: fromDns is not a source itself - it resolves the CID for FROM_CID.\n */\n order?: ConfigLoadMethod[];\n /**\n * Replaces the default error handling (error overlay + page reload after 30 s) for failed\n * config url requests. Used for the `url` / `fromUrls` source and for `SideLoad`.\n *\n * Afterwards a required url still throws and an optional url resolves with `null`. The\n * `onError` / `onRequestError` hooks are still called.\n */\n errorHandler?: ConfigLoadErrorHandler;\n /**\n * Passed to `fetch()` for config url requests, e.g. `{ redirect: 'manual' }`.\n */\n requestInit?: RequestInit;\n}\n\nexport type ConfigRequestOptions = Pick<ConfigLoadOptions, 'errorHandler' | 'requestInit'>;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ConfigService<Config extends Record<string, any> = Record<string, any>> {\n\n public static onError = new ReplaySubject<unknown>(1);\n public static onRequestError = new ReplaySubject<Response>(1);\n\n public static onErrorFnc: Array<(error: any) => void> = [];\n public static onRequestErrorFnc: Array<(response: Response) => void> = [];\n\n public static Config: any = null;\n\n /**\n * Static default values for the config object.\n * Will be overwritten by an dynamic config file specified in\n * the Urls array.\n */\n public static Defaults: any = {};\n\n /**\n * Any value definition in the Overwrites object will overwrite any\n * value form the Defaults values or dynamic config files\n */\n public static Overwrites: any = {};\n\n public static LocalStorageKey = 'rxap/config/local-config';\n\n /**\n * The errorHandler and requestInit of the last Load call. Used by SideLoad.\n */\n public static RequestOptions: ConfigRequestOptions = {};\n\n /**\n * @deprecated instead use the url property of the ConfigLoadOptions\n */\n public static Urls = [];\n public readonly config!: Config;\n\n constructor(@Optional() @Inject(RXAP_CONFIG) config: any | null = null) {\n this.config = ConfigService.Config;\n if (config) {\n this.config = deepMerge(this.config ?? {}, config);\n }\n if (!this.config) {\n throw new Error('config not available');\n }\n }\n\n /**\n * Used to load the app config from a remote resource.\n *\n * Promise.all([ ConfigService.Load() ])\n * .then(() => platformBrowserDynamic().bootstrapModule(AppModule))\n * .catch(err => console.error(err))\n *\n */\n public static async Load(options?: ConfigLoadOptions, environment?: Environment): Promise<void> {\n options ??= {};\n\n this.RequestOptions = {\n errorHandler: options.errorHandler,\n requestInit: options.requestInit,\n };\n\n let config: any = deepMerge(this.Defaults, {});\n\n if (environment?.config) {\n if (typeof environment.config === 'string') {\n options.url = environment.config;\n } else {\n options.static = environment.config.static;\n options.url = environment.config.url;\n options.fromUrlParam = environment.config.fromUrlParam;\n options.fromLocalStorage = environment.config.fromLocalStorage;\n options.schema = environment.config.schema;\n options.strategy = environment.config.strategy as ConfigLoadingStrategy ?? options.strategy;\n }\n }\n\n // Always merge static config first\n config = deepMerge(config, options?.static ?? {});\n\n // Determine the order of config sources to load\n const order = options.order ?? [\n ConfigLoadMethod.FROM_URLS,\n ConfigLoadMethod.FROM_LOCAL_STORAGE,\n ConfigLoadMethod.FROM_URL_PARAM,\n ConfigLoadMethod.FROM_CID,\n ];\n\n // If fromDns is enabled and FROM_CID is in the order, resolve CID first\n if (options.fromDns && order.includes(ConfigLoadMethod.FROM_CID) && !options.fromCid) {\n await this.loadConfigFromDns(options as any);\n }\n\n // Load configs from sources in the specified order\n let done = false;\n for (const method of order) {\n if (done) {\n break;\n }\n\n // Check if the source is enabled\n if (!this.isSourceEnabled(options, method)) {\n continue;\n }\n\n try {\n const loadedConfig = await this.loadConfigFromMethod(method, options, environment);\n if (loadedConfig) {\n config = deepMerge(config, loadedConfig);\n }\n\n // If using FIFO strategy, stop after first successful load\n if (options.strategy === ConfigLoadingStrategy.FIFO) {\n done = true;\n }\n } catch (error: any) {\n const methodName = this.getMethodName(method);\n if (options.strategy !== ConfigLoadingStrategy.FIFO) {\n console.error(`Could not load config from ${methodName}`, error);\n throw error;\n } else {\n console.warn(`Could not load config from ${methodName}: ${error.message}. Will try next strategy.`);\n }\n }\n }\n\n if (!done && order.length > 0) {\n console.warn('No config loading strategy succeeded. Using default config.');\n }\n\n // Always merge overwrites last\n config = deepMerge(config, this.Overwrites);\n\n console.debug('app config', config);\n\n this.Config = config;\n }\n\n private static isSourceEnabled(options: ConfigLoadOptions, method: ConfigLoadMethod): boolean {\n switch (method) {\n case ConfigLoadMethod.FROM_URLS:\n return options.fromUrls !== false;\n case ConfigLoadMethod.FROM_LOCAL_STORAGE:\n return options.fromLocalStorage !== false;\n case ConfigLoadMethod.FROM_URL_PARAM:\n return !!options.fromUrlParam;\n case ConfigLoadMethod.FROM_CID:\n return !!options.fromCid;\n default:\n return false;\n }\n }\n\n private static async loadConfigFromMethod(\n method: ConfigLoadMethod,\n options: ConfigLoadOptions,\n environment?: Environment,\n ): Promise<any> {\n switch (method) {\n case ConfigLoadMethod.FROM_URLS:\n return await this.loadConfigFromUrls(options, environment);\n case ConfigLoadMethod.FROM_LOCAL_STORAGE:\n return this.loadConfigFromLocalStorage(options);\n case ConfigLoadMethod.FROM_URL_PARAM:\n return this.loadConfigFromUrlParam(options as any);\n case ConfigLoadMethod.FROM_CID:\n return await this.loadConfigFromCid(options as any);\n default:\n return null;\n }\n }\n\n private static getMethodName(method: ConfigLoadMethod): string {\n switch (method) {\n case ConfigLoadMethod.FROM_URLS:\n return 'urls';\n case ConfigLoadMethod.FROM_LOCAL_STORAGE:\n return 'local storage';\n case ConfigLoadMethod.FROM_URL_PARAM:\n return 'url param';\n case ConfigLoadMethod.FROM_CID:\n return 'cid';\n default:\n return 'unknown';\n }\n }\n\n private static loadConfigFromUrlParam(options: ConfigLoadOptions & { fromUrlParam: string | true }) {\n const param = typeof options.fromUrlParam === 'string' ? options.fromUrlParam : 'config';\n return this.LoadConfigDefaultFromUrlParam(param);\n }\n\n private static loadConfigFromLocalStorage(options: ConfigLoadOptions) {\n const localConfig = localStorage.getItem(ConfigService.LocalStorageKey);\n if (localConfig) {\n return JSON.parse(localConfig);\n } else {\n return {};\n }\n }\n\n private static async loadConfigFromUrls(options: ConfigLoadOptions, environment?: Environment) {\n let config: any = {};\n const urls = (\n options?.url ? coerceArray(options.url) : ConfigService.Urls\n ).map(url => {\n if (typeof url === 'function') {\n if (!environment) {\n throw new Error('environment is required when url is a function');\n }\n return coerceArray(url(environment));\n }\n return coerceArray(url);\n }).flat();\n\n for (const url of urls) {\n const loadedConfig = await this.loadConfig(url, true, options?.schema, options);\n const match = url.match(/config\\.([a-zA-Z0-9.\\-_]+)\\.json/);\n if (match) {\n SetToObject(config, match[1], loadedConfig);\n } else {\n config = deepMerge(config, loadedConfig);\n }\n }\n return config;\n }\n\n private static async loadConfigFromCid(options: ConfigLoadOptions & { fromCid: string | boolean }) {\n console.debug('Loading config from CID: ', options.fromCid);\n const ipfsGatewayFunctions = options.ipfsGatewayServers ?? [];\n if (!ipfsGatewayFunctions.length) {\n console.warn('No IPFS gateway servers provided for fetching content from CID');\n return;\n }\n try {\n const cidContent = await fetchCidContentAsJson(\n options.fromCid,\n undefined,\n options.fetchCidContent,\n ipfsGatewayFunctions\n );\n if (cidContent && typeof cidContent === 'object') {\n console.log(`Merging configuration from CID ${options.fromCid}.`, cidContent);\n // Merge CID content into the existing config object\n console.log('Configuration merged successfully.');\n return cidContent;\n } else if (cidContent) {\n console.warn(`Content fetched from CID ${options.fromCid} is not a mergeable object, skipping merge.`);\n } else {\n console.warn(`No content fetched or content was null for CID ${options.fromCid}.`);\n }\n } catch (error: any) {\n console.error(`Failed to fetch or process content for CID ${options.fromCid}: ${error.message}`);\n // Decide how to handle fetch/processing errors\n }\n }\n\n private static async loadConfigFromDns(options: ConfigLoadOptions & { fromDns: string | boolean }) {\n console.debug('Loading config from DNS');\n const dnsServers = options.dnsServers ?? [];\n if (!dnsServers.length) {\n console.warn('No DNS servers provided for DNS lookup');\n return;\n }\n let domain = location.hostname;\n if (typeof options.fromDns === 'string') {\n domain = options.fromDns;\n }\n domain = CoercePrefix(domain, '_config.');\n try {\n console.log(`Attempting DNS lookup for domain: ${domain}`);\n const txtData = await dnsLookup(domain, 'TXT', dnsServers);\n console.log(`DNS TXT record data found: ${txtData}`);\n // Example CID extraction logic (adapt to your TXT record format)\n // This looks for IPFS CIDs (v0 'Qm...' or v1 'b...') potentially after 'ipfs://' or '/'\n const cidMatch = txtData.match(/(?:ipfs:\\/\\/|\\/|^)([a-zA-Z0-9]{40,})$/);\n if (cidMatch && cidMatch[1]) {\n options.fromCid = cidMatch[1];\n console.log(`Extracted CID from DNS: ${options.fromCid}`);\n } else {\n console.warn(`Could not extract a valid CID format from DNS TXT data: \"${txtData}\"`);\n }\n } catch (error: any) {\n console.error(`DNS lookup for ${domain} failed: ${error.message}`);\n // Decide if failure is critical or recoverable\n }\n }\n\n private static handleError(error: any) {\n this.onError.next(error);\n for (const fnc of this.onErrorFnc) {\n try {\n fnc(error);\n } catch (e: any) {\n console.error('Error in onErrorFnc', e);\n }\n }\n }\n\n private static handleRequestError(response: Response) {\n this.onRequestError.next(response);\n for (const fnc of this.onRequestErrorFnc) {\n try {\n fnc(response);\n } catch (e: any) {\n console.error('Error in onRequestErrorFnc', e);\n }\n }\n }\n\n private static async loadConfig<T = any>(\n url: string,\n required = false,\n schema?: AnySchema,\n options: ConfigRequestOptions = this.RequestOptions,\n ): Promise<T | null> {\n\n let config: any;\n let response: Response;\n\n try {\n response = await fetch(url, options.requestInit);\n } catch (error: any) {\n return this.handleLoadError({\n kind: 'network',\n url,\n required,\n cause: error,\n message: `Could not fetch config from '${ url }': ${ error.message }`,\n }, options);\n }\n\n if (response.type === 'opaqueredirect') {\n return this.handleLoadError({\n kind: 'redirect',\n url,\n required,\n status: response.status,\n response,\n message: `Config request for '${ url }' was redirected`,\n }, options);\n }\n\n if (!response.ok) {\n let message = `Config request results in non ok response for '${ url }': (${ response.status }) ${ response.statusText }`;\n switch (response.status) {\n case 404:\n message = `Config not found at '${ url }'`;\n break;\n case 405:\n message = `Config service is not started yet. Wait 30s and try again.`;\n break;\n case 401:\n message = `Unauthorized to fetch config from '${ url }'`;\n break;\n }\n return this.handleLoadError({\n kind: 'http',\n url,\n required,\n status: response.status,\n response,\n message,\n }, options);\n }\n\n try {\n config = await response.json();\n } catch (error: any) {\n return this.handleLoadError({\n kind: 'parse',\n url,\n required,\n status: response.status,\n response,\n cause: error,\n message: `Could not parse config from '${ url }' to a json object: ${ error.message }`,\n }, options);\n }\n\n if (schema) {\n try {\n config = await schema.validateAsync(config);\n } catch (error: any) {\n return this.handleLoadError({\n kind: 'schema',\n url,\n required,\n status: response.status,\n response,\n cause: error,\n message: `Config from '${ url }' is not valid: ${ error.message }`,\n }, options);\n }\n }\n\n return config;\n\n }\n\n /**\n * Notifies the onError/onRequestError hooks (required urls only), calls the error handler and\n * throws for required urls. Resolves with null for optional urls.\n */\n private static async handleLoadError(error: ConfigLoadError, options: ConfigRequestOptions): Promise<null> {\n if (error.required) {\n if (error.response && (error.kind === 'http' || error.kind === 'redirect')) {\n this.handleRequestError(error.response);\n } else {\n this.handleError(error.cause);\n }\n }\n const errorHandler = options.errorHandler ?? defaultConfigLoadErrorHandler;\n try {\n await errorHandler(error);\n } catch (e: any) {\n console.error('Error in config load error handler', e);\n }\n if (error.required) {\n throw new Error(error.message);\n }\n return null;\n }\n\n private static LoadConfigDefaultFromUrlParam(param = 'config') {\n\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n\n const configFromParams = {};\n\n for (const configParam of urlParams.getAll(param)) {\n\n try {\n const split = configParam.split(';');\n if (split.length === 2) {\n const keyPath = split[0];\n const value = split[1];\n SetObjectValue(configFromParams, keyPath, value);\n }\n } catch (e: any) {\n console.warn(`Parsing of url config param failed for '${ configParam }': ${ e.message }`);\n }\n\n }\n\n return configFromParams;\n\n }\n\n public static async SideLoad(\n url: string,\n propertyPath: string,\n required?: boolean,\n schema?: AnySchema,\n options: ConfigRequestOptions = this.RequestOptions,\n ): Promise<void> {\n\n if (!this.Config) {\n throw new Error('Config side load is only possible after the initial config load.');\n }\n\n const config = await this.loadConfig(url, required, schema, options);\n\n SetObjectValue(this.Config, propertyPath, config);\n\n console.debug(`Side loaded config for '${ propertyPath }' successful`, this.Config);\n\n }\n\n public static Get<T = any, K extends Record<string, any> = Record<string, any>>(\n path: string,\n defaultValue: T | undefined,\n config: Record<string, any>,\n ): T\n\n public static Get<T = any, K extends Record<string, any> = Record<string, any>>(\n path: string,\n defaultValue: NoInferType<T>,\n config: Record<string, any> = this.Config,\n ): T {\n if (!config) {\n throw new Error('config not loaded');\n }\n let configValue: any = config;\n if (typeof path !== 'string') {\n throw new Error('The config property path is not a string');\n }\n for (const fragment of path.split('.')) {\n if (configValue && typeof configValue === 'object' && fragment in configValue) {\n configValue = configValue[fragment];\n } else {\n if (defaultValue !== undefined) {\n return defaultValue;\n }\n console.debug(`Config with path '${ path }' not found`);\n return undefined as any;\n }\n }\n return configValue;\n }\n\n public setLocalConfig(config: Config): void {\n localStorage.setItem(ConfigService.LocalStorageKey, JSON.stringify(config));\n }\n\n public clearLocalConfig(): void {\n localStorage.removeItem(ConfigService.LocalStorageKey);\n }\n\n public get<T = any>(propertyPath: string): T | undefined;\n public get<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;\n public get<T = any>(propertyPath: string, defaultValue?: T): T | undefined {\n return ConfigService.Get(propertyPath, defaultValue, this.config);\n }\n\n public getOrThrow<T = any>(propertyPath: string): T;\n public getOrThrow<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;\n public getOrThrow<T = any>(propertyPath: string, defaultValue?: T): T {\n const value = ConfigService.Get(propertyPath, defaultValue, this.config);\n if (value === undefined) {\n throw new Error(`Could not find config in path '${ propertyPath }'`);\n }\n return value;\n }\n\n}\n","import { RXAP_CONFIG } from './tokens';\n\nexport function ProvideConfig(config: Record<string, unknown> = {}) {\n return {\n provide: RXAP_CONFIG,\n useValue: config,\n };\n}\n","// region \nexport * from './lib/config-load-error';\nexport * from './lib/config-loader.service';\nexport * from './lib/config-testing-service';\nexport * from './lib/config.service';\nexport * from './lib/config';\nexport * from './lib/provide-config';\nexport * from './lib/tokens';\nexport * from './lib/types';\nexport * from './lib/utilities';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mapp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A,aAAa,cAFZ,MAAM,EAAA,CAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAqCc;;0BAAY,MAAM;2BAAC,WAAW;;;ACzHvC,SAAU,aAAa,CAAC,MAAA,GAAkC,EAAE,EAAA;IAChE,OAAO;AACL,QAAA,OAAO,EAAE,WAAW;AACpB,QAAA,QAAQ,EAAE,MAAM;KACjB;AACH;;ACPA;AAUA;;ACVA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "21.0.1-dev.0",
2
+ "version": "21.0.1",
3
3
  "name": "@rxap/config",
4
4
  "description": "Provides a configuration service for Angular applications, allowing you to load and manage application settings from various sources such as static files, URLs, local storage, and URL parameters. It supports schema validation and provides utilities for accessing configuration values. This package also includes testing utilities for mocking and managing configurations in test environments.\n",
5
5
  "license": "GPL-3.0-or-later",
@@ -10,8 +10,8 @@
10
10
  "peerDependencies": {
11
11
  "@angular/common": "^21.2.9",
12
12
  "@angular/core": "^21.2.9",
13
- "@rxap/environment": "^21.0.1-dev.0",
14
- "@rxap/utilities": "^16.5.2-dev.0",
13
+ "@rxap/environment": "^21.0.1",
14
+ "@rxap/utilities": "^16.5.2",
15
15
  "rxjs": "^7.8.2"
16
16
  },
17
17
  "author": {
@@ -45,11 +45,11 @@
45
45
  },
46
46
  {
47
47
  "package": "@rxap/environment",
48
- "version": "21.0.1-dev.0"
48
+ "version": "21.0.1"
49
49
  },
50
50
  {
51
51
  "package": "@rxap/utilities",
52
- "version": "16.5.2-dev.0"
52
+ "version": "16.5.2"
53
53
  }
54
54
  ]
55
55
  },
@@ -51,7 +51,6 @@ declare class ConfigLoaderService {
51
51
  readonly http: HttpClient;
52
52
  readonly configs: Map<string, any>;
53
53
  readonly configLoading: Map<string, Observable<any>>;
54
- constructor(http: HttpClient);
55
54
  load$<T = any>(url: string): Promise<T>;
56
55
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfigLoaderService, never>;
57
56
  static ɵprov: i0.ɵɵInjectableDeclaration<ConfigLoaderService>;