n8n-nodes-base
Version:
Base nodes of n8n
101 lines (96 loc) • 2.93 kB
text/typescript
/**
* Slack Node - Version 2.1
* Discriminator: resource=file, operation=upload
*/
interface Credentials {
slackApi: CredentialReference;
slackOAuth2Api: CredentialReference;
}
/** Create or upload an existing file */
export type SlackV21FileUploadParams = {
resource: 'file';
operation: 'upload';
authentication?: 'accessToken' | 'oAuth2' | Expression<string>;
/**
* Whether the data to upload should be taken from binary field
* @default false
*/
binaryData?: boolean | Expression<boolean>;
/**
* File Content
* @displayOptions.show { binaryData: [false] }
*/
fileContent?: string | Expression<string> | PlaceholderValue;
/**
* Name of the binary property which contains the data for the file to be uploaded
* @displayOptions.show { binaryData: [true] }
* @default data
*/
binaryPropertyName?: string | Expression<string> | PlaceholderValue;
/**
* Other options to set
* @default {}
*/
options?: {
/** The channels to send the file to. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
* @default []
*/
channelIds?: string[];
/** The channel to send the file to. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
* @default []
*/
channelId?: string | Expression<string>;
/** File Name
*/
fileName?: string | Expression<string> | PlaceholderValue;
/** The message text introducing the file in specified channels
*/
initialComment?: string | Expression<string> | PlaceholderValue;
/** Provide another message's Timestamp value to upload this file as a reply. Never use a reply's Timestamp value; use its parent instead.
*/
threadTs?: string | Expression<string> | PlaceholderValue;
/** Title
*/
title?: string | Expression<string> | PlaceholderValue;
};
};
export type SlackV21FileUploadOutput = {
channels?: Array<string>;
comments_count?: number;
created?: number;
display_as_bot?: boolean;
editable?: boolean;
external_type?: string;
file_access?: string;
filetype?: string;
groups?: Array<string>;
has_more_shares?: boolean;
has_rich_preview?: boolean;
id?: string;
is_external?: boolean;
is_public?: boolean;
is_starred?: boolean;
media_display_type?: string;
mimetype?: string;
mode?: string;
name?: string;
permalink?: string;
permalink_public?: string;
pretty_type?: string;
public_url_shared?: boolean;
size?: number;
timestamp?: number;
title?: string;
url_private?: string;
url_private_download?: string;
user?: string;
user_team?: string;
username?: string;
};
export type SlackV21FileUploadNode = {
type: 'n8n-nodes-base.slack';
version: 2.1;
credentials?: Credentials;
config: NodeConfig<SlackV21FileUploadParams>;
output?: Items<SlackV21FileUploadOutput>;
};