mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(slack Node): add operation get many for user resource (#3150)
This commit is contained in:
committed by
GitHub
parent
a8da9c31a9
commit
2714b4ced7
@@ -1,11 +1,8 @@
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
ICredentialsDecrypted,
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
ILoadOptionsFunctions,
|
||||
INodeCredentialTestResult,
|
||||
INodeExecutionData,
|
||||
INodePropertyOptions,
|
||||
INodeType,
|
||||
@@ -15,23 +12,14 @@ import {
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { channelFields, channelOperations } from './ChannelDescription';
|
||||
|
||||
import { messageFields, messageOperations } from './MessageDescription';
|
||||
|
||||
import { starFields, starOperations } from './StarDescription';
|
||||
|
||||
import { fileFields, fileOperations } from './FileDescription';
|
||||
|
||||
import { reactionFields, reactionOperations } from './ReactionDescription';
|
||||
|
||||
import { userGroupFields, userGroupOperations } from './UserGroupDescription';
|
||||
|
||||
import { userFields, userOperations } from './UserDescription';
|
||||
|
||||
import { userProfileFields, userProfileOperations } from './UserProfileDescription';
|
||||
|
||||
import { slackApiRequest, slackApiRequestAllItems, validateJSON } from './GenericFunctions';
|
||||
|
||||
import { IAttachment } from './MessageInterface';
|
||||
|
||||
import moment from 'moment';
|
||||
@@ -1206,6 +1194,24 @@ export class Slack implements INodeType {
|
||||
responseData = await slackApiRequest.call(this, 'GET', '/users.info', {}, qs);
|
||||
responseData = responseData.user;
|
||||
}
|
||||
//https://api.slack.com/methods/users.list
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
if (returnAll === true) {
|
||||
responseData = await slackApiRequestAllItems.call(
|
||||
this,
|
||||
'members',
|
||||
'GET',
|
||||
'/users.list',
|
||||
{},
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.limit = this.getNodeParameter('limit', i) as number;
|
||||
responseData = await slackApiRequest.call(this, 'GET', '/users.list', {}, qs);
|
||||
responseData = responseData.members;
|
||||
}
|
||||
}
|
||||
//https://api.slack.com/methods/users.getPresence
|
||||
if (operation === 'getPresence') {
|
||||
qs.user = this.getNodeParameter('user', i) as string;
|
||||
|
||||
Reference in New Issue
Block a user