diff --git a/packages/nodes-base/nodes/Discourse/Discourse.node.ts b/packages/nodes-base/nodes/Discourse/Discourse.node.ts index 5bd488805d..62e518b599 100644 --- a/packages/nodes-base/nodes/Discourse/Discourse.node.ts +++ b/packages/nodes-base/nodes/Discourse/Discourse.node.ts @@ -372,6 +372,24 @@ export class Discourse implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); const flag = this.getNodeParameter('flag', i) as boolean; + const options = this.getNodeParameter('options', i); + + if (options.stats) { + qs.stats = options.stats as boolean; + } + + if (options.asc) { + qs.asc = options.asc as boolean; + } + + if (options.showEmails) { + qs.show_emails = options.showEmails as boolean; + } + + if (options.order) { + qs.order = options.order as string; + } + responseData = await discourseApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Discourse/UserDescription.ts b/packages/nodes-base/nodes/Discourse/UserDescription.ts index cf921a3a1d..8b750bfd0c 100644 --- a/packages/nodes-base/nodes/Discourse/UserDescription.ts +++ b/packages/nodes-base/nodes/Discourse/UserDescription.ts @@ -215,6 +215,10 @@ export const userFields: INodeProperties[] = [ name: 'Suspect', value: 'suspect', }, + { + name: 'Suspended', + value: 'suspended', + }, ], displayOptions: { show: { @@ -256,4 +260,93 @@ export const userFields: INodeProperties[] = [ default: 50, description: 'Max number of results to return', }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: ['user'], + operation: ['getAll'], + }, + }, + options: [ + { + displayName: 'Ascending', + name: 'asc', + type: 'boolean', + default: true, + description: 'Whether to sort ascending', + }, + { + displayName: 'Order', + name: 'order', + type: 'options', + options: [ + { + name: 'Created', + value: 'created', + }, + { + name: 'Days Visited', + value: 'days_visited', + }, + { + name: 'Email', + value: 'email', + }, + { + name: 'Last Emailed', + value: 'last_emailed', + }, + { + name: 'Posts', + value: 'posts', + }, + { + name: 'Posts Read', + value: 'posts_read', + }, + { + name: 'Read Time', + value: 'read_time', + }, + { + name: 'Seen', + value: 'seen', + }, + { + name: 'Topics Viewed', + value: 'topics_viewed', + }, + { + name: 'Trust Level', + value: 'trust_level', + }, + { + name: 'Username', + value: 'username', + }, + ], + default: 'created', + description: 'What to order by', + }, + { + displayName: 'Show Emails', + name: 'showEmails', + type: 'boolean', + default: false, + description: 'Whether to include user email addresses', + }, + { + displayName: 'Stats', + name: 'stats', + type: 'boolean', + default: false, + description: 'Whether to return user stats', + }, + ], + }, ];