pmcf 2.65.2 → 2.65.4

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": "2.65.2",
3
+ "version": "2.65.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -16,7 +16,7 @@ import {
16
16
  addresses
17
17
  } from "pmcf";
18
18
  import { addType } from "../types.mjs";
19
- import { serviceTypeEndpoints } from "../service-types.mjs";
19
+ import { serviceTypeEndpoints, addServiceTypes } from "../service-types.mjs";
20
20
  import { Service, ServiceTypeDefinition } from "../service.mjs";
21
21
  import { ExtraSourceServiceTypeDefinition } from "../extra-source-service.mjs";
22
22
  import { addHook } from "../hooks.mjs";
@@ -91,6 +91,9 @@ const BindServiceTypeDefinition = {
91
91
  };
92
92
 
93
93
  const BindServiceTypes = {
94
+ "bind": {
95
+ extends: ["dns"]
96
+ },
94
97
  "bind-statistics": {
95
98
  endpoints: [
96
99
  {
@@ -105,19 +108,8 @@ const BindServiceTypes = {
105
108
  }
106
109
  };
107
110
 
108
- const rdncEndpoint = {
109
- type: "rdnc",
110
- port: 953,
111
- protocol: "tcp",
112
- tls: false
113
- };
114
-
115
- const statisticsEndpoint = {
116
- type: "bind-statistics",
117
- port: 19521,
118
- protocol: "tcp",
119
- tls: false
120
- };
111
+ const rdncEndpoint = BindServiceTypes.rdnc.endpoints[0];
112
+ const statisticsEndpoint = BindServiceTypes["bind-statistics"].endpoints[0];
121
113
 
122
114
  function addressesStatement(prefix, objects, generateEmpty = false) {
123
115
  const body = asArray(objects).map(name => ` ${name};`);
@@ -150,6 +142,7 @@ export class BindService extends ExtraSourceService {
150
142
 
151
143
  static {
152
144
  addType(this);
145
+ addServiceTypes(BindServiceTypes);
153
146
  }
154
147
 
155
148
  static get typeDefinition() {
@@ -12,6 +12,7 @@ import {
12
12
  SUBNET_LOCALHOST_IPV4,
13
13
  SUBNET_LOCALHOST_IPV6
14
14
  } from "pmcf";
15
+ import { addServiceTypes } from "../service-types.mjs";
15
16
  import { addType } from "../types.mjs";
16
17
  import { writeLines } from "../utils.mjs";
17
18
 
@@ -73,12 +74,38 @@ const controlDDNSEndpoint = {
73
74
  path: "/run/kea/ddns-ctrl-socket"
74
75
  };
75
76
 
77
+ const KEAServiceTypes = {
78
+ kea: { extends: ["dhcp"] },
79
+ "kea-ddns": {
80
+ endpoints: [ddnsEndpoint]
81
+ },
82
+ "kea-control-agent": {
83
+ endpoints: [controlAgentEndpoint]
84
+ },
85
+ "kea-ha-4": {
86
+ endpoints: [ha4Endpoint]
87
+ },
88
+ "kea-ha-6": {
89
+ endpoints: [ha6Endpoint]
90
+ },
91
+ "kea-control-dhcp4": {
92
+ endpoints: [control4Endpoint]
93
+ },
94
+ "kea-control-dhcp6": {
95
+ endpoints: [control6Endpoint]
96
+ },
97
+ "kea-control-ddns": {
98
+ endpoints: [controlDDNSEndpoint]
99
+ }
100
+ };
101
+
76
102
  const keaVersion = 2.6;
77
103
  export const fetureHasHTTPEndpoints = keaVersion > 2.7;
78
104
 
79
105
  export class KeaService extends Service {
80
106
  static {
81
107
  addType(this);
108
+ addServiceTypes(KEAServiceTypes);
82
109
  }
83
110
 
84
111
  static get typeDefinition() {
@@ -367,9 +394,7 @@ export class KeaService extends Service {
367
394
 
368
395
  if (addr && subnet.matchesAddress(addr)) {
369
396
  ip =
370
- family == 6
371
- ? { "ip-addresses": [addr] }
372
- : { "ip-address": addr };
397
+ family == 6 ? { "ip-addresses": [addr] } : { "ip-address": addr };
373
398
  }
374
399
 
375
400
  return {