pmcf 2.74.0 → 2.74.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/package.json +2 -2
  2. package/src/host.mjs +17 -22
  3. package/src/location.mjs +2 -1
  4. package/src/network-interfaces/network-interface.mjs +5 -4
  5. package/src/network-support.mjs +14 -17
  6. package/src/owner.mjs +8 -8
  7. package/src/service.mjs +7 -9
  8. package/src/services/kea.mjs +1 -1
  9. package/src/subnet.mjs +2 -3
  10. package/types/cluster.d.mts +316 -31
  11. package/types/extra-source-service.d.mts +121 -13
  12. package/types/host.d.mts +220 -22
  13. package/types/location.d.mts +204 -19
  14. package/types/network-interfaces/ethernet.d.mts +340 -36
  15. package/types/network-interfaces/loopback.d.mts +340 -36
  16. package/types/network-interfaces/network-interface.d.mts +340 -36
  17. package/types/network-interfaces/wireguard.d.mts +340 -36
  18. package/types/network-interfaces/wlan.d.mts +510 -54
  19. package/types/network-support.d.mts +186 -104
  20. package/types/network.d.mts +170 -19
  21. package/types/owner.d.mts +96 -9
  22. package/types/root.d.mts +204 -19
  23. package/types/service.d.mts +307 -62
  24. package/types/services/bind.d.mts +242 -26
  25. package/types/services/chrony.d.mts +242 -26
  26. package/types/services/influxdb.d.mts +242 -26
  27. package/types/services/kea.d.mts +242 -26
  28. package/types/services/mosquitto.d.mts +242 -26
  29. package/types/services/openldap.d.mts +242 -26
  30. package/types/services/systemd-journal-remote.d.mts +242 -26
  31. package/types/services/systemd-journal-upload.d.mts +242 -26
  32. package/types/services/systemd-journal.d.mts +242 -26
  33. package/types/services/systemd-resolved.d.mts +242 -26
  34. package/types/services/systemd-timesyncd.d.mts +242 -26
  35. package/types/subnet.d.mts +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.74.0",
3
+ "version": "2.74.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "ip-utilties": "^1.4.7",
54
54
  "npm-pkgbuild": "^18.2.12",
55
- "pacc": "^3.12.0",
55
+ "pacc": "^3.13.0",
56
56
  "package-directory": "^8.1.0"
57
57
  },
