UNPKG

n8n-nodes-feishu-lark

Version:

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

75 lines 3.52 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const n8n_workflow_1 = require("n8n-workflow"); 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")); const validation_1 = require("../../../help/utils/validation"); exports.default = { name: wording_1.WORDING.CalendarEventAttendeeDelete, value: "deleteEventAttendee", order: 80, options: [ description_1.DESCRIPTIONS.CALENDAR_ID, description_1.DESCRIPTIONS.CALENDAR_EVENT_ID, description_1.DESCRIPTIONS.CALENDAR_EVENT_ATTENDEE_IDS, { 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.CALENDAR_EVENT_DELETE_IDS, ], }, { displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/calendar-v4/calendar-event-attendee/batch_delete">${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('calendar_event_id', index, undefined, { extractValue: true, }); const attendeeIds = node_1.default.getArrayData(this, 'attendee_ids', index, validation_1.isString); const options = this.getNodeParameter('options', index, {}); const userIdType = options.user_id_type || 'open_id'; const needNotification = options.need_notification; const instanceStartTimeAdmin = options.instance_start_time_admin; const isEnableAdmin = options.is_enable_admin; let deleteIds = options.delete_ids; if (deleteIds) { deleteIds = typeof deleteIds === 'string' ? (0, n8n_workflow_1.jsonParse)(deleteIds) : deleteIds; } await RequestUtils_1.default.request.call(this, { method: 'POST', url: `/open-apis/calendar/v4/calendars/${calendarId}/events/${eventId}/attendees/batch_delete`, qs: { ...(userIdType && { user_id_type: userIdType }), }, body: { attendee_ids: attendeeIds, ...(needNotification && { need_notification: needNotification }), ...(instanceStartTimeAdmin && { instance_start_time_admin: instanceStartTimeAdmin }), ...(isEnableAdmin && { is_enable_admin: isEnableAdmin }), ...((deleteIds === null || deleteIds === void 0 ? void 0 : deleteIds.length) && { delete_ids: deleteIds }), }, }); return {}; }, }; //# sourceMappingURL=EventAttendeeDelete.operation.js.map