upload-post 1.0.3 → 2.0.4

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 CHANGED
@@ -1,175 +1,597 @@
1
1
  declare module 'upload-post' {
2
- export interface UploadOptions {
3
- /** Video title */
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' | 'VIDEO';
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 */
4
47
  title: string;
5
- /** User identifier */
6
- user: string;
7
- /** Array of target platforms. Supported: tiktok, instagram, linkedin, youtube, facebook, twitter, threads, pinterest */
8
- platforms: string[];
9
- /** The video file to upload (can be a file upload or a video URL) */
10
- video?: string; // Already handled by videoPath parameter, but good to have for consistency if API supports 'video' form field directly for URLs
11
-
12
- // TikTok specific
13
- privacy_level?: 'PUBLIC_TO_EVERYONE' | 'MUTUAL_FOLLOW_FRIENDS' | 'FOLLOWER_OF_CREATOR' | 'SELF_ONLY';
14
- disable_duet?: boolean;
15
- disable_comment?: boolean; // Note: also a common param for photos on TikTok
16
- disable_stitch?: boolean;
17
- cover_timestamp?: number;
18
- brand_content_toggle?: boolean;
19
- brand_organic?: boolean;
20
- branded_content?: boolean; // Note: also a common param for photos on TikTok
21
- brand_organic_toggle?: boolean;
22
- is_aigc?: boolean;
23
-
24
- // Instagram specific
25
- media_type?: 'REELS' | 'STORIES'; // Note: also a param for photos, but with different values
26
- share_to_feed?: boolean;
27
- collaborators?: string; // Comma-separated list
28
- cover_url?: string;
29
- audio_name?: string;
30
- user_tags?: string; // Comma-separated list
31
- location_id?: string;
32
- thumb_offset?: string;
33
-
34
- // LinkedIn specific
35
- description?: string; // Note: also a common param for photos on TikTok & FB videos
36
- visibility?: 'CONNECTIONS' | 'PUBLIC' | 'LOGGED_IN' | 'CONTAINER'; // Note: different values than photo visibility
37
- target_linkedin_page_id?: string; // Note: also a param for photos
38
-
39
- // YouTube specific
40
- // description?: string; // Already listed under LinkedIn, will be used if provided
41
- tags?: string[];
42
- categoryId?: string;
43
- privacyStatus?: 'public' | 'unlisted' | 'private';
44
- embeddable?: boolean;
45
- license?: 'youtube' | 'creativeCommon';
46
- publicStatsViewable?: boolean;
47
- madeForKids?: boolean;
48
-
49
- // Facebook specific
50
- facebook_page_id?: string; // Note: also a param for photos
51
- // description?: string; // Already listed under LinkedIn
52
- video_state?: 'DRAFT' | 'PUBLISHED' | 'SCHEDULED';
53
-
54
- // Threads specific
55
- // description?: string; // Already listed under LinkedIn
56
-
57
- // X (Twitter) specific
58
- tagged_user_ids?: string[];
59
- reply_settings?: 'following' | 'mentionedUsers' | 'everyone';
60
- nullcast?: boolean;
61
- place_id?: string;
62
- poll_duration?: number; // in minutes
63
- poll_options?: string[];
64
- poll_reply_settings?: 'following' | 'mentionedUsers' | 'everyone';
65
-
66
- // Pinterest specific
67
- pinterest_board_id?: string; // Note: also a param for photos
68
- pinterest_link?: string; // Note: also a param for photos
69
- pinterest_cover_image_url?: string;
70
- pinterest_cover_image_content_type?: string;
71
- pinterest_cover_image_data?: string; // Base64 encoded
72
- pinterest_cover_image_key_frame_time?: number; // in milliseconds
73
- }
74
-
75
- export interface UploadPhotosOptions {
76
- /** User identifier */
48
+ /** User identifier (profile name) */
77
49
  user: string;
78
- /** Array of target platforms. Supported: tiktok, instagram, linkedin, facebook, x, threads, pinterest */
79
- platforms: string[];
80
- /** Array of photo file paths or URLs */
81
- photos: string[];
82
- /** Title of the post */
83
- title: string;
84
- /** Caption/description for the photos (this will be used as the post commentary) */
85
- caption?: string;
86
-
87
- // LinkedIn specific
88
- /** Visibility setting for the LinkedIn post (accepted value: "PUBLIC") */
89
- visibility?: 'PUBLIC';
90
- /** LinkedIn page ID to upload photos to an organization */
91
- target_linkedin_page_id?: string;
92
-
93
- // Facebook specific
94
- /** Facebook Page ID where the photos will be posted */
95
- facebook_page_id?: string;
96
-
97
- // TikTok specific
98
- /** Automatically add background music to photos */
99
- auto_add_music?: boolean;
100
- /** Disable comments on the post */
101
- disable_comment?: boolean;
102
- /** Indicate if the post is branded content (requires disclose_commercial=true) */
103
- branded_content?: boolean;
104
- /** Disclose the commercial nature of the post (used with branded_content) */
105
- disclose_commercial?: boolean;
106
- /** Index (starting at 0) of the photo to use as the cover/thumbnail for the TikTok photo post */
107
- photo_cover_index?: number;
108
- /** Description for the TikTok post. If not provided, the title value will be used by default. */
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
109
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
+ }
110
91
 
111
- // Instagram specific
112
- /** Type of media ("IMAGE" or "STORIES") */
113
- media_type?: 'IMAGE' | 'STORIES';
92
+ // ==================== TikTok Options ====================
114
93
 
115
- // Pinterest specific
116
- /** Pinterest board ID to publish the photo to. */
117
- pinterest_board_id?: string;
118
- /** Alt text for the image. */
119
- pinterest_alt_text?: string;
120
- /** Destination link for the photo Pin. */
121
- pinterest_link?: string;
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;
122
113
  }
