pmcf 4.20.0 → 4.21.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/README.md +74 -79
- package/package.json +1 -1
- package/src/base.mjs +12 -3
- package/src/host.mjs +16 -8
- package/src/initialization-context.mjs +4 -1
- package/src/service-owner.mjs +1 -1
package/README.md
CHANGED
|
@@ -41,77 +41,72 @@ generates config packages for:
|
|
|
41
41
|
|
|
42
42
|
### Table of Contents
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
- [asArray](#asarray)
|
|
111
|
-
- [Parameters](#parameters-23)
|
|
112
|
-
- [asIterator](#asiterator)
|
|
113
|
-
- [Parameters](#parameters-24)
|
|
114
|
-
- [install](#install)
|
|
44
|
+
* [Base](#base)
|
|
45
|
+
* [Parameters](#parameters)
|
|
46
|
+
* [walkDirections](#walkdirections)
|
|
47
|
+
* [Parameters](#parameters-1)
|
|
48
|
+
* [extendedAttribute](#extendedattribute)
|
|
49
|
+
* [Parameters](#parameters-2)
|
|
50
|
+
* [propertyIterator](#propertyiterator)
|
|
51
|
+
* [Parameters](#parameters-3)
|
|
52
|
+
* [getProperties](#getproperties)
|
|
53
|
+
* [Parameters](#parameters-4)
|
|
54
|
+
* [priority](#priority)
|
|
55
|
+
* [expression](#expression)
|
|
56
|
+
* [Parameters](#parameters-5)
|
|
57
|
+
* [templateContent](#templatecontent)
|
|
58
|
+
* [Parameters](#parameters-6)
|
|
59
|
+
* [isTemplate](#istemplate)
|
|
60
|
+
* [property](#property)
|
|
61
|
+
* [Parameters](#parameters-7)
|
|
62
|
+
* [expand](#expand)
|
|
63
|
+
* [Parameters](#parameters-8)
|
|
64
|
+
* [PortEndpoint](#portendpoint)
|
|
65
|
+
* [Parameters](#parameters-9)
|
|
66
|
+
* [port](#port)
|
|
67
|
+
* [socketAddress](#socketaddress)
|
|
68
|
+
* [HTTPEndpoint](#httpendpoint)
|
|
69
|
+
* [Parameters](#parameters-10)
|
|
70
|
+
* [port](#port-1)
|
|
71
|
+
* [id](#id)
|
|
72
|
+
* [InitializationContext](#initializationcontext)
|
|
73
|
+
* [Parameters](#parameters-11)
|
|
74
|
+
* [SkeletonNetworkInterface](#skeletonnetworkinterface)
|
|
75
|
+
* [networkAddresses](#networkaddresses)
|
|
76
|
+
* [Parameters](#parameters-12)
|
|
77
|
+
* [SystemdJournalRemoteService](#systemdjournalremoteservice)
|
|
78
|
+
* [Properties](#properties)
|
|
79
|
+
* [systemdConfigs](#systemdconfigs)
|
|
80
|
+
* [Parameters](#parameters-13)
|
|
81
|
+
* [SystemdJournalUploadService](#systemdjournaluploadservice)
|
|
82
|
+
* [Properties](#properties-1)
|
|
83
|
+
* [systemdConfigs](#systemdconfigs-1)
|
|
84
|
+
* [Parameters](#parameters-14)
|
|
85
|
+
* [NetworkAddress](#networkaddress)
|
|
86
|
+
* [Parameters](#parameters-15)
|
|
87
|
+
* [subnet](#subnet)
|
|
88
|
+
* [networkInterface](#networkinterface)
|
|
89
|
+
* [address](#address)
|
|
90
|
+
* [addresses](#addresses)
|
|
91
|
+
* [Parameters](#parameters-16)
|
|
92
|
+
* [cidrAddresses](#cidraddresses)
|
|
93
|
+
* [Parameters](#parameters-17)
|
|
94
|
+
* [secretName](#secretname)
|
|
95
|
+
* [isTemplate](#istemplate-1)
|
|
96
|
+
* [named](#named)
|
|
97
|
+
* [Parameters](#parameters-18)
|
|
98
|
+
* [serviceEndpoints](#serviceendpoints)
|
|
99
|
+
* [Parameters](#parameters-19)
|
|
100
|
+
* [domainName](#domainname)
|
|
101
|
+
* [Parameters](#parameters-20)
|
|
102
|
+
* [domainFromDominName](#domainfromdominname)
|
|
103
|
+
* [Parameters](#parameters-21)
|
|
104
|
+
* [sectionLines](#sectionlines)
|
|
105
|
+
* [Parameters](#parameters-22)
|
|
106
|
+
* [asArray](#asarray)
|
|
107
|
+
* [Parameters](#parameters-23)
|
|
108
|
+
* [asIterator](#asiterator)
|
|
109
|
+
* [Parameters](#parameters-24)
|
|
115
110
|
|
|
116
111
|
## Base
|
|
117
112
|
|
|
@@ -242,6 +237,14 @@ Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
242
237
|
|
|
243
238
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
244
239
|
|
|
240
|
+
## InitializationContext
|
|
241
|
+
|
|
242
|
+
Keeps track of all in flight object creations and loose ends during config initialization.
|
|
243
|
+
|
|
244
|
+
### Parameters
|
|
245
|
+
|
|
246
|
+
* `directory` (optional, default `"/"`)
|
|
247
|
+
|
|
245
248
|
## SkeletonNetworkInterface
|
|
246
249
|
|
|
247
250
|
**Extends ServiceOwner**
|
|
@@ -254,14 +257,6 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
254
257
|
|
|
255
258
|
Returns **Iterable<[NetworkAddress](#networkaddress)>** 
|
|
256
259
|
|
|
257
|
-
## InitializationContext
|
|
258
|
-
|
|
259
|
-
Keeps track of all in flight object creations and loose ends during config initialization.
|
|
260
|
-
|
|
261
|
-
### Parameters
|
|
262
|
-
|
|
263
|
-
* `directory` (optional, default `"/"`)
|
|
264
|
-
|
|
265
260
|
## SystemdJournalRemoteService
|
|
266
261
|
|
|
267
262
|
**Extends Service**
|
package/package.json
CHANGED
package/src/base.mjs
CHANGED
|
@@ -64,7 +64,7 @@ export class Base {
|
|
|
64
64
|
owner;
|
|
65
65
|
description;
|
|
66
66
|
name;
|
|
67
|
-
extends =
|
|
67
|
+
extends = new Set();
|
|
68
68
|
_tags = new Set();
|
|
69
69
|
_packaging = new Set();
|
|
70
70
|
_directory;
|
|
@@ -127,6 +127,15 @@ export class Base {
|
|
|
127
127
|
return this.owner.addObject(object);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
collectFromDirections(directions = ["this", "extends", "owner"], property) {
|
|
131
|
+
let collected = new Set();
|
|
132
|
+
for (const node of this.walkDirections(directions)) {
|
|
133
|
+
collected = collected.union(node[property]);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return collected;
|
|
137
|
+
}
|
|
138
|
+
|
|
130
139
|
/**
|
|
131
140
|
* Walk the object graph in some directions and deliver seen nodes.
|
|
132
141
|
* @param {string[]} directions
|
|
@@ -166,7 +175,7 @@ export class Base {
|
|
|
166
175
|
forOwner(owner) {
|
|
167
176
|
if (this.owner !== owner) {
|
|
168
177
|
const newObject = Object.create(this);
|
|
169
|
-
newObject.extends = [...this.extends];
|
|
178
|
+
newObject.extends = new Set([...this.extends]);
|
|
170
179
|
newObject.owner = owner;
|
|
171
180
|
return newObject;
|
|
172
181
|
}
|
|
@@ -414,7 +423,7 @@ export class Base {
|
|
|
414
423
|
}
|
|
415
424
|
|
|
416
425
|
get tags() {
|
|
417
|
-
return this.
|
|
426
|
+
return this.collectFromDirections(["this", "extends"], "_tags");
|
|
418
427
|
}
|
|
419
428
|
|
|
420
429
|
set tags(value) {
|
package/src/host.mjs
CHANGED
|
@@ -117,8 +117,8 @@ export class Host extends ServiceOwner {
|
|
|
117
117
|
const present = this._networkInterfaces.get(name);
|
|
118
118
|
|
|
119
119
|
if (present) {
|
|
120
|
-
//console.log("LINK", present.fullName, ni.fullName);
|
|
121
|
-
present.extends.
|
|
120
|
+
//console.log("LINK", present.fullName, ni.fullName,present.extends);
|
|
121
|
+
present.extends.add(ni);
|
|
122
122
|
} else {
|
|
123
123
|
this._networkInterfaces.set(name, ni.forOwner(this));
|
|
124
124
|
}
|
|
@@ -192,7 +192,9 @@ export class Host extends ServiceOwner {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
get derivedPackaging() {
|
|
195
|
-
return this.
|
|
195
|
+
return this.expand(
|
|
196
|
+
this.collectFromDirections(["this", "extends"], "_packaging")
|
|
197
|
+
);
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
get isTemplate() {
|
|
@@ -204,7 +206,11 @@ export class Host extends ServiceOwner {
|
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
get model() {
|
|
207
|
-
|
|
209
|
+
for (const node of this.walkDirections(["this", "extends"])) {
|
|
210
|
+
if (node.isModel) {
|
|
211
|
+
return node;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
208
214
|
}
|
|
209
215
|
|
|
210
216
|
set aliases(value) {
|
|
@@ -212,7 +218,9 @@ export class Host extends ServiceOwner {
|
|
|
212
218
|
}
|
|
213
219
|
|
|
214
220
|
get aliases() {
|
|
215
|
-
return this.
|
|
221
|
+
return this.expand(
|
|
222
|
+
this.collectFromDirections(["this", "extends"], "_aliases")
|
|
223
|
+
);
|
|
216
224
|
}
|
|
217
225
|
|
|
218
226
|
set provides(value) {
|
|
@@ -221,7 +229,7 @@ export class Host extends ServiceOwner {
|
|
|
221
229
|
|
|
222
230
|
get provides() {
|
|
223
231
|
return this.expand(
|
|
224
|
-
this.
|
|
232
|
+
this.collectFromDirections(["this", "extends"], "_provides")
|
|
225
233
|
);
|
|
226
234
|
}
|
|
227
235
|
|
|
@@ -231,7 +239,7 @@ export class Host extends ServiceOwner {
|
|
|
231
239
|
|
|
232
240
|
get replaces() {
|
|
233
241
|
return this.expand(
|
|
234
|
-
this.
|
|
242
|
+
this.collectFromDirections(["this", "extends"], "_replaces")
|
|
235
243
|
);
|
|
236
244
|
}
|
|
237
245
|
|
|
@@ -241,7 +249,7 @@ export class Host extends ServiceOwner {
|
|
|
241
249
|
|
|
242
250
|
get depends() {
|
|
243
251
|
return this.expand(
|
|
244
|
-
this.
|
|
252
|
+
this.collectFromDirections(["this", "extends"], "_depends")
|
|
245
253
|
);
|
|
246
254
|
}
|
|
247
255
|
|
|
@@ -233,8 +233,11 @@ export class InitializationContext {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
if (type.extends) {
|
|
236
|
-
//console.log("READ EXTENDS",data);
|
|
237
236
|
this.read(object, data, type.extends);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (data.extends) {
|
|
240
|
+
//console.log("EXTENDS", object.fullName, data.extends);
|
|
238
241
|
object.materializeExtends();
|
|
239
242
|
}
|
|
240
243
|
}
|
package/src/service-owner.mjs
CHANGED