pmcf 3.10.0 → 3.10.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 (61) hide show
  1. package/package.json +2 -2
  2. package/src/base.mjs +3 -3
  3. package/src/cluster.mjs +1 -1
  4. package/src/extra-source-service.mjs +1 -1
  5. package/src/filter.mjs +1 -1
  6. package/src/host.mjs +3 -8
  7. package/src/location.mjs +1 -1
  8. package/src/network-interfaces/ethernet.mjs +1 -1
  9. package/src/network-interfaces/loopback.mjs +1 -1
  10. package/src/network-interfaces/network-interface.mjs +8 -8
  11. package/src/network-interfaces/tun.mjs +1 -1
  12. package/src/network-interfaces/wireguard.mjs +1 -1
  13. package/src/network-interfaces/wlan.mjs +1 -1
  14. package/src/network-support.mjs +2 -2
  15. package/src/network.mjs +3 -3
  16. package/src/owner.mjs +1 -1
  17. package/src/root.mjs +1 -1
  18. package/src/service.mjs +6 -6
  19. package/src/services/bind.mjs +25 -20
  20. package/src/services/chrony.mjs +1 -1
  21. package/src/services/headscale.mjs +1 -1
  22. package/src/services/influxdb.mjs +2 -2
  23. package/src/services/kea.mjs +2 -2
  24. package/src/services/mosquitto.mjs +3 -3
  25. package/src/services/openldap.mjs +4 -4
  26. package/src/services/systemd-journal-remote.mjs +1 -1
  27. package/src/services/systemd-journal-upload.mjs +1 -1
  28. package/src/services/systemd-journal.mjs +1 -1
  29. package/src/services/systemd-resolved.mjs +1 -1
  30. package/src/services/systemd-timesyncd.mjs +1 -1
  31. package/src/subnet.mjs +1 -1
  32. package/src/types.mjs +8 -7
  33. package/types/base.d.mts +1 -1
  34. package/types/cluster.d.mts +6 -6
  35. package/types/extra-source-service.d.mts +4 -4
  36. package/types/host.d.mts +2 -2
  37. package/types/location.d.mts +7 -7
  38. package/types/network-interfaces/ethernet.d.mts +6 -6
  39. package/types/network-interfaces/loopback.d.mts +5 -5
  40. package/types/network-interfaces/network-interface.d.mts +4 -4
  41. package/types/network-interfaces/tun.d.mts +5 -5
  42. package/types/network-interfaces/wireguard.d.mts +5 -5
  43. package/types/network-interfaces/wlan.d.mts +8 -8
  44. package/types/network-support.d.mts +2 -2
  45. package/types/network.d.mts +4 -4
  46. package/types/owner.d.mts +3 -3
  47. package/types/root.d.mts +8 -8
  48. package/types/service.d.mts +6 -6
  49. package/types/services/bind.d.mts +11 -11
  50. package/types/services/chrony.d.mts +6 -6
  51. package/types/services/headscale.d.mts +6 -6
  52. package/types/services/influxdb.d.mts +5 -5
  53. package/types/services/kea.d.mts +5 -5
  54. package/types/services/mosquitto.d.mts +6 -6
  55. package/types/services/openldap.d.mts +6 -6
  56. package/types/services/systemd-journal-remote.d.mts +5 -5
  57. package/types/services/systemd-journal-upload.d.mts +5 -5
  58. package/types/services/systemd-journal.d.mts +5 -5
  59. package/types/services/systemd-resolved.d.mts +6 -6
  60. package/types/services/systemd-timesyncd.d.mts +6 -6
  61. package/types/subnet.d.mts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "3.10.0",
3
+ "version": "3.10.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "ip-utilties": "^1.4.9",
55
55
  "npm-pkgbuild": "^18.2.30",
56
- "pacc": "^4.16.0",
56
+ "pacc": "^4.16.1",
57
57
  "package-directory": "^8.1.0"
58
58
  },
