pmcf 3.4.0 → 3.4.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 (40) hide show
  1. package/package.json +2 -2
  2. package/src/base.mjs +14 -7
  3. package/src/host.mjs +20 -15
  4. package/src/location.mjs +2 -2
  5. package/src/network-interfaces/network-interface.mjs +4 -4
  6. package/src/network-support.mjs +16 -10
  7. package/src/owner.mjs +11 -7
  8. package/src/service.mjs +11 -6
  9. package/src/services/bind.mjs +9 -9
  10. package/src/services/kea.mjs +9 -8
  11. package/src/services/openldap.mjs +4 -4
  12. package/src/services/systemd-journal-upload.mjs +2 -2
  13. package/src/subnet.mjs +3 -3
  14. package/types/base.d.mts +9 -9
  15. package/types/cluster.d.mts +92 -105
  16. package/types/extra-source-service.d.mts +34 -47
  17. package/types/host.d.mts +58 -71
  18. package/types/location.d.mts +76 -76
  19. package/types/network-interfaces/ethernet.d.mts +50 -50
  20. package/types/network-interfaces/loopback.d.mts +50 -50
  21. package/types/network-interfaces/network-interface.d.mts +50 -50
  22. package/types/network-interfaces/wireguard.d.mts +50 -50
  23. package/types/network-interfaces/wlan.d.mts +75 -75
  24. package/types/network-support.d.mts +16 -16
  25. package/types/network.d.mts +34 -34
  26. package/types/owner.d.mts +34 -34
  27. package/types/root.d.mts +76 -76
  28. package/types/service.d.mts +70 -108
  29. package/types/services/bind.d.mts +85 -110
  30. package/types/services/chrony.d.mts +68 -94
  31. package/types/services/influxdb.d.mts +68 -94
  32. package/types/services/kea.d.mts +71 -97
  33. package/types/services/mosquitto.d.mts +68 -94
  34. package/types/services/openldap.d.mts +68 -94
  35. package/types/services/systemd-journal-remote.d.mts +68 -94
  36. package/types/services/systemd-journal-upload.d.mts +68 -94
  37. package/types/services/systemd-journal.d.mts +68 -94
  38. package/types/services/systemd-resolved.d.mts +68 -94
  39. package/types/services/systemd-timesyncd.d.mts +68 -94
  40. package/types/subnet.d.mts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "3.4.0",
3
+ "version": "3.4.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.16",
55
- "pacc": "^4.1.1",
55
+ "pacc": "^4.4.0",
56
56
  "package-directory": "^8.1.0"
57
57
  },
58
58
  "devDependencies": {
package/src/base.mjs CHANGED
@@ -1,6 +1,14 @@
1
1
  import { join } from "node:path";
2
2
  import { allOutputs } from "npm-pkgbuild";
3
- import { getAttribute, default_attribute, number_attribute, description_attribute, boolean_attribute } from "pacc";
3
+ import {
4
+ getAttribute,
5
+ name_attribute,
6
+ string_attribute,
7
+ string_collection_attribute,
8
+ number_attribute,
9
+ description_attribute,
10
+ boolean_attribute
11
+ } from "pacc";
4
12
  import { addType, primitives, typeFactory } from "./types.mjs";
5
13
  import { asArray } from "./utils.mjs";
6
14
 
@@ -9,22 +17,21 @@ const BaseTypeDefinition = {
9
17
  owners: [],
10
18
  properties: {
11
19
  owner: { type: "base", collection: false, writable: false },
12
- type: default_attribute,
20
+ type: string_attribute,
13
21
  name: {
14
- ...default_attribute,
15
- isKey: true,
22
+ ...name_attribute,
16
23
  writable: true
17
24
  },
18
25
  description: { ...description_attribute, writable: true },
19
26
  priority: { ...number_attribute, writable: true },
20
- directory: { ...default_attribute, writable: false },
21
- packaging: { ...default_attribute, writable: true },
27
+ directory: { ...string_attribute, writable: false },
28
+ packaging: { ...string_attribute, writable: true },
22
29
  disabled: {
23
30
  ...boolean_attribute,
24
31
  writable: true,
25
32
  default: false
26
33
  },
27
- tags: { ...default_attribute, collection: true, writable: true }
34
+ tags: { ...string_collection_attribute, writable: true }
28
35
  }
29
36
  };
30
37
 
package/src/host.mjs CHANGED
@@ -1,7 +1,12 @@
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, number_attribute, boolean_attribute_false } from "pacc";
4
+ import {
5
+ string_attribute,
6
+ string_collection_attribute,
7
+ number_attribute,
8
+ boolean_attribute_false
9
+ } from "pacc";
5
10
  import { ServiceOwner, Base, addresses } from "pmcf";
