pmcf 3.16.5 → 3.17.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "3.16.5",
3
+ "version": "3.17.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,6 +14,7 @@ import {
14
14
  import { asArray, writeLines, sectionLines } from "../utils.mjs";
15
15
  import { SkeletonNetworkInterface } from "./skeleton.mjs";
16
16
  import { Network } from "../network.mjs";
17
+ import { yesno } from "../utils.mjs";
17
18
 
18
19
  export const NetworkInterfaceTypeDefinition = {
19
20
  name: "network_interface",
@@ -243,7 +244,7 @@ export class NetworkInterface extends SkeletonNetworkInterface {
243
244
  ...networkSectionExtra,
244
245
  DHCP: "no",
245
246
  DHCPServer: "no",
246
- MulticastDNS: this.network.multicastDNS ? "yes" : "no",
247
+ MulticastDNS: yesno(this.network.multicastDNS),
247
248
  LinkLocalAddressing: "ipv6",
248
249
  IPv6LinkLocalAddressGenerationMode: "stable-privacy"
249
250
  }),
package/src/root.mjs CHANGED
@@ -3,18 +3,15 @@ import { join } from "node:path";
3
3
  import { typeFactory, addType, types, resolveTypeLinks } from "pacc";
4
4
  import { Location } from "./location.mjs";
5
5
 