59
59
  "devDependencies": {
package/src/base.mjs CHANGED
@@ -17,7 +17,7 @@ import { asArray } from "./utils.mjs";
17
17
  const BaseTypeDefinition = {
18
18
  name: "base",
19
19
  owners: [],
20
- properties: {
20
+ attributes: {
21
21
  owner: { type: "base", collection: false, writable: false },
22
22
  type: string_attribute,
23
23
  name: name_attribute_writable,
@@ -228,7 +228,7 @@ export class Base {
228
228
  this._properties = data.properties;
229
229
  }
230
230
 
231
- for (const [name, attribute] of Object.entries(type.properties)) {
231
+ for (const [name, attribute] of Object.entries(type.attributes)) {
232
232
  if (attribute.writable) {
233
233
  const value = this.expand(data[name]);
234
234
 
@@ -616,7 +616,7 @@ export function extractFrom(
616
616
  const json = {};
617
617
 
618
618
  do {
619
- for (const [name, def] of Object.entries(typeDefinition.properties)) {
619
+ for (const [name, def] of Object.entries(typeDefinition.attributes)) {
620
620
  let value = object[name];
621
621
 
622
622
  switch (typeof value) {
package/src/cluster.mjs CHANGED
@@ -12,7 +12,7 @@ const ClusterTypeDefinition = {
12
12
  owners: [Owner.typeDefinition, "network", "location", "root"],
13
13
  priority: 0.7,
14
14
  extends: Host.typeDefinition,
15
- properties: {
15
+ attributes: {
16
16
  routerId: { ...number_attribute_writable },
17
17
  masters: { type: "network_interface", collection: true, writable: true },
18
18
  backups: { type: "network_interface", collection: true, writable: true },
@@ -7,7 +7,7 @@ export const ExtraSourceServiceTypeDefinition = {
7
7
  owners: ServiceTypeDefinition.owners,
8
8
  extends: ServiceTypeDefinition,
9
9
  priority: 0.1,
10
- properties: {
10
+ attributes: {
11
11
  source: { type: networkAddressType, collection: true, writable: true }
12
12
  }
13
13
  };
package/src/filter.mjs CHANGED
@@ -55,7 +55,7 @@ export function* objectFilter(type, objects, filter) {
55
55
  return false;
56
56
  };
57
57
  for (let t = type; t; t = t.extends) {
58
- for (const property of Object.values(t.properties)) {
58
+ for (const property of Object.values(t.attributes)) {
59
59
  switch (property.type[0]) {
60
60
  case "boolean":
61
61
  if (
package/src/host.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  boolean_attribute_false
10
10
  } from "pacc";
11
11
  import { ServiceOwner, Base, addresses } from "pmcf";
12
- import { networkAddressProperties } from "./network-support.mjs";
12
+ import { networkAddressAttributes } from "./network-support.mjs";
13
13
  import { addHook } from "./hooks.mjs";
14
14
  import {
15
15
  domainFromDominName,
@@ -29,8 +29,8 @@ const HostTypeDefinition = {
29
29
  priority: 0.5,
30
30
  owners: ["owner", "network", "root"],
31
31
  extends: Base.typeDefinition,
32
- properties: {
33
- ...networkAddressProperties,
32
+ attributes: {
33
+ ...networkAddressAttributes,
34
34
  networkInterfaces: {
35
35
  type: "network_interface",
36
36
  collection: true,
@@ -107,11 +107,6 @@ export class Host extends ServiceOwner {
107
107
  return HostTypeDefinition;
108
108
  }
109
109
 
110
- constructor(owner, data) {
111
- super(owner, data);
112
- owner.addObject(this);
113
- }
114
-
115
110
  read(data, type) {
116
111
  super.read(data, type);
117
112
 
package/src/location.mjs CHANGED
@@ -9,7 +9,7 @@ const LocationTypeDefinition = {
9
9
  owners: [Owner.typeDefinition, "location", "root"],
10
10
  priority: 1.0,
11
11
  extends: Owner.typeDefinition,
12
- properties: {
12
+ attributes: {
13
13
  locales: { ...string_collection_attribute, writable: true }
14
14
  }
15
15
  };
@@ -10,7 +10,7 @@ export const EthernetNetworkInterfaceTypeDefinition = {
10
10
  owners: NetworkInterfaceTypeDefinition.owners,
11
11
  extends: NetworkInterfaceTypeDefinition,
12
12
  priority: 0.1,
13
- properties: {
13
+ attributes: {
14
14
  arpbridge: { type: "network_interface", collection: true, writable: true }
15
15
  }
16
16
  };
@@ -9,7 +9,7 @@ const LoopbackNetworkInterfaceTypeDefinition = {
9
9
  owners: NetworkInterfaceTypeDefinition.owners,
10
10
  extends: NetworkInterfaceTypeDefinition,
11
11
  priority: 0.1,
12
- properties: {}
12
+ attributes: {}
13
13
  };
14
14
 
15
15
  const _localAddresses = new Map([
@@ -3,8 +3,8 @@ import { hasWellKnownSubnet, normalizeIP } from "ip-utilties";
3
3
  import { string_attribute_writable, hostname_attribute } from "pacc";
4
4
  import { Base, cidrAddresses } from "pmcf";
5
5
  import {
6
- networkProperties,
7
- networkAddressProperties
6
+ networkAttributes,
7
+ networkAddressAttributes
8
8
  } from "../network-support.mjs";
9
9
  import { asArray, writeLines, sectionLines } from "../utils.mjs";
10
10
  import { addType } from "../types.mjs";
@@ -35,9 +35,9 @@ export const NetworkInterfaceTypeDefinition = {
35
35
 
36
36
  return NetworkInterface;
37
37
  },
38
- properties: {
39
- ...networkProperties,
40
- ...networkAddressProperties,
38
+ attributes: {
39
+ ...networkAttributes,
40
+ ...networkAddressAttributes,
41
41
 
42
42
  services: { type: "service", collection: true, writable: true },
43
43
  hostName: { ...hostname_attribute, writable: true },
@@ -133,7 +133,7 @@ export class NetworkInterface extends SkeletonNetworkInterface {
133
133
  return (
134
134
  this.extendedProperty("_scope") ??
135
135
  this.network?.scope ??
136
- networkProperties.scope.default
136
+ networkAttributes.scope.default
137
137
  );
138
138
  }
139
139
 
@@ -153,7 +153,7 @@ export class NetworkInterface extends SkeletonNetworkInterface {
153
153
  return (
154
154
  this.extendedProperty("_metric") ??
155
155
  this.network?.metric ??
156
- networkProperties.metric.default
156
+ networkAttributes.metric.default
157
157
  );
158
158
  }
159
159
 
@@ -162,7 +162,7 @@ export class NetworkInterface extends SkeletonNetworkInterface {
162
162
  }
163
163
 
164
164
  get mtu() {
165
- return this.extendedProperty("_mtu"); // ?? networkProperties.mtu.default;
165
+ return this.extendedProperty("_mtu"); // ?? networkAttributes.mtu.default;
166
166
  }
167
167
 
168
168
  set class(value) {
@@ -8,7 +8,7 @@ const TUNdNetworkInterfaceTypeDefinition = {
8
8
  owners: NetworkInterfaceTypeDefinition.owners,
9
9
  extends: NetworkInterfaceTypeDefinition,
10
10
  priority: 0.1,
11
- properties: {}
11
+ attributes: {}
12
12
  };
13
13
 
14
14
  export class TUNNetworkInterface extends NetworkInterface {
@@ -8,7 +8,7 @@ const WireguardNetworkInterfaceTypeDefinition = {
8
8
  owners: NetworkInterfaceTypeDefinition.owners,
9
9
  extends: NetworkInterfaceTypeDefinition,
10
10
  priority: 0.1,
11
- properties: {}
11
+ attributes: {}
12
12
  };
13
13
 
14
14
  export class WireguardNetworkInterface extends SkeletonNetworkInterface {
@@ -15,7 +15,7 @@ const WLANNetworkInterfaceTypeDefinition = {
15
15
  owners: EthernetNetworkInterfaceTypeDefinition.owners,
16
16
  extends: EthernetNetworkInterfaceTypeDefinition,
17
17
  priority: 0.1,
18
- properties: {
18
+ attributes: {
19
19
  ssid: string_attribute_writable,
20
20
  psk: { ...secret_attribute, writable: true },
21
21
  secretName: string_attribute_writable
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  export const networkAddressType = ["network", "host", "network_interface"];
10
10
 
11
- export const networkProperties = {
11
+ export const networkAttributes = {
12
12
  scope: {
13
13
  ...string_attribute_writable,
14
14
  values: ["global", "site", "link", "host"]
@@ -31,7 +31,7 @@ export const networkProperties = {
31
31
  multicastDNS: boolean_attribute_writable
32
32
  };
33
33
 
34
- export const networkAddressProperties = {
34
+ export const networkAddressAttributes = {
35
35
  hostName: { ...hostname_attribute, writable: true },
36
36
  cidrAddresses: { ...string_collection_attribute_writable },
37
37
  cidrAddress: { ...string_attribute_writable },
package/src/network.mjs CHANGED
@@ -2,15 +2,15 @@ import { default_attribute_writable } from "pacc";
2
2
  import { Owner } from "./owner.mjs";
3
3
  import { Subnet } from "./subnet.mjs";
4
4
  import { addType } from "./types.mjs";
5
- import { networkProperties } from "./network-support.mjs";
5
+ import { networkAttributes } from "./network-support.mjs";
6
6
 
7
7
  const NetworkTypeDefinition = {
8
8
  name: "network",
9
9
  owners: ["location", "owner", "root"],
10
10
  priority: 0.8,
11
11
  extends: Owner.typeDefinition,
12
- properties: {
13
- ...networkProperties,
12
+ attributes: {
13
+ ...networkAttributes,
14
14
  bridge: {
15
15
  ...default_attribute_writable,
16
16
  type: "network",
package/src/owner.mjs CHANGED
@@ -15,7 +15,7 @@ const OwnerTypeDefinition = {
15
15
  owners: ["location", "owner", "root"],
16
16
  priority: 0.9,
17
17
  extends: Base.typeDefinition,
18
- properties: {
18
+ attributes: {
19
19
  networks: { type: "network", collection: true, writable: true },
20
20
  hosts: { type: "host", collection: true, writable: true },
21
21
  clusters: { type: "cluster", collection: true, writable: true },
package/src/root.mjs CHANGED
@@ -8,7 +8,7 @@ const RootTypeDefinition = {
8
8
  owners: [],
9
9
  priority: 1000,
10
10
  extends: Location.typeDefinition,
11
- properties: {}
11
+ attributes: {}
12
12
  };
13
13
 
14
14
  export class Root extends Location {
package/src/service.mjs CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  } from "pmcf";
16
16
  import { addType } from "./types.mjs";
17
17
  import { asArray } from "./utils.mjs";
18
- import { networkAddressProperties } from "./network-support.mjs";
18
+ import { networkAddressAttributes } from "./network-support.mjs";
19
19
  import { serviceTypeEndpoints, ServiceTypes } from "./service-types.mjs";
20
20
  import {
21
21
  DNSRecord,
@@ -25,7 +25,7 @@ import {
25
25
  dnsPriority
26
26
  } from "./dns-utils.mjs";
27
27
 
28
- export const endpointProperties = {
28
+ export const endpointAttributes = {
29
29
  port: { ...number_attribute_writable },
30
30
  protocol: {
31
31
  ...string_attribute_writable,
@@ -41,7 +41,7 @@ export const EndpointTypeDefinition = {
41
41
  owners: ["service", "network_interface"],
42
42
  priority: 0.4,
43
43
  specializations: {},
44
- properties: endpointProperties
44
+ attributes: endpointAttributes
45
45
  };
46
46
 
47
47
  export const ServiceTypeDefinition = {
@@ -61,9 +61,9 @@ export const ServiceTypeDefinition = {
61
61
 
62
62
  return Service;
63
63
  },
64
- properties: {
65
- ...networkAddressProperties,
66
- ...endpointProperties,
64
+ attributes: {
65
+ ...networkAddressAttributes,
66
+ ...endpointAttributes,
67
67
  alias: { ...string_attribute_writable },
68
68
  weight: { ...number_attribute_writable /*default: 1*/ },
69
69
  systemd: string_collection_attribute_writable
@@ -16,7 +16,12 @@ import {
16
16
  dnsRecordTypeForAddressFamily,
17
17
  sortZoneRecords
18
18
  } from "../dns-utils.mjs";
19
- import { ExtraSourceService, serviceEndpoints, addresses, networkAddressType } from "pmcf";
19
+ import {
20
+ ExtraSourceService,
21
+ serviceEndpoints,
22
+ addresses,
23
+ networkAddressType
24
+ } from "pmcf";
20
25
  import { addType } from "../types.mjs";
21
26
  import { Service, ServiceTypeDefinition } from "../service.mjs";
22
27
  import { ExtraSourceServiceTypeDefinition } from "../extra-source-service.mjs";
@@ -28,8 +33,8 @@ const BindServiceTypeDefinition = {
28
33
  owners: ServiceTypeDefinition.owners,
29
34
  extends: ExtraSourceServiceTypeDefinition,
30
35
  priority: 0.1,
31
- properties: {
32
- addresses: {
36
+ attributes: {
37
+ zones: {
33
38
  type: [...networkAddressType, "location", "owner"],
34
39
  collection: true,
35
40
  writable: true
@@ -104,10 +109,10 @@ export class BindService extends ExtraSourceService {
104
109
  hasSVRRecords = true;
105
110
  hasCatalog = true;
106
111
  hasLinkLocalAdresses =
107
- BindServiceTypeDefinition.properties.hasLinkLocalAdresses.default;
112
+ BindServiceTypeDefinition.attributes.hasLinkLocalAdresses.default;
108
113
  hasLocationRecord = true;
109
114
  notify = true;
110
- _addresses = [];
115
+ _zones = [];
111
116
  _trusted = [];
112
117
  _exclude = new Set([]);
113
118
  _excludeInterfaceKinds = new Set();
@@ -157,12 +162,12 @@ export class BindService extends ExtraSourceService {
157
162
  return [this.serial, this.refresh, this.retry, this.expire, this.minimum];
158
163
  }
159
164
 
160
- set addresses(value) {
161
- this._addresses.push(value);
165
+ set zones(value) {
166
+ this._zones.push(value);
162
167
  }
163
168
 
164
- get addresses() {
165
- return this._addresses;
169
+ get zones() {
170
+ return this._zones;
166
171
  }
167
172
 
168
173
  set protected(value) {
@@ -206,8 +211,8 @@ export class BindService extends ExtraSourceService {
206
211
  }
207
212
 
208
213
  async *preparePackages(dir) {
209
- const sources = this.addresses.length ? this.addresses : [this.owner];
210
- const names = sources.map(a => a.fullName).join(" ");
214
+ const zoneSources = this.zones.length ? this.zones : [this.owner];
215
+ const names = zoneSources.map(a => a.fullName).join(" ");
211
216
  const name = this.owner.owner.name || this.owner.name;
212
217
 
213
218
  const configPackageDir = join(dir, "config") + "/";
@@ -290,7 +295,7 @@ export class BindService extends ExtraSourceService {
290
295
  new FileContentProvider(zonesPackageDir, ...filePermissions)
291
296
  ];
292
297
 
293
- yield this.generateZoneDefs(sources, packageData);
298
+ yield this.generateZoneDefs(zoneSources, packageData);
294
299
 
295
300
  const outfacingZonesPackageDir = join(dir, "outfacingZones") + "/";
296
301
 
@@ -307,7 +312,7 @@ export class BindService extends ExtraSourceService {
307
312
  new FileContentProvider(outfacingZonesPackageDir, ...filePermissions)
308
313
  ];
309
314
 
310
- yield* this.generateOutfacingDefs(sources, packageData);
315
+ yield* this.generateOutfacingDefs(zoneSources, packageData);
311
316
  }
312
317
 
313
318
  async *generateOutfacingDefs(sources, packageData) {
@@ -338,18 +343,18 @@ export class BindService extends ExtraSourceService {
338
343
  }
339
344
  }
340
345
 
341
- async generateZoneDefs(sources, packageData) {
346
+ async generateZoneDefs(zoneSources, packageData) {
342
347
  const configs = [];
343
348
 
344
- for (const source of sources) {
349
+ for (const zoneSource of zoneSources) {
345
350
  console.log(
346
351
  "SOURCE",
347
- source.toString(),
348
- [...source.localDomains].join(" ")
352
+ zoneSource.toString(),
353
+ [...zoneSource.localDomains].join(" ")
349
354
  );
350
355
 
351
- for (const domain of source.localDomains) {
352
- const locationName = source.location.name;
356
+ for (const domain of zoneSource.localDomains) {
357
+ const locationName = zoneSource.location.name;
353
358
  const reverseZones = new Map();
354
359
 
355
360
  const config = {
@@ -402,7 +407,7 @@ export class BindService extends ExtraSourceService {
402
407
  networkInterface,
403
408
  domainNames,
404
409
  family
405
- } of source.networkAddresses()) {
410
+ } of zoneSource.networkAddresses()) {
406
411
  if (
407
412
  !this.exclude.has(networkInterface.network) &&
408
413
  !this.excludeInterfaceKinds.has(networkInterface.kind)
@@ -19,7 +19,7 @@ const ChronyServiceTypeDefinition = {
19
19
  owners: ServiceTypeDefinition.owners,
20
20
  extends: ExtraSourceServiceTypeDefinition,
21
21
  priority: 0.1,
22
- properties: {},
22
+ attributes: {},
23
23
  service: {
24
24
  extends: ["ntp"],
25
25
  services: {
@@ -11,7 +11,7 @@ const HeadscaleServiceTypeDefinition = {
11
11
  owners: ServiceTypeDefinition.owners,
12
12
  extends: ExtraSourceServiceTypeDefinition,
13
13
  priority: 0.1,
14
- properties: {},
14
+ attributes: {},
15
15
  service: {
16
16
  endpoints: [
17
17
  {
@@ -11,7 +11,7 @@ const InfluxdbServiceTypeDefinition = {
11
11
  owners: ServiceTypeDefinition.owners,
12
12
  extends: ServiceTypeDefinition,
13
13
  priority: 0.1,
14
- properties: {
14
+ attributes: {
15
15
  "metrics-disabled": {
16
16
  ...boolean_attribute_writable_true,
17
17
  isCommonOption: true
@@ -65,7 +65,7 @@ export class InfluxdbService extends Service {
65
65
  }
66
66
  };
67
67
 
68
- const lines = Object.entries(InfluxdbServiceTypeDefinition.properties)
68
+ const lines = Object.entries(InfluxdbServiceTypeDefinition.attributes)
69
69
  .filter(
70
70
  ([key, attribute]) =>
71
71
  attribute.isCommonOption && this[key] !== undefined
@@ -23,7 +23,7 @@ const KeaServiceTypeDefinition = {
23
23
  owners: ServiceTypeDefinition.owners,
24
24
  extends: ServiceTypeDefinition,
25
25
  priority: 0.1,
26
- properties: {
26
+ attributes: {
27
27
  "ddns-send-updates": {
28
28
  ...boolean_attribute_writable_true,
29
29
  isCommonOption: true
@@ -281,7 +281,7 @@ export class KeaService extends Service {
281
281
  };
282
282
 
283
283
  for (const [key] of Object.entries(
284
- KeaServiceTypeDefinition.properties
284
+ KeaServiceTypeDefinition.attributes
285
285
  ).filter(
286
286
  ([key, attribute]) =>
287
287
  attribute.isCommonOption && this[key] !== undefined
@@ -11,7 +11,7 @@ const MosquittoServiceTypeDefinition = {
11
11
  owners: ServiceTypeDefinition.owners,
12
12
  extends: ServiceTypeDefinition,
13
13
  priority: 0.1,
14
- properties: {
14
+ attributes: {
15
15
  log_timestamp: {
16
16
  ...boolean_attribute_writable_true,
17
17
  isCommonOption: true
@@ -48,7 +48,7 @@ export class MosquittoService extends Service {
48
48
  dir,
49
49
  sources: [new FileContentProvider(dir + "/")],
50
50
  outputs: this.outputs,
51
- properties: {
51
+ attributes: {
52
52
  name: `mosquitto-${this.location.name}-${host.name}`,
53
53
  description: `mosquitto definitions for ${this.fullName}@${name}`,
54
54
  access: "private",
@@ -56,7 +56,7 @@ export class MosquittoService extends Service {
56
56
  }
57
57
  };
58
58
 
59
- const lines = Object.entries(MosquittoServiceTypeDefinition.properties)
59
+ const lines = Object.entries(MosquittoServiceTypeDefinition.attributes)
60
60
  .filter(
61
61
  ([key, attribute]) =>
62
62
  attribute.isCommonOption && this[key] !== undefined
@@ -12,7 +12,7 @@ const OpenLDAPServiceTypeDefinition = {
12
12
  owners: ServiceTypeDefinition.owners,
13
13
  extends: ServiceTypeDefinition,
14
14
  priority: 0.1,
15
- properties: {
15
+ attributes: {
16
16
  baseDN: {
17
17
  ...string_attribute,
18
18
  writable: true
@@ -110,7 +110,7 @@ export class OpenLDAPService extends Service {
110
110
  dir,
111
111
  sources: [new FileContentProvider(dir + "/", ...filePermissions)],
112
112
  outputs: this.outputs,
113
- properties: {
113
+ attributes: {
114
114
  name: `openldap-${this.location.name}-${name}`,
115
115
  description: `openldap definitions for ${this.fullName}@${name}`,
116
116
  access: "private",
@@ -120,13 +120,13 @@ export class OpenLDAPService extends Service {
120
120
  };
121
121
 
122
122
  addHook(
123
- packageData.properties.hooks,
123
+ packageData.attributes.hooks,
124
124
  "post_upgrade",
125
125
  "setfacl -m u:ldap:r /etc/letsencrypt/archive/*/privkey*.pem"
126
126
  );
127
127
 
128
128
  addHook(
129
- packageData.properties.hooks,
129
+ packageData.attributes.hooks,
130
130
  "post_install",
131
131
  "setfacl -m u:ldap:r /etc/letsencrypt/archive/*/privkey*.pem"
132
132
  );
@@ -7,7 +7,7 @@ const SystemdJournalRemoteServiceTypeDefinition = {
7
7
  owners: ServiceTypeDefinition.owners,
8
8
  extends: ServiceTypeDefinition,
9
9
  priority: 0.1,
10
- properties: {},
10
+ attributes: {},
11
11
  services: {
12
12
  endpoints: [
13
13
  {
@@ -8,7 +8,7 @@ const SystemdJournalUploadServiceTypeDefinition = {
8
8
  owners: ServiceTypeDefinition.owners,
9
9
  extends: ServiceTypeDefinition,
10
10
  priority: 0.1,
11
- properties: {
11
+ attributes: {
12
12
  url: { ...string_attribute_writable }
13
13
  },
14
14
  service: {}
@@ -7,7 +7,7 @@ const SystemdJournalServiceTypeDefinition = {
7
7
  owners: ServiceTypeDefinition.owners,
8
8
  extends: ServiceTypeDefinition,
9
9
  priority: 0.1,
10
- properties: {},
10
+ attributes: {},
11
11
  service: {}
12
12
  };
13
13
 
@@ -12,7 +12,7 @@ const SystemdResolvedServiceTypeDefinition = {
12
12
  owners: ServiceTypeDefinition.owners,
13
13
  extends: ExtraSourceServiceTypeDefinition,
14
14
  priority: 0.1,
15
- properties: {},
15
+ attributes: {},
16
16
  service: {}
17
17
  };
18
18
 
@@ -12,7 +12,7 @@ const SystemdTimesyncdServiceTypeDefinition = {
12
12
  owners: ServiceTypeDefinition.owners,
13
13
  extends: ExtraSourceServiceTypeDefinition,
14
14
  priority: 0.1,
15
- properties: {},
15
+ attributes: {},
16
16
  service: {}
17
17
  };
18
18
 
package/src/subnet.mjs CHANGED
@@ -15,7 +15,7 @@ const SubnetTypeDefinition = {
15
15
  owners: ["location", "owner", "network", "root"],
16
16
  priority: 0.6,
17
17
  constructWithIdentifierOnly: true,
18
- properties: {
18
+ attributes: {
19
19
  address: {
20
20
  ...string_attribute,
21
21
  isKey: true
package/src/types.mjs CHANGED
@@ -26,15 +26,15 @@ export function resolveTypeLinks() {
26
26
  typeof owner === "string" ? types[owner] : owner
27
27
  );
28
28
 
29
- for (const [name, property] of Object.entries(type.properties)) {
30
- property.name = name;
31
- if (property.isKey) {
32
- type.identifier = property;
29
+ for (const [name, attribute] of Object.entries(type.attributes)) {
30
+ attribute.name = name;
31
+ if (attribute.isKey) {
32
+ type.identifier = attribute;
33
33
  }
34
34
 
35
35
  const ts = [];
36
36
 
37
- for (const type of asArray(property.type)) {
37
+ for (const type of asArray(attribute.type)) {
38
38
  if (typeof type === "string") {
39
39
  if (baseTypes.has(type)) {
40
40
  ts.push(type);
@@ -45,7 +45,7 @@ export function resolveTypeLinks() {
45
45
  } else {
46
46
  console.error(
47
47
  "Unknown type",
48
- property.type,
48
+ attribute.type,
49
49
  type.name,
50
50
  name
51
51
  );
@@ -55,7 +55,7 @@ export function resolveTypeLinks() {
55
55
  ts.push(type);
56
56
  }
57
57
  }
58
- property.type = ts;
58
+ attribute.type = ts;
59
59
 
60
60
  /*
61
61
  if (typeof property.type === "string") {
@@ -92,5 +92,6 @@ export function typeFactory(type, owner, data) {
92
92
  const factory = type.factoryFor?.(owner, data) || type.clazz;
93
93
  const object = new factory(owner);
94
94
  object.read(data);
95
+ owner.addObject(object);
95
96
  return object;
96
97
  }