@rxap/config 19.2.0-dev.1 → 19.2.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/compodoc/changelog.html +11 -0
- package/compodoc/dependencies.html +1 -1
- package/compodoc/injectables/ConfigService.html +151 -69
- package/compodoc/interfaces/ConfigLoadOptions.html +251 -34
- package/compodoc/js/menu-wc.js +3 -0
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/enumerations.html +231 -0
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +813 -648
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/ConfigLoaderService.html +2 -2
- package/docs/html/classes/ConfigService.html +6 -6
- package/docs/html/classes/ConfigTestingService.html +2 -2
- package/docs/html/enums/ConfigLoadingStrategy.html +3 -0
- package/docs/html/functions/ProvideConfig.html +1 -1
- package/docs/html/functions/dnsLookup.html +1 -1
- package/docs/html/functions/dnsResolver.html +1 -1
- package/docs/html/functions/fetchCidContent.html +1 -1
- package/docs/html/functions/fetchCidContentAsJson.html +1 -1
- package/docs/html/functions/fetchCidContentViaHttp.html +1 -1
- package/docs/html/functions/fetchContentViaHttp.html +1 -1
- package/docs/html/functions/raceSuccess.html +2 -2
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/AppsNavigationConfig.html +2 -2
- package/docs/html/interfaces/Config.html +2 -2
- package/docs/html/interfaces/ConfigLoadOptions.html +8 -5
- package/docs/html/interfaces/LogoConfig.html +2 -2
- package/docs/html/interfaces/NavigationConfig.html +2 -2
- package/docs/html/interfaces/Oauth2Config.html +2 -2
- package/docs/html/interfaces/i18nConfig.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/AnySchema.html +1 -1
- package/docs/html/types/Join.html +1 -1
- package/docs/html/types/LanguagesConfig.html +1 -1
- package/docs/html/types/Leaves.html +1 -1
- package/docs/html/types/NoInferType.html +1 -1
- package/docs/html/types/Paths.html +1 -1
- package/docs/html/variables/RXAP_CONFIG.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/ConfigLoaderService.md +7 -7
- package/docs/markdown/classes/ConfigService.md +22 -22
- package/docs/markdown/classes/ConfigTestingService.md +8 -8
- package/docs/markdown/enumerations/ConfigLoadingStrategy.md +25 -0
- package/docs/markdown/functions/ProvideConfig.md +2 -2
- package/docs/markdown/functions/dnsLookup.md +2 -2
- package/docs/markdown/functions/dnsResolver.md +2 -2
- package/docs/markdown/functions/fetchCidContent.md +2 -2
- package/docs/markdown/functions/fetchCidContentAsJson.md +2 -2
- package/docs/markdown/functions/fetchCidContentViaHttp.md +2 -2
- package/docs/markdown/functions/fetchContentViaHttp.md +2 -2
- package/docs/markdown/functions/raceSuccess.md +2 -2
- package/docs/markdown/globals.md +6 -2
- package/docs/markdown/interfaces/AppsNavigationConfig.md +12 -12
- package/docs/markdown/interfaces/Config.md +6 -6
- package/docs/markdown/interfaces/ConfigLoadOptions.md +34 -10
- package/docs/markdown/interfaces/LogoConfig.md +5 -5
- package/docs/markdown/interfaces/NavigationConfig.md +9 -9
- package/docs/markdown/interfaces/Oauth2Config.md +3 -3
- package/docs/markdown/interfaces/i18nConfig.md +4 -4
- package/docs/markdown/type-aliases/AnySchema.md +2 -2
- package/docs/markdown/type-aliases/Join.md +2 -2
- package/docs/markdown/type-aliases/LanguagesConfig.md +2 -2
- package/docs/markdown/type-aliases/Leaves.md +2 -2
- package/docs/markdown/type-aliases/NoInferType.md +2 -2
- package/docs/markdown/type-aliases/Paths.md +2 -2
- package/docs/markdown/variables/RXAP_CONFIG.md +2 -2
- package/docs/wiki/Class.ConfigLoaderService.md +6 -6
- package/docs/wiki/Class.ConfigService.md +21 -21
- package/docs/wiki/Class.ConfigTestingService.md +7 -7
- package/docs/wiki/Enumeration.ConfigLoadingStrategy.md +21 -0
- package/docs/wiki/Function.ProvideConfig.md +1 -1
- package/docs/wiki/Function.dnsLookup.md +1 -1
- package/docs/wiki/Function.dnsResolver.md +1 -1
- package/docs/wiki/Function.fetchCidContent.md +1 -1
- package/docs/wiki/Function.fetchCidContentAsJson.md +1 -1
- package/docs/wiki/Function.fetchCidContentViaHttp.md +1 -1
- package/docs/wiki/Function.fetchContentViaHttp.md +1 -1
- package/docs/wiki/Function.raceSuccess.md +1 -1
- package/docs/wiki/Interface.AppsNavigationConfig.md +11 -11
- package/docs/wiki/Interface.Config.md +5 -5
- package/docs/wiki/Interface.ConfigLoadOptions.md +33 -9
- package/docs/wiki/Interface.LogoConfig.md +4 -4
- package/docs/wiki/Interface.NavigationConfig.md +8 -8
- package/docs/wiki/Interface.Oauth2Config.md +2 -2
- package/docs/wiki/Interface.i18nConfig.md +3 -3
- package/docs/wiki/TypeAlias.AnySchema.md +1 -1
- package/docs/wiki/TypeAlias.Join.md +1 -1
- package/docs/wiki/TypeAlias.LanguagesConfig.md +1 -1
- package/docs/wiki/TypeAlias.Leaves.md +1 -1
- package/docs/wiki/TypeAlias.NoInferType.md +1 -1
- package/docs/wiki/TypeAlias.Paths.md +1 -1
- package/docs/wiki/Variable.RXAP_CONFIG.md +1 -1
- package/docs/wiki/_Sidebar.md +4 -0
- package/docs/wiki/globals.md +5 -1
- package/fesm2022/rxap-config.mjs +118 -35
- package/fesm2022/rxap-config.mjs.map +1 -1
- package/lib/config.service.d.ts +10 -0
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: NavigationConfig
|
|
4
4
|
|
|
5
|
-
Defined in: [config.ts:22](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [config.ts:22](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L22)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [config.ts:22](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
10
10
|
|
|
11
11
|
> `optional` **apps**: [`AppsNavigationConfig`](../wiki/Interface.AppsNavigationConfig)[]
|
|
12
12
|
|
|
13
|
-
Defined in: [config.ts:23](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [config.ts:23](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L23)
|
|
14
14
|
|
|
15
15
|
***
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ Defined in: [config.ts:23](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
18
18
|
|
|
19
19
|
> `optional` **collapsable**: `boolean`
|
|
20
20
|
|
|
21
|
-
Defined in: [config.ts:24](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [config.ts:24](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L24)
|
|
22
22
|
|
|
23
23
|
***
|
|
24
24
|
|
|
@@ -26,7 +26,7 @@ Defined in: [config.ts:24](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
26
26
|
|
|
27
27
|
> `optional` **fixedInViewport**: `boolean`
|
|
28
28
|
|
|
29
|
-
Defined in: [config.ts:28](https://gitlab.com/rxap/packages/-/blob/
|
|
29
|
+
Defined in: [config.ts:28](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L28)
|
|
30
30
|
|
|
31
31
|
***
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ Defined in: [config.ts:28](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
34
34
|
|
|
35
35
|
> `optional` **mobileQuery**: `string`
|
|
36
36
|
|
|
37
|
-
Defined in: [config.ts:29](https://gitlab.com/rxap/packages/-/blob/
|
|
37
|
+
Defined in: [config.ts:29](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L29)
|
|
38
38
|
|
|
39
39
|
***
|
|
40
40
|
|
|
@@ -42,7 +42,7 @@ Defined in: [config.ts:29](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
42
42
|
|
|
43
43
|
> `optional` **mode**: `"side"` \| `"over"`
|
|
44
44
|
|
|
45
|
-
Defined in: [config.ts:26](https://gitlab.com/rxap/packages/-/blob/
|
|
45
|
+
Defined in: [config.ts:26](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L26)
|
|
46
46
|
|
|
47
47
|
***
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ Defined in: [config.ts:26](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
50
50
|
|
|
51
51
|
> `optional` **opened**: `boolean`
|
|
52
52
|
|
|
53
|
-
Defined in: [config.ts:27](https://gitlab.com/rxap/packages/-/blob/
|
|
53
|
+
Defined in: [config.ts:27](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L27)
|
|
54
54
|
|
|
55
55
|
***
|
|
56
56
|
|
|
@@ -58,4 +58,4 @@ Defined in: [config.ts:27](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
58
58
|
|
|
59
59
|
> `optional` **pinned**: `boolean`
|
|
60
60
|
|
|
61
|
-
Defined in: [config.ts:25](https://gitlab.com/rxap/packages/-/blob/
|
|
61
|
+
Defined in: [config.ts:25](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L25)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: Oauth2Config
|
|
4
4
|
|
|
5
|
-
Defined in: [config.ts:39](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [config.ts:39](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L39)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
@@ -10,4 +10,4 @@ Defined in: [config.ts:39](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
10
10
|
|
|
11
11
|
> `optional` **profileUrl**: `string`
|
|
12
12
|
|
|
13
|
-
Defined in: [config.ts:40](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [config.ts:40](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L40)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: i18nConfig
|
|
4
4
|
|
|
5
|
-
Defined in: [config.ts:34](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [config.ts:34](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L34)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [config.ts:34](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
10
10
|
|
|
11
11
|
> `optional` **defaultLanguage**: `string`
|
|
12
12
|
|
|
13
|
-
Defined in: [config.ts:36](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [config.ts:36](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L36)
|
|
14
14
|
|
|
15
15
|
***
|
|
16
16
|
|
|
@@ -18,4 +18,4 @@ Defined in: [config.ts:36](https://gitlab.com/rxap/packages/-/blob/c245f8b24a529
|
|
|
18
18
|
|
|
19
19
|
> `optional` **languages**: [`LanguagesConfig`](../wiki/TypeAlias.LanguagesConfig)
|
|
20
20
|
|
|
21
|
-
Defined in: [config.ts:35](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [config.ts:35](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L35)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **AnySchema**: `object`
|
|
6
6
|
|
|
7
|
-
Defined in: [config.service.ts:22](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [config.service.ts:22](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.service.ts#L22)
|
|
8
8
|
|
|
9
9
|
## Type declaration
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Join**\<`K`, `P`\>: `K` *extends* `string` \| `number` ? `P` *extends* `string` \| `number` ? `` `${K}${"" extends P ? "" : "."}${P}` `` : `never` : `never`
|
|
6
6
|
|
|
7
|
-
Defined in: [types.ts:8](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [types.ts:8](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/types.ts#L8)
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
> **LanguagesConfig**: `Record`\<`string`, `string`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [config.ts:32](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [config.ts:32](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/config.ts#L32)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Leaves**\<`T`, `D`\>: \[`D`\] *extends* \[`never`\] ? `never` : `T` *extends* `object` ? `{ [K in keyof T]-?: Join<K, Leaves<T[K], Prev[D]>> }`\[keyof `T`\] : `""`
|
|
6
6
|
|
|
7
|
-
Defined in: [types.ts:20](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [types.ts:20](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/types.ts#L20)
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **NoInferType**\<`T`\>: \[`T`\]\[`T` *extends* `any` ? `0` : `never`\]
|
|
6
6
|
|
|
7
|
-
Defined in: [types.ts:1](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [types.ts:1](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/types.ts#L1)
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Paths**\<`T`, `D`\>: \[`D`\] *extends* \[`never`\] ? `never` : `T` *extends* `object` ? \{ \[K in keyof T\]-?: K extends string \| number ? \`$\{K\}\` \| Join\<K, Paths\<T\[K\], Prev\[D\]\>\> : never \}\[keyof `T`\] : `""`
|
|
6
6
|
|
|
7
|
-
Defined in: [types.ts:13](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [types.ts:13](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/types.ts#L13)
|
|
8
8
|
|
|
9
9
|
## Type Parameters
|
|
10
10
|
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
> `const` **RXAP\_CONFIG**: `InjectionToken`\<`unknown`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [tokens.ts:3](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [tokens.ts:3](https://gitlab.com/rxap/packages/-/blob/5ad37909a73f9e3eaab7208cdf5b0e12eb759c7e/packages/angular/config/src/lib/tokens.ts#L3)
|
package/docs/wiki/_Sidebar.md
CHANGED
package/docs/wiki/globals.md
CHANGED
package/fesm2022/rxap-config.mjs
CHANGED
|
@@ -24,10 +24,10 @@ class ConfigLoaderService {
|
|
|
24
24
|
this.configLoading.set(url, loading$);
|
|
25
25
|
return firstValueFrom(loading$);
|
|
26
26
|
}
|
|
27
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
28
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
27
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigLoaderService, deps: [{ token: HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
28
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigLoaderService, providedIn: 'root' }); }
|
|
29
29
|
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigLoaderService, decorators: [{
|
|
31
31
|
type: Injectable,
|
|
32
32
|
args: [{ providedIn: 'root' }]
|
|
33
33
|
}], ctorParameters: () => [{ type: i1.HttpClient, decorators: [{
|
|
@@ -58,10 +58,10 @@ class ConfigTestingService {
|
|
|
58
58
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
59
59
|
setLocalConfig(config) {
|
|
60
60
|
}
|
|
61
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
62
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
61
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigTestingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
62
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigTestingService }); }
|
|
63
63
|
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigTestingService, decorators: [{
|
|
65
65
|
type: Injectable
|
|
66
66
|
}] });
|
|
67
67
|
|
|
@@ -164,6 +164,8 @@ function fetchCidContentViaHttp(cid, path) {
|
|
|
164
164
|
return race(
|
|
165
165
|
// Attempt 1: w3s.link
|
|
166
166
|
fetchContentViaHttp(JoinPath(`https://${cid}.ipfs.w3s.link`, path)).pipe(log(`w3s fetch attempt for ${cid}`)),
|
|
167
|
+
// Attempt 1: storacha.link
|
|
168
|
+
fetchContentViaHttp(JoinPath(`https://${cid}.ipfs.storacha.link`, path)).pipe(log(`storacha fetch attempt for ${cid}`)),
|
|
167
169
|
// Attempt 2: Local gateway
|
|
168
170
|
fetchContentViaHttp(JoinPath(`${location.origin}/ipfs/${cid}`, path)).pipe(log(`local fetch attempt for ${cid}`))
|
|
169
171
|
// Add more sources here if needed
|
|
@@ -199,6 +201,11 @@ async function fetchCidContentAsJson(cid, path, _fetchCidContent = fetchCidConte
|
|
|
199
201
|
return null; // Return null if blob is not available
|
|
200
202
|
}
|
|
201
203
|
|
|
204
|
+
var ConfigLoadingStrategy;
|
|
205
|
+
(function (ConfigLoadingStrategy) {
|
|
206
|
+
ConfigLoadingStrategy["DEFAULT"] = "default";
|
|
207
|
+
ConfigLoadingStrategy["FIFO"] = "fifo";
|
|
208
|
+
})(ConfigLoadingStrategy || (ConfigLoadingStrategy = {}));
|
|
202
209
|
class ConfigService {
|
|
203
210
|
static { this.onError = new ReplaySubject(1); }
|
|
204
211
|
static { this.onRequestError = new ReplaySubject(1); }
|
|
@@ -251,9 +258,104 @@ class ConfigService {
|
|
|
251
258
|
options.fromUrlParam = environment.config.fromUrlParam;
|
|
252
259
|
options.fromLocalStorage = environment.config.fromLocalStorage;
|
|
253
260
|
options.schema = environment.config.schema;
|
|
261
|
+
options.strategy = environment.config.strategy ?? options.strategy;
|
|
254
262
|
}
|
|
255
263
|
}
|
|
256
264
|
config = deepMerge(config, options?.static ?? {});
|
|
265
|
+
let done = false;
|
|
266
|
+
if (!done && options?.fromUrls !== false) {
|
|
267
|
+
try {
|
|
268
|
+
config = deepMerge(config, await this.loadConfigFromUrls(options, environment));
|
|
269
|
+
if (options.strategy === ConfigLoadingStrategy.FIFO) {
|
|
270
|
+
done = true;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
if (options.strategy !== ConfigLoadingStrategy.FIFO) {
|
|
275
|
+
console.error('Could not load config from urls', error);
|
|
276
|
+
throw error;
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
console.warn('Could not load config from urls: ' + error.message + '. Will try next strategy.');
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (!done && options?.fromLocalStorage !== false) {
|
|
284
|
+
try {
|
|
285
|
+
config = deepMerge(config, this.loadConfigFromLocalStorage(options));
|
|
286
|
+
if (options.strategy === ConfigLoadingStrategy.FIFO) {
|
|
287
|
+
done = true;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
if (options.strategy !== ConfigLoadingStrategy.FIFO) {
|
|
292
|
+
console.error('Could not load config from local storage', error);
|
|
293
|
+
throw error;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
console.warn('Could not load config from local storage: ' + error.message + '. Will try next strategy.');
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (!done && options?.fromUrlParam) {
|
|
301
|
+
try {
|
|
302
|
+
config = deepMerge(config, this.loadConfigFromUrlParam(options));
|
|
303
|
+
if (options.strategy === ConfigLoadingStrategy.FIFO) {
|
|
304
|
+
done = true;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
if (options.strategy !== ConfigLoadingStrategy.FIFO) {
|
|
309
|
+
console.error('Could not load config from url param', error);
|
|
310
|
+
throw error;
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
console.warn('Could not load config from url param: ' + error.message + '. Will try next strategy.');
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (!done && options?.fromDns) {
|
|
318
|
+
await this.loadConfigFromDns(options);
|
|
319
|
+
}
|
|
320
|
+
if (!done && options?.fromCid) {
|
|
321
|
+
try {
|
|
322
|
+
config = deepMerge(config, await this.loadConfigFromCid(options));
|
|
323
|
+
if (options.strategy === ConfigLoadingStrategy.FIFO) {
|
|
324
|
+
done = true;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
catch (error) {
|
|
328
|
+
if (options.strategy !== ConfigLoadingStrategy.FIFO) {
|
|
329
|
+
console.error('Could not load config from cid', error);
|
|
330
|
+
throw error;
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
console.warn('Could not load config from cid: ' + error.message + '. Will try next strategy.');
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (!done) {
|
|
338
|
+
console.warn('No config loading strategy succeeded. Using default config.');
|
|
339
|
+
}
|
|
340
|
+
config = deepMerge(config, this.Overwrites);
|
|
341
|
+
console.debug('app config', config);
|
|
342
|
+
this.Config = config;
|
|
343
|
+
}
|
|
344
|
+
static loadConfigFromUrlParam(options) {
|
|
345
|
+
const param = typeof options.fromUrlParam === 'string' ? options.fromUrlParam : 'config';
|
|
346
|
+
return this.LoadConfigDefaultFromUrlParam(param);
|
|
347
|
+
}
|
|
348
|
+
static loadConfigFromLocalStorage(options) {
|
|
349
|
+
const localConfig = localStorage.getItem(ConfigService.LocalStorageKey);
|
|
350
|
+
if (localConfig) {
|
|
351
|
+
return JSON.parse(localConfig);
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
return {};
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
static async loadConfigFromUrls(options, environment) {
|
|
358
|
+
let config = {};
|
|
257
359
|
const urls = (options?.url ? coerceArray(options.url) : ConfigService.Urls).map(url => {
|
|
258
360
|
if (typeof url === 'function') {
|
|
259
361
|
if (!environment) {
|
|
@@ -273,30 +375,7 @@ class ConfigService {
|
|
|
273
375
|
config = deepMerge(config, loadedConfig);
|
|
274
376
|
}
|
|
275
377
|
}
|
|
276
|
-
|
|
277
|
-
if (options?.fromLocalStorage !== false) {
|
|
278
|
-
const localConfig = localStorage.getItem(ConfigService.LocalStorageKey);
|
|
279
|
-
if (localConfig) {
|
|
280
|
-
try {
|
|
281
|
-
config = deepMerge(config, JSON.parse(localConfig));
|
|
282
|
-
}
|
|
283
|
-
catch (e) {
|
|
284
|
-
console.error('local config could not be parsed');
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
if (options?.fromUrlParam) {
|
|
289
|
-
const param = typeof options.fromUrlParam === 'string' ? options.fromUrlParam : 'config';
|
|
290
|
-
config = deepMerge(config, this.LoadConfigDefaultFromUrlParam(param));
|
|
291
|
-
}
|
|
292
|
-
if (options?.fromDns) {
|
|
293
|
-
await this.loadConfigFromDns(options);
|
|
294
|
-
}
|
|
295
|
-
if (options?.fromCid) {
|
|
296
|
-
config = deepMerge(config, await this.loadConfigFromCid(options));
|
|
297
|
-
}
|
|
298
|
-
console.debug('app config', config);
|
|
299
|
-
this.Config = config;
|
|
378
|
+
return config;
|
|
300
379
|
}
|
|
301
380
|
static async loadConfigFromCid(options) {
|
|
302
381
|
console.debug('Loading config from CID: ', options.fromCid);
|
|
@@ -322,6 +401,10 @@ class ConfigService {
|
|
|
322
401
|
}
|
|
323
402
|
static async loadConfigFromDns(options) {
|
|
324
403
|
console.debug('Loading config from DNS');
|
|
404
|
+
const dnsServers = options.dnsServers ?? [];
|
|
405
|
+
if (dnsServers.length === 0) {
|
|
406
|
+
dnsServers.push('https://dns.google/resolve', 'https://cloudflare-dns.com/dns-query');
|
|
407
|
+
}
|
|
325
408
|
let domain = location.hostname;
|
|
326
409
|
if (typeof options.fromDns === 'string') {
|
|
327
410
|
domain = options.fromDns;
|
|
@@ -329,7 +412,7 @@ class ConfigService {
|
|
|
329
412
|
domain = CoercePrefix(domain, '_config.');
|
|
330
413
|
try {
|
|
331
414
|
console.log(`Attempting DNS lookup for domain: ${domain}`);
|
|
332
|
-
const txtData = await dnsLookup(domain, 'TXT');
|
|
415
|
+
const txtData = await dnsLookup(domain, 'TXT', dnsServers);
|
|
333
416
|
console.log(`DNS TXT record data found: ${txtData}`);
|
|
334
417
|
// Example CID extraction logic (adapt to your TXT record format)
|
|
335
418
|
// This looks for IPFS CIDs (v0 'Qm...' or v1 'b...') potentially after 'ipfs://' or '/'
|
|
@@ -534,10 +617,10 @@ class ConfigService {
|
|
|
534
617
|
}
|
|
535
618
|
return value;
|
|
536
619
|
}
|
|
537
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
538
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
620
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigService, deps: [{ token: RXAP_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
621
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigService, providedIn: 'root' }); }
|
|
539
622
|
}
|
|
540
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.16", ngImport: i0, type: ConfigService, decorators: [{
|
|
541
624
|
type: Injectable,
|
|
542
625
|
args: [{
|
|
543
626
|
providedIn: 'root',
|
|
@@ -563,5 +646,5 @@ function ProvideConfig(config = {}) {
|
|
|
563
646
|
* Generated bundle index. Do not edit.
|
|
564
647
|
*/
|
|
565
648
|
|
|
566
|
-
export { ConfigLoaderService, ConfigService, ConfigTestingService, ProvideConfig, RXAP_CONFIG, dnsLookup, dnsResolver, fetchCidContent, fetchCidContentAsJson, fetchCidContentViaHttp, fetchContentViaHttp, raceSuccess };
|
|
649
|
+
export { ConfigLoaderService, ConfigLoadingStrategy, ConfigService, ConfigTestingService, ProvideConfig, RXAP_CONFIG, dnsLookup, dnsResolver, fetchCidContent, fetchCidContentAsJson, fetchCidContentViaHttp, fetchContentViaHttp, raceSuccess };
|
|
567
650
|
//# sourceMappingURL=rxap-config.mjs.map
|