bfi-cli 0.1.10 → 0.1.12
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/dist/cli.mjs +13 -18
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -6765,30 +6765,25 @@ async function runWhoami(globalOpts) {
|
|
|
6765
6765
|
console.error("未认证。运行:bfi auth login --token <token>");
|
|
6766
6766
|
process.exit(1);
|
|
6767
6767
|
}
|
|
6768
|
-
const
|
|
6769
|
-
const response = await api.whoami();
|
|
6768
|
+
const response = await new SkillHubAPI(registry, token).whoami();
|
|
6770
6769
|
const user = response.user || response;
|
|
6770
|
+
const namespaces = response.namespaces || [];
|
|
6771
6771
|
const displayName = user.displayName || user.name || "N/A";
|
|
6772
6772
|
const userId = user.handle || user.id || "N/A";
|
|
6773
6773
|
console.log(`\n用户名: ${displayName}`);
|
|
6774
6774
|
console.log(`用户ID: ${userId}`);
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
const
|
|
6778
|
-
|
|
6779
|
-
console.log(
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
MEMBER: "成员",
|
|
6786
|
-
VIEWER: "访客"
|
|
6787
|
-
}[role] || role;
|
|
6788
|
-
console.log(` @${ns.slug} ${ns.displayName || ""} [${roleLabel}]`);
|
|
6789
|
-
}
|
|
6775
|
+
if (Array.isArray(namespaces) && namespaces.length > 0) {
|
|
6776
|
+
console.log(`\n命名空间 (${namespaces.length}):`);
|
|
6777
|
+
for (const ns of namespaces) {
|
|
6778
|
+
const role = ns.role || "MEMBER";
|
|
6779
|
+
console.log(` @${ns.slug} ${ns.displayName || ""} [${{
|
|
6780
|
+
OWNER: "拥有者",
|
|
6781
|
+
ADMIN: "管理员",
|
|
6782
|
+
MEMBER: "成员",
|
|
6783
|
+
VIEWER: "访客"
|
|
6784
|
+
}[role] || role}]`);
|
|
6790
6785
|
}
|
|
6791
|
-
}
|
|
6786
|
+
}
|
|
6792
6787
|
console.log();
|
|
6793
6788
|
}
|
|
6794
6789
|
function getOptionValue$3(args, flag) {
|