6
11
  import { networkAddressProperties } from "./network-support.mjs";
7
12
  import { addHook } from "./hooks.mjs";
@@ -31,25 +36,25 @@ const HostTypeDefinition = {
31
36
  writable: true
32
37
  },
33
38
  services: { type: "service", collection: true, writable: true },
34
- aliases: { ...default_attribute, collection: true, writable: true },
39
+ aliases: { ...string_collection_attribute, writable: true },
35
40
  os: {
36
- ...default_attribute,
41
+ ...string_attribute,
37
42
  writable: true,
38
43
  values: ["osx", "windows", "linux"]
39
44
  },
40
- "machine-id": { ...default_attribute, writable: true },
41
- distribution: { ...default_attribute, writable: true },
45
+ "machine-id": { ...string_attribute, writable: true },
46
+ distribution: { ...string_attribute, writable: true },
42
47
  deployment: {
43
- ...default_attribute,
48
+ ...string_attribute,
44
49
  writable: true,
45
50
  values: ["production", "development"]
46
51
  },
47
52
  weight: { ...number_attribute, writable: true },
48
- serial: { ...default_attribute, writable: true },
49
- vendor: { ...default_attribute, writable: true },
50
- keymap: { ...default_attribute, writable: true },
53
+ serial: { ...string_attribute, writable: true },
54
+ vendor: { ...string_attribute, writable: true },
55
+ keymap: { ...string_attribute, writable: true },
51
56
  chassis: {
52
- ...default_attribute,
57
+ ...string_attribute,
53
58
  writable: true,
54
59
  values: [
55
60
  "phone",
@@ -67,15 +72,15 @@ const HostTypeDefinition = {
67
72
  ]
68
73
  },
69
74
  architecture: {
70
- ...default_attribute,
75
+ ...string_attribute,
71
76
  writable: true,
72
77
  values: ["x86", "x86_64", "aarch64", "armv7"]
73
78
  },
74
- replaces: { ...default_attribute, collection: true, writable: true },
75
- depends: { ...default_attribute, collection: true, writable: true },
76
- provides: { ...default_attribute, collection: true, writable: true },
79
+ replaces: { ...string_collection_attribute, writable: true },
80
+ depends: { ...string_collection_attribute, writable: true },
81
+ provides: { ...string_collection_attribute, writable: true },
77
82
  extends: { type: "host", collection: true, writable: true },
78
- model: { ...default_attribute, collection: false, writable: false },
83
+ model: string_attribute,
79
84
  isModel: boolean_attribute_false
80
85
  }
81
86
  };
package/src/location.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FileContentProvider } from "npm-pkgbuild";
2
- import { default_attribute } from "pacc";
2
+ import { string_collection_attribute } from "pacc";
3
3
  import { Owner } from "pmcf";
4
4
  import { addType } from "./types.mjs";
5
5
  import { loadHooks } from "./hooks.mjs";
@@ -10,7 +10,7 @@ const LocationTypeDefinition = {
10
10
  priority: 1.0,
11
11
  extends: Owner.typeDefinition,
12
12
  properties: {
13
- locales: { ...default_attribute, collection: true, writable: true }
13
+ locales: { ...string_collection_attribute, writable: true }
14
14
  }
15
15
  };
16
16
 
@@ -1,6 +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
+ import { string_attribute, hostname_attribute } from "pacc";
4
4
  import { Base, cidrAddresses } from "pmcf";
5
5
  import {
6
6
  networkProperties,
@@ -41,11 +41,11 @@ export const NetworkInterfaceTypeDefinition = {
41
41
 
42
42
  services: { type: "service", collection: true, writable: true },
43
43
  hostName: { ...hostname_attribute, writable: true },
44
- ipAddresses: { ...default_attribute, writable: true },
44
+ ipAddresses: { ...string_attribute, writable: true },
45
45
 
46
- hwaddr: { ...default_attribute, writable: true },
46
+ hwaddr: { ...string_attribute, writable: true },
47
47
  network: { type: "network", collection: false, writable: true },
48
- destination: { ...default_attribute, writable: true }
48
+ destination: { ...string_attribute, writable: true }
49
49
  }
50
50
  };
