pmcf 2.11.5 → 2.12.1

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.11.5",
3
+ "version": "2.12.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/host.mjs CHANGED
@@ -115,6 +115,9 @@ export class Host extends Base {
115
115
 
116
116
  _applyExtends(host) {
117
117
  for (const service of host.services) {
118
+
119
+ //present.extends.push(service);
120
+
118
121
  this.services = service.forOwner(this);
119
122
  }
120
123
 
package/src/service.mjs CHANGED
@@ -100,12 +100,13 @@ export const ServiceTypeDefinition = {
100
100
  };
101
101
 
102
102
  export class Service extends Base {
103
- alias;
103
+ _alias;
104
104
  _weight;
105
105
  _type;
106
106
  _port;
107
107
  _ipAddresses;
108
108
  _systemd;
109
+ _extends = [];
109
110
 
110
111
  static {
111
112
  addType(this);
@@ -120,6 +121,14 @@ export class Service extends Base {
120
121
  this.read(data, ServiceTypeDefinition);
121
122
  }
122
123
 
124
+ set extends(value) {
125
+ this._extends.push(value);
126
+ }
127
+
128
+ get extends() {
129
+ return this._extends;
130
+ }
131
+
123
132
  get network() {
124
133
  return this.server.network;
125
134
  }
@@ -158,14 +167,29 @@ export class Service extends Base {
158
167
 
159
168
  get endpoints() {
160
169
  if (!ServiceTypes[this.type]) {
161
- return [{ address: this.rawAddress, port: this._port, tls: false }];
170
+ return [
171
+ {
172
+ service: this,
173
+ address: this.rawAddress,
174
+ port: this._port,
175
+ tls: false
176
+ }
177
+ ];
162
178
  }
163
179
 
164
180
  return ServiceTypes[this.type].endpoints.map(e =>
165
- Object.assign({ address: this.rawAddress }, e)
181
+ Object.assign({ service: this, address: this.rawAddress }, e)
166
182
  );
167
183
  }
168
184
 
185
+ set alias(value) {
186
+ this._alias = value;
187
+ }
188
+
189
+ get alias() {
190
+ return this.extendedProperty("_alias");
191
+ }
192
+
169
193
  set port(value) {
170
194
  this._port = value;
171
195
  }
@@ -187,7 +211,7 @@ export class Service extends Base {
187
211
  }
188
212
 
189
213
  get weight() {
190
- return this._weight ?? this.owner.weight ?? 1;
214
+ return this.extendedProperty("_weight") ?? this.owner.weight ?? 1;
191
215
  }
192
216
 
193
217
  set type(value) {
@@ -199,7 +223,7 @@ export class Service extends Base {
199
223
  }
200
224
 
201
225
  get systemdServices() {
202
- return this._systemd;
226
+ return this.extendedProperty("_systemd");
203
227
  }
204
228
 
205
229
  dnsRecordsForDomainName(domainName, hasSVRRecords) {
@@ -14,7 +14,14 @@ const NTPServiceTypeDefinition = {
14
14
  owners: ServiceTypeDefinition.owners,
15
15
  extends: ExtraSourceServiceTypeDefinition,
16
16
  priority: 0.1,
17
- properties: {}
17
+ properties: {
18
+ isPool: {
19
+ type: "boolean",
20
+ collection: false,
21
+ writeable: true,
22
+ default: false
23
+ }
24
+ }
18
25
  };
19
26
 
20
27
  const NTP_SERVICE_FILTER = { type: NTPServiceTypeDefinition.name };
@@ -249,12 +249,15 @@ export class Service extends Base {
249
249
  };
250
250
  };
251
251
  };
252
- alias: any;
252
+ _alias: any;
253
253
  _weight: any;
254
254
  _type: any;
255
255
  _port: any;
256
256
  _ipAddresses: any;
257
257
  _systemd: any;
258
+ _extends: any[];
259
+ set extends(value: any[]);
260
+ get extends(): any[];
258
261
  get server(): any;
259
262
  get domainName(): any;
260
263
  get ipAddressOrDomainName(): any;
@@ -264,6 +267,8 @@ export class Service extends Base {
264
267
  get addresses(): any;
265
268
  get networks(): any;
266
269
  get endpoints(): any;
270
+ set alias(value: any);
271
+ get alias(): any;
267
272
  set port(value: any);
268
273
  get port(): any;
269
274
  get protocol(): any;
@@ -263,7 +263,14 @@ export class NTPService extends ExtraSourceService {
263
263
  };
264
264
  };
265
265
  priority: number;
266
- properties: {};
266
+ properties: {
267
+ isPool: {
268
+ type: string;
269
+ collection: boolean;
270
+ writeable: boolean;
271
+ default: boolean;
272
+ };
273
+ };
267
274
  };
268
275
  get systemdConfig(): (string | {
269
276
  NTP: string;