UNPKG

n8n-nodes-feishu-lark

Version:

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

76 lines 2.91 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 base_1 = require("../../../help/description/base"); const node_1 = __importDefault(require("../../../help/utils/node")); exports.default = { name: wording_1.WORDING.SendLimitedCard, value: "sendLimitedCard", order: 181, options: [ { displayName: `Only work with Tenant Access Token`, name: 'notice', type: 'notice', default: '', }, description_1.DESCRIPTIONS.CHAT_ID, { displayName: 'User ID Type(用户 ID 类型)', name: 'user_id_type', type: 'options', options: [ { name: 'Open ID', value: 'open_id' }, { name: 'User ID', value: 'user_id' }, { name: 'Email', value: 'email' }, ], default: 'open_id', }, { displayName: 'ID', name: 'id', type: 'string', required: true, default: '', }, { displayName: 'Message Card(消息卡片)', ...base_1.OBJECT_JSON, name: 'message_card', }, { displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/im-v1/message-card/send-message-cards-that-are-only-visible-to-certain-people">${wording_1.WORDING.OpenDocument}</a>`, name: 'notice', type: 'notice', default: '', }, ], async call(index) { const chat_id = this.getNodeParameter('chat_id', index); const user_id_type = this.getNodeParameter('user_id_type', index); const id = this.getNodeParameter('id', index, ''); const content = node_1.default.getObjectData(this, index, 'message_card'); const openId = user_id_type === 'open_id' ? id : undefined; const userId = user_id_type === 'user_id' ? id : undefined; const email = user_id_type === 'email' ? id : undefined; const { data } = await RequestUtils_1.default.request.call(this, { method: 'POST', url: `/open-apis/ephemeral/v1/send`, body: { chat_id, ...(openId && { open_id: openId }), ...(userId && { user_id: userId }), ...(email && { email }), msg_type: 'interactive', card: content, }, }); return data; }, }; //# sourceMappingURL=LimitedCardSend.operation.js.map