pmcf 6.39.7 → 6.39.9

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
@@ -47,75 +47,75 @@ generates config packages for:
47
47
  * [templateContentAttributes](#templatecontentattributes)
48
48
  * [Parameters](#parameters)
49
49
  * [templateContent](#templatecontent)
50
- * [Parameters](#parameters-1)
51
50
  * [isTemplate](#istemplate)
52
51
  * [access](#access)
53
52
  * [loadHooks](#loadhooks)
54
- * [Parameters](#parameters-2)
53
+ * [Parameters](#parameters-1)
55
54
  * [serviceEndpoints](#serviceendpoints)
56
- * [Parameters](#parameters-3)
55
+ * [Parameters](#parameters-2)
57
56
  * [attributeIterator](#attributeiterator)
58
- * [Parameters](#parameters-4)
57
+ * [Parameters](#parameters-3)
59
58
  * [getAttributes](#getattributes)
60
- * [Parameters](#parameters-5)
59
+ * [Parameters](#parameters-4)
61
60
  * [property](#property)
62
- * [Parameters](#parameters-6)
61
+ * [Parameters](#parameters-5)
63
62
  * [attribute](#attribute)
64
- * [Parameters](#parameters-7)
63
+ * [Parameters](#parameters-6)
65
64
  * [walkDirections](#walkdirections)
66
- * [Parameters](#parameters-8)
65
+ * [Parameters](#parameters-7)
67
66
  * [mapFromDirections](#mapfromdirections)
68
- * [Parameters](#parameters-9)
67
+ * [Parameters](#parameters-8)
69
68
  * [unionFromDirections](#unionfromdirections)
70
- * [Parameters](#parameters-10)
69
+ * [Parameters](#parameters-9)
71
70
  * [expand](#expand)
72
- * [Parameters](#parameters-11)
71
+ * [Parameters](#parameters-10)
73
72
  * [expression](#expression)
74
- * [Parameters](#parameters-12)
73
+ * [Parameters](#parameters-11)
74
+ * [isTemplate](#istemplate-1)
75
75
  * [PortEndpoint](#portendpoint)
76
- * [Parameters](#parameters-13)
76
+ * [Parameters](#parameters-12)
77
77
  * [port](#port)
78
78
  * [socketAddress](#socketaddress)
79
79
  * [HTTPEndpoint](#httpendpoint)
80
- * [Parameters](#parameters-14)
80
+ * [Parameters](#parameters-13)
81
81
  * [port](#port-1)
82
82
  * [domainNames](#domainnames)
83
83
  * [InitializationContext](#initializationcontext)
84
- * [Parameters](#parameters-15)
84
+ * [Parameters](#parameters-14)
85
85
  * [SkeletonNetworkInterface](#skeletonnetworkinterface)
86
86
  * [networkAddresses](#networkaddresses)
87
- * [Parameters](#parameters-16)
87
+ * [Parameters](#parameters-15)
88
88
  * [zones](#zones)
89
89
  * [addressesStatement](#addressesstatement)
90
- * [Parameters](#parameters-17)
90
+ * [Parameters](#parameters-16)
91
91
  * [SystemdJournalRemoteService](#systemdjournalremoteservice)
92
92
  * [Properties](#properties)
93
93
  * [systemdConfigs](#systemdconfigs)
94
- * [Parameters](#parameters-18)
94
+ * [Parameters](#parameters-17)
95
95
  * [SystemdJournalUploadService](#systemdjournaluploadservice)
96
96
  * [Properties](#properties-1)
97
97
  * [systemdConfigs](#systemdconfigs-1)
98
- * [Parameters](#parameters-19)
98
+ * [Parameters](#parameters-18)
99
99
  * [NetworkAddress](#networkaddress)
100
- * [Parameters](#parameters-20)
100
+ * [Parameters](#parameters-19)
101
101
  * [subnet](#subnet)
102
102
  * [networkInterface](#networkinterface)
103
103
  * [address](#address)
104
104
  * [addresses](#addresses)
105
- * [Parameters](#parameters-21)
105
+ * [Parameters](#parameters-20)
106
106
  * [cidrAddresses](#cidraddresses)
107
- * [Parameters](#parameters-22)
107
+ * [Parameters](#parameters-21)
108
108
  * [families](#families)
109
109
  * [secretName](#secretname)
110
110
  * [directHosts](#directhosts)
111
111
  * [subnetForAddress](#subnetforaddress)
112
- * [Parameters](#parameters-23)
112
+ * [Parameters](#parameters-22)
113
113
  * [domainName](#domainname)
114
- * [Parameters](#parameters-24)
114
+ * [Parameters](#parameters-23)
115
115
  * [domainFromDominName](#domainfromdominname)
116
- * [Parameters](#parameters-25)
116
+ * [Parameters](#parameters-24)
117
117
  * [sectionLines](#sectionlines)
118
- * [Parameters](#parameters-26)
118
+ * [Parameters](#parameters-25)
119
119
 
120
120
  ## base
121
121
 
@@ -142,11 +142,6 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
142
142
 
143
143
  ### templateContent
144
144
 
145
- #### Parameters
146
-
147
- * `entryProperties` **any** 
148
- * `directoryProperties` **any** 
149
-
150
145
  Returns **AsyncIterable\<ContentProvider>**&#x20;
151
146
 
152
147
  ### isTemplate
@@ -263,6 +258,10 @@ Returns **any**&#x20;
263
258
 
264
259
  Returns **any**&#x20;
265
260
 
261
+ ## isTemplate
262
+
263
+ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**&#x20;
264
+
266
265
  ## PortEndpoint
267
266
 
268
267
  **Extends BaseEndpoint**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.39.7",
3
+ "version": "6.39.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -66,7 +66,7 @@
66
66
  "semantic-release": "^25.0.9"
67
67
  },
68
68
  "engines": {
69
- "node": ">=26.7.0"
69
+ "node": ">=26.8.1"
70
70
  },
71
71
  "repository": {
72
72
  "type": "git",
package/src/base.mjs CHANGED
@@ -217,7 +217,7 @@ export class base extends core {
217
217
  }
218
218
  }
219
219
  }
220
- return this.content?.packageData(this);
220
+ return this.content?.packageData();
221
221
  }
222
222
 
223
223
  async *preparePackages(stagingDir) {}
@@ -248,22 +248,16 @@ export class base extends core {
248
248
 
249
249
  /**
250
250
  *
251
- * @param {*} entryProperties
252
- * @param {*} directoryProperties
253
251
  * @returns {AsyncIterable<ContentProvider>}
254
252
  */
255
- async *templateContent(entryProperties, directoryProperties) {
253
+ async *templateContent() {
256
254
  for (const node of this.walkDirections(["this", "extends"])) {
257
255
  const dir = join(node.directory, "content");
258
256
 
259
257
  try {
260
258
  if ((await stat(dir)).isDirectory) {
261
259
  yield transform(
262
- new FileContentProvider(
263
- this.templateContentAttributes(dir),
264
- entryProperties,
265
- directoryProperties
266
- ),
260
+ new FileContentProvider(this.templateContentAttributes(dir)),
267
261
  this.templateTransformers
268
262
  );
269
263
  }
@@ -279,10 +273,7 @@ export class base extends core {
279
273
  * @return {boolean}
280
274
  */
281
275
  get isTemplate() {
282
- return (
283
- this.template ??
284
- (this.name?.indexOf("*") >= 0 || this.owner?.isTemplate || false)
285
- );
276
+ return this.template ?? (super.isTemplate || this.name?.indexOf("*") >= 0);
286
277
  }
287
278
 
288
279
  error(...args) {
package/src/content.mjs CHANGED
@@ -97,8 +97,7 @@ export class content extends core {
97
97
  _hooks = new Set();
98
98
 
99
99
  value(name) {
100
- // console.log("CONTENT VALUE", this.name, this.owner.fullName, name, this.owner.name);
101
- return this.owner.value(name) ?? super.value(name);
100
+ return super.value(name) ?? this.owner.value(name);
102
101
  }
103
102
 
104
103
  get name() {
@@ -226,26 +225,7 @@ export class content extends core {
226
225
  }
227
226
 
228
227
  get permissions() {
229
- const p = this.mapFromDirections(["this", "extends"], "_permissions");
230
-
231
- return p;
232
-
233
- /*
234
- const owner = this.systemUserName;
235
- const group = this.systemGroupName;
236
- return [
237
- {
238
- mode: 0o644,
239
- owner,
240
- group
241
- },
242
- {
243
- mode: 0o755,
244
- owner,
245
- group
246
- }
247
- ];
248
- */
228
+ return this.mapFromDirections(["this", "extends"], "_permissions");
249
229
  }
250
230
 
251
231
  /**
@@ -274,7 +274,7 @@ export class CoreService extends base {
274
274
  const pd = await this.packageData;
275
275
 
276
276
  pd.sources = await Array.fromAsync(
277
- this.templateContent(this.content.permissions)
277
+ this.templateContent()
278
278
  );
279
279
 
280
280
  if (pd.sources.length) {
@@ -281,7 +281,6 @@ class bind_object extends base {
281
281
  }
282
282
 
283
283
  export class bind_acl extends bind_object {
284
-
285
284
  static {
286
285
  addType(this);
287
286
  }
@@ -630,9 +629,7 @@ class bind_view extends bind_object {
630
629
 
631
630
  async packageContent(outputControl) {
632
631
  outputControl.packageData.sources.push(
633
- ...(await Array.fromAsync(
634
- this.templateContent(...outputControl.permissions)
635
- ))
632
+ ...(await Array.fromAsync(this.templateContent()))
636
633
  );
637
634
 
638
635
  for (const config of this.zoneConfigs.values()) {
@@ -803,36 +800,14 @@ export class bind extends CoreService {
803
800
  return false;
804
801
  }
805
802
 
806
- templateContentAttributes(dir) {
807
- const attr = super.templateContentAttributes(dir);
808
-
809
- // attr.properties = this.packageContentProperties;
810
-
811
- attr.properties = {
812
- "usr/share/libalpm/scripts/*": { mode: 0o777 },
813
- "etc/named/**/*": { user: "named", group: "named" },
814
- "var/lib/named/**/*": { user: "named", group: "named" }
815
- };
816
-
817
- console.log("templateContentAttributes", this.fullName, attr);
818
-
819
- return attr;
820
- }
821
-
822
803
  async *preparePackages(dir) {
823
804
  const packageData = await this.packageData;
824
805
 
825
- const permissions = this.content.permissions;
826
-
827
- packageData.sources = await Array.fromAsync(
828
- this.templateContent(permissions)
829
- );
806
+ packageData.sources = await Array.fromAsync(this.templateContent());
830
807
 
831
808
  let hasContent = packageData.sources.length > 0;
832
809
 
833
- packageData.sources.push(
834
- new FileContentProvider(dir + "/", permissions)
835
- );
810
+ packageData.sources.push(new FileContentProvider({ dir: dir + "/" }));
836
811
 
837
812
  const outputControl = { packageData, dir, permissions };
838
813
 
@@ -59,15 +59,10 @@ export class mosquitto extends CoreService {
59
59
  );*/
60
60
 
61
61
  const packageData = await this.packageData;
62
- const permissions = this.content.permissions;
63
62
 
64
- packageData.sources = await Array.fromAsync(
65
- this.templateContent(...permissions)
66
- );
63
+ packageData.sources = await Array.fromAsync(this.templateContent());
67
64
 
68
- packageData.sources.push(
69
- new FileContentProvider(dir + "/", permissions)
70
- );
65
+ packageData.sources.push(new FileContentProvider({ dir: dir + "/" }));
71
66
 
72
67
  await writeLines(
73
68
  join(dir, "etc", "mosquitto"),