51
51
 
@@ -1,24 +1,30 @@
1
- import { default_attribute, number_attribute, hostname_attribute, boolean_attribute } from "pacc";
1
+ import {
2
+ string_collection_attribute,
3
+ string_attribute,
4
+ number_attribute,
5
+ hostname_attribute,
6
+ boolean_attribute
7
+ } from "pacc";
2
8
 
3
9
  export const networkProperties = {
4
10
  scope: {
5
- ...default_attribute,
11
+ ...string_attribute,
6
12
  writable: true,
7
13
  values: ["global", "site", "link", "host"],
8
14
  default: "global"
9
15
  },
10
16
  class: {
11
- ...default_attribute,
17
+ ...string_attribute,
12
18
  writable: true,
13
19
  values: ["10GBASE-T", "1000BASE-T", "100BASE-T", "10BASE-T"]
14
20
  },
15
21
  kind: {
16
- ...default_attribute,
22
+ ...string_attribute,
17
23
  writable: true,
18
24
  values: ["loopback", "ethernet", "wlan", "wireguard", "fiber", "dsl"]
19
25
  },
20
- ssid: { ...default_attribute, writable: true },
21
- psk: { ...default_attribute, writable: true },
26
+ ssid: { ...string_attribute, writable: true },
27
+ psk: { ...string_attribute, writable: true },
22
28
  metric: { ...number_attribute, writable: true, default: 1004 },
23
29
  mtu: { ...number_attribute, writable: true, default: 1500 },
24
30
  gateway: { type: "host", collection: false, writable: true },
@@ -30,8 +36,8 @@ export const networkProperties = {
30
36
 
31
37
  export const networkAddressProperties = {
32
38
  hostName: { ...hostname_attribute, writable: true },
33
- cidrAddresses: { ...default_attribute, collection: true, writable: false },
34
- cidrAddress: { ...default_attribute, writable: false },
35
- addresses: { ...default_attribute, collection: true, writable: false },
36
- address: { ...default_attribute, writable: false }
39
+ cidrAddresses: { ...string_collection_attribute, writable: false },
40
+ cidrAddress: { ...string_attribute, writable: false },
41
+ addresses: { ...string_collection_attribute, writable: false },
42
+ address: { ...string_attribute, writable: false }
37
43
  };
package/src/owner.mjs CHANGED
@@ -1,5 +1,9 @@
1
1
  import { normalizeCIDR, familyIP } from "ip-utilties";
2
- import { default_attribute, email_attribute } from "pacc";
2
+ import {
3
+ string_collection_attribute,
4
+ string_attribute,
5
+ email_attribute
6
+ } from "pacc";
3
7
  import { asIterator } from "./utils.mjs";
4
8
  import { Base } from "./base.mjs";
5
9
  import { Subnet, SUBNET_GLOBAL_IPV4, SUBNET_GLOBAL_IPV6 } from "./subnet.mjs";
@@ -15,12 +19,12 @@ const OwnerTypeDefinition = {
15
19
  hosts: { type: "host", collection: true, writable: true },
16
20
  clusters: { type: "cluster", collection: true, writable: true },
17
21
  subnets: { type: Subnet.typeDefinition, collection: true, writable: true },
18
- country: { ...default_attribute, writable: true },
19
- domain: { ...default_attribute, writable: true },
20
- domains: { ...default_attribute, collection: true, writable: true },
21
- timezone: { ...default_attribute, writable: true },
22
- architectures: { ...default_attribute, collection: true, writable: true },
23
- locales: { ...default_attribute, collection: true, writable: true },
22
+ country: { ...string_attribute, writable: true },
23
+ domain: { ...string_attribute, writable: true },
24
+ domains: { ...string_collection_attribute, writable: true },
25
+ timezone: { ...string_attribute, writable: true },
26
+ architectures: { ...string_collection_attribute, writable: true },
27
+ locales: { ...string_collection_attribute, writable: true },
24
28
  administratorEmail: { ...email_attribute, writable: true }
25
29
  }
26
30
  };
package/src/service.mjs CHANGED
@@ -1,4 +1,9 @@
1
- import { default_attribute, string_attribute, number_attribute, boolean_attribute_false } from "pacc";
1
+ import {
2
+ string_attribute,
3
+ string_collection_attribute,
4
+ number_attribute,
5
+ boolean_attribute_false
6
+ } from "pacc";
2
7
  import {
3
8
  Base,
4
9
  Host,
@@ -22,12 +27,12 @@ import {
22
27
  export const endpointProperties = {
23
28
  port: { ...number_attribute, writable: true },
24
29
  protocol: {
25
- ...default_attribute,
30
+ ...string_attribute,
26
31
  writable: true,
27
32
  values: ["tcp", "udp"]
28
33
  },
29
- type: { ...default_attribute, writable: true },
30
- types: { ...default_attribute, collection: true },
34
+ type: { ...string_attribute, writable: true },
35
+ types: string_collection_attribute,
31
36
  tls: boolean_attribute_false
32
37
  };
33
38
 
@@ -59,9 +64,9 @@ export const ServiceTypeDefinition = {
59
64
  properties: {
60
65
  ...networkAddressProperties,
61
66
  ...endpointProperties,
62
- alias: { ...default_attribute, writable: true },
67
+ alias: { ...string_attribute, writable: true },
63
68
  weight: { ...number_attribute, writable: true, default: 1 },
64
- systemd: { ...string_attribute, collection: true, writable: true }
69
+ systemd: { ...string_collection_attribute, writable: true }
65
70
  }
66
71
  };
67
72
 
@@ -3,7 +3,8 @@ import { createHmac } from "node:crypto";
3
3
  import { FileContentProvider } from "npm-pkgbuild";
4
4
  import { isLinkLocal, reverseArpa } from "ip-utilties";
5
5
  import {
6
- default_attribute,
6
+ string_attribute,
7
+ string_collection_attribute,
7
8
  boolean_attribute_writeable_true,
8
9
  boolean_attribute_writeable_false,
9
10
  number_attribute
@@ -48,19 +49,18 @@ const BindServiceTypeDefinition = {
48
49
  hasLinkLocalAdresses: boolean_attribute_writeable_true,
49
50
  hasLocationRecord: boolean_attribute_writeable_true,
50
51
  excludeInterfaceKinds: {
51
- ...default_attribute,
52
- collection: true,
52
+ ...string_collection_attribute,
53
53
  writable: true
54
54
  },
55
55
  exclude: { type: address_types, collection: true, writable: true },
56
56
  notify: boolean_attribute_writeable_false,
57
- recordTTL: { ...default_attribute, writable: true },
57
+ recordTTL: { ...string_attribute, writable: true },
58
58
  serial: { ...number_attribute, writable: true },
59
- refresh: { ...default_attribute, writable: true, default: 36000 },
60
- retry: { ...default_attribute, writable: true, default: 72000 },
61
- expire: { ...default_attribute, writable: true, default: 600000 },
62
- minimum: { ...default_attribute, writable: true, default: 60000 },
63
- allowedUpdates: { ...default_attribute, collection: true, writable: true }
59
+ refresh: { ...string_attribute, writable: true, default: 36000 },
60
+ retry: { ...string_attribute, writable: true, default: 72000 },
61
+ expire: { ...string_attribute, writable: true, default: 600000 },
62
+ minimum: { ...string_attribute, writable: true, default: 60000 },
63
+ allowedUpdates: { ...string_collection_attribute, writable: true }
64
64
  },
65
65
 
66
66
  service: {
@@ -1,7 +1,11 @@
1
1
  import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
3
  import { reverseArpa } from "ip-utilties";
4
- import { default_attribute, boolean_attribute_writeable_true } from "pacc";
4
+ import {
5
+ string_attribute,
6
+ number_attribute,
7
+ boolean_attribute_writeable_true
8
+ } from "pacc";
5
9
  import {
6
10
  Service,
7
11
  sortDescendingByPriority,
@@ -25,29 +29,26 @@ const KeaServiceTypeDefinition = {
25
29
  isCommonOption: true
26
30
  },
27
31
  "renew-timer": {
28
- ...default_attribute,
29
- type: "number",
32
+ ...number_attribute,
30
33
  writable: true,
31
34
  isCommonOption: true,
32
35
  default: 900
33
36
  },
34
37
  "rebind-timer": {
35
- ...default_attribute,
36
- type: "number",
38
+ ...number_attribute,
37
39
  writable: true,
38
40
  isCommonOption: true,
39
41
  default: 1800
40
42
  },
41
43
  "valid-lifetime": {
42
- ...default_attribute,
43
- type: "number",
44
+ ...number_attribute,
44
45
  writable: true,
45
46
  mandatory: true,
46
47
  isCommonOption: true,
47
48
  default: 86400
48
49
  },
49
50
  "ddns-conflict-resolution-mode": {
50
- ...default_attribute,
51
+ ...string_attribute,
51
52
  writable: true,
52
53
  isCommonOption: true
53
54
  //values: ["check-exists-with-dhcid"]
@@ -1,6 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
- import { default_attribute } from "pacc";
3
+ import { string_attribute } from "pacc";
4
4
  import { addType } from "../types.mjs";
5
5
  import { ServiceTypeDefinition, Service } from "../service.mjs";
6
6
  import { writeLines } from "../utils.mjs";
@@ -14,15 +14,15 @@ const OpenLDAPServiceTypeDefinition = {
14
14
  priority: 0.1,
15
15
  properties: {
16
16
  baseDN: {
17
- ...default_attribute,
17
+ ...string_attribute,
18
18
  writable: true
19
19
  },
20
20
  rootDN: {
21
- ...default_attribute,
21
+ ...string_attribute,
22
22
  writable: true
23
23
  },
24
24
  uri: {
25
- ...default_attribute,
25
+ ...string_attribute,
26
26
  writable: true
27
27
  }
28
28
  },
@@ -1,4 +1,4 @@
1
- import { default_attribute } from "pacc";
1
+ import { string_attribute } from "pacc";
2
2
  import { Service, ServiceTypeDefinition } from "pmcf";
3
3
  import { addType } from "../types.mjs";
4
4
 
@@ -9,7 +9,7 @@ const SystemdJournalUploadServiceTypeDefinition = {
9
9
  extends: ServiceTypeDefinition,
10
10
  priority: 0.1,
11
11
  properties: {
12
- url: { ...default_attribute, writable: true }
12
+ url: { ...string_attribute, writable: true }
13
13
  },
14
14
  service: {}
15
15
  };
package/src/subnet.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  familyIP,
7
7
  matchPrefixIP
8
8
  } from "ip-utilties";
9
- import { default_attribute, number_attribute } from "pacc";
9
+ import { string_attribute, number_attribute } from "pacc";
10
10
  import { Base } from "./base.mjs";
11
11
  import { addType } from "./types.mjs";
12
12
 
@@ -17,11 +17,11 @@ const SubnetTypeDefinition = {
17
17
  constructWithIdentifierOnly: true,
18
18
  properties: {
19
19
  address: {
20
- ...default_attribute,
20
+ ...string_attribute,
21
21
  isKey: true
22
22
  },
23
23
  networks: { type: "network", collection: true, writable: true },
24
- prefixLength: { ...number_attribute, writable: false }
24
+ prefixLength: { ...number_attribute }
25
25
  }
26
26
  };
27
27
 
package/types/base.d.mts CHANGED
@@ -15,9 +15,9 @@ export class Base {
15
15
  };
16
16
  type: import("pacc").AttributeDefinition;
17
17
  name: {
18
- isKey: boolean;
19
18
  writable: boolean;
20
19
  type: string;
20
+ isKey: boolean;
21
21
  mandatory: boolean;
22
22
  collection: boolean;
23
23
  private?: boolean;
@@ -99,18 +99,18 @@ export class Base {
99
99
  env?: string[] | string;
100
100
  };
101
101
  tags: {
102
- collection: boolean;
103
102
  writable: boolean;
103
+ collection: boolean;
104
104
  type: string;
105
105
  isKey: boolean;
106
106
  mandatory: boolean;
107
- private?: boolean;
108
- depends?: string;
109
- description?: string;
110
- default?: any;
111
- set?: Function;
112
- get?: Function;
113
- env?: string[] | string;
107
+ private: boolean;
108
+ depends: string;
109
+ description: string;
110
+ default: any;
111
+ set: Function;
112
+ get: Function;
113
+ env: string[] | string;
114
114
  };
115
115
  };
116
116
  };