UNPKG

n8n-nodes-feishu-fork

Version:

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

54 lines 2.36 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 utils_1 = require("../../../help/utils"); exports.default = { name: wording_1.WORDING.CreateCalendar, value: "create", order: 200, options: [ description_1.DESCRIPTIONS.CALENDAR_TITLE, description_1.DESCRIPTIONS.CALENDAR_DESCRIPTION, description_1.DESCRIPTIONS.CALENDAR_PERMISSIONS, { displayName: wording_1.WORDING.Options, name: 'options', type: 'collection', placeholder: wording_1.WORDING.AddField, default: {}, options: [description_1.DESCRIPTIONS.CALENDAR_SUMMARY_ALIAS, description_1.DESCRIPTIONS.CALENDAR_COLOR], }, { displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/calendar-v4/calendar/create">${wording_1.WORDING.OpenDocument}</a>`, name: 'notice', type: 'notice', default: '', }, ], async call(index) { const summary = this.getNodeParameter('summary', index, ''); const description = this.getNodeParameter('description', index, ''); const permissions = this.getNodeParameter('permissions', index, 'show_only_free_busy'); const options = this.getNodeParameter('options', index, {}); const summary_alias = options.summary_alias || ''; const color = options.color || ''; const { data: { calendar }, } = await RequestUtils_1.default.request.call(this, { method: 'POST', url: '/open-apis/calendar/v4/calendars', body: { ...(summary && { summary }), ...(description && { description }), ...(permissions && { permissions }), ...(color && { color: (0, utils_1.hexToRgbInt32)(color) }), ...(summary_alias && { summary_alias }), }, }); return calendar; }, }; //# sourceMappingURL=Create.operation.js.map