pmcf 4.25.12 → 4.25.14

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": "4.25.12",
3
+ "version": "4.25.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -55,7 +55,7 @@ export class Base {
55
55
  }
56
56
 
57
57
  static get typeName() {
58
- return this.typeDefinition.name;
58
+ return this.typeDefinition?.name || this.name;
59
59
  }
60
60
 
61
61
  static get typeFileName() {
package/src/service.mjs CHANGED
@@ -52,7 +52,7 @@ export const ServiceTypeDefinition = {
52
52
  name: "service",
53
53
  priority: 1.1,
54
54
  owners: [Host.typeDefinition, "cluster", "network_interface"],
55
- extends: Base.typeDefinition,
55
+ extends: Base,
56
56
  specializations: {},
57
57
  factoryFor(owner, value) {
58
58
  const type = value.type ?? value.name;
@@ -8,54 +8,50 @@ import {
8
8
  import { addServiceType, Base } from "pmcf";
9
9
  import { ServiceTypeDefinition, Service } from "../service.mjs";
10
10
 
11
- const ALPMRepositoryTypeDefinition = {
12
- name: "alpm_repository",
13
- extends: Base.typeDefinition,
14
- key: "name",
15
- attributes: {
11
+ class ALPMRepository extends Base {
12
+ static name = "alpm_repository";
13
+ static extends = Base.typeDefinition;
14
+ static key = "name";
15
+ static attributes = {
16
16
  name: name_attribute_writable,
17
17
  base: string_attribute_writable,
18
18
  architectures: string_set_attribute_writable
19
- }
20
- };
19
+ };
21
20
 
22
- class ALPMRepository extends Base {
23
- static typeDefinition = ALPMRepositoryTypeDefinition;
21
+ static typeDefinition = this;
24
22
  static {
25
23
  addType(this);
26
24
  }
27
25
  }
28
26
 
29
- const ALPMServiceTypeDefinition = {
30
- name: "alpm",
31
- priority: 1,
32
- extends: ServiceTypeDefinition,
33
- specializationOf: ServiceTypeDefinition,
34
- owners: ServiceTypeDefinition.owners,
35
- attributes: {
27
+ export class ALPMService extends Service {
28
+ static name = "alpm";
29
+ static priority = 1;
30
+ static extends = ServiceTypeDefinition;
31
+ static specializationOf = ServiceTypeDefinition;
32
+ static owners = ServiceTypeDefinition.owners;
33
+ static attributes = {
36
34
  repositories: {
37
35
  ...default_attribute_writable,
38
36
  type: "alpm_repository",
39
37
  collection: true
40
38
  }
41
- },
39
+ };
42
40
 
43
- service: {
41
+ static service = {
44
42
  extends: ["https", "http"]
45
- }
46
- };
43
+ };
47
44
 
48
- export class ALPMService extends Service {
49
- static typeDefinition = ALPMServiceTypeDefinition;
45
+ static typeDefinition = this;
50
46
  static {
51
47
  addType(this);
52
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
48
+ addServiceType(this.service, this.name);
53
49
  }
54
50
 
55
51
  repositories = new Map();
56
52
 
57
53
  typeNamed(type, name) {
58
- if (type === ALPMRepositoryTypeDefinition.name) {
54
+ if (type === ALPMService.name) {
59
55
  return this.repositories.get(name);
60
56
  }
61
57
 
@@ -33,11 +33,10 @@ import { addHook } from "../hooks.mjs";
33
33
 
34
34
  const bindNetworkAddressTypes = networkAddressType + "|bind_group";
35
35
 
36
- const BindGroupTypeDefinition = {
37
- name: "bind_group",
38
- priority: 1,
39
- key: "name",
40
- attributes: {
36
+ class bind_group extends Base {
37
+ static priority = 1;
38
+ static key = "name";
39
+ static attributes = {
41
40
  name: name_attribute_writable,
42
41
  access: {
43
42
  type: bindNetworkAddressTypes,
@@ -77,11 +76,9 @@ const BindGroupTypeDefinition = {
77
76
  retry: { ...duration_attribute_writable, default: 72000 },
78
77
  expire: { ...duration_attribute_writable, default: 600000 },
79
78
  minimum: { ...duration_attribute_writable, default: 60000 }
80
- }
81
- };
79
+ };
82
80
 
83
- class BindGroup extends Base {
84
- static typeDefinition = BindGroupTypeDefinition;
81
+ static typeDefinition = this;
85
82
  static {
86
83
  addType(this);
87
84
  }
@@ -94,8 +91,7 @@ class BindGroup extends Base {
94
91
  notify = true;
95
92
  hasCatalog = true;
96
93
  hasSVRRecords = true;
97
- hasLinkLocalAdresses =
98
- BindGroupTypeDefinition.attributes.hasLinkLocalAdresses.default;
94
+ hasLinkLocalAdresses = bind_group.attributes.hasLinkLocalAdresses.default;
99
95
 
100
96
  recordTTL = "1W";
101
97
 
@@ -392,16 +388,26 @@ class BindGroup extends Base {
392
388
  }
393
389
  }
394
390
 
395
- const BindServiceTypeDefinition = {
396
- name: "bind",
397
- extends: ExtraSourceServiceTypeDefinition,
398
- specializationOf: ServiceTypeDefinition,
399
- owners: ServiceTypeDefinition.owners,
400
- key: "name",
401
- attributes: {
391
+ function addressesStatement(prefix, objects, generateEmpty = false) {
392
+ const body = asArray(objects).map(name => ` ${name};`);
393
+
394
+ if (body.length || generateEmpty) {
395
+ return [`${prefix} {`, body, "};"];
396
+ }
397
+
398
+ return [];
399
+ }
400
+
401
+ export class BindService extends ExtraSourceService {
402
+ static name = "bind";
403
+ static extends = ExtraSourceServiceTypeDefinition;
404
+ static specializationOf = ServiceTypeDefinition;
405
+ static owners = ServiceTypeDefinition.owners;
406
+ static key = "name";
407
+ static attributes = {
402
408
  groups: {
403
409
  ...default_attribute_writable,
404
- type: BindGroupTypeDefinition,
410
+ type: bind_group,
405
411
  collection: true,
406
412
  writable: true
407
413
  },
@@ -410,8 +416,8 @@ const BindServiceTypeDefinition = {
410
416
  type: networkAddressType,
411
417
  collection: true
412
418
  }
413
- },
414
- service: {
419
+ };
420
+ static service = {
415
421
  systemdService: "bind.service",
416
422
  extends: ["dns"],
417
423
  services: {
@@ -447,31 +453,19 @@ const BindServiceTypeDefinition = {
447
453
  ]
448
454
  }
449
455
  }
450
- }
451
- };
452
-
453
- function addressesStatement(prefix, objects, generateEmpty = false) {
454
- const body = asArray(objects).map(name => ` ${name};`);
455
-
456
- if (body.length || generateEmpty) {
457
- return [`${prefix} {`, body, "};"];
458
- }
459
-
460
- return [];
461
- }
456
+ };
462
457
 
463
- export class BindService extends ExtraSourceService {
464
- static typeDefinition = BindServiceTypeDefinition;
458
+ static typeDefinition = this;
465
459
 
466
460
  static {
467
461
  addType(this);
468
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
462
+ addServiceType(this.service, this.name);
469
463
  }
470
464
 
471
465
  groups = {};
472
466
 
473
467
  get type() {
474
- return BindServiceTypeDefinition.name;
468
+ return this.constructor.name;
475
469
  }
476
470
 
477
471
  materializeExtends() {
@@ -522,7 +516,7 @@ export class BindService extends ExtraSourceService {
522
516
  }
523
517
 
524
518
  typeNamed(type, name) {
525
- if (type === BindGroupTypeDefinition.name) {
519
+ if (type === bind_group.name) {
526
520
  return this.groups[name];
527
521
  }
528
522
 
@@ -10,14 +10,14 @@ import {
10
10
  } from "../extra-source-service.mjs";
11
11
  import { writeLines } from "../utils.mjs";
12
12
 
13
- const ChronyServiceTypeDefinition = {
14
- name: "chrony",
15
- priority: 1,
16
- extends: ExtraSourceServiceTypeDefinition,
17
- specializationOf: ServiceTypeDefinition,
18
- owners: ServiceTypeDefinition.owners,
19
- key: "name",
20
- service: {
13
+ export class ChronyService extends ExtraSourceService {
14
+ static name = "chrony";
15
+ static priority = 1;
16
+ static extends = ExtraSourceServiceTypeDefinition;
17
+ static specializationOf = ServiceTypeDefinition;
18
+ static owners = ServiceTypeDefinition.owners;
19
+ static key = "name";
20
+ static service = {
21
21
  systemdService: "chronyd.service",
22
22
  extends: ["ntp"],
23
23
  services: {
@@ -42,18 +42,16 @@ const ChronyServiceTypeDefinition = {
42
42
  ]
43
43
  }
44
44
  }
45
- }
46
- };
45
+ };
47
46
 
48
- export class ChronyService extends ExtraSourceService {
49
- static typeDefinition = ChronyServiceTypeDefinition;
47
+ static typeDefinition = this;
50
48
  static {
51
49
  addType(this);
52
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
50
+ addServiceType(this.service, this.name);
53
51
  }
54
52
 
55
53
  get type() {
56
- return ChronyServiceTypeDefinition.name;
54
+ return this.constructor.name;
57
55
  }
58
56
 
59
57
  async *preparePackages(dir) {
@@ -2,14 +2,14 @@ import { addType } from "pacc";
2
2
  import { addServiceType } from "pmcf";
3
3
  import { ServiceTypeDefinition, Service } from "../service.mjs";
4
4
 
5
- const HeadscaleServiceTypeDefinition = {
6
- name: "headscale",
7
- priority: 1,
8
- extends: ServiceTypeDefinition,
9
- specializationOf: ServiceTypeDefinition,
10
- owners: ServiceTypeDefinition.owners,
11
- key: "name",
12
- service: {
5
+ export class HeadscaleService extends Service {
6
+ static name = "headscale";
7
+ static priority = 1;
8
+ static extends = ServiceTypeDefinition;
9
+ static specializationOf = ServiceTypeDefinition;
10
+ static owners = ServiceTypeDefinition.owners;
11
+ static key = "name";
12
+ static service = {
13
13
  endpoints: [
14
14
  {
15
15
  family: "unix",
@@ -36,13 +36,10 @@ const HeadscaleServiceTypeDefinition = {
36
36
  tls: false
37
37
  }
38
38
  ]
39
- }
40
- };
41
-
42
- export class HeadscaleService extends Service {
43
- static typeDefinition = HeadscaleServiceTypeDefinition;
39
+ };
40
+ static typeDefinition = this;
44
41
  static {
45
42
  addType(this);
46
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
43
+ addServiceType(this.service, this.name);
47
44
  }
48
45
  }
@@ -9,21 +9,21 @@ import {
9
9
  } from "../utils.mjs";
10
10
  import { Service, ServiceTypeDefinition } from "../service.mjs";
11
11
 
12
- const InfluxdbServiceTypeDefinition = {
13
- name: "influxdb",
14
- priority: 1,
15
- extends: ServiceTypeDefinition,
16
- specializationOf: ServiceTypeDefinition,
17
- owners: ServiceTypeDefinition.owners,
18
- key: "name",
19
- attributes: {
12
+ export class InfluxdbService extends Service {
13
+ static name = "influxdb";
14
+ static priority = 1;
15
+ static extends = ServiceTypeDefinition;
16
+ static specializationOf = ServiceTypeDefinition;
17
+ static owners = ServiceTypeDefinition.owners;
18
+ static key = "name";
19
+ static attributes = {
20
20
  metricsDisabled: {
21
21
  externalName: "metrics-disabled",
22
22
  ...boolean_attribute_writable_true,
23
23
  configurable: true
24
24
  }
25
- },
26
- service: {
25
+ };
26
+ static service = {
27
27
  endpoints: [
28
28
  {
29
29
  family: "IPv4",
@@ -40,18 +40,16 @@ const InfluxdbServiceTypeDefinition = {
40
40
  pathname: "/"
41
41
  }
42
42
  ]
43
- }
44
- };
43
+ };
45
44
 
46
- export class InfluxdbService extends Service {
47
- static typeDefinition = InfluxdbServiceTypeDefinition;
45
+ static typeDefinition = this;
48
46
  static {
49
47
  addType(this);
50
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
48
+ addServiceType(this.service, this.name);
51
49
  }
52
50
 
53
51
  get type() {
54
- return InfluxdbServiceTypeDefinition.name;
52
+ return this.constructor.name;
55
53
  }
56
54
 
57
55
  async *preparePackages(dir) {
@@ -62,7 +60,9 @@ export class InfluxdbService extends Service {
62
60
  await writeLines(
63
61
  join(dir, "etc", "influxdb"),
64
62
  "config.yml",
65
- setionLinesFromPropertyIterator(this.attributeIterator(filterConfigurable))
63
+ setionLinesFromPropertyIterator(
64
+ this.attributeIterator(filterConfigurable)
65
+ )
66
66
  );
67
67
 
68
68
  yield packageData;
@@ -18,14 +18,16 @@ import {
18
18
  } from "pmcf";
19
19
  import { writeLines } from "../utils.mjs";
20
20
 
21
- const KeaServiceTypeDefinition = {
22
- name: "kea",
23
- priority: 1,
24
- extends: ServiceTypeDefinition,
25
- specializationOf: ServiceTypeDefinition,
26
- owners: ServiceTypeDefinition.owners,
27
- key: "name",
28
- attributes: {
21
+ const keaVersion = "3.0.1";
22
+
23
+ export class KeaService extends Service {
24
+ static name = "kea";
25
+ static priority = 1;
26
+ static extends = ServiceTypeDefinition;
27
+ static specializationOf = ServiceTypeDefinition;
28
+ static owners = ServiceTypeDefinition.owners;
29
+ static key = "name";
30
+ static attributes = {
29
31
  "ddns-send-updates": {
30
32
  ...boolean_attribute_writable_true,
31
33
  configurable: true
@@ -51,8 +53,8 @@ const KeaServiceTypeDefinition = {
51
53
  configurable: true
52
54
  //values: ["check-exists-with-dhcid","no-check-with-dhcid"]
53
55
  }
54
- },
55
- service: {
56
+ };
57
+ static service = {
56
58
  extends: ["dhcp"],
57
59
  services: {
58
60
  "kea-ddns": {
@@ -124,20 +126,16 @@ const KeaServiceTypeDefinition = {
124
126
  ]
125
127
  }
126
128
  }
127
- }
128
- };
129
+ };
129
130
 
130
- const keaVersion = "3.0.1";
131
-
132
- export class KeaService extends Service {
133
- static typeDefinition = KeaServiceTypeDefinition;
131
+ static typeDefinition = this;
134
132
  static {
135
133
  addType(this);
136
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
134
+ addServiceType(this.service, this.name);
137
135
  }
138
136
 
139
137
  get type() {
140
- return KeaServiceTypeDefinition.name;
138
+ return this.constructor.name;
141
139
  }
142
140
 
143
141
  async *preparePackages(dir) {
@@ -2,14 +2,14 @@ import { port_attribute, string_attribute_writable, addType } from "pacc";
2
2
  import { addServiceType } from "pmcf";
3
3
  import { Service, ServiceTypeDefinition } from "../service.mjs";
4
4
 
5
- const MosquittoServiceTypeDefinition = {
6
- name: "mosquitto",
7
- priority: 1,
8
- extends: ServiceTypeDefinition,
9
- specializationOf: ServiceTypeDefinition,
10
- owners: ServiceTypeDefinition.owners,
11
- key: "name",
12
- attributes: {
5
+ export class MosquittoService extends Service {
6
+ static name = "mosquitto";
7
+ static priority = 1;
8
+ static extends = ServiceTypeDefinition;
9
+ static specializationOf = ServiceTypeDefinition;
10
+ static owners = ServiceTypeDefinition.owners;
11
+ static key = "name";
12
+ static attributes = {
13
13
  listener: {
14
14
  ...port_attribute,
15
15
  writable: true,
@@ -27,21 +27,18 @@ const MosquittoServiceTypeDefinition = {
27
27
  ...string_attribute_writable,
28
28
  configurable: true
29
29
  }
30
- },
31
- service: {
30
+ };
31
+ static service = {
32
32
  extends: ["mqtt"]
33
- }
34
- };
35
-
36
- export class MosquittoService extends Service {
37
- static typeDefinition = MosquittoServiceTypeDefinition;
33
+ };
34
+ static typeDefinition = this;
38
35
  static {
39
36
  addType(this);
40
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
37
+ addServiceType(this.service, this.name);
41
38
  }
42
39
 
43
40
  get type() {
44
- return MosquittoServiceTypeDefinition.name;
41
+ return this.constructor.name;
45
42
  }
46
43
 
47
44
  get listener() {
@@ -1,42 +1,34 @@
1
- import { FileContentProvider } from "npm-pkgbuild";
2
- import {
3
- string_attribute_writable,
4
- number_attribute_writable,
5
- object_attribute,
6
- addType
7
- } from "pacc";
1
+ import { string_attribute_writable, addType } from "pacc";
8
2
  import { addServiceType } from "pmcf";
9
3
  import { ServiceTypeDefinition, Service } from "../service.mjs";
10
4
 
11
- const OpenLDAPServiceTypeDefinition = {
12
- name: "openldap",
13
- priority: 1,
14
- extends: ServiceTypeDefinition,
15
- specializationOf: ServiceTypeDefinition,
16
- owners: ServiceTypeDefinition.owners,
17
- key: "name",
18
- attributes: {
5
+ export class OpenLDAPService extends Service {
6
+ static name = "openldap";
7
+ static priority = 1;
8
+ static extends = ServiceTypeDefinition;
9
+ static specializationOf = ServiceTypeDefinition;
10
+ static owners = ServiceTypeDefinition.owners;
11
+ static key = "name";
12
+ static attributes = {
19
13
  base: string_attribute_writable,
20
14
  uri: string_attribute_writable
21
- },
22
- service: {
15
+ };
16
+ static service = {
23
17
  systemdService: "slapd.service",
24
18
  extends: ["ldap", "ldapi"],
25
19
  services: {}
26
- }
27
- };
20
+ };
28
21
 
29
- export class OpenLDAPService extends Service {
30
- static typeDefinition = OpenLDAPServiceTypeDefinition;
22
+ static typeDefinition = this;
31
23
  static {
32
24
  addType(this);
33
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
25
+ addServiceType(this.service, this.name);
34
26
  }
35
27
 
36
28
  _base;
37
29
 
38
30
  get type() {
39
- return OpenLDAPServiceTypeDefinition.name;
31
+ return this.constructor.name;
40
32
  }
41
33
 
42
34
  get base() {
@@ -2,29 +2,27 @@ import { addType } from "pacc";
2
2
  import { addServiceType } from "pmcf";
3
3
  import { ServiceTypeDefinition, Service } from "../service.mjs";
4
4
 
5
- const PostfixServiceTypeDefinition = {
6
- name: "postfix",
7
- priority: 1,
8
- extends: ServiceTypeDefinition,
9
- specializationOf: ServiceTypeDefinition,
10
- owners: ServiceTypeDefinition.owners,
11
- key: "name",
12
- attributes: {},
13
- service: {
5
+ export class PostfixService extends Service {
6
+ static name = "postfix";
7
+ static priority = 1;
8
+ static extends = ServiceTypeDefinition;
9
+ static specializationOf = ServiceTypeDefinition;
10
+ static owners = ServiceTypeDefinition.owners;
11
+ static key = "name";
12
+ static attributes = {};
13
+ static service = {
14
14
  systemdService: "postfix.service",
15
15
  extends: ["smtp", "lmtp", "submission"],
16
16
  services: {}
17
- }
18
- };
17
+ };
19
18
 
20
- export class PostfixService extends Service {
21
- static typeDefinition = PostfixServiceTypeDefinition;
19
+ static typeDefinition = this;
22
20
  static {
23
21
  addType(this);
24
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
22
+ addServiceType(this.service, this.name);
25
23
  }
26
24
 
27
25
  get type() {
28
- return PostfixServiceTypeDefinition.name;
26
+ return this.constructor.name;
29
27
  }
30
28
  }
@@ -8,14 +8,18 @@ import {
8
8
  import { Service, ServiceTypeDefinition, addServiceType } from "pmcf";
9
9
  import { filterConfigurable, sectionLines } from "../utils.mjs";
10
10
 
11
- const SystemdJournalRemoteServiceTypeDefinition = {
12
- name: "systemd-journal-remote",
13
- priority: 1,
14
- extends: ServiceTypeDefinition,
15
- specializationOf: ServiceTypeDefinition,
16
- owners: ServiceTypeDefinition.owners,
17
- key: "name",
18
- attributes: {
11
+ /**
12
+ * @property {string} ServerCertificateFile
13
+ * @property {string} ServerKeyFile
14
+ */
15
+ export class SystemdJournalRemoteService extends Service {
16
+ static name = "systemd-journal-remote";
17
+ static priority = 1;
18
+ static extends = ServiceTypeDefinition;
19
+ static specializationOf = ServiceTypeDefinition;
20
+ static owners = ServiceTypeDefinition.owners;
21
+ static key = "name";
22
+ static attributes = {
19
23
  Seal: {
20
24
  ...boolean_attribute_writable,
21
25
  configurable: true
@@ -61,8 +65,8 @@ const SystemdJournalRemoteServiceTypeDefinition = {
61
65
  configurable: true
62
66
  // default: "zstd lz4 xz"
63
67
  }
64
- },
65
- service: {
68
+ };
69
+ static service = {
66
70
  systemdService: "systemd-journal-remote.service",
67
71
  endpoints: [
68
72
  {
@@ -80,22 +84,16 @@ const SystemdJournalRemoteServiceTypeDefinition = {
80
84
  pathname: "/"
81
85
  }
82
86
  ]
83
- }
84
- };
87
+ };
85
88
 
86
- /**
87
- * @property {string} ServerCertificateFile
88
- * @property {string} ServerKeyFile
89
- */
90
- export class SystemdJournalRemoteService extends Service {
91
- static typeDefinition = SystemdJournalRemoteServiceTypeDefinition;
89
+ static typeDefinition = this;
92
90
  static {
93
91
  addType(this);
94
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
92
+ addServiceType(this.service, this.name);
95
93
  }
96
94
 
97
95
  get type() {
98
- return SystemdJournalRemoteServiceTypeDefinition.name;
96
+ return this.constructor.name;
99
97
  }
100
98
 
101
99
  /**
@@ -7,14 +7,19 @@ import {
7
7
  import { Service, ServiceTypeDefinition, addServiceType } from "pmcf";
8
8
  import { filterConfigurable, sectionLines } from "../utils.mjs";
9
9
 
10
- const SystemdJournalUploadServiceTypeDefinition = {
11
- name: "systemd-journal-upload",
12
- priority: 1,
13
- extends: ServiceTypeDefinition,
14
- specializationOf: ServiceTypeDefinition,
15
- owners: ServiceTypeDefinition.owners,
16
- key: "name",
17
- attributes: {
10
+ /**
11
+ * @property {string} URL
12
+ * @property {string} ServerCertificateFile
13
+ * @property {string} ServerKeyFile
14
+ */
15
+ export class SystemdJournalUploadService extends Service {
16
+ static name = "systemd-journal-upload";
17
+ static priority = 1;
18
+ static extends = ServiceTypeDefinition;
19
+ static specializationOf = ServiceTypeDefinition;
20
+ static owners = ServiceTypeDefinition.owners;
21
+ static key = "name";
22
+ static attributes = {
18
23
  URL: { ...string_attribute_writable, configurable: true },
19
24
  ServerKeyFile: {
20
25
  ...string_attribute_writable,
@@ -41,26 +46,18 @@ const SystemdJournalUploadServiceTypeDefinition = {
41
46
  configurable: true
42
47
  // default: false
43
48
  }
44
- },
45
- service: {
49
+ };
50
+ static service = {
46
51
  systemdService: "systemd-journal-upload.service"
47
- }
48
- };
49
-
50
- /**
51
- * @property {string} URL
52
- * @property {string} ServerCertificateFile
53
- * @property {string} ServerKeyFile
54
- */
55
- export class SystemdJournalUploadService extends Service {
56
- static typeDefinition = SystemdJournalUploadServiceTypeDefinition;
52
+ };
53
+ static typeDefinition = this;
57
54
  static {
58
55
  addType(this);
59
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
56
+ addServiceType(this.service, this.name);
60
57
  }
61
58
 
62
59
  get type() {
63
- return SystemdJournalUploadServiceTypeDefinition.name;
60
+ return this.constructor.name;
64
61
  }
65
62
 
66
63
  /**
@@ -69,9 +66,9 @@ export class SystemdJournalUploadService extends Service {
69
66
  * @returns {Object}
70
67
  */
71
68
  systemdConfigs(name) {
72
- console.log(this.fullName,this.owner.fullName);
73
- console.log(this.property('domainName'),this.name);
74
- console.log(this.property('certs_private_dir'));
69
+ console.log(this.fullName, this.owner.fullName);
70
+ console.log(this.property("domainName"), this.name);
71
+ console.log(this.property("certs_private_dir"));
75
72
  console.log("PROPS", this.expand(this.getAttributes(filterConfigurable)));
76
73
  return {
77
74
  serviceName: this.systemdService,
@@ -6,14 +6,14 @@ import {
6
6
  import { Service, ServiceTypeDefinition, addServiceType } from "pmcf";
7
7
  import { filterConfigurable, sectionLines } from "../utils.mjs";
8
8
 
9
- const SystemdJournalServiceTypeDefinition = {
10
- name: "systemd-journald",
11
- priority: 1,
12
- extends: ServiceTypeDefinition,
13
- specializationOf: ServiceTypeDefinition,
14
- owners: ServiceTypeDefinition.owners,
15
- key: "name",
16
- attributes: {
9
+ export class SystemdJournaldService extends Service {
10
+ static name = "systemd-journald";
11
+ static priority = 1;
12
+ static extends = ServiceTypeDefinition;
13
+ static specializationOf = ServiceTypeDefinition;
14
+ static owners = ServiceTypeDefinition.owners;
15
+ static key = "name";
16
+ static attributes = {
17
17
  Storage: {
18
18
  ...string_attribute_writable,
19
19
  configurable: true
@@ -106,21 +106,18 @@ const SystemdJournalServiceTypeDefinition = {
106
106
  ...string_attribute_writable,
107
107
  configurable: true
108
108
  }
109
- },
110
- service: {
109
+ };
110
+ static service = {
111
111
  systemdService: "systemd-journald.service"
112
- }
113
- };
114
-
115
- export class SystemdJournaldService extends Service {
116
- static typeDefinition = SystemdJournalServiceTypeDefinition;
112
+ };
113
+ static typeDefinition = this;
117
114
  static {
118
115
  addType(this);
119
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
116
+ addServiceType(this.service, this.name);
120
117
  }
121
118
 
122
119
  get type() {
123
- return SystemdJournalServiceTypeDefinition.name;
120
+ return this.constructor.name;
124
121
  }
125
122
 
126
123
  systemdConfigs(name) {
@@ -21,14 +21,14 @@ import {
21
21
  setionLinesFromPropertyIterator
22
22
  } from "../utils.mjs";
23
23
 
24
- const SystemdResolvedServiceTypeDefinition = {
25
- name: "systemd-resolved",
26
- priority: 1,
27
- extends: ExtraSourceServiceTypeDefinition,
28
- specializationOf: ServiceTypeDefinition,
29
- owners: ServiceTypeDefinition.owners,
30
- key: "name",
31
- attributes: {
24
+ export class SystemdResolvedService extends ExtraSourceService {
25
+ static name = "systemd-resolved";
26
+ static priority = 1;
27
+ static extends = ExtraSourceServiceTypeDefinition;
28
+ static specializationOf = ServiceTypeDefinition;
29
+ static owners = ServiceTypeDefinition.owners;
30
+ static key = "name";
31
+ static attributes = {
32
32
  /* Resolve: {
33
33
  ...object_attribute,
34
34
  attributes: {*/
@@ -71,22 +71,20 @@ const SystemdResolvedServiceTypeDefinition = {
71
71
  LLMNR: { ...yesno_attribute_writable, configurable: true }
72
72
  /* }
73
73
  }*/
74
- },
75
- service: {
76
- extends: ["dns","mdns","llmnr"],
74
+ };
75
+ static service = {
76
+ extends: ["dns", "mdns", "llmnr"],
77
77
  systemdService: "systemd-resolved.service"
78
- }
79
- };
78
+ };
80
79
 
81
- export class SystemdResolvedService extends ExtraSourceService {
82
- static typeDefinition = SystemdResolvedServiceTypeDefinition;
80
+ static typeDefinition = this;
83
81
  static {
84
82
  addType(this);
85
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
83
+ addServiceType(this.service, this.name);
86
84
  }
87
85
 
88
86
  get type() {
89
- return SystemdResolvedServiceTypeDefinition.name;
87
+ return this.constructor.name;
90
88
  }
91
89
 
92
90
  systemdConfigs(name) {
@@ -12,14 +12,14 @@ import {
12
12
  } from "pmcf";
13
13
  import { filterConfigurable, sectionLines } from "../utils.mjs";
14
14
 
15
- const SystemdTimesyncdServiceTypeDefinition = {
16
- name: "systemd-timesyncd",
17
- priority: 1,
18
- extends: ExtraSourceServiceTypeDefinition,
19
- specializationOf: ServiceTypeDefinition,
20
- owners: ServiceTypeDefinition.owners,
15
+ export class SystemdTimesyncdService extends ExtraSourceService {
16
+ static name = "systemd-timesyncd";
17
+ static priority = 1;
18
+ static extends = ExtraSourceServiceTypeDefinition;
19
+ static specializationOf = ServiceTypeDefinition;
20
+ static owners = ServiceTypeDefinition.owners;
21
21
 
22
- attributes: {
22
+ static attributes = {
23
23
  NTP: { ...string_attribute_writable, configurable: true },
24
24
  FallbackNTP: { ...string_attribute_writable, configurable: true },
25
25
  RootDistanceMaxSec: { ...duration_attribute_writable, configurable: true },
@@ -27,21 +27,19 @@ const SystemdTimesyncdServiceTypeDefinition = {
27
27
  PollIntervalMaxSec: { ...duration_attribute_writable, configurable: true },
28
28
  ConnectionRetrySec: { ...duration_attribute_writable, configurable: true },
29
29
  SaveIntervalSec: { ...duration_attribute_writable, configurable: true }
30
- },
31
- service: {
30
+ };
31
+ static service = {
32
32
  systemdService: "systemd-timesyncd.service"
33
- }
34
- };
33
+ };
35
34
 
36
- export class SystemdTimesyncdService extends ExtraSourceService {
37
- static typeDefinition = SystemdTimesyncdServiceTypeDefinition;
35
+ static typeDefinition = this;
38
36
  static {
39
37
  addType(this);
40
- addServiceType(this.typeDefinition.service, this.typeDefinition.name);
38
+ addServiceType(this.service, this.name);
41
39
  }
42
40
 
43
41
  get type() {
44
- return SystemdTimesyncdServiceTypeDefinition.name;
42
+ return this.constructor.name;
45
43
  }
46
44
 
47
45
  systemdConfigs(name) {
@@ -22,6 +22,6 @@ export class TailscaleService extends Service {
22
22
  static typeDefinition = this;
23
23
 
24
24
  static {
25
- addType(TailscaleService);
25
+ addType(this);
26
26
  }
27
27
  }