pmcf 3.20.0 → 3.20.2

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 (35) hide show
  1. package/README.md +33 -10
  2. package/package.json +2 -2
  3. package/src/services/systemd-journal-upload.mjs +12 -4
  4. package/src/services/systemd-journal.mjs +11 -1
  5. package/src/services/systemd-resolved.mjs +34 -6
  6. package/types/base.d.mts +2 -1
  7. package/types/cluster.d.mts +36 -18
  8. package/types/extra-source-service.d.mts +80 -40
  9. package/types/host.d.mts +16 -8
  10. package/types/location.d.mts +28 -14
  11. package/types/network-interfaces/ethernet.d.mts +96 -48
  12. package/types/network-interfaces/loopback.d.mts +92 -46
  13. package/types/network-interfaces/network-interface.d.mts +92 -46
  14. package/types/network-interfaces/tun.d.mts +92 -46
  15. package/types/network-interfaces/wireguard.d.mts +92 -46
  16. package/types/network-interfaces/wlan.d.mts +142 -71
  17. package/types/network-support.d.mts +16 -8
  18. package/types/network.d.mts +56 -28
  19. package/types/owner.d.mts +14 -7
  20. package/types/service.d.mts +46 -23
  21. package/types/services/bind.d.mts +114 -57
  22. package/types/services/chrony.d.mts +100 -50
  23. package/types/services/headscale.d.mts +60 -30
  24. package/types/services/influxdb.d.mts +62 -31
  25. package/types/services/kea.d.mts +70 -35
  26. package/types/services/mosquitto.d.mts +64 -32
  27. package/types/services/openldap.d.mts +60 -30
  28. package/types/services/systemd-journal-remote.d.mts +80 -40
  29. package/types/services/systemd-journal-upload.d.mts +70 -35
  30. package/types/services/systemd-journal.d.mts +106 -53
  31. package/types/services/systemd-resolved.d.mts +117 -60
  32. package/types/services/systemd-timesyncd.d.mts +100 -50
  33. package/types/services/tailscale.d.mts +60 -30
  34. package/types/subnet.d.mts +2 -1
  35. package/types/utils.d.mts +1 -1
package/README.md CHANGED
@@ -42,7 +42,7 @@ generates config packages for:
42
42
 
