pmcf 4.25.12 → 4.25.13

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.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -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
 
@@ -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 "postfix";
29
27
  }
30
28
  }
@@ -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
  }