@1db/cli 0.3.0 → 0.3.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/lib/config-commands.mjs +10 -6
- package/package.json +1 -1
package/lib/config-commands.mjs
CHANGED
|
@@ -102,13 +102,17 @@ export const configCommands = {
|
|
|
102
102
|
async forwarding({ positional, flags }) {
|
|
103
103
|
const [action = "list", id] = positional;
|
|
104
104
|
if (action === "list") {
|
|
105
|
-
const { rules } = await api("/v1/agent/forwarding");
|
|
105
|
+
const { rules, warnings = [] } = await api("/v1/agent/forwarding");
|
|
106
106
|
if (flags.json) return json(rules);
|
|
107
|
-
if (rules.length === 0)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
if (rules.length === 0) print("No forwarding rules.");
|
|
108
|
+
else {
|
|
109
|
+
table(
|
|
110
|
+
rules.map((r) => ({ ...r, on: r.enabled ? "yes" : "no", auth: r.hasAuthToken ? r.authType : "none" })),
|
|
111
|
+
["id", "name", "endpoint", "on", "auth"],
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
for (const warning of warnings) print(`! ${warning}`);
|
|
115
|
+
return;
|
|
112
116
|
}
|
|
113
117
|
let result;
|
|
114
118
|
if (action === "add") {
|