pmcf 3.10.14 → 3.10.16

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 (43) hide show
  1. package/package.json +1 -1
  2. package/src/base.mjs +1 -1
  3. package/src/cluster.mjs +2 -3
  4. package/src/filter.mjs +8 -11
  5. package/src/host.mjs +10 -10
  6. package/src/location.mjs +2 -2
  7. package/src/network-support.mjs +6 -6
  8. package/src/owner.mjs +6 -6
  9. package/src/service.mjs +3 -3
  10. package/src/services/bind.mjs +5 -7
  11. package/src/services/openldap.mjs +4 -13
  12. package/src/services/systemd-journal-upload.mjs +1 -1
  13. package/src/subnet.mjs +4 -7
  14. package/src/types.mjs +0 -1
  15. package/types/base.d.mts +1 -14
  16. package/types/cluster.d.mts +27 -378
  17. package/types/extra-source-service.d.mts +8 -112
  18. package/types/host.d.mts +15 -210
  19. package/types/location.d.mts +21 -294
  20. package/types/network-interfaces/ethernet.d.mts +14 -196
  21. package/types/network-interfaces/loopback.d.mts +14 -196
  22. package/types/network-interfaces/network-interface.d.mts +14 -196
  23. package/types/network-interfaces/tun.d.mts +14 -196
  24. package/types/network-interfaces/wireguard.d.mts +14 -196
  25. package/types/network-interfaces/wlan.d.mts +21 -294
  26. package/types/network-support.d.mts +8 -85
  27. package/types/network.d.mts +12 -168
  28. package/types/owner.d.mts +10 -140
  29. package/types/root.d.mts +21 -294
  30. package/types/service.d.mts +20 -252
  31. package/types/services/bind.d.mts +20 -280
  32. package/types/services/chrony.d.mts +16 -224
  33. package/types/services/headscale.d.mts +16 -224
  34. package/types/services/influxdb.d.mts +16 -224
  35. package/types/services/kea.d.mts +16 -224
  36. package/types/services/mosquitto.d.mts +16 -224
  37. package/types/services/openldap.d.mts +19 -266
  38. package/types/services/systemd-journal-remote.d.mts +16 -224
  39. package/types/services/systemd-journal-upload.d.mts +17 -238
  40. package/types/services/systemd-journal.d.mts +16 -224
  41. package/types/services/systemd-resolved.d.mts +16 -224
  42. package/types/services/systemd-timesyncd.d.mts +16 -224
  43. package/types/subnet.d.mts +3 -42
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "3.10.14",
3
+ "version": "3.10.16",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -26,7 +26,7 @@ const BaseTypeDefinition = {
26
26
  name: name_attribute_writable,
27
27
  description: { ...description_attribute, writable: true },
28
28
  priority: number_attribute_writable,
29
- directory: { ...string_attribute, writable: false },
29
+ directory: string_attribute_writable,
30
30
  packaging: string_attribute_writable,
31
31
  disabled: boolean_attribute_writable,
32
32
  tags: string_collection_attribute_writable
package/src/cluster.mjs CHANGED
@@ -13,11 +13,11 @@ const ClusterTypeDefinition = {
13
13
  priority: 0.7,
14
14
  extends: Host.typeDefinition,
15
15
  attributes: {
16
- routerId: { ...number_attribute_writable },
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 },
19
19
  members: { type: "network_interface", collection: true, writable: false },
20
- checkInterval: { ...number_attribute_writable }
20
+ checkInterval: number_attribute_writable
21
21
  }
22
22
  };
23
23
 
@@ -35,7 +35,6 @@ export class Cluster extends Host {
35
35
  return ClusterTypeDefinition;
36
36
  }
37
37
 
