n8n-nodes-base
Version:
Base nodes of n8n
198 lines (193 loc) • 5.27 kB
text/typescript
/**
* Mattermost Node - Version 1
* Discriminator: resource=message, operation=post
*/
interface Credentials {
mattermostApi: CredentialReference;
}
/** Post a message into a channel */
export type MattermostV1MessagePostParams = {
resource: 'message';
operation: 'post';
/**
* The ID of the channel to post to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
*/
channelId?: string | Expression<string>;
/**
* The text to send
*/
message?: string | Expression<string> | PlaceholderValue;
/**
* The attachment to add
* @default {}
*/
attachments?: {
/** Actions to add to message. More information can be found <a href="https://docs.mattermost.com/developer/interactive-messages.html" target="_blank">here</a>.
* @default {}
*/
actions?: {
/** Item
*/
item?: Array<{
/** The type of the action
* @default button
*/
type?: 'button' | 'select' | Expression<string>;
/** The type of the action
* @displayOptions.show { type: ["select"] }
* @default custom
*/
data_source?: 'channels' | 'custom' | 'users' | Expression<string>;
/** Adds a new option to select field
* @displayOptions.show { data_source: ["custom"], type: ["select"] }
* @default {}
*/
options?: {
/** Option
*/
option?: Array<{
/** Text of the option
*/
text?: string | Expression<string> | PlaceholderValue;
/** Value of the option
*/
value?: string | Expression<string> | PlaceholderValue;
}>;
};
/** Name of the Action
*/
name?: string | Expression<string> | PlaceholderValue;
/** Integration to add to message
* @default {}
*/
integration?: {
/** Item
*/
item?: {
/** URL of the Integration
*/
url?: string | Expression<string> | PlaceholderValue;
/** Adds a Context values set
* @default {}
*/
context?: {
/** Property
*/
property?: Array<{
/** Name of the property to set
*/
name?: string | Expression<string> | PlaceholderValue;
/** Value of the property to set
*/
value?: string | Expression<string> | PlaceholderValue;
}>;
};
};
};
}>;
};
/** Icon which should appear for the user
*/
author_icon?: string | Expression<string> | PlaceholderValue;
/** Link for the author
*/
author_link?: string | Expression<string> | PlaceholderValue;
/** Name that should appear
*/
author_name?: string | Expression<string> | PlaceholderValue;
/** Color of the line left of text
* @default #ff0000
*/
color?: string | Expression<string>;
/** Required plain-text summary of the attachment
*/
fallback?: string | Expression<string> | PlaceholderValue;
/** Fields to add to message
* @default {}
*/
fields?: {
/** Item
*/
item?: Array<{
/** Title of the item
*/
title?: string | Expression<string> | PlaceholderValue;
/** Value of the item
*/
value?: string | Expression<string> | PlaceholderValue;
/** Whether items can be displayed next to each other
* @default true
*/
short?: boolean | Expression<boolean>;
}>;
};
/** Text of footer to add
*/
footer?: string | Expression<string> | PlaceholderValue;
/** Icon which should appear next to footer
*/
footer_icon?: string | Expression<string> | PlaceholderValue;
/** URL of image
*/
image_url?: string | Expression<string> | PlaceholderValue;
/** Text which appears before the message block
*/
pretext?: string | Expression<string> | PlaceholderValue;
/** Text to send
*/
text?: string | Expression<string> | PlaceholderValue;
/** URL of thumbnail
*/
thumb_url?: string | Expression<string> | PlaceholderValue;
/** Title of the message
*/
title?: string | Expression<string> | PlaceholderValue;
/** Link of the title
*/
title_link?: string | Expression<string> | PlaceholderValue;
};
/**
* Other options to set
* @default {}
*/
otherOptions?: {
/** If set, the created message will be a threaded reply to the specified parent post ID
*/
root_id?: string | Expression<string> | PlaceholderValue;
};
};
export type MattermostV1MessagePostOutput = {
channel_id?: string;
create_at?: number;
delete_at?: number;
edit_at?: number;
hashtags?: string;
id?: string;
is_pinned?: boolean;
last_reply_at?: number;
message?: string;
metadata?: {
embeds?: Array<{
type?: string;
}>;
};
original_id?: string;
participants?: null;
pending_post_id?: string;
props?: {
from_bot?: string;
};
remote_id?: string;
reply_count?: number;
root_id?: string;
type?: string;
update_at?: number;
user_id?: string;
};
export type MattermostV1MessagePostNode = {
type: 'n8n-nodes-base.mattermost';
version: 1;
credentials?: Credentials;
config: NodeConfig<MattermostV1MessagePostParams>;
output?: Items<MattermostV1MessagePostOutput>;
};