pmcf 2.6.5 → 2.6.7

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.6.5",
3
+ "version": "2.6.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/service.mjs CHANGED
@@ -8,7 +8,6 @@ import {
8
8
  dnsFormatParameters,
9
9
  dnsMergeParameters
10
10
  } from "./dns-utils.mjs";
11
- import { DHCPService, DNSService, NTPService } from "./module.mjs";
12
11
 
13
12
  const ServiceTypes = {
14
13
  ntp: { endpoints: [{ protocol: "udp", port: 123, tls: false }] },
@@ -47,7 +46,7 @@ const ServiceTypes = {
47
46
  smb: { endpoints: [{ protocol: "tcp", port: 445, tls: false }] },
48
47
  timemachine: {
49
48
  type: "adisk",
50
- endpoints: [{ protocol: "tcp", tls: false }],
49
+ endpoints: [{ protocol: "tcp", port: 445, tls: false }],
51
50
  dnsRecord: {
52
51
  type: "TXT",
53
52
  parameters: {
@@ -149,13 +148,13 @@ export class Service extends Base {
149
148
  }
150
149
 
151
150
  get endpoints() {
152
- if (this._port !== undefined) {
151
+ if (!ServiceTypes[this.type]) {
153
152
  return [
154
- { protocol: this.protocol, address: this.rawAddress, port: this._port }
153
+ { address: this.rawAddress, port: this._port, tls: false }
155
154
  ];
156
155
  }
157
156
 
158
- return ServiceTypes[this.type]?.endpoints || [];
157
+ return ServiceTypes[this.type].endpoints;
159
158
  }
160
159
 
161
160
  set port(value) {
@@ -163,7 +162,15 @@ export class Service extends Base {
163
162
  }
164
163
 
165
164
  get port() {
166
- return this._port ?? ServiceTypes[this.type]?.endpoints[0].port;
165
+ return this.endpoints[0].port;
166
+ }
167
+
168
+ get protocol() {
169
+ return this.endpoints[0].protocol;
170
+ }
171
+
172
+ get tls() {
173
+ return this.endpoints[0].tls;
167
174
  }
168
175
 
169
176
  set weight(value) {
@@ -182,14 +189,6 @@ export class Service extends Base {
182
189
  return this._type ?? this.name;
183
190
  }
184
191
 
185
- get protocol() {
186
- return ServiceTypes[this.type]?.endpoints[0].protocol;
187
- }
188
-
189
- get tls() {
190
- return ServiceTypes[this.type]?.tls ?? false;
191
- }
192
-
193
192
  get systemdServices() {
194
193
  return this._systemd;
195
194
  }
@@ -50,8 +50,7 @@ export class DHCPService extends Service {
50
50
  name: `kea-${this.location.name}-${host.name}`,
51
51
  description: `kea definitions for ${this.fullName}@${name}`,
52
52
  access: "private",
53
- dependencies: ["kea"],
54
- replaces: [`kea-${name}`] // TODO remove
53
+ dependencies: ["kea>=2.6.1"]
55
54
  }
56
55
  };
57
56
 
@@ -261,12 +261,12 @@ export class Service extends Base {
261
261
  get endpoints(): any;
262
262
  set port(value: any);
263
263
  get port(): any;
264
+ get protocol(): any;
265
+ get tls(): any;
264
266
  set weight(value: any);
265
267
  get weight(): any;
266
268
  set type(value: any);
267
269
  get type(): any;
268
- get protocol(): any;
269
- get tls(): any;
270
270
  get systemdServices(): any;
271
271
  dnsRecordsForDomainName(domainName: any, hasSVRRecords: any): {
272
272
  key: any;
@@ -259,7 +259,6 @@ export class DHCPService extends Service {
259
259
  description: string;
260
260
  access: string;
261
261
  dependencies: string[];
262
- replaces: string[];
263
262
  };
264
263
  }, void, unknown>;
265
264
  }