@blotato/n8n-nodes-blotato
Version:
Official n8n Blotato node
1,149 lines • 95.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Blotato = void 0;
const n8n_workflow_1 = require("n8n-workflow");
const SearchFunctions_1 = require("./SearchFunctions");
const THREAD_SUPPORTED_PLATFORMS = ['twitter', 'threads', 'bluesky'];
const BINARY_UPLOAD_MAX_SIZE_MB = 15;
const BINARY_UPLOAD_MAX_SIZE_BYTES = BINARY_UPLOAD_MAX_SIZE_MB * 1024 * 1024;
const API_ENDPOINTS = {
VIDEO_TEMPLATES: '/v2/videos/templates',
VIDEO_FROM_TEMPLATES: '/v2/videos/from-templates',
VIDEO_GET: '/v2/videos/creations',
VIDEO_DELETE: '/v2/videos',
POST_GET: '/v2/posts',
SOURCE: '/v2/source-resolutions-v3',
};
const SOURCE_TYPES = [
{ name: 'URL', value: 'url', description: 'YouTube, TikTok, Article, PDF, or Audio URL' },
{ name: 'Text', value: 'text', description: 'Raw text content with optional AI transformation' },
{ name: 'AI Research', value: 'perplexity-query', description: 'AI-powered research query' },
];
function inferSourceTypeFromUrl(url) {
const lowerUrl = url.toLowerCase();
if (lowerUrl.includes('youtube.com') || lowerUrl.includes('youtu.be')) {
return 'youtube';
}
if (lowerUrl.includes('tiktok.com')) {
return 'tiktok';
}
if (lowerUrl.endsWith('.pdf') || lowerUrl.includes('.pdf?')) {
return 'pdf';
}
const audioExtensions = ['.mp3', '.wav', '.m4a', '.ogg', '.flac', '.aac'];
for (const ext of audioExtensions) {
if (lowerUrl.endsWith(ext) || lowerUrl.includes(`${ext}?`)) {
return 'audio';
}
}
return 'article';
}
function cleanTranscript(text) {
if (!text || typeof text !== 'string') {
return text;
}
let cleaned = text.replace(/\d{2}:\d{2}:\d{2}[.,]\d{3}\s*-->\s*\d{2}:\d{2}:\d{2}[.,]\d{3}/g, '');
cleaned = cleaned.replace(/\d{2}:\d{2}:\d{2},\d{3}\s*-->\s*\d{2}:\d{2}:\d{2},\d{3}/g, '');
cleaned = cleaned.replace(/^\d+\s*$/gm, '');
cleaned = cleaned.replace(/^#{1,6}\s+/gm, '');
cleaned = cleaned.replace(/\*\*([^*]+)\*\*/g, '$1');
cleaned = cleaned.replace(/__([^_]+)__/g, '$1');
cleaned = cleaned.replace(/\*([^*]+)\*/g, '$1');
cleaned = cleaned.replace(/(?<!\w)_([^_]+)_(?!\w)/g, '$1');
cleaned = cleaned.replace(/~~([^~]+)~~/g, '$1');
cleaned = cleaned.replace(/^[-*_]{3,}\s*$/gm, '');
cleaned = cleaned.replace(/^>\s*/gm, '');
cleaned = cleaned.replace(/\n{3,}/g, '\n\n');
cleaned = cleaned.split('\n').map(line => line.trim()).join('\n');
cleaned = cleaned.trim();
cleaned = cleaned.replace(/(?<!\n)\n(?!\n)/g, ' ');
cleaned = cleaned.replace(/\s{2,}/g, ' ');
return cleaned;
}
const BLOTATO_URLS = {
VIDEO_TEMPLATES: 'https://my.blotato.com/videos/new',
API_DASHBOARD: 'https://my.blotato.com/api-dashboard',
MEDIA_REQUIREMENTS: 'https://help.blotato.com/api/media',
AUTOMATION_TEMPLATES: 'https://help.blotato.com/api/templates',
BILLING: 'https://my.blotato.com/settings/billing',
};
function extractTemplateId(param) {
return typeof param === 'object' ? param.value : param;
}
class Blotato {
constructor() {
this.description = {
displayName: 'Blotato',
name: 'blotato',
icon: 'file:blotato.svg',
group: ['input'],
version: [2],
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
description: 'Use Blotato API',
defaults: {
name: 'Blotato',
},
usableAsTool: true,
inputs: ["main"],
outputs: ["main"],
credentials: [
{
name: 'blotatoApi',
required: true,
},
],
hints: [
{
message: `View all video/carousel templates: <a href="${BLOTATO_URLS.VIDEO_TEMPLATES}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.VIDEO_TEMPLATES}</a><br><br>API Dashboard for debugging: <a href="${BLOTATO_URLS.API_DASHBOARD}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.API_DASHBOARD}</a>`,
type: 'info',
displayCondition: '={{$parameter["resource"] === "video" && $parameter["operation"] === "create" && $parameter["templateId"] && $parameter["templateId"].value !== ""}}',
},
{
message: `API Dashboard for debugging: <a href="${BLOTATO_URLS.API_DASHBOARD}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.API_DASHBOARD}</a>`,
type: 'info',
displayCondition: '={{$parameter["resource"] === "video" && $parameter["operation"] === "get"}}',
},
{
message: `API Dashboard for debugging: <a href="${BLOTATO_URLS.API_DASHBOARD}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.API_DASHBOARD}</a>`,
type: 'info',
displayCondition: '={{$parameter["resource"] === "video" && $parameter["operation"] === "delete"}}',
},
{
message: `View media requirements: <a href="${BLOTATO_URLS.MEDIA_REQUIREMENTS}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.MEDIA_REQUIREMENTS}</a><br><br>API Dashboard for debugging: <a href="${BLOTATO_URLS.API_DASHBOARD}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.API_DASHBOARD}</a>`,
type: 'info',
displayCondition: '={{$parameter["resource"] === "media" && $parameter["operation"] === "upload"}}',
},
{
message: `View all automation templates: <a href="${BLOTATO_URLS.AUTOMATION_TEMPLATES}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.AUTOMATION_TEMPLATES}</a><br><br>View all video/carousel templates: <a href="${BLOTATO_URLS.VIDEO_TEMPLATES}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.VIDEO_TEMPLATES}</a><br><br>View media requirements: <a href="${BLOTATO_URLS.MEDIA_REQUIREMENTS}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.MEDIA_REQUIREMENTS}</a><br><br>API Dashboard for debugging: <a href="${BLOTATO_URLS.API_DASHBOARD}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.API_DASHBOARD}</a>`,
type: 'info',
displayCondition: '={{$parameter["resource"] === "post"}}',
},
{
message: `API Dashboard for debugging: <a href="${BLOTATO_URLS.API_DASHBOARD}" target="_blank" style="color: #0088cc;">${BLOTATO_URLS.API_DASHBOARD}</a>`,
type: 'info',
displayCondition: '={{$parameter["resource"] === "source"}}',
},
],
properties: [
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Media',
value: 'media',
},
{
name: 'Post',
value: 'post',
},
{
name: 'Source',
value: 'source',
},
{
name: 'Video',
value: 'video',
},
],
default: 'post',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['source'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Submit a source for content extraction (YouTube, TikTok, article, PDF, etc.)',
action: 'Create source',
},
{
name: 'Get',
value: 'get',
description: 'Get the extracted content by source ID',
action: 'Get source',
},
],
default: 'create',
},
{
displayName: 'Source Type',
name: 'sourceType',
type: 'options',
options: SOURCE_TYPES,
default: 'url',
required: true,
displayOptions: {
show: {
resource: ['source'],
operation: ['create'],
},
},
description: 'The type of source to extract content from',
},
{
displayName: 'URL',
name: 'sourceUrl',
type: 'string',
required: true,
validateType: 'url',
displayOptions: {
show: {
resource: ['source'],
operation: ['create'],
sourceType: ['url'],
},
},
default: '',
placeholder: 'e.g. https://www.youtube.com/watch?v=...',
description: 'YouTube, TikTok, Article, PDF, or Audio URL. The type will be auto-detected.',
},
{
displayName: 'Text',
name: 'sourceText',
type: 'string',
typeOptions: {
rows: 6,
},
required: true,
displayOptions: {
show: {
resource: ['source'],
operation: ['create'],
sourceType: ['text'],
},
},
default: '',
placeholder: 'Enter your text content here...',
description: 'The raw text content to transform',
},
{
displayName: 'Query',
name: 'sourceQuery',
type: 'string',
typeOptions: {
rows: 3,
},
required: true,
displayOptions: {
show: {
resource: ['source'],
operation: ['create'],
sourceType: ['perplexity-query'],
},
},
default: '',
placeholder: 'e.g. What are the latest trends in AI?',
description: 'The search query for AI Research',
},
{
displayName: 'Optional Instructions',
name: 'customInstructions',
type: 'string',
typeOptions: {
rows: 3,
},
displayOptions: {
show: {
resource: ['source'],
operation: ['create'],
},
},
default: '',
placeholder: 'e.g. summarize in 5 detailed bullet points for an instagram carousel... leave this blank if you only want the raw source content.',
description: 'AI instructions to transform the extracted content (e.g., summarize, translate, reformat)',
},
{
displayName: 'Source ID',
name: 'sourceId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['source'],
operation: ['get'],
},
},
default: '',
placeholder: 'e.g. 123e4567-e89b-12d3-a456-426614174000',
description: 'The ID of the source resolution to retrieve',
},
{
displayName: 'Clean Transcript',
name: 'cleanTranscript',
type: 'boolean',
default: true,
displayOptions: {
show: {
resource: ['source'],
operation: ['get'],
},
},
description: 'Whether to remove timestamps and clean up the transcript for YouTube/TikTok/Audio sources. Makes the text easier to use for content repurposing.',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['video'],
},
},
options: [
{
name: 'Create Visual',
value: 'create',
description: 'Create a visual (video, carousel, or infographic) from a template',
action: 'Create visual',
},
{
name: 'Get Visual',
value: 'get',
description: 'Get a visual by ID',
action: 'Get visual',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a video by ID',
action: 'Delete video',
},
],
default: 'create',
},
{
displayName: 'Template',
name: 'templateId',
type: 'resourceLocator',
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a template',
typeOptions: {
searchListMethod: 'getTemplates',
searchable: true,
},
},
{
displayName: 'By ID',
name: 'id',
type: 'string',
placeholder: 'e.g. template_123',
validation: [
{
type: 'regex',
properties: {
regex: '^[a-zA-Z0-9_-]+$',
errorMessage: 'Not a valid template ID',
},
},
],
},
],
default: { mode: 'list', value: '' },
required: true,
displayOptions: {
show: {
resource: ['video'],
operation: ['create'],
},
},
description: 'The template to use to create the video',
},
{
displayName: 'Prompt',
name: 'prompt',
type: 'string',
typeOptions: {
rows: 4,
},
default: '',
placeholder: 'e.g. Regenerate this visual for a beginner audience',
displayOptions: {
show: {
resource: ['video'],
operation: ['create'],
},
},
description: 'New prompt to generate template with',
},
{
displayName: 'Template Inputs',
name: 'templateInputs',
type: 'resourceMapper',
noDataExpression: true,
default: {
mappingMode: 'defineBelow',
value: {},
},
required: true,
displayOptions: {
show: {
resource: ['video'],
operation: ['create'],
},
},
typeOptions: {
loadOptionsDependsOn: ['templateId.value'],
resourceMapper: {
resourceMapperMethod: 'getTemplateInputSchema',
mode: 'map',
fieldWords: {
singular: 'input',
plural: 'inputs',
},
addAllFields: true,
multiKeyMatch: false,
},
},
description: 'Map the input fields required by the selected template',
},
{
displayName: 'Video ID',
name: 'videoId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['video'],
operation: ['get', 'delete'],
},
},
default: '',
placeholder: 'e.g. 123e4567-e89b-12d3-a456-426614174000',
description: 'The ID of the video',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['media'],
},
},
options: [
{
name: 'Upload',
value: 'upload',
description: 'Upload image or video',
action: 'Upload media',
},
],
default: 'upload',
},
{
displayName: 'Use Binary Data',
name: 'useBinaryData',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['media'],
operation: ['upload'],
},
},
description: `Whether to use binary data instead of URL. Note: Binary uploads are limited to ${BINARY_UPLOAD_MAX_SIZE_MB}MB. For larger files, use URL upload with services like Google Drive (up to 60MB), Dropbox, Frame.io, or S3/GCS buckets.`,
},
{
displayName: 'Media URL',
name: 'mediaUrl',
type: 'string',
default: '',
validateType: 'url',
displayOptions: {
show: {
resource: ['media'],
operation: ['upload'],
useBinaryData: [false],
},
},
description: 'Public URL of image or video',
},
{
displayName: 'Input Binary Field',
name: 'binaryPropertyName',
type: 'string',
default: 'data',
displayOptions: {
show: {
resource: ['media'],
operation: ['upload'],
useBinaryData: [true],
},
},
description: 'Name of the binary property which contains the media to upload',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['post'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create post',
action: 'Create post',
},
{
name: 'Get',
value: 'get',
description: 'Get post status by submission ID',
action: 'Get post',
},
],
default: 'create',
},
{
displayName: 'Post Submission ID',
name: 'postSubmissionId',
type: 'string',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['get'],
},
},
default: '',
placeholder: 'e.g. 123e4567-e89b-12d3-a456-426614174000',
description: 'The ID of the post submission to check',
},
{
displayName: 'Platform',
name: 'platform',
type: 'options',
options: [
{ name: 'Bluesky', value: 'bluesky' },
{ name: 'Facebook', value: 'facebook' },
{ name: 'Instagram', value: 'instagram' },
{ name: 'Linkedin', value: 'linkedin' },
{ name: 'Pinterest', value: 'pinterest' },
{ name: 'Threads', value: 'threads' },
{ name: 'Tiktok', value: 'tiktok' },
{ name: 'Twitter', value: 'twitter' },
{ name: 'Youtube', value: 'youtube' },
],
default: 'instagram',
description: 'Social media platform',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
},
{
displayName: 'Account',
name: 'accountId',
type: 'resourceLocator',
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select an account for the chosen platform',
typeOptions: {
searchListMethod: 'getAccounts',
searchable: false,
},
},
{
displayName: 'By ID',
name: 'id',
type: 'string',
placeholder: 'e.g. 1234',
validation: [
{
type: 'regex',
properties: {
regex: '^[1-9]+[0-9]*$',
errorMessage: 'Not a valid account ID',
},
},
],
},
],
default: { mode: 'list', value: '' },
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
description: 'Your Blotato social media account ID',
},
{
displayName: 'Text',
name: 'postContentText',
type: 'string',
typeOptions: {
rows: 3,
},
default: '',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
description: 'The main text for your post',
},
{
displayName: 'Media URLs',
name: 'postContentMediaUrls',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
description: 'Comma-separated list of media URLs',
placeholder: 'https://database.blotato.com/image1.jpg, https://database.blotato.com/image2.jpg',
},
{
displayName: 'Schedule Next Free Slot',
name: 'useNextFreeSlot',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
description: 'Whether to schedule post in next free slot for this account. If Scheduled Time is provided, this option is ignored.',
},
{
displayName: 'Thread (Optional)',
name: 'threadInputMethod',
type: 'options',
options: [
{
name: 'Manual',
value: 'manual',
description: 'Add each post manually',
},
{
name: 'From Data',
value: 'array',
description: 'Use array data from previous node',
},
],
default: 'manual',
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: THREAD_SUPPORTED_PLATFORMS,
},
},
description: 'Choose how to create a long-form thread',
},
{
displayName: 'Thread Posts',
name: 'postContentAdditionalPosts',
placeholder: 'Add Thread',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: THREAD_SUPPORTED_PLATFORMS,
threadInputMethod: ['manual'],
},
},
options: [
{
name: 'posts',
displayName: 'Posts',
values: [
{
displayName: 'Text',
name: 'text',
type: 'string',
typeOptions: {
rows: 3,
},
default: '',
description: 'Text content of additional thread',
required: true,
},
{
displayName: 'Media URLs (Optional)',
name: 'mediaUrls',
type: 'string',
default: '',
description: 'Comma-separated list of media URLs',
placeholder: 'https://database.blotato.com/image1.jpg, https://database.blotato.com/image2.jpg',
},
],
},
],
},
{
displayName: 'Thread Posts',
name: 'threadPostsArray',
type: 'string',
default: '[]',
description: 'Array of posts from previous node. Each item must have "text" (string) and optionally "mediaUrls" (array of strings) properties.',
placeholder: '[{"text": "Post 1", "mediaUrls": []}, {"text": "Post 2", "mediaUrls": []}]',
hint: 'Correct format: [{"text": "Post 1", "mediaUrls": []}, {"text": "Post 2", "mediaUrls": []}]',
validateType: 'array',
ignoreValidationDuringExecution: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: THREAD_SUPPORTED_PLATFORMS,
threadInputMethod: ['array'],
},
},
},
{
displayName: 'Privacy Level',
name: 'postCreateTiktokOptionPrivacyLevel',
type: 'options',
default: 'PUBLIC_TO_EVERYONE',
options: [
{
name: 'Self Only',
value: 'SELF_ONLY',
},
{
name: 'Public to Everyone',
value: 'PUBLIC_TO_EVERYONE',
},
{
name: 'Mutual Follow Friends',
value: 'MUTUAL_FOLLOW_FRIENDS',
},
{
name: 'Follower of Creator',
value: 'FOLLOWER_OF_CREATOR',
},
],
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
},
description: 'Set the privacy level for the TikTok post',
},
{
displayName: 'Slideshow Title',
name: 'postCreateTiktokOptionTitle',
type: 'string',
default: '',
typeOptions: {
maxLength: 90,
},
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
},
description: 'Title for Tiktok slideshow, less than 90 characters. Defaults to first 90 characters of the \'text\' field.',
hint: 'Applies to Tiktok slideshows only.',
},
{
displayName: 'Post As Draft',
name: 'postCreateTiktokOptionIsDraft',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
},
description: 'Whether to post a DRAFT video/slideshow. It will go to your Tiktok Inbox > System Notifications. Finalize your publishing options in the Tiktok app.',
hint: 'Post a DRAFT video/slideshow. It will go to your Tiktok Inbox > System Notifications. Finalize your publishing options in the Tiktok app.'
},
{
displayName: 'Disable Comments',
name: 'postCreateTiktokOptionDisabledComments',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
hide: {
postCreateTiktokOptionIsDraft: [true],
},
},
description: 'Whether to disable comments on this post',
},
{
displayName: 'Disable Duet',
name: 'postCreateTiktokOptionDisabledDuet',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
hide: {
postCreateTiktokOptionIsDraft: [true],
},
},
description: 'Whether to disable duet for this post',
},
{
displayName: 'Disable Stitch',
name: 'postCreateTiktokOptionDisabledStitch',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
hide: {
postCreateTiktokOptionIsDraft: [true],
},
},
description: 'Whether to disable stitch for this post',
},
{
displayName: 'Is Branded Content',
name: 'postCreateTiktokOptionIsBrandedContent',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
hide: {
postCreateTiktokOptionIsDraft: [true],
},
},
description: 'Whether this post contains branded content',
},
{
displayName: 'Is Your Brand',
name: 'postCreateTiktokOptionIsYourBrand',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
hide: {
postCreateTiktokOptionIsDraft: [true],
},
},
description: 'Whether this post is about your own brand',
},
{
displayName: 'Is AI Generated',
name: 'postCreateTiktokOptionIsAiGenerated',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
hide: {
postCreateTiktokOptionIsDraft: [true],
},
},
description: 'Whether this content is AI generated',
},
{
displayName: 'Auto Add Music',
name: 'postCreateTiktokOptionAutoAddMusic',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['tiktok'],
},
hide: {
postCreateTiktokOptionIsDraft: [true],
},
},
description: 'Whether to automatically add music. Only works for Tiktok slideshows.',
},
{
displayName: 'Facebook Page',
name: 'facebookPageId',
type: 'resourceLocator',
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a Facebook Page for this account',
typeOptions: {
searchListMethod: 'getSubaccounts',
},
},
{
displayName: 'By ID',
name: 'id',
type: 'string',
placeholder: 'e.g. 123456789012345',
validation: [
{
type: 'regex',
properties: {
regex: '^[0-9]+$',
errorMessage: 'Not a valid Facebook Page ID (only numbers)',
},
},
],
},
],
default: { mode: 'list', value: '' },
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['facebook'],
},
},
description: 'The Facebook Page ID to post to',
},
{
displayName: 'Pinterest Board',
name: 'pinterestBoardId',
type: 'resourceLocator',
modes: [
{
displayName: 'By ID',
name: 'id',
type: 'string',
placeholder: 'e.g. 123456789012345',
validation: [
{
type: 'regex',
properties: {
regex: '^[0-9]+$',
errorMessage: 'Not a valid Pinterest Board ID (only numbers)',
},
},
],
},
],
default: { mode: 'id', value: '' },
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['pinterest'],
},
},
description: 'The Pinterest Board ID to pin to. Pinterest requires at least one image in mediaUrls.',
},
{
displayName: 'Pin Title (Optional)',
name: 'postCreatePinterestOptionTitle',
type: 'string',
default: '',
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['pinterest'],
},
},
description: 'Optional title for the Pinterest pin',
},
{
displayName: 'Video Title',
name: 'postCreateYoutubeOptionTitle',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['youtube'],
},
},
description: 'Title of the Youtube video',
},
{
displayName: 'Privacy Status',
name: 'postCreateYoutubeOptionPrivacyStatus',
type: 'options',
default: 'public',
options: [
{
name: 'Public',
value: 'public',
},
{
name: 'Private',
value: 'private',
},
{
name: 'Unlisted',
value: 'unlisted',
},
],
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['youtube'],
},
},
description: 'Privacy setting for the Youtube video',
},
{
displayName: 'Notify Subscribers',
name: 'postCreateYoutubeOptionShouldNotifySubscribers',
type: 'boolean',
default: true,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['youtube'],
},
},
description: 'Whether to notify subscribers about this video',
},
{
displayName: 'Made for Kids',
name: 'postCreateYoutubeOptionMadeForKids',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['youtube'],
},
},
description: 'Whether this video is made for kids',
},
{
displayName: 'Contains Synthetic Media',
name: 'postCreateYoutubeOptionContainsSyntheticMedia',
type: 'boolean',
default: false,
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
platform: ['youtube'],
},
},
description: 'Whether the media contains synthetic content, such as AI images, AI videos, or AI avatars',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
resource: ['post'],
operation: ['create'],
},
},
options: [
{
displayName: 'Alt Text',
name: 'instagramAltText',
type: 'string',
default: '',
displayOptions: {
show: {
'/platform': ['instagram'],
},
},
description: 'Alternative text for accessibility. Only supported on single images or carousel images (max 2200 characters).',
},
{
displayName: 'Audio Name',
name: 'instagramAudioName',
type: 'string',
default: '',
typeOptions: {
minLength: 1,
maxLength: 2200,
},
displayOptions: {
show: {
'/platform': ['instagram'],
},
},
description: 'For Reels only. Name of the audio of your Reels media. You can only rename once, either while creating a reel or after from the audio page.',
placeholder: 'My Custom Audio Name',
},
{
displayName: 'Collaborators',
name: 'instagramCollaborators',
type: 'string',
default: '',
displayOptions: {
show: {
'/platform': ['instagram'],
},
},
description: 'Comma-separated list of Instagram usernames to add as collaborators (min: 1, max: 3)',
placeholder: 'username1, username2, username3',
},
{
displayName: 'Cover Image URL',
name: 'instagramCoverImageUrl',
type: 'string',
default: '',
validateType: 'url