upload-post 2.14.0 → 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 CHANGED
@@ -183,6 +183,14 @@ await client.editScheduled('job-id', {
183
183
  timezone: 'America/New_York',
184
184
  });
185
185
 
186
+ // Fix the text of a pending post in place (only the platforms listed change)
187
+ await client.editScheduled('job-id', {
188
+ platformContent: {
189
+ instagram: { caption: 'New Instagram caption' },
190
+ tiktok: { caption: 'New TikTok caption' },
191
+ },
192
+ });
193
+
186
194
  // Cancel a scheduled post
187
195
  await client.cancelScheduled('job-id');
188
196
  ```
@@ -648,7 +656,7 @@ for those options.
648
656
  - `facebookPageId` - Facebook Page ID (required)
649
657
  - `facebookVideoState` - PUBLISHED, DRAFT
650
658
  - `facebookMediaType` - REELS, STORIES, VIDEO (VIDEO for normal page videos with no 9:16 restriction)
651
- - `thumbnailUrl` - URL for custom video thumbnail (only when facebookMediaType is VIDEO)
659
+ - `thumbnailUrl` - URL for custom video cover (generic field, also read by X, YouTube and LinkedIn; on Facebook only when facebookMediaType is VIDEO)
652
660
  - `facebookLinkUrl` - URL for text posts
653
661
  - `facebookAltText` - Alt text per photo
654
662
  - `facebookPlaceId` - Place ID
@@ -686,6 +694,8 @@ for those options.
686
694
  - `xAltText` - Alt text (≤1000 chars)
687
695
  - `xSubtitles` / `xSubtitlesUrl` / `xSubtitlesLanguage` / `xSubtitlesName` - Video captions
688
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)
689
699
  - `xArticleTitle` / `xArticleBody` / `xArticleContentState` / `xArticleDraft` / `xArticleCoverMedia` - X Articles (Premium)
690
700
 
691
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
- /** Thumbnail URL for normal page videos (only when facebookMediaType is 'VIDEO') */
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) */
@@ -1406,7 +1412,18 @@ declare module 'upload-post' {
1406
1412
  * @param jobId - Scheduled job ID
1407
1413
  * @param options - Edit options
1408
1414
  */
1409
- editScheduled(jobId: string, options: { scheduledDate?: string; timezone?: string }): Promise<{ success: boolean }>;
1415
+ editScheduled(jobId: string, options: {
1416
+ scheduledDate?: string;
1417
+ timezone?: string;
1418
+ /** New title for every platform */
1419
+ title?: string;
1420
+ /** New caption/description for every platform */
1421
+ caption?: string;
1422
+ /** Alias of caption */
1423
+ description?: string;
1424
+ /** Per-platform text; only the platforms listed are touched */
1425
+ platformContent?: Record<string, { title?: string; caption?: string }>;
1426
+ }): Promise<{ success: boolean }>;
1410
1427
 
1411
1428
  // User Management
1412
1429
  /**
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
 
@@ -1409,12 +1419,22 @@ export class UploadPost {
1409
1419
  * @param {Object} options - Edit options
1410
1420
  * @param {string} [options.scheduledDate] - New scheduled date (ISO 8601)
1411
1421
  * @param {string} [options.timezone] - New timezone
1422
+ * @param {string} [options.title] - New title for every platform
1423
+ * @param {string} [options.caption] - New caption/description for every platform
1424
+ * @param {string} [options.description] - Alias of caption
1425
+ * @param {Object} [options.platformContent] - Per-platform text, e.g.
1426
+ * { instagram: { caption: '...' }, tiktok: { caption: '...' }, youtube: { title: '...' } }.
1427
+ * Only the platforms listed are touched.
1412
1428
  * @returns {Promise<Object>} Edit result
1413
1429
  */
1414
1430
  async editScheduled(jobId, options) {
1415
1431
  const body = {};
1416
1432
  if (options.scheduledDate) body.scheduled_date = options.scheduledDate;
1417
1433
  if (options.timezone) body.timezone = options.timezone;
1434
+ if (options.title !== undefined) body.title = options.title;
1435
+ if (options.caption !== undefined) body.caption = options.caption;
1436
+ else if (options.description !== undefined) body.description = options.description;
1437
+ if (options.platformContent) body.platform_content = options.platformContent;
1418
1438
  return this._request(`/uploadposts/schedule/${jobId}`, 'PATCH', body);
1419
1439
  }
1420
1440
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "upload-post",
3
- "version": "2.14.0",
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",