@luka-cat-mimi/n8n-nodes-feishu-project
Version:
飞书项目 N8N 集成插件,支持附件管理等功能
50 lines • 1.92 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 CommentDeleteOperate = {
name: '删除评论',
value: 'comment:delete',
description: '只有创建评论的人才能删除评论,且删除评论只能通过 API 操作。',
order: 40,
options: [
description_1.DESCRIPTIONS.PROJECT_KEY,
{
displayName: '评论ID',
name: 'comment_id',
type: 'string',
required: true,
default: '',
description: '评论 ID,可通过查询评论或创建评论接口获取',
},
sharedOptions_1.commonOptions,
],
async call(index) {
const project_key = this.getNodeParameter('project_key', index, '', {
extractValue: true,
});
const comment_id = this.getNodeParameter('comment_id', index);
const options = this.getNodeParameter('options', index, {});
if (!comment_id) {
throw new Error('评论 ID 不能为空');
}
const response = await RequestUtils_1.default.request.call(this, {
method: 'POST',
url: '/open_api/comment/delete',
body: {
project_key,
comment_id,
},
timeout: options.timeout,
});
return {
comment_id: (response === null || response === void 0 ? void 0 : response.comment_id) || comment_id,
};
},
};
exports.default = CommentDeleteOperate;
//# sourceMappingURL=CommentDeleteOperate.js.map