upload-post 1.0.1 → 2.0.3
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/.github/workflows/publish.yml +45 -0
- package/LICENSE +21 -0
- package/README.md +300 -31
- package/index.d.ts +568 -9
- package/index.js +718 -32
- package/package.json +28 -5
package/index.d.ts
CHANGED
|
@@ -1,28 +1,587 @@
|
|
|
1
1
|
declare module 'upload-post' {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
// ==================== Common Types ====================
|
|
3
|
+
|
|
4
|
+
/** Supported platforms for video upload */
|
|
5
|
+
export type VideoPlatform = 'tiktok' | 'instagram' | 'youtube' | 'linkedin' | 'facebook' | 'pinterest' | 'threads' | 'bluesky' | 'x';
|
|
6
|
+
|
|
7
|
+
/** Supported platforms for photo upload */
|
|
8
|
+
export type PhotoPlatform = 'tiktok' | 'instagram' | 'linkedin' | 'facebook' | 'pinterest' | 'threads' | 'reddit' | 'bluesky' | 'x';
|
|
9
|
+
|
|
10
|
+
/** Supported platforms for text upload */
|
|
11
|
+
export type TextPlatform = 'x' | 'linkedin' | 'facebook' | 'threads' | 'reddit' | 'bluesky';
|
|
12
|
+
|
|
13
|
+
/** TikTok privacy levels */
|
|
14
|
+
export type TikTokPrivacyLevel = 'PUBLIC_TO_EVERYONE' | 'MUTUAL_FOLLOW_FRIENDS' | 'FOLLOWER_OF_CREATOR' | 'SELF_ONLY';
|
|
15
|
+
|
|
16
|
+
/** TikTok post modes */
|
|
17
|
+
export type TikTokPostMode = 'DIRECT_POST' | 'MEDIA_UPLOAD';
|
|
18
|
+
|
|
19
|
+
/** Instagram media types for video */
|
|
20
|
+
export type InstagramVideoMediaType = 'REELS' | 'STORIES';
|
|
21
|
+
|
|
22
|
+
/** Instagram media types for photos */
|
|
23
|
+
export type InstagramPhotoMediaType = 'IMAGE' | 'STORIES';
|
|
24
|
+
|
|
25
|
+
/** YouTube privacy status */
|
|
26
|
+
export type YouTubePrivacyStatus = 'public' | 'unlisted' | 'private';
|
|
27
|
+
|
|
28
|
+
/** YouTube license */
|
|
29
|
+
export type YouTubeLicense = 'youtube' | 'creativeCommon';
|
|
30
|
+
|
|
31
|
+
/** LinkedIn visibility */
|
|
32
|
+
export type LinkedInVisibility = 'PUBLIC' | 'CONNECTIONS' | 'LOGGED_IN' | 'CONTAINER';
|
|
33
|
+
|
|
34
|
+
/** Facebook video state */
|
|
35
|
+
export type FacebookVideoState = 'PUBLISHED' | 'DRAFT';
|
|
36
|
+
|
|
37
|
+
/** Facebook media type */
|
|
38
|
+
export type FacebookMediaType = 'REELS' | 'STORIES';
|
|
39
|
+
|
|
40
|
+
/** X (Twitter) reply settings */
|
|
41
|
+
export type XReplySettings = 'everyone' | 'following' | 'mentionedUsers' | 'subscribers' | 'verified';
|
|
42
|
+
|
|
43
|
+
// ==================== Common Options ====================
|
|
44
|
+
|
|
45
|
+
export interface CommonUploadOptions {
|
|
46
|
+
/** Post title/caption */
|
|
47
|
+
title: string;
|
|
48
|
+
/** User identifier (profile name) */
|
|
49
|
+
user: string;
|
|
50
|
+
/** First comment to post after publishing */
|
|
51
|
+
firstComment?: string;
|
|
52
|
+
/** Alt text for accessibility */
|
|
53
|
+
altText?: string;
|
|
54
|
+
/** ISO date for scheduling (e.g., "2024-12-25T10:00:00Z") */
|
|
55
|
+
scheduledDate?: string;
|
|
56
|
+
/** Timezone for scheduled date (e.g., "Europe/Madrid") */
|
|
57
|
+
timezone?: string;
|
|
58
|
+
/** Add to posting queue instead of immediate post */
|
|
59
|
+
addToQueue?: boolean;
|
|
60
|
+
/** Process upload asynchronously (default: true) */
|
|
61
|
+
asyncUpload?: boolean;
|
|
62
|
+
|
|
63
|
+
// Platform-specific title overrides
|
|
64
|
+
blueskyTitle?: string;
|
|
65
|
+
instagramTitle?: string;
|
|
66
|
+
facebookTitle?: string;
|
|
67
|
+
tiktokTitle?: string;
|
|
68
|
+
linkedinTitle?: string;
|
|
69
|
+
xTitle?: string;
|
|
70
|
+
youtubeTitle?: string;
|
|
71
|
+
pinterestTitle?: string;
|
|
72
|
+
threadsTitle?: string;
|
|
73
|
+
|
|
74
|
+
// Platform-specific description overrides
|
|
75
|
+
description?: string;
|
|
76
|
+
linkedinDescription?: string;
|
|
77
|
+
youtubeDescription?: string;
|
|
78
|
+
facebookDescription?: string;
|
|
79
|
+
tiktokDescription?: string;
|
|
80
|
+
pinterestDescription?: string;
|
|
81
|
+
|
|
82
|
+
// Platform-specific first comment overrides
|
|
83
|
+
instagramFirstComment?: string;
|
|
84
|
+
facebookFirstComment?: string;
|
|
85
|
+
xFirstComment?: string;
|
|
86
|
+
threadsFirstComment?: string;
|
|
87
|
+
youtubeFirstComment?: string;
|
|
88
|
+
redditFirstComment?: string;
|
|
89
|
+
blueskyFirstComment?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ==================== TikTok Options ====================
|
|
93
|
+
|
|
94
|
+
export interface TikTokVideoOptions {
|
|
95
|
+
/** Privacy setting */
|
|
96
|
+
tiktokPrivacyLevel?: TikTokPrivacyLevel;
|
|
97
|
+
/** Disable duet */
|
|
98
|
+
tiktokDisableDuet?: boolean;
|
|
99
|
+
/** Disable comments */
|
|
100
|
+
tiktokDisableComment?: boolean;
|
|
101
|
+
/** Disable stitch */
|
|
102
|
+
tiktokDisableStitch?: boolean;
|
|
103
|
+
/** Timestamp in ms for video cover */
|
|
104
|
+
tiktokCoverTimestamp?: number;
|
|
105
|
+
/** AI-generated content flag */
|
|
106
|
+
tiktokIsAigc?: boolean;
|
|
107
|
+
/** Post mode */
|
|
108
|
+
tiktokPostMode?: TikTokPostMode;
|
|
109
|
+
/** Branded content toggle */
|
|
110
|
+
brandContentToggle?: boolean;
|
|
111
|
+
/** Brand organic toggle */
|
|
112
|
+
brandOrganicToggle?: boolean;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface TikTokPhotoOptions {
|
|
116
|
+
/** Auto add music */
|
|
117
|
+
tiktokAutoAddMusic?: boolean;
|
|
118
|
+
/** Disable comments */
|
|
119
|
+
tiktokDisableComment?: boolean;
|
|
120
|
+
/** Index of photo for cover (0-based) */
|
|
121
|
+
tiktokPhotoCoverIndex?: number;
|
|
122
|
+
/** Branded content toggle */
|
|
123
|
+
brandContentToggle?: boolean;
|
|
124
|
+
/** Brand organic toggle */
|
|
125
|
+
brandOrganicToggle?: boolean;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ==================== Instagram Options ====================
|
|
129
|
+
|
|
130
|
+
export interface InstagramVideoOptions {
|
|
131
|
+
/** Media type */
|
|
132
|
+
instagramMediaType?: InstagramVideoMediaType;
|
|
133
|
+
/** Share to feed */
|
|
134
|
+
instagramShareToFeed?: boolean;
|
|
135
|
+
/** Comma-separated collaborator usernames */
|
|
136
|
+
instagramCollaborators?: string;
|
|
137
|
+
/** Custom cover URL */
|
|
138
|
+
instagramCoverUrl?: string;
|
|
139
|
+
/** Audio track name */
|
|
140
|
+
instagramAudioName?: string;
|
|
141
|
+
/** Comma-separated user tags */
|
|
142
|
+
instagramUserTags?: string;
|
|
143
|
+
/** Location ID */
|
|
144
|
+
instagramLocationId?: string;
|
|
145
|
+
/** Thumbnail offset */
|
|
146
|
+
instagramThumbOffset?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface InstagramPhotoOptions {
|
|
150
|
+
/** Media type */
|
|
151
|
+
instagramMediaType?: InstagramPhotoMediaType;
|
|
152
|
+
/** Comma-separated collaborator usernames */
|
|
153
|
+
instagramCollaborators?: string;
|
|
154
|
+
/** Comma-separated user tags */
|
|
155
|
+
instagramUserTags?: string;
|
|
156
|
+
/** Location ID */
|
|
157
|
+
instagramLocationId?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ==================== YouTube Options ====================
|
|
161
|
+
|
|
162
|
+
export interface YouTubeOptions {
|
|
163
|
+
/** Video tags */
|
|
164
|
+
youtubeTags?: string | string[];
|
|
165
|
+
/** Category ID (e.g., "22" for People & Blogs) */
|
|
166
|
+
youtubeCategoryId?: string;
|
|
167
|
+
/** Privacy status */
|
|
168
|
+
youtubePrivacyStatus?: YouTubePrivacyStatus;
|
|
169
|
+
/** Allow embedding */
|
|
170
|
+
youtubeEmbeddable?: boolean;
|
|
171
|
+
/** Video license */
|
|
172
|
+
youtubeLicense?: YouTubeLicense;
|
|
173
|
+
/** Show public stats */
|
|
174
|
+
youtubePublicStatsViewable?: boolean;
|
|
175
|
+
/** Custom thumbnail URL */
|
|
176
|
+
youtubeThumbnailUrl?: string;
|
|
177
|
+
/** Made for kids flag (COPPA) */
|
|
178
|
+
youtubeSelfDeclaredMadeForKids?: boolean;
|
|
179
|
+
/** AI/synthetic content flag */
|
|
180
|
+
youtubeContainsSyntheticMedia?: boolean;
|
|
181
|
+
/** Title/description language (BCP-47) */
|
|
182
|
+
youtubeDefaultLanguage?: string;
|
|
183
|
+
/** Audio language (BCP-47) */
|
|
184
|
+
youtubeDefaultAudioLanguage?: string;
|
|
185
|
+
/** Comma-separated allowed country codes */
|
|
186
|
+
youtubeAllowedCountries?: string;
|
|
187
|
+
/** Comma-separated blocked country codes */
|
|
188
|
+
youtubeBlockedCountries?: string;
|
|
189
|
+
/** Paid product placement flag */
|
|
190
|
+
youtubeHasPaidProductPlacement?: boolean;
|
|
191
|
+
/** Recording date (ISO 8601) */
|
|
192
|
+
youtubeRecordingDate?: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// ==================== LinkedIn Options ====================
|
|
196
|
+
|
|
197
|
+
export interface LinkedInOptions {
|
|
198
|
+
/** Visibility setting */
|
|
199
|
+
linkedinVisibility?: LinkedInVisibility;
|
|
200
|
+
/** Page ID for organization posts */
|
|
201
|
+
targetLinkedinPageId?: string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// ==================== Facebook Options ====================
|
|
205
|
+
|
|
206
|
+
export interface FacebookVideoOptions {
|
|
207
|
+
/** Facebook Page ID */
|
|
208
|
+
facebookPageId?: string;
|
|
209
|
+
/** Video state */
|
|
210
|
+
facebookVideoState?: FacebookVideoState;
|
|
211
|
+
/** Media type */
|
|
212
|
+
facebookMediaType?: FacebookMediaType;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface FacebookPhotoOptions {
|
|
216
|
+
/** Facebook Page ID */
|
|
217
|
+
facebookPageId?: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface FacebookTextOptions {
|
|
221
|
+
/** Facebook Page ID */
|
|
222
|
+
facebookPageId?: string;
|
|
223
|
+
/** URL to attach as link preview */
|
|
224
|
+
facebookLinkUrl?: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// ==================== Pinterest Options ====================
|
|
228
|
+
|
|
229
|
+
export interface PinterestVideoOptions {
|
|
230
|
+
/** Board ID */
|
|
231
|
+
pinterestBoardId?: string;
|
|
232
|
+
/** Destination link */
|
|
233
|
+
pinterestLink?: string;
|
|
234
|
+
/** Cover image URL */
|
|
235
|
+
pinterestCoverImageUrl?: string;
|
|
236
|
+
/** Cover image content type */
|
|
237
|
+
pinterestCoverImageContentType?: string;
|
|
238
|
+
/** Base64-encoded cover image data */
|
|
239
|
+
pinterestCoverImageData?: string;
|
|
240
|
+
/** Key frame time in ms for cover */
|
|
241
|
+
pinterestCoverImageKeyFrameTime?: number;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface PinterestPhotoOptions {
|
|
245
|
+
/** Board ID */
|
|
246
|
+
pinterestBoardId?: string;
|
|
247
|
+
/** Alt text */
|
|
248
|
+
pinterestAltText?: string;
|
|
249
|
+
/** Destination link */
|
|
250
|
+
pinterestLink?: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// ==================== X (Twitter) Options ====================
|
|
254
|
+
|
|
255
|
+
export interface XBaseOptions {
|
|
256
|
+
/** Who can reply */
|
|
257
|
+
xReplySettings?: XReplySettings;
|
|
258
|
+
/** Promoted-only post */
|
|
259
|
+
xNullcast?: boolean;
|
|
260
|
+
/** Geographic place ID */
|
|
261
|
+
xGeoPlaceId?: string;
|
|
262
|
+
/** Exclusive for super followers */
|
|
263
|
+
xForSuperFollowersOnly?: boolean;
|
|
264
|
+
/** Community ID */
|
|
265
|
+
xCommunityId?: string;
|
|
266
|
+
/** Share community post with followers */
|
|
267
|
+
xShareWithFollowers?: boolean;
|
|
268
|
+
/** Direct message deep link */
|
|
269
|
+
xDirectMessageDeepLink?: string;
|
|
270
|
+
/** Post long text as single post */
|
|
271
|
+
xLongTextAsPost?: boolean;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface XMediaOptions extends XBaseOptions {
|
|
275
|
+
/** User IDs to tag */
|
|
276
|
+
xTaggedUserIds?: string | string[];
|
|
277
|
+
/** Location place ID */
|
|
278
|
+
xPlaceId?: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface XTextOptions extends XBaseOptions {
|
|
282
|
+
/** URL to attach */
|
|
283
|
+
xPostUrl?: string;
|
|
284
|
+
/** Tweet ID to quote */
|
|
285
|
+
xQuoteTweetId?: string;
|
|
286
|
+
/** Poll options (2-4 options) */
|
|
287
|
+
xPollOptions?: string | string[];
|
|
288
|
+
/** Poll duration in minutes (5-10080) */
|
|
289
|
+
xPollDuration?: number;
|
|
290
|
+
/** Who can reply to poll */
|
|
291
|
+
xPollReplySettings?: XReplySettings;
|
|
292
|
+
/** Card URI for Twitter Cards */
|
|
293
|
+
xCardUri?: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// ==================== Threads Options ====================
|
|
297
|
+
|
|
298
|
+
export interface ThreadsOptions {
|
|
299
|
+
/** Post long text as single post (vs thread) */
|
|
300
|
+
threadsLongTextAsPost?: boolean;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// ==================== Reddit Options ====================
|
|
304
|
+
|
|
305
|
+
export interface RedditOptions {
|
|
306
|
+
/** Subreddit name (without r/) */
|
|
307
|
+
redditSubreddit?: string;
|
|
308
|
+
/** Flair template ID */
|
|
309
|
+
redditFlairId?: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// ==================== Combined Upload Options ====================
|
|
313
|
+
|
|
314
|
+
export interface UploadVideoOptions extends CommonUploadOptions,
|
|
315
|
+
TikTokVideoOptions,
|
|
316
|
+
InstagramVideoOptions,
|
|
317
|
+
YouTubeOptions,
|
|
318
|
+
LinkedInOptions,
|
|
319
|
+
FacebookVideoOptions,
|
|
320
|
+
PinterestVideoOptions,
|
|
321
|
+
XMediaOptions,
|
|
322
|
+
ThreadsOptions {
|
|
323
|
+
/** Target platforms */
|
|
324
|
+
platforms: VideoPlatform[];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface UploadPhotosOptions extends CommonUploadOptions,
|
|
328
|
+
TikTokPhotoOptions,
|
|
329
|
+
InstagramPhotoOptions,
|
|
330
|
+
LinkedInOptions,
|
|
331
|
+
FacebookPhotoOptions,
|
|
332
|
+
PinterestPhotoOptions,
|
|
333
|
+
XMediaOptions,
|
|
334
|
+
ThreadsOptions,
|
|
335
|
+
RedditOptions {
|
|
336
|
+
/** Target platforms */
|
|
337
|
+
platforms: PhotoPlatform[];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface UploadTextOptions extends CommonUploadOptions,
|
|
341
|
+
LinkedInOptions,
|
|
342
|
+
FacebookTextOptions,
|
|
343
|
+
XTextOptions,
|
|
344
|
+
ThreadsOptions,
|
|
345
|
+
RedditOptions {
|
|
346
|
+
/** Target platforms */
|
|
347
|
+
platforms: TextPlatform[];
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface UploadDocumentOptions {
|
|
351
|
+
/** Post title/caption */
|
|
4
352
|
title: string;
|
|
5
|
-
/** User identifier */
|
|
353
|
+
/** User identifier (profile name) */
|
|
6
354
|
user: string;
|
|
7
|
-
/**
|
|
8
|
-
|
|
355
|
+
/** Document description/commentary */
|
|
356
|
+
description?: string;
|
|
357
|
+
/** Visibility setting */
|
|
358
|
+
linkedinVisibility?: LinkedInVisibility;
|
|
359
|
+
/** Page ID for organization posts */
|
|
360
|
+
targetLinkedinPageId?: string;
|
|
361
|
+
/** ISO date for scheduling */
|
|
362
|
+
scheduledDate?: string;
|
|
363
|
+
/** Timezone for scheduled date */
|
|
364
|
+
timezone?: string;
|
|
365
|
+
/** Add to posting queue */
|
|
366
|
+
addToQueue?: boolean;
|
|
367
|
+
/** Process upload asynchronously */
|
|
368
|
+
asyncUpload?: boolean;
|
|
9
369
|
}
|
|
10
370
|
|
|
371
|
+
// ==================== Response Types ====================
|
|
372
|
+
|
|
373
|
+
export interface UploadResponse {
|
|
374
|
+
success: boolean;
|
|
375
|
+
request_id?: string;
|
|
376
|
+
message?: string;
|
|
377
|
+
data?: {
|
|
378
|
+
status?: string;
|
|
379
|
+
platforms?: Array<{
|
|
380
|
+
name: string;
|
|
381
|
+
url?: string;
|
|
382
|
+
error?: string;
|
|
383
|
+
}>;
|
|
384
|
+
[key: string]: any;
|
|
385
|
+
};
|
|
386
|
+
[key: string]: any;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export interface StatusResponse {
|
|
390
|
+
success: boolean;
|
|
391
|
+
status?: string;
|
|
392
|
+
request_id?: string;
|
|
393
|
+
data?: any;
|
|
394
|
+
[key: string]: any;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
export interface HistoryResponse {
|
|
398
|
+
success: boolean;
|
|
399
|
+
uploads?: any[];
|
|
400
|
+
page?: number;
|
|
401
|
+
total?: number;
|
|
402
|
+
[key: string]: any;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export interface AnalyticsResponse {
|
|
406
|
+
success: boolean;
|
|
407
|
+
analytics?: any;
|
|
408
|
+
[key: string]: any;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface ScheduledResponse {
|
|
412
|
+
success: boolean;
|
|
413
|
+
scheduled?: any[];
|
|
414
|
+
[key: string]: any;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface UserProfile {
|
|
418
|
+
username: string;
|
|
419
|
+
social_accounts?: Record<string, any>;
|
|
420
|
+
created_at?: string;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export interface UsersResponse {
|
|
424
|
+
success: boolean;
|
|
425
|
+
profiles?: UserProfile[];
|
|
426
|
+
[key: string]: any;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface JwtResponse {
|
|
430
|
+
success: boolean;
|
|
431
|
+
jwt?: string;
|
|
432
|
+
connection_url?: string;
|
|
433
|
+
[key: string]: any;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export interface PagesResponse {
|
|
437
|
+
success: boolean;
|
|
438
|
+
pages?: Array<{ id: string; name?: string }>;
|
|
439
|
+
[key: string]: any;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface BoardsResponse {
|
|
443
|
+
success: boolean;
|
|
444
|
+
boards?: Array<{ id: string; name?: string }>;
|
|
445
|
+
[key: string]: any;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// ==================== Client Class ====================
|
|
449
|
+
|
|
11
450
|
/**
|
|
12
451
|
* Upload-Post API client
|
|
452
|
+
*
|
|
453
|
+
* Supports uploading to: TikTok, Instagram, YouTube, LinkedIn, Facebook,
|
|
454
|
+
* Pinterest, Threads, Reddit, Bluesky, X (Twitter)
|
|
13
455
|
*/
|
|
14
456
|
export class UploadPost {
|
|
15
457
|
/**
|
|
458
|
+
* Create a new Upload-Post client
|
|
16
459
|
* @param apiKey - Your API key from Upload-Post
|
|
17
460
|
*/
|
|
18
461
|
constructor(apiKey: string);
|
|
19
462
|
|
|
463
|
+
// Upload methods
|
|
20
464
|
/**
|
|
21
|
-
* Upload video to social media platforms
|
|
22
|
-
* @param
|
|
465
|
+
* Upload a video to social media platforms
|
|
466
|
+
* @param videoPathOrUrl - Path to video file or video URL
|
|
23
467
|
* @param options - Upload options
|
|
24
|
-
* @returns Promise with API response
|
|
25
468
|
*/
|
|
26
|
-
upload(
|
|
469
|
+
upload(videoPathOrUrl: string, options: UploadVideoOptions): Promise<UploadResponse>;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Upload photos to social media platforms
|
|
473
|
+
* @param photosPathsOrUrls - Array of photo file paths or URLs
|
|
474
|
+
* @param options - Upload options
|
|
475
|
+
*/
|
|
476
|
+
uploadPhotos(photosPathsOrUrls: string[], options: UploadPhotosOptions): Promise<UploadResponse>;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Upload text posts to social media platforms
|
|
480
|
+
* @param options - Upload options
|
|
481
|
+
*/
|
|
482
|
+
uploadText(options: UploadTextOptions): Promise<UploadResponse>;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Upload a document to LinkedIn (PDF, PPT, PPTX, DOC, DOCX)
|
|
486
|
+
* @param documentPathOrUrl - Path to document file or document URL
|
|
487
|
+
* @param options - Upload options
|
|
488
|
+
*/
|
|
489
|
+
uploadDocument(documentPathOrUrl: string, options: UploadDocumentOptions): Promise<UploadResponse>;
|
|
490
|
+
|
|
491
|
+
// Status & History
|
|
492
|
+
/**
|
|
493
|
+
* Get the status of an async upload
|
|
494
|
+
* @param requestId - The request_id from an async upload
|
|
495
|
+
*/
|
|
496
|
+
getStatus(requestId: string): Promise<StatusResponse>;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Get upload history
|
|
500
|
+
* @param options - Query options
|
|
501
|
+
*/
|
|
502
|
+
getHistory(options?: { page?: number; limit?: number }): Promise<HistoryResponse>;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Get analytics for a profile
|
|
506
|
+
* @param profileUsername - Profile username
|
|
507
|
+
* @param options - Query options
|
|
508
|
+
*/
|
|
509
|
+
getAnalytics(profileUsername: string, options?: { platforms?: string[] }): Promise<AnalyticsResponse>;
|
|
510
|
+
|
|
511
|
+
// Scheduled Posts
|
|
512
|
+
/**
|
|
513
|
+
* List scheduled posts
|
|
514
|
+
*/
|
|
515
|
+
listScheduled(): Promise<ScheduledResponse>;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Cancel a scheduled post
|
|
519
|
+
* @param jobId - Scheduled job ID
|
|
520
|
+
*/
|
|
521
|
+
cancelScheduled(jobId: string): Promise<{ success: boolean }>;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Edit a scheduled post
|
|
525
|
+
* @param jobId - Scheduled job ID
|
|
526
|
+
* @param options - Edit options
|
|
527
|
+
*/
|
|
528
|
+
editScheduled(jobId: string, options: { scheduledDate?: string; timezone?: string }): Promise<{ success: boolean }>;
|
|
529
|
+
|
|
530
|
+
// User Management
|
|
531
|
+
/**
|
|
532
|
+
* List all users/profiles
|
|
533
|
+
*/
|
|
534
|
+
listUsers(): Promise<UsersResponse>;
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Create a new user/profile
|
|
538
|
+
* @param username - Profile name to create
|
|
539
|
+
*/
|
|
540
|
+
createUser(username: string): Promise<{ success: boolean; username?: string }>;
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Delete a user/profile
|
|
544
|
+
* @param username - Profile name to delete
|
|
545
|
+
*/
|
|
546
|
+
deleteUser(username: string): Promise<{ success: boolean }>;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Generate a JWT for platform integration
|
|
550
|
+
* @param username - Profile username
|
|
551
|
+
* @param options - JWT options
|
|
552
|
+
*/
|
|
553
|
+
generateJwt(username: string, options?: {
|
|
554
|
+
redirectUrl?: string;
|
|
555
|
+
logoImage?: string;
|
|
556
|
+
redirectButtonText?: string;
|
|
557
|
+
platforms?: string[];
|
|
558
|
+
}): Promise<JwtResponse>;
|
|
559
|
+
|
|
560
|
+
/**
|
|
561
|
+
* Validate a JWT token
|
|
562
|
+
* @param jwt - JWT token to validate
|
|
563
|
+
*/
|
|
564
|
+
validateJwt(jwt: string): Promise<{ success: boolean; valid?: boolean }>;
|
|
565
|
+
|
|
566
|
+
// Helper Endpoints
|
|
567
|
+
/**
|
|
568
|
+
* Get Facebook pages for a profile
|
|
569
|
+
* @param profile - Profile username
|
|
570
|
+
*/
|
|
571
|
+
getFacebookPages(profile?: string): Promise<PagesResponse>;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Get LinkedIn pages for a profile
|
|
575
|
+
* @param profile - Profile username
|
|
576
|
+
*/
|
|
577
|
+
getLinkedinPages(profile?: string): Promise<PagesResponse>;
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* Get Pinterest boards for a profile
|
|
581
|
+
* @param profile - Profile username
|
|
582
|
+
*/
|
|
583
|
+
getPinterestBoards(profile?: string): Promise<BoardsResponse>;
|
|
27
584
|
}
|
|
585
|
+
|
|
586
|
+
export default UploadPost;
|
|
28
587
|
}
|