43
43
  * [Base](#base)
44
44
  * [Parameters](#parameters)
45
- * [extends](#extends)
45
+ * [priority](#priority)
46
46
  * [expression](#expression)
47
47
  * [Parameters](#parameters-1)
48
48
  * [findService](#findservice)
@@ -76,29 +76,34 @@ generates config packages for:
76
76
  * [Parameters](#parameters-10)
77
77
  * [cidrAddresses](#cidraddresses)
78
78
  * [Parameters](#parameters-11)
79
- * [serviceEndpoints](#serviceendpoints)
79
+ * [isTemplate](#istemplate)
80
+ * [services](#services)
80
81
  * [Parameters](#parameters-12)
81
- * [domainName](#domainname)
82
+ * [named](#named)
82
83
  * [Parameters](#parameters-13)
83
- * [domainFromDominName](#domainfromdominname)
84
+ * [serviceEndpoints](#serviceendpoints)
84
85
  * [Parameters](#parameters-14)
85
- * [sectionLines](#sectionlines)
86
+ * [domainName](#domainname)
86
87
  * [Parameters](#parameters-15)
87
- * [asArray](#asarray)
88
+ * [domainFromDominName](#domainfromdominname)
88
89
  * [Parameters](#parameters-16)
89
- * [asIterator](#asiterator)
90
+ * [sectionLines](#sectionlines)
90
91
  * [Parameters](#parameters-17)
92
+ * [asArray](#asarray)
93
+ * [Parameters](#parameters-18)
94
+ * [asIterator](#asiterator)
95
+ * [Parameters](#parameters-19)
91
96
 
92
97
  ## Base
93
98
 
94
99
  ### Parameters
95
100
 
96
101
  * `owner` **[Base](#base)** 
97
- * `data` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
102
+ * `data` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
98
103
 
99
- ### extends
104
+ ### priority
100
105
 
101
- Returns **Iterable<[Base](#base)>**&#x20;
106
+ Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**&#x20;
102
107
 
103
108
  ### expression
104
109
 
@@ -247,6 +252,24 @@ Returns **Iterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Re
247
252
 
248
253
  Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**&#x20;
249
254
 
255
+ ## isTemplate
256
+
257
+ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
258
+
259
+ ## services
260
+
261
+ ### Parameters
262
+
263
+ * `service` **Service**&#x20;
264
+
265
+ ## named
266
+
267
+ ### Parameters
268
+
269
+ * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
270
+
271
+ Returns **(Service | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))**&#x20;
272
+
250
273
  ## serviceEndpoints
251
274
 
252
275
  ### Parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "3.20.0",
3
+ "version": "3.20.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "ip-utilties": "^2.0.2",
57
57
  "npm-pkgbuild": "^19.1.3",
58
- "pacc": "^6.8.1",
58
+ "pacc": "^7.0.0",
59
59
  "package-directory": "^8.1.0"
60
60
  },
61
61
  "devDependencies": {
@@ -71,10 +71,18 @@ export class SystemdJournalUploadService extends Service {
71
71
  configFileName: `etc/systemd/journal-upload.conf.d/${name}.conf`,
72
72
  content: [
73
73
  "Upload",
74
- getAttributesJSON(
75
- this,
76
- SystemdJournalUploadServiceTypeDefinition.attributes
77
- )
74
+ {
75
+ ...getAttributesJSON(
76
+ this,
77
+ SystemdJournalUploadServiceTypeDefinition.attributes
78
+ ),
79
+ // TODO extendet properties with getAttribute()
80
+ ...Object.fromEntries(
81
+ Object.entries(SystemdJournalUploadServiceTypeDefinition.attributes)
82
+ .map(([k, v]) => [k, this.extendedProperty(k)])
83
+ .filter(([k, v]) => v !== undefined)
84
+ )
85
+ }
78
86
  ]
79
87
  };
80
88
  }
@@ -108,7 +108,17 @@ export class SystemdJournalService extends Service {
108
108
  configFileName: `etc/systemd/journal.conf.d/${name}.conf`,
109
109
  content: [
110
110
  "Journal",
111
- getAttributesJSON(this, SystemdJournalServiceTypeDefinition.attributes)
111
+ {
112
+ ...getAttributesJSON(
113
+ this,
114
+ SystemdJournalServiceTypeDefinition.attributes
115
+ ),
116
+ ...Object.fromEntries(
117
+ Object.entries(SystemdJournalServiceTypeDefinition.attributes)
118
+ .map(([k, v]) => [k, this.extendedProperty(k)])
119
+ .filter(([k, v]) => v !== undefined)
120
+ )
121
+ }
112
122
  ]
113
123
  };
114
124
  }
@@ -1,9 +1,15 @@
1
- import { addType, boolean_attribute_writable } from "pacc";
1
+ import {
2
+ addType,
3
+ duration_attribute_writable,
4
+ string_attribute_writable,
5
+ boolean_attribute_writable,
6
+ yesno_attribute_writable
7
+ } from "pacc";
2
8
  import {
3
9
  ExtraSourceService,
4
10
  ExtraSourceServiceTypeDefinition,
5
11
  ServiceTypeDefinition,
6
- serviceEndpoints,
12
+ serviceEndpoints
7
13
  } from "pmcf";
8
14
  import { yesno } from "../utils.mjs";
9
15
 
@@ -14,8 +20,21 @@ const SystemdResolvedServiceTypeDefinition = {
14
20
  owners: ServiceTypeDefinition.owners,
15
21
  key: "name",
16
22
  attributes: {
17
- dnssec: boolean_attribute_writable,
18
- llmnr: boolean_attribute_writable
23
+ DNS: string_attribute_writable,
24
+ FallbackDNS: string_attribute_writable,
25
+ Domains: string_attribute_writable,
26
+ MulticastDNS: boolean_attribute_writable,
27
+ Cache: boolean_attribute_writable,
28
+ CacheFromLocalhost: boolean_attribute_writable,
29
+ DNSStubListener: boolean_attribute_writable,
30
+ DNSStubListenerExtra: string_attribute_writable,
31
+ ReadEtcHosts: boolean_attribute_writable,
32
+ ResolveUnicastSingleLabel: boolean_attribute_writable,
33
+ StaleRetentionSec: duration_attribute_writable,
34
+ RefuseRecordTypes: string_attribute_writable,
35
+ DNSSEC: yesno_attribute_writable,
36
+ DNSOverTLS: yesno_attribute_writable,
37
+ LLMNR: yesno_attribute_writable
19
38
  }
20
39
  };
21
40
 
@@ -59,9 +78,18 @@ export class SystemdResolvedService extends ExtraSourceService {
59
78
  DNS: serviceEndpoints(this, options(300, 399, 4)),
60
79
  FallbackDNS: serviceEndpoints(this, options(100, 199, 4)),
61
80
  Domains: [...this.localDomains].join(" "),
62
- DNSSEC: yesno(this.dnssec),
63
81
  MulticastDNS: yesno(this.network.multicastDNS),
64
- LLMNR: yesno(this.llmnr)
82
+
83
+ DNSSEC: yesno(this.DNSSEC),
84
+
85
+ // TODO extendet properties with getAttribute()
86
+ ...Object.fromEntries(
87
+ Object.entries(SystemdResolvedServiceTypeDefinition.attributes)
88
+ .map(([k, v]) => [k, this.extendedProperty(k)])
89
+ .filter(([k, v]) => v !== undefined)
90
+ ),
91
+ LLMNR: yesno(this.LLMNR),
92
+
65
93
  }
66
94
  ]
67
95
  };
package/types/base.d.mts CHANGED
@@ -20,7 +20,8 @@ export class Base {
20
20
  default?: any;
21
21
  set?: Function;
22
22
  get?: Function;
23
- prepareValue?: Function;
23
+ toInternal?: Function;
24
+ toExternal?: Function;
24
25
  values?: Set<any>;
25
26
  externalName?: string;
26
27
  env?: string[] | string;
@@ -21,7 +21,8 @@ export class Cluster extends Host {
21
21
  default?: any;
22
22
  set?: Function;
23
23
  get?: Function;
24
- prepareValue?: Function;
24
+ toInternal?: Function;
25
+ toExternal?: Function;
25
26
  values?: Set<any>;
26
27
  externalName?: string;
27
28
  env?: string[] | string;
@@ -41,7 +42,8 @@ export class Cluster extends Host {
41
42
  default?: any;
42
43
  set?: Function;
43
44
  get?: Function;
44
- prepareValue?: Function;
45
+ toInternal?: Function;
46
+ toExternal?: Function;
45
47
  values?: Set<any>;
46
48
  externalName?: string;
47
49
  env?: string[] | string;
@@ -61,7 +63,8 @@ export class Cluster extends Host {
61
63
  default?: any;
62
64
  set?: Function;
63
65
  get?: Function;
64
- prepareValue?: Function;
66
+ toInternal?: Function;
67
+ toExternal?: Function;
65
68
  values?: Set<any>;
66
69
  externalName?: string;
67
70
  env?: string[] | string;
@@ -89,7 +92,8 @@ export class Cluster extends Host {
89
92
  default?: any;
90
93
  set?: Function;
91
94
  get?: Function;
92
- prepareValue?: Function;
95
+ toInternal?: Function;
96
+ toExternal?: Function;
93
97
  values?: Set<any>;
94
98
  externalName?: string;
95
99
  env?: string[] | string;
@@ -111,7 +115,8 @@ export class Cluster extends Host {
111
115
  default?: any;
112
116
  set?: Function;
113
117
  get?: Function;
114
- prepareValue?: Function;
118
+ toInternal?: Function;
119
+ toExternal?: Function;
115
120
  values?: Set<any>;
116
121
  externalName?: string;
117
122
  env?: string[] | string;
@@ -137,7 +142,8 @@ export class Cluster extends Host {
137
142
  default?: any;
138
143
  set?: Function;
139
144
  get?: Function;
140
- prepareValue?: Function;
145
+ toInternal?: Function;
146
+ toExternal?: Function;
141
147
  values?: Set<any>;
142
148
  externalName?: string;
143
149
  env?: string[] | string;
@@ -157,7 +163,8 @@ export class Cluster extends Host {
157
163
  default?: any;
158
164
  set?: Function;
159
165
  get?: Function;
160
- prepareValue?: Function;
166
+ toInternal?: Function;
167
+ toExternal?: Function;
161
168
  values?: Set<any>;
162
169
  externalName?: string;
163
170
  env?: string[] | string;
@@ -185,7 +192,8 @@ export class Cluster extends Host {
185
192
  default?: any;
186
193
  set?: Function;
187
194
  get?: Function;
188
- prepareValue?: Function;
195
+ toInternal?: Function;
196
+ toExternal?: Function;
189
197
  values?: Set<any>;
190
198
  externalName?: string;
191
199
  env?: string[] | string;
@@ -205,7 +213,8 @@ export class Cluster extends Host {
205
213
  default?: any;
206
214
  set?: Function;
207
215
  get?: Function;
208
- prepareValue?: Function;
216
+ toInternal?: Function;
217
+ toExternal?: Function;
209
218
  values?: Set<any>;
210
219
  externalName?: string;
211
220
  env?: string[] | string;
@@ -227,7 +236,8 @@ export class Cluster extends Host {
227
236
  default?: any;
228
237
  set?: Function;
229
238
  get?: Function;
230
- prepareValue?: Function;
239
+ toInternal?: Function;
240
+ toExternal?: Function;
231
241
  externalName?: string;
232
242
  env?: string[] | string;
233
243
  additionalValues?: object;
@@ -249,7 +259,8 @@ export class Cluster extends Host {
249
259
  default?: any;
250
260
  set?: Function;
251
261
  get?: Function;
252
- prepareValue?: Function;
262
+ toInternal?: Function;
263
+ toExternal?: Function;
253
264
  externalName?: string;
254
265
  env?: string[] | string;
255
266
  additionalValues?: object;
@@ -273,7 +284,8 @@ export class Cluster extends Host {
273
284
  default?: any;
274
285
  set?: Function;
275
286
  get?: Function;
276
- prepareValue?: Function;
287
+ toInternal?: Function;
288
+ toExternal?: Function;
277
289
  externalName?: string;
278
290
  env?: string[] | string;
279
291
  additionalValues?: object;
@@ -293,7 +305,8 @@ export class Cluster extends Host {
293
305
  default?: any;
294
306
  set?: Function;
295
307
  get?: Function;
296
- prepareValue?: Function;
308
+ toInternal?: Function;
309
+ toExternal?: Function;
297
310
  externalName?: string;
298
311
  env?: string[] | string;
299
312
  additionalValues?: object;
@@ -315,7 +328,8 @@ export class Cluster extends Host {
315
328
  default?: any;
316
329
  set?: Function;
317
330
  get?: Function;
318
- prepareValue?: Function;
331
+ toInternal?: Function;
332
+ toExternal?: Function;
319
333
  values?: Set<any>;
320
334
  externalName?: string;
321
335
  env?: string[] | string;
@@ -337,7 +351,8 @@ export class Cluster extends Host {
337
351
  default?: any;
338
352
  set?: Function;
339
353
  get?: Function;
340
- prepareValue?: Function;
354
+ toInternal?: Function;
355
+ toExternal?: Function;
341
356
  values?: Set<any>;
342
357
  externalName?: string;
343
358
  env?: string[] | string;
@@ -366,7 +381,8 @@ export class Cluster extends Host {
366
381
  default?: any;
367
382
  set?: Function;
368
383
  get?: Function;
369
- prepareValue?: Function;
384
+ toInternal?: Function;
385
+ toExternal?: Function;
370
386
  values?: Set<any>;
371
387
  externalName?: string;
372
388
  env?: string[] | string;
@@ -386,7 +402,8 @@ export class Cluster extends Host {
386
402
  default?: any;
387
403
  set?: Function;
388
404
  get?: Function;
389
- prepareValue?: Function;
405
+ toInternal?: Function;
406
+ toExternal?: Function;
390
407
  values?: Set<any>;
391
408
  externalName?: string;
392
409
  env?: string[] | string;
@@ -406,7 +423,8 @@ export class Cluster extends Host {
406
423
  default?: any;
407
424
  set?: Function;
408
425
  get?: Function;
409
- prepareValue?: Function;
426
+ toInternal?: Function;
427
+ toExternal?: Function;
410
428
  values?: Set<any>;
411
429
  externalName?: string;
412
430
  env?: string[] | string;