n8n-nodes-feishu-lark
Version:
n8n custom nodes for n8n to interact with Feishu/Lark, including Lark Bot, Lark MCP, and Lark Trigger.
78 lines • 3.55 kB
JavaScript
;
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.ValuesRead,
value: "readValues",
order: 127,
options: [
description_1.DESCRIPTIONS.SPREADSHEET_ID,
description_1.DESCRIPTIONS.SHEET_ID,
description_1.DESCRIPTIONS.CELL_RANGE,
{
displayName: wording_1.WORDING.Options,
name: 'options',
type: 'collection',
placeholder: wording_1.WORDING.AddField,
default: {},
options: [
{
displayName: 'Value Render Option(值渲染选项)',
name: 'valueRenderOption',
type: 'options',
options: [
{ name: 'To String(返回纯文本值)', value: 'ToString' },
{ name: 'Formula(返回公式)', value: 'Formula' },
{ name: 'FormattedValue(计算并格式化单元格)', value: 'FormattedValue' },
{ name: 'UnformattedValue(计算但不对单元格进行格式化)', value: 'UnformattedValue' },
],
default: 'ToString',
},
{
displayName: 'Date Time Render Option(日期时间渲染选项)',
name: 'dateTimeRenderOption',
type: 'options',
options: [{ name: 'FormattedString', value: 'FormattedString' }],
default: 'FormattedString',
description: 'Specifies the format of cell data that is of date, time, or date-time type',
},
description_1.DESCRIPTIONS.USER_ID_TYPE,
],
},
{
displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/docs/sheets-v3/data-operation/reading-a-single-range">${wording_1.WORDING.OpenDocument}</a>`,
name: 'notice',
type: 'notice',
default: '',
},
],
async call(index) {
const spreadsheet_id = this.getNodeParameter('spreadsheet_id', index, undefined, {
extractValue: true,
});
const sheet_id = this.getNodeParameter('sheet_id', index, undefined, {
extractValue: true,
});
const cell_range = this.getNodeParameter('range', index, '');
const options = this.getNodeParameter('options', index);
const valueRenderOption = options.valueRenderOption || '';
const dateTimeRenderOption = options.dateTimeRenderOption || '';
const userIdType = options.userIdType || '';
const { data } = await RequestUtils_1.default.request.call(this, {
method: 'GET',
url: `/open-apis/sheets/v2/spreadsheets/${spreadsheet_id}/values/${sheet_id}${cell_range}`,
qs: {
...(valueRenderOption && { valueRenderOption }),
...(dateTimeRenderOption && { dateTimeRenderOption }),
...(userIdType && { user_id_type: userIdType }),
},
});
return data;
},
};
//# sourceMappingURL=ValuesRead.operation.js.map