pmcf 2.44.0 → 2.45.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.44.0",
3
+ "version": "2.45.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/service.mjs CHANGED
@@ -184,10 +184,6 @@ export class Service extends Base {
184
184
  return this.host.domainName;
185
185
  }
186
186
 
187
- get ipAddressOrDomainName() {
188
- return this.address ?? this.domainName;
189
- }
190
-
191
187
  get networks() {
192
188
  return this.host.networks;
193
189
  }
@@ -209,7 +205,14 @@ export class Service extends Base {
209
205
  return filter ? result.filter(filter) : result;
210
206
  }
211
207
 
212
- address(options = { select: e => e.address, limit: 1 }) {
208
+ address(
209
+ options = {
210
+ endpoints: e => e.networkInterface?.kind !== "loopbak",
211
+ select: e => e.domainName||e.address,
212
+ limit: 1,
213
+ join: ""
214
+ }
215
+ ) {
213
216
  const all = this.endpoints(options.endpoints);
214
217
  const res = [...new Set(options.select ? all.map(options.select) : all)];
215
218
 
@@ -217,7 +220,7 @@ export class Service extends Base {
217
220
  res.length = options.limit;
218
221
  }
219
222
 
220
- return options.join ? res.join(options.join) : res;
223
+ return options.join !== undefined ? res.join(options.join) : res;
221
224
  }
222
225
 
223
226
  set alias(value) {
@@ -527,20 +527,19 @@ export class BINDService extends ExtraSourceService {
527
527
 
528
528
  get defaultRecords() {
529
529
  const nameService = this.findService({ type: "dns", priority: "<10" });
530
- const rname = this.administratorEmail.replace(/@/, ".");
531
530
 
532
531
  const SOARecord = DNSRecord(
533
532
  "@",
534
533
  "SOA",
535
534
  dnsFullName(nameService.domainName),
536
- dnsFullName(rname),
535
+ dnsFullName(this.administratorEmail.replace(/@/, ".")),
537
536
  `(${[...this.soaUpdates].join(" ")})`
538
537
  );
539
538
 
540
539
  const NSRecord = DNSRecord(
541
540
  "@",
542
541
  "NS",
543
- dnsFullName(nameService.ipAddressOrDomainName)
542
+ dnsFullName(nameService.address())
544
543
  );
545
544
 
546
545
  return [SOARecord, NSRecord];
@@ -313,12 +313,13 @@ export class Service extends Base {
313
313
  get host(): Host;
314
314
  hosts(): Generator<any, void, any>;
315
315
  get domainName(): any;
316
- get ipAddressOrDomainName(): any;
317
316
  get networks(): Set<any>;
318
317
  endpoints(filter: any): any[];
319
318
  address(options?: {
319
+ endpoints: (e: any) => boolean;
320
320
  select: (e: any) => any;
321
321
  limit: number;
322
+ join: string;
322
323
  }): string | any[];
323
324
  set alias(value: any);
324
325
  get alias(): any;