pmcf 3.13.12 → 3.14.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 +7 -7
- package/src/base.mjs +3 -1
- package/src/cluster.mjs +2 -2
- package/src/extra-source-service.mjs +1 -2
- package/src/host.mjs +2 -2
- package/src/location.mjs +1 -2
- package/src/module.mjs +1 -2
- package/src/network-interfaces/ethernet.mjs +1 -2
- package/src/network-interfaces/loopback.mjs +1 -1
- package/src/network-interfaces/network-interface.mjs +3 -3
- package/src/network-interfaces/tun.mjs +1 -1
- package/src/network-interfaces/wireguard.mjs +1 -1
- package/src/network-interfaces/wlan.mjs +1 -2
- package/src/network-support.mjs +6 -4
- package/src/network.mjs +1 -2
- package/src/owner.mjs +2 -2
- package/src/root.mjs +1 -1
- package/src/service.mjs +2 -2
- package/src/services/bind.mjs +5 -3
- package/src/services/chrony.mjs +3 -1
- package/src/services/headscale.mjs +3 -1
- package/src/services/influxdb.mjs +3 -2
- package/src/services/kea.mjs +4 -2
- package/src/services/mosquitto.mjs +3 -2
- package/src/services/openldap.mjs +3 -2
- package/src/services/systemd-journal-remote.mjs +3 -2
- package/src/services/systemd-journal-upload.mjs +3 -3
- package/src/services/systemd-journal.mjs +1 -1
- package/src/services/systemd-resolved.mjs +2 -2
- package/src/services/systemd-timesyncd.mjs +1 -1
- package/src/services/tailscale.mjs +1 -1
- package/src/subnet.mjs +1 -2
- package/types/extra-source-service.d.mts +2 -2
- package/types/module.d.mts +1 -2
- package/types/network-interfaces/network-interface.d.mts +1 -1
- package/types/network-support.d.mts +1 -1
- package/types/services/bind.d.mts +6 -6
- package/types/services/chrony.d.mts +1 -1
- package/types/services/systemd-resolved.d.mts +1 -1
- package/types/services/systemd-timesyncd.d.mts +1 -1
- package/src/types.mjs +0 -47
- package/types/types.d.mts +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -51,21 +51,21 @@
|
|
|
51
51
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"ip-utilties": "^1.4.
|
|
55
|
-
"npm-pkgbuild": "^
|
|
56
|
-
"pacc": "^4.
|
|
54
|
+
"ip-utilties": "^1.4.10",
|
|
55
|
+
"npm-pkgbuild": "^19.0.1",
|
|
56
|
+
"pacc": "^4.41.1",
|
|
57
57
|
"package-directory": "^8.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/node": "^24.
|
|
60
|
+
"@types/node": "^24.10.0",
|
|
61
61
|
"ava": "^6.4.1",
|
|
62
62
|
"c8": "^10.1.3",
|
|
63
63
|
"documentation": "^14.0.3",
|
|
64
|
-
"semantic-release": "^
|
|
64
|
+
"semantic-release": "^25.0.1",
|
|
65
65
|
"typescript": "^5.9.3"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
|
-
"node": ">=
|
|
68
|
+
"node": ">=24.11.0"
|
|
69
69
|
},
|
|
70
70
|
"repository": {
|
|
71
71
|
"type": "git",
|
package/src/base.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { allOutputs } from "npm-pkgbuild";
|
|
3
3
|
import {
|
|
4
|
+
typeFactory,
|
|
5
|
+
addType,
|
|
4
6
|
parse,
|
|
5
7
|
globals,
|
|
6
8
|
expand,
|
|
@@ -14,7 +16,6 @@ import {
|
|
|
14
16
|
description_attribute_writable,
|
|
15
17
|
boolean_attribute_writable
|
|
16
18
|
} from "pacc";
|
|
17
|
-
import { addType, typeFactory } from "./types.mjs";
|
|
18
19
|
import { asArray } from "./utils.mjs";
|
|
19
20
|
|
|
20
21
|
const BaseTypeDefinition = {
|
|
@@ -80,6 +81,7 @@ export class Base {
|
|
|
80
81
|
|
|
81
82
|
ownerFor(attribute, data) {
|
|
82
83
|
const owners = attribute.type.owners;
|
|
84
|
+
|
|
83
85
|
if (owners) {
|
|
84
86
|
for (const type of owners) {
|
|
85
87
|
if (this.typeName === type?.name) {
|
package/src/cluster.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import { FileContentProvider } from "npm-pkgbuild";
|
|
|
3
3
|
import {
|
|
4
4
|
default_attribute_writable,
|
|
5
5
|
default_attribute,
|
|
6
|
-
number_attribute_writable
|
|
6
|
+
number_attribute_writable,
|
|
7
|
+
addType
|
|
7
8
|
} from "pacc";
|
|
8
9
|
import { Owner } from "./owner.mjs";
|
|
9
10
|
import { Host } from "./host.mjs";
|
|
10
11
|
import { serviceEndpoints } from "pmcf";
|
|
11
|
-
import { addType } from "./types.mjs";
|
|
12
12
|
import { writeLines } from "./utils.mjs";
|
|
13
13
|
|
|
14
14
|
const ClusterTypeDefinition = {
|
package/src/host.mjs
CHANGED
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
string_attribute_writable,
|
|
8
8
|
string_collection_attribute_writable,
|
|
9
9
|
number_attribute_writable,
|
|
10
|
-
boolean_attribute_false
|
|
10
|
+
boolean_attribute_false,
|
|
11
|
+
addType
|
|
11
12
|
} from "pacc";
|
|
12
13
|
import { ServiceOwner, Base, addresses } from "pmcf";
|
|
13
14
|
import { networkAddressAttributes } from "./network-support.mjs";
|
|
@@ -19,7 +20,6 @@ import {
|
|
|
19
20
|
sectionLines,
|
|
20
21
|
asArray
|
|
21
22
|
} from "./utils.mjs";
|
|
22
|
-
import { addType } from "./types.mjs";
|
|
23
23
|
import { loadHooks } from "./hooks.mjs";
|
|
24
24
|
import { generateMachineInfo, generateKnownHosts } from "./host-utils.mjs";
|
|
25
25
|
import { NetworkInterfaceTypeDefinition } from "./network-interfaces/network-interface.mjs";
|
package/src/location.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
2
|
-
import { string_collection_attribute_writable } from "pacc";
|
|
2
|
+
import { string_collection_attribute_writable, addType } from "pacc";
|
|
3
3
|
import { Owner } from "pmcf";
|
|
4
|
-
import { addType } from "./types.mjs";
|
|
5
4
|
import { loadHooks } from "./hooks.mjs";
|
|
6
5
|
|
|
7
6
|
const LocationTypeDefinition = {
|
package/src/module.mjs
CHANGED
|
@@ -8,13 +8,13 @@ export * from "./service-owner.mjs";
|
|
|
8
8
|
export * from "./network.mjs";
|
|
9
9
|
export * from "./network-address.mjs";
|
|
10
10
|
export * from "./network-support.mjs";
|
|
11
|
+
export * from "./host.mjs";
|
|
11
12
|
export * from "./network-interfaces/network-interface.mjs";
|
|
12
13
|
export * from "./network-interfaces/loopback.mjs";
|
|
13
14
|
export * from "./network-interfaces/ethernet.mjs";
|
|
14
15
|
export * from "./network-interfaces/wlan.mjs";
|
|
15
16
|
export * from "./network-interfaces/wireguard.mjs";
|
|
16
17
|
export * from "./network-interfaces/tun.mjs";
|
|
17
|
-
export * from "./host.mjs";
|
|
18
18
|
export * from "./service-types.mjs";
|
|
19
19
|
export * from "./service.mjs";
|
|
20
20
|
export * from "./extra-source-service.mjs";
|
|
@@ -32,4 +32,3 @@ export * from "./services/systemd-journal-remote.mjs";
|
|
|
32
32
|
export * from "./services/systemd-journal-upload.mjs";
|
|
33
33
|
export * from "./services/systemd-timesyncd.mjs";
|
|
34
34
|
export * from "./services/systemd-resolved.mjs";
|
|
35
|
-
export * from "./types.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { addType } from "pacc";
|
|
1
2
|
import { SUBNET_LOCALHOST_IPV4, SUBNET_LOCALHOST_IPV6 } from "pmcf";
|
|
2
3
|
import { SkeletonNetworkInterface } from "./skeleton.mjs";
|
|
3
4
|
import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
|
|
4
|
-
import { addType } from "../types.mjs";
|
|
5
5
|
|
|
6
6
|
const LoopbackNetworkInterfaceTypeDefinition = {
|
|
7
7
|
name: "loopback",
|
|
@@ -3,7 +3,8 @@ import { hasWellKnownSubnet, normalizeIP } from "ip-utilties";
|
|
|
3
3
|
import {
|
|
4
4
|
default_attribute_writable,
|
|
5
5
|
string_attribute_writable,
|
|
6
|
-
hostname_attribute
|
|
6
|
+
hostname_attribute,
|
|
7
|
+
addType
|
|
7
8
|
} from "pacc";
|
|
8
9
|
import { Base, cidrAddresses } from "pmcf";
|
|
9
10
|
import {
|
|
@@ -11,7 +12,6 @@ import {
|
|
|
11
12
|
networkAddressAttributes
|
|
12
13
|
} from "../network-support.mjs";
|
|
13
14
|
import { asArray, writeLines, sectionLines } from "../utils.mjs";
|
|
14
|
-
import { addType } from "../types.mjs";
|
|
15
15
|
import { SkeletonNetworkInterface } from "./skeleton.mjs";
|
|
16
16
|
import { Network } from "../network.mjs";
|
|
17
17
|
|
|
@@ -71,7 +71,7 @@ export class NetworkInterface extends SkeletonNetworkInterface {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
static isCommonName(name) {
|
|
74
|
-
false;
|
|
74
|
+
return false;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
_ipAddresses = new Map();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { addType } from "pacc";
|
|
1
2
|
import { NetworkInterface } from "./network-interface.mjs";
|
|
2
3
|
import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
|
|
3
|
-
import { addType } from "../types.mjs";
|
|
4
4
|
|
|
5
5
|
const TUNdNetworkInterfaceTypeDefinition = {
|
|
6
6
|
name: "tun",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { addType } from "pacc";
|
|
1
2
|
import { SkeletonNetworkInterface } from "./skeleton.mjs";
|
|
2
3
|
import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
|
|
3
|
-
import { addType } from "../types.mjs";
|
|
4
4
|
|
|
5
5
|
const WireguardNetworkInterfaceTypeDefinition = {
|
|
6
6
|
name: "wireguard",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { mkdir } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { string_attribute_writable, secret_attribute } from "pacc";
|
|
4
|
-
import { addType } from "../types.mjs";
|
|
3
|
+
import { string_attribute_writable, secret_attribute, addType } from "pacc";
|
|
5
4
|
import { writeLines, sectionLines } from "../utils.mjs";
|
|
6
5
|
import { NetworkInterfaceTypeDefinition } from "./network-interface.mjs";
|
|
7
6
|
import {
|
package/src/network-support.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
oneOfType,
|
|
3
2
|
default_attribute_writable,
|
|
4
3
|
string_collection_attribute_writable,
|
|
5
4
|
string_attribute_writable,
|
|
@@ -8,10 +7,13 @@ import {
|
|
|
8
7
|
boolean_attribute_writable
|
|
9
8
|
} from "pacc";
|
|
10
9
|
|
|
11
|
-
export const networkAddressType =
|
|
12
|
-
//export const networkAddressType = oneOfType([NetworkTypeDefinition,"host","network_interface"]);
|
|
10
|
+
export const networkAddressType = "network|host|network_interface";
|
|
13
11
|
|
|
14
|
-
export const networks_attribute = {
|
|
12
|
+
export const networks_attribute = {
|
|
13
|
+
...default_attribute_writable,
|
|
14
|
+
type: "network",
|
|
15
|
+
collection: true
|
|
16
|
+
};
|
|
15
17
|
|
|
16
18
|
export const networkAttributes = {
|
|
17
19
|
scope: {
|
package/src/network.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { default_attribute_writable } from "pacc";
|
|
1
|
+
import { default_attribute_writable, addType } from "pacc";
|
|
2
2
|
import { Owner } from "./owner.mjs";
|
|
3
3
|
import { Subnet } from "./subnet.mjs";
|
|
4
|
-
import { addType } from "./types.mjs";
|
|
5
4
|
import { networkAttributes } from "./network-support.mjs";
|
|
6
5
|
|
|
7
6
|
export const NetworkTypeDefinition = {
|
package/src/owner.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
default_attribute_writable,
|
|
4
4
|
string_collection_attribute_writable,
|
|
5
5
|
string_attribute_writable,
|
|
6
|
-
email_attribute
|
|
6
|
+
email_attribute,
|
|
7
|
+
addType, types
|
|
7
8
|
} from "pacc";
|
|
8
9
|
import { asIterator } from "./utils.mjs";
|
|
9
10
|
import { Base } from "./base.mjs";
|
|
10
11
|
import { Subnet, SUBNET_GLOBAL_IPV4, SUBNET_GLOBAL_IPV6 } from "./subnet.mjs";
|
|
11
|
-
import { addType, types } from "./types.mjs";
|
|
12
12
|
import { networks_attribute } from "./network-support.mjs";
|
|
13
13
|
|
|
14
14
|
const OwnerTypeDefinition = {
|
package/src/root.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFile, glob } from "node:fs/promises";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { typeFactory, addType, types, resolveTypeLinks } from "pacc";
|
|
3
4
|
import { Location } from "./location.mjs";
|
|
4
|
-
import { addType, types, resolveTypeLinks, typeFactory } from "./types.mjs";
|
|
5
5
|
|
|
6
6
|
const RootTypeDefinition = {
|
|
7
7
|
name: "root",
|
package/src/service.mjs
CHANGED
|
@@ -3,7 +3,8 @@ import {
|
|
|
3
3
|
string_collection_attribute,
|
|
4
4
|
string_collection_attribute_writable,
|
|
5
5
|
number_attribute_writable,
|
|
6
|
-
boolean_attribute_false
|
|
6
|
+
boolean_attribute_false,
|
|
7
|
+
addType
|
|
7
8
|
} from "pacc";
|
|
8
9
|
import {
|
|
9
10
|
Base,
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
HTTPEndpoint,
|
|
14
15
|
UnixEndpoint
|
|
15
16
|
} from "pmcf";
|
|
16
|
-
import { addType } from "./types.mjs";
|
|
17
17
|
import { asArray } from "./utils.mjs";
|
|
18
18
|
import { networkAddressAttributes } from "./network-support.mjs";
|
|
19
19
|
import {
|
package/src/services/bind.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { createHmac } from "node:crypto";
|
|
|
3
3
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
4
|
import { isLinkLocal, reverseArpa } from "ip-utilties";
|
|
5
5
|
import {
|
|
6
|
+
addType,
|
|
6
7
|
oneOfType,
|
|
7
8
|
default_attribute_writable,
|
|
8
9
|
string_attribute_writable,
|
|
@@ -23,9 +24,9 @@ import {
|
|
|
23
24
|
ExtraSourceService,
|
|
24
25
|
serviceEndpoints,
|
|
25
26
|
addresses,
|
|
26
|
-
networkAddressType
|
|
27
|
+
networkAddressType,
|
|
28
|
+
addServiceType
|
|
27
29
|
} from "pmcf";
|
|
28
|
-
import { addType } from "../types.mjs";
|
|
29
30
|
import { ServiceTypeDefinition } from "../service.mjs";
|
|
30
31
|
import { ExtraSourceServiceTypeDefinition } from "../extra-source-service.mjs";
|
|
31
32
|
import { addHook } from "../hooks.mjs";
|
|
@@ -56,7 +57,7 @@ const BindServiceTypeDefinition = {
|
|
|
56
57
|
writable: true
|
|
57
58
|
},*/
|
|
58
59
|
zones: {
|
|
59
|
-
type:
|
|
60
|
+
type: networkAddressType+ "|location|owner",
|
|
60
61
|
collection: true,
|
|
61
62
|
writable: true
|
|
62
63
|
},
|
|
@@ -154,6 +155,7 @@ export class BindService extends ExtraSourceService {
|
|
|
154
155
|
minimum = 60000;
|
|
155
156
|
static {
|
|
156
157
|
addType(this);
|
|
158
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
static get typeDefinition() {
|
package/src/services/chrony.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
3
|
import { isLinkLocal } from "ip-utilties";
|
|
4
|
-
import { addType } from "
|
|
4
|
+
import { addType } from "pacc";
|
|
5
|
+
import { addServiceType } from "pmcf";
|
|
5
6
|
import { ServiceTypeDefinition, serviceEndpoints } from "../service.mjs";
|
|
6
7
|
import {
|
|
7
8
|
ExtraSourceService,
|
|
@@ -45,6 +46,7 @@ const ChronyServiceTypeDefinition = {
|
|
|
45
46
|
export class ChronyService extends ExtraSourceService {
|
|
46
47
|
static {
|
|
47
48
|
addType(this);
|
|
49
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
static get typeDefinition() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { addType } from "
|
|
1
|
+
import { addType } from "pacc";
|
|
2
|
+
import { addServiceType } from "pmcf";
|
|
2
3
|
import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
3
4
|
|
|
4
5
|
const HeadscaleServiceTypeDefinition = {
|
|
@@ -40,6 +41,7 @@ const HeadscaleServiceTypeDefinition = {
|
|
|
40
41
|
export class HeadscaleService extends Service {
|
|
41
42
|
static {
|
|
42
43
|
addType(this);
|
|
44
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
static get typeDefinition() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
-
import { boolean_attribute_writable_true } from "pacc";
|
|
3
|
+
import { boolean_attribute_writable_true, addType } from "pacc";
|
|
4
|
+
import { addServiceType } from "pmcf";
|
|
4
5
|
import { writeLines } from "../utils.mjs";
|
|
5
|
-
import { addType } from "../types.mjs";
|
|
6
6
|
import { Service, ServiceTypeDefinition } from "../service.mjs";
|
|
7
7
|
|
|
8
8
|
const InfluxdbServiceTypeDefinition = {
|
|
@@ -38,6 +38,7 @@ const InfluxdbServiceTypeDefinition = {
|
|
|
38
38
|
export class InfluxdbService extends Service {
|
|
39
39
|
static {
|
|
40
40
|
addType(this);
|
|
41
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
static get typeDefinition() {
|
package/src/services/kea.mjs
CHANGED
|
@@ -4,9 +4,11 @@ import { reverseArpa, isLinkLocal } from "ip-utilties";
|
|
|
4
4
|
import {
|
|
5
5
|
string_attribute_writable,
|
|
6
6
|
number_attribute_writable,
|
|
7
|
-
boolean_attribute_writable_true
|
|
7
|
+
boolean_attribute_writable_true,
|
|
8
|
+
addType
|
|
8
9
|
} from "pacc";
|
|
9
10
|
import {
|
|
11
|
+
addServiceType,
|
|
10
12
|
Service,
|
|
11
13
|
sortDescendingByPriority,
|
|
12
14
|
ServiceTypeDefinition,
|
|
@@ -14,7 +16,6 @@ import {
|
|
|
14
16
|
SUBNET_LOCALHOST_IPV4,
|
|
15
17
|
SUBNET_LOCALHOST_IPV6
|
|
16
18
|
} from "pmcf";
|
|
17
|
-
import { addType } from "../types.mjs";
|
|
18
19
|
import { writeLines } from "../utils.mjs";
|
|
19
20
|
|
|
20
21
|
const KeaServiceTypeDefinition = {
|
|
@@ -130,6 +131,7 @@ const keaVersion = "3.0.1";
|
|
|
130
131
|
export class KeaService extends Service {
|
|
131
132
|
static {
|
|
132
133
|
addType(this);
|
|
134
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
static get typeDefinition() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
-
import { boolean_attribute_writable_true } from "pacc";
|
|
3
|
+
import { boolean_attribute_writable_true, addType } from "pacc";
|
|
4
|
+
import { addServiceType } from "pmcf";
|
|
4
5
|
import { writeLines } from "../utils.mjs";
|
|
5
|
-
import { addType } from "../types.mjs";
|
|
6
6
|
import { Service, ServiceTypeDefinition } from "../service.mjs";
|
|
7
7
|
|
|
8
8
|
const MosquittoServiceTypeDefinition = {
|
|
@@ -29,6 +29,7 @@ const MosquittoServiceTypeDefinition = {
|
|
|
29
29
|
export class MosquittoService extends Service {
|
|
30
30
|
static {
|
|
31
31
|
addType(this);
|
|
32
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
static get typeDefinition() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
3
|
-
import { string_attribute_writable } from "pacc";
|
|
4
|
-
import {
|
|
3
|
+
import { string_attribute_writable, addType } from "pacc";
|
|
4
|
+
import { addServiceType } from "pmcf";
|
|
5
5
|
import { ServiceTypeDefinition, Service } from "../service.mjs";
|
|
6
6
|
import { writeLines } from "../utils.mjs";
|
|
7
7
|
import { addHook } from "../hooks.mjs";
|
|
@@ -35,6 +35,7 @@ const OpenLDAPServiceTypeDefinition = {
|
|
|
35
35
|
export class OpenLDAPService extends Service {
|
|
36
36
|
static {
|
|
37
37
|
addType(this);
|
|
38
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
static get typeDefinition() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { addType } from "pacc";
|
|
2
|
+
import { Service, ServiceTypeDefinition, addServiceType } from "pmcf";
|
|
3
3
|
|
|
4
4
|
const SystemdJournalRemoteServiceTypeDefinition = {
|
|
5
5
|
name: "systemd-journal-remote",
|
|
@@ -30,6 +30,7 @@ const SystemdJournalRemoteServiceTypeDefinition = {
|
|
|
30
30
|
export class SystemdJournalRemoteService extends Service {
|
|
31
31
|
static {
|
|
32
32
|
addType(this);
|
|
33
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
static get typeDefinition() {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { string_attribute_writable } from "pacc";
|
|
2
|
-
import { Service, ServiceTypeDefinition } from "pmcf";
|
|
3
|
-
import { addType } from "../types.mjs";
|
|
1
|
+
import { string_attribute_writable, addType } from "pacc";
|
|
2
|
+
import { Service, ServiceTypeDefinition, addServiceType } from "pmcf";
|
|
4
3
|
|
|
5
4
|
const SystemdJournalUploadServiceTypeDefinition = {
|
|
6
5
|
name: "systemd-journal-upload",
|
|
@@ -16,6 +15,7 @@ const SystemdJournalUploadServiceTypeDefinition = {
|
|
|
16
15
|
export class SystemdJournalUploadService extends Service {
|
|
17
16
|
static {
|
|
18
17
|
addType(this);
|
|
18
|
+
addServiceType(this.typeDefinition.service, this.typeDefinition.name);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
static get typeDefinition() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { addType } from "pacc";
|
|
1
2
|
import {
|
|
2
3
|
ExtraSourceService,
|
|
3
4
|
ExtraSourceServiceTypeDefinition,
|
|
4
5
|
ServiceTypeDefinition,
|
|
5
|
-
serviceEndpoints
|
|
6
|
+
serviceEndpoints,
|
|
6
7
|
} from "pmcf";
|
|
7
|
-
import { addType } from "../types.mjs";
|
|
8
8
|
|
|
9
9
|
const SystemdResolvedServiceTypeDefinition = {
|
|
10
10
|
name: "systemd-resolved",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { addType } from "pacc";
|
|
1
2
|
import {
|
|
2
3
|
ExtraSourceService,
|
|
3
4
|
ExtraSourceServiceTypeDefinition,
|
|
4
5
|
ServiceTypeDefinition,
|
|
5
6
|
serviceEndpoints
|
|
6
7
|
} from "pmcf";
|
|
7
|
-
import { addType } from "../types.mjs";
|
|
8
8
|
|
|
9
9
|
const SystemdTimesyncdServiceTypeDefinition = {
|
|
10
10
|
name: "systemd-timesyncd",
|
package/src/subnet.mjs
CHANGED
|
@@ -6,10 +6,9 @@ import {
|
|
|
6
6
|
familyIP,
|
|
7
7
|
matchPrefixIP
|
|
8
8
|
} from "ip-utilties";
|
|
9
|
-
import { string_attribute, name_attribute, number_attribute } from "pacc";
|
|
9
|
+
import { string_attribute, name_attribute, number_attribute, addType } from "pacc";
|
|
10
10
|
import { networks_attribute } from "./network-support.mjs";
|
|
11
11
|
import { Base } from "./base.mjs";
|
|
12
|
-
import { addType } from "./types.mjs";
|
|
13
12
|
|
|
14
13
|
const SubnetTypeDefinition = {
|
|
15
14
|
name: "subnet",
|
|
@@ -203,7 +203,7 @@ export namespace ExtraSourceServiceTypeDefinition {
|
|
|
203
203
|
})[];
|
|
204
204
|
export namespace attributes {
|
|
205
205
|
let source: {
|
|
206
|
-
type:
|
|
206
|
+
type: string;
|
|
207
207
|
collection: boolean;
|
|
208
208
|
isKey: boolean;
|
|
209
209
|
writable: boolean;
|
|
@@ -1032,7 +1032,7 @@ export class ExtraSourceService extends Service {
|
|
|
1032
1032
|
})[];
|
|
1033
1033
|
attributes: {
|
|
1034
1034
|
source: {
|
|
1035
|
-
type:
|
|
1035
|
+
type: string;
|
|
1036
1036
|
collection: boolean;
|
|
1037
1037
|
isKey: boolean;
|
|
1038
1038
|
writable: boolean;
|
package/types/module.d.mts
CHANGED
|
@@ -8,13 +8,13 @@ export * from "./service-owner.mjs";
|
|
|
8
8
|
export * from "./network.mjs";
|
|
9
9
|
export * from "./network-address.mjs";
|
|
10
10
|
export * from "./network-support.mjs";
|
|
11
|
+
export * from "./host.mjs";
|
|
11
12
|
export * from "./network-interfaces/network-interface.mjs";
|
|
12
13
|
export * from "./network-interfaces/loopback.mjs";
|
|
13
14
|
export * from "./network-interfaces/ethernet.mjs";
|
|
14
15
|
export * from "./network-interfaces/wlan.mjs";
|
|
15
16
|
export * from "./network-interfaces/wireguard.mjs";
|
|
16
17
|
export * from "./network-interfaces/tun.mjs";
|
|
17
|
-
export * from "./host.mjs";
|
|
18
18
|
export * from "./service-types.mjs";
|
|
19
19
|
export * from "./service.mjs";
|
|
20
20
|
export * from "./extra-source-service.mjs";
|
|
@@ -32,4 +32,3 @@ export * from "./services/systemd-journal-remote.mjs";
|
|
|
32
32
|
export * from "./services/systemd-journal-upload.mjs";
|
|
33
33
|
export * from "./services/systemd-timesyncd.mjs";
|
|
34
34
|
export * from "./services/systemd-resolved.mjs";
|
|
35
|
-
export * from "./types.mjs";
|
|
@@ -1026,7 +1026,7 @@ export class NetworkInterface extends SkeletonNetworkInterface {
|
|
|
1026
1026
|
multicastDNS: import("pacc").AttributeDefinition;
|
|
1027
1027
|
};
|
|
1028
1028
|
};
|
|
1029
|
-
static isCommonName(name: any):
|
|
1029
|
+
static isCommonName(name: any): boolean;
|
|
1030
1030
|
_ipAddresses: Map<any, any>;
|
|
1031
1031
|
_scope: any;
|
|
1032
1032
|
_metric: any;
|
|
@@ -810,7 +810,7 @@ export class BindService extends ExtraSourceService {
|
|
|
810
810
|
})[];
|
|
811
811
|
attributes: {
|
|
812
812
|
source: {
|
|
813
|
-
type:
|
|
813
|
+
type: string;
|
|
814
814
|
collection: boolean;
|
|
815
815
|
isKey: boolean;
|
|
816
816
|
writable: boolean;
|
|
@@ -1334,17 +1334,17 @@ export class BindService extends ExtraSourceService {
|
|
|
1334
1334
|
key: string;
|
|
1335
1335
|
attributes: {
|
|
1336
1336
|
zones: {
|
|
1337
|
-
type:
|
|
1337
|
+
type: string;
|
|
1338
1338
|
collection: boolean;
|
|
1339
1339
|
writable: boolean;
|
|
1340
1340
|
};
|
|
1341
1341
|
trusted: {
|
|
1342
|
-
type:
|
|
1342
|
+
type: string;
|
|
1343
1343
|
collection: boolean;
|
|
1344
1344
|
writable: boolean;
|
|
1345
1345
|
};
|
|
1346
1346
|
protected: {
|
|
1347
|
-
type:
|
|
1347
|
+
type: string;
|
|
1348
1348
|
collection: boolean;
|
|
1349
1349
|
isKey: boolean;
|
|
1350
1350
|
writable: boolean;
|
|
@@ -1362,7 +1362,7 @@ export class BindService extends ExtraSourceService {
|
|
|
1362
1362
|
additionalValues?: object;
|
|
1363
1363
|
};
|
|
1364
1364
|
internal: {
|
|
1365
|
-
type:
|
|
1365
|
+
type: string;
|
|
1366
1366
|
collection: boolean;
|
|
1367
1367
|
isKey: boolean;
|
|
1368
1368
|
writable: boolean;
|
|
@@ -1385,7 +1385,7 @@ export class BindService extends ExtraSourceService {
|
|
|
1385
1385
|
hasLocationRecord: import("pacc").AttributeDefinition;
|
|
1386
1386
|
excludeInterfaceKinds: import("pacc").AttributeDefinition;
|
|
1387
1387
|
exclude: {
|
|
1388
|
-
type:
|
|
1388
|
+
type: string;
|
|
1389
1389
|
collection: boolean;
|
|
1390
1390
|
isKey: boolean;
|
|
1391
1391
|
writable: boolean;
|
package/src/types.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
attributeIterator,
|
|
3
|
-
types,
|
|
4
|
-
oneOfType,
|
|
5
|
-
addType as paccAddType
|
|
6
|
-
} from "pacc";
|
|
7
|
-
import { addServiceType } from "./service-types.mjs";
|
|
8
|
-
export { types };
|
|
9
|
-
|
|
10
|
-
export function addType(type) {
|
|
11
|
-
type = paccAddType(type);
|
|
12
|
-
|
|
13
|
-
if (type.specializationOf) {
|
|
14
|
-
type.specializationOf.specializations[type.name] = type;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
addServiceType(type.service, type.name);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function resolveTypeLinks() {
|
|
21
|
-
for (const type of Object.values(types)) {
|
|
22
|
-
if (typeof type.extends === "string") {
|
|
23
|
-
type.extends = types[type.extends];
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (type.owners) {
|
|
27
|
-
type.owners = type.owners.map(owner =>
|
|
28
|
-
typeof owner === "string" ? types[owner] : owner
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
for (const [path, attribute] of attributeIterator(type.attributes)) {
|
|
33
|
-
if (typeof attribute.type === "string") {
|
|
34
|
-
attribute.type = oneOfType(attribute.type);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function typeFactory(type, owner, data) {
|
|
41
|
-
const factory = type.factoryFor?.(owner, data) || type.clazz;
|
|
42
|
-
//console.log(factory, type, owner, data);
|
|
43
|
-
const object = new factory(owner);
|
|
44
|
-
object.read(data);
|
|
45
|
-
owner.addObject(object);
|
|
46
|
-
return object;
|
|
47
|
-
}
|