46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { z } from "zod";
|
|
import type { KyInstance } from "ky";
|
|
import * as api from "../api.js";
|
|
|
|
export const contactsCapabilities = [
|
|
{
|
|
name: "sealContactsDepartmentsRootList",
|
|
description: "列出当前 Seal 租户通讯录的顶级部门",
|
|
parameters: z.object({}),
|
|
handler: async (client: KyInstance) => api.listRootDepartments(client)
|
|
},
|
|
{
|
|
name: "sealContactsDepartmentGet",
|
|
description: "获取指定通讯录部门的详细信息",
|
|
parameters: z.object({
|
|
departmentId: z.string().describe("部门 ID")
|
|
}),
|
|
handler: async (client: KyInstance, params: { departmentId: string }) =>
|
|
api.getDepartment(client, params.departmentId)
|
|
},
|
|
{
|
|
name: "sealContactsDepartmentChildrenList",
|
|
description: "列出指定通讯录部门的直接子部门",
|
|
parameters: z.object({
|
|
departmentId: z.string().describe("部门 ID")
|
|
}),
|
|
handler: async (client: KyInstance, params: { departmentId: string }) =>
|
|
api.listDepartmentChildren(client, params.departmentId)
|
|
},
|
|
{
|
|
name: "sealContactsDepartmentUsersList",
|
|
description: "列出指定通讯录部门下的用户",
|
|
parameters: z.object({
|
|
departmentId: z.string().describe("部门 ID")
|
|
}),
|
|
handler: async (client: KyInstance, params: { departmentId: string }) =>
|
|
api.listDepartmentUsers(client, params.departmentId)
|
|
},
|
|
{
|
|
name: "sealContactsLastSyncTimeGet",
|
|
description: "查询通讯录最后同步时间",
|
|
parameters: z.object({}),
|
|
handler: async (client: KyInstance) => api.getContactsLastSyncTime(client)
|
|
}
|
|
];
|