pmcf 6.24.1 → 6.25.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-info CHANGED
@@ -2,15 +2,25 @@
2
2
  import { extendingAttributeIterator } from "pacc";
3
3
  import { prepare } from "../src/cli.mjs";
4
4
 
5
- const { root, args, options } = await prepare({});
5
+ const { root, args, options } = await prepare({
6
+ maxDepth: {
7
+ type: "string",
8
+ short: "m"
9
+ }
10
+ });
6
11
 
7
12
  for (const expression of args) {
8
13
  const result = root.expression(expression);
9
14
 
10
- show(result);
15
+ show(result, 0, { short: false, maxDepth: options.maxDepth });
11
16
  }
12
17
 
13
- function show(value, indent = 0, short = false) {
18
+ function show(value, indent = 0, options = { short: false, maxDepth: 5 }) {
19
+ if (indent >= options.maxDepth) {
20
+ console.log("...");
21
+ return;
22
+ }
23
+
14
24
  switch (typeof value) {
15
25
  case "string":
16
26
  case "number":
@@ -23,7 +33,7 @@ function show(value, indent = 0, short = false) {
23
33
 
24
34
  if (value instanceof Iterator || Array.isArray(value)) {
25
35
  for (const v of value) {
26
- show(v, indent);
36
+ show(v, indent, options);
27
37
  }
28
38
  } else {
29
39
  const type = value.constructor;
@@ -32,7 +42,12 @@ function show(value, indent = 0, short = false) {
32
42
  const name = (attribute, l = indent + 1) =>
33
43
  prefix(l) + attribute.name.padEnd(ml) + ": ";
34
44
 
35
- if (short) {
45
+ if (value instanceof Set || Array.isArray(value)) {
46
+ console.log([...value].join(" "));
47
+ return;
48
+ }
49
+
50
+ if (options.short) {
36
51
  console.log(`${prefix()}${value[type.key]}:`);
37
52
  } else {
38
53
  console.log(`${prefix()}${value.fullName}(${type.name}):`);
@@ -71,9 +86,14 @@ function show(value, indent = 0, short = false) {
71
86
  if (v !== undefined) {
72
87
  if (attribute.collection) {
73
88
  if (attribute.backpointer) {
74
- console.log(name(attribute));
75
- for (const o of v.values()) {
76
- show(o, indent + 2, true);
89
+ if (indent + 2 >= options.maxDepth) {
90
+ console.log(name(attribute), "...");
91
+ } else {
92
+ console.log(name(attribute));
93
+
94
+ for (const o of v.values()) {
95
+ show(o, indent + 2, { ...options, short: true });
96
+ }
77
97
  }
78
98
  } else {
79
99
  const l = [...v];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.24.1",
3
+ "version": "6.25.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -77,14 +77,38 @@ export const ServiceTypes = {
77
77
  },
78
78
  ldap: {
79
79
  endpoints: [
80
- { family: FAMILY_IPV4, scheme: "ldap", protocol: "tcp", port: 389, tls: false },
81
- { family: FAMILY_IPV6, scheme: "ldap", protocol: "tcp", port: 389, tls: false }
80
+ {
81
+ family: FAMILY_IPV4,
82
+ scheme: "ldap",
83
+ protocol: "tcp",
84
+ port: 389,
85
+ tls: false
86
+ },
87
+ {
88
+ family: FAMILY_IPV6,
89
+ scheme: "ldap",
90
+ protocol: "tcp",
91
+ port: 389,
92
+ tls: false
93
+ }
82
94
  ]
83
95
  },
84
96
  ldaps: {
85
97
  endpoints: [
86
- { family: FAMILY_IPV4, scheme: "ldaps", protocol: "tcp", port: 636, tls: true },
87
- { family: FAMILY_IPV6, scheme: "ldaps", protocol: "tcp", port: 636, tls: true }
98
+ {
99
+ family: FAMILY_IPV4,
100
+ scheme: "ldaps",
101
+ protocol: "tcp",
102
+ port: 636,
103
+ tls: true
104
+ },
105
+ {
106
+ family: FAMILY_IPV6,
107
+ scheme: "ldaps",
108
+ protocol: "tcp",
109
+ port: 636,
110
+ tls: true
111
+ }
88
112
  ]
89
113
  },
90
114
  ldapi: {
@@ -92,21 +116,57 @@ export const ServiceTypes = {
92
116
  },
93
117
  http: {
94
118
  endpoints: [
95
- { family: FAMILY_IPV4, scheme: "http", protocol: "tcp", port: 80, tls: false },
96
- { family: FAMILY_IPV6, scheme: "http", protocol: "tcp", port: 80, tls: false }
119
+ {
120
+ family: FAMILY_IPV4,
121
+ scheme: "http",
122
+ protocol: "tcp",
123
+ port: 80,
124
+ tls: false
125
+ },
126
+ {
127
+ family: FAMILY_IPV6,
128
+ scheme: "http",
129
+ protocol: "tcp",
130
+ port: 80,
131
+ tls: false
132
+ }
97
133
  ]
98
134
  },
99
135
  https: {
100
136
  endpoints: [
101
- { family: FAMILY_IPV4, scheme: "https", protocol: "tcp", port: 443, tls: true },
102
- { family: FAMILY_IPV6, scheme: "https", protocol: "tcp", port: 443, tls: true }
137
+ {
138
+ family: FAMILY_IPV4,
139
+ scheme: "https",
140
+ protocol: "tcp",
141
+ port: 443,
142
+ tls: true
143
+ },
144
+ {
145
+ family: FAMILY_IPV6,
146
+ scheme: "https",
147
+ protocol: "tcp",
148
+ port: 443,
149
+ tls: true
150
+ }
103
151
  ],
104
152
  dnsRecord: { type: "HTTPS", parameters: { alpn: "h2" } }
105
153
  },
106
154
  http3: {
107
155
  endpoints: [
108
- { family: FAMILY_IPV4, scheme: "https", protocol: "udp", port: 443, tls: true },
109
- { family: FAMILY_IPV6, scheme: "https", protocol: "udp", port: 443, tls: true }
156
+ {
157
+ family: FAMILY_IPV4,
158
+ scheme: "https",
159
+ protocol: "udp",
160
+ port: 443,
161
+ tls: true
162
+ },
163
+ {
164
+ family: FAMILY_IPV6,
165
+ scheme: "https",
166
+ protocol: "udp",
167
+ port: 443,
168
+ tls: true
169
+ }
110
170
  ],
111
171
  dnsRecord: {
112
172
  type: "HTTPS",
@@ -168,13 +228,18 @@ export const ServiceTypes = {
168
228
  { family: FAMILY_IPV6, protocol: "udp", port: 546, tls: false }
169
229
  ]
170
230
  },
171
- "dhcpv6-server": { endpoints: [{ family: FAMILY_IPV6, port: 547, tls: false }] },
231
+ "dhcpv6-server": {
232
+ endpoints: [{ family: FAMILY_IPV6, port: 547, tls: false }]
233
+ },
172
234
  smb: {
173
235
  endpoints: [
174
236
  { family: FAMILY_IPV4, protocol: "tcp", port: 445, tls: false },
175
237
  { family: FAMILY_IPV6, protocol: "tcp", port: 445, tls: false }
176
238
  ]
177
239
  },
240
+ nginx: {
241
+ extends: ["http", "https", "http3"]
242
+ },
178
243
  timemachine: {
179
244
  extends: ["smb"],
180
245
  dnsRecord: {