first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,103 @@
import type { UserProperties } from '../../Interfaces';
export const userGetAllDescription: UserProperties = [
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['user'],
operation: ['getAll'],
},
},
default: true,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['user'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: ['user'],
operation: ['getAll'],
},
},
default: {},
options: [
{
displayName: 'In Channel',
name: 'inChannel',
type: 'string',
default: '',
description: 'The ID of the channel to get users for',
},
{
displayName: 'In Team',
name: 'inTeam',
type: 'string',
default: '',
description: 'The ID of the team to get users for',
},
{
displayName: 'Not In Team',
name: 'notInTeam',
type: 'string',
default: '',
description: 'The ID of the team to exclude users for',
},
{
displayName: 'Not In Channel',
name: 'notInChannel',
type: 'string',
default: '',
description: 'The ID of the channel to exclude users for',
},
{
displayName: 'Sort',
name: 'sort',
type: 'options',
options: [
{
name: 'Created At',
value: 'createdAt',
},
{
name: 'Last Activity At',
value: 'lastActivityAt',
},
{
name: 'Status',
value: 'status',
},
{
name: 'Username',
value: 'username',
},
],
default: 'username',
description: 'The ID of the channel to exclude users for',
},
],
},
];
@@ -0,0 +1,111 @@
import { snakeCase } from 'change-case';
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
import { apiRequest, apiRequestAllItems } from '../../../transport';
export async function getAll(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const returnAll = this.getNodeParameter('returnAll', index);
const additionalFields = this.getNodeParameter('additionalFields', index);
const qs = {} as IDataObject;
const requestMethod = 'GET';
const endpoint = '/users';
const body = {} as IDataObject;
if (additionalFields.inTeam) {
qs.in_team = additionalFields.inTeam;
}
if (additionalFields.notInTeam) {
qs.not_in_team = additionalFields.notInTeam;
}
if (additionalFields.inChannel) {
qs.in_channel = additionalFields.inChannel;
}
if (additionalFields.notInChannel) {
qs.not_in_channel = additionalFields.notInChannel;
}
if (additionalFields.sort) {
qs.sort = snakeCase(additionalFields.sort as string);
}
const validRules = {
inTeam: ['last_activity_at', 'created_at', 'username'],
inChannel: ['status', 'username'],
};
if (additionalFields.sort) {
if (additionalFields.inTeam !== undefined || additionalFields.inChannel !== undefined) {
if (
additionalFields.inTeam !== undefined &&
!validRules.inTeam.includes(snakeCase(additionalFields.sort as string))
) {
throw new NodeOperationError(
this.getNode(),
`When In Team is set the only valid values for sorting are ${validRules.inTeam.join(
',',
)}`,
{ itemIndex: index },
);
}
if (
additionalFields.inChannel !== undefined &&
!validRules.inChannel.includes(snakeCase(additionalFields.sort as string))
) {
throw new NodeOperationError(
this.getNode(),
`When In Channel is set the only valid values for sorting are ${validRules.inChannel.join(
',',
)}`,
{ itemIndex: index },
);
}
if (additionalFields.inChannel === '' && additionalFields.sort !== 'username') {
throw new NodeOperationError(
this.getNode(),
'When sort is different than username In Channel must be set',
{ itemIndex: index },
);
}
if (additionalFields.inTeam === '' && additionalFields.sort !== 'username') {
throw new NodeOperationError(
this.getNode(),
'When sort is different than username In Team must be set',
{ itemIndex: index },
);
}
} else {
throw new NodeOperationError(
this.getNode(),
"When sort is defined either 'in team' or 'in channel' must be defined",
{ itemIndex: index },
);
}
}
if (additionalFields.sort === 'username') {
qs.sort = '';
}
if (!returnAll) {
qs.per_page = this.getNodeParameter('limit', index);
}
let responseData;
if (returnAll) {
responseData = await apiRequestAllItems.call(this, requestMethod, endpoint, body, qs);
} else {
responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
}
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { userGetAllDescription as description } from './description';
import { getAll as execute } from './execute';
export { description, execute };