@larksuiteoapi/lark-mcp
Version:
Feishu/Lark OpenAPI MCP
585 lines • 185 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contactV3UnitBindDepartment = exports.contactV3ScopeList = exports.contactV3JobTitleList = exports.contactV3JobTitleGet = exports.contactV3JobLevelUpdate = exports.contactV3JobLevelList = exports.contactV3JobLevelGet = exports.contactV3JobLevelDelete = exports.contactV3JobLevelCreate = exports.contactV3JobFamilyUpdate = exports.contactV3JobFamilyList = exports.contactV3JobFamilyGet = exports.contactV3JobFamilyDelete = exports.contactV3JobFamilyCreate = exports.contactV3GroupSimplelist = exports.contactV3GroupPatch = exports.contactV3GroupMemberSimplelist = exports.contactV3GroupMemberRemove = exports.contactV3GroupMemberBatchRemove = exports.contactV3GroupMemberBatchAdd = exports.contactV3GroupMemberAdd = exports.contactV3GroupMemberBelong = exports.contactV3GroupGet = exports.contactV3GroupDelete = exports.contactV3GroupCreate = exports.contactV3FunctionalRoleUpdate = exports.contactV3FunctionalRoleMemberScopes = exports.contactV3FunctionalRoleMemberList = exports.contactV3FunctionalRoleMemberGet = exports.contactV3FunctionalRoleMemberBatchDelete = exports.contactV3FunctionalRoleMemberBatchCreate = exports.contactV3FunctionalRoleDelete = exports.contactV3FunctionalRoleCreate = exports.contactV3EmployeeTypeEnumUpdate = exports.contactV3EmployeeTypeEnumList = exports.contactV3EmployeeTypeEnumDelete = exports.contactV3EmployeeTypeEnumCreate = exports.contactV3DepartmentUpdateDepartmentId = exports.contactV3DepartmentUpdate = exports.contactV3DepartmentUnbindDepartmentChat = exports.contactV3DepartmentSearch = exports.contactV3DepartmentPatch = exports.contactV3DepartmentParent = exports.contactV3DepartmentList = exports.contactV3DepartmentGet = exports.contactV3DepartmentDelete = exports.contactV3DepartmentCreate = exports.contactV3DepartmentChildren = exports.contactV3DepartmentBatch = exports.contactV3CustomAttrList = void 0;
exports.contactV3Tools = exports.contactV3WorkCityList = exports.contactV3WorkCityGet = exports.contactV3UserUpdateUserId = exports.contactV3UserUpdate = exports.contactV3UserResurrect = exports.contactV3UserPatch = exports.contactV3UserList = exports.contactV3UserGet = exports.contactV3UserFindByDepartment = exports.contactV3UserDelete = exports.contactV3UserCreate = exports.contactV3UserBatchGetId = exports.contactV3UserBatch = exports.contactV3UnitUnbindDepartment = exports.contactV3UnitPatch = exports.contactV3UnitListDepartment = exports.contactV3UnitList = exports.contactV3UnitGet = exports.contactV3UnitDelete = exports.contactV3UnitCreate = void 0;
const zod_1 = require("zod");
exports.contactV3CustomAttrList = {
project: 'contact',
name: 'contact.v3.customAttr.list',
sdkName: 'contact.v3.customAttr.list',
path: '/open-apis/contact/v3/custom_attrs',
httpMethod: 'GET',
description: '[Feishu/Lark]-Contacts-Custom user fields-Obtain custom user fields-Call this interface to query the configuration information of custom user fields in the current enterprise',
accessTokens: ['tenant'],
schema: {
params: zod_1.z
.object({
page_size: zod_1.z
.number()
.describe('Paging size, used to limit the number of data entries returned in one request')
.optional(),
page_token: zod_1.z
.string()
.describe('Page identifier. It is not filled in the first request, indicating traversal from the beginning when there will be more groups, the new page_token will be returned at the same time, and the next traversal can use the page_token to get more groups')
.optional(),
})
.optional(),
},
};
exports.contactV3DepartmentBatch = {
project: 'contact',
name: 'contact.v3.department.batch',
sdkName: 'contact.v3.department.batch',
path: '/open-apis/contact/v3/departments/batch',
httpMethod: 'GET',
description: '[Feishu/Lark]-Contacts-Department-Obtain bulk department information-Call this interface to obtain information about one or more departments, including department name, ID, parent department, person in charge, status, number of members, etc',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z.object({
department_ids: zod_1.z
.array(zod_1.z.string())
.describe('Department ID, ID type needs to be consistent with the value of the query parameter department_id_type. Instructions on how to obtain the ID:- After calling the [Create Department] interface, the department ID information can be obtained from the returned result.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying.**Notice:**- The maximum number of IDs requested in a single request is 50.- If you need to query multiple departments at one time, you can pass the same parameter name multiple times, and pass a different department ID each time for query. GET request example:`https://{url}?department_ids={department_id1}&department_ids={department_id2}`. in: - `department_ids` is the parameter name and can be passed multiple times. - `department_id1` and `department_id2` are different parameter values'),
department_id_type: zod_1.z
.enum(['open_department_id', 'department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description]. Options:open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.),department_id(Supports user-defined configuration of department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.)')
.optional(),
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
}),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.contactV3DepartmentChildren = {
project: 'contact',
name: 'contact.v3.department.children',
sdkName: 'contact.v3.department.children',
path: '/open-apis/contact/v3/departments/:department_id/children',
httpMethod: 'GET',
description: "[Feishu/Lark]-Contacts-Department-Obtain the list of sub-departments-Call this interface to query the list of sub-departments under the specified department. The list contains information such as the department's name, ID, parent department, person in charge, and status",
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z
.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description]. Options:department_id(Supports user-defined configured department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
fetch_child: zod_1.z
.boolean()
.describe('Whether to recursively obtain subdepartments. When the value is true, the interface will recursively query sub-department information at all levels under the current department.**Optional values are:**- true- false (default)')
.optional(),
page_size: zod_1.z
.number()
.describe('Paging size, used to limit the number of data entries returned in one request')
.optional(),
page_token: zod_1.z
.string()
.describe('Page identifier. It is not filled in the first request, indicating traversal from the beginning when there will be more groups, the new page_token will be returned at the same time, and the next traversal can use the page_token to get more groups')
.optional(),
})
.optional(),
path: zod_1.z.object({
department_id: zod_1.z
.string()
.describe('Department ID.**Note:**- The ID type needs to be consistent with the value of the query parameter department_id_type.- When you create a department, you can obtain the department ID information from the returned results. You can also call the [Search Department] interface to obtain The desired department ID.- The root department has a department ID of 0'),
}),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.contactV3DepartmentCreate = {
project: 'contact',
name: 'contact.v3.department.create',
sdkName: 'contact.v3.department.create',
path: '/open-apis/contact/v3/departments',
httpMethod: 'POST',
description: '[Feishu/Lark]-Contacts-Department-Create a department-Call this interface to create a department in the contacts',
accessTokens: ['tenant'],
schema: {
data: zod_1.z.object({
name: zod_1.z
.string()
.describe('Department name.**Notice**:- Cannot contain slashes (`/`).- Cannot be the same as the existing department name'),
i18n_name: zod_1.z
.object({
zh_cn: zod_1.z.string().describe("Department's Chinese name").optional(),
ja_jp: zod_1.z.string().describe("Department's Japanese name").optional(),
en_us: zod_1.z.string().describe("Department's English name").optional(),
})
.describe('International configuration of department names.**Notice**:- Cannot contain slashes (`/`).- It cannot be repeated with the internationalization configuration of the existing department name.**Default value**: empty')
.optional(),
parent_department_id: zod_1.z
.string()
.describe('The ID of the parent department. How to obtain department ID:- If the department is currently being created under the root department, the value of this parameter is `0`.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying'),
department_id: zod_1.z
.string()
.describe('Custom department ID.**Notice**:- cannot start with `od-`.- Cannot be set to `0` or `1`.**Default value**: empty, indicating that the ID is automatically generated by the system')
.optional(),
leader_user_id: zod_1.z
.string()
.describe('The user ID of the department head. The ID type is consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs].**Default value**: empty')
.optional(),
order: zod_1.z
.string()
.describe('The sorting of departments is the order in which departments are displayed among departments at the same level. The value format is a non-negative integer of String type. The smaller the value, the higher the sorting is.**Note**: The order value is unique, that is, the value passed in cannot be the same as the order value of the stock department. Therefore, when creating departments, it is recommended that you plan the ordering of departments at the same level and set different order values in order.**Default value**: empty. By default, the newly created departments are ranked after the existing departments')
.optional(),
unit_ids: zod_1.z
.array(zod_1.z.string())
.describe('A list of custom IDs for units bound to the department. Currently, only one unit is supported.- For unit information, see [Resource Introduction].- Call the [Get unit list] interface to obtain the unit ID.**Default value**: empty')
.optional(),
create_group_chat: zod_1.z
.boolean()
.describe('Whether to create department groups. **Optional values are:**- true: create- false (default)**Note**: When creating a department group, the group name defaults to the department name, and the group owner defaults to the department head')
.optional(),
leaders: zod_1.z
.array(zod_1.z.object({
leaderType: zod_1.z
.number()
.describe('Person in charge type. Options:1(main Main person in charge),2(deputy Deputy responsible person)'),
leaderID: zod_1.z
.string()
.describe('The user ID and ID type of the person in charge are consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs]'),
}))
.describe('Department head information.**Notice**:- When configuring this parameter, you must specify a person in charge.- When setting up multiple persons in charge, only one person in charge can be set as the main person in charge.- If a department head (leader_user_id) is set at the same time, the department head set here must be the same person as the department head.**Default value**: empty')
.optional(),
group_chat_employee_types: zod_1.z
.array(zod_1.z.number())
.describe('Personnel type restrictions for department groups.The value range of personnel type is as follows. This parameter supports setting multiple type values. If there are multiple types, separate them with English `,`:- 1: Regular employee- 2: Intern- 3: Outsourcing- 4: Labor services- 5: ConsultantThis parameter supports passing in the number corresponding to the custom person type. You can call the [Query employee type] interface to obtain the corresponding number (enum_value).**Default value**: empty')
.optional(),
department_hrbps: zod_1.z
.array(zod_1.z.string())
.describe('List of user IDs for department HRBP. The ID type is consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs].**Default value**: empty')
.optional(),
}),
params: zod_1.z
.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description].**Default value**: open_department_id Options:department_id(Supports user-defined configuration of department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
client_token: zod_1.z
.string()
.describe('Used to determine whether it is the same request idempotently to avoid repeated requests. String type, you need to generate parameter values yourself.**Default value**: empty')
.optional(),
})
.optional(),
},
};
exports.contactV3DepartmentDelete = {
project: 'contact',
name: 'contact.v3.department.delete',
sdkName: 'contact.v3.department.delete',
path: '/open-apis/contact/v3/departments/:department_id',
httpMethod: 'DELETE',
description: '[Feishu/Lark]-Contacts-Department-Delete a department-Call this interface to delete the specified department from the contacts',
accessTokens: ['tenant'],
schema: {
params: zod_1.z
.object({
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description]. Options:department_id(Supports user-defined configuration of department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
})
.optional(),
path: zod_1.z
.object({
department_id: zod_1.z
.string()
.describe('Department ID, ID type needs to be consistent with the value of the query parameter department_id_type.- After calling the [Create Department] interface, the department ID information can be obtained from the returned result.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying')
.optional(),
})
.optional(),
},
};
exports.contactV3DepartmentGet = {
project: 'contact',
name: 'contact.v3.department.get',
sdkName: 'contact.v3.department.get',
path: '/open-apis/contact/v3/departments/:department_id',
httpMethod: 'GET',
description: '[Feishu/Lark]-Contacts-Department-Obtain single department information-Call this interface to obtain information about a single department, including department name, ID, parent department, person in charge, status, number of members, etc',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z
.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description]. Options:department_id(Supports user-defined configuration of department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
})
.optional(),
path: zod_1.z
.object({
department_id: zod_1.z
.string()
.describe('Department ID, ID type needs to be consistent with the value of the query parameter department_id_type. Instructions on how to obtain the ID:- After calling the [Create Department] interface, the department ID information can be obtained from the returned result.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying')
.optional(),
})
.optional(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.contactV3DepartmentList = {
project: 'contact',
name: 'contact.v3.department.list',
sdkName: 'contact.v3.department.list',
path: '/open-apis/contact/v3/departments',
httpMethod: 'GET',
description: '[Feishu/Lark]-Deprecated Version (Not Recommended)-Contact-Department-Get Department Information List-This API is used to obtain the list of sub-departments of a department. [FAQs]',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z
.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('Type of department ID used in this call Options:department_id(Identify the department with the custom department_id),open_department_id(Identify the department with open_department_id)')
.optional(),
parent_department_id: zod_1.z
.string()
.describe('Parent department ID. If this parameter is specified, all sub-departments under the department will be obtained. The ID entered must be the one specified by department_id_type')
.optional(),
fetch_child: zod_1.z.boolean().describe('Whether to obtain sub-departments recursively').optional(),
page_token: zod_1.z.string().optional(),
page_size: zod_1.z.number().optional(),
})
.optional(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.contactV3DepartmentParent = {
project: 'contact',
name: 'contact.v3.department.parent',
sdkName: 'contact.v3.department.parent',
path: '/open-apis/contact/v3/departments/parent',
httpMethod: 'GET',
description: '[Feishu/Lark]-Contacts-Department-Obtain parent department information-Call this interface to recursively obtain the parent department information of the specified department, including department name, ID, person in charge, status, etc',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description].**Default**: open_department_id Options:department_id(Supports user-defined configured department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
department_id: zod_1.z
.string()
.describe('Department ID. The ID type needs to be consistent with the value of the query parameter department_id_type.When you create a department, you can obtain the department ID information from the returned results. You can also call the [Search Department] interface to obtain all Required department ID'),
page_token: zod_1.z
.string()
.describe('Page identifier. It is not filled in the first request, indicating traversal from the beginning; when there will be more groups, the new page_token will be returned at the same time, and the next traversal can use the page_token to get more groups')
.optional(),
page_size: zod_1.z
.number()
.describe('Paging size, used to limit the number of data entries returned in one request')
.optional(),
}),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.contactV3DepartmentPatch = {
project: 'contact',
name: 'contact.v3.department.patch',
sdkName: 'contact.v3.department.patch',
path: '/open-apis/contact/v3/departments/:department_id',
httpMethod: 'PATCH',
description: '[Feishu/Lark]-Contacts-Department-Modify department information in part-Call this interface to update some information of the specified department, including name, parent department, sorting, person in charge, etc',
accessTokens: ['tenant'],
schema: {
data: zod_1.z
.object({
name: zod_1.z
.string()
.describe('Department name.**Notice**:- Cannot contain slashes (`/`).- Cannot be the same as the existing department name.**Default value**: empty, indicating no modification')
.optional(),
i18n_name: zod_1.z
.object({
zh_cn: zod_1.z.string().describe("Department's Chinese name").optional(),
ja_jp: zod_1.z.string().describe("Department's Japanese name").optional(),
en_us: zod_1.z.string().describe("Department's English name").optional(),
})
.describe('International configuration of department names.**Notice**:- Cannot contain slashes (`/`).- It cannot be repeated with the internationalization configuration of the existing department name.**Default value**: empty, indicating no modification')
.optional(),
parent_department_id: zod_1.z
.string()
.describe('The ID of the parent department. How to obtain department ID:- If the parent department of the department needs to be set as the root department, this parameter takes the value `0`.- You can call the [Search Department] interface to obtain the required department ID.**Default value**: empty, indicating no modification')
.optional(),
leader_user_id: zod_1.z
.string()
.describe('The user ID of the department head. The ID type is consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs].**Note**: The values of department head (leader_user_id) and department head (leaderID corresponding to leaderType value 1) are always consistent. therefore:- If the department head is set at the same time (leaderID corresponding to leaderType value 1), the department head set here must be the same person as the department head.- Only the department head is modified, and the department leader will be modified simultaneously (leaderID corresponding to leaderType value 1).**Default value**: empty, indicating no modification')
.optional(),
order: zod_1.z
.string()
.describe('The sorting of departments is the order in which departments are displayed among departments at the same level. The value format is a non-negative integer of String type. The smaller the value, the higher the sorting is.**Note**: The order value is unique, that is, the value passed in cannot be the same as the order value of the stock department.**Default value**: empty, indicating no modification')
.optional(),
create_group_chat: zod_1.z
.boolean()
.describe('Whether to create department groups. **Optional values are:**- true: create.- false: Do not create. If a department group has been created previously, the group will continue to exist even if set to false.**Note**: When creating a department group, the group name defaults to the department name, and the group owner defaults to the department head.**Default value**: empty, indicating no modification')
.optional(),
leaders: zod_1.z
.array(zod_1.z.object({
leaderType: zod_1.z
.number()
.describe('Person in charge type. Options:1(main Main person in charge),2(deputy Deputy responsible person)'),
leaderID: zod_1.z
.string()
.describe('The user ID and ID type of the person in charge are consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs]'),
}))
.describe('Department head information.**Notice**:- If an empty array is passed to leaders, the original value will be cleared.- When configuring this parameter, you must specify a person in charge.- When setting up multiple persons in charge, only one person in charge can be set as the main person in charge.- The values of department head (leader_user_id) and department head (leaderID corresponding to leaderType value 1) are always consistent. therefore: - If a department head (leader_user_id) is set at the same time, the department head set here must be the same person as the department head. - Only the department leader is modified, and the department head (leader_user_id) will be modified simultaneously')
.optional(),
group_chat_employee_types: zod_1.z
.array(zod_1.z.number())
.describe('Personnel type restrictions for department groups.The value range of personnel type is as follows. This parameter supports setting multiple type values. If there are multiple types, separate them with English `,`:- 1: Regular employee- 2: Intern- 3: Outsourcing- 4: Labor services- 5: ConsultantThis parameter supports passing in the number corresponding to the custom person type. You can call the [Query employee type] interface to obtain the corresponding number (enum_value).**Default**: empty')
.optional(),
department_hrbps: zod_1.z
.array(zod_1.z.string())
.describe('List of user IDs for department HRBP. The ID type is consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs].**Notice**: If an empty array is passed to department_hrbps, the original value will be cleared')
.optional(),
})
.optional(),
params: zod_1.z
.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description]. Options:department_id(Supports user-defined configuration of department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
})
.optional(),
path: zod_1.z
.object({
department_id: zod_1.z
.string()
.describe('Department ID, ID type needs to be consistent with the value of the query parameter department_id_type. Instructions on how to obtain the ID:- After calling the [Create Department] interface, the department ID information can be obtained from the returned result.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying')
.optional(),
})
.optional(),
},
};
exports.contactV3DepartmentSearch = {
project: 'contact',
name: 'contact.v3.department.search',
sdkName: 'contact.v3.department.search',
path: '/open-apis/contact/v3/departments/search',
httpMethod: 'POST',
description: "[Feishu/Lark]-Contacts-Department-Search for departments-Call this interface to query the visible department information through the department name keyword as a user, including the department's ID, parent department, person in charge, and status, etc",
accessTokens: ['user'],
schema: {
data: zod_1.z.object({
query: zod_1.z
.string()
.describe('Search keywords, the matching field is the department name (matching department internationalized names is not supported)'),
}),
params: zod_1.z
.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description].**Default**: open_department_id Options:department_id(Supports user-defined configured department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
page_token: zod_1.z
.string()
.describe('Page identifier. It is not filled in the first request, indicating traversal from the beginning when there will be more groups, the new page_token will be returned at the same time, and the next traversal can use the page_token to get more groups')
.optional(),
page_size: zod_1.z
.number()
.describe('Paging size, used to limit the number of data entries returned in one request')
.optional(),
})
.optional(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.contactV3DepartmentUnbindDepartmentChat = {
project: 'contact',
name: 'contact.v3.department.unbindDepartmentChat',
sdkName: 'contact.v3.department.unbindDepartmentChat',
path: '/open-apis/contact/v3/departments/unbind_department_chat',
httpMethod: 'POST',
description: '[Feishu/Lark]-Contacts-Department-Change department group to common group-Call this interface to convert the department group of the specified department into a normal group',
accessTokens: ['tenant'],
schema: {
data: zod_1.z.object({
department_id: zod_1.z
.string()
.describe('Department ID, ID type needs to be consistent with the value of the query parameter department_id_type. Instructions on how to obtain the ID:- After calling the [Create Department] interface, the department ID information can be obtained from the returned result.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying'),
}),
params: zod_1.z
.object({
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description].**Default**: open_department_id Options:department_id(Supports user-defined configuration of department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
})
.optional(),
},
};
exports.contactV3DepartmentUpdate = {
project: 'contact',
name: 'contact.v3.department.update',
sdkName: 'contact.v3.department.update',
path: '/open-apis/contact/v3/departments/:department_id',
httpMethod: 'PUT',
description: '[Feishu/Lark]-Contacts-Department-Update department information in whole-Call this interface to update the information of the specified department, including name, parent department, person in charge, etc',
accessTokens: ['tenant'],
schema: {
data: zod_1.z.object({
name: zod_1.z
.string()
.describe('Department name.**Notice**:- Cannot contain slashes (`/`).- Cannot be the same as the existing department name'),
i18n_name: zod_1.z
.object({
zh_cn: zod_1.z.string().describe("Department's Chinese name").optional(),
ja_jp: zod_1.z.string().describe("Department's Japanese name").optional(),
en_us: zod_1.z.string().describe("Department's English name").optional(),
})
.describe('International configuration of department names.**Notice**:- Cannot contain slashes (`/`).- It cannot be repeated with the internationalization configuration of the existing department name')
.optional(),
parent_department_id: zod_1.z
.string()
.describe('The ID of the parent department. How to obtain department ID:- If the parent department of the department needs to be set as the root department, this parameter takes the value `0`.- You can call the [Search Department] interface to obtain the required department ID'),
leader_user_id: zod_1.z
.string()
.describe('The user ID of the department head. The ID type is consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs].**Note**: The values of department head (leader_user_id) and department head (leaderID corresponding to leaderType value 1) are always consistent. therefore:- If the department head is set at the same time (leaderID corresponding to leaderType value 1), the department head set here must be the same person as the department head.- Only the department head is modified, and the department leader will be modified simultaneously (leaderID corresponding to leaderType value 1)')
.optional(),
order: zod_1.z
.string()
.describe('The sorting of departments is the order in which departments are displayed among departments at the same level. The value format is a non-negative integer of String type. The smaller the value, the higher the sorting is.**Note**: The order value is unique, that is, the value passed in cannot be the same as the order value of the stock department.**Default value**: empty, indicating that the original order value of the department will not be modified')
.optional(),
create_group_chat: zod_1.z
.boolean()
.describe('Whether to create department groups. **Optional values are:**- true: create.- false: do not create.**illustrate**:- If the department does not have a department group before, then the value of true will create a department group. When created, the group name defaults to the department name, and the group owner defaults to the department head.- If the department has previously created a department group, this parameter will not affect the original department group regardless of whether it is passed a value')
.optional(),
leaders: zod_1.z
.array(zod_1.z.object({
leaderType: zod_1.z
.number()
.describe('Person in charge type. Options:1(main Main person in charge),2(deputy Deputy responsible person)'),
leaderID: zod_1.z
.string()
.describe('The user ID and ID type of the person in charge are consistent with the value of the query parameter user_id_type. For how to obtain user ID, please refer to [How to obtain different user IDs]'),
}))
.describe('Department head information.**Notice**:- When configuring this parameter, you must specify a person in charge.- When setting up multiple persons in charge, only one person in charge can be set as the main person in charge.- The values of department head (leader_user_id) and department head (leaderID corresponding to leaderType value 1) are always consistent. therefore: - If a department head (leader_user_id) is set at the same time, the department head set here must be the same person as the department head. - Only the department leader is modified, and the department head (leader_user_id) will be modified simultaneously')
.optional(),
group_chat_employee_types: zod_1.z
.array(zod_1.z.number())
.describe('Personnel type restrictions for department groups.The value range of personnel type is as follows. This parameter supports setting multiple type values. If there are multiple types, separate them with English `,`:- 1: Regular employee- 2: Intern- 3: Outsourcing- 4: Labor services- 5: ConsultantThis parameter supports passing in the number corresponding to the custom person type. You can call the [Query employee type] interface to obtain the corresponding number (enum_value).**Note**: If the department has previously created a department group, if this parameter does not pass a value, the original department group personnel type restrictions will not be modified by default')
.optional(),
}),
params: zod_1.z
.object({
user_id_type: zod_1.z.enum(['open_id', 'union_id', 'user_id']).describe('User ID type').optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description]. Options:department_id(Supports user-defined configuration of department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
})
.optional(),
path: zod_1.z
.object({
department_id: zod_1.z
.string()
.describe('Department ID, ID type needs to be consistent with the value of the query parameter department_id_type. Instructions on how to obtain the ID:- After calling the [Create Department] interface, the department ID information can be obtained from the returned result.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying')
.optional(),
})
.optional(),
},
};
exports.contactV3DepartmentUpdateDepartmentId = {
project: 'contact',
name: 'contact.v3.department.updateDepartmentId',
sdkName: 'contact.v3.department.updateDepartmentId',
path: '/open-apis/contact/v3/departments/:department_id/update_department_id',
httpMethod: 'PATCH',
description: "[Feishu/Lark]-Contacts-Department-Update DepartmentID-Call this interface to update the department's custom ID, that is, department_id",
accessTokens: ['tenant'],
schema: {
data: zod_1.z.object({
new_department_id: zod_1.z
.string()
.describe("The new custom department ID, which is the department's department_id.**Notice**:- Cannot start with `od-`.- Cannot be set to `0`.- Cannot be the same as the department_id of other departments that have not been deleted"),
}),
params: zod_1.z
.object({
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID in this call. For a detailed introduction to department ID, please refer to [Department ID Description].**Default**: open_department_id Options:department_id(Supports user-defined configured department IDs. The deleted department_id can be reused when customizing the configuration, so department_id is unique within the scope of the department that has not been deleted.),open_department_id(Department ID automatically generated by the system. The ID prefix is fixed to `od-` and is globally unique within the tenant.)')
.optional(),
})
.optional(),
path: zod_1.z
.object({
department_id: zod_1.z
.string()
.describe('Department ID, ID type needs to be consistent with the value of the query parameter department_id_type. Instructions on how to obtain the ID:- After calling the [Create Department] interface, the department ID information can be obtained from the returned result.- The department API provides multiple ways to obtain the IDs of other departments, such as [Get list of sub-departments], [Get parent department information], [search department], you can choose the appropriate one API for querying')
.optional(),
})
.optional(),
},
};
exports.contactV3EmployeeTypeEnumCreate = {
project: 'contact',
name: 'contact.v3.employeeTypeEnum.create',
sdkName: 'contact.v3.employeeTypeEnum.create',
path: '/open-apis/contact/v3/employee_type_enums',
httpMethod: 'POST',
description: "[Feishu/Lark]-Contacts-Workforce type-Add a workforce type-Call this interface to add a workforce type. Workforce type is one of the user attributes, used to flexibly mark the user's identity type",
accessTokens: ['tenant'],
schema: {
data: zod_1.z.object({
content: zod_1.z.string().describe('Enum content of workforce type'),
enum_type: zod_1.z
.number()
.describe('Enum type of workforce type. When adding, the fixed value is `2`. Options:1(Defualt Built-in type, read-only. This type cannot be selected when adding a new personnel type.),2(Custom Custom.)'),
enum_status: zod_1.z
.number()
.describe('Enum activation status of the workforce type. Only activated options can be used to configure user properties. Options:1(Active Activated),2(Inactive Unactivated)'),
i18n_content: zod_1.z
.array(zod_1.z.object({
locale: zod_1.z
.string()
.describe('Language version. For example:- zh_cn: Chinese- en_us: English- ja_jp: Japanese')
.optional(),
value: zod_1.z
.string()
.describe('Content corresponding to the language version.**Data verification rules:**Length range: `1` characters ~ `100` characters')
.optional(),
}))
.describe('International configuration of enum content.**Note**: When viewing user workforce types on the Feishu client, the system will automatically display the matching enum language based on the client language environment. If the corresponding language is not included in the enum internationalization configuration, the default option content (i.e. content field) will be displayed')
.optional(),
}),
},
};
exports.contactV3EmployeeTypeEnumDelete = {
project: 'contact',
name: 'contact.v3.employeeTypeEnum.delete',
sdkName: 'contact.v3.employeeTypeEnum.delete',
path: '/open-apis/contact/v3/employee_type_enums/:enum_id',
httpMethod: 'DELETE',
description: '[Feishu/Lark]-Contacts-Workforce type-Delete workforce types-Call this interface to delete the specified custom workforce type',
accessTokens: ['tenant'],
schema: {
path: zod_1.z
.object({
enum_id: zod_1.z
.string()
.describe('Enum ID of the custom workforce type. You can get it from the return value when creating a new employee type, or you can call the [Query employee type] interface to get the ID of the enum')
.optional(),
})
.optional(),
},
};
exports.contactV3EmployeeTypeEnumList = {
project: 'contact',
name: 'contact.v3.employeeTypeEnum.list',
sdkName: 'contact.v3.employeeTypeEnum.list',
path: '/open-apis/contact/v3/employee_type_enums',
httpMethod: 'GET',
description: '[Feishu/Lark]-Contacts-Workforce type-Query the workforce type-Call this interface to query all workforce type information under the current tenant, including enum ID, type, number, and content',
accessTokens: ['tenant'],
schema: {
params: zod_1.z
.object({
page_token: zod_