pmcf 3.8.12 → 3.8.14
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 +1 -1
- package/src/services/kea.mjs +16 -19
- package/src/subnet.mjs +6 -2
- package/types/cluster.d.mts +14 -0
- package/types/location.d.mts +28 -0
- package/types/network.d.mts +14 -0
- package/types/owner.d.mts +14 -0
- package/types/root.d.mts +28 -0
- package/types/services/kea.d.mts +1 -2
- package/types/subnet.d.mts +14 -0
package/package.json
CHANGED
package/src/services/kea.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { join } from "node:path";
|
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
3
|
import { reverseArpa } from "ip-utilties";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
string_attribute_writable,
|
|
6
6
|
number_attribute_writable,
|
|
7
7
|
boolean_attribute_writable_true
|
|
8
8
|
} from "pacc";
|
|
@@ -45,8 +45,7 @@ const KeaServiceTypeDefinition = {
|
|
|
45
45
|
default: 86400
|
|
46
46
|
},
|
|
47
47
|
"ddns-conflict-resolution-mode": {
|
|
48
|
-
...
|
|
49
|
-
writable: true,
|
|
48
|
+
...string_attribute_writable,
|
|
50
49
|
isCommonOption: true
|
|
51
50
|
//values: ["check-exists-with-dhcid","no-check-with-dhcid"]
|
|
52
51
|
}
|
|
@@ -126,8 +125,7 @@ const KeaServiceTypeDefinition = {
|
|
|
126
125
|
}
|
|
127
126
|
};
|
|
128
127
|
|
|
129
|
-
const keaVersion = 3.0;
|
|
130
|
-
export const fetureHasHTTPEndpoints = keaVersion >= 3.0;
|
|
128
|
+
const keaVersion = "3.0.1";
|
|
131
129
|
|
|
132
130
|
export class KeaService extends Service {
|
|
133
131
|
static {
|
|
@@ -148,9 +146,7 @@ export class KeaService extends Service {
|
|
|
148
146
|
}
|
|
149
147
|
|
|
150
148
|
async *preparePackages(dir) {
|
|
151
|
-
const ctrlAgentEndpoint = this.endpoint(
|
|
152
|
-
fetureHasHTTPEndpoints ? "kea-ha-4" : "kea-control-agent"
|
|
153
|
-
);
|
|
149
|
+
const ctrlAgentEndpoint = this.endpoint("kea-ha-4");
|
|
154
150
|
|
|
155
151
|
if (!ctrlAgentEndpoint) {
|
|
156
152
|
return;
|
|
@@ -193,9 +189,7 @@ export class KeaService extends Service {
|
|
|
193
189
|
)
|
|
194
190
|
.sort(sortDescendingByPriority)
|
|
195
191
|
.map((dhcp, i) => {
|
|
196
|
-
const ctrlAgentEndpoint = dhcp.endpoint(
|
|
197
|
-
fetureHasHTTPEndpoints ? `kea-ha-${family}` : "kea-control-agent"
|
|
198
|
-
);
|
|
192
|
+
const ctrlAgentEndpoint = dhcp.endpoint(`kea-ha-${family}`);
|
|
199
193
|
|
|
200
194
|
if (ctrlAgentEndpoint) {
|
|
201
195
|
return {
|
|
@@ -421,6 +415,13 @@ export class KeaService extends Service {
|
|
|
421
415
|
const subnets = [...this.subnets].filter(
|
|
422
416
|
s => s !== SUBNET_LOCALHOST_IPV4 && s !== SUBNET_LOCALHOST_IPV6
|
|
423
417
|
);
|
|
418
|
+
|
|
419
|
+
const pools = (subnet) => {
|
|
420
|
+
return subnet.dhcpPools.map(pool => {
|
|
421
|
+
return { pool: Array.isArray(pool) ? pool.join(" - ") : pool };
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
|
|
424
425
|
const dhcp4 = {
|
|
425
426
|
Dhcp4: {
|
|
426
427
|
...(await commonConfig("4")),
|
|
@@ -430,16 +431,14 @@ export class KeaService extends Service {
|
|
|
430
431
|
return {
|
|
431
432
|
id: index + 1,
|
|
432
433
|
subnet: subnet.longAddress,
|
|
433
|
-
pools: subnet
|
|
434
|
-
|
|
435
|
-
}),
|
|
434
|
+
pools: pools(subnet),
|
|
435
|
+
reservations: reservations(subnet, "4"),
|
|
436
436
|
"option-data": [
|
|
437
437
|
{
|
|
438
438
|
name: "routers",
|
|
439
439
|
data: network.gateway.address
|
|
440
440
|
}
|
|
441
|
-
]
|
|
442
|
-
reservations: reservations(subnet, "4")
|
|
441
|
+
]
|
|
443
442
|
};
|
|
444
443
|
})
|
|
445
444
|
}
|
|
@@ -453,9 +452,7 @@ export class KeaService extends Service {
|
|
|
453
452
|
return {
|
|
454
453
|
id: index + 1,
|
|
455
454
|
subnet: subnet.longAddress,
|
|
456
|
-
pools: subnet
|
|
457
|
-
return { pool: range.join(" - ") };
|
|
458
|
-
}),
|
|
455
|
+
pools: pools(subnet),
|
|
459
456
|
reservations: reservations(subnet, "6")
|
|
460
457
|
};
|
|
461
458
|
})
|
package/src/subnet.mjs
CHANGED
|
@@ -21,7 +21,8 @@ const SubnetTypeDefinition = {
|
|
|
21
21
|
isKey: true
|
|
22
22
|
},
|
|
23
23
|
networks: { type: "network", collection: true, writable: true },
|
|
24
|
-
prefixLength: { ...number_attribute }
|
|
24
|
+
prefixLength: { ...number_attribute },
|
|
25
|
+
family: { ...string_attribute }
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -66,8 +67,11 @@ export class Subnet extends Base {
|
|
|
66
67
|
|
|
67
68
|
get dhcpPools() {
|
|
68
69
|
/* TODO where to take values from ? */
|
|
70
|
+
|
|
69
71
|
return [
|
|
70
|
-
|
|
72
|
+
this.family === "IPv6"
|
|
73
|
+
? this.prefix
|
|
74
|
+
: rangeIP(this.prefix, this.prefixLength, 51, 6).map(a => decodeIP(a))
|
|
71
75
|
];
|
|
72
76
|
}
|
|
73
77
|
|
package/types/cluster.d.mts
CHANGED
|
@@ -106,6 +106,20 @@ export class Cluster extends Host {
|
|
|
106
106
|
get?: Function;
|
|
107
107
|
env?: string[] | string;
|
|
108
108
|
};
|
|
109
|
+
family: {
|
|
110
|
+
type: string;
|
|
111
|
+
isKey: boolean;
|
|
112
|
+
writable: boolean;
|
|
113
|
+
mandatory: boolean;
|
|
114
|
+
collection: boolean;
|
|
115
|
+
private?: boolean;
|
|
116
|
+
depends?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
default?: any;
|
|
119
|
+
set?: Function;
|
|
120
|
+
get?: Function;
|
|
121
|
+
env?: string[] | string;
|
|
122
|
+
};
|
|
109
123
|
};
|
|
110
124
|
};
|
|
111
125
|
collection: boolean;
|
package/types/location.d.mts
CHANGED
|
@@ -106,6 +106,20 @@ export class Location extends Owner {
|
|
|
106
106
|
get?: Function;
|
|
107
107
|
env?: string[] | string;
|
|
108
108
|
};
|
|
109
|
+
family: {
|
|
110
|
+
type: string;
|
|
111
|
+
isKey: boolean;
|
|
112
|
+
writable: boolean;
|
|
113
|
+
mandatory: boolean;
|
|
114
|
+
collection: boolean;
|
|
115
|
+
private?: boolean;
|
|
116
|
+
depends?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
default?: any;
|
|
119
|
+
set?: Function;
|
|
120
|
+
get?: Function;
|
|
121
|
+
env?: string[] | string;
|
|
122
|
+
};
|
|
109
123
|
};
|
|
110
124
|
};
|
|
111
125
|
collection: boolean;
|
|
@@ -317,6 +331,20 @@ export class Location extends Owner {
|
|
|
317
331
|
get?: Function;
|
|
318
332
|
env?: string[] | string;
|
|
319
333
|
};
|
|
334
|
+
family: {
|
|
335
|
+
type: string;
|
|
336
|
+
isKey: boolean;
|
|
337
|
+
writable: boolean;
|
|
338
|
+
mandatory: boolean;
|
|
339
|
+
collection: boolean;
|
|
340
|
+
private?: boolean;
|
|
341
|
+
depends?: string;
|
|
342
|
+
description?: string;
|
|
343
|
+
default?: any;
|
|
344
|
+
set?: Function;
|
|
345
|
+
get?: Function;
|
|
346
|
+
env?: string[] | string;
|
|
347
|
+
};
|
|
320
348
|
};
|
|
321
349
|
};
|
|
322
350
|
collection: boolean;
|
package/types/network.d.mts
CHANGED
|
@@ -108,6 +108,20 @@ export class Network extends Owner {
|
|
|
108
108
|
get?: Function;
|
|
109
109
|
env?: string[] | string;
|
|
110
110
|
};
|
|
111
|
+
family: {
|
|
112
|
+
type: string;
|
|
113
|
+
isKey: boolean;
|
|
114
|
+
writable: boolean;
|
|
115
|
+
mandatory: boolean;
|
|
116
|
+
collection: boolean;
|
|
117
|
+
private?: boolean;
|
|
118
|
+
depends?: string;
|
|
119
|
+
description?: string;
|
|
120
|
+
default?: any;
|
|
121
|
+
set?: Function;
|
|
122
|
+
get?: Function;
|
|
123
|
+
env?: string[] | string;
|
|
124
|
+
};
|
|
111
125
|
};
|
|
112
126
|
};
|
|
113
127
|
collection: boolean;
|
package/types/owner.d.mts
CHANGED
|
@@ -104,6 +104,20 @@ export class Owner extends Base {
|
|
|
104
104
|
get?: Function;
|
|
105
105
|
env?: string[] | string;
|
|
106
106
|
};
|
|
107
|
+
family: {
|
|
108
|
+
type: string;
|
|
109
|
+
isKey: boolean;
|
|
110
|
+
writable: boolean;
|
|
111
|
+
mandatory: boolean;
|
|
112
|
+
collection: boolean;
|
|
113
|
+
private?: boolean;
|
|
114
|
+
depends?: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
default?: any;
|
|
117
|
+
set?: Function;
|
|
118
|
+
get?: Function;
|
|
119
|
+
env?: string[] | string;
|
|
120
|
+
};
|
|
107
121
|
};
|
|
108
122
|
};
|
|
109
123
|
collection: boolean;
|
package/types/root.d.mts
CHANGED
|
@@ -110,6 +110,20 @@ export class Root extends Location {
|
|
|
110
110
|
get?: Function;
|
|
111
111
|
env?: string[] | string;
|
|
112
112
|
};
|
|
113
|
+
family: {
|
|
114
|
+
type: string;
|
|
115
|
+
isKey: boolean;
|
|
116
|
+
writable: boolean;
|
|
117
|
+
mandatory: boolean;
|
|
118
|
+
collection: boolean;
|
|
119
|
+
private?: boolean;
|
|
120
|
+
depends?: string;
|
|
121
|
+
description?: string;
|
|
122
|
+
default?: any;
|
|
123
|
+
set?: Function;
|
|
124
|
+
get?: Function;
|
|
125
|
+
env?: string[] | string;
|
|
126
|
+
};
|
|
113
127
|
};
|
|
114
128
|
};
|
|
115
129
|
collection: boolean;
|
|
@@ -321,6 +335,20 @@ export class Root extends Location {
|
|
|
321
335
|
get?: Function;
|
|
322
336
|
env?: string[] | string;
|
|
323
337
|
};
|
|
338
|
+
family: {
|
|
339
|
+
type: string;
|
|
340
|
+
isKey: boolean;
|
|
341
|
+
writable: boolean;
|
|
342
|
+
mandatory: boolean;
|
|
343
|
+
collection: boolean;
|
|
344
|
+
private?: boolean;
|
|
345
|
+
depends?: string;
|
|
346
|
+
description?: string;
|
|
347
|
+
default?: any;
|
|
348
|
+
set?: Function;
|
|
349
|
+
get?: Function;
|
|
350
|
+
env?: string[] | string;
|
|
351
|
+
};
|
|
324
352
|
};
|
|
325
353
|
};
|
|
326
354
|
collection: boolean;
|
package/types/services/kea.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const fetureHasHTTPEndpoints: boolean;
|
|
2
1
|
export class KeaService extends Service {
|
|
3
2
|
static get typeDefinition(): {
|
|
4
3
|
name: string;
|
|
@@ -462,10 +461,10 @@ export class KeaService extends Service {
|
|
|
462
461
|
env?: string[] | string;
|
|
463
462
|
};
|
|
464
463
|
"ddns-conflict-resolution-mode": {
|
|
465
|
-
writable: boolean;
|
|
466
464
|
isCommonOption: boolean;
|
|
467
465
|
type: string;
|
|
468
466
|
isKey: boolean;
|
|
467
|
+
writable: boolean;
|
|
469
468
|
mandatory: boolean;
|
|
470
469
|
collection: boolean;
|
|
471
470
|
private?: boolean;
|
package/types/subnet.d.mts
CHANGED
|
@@ -39,6 +39,20 @@ export class Subnet extends Base {
|
|
|
39
39
|
get?: Function;
|
|
40
40
|
env?: string[] | string;
|
|
41
41
|
};
|
|
42
|
+
family: {
|
|
43
|
+
type: string;
|
|
44
|
+
isKey: boolean;
|
|
45
|
+
writable: boolean;
|
|
46
|
+
mandatory: boolean;
|
|
47
|
+
collection: boolean;
|
|
48
|
+
private?: boolean;
|
|
49
|
+
depends?: string;
|
|
50
|
+
description?: string;
|
|
51
|
+
default?: any;
|
|
52
|
+
set?: Function;
|
|
53
|
+
get?: Function;
|
|
54
|
+
env?: string[] | string;
|
|
55
|
+
};
|
|
42
56
|
};
|
|
43
57
|
};
|
|
44
58
|
networks: Set<any>;
|