Clarify enterprise onboarding commands

This commit is contained in:
gitea committed 2026-09-22 13:50:35 +08:00
1 parent 941a1597c0
commit 50a8beb3fd
14 files changed
+74 -29

No files matched your search

+9
View File
@@ -195,6 +195,15 @@ describe("corps link onboarding", () => {
});
describe("corp compatibility alias", () => {
test("exposes add-hose-persistent as the canonical Hose onboarding command", async () => {
setupConfigEnv();
const result = await runCli(["corps", "add-hose-persistent", "--json", "{}"]);
expect(result.isError).toBe(true);
expect(result.stderr).toContain("Missing required JSON field: appKey");
expect(result.stderr).not.toContain("Unknown corps action");
});
test("seal-use corp list executes and resolves cleanly like seal-use corps", async () => {
setupConfigEnv();
const result = await runCli(["corp", "list"]);
+5 -2
View File
@@ -151,7 +151,7 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
}
if (allCorps.length === 0) {
console.error("提示:当前未检测到企业配置。你可以使用 seal-use corps add-hose 或 seal-use corps add-seal 添加企业,或运行 seal-use help 查看说明。");
console.error("提示:当前未检测到企业配置。你可以使用 seal-use corps add-hose-persistent 或 seal-use corps add-seal 添加企业,或运行 seal-use help 查看说明。");
} else if (isStrict && filtered.length === 0 && (action === "search" || action === "find") && rawQuery) {
console.error(`提示:未在严格模式下匹配到企业 "${rawQuery}"。可以尝试省略 --strict 进行智能软搜索。`);
}
@@ -1003,7 +1003,10 @@ export async function handleCorpsCommand(action: string | undefined, maybeName:
return;
}
if (action === "add-hose") {
if (action === "add-hose-persistent" || action === "add-hose") {
if (action === "add-hose") {
console.error("⚠️ Notice: 'add-hose' is a compatibility alias; use 'add-hose-persistent' for durable Hose credentials.");
}
const jsonPayload = jsonObject(args.json);
const merged = {
...jsonPayload,
+7
View File
@@ -75,6 +75,7 @@ describe("renderHelp", () => {
expect(help).toContain("seal-use corps sync-test");
expect(help).toContain("发现与选择:");
expect(help).toContain("企业接入:");
expect(help).toContain("seal-use corps add-hose-persistent");
expect(help).toContain("Hose 专属能力:");
expect(help).toContain("seal-use corps probe-hose");
expect(help).toContain("seal-use corps hose-staffs");
@@ -103,6 +104,12 @@ describe("renderHelp", () => {
expect(help).not.toContain("seal-use webhook");
});
test("documents the add-hose compatibility alias", () => {
const help = renderHelp(["corps", "add-hose-persistent"]);
expect(help).toContain("seal-use corps add-hose-persistent");
expect(help).toContain("旧命令 add-hose 仍可用");
});
test("throws usage error for unknown area or subcommand", () => {
expect(() => renderHelp(["nonexistent-domain"])).toThrow(/Unknown command/);
expect(() => renderHelp(["corps", "nonexistent-cmd"])).toThrow(/Unknown corps command/);
+6 -4
View File
@@ -157,10 +157,12 @@ export const HELP_REGISTRY: AreaHelp[] = [
description: "Pulls production approval records from the production enterprise and replays them into the bound test enterprise's Webhook channel for rule verification."
},
{
name: "add-hose",
name: "add-hose-persistent",
aliases: ["add-hose"],
group: "企业接入",
summary: "Add a Hose/Ekuaibao enterprise configuration",
usage: ["seal-use corps add-hose --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'"]
summary: "Add a durable Hose/Ekuaibao enterprise configuration",
usage: ["seal-use corps add-hose-persistent --json '{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'"],
description: "使用长期 Hose OpenAPI 凭据接入企业并持久化配置;旧命令 add-hose 仍可用,但仅作为兼容别名。"
},
{
name: "add-seal",
@@ -196,7 +198,7 @@ export const HELP_REGISTRY: AreaHelp[] = [
group: "Hose 专属能力",
summary: "Discover Hose staff candidates by role",
usage: ["seal-use corps hose-staffs --json '{\"appKey\":\"...\",\"appSecurity\":\"...\",\"role\":\"admin\"}'"],
description: "按合思角色查询员工候选;手机号默认脱敏,供 add-hose 选择管理员。"
description: "按合思角色查询员工候选;手机号默认脱敏,供 add-hose-persistent 选择管理员。"
},
{
name: "hose-extract-keys",