123
114
 
124
- export interface UploadTextOptions {
125
- /** User identifier */
126
- user: string;
127
- /** Array of target platforms. Supported: linkedin, x, facebook, threads */
128
- platforms: ('linkedin' | 'x' | 'facebook' | 'threads')[];
129
- /** The text content for the post. This will be used as the 'title' parameter for all supported platforms. */
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
+ /** Thumbnail URL for normal page videos (only when facebookMediaType is 'VIDEO') */
214
+ thumbnailUrl?: string;
215
+ }
216
+
217
+ export interface FacebookPhotoOptions {
218
+ /** Facebook Page ID */
219
+ facebookPageId?: string;
220
+ }
221
+
222
+ export interface FacebookTextOptions {
223
+ /** Facebook Page ID */
224
+ facebookPageId?: string;
225
+ /** URL to attach as link preview */
226
+ facebookLinkUrl?: string;
227
+ }
228
+
229
+ // ==================== Pinterest Options ====================
230
+
231
+ export interface PinterestVideoOptions {
232
+ /** Board ID */
233
+ pinterestBoardId?: string;
234
+ /** Destination link */
235
+ pinterestLink?: string;
236
+ /** Cover image URL */
237
+ pinterestCoverImageUrl?: string;
238
+ /** Cover image content type */
239
+ pinterestCoverImageContentType?: string;
240
+ /** Base64-encoded cover image data */
241
+ pinterestCoverImageData?: string;
242
+ /** Key frame time in ms for cover */
243
+ pinterestCoverImageKeyFrameTime?: number;
244
+ }
245
+
246
+ export interface PinterestPhotoOptions {
247
+ /** Board ID */
248
+ pinterestBoardId?: string;
249
+ /** Alt text */
250
+ pinterestAltText?: string;
251
+ /** Destination link */
252
+ pinterestLink?: string;
253
+ }
254
+
255
+ // ==================== X (Twitter) Options ====================
256
+
257
+ export interface XBaseOptions {
258
+ /** Who can reply */
259
+ xReplySettings?: XReplySettings;
260
+ /** Promoted-only post */
261
+ xNullcast?: boolean;
262
+ /** Geographic place ID */
263
+ xGeoPlaceId?: string;
264
+ /** Exclusive for super followers */
265
+ xForSuperFollowersOnly?: boolean;
266
+ /** Community ID */
267
+ xCommunityId?: string;
268
+ /** Share community post with followers */
269
+ xShareWithFollowers?: boolean;
270
+ /** Direct message deep link */
271
+ xDirectMessageDeepLink?: string;
272
+ /** Post long text as single post */
273
+ xLongTextAsPost?: boolean;
274
+ }
275
+
276
+ export interface XMediaOptions extends XBaseOptions {
277
+ /** User IDs to tag */
278
+ xTaggedUserIds?: string | string[];
279
+ /** Location place ID */
280
+ xPlaceId?: string;
281
+ /** Comma-separated image layout for thread (e.g. "4,4" or "2,3,1"). Each value 1-4, total must equal image count. */
282
+ xThreadImageLayout?: string;
283
+ }
284
+
285
+ export interface XTextOptions extends XBaseOptions {
286
+ /** URL to attach */
287
+ xPostUrl?: string;
288
+ /** Tweet ID to quote */
289
+ xQuoteTweetId?: string;
290
+ /** Poll options (2-4 options) */
291
+ xPollOptions?: string | string[];
292
+ /** Poll duration in minutes (5-10080) */
293
+ xPollDuration?: number;
294
+ /** Who can reply to poll */
295
+ xPollReplySettings?: XReplySettings;
296
+ /** Card URI for Twitter Cards */
297
+ xCardUri?: string;
298
+ }
299
+
300
+ // ==================== Threads Options ====================
301
+
302
+ export interface ThreadsOptions {
303
+ /** Post long text as single post (vs thread) */
304
+ threadsLongTextAsPost?: boolean;
305
+ /** Comma-separated list of how many media items per Threads post (e.g. "5,5"). Each value 1-10, total must equal file count. */
306
+ threadsThreadMediaLayout?: string;
307
+ }
308
+
309
+ // ==================== Reddit Options ====================
310
+
311
+ export interface RedditOptions {
312
+ /** Subreddit name (without r/) */
313
+ redditSubreddit?: string;
314
+ /** Flair template ID */
315
+ redditFlairId?: string;
316
+ }
317
+
318
+ // ==================== Combined Upload Options ====================
319
+
320
+ export interface UploadVideoOptions extends CommonUploadOptions,
321
+ TikTokVideoOptions,
322
+ InstagramVideoOptions,
323
+ YouTubeOptions,
324
+ LinkedInOptions,
325
+ FacebookVideoOptions,
326
+ PinterestVideoOptions,
327
+ XMediaOptions,
328
+ ThreadsOptions {
329
+ /** Target platforms */
330
+ platforms: VideoPlatform[];
331
+ }
332
+
333
+ export interface UploadPhotosOptions extends CommonUploadOptions,
334
+ TikTokPhotoOptions,
335
+ InstagramPhotoOptions,
336
+ LinkedInOptions,
337
+ FacebookPhotoOptions,
338
+ PinterestPhotoOptions,
339
+ XMediaOptions,
340
+ ThreadsOptions,
341
+ RedditOptions {
342
+ /** Target platforms */
343
+ platforms: PhotoPlatform[];
344
+ }
345
+
346
+ export interface UploadTextOptions extends CommonUploadOptions,
347
+ LinkedInOptions,
348
+ FacebookTextOptions,
349
+ XTextOptions,
350
+ ThreadsOptions,
351
+ RedditOptions {
352
+ /** Target platforms */
353
+ platforms: TextPlatform[];
354
+ }
355
+
356
+ export interface UploadDocumentOptions {
357
+ /** Post title/caption */
130
358
  title: string;
359
+ /** User identifier (profile name) */
360
+ user: string;
361
+ /** Document description/commentary */
362
+ description?: string;
363
+ /** Visibility setting */
364
+ linkedinVisibility?: LinkedInVisibility;
365
+ /** Page ID for organization posts */
366
+ targetLinkedinPageId?: string;
367
+ /** ISO date for scheduling */
368
+ scheduledDate?: string;
369
+ /** Timezone for scheduled date */
370
+ timezone?: string;
371
+ /** Add to posting queue */
372
+ addToQueue?: boolean;
373
+ /** Process upload asynchronously */
374
+ asyncUpload?: boolean;
375
+ }
376
+
377
+ // ==================== Response Types ====================
131
378
 
