upload-post 2.14.1 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/index.d.ts +7 -1
- package/index.js +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -656,7 +656,7 @@ for those options.
|
|
|
656
656
|
- `facebookPageId` - Facebook Page ID (required)
|
|
657
657
|
- `facebookVideoState` - PUBLISHED, DRAFT
|
|
658
658
|
- `facebookMediaType` - REELS, STORIES, VIDEO (VIDEO for normal page videos with no 9:16 restriction)
|
|
659
|
-
- `thumbnailUrl` - URL for custom video
|
|
659
|
+
- `thumbnailUrl` - URL for custom video cover (generic field, also read by X, YouTube and LinkedIn; on Facebook only when facebookMediaType is VIDEO)
|
|
660
660
|
- `facebookLinkUrl` - URL for text posts
|
|
661
661
|
- `facebookAltText` - Alt text per photo
|
|
662
662
|
- `facebookPlaceId` - Place ID
|
|
@@ -694,6 +694,8 @@ for those options.
|
|
|
694
694
|
- `xAltText` - Alt text (≤1000 chars)
|
|
695
695
|
- `xSubtitles` / `xSubtitlesUrl` / `xSubtitlesLanguage` / `xSubtitlesName` - Video captions
|
|
696
696
|
- `xPaidPartnership` - Paid partnership label
|
|
697
|
+
- `madeWithAi` - Disclose AI-generated media on X (`made_with_ai`; alias `isAiGenerated`)
|
|
698
|
+
- `thumbnailUrl` - Custom video cover (generic field; applied by X as the post's preview image)
|
|
697
699
|
- `xArticleTitle` / `xArticleBody` / `xArticleContentState` / `xArticleDraft` / `xArticleCoverMedia` - X Articles (Premium)
|
|
698
700
|
|
|
699
701
|
### Threads
|
package/index.d.ts
CHANGED
|
@@ -389,7 +389,7 @@ declare module 'upload-post' {
|
|
|
389
389
|
facebookVideoState?: FacebookVideoState;
|
|
390
390
|
/** Media type */
|
|
391
391
|
facebookMediaType?: FacebookMediaType;
|
|
392
|
-
/**
|
|
392
|
+
/** Custom video cover URL. Generic API field: X, YouTube, LinkedIn and Facebook (only when facebookMediaType is 'VIDEO') read it */
|
|
393
393
|
thumbnailUrl?: string;
|
|
394
394
|
/** Facebook Place ID */
|
|
395
395
|
facebookPlaceId?: string;
|
|
@@ -517,6 +517,12 @@ declare module 'upload-post' {
|
|
|
517
517
|
xThreadImageLayout?: string;
|
|
518
518
|
/** Alt text (≤1000 chars). String for video; string, list or `x_alt_text[]` for photos */
|
|
519
519
|
xAltText?: string | string[];
|
|
520
|
+
/** Disclose that the post contains AI-generated media (X `made_with_ai`). Alias: isAiGenerated */
|
|
521
|
+
madeWithAi?: boolean;
|
|
522
|
+
/** Same as madeWithAi */
|
|
523
|
+
xMadeWithAi?: boolean;
|
|
524
|
+
/** Cross-platform alias of madeWithAi (API `is_ai_generated`) */
|
|
525
|
+
isAiGenerated?: boolean;
|
|
520
526
|
/** Public URL of a .srt file (≤1 MB) */
|
|
521
527
|
xSubtitlesUrl?: string;
|
|
522
528
|
/** Inline SRT text, or a URL if the value starts with http(s) */
|
package/index.js
CHANGED
|
@@ -492,6 +492,8 @@ export class UploadPost {
|
|
|
492
492
|
this._appendField(form, 'x_subtitles', this._pick(options, 'xSubtitles', 'x_subtitles'));
|
|
493
493
|
this._appendField(form, 'x_subtitles_language', this._pick(options, 'xSubtitlesLanguage', 'x_subtitles_language'));
|
|
494
494
|
this._appendField(form, 'x_subtitles_name', this._pick(options, 'xSubtitlesName', 'x_subtitles_name'));
|
|
495
|
+
// AI-media disclosure (X "made_with_ai"); is_ai_generated is the cross-platform alias.
|
|
496
|
+
this._appendField(form, 'made_with_ai', this._pick(options, 'xMadeWithAi', 'madeWithAi', 'made_with_ai', 'isAiGenerated', 'is_ai_generated'));
|
|
495
497
|
} else {
|
|
496
498
|
if (options.xPostUrl) form.append('post_url', options.xPostUrl);
|
|
497
499
|
if (options.xCardUri) form.append('card_uri', options.xCardUri);
|
|
@@ -902,6 +904,14 @@ export class UploadPost {
|
|
|
902
904
|
if (platforms.includes('google_business')) this._addGoogleBusinessParams(form, options);
|
|
903
905
|
this._addCredentialPlatformParams(form, options);
|
|
904
906
|
|
|
907
|
+
// thumbnail_url is one generic API field, read by X, YouTube, LinkedIn and Facebook.
|
|
908
|
+
// The Facebook and YouTube helpers already send it for their platform; send it once
|
|
909
|
+
// here for the rest (X since 2.15.0) without duplicating the field.
|
|
910
|
+
const cover = this._pick(options, 'thumbnailUrl', 'thumbnail_url');
|
|
911
|
+
const coverAlreadySent = (platforms.includes('facebook') && cover)
|
|
912
|
+
|| (platforms.includes('youtube') && options.youtubeThumbnailUrl);
|
|
913
|
+
if (cover && !coverAlreadySent) form.append('thumbnail_url', cover);
|
|
914
|
+
|
|
905
915
|
return this._request('/upload', 'POST', form, true, this._idempotencyHeaders(options));
|
|
906
916
|
}
|
|
907
917
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "upload-post",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"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)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|