pmcf 1.73.0 → 1.73.2

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": "1.73.0",
3
+ "version": "1.73.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/host.mjs CHANGED
@@ -2,7 +2,7 @@ import { readFile } from "node:fs/promises";
2
2
  import { join } from "node:path";
3
3
  import { FileContentProvider } from "npm-pkgbuild";
4
4
  import { Base } from "./base.mjs";
5
- import { networkProperties } from "./network-support.mjs";
5
+ import { networkProperties, networkAddressProperties } from "./network-support.mjs";
6
6
  import {
7
7
  asArray,
8
8
  isIPv4Address,
@@ -381,10 +381,10 @@ const NetworkInterfaceTypeDefinition = {
381
381
  extends: Base.typeDefinition,
382
382
  properties: {
383
383
  ...networkProperties,
384
- hwaddr: { type: "string", collection: false, writeable: true },
384
+ ...networkAddressProperties,
385
385
  ipAddresses: { type: "string", collection: true, writeable: true },
386
- cidrAddresses: { type: "string", collection: true, writeable: false },
387
- rawAddresses: { type: "string", collection: true, writeable: false },
386
+
387
+ hwaddr: { type: "string", collection: false, writeable: true },
388
388
  network: { type: "network", collection: false, writeable: true },
389
389
  destination: { type: "string", collection: false, writeable: true },
390
390
  arpbridge: { type: "network_interface", collection: true, writeable: true }
@@ -7,3 +7,10 @@ export const networkProperties = {
7
7
  MTU: { type: "number", collection: false, writeable: true },
8
8
  gateway: { type: "host", collection: false, writeable: true }
9
9
  };
10
+
11
+ export const networkAddressProperties = {
12
+ cidrAddresses: { type: "string", collection: true, writeable: false },
13
+ cidrAddress: { type: "string", collection: false, writeable: false },
14
+ rawAddresses: { type: "string", collection: true, writeable: false },
15
+ rawAddress: { type: "string", collection: false, writeable: false }
16
+ };
package/src/owner.mjs CHANGED
@@ -128,9 +128,7 @@ export class Owner extends Base {
128
128
 
129
129
  *findServices(filter) {
130
130
  for (const host of this.hosts()) {
131
- for (const service of host.findServices(filter)) {
132
- yield service;
133
- }
131
+ yield* host.findServices(filter);
134
132
  }
135
133
  }
136
134
 
@@ -143,7 +141,7 @@ export class Owner extends Base {
143
141
  }
144
142
 
145
143
  hostNamed(name) {
146
- return this.typeNamed("host", name);
144
+ return this.typeNamed("host", name) || this.typeNamed("cluster", name);
147
145
  }
148
146
 
149
147
  *hosts() {
@@ -363,5 +361,4 @@ export class Owner extends Base {
363
361
  yield location.domain;
364
362
  }
365
363
  }
366
-
367
364
  }
package/src/service.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Base } from "./base.mjs";
2
2
  import { addType } from "./types.mjs";
3
3
  import { asArray } from "./utils.mjs";
4
+ import { networkAddressProperties } from "./network-support.mjs";
4
5
 
5
6
  const ServiceTypes = {
6
7
  dns: { protocol: "udp", port: 53, tls: false },
@@ -22,6 +23,7 @@ const ServiceTypeDefinition = {
22
23
  priority: 0.4,
23
24
  extends: Base.typeDefinition,
24
25
  properties: {
26
+ ...networkAddressProperties,
25
27
  ipAddresses: { type: "string", collection: true, writeable: true },
26
28
  port: { type: "number", collection: false, writeable: true },
27
29
  protocol: { type: "string", collection: false, writeable: true },
@@ -90,6 +92,10 @@ export class Service extends Base {
90
92
  return this.server.domainName;
91
93
  }
92
94
 
95
+ get rawAddresses() {
96
+ return this.#ipAddresses || this.owner.rawAddresses;
97
+ }
98
+
93
99
  get rawAddress() {
94
100
  return this.#ipAddresses?.[0] || this.server.rawAddress;
95
101
  }
@@ -98,10 +104,6 @@ export class Service extends Base {
98
104
  this.#ipAddresses = value;
99
105
  }
100
106
 
101
- get rawAddresses() {
102
- return this.#ipAddresses || this.owner.rawAddresses;
103
- }
104
-
105
107
  get addresses() {
106
108
  return this.rawAddresses.map(a => `${a}:${this.port}`);
107
109
  }
package/types/host.d.mts CHANGED
@@ -233,37 +233,47 @@ export class NetworkInterface extends Base {
233
233
  };
234
234
  };
235
235
  properties: {
236
+ ipAddresses: {
237
+ type: string;
238
+ collection: boolean;
239
+ writeable: boolean;
240
+ };
236
241
  hwaddr: {
237
242
  type: string;
238
243
  collection: boolean;
239
244
  writeable: boolean;
240
245
  };
241
- ipAddresses: {
246
+ network: {
242
247
  type: string;
243
248
  collection: boolean;
244
249
  writeable: boolean;
245
250
  };
246
- cidrAddresses: {
251
+ destination: {
247
252
  type: string;
248
253
  collection: boolean;
249
254
  writeable: boolean;
250
255
  };
251
- rawAddresses: {
256
+ arpbridge: {
252
257
  type: string;
253
258
  collection: boolean;
254
259
  writeable: boolean;
255
260
  };
256
- network: {
261
+ cidrAddresses: {
257
262
  type: string;
258
263
  collection: boolean;
259
264
  writeable: boolean;
260
265
  };
261
- destination: {
266
+ cidrAddress: {
262
267
  type: string;
263
268
  collection: boolean;
264
269
  writeable: boolean;
265
270
  };
266
- arpbridge: {
271
+ rawAddresses: {
272
+ type: string;
273
+ collection: boolean;
274
+ writeable: boolean;
275
+ };
276
+ rawAddress: {
267
277
  type: string;
268
278
  collection: boolean;
269
279
  writeable: boolean;
@@ -53,3 +53,37 @@ export namespace networkProperties {
53
53
  export { writeable_6 as writeable };
54
54
  }
55
55
  }
56
+ export namespace networkAddressProperties {
57
+ namespace cidrAddresses {
58
+ let type_7: string;
59
+ export { type_7 as type };
60
+ let collection_7: boolean;
61
+ export { collection_7 as collection };
62
+ let writeable_7: boolean;
63
+ export { writeable_7 as writeable };
64
+ }
65
+ namespace cidrAddress {
66
+ let type_8: string;
67
+ export { type_8 as type };
68
+ let collection_8: boolean;
69
+ export { collection_8 as collection };
70
+ let writeable_8: boolean;
71
+ export { writeable_8 as writeable };
72
+ }
73
+ namespace rawAddresses {
74
+ let type_9: string;
75
+ export { type_9 as type };
76
+ let collection_9: boolean;
77
+ export { collection_9 as collection };
78
+ let writeable_9: boolean;
79
+ export { writeable_9 as writeable };
80
+ }
81
+ namespace rawAddress {
82
+ let type_10: string;
83
+ export { type_10 as type };
84
+ let collection_10: boolean;
85
+ export { collection_10 as collection };
86
+ let writeable_10: boolean;
87
+ export { writeable_10 as writeable };
88
+ }
89
+ }
package/types/owner.d.mts CHANGED
@@ -194,7 +194,6 @@ export class Owner extends Base {
194
194
  typeList(typeName: any): any;
195
195
  addTypeObject(typeName: any, name: any, object: any): void;
196
196
  addObject(object: any): void;
197
- findServices(filter: any): Generator<any, void, unknown>;
198
197
  locationNamed(name: any): any;
199
198
  locations(): any;
200
199
  hostNamed(name: any): any;
@@ -92,14 +92,34 @@ export class Service extends Base {
92
92
  collection: boolean;
93
93
  writeable: boolean;
94
94
  };
95
+ cidrAddresses: {
96
+ type: string;
97
+ collection: boolean;
98
+ writeable: boolean;
99
+ };
100
+ cidrAddress: {
101
+ type: string;
102
+ collection: boolean;
103
+ writeable: boolean;
104
+ };
105
+ rawAddresses: {
106
+ type: string;
107
+ collection: boolean;
108
+ writeable: boolean;
109
+ };
110
+ rawAddress: {
111
+ type: string;
112
+ collection: boolean;
113
+ writeable: boolean;
114
+ };
95
115
  };
96
116
  };
97
117
  alias: any;
98
118
  get server(): any;
99
119
  get domainName(): any;
120
+ get rawAddresses(): any;
100
121
  get rawAddress(): any;
101
122
  set ipAddresses(value: any);
102
- get rawAddresses(): any;
103
123
  get addresses(): any;
104
124
  set port(value: any);
105
125
  get port(): any;