n8n-nodes-feishu-fork
Version:
n8n custom nodes for n8n to interact with Feishu/Lark, including Lark Bot, Lark MCP, and Lark Trigger.
69 lines • 2.7 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.BatchGetUserInfo,
value: "batchGetUserInfo",
options: [
{
...description_1.DESCRIPTIONS.REQUEST_BODY,
displayName: wording_1.WORDING.Emails,
required: false,
name: 'emails',
default: '[]',
description: 'Up to 50 user emails can be input to be queried',
},
{
...description_1.DESCRIPTIONS.REQUEST_BODY,
displayName: wording_1.WORDING.PhoneNumbers,
required: false,
name: 'mobiles',
default: '[]',
description: 'Up to 50 user mobile numbers can be input to be queried',
},
{
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.INCLUDE_RESIGNED],
},
{
displayName: `<a target="_blank" href="https://open.feishu.cn/document/server-docs/contact-v3/user/batch_get_id">${wording_1.WORDING.OpenDocument}</a>`,
name: 'notice',
type: 'notice',
default: '',
},
],
async call(index) {
const emails = this.getNodeParameter('emails', index, [], {
ensureType: 'json',
});
const mobiles = this.getNodeParameter('mobiles', index, [], {
ensureType: 'json',
});
const options = this.getNodeParameter('options', index, {});
const user_id_type = options.user_id_type || 'open_id';
const include_resigned = options.include_resigned || false;
const { data: { user_list }, } = await RequestUtils_1.default.request.call(this, {
method: 'POST',
url: '/open-apis/contact/v3/users/batch_get_id',
qs: {
user_id_type,
},
body: {
emails: emails.length ? emails : undefined,
mobiles: mobiles.length ? mobiles : undefined,
include_resigned,
},
});
return user_list;
},
};
//# sourceMappingURL=UserBatchGetInfo.operation.js.map