UNPKG

@luka-cat-mimi/n8n-nodes-feishu-project

Version:
76 lines 3.37 kB
"use strict"; 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 sharedOptions_1 = require("../../../help/utils/sharedOptions"); const description_1 = require("../../../help/description"); const WorkItemConfigRelationUpdateOperate = { name: '更新工作项关系', value: 'work_item_config:relation_update', description: '该接口用于更新指定工作项关系的配置信息,对应的平台功能介绍详见<a href="https://project.feishu.cn/b/helpcenter/1ykiuvvj/se3xal6e">关系管理</a>', order: 80, options: [ description_1.DESCRIPTIONS.PROJECT_KEY, { displayName: '工作项类型 Name or ID', name: 'work_item_type_key', type: 'options', default: '', required: true, description: '空间下工作项类型,需要先选择空间,详见:<a href="https://project.feishu.cn/b/helpcenter/2.0.0/1p8d7djs/3pjp854w">获取空间下工作项类型</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.', typeOptions: { loadOptionsMethod: 'loadWorkItemTypes', }, }, { displayName: '关系ID', name: 'relation_id', type: 'string', default: '', required: true, description: '工作项关系的唯一标识ID', }, { displayName: '请求体参数', name: 'body', type: 'json', default: JSON.stringify({ "name": "", "relation_details": [ { "work_item_type_key": "", "work_item_type_name": "", "project_key": "", "project_name": "" } ] }, null, 2), description: '完整的请求体参数,JSON格式', }, sharedOptions_1.commonOptions, ], async call(index) { const project_key = this.getNodeParameter('project_key', index, '', { extractValue: true, }); const work_item_type_key = this.getNodeParameter('work_item_type_key', index); const relation_id = this.getNodeParameter('relation_id', index); const bodyParam = this.getNodeParameter('body', index); const body = NodeUtils_1.default.parseJsonParameter(bodyParam, '请求体参数'); const options = this.getNodeParameter('options', index, {}); body.project_key = project_key; body.work_item_type_key = work_item_type_key; body.relation_id = relation_id; return RequestUtils_1.default.request.call(this, { method: 'POST', url: `/open_api/work_item/relation/update`, body: body, timeout: options.timeout, }); } }; exports.default = WorkItemConfigRelationUpdateOperate; //# sourceMappingURL=WorkItemConfigRelationUpdateOperate.js.map