@larksuiteoapi/lark-mcp
Version:
Feishu/Lark OpenAPI MCP
711 lines (710 loc) • 103 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.directoryV1Tools = exports.directoryV1EmployeeToBeResigned = exports.directoryV1EmployeeSearch = exports.directoryV1EmployeeResurrect = exports.directoryV1EmployeeRegular = exports.directoryV1EmployeePatch = exports.directoryV1EmployeeMget = exports.directoryV1EmployeeFilter = exports.directoryV1EmployeeDelete = exports.directoryV1EmployeeCreate = exports.directoryV1DepartmentSearch = exports.directoryV1DepartmentPatch = exports.directoryV1DepartmentMget = exports.directoryV1DepartmentFilter = exports.directoryV1DepartmentDelete = exports.directoryV1DepartmentCreate = exports.directoryV1CollborationShareEntityList = exports.directoryV1CollaborationTenantList = exports.directoryV1CollaborationRuleUpdate = exports.directoryV1CollaborationRuleList = exports.directoryV1CollaborationRuleDelete = exports.directoryV1CollaborationRuleCreate = void 0;
const zod_1 = require("zod");
exports.directoryV1CollaborationRuleCreate = {
project: 'directory',
name: 'directory.v1.collaborationRule.create',
sdkName: 'directory.v1.collaborationRule.create',
path: '/open-apis/directory/v1/collaboration_rules',
httpMethod: 'POST',
description: '[Feishu/Lark]-Trust Party-Collaboration rules-Add collaboration rules-Admin perspective Added collaboration rules. Users need to have trusted party administrator role',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
subjects: zod_1.z
.object({
open_user_ids: zod_1.z
.array(zod_1.z.string())
.describe('User open id, which can be obtained from our Contacts/organizational structure interfaces')
.optional(),
open_department_ids: zod_1.z
.array(zod_1.z.string())
.describe('Department open id, 0 represents all members, which can be obtained from our Contacts/organizational structure interfaces')
.optional(),
open_group_ids: zod_1.z
.array(zod_1.z.string())
.describe('The user group open id can be obtained from our Contacts/organizational structure interfaces')
.optional(),
})
.describe('The sum of the number of entities needs to be less than 100'),
objects: zod_1.z
.object({
open_user_ids: zod_1.z.array(zod_1.z.string()).describe('User open id').optional(),
open_department_ids: zod_1.z.array(zod_1.z.string()).describe('Department open id, 0 represents all members').optional(),
open_group_ids: zod_1.z.array(zod_1.z.string()).describe('Group open id').optional(),
})
.describe('The sum of the number of entities needs to be less than 100'),
}),
params: zod_1.z.object({ target_tenant_key: zod_1.z.string().describe("The other tenant's tenant key") }),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1CollaborationRuleDelete = {
project: 'directory',
name: 'directory.v1.collaborationRule.delete',
sdkName: 'directory.v1.collaborationRule.delete',
path: '/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id',
httpMethod: 'DELETE',
description: '[Feishu/Lark]-Trust Party-Collaboration rules-Delete the collaboration rules-Administrator delete collaboration rules. Users need to have trusted party administrator role',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z.object({ target_tenant_key: zod_1.z.string().describe("The other tenant's tenant key") }),
path: zod_1.z.object({ collaboration_rule_id: zod_1.z.string().describe('rule ID') }),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1CollaborationRuleList = {
project: 'directory',
name: 'directory.v1.collaborationRule.list',
sdkName: 'directory.v1.collaborationRule.list',
path: '/open-apis/directory/v1/collaboration_rules',
httpMethod: 'GET',
description: '[Feishu/Lark]-Trust Party-Collaboration rules-Query the collaboration rules-Administrator query collaboration rules. Users need to have trusted party administrator role',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z.object({
page_size: zod_1.z.number().describe('paging size').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(),
target_tenant_key: zod_1.z.string().describe("The other tenant's tenant key"),
}),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1CollaborationRuleUpdate = {
project: 'directory',
name: 'directory.v1.collaborationRule.update',
sdkName: 'directory.v1.collaborationRule.update',
path: '/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id',
httpMethod: 'PUT',
description: '[Feishu/Lark]-Trust Party-Collaboration rules-Modify the collaboration rules-Administrator updates the collaboration rules. Users need to have trusted party administrator role',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
subjects: zod_1.z
.object({
open_user_ids: zod_1.z.array(zod_1.z.string()).describe('User open id').optional(),
open_department_ids: zod_1.z.array(zod_1.z.string()).describe('Department open id, 0 represents all members').optional(),
open_group_ids: zod_1.z.array(zod_1.z.string()).describe('Group open id').optional(),
})
.describe('The sum of the number of entities needs to be less than 100'),
objects: zod_1.z
.object({
open_user_ids: zod_1.z.array(zod_1.z.string()).describe('User open id').optional(),
open_department_ids: zod_1.z.array(zod_1.z.string()).describe('Department open id, 0 represents all members').optional(),
open_group_ids: zod_1.z.array(zod_1.z.string()).describe('Group open id').optional(),
})
.describe('The sum of the number of entities needs to be less than 100'),
}),
params: zod_1.z.object({ target_tenant_key: zod_1.z.string().describe("The other tenant's tenant key") }),
path: zod_1.z.object({ collaboration_rule_id: zod_1.z.string().describe('rule ID') }),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1CollaborationTenantList = {
project: 'directory',
name: 'directory.v1.collaborationTenant.list',
sdkName: 'directory.v1.collaborationTenant.list',
path: '/open-apis/directory/v1/collaboration_tenants',
httpMethod: 'GET',
description: '[Feishu/Lark]-Trust Party-Collaboraiton Organization-Query the list of trusted parties by Admin-When creating a rule, you need to know the tenant key of the other tenant, and you can get a valid tenant key through this interface. Please use the trusted party administrator role to use this function',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z
.object({
page_size: zod_1.z.number().describe('paging size').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(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1CollborationShareEntityList = {
project: 'directory',
name: 'directory.v1.collborationShareEntity.list',
sdkName: 'directory.v1.collborationShareEntity.list',
path: '/open-apis/directory/v1/share_entities',
httpMethod: 'GET',
description: '[Feishu/Lark]-Trust Party-Collaboraiton Organization-Query the sharing members between the trust party relations-When creating a rule, you need to query the openIDs of this tenant and the other tenant entities, and these entities should be within the sharing scope of the trusted party. This interface can obtain the scope shared by the subject and object tenants of the trusted parties',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z.object({
target_tenant_key: zod_1.z
.string()
.describe('The tenant key of the other party. It can be obtained through [Query the list of trusted parties by Admin]'),
target_department_id: zod_1.z
.string()
.describe("If you don't fill in this parameter, it is the sharing range of the tenant. You can fill in this field and continue to drill down to view the sub-departments + members under the designated department. Filling in 0 is divided into two cases. If the tenant shares all employees, the first-level department will be displayed, otherwise the shared department + members will be displayed")
.optional(),
target_group_id: zod_1.z
.string()
.describe('Get the members of the user group, fill in the value and ignore target_department_id')
.optional(),
is_select_subject: zod_1.z
.boolean()
.describe('Whether the subject tenant shares the scope, the default is the sharing scope of the object 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').optional(),
}),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1DepartmentCreate = {
project: 'directory',
name: 'directory.v1.department.create',
sdkName: 'directory.v1.department.create',
path: '/open-apis/directory/v1/departments',
httpMethod: 'POST',
description: '[Feishu/Lark]-Organization-Department management-Create department-This interface is used to create a new department in the enterprise address book, supporting the setting of information such as department name, parent department, and department head.',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
department: zod_1.z
.object({
custom_department_id: zod_1.z
.string()
.describe('Identifies a unique department within the tenant, supports customization and is automatically generated by the system when not customized. id supports modification.Notes:1. in addition to the need to meet the regular rules, at the same time can not start with od-.2. Regular checksum: ^[a-zA-Z0-9][a-zA-Z0-9_\\-@.] {0,63}$')
.optional(),
name: zod_1.z
.object({
default_value: zod_1.z.string().describe('Default value'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalization value, key is zh_cn, ja_jp, en_us, and value is the corresponding value')
.optional(),
})
.describe('Department name, up to 100 characters')
.optional(),
parent_department_id: zod_1.z
.string()
.describe('Parent department ID, consistent with the department_id_type type. if the parent department is the root department, the value of this parameter is "0"')
.optional(),
leaders: zod_1.z
.array(zod_1.z.object({
leader_type: zod_1.z
.number()
.describe('Department leader type Options:1(department_leader_type_directory_main main),2(department_leader_type_directory_deputy Vice)'),
leader_id: zod_1.z.string().describe('Department leader id, consistent with the employee_id_type type'),
}))
.describe('Department leader')
.optional(),
order_weight: zod_1.z
.string()
.describe('The sorting weight under the superior department, with the returned results sorted in descending order by order_weight')
.optional(),
enabled_status: zod_1.z.boolean().describe('Enabled status').optional(),
custom_field_values: zod_1.z
.array(zod_1.z.object({
field_type: zod_1.z
.enum(['1', '2', '3', '4', '9', '10', '11'])
.describe('Custom field types Options:1(custom_field_value_type_text Text),2(custom_field_value_type_url URL),3(custom_field_value_type_enum Options),4(custom_field_value_type_generic_user Members),9(custom_field_value_type_phone ),10(custom_field_field_type_directory_multi_enum Multiple selection options),11(custom_field_field_type_directory_multi_generic_user Members list)')
.optional(),
text_value: zod_1.z
.object({
default_value: zod_1.z.string().describe('Default value'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalization value, key is zh_cn, ja_jp, en_us, and value is the corresponding value')
.optional(),
})
.describe('Text Field Values')
.optional(),
url_value: zod_1.z
.object({
link_text: zod_1.z
.object({
default_value: zod_1.z.string().describe('Default value'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalization value, key is zh_cn, ja_jp, en_us, and value is the corresponding value')
.optional(),
})
.describe('Link title'),
url: zod_1.z.string().describe('Mobile web link'),
pcurl: zod_1.z.string().describe('Desktop web link'),
})
.describe('Web Link Field Values')
.optional(),
enum_value: zod_1.z
.object({
enum_ids: zod_1.z.array(zod_1.z.string()).describe('Enum option id'),
enum_type: zod_1.z
.enum(['1', '2'])
.describe('Enum type Options:1(custom_field_value_enum_type_text Text),2(custom_field_value_enum_type_picture picture)'),
})
.describe('Enum field values')
.optional(),
user_values: zod_1.z
.array(zod_1.z.object({
ids: zod_1.z.array(zod_1.z.string()).describe('Employee IDs, consistent with the employee_id_type type'),
}))
.describe('User Field Values')
.optional(),
phone_value: zod_1.z.object({ phone_number: zod_1.z.string(), extension_number: zod_1.z.string().optional() }).optional(),
field_key: zod_1.z.string().describe('Custom field key').optional(),
}))
.describe('Departmental custom field values')
.optional(),
})
.describe('Create Department'),
}),
params: zod_1.z
.object({
employee_id_type: zod_1.z
.enum(['open_id', 'union_id', 'employee_id'])
.describe('User ID categories Options:open_id(Identifies the identity of a user in an application. The same user has different Open IDs in different applications. [Learn more: How to get an Open ID]),union_id(Identifies the identity of a user under an application developer. The Union ID of the same user in an application under the same developer is the same, and the Union ID in an application under different developers is different. With Union ID, application developers can associate the identity of the same user in multiple applications. [Learn more: How to get Union ID?]),employee_id(The unique identifier of an employee within the enterprise. Supports customization, the system automatically generates it if it is not customized. ID supports modification.How to get employee_id: - Enterprise administrators go to the Admin Console > Organizational Structure > Members and Departments page, click Member Details to query employee IDs - Through the interface of [Get employee list in batches], query employee ID by mobile phone number or email.)')
.optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID used in this call Options:department_id(Used to identify a unique department within a tenant),open_department_id(Used to identify a department in a specific application, where the open_department_id is different for the same department in different applications.)')
.optional(),
})
.optional(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1DepartmentDelete = {
project: 'directory',
name: 'directory.v1.department.delete',
sdkName: 'directory.v1.department.delete',
path: '/open-apis/directory/v1/departments/:department_id',
httpMethod: 'DELETE',
description: '[Feishu/Lark]-Organization-Department management-Delete department-This interface is used to delete departments',
accessTokens: ['tenant', 'user'],
schema: {
params: zod_1.z
.object({
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID used in this call Options:department_id(Used to identify a unique department within a tenant),open_department_id(It is used to identify a department in a specific application, and the same department has different open_department_id in different applications.)')
.optional(),
})
.optional(),
path: zod_1.z.object({
department_id: zod_1.z.string().describe('Department ID, consistent with the department_id_type type'),
}),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1DepartmentFilter = {
project: 'directory',
name: 'directory.v1.department.filter',
sdkName: 'directory.v1.department.filter',
path: '/open-apis/directory/v1/departments/filter',
httpMethod: 'POST',
description: '[Feishu/Lark]-Organization-Department management-List department-This interface is used to obtain the list of eligible department details in batches according to the specified conditions',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
filter: zod_1.z
.object({
conditions: zod_1.z
.array(zod_1.z.object({
field: zod_1.z
.string()
.describe('The lvalue of the filter criterion, which is the parameter name of the field.** Optional filters are: **- parent_department_id'),
operator: zod_1.z
.string()
.describe('Comparison operator** Optional values are: **- eq: equal to, supports any type of lvalue- in: belongs to any one, does not support parent_department_id, rvalue is an array of multiple target filter values (no more than 100)'),
value: zod_1.z
.string()
.describe('The right value of the filter condition, whose content is the corresponding value type under the combination of the left value field type and the operator. Its value type must be consistent with the value of the query parameter department_id_type, with a maximum length of 64 characters, and supports numbers and letters. When using the parent_department_id condition, the ID of the root department can be "0"'),
}))
.describe('List of comparison expressions. Relationships between multiple expressions default to "and"'),
})
.describe('Query Conditions [Learn more: Query Conditions Usage]'),
required_fields: zod_1.z
.array(zod_1.z.string())
.describe('List of fields to query. Permissioned row and column data will be returned according to the passed field list. If not passed, no fields will be returned [Learn more: Field enumeration instructions]'),
page_request: zod_1.z
.object({
page_size: zod_1.z
.number()
.describe('Maximum number of entries returned per page, maximum value is 100**Default value**:20**Minimum Value**: 0')
.optional(),
page_token: zod_1.z
.string()
.describe('Sequential paging query, can not skip page query, support deep paging, in the need to traverse all the data scene can only use this method. The first pass empty string or not, later pass the last return value in the page_token')
.optional(),
})
.describe('paging information'),
}),
params: zod_1.z
.object({
employee_id_type: zod_1.z
.enum(['open_id', 'union_id', 'employee_id'])
.describe("User ID categories Options:open_id(Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID]),union_id(Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID]),employee_id(The unique identifier of an employee within the enterprise. Supports customization, the system automatically generates it if it is not customized. ID supports modification.How to get employee_id: - Enterprise administrators go to the Admin Console > Organizational Structure > Members and Departments page, click Member Details to query employee IDs - Through the interface of [Get employee list in batches], query employee ID by mobile phone number or email.)")
.optional(),
department_id_type: zod_1.z
.enum(['open_department_id', 'department_id'])
.describe('The type of department ID used in this call Options:open_department_id(Used to identify a department in a specific application, the same department, the same open_department_id in different applications.),department_id(Used to identify a unique department within a tenant)')
.optional(),
})
.optional(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1DepartmentMget = {
project: 'directory',
name: 'directory.v1.department.mget',
sdkName: 'directory.v1.department.mget',
path: '/open-apis/directory/v1/departments/mget',
httpMethod: 'POST',
description: '[Feishu/Lark]-Organization-Department management-Batch get department info-This interface supports passing in multiple department IDs and returns detailed information for each department (such as name, person in charge, sub-departments, etc.).',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
department_ids: zod_1.z
.array(zod_1.z.string())
.describe('Department ID, consistent with the department_id_type. The way to get the ID: you can query it through the management background'),
required_fields: zod_1.z
.array(zod_1.z.string())
.describe('List of fields to query. Permissioned row and column data will be returned according to the passed field list. If not passed, no fields will be returned [Learn more: Field enumeration instructions]'),
}),
params: zod_1.z
.object({
employee_id_type: zod_1.z
.enum(['open_id', 'union_id', 'employee_id'])
.describe("User ID categories Options:open_id(Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID]),union_id(Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID]),employee_id(The unique identifier of an employee within the enterprise. Supports customization, the system automatically generates it if it is not customized. ID supports modification.How to get employee_id: - Enterprise administrators go to the Admin Console > Organizational Structure > Members and Departments page, click Member Details to query employee IDs - Through the interface of [Get employee list in batches], query employee ID by mobile phone number or email.)")
.optional(),
department_id_type: zod_1.z
.enum(['department_id', 'open_department_id'])
.describe('The type of department ID used in this call Options:department_id(Used to identify a unique department within a tenant),open_department_id(Used to identify a department in a specific application, the same department, the same open_department_id in different applications.)')
.optional(),
})
.optional(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1DepartmentPatch = {
project: 'directory',
name: 'directory.v1.department.patch',
sdkName: 'directory.v1.department.patch',
path: '/open-apis/directory/v1/departments/:department_id',
httpMethod: 'PATCH',
description: '[Feishu/Lark]-Organization-Department management-Update department-This interface is used to update department information. Only the parts param that are explicitly passed are updated',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
department: zod_1.z
.object({
custom_department_id: zod_1.z
.string()
.describe('Customize the department ID. Note:1. Except for the need to meet the regular rules, it cannot start with od- at the same time2. Regular check: ^ [a-zA-Z0-9] [a-zA-Z0-9 _\\-@.]{ 0,63} $**Data Validation Rules**:Length range: 1-64 characters')
.optional(),
name: zod_1.z
.object({
default_value: zod_1.z.string().describe('default value'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalized value, key is zh_cn, ja_jp, en_us, value is the corresponding value')
.optional(),
})
.describe('Department name')
.optional(),
parent_department_id: zod_1.z
.string()
.describe('Parent Department ID, consistent with the department_id_type type')
.optional(),
leaders: zod_1.z
.array(zod_1.z.object({
leader_type: zod_1.z
.number()
.describe('Type of department head Options:1(department_leader_type_directory_main main),2(department_leader_type_directory_deputy vice)'),
leader_id: zod_1.z.string().describe('Department head ID, consistent with the employee_id_type type'),
}))
.describe('department head')
.optional(),
order_weight: zod_1.z
.string()
.describe('The sorting weight under the superior department, and the returned results will be sorted in ascending order according to the value of order_weight.')
.optional(),
enabled_status: zod_1.z.boolean().describe('Whether to enable').optional(),
custom_field_values: zod_1.z
.array(zod_1.z.object({
field_key: zod_1.z.string().describe('Custom field key').optional(),
field_type: zod_1.z
.enum(['1', '2', '3', '4', '10', '11'])
.describe('custom field type Options:1(custom_field_value_type_text Text),2(custom_field_value_type_url URL),3(custom_field_value_type_enum Options),4(custom_field_value_type_generic_user Members),10(custom_field_field_type_directory_multi_enum Multiple selection options),11(custom_field_field_type_directory_multi_generic_user Members list)')
.optional(),
text_value: zod_1.z
.object({
default_value: zod_1.z.string().describe('default value'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalized value, key is zh_cn, ja_jp, en_us, value is the corresponding value')
.optional(),
})
.describe('Text field value')
.optional(),
url_value: zod_1.z
.object({
link_text: zod_1.z
.object({
default_value: zod_1.z.string().describe('default value'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalized value, key is zh_cn, ja_jp, en_us, value is the corresponding value')
.optional(),
})
.describe('page title'),
url: zod_1.z.string().describe('Mobile end web link'),
pcurl: zod_1.z.string().describe('Desktop web link'),
})
.describe('Web link field value')
.optional(),
enum_value: zod_1.z
.object({
enum_ids: zod_1.z.array(zod_1.z.string()).describe('Option result ID'),
enum_type: zod_1.z
.enum(['1', '2'])
.describe('option type Options:1(custom_field_value_enum_type_text Text),2(custom_field_value_enum_type_picture picture)'),
})
.describe('Enumerate field values')
.optional(),
user_values: zod_1.z
.array(zod_1.z.object({
ids: zod_1.z.array(zod_1.z.string()).describe('Person ID,consistent with the employee_id_type type'),
user_type: zod_1.z
.literal('1')
.describe('Personnel Type Options:1(custom_field_value_user_type_employee employees)'),
}))
.describe('Person field value')
.optional(),
}))
.describe('Department custom field values')
.optional(),
})
.describe('Update department information'),
}),
params: zod_1.z
.object({
employee_id_type: zod_1.z
.enum(['open_id', 'union_id', 'employee_id'])
.describe("User ID categories Options:open_id(Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID]),union_id(Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID]),employee_id(The unique identifier of an employee within the enterprise. Supports customization, the system automatically generates it if it is not customized. ID supports modification.How to get employee_id: - Enterprise administrators go to the Admin Console > Organizational Structure > Members and Departments page, click Member Details to query employee IDs - Through the interface of [Get employee list in batches], query employee ID by mobile phone number or email.)")
.optional(),
department_id_type: zod_1.z
.enum(['open_department_id', 'department_id'])
.describe('The type of department ID used in this call Options:open_department_id(It is used to identify a department in a specific application, and the same department has different open_department_id in different applications.),department_id(Used to identify a unique department within a tenant)')
.optional(),
})
.optional(),
path: zod_1.z.object({
department_id: zod_1.z.string().describe('Department ID, consistent with the department_id_type type'),
}),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1DepartmentSearch = {
project: 'directory',
name: 'directory.v1.department.search',
sdkName: 'directory.v1.department.search',
path: '/open-apis/directory/v1/departments/search',
httpMethod: 'POST',
description: '[Feishu/Lark]-Organization-Department management-Search department-This interface is used to search for department information, search for department information through keywords such as department names, and return a list of departments that meet the criteria.',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
query: zod_1.z
.string()
.describe('Search for keywords. Supports searching by department name, with a maximum input of 100 characters.'),
page_request: zod_1.z
.object({
page_size: zod_1.z
.number()
.describe('Maximum number of entries returned per page, maximum value is 100**Default value**:20**Minimum Value**: 0')
.optional(),
page_token: zod_1.z
.string()
.describe('Sequential paging query, can not skip page query, support deep paging, in the need to traverse all the data scene can only use this method. The first pass empty string or not, later pass the last return value in the page_token')
.optional(),
})
.describe('paging information'),
required_fields: zod_1.z
.array(zod_1.z.string())
.describe('List of fields to be queried. Permissioned row and column data will be returned according to the passed field list. If not passed, no fields will be returned[Learn more: Field enumeration instructions]'),
}),
params: zod_1.z
.object({
employee_id_type: zod_1.z
.enum(['open_id', 'union_id', 'employee_id'])
.describe("User ID categories Options:open_id(Identifies a user to an app. The same user has different Open IDs in different apps. [How to get Open ID]),union_id(Identifies a user to a tenant that acts as a developer. A user has the same Union ID in apps developed by the same developer, and has different Union IDs in apps developed by different developers. A developer can use Union ID to link the same user's identities in multiple apps.[How to get Union ID]),employee_id(The unique identifier of an employee within the enterprise. Supports customization, the system automatically generates it if it is not customized. ID supports modification.How to get employee_id: - Enterprise administrators go to the Admin Console > Organizational Structure > Members and Departments page, click Member Details to query employee IDs - Through the interface of [Get employee list in batches], query employee ID by mobile phone number or email.)")
.optional(),
department_id_type: zod_1.z
.enum(['open_department_id', 'department_id'])
.describe('The type of department ID used in this call Options:open_department_id(It is used to identify a department in a specific application, and the same department has different open_department_id in different applications.),department_id(Used to identify a unique department within a tenant)')
.optional(),
})
.optional(),
useUAT: zod_1.z.boolean().describe('Use user access token, otherwise use tenant access token').optional(),
},
};
exports.directoryV1EmployeeCreate = {
project: 'directory',
name: 'directory.v1.employee.create',
sdkName: 'directory.v1.employee.create',
path: '/open-apis/directory/v1/employees',
httpMethod: 'POST',
description: '[Feishu/Lark]-Organization-Employee management-Create employee-This API is used to create an employee under the enterprise. It supports passing in information such as name and mobile phone number to generate an employee object in the active state. Employees refer to members with the identity of "Employee" in the Feishu enterprise, which is equivalent to the "User" in the address book OpenAPI.',
accessTokens: ['tenant', 'user'],
schema: {
data: zod_1.z.object({
employee: zod_1.z
.object({
name: zod_1.z
.object({
name: zod_1.z
.object({
default_value: zod_1.z.string().describe('default valueMinimum length: 1 character'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalized value, key is zh_cn, ja_jp, en_us, value is the corresponding value')
.optional(),
})
.describe('The name of the employee, up to 64 characters can be entered'),
another_name: zod_1.z.string().describe('Alias, up to 64 characters').optional(),
})
.describe('name')
.optional(),
mobile: zod_1.z
.string()
.describe("Employee's mobile phone number, enter up to 255 characters. Note:1. It cannot be repeated among current employees within the enterprise.2. Uncertified enterprises only support adding Chinese mainland mobile phone numbers, and enterprises certified by Feishu are allowed to add overseas mobile phone numbers.3. The plus sign + must be included in the international area code prefix")
.optional(),
custom_employee_id: zod_1.z
.string()
.describe('Unique identification of active employees in the enterprise. Customization is supported, and the system automatically generates it when not customized. ID supports modification. Note:1. The ID of current employees cannot be repeated2. ID cannot contain spaces')
.optional(),
avatar_key: zod_1.z
.string()
.describe("Employee's avatar key. To get the key of the picture, please use [Upload Image - Server Level API - Development Documentation - Feishu open platform]. when uploading, you need to select for setting avatar as the picture type")
.optional(),
email: zod_1.z
.string()
.describe("The employee's email address at work. Note:1. It cannot be repeated among current employees within the enterprise.2. Non-Chinese mainland mobile phone number members must add email at the same time")
.optional(),
enterprise_email: zod_1.z
.string()
.describe("Employee's enterprise mailbox. Please make sure that the Feishu mailbox service has been enabled in the management background first. The domain name of the enterprise mailbox needs to be applied and opened by the enterprise in the management background. If the enterprise does not open the enterprise mailbox of the corresponding domain name, setting the user's enterprise mailbox will fail")
.optional(),
gender: zod_1.z
.number()
.describe('gender Options:0(gender_directory_unknown unknown),1(gender_directory_man male),2(gender_directory_woman female),3(gender_directory_other other)')
.optional(),
employee_order_in_departments: zod_1.z
.array(zod_1.z.object({
department_id: zod_1.z
.string()
.describe('Specify the department where the employee is located, identify a unique department within the enterprise, and keep it consistent with the department_id_type type.')
.optional(),
order_weight_in_deparment: zod_1.z
.string()
.describe('The ranking weight of employees within the department')
.optional(),
order_weight_among_deparments: zod_1.z
.string()
.describe('The ranking weight of this department among the multiple departments to which the user belongs')
.optional(),
is_main_department: zod_1.z
.boolean()
.describe("Whether it is the user's main department (a user can only have one main department, and the sorting weight should be the largest. If not filled in, the first department in the sorting will be used as the main department by default), optional values: true/false.")
.optional(),
}))
.describe('The ranking information of employees within their department')
.optional(),
leader_id: zod_1.z
.string()
.describe("The ID of the employee's line manager, consistent with the employee_id_type. Note: 1. There should be no circular reporting, i.e. A reports to B and B reports to A.2. The line manager must be an active employee")
.optional(),
dotted_line_leader_ids: zod_1.z
.array(zod_1.z.string())
.describe('The dotted-line manager ID of the employee, which is consistent with the employee_id_type. Note: 1. There should be no circular reporting, i.e. A reports to B and B reports to A.2. The line manager must be an active employee')
.optional(),
work_country_or_region: zod_1.z
.string()
.describe('Workplace country code. To obtain the country code, please use [Paging Bulk Query Country]')
.optional(),
work_place_id: zod_1.z.string().describe('Workplace ID').optional(),
work_station: zod_1.z
.object({
default_value: zod_1.z.string().describe('default value'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalized value, key is zh_cn, ja_jp, en_us, value is the corresponding value')
.optional(),
})
.describe('Workstation')
.optional(),
job_number: zod_1.z
.string()
.describe('Job number. The job number of employees in the enterprise cannot be repeated')
.optional(),
extension_number: zod_1.z
.string()
.describe('Extension number, up to 99 characters can be entered . The extension numbers of all employees in the enterprise cannot be repeated')
.optional(),
join_date: zod_1.z.string().describe('Onboard date').optional(),
employment_type: zod_1.z.number().describe('Employee type').optional(),
job_title_id: zod_1.z.string().describe('Job ID').optional(),
custom_field_values: zod_1.z
.array(zod_1.z.object({
field_type: zod_1.z
.enum(['1', '2', '3', '4', '9', '10', '11'])
.describe('Custom field type Options:1(custom_field_value_type_text Text),2(custom_field_value_type_url URL),3(custom_field_value_type_enum Options),4(custom_field_value_type_generic_user Members),9(custom_field_value_type_phone ),10(custom_field_field_type_directory_multi_enum Multiple selection options),11(custom_field_field_type_directory_multi_generic_user Members list)')
.optional(),
text_value: zod_1.z
.object({
default_value: zod_1.z.string().describe('defaultMinimum length: 1 character'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalized value, key is zh_cn, ja_jp, en_us, value is the corresponding value')
.optional(),
})
.describe('Text field value')
.optional(),
url_value: zod_1.z
.object({
link_text: zod_1.z.object({
default_value: zod_1.z.string().describe('default valueLength range: 1-40 characters'),
i18n_value: zod_1.z
.object({})
.catchall(zod_1.z.any())
.describe('Internationalized value, key is zh_cn, ja_jp, en_us, value is the corresponding value')
.optional(),
}),
url: zod_1.z.string(),
pcurl: zod_1.z.string(),
})
.optional(),
enum_value: zod_1.z
.object({
enum_ids: zod_1.z.array(zod_1.z.string()).describe('link title'),
enum_type: zod_1.z
.enum(['1', '2'])
.describe('mobile web link Options:1(custom_field_value_enum_type_text text),2(custom_field_value_enum_type_picture image)'),
})
.describe('Url field value')
.optional(),
user_values: zod_1.z
.array(zod_1.z.object({
ids: zod_1.z.array(zod_1.z.string()).describe('employee id,consistent with the employee_id_type type.'),
}))
.describe('enum field value')