38
-
39
38
  set masters(value) {
40
39
  this._masters.push(value);
41
40
  value.cluster = this;
package/src/filter.mjs CHANGED
@@ -55,31 +55,28 @@ 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.attributes)) {
59
- switch (property.type[0]) {
58
+ for (const [name, attribute] of Object.entries(t.attributes)) {
59
+ switch (attribute.type[0]) {
60
60
  case "boolean":
61
- if (
62
- filter[property.name] !== undefined &&
63
- filter[property.name] != object[property.name]
64
- ) {
61
+ if (filter[name] !== undefined && filter[name] != object[name]) {
65
62
  continue advance;
66
63
  }
67
64
  break;
68
65
 
69
66
  case "number":
70
- if (!filterNumber(property.name)) {
67
+ if (!filterNumber(name)) {
71
68
  continue advance;
72
69
  }
73
70
  break;
74
71
  case "string":
75
- if (property.collection && filter[property.name] !== undefined) {
76
- const value = object[property.name];
72
+ if (attribute.collection && filter[name] !== undefined) {
73
+ const value = object[name];
77
74
 
78
- if (value instanceof Set && value.has(filter[property.name])) {
75
+ if (value instanceof Set && value.has(filter[name])) {
79
76
  break;
80
77
  }
81
78
  continue advance;
82
- } else if (!filterString(property.name)) {
79
+ } else if (!filterString(name)) {
83
80
  continue advance;
84
81
  }
85
82
  break;
package/src/host.mjs CHANGED
@@ -36,21 +36,21 @@ const HostTypeDefinition = {
36
36
  writable: true
37
37
  },
38
38
  services: { type: "service", collection: true, writable: true },
39
- aliases: { ...string_collection_attribute_writable },
39
+ aliases: string_collection_attribute_writable,
40
40
  os: {
41
41
  ...string_attribute_writable,
42
42
  values: ["osx", "windows", "linux"]
43
43
  },
44
- "machine-id": { ...string_attribute_writable },
45
- distribution: { ...string_attribute_writable },
44
+ "machine-id": string_attribute_writable,
45
+ distribution: string_attribute_writable,
46
46
  deployment: {
47
47
  ...string_attribute_writable,
48
48
  values: ["production", "development"]
49
49
  },
50
- weight: { ...number_attribute_writable },
51
- serial: { ...string_attribute_writable },
52
- vendor: { ...string_attribute_writable },
53
- keymap: { ...string_attribute_writable },
50
+ weight: number_attribute_writable,
51
+ serial: string_attribute_writable,
52
+ vendor: string_attribute_writable,
53
+ keymap: string_attribute_writable,
54
54
  chassis: {
55
55
  ...string_attribute_writable,
56
56
  values: [
@@ -73,9 +73,9 @@ const HostTypeDefinition = {
73
73
  ...string_attribute_writable,
74
74
  values: ["x86", "x86_64", "aarch64", "armv7"]
75
75
  },
76
- replaces: { ...string_collection_attribute_writable },
77
- depends: { ...string_collection_attribute_writable },
78
- provides: { ...string_collection_attribute_writable },
76
+ replaces: string_collection_attribute_writable,
77
+ depends: string_collection_attribute_writable,
78
+ provides: string_collection_attribute_writable,
79
79
  extends: { type: "host", collection: true, writable: true },
80
80
  model: string_attribute,
81
81
  isModel: boolean_attribute_false
package/src/location.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FileContentProvider } from "npm-pkgbuild";
2
- import { string_collection_attribute } from "pacc";
2
+ import { string_collection_attribute_writable } 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
  attributes: {
13
- locales: { ...string_collection_attribute, writable: true }
13
+ locales: string_collection_attribute_writable
14
14
  }
15
15
  };
16
16
 
@@ -22,8 +22,8 @@ export const networkAttributes = {
22
22
  ...string_attribute_writable,
23
23
  values: ["loopback", "ethernet", "wlan", "wireguard", "fiber", "dsl"]
24
24
  },
25
- ssid: { ...string_attribute_writable },
26
- psk: { ...string_attribute_writable },
25
+ ssid: string_attribute_writable,
26
+ psk: string_attribute_writable,
27
27
  secretName: string_attribute_writable,
28
28
  metric: { ...number_attribute_writable /*default: 1004*/ },
29
29
  mtu: { ...number_attribute_writable, default: 1500 },
@@ -33,8 +33,8 @@ export const networkAttributes = {
33
33
 
34
34
  export const networkAddressAttributes = {
35
35
  hostName: { ...hostname_attribute, writable: true },
36
- cidrAddresses: { ...string_collection_attribute_writable },
37
- cidrAddress: { ...string_attribute_writable },
38
- addresses: { ...string_collection_attribute_writable },
39
- address: { ...string_attribute_writable }
36
+ cidrAddresses: string_collection_attribute_writable ,
37
+ cidrAddress: string_attribute_writable,
38
+ addresses: string_collection_attribute_writable,
39
+ address: string_attribute_writable
40
40
  };
package/src/owner.mjs CHANGED
@@ -19,12 +19,12 @@ const OwnerTypeDefinition = {
19
19
  hosts: { type: "host", collection: true, writable: true },
20
20
  clusters: { type: "cluster", collection: true, writable: true },
21
21
  subnets: { type: Subnet.typeDefinition, collection: true, writable: true },
22
- country: { ...string_attribute_writable },
23
- domain: { ...string_attribute_writable },
24
- domains: { ...string_collection_attribute_writable },
25
- timezone: { ...string_attribute_writable },
26
- architectures: { ...string_collection_attribute_writable },
27
- locales: { ...string_collection_attribute_writable },
22
+ country: string_attribute_writable,
23
+ domain: string_attribute_writable,
24
+ domains: string_collection_attribute_writable,
25
+ timezone: string_attribute_writable,
26
+ architectures: string_collection_attribute_writable,
27
+ locales: string_collection_attribute_writable,
28
28
  administratorEmail: { ...email_attribute, writable: true }
29
29
  }
30
30
  };
package/src/service.mjs CHANGED
@@ -26,12 +26,12 @@ import {
26
26
  } from "./dns-utils.mjs";
27
27
 
28
28
  export const endpointAttributes = {
29
- port: { ...number_attribute_writable },
29
+ port: number_attribute_writable,
30
30
  protocol: {
31
31
  ...string_attribute_writable,
32
32
  values: ["tcp", "udp"]
33
33
  },
34
- type: { ...string_attribute_writable },
34
+ type: string_attribute_writable,
35
35
  types: string_collection_attribute,
36
36
  tls: boolean_attribute_false
37
37
  };
@@ -64,7 +64,7 @@ export const ServiceTypeDefinition = {
64
64
  attributes: {
65
65
  ...networkAddressAttributes,
66
66
  ...endpointAttributes,
67
- alias: { ...string_attribute_writable },
67
+ alias: string_attribute_writable,
68
68
  weight: { ...number_attribute_writable /*default: 1*/ },
69
69
  systemd: string_collection_attribute_writable
70
70
  }
@@ -6,7 +6,7 @@ import {
6
6
  string_attribute_writable,
7
7
  boolean_attribute_writable_true,
8
8
  boolean_attribute_writable_false,
9
- number_attribute,
9
+ number_attribute_writable,
10
10
  string_collection_attribute_writable
11
11
  } from "pacc";
12
12
  import { writeLines, asArray } from "../utils.mjs";
@@ -50,18 +50,16 @@ const BindServiceTypeDefinition = {
50
50
  hasCatalog: boolean_attribute_writable_true,
51
51
  hasLinkLocalAdresses: boolean_attribute_writable_false,
52
52
  hasLocationRecord: boolean_attribute_writable_true,
53
- excludeInterfaceKinds: {
54
- ...string_collection_attribute_writable
55
- },
53
+ excludeInterfaceKinds: string_collection_attribute_writable,
56
54
  exclude: { type: networkAddressType, collection: true, writable: true },
57
55
  notify: boolean_attribute_writable_false,
58
- recordTTL: { ...string_attribute_writable },
59
- serial: { ...number_attribute, writable: true },
56
+ recordTTL: string_attribute_writable,
57
+ serial: number_attribute_writable,
60
58
  refresh: { ...string_attribute_writable, default: 36000 },
61
59
  retry: { ...string_attribute_writable, default: 72000 },
62
60
  expire: { ...string_attribute_writable, default: 600000 },
63
61
  minimum: { ...string_attribute_writable, default: 60000 },
64
- allowedUpdates: { ...string_collection_attribute_writable }
62
+ allowedUpdates: string_collection_attribute_writable
65
63
  },
66
64
 
67
65
  service: {
@@ -1,6 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
- import { string_attribute } from "pacc";
3
+ import { string_attribute_writable } from "pacc";
4
4
  import { addType } from "../types.mjs";
5
5
  import { ServiceTypeDefinition, Service } from "../service.mjs";
6
6
  import { writeLines } from "../utils.mjs";
@@ -13,18 +13,9 @@ const OpenLDAPServiceTypeDefinition = {
13
13
  extends: ServiceTypeDefinition,
14
14
  priority: 0.1,
15
15
  attributes: {
16
- baseDN: {
17
- ...string_attribute,
18
- writable: true
19
- },
20
- rootDN: {
21
- ...string_attribute,
22
- writable: true
23
- },
24
- uri: {
25
- ...string_attribute,
26
- writable: true
27
- }
16
+ baseDN: string_attribute_writable,
17
+ rootDN: string_attribute_writable,
18
+ uri: string_attribute_writable
28
19
  },
29
20
  service: {
30
21
  extends: ["ldap"],
@@ -9,7 +9,7 @@ const SystemdJournalUploadServiceTypeDefinition = {
9
9
  extends: ServiceTypeDefinition,
10
10
  priority: 0.1,
11
11
  attributes: {
12
- url: { ...string_attribute_writable }
12
+ url: string_attribute_writable
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 { string_attribute, number_attribute } from "pacc";
9
+ import { string_attribute, name_attribute, number_attribute } from "pacc";
10
10
  import { Base } from "./base.mjs";
11
11
  import { addType } from "./types.mjs";
12
12
 
@@ -16,13 +16,10 @@ const SubnetTypeDefinition = {
16
16
  priority: 0.6,
17
17
  constructWithIdentifierOnly: true,
18
18
  attributes: {
19
- address: {
20
- ...string_attribute,
21
- isKey: true
22
- },
19
+ address: name_attribute,
23
20
  networks: { type: "network", collection: true, writable: true },
24
- prefixLength: { ...number_attribute },
25
- family: { ...string_attribute }
21
+ prefixLength: number_attribute,
22
+ family: string_attribute
26
23
  }
27
24
  };
28
25
 
package/src/types.mjs CHANGED
@@ -30,7 +30,6 @@ export function resolveTypeLinks() {
30
30
  }
31
31
  for (const [path, attribute] of attributeIterator(type.attributes)) {
32
32
  const name = path.join(".");
33
- attribute.name = name;
34
33
  const ts = [];
35
34
 
36
35
  for (const type of asArray(attribute.type)) {
package/types/base.d.mts CHANGED
@@ -30,20 +30,7 @@ export class Base {
30
30
  env?: string[] | string;
31
31
  };
32
32
  priority: import("pacc").AttributeDefinition;
33
- directory: {
34
- writable: boolean;
35
- type: string;
36
- isKey: boolean;
37
- mandatory: boolean;
38
- collection: boolean;
39
- private?: boolean;
40
- depends?: string;
41
- description?: string;
42
- default?: any;
43
- set?: Function;
44
- get?: Function;
45
- env?: string[] | string;
46
- };
33
+ directory: import("pacc").AttributeDefinition;
47
34
  packaging: import("pacc").AttributeDefinition;
48
35
  disabled: import("pacc").AttributeDefinition;
49
36
  tags: import("pacc").AttributeDefinition;