Skip to content

Commit 7e68ff9

Browse files
Merge pull request #8 from Upload-Post/staging
Release Staging to Production
2 parents 7f47d72 + 81d1212 commit 7e68ff9

4 files changed

Lines changed: 28 additions & 12 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ const boards = await client.getPinterestBoards('my-profile');
238238
### Facebook
239239
- `facebookPageId` - Facebook Page ID (required)
240240
- `facebookVideoState` - PUBLISHED, DRAFT
241-
- `facebookMediaType` - REELS, STORIES
241+
- `facebookMediaType` - REELS, STORIES, VIDEO (VIDEO for normal page videos with no 9:16 restriction)
242+
- `thumbnailUrl` - URL for custom video thumbnail (only when facebookMediaType is VIDEO)
242243
- `facebookLinkUrl` - URL for text posts
243244

244245
### Pinterest
@@ -261,9 +262,11 @@ const boards = await client.getPinterestBoards('my-profile');
261262
- `xShareWithFollowers` - Share community post with followers
262263
- `xCardUri` - Card URI for Twitter Cards
263264
- `xLongTextAsPost` - Post long text as single post
265+
- `xThreadImageLayout` - Comma-separated image layout for thread (e.g. "4,4" or "2,3,1")
264266

265267
### Threads
266268
- `threadsLongTextAsPost` - Post long text as single post (vs thread)
269+
- `threadsThreadMediaLayout` - Comma-separated list of how many media items to include in each Threads post. Each value must be 1-10, and the total must equal the number of files. Example: '5,5' splits 10 items into 2 posts with 5 each. If omitted and more than 10 items are provided, auto-chunks into groups of 10.
267270

268271
### Reddit
269272
- `redditSubreddit` - Subreddit name (without r/)

