pmcf 2.31.1 → 2.32.1
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-info +15 -9
- package/package.json +2 -2
- package/src/base.mjs +35 -23
- package/src/filter.mjs +1 -1
- package/src/host.mjs +15 -2
- package/src/module.mjs +0 -1
- package/src/network-address.mjs +6 -2
- package/src/network-interfaces/network-interface.mjs +2 -2
- package/src/network.mjs +6 -0
- package/src/owner.mjs +11 -5
- package/src/service.mjs +8 -8
- package/src/services/dhcp.mjs +2 -2
- package/src/services/dns.mjs +28 -13
- package/src/services/ntp.mjs +1 -1
- package/src/subnet.mjs +2 -2
- package/src/types.mjs +32 -1
- package/types/module.d.mts +0 -1
- package/types/network-address.d.mts +1 -0
- package/types/network.d.mts +1 -0
- package/types/service.d.mts +0 -1
- package/types/services/dns.d.mts +4 -4
- package/types/subnet.d.mts +1 -0
- package/src/address.mjs +0 -32
- package/types/address.d.mts +0 -17
package/bin/pmcf-info
CHANGED
|
@@ -3,17 +3,23 @@ import { prepare } from "../src/cli.mjs";
|
|
|
3
3
|
const { root, args, options } = await prepare({
|
|
4
4
|
service: {
|
|
5
5
|
type: "string"
|
|
6
|
+
},
|
|
7
|
+
address: {
|
|
8
|
+
type: "string"
|
|
6
9
|
}
|
|
7
10
|
});
|
|
8
11
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
for (const name of args) {
|
|
13
|
+
const object = await root.load(name);
|
|
14
|
+
if (options.service) {
|
|
15
|
+
for (const service of root.findServices({ type: options.service })) {
|
|
16
|
+
console.log(service.toString());
|
|
17
|
+
}
|
|
18
|
+
} else if (options.address) {
|
|
19
|
+
for (const na of object.networkAddresses()) {
|
|
20
|
+
console.log(na.toString());
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
console.log(object.toJSON());
|
|
16
24
|
}
|
|
17
|
-
} else {
|
|
18
|
-
console.log(object.toJSON());
|
|
19
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.32.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"ip-utilties": "^1.3.
|
|
41
|
+
"ip-utilties": "^1.3.1",
|
|
42
42
|
"npm-pkgbuild": "^18.0.1",
|
|
43
43
|
"pacc": "^3.4.0",
|
|
44
44
|
"pkg-dir": "^8.0.0"
|
package/src/base.mjs
CHANGED
|
@@ -75,12 +75,12 @@ export class Base {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
ownerFor(property, data) {
|
|
78
|
-
for (const type of property.type.owners) {
|
|
78
|
+
for (const type of property.type[0].owners) {
|
|
79
79
|
if (this.typeName === type?.name) {
|
|
80
80
|
return this;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
for (const type of property.type.owners) {
|
|
83
|
+
for (const type of property.type[0].owners) {
|
|
84
84
|
const owner = this[type?.name];
|
|
85
85
|
if (owner) {
|
|
86
86
|
return owner;
|
|
@@ -133,7 +133,7 @@ export class Base {
|
|
|
133
133
|
};
|
|
134
134
|
|
|
135
135
|
const instantiateAndAssign = (property, value) => {
|
|
136
|
-
if (primitives.has(property.type)) {
|
|
136
|
+
if (primitives.has(property.type[0])) {
|
|
137
137
|
assign(property, value);
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
@@ -151,13 +151,21 @@ export class Base {
|
|
|
151
151
|
case "string":
|
|
152
152
|
{
|
|
153
153
|
value = this.expand(value);
|
|
154
|
-
|
|
154
|
+
|
|
155
|
+
let object;
|
|
156
|
+
|
|
157
|
+
for (const type of property.type) {
|
|
158
|
+
object = this.typeNamed(type.name, value);
|
|
159
|
+
if (object) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
155
163
|
|
|
156
164
|
if (object) {
|
|
157
165
|
assign(property, object);
|
|
158
166
|
} else {
|
|
159
|
-
if (property.type.constructWithIdentifierOnly) {
|
|
160
|
-
object = new property.type.clazz(
|
|
167
|
+
if (property.type[0].constructWithIdentifierOnly) {
|
|
168
|
+
object = new property.type[0].clazz(
|
|
161
169
|
this.ownerFor(property, value),
|
|
162
170
|
value
|
|
163
171
|
);
|
|
@@ -165,32 +173,36 @@ export class Base {
|
|
|
165
173
|
} else {
|
|
166
174
|
this.finalize(() => {
|
|
167
175
|
value = this.expand(value);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
property.type.name,
|
|
180
|
-
value
|
|
181
|
-
);
|
|
176
|
+
|
|
177
|
+
for (const type of property.type) {
|
|
178
|
+
const object =
|
|
179
|
+
this.typeNamed(type.name, value) ||
|
|
180
|
+
this.owner.typeNamed(type.name, value) ||
|
|
181
|
+
this.root.typeNamed(type.name, value); // TODO
|
|
182
|
+
|
|
183
|
+
if (object) {
|
|
184
|
+
assign(property, object);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
182
187
|
}
|
|
188
|
+
|
|
189
|
+
this.error(
|
|
190
|
+
"Not found",
|
|
191
|
+
property.name,
|
|
192
|
+
property.type.map(t => t.name),
|
|
193
|
+
value
|
|
194
|
+
);
|
|
183
195
|
});
|
|
184
196
|
}
|
|
185
197
|
}
|
|
186
198
|
}
|
|
187
199
|
break;
|
|
188
200
|
case "object":
|
|
189
|
-
if (value instanceof property.type.clazz) {
|
|
201
|
+
if (value instanceof property.type[0].clazz) {
|
|
190
202
|
assign(property, value);
|
|
191
203
|
} else {
|
|
192
204
|
const factory =
|
|
193
|
-
property.type.factoryFor?.(this, value) || property.type.clazz;
|
|
205
|
+
property.type[0].factoryFor?.(this, value) || property.type[0].clazz;
|
|
194
206
|
|
|
195
207
|
assign(
|
|
196
208
|
property,
|
|
@@ -570,7 +582,7 @@ export function extractFrom(
|
|
|
570
582
|
value = [...value];
|
|
571
583
|
}
|
|
572
584
|
|
|
573
|
-
value = extractFrom(value, def.type);
|
|
585
|
+
value = extractFrom(value, def.type[0]);
|
|
574
586
|
if (value !== undefined) {
|
|
575
587
|
json[name] = value;
|
|
576
588
|
}
|
package/src/filter.mjs
CHANGED
|
@@ -52,7 +52,7 @@ export function* objectFilter(type, objects, filter) {
|
|
|
52
52
|
};
|
|
53
53
|
for (let t = type; t; t = t.extends) {
|
|
54
54
|
for (const property of Object.values(t.properties)) {
|
|
55
|
-
switch (property.type) {
|
|
55
|
+
switch (property.type[0]) {
|
|
56
56
|
case "boolean":
|
|
57
57
|
if (
|
|
58
58
|
filter[property.name] !== undefined &&
|
package/src/host.mjs
CHANGED
|
@@ -45,7 +45,20 @@ const HostTypeDefinition = {
|
|
|
45
45
|
type: "string",
|
|
46
46
|
collection: false,
|
|
47
47
|
writeable: true,
|
|
48
|
-
values: [
|
|
48
|
+
values: [
|
|
49
|
+
"phone",
|
|
50
|
+
"tablet",
|
|
51
|
+
"router",
|
|
52
|
+
"gateway",
|
|
53
|
+
"desktop",
|
|
54
|
+
"notebook",
|
|
55
|
+
"server",
|
|
56
|
+
"monitor",
|
|
57
|
+
"camera",
|
|
58
|
+
"inverter",
|
|
59
|
+
"battery",
|
|
60
|
+
"virtual"
|
|
61
|
+
]
|
|
49
62
|
},
|
|
50
63
|
architecture: {
|
|
51
64
|
type: "string",
|
|
@@ -449,7 +462,7 @@ export class Host extends Base {
|
|
|
449
462
|
|
|
450
463
|
*subnets() {
|
|
451
464
|
for (const networkInterface of this.networkInterfaces.values()) {
|
|
452
|
-
yield* networkInterface.subnets;
|
|
465
|
+
yield* networkInterface.subnets();
|
|
453
466
|
}
|
|
454
467
|
}
|
|
455
468
|
|
package/src/module.mjs
CHANGED
package/src/network-address.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { familyIP, formatCIDR } from "ip-utilties";
|
|
1
|
+
import { familyIP, formatCIDR, decodeIP } from "ip-utilties";
|
|
2
2
|
import { Subnet } from "./subnet.mjs";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
*
|
|
6
6
|
*/
|
|
7
7
|
export class NetworkAddress {
|
|
8
8
|
/** @type {Subnet} */ subnet;
|
|
@@ -26,4 +26,8 @@ export class NetworkAddress {
|
|
|
26
26
|
get cidrAddress() {
|
|
27
27
|
return formatCIDR(this.address, this.subnet.prefixLength);
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
toString() {
|
|
31
|
+
return `${this.networkInterface.fullName} ${decodeIP(this.address)}`;
|
|
32
|
+
}
|
|
29
33
|
}
|
|
@@ -20,9 +20,9 @@ export const NetworkInterfaceTypeDefinition = {
|
|
|
20
20
|
const kind = value.kind;
|
|
21
21
|
const t = NetworkInterfaceTypeDefinition.specializations[kind];
|
|
22
22
|
|
|
23
|
-
if (!t) {
|
|
23
|
+
/*if (!t) {
|
|
24
24
|
console.warn("FACTORY", owner.name, value, t?.name);
|
|
25
|
-
}
|
|
25
|
+
}*/
|
|
26
26
|
if (t) {
|
|
27
27
|
delete value.type;
|
|
28
28
|
delete value.kind;
|
package/src/network.mjs
CHANGED
package/src/owner.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { normalizeCIDR } from "ip-utilties";
|
|
1
|
+
import { normalizeCIDR, familyIP } from "ip-utilties";
|
|
2
2
|
import { asIterator } from "./utils.mjs";
|
|
3
3
|
import { Base } from "./base.mjs";
|
|
4
|
-
import { Subnet } from "./subnet.mjs";
|
|
4
|
+
import { Subnet, SUBNET_GLOBAL_IPV4, SUBNET_GLOBAL_IPV6 } from "./subnet.mjs";
|
|
5
5
|
import { addType, types } from "./types.mjs";
|
|
6
6
|
const OwnerTypeDefinition = {
|
|
7
7
|
name: "owner",
|
|
@@ -182,19 +182,25 @@ export class Owner extends Base {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
addSubnet(address) {
|
|
185
|
-
const { cidr } = normalizeCIDR(address);
|
|
185
|
+
const { cidr, prefixLength } = normalizeCIDR(address);
|
|
186
186
|
|
|
187
|
-
if (cidr) {
|
|
187
|
+
if (cidr && prefixLength !== 0) {
|
|
188
188
|
return this.subnetNamed(cidr) || new Subnet(this, cidr);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
let subnet = this.subnetForAddress(address);
|
|
192
|
+
|
|
192
193
|
if (!subnet) {
|
|
194
|
+
subnet = familyIP(address) === 'IPv4' ? SUBNET_GLOBAL_IPV4 : SUBNET_GLOBAL_IPV6;
|
|
195
|
+
|
|
196
|
+
/*
|
|
193
197
|
this.error(
|
|
194
198
|
`Address without subnet ${address}`,
|
|
195
199
|
[...this.subnets()].map(s => s.address)
|
|
196
200
|
);
|
|
201
|
+
*/
|
|
197
202
|
}
|
|
203
|
+
|
|
198
204
|
return subnet;
|
|
199
205
|
}
|
|
200
206
|
|
package/src/service.mjs
CHANGED
|
@@ -89,11 +89,11 @@ export const EndpointTypeDefinition = {
|
|
|
89
89
|
|
|
90
90
|
export const ServiceTypeDefinition = {
|
|
91
91
|
name: "service",
|
|
92
|
-
owners: ["host", "cluster"],
|
|
92
|
+
owners: ["host", "cluster", "network_interface"],
|
|
93
93
|
priority: 0.4,
|
|
94
94
|
extends: Base.typeDefinition,
|
|
95
95
|
specializations: {},
|
|
96
|
-
factoryFor(owner,value) {
|
|
96
|
+
factoryFor(owner, value) {
|
|
97
97
|
const type = value.type ?? value.name;
|
|
98
98
|
const t = ServiceTypeDefinition.specializations[type];
|
|
99
99
|
|
|
@@ -145,15 +145,15 @@ export class Service extends Base {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
get network() {
|
|
148
|
-
return this.
|
|
148
|
+
return this.host.network;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
get
|
|
151
|
+
get host() {
|
|
152
152
|
return this.owner;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
get domainName() {
|
|
156
|
-
return this.
|
|
156
|
+
return this.host.domainName;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
get ipAddressOrDomainName() {
|
|
@@ -165,7 +165,7 @@ export class Service extends Base {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
get address() {
|
|
168
|
-
return this._ipAddresses?.[0] ?? this.
|
|
168
|
+
return this._ipAddresses?.[0] ?? this.host.address;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
set ipAddresses(value) {
|
|
@@ -173,7 +173,7 @@ export class Service extends Base {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
get networks() {
|
|
176
|
-
return this.
|
|
176
|
+
return this.host.networks;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
endpoints(filter) {
|
|
@@ -188,7 +188,7 @@ export class Service extends Base {
|
|
|
188
188
|
}
|
|
189
189
|
];
|
|
190
190
|
|
|
191
|
-
const result = [...this.
|
|
191
|
+
const result = [...this.host.networkAddresses()]
|
|
192
192
|
.map(na =>
|
|
193
193
|
data.map(
|
|
194
194
|
d =>
|
package/src/services/dhcp.mjs
CHANGED
|
@@ -53,7 +53,7 @@ export class DHCPService extends Service {
|
|
|
53
53
|
endpoints(filter) {
|
|
54
54
|
const endpoints = super.endpoints(filter);
|
|
55
55
|
|
|
56
|
-
for (const na of this.
|
|
56
|
+
for (const na of this.host.networkAddresses(
|
|
57
57
|
na => na.networkInterface.kind === "localhost"
|
|
58
58
|
)) {
|
|
59
59
|
endpoints.push(new Endpoint(this, na, controlAgentEndpoint));
|
|
@@ -65,7 +65,7 @@ export class DHCPService extends Service {
|
|
|
65
65
|
|
|
66
66
|
async *preparePackages(dir) {
|
|
67
67
|
const network = this.network;
|
|
68
|
-
const host = this.
|
|
68
|
+
const host = this.host;
|
|
69
69
|
const name = host.name;
|
|
70
70
|
|
|
71
71
|
console.log("kea", host.name, network.name);
|
package/src/services/dns.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { createHmac } from "node:crypto";
|
|
3
3
|
import { FileContentProvider } from "npm-pkgbuild";
|
|
4
|
-
import { isLinkLocal, reverseArpa } from "ip-utilties";
|
|
4
|
+
import { isLinkLocal, reverseArpa, decodeIP } from "ip-utilties";
|
|
5
5
|
import { writeLines } from "../utils.mjs";
|
|
6
6
|
import {
|
|
7
7
|
DNSRecord,
|
|
@@ -16,9 +16,11 @@ import {
|
|
|
16
16
|
ExtraSourceService,
|
|
17
17
|
ExtraSourceServiceTypeDefinition
|
|
18
18
|
} from "../extra-source-service.mjs";
|
|
19
|
-
import {
|
|
19
|
+
import { addresses } from "../network-support.mjs";
|
|
20
20
|
import { addHook } from "../hooks.mjs";
|
|
21
21
|
|
|
22
|
+
const address_types = ["network", "host", "network_interface"];
|
|
23
|
+
|
|
22
24
|
const DNSServiceTypeDefinition = {
|
|
23
25
|
name: "dns",
|
|
24
26
|
specializationOf: ServiceTypeDefinition,
|
|
@@ -26,9 +28,13 @@ const DNSServiceTypeDefinition = {
|
|
|
26
28
|
extends: ExtraSourceServiceTypeDefinition,
|
|
27
29
|
priority: 0.1,
|
|
28
30
|
properties: {
|
|
29
|
-
trusted: {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
trusted: {
|
|
32
|
+
type: address_types,
|
|
33
|
+
collection: true,
|
|
34
|
+
writeable: true
|
|
35
|
+
},
|
|
36
|
+
protected: { type: address_types, collection: true, writeable: true },
|
|
37
|
+
open: { type: address_types, collection: true, writeable: true },
|
|
32
38
|
hasSVRRecords: {
|
|
33
39
|
type: "boolean",
|
|
34
40
|
collection: false,
|
|
@@ -53,7 +59,7 @@ const DNSServiceTypeDefinition = {
|
|
|
53
59
|
writeable: true
|
|
54
60
|
},
|
|
55
61
|
|
|
56
|
-
exclude: { type:
|
|
62
|
+
exclude: { type: address_types, collection: true, writeable: true },
|
|
57
63
|
notify: {
|
|
58
64
|
type: "boolean",
|
|
59
65
|
collection: false,
|
|
@@ -87,9 +93,18 @@ const statisticsEndpoint = {
|
|
|
87
93
|
const DNS_SERVICE_FILTER = { type: DNSServiceTypeDefinition.name };
|
|
88
94
|
|
|
89
95
|
function addressList(objects) {
|
|
90
|
-
return Array.from(objects).map(object =>
|
|
91
|
-
typeof object
|
|
92
|
-
|
|
96
|
+
return Array.from(objects).map(object => {
|
|
97
|
+
switch (typeof object) {
|
|
98
|
+
case "string":
|
|
99
|
+
return object;
|
|
100
|
+
case "object":
|
|
101
|
+
if (object.name) {
|
|
102
|
+
return object.name;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return decodeIP(object);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
93
108
|
}
|
|
94
109
|
|
|
95
110
|
function addressesStatement(prefix, objects, generateEmpty = false) {
|
|
@@ -141,7 +156,7 @@ export class DNSService extends ExtraSourceService {
|
|
|
141
156
|
endpoints(filter) {
|
|
142
157
|
const endpoints = super.endpoints(filter);
|
|
143
158
|
|
|
144
|
-
for (const na of this.
|
|
159
|
+
for (const na of this.owner.networkAddresses(
|
|
145
160
|
na => na.networkInterface.kind === "localhost"
|
|
146
161
|
)) {
|
|
147
162
|
endpoints.push(new Endpoint(this, na, rdncEndpoint));
|
|
@@ -243,9 +258,9 @@ export class DNSService extends ExtraSourceService {
|
|
|
243
258
|
}
|
|
244
259
|
|
|
245
260
|
const acls = [
|
|
246
|
-
addressesStatement("acl trusted",
|
|
247
|
-
addressesStatement("acl protected",
|
|
248
|
-
addressesStatement("acl open",
|
|
261
|
+
addressesStatement("acl trusted", addresses(this.trusted)),
|
|
262
|
+
addressesStatement("acl protected", addresses(this.protected)),
|
|
263
|
+
addressesStatement("acl open", addresses(this.open), true)
|
|
249
264
|
].flat();
|
|
250
265
|
|
|
251
266
|
if (acls.length) {
|
package/src/services/ntp.mjs
CHANGED
package/src/subnet.mjs
CHANGED
|
@@ -56,9 +56,8 @@ export class Subnet extends Base {
|
|
|
56
56
|
try {
|
|
57
57
|
return matchPrefixIP(this.address, this.prefixLength, address);
|
|
58
58
|
} catch (e) {
|
|
59
|
-
console.error(e,
|
|
59
|
+
console.error(e, this.toString(), address);
|
|
60
60
|
}
|
|
61
|
-
|
|
62
61
|
return false;
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -92,6 +91,7 @@ export class Subnet extends Base {
|
|
|
92
91
|
|
|
93
92
|
const _owner = { addObject() {} };
|
|
94
93
|
export const SUBNET_GLOBAL_IPV4 = new Subnet(_owner, "0.0.0.0/0");
|
|
94
|
+
export const SUBNET_GLOBAL_IPV6 = new Subnet(_owner, "::0/0");
|
|
95
95
|
export const SUBNET_LOCALHOST_IPV4 = new Subnet(_owner, "127.0.0.1/8");
|
|
96
96
|
export const SUBNET_LOCALHOST_IPV6 = new Subnet(_owner, "::1/128");
|
|
97
97
|
|
package/src/types.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { asArray } from "./utils.mjs";
|
|
2
|
+
|
|
1
3
|
export const types = {};
|
|
2
4
|
|
|
3
5
|
export function addType(clazz) {
|
|
4
6
|
const type = clazz.typeDefinition;
|
|
5
7
|
|
|
6
|
-
if(type.specializationOf) {
|
|
8
|
+
if (type.specializationOf) {
|
|
7
9
|
type.specializationOf.specializations[type.name] = type;
|
|
8
10
|
}
|
|
9
11
|
|
|
@@ -26,6 +28,32 @@ export function resolveTypeLinks() {
|
|
|
26
28
|
type.identifier = property;
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
const ts = [];
|
|
32
|
+
|
|
33
|
+
for (const type of asArray(property.type)) {
|
|
34
|
+
if (typeof type === "string") {
|
|
35
|
+
if (primitives.has(type)) {
|
|
36
|
+
ts.push(type);
|
|
37
|
+
} else {
|
|
38
|
+
const t = types[type];
|
|
39
|
+
if (t) {
|
|
40
|
+
ts.push(t);
|
|
41
|
+
} else {
|
|
42
|
+
console.error(
|
|
43
|
+
"Unknown type",
|
|
44
|
+
property.type,
|
|
45
|
+
type.name,
|
|
46
|
+
property.name
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
ts.push(type);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
property.type = ts;
|
|
55
|
+
|
|
56
|
+
/*
|
|
29
57
|
if (typeof property.type === "string") {
|
|
30
58
|
if (!primitives.has(property.type)) {
|
|
31
59
|
const type = types[property.type];
|
|
@@ -41,6 +69,9 @@ export function resolveTypeLinks() {
|
|
|
41
69
|
}
|
|
42
70
|
}
|
|
43
71
|
}
|
|
72
|
+
|
|
73
|
+
property.type = asArray(property.type);
|
|
74
|
+
*/
|
|
44
75
|
}
|
|
45
76
|
}
|
|
46
77
|
|
package/types/module.d.mts
CHANGED
package/types/network.d.mts
CHANGED
package/types/service.d.mts
CHANGED
package/types/services/dns.d.mts
CHANGED
|
@@ -265,17 +265,17 @@ export class DNSService extends ExtraSourceService {
|
|
|
265
265
|
priority: number;
|
|
266
266
|
properties: {
|
|
267
267
|
trusted: {
|
|
268
|
-
type: string;
|
|
268
|
+
type: string[];
|
|
269
269
|
collection: boolean;
|
|
270
270
|
writeable: boolean;
|
|
271
271
|
};
|
|
272
272
|
protected: {
|
|
273
|
-
type: string;
|
|
273
|
+
type: string[];
|
|
274
274
|
collection: boolean;
|
|
275
275
|
writeable: boolean;
|
|
276
276
|
};
|
|
277
277
|
open: {
|
|
278
|
-
type: string;
|
|
278
|
+
type: string[];
|
|
279
279
|
collection: boolean;
|
|
280
280
|
writeable: boolean;
|
|
281
281
|
};
|
|
@@ -303,7 +303,7 @@ export class DNSService extends ExtraSourceService {
|
|
|
303
303
|
writeable: boolean;
|
|
304
304
|
};
|
|
305
305
|
exclude: {
|
|
306
|
-
type: string;
|
|
306
|
+
type: string[];
|
|
307
307
|
collection: boolean;
|
|
308
308
|
writeable: boolean;
|
|
309
309
|
};
|
package/types/subnet.d.mts
CHANGED
|
@@ -38,6 +38,7 @@ export class Subnet extends Base {
|
|
|
38
38
|
_traverse(...args: any[]): boolean;
|
|
39
39
|
}
|
|
40
40
|
export const SUBNET_GLOBAL_IPV4: Subnet;
|
|
41
|
+
export const SUBNET_GLOBAL_IPV6: Subnet;
|
|
41
42
|
export const SUBNET_LOCALHOST_IPV4: Subnet;
|
|
42
43
|
export const SUBNET_LOCALHOST_IPV6: Subnet;
|
|
43
44
|
import { Base } from "./base.mjs";
|
package/src/address.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Base } from "./base.mjs";
|
|
2
|
-
import { addType } from "./types.mjs";
|
|
3
|
-
|
|
4
|
-
const AddressTypeDefinition = {
|
|
5
|
-
name: "address",
|
|
6
|
-
owners: ["location", "owner", "network", "root"],
|
|
7
|
-
priority: 0.6,
|
|
8
|
-
constructWithIdentifierOnly: true,
|
|
9
|
-
properties: {
|
|
10
|
-
address: {
|
|
11
|
-
type: "string",
|
|
12
|
-
collection: false,
|
|
13
|
-
writeable: false,
|
|
14
|
-
identifier: true
|
|
15
|
-
},
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export class Address extends Base {
|
|
21
|
-
static {
|
|
22
|
-
addType(this);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static get typeDefinition() {
|
|
26
|
-
return AddressTypeDefinition;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
constructor(owner, address) {
|
|
30
|
-
super(owner, address);
|
|
31
|
-
}
|
|
32
|
-
}
|
package/types/address.d.mts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export class Address extends Base {
|
|
2
|
-
static get typeDefinition(): {
|
|
3
|
-
name: string;
|
|
4
|
-
owners: string[];
|
|
5
|
-
priority: number;
|
|
6
|
-
constructWithIdentifierOnly: boolean;
|
|
7
|
-
properties: {
|
|
8
|
-
address: {
|
|
9
|
-
type: string;
|
|
10
|
-
collection: boolean;
|
|
11
|
-
writeable: boolean;
|
|
12
|
-
identifier: boolean;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
import { Base } from "./base.mjs";
|