upload-post 2.7.0 → 2.8.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/index.d.ts +4 -0
- package/index.js +6 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -145,6 +145,10 @@ declare module 'upload-post' {
|
|
|
145
145
|
tiktokDisableComment?: boolean;
|
|
146
146
|
/** Index of photo for cover (0-based) */
|
|
147
147
|
tiktokPhotoCoverIndex?: number;
|
|
148
|
+
/** Privacy level, e.g. PUBLIC_TO_EVERYONE, SELF_ONLY, MUTUAL_FOLLOW_FRIENDS */
|
|
149
|
+
tiktokPrivacyLevel?: string;
|
|
150
|
+
/** Post mode, e.g. DIRECT_POST or MEDIA_UPLOAD (inbox) */
|
|
151
|
+
tiktokPostMode?: string;
|
|
148
152
|
/** Branded content toggle */
|
|
149
153
|
brandContentToggle?: boolean;
|
|
150
154
|
/** Brand organic toggle */
|
package/index.js
CHANGED
|
@@ -160,13 +160,17 @@ export class UploadPost {
|
|
|
160
160
|
if (options.brandContentToggle !== undefined) form.append('brand_content_toggle', String(options.brandContentToggle));
|
|
161
161
|
if (options.brandOrganicToggle !== undefined) form.append('brand_organic_toggle', String(options.brandOrganicToggle));
|
|
162
162
|
|
|
163
|
+
// Shared by TikTok video AND photo uploads: the backend reads privacy_level and
|
|
164
|
+
// post_mode for both /upload and /upload_photos. Gating them behind isVideo made
|
|
165
|
+
// photo carousels always publish as PUBLIC_TO_EVERYONE / DIRECT_POST.
|
|
166
|
+
if (options.tiktokPrivacyLevel) form.append('privacy_level', options.tiktokPrivacyLevel);
|
|
167
|
+
if (options.tiktokPostMode) form.append('post_mode', options.tiktokPostMode);
|
|
168
|
+
|
|
163
169
|
if (isVideo) {
|
|
164
|
-
if (options.tiktokPrivacyLevel) form.append('privacy_level', options.tiktokPrivacyLevel);
|
|
165
170
|
if (options.tiktokDisableDuet !== undefined) form.append('disable_duet', String(options.tiktokDisableDuet));
|
|
166
171
|
if (options.tiktokDisableStitch !== undefined) form.append('disable_stitch', String(options.tiktokDisableStitch));
|
|
167
172
|
if (options.tiktokCoverTimestamp !== undefined) form.append('cover_timestamp', options.tiktokCoverTimestamp);
|
|
168
173
|
if (options.tiktokIsAigc !== undefined) form.append('is_aigc', String(options.tiktokIsAigc));
|
|
169
|
-
if (options.tiktokPostMode) form.append('post_mode', options.tiktokPostMode);
|
|
170
174
|
} else {
|
|
171
175
|
// Photo-specific
|
|
172
176
|
if (options.tiktokAutoAddMusic !== undefined) form.append('auto_add_music', String(options.tiktokAutoAddMusic));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "upload-post",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.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",
|