n8n-nodes-feishu-lark
Version:
n8n custom nodes for n8n to interact with Feishu/Lark, including Lark Bot, Lark MCP, and Lark Trigger.
50 lines • 2.06 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 wording_1 = require("../../../help/wording");
const description_1 = require("../../../help/description");
exports.default = {
name: wording_1.WORDING.GetDocumentBlock,
value: "getBlock",
order: 193,
options: [
description_1.DESCRIPTIONS.DOCUMENT_ID,
description_1.DESCRIPTIONS.DOCUMENT_BLOCK_ID,
{
displayName: wording_1.WORDING.Options,
name: 'options',
type: 'collection',
placeholder: wording_1.WORDING.AddField,
default: {},
options: [description_1.DESCRIPTIONS.USER_ID_TYPE, description_1.DESCRIPTIONS.DOCUMENT_REVISION_ID],
},
{
displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document-block/get">${wording_1.WORDING.OpenDocument}</a>`,
name: 'notice',
type: 'notice',
default: '',
},
],
async call(index) {
const document_id = this.getNodeParameter('document_id', index, undefined, {
extractValue: true,
});
const block_id = this.getNodeParameter('block_id', index);
const options = this.getNodeParameter('options', index, {});
const document_revision_id = options.document_revision_id || -1;
const user_id_type = options.user_id_type || 'open_id';
const { data: { block }, } = await RequestUtils_1.default.request.call(this, {
method: 'GET',
url: `/open-apis/docx/v1/documents/${document_id}/blocks/${block_id}`,
qs: {
document_revision_id,
user_id_type,
},
});
return block;
},
};
//# sourceMappingURL=BlockGet.operation.js.map