UNPKG

n8n-nodes-feishu-fork

Version:

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

71 lines 3.35 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"); exports.default = { name: wording_1.WORDING.CalendarEventAttendeeCreate, value: "createEventAttendee", order: 80, options: [ description_1.DESCRIPTIONS.CALENDAR_ID, description_1.DESCRIPTIONS.CALENDAR_EVENT_ID, description_1.DESCRIPTIONS.CALENDAR_EVENT_ATTENDEES, { 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.NEED_NOTIFICATION, description_1.DESCRIPTIONS.INSTANCE_START_TIME_ADMIN, description_1.DESCRIPTIONS.IS_ENABLE_ADMIN, description_1.DESCRIPTIONS.ADD_OPERATOR_TO_ATTENDEE, ], }, { displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/calendar-v4/calendar-event-attendee/create">${wording_1.WORDING.OpenDocument}</a>`, name: 'notice', type: 'notice', default: '', }, ], async call(index) { const calendarId = this.getNodeParameter('calendar_id', index, undefined, { extractValue: true, }); const eventId = this.getNodeParameter('event_id', index, undefined, { extractValue: true, }); const attendees = this.getNodeParameter('attendees', index, undefined, { ensureType: 'json', }); const options = this.getNodeParameter('options', index, {}); const userIdType = options.user_id_type || 'open_id'; const needNotification = options.need_notification !== false; const instanceStartTimeAdmin = options.instance_start_time_admin; const isEnableAdmin = options.is_enable_admin; const addOperatorToAttendee = options.add_operator_to_attendee; const { data: { attendees: results }, } = await RequestUtils_1.default.request.call(this, { method: 'POST', url: `/open-apis/calendar/v4/calendars/${calendarId}/events/${eventId}/attendees`, qs: { ...(userIdType && { user_id_type: userIdType }), }, body: { ...((attendees === null || attendees === void 0 ? void 0 : attendees.length) > 0 && { attendees }), ...(needNotification !== undefined && { need_notification: needNotification }), ...(instanceStartTimeAdmin && { instance_start_time_admin: instanceStartTimeAdmin }), ...(isEnableAdmin !== undefined && { is_enable_admin: isEnableAdmin }), ...(addOperatorToAttendee !== undefined && { add_operator_to_attendee: addOperatorToAttendee }), }, }); return results || []; }, }; //# sourceMappingURL=EventAttendeeCreate.operation.js.map