pmcf 2.43.0 → 2.44.0
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 +3 -3
- package/src/cluster.mjs +2 -1
- package/src/service.mjs +11 -0
- package/types/service.d.mts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"config management",
|
|
17
17
|
"dhcp",
|
|
18
18
|
"dns",
|
|
19
|
+
"iwd",
|
|
19
20
|
"kea",
|
|
20
21
|
"keepalived",
|
|
21
|
-
"systemd"
|
|
22
|
-
"iwd"
|
|
22
|
+
"systemd"
|
|
23
23
|
],
|
|
24
24
|
"contributors": [
|
|
25
25
|
{
|
package/src/cluster.mjs
CHANGED
|
@@ -86,12 +86,13 @@ export class Cluster extends Host {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
+
|
|
89
90
|
const cfg = [
|
|
90
91
|
"global_defs {",
|
|
91
92
|
" notification_email {",
|
|
92
93
|
" " + this.administratorEmail,
|
|
93
94
|
" }",
|
|
94
|
-
` smtp_server ${this.smtp.address}`,
|
|
95
|
+
` smtp_server ${this.smtp.address()}`,
|
|
95
96
|
` notification_email_from keepalived@${host.domainName}`,
|
|
96
97
|
" enable_script_security",
|
|
97
98
|
" script_user root",
|
package/src/service.mjs
CHANGED
|
@@ -209,6 +209,17 @@ export class Service extends Base {
|
|
|
209
209
|
return filter ? result.filter(filter) : result;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
address(options = { select: e => e.address, limit: 1 }) {
|
|
213
|
+
const all = this.endpoints(options.endpoints);
|
|
214
|
+
const res = [...new Set(options.select ? all.map(options.select) : all)];
|
|
215
|
+
|
|
216
|
+
if (options.limit < res.length) {
|
|
217
|
+
res.length = options.limit;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return options.join ? res.join(options.join) : res;
|
|
221
|
+
}
|
|
222
|
+
|
|
212
223
|
set alias(value) {
|
|
213
224
|
this._alias = value;
|
|
214
225
|
}
|
package/types/service.d.mts
CHANGED
|
@@ -316,6 +316,10 @@ export class Service extends Base {
|
|
|
316
316
|
get ipAddressOrDomainName(): any;
|
|
317
317
|
get networks(): Set<any>;
|
|
318
318
|
endpoints(filter: any): any[];
|
|
319
|
+
address(options?: {
|
|
320
|
+
select: (e: any) => any;
|
|
321
|
+
limit: number;
|
|
322
|
+
}): string | any[];
|
|
319
323
|
set alias(value: any);
|
|
320
324
|
get alias(): any;
|
|
321
325
|
set port(value: any);
|