pmcf 2.65.2 → 2.65.3

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.3",
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
 
@@ -31,6 +32,13 @@ const ddnsEndpoint = {
31
32
  tls: false
32
33
  };
33
34
 
35
+ const KEAServiceTypes = {
36
+ kea: { extends: ["dhcp"] },
37
+ "kea-ddns": {
38
+ endpoints: [ddnsEndpoint]
39
+ }
40
+ };
41
+
34
42
  const controlAgentEndpoint = {
35
43
  type: "kea-control-agent",
36
44
  port: 53002,
@@ -79,6 +87,7 @@ export const fetureHasHTTPEndpoints = keaVersion > 2.7;
79
87
  export class KeaService extends Service {
80
88
  static {
81
89
  addType(this);
90
+ addServiceTypes(KEAServiceTypes);
82
91
  }
83
92
 
84
93
  static get typeDefinition() {
@@ -367,9 +376,7 @@ export class KeaService extends Service {
367
376
 
368
377
  if (addr && subnet.matchesAddress(addr)) {
369
378
  ip =
370
- family == 6
371
- ? { "ip-addresses": [addr] }
372
- : { "ip-address": addr };
379
+ family == 6 ? { "ip-addresses": [addr] } : { "ip-address": addr };
373
380
  }
374
381
 
375
382
  return {