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.
Files changed (2) hide show
  1. package/dist/cli.mjs +13 -18
  2. 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 api = new SkillHubAPI(registry, token);
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
- try {
6776
- const nsResponse = await api.myNamespaces();
6777
- const namespaces = nsResponse.data || nsResponse;
6778
- if (Array.isArray(namespaces) && namespaces.length > 0) {
6779
- console.log(`\n命名空间 (${namespaces.length}):`);
6780
- for (const ns of namespaces) {
6781
- const role = ns.currentUserRole || "MEMBER";
6782
- const roleLabel = {
6783
- OWNER: "拥有者",
6784
- ADMIN: "管理员",
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
- } catch {}
6786
+ }
6792
6787
  console.log();
6793
6788
  }
6794
6789
  function getOptionValue$3(args, flag) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bfi-cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "用友大业财BFI统一命令行工具,支持技能,技能包,元数据,UI元数据等",
5
5
  "type": "module",
6
6
  "bin": {