Add user management and password reset support and bump version to 0.3.7

This commit is contained in:
gitea committed 2026-07-29 16:38:57 +08:00
1 parent 33ca5fcb4a
commit 8b070cf956
6 files changed
+179 -2

No files matched your search

+35
View File
@@ -160,6 +160,37 @@ async function main() {
return;
}
if (area === "users" && action === "create") {
const name = stringOption(args.options.name) ?? maybeName;
const phone = stringOption(args.options.phone);
if (!name || !phone) throw new Error("Usage: seal-home users create --name <name> --phone <phone> [--dept <deptId>]");
const deptId = stringOption(args.options.dept) ?? stringOption(args.options.departmentId);
const departmentIds = deptId ? [deptId] : undefined;
await runTool("seal_user_create", client, corp, { name, phone, departmentIds }, outputOptions(args.options));
return;
}
if (area === "users" && action === "reset-password") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw new Error("Usage: seal-home users reset-password <userId>");
await runTool("seal_user_reset_password", client, corp, { userId }, outputOptions(args.options));
return;
}
if (area === "users" && action === "get") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw new Error("Usage: seal-home users get <userId>");
await runTool("seal_user_get", client, corp, { userId }, outputOptions(args.options));
return;
}
if (area === "users" && action === "delete") {
const userId = maybeName ?? stringOption(args.options.userId);
if (!userId) throw new Error("Usage: seal-home users delete <userId>");
await runTool("seal_user_delete", client, corp, { userId }, outputOptions(args.options));
return;
}
if (area === "context") {
await runTool("seal_approval_context_get", client, corp, {
documentLimit: numberOption(args.options.documentLimit),
@@ -1259,6 +1290,10 @@ Usage:
seal-home delegation list [--corp <corpId>]
seal-home delegation create [--note <note>] [--corp <corpId>]
seal-home delegation revoke <tokenId> [--corp <corpId>]
seal-home users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]
seal-home users reset-password <userId> [--corp <corpId>]
seal-home users get <userId> [--corp <corpId>]
seal-home users delete <userId> [--corp <corpId>]
seal-home source config [--corp <corpId>]
seal-home tool <toolName> [--corp <corpId>] [--json '{"key":"value"}']
seal-home rules count [--corp <corpId>]