n8n-nodes-feishu-lark
Version:
n8n custom nodes for n8n to interact with Feishu/Lark, including Lark Bot, Lark MCP, and Lark Trigger.
69 lines • 2.38 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_1 = __importDefault(require("../../../help/utils/node"));
const RequestUtils_1 = __importDefault(require("../../../help/utils/RequestUtils"));
exports.default = {
name: 'Create Task | 创建任务',
value: 'create',
order: 100,
options: [
{
displayName: 'Task Title(任务标题)',
name: 'summary',
type: 'string',
required: true,
default: '',
},
{
displayName: 'Task Description(任务摘要)',
name: 'description',
type: 'string',
default: '',
},
{
displayName: 'User ID Type(用户 ID 类型)',
name: 'user_id_type',
type: 'options',
options: [
{ name: 'Open ID', value: 'open_id' },
{ name: 'Union ID', value: 'union_id' },
{ name: 'User ID', value: 'user_id' },
],
default: 'open_id',
},
{
displayName: 'Request Body(请求体)',
name: 'body',
type: 'json',
required: true,
default: '{}',
description: 'Https://open.feishu.cn/document/task-v2/task/create#requestBody',
},
],
async call(index) {
const summary = this.getNodeParameter('summary', index);
const description = this.getNodeParameter('description', index);
const user_id_type = this.getNodeParameter('user_id_type', index);
const extObject = node_1.default.getNodeJsonData(this, 'body', index);
const { code, msg, data: { task }, } = await RequestUtils_1.default.request.call(this, {
method: 'POST',
url: `/open-apis/task/v2/tasks`,
qs: {
user_id_type: user_id_type,
},
body: {
summary,
description,
...extObject,
},
});
if (code !== 0) {
throw new Error(`Create task failed, code: ${code}, message: ${msg}`);
}
return task;
},
};
//# sourceMappingURL=Create.operation.js.map