index.d.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ declare module 'upload-post' {
3535
export type FacebookVideoState = 'PUBLISHED' | 'DRAFT';
3636

3737
/** Facebook media type */
38-
export type FacebookMediaType = 'REELS' | 'STORIES';
38+
export type FacebookMediaType = 'REELS' | 'STORIES' | 'VIDEO';
3939

4040
/** X (Twitter) reply settings */
4141
export type XReplySettings = 'everyone' | 'following' | 'mentionedUsers' | 'subscribers' | 'verified';
@@ -210,6 +210,8 @@ declare module 'upload-post' {
210210
facebookVideoState?: FacebookVideoState;
211211
/** Media type */
212212
facebookMediaType?: FacebookMediaType;
213+
/** Thumbnail URL for normal page videos (only when facebookMediaType is 'VIDEO') */
214+
thumbnailUrl?: string;
213215
}
214216

215217
export interface FacebookPhotoOptions {
@@ -276,6 +278,8 @@ declare module 'upload-post' {
276278
xTaggedUserIds?: string | string[];
277279
/** Location place ID */
278280
xPlaceId?: string;
281+
/** Comma-separated image layout for thread (e.g. "4,4" or "2,3,1"). Each value 1-4, total must equal image count. */
282+
xThreadImageLayout?: string;
279283
}
280284

281285
export interface XTextOptions extends XBaseOptions {
@@ -298,6 +302,8 @@ declare module 'upload-post' {
298302
export interface ThreadsOptions {
299303
/** Post long text as single post (vs thread) */
300304
threadsLongTextAsPost?: boolean;
305+
/** Comma-separated list of how many media items per Threads post (e.g. "5,5"). Each value 1-10, total must equal file count. */
306+
threadsThreadMediaLayout?: string;
301307
}
302308

303309
// ==================== Reddit Options ====================

index.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export class UploadPost {
190190
if (isVideo) {
191191
if (options.facebookVideoState) form.append('video_state', options.facebookVideoState);
192192
if (options.facebookMediaType) form.append('facebook_media_type', options.facebookMediaType);
193+
if (options.thumbnailUrl) form.append('thumbnail_url', options.thumbnailUrl);
193194
}
194195

195196
if (isText && options.facebookLinkUrl) {
@@ -235,6 +236,7 @@ export class UploadPost {
235236
ids.forEach(id => form.append('tagged_user_ids[]', id));
236237
}
237238
if (options.xPlaceId) form.append('place_id', options.xPlaceId);
239+
if (options.xThreadImageLayout) form.append('x_thread_image_layout', options.xThreadImageLayout);
238240
} else {
239241
if (options.xPostUrl) form.append('post_url', options.xPostUrl);
240242
if (options.xCardUri) form.append('card_uri', options.xCardUri);
@@ -255,6 +257,7 @@ export class UploadPost {
255257
*/
256258
_addThreadsParams(form, options) {
257259
if (options.threadsLongTextAsPost !== undefined) form.append('threads_long_text_as_post', String(options.threadsLongTextAsPost));
260+
if (options.threadsThreadMediaLayout) form.append('threads_thread_media_layout', options.threadsThreadMediaLayout);
258261
}
259262

260263
/**
@@ -326,8 +329,9 @@ export class UploadPost {
326329
* Facebook options:
327330
* @param {string} [options.facebookPageId] - Facebook Page ID
328331
* @param {string} [options.facebookVideoState] - PUBLISHED or DRAFT
329-
* @param {string} [options.facebookMediaType] - REELS or STORIES
330-
*
332+
* @param {string} [options.facebookMediaType] - REELS, STORIES, or VIDEO
333+
* @param {string} [options.thumbnailUrl] - Thumbnail URL for normal page videos (VIDEO type only)
334+
*
331335
* Pinterest options:
332336
* @param {string} [options.pinterestBoardId] - Board ID
333337
* @param {string} [options.pinterestLink] - Destination link
@@ -347,7 +351,8 @@ export class UploadPost {
347351
*
348352
* Threads options:
349353
* @param {boolean} [options.threadsLongTextAsPost] - Post long text as single post (vs thread)
350-
*
354+
* @param {string} [options.threadsThreadMediaLayout] - Comma-separated list of how many media items per Threads post (e.g. "5,5")
355+
*
351356
* @returns {Promise<Object>} API response with request_id for async uploads
352357
*/
353358
async upload(videoPathOrUrl, options) {
@@ -424,14 +429,15 @@ export class UploadPost {
424429
* @param {boolean} [options.xNullcast] - Promoted-only post
425430
* @param {string|string[]} [options.xTaggedUserIds] - User IDs to tag
426431
* @param {boolean} [options.xLongTextAsPost] - Post long text as single post
427-
*
432+
*
428433
* Threads options:
429434
* @param {boolean} [options.threadsLongTextAsPost] - Post long text as single post
430-
*
435+
* @param {string} [options.threadsThreadMediaLayout] - Comma-separated list of how many media items per Threads post (e.g. "5,5")
436+
*
431437
* Reddit options:
432438
* @param {string} [options.redditSubreddit] - Subreddit name (without r/)
433439
* @param {string} [options.redditFlairId] - Flair template ID
434-
*
440+
*
435441
* @returns {Promise<Object>} API response
436442
*/
437443
async uploadPhotos(photosPathsOrUrls, options) {
@@ -493,14 +499,15 @@ export class UploadPost {
493499
* @param {string} [options.xPollReplySettings] - Who can reply to poll
494500
* @param {string} [options.xCardUri] - Card URI for Twitter Cards
495501
* @param {boolean} [options.xLongTextAsPost] - Post long text as single post
496-
*
502+
*
497503
* Threads options:
498504
* @param {boolean} [options.threadsLongTextAsPost] - Post long text as single post
499-
*
505+
* @param {string} [options.threadsThreadMediaLayout] - Comma-separated list of how many media items per Threads post (e.g. "5,5")
506+
*
500507
* Reddit options:
501508
* @param {string} [options.redditSubreddit] - Subreddit name (without r/)
502509
* @param {string} [options.redditFlairId] - Flair template ID
503-
*
510+
*
504511
* @returns {Promise<Object>} API response
505512
*/
506513
async uploadText(options) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "upload-post",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "Official client library for Upload-Post API - Cross-platform social media upload for TikTok, Instagram, YouTube, LinkedIn, Facebook, Pinterest, Threads, Reddit, Bluesky, and X (Twitter)",
55
"main": "index.js",
66
"types": "index.d.ts",

0 commit comments

Comments
 (0)