UNPKG

n8n-nodes-feishu-lark

Version:

n8n custom nodes for n8n to interact with Feishu/Lark, including Lark Bot, Lark MCP, and Lark Trigger.

60 lines 2.5 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 wording_1 = require("../../../help/wording"); const description_1 = require("../../../help/description"); const node_1 = __importDefault(require("../../../help/utils/node")); exports.default = { name: wording_1.WORDING.CreateDocumentBlock, value: "createBlock", order: 196, options: [ description_1.DESCRIPTIONS.DOCUMENT_ID, description_1.DESCRIPTIONS.DOCUMENT_BLOCK_ID, description_1.DESCRIPTIONS.REQUEST_BODY, { 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, description_1.DESCRIPTIONS.REQUEST_ID, ], }, { displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document-block/create">${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, document_id); const body = node_1.default.getObjectData(this, 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 request_id = options.request_id || undefined; const { data } = await RequestUtils_1.default.request.call(this, { method: 'POST', url: `/open-apis/docx/v1/documents/${document_id}/blocks/${block_id}/children`, qs: { document_revision_id, user_id_type, ...(request_id && { client_token: request_id }), }, body, }); return data; }, }; //# sourceMappingURL=BlockCreate.operation.js.map