pmcf 3.1.1 → 3.2.0

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": "3.1.1",
3
+ "version": "3.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "ip-utilties": "^1.4.7",
54
54
  "npm-pkgbuild": "^18.2.16",
55
- "pacc": "^4.0.0",
55
+ "pacc": "^4.1.0",
56
56
  "package-directory": "^8.1.0"
57
57
  },
58
58
  "devDependencies": {
@@ -1,5 +1,6 @@
1
1
  import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
+ import { boolean_attribute_writeable_true } from "pacc";
3
4
  import { writeLines } from "../utils.mjs";
4
5
  import { addType } from "../types.mjs";
5
6
  import { Service, ServiceTypeDefinition } from "../service.mjs";
@@ -10,7 +11,12 @@ const InfluxdbServiceTypeDefinition = {
10
11
  owners: ServiceTypeDefinition.owners,
11
12
  extends: ServiceTypeDefinition,
12
13
  priority: 0.1,
13
- properties: {},
14
+ properties: {
15
+ "metrics-disabled": {
16
+ ...boolean_attribute_writeable_true,
17
+ isCommonOption: true
18
+ }
19
+ },
14
20
  service: {
15
21
  endpoints: [
16
22
  {
@@ -64,7 +70,12 @@ export class InfluxdbService extends Service {
64
70
  }
65
71
  };
66
72
 
67
- const lines = ["metrics-disabled: true"];
73
+ const lines = Object.entries(InfluxdbServiceTypeDefinition.properties)
74
+ .filter(
75
+ ([key, attribute]) =>
76
+ attribute.isCommonOption && this[key] !== undefined
77
+ )
78
+ .map(([key]) => `${key}: ${this[key]}`);
68
79
 
69
80
  await writeLines(join(dir, "etc", "influxdb"), "config.yml", lines);
70
81
 
@@ -1,5 +1,10 @@
1
1
  import { join } from "node:path";
2
2
  import { FileContentProvider } from "npm-pkgbuild";
3
+ import {
4
+ boolean_attribute_writeable_true,
5
+ boolean_attribute_writeable_false
6
+ } from "pacc";
7
+
3
8
  import { writeLines } from "../utils.mjs";
4
9
  import { addType } from "../types.mjs";
5
10
  import { Service, ServiceTypeDefinition } from "../service.mjs";
@@ -10,7 +15,16 @@ const MosquittoServiceTypeDefinition = {
10
15
  owners: ServiceTypeDefinition.owners,
11
16
  extends: ServiceTypeDefinition,
12
17
  priority: 0.1,
13
- properties: {},
18
+ properties: {
19
+ log_timestamp: {
20
+ ...boolean_attribute_writeable_false,
21
+ isCommonOption: true
22
+ },
23
+ allow_anonymous: {
24
+ ...boolean_attribute_writeable_false,
25
+ isCommonOption: true
26
+ }
27
+ },
14
28
  service: {
15
29
  extends: ["mqtt"]
16
30
  }
@@ -51,16 +65,21 @@ export class MosquittoService extends Service {
51
65
  }
52
66
  };
53
67
 
68
+ const lines = Object.entries(MosquittoServiceTypeDefinition.properties)
69
+ .filter(
70
+ ([key, attribute]) =>
71
+ attribute.isCommonOption && this[key] !== undefined
72
+ )
73
+ .map(([key]) => `${key}: ${this[key]}`);
74
+
54
75
  const endpoint = this.endpoint("mqtt");
55
76
 
56
- const lines = [
77
+ lines.push(
57
78
  `listener ${endpoint.port}`,
58
- "log_timestamp false",
59
- "allow_anonymous true",
60
79
  "persistence_location /var/lib/mosquitto",
61
80
  "password_file /etc/mosquitto/passwd",
62
81
  "acl_file /etc/mosquitto/acl"
63
- ];
82
+ );
64
83
 
65
84
  await writeLines(join(dir, "etc", "mosquitto"), "mosquitto.conf", lines);
66
85
 
package/types/base.d.mts CHANGED
@@ -22,7 +22,6 @@ export class Base {
22
22
  collection: boolean;
23
23
  private?: boolean;
24
24
  depends?: string;
25
- additionalAttributes: string[];
26
25
  description?: string;
27
26
  default?: any;
28
27
  set?: Function;
@@ -37,7 +36,6 @@ export class Base {
37
36
  collection: boolean;
38
37
  private?: boolean;
39
38
  depends?: string;
40
- additionalAttributes: string[];
41
39
  description?: string;
42
40
  default?: any;
43
41
  set?: Function;
@@ -57,7 +55,6 @@ export class Base {
57
55
  collection: boolean;
58
56
  private?: boolean;
59
57
  depends?: string;
60
- additionalAttributes: string[];
61
58
  description?: string;
62
59
  default?: any;
63
60
  set?: Function;
@@ -72,7 +69,6 @@ export class Base {
72
69
  collection: boolean;
73
70
  private?: boolean;
74
71
  depends?: string;
75
- additionalAttributes: string[];
76
72
  description?: string;
77
73
  default?: any;
78
74
  set?: Function;
@@ -88,7 +84,6 @@ export class Base {
88
84
  collection: boolean;
89
85
  private?: boolean;
90
86
  depends?: string;
91
- additionalAttributes: string[];
92
87
  description?: string;
93
88
  set?: Function;
94
89
  get?: Function;
@@ -102,7 +97,6 @@ export class Base {
102
97
  mandatory: boolean;
103
98
  private?: boolean;
104
99
  depends?: string;
105
- additionalAttributes: string[];
106
100
  description?: string;
107
101
  default?: any;
108
102
  set?: Function;
@@ -23,7 +23,6 @@ export class Cluster extends Host {
23
23
  collection: boolean;
24
24
  private?: boolean;
25
25
  depends?: string;
26
- additionalAttributes: string[];
27
26
  description?: string;
28
27
  default?: any;
29
28
  set?: Function;
@@ -38,7 +37,6 @@ export class Cluster extends Host {
38
37
  collection: boolean;
39
38
  private?: boolean;
40
39
  depends?: string;
41
- additionalAttributes: string[];
42
40
  description?: string;
43
41
  default?: any;
44
42
  set?: Function;
@@ -58,7 +56,6 @@ export class Cluster extends Host {
58
56
  collection: boolean;
59
57
  private?: boolean;
60
58
  depends?: string;
61
- additionalAttributes: string[];
62
59
  description?: string;
63
60
  default?: any;
64
61
  set?: Function;
@@ -73,7 +70,6 @@ export class Cluster extends Host {
73
70
  collection: boolean;
74
71
  private?: boolean;
75
72
  depends?: string;
76
- additionalAttributes: string[];
77
73
  description?: string;
78
74
  default?: any;
79
75
  set?: Function;
@@ -89,7 +85,6 @@ export class Cluster extends Host {
89
85
  collection: boolean;
90
86
  private?: boolean;
91
87
  depends?: string;
92
- additionalAttributes: string[];
93
88
  description?: string;
94
89
  set?: Function;
95
90
  get?: Function;
@@ -103,7 +98,6 @@ export class Cluster extends Host {
103
98
  mandatory: boolean;
104
99
  private?: boolean;
105
100
  depends?: string;
106
- additionalAttributes: string[];
107
101
  description?: string;
108
102
  default?: any;
109
103
  set?: Function;
@@ -143,7 +137,6 @@ export class Cluster extends Host {
143
137
  collection: boolean;
144
138
  private?: boolean;
145
139
  depends?: string;
146
- additionalAttributes: string[];
147
140
  description?: string;
148
141
  default?: any;
149
142
  set?: Function;
@@ -173,7 +166,6 @@ export class Cluster extends Host {
173
166
  collection: boolean;
174
167
  private?: boolean;
175
168
  depends?: string;
176
- additionalAttributes: string[];
177
169
  description?: string;
178
170
  default?: any;
179
171
  set?: Function;
@@ -188,7 +180,6 @@ export class Cluster extends Host {
188
180
  collection: boolean;
189
181
  private?: boolean;
190
182
  depends?: string;
191
- additionalAttributes: string[];
192
183
  description?: string;
193
184
  default?: any;
194
185
  set?: Function;
@@ -203,7 +194,6 @@ export class Cluster extends Host {
203
194
  mandatory: boolean;
204
195
  private?: boolean;
205
196
  depends?: string;
206
- additionalAttributes: string[];
207
197
  description?: string;
208
198
  default?: any;
209
199
  set?: Function;
@@ -218,7 +208,6 @@ export class Cluster extends Host {
218
208
  collection: boolean;
219
209
  private?: boolean;
220
210
  depends?: string;
221
- additionalAttributes: string[];
222
211
  description?: string;
223
212
  default?: any;
224
213
  set?: Function;
@@ -233,7 +222,6 @@ export class Cluster extends Host {
233
222
  mandatory: boolean;
234
223
  private?: boolean;
235
224
  depends?: string;
236
- additionalAttributes: string[];
237
225
  description?: string;
238
226
  default?: any;
239
227
  set?: Function;
@@ -248,7 +236,6 @@ export class Cluster extends Host {
248
236
  mandatory: boolean;
249
237
  private?: boolean;
250
238
  depends?: string;
251
- additionalAttributes: string[];
252
239
  description?: string;
253
240
  default?: any;
254
241
  set?: Function;
@@ -263,7 +250,6 @@ export class Cluster extends Host {
263
250
  collection: boolean;
264
251
  private?: boolean;
265
252
  depends?: string;
266
- additionalAttributes: string[];
267
253
  description?: string;
268
254
  default?: any;
269
255
  set?: Function;
@@ -295,7 +281,6 @@ export class Cluster extends Host {
295
281
  collection: boolean;
296
282
  private?: boolean;
297
283
  depends?: string;
298
- additionalAttributes: string[];
299
284
  description?: string;
300
285
  default?: any;
301
286
  set?: Function;
@@ -310,7 +295,6 @@ export class Cluster extends Host {
310
295
  collection: boolean;
311
296
  private?: boolean;
312
297
  depends?: string;
313
- additionalAttributes: string[];
314
298
  description?: string;
315
299
  default?: any;
316
300
  set?: Function;
@@ -330,7 +314,6 @@ export class Cluster extends Host {
330
314
  collection: boolean;
331
315
  private?: boolean;
332
316
  depends?: string;
333
- additionalAttributes: string[];
334
317
  description?: string;
335
318
  default?: any;
336
319
  set?: Function;
@@ -345,7 +328,6 @@ export class Cluster extends Host {
345
328
  collection: boolean;
346
329
  private?: boolean;
347
330
  depends?: string;
348
- additionalAttributes: string[];
349
331
  description?: string;
350
332
  default?: any;
351
333
  set?: Function;
@@ -361,7 +343,6 @@ export class Cluster extends Host {
361
343
  collection: boolean;
362
344
  private?: boolean;
363
345
  depends?: string;
364
- additionalAttributes: string[];
365
346
  description?: string;
366
347
  set?: Function;
367
348
  get?: Function;
@@ -375,7 +356,6 @@ export class Cluster extends Host {
375
356
  mandatory: boolean;
376
357
  private?: boolean;
377
358
  depends?: string;
378
- additionalAttributes: string[];
379
359
  description?: string;
380
360
  default?: any;
381
361
  set?: Function;
@@ -409,7 +389,6 @@ export class Cluster extends Host {
409
389
  collection: boolean;
410
390
  private?: boolean;
411
391
  depends?: string;
412
- additionalAttributes: string[];
413
392
  description?: string;
414
393
  default?: any;
415
394
  set?: Function;
@@ -424,7 +403,6 @@ export class Cluster extends Host {
424
403
  collection: boolean;
425
404
  private?: boolean;
426
405
  depends?: string;
427
- additionalAttributes: string[];
428
406
  description?: string;
429
407
  default?: any;
430
408
  set?: Function;
@@ -439,7 +417,6 @@ export class Cluster extends Host {
439
417
  collection: boolean;
440
418
  private?: boolean;
441
419
  depends?: string;
442
- additionalAttributes: string[];
443
420
  description?: string;
444
421
  default?: any;
445
422
  set?: Function;
@@ -455,7 +432,6 @@ export class Cluster extends Host {
455
432
  collection: boolean;
456
433
  private?: boolean;
457
434
  depends?: string;
458
- additionalAttributes: string[];
459
435
  description?: string;
460
436
  default?: any;
461
437
  set?: Function;
@@ -475,7 +451,6 @@ export class Cluster extends Host {
475
451
  collection: boolean;
476
452
  private?: boolean;
477
453
  depends?: string;
478
- additionalAttributes: string[];
479
454
  description?: string;
480
455
  default?: any;
481
456
  set?: Function;
@@ -490,7 +465,6 @@ export class Cluster extends Host {
490
465
  collection: boolean;
491
466
  private?: boolean;
492
467
  depends?: string;
493
- additionalAttributes: string[];
494
468
  description?: string;
495
469
  default?: any;
496
470
  set?: Function;
@@ -505,7 +479,6 @@ export class Cluster extends Host {
505
479
  collection: boolean;
506
480
  private?: boolean;
507
481
  depends?: string;
508
- additionalAttributes: string[];
509
482
  description?: string;
510
483
  default?: any;
511
484
  set?: Function;
@@ -521,7 +494,6 @@ export class Cluster extends Host {
521
494
  collection: boolean;
522
495
  private?: boolean;
523
496
  depends?: string;
524
- additionalAttributes: string[];
525
497
  description?: string;
526
498
  default?: any;
527
499
  set?: Function;
@@ -537,7 +509,6 @@ export class Cluster extends Host {
537
509
  collection: boolean;
538
510
  private?: boolean;
539
511
  depends?: string;
540
- additionalAttributes: string[];
541
512
  description?: string;
542
513
  default?: any;
543
514
  set?: Function;
@@ -552,7 +523,6 @@ export class Cluster extends Host {
552
523
  mandatory: boolean;
553
524
  private?: boolean;
554
525
  depends?: string;
555
- additionalAttributes: string[];
556
526
  description?: string;
557
527
  default?: any;
558
528
  set?: Function;
@@ -567,7 +537,6 @@ export class Cluster extends Host {
567
537
  mandatory: boolean;
568
538
  private?: boolean;
569
539
  depends?: string;
570
- additionalAttributes: string[];
571
540
  description?: string;
572
541
  default?: any;
573
542
  set?: Function;
@@ -582,7 +551,6 @@ export class Cluster extends Host {
582
551
  mandatory: boolean;
583
552
  private?: boolean;
584
553
  depends?: string;
585
- additionalAttributes: string[];
586
554
  description?: string;
587
555
  default?: any;
588
556
  set?: Function;
@@ -602,7 +570,6 @@ export class Cluster extends Host {
602
570
  mandatory: boolean;
603
571
  private?: boolean;
604
572
  depends?: string;
605
- additionalAttributes: string[];
606
573
  description?: string;
607
574
  default?: any;
608
575
  set?: Function;
@@ -622,7 +589,6 @@ export class Cluster extends Host {
622
589
  collection: boolean;
623
590
  private?: boolean;
624
591
  depends?: string;
625
- additionalAttributes: string[];
626
592
  description?: string;
627
593
  default?: any;
628
594
  set?: Function;
@@ -637,7 +603,6 @@ export class Cluster extends Host {
637
603
  mandatory: boolean;
638
604
  private?: boolean;
639
605
  depends?: string;
640
- additionalAttributes: string[];
641
606
  description?: string;
642
607
  default?: any;
643
608
  set?: Function;
@@ -652,7 +617,6 @@ export class Cluster extends Host {
652
617
  collection: boolean;
653
618
  private?: boolean;
654
619
  depends?: string;
655
- additionalAttributes: string[];
656
620
  description?: string;
657
621
  default?: any;
658
622
  set?: Function;
@@ -667,7 +631,6 @@ export class Cluster extends Host {
667
631
  mandatory: boolean;
668
632
  private?: boolean;
669
633
  depends?: string;
670
- additionalAttributes: string[];
671
634
  description?: string;
672
635
  default?: any;
673
636
  set?: Function;
@@ -682,7 +645,6 @@ export class Cluster extends Host {
682
645
  collection: boolean;
683
646
  private?: boolean;
684
647
  depends?: string;
685
- additionalAttributes: string[];
686
648
  description?: string;
687
649
  default?: any;
688
650
  set?: Function;
@@ -37,7 +37,6 @@ export class ExtraSourceService extends Service {
37
37
  collection: boolean;
38
38
  private?: boolean;
39
39
  depends?: string;
40
- additionalAttributes: string[];
41
40
  description?: string;
42
41
  default?: any;
43
42
  set?: Function;
@@ -52,7 +51,6 @@ export class ExtraSourceService extends Service {
52
51
  collection: boolean;
53
52
  private?: boolean;
54
53
  depends?: string;
55
- additionalAttributes: string[];
56
54
  description?: string;
57
55
  default?: any;
58
56
  set?: Function;
@@ -72,7 +70,6 @@ export class ExtraSourceService extends Service {
72
70
  collection: boolean;
73
71
  private?: boolean;
74
72
  depends?: string;
75
- additionalAttributes: string[];
76
73
  description?: string;
77
74
  default?: any;
78
75
  set?: Function;
@@ -87,7 +84,6 @@ export class ExtraSourceService extends Service {
87
84
  collection: boolean;
88
85
  private?: boolean;
89
86
  depends?: string;
90
- additionalAttributes: string[];
91
87
  description?: string;
92
88
  default?: any;
93
89
  set?: Function;
@@ -103,7 +99,6 @@ export class ExtraSourceService extends Service {
103
99
  collection: boolean;
104
100
  private?: boolean;
105
101
  depends?: string;
106
- additionalAttributes: string[];
107
102
  description?: string;
108
103
  set?: Function;
109
104
  get?: Function;
@@ -117,7 +112,6 @@ export class ExtraSourceService extends Service {
117
112
  mandatory: boolean;
118
113
  private?: boolean;
119
114
  depends?: string;
120
- additionalAttributes: string[];
121
115
  description?: string;
122
116
  default?: any;
123
117
  set?: Function;
@@ -137,7 +131,6 @@ export class ExtraSourceService extends Service {
137
131
  collection: boolean;
138
132
  private?: boolean;
139
133
  depends?: string;
140
- additionalAttributes: string[];
141
134
  description?: string;
142
135
  default?: any;
143
136
  set?: Function;
@@ -169,7 +162,6 @@ export class ExtraSourceService extends Service {
169
162
  collection: boolean;
170
163
  private?: boolean;
171
164
  depends?: string;
172
- additionalAttributes: string[];
173
165
  description?: string;
174
166
  default?: any;
175
167
  set?: Function;
@@ -184,7 +176,6 @@ export class ExtraSourceService extends Service {
184
176
  collection: boolean;
185
177
  private?: boolean;
186
178
  depends?: string;
187
- additionalAttributes: string[];
188
179
  description?: string;
189
180
  default?: any;
190
181
  set?: Function;
@@ -199,7 +190,6 @@ export class ExtraSourceService extends Service {
199
190
  mandatory: boolean;
200
191
  private?: boolean;
201
192
  depends?: string;
202
- additionalAttributes: string[];
203
193
  description?: string;
204
194
  default?: any;
205
195
  set?: Function;
@@ -214,7 +204,6 @@ export class ExtraSourceService extends Service {
214
204
  collection: boolean;
215
205
  private?: boolean;
216
206
  depends?: string;
217
- additionalAttributes: string[];
218
207
  description?: string;
219
208
  default?: any;
220
209
  set?: Function;
@@ -229,7 +218,6 @@ export class ExtraSourceService extends Service {
229
218
  collection: boolean;
230
219
  private?: boolean;
231
220
  depends?: string;
232
- additionalAttributes: string[];
233
221
  description?: string;
234
222
  default?: any;
235
223
  set?: Function;
@@ -244,7 +232,6 @@ export class ExtraSourceService extends Service {
244
232
  mandatory: boolean;
245
233
  private?: boolean;
246
234
  depends?: string;
247
- additionalAttributes: string[];
248
235
  description?: string;
249
236
  default?: any;
250
237
  set?: Function;
@@ -259,7 +246,6 @@ export class ExtraSourceService extends Service {
259
246
  collection: boolean;
260
247
  private?: boolean;
261
248
  depends?: string;
262
- additionalAttributes: string[];
263
249
  description?: string;
264
250
  default?: any;
265
251
  set?: Function;
@@ -274,7 +260,6 @@ export class ExtraSourceService extends Service {
274
260
  mandatory: boolean;
275
261
  private?: boolean;
276
262
  depends?: string;
277
- additionalAttributes: string[];
278
263
  description?: string;
279
264
  default?: any;
280
265
  set?: Function;
@@ -289,7 +274,6 @@ export class ExtraSourceService extends Service {
289
274
  collection: boolean;
290
275
  private?: boolean;
291
276
  depends?: string;
292
- additionalAttributes: string[];
293
277
  description?: string;
294
278
  default?: any;
295
279
  set?: Function;