58
58
  "devDependencies": {
package/src/host.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { readFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { FileContentProvider } from "npm-pkgbuild";
4
+ import { default_attribute } from "pacc";
4
5
  import { ServiceOwner, Base, addresses } from "pmcf";
5
6
  import { networkAddressProperties } from "./network-support.mjs";
6
7
  import { addHook } from "./hooks.mjs";
@@ -32,26 +33,23 @@ const HostTypeDefinition = {
32
33
  services: { type: "service", collection: true, writeable: true },
33
34
  aliases: { type: "string", collection: true, writeable: true },
34
35
  os: {
35
- type: "string",
36
- collection: false,
36
+ ...default_attribute,
37
37
  writeable: true,
38
38
  values: ["osx", "windows", "linux"]
39
39
  },
40
- "machine-id": { type: "string", collection: false, writeable: true },
41
- distribution: { type: "string", collection: false, writeable: true },
40
+ "machine-id": { ...default_attribute, writeable: true },
41
+ distribution: { ...default_attribute, writeable: true },
42
42
  deployment: {
43
- type: "string",
44
- collection: false,
43
+ ...default_attribute,
45
44
  writeable: true,
46
45
  values: ["production", "development"]
47
46
  },
48
47
  weight: { type: "number", collection: false, writeable: true },
49
- serial: { type: "string", collection: false, writeable: true },
50
- vendor: { type: "string", collection: false, writeable: true },
51
- keymap: { type: "string", collection: false, writeable: true },
48
+ serial: { ...default_attribute, writeable: true },
49
+ vendor: { ...default_attribute, writeable: true },
50
+ keymap: { ...default_attribute, writeable: true },
52
51
  chassis: {
53
- type: "string",
54
- collection: false,
52
+ ...default_attribute,
55
53
  writeable: true,
56
54
  values: [
57
55
  "phone",
@@ -69,16 +67,15 @@ const HostTypeDefinition = {
69
67
  ]
70
68
  },
71
69
  architecture: {
72
- type: "string",
73
- collection: false,
70
+ ...default_attribute,
74
71
  writeable: true,
75
72
  values: ["x86", "x86_64", "aarch64", "armv7"]
76
73
  },
77
- replaces: { type: "string", collection: true, writeable: true },
78
- depends: { type: "string", collection: true, writeable: true },
79
- provides: { type: "string", collection: true, writeable: true },
74
+ replaces: { ...default_attribute, collection: true, writeable: true },
75
+ depends: { ...default_attribute, collection: true, writeable: true },
76
+ provides: { ...default_attribute, collection: true, writeable: true },
80
77
  extends: { type: "host", collection: true, writeable: true },
81
- model: { type: "string", collection: false, writeable: false },
78
+ model: { ...default_attribute, collection: false, writeable: false },
82
79
  isModel: { type: "boolean", collection: false, writeable: false }
83
80
  }
84
81
  };
@@ -516,11 +513,9 @@ export class Host extends ServiceOwner {
516
513
 
517
514
  for (const service of this.services) {
518
515
  if (service.systemdConfigs) {
519
- for (const {
520
- serviceName,
521
- configFileName,
522
- content
523
- } of asArray(service.systemdConfigs(this.name))) {
516
+ for (const { serviceName, configFileName, content } of asArray(
517
+ service.systemdConfigs(this.name)
518
+ )) {
524
519
  await writeLines(dir, configFileName, sectionLines(...content));
525
520
 
526
521
  addHook(
package/src/location.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { FileContentProvider } from "npm-pkgbuild";
2
+ import { default_attribute } from "pacc";
2
3
  import { Owner } from "pmcf";
3
4
  import { addType } from "./types.mjs";
4
5
  import { loadHooks } from "./hooks.mjs";
@@ -9,7 +10,7 @@ const LocationTypeDefinition = {
9
10
  priority: 1.0,
10
11
  extends: Owner.typeDefinition,
11
12
  properties: {
12
- locales: { type: "string", collection: true, writeable: true }
13
+ locales: { ...default_attribute, collection: true, writeable: true }
13
14
  }
14
15
  };
15
16
 
@@ -1,5 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import { hasWellKnownSubnet, normalizeIP } from "ip-utilties";
3
+ import { default_attribute, hostname_attribute } from "pacc";
3
4
  import { Base, cidrAddresses } from "pmcf";
4
5
  import {
5
6
  networkProperties,
@@ -39,12 +40,12 @@ export const NetworkInterfaceTypeDefinition = {
39
40
  ...networkAddressProperties,
40
41
 
41
42
  services: { type: "service", collection: true, writeable: true },
42
- hostName: { type: "string", collection: false, writeable: true },
43
- ipAddresses: { type: "string", collection: true, writeable: true },
43
+ hostName: { ...hostname_attribute, writeable: true },
44
+ ipAddresses: { ...default_attribute, writeable: true },
44
45
 
45
- hwaddr: { type: "string", collection: false, writeable: true },
46
+ hwaddr: { ...default_attribute, writeable: true },
46
47
  network: { type: "network", collection: false, writeable: true },
47
- destination: { type: "string", collection: false, writeable: true }
48
+ destination: { ...default_attribute, writeable: true }
48
49
  }
49
50
  };
50
51
 
@@ -1,40 +1,37 @@
1
+ import { default_attribute, hostname_attribute, boolean_attribute } from "pacc";
2
+
1
3
  export const networkProperties = {
2
4
  scope: {
3
- type: "string",
4
- collection: false,
5
+ ...default_attribute,
5
6
  writeable: true,
6
7
  values: ["global", "site", "link", "host"],
7
8
  default: "global"
8
9
  },
9
10
  class: {
10
- type: "string",
11
- collection: false,
11
+ ...default_attribute,
12
12
  writeable: true,
13
13
  values: ["10GBASE-T", "1000BASE-T", "100BASE-T", "10BASE-T"]
14
14
  },
15
15
  kind: {
16
- type: "string",
17
- collection: false,
16
+ ...default_attribute,
18
17
  writeable: true,
19
18
  values: ["loopback", "ethernet", "wlan", "wireguard", "fiber", "dsl"]
20
19
  },
21
- ssid: { type: "string", collection: false, writeable: true },
22
- psk: { type: "string", collection: false, writeable: true },
20
+ ssid: { ...default_attribute, writeable: true },
21
+ psk: { ...default_attribute, writeable: true },
23
22
  metric: { type: "number", collection: false, writeable: true, default: 1004 },
24
23
  mtu: { type: "number", collection: false, writeable: true, default: 1500 },
25
24
  gateway: { type: "host", collection: false, writeable: true },
26
25
  multicastDNS: {
27
- type: "boolean",
28
- collection: false,
29
- writeable: true,
30
- default: false
26
+ ...boolean_attribute,
27
+ writeable: true
31
28
  }
32
29
  };
33
30
 
34
31
  export const networkAddressProperties = {
35
- hostName: { type: "string", collection: false, writeable: true },
36
- cidrAddresses: { type: "string", collection: true, writeable: false },
37
- cidrAddress: { type: "string", collection: false, writeable: false },
38
- addresses: { type: "string", collection: true, writeable: false },
39
- address: { type: "string", collection: false, writeable: false }
32
+ hostName: { ...hostname_attribute, writeable: true },
33
+ cidrAddresses: { ...default_attribute, collection: true, writeable: false },
34
+ cidrAddress: { ...default_attribute, writeable: false },
35
+ addresses: { ...default_attribute, collection: true, writeable: false },
36
+ address: { ...default_attribute, writeable: false }
40
37
  };
package/src/owner.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { normalizeCIDR, familyIP } from "ip-utilties";
2
+ import { default_attribute, email_attribute } from "pacc";
2
3
  import { asIterator } from "./utils.mjs";
3
4
  import { Base } from "./base.mjs";
4
5
  import { Subnet, SUBNET_GLOBAL_IPV4, SUBNET_GLOBAL_IPV6 } from "./subnet.mjs";
@@ -14,14 +15,13 @@ const OwnerTypeDefinition = {
14
15
  hosts: { type: "host", collection: true, writeable: true },
15
16
  clusters: { type: "cluster", collection: true, writeable: true },
16
17
  subnets: { type: Subnet.typeDefinition, collection: true, writeable: true },
17
-
18
- country: { type: "string", collection: false, writeable: true },
19
- domain: { type: "string", collection: false, writeable: true },
20
- domains: { type: "string", collection: true, writeable: true },
21
- timezone: { type: "string", collection: false, writeable: true },
22
- architectures: { type: "string", collection: true, writeable: true },
23
- locales: { type: "string", collection: true, writeable: true },
24
- administratorEmail: { type: "string", collection: false, writeable: true }
18
+ country: { ...default_attribute, writeable: true },
19
+ domain: { ...default_attribute, writeable: true },
20
+ domains: { ...default_attribute, collection: true, writeable: true },
21
+ timezone: { ...default_attribute, writeable: true },
22
+ architectures: { ...default_attribute, collection: true, writeable: true },
23
+ locales: { ...default_attribute, collection: true, writeable: true },
24
+ administratorEmail: { ...email_attribute, writeable: true }
25
25
  }
26
26
  };
27
27
 
package/src/service.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { default_attribute, boolean_attribute } from "pacc";
1
2
  import {
2
3
  Base,
3
4
  Host,
@@ -21,18 +22,15 @@ import {
21
22
  export const endpointProperties = {
22
23
  port: { type: "number", collection: false, writeable: true },
23
24
  protocol: {
24
- type: "string",
25
- collection: false,
25
+ ...default_attribute,
26
26
  writeable: true,
27
27
  values: ["tcp", "udp"]
28
28
  },
29
- type: { type: "string", collection: false, writeable: true },
30
- types: { type: "string", collection: true, writeable: false },
29
+ type: { ...default_attribute, writeable: true },
30
+ types: { ...default_attribute, collection: true },
31
31
  tls: {
32
- type: "boolean",
33
- collection: false,
34
- writeable: false,
35
- default: false
32
+ ...boolean_attribute,
33
+ writeable: false
36
34
  }
37
35
  };
38
36
 
@@ -64,7 +62,7 @@ export const ServiceTypeDefinition = {
64
62
  properties: {
65
63
  ...networkAddressProperties,
66
64
  ...endpointProperties,
67
- alias: { type: "string", collection: false, writeable: true },
65
+ alias: { ...default_attribute, writeable: true },
68
66
  weight: { type: "number", collection: false, writeable: true, default: 1 },
69
67
  systemd: { type: "string", collection: true, writeable: true }
70
68
  }
@@ -94,7 +94,7 @@ const KeaServiceTypeDefinition = {
94
94
  };
95
95
 
96
96
  const keaVersion = 3.0;
97
- export const fetureHasHTTPEndpoints = keaVersion > 2.7;
97
+ export const fetureHasHTTPEndpoints = keaVersion >= 3.0;
98
98
 
99
99
  export class KeaService extends Service {
100
100
  static {
package/src/subnet.mjs CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  familyIP,
7
7
  matchPrefixIP
8
8
  } from "ip-utilties";
9
+ import { default_attribute } from "pacc";
9
10
  import { Base } from "./base.mjs";
10
11
  import { addType } from "./types.mjs";
11
12
 
@@ -16,9 +17,7 @@ const SubnetTypeDefinition = {
16
17
  constructWithIdentifierOnly: true,
17
18
  properties: {
18
19
  address: {
19
- type: "string",
20
- collection: false,
21
- writeable: false,
20
+ ...default_attribute,
22
21
  identifier: true
23
22
  },
24
23
  networks: { type: "network", collection: true, writeable: true },