n8n-nodes-base
Version:
Base nodes of n8n
126 lines (121 loc) • 3.63 kB
text/typescript
/**
* Slack Node - Version 2.2
* Discriminator: resource=message, operation=update
*/
interface Credentials {
slackApi: CredentialReference;
slackOAuth2Api: CredentialReference;
}
export type SlackV22MessageUpdateParams = {
resource: 'message';
operation: 'update';
authentication?: 'accessToken' | 'oAuth2' | Expression<string>;
/**
* The Slack channel to update the message from
* @default {"mode":"list","value":""}
*/
channelId?: { __rl: true; mode: 'list' | 'id' | 'url'; value: string; cachedResultName?: string };
/**
* Timestamp of the message to update
*/
ts: number | Expression<number>;
/**
* Whether to send a simple text message, or use Slack’s Blocks UI builder for more sophisticated messages that include form fields, sections and more
* @default text
*/
messageType?: 'text' | 'block' | 'attachment' | Expression<string>;
/**
* Enter the JSON output from Slack's visual Block Kit Builder here. You can then use expressions to add variable content to your blocks. To create blocks, use <a target='_blank' href='https://app.slack.com/block-kit-builder'>Slack's Block Kit Builder</a>
* @hint To create blocks, use <a target='_blank' href='https://app.slack.com/block-kit-builder'>Slack's Block Kit Builder</a>
* @displayOptions.show { messageType: ["block"] }
*/
blocksUi?: string | Expression<string> | PlaceholderValue;
/**
* Fallback text to display in slack notifications. Supports <a href="https://api.slack.com/reference/surfaces/formatting">markdown</a> by default - this can be disabled in "Options".
* @displayOptions.show { messageType: ["block", "text"] }
*/
text?: string | Expression<string> | PlaceholderValue;
/**
* Update Fields
* @default {}
*/
updateFields?: {
/** Whether to find and link channel names and usernames
* @default false
*/
link_names?: boolean | Expression<boolean>;
/** Change how messages are treated
* @default client
*/
parse?: 'client' | 'full' | 'none' | Expression<string>;
};
/**
* Other options to set
* @default {}
*/
otherOptions?: {
/** Whether to append a link to this workflow at the end of the message. This is helpful if you have many workflows sending Slack messages.
* @default true
*/
includeLinkToWorkflow?: boolean | Expression<boolean>;
};
};
export type SlackV22MessageUpdateOutput = {
channel?: string;
message?: {
app_id?: string;
blocks?: Array<{
block_id?: string;
elements?: Array<{
elements?: Array<{
style?: {
bold?: boolean;
italic?: boolean;
};
text?: string;
type?: string;
url?: string;
}>;
type?: string;
}>;
text?: {
text?: string;
type?: string;
verbatim?: boolean;
};
type?: string;
}>;
bot_id?: string;
bot_profile?: {
app_id?: string;
deleted?: boolean;
icons?: {
image_36?: string;
image_48?: string;
image_72?: string;
};
id?: string;
name?: string;
team_id?: string;
updated?: number;
};
edited?: {
ts?: string;
user?: string;
};
team?: string;
text?: string;
type?: string;
user?: string;
};
message_timestamp?: string;
ok?: boolean;
text?: string;
};
export type SlackV22MessageUpdateNode = {
type: 'n8n-nodes-base.slack';
version: 2.2;
credentials?: Credentials;
config: NodeConfig<SlackV22MessageUpdateParams>;
output?: Items<SlackV22MessageUpdateOutput>;
};