@luka-cat-mimi/n8n-nodes-feishu-project
Version:
飞书项目 N8N 集成插件,支持附件管理等功能
66 lines • 2.81 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 sharedOptions_1 = require("../../../help/utils/sharedOptions");
const description_1 = require("../../../help/description");
const WorkflowConfigTemplateCreateOperate = {
name: '新增流程模板',
value: 'workflow_config:template_create',
order: 30,
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: '模板名称',
name: 'template_name',
type: 'string',
default: '',
required: true,
description: '流程模板名称',
},
{
displayName: '复制模板ID',
name: 'copy_template_id',
type: 'string',
default: '0',
description: '复制的模板ID,如果提供此参数,将基于该模板创建新模板。默认为0表示不复制',
},
sharedOptions_1.commonOptions,
],
async call(index) {
const projectKey = this.getNodeParameter('project_key', index, '', {
extractValue: true,
});
const workItemTypeKey = this.getNodeParameter('work_item_type_key', index);
const templateName = this.getNodeParameter('template_name', index);
const copyTemplateId = this.getNodeParameter('copy_template_id', index);
const options = this.getNodeParameter('options', index, {});
const body = {
project_key: projectKey,
work_item_type_key: workItemTypeKey,
template_name: templateName,
copy_template_id: Number(copyTemplateId),
};
return RequestUtils_1.default.request.call(this, {
method: 'POST',
url: `/open_api/template/v2/create_template`,
body: body,
timeout: options.timeout,
});
}
};
exports.default = WorkflowConfigTemplateCreateOperate;
//# sourceMappingURL=WorkflowConfigTemplateCreateOperate.js.map