pmcf 4.25.19 → 4.25.21
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/README.md
CHANGED
|
@@ -75,9 +75,6 @@ generates config packages for:
|
|
|
75
75
|
* [id](#id)
|
|
76
76
|
* [InitializationContext](#initializationcontext)
|
|
77
77
|
* [Parameters](#parameters-13)
|
|
78
|
-
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
79
|
-
* [networkAddresses](#networkaddresses)
|
|
80
|
-
* [Parameters](#parameters-14)
|
|
81
78
|
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
82
79
|
* [Properties](#properties)
|
|
83
80
|
* [systemdConfigs](#systemdconfigs)
|
|
@@ -274,18 +271,6 @@ Keeps track of all in flight object creations and loose ends during config initi
|
|
|
274
271
|
|
|
275
272
|
* `directory` (optional, default `"/"`)
|
|
276
273
|
|
|
277
|
-
## SkeletonNetworkInterface
|
|
278
|
-
|
|
279
|
-
**Extends ServiceOwner**
|
|
280
|
-
|
|
281
|
-
### networkAddresses
|
|
282
|
-
|
|
283
|
-
#### Parameters
|
|
284
|
-
|
|
285
|
-
* `filter` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `n=>true`)
|
|
286
|
-
|
|
287
|
-
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
288
|
-
|
|
289
274
|
## SystemdJournalRemoteService
|
|
290
275
|
|
|
291
276
|
**Extends Service**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"content-entry-transform": "^1.6.9",
|
|
55
55
|
"ip-utilties": "^3.0.4",
|
|
56
56
|
"npm-pkgbuild": "^20.7.2",
|
|
57
|
-
"pacc": "^9.2.
|
|
57
|
+
"pacc": "^9.2.14",
|
|
58
58
|
"package-directory": "^8.2.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/node": "^25.9.
|
|
61
|
+
"@types/node": "^25.9.3",
|
|
62
62
|
"ava": "^8.0.1",
|
|
63
63
|
"c8": "^11.0.0",
|
|
64
64
|
"documentation": "^14.0.3",
|
package/src/base.mjs
CHANGED
|
@@ -52,12 +52,8 @@ export class Base {
|
|
|
52
52
|
addType(this);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
static get
|
|
56
|
-
return this.name;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
static get typeFileName() {
|
|
60
|
-
return this.typeName + ".json";
|
|
55
|
+
static get fileName() {
|
|
56
|
+
return this.name + ".json";
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
owner;
|
|
@@ -210,7 +206,6 @@ export class Base {
|
|
|
210
206
|
}
|
|
211
207
|
|
|
212
208
|
get typeName() {
|
|
213
|
-
// @ts-ignore
|
|
214
209
|
return this.constructor.name;
|
|
215
210
|
}
|
|
216
211
|
|
|
@@ -146,7 +146,7 @@ export class InitializationContext {
|
|
|
146
146
|
this.assign(object, name, attribute, o);
|
|
147
147
|
} else {
|
|
148
148
|
if (attribute.type.constructWithIdentifierOnly) {
|
|
149
|
-
o = new attribute.type
|
|
149
|
+
o = new attribute.type(
|
|
150
150
|
object.ownerFor(attribute, value),
|
|
151
151
|
value
|
|
152
152
|
);
|
|
@@ -161,7 +161,7 @@ export class InitializationContext {
|
|
|
161
161
|
break;
|
|
162
162
|
|
|
163
163
|
case "object":
|
|
164
|
-
if (attribute.type
|
|
164
|
+
if (attribute.type && value instanceof attribute.type) {
|
|
165
165
|
this.assign(object, name, attribute, value);
|
|
166
166
|
} else {
|
|
167
167
|
this.assign(
|
|
@@ -180,7 +180,7 @@ export class InitializationContext {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
typeFactory(type, owner, data) {
|
|
183
|
-
const factory = type.factoryFor?.(owner, data) || type
|
|
183
|
+
const factory = type.factoryFor?.(owner, data) || type;
|
|
184
184
|
const object = new factory(owner);
|
|
185
185
|
|
|
186
186
|
this.read(object, data);
|
|
@@ -244,7 +244,7 @@ export class InitializationContext {
|
|
|
244
244
|
async loadType(name, type) {
|
|
245
245
|
const data = JSON.parse(
|
|
246
246
|
await readFile(
|
|
247
|
-
join(this.directory, name, type.
|
|
247
|
+
join(this.directory, name, type.fileName),
|
|
248
248
|
"utf8"
|
|
249
249
|
)
|
|
250
250
|
);
|
|
@@ -262,7 +262,7 @@ export class InitializationContext {
|
|
|
262
262
|
//console.log("LOAD", [name, owner.fullName, data.name]);
|
|
263
263
|
|
|
264
264
|
const object = this.typeFactory(type, owner, data);
|
|
265
|
-
this.root.addTypeObject(type.
|
|
265
|
+
this.root.addTypeObject(type.name, name, object);
|
|
266
266
|
|
|
267
267
|
return object;
|
|
268
268
|
}
|
|
@@ -279,7 +279,7 @@ export class InitializationContext {
|
|
|
279
279
|
return this.loadType(name, options.type);
|
|
280
280
|
} else {
|
|
281
281
|
for (const type of Object.values(types).filter(
|
|
282
|
-
type => type?.
|
|
282
|
+
type => type?.fileName
|
|
283
283
|
)) {
|
|
284
284
|
try {
|
|
285
285
|
return await this.loadType(name, type);
|
|
@@ -295,9 +295,8 @@ export class InitializationContext {
|
|
|
295
295
|
for (const type of Object.values(types).sort(
|
|
296
296
|
(a, b) => b.priority - a.priority
|
|
297
297
|
)) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
for await (const name of glob("**/" + type.clazz.typeFileName, {
|
|
298
|
+
if (type.fileName) {
|
|
299
|
+
for await (const name of glob("**/" + type.fileName, {
|
|
301
300
|
cwd: this.directory
|
|
302
301
|
})) {
|
|
303
302
|
if (type === this.root.constructor) {
|
|
@@ -22,21 +22,21 @@ export class NetworkInterface extends SkeletonNetworkInterface {
|
|
|
22
22
|
static extends = Base;
|
|
23
23
|
static specializations = {};
|
|
24
24
|
static factoryFor(owner, value) {
|
|
25
|
-
let
|
|
25
|
+
let st = this.specializations[value.kind];
|
|
26
26
|
|
|
27
27
|
//console.log("factoryFor", owner, value);
|
|
28
|
-
if (!
|
|
29
|
-
for (
|
|
30
|
-
if (
|
|
28
|
+
if (!st) {
|
|
29
|
+
for (st of Object.values(this.specializations)) {
|
|
30
|
+
if (st.isCommonName && st.isCommonName(value.name)) {
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
if (
|
|
36
|
+
if (st) {
|
|
37
37
|
delete value.type;
|
|
38
38
|
delete value.kind;
|
|
39
|
-
return
|
|
39
|
+
return st;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
return this;
|
package/src/service.mjs
CHANGED
|
@@ -56,11 +56,11 @@ export class Service extends Base {
|
|
|
56
56
|
static specializations = {};
|
|
57
57
|
static factoryFor(owner, value) {
|
|
58
58
|
const type = value.type ?? value.name;
|
|
59
|
-
const
|
|
59
|
+
const st = this.specializations[type];
|
|
60
60
|
|
|
61
|
-
if (
|
|
61
|
+
if (st) {
|
|
62
62
|
delete value.type;
|
|
63
|
-
return
|
|
63
|
+
return st;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
return Service;
|