pmcf 4.25.11 → 4.25.13

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": "4.25.11",
3
+ "version": "4.25.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -3,14 +3,6 @@ import { SUBNET_LOCALHOST_IPV4, SUBNET_LOCALHOST_IPV6 } from "pmcf";
3
3
  import { SkeletonNetworkInterface } from "./skeleton.mjs";
4
4
  import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
5
5
 
6
- const LoopbackNetworkInterfaceTypeDefinition = {
7
- name: "loopback",
8
- extends: NetworkInterfaceTypeDefinition,
9
- specializationOf: NetworkInterfaceTypeDefinition,
10
- owners: NetworkInterfaceTypeDefinition.owners,
11
- key: "name"
12
- };
13
-
14
6
  const _localAddresses = new Map([
15
7
  ["127.0.0.1", SUBNET_LOCALHOST_IPV4],
16
8
  ["::1", SUBNET_LOCALHOST_IPV6]
@@ -19,7 +11,13 @@ const _localAddresses = new Map([
19
11
  const _localDomains = new Set(["localhost"]);
20
12
 
21
13
  export class LoopbackNetworkInterface extends SkeletonNetworkInterface {
22
- static typeDefinition = LoopbackNetworkInterfaceTypeDefinition;
14
+ static name = "loopback";
15
+ static extends = NetworkInterfaceTypeDefinition;
16
+ static specializationOf = NetworkInterfaceTypeDefinition;
17
+ static owners = NetworkInterfaceTypeDefinition.owners;
18
+ static key = "name";
19
+
20
+ static typeDefinition = this;
23
21
 
24
22
  static {
25
23
  addType(this);
@@ -30,7 +28,7 @@ export class LoopbackNetworkInterface extends SkeletonNetworkInterface {
30
28
  }
31
29
 
32
30
  get kind() {
33
- return LoopbackNetworkInterfaceTypeDefinition.name;
31
+ return "loopback";
34
32
  }
35
33
 
36
34
  set scope(v) {}
@@ -2,23 +2,21 @@ import { addType } from "pacc";
2
2
  import { NetworkInterface } from "./network-interface.mjs";
3
3
  import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
4
4
 
5
- const TUNdNetworkInterfaceTypeDefinition = {
6
- name: "tun",
7
- extends: NetworkInterfaceTypeDefinition,
8
- specializationOf: NetworkInterfaceTypeDefinition,
9
- owners: NetworkInterfaceTypeDefinition.owners,
10
- key: "name"
11
- };
12
-
13
5
  export class TUNNetworkInterface extends NetworkInterface {
14
- static typeDefinition = TUNdNetworkInterfaceTypeDefinition;
6
+ static name = "tun";
7
+ static extends = NetworkInterfaceTypeDefinition;
8
+ static specializationOf = NetworkInterfaceTypeDefinition;
9
+ static owners = NetworkInterfaceTypeDefinition.owners;
10
+ static key = "name";
11
+
12
+ static typeDefinition = this;
15
13
 
16
14
  static {
17
15
  addType(this);
18
16
  }
19
17
 
20
18
  get kind() {
21
- return TUNdNetworkInterfaceTypeDefinition.name;
19
+ return "tun";
22
20
  }
23
21
 
24
22
  async systemdDefinitions(dir, packageData) {}
@@ -2,23 +2,21 @@ import { addType } from "pacc";
2
2
  import { SkeletonNetworkInterface } from "./skeleton.mjs";
3
3
  import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
4
4
 
5
- const WireguardNetworkInterfaceTypeDefinition = {
6
- name: "wireguard",
7
- extends: NetworkInterfaceTypeDefinition,
8
- specializationOf: NetworkInterfaceTypeDefinition,
9
- owners: NetworkInterfaceTypeDefinition.owners,
10
- key: "name"
11
- };
12
-
13
5
  export class WireguardNetworkInterface extends SkeletonNetworkInterface {
14
- static typeDefinition = WireguardNetworkInterfaceTypeDefinition;
6
+ static name = "wireguard";
7
+ static extends = NetworkInterfaceTypeDefinition;
8
+ static specializationOf = NetworkInterfaceTypeDefinition;
9
+ static owners = NetworkInterfaceTypeDefinition.owners;
10
+ static key = "name";
11
+
12
+ static typeDefinition = this;
15
13
 
16
14
  static {
17
15
  addType(this);
18
16
  }
19
-
17
+
20
18
  get kind() {
21
- return WireguardNetworkInterfaceTypeDefinition.name;
19
+ return "wireguard";
22
20
  }
23
21
 
24
22
  get ipAddresses() {
@@ -12,21 +12,19 @@ import {
12
12
  EthernetNetworkInterfaceTypeDefinition
13
13
  } from "./ethernet.mjs";
14
14
 
15
- const WLANNetworkInterfaceTypeDefinition = {
16
- name: "wlan",
17
- extends: EthernetNetworkInterfaceTypeDefinition,
18
- specializationOf: NetworkInterfaceTypeDefinition,
19
- owners: EthernetNetworkInterfaceTypeDefinition.owners,
20
- key: "name",
21
- attributes: {
15
+ export class WLANNetworkInterface extends EthernetNetworkInterface {
16
+ static name = "wlan";
17
+ static extends = EthernetNetworkInterfaceTypeDefinition;
18
+ static specializationOf = NetworkInterfaceTypeDefinition;
19
+ static owners = EthernetNetworkInterfaceTypeDefinition.owners;
20
+ static key = "name";
21
+ static attributes = {
22
22
  ssid: string_attribute_writable,
23
23
  psk: secret_attribute_writable,
24
24
  secretName: string_attribute_writable
25
- }
26
- };
25
+ };
27
26
 
28
- export class WLANNetworkInterface extends EthernetNetworkInterface {
29
- static typeDefinition = WLANNetworkInterfaceTypeDefinition;
27
+ static typeDefinition = this;
30
28
 
31
29
  static {
32
30
  addType(this);
@@ -41,7 +39,7 @@ export class WLANNetworkInterface extends EthernetNetworkInterface {
41
39
  _secretName;
42
40
 
43
41
  get kind() {
44
- return WLANNetworkInterfaceTypeDefinition.name;
42
+ return "wlan";
45
43
  }
46
44
 
47
45
  set secretName(value) {
@@ -8,54 +8,50 @@ import {
8
8
  import { addServiceType, Base } from "pmcf";
9
9
  import { ServiceTypeDefinition, Service } from "../service.mjs";
10
10
 
11
- const ALPMRepositoryTypeDefinition = {
12
- name: "alpm_repository",
13
- extends: Base.typeDefinition,
14
- key: "name",
15
- attributes: {
11
+ class ALPMRepository extends Base {
12
+ static name = "alpm_repository";
13
+ static extends = Base.typeDefinition;
14
+ static key = "name";
15
+ static attributes = {
16
16
  name: name_attribute_writable,
17
17
  base: string_attribute_writable,
18
18
  architectures: string_set_attribute_writable
19
- }
20
- };
19
+ };
21
20
 
22
- class ALPMRepository extends Base {
23
- static typeDefinition = ALPMRepositoryTypeDefinition;
21
+ static typeDefinition = this;
24
22
  static {
25
23
  addType(this);
26
24
  }
27
25
  }
28
26
 
29
- const ALPMServiceTypeDefinition = {
30
- name: "alpm",
31
- priority: 1,
32
- extends: ServiceTypeDefinition,
33
- specializationOf: ServiceTypeDefinition,
34
- owners: ServiceTypeDefinition.owners,
35
- attributes: {
27
+ export class ALPMService extends Service {
28
+ static name = "alpm";
29
+ static priority = 1;
30
+ static extends = ServiceTypeDefinition;
31
+ static specializationOf = ServiceTypeDefinition;
32
+ static owners = ServiceTypeDefinition.owners;
33
+ static attributes = {
36
34
  repositories: {
37
35
  ...default_attribute_writable,
38
36
  type: "alpm_repository",
39
37
  collection: true
40
38
  }
41
- },
39
+ };
42
40
 
43
- service: {
41
+ static service = {
44
42
  extends: ["https", "http"]
45
- }
46
- };
43
+ };
47
44
 
48
- export class ALPMService extends Service {
49
- static typeDefinition = ALPMServiceTypeDefinition;
45
+ static typeDefinition = this;
50
46
  static {
51
47
  addType(this);
52
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
48
+ addServiceType(this.service, this.name);
53
49
  }
54
50
 
55
51
  repositories = new Map();
56
52
 
57
53
  typeNamed(type, name) {
58
- if (type === ALPMRepositoryTypeDefinition.name) {
54
+ if (type === ALPMService.name) {
59
55
  return this.repositories.get(name);
60
56
  }
61
57
 
@@ -2,29 +2,27 @@ import { addType } from "pacc";
2
2
  import { addServiceType } from "pmcf";
3
3
  import { ServiceTypeDefinition, Service } from "../service.mjs";
4
4
 
5
- const PostfixServiceTypeDefinition = {
6
- name: "postfix",
7
- priority: 1,
8
- extends: ServiceTypeDefinition,
9
- specializationOf: ServiceTypeDefinition,
10
- owners: ServiceTypeDefinition.owners,
11
- key: "name",
12
- attributes: {},
13
- service: {
5
+ export class PostfixService extends Service {
6
+ static name = "postfix";
7
+ static priority = 1;
8
+ static extends = ServiceTypeDefinition;
9
+ static specializationOf = ServiceTypeDefinition;
10
+ static owners = ServiceTypeDefinition.owners;
11
+ static key = "name";
12
+ static attributes = {};
13
+ static service = {
14
14
  systemdService: "postfix.service",
15
15
  extends: ["smtp", "lmtp", "submission"],
16
16
  services: {}
17
- }
18
- };
17
+ };
19
18
 
20
- export class PostfixService extends Service {
21
- static typeDefinition = PostfixServiceTypeDefinition;
19
+ static typeDefinition = this;
22
20
  static {
23
21
  addType(this);
24
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
22
+ addServiceType(this.service, this.name);
25
23
  }
26
24
 
27
25
  get type() {
28
- return PostfixServiceTypeDefinition.name;
26
+ return "postfix";
29
27
  }
30
28
  }
@@ -22,6 +22,6 @@ export class TailscaleService extends Service {
22
22
  static typeDefinition = this;
23
23
 
24
24
  static {
25
- addType(TailscaleService);
25
+ addType(this);
26
26
  }
27
27
  }