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,42 @@
import type { ChannelProperties } from '../../Interfaces';
export const channelAddUserDescription: ChannelProperties = [
{
displayName: 'Channel Name or ID',
name: 'channelId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getChannels',
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['addUser'],
resource: ['channel'],
},
},
description:
'The ID of the channel to invite user to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'User Name or ID',
name: 'userId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getUsers',
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['addUser'],
resource: ['channel'],
},
},
description:
'The ID of the user to invite into channel. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
];
@@ -0,0 +1,21 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function addUser(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const channelId = this.getNodeParameter('channelId', index) as string;
const body = {} as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'POST';
const endpoint = `channels/${channelId}/members`;
body.user_id = this.getNodeParameter('userId', index) as string;
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { channelAddUserDescription as description } from './description';
import { addUser as execute } from './execute';
export { description, execute };
@@ -0,0 +1,76 @@
import type { ChannelProperties } from '../../Interfaces';
export const channelCreateDescription: ChannelProperties = [
{
displayName: 'Team Name or ID',
name: 'teamId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTeams',
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['create'],
resource: ['channel'],
},
},
description:
'The Mattermost Team. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Display Name',
name: 'displayName',
type: 'string',
default: '',
placeholder: 'Announcements',
displayOptions: {
show: {
operation: ['create'],
resource: ['channel'],
},
},
required: true,
description: 'The non-unique UI name for the channel',
},
{
displayName: 'Name',
name: 'channel',
type: 'string',
default: '',
placeholder: 'announcements',
displayOptions: {
show: {
operation: ['create'],
resource: ['channel'],
},
},
required: true,
description: 'The unique handle for the channel, will be present in the channel URL',
},
{
displayName: 'Type',
name: 'type',
type: 'options',
displayOptions: {
show: {
operation: ['create'],
resource: ['channel'],
},
},
options: [
{
name: 'Private',
value: 'private',
},
{
name: 'Public',
value: 'public',
},
],
default: 'public',
description: 'The type of channel to create',
},
];
@@ -0,0 +1,24 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function create(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const body = {} as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'POST';
const endpoint = 'channels';
const type = this.getNodeParameter('type', index) as string;
body.team_id = this.getNodeParameter('teamId', index) as string;
body.display_name = this.getNodeParameter('displayName', index) as string;
body.name = this.getNodeParameter('channel', index) as string;
body.type = type === 'public' ? 'O' : 'P';
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { channelCreateDescription as description } from './description';
import { create as execute } from './execute';
export { description, execute };
@@ -0,0 +1,23 @@
import type { ChannelProperties } from '../../Interfaces';
export const channelDeleteDescription: ChannelProperties = [
{
displayName: 'Channel Name or ID',
name: 'channelId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getChannels',
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['delete'],
resource: ['channel'],
},
},
description:
'The ID of the channel to soft delete. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
];
@@ -0,0 +1,16 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function del(this: IExecuteFunctions, index: number): Promise<INodeExecutionData[]> {
const channelId = this.getNodeParameter('channelId', index) as string;
const body = {} as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'DELETE';
const endpoint = `channels/${channelId}`;
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { channelDeleteDescription as description } from './description';
import { del as execute } from './execute';
export { description, execute };
@@ -0,0 +1,77 @@
import type { INodeProperties } from 'n8n-workflow';
import * as addUser from './addUser';
import * as create from './create';
import * as del from './del';
import * as members from './members';
import * as restore from './restore';
import * as search from './search';
import * as statistics from './statistics';
export { create, del as delete, members, restore, addUser, statistics, search };
export const descriptions: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['channel'],
},
},
options: [
{
name: 'Add User',
value: 'addUser',
description: 'Add a user to a channel',
action: 'Add a user to a channel',
},
{
name: 'Create',
value: 'create',
description: 'Create a new channel',
action: 'Create a channel',
},
{
name: 'Delete',
value: 'delete',
description: 'Soft delete a channel',
action: 'Delete a channel',
},
{
name: 'Member',
value: 'members',
description: 'Get a page of members for a channel',
action: 'Get a page of members for a channel',
},
{
name: 'Restore',
value: 'restore',
description: 'Restores a soft deleted channel',
action: 'Restore a soft-deleted channel',
},
{
name: 'Search',
value: 'search',
description: 'Search for a channel',
action: 'Search for a channel',
},
{
name: 'Statistics',
value: 'statistics',
description: 'Get statistics for a channel',
action: 'Get statistics for a channel',
},
],
default: 'create',
},
...create.description,
...del.description,
...members.description,
...restore.description,
...addUser.description,
...statistics.description,
...search.description,
];
@@ -0,0 +1,89 @@
import type { ChannelProperties } from '../../Interfaces';
export const channelMembersDescription: ChannelProperties = [
{
displayName: 'Team Name or ID',
name: 'teamId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTeams',
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['members'],
resource: ['channel'],
},
},
description:
'The Mattermost Team. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Channel Name or ID',
name: 'channelId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getChannelsInTeam',
loadOptionsDependsOn: ['teamId'],
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['members'],
resource: ['channel'],
},
},
description:
'The Mattermost Team. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Resolve Data',
name: 'resolveData',
type: 'boolean',
displayOptions: {
show: {
resource: ['channel'],
operation: ['members'],
},
},
default: true,
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
description:
'By default the response only contain the ID of the user. If this option gets activated, it will resolve the user automatically.',
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: ['members'],
resource: ['channel'],
},
},
default: true,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: ['members'],
resource: ['channel'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 100,
description: 'Max number of results to return',
},
];
@@ -0,0 +1,44 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest, apiRequestAllItems } from '../../../transport';
export async function members(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const channelId = this.getNodeParameter('channelId', index) as string;
const returnAll = this.getNodeParameter('returnAll', index);
const resolveData = this.getNodeParameter('resolveData', index);
const limit = this.getNodeParameter('limit', index, 0);
const body = {} as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'GET';
const endpoint = `channels/${channelId}/members`;
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);
if (limit) {
responseData = responseData.slice(0, limit);
}
if (resolveData) {
const userIds: string[] = [];
for (const data of responseData) {
userIds.push(data.user_id as string);
}
if (userIds.length > 0) {
responseData = await apiRequest.call(this, 'POST', 'users/ids', userIds, qs);
}
}
}
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { channelMembersDescription as description } from './description';
import { members as execute } from './execute';
export { description, execute };
@@ -0,0 +1,18 @@
import type { ChannelProperties } from '../../Interfaces';
export const channelRestoreDescription: ChannelProperties = [
{
displayName: 'Channel ID',
name: 'channelId',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['restore'],
resource: ['channel'],
},
},
description: 'The ID of the channel to restore',
},
];
@@ -0,0 +1,19 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function restore(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const channelId = this.getNodeParameter('channelId', index) as string;
const body = {} as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'POST';
const endpoint = `channels/${channelId}/restore`;
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { channelRestoreDescription as description } from './description';
import { restore as execute } from './execute';
export { description, execute };
@@ -0,0 +1,69 @@
import type { ChannelProperties } from '../../Interfaces';
export const channelSearchDescription: ChannelProperties = [
{
displayName: 'Team Name or ID',
name: 'teamId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getTeams',
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['search'],
resource: ['channel'],
},
},
description:
'The Mattermost Team. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
{
displayName: 'Search Term',
name: 'term',
type: 'string',
default: '',
placeholder: 'General',
displayOptions: {
show: {
operation: ['search'],
resource: ['channel'],
},
},
required: true,
description: 'The search term for Channels in a Team',
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
displayOptions: {
show: {
operation: ['search'],
resource: ['channel'],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 100,
description: 'Max number of results to return',
typeOptions: {
minValue: 1,
maxValue: 100,
},
displayOptions: {
show: {
operation: ['search'],
resource: ['channel'],
returnAll: [false],
},
},
},
];
@@ -0,0 +1,26 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function search(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const body = {} as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'POST';
const teamId = this.getNodeParameter('teamId', index);
const returnAll = this.getNodeParameter('returnAll', 0);
const endpoint = `teams/${teamId}/channels/search`;
body.term = this.getNodeParameter('term', index) as string;
let responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
if (!returnAll) {
const limit = this.getNodeParameter('limit', 0);
responseData = responseData.slice(0, limit);
}
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { channelSearchDescription as description } from './description';
import { search as execute } from './execute';
export { description, execute };
@@ -0,0 +1,23 @@
import type { ChannelProperties } from '../../Interfaces';
export const channelStatisticsDescription: ChannelProperties = [
{
displayName: 'Channel Name or ID',
name: 'channelId',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getChannels',
},
options: [],
default: '',
required: true,
displayOptions: {
show: {
operation: ['statistics'],
resource: ['channel'],
},
},
description:
'The ID of the channel to get the statistics from. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
},
];
@@ -0,0 +1,19 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { apiRequest } from '../../../transport';
export async function statistics(
this: IExecuteFunctions,
index: number,
): Promise<INodeExecutionData[]> {
const channelId = this.getNodeParameter('channelId', index) as string;
const body = {} as IDataObject;
const qs = {} as IDataObject;
const requestMethod = 'GET';
const endpoint = `channels/${channelId}/stats`;
const responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs);
return this.helpers.returnJsonArray(responseData as IDataObject[]);
}
@@ -0,0 +1,4 @@
import { channelStatisticsDescription as description } from './description';
import { statistics as execute } from './execute';
export { description, execute };