n8n/packages/nodes-base/nodes/Slack/Slack.node.ts
OlegIvaniv aa53c46367
feat(Slack Node): Add option to include link to workflow in Slack node (#6611)
* feat(Slack Node): Add “automated by” message to Slack node’s post message

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Pass instanceBaseUrl to node context

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Move `includeLinkToWorkflow` to options

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* keep "includeLinkToWorkflow" hidden

* Only append the message for version 2.1 and up

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

---------

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
2023-07-10 15:03:21 +02:00

29 lines
801 B
TypeScript

import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
import { VersionedNodeType } from 'n8n-workflow';
import { SlackV1 } from './V1/SlackV1.node';
import { SlackV2 } from './V2/SlackV2.node';
export class Slack extends VersionedNodeType {
constructor() {
const baseDescription: INodeTypeBaseDescription = {
displayName: 'Slack',
name: 'slack',
icon: 'file:slack.svg',
group: ['output'],
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Slack API',
defaultVersion: 2.1,
};
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
1: new SlackV1(baseDescription),
2: new SlackV2(baseDescription),
2.1: new SlackV2(baseDescription),
};
super(nodeVersions, baseDescription);
}
}