pmcf 2.28.0 → 2.29.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/bin/pmcf-diagram CHANGED
@@ -45,7 +45,11 @@ for await (const network of location.networks()) {
45
45
  }
46
46
 
47
47
  for await (const cluster of location.clusters()) {
48
- console.log(` ${[...cluster.members].map(b => `${q(b.host.name)}:${b.name}`).join(" -- ")};`);
48
+ console.log(` subgraph cluster_${cluster.name} {`);
49
+
50
+ console.log(` ${[...cluster.members].map(b => `${q(b.host.name)}:${b.name}`).join(" -- ")};`);
51
+
52
+ console.log(" } [label=\"${cluster.name}\"];");
49
53
  }
50
54
 
51
55
  for (const bridge of location.bridges) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "2.28.0",
3
+ "version": "2.29.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -40,6 +40,7 @@ export class Cluster extends Host {
40
40
 
41
41
  set masters(value) {
42
42
  this._masters.add(value);
43
+ value.cluster = this;
43
44
  }
44
45
 
45
46
  get masters() {
@@ -48,6 +49,8 @@ export class Cluster extends Host {
48
49
 
49
50
  set backups(value) {
50
51
  this._backups.add(value);
52
+
53
+ value.cluster = this;
51
54
  }
52
55
 
53
56
  get backups() {
@@ -102,10 +102,6 @@ export async function generateNetworkDefs(host, packageData) {
102
102
  await writeLines(networkDir, `${ni.name}.network`, networkSections);
103
103
 
104
104
  switch (ni?.kind) {
105
- case "wireguard":
106
- {
107
- }
108
- break;
109
105
  case "wifi": {
110
106
  const d = join(packageData.dir, "etc/wpa_supplicant");
111
107
  await mkdir(d, { recursive: true });
@@ -133,8 +133,6 @@ export class NetworkInterface extends SkeletonNetworkInterface {
133
133
  _ipAddresses = new Map();
134
134
  _scope;
135
135
  _metric;
136
- _ssid;
137
- _psk;
138
136
  _kind;
139
137
  _hostName;
140
138
  _hwaddr;
@@ -247,6 +245,40 @@ export class NetworkInterface extends SkeletonNetworkInterface {
247
245
  return this.extendedProperty("_class") ?? this.network?.class;
248
246
  }
249
247
 
248
+ set kind(value) {
249
+ this._kind = value;
250
+ }
251
+
252
+ get kind() {
253
+ return this.extendedProperty("_kind") ?? this.network?.kind;
254
+ }
255
+ }
256
+
257
+ const WLANNetworkInterfaceTypeDefinition = {
258
+ name: "wlan",
259
+ specializationOf: NetworkInterfaceTypeDefinition,
260
+ owners: NetworkInterfaceTypeDefinition.owners,
261
+ extends: NetworkInterfaceTypeDefinition,
262
+ priority: 0.1,
263
+ properties: {}
264
+ };
265
+
266
+ export class WLANNetworkInterface extends NetworkInterface {
267
+ _ssid;
268
+ _psk;
269
+
270
+ static {
271
+ addType(this);
272
+ }
273
+
274
+ static get typeDefinition() {
275
+ return WLANNetworkInterfaceTypeDefinition;
276
+ }
277
+
278
+ /*get kind() {
279
+ return WLANNetworkInterfaceTypeDefinition.name;
280
+ }*/
281
+
250
282
  set ssid(value) {
251
283
  this._ssid = value;
252
284
  }
@@ -262,14 +294,6 @@ export class NetworkInterface extends SkeletonNetworkInterface {
262
294
  get psk() {
263
295
  return this.extendedProperty("_psk") ?? this.network?.psk;
264
296
  }
265
-
266
- set kind(value) {
267
- this._kind = value;
268
- }
269
-
270
- get kind() {
271
- return this.extendedProperty("_kind") ?? this.network?.kind;
272
- }
273
297
  }
274
298
 
275
299
  const LoopbackNetworkInterfaceTypeDefinition = {
@@ -319,8 +319,6 @@ export class NetworkInterface extends SkeletonNetworkInterface {
319
319
  _ipAddresses: Map<any, any>;
320
320
  _scope: any;
321
321
  _metric: any;
322
- _ssid: any;
323
- _psk: any;
324
322
  _kind: any;
325
323
  _hostName: any;
326
324
  _hwaddr: any;
@@ -346,12 +344,338 @@ export class NetworkInterface extends SkeletonNetworkInterface {
346
344
  _MTU: any;
347
345
  set class(value: any);
348
346
  get class(): any;
347
+ set kind(value: any);
348
+ get kind(): any;
349
+ }
350
+ export class WLANNetworkInterface extends NetworkInterface {
351
+ static get typeDefinition(): {
352
+ name: string;
353
+ specializationOf: {
354
+ name: string;
355
+ priority: number;
356
+ owners: string[];
357
+ extends: {
358
+ name: string;
359
+ owners: any[];
360
+ properties: {
361
+ owner: {
362
+ type: string;
363
+ collection: boolean;
364
+ writeable: boolean;
365
+ };
366
+ type: {
367
+ type: string;
368
+ collection: boolean;
369
+ writeable: boolean;
370
+ };
371
+ name: {
372
+ type: string;
373
+ collection: boolean;
374
+ identifier: boolean;
375
+ writeable: boolean;
376
+ };
377
+ description: {
378
+ type: string;
379
+ collection: boolean;
380
+ writeable: boolean;
381
+ };
382
+ priority: {
383
+ type: string;
384
+ collection: boolean;
385
+ writeable: boolean;
386
+ };
387
+ directory: {
388
+ type: string;
389
+ collection: boolean;
390
+ writeable: boolean;
391
+ };
392
+ packaging: {
393
+ type: string;
394
+ collection: boolean;
395
+ writeable: boolean;
396
+ };
397
+ tags: {
398
+ type: string;
399
+ collection: boolean;
400
+ writeable: boolean;
401
+ };
402
+ };
403
+ };
404
+ specializations: {};
405
+ factoryFor(value: any): any;
406
+ properties: {
407
+ hostName: {
408
+ type: string;
409
+ collection: boolean;
410
+ writeable: boolean;
411
+ };
412
+ ipAddresses: {
413
+ type: string;
414
+ collection: boolean;
415
+ writeable: boolean;
416
+ };
417
+ hwaddr: {
418
+ type: string;
419
+ collection: boolean;
420
+ writeable: boolean;
421
+ };
422
+ network: {
423
+ type: string;
424
+ collection: boolean;
425
+ writeable: boolean;
426
+ };
427
+ destination: {
428
+ type: string;
429
+ collection: boolean;
430
+ writeable: boolean;
431
+ };
432
+ arpbridge: {
433
+ type: string;
434
+ collection: boolean;
435
+ writeable: boolean;
436
+ };
437
+ cidrAddresses: {
438
+ type: string;
439
+ collection: boolean;
440
+ writeable: boolean;
441
+ };
442
+ cidrAddress: {
443
+ type: string;
444
+ collection: boolean;
445
+ writeable: boolean;
446
+ };
447
+ addresses: {
448
+ type: string;
449
+ collection: boolean;
450
+ writeable: boolean;
451
+ };
452
+ address: {
453
+ type: string;
454
+ collection: boolean;
455
+ writeable: boolean;
456
+ };
457
+ scope: {
458
+ type: string;
459
+ collection: boolean;
460
+ writeable: boolean;
461
+ values: string[];
462
+ default: string;
463
+ };
464
+ class: {
465
+ type: string;
466
+ collection: boolean;
467
+ writeable: boolean;
468
+ values: string[];
469
+ };
470
+ kind: {
471
+ type: string;
472
+ collection: boolean;
473
+ writeable: boolean;
474
+ values: string[];
475
+ };
476
+ ssid: {
477
+ type: string;
478
+ collection: boolean;
479
+ writeable: boolean;
480
+ };
481
+ psk: {
482
+ type: string;
483
+ collection: boolean;
484
+ writeable: boolean;
485
+ };
486
+ metric: {
487
+ type: string;
488
+ collection: boolean;
489
+ writeable: boolean;
490
+ default: number;
491
+ };
492
+ MTU: {
493
+ type: string;
494
+ collection: boolean;
495
+ writeable: boolean;
496
+ default: number;
497
+ };
498
+ gateway: {
499
+ type: string;
500
+ collection: boolean;
501
+ writeable: boolean;
502
+ };
503
+ multicastDNS: {
504
+ type: string;
505
+ collection: boolean;
506
+ writeable: boolean;
507
+ default: boolean;
508
+ };
509
+ };
510
+ };
511
+ owners: string[];
512
+ extends: {
513
+ name: string;
514
+ priority: number;
515
+ owners: string[];
516
+ extends: {
517
+ name: string;
518
+ owners: any[];
519
+ properties: {
520
+ owner: {
521
+ type: string;
522
+ collection: boolean;
523
+ writeable: boolean;
524
+ };
525
+ type: {
526
+ type: string;
527
+ collection: boolean;
528
+ writeable: boolean;
529
+ };
530
+ name: {
531
+ type: string;
532
+ collection: boolean;
533
+ identifier: boolean;
534
+ writeable: boolean;
535
+ };
536
+ description: {
537
+ type: string;
538
+ collection: boolean;
539
+ writeable: boolean;
540
+ };
541
+ priority: {
542
+ type: string;
543
+ collection: boolean;
544
+ writeable: boolean;
545
+ };
546
+ directory: {
547
+ type: string;
548
+ collection: boolean;
549
+ writeable: boolean;
550
+ };
551
+ packaging: {
552
+ type: string;
553
+ collection: boolean;
554
+ writeable: boolean;
555
+ };
556
+ tags: {
557
+ type: string;
558
+ collection: boolean;
559
+ writeable: boolean;
560
+ };
561
+ };
562
+ };
563
+ specializations: {};
564
+ factoryFor(value: any): any;
565
+ properties: {
566
+ hostName: {
567
+ type: string;
568
+ collection: boolean;
569
+ writeable: boolean;
570
+ };
571
+ ipAddresses: {
572
+ type: string;
573
+ collection: boolean;
574
+ writeable: boolean;
575
+ };
576
+ hwaddr: {
577
+ type: string;
578
+ collection: boolean;
579
+ writeable: boolean;
580
+ };
581
+ network: {
582
+ type: string;
583
+ collection: boolean;
584
+ writeable: boolean;
585
+ };
586
+ destination: {
587
+ type: string;
588
+ collection: boolean;
589
+ writeable: boolean;
590
+ };
591
+ arpbridge: {
592
+ type: string;
593
+ collection: boolean;
594
+ writeable: boolean;
595
+ };
596
+ cidrAddresses: {
597
+ type: string;
598
+ collection: boolean;
599
+ writeable: boolean;
600
+ };
601
+ cidrAddress: {
602
+ type: string;
603
+ collection: boolean;
604
+ writeable: boolean;
605
+ };
606
+ addresses: {
607
+ type: string;
608
+ collection: boolean;
609
+ writeable: boolean;
610
+ };
611
+ address: {
612
+ type: string;
613
+ collection: boolean;
614
+ writeable: boolean;
615
+ };
616
+ scope: {
617
+ type: string;
618
+ collection: boolean;
619
+ writeable: boolean;
620
+ values: string[];
621
+ default: string;
622
+ };
623
+ class: {
624
+ type: string;
625
+ collection: boolean;
626
+ writeable: boolean;
627
+ values: string[];
628
+ };
629
+ kind: {
630
+ type: string;
631
+ collection: boolean;
632
+ writeable: boolean;
633
+ values: string[];
634
+ };
635
+ ssid: {
636
+ type: string;
637
+ collection: boolean;
638
+ writeable: boolean;
639
+ };
640
+ psk: {
641
+ type: string;
642
+ collection: boolean;
643
+ writeable: boolean;
644
+ };
645
+ metric: {
646
+ type: string;
647
+ collection: boolean;
648
+ writeable: boolean;
649
+ default: number;
650
+ };
651
+ MTU: {
652
+ type: string;
653
+ collection: boolean;
654
+ writeable: boolean;
655
+ default: number;
656
+ };
657
+ gateway: {
658
+ type: string;
659
+ collection: boolean;
660
+ writeable: boolean;
661
+ };
662
+ multicastDNS: {
663
+ type: string;
664
+ collection: boolean;
665
+ writeable: boolean;
666
+ default: boolean;
667
+ };
668
+ };
669
+ };
670
+ priority: number;
671
+ properties: {};
672
+ };
673
+ _ssid: any;
674
+ _psk: any;
349
675
  set ssid(value: any);
350
676
  get ssid(): any;
351
677
  set psk(value: any);
352
678
  get psk(): any;
353
- set kind(value: any);
354
- get kind(): any;
355
679
  }
356
680
  export class LoopbackNetworkInterface extends SkeletonNetworkInterface {
357
681
  static get typeDefinition(): {