n8n/packages/nodes-base/nodes/Slack/V2/utils.ts
yehorkardash 756ea6ec78
fix(Slack Node): Rate limit requests in RLC getChannels (#22149)
Co-authored-by: Shireen Missi <shireen@n8n.io>
2025-12-09 10:52:48 +00:00

54 lines
1.2 KiB
TypeScript

/* eslint-disable n8n-nodes-base/node-param-default-missing */
import type { INodePropertyMode } from 'n8n-workflow';
export const slackChannelModes: INodePropertyMode[] = [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a channel...',
typeOptions: {
searchListMethod: 'getChannels',
searchable: true,
slowLoadNotice: {
message: 'If loading is slow, try selecting a channel using "By ID" or "By URL"',
timeout: 15000,
},
},
},
{
displayName: 'By ID',
name: 'id',
type: 'string',
validation: [
{
type: 'regex',
properties: {
regex: '[a-zA-Z0-9]{2,}',
errorMessage: 'Not a valid Slack Channel ID',
},
},
],
placeholder: 'C0122KQ70S7E',
},
{
displayName: 'By URL',
name: 'url',
type: 'string',
placeholder: 'https://app.slack.com/client/TS9594PZK/B0556F47Z3A',
validation: [
{
type: 'regex',
properties: {
regex: 'http(s)?://app.slack.com/client/.*/([a-zA-Z0-9]{2,})',
errorMessage: 'Not a valid Slack Channel URL',
},
},
],
extractValue: {
type: 'regex',
regex: 'https://app.slack.com/client/.*/([a-zA-Z0-9]{2,})',
},
},
];