132
- // LinkedIn specific
133
- /** LinkedIn page ID to upload text to an organization's page. */
134
- target_linkedin_page_id?: string;
379
+ export interface UploadResponse {
380
+ success: boolean;
381
+ request_id?: string;
382
+ message?: string;
383
+ data?: {
384
+ status?: string;
385
+ platforms?: Array<{
386
+ name: string;
387
+ url?: string;
388
+ error?: string;
389
+ }>;
390
+ [key: string]: any;
391
+ };
392
+ [key: string]: any;
393
+ }
394
+
395
+ export interface StatusResponse {
396
+ success: boolean;
397
+ status?: string;
398
+ request_id?: string;
399
+ data?: any;
400
+ [key: string]: any;
401
+ }
402
+
403
+ export interface HistoryResponse {
404
+ success: boolean;
405
+ uploads?: any[];
406
+ page?: number;
407
+ total?: number;
408
+ [key: string]: any;
409
+ }
410
+
411
+ export interface AnalyticsResponse {
412
+ success: boolean;
413
+ analytics?: any;
414
+ [key: string]: any;
415
+ }
416
+
417
+ export interface ScheduledResponse {
418
+ success: boolean;
419
+ scheduled?: any[];
420
+ [key: string]: any;
421
+ }
422
+
423
+ export interface UserProfile {
424
+ username: string;
425
+ social_accounts?: Record<string, any>;
426
+ created_at?: string;
427
+ }
428
+
429
+ export interface UsersResponse {
430
+ success: boolean;
431
+ profiles?: UserProfile[];
432
+ [key: string]: any;
433
+ }
434
+
435
+ export interface JwtResponse {
436
+ success: boolean;
437
+ jwt?: string;
438
+ connection_url?: string;
439
+ [key: string]: any;
440
+ }
135
441
 
