pmcf 1.44.0 → 1.44.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": "1.44.0",
3
+ "version": "1.44.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -16,9 +16,10 @@ export class Base {
16
16
  return {
17
17
  name: "base",
18
18
  properties: {
19
+ type: { type: "string", writeable: false },
19
20
  name: { type: "string" },
20
21
  description: { type: "string" },
21
- directory: { type: "string" },
22
+ directory: { type: "string", writeable: false },
22
23
  owner: {}
23
24
  }
24
25
  };
@@ -109,7 +110,7 @@ export class Base {
109
110
 
110
111
  get typeName() {
111
112
  // @ts-ignore
112
- return this.constructor.typeName;
113
+ return this.constructor.typeDefinition.name;
113
114
  }
114
115
 
115
116
  get root() {
@@ -277,7 +278,10 @@ export function extractFrom(object, typeDefinition) {
277
278
  json[name] = value;
278
279
  } else {
279
280
  json[name] = Object.fromEntries(
280
- Object.entries(value).map(([k, v]) => [k, extractFrom(v)])
281
+ Object.entries(value).map(([k, v]) => [
282
+ k,
283
+ extractFrom(v, typesByName[def.type])
284
+ ])
281
285
  );
282
286
  }
283
287
  }
package/src/dns.mjs CHANGED
@@ -8,7 +8,6 @@ export class DNSService extends Base {
8
8
  soaUpdates = [36000, 72000, 600000, 60000];
9
9
  hasSVRRecords = true;
10
10
  hasCatalog = true;
11
-
12
11
  forwardsTo = [];
13
12
 
14
13
  static {
@@ -21,10 +20,10 @@ export class DNSService extends Base {
21
20
  properties: {
22
21
  hasSVRRecords: { type: "boolean" },
23
22
  hasCatalog: { type: "boolean" },
24
- recordTTL: { type: "string" }
25
- /*soaUpdates: {},
26
- forwardsTo: {},
27
- allowedUpdates: {}*/
23
+ recordTTL: { type: "string" },
24
+ soaUpdates: { type: "number", collection: true },
25
+ forwardsTo: { type: "host", collection: true },
26
+ allowedUpdates: { type: "string", collection: true }
28
27
  }
29
28
  };
30
29
  }
package/src/host.mjs CHANGED
@@ -303,7 +303,7 @@ export class NetworkInterface extends Base {
303
303
  ssid: { type: "string" },
304
304
  psk: { type: "string" },
305
305
  metric: { type: "number" },
306
- ipAddresses: { type: "string", isCollection: true },
306
+ ipAddresses: { type: "string", collection: true },
307
307
  network: {},
308
308
  gateway: {},
309
309
  arpbridge: {}
package/types/base.d.mts CHANGED
@@ -4,6 +4,10 @@ export class Base {
4
4
  static get typeDefinition(): {
5
5
  name: string;
6
6
  properties: {
7
+ type: {
8
+ type: string;
9
+ writeable: boolean;
10
+ };
7
11
  name: {
8
12
  type: string;
9
13
  };
@@ -12,6 +16,7 @@ export class Base {
12
16
  };
13
17
  directory: {
14
18
  type: string;
19
+ writeable: boolean;
15
20
  };
16
21
  owner: {};
17
22
  };
package/types/dns.d.mts CHANGED
@@ -11,6 +11,18 @@ export class DNSService extends Base {
11
11
  recordTTL: {
12
12
  type: string;
13
13
  };
14
+ soaUpdates: {
15
+ type: string;
16
+ collection: boolean;
17
+ };
18
+ forwardsTo: {
19
+ type: string;
20
+ collection: boolean;
21
+ };
22
+ allowedUpdates: {
23
+ type: string;
24
+ collection: boolean;
25
+ };
14
26
  };
15
27
  };
16
28
  allowedUpdates: any[];
package/types/host.d.mts CHANGED
@@ -96,7 +96,7 @@ export class NetworkInterface extends Base {
96
96
  };
97
97
  ipAddresses: {
98
98
  type: string;
99
- isCollection: boolean;
99
+ collection: boolean;
100
100
  };
101
101
  network: {};
102
102
  gateway: {};