@rxap/config 18.1.0-dev.0 → 18.1.1-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/compodoc/changelog.html +511 -0
- package/compodoc/dependencies.html +201 -0
- package/compodoc/fonts/ionicons.eot +0 -0
- package/compodoc/fonts/ionicons.svg +2090 -0
- package/compodoc/fonts/ionicons.ttf +0 -0
- package/compodoc/fonts/ionicons.woff +0 -0
- package/compodoc/fonts/ionicons.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.svg +314 -0
- package/compodoc/fonts/roboto-v15-latin-300.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-300.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.svg +310 -0
- package/compodoc/fonts/roboto-v15-latin-700.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-700.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.svg +323 -0
- package/compodoc/fonts/roboto-v15-latin-italic.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-italic.woff2 +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.eot +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.svg +308 -0
- package/compodoc/fonts/roboto-v15-latin-regular.ttf +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.woff +0 -0
- package/compodoc/fonts/roboto-v15-latin-regular.woff2 +0 -0
- package/compodoc/graph/dependencies.svg +24 -0
- package/compodoc/images/compodoc-vectorise-inverted.png +0 -0
- package/compodoc/images/compodoc-vectorise-inverted.svg +201 -0
- package/compodoc/images/compodoc-vectorise.png +0 -0
- package/compodoc/images/compodoc-vectorise.svg +201 -0
- package/compodoc/images/favicon.ico +0 -0
- package/compodoc/index.html +193 -0
- package/compodoc/injectables/ConfigLoaderService.html +551 -0
- package/compodoc/injectables/ConfigService.html +1951 -0
- package/compodoc/injectables/ConfigTestingService.html +706 -0
- package/compodoc/interfaces/ConfigLoadOptions.html +802 -0
- package/compodoc/js/compodoc.js +14 -0
- package/compodoc/js/lazy-load-graphs.js +44 -0
- package/compodoc/js/libs/EventDispatcher.js +5 -0
- package/compodoc/js/libs/bootstrap-native.js +2 -0
- package/compodoc/js/libs/clipboard.min.js +7 -0
- package/compodoc/js/libs/custom-elements-es5-adapter.js +15 -0
- package/compodoc/js/libs/custom-elements.min.js +38 -0
- package/compodoc/js/libs/d3.v3.min.js +2 -0
- package/compodoc/js/libs/deep-iterator.js +2 -0
- package/compodoc/js/libs/es6-shim.min.js +12 -0
- package/compodoc/js/libs/htmlparser.js +23 -0
- package/compodoc/js/libs/innersvg.js +9 -0
- package/compodoc/js/libs/lit-html.js +1 -0
- package/compodoc/js/libs/prism.js +46 -0
- package/compodoc/js/libs/promise.min.js +6 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -0
- package/compodoc/js/libs/tablesort.min.js +6 -0
- package/compodoc/js/libs/tablesort.number.min.js +6 -0
- package/compodoc/js/libs/vis.min.js +47 -0
- package/compodoc/js/libs/zepto.min.js +2 -0
- package/compodoc/js/menu-wc.js +120 -0
- package/compodoc/js/menu-wc_es5.js +40 -0
- package/compodoc/js/menu.js +270 -0
- package/compodoc/js/routes.js +301 -0
- package/compodoc/js/search/lunr.min.js +6 -0
- package/compodoc/js/search/search-lunr.js +67 -0
- package/compodoc/js/search/search.js +283 -0
- package/compodoc/js/search/search_index.js +4 -0
- package/compodoc/js/sourceCode.js +58 -0
- package/compodoc/js/svg-pan-zoom.controls.js +53 -0
- package/compodoc/js/tabs.js +21 -0
- package/compodoc/js/tree.js +147 -0
- package/compodoc/license.html +731 -0
- package/compodoc/miscellaneous/functions.html +258 -0
- package/compodoc/miscellaneous/typealiases.html +313 -0
- package/compodoc/miscellaneous/variables.html +221 -0
- package/compodoc/modules.html +183 -0
- package/compodoc/overview.html +201 -0
- package/compodoc/properties.html +197 -0
- package/compodoc/styles/bootstrap-card.css +219 -0
- package/compodoc/styles/bootstrap.min.css +6 -0
- package/compodoc/styles/compodoc.css +1124 -0
- package/compodoc/styles/dark.css +121 -0
- package/compodoc/styles/ionicons.min.css +11 -0
- package/compodoc/styles/laravel.css +113 -0
- package/compodoc/styles/material.css +131 -0
- package/compodoc/styles/original.css +51 -0
- package/compodoc/styles/postmark.css +238 -0
- package/compodoc/styles/prism.css +301 -0
- package/compodoc/styles/readthedocs.css +117 -0
- package/compodoc/styles/reset.css +129 -0
- package/compodoc/styles/stripe.css +106 -0
- package/compodoc/styles/style.css +7 -0
- package/compodoc/styles/tablesort.css +33 -0
- package/compodoc/styles/vagrant.css +130 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +43 -0
- package/docs/assets/icons.js +15 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1412 -0
- package/docs/classes/ConfigLoaderService.html +6 -0
- package/docs/classes/ConfigService.html +28 -0
- package/docs/classes/ConfigTestingService.html +8 -0
- package/docs/documentation.json +3854 -0
- package/docs/functions/ProvideConfig.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +19 -0
- package/docs/interfaces/ConfigLoadOptions.html +7 -0
- package/docs/modules.html +12 -0
- package/docs/types/AnySchema.html +1 -0
- package/docs/types/Join.html +1 -0
- package/docs/types/Leaves.html +1 -0
- package/docs/types/NoInferType.html +1 -0
- package/docs/types/Paths.html +1 -0
- package/docs/variables/RXAP_CONFIG.html +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,802 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html class="no-js" lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
|
6
|
+
<title>angular-config</title>
|
|
7
|
+
<meta name="description" content="">
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
9
|
+
|
|
10
|
+
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
|
11
|
+
<link rel="stylesheet" href="../styles/style.css">
|
|
12
|
+
<link rel="stylesheet" href="../styles/dark.css">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<script>
|
|
16
|
+
// Blocking script to avoid flickering dark mode
|
|
17
|
+
// Dark mode toggle button
|
|
18
|
+
var useDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
19
|
+
var darkModeState = useDark.matches;
|
|
20
|
+
var $darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
21
|
+
var $darkModeToggles = document.querySelectorAll('.dark-mode-switch');
|
|
22
|
+
var darkModeStateLocal = localStorage.getItem('compodoc_darkmode-state');
|
|
23
|
+
|
|
24
|
+
function checkToggle(check) {
|
|
25
|
+
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
26
|
+
$darkModeToggleSwitchers[i].checked = check;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function toggleDarkMode(state) {
|
|
31
|
+
if (window.localStorage) {
|
|
32
|
+
localStorage.setItem('compodoc_darkmode-state', state);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
checkToggle(state);
|
|
36
|
+
|
|
37
|
+
const hasClass = document.body.classList.contains('dark');
|
|
38
|
+
|
|
39
|
+
if (state) {
|
|
40
|
+
for (var i = 0; i < $darkModeToggles.length; i++) {
|
|
41
|
+
$darkModeToggles[i].classList.add('dark');
|
|
42
|
+
}
|
|
43
|
+
if (!hasClass) {
|
|
44
|
+
document.body.classList.add('dark');
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
for (var i = 0; i < $darkModeToggles.length; i++) {
|
|
48
|
+
$darkModeToggles[i].classList.remove('dark');
|
|
49
|
+
}
|
|
50
|
+
if (hasClass) {
|
|
51
|
+
document.body.classList.remove('dark');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
useDark.addEventListener('change', function (evt) {
|
|
57
|
+
toggleDarkMode(evt.matches);
|
|
58
|
+
});
|
|
59
|
+
if (darkModeStateLocal) {
|
|
60
|
+
darkModeState = darkModeStateLocal === 'true';
|
|
61
|
+
}
|
|
62
|
+
toggleDarkMode(darkModeState);
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
|
+
<div class="d-flex">
|
|
67
|
+
<a href="../" class="navbar-brand">angular-config</a>
|
|
68
|
+
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
+
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div class="container-fluid main">
|
|
77
|
+
<div class="row main">
|
|
78
|
+
<div class="d-none d-md-block menu">
|
|
79
|
+
<compodoc-menu mode="normal"></compodoc-menu>
|
|
80
|
+
</div>
|
|
81
|
+
<!-- START CONTENT -->
|
|
82
|
+
<div class="content interface">
|
|
83
|
+
<div class="content-data">
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<ol class="breadcrumb">
|
|
98
|
+
<li class="breadcrumb-item">Interfaces</li>
|
|
99
|
+
<li class="breadcrumb-item"
|
|
100
|
+
>
|
|
101
|
+
ConfigLoadOptions</li>
|
|
102
|
+
</ol>
|
|
103
|
+
|
|
104
|
+
<ul class="nav nav-tabs" role="tablist">
|
|
105
|
+
<li class="nav-item">
|
|
106
|
+
<a href="#info"
|
|
107
|
+
class="nav-link"
|
|
108
|
+
class="nav-link active"
|
|
109
|
+
role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a>
|
|
110
|
+
</li>
|
|
111
|
+
<li class="nav-item">
|
|
112
|
+
<a href="#source"
|
|
113
|
+
class="nav-link"
|
|
114
|
+
|
|
115
|
+
role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a>
|
|
116
|
+
</li>
|
|
117
|
+
</ul>
|
|
118
|
+
|
|
119
|
+
<div class="tab-content">
|
|
120
|
+
<div class="tab-pane fade active in" id="info">
|
|
121
|
+
<p class="comment">
|
|
122
|
+
<h3>File</h3>
|
|
123
|
+
</p>
|
|
124
|
+
<p class="comment">
|
|
125
|
+
<code>src/lib/config.service.ts</code>
|
|
126
|
+
</p>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
<section data-compodoc="block-index">
|
|
132
|
+
<h3 id="index">Index</h3>
|
|
133
|
+
<table class="table table-sm table-bordered index-table">
|
|
134
|
+
<tbody>
|
|
135
|
+
<tr>
|
|
136
|
+
<td class="col-md-4">
|
|
137
|
+
<h6><b>Properties</b></h6>
|
|
138
|
+
</td>
|
|
139
|
+
</tr>
|
|
140
|
+
<tr>
|
|
141
|
+
<td class="col-md-4">
|
|
142
|
+
<ul class="index-list">
|
|
143
|
+
<li>
|
|
144
|
+
<span class="modifier">Optional</span>
|
|
145
|
+
<a href="#fromLocalStorage"
|
|
146
|
+
>
|
|
147
|
+
fromLocalStorage
|
|
148
|
+
</a>
|
|
149
|
+
</li>
|
|
150
|
+
<li>
|
|
151
|
+
<span class="modifier">Optional</span>
|
|
152
|
+
<a href="#fromUrlParam"
|
|
153
|
+
>
|
|
154
|
+
fromUrlParam
|
|
155
|
+
</a>
|
|
156
|
+
</li>
|
|
157
|
+
<li>
|
|
158
|
+
<span class="modifier">Optional</span>
|
|
159
|
+
<a href="#schema"
|
|
160
|
+
>
|
|
161
|
+
schema
|
|
162
|
+
</a>
|
|
163
|
+
</li>
|
|
164
|
+
<li>
|
|
165
|
+
<span class="modifier">Optional</span>
|
|
166
|
+
<a href="#static"
|
|
167
|
+
>
|
|
168
|
+
static
|
|
169
|
+
</a>
|
|
170
|
+
</li>
|
|
171
|
+
<li>
|
|
172
|
+
<span class="modifier">Optional</span>
|
|
173
|
+
<a href="#url"
|
|
174
|
+
>
|
|
175
|
+
url
|
|
176
|
+
</a>
|
|
177
|
+
</li>
|
|
178
|
+
</ul>
|
|
179
|
+
</td>
|
|
180
|
+
</tr>
|
|
181
|
+
</tbody>
|
|
182
|
+
</table>
|
|
183
|
+
</section>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
<section data-compodoc="block-properties">
|
|
188
|
+
<h3 id="inputs">Properties</h3>
|
|
189
|
+
<table class="table table-sm table-bordered">
|
|
190
|
+
<tbody>
|
|
191
|
+
<tr>
|
|
192
|
+
<td class="col-md-4">
|
|
193
|
+
<a name="fromLocalStorage"></a>
|
|
194
|
+
<span class="name "><b>fromLocalStorage</b>
|
|
195
|
+
<a href="#fromLocalStorage">
|
|
196
|
+
<span class="icon ion-ios-link"></span>
|
|
197
|
+
</a>
|
|
198
|
+
</span>
|
|
199
|
+
</td>
|
|
200
|
+
</tr>
|
|
201
|
+
<tr>
|
|
202
|
+
<td class="col-md-4">
|
|
203
|
+
<code>fromLocalStorage: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
204
|
+
</code>
|
|
205
|
+
</td>
|
|
206
|
+
</tr>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
<tr>
|
|
210
|
+
<td class="col-md-4">
|
|
211
|
+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
212
|
+
|
|
213
|
+
</td>
|
|
214
|
+
</tr>
|
|
215
|
+
|
|
216
|
+
<tr>
|
|
217
|
+
<td class="col-md-4">
|
|
218
|
+
<i>Optional</i>
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
</tbody>
|
|
226
|
+
</table>
|
|
227
|
+
<table class="table table-sm table-bordered">
|
|
228
|
+
<tbody>
|
|
229
|
+
<tr>
|
|
230
|
+
<td class="col-md-4">
|
|
231
|
+
<a name="fromUrlParam"></a>
|
|
232
|
+
<span class="name "><b>fromUrlParam</b>
|
|
233
|
+
<a href="#fromUrlParam">
|
|
234
|
+
<span class="icon ion-ios-link"></span>
|
|
235
|
+
</a>
|
|
236
|
+
</span>
|
|
237
|
+
</td>
|
|
238
|
+
</tr>
|
|
239
|
+
<tr>
|
|
240
|
+
<td class="col-md-4">
|
|
241
|
+
<code>fromUrlParam: <code>string | boolean</code>
|
|
242
|
+
</code>
|
|
243
|
+
</td>
|
|
244
|
+
</tr>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
<tr>
|
|
248
|
+
<td class="col-md-4">
|
|
249
|
+
<i>Type : </i> <code>string | boolean</code>
|
|
250
|
+
|
|
251
|
+
</td>
|
|
252
|
+
</tr>
|
|
253
|
+
|
|
254
|
+
<tr>
|
|
255
|
+
<td class="col-md-4">
|
|
256
|
+
<i>Optional</i>
|
|
257
|
+
</td>
|
|
258
|
+
</tr>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
</tbody>
|
|
264
|
+
</table>
|
|
265
|
+
<table class="table table-sm table-bordered">
|
|
266
|
+
<tbody>
|
|
267
|
+
<tr>
|
|
268
|
+
<td class="col-md-4">
|
|
269
|
+
<a name="schema"></a>
|
|
270
|
+
<span class="name "><b>schema</b>
|
|
271
|
+
<a href="#schema">
|
|
272
|
+
<span class="icon ion-ios-link"></span>
|
|
273
|
+
</a>
|
|
274
|
+
</span>
|
|
275
|
+
</td>
|
|
276
|
+
</tr>
|
|
277
|
+
<tr>
|
|
278
|
+
<td class="col-md-4">
|
|
279
|
+
<code>schema: <code><a href="../miscellaneous/typealiases.html#AnySchema" target="_self" >AnySchema</a></code>
|
|
280
|
+
</code>
|
|
281
|
+
</td>
|
|
282
|
+
</tr>
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
<tr>
|
|
286
|
+
<td class="col-md-4">
|
|
287
|
+
<i>Type : </i> <code><a href="../miscellaneous/typealiases.html#AnySchema" target="_self" >AnySchema</a></code>
|
|
288
|
+
|
|
289
|
+
</td>
|
|
290
|
+
</tr>
|
|
291
|
+
|
|
292
|
+
<tr>
|
|
293
|
+
<td class="col-md-4">
|
|
294
|
+
<i>Optional</i>
|
|
295
|
+
</td>
|
|
296
|
+
</tr>
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
</tbody>
|
|
302
|
+
</table>
|
|
303
|
+
<table class="table table-sm table-bordered">
|
|
304
|
+
<tbody>
|
|
305
|
+
<tr>
|
|
306
|
+
<td class="col-md-4">
|
|
307
|
+
<a name="static"></a>
|
|
308
|
+
<span class="name "><b>static</b>
|
|
309
|
+
<a href="#static">
|
|
310
|
+
<span class="icon ion-ios-link"></span>
|
|
311
|
+
</a>
|
|
312
|
+
</span>
|
|
313
|
+
</td>
|
|
314
|
+
</tr>
|
|
315
|
+
<tr>
|
|
316
|
+
<td class="col-md-4">
|
|
317
|
+
<code>static: <code>Record<string | any></code>
|
|
318
|
+
</code>
|
|
319
|
+
</td>
|
|
320
|
+
</tr>
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
<tr>
|
|
324
|
+
<td class="col-md-4">
|
|
325
|
+
<i>Type : </i> <code>Record<string | any></code>
|
|
326
|
+
|
|
327
|
+
</td>
|
|
328
|
+
</tr>
|
|
329
|
+
|
|
330
|
+
<tr>
|
|
331
|
+
<td class="col-md-4">
|
|
332
|
+
<i>Optional</i>
|
|
333
|
+
</td>
|
|
334
|
+
</tr>
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
<tr>
|
|
340
|
+
<td class="col-md-4">
|
|
341
|
+
<div class="io-description"><p>static config values</p>
|
|
342
|
+
</div>
|
|
343
|
+
</td>
|
|
344
|
+
</tr>
|
|
345
|
+
</tbody>
|
|
346
|
+
</table>
|
|
347
|
+
<table class="table table-sm table-bordered">
|
|
348
|
+
<tbody>
|
|
349
|
+
<tr>
|
|
350
|
+
<td class="col-md-4">
|
|
351
|
+
<a name="url"></a>
|
|
352
|
+
<span class="name "><b>url</b>
|
|
353
|
+
<a href="#url">
|
|
354
|
+
<span class="icon ion-ios-link"></span>
|
|
355
|
+
</a>
|
|
356
|
+
</span>
|
|
357
|
+
</td>
|
|
358
|
+
</tr>
|
|
359
|
+
<tr>
|
|
360
|
+
<td class="col-md-4">
|
|
361
|
+
<code>url: <code>string | string[] | </code>
|
|
362
|
+
</code>
|
|
363
|
+
</td>
|
|
364
|
+
</tr>
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
<tr>
|
|
368
|
+
<td class="col-md-4">
|
|
369
|
+
<i>Type : </i> <code>string | string[] | </code>
|
|
370
|
+
|
|
371
|
+
</td>
|
|
372
|
+
</tr>
|
|
373
|
+
|
|
374
|
+
<tr>
|
|
375
|
+
<td class="col-md-4">
|
|
376
|
+
<i>Optional</i>
|
|
377
|
+
</td>
|
|
378
|
+
</tr>
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
</tbody>
|
|
384
|
+
</table>
|
|
385
|
+
</section>
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
<div class="tab-pane fade tab-source-code" id="source">
|
|
390
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
391
|
+
Inject,
|
|
392
|
+
Injectable,
|
|
393
|
+
Optional,
|
|
394
|
+
} from '@angular/core';
|
|
395
|
+
import { Environment } from '@rxap/environment';
|
|
396
|
+
import {
|
|
397
|
+
coerceArray,
|
|
398
|
+
deepMerge,
|
|
399
|
+
SetObjectValue,
|
|
400
|
+
} from '@rxap/utilities';
|
|
401
|
+
import { RXAP_CONFIG } from './tokens';
|
|
402
|
+
import { NoInferType } from './types';
|
|
403
|
+
|
|
404
|
+
export type AnySchema = { validateAsync: (...args: any[]) => any };
|
|
405
|
+
|
|
406
|
+
export interface ConfigLoadOptions {
|
|
407
|
+
fromUrlParam?: string | boolean;
|
|
408
|
+
fromLocalStorage?: boolean;
|
|
409
|
+
schema?: AnySchema;
|
|
410
|
+
url?: string | string[] | ((environment: Environment) => string | string[]);
|
|
411
|
+
/**
|
|
412
|
+
* static config values
|
|
413
|
+
*/
|
|
414
|
+
static?: Record<string, any>;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
@Injectable({
|
|
418
|
+
providedIn: 'root',
|
|
419
|
+
})
|
|
420
|
+
export class ConfigService<Config extends Record<string, any> = Record<string, any>> {
|
|
421
|
+
|
|
422
|
+
public static Config: any = null;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Static default values for the config object.
|
|
426
|
+
* Will be overwritten by an dynamic config file specified in
|
|
427
|
+
* the Urls array.
|
|
428
|
+
*/
|
|
429
|
+
public static Defaults: any = {};
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Any value definition in the Overwrites object will overwrite any
|
|
433
|
+
* value form the Defaults values or dynamic config files
|
|
434
|
+
*/
|
|
435
|
+
public static Overwrites: any = {};
|
|
436
|
+
|
|
437
|
+
public static LocalStorageKey = 'rxap/config/local-config';
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* @deprecated instead use the url property of the ConfigLoadOptions
|
|
441
|
+
*/
|
|
442
|
+
public static Urls = [];
|
|
443
|
+
public readonly config!: Config;
|
|
444
|
+
|
|
445
|
+
constructor(@Optional() @Inject(RXAP_CONFIG) config: any | null = null) {
|
|
446
|
+
this.config = ConfigService.Config;
|
|
447
|
+
if (config) {
|
|
448
|
+
this.config = deepMerge(this.config ?? {}, config);
|
|
449
|
+
}
|
|
450
|
+
if (!this.config) {
|
|
451
|
+
throw new Error('config not available');
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Used to load the app config from a remote resource.
|
|
457
|
+
*
|
|
458
|
+
* Promise.all([ ConfigService.Load() ])
|
|
459
|
+
* .then(() => platformBrowserDynamic().bootstrapModule(AppModule))
|
|
460
|
+
* .catch(err => console.error(err))
|
|
461
|
+
*
|
|
462
|
+
*/
|
|
463
|
+
public static async Load(options?: ConfigLoadOptions, environment?: Environment): Promise<void> {
|
|
464
|
+
options ??= {};
|
|
465
|
+
|
|
466
|
+
let config: any = deepMerge(this.Defaults, {});
|
|
467
|
+
|
|
468
|
+
if (environment?.config) {
|
|
469
|
+
if (typeof environment.config === 'string') {
|
|
470
|
+
options.url = environment.config;
|
|
471
|
+
} else {
|
|
472
|
+
options.static = environment.config.static;
|
|
473
|
+
options.url = environment.config.url;
|
|
474
|
+
options.fromUrlParam = environment.config.fromUrlParam;
|
|
475
|
+
options.fromLocalStorage = environment.config.fromLocalStorage;
|
|
476
|
+
options.schema = environment.config.schema;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
config = deepMerge(config, options?.static ?? {});
|
|
481
|
+
|
|
482
|
+
const urls = (options?.url ? coerceArray(options.url) : ConfigService.Urls).map(url => {
|
|
483
|
+
if (typeof url === 'function') {
|
|
484
|
+
if (!environment) {
|
|
485
|
+
throw new Error('environment is required when url is a function');
|
|
486
|
+
}
|
|
487
|
+
return coerceArray(url(environment));
|
|
488
|
+
}
|
|
489
|
+
return coerceArray(url);
|
|
490
|
+
}).flat();
|
|
491
|
+
|
|
492
|
+
for (const url of urls) {
|
|
493
|
+
config = deepMerge(config, await this.loadConfig(url, true, options?.schema));
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
config = deepMerge(config, this.Overwrites);
|
|
497
|
+
|
|
498
|
+
if (options?.fromLocalStorage !== false) {
|
|
499
|
+
|
|
500
|
+
const localConfig = localStorage.getItem(ConfigService.LocalStorageKey);
|
|
501
|
+
|
|
502
|
+
if (localConfig) {
|
|
503
|
+
try {
|
|
504
|
+
config = deepMerge(config, JSON.parse(localConfig));
|
|
505
|
+
} catch (e: any) {
|
|
506
|
+
console.error('local config could not be parsed');
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
if (options?.fromUrlParam) {
|
|
513
|
+
const param = typeof options.fromUrlParam === 'string' ? options.fromUrlParam : 'config';
|
|
514
|
+
config = deepMerge(config, this.LoadConfigDefaultFromUrlParam(param));
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
console.debug('app config', config);
|
|
518
|
+
|
|
519
|
+
this.Config = config;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
private static async loadConfig<T = any>(url: string, required?: boolean, schema?: AnySchema): Promise<T | null> {
|
|
523
|
+
|
|
524
|
+
let config: any;
|
|
525
|
+
let response: any;
|
|
526
|
+
|
|
527
|
+
try {
|
|
528
|
+
response = await fetch(url);
|
|
529
|
+
} catch (error: any) {
|
|
530
|
+
const message = `Could not fetch config from '${ url }': ${ error.message }`;
|
|
531
|
+
if (required) {
|
|
532
|
+
this.showError(message);
|
|
533
|
+
throw new Error(message);
|
|
534
|
+
} else {
|
|
535
|
+
console.warn(message);
|
|
536
|
+
return null;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
if (!response.ok) {
|
|
541
|
+
let message = `Config request results in non ok response for '${ url }': (${ response.status }) ${ response.statusText }`;
|
|
542
|
+
switch (response.status) {
|
|
543
|
+
case 404:
|
|
544
|
+
message = `Config not found at '${ url }'`;
|
|
545
|
+
break;
|
|
546
|
+
case 405:
|
|
547
|
+
message = `Config service is not started yet. Wait 30s and try again.`;
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
if (required) {
|
|
551
|
+
this.showError(message);
|
|
552
|
+
throw new Error(message);
|
|
553
|
+
} else {
|
|
554
|
+
console.warn(message);
|
|
555
|
+
return null;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
try {
|
|
560
|
+
config = await response.json();
|
|
561
|
+
} catch (error: any) {
|
|
562
|
+
const message = `Could not parse config from '${ url }' to a json object: ${ error.message }`;
|
|
563
|
+
if (required) {
|
|
564
|
+
this.showError(message);
|
|
565
|
+
throw new Error(message);
|
|
566
|
+
} else {
|
|
567
|
+
console.warn(message);
|
|
568
|
+
return null;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if (schema) {
|
|
573
|
+
try {
|
|
574
|
+
config = await schema.validateAsync(config);
|
|
575
|
+
} catch (error: any) {
|
|
576
|
+
const message = `Config from '${ url }' is not valid: ${ error.message }`;
|
|
577
|
+
if (required) {
|
|
578
|
+
this.showError(message);
|
|
579
|
+
throw new Error(message);
|
|
580
|
+
} else {
|
|
581
|
+
console.warn(message);
|
|
582
|
+
return null;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
return config;
|
|
588
|
+
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
private static LoadConfigDefaultFromUrlParam(param = 'config') {
|
|
592
|
+
|
|
593
|
+
const queryString = window.location.search;
|
|
594
|
+
const urlParams = new URLSearchParams(queryString);
|
|
595
|
+
|
|
596
|
+
const configFromParams = {};
|
|
597
|
+
|
|
598
|
+
for (const configParam of urlParams.getAll('config')) {
|
|
599
|
+
|
|
600
|
+
try {
|
|
601
|
+
const split = configParam.split(';');
|
|
602
|
+
if (split.length === 2) {
|
|
603
|
+
const keyPath = split[0];
|
|
604
|
+
const value = split[1];
|
|
605
|
+
SetObjectValue(configFromParams, keyPath, value);
|
|
606
|
+
}
|
|
607
|
+
} catch (e: any) {
|
|
608
|
+
console.warn(`Parsing of url config param failed for '${ configParam }': ${ e.message }`);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
return configFromParams;
|
|
614
|
+
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
public static async SideLoad(
|
|
618
|
+
url: string,
|
|
619
|
+
propertyPath: string,
|
|
620
|
+
required?: boolean,
|
|
621
|
+
schema?: AnySchema,
|
|
622
|
+
): Promise<void> {
|
|
623
|
+
|
|
624
|
+
if (!this.Config) {
|
|
625
|
+
throw new Error('Config side load is only possible after the initial config load.');
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
const config = await this.loadConfig(url, required, schema);
|
|
629
|
+
|
|
630
|
+
SetObjectValue(this.Config, propertyPath, config);
|
|
631
|
+
|
|
632
|
+
console.debug(`Side loaded config for '${ propertyPath }' successful`, this.Config);
|
|
633
|
+
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
public static Get<T = any, K extends Record<string, any> = Record<string, any>>(
|
|
637
|
+
path: string,
|
|
638
|
+
defaultValue: T | undefined,
|
|
639
|
+
config: Record<string, any>,
|
|
640
|
+
): T
|
|
641
|
+
|
|
642
|
+
public static Get<T = any, K extends Record<string, any> = Record<string, any>>(
|
|
643
|
+
path: string,
|
|
644
|
+
defaultValue: NoInferType<T>,
|
|
645
|
+
config: Record<string, any> = this.Config,
|
|
646
|
+
): T {
|
|
647
|
+
if (!config) {
|
|
648
|
+
throw new Error('config not loaded');
|
|
649
|
+
}
|
|
650
|
+
let configValue: any = config;
|
|
651
|
+
if (typeof path !== 'string') {
|
|
652
|
+
throw new Error('The config property path is not a string');
|
|
653
|
+
}
|
|
654
|
+
for (const fragment of (path as any).split('.')) {
|
|
655
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
656
|
+
if (configValue.hasOwnProperty(fragment)) {
|
|
657
|
+
configValue = configValue[fragment];
|
|
658
|
+
} else {
|
|
659
|
+
if (defaultValue !== undefined) {
|
|
660
|
+
return defaultValue;
|
|
661
|
+
}
|
|
662
|
+
console.warn(`Config with path '${ path }' not found`);
|
|
663
|
+
return undefined as any;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
return configValue;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
private static showError(message: string) {
|
|
670
|
+
const hasUl = document.getElementById('rxap-config-error') !== null;
|
|
671
|
+
const ul = document.getElementById('rxap-config-error') ?? document.createElement('ul');
|
|
672
|
+
ul.id = 'rxap-config-error';
|
|
673
|
+
ul.style.position = 'fixed';
|
|
674
|
+
ul.style.bottom = '16px';
|
|
675
|
+
ul.style.right = '16px';
|
|
676
|
+
ul.style.backgroundColor = 'white';
|
|
677
|
+
ul.style.padding = '32px';
|
|
678
|
+
ul.style.zIndex = '99999999';
|
|
679
|
+
ul.style.color = 'black';
|
|
680
|
+
const messageLi = document.createElement('li');
|
|
681
|
+
messageLi.innerText = message;
|
|
682
|
+
ul.appendChild(messageLi);
|
|
683
|
+
const refreshHintLi = document.createElement('li');
|
|
684
|
+
refreshHintLi.innerText = 'Please refresh the page to try again.';
|
|
685
|
+
ul.appendChild(refreshHintLi);
|
|
686
|
+
const autoRefreshHintLi = document.createElement('li');
|
|
687
|
+
autoRefreshHintLi.innerText = 'The page will refresh automatically in 30 seconds.';
|
|
688
|
+
ul.appendChild(autoRefreshHintLi);
|
|
689
|
+
if (!hasUl) {
|
|
690
|
+
document.body.appendChild(ul);
|
|
691
|
+
}
|
|
692
|
+
setTimeout(() => location.reload(), 30000);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
public setLocalConfig(config: Config): void {
|
|
696
|
+
localStorage.setItem(ConfigService.LocalStorageKey, JSON.stringify(config));
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
public clearLocalConfig(): void {
|
|
700
|
+
localStorage.removeItem(ConfigService.LocalStorageKey);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
public get<T = any>(propertyPath: string): T | undefined;
|
|
704
|
+
public get<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;
|
|
705
|
+
public get<T = any>(propertyPath: string, defaultValue?: T): T | undefined {
|
|
706
|
+
return ConfigService.Get(propertyPath, defaultValue, this.config);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
public getOrThrow<T = any>(propertyPath: string): T;
|
|
710
|
+
public getOrThrow<T = any>(propertyPath: string, defaultValue: NoInferType<T>): T;
|
|
711
|
+
public getOrThrow<T = any>(propertyPath: string, defaultValue?: T): T {
|
|
712
|
+
const value = ConfigService.Get(propertyPath, defaultValue, this.config);
|
|
713
|
+
if (value === undefined) {
|
|
714
|
+
throw new Error(`Could not find config in path '${ propertyPath }'`);
|
|
715
|
+
}
|
|
716
|
+
return value;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
}
|
|
720
|
+
</code></pre>
|
|
721
|
+
</div>
|
|
722
|
+
</div>
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
</div><div class="search-results">
|
|
732
|
+
<div class="has-results">
|
|
733
|
+
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
|
734
|
+
<ul class="search-results-list"></ul>
|
|
735
|
+
</div>
|
|
736
|
+
<div class="no-results">
|
|
737
|
+
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
738
|
+
</div>
|
|
739
|
+
</div>
|
|
740
|
+
</div>
|
|
741
|
+
<!-- END CONTENT -->
|
|
742
|
+
</div>
|
|
743
|
+
</div>
|
|
744
|
+
|
|
745
|
+
<label class="dark-mode-switch">
|
|
746
|
+
<input type="checkbox">
|
|
747
|
+
<span class="slider">
|
|
748
|
+
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
|
749
|
+
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
|
750
|
+
</svg>
|
|
751
|
+
</span>
|
|
752
|
+
</label>
|
|
753
|
+
|
|
754
|
+
<script>
|
|
755
|
+
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
|
756
|
+
var COMPODOC_CURRENT_PAGE_CONTEXT = 'interface';
|
|
757
|
+
var COMPODOC_CURRENT_PAGE_URL = 'ConfigLoadOptions.html';
|
|
758
|
+
var MAX_SEARCH_RESULTS = 15;
|
|
759
|
+
</script>
|
|
760
|
+
|
|
761
|
+
<script>
|
|
762
|
+
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
763
|
+
checkToggle(darkModeState);
|
|
764
|
+
if ($darkModeToggleSwitchers.length > 0) {
|
|
765
|
+
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
766
|
+
$darkModeToggleSwitchers[i].addEventListener('change', function (event) {
|
|
767
|
+
darkModeState = !darkModeState;
|
|
768
|
+
toggleDarkMode(darkModeState);
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
</script>
|
|
773
|
+
|
|
774
|
+
<script src="../js/libs/custom-elements.min.js"></script>
|
|
775
|
+
<script src="../js/libs/lit-html.js"></script>
|
|
776
|
+
|
|
777
|
+
<script src="../js/menu-wc.js" defer></script>
|
|
778
|
+
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
779
|
+
|
|
780
|
+
<script src="../js/libs/bootstrap-native.js"></script>
|
|
781
|
+
|
|
782
|
+
<script src="../js/libs/es6-shim.min.js"></script>
|
|
783
|
+
<script src="../js/libs/EventDispatcher.js"></script>
|
|
784
|
+
<script src="../js/libs/promise.min.js"></script>
|
|
785
|
+
<script src="../js/libs/zepto.min.js"></script>
|
|
786
|
+
|
|
787
|
+
<script src="../js/compodoc.js"></script>
|
|
788
|
+
|
|
789
|
+
<script src="../js/tabs.js"></script>
|
|
790
|
+
<script src="../js/menu.js"></script>
|
|
791
|
+
<script src="../js/libs/clipboard.min.js"></script>
|
|
792
|
+
<script src="../js/libs/prism.js"></script>
|
|
793
|
+
<script src="../js/sourceCode.js"></script>
|
|
794
|
+
<script src="../js/search/search.js"></script>
|
|
795
|
+
<script src="../js/search/lunr.min.js"></script>
|
|
796
|
+
<script src="../js/search/search-lunr.js"></script>
|
|
797
|
+
<script src="../js/search/search_index.js"></script>
|
|
798
|
+
<script src="../js/lazy-load-graphs.js"></script>
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
</body>
|
|
802
|
+
</html>
|