@luka-cat-mimi/n8n-nodes-feishu-project
Version:
飞书项目 N8N 集成插件,支持附件管理等功能
68 lines • 2.6 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const RequestUtils_1 = __importDefault(require("../../../help/utils/RequestUtils"));
const NodeUtils_1 = __importDefault(require("../../../help/utils/NodeUtils"));
const WorkItemConfigFieldUpdateOperate = {
name: '更新自定义字段',
value: 'work_item_config:field_update',
options: [
{
displayName: '项目Key',
name: 'project_key',
type: 'string',
required: true,
default: '',
description: '项目的唯一标识Key',
},
{
displayName: '工作项类型Key',
name: 'work_item_type_key',
type: 'string',
required: true,
default: '',
description: '工作项类型的唯一标识Key',
},
{
displayName: '请求体参数',
name: 'body',
type: 'json',
default: JSON.stringify({
"field_name": "",
"field_key": "",
"field_value": "",
"free_add": 0,
"work_item_relation_uuid": "",
"default_value": "",
"field_alias": "",
"help_description": "",
"authorized_roles": [""],
"related_field_extra_display_infos": [
{
"project_key": "",
"work_item_type_key": "",
"display_field_keys": [""],
"display_role_keys": [""],
"display_controls": [""]
}
]
}, null, 2),
description: '完整的请求体参数,JSON格式',
},
],
async call(index) {
const project_key = this.getNodeParameter('project_key', index);
const work_item_type_key = this.getNodeParameter('work_item_type_key', index);
const bodyParam = this.getNodeParameter('body', index);
const body = NodeUtils_1.default.parseJsonParameter(bodyParam, '请求体参数');
return RequestUtils_1.default.request.call(this, {
method: 'PUT',
url: `/open_api/${project_key}/field/${work_item_type_key}`,
body: body,
});
}
};
exports.default = WorkItemConfigFieldUpdateOperate;
//# sourceMappingURL=WorkItemConfigFieldUpdateOperate.js.map