136
- // Facebook specific
137
- /** Facebook Page ID where the text will be posted. Required if 'facebook' is in platforms. */
138
- facebook_page_id?: string;
442
+ export interface PagesResponse {
443
+ success: boolean;
444
+ pages?: Array<{ id: string; name?: string }>;
445
+ [key: string]: any;
446
+ }
139
447
 
140
- // X (Twitter) and Threads do not have additional specific parameters beyond 'title' for the text content.
448
+ export interface BoardsResponse {
449
+ success: boolean;
450
+ boards?: Array<{ id: string; name?: string }>;
451
+ [key: string]: any;
141
452
  }
142
453
 
454
+ // ==================== Client Class ====================
455
+
143
456
  /**
144
457
  * Upload-Post API client
458
+ *
459
+ * Supports uploading to: TikTok, Instagram, YouTube, LinkedIn, Facebook,
460
+ * Pinterest, Threads, Reddit, Bluesky, X (Twitter)
145
461
  */
146
462
  export class UploadPost {
147
463
  /**
464
+ * Create a new Upload-Post client
148
465
  * @param apiKey - Your API key from Upload-Post
149
466
  */
150
467
  constructor(apiKey: string);
151
468
 
469
+ // Upload methods
152
470
  /**
153
- * Upload video to social media platforms
154
- * @param videoPath - Path to video file
471
+ * Upload a video to social media platforms
472
+ * @param videoPathOrUrl - Path to video file or video URL
155
473
  * @param options - Upload options
156
- * @returns Promise with API response
157
474
  */
158
- upload(videoPath: string, options: UploadOptions): Promise<object>;
475
+ upload(videoPathOrUrl: string, options: UploadVideoOptions): Promise<UploadResponse>;
159
476
 
160
477
  /**
161
478
  * Upload photos to social media platforms
162
- * @param photos - Array of photo file paths or URLs
163
- * @param options - Upload photos options
164
- * @returns Promise with API response
479
+ * @param photosPathsOrUrls - Array of photo file paths or URLs
480
+ * @param options - Upload options
165
481
  */
166
- uploadPhotos(photos: string[], options: UploadPhotosOptions): Promise<object>;
482
+ uploadPhotos(photosPathsOrUrls: string[], options: UploadPhotosOptions): Promise<UploadResponse>;
167
483
 
168
484
  /**
169
485
  * Upload text posts to social media platforms
170
- * @param options - Upload text options
171
- * @returns Promise with API response
486
+ * @param options - Upload options
487
+ */
488
+ uploadText(options: UploadTextOptions): Promise<UploadResponse>;
489
+
490
+ /**
491
+ * Upload a document to LinkedIn (PDF, PPT, PPTX, DOC, DOCX)
492
+ * @param documentPathOrUrl - Path to document file or document URL
493
+ * @param options - Upload options
494
+ */
495
+ uploadDocument(documentPathOrUrl: string, options: UploadDocumentOptions): Promise<UploadResponse>;
496
+
497
+ // Status & History
498
+ /**
499
+ * Get the status of an async upload
500
+ * @param requestId - The request_id from an async upload
501
+ */
502
+ getStatus(requestId: string): Promise<StatusResponse>;
503
+
504
+ /**
505
+ * Get upload history
506
+ * @param options - Query options
507
+ */
508
+ getHistory(options?: { page?: number; limit?: number }): Promise<HistoryResponse>;
509
+
510
+ /**
511
+ * Get analytics for a profile
512
+ * @param profileUsername - Profile username
513
+ * @param options - Query options
172
514
  */
173
- uploadText(options: UploadTextOptions): Promise<object>;
515
+ getAnalytics(profileUsername: string, options?: { platforms?: string[] }): Promise<AnalyticsResponse>;
516
+
517
+ // Scheduled Posts
518
+ /**
519
+ * List scheduled posts
520
+ */
521
+ listScheduled(): Promise<ScheduledResponse>;
522
+
523
+ /**
524
+ * Cancel a scheduled post
525
+ * @param jobId - Scheduled job ID
526
+ */
527
+ cancelScheduled(jobId: string): Promise<{ success: boolean }>;
528
+
529
+ /**
530
+ * Edit a scheduled post
531
+ * @param jobId - Scheduled job ID
532
+ * @param options - Edit options
533
+ */
534
+ editScheduled(jobId: string, options: { scheduledDate?: string; timezone?: string }): Promise<{ success: boolean }>;
535
+
536
+ // User Management
537
+ /**
538
+ * List all users/profiles
539
+ */
540
+ listUsers(): Promise<UsersResponse>;
541
+
542
+ /**
543
+ * Create a new user/profile
544
+ * @param username - Profile name to create
545
+ */
546
+ createUser(username: string): Promise<{ success: boolean; username?: string }>;
547
+
548
+ /**
549
+ * Delete a user/profile
550
+ * @param username - Profile name to delete
551
+ */
552
+ deleteUser(username: string): Promise<{ success: boolean }>;
553
+
554
+ /**
555
+ * Generate a JWT for platform integration
556
+ * @param username - Profile username
557
+ * @param options - JWT options
558
+ */
559
+ generateJwt(username: string, options?: {
560
+ redirectUrl?: string;
561
+ logoImage?: string;
562
+ redirectButtonText?: string;
563
+ platforms?: string[];
564
+ showCalendar?: boolean;
565
+ readonlyCalendar?: boolean;
566
+ connectTitle?: string;
567
+ connectDescription?: string;
568
+ }): Promise<JwtResponse>;
569
+
570
+ /**
571
+ * Validate a JWT token
572
+ * @param jwt - JWT token to validate
573
+ */
574
+ validateJwt(jwt: string): Promise<{ success: boolean; valid?: boolean }>;
575
+
576
+ // Helper Endpoints
577
+ /**
578
+ * Get Facebook pages for a profile
579
+ * @param profile - Profile username
580
+ */
581
+ getFacebookPages(profile?: string): Promise<PagesResponse>;
582
+
583
+ /**
584
+ * Get LinkedIn pages for a profile
585
+ * @param profile - Profile username
586
+ */
587
+ getLinkedinPages(profile?: string): Promise<PagesResponse>;
588
+
589
+ /**
590
+ * Get Pinterest boards for a profile
591
+ * @param profile - Profile username
592
+ */
593
+ getPinterestBoards(profile?: string): Promise<BoardsResponse>;
174
594
  }
595
+
596
+ export default UploadPost;
175
597
  }