upload-post 2.16.0 → 2.17.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 -0
- package/index.d.ts +10 -0
- package/index.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -630,6 +630,8 @@ for those options.
|
|
|
630
630
|
- `instagramLocationId` - Location ID
|
|
631
631
|
- `instagramThumbOffset` - Thumbnail offset
|
|
632
632
|
- `instagramAltText` - Alt text on photos (string or list, ≤1000 chars each)
|
|
633
|
+
- `instagramShareMode` - Trial Reels: `TRIAL_REELS_SHARE_TO_FOLLOWERS_IF_LIKED` or `TRIAL_REELS_DONT_SHARE_TO_FOLLOWERS` (videos only)
|
|
634
|
+
- `instagramIsAiGenerated` - AI-generated content label (sent as the generic `is_ai_generated`, which other platforms in the same post also read)
|
|
633
635
|
|
|
634
636
|
### YouTube
|
|
635
637
|
- `youtubeTags` - Array or comma-separated tags
|
|
@@ -667,6 +669,7 @@ for those options.
|
|
|
667
669
|
- `thumbnailUrl` - URL for custom video cover (generic field, also read by X, YouTube and LinkedIn; on Facebook only when facebookMediaType is VIDEO)
|
|
668
670
|
- `facebookLinkUrl` - URL for text posts
|
|
669
671
|
- `facebookAltText` - Alt text per photo
|
|
672
|
+
- `facebookMediaType` on photos - POSTS (feed, default) or STORIES (Page photo story)
|
|
670
673
|
- `facebookPlaceId` - Place ID
|
|
671
674
|
- `facebookTargeting` / `facebookFeedTargeting` - Audience JSON
|
|
672
675
|
- `facebookCallToAction` / `facebookChildAttachments` / `facebookMultiShareEndCard` - Link posts
|
package/index.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ declare module 'upload-post' {
|
|
|
36
36
|
|
|
37
37
|
/** Facebook media type */
|
|
38
38
|
export type FacebookMediaType = 'REELS' | 'STORIES' | 'VIDEO';
|
|
39
|
+
export type FacebookPhotoMediaType = 'POSTS' | 'STORIES';
|
|
40
|
+
export type InstagramShareMode = 'TRIAL_REELS_SHARE_TO_FOLLOWERS_IF_LIKED' | 'TRIAL_REELS_DONT_SHARE_TO_FOLLOWERS';
|
|
39
41
|
|
|
40
42
|
/** X (Twitter) reply settings */
|
|
41
43
|
export type XReplySettings = 'everyone' | 'following' | 'mentionedUsers' | 'subscribers' | 'verified';
|
|
@@ -274,6 +276,10 @@ declare module 'upload-post' {
|
|
|
274
276
|
instagramLocationId?: string;
|
|
275
277
|
/** Thumbnail offset */
|
|
276
278
|
instagramThumbOffset?: string;
|
|
279
|
+
/** Trial Reel: shown to non-followers first. Sent as share_mode */
|
|
280
|
+
instagramShareMode?: InstagramShareMode;
|
|
281
|
+
/** AI-generated content label. Sent as the generic is_ai_generated field */
|
|
282
|
+
instagramIsAiGenerated?: boolean;
|
|
277
283
|
}
|
|
278
284
|
|
|
279
285
|
export interface InstagramPhotoOptions {
|
|
@@ -287,6 +293,8 @@ declare module 'upload-post' {
|
|
|
287
293
|
instagramLocationId?: string;
|
|
288
294
|
/** Alt text: string (applied to every item) or list of strings, ≤1000 chars each */
|
|
289
295
|
instagramAltText?: string | string[];
|
|
296
|
+
/** AI-generated content label. Sent as the generic is_ai_generated field */
|
|
297
|
+
instagramIsAiGenerated?: boolean;
|
|
290
298
|
}
|
|
291
299
|
|
|
292
300
|
// ==================== YouTube Options ====================
|
|
@@ -414,6 +422,8 @@ declare module 'upload-post' {
|
|
|
414
422
|
facebookPageId?: string;
|
|
415
423
|
/** Alt text per photo */
|
|
416
424
|
facebookAltText?: string | string[];
|
|
425
|
+
/** POSTS (default) publishes to the feed, STORIES as a Page story */
|
|
426
|
+
facebookMediaType?: FacebookPhotoMediaType;
|
|
417
427
|
/** Facebook Place ID */
|
|
418
428
|
facebookPlaceId?: string;
|
|
419
429
|
/** Geographic/age/language targeting */
|
package/index.js
CHANGED
|
@@ -300,9 +300,14 @@ export class UploadPost {
|
|
|
300
300
|
if (options.instagramCollaborators) form.append('collaborators', options.instagramCollaborators);
|
|
301
301
|
if (options.instagramUserTags) form.append('user_tags', options.instagramUserTags);
|
|
302
302
|
if (options.instagramLocationId) form.append('location_id', options.instagramLocationId);
|
|
303
|
+
// AI-content label. The API field is the generic is_ai_generated, which other
|
|
304
|
+
// platforms in the same post also read (it is the same media).
|
|
305
|
+
this._appendField(form, 'is_ai_generated', this._pick(options, 'instagramIsAiGenerated', 'isAiGenerated', 'is_ai_generated'));
|
|
303
306
|
|
|
304
307
|
if (isVideo) {
|
|
305
308
|
if (options.instagramShareToFeed !== undefined) form.append('share_to_feed', String(options.instagramShareToFeed));
|
|
309
|
+
// Trial Reels: TRIAL_REELS_SHARE_TO_FOLLOWERS_IF_LIKED or TRIAL_REELS_DONT_SHARE_TO_FOLLOWERS.
|
|
310
|
+
this._appendField(form, 'share_mode', this._pick(options, 'instagramShareMode', 'share_mode'));
|
|
306
311
|
if (options.instagramCoverUrl) {
|
|
307
312
|
const coverVal = options.instagramCoverUrl;
|
|
308
313
|
if (typeof coverVal === 'string' && (coverVal.toLowerCase().startsWith('http://') || coverVal.toLowerCase().startsWith('https://'))) {
|
|
@@ -426,6 +431,8 @@ export class UploadPost {
|
|
|
426
431
|
|
|
427
432
|
if (!isVideo && !isText) {
|
|
428
433
|
this._appendField(form, 'facebook_alt_text', this._pick(options, 'facebookAltText', 'facebook_alt_text'));
|
|
434
|
+
// POSTS (default) or STORIES for a Page photo story.
|
|
435
|
+
this._appendField(form, 'facebook_media_type', this._pick(options, 'facebookMediaType', 'facebook_media_type'));
|
|
429
436
|
}
|
|
430
437
|
|
|
431
438
|
if (isText && options.facebookLinkUrl) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "upload-post",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.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",
|