n8n-nodes-wechat-work
Version:
47 lines • 1.68 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const WechatWorkRequestUtils_1 = __importDefault(require("../../../help/utils/WechatWorkRequestUtils"));
const UserGetUserIdByEmailOperate = {
name: '通过邮箱获取用户ID',
value: 'user:getUserIdByEmail',
description: '通过邮箱获取其所对应的用户ID',
options: [
{
displayName: '*邮箱',
name: 'email',
default: '',
description: '用户的邮箱',
type: 'string',
placeholder: 'name@email.com',
required: true,
},
{
displayName: '邮箱类型',
name: 'email_type',
default: 1,
description: '邮箱类型:1-企业邮箱(默认);2-个人邮箱',
type: 'options',
options: [
{ name: '企业邮箱', value: 1 },
{ name: '个人邮箱', value: 2 },
],
},
],
async call(index) {
const email = this.getNodeParameter('email', index);
const emailType = this.getNodeParameter('email_type', index, 1);
return WechatWorkRequestUtils_1.default.request.call(this, {
method: 'POST',
url: `/cgi-bin/user/get_userid_by_email`,
body: {
email,
email_type: emailType,
},
});
},
};
exports.default = UserGetUserIdByEmailOperate;
//# sourceMappingURL=UserGetUserIdByEmailOperate.js.map