6
- const RootTypeDefinition = {
7
- name: "root",
8
- extends: Location.typeDefinition
9
- };
10
-
11
6
  export class Root extends Location {
12
- static {
13
- addType(this);
14
- }
7
+ static name = "root";
15
8
 
16
9
  static get typeDefinition() {
17
- return RootTypeDefinition;
10
+ return this;
11
+ }
12
+
13
+ static {
14
+ addType(this);
18
15
  }
19
16
 
20
17
  constructor(directory) {
@@ -4,7 +4,6 @@ import { FileContentProvider } from "npm-pkgbuild";
4
4
  import { isLinkLocal, reverseArpa } from "ip-utilties";
5
5
  import {
6
6
  addType,
7
- oneOfType,
8
7
  default_attribute_writable,
9
8
  string_attribute_writable,
10
9
  boolean_attribute_writable_true,
@@ -13,7 +12,7 @@ import {
13
12
  string_collection_attribute_writable,
14
13
  name_attribute_writable
15
14
  } from "pacc";
16
- import { writeLines, asArray } from "../utils.mjs";
15
+ import { yesno, writeLines, asArray } from "../utils.mjs";
17
16
  import {
18
17
  DNSRecord,
19
18
  dnsFullName,
@@ -619,7 +618,7 @@ export class BindService extends ExtraSourceService {
619
618
  : "none"
620
619
  }; };`
621
620
  );
622
- content.push(` notify ${this.notify ? "yes" : "no"};`);
621
+ content.push(` notify ${yesno(this.notify)};`);
623
622
  }
624
623
  content.push(`};`, "");
625
624
 
@@ -42,7 +42,7 @@ export class SystemdJournalRemoteService extends Service {
42
42
  }
43
43
 
44
44
  get systemdServices() {
45
- return SystemdJournalRemoteServiceTypeDefinition.name;
45
+ return this.type;
46
46
  }
47
47
 
48
48
  systemdConfigs(name) {
@@ -27,7 +27,7 @@ export class SystemdJournalUploadService extends Service {
27
27
  }
28
28
 
29
29
  get systemdServices() {
30
- return SystemdJournalUploadServiceTypeDefinition.name;
30
+ return this.type;
31
31
  }
32
32
 
33
33
  systemdConfigs(name) {
@@ -23,7 +23,7 @@ export class SystemdJournalService extends Service {
23
23
  }
24
24
 
25
25
  get systemdServices() {
26
- return SystemdJournalServiceTypeDefinition.name;
26
+ return this.type;
27
27
  }
28
28
 
29
29
  systemdConfigs(name) {
@@ -1,17 +1,21 @@
1
- import { addType } from "pacc";
1
+ import { addType, boolean_attribute_writable } from "pacc";
2
2
  import {
3
3
  ExtraSourceService,
4
4
  ExtraSourceServiceTypeDefinition,
5
5
  ServiceTypeDefinition,
6
6
  serviceEndpoints,
7
7
  } from "pmcf";
8
+ import { yesno } from "../utils.mjs";
8
9
 
9
10
  const SystemdResolvedServiceTypeDefinition = {
10
11
  name: "systemd-resolved",
11
12
  extends: ExtraSourceServiceTypeDefinition,
12
13
  specializationOf: ServiceTypeDefinition,
13
14
  owners: ServiceTypeDefinition.owners,
14
- key: "name"
15
+ key: "name",
16
+ attributes: {
17
+ llmnr: boolean_attribute_writable
18
+ }
15
19
  };
16
20
 
17
21
  export class SystemdResolvedService extends ExtraSourceService {
@@ -28,7 +32,7 @@ export class SystemdResolvedService extends ExtraSourceService {
28
32
  }
29
33
 
30
34
  get systemdServices() {
31
- return SystemdResolvedServiceTypeDefinition.name;
35
+ return this.type;
32
36
  }
33
37
 
34
38
  systemdConfigs(name) {
@@ -55,8 +59,8 @@ export class SystemdResolvedService extends ExtraSourceService {
55
59
  FallbackDNS: serviceEndpoints(this, options(100, 199, 4)),
56
60
  Domains: [...this.localDomains].join(" "),
57
61
  DNSSEC: "no",
58
- MulticastDNS: this.network.multicastDNS ? "yes" : "no",
59
- LLMNR: "no"
62
+ MulticastDNS: yesno(this.network.multicastDNS),
63
+ LLMNR: yesno(this.llmnr)
60
64
  }
61
65
  ]
62
66
  };
@@ -27,7 +27,7 @@ export class SystemdTimesyncdService extends ExtraSourceService {
27
27
  }
28
28
 
29
29
  get systemdServices() {
30
- return SystemdTimesyncdServiceTypeDefinition.name;
30
+ return this.type;
31
31
  }
32
32
 
33
33
  systemdConfigs(name) {
package/src/utils.mjs CHANGED
@@ -1,6 +1,10 @@
1
1
  import { writeFile, mkdir } from "node:fs/promises";
2
2
  import { join, dirname, basename } from "node:path";
3
3
 
4
+ export function yesno(flag) {
5
+ return flag ? "yes" : "no";
6
+ }
7
+
4
8
  export function domainName(name, defaultDomain) {
5
9
  const dcs = name.split(".");
6
10
  return defaultDomain === undefined || dcs.length > 1
package/types/root.d.mts CHANGED
@@ -1,278 +1,5 @@
1
1
  export class Root extends Location {
2
- static get typeDefinition(): {
3
- name: string;
4
- extends: {
5
- name: string;
6
- owners: (string | {
7
- name: string;
8
- owners: string[];
9
- extends: typeof import("./base.mjs").Base;
10
- key: string;
11
- attributes: {
12
- networks: {
13
- type: string;
14
- collection: boolean;
15
- isKey: boolean;
16
- writable: boolean;
17
- mandatory: boolean;
18
- private?: boolean;
19
- depends?: string;
20
- description?: string;
21
- default?: any;
22
- set?: Function;
23
- get?: Function;
24
- prepareValue?: Function;
25
- values?: Set<any>;
26
- externalName?: string;
27
- env?: string[] | string;
28
- additionalValues?: object;
29
- };
30
- hosts: {
31
- type: string;
32
- collection: boolean;
33
- isKey: boolean;
34
- writable: boolean;
35
- mandatory: boolean;
36
- private?: boolean;
37
- depends?: string;
38
- description?: string;
39
- default?: any;
40
- set?: Function;
41
- get?: Function;
42
- prepareValue?: Function;
43
- values?: Set<any>;
44
- externalName?: string;
45
- env?: string[] | string;
46
- additionalValues?: object;
47
- };
48
- clusters: {
49
- type: string;
50
- collection: boolean;
51
- isKey: boolean;
52
- writable: boolean;
53
- mandatory: boolean;
54
- private?: boolean;
55
- depends?: string;
56
- description?: string;
57
- default?: any;
58
- set?: Function;
59
- get?: Function;
60
- prepareValue?: Function;
61
- values?: Set<any>;
62
- externalName?: string;
63
- env?: string[] | string;
64
- additionalValues?: object;
65
- };
66
- subnets: {
67
- type: {
68
- name: string;
69
- owners: string[];
70
- constructWithIdentifierOnly: boolean;
71
- key: string;
72
- attributes: {
73
- address: import("pacc").AttributeDefinition;
74
- networks: {
75
- type: string;
76
- collection: boolean;
77
- isKey: boolean;
78
- writable: boolean;
79
- mandatory: boolean;
80
- private?: boolean;
81
- depends?: string;
82
- description?: string;
83
- default?: any;
84
- set?: Function;
85
- get?: Function;
86
- prepareValue?: Function;
87
- values?: Set<any>;
88
- externalName?: string;
89
- env?: string[] | string;
90
- additionalValues?: object;
91
- };
92
- prefixLength: import("pacc").AttributeDefinition;
93
- family: import("pacc").AttributeDefinition;
94
- };
95
- };
96
- collection: boolean;
97
- isKey: boolean;
98
- writable: boolean;
99
- mandatory: boolean;
100
- private?: boolean;
101
- depends?: string;
102
- description?: string;
103
- default?: any;
104
- set?: Function;
105
- get?: Function;
106
- prepareValue?: Function;
107
- values?: Set<any>;
108
- externalName?: string;
109
- env?: string[] | string;
110
- additionalValues?: object;
111
- };
112
- country: import("pacc").AttributeDefinition;
113
- domain: import("pacc").AttributeDefinition;
114
- domains: import("pacc").AttributeDefinition;
115
- timezone: import("pacc").AttributeDefinition;
116
- architectures: import("pacc").AttributeDefinition;
117
- locales: import("pacc").AttributeDefinition;
118
- administratorEmail: {
119
- writable: boolean;
120
- type: object;
121
- isKey: boolean;
122
- mandatory: boolean;
123
- collection: boolean;
124
- private?: boolean;
125
- depends?: string;
126
- description?: string;
127
- default?: any;
128
- set?: Function;
129
- get?: Function;
130
- prepareValue?: Function;
131
- values?: Set<any>;
132
- externalName?: string;
133
- env?: string[] | string;
134
- additionalValues?: object;
135
- };
136
- };
137
- })[];
138
- extends: {
139
- name: string;
140
- owners: string[];
141
- extends: typeof import("./base.mjs").Base;
142
- key: string;
143
- attributes: {
144
- networks: {
145
- type: string;
146
- collection: boolean;
147
- isKey: boolean;
148
- writable: boolean;
149
- mandatory: boolean;
150
- private?: boolean;
151
- depends?: string;
152
- description?: string;
153
- default?: any;
154
- set?: Function;
155
- get?: Function;
156
- prepareValue?: Function;
157
- values?: Set<any>;
158
- externalName?: string;
159
- env?: string[] | string;
160
- additionalValues?: object;
161
- };
162
- hosts: {
163
- type: string;
164
- collection: boolean;
165
- isKey: boolean;
166
- writable: boolean;
167
- mandatory: boolean;
168
- private?: boolean;
169
- depends?: string;
170
- description?: string;
171
- default?: any;
172
- set?: Function;
173
- get?: Function;
174
- prepareValue?: Function;
175
- values?: Set<any>;
176
- externalName?: string;
177
- env?: string[] | string;
178
- additionalValues?: object;
179
- };
180
- clusters: {
181
- type: string;
182
- collection: boolean;
183
- isKey: boolean;
184
- writable: boolean;
185
- mandatory: boolean;
186
- private?: boolean;
187
- depends?: string;
188
- description?: string;
189
- default?: any;
190
- set?: Function;
191
- get?: Function;
192
- prepareValue?: Function;
193
- values?: Set<any>;
194
- externalName?: string;
195
- env?: string[] | string;
196
- additionalValues?: object;
197
- };
198
- subnets: {
199
- type: {
200
- name: string;
201
- owners: string[];
202
- constructWithIdentifierOnly: boolean;
203
- key: string;
204
- attributes: {
205
- address: import("pacc").AttributeDefinition;
206
- networks: {
207
- type: string;
208
- collection: boolean;
209
- isKey: boolean;
210
- writable: boolean;
211
- mandatory: boolean;
212
- private?: boolean;
213
- depends?: string;
214
- description?: string;
215
- default?: any;
216
- set?: Function;
217
- get?: Function;
218
- prepareValue?: Function;
219
- values?: Set<any>;
220
- externalName?: string;
221
- env?: string[] | string;
222
- additionalValues?: object;
223
- };
224
- prefixLength: import("pacc").AttributeDefinition;
225
- family: import("pacc").AttributeDefinition;
226
- };
227
- };
228
- collection: boolean;
229
- isKey: boolean;
230
- writable: boolean;
231
- mandatory: boolean;
232
- private?: boolean;
233
- depends?: string;
234
- description?: string;
235
- default?: any;
236
- set?: Function;
237
- get?: Function;
238
- prepareValue?: Function;
239
- values?: Set<any>;
240
- externalName?: string;
241
- env?: string[] | string;
242
- additionalValues?: object;
243
- };
244
- country: import("pacc").AttributeDefinition;
245
- domain: import("pacc").AttributeDefinition;
246
- domains: import("pacc").AttributeDefinition;
247
- timezone: import("pacc").AttributeDefinition;
248
- architectures: import("pacc").AttributeDefinition;
249
- locales: import("pacc").AttributeDefinition;
250
- administratorEmail: {
251
- writable: boolean;
252
- type: object;
253
- isKey: boolean;
254
- mandatory: boolean;
255
- collection: boolean;
256
- private?: boolean;
257
- depends?: string;
258
- description?: string;
259
- default?: any;
260
- set?: Function;
261
- get?: Function;
262
- prepareValue?: Function;
263
- values?: Set<any>;
264
- externalName?: string;
265
- env?: string[] | string;
266
- additionalValues?: object;
267
- };
268
- };
269
- };
270
- key: string;
271
- attributes: {
272
- locales: import("pacc").AttributeDefinition;
273
- };
274
- };
275
- };
2
+ static get typeDefinition(): typeof Root;
276
3
  constructor(directory: any);
277
4
  get fullName(): string;
278
5
  get root(): this;
@@ -1084,6 +1084,9 @@ export class SystemdResolvedService extends ExtraSourceService {
1084
1084
  };
1085
1085
  })[];
1086
1086
  key: string;
1087
+ attributes: {
1088
+ llmnr: import("pacc").AttributeDefinition;
1089
+ };
1087
1090
  };
1088
1091
  get systemdServices(): string;
1089
1092
  systemdConfigs(name: any): {
package/types/utils.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ export function yesno(flag: any): "yes" | "no";
1
2
  export function domainName(name: any, defaultDomain: any): any;
2
3
  export function domainFromDominName(domainName: any, defaultDomain: any): any;
3
4
  export function writeLines(dir: any, name: any, lines: any): Promise<void>;