@posty5/social-publisher-post 3.0.0 → 4.0.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 +986 -957
- package/dist/index.d.mts +232 -52
- package/dist/index.d.ts +232 -52
- package/dist/index.js +58 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +58 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +61 -61
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,16 @@ type SocialPublisherPostType = "shortVideo";
|
|
|
5
5
|
type SocialPublisherPostAccountType = "youtube" | "facebook" | "instagram" | "tiktok";
|
|
6
6
|
type SocialPublisherPostScheduleType = "now" | "schedule";
|
|
7
7
|
type SocialPublisherPostSourceType = "video-file" | "video-url" | "facebook-video" | "youtube-video" | "tiktok-video";
|
|
8
|
+
/**
|
|
9
|
+
* Status of the optional post-publish comment, reported per-platform.
|
|
10
|
+
* - `pending`: queued, waiting for the parent post to be published
|
|
11
|
+
* - `processing`: comment request is in flight
|
|
12
|
+
* - `done`: comment posted successfully
|
|
13
|
+
* - `error`: comment failed (see `currentError`)
|
|
14
|
+
* - `skipped`: caller opted out for this platform (e.g. postToFacebook=false)
|
|
15
|
+
* - `notSupported`: platform does not allow programmatic comments (TikTok)
|
|
16
|
+
*/
|
|
17
|
+
type CommentStatusType = "pending" | "processing" | "done" | "error" | "skipped" | "notSupported";
|
|
8
18
|
type SocialPublisherAccountPlatformType = "youtube" | "facebook" | "tiktok";
|
|
9
19
|
type SocialPublisherAccountAccountType = "facebook" | "instagram" | "youtube" | "tiktok";
|
|
10
20
|
type SocialPublisherAccountStatusType = "active" | "inactive" | "authenticationExpired";
|
|
@@ -39,14 +49,91 @@ interface IScheduleConfig {
|
|
|
39
49
|
type: SocialPublisherPostScheduleType;
|
|
40
50
|
scheduledAt?: Date;
|
|
41
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Image-post source — uploaded to our bucket or fetched from a public URL.
|
|
54
|
+
*/
|
|
55
|
+
type ImageSourceType = "image-file" | "image-url";
|
|
56
|
+
/**
|
|
57
|
+
* Image-post media block. One of `bucketKey` (uploaded) or `externalUrl`
|
|
58
|
+
* (image-url) must be provided, matching the `source` discriminator.
|
|
59
|
+
*/
|
|
60
|
+
interface IImageMediaRequest {
|
|
61
|
+
source: ImageSourceType;
|
|
62
|
+
/** Bucket file URL returned by `generate-upload-urls` (when source = image-file). */
|
|
63
|
+
bucketKey?: string;
|
|
64
|
+
/** Direct public image URL (when source = image-url). */
|
|
65
|
+
externalUrl?: string;
|
|
66
|
+
/** Optional metadata — server uses for soft validation. */
|
|
67
|
+
width?: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
/** e.g. "image/jpeg", "image/png", "image/webp". */
|
|
70
|
+
mimeType?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Image-post create request (workspace target).
|
|
74
|
+
* Image posts cost **5 credits** + 1 for an optional auto-comment.
|
|
75
|
+
* YouTube community posts are always reported as `notSupported`.
|
|
76
|
+
*/
|
|
77
|
+
interface ICreateImagePostToWorkspaceRequest {
|
|
78
|
+
/** Workspace ID. */
|
|
79
|
+
workspaceId: string;
|
|
80
|
+
image: IImageMediaRequest;
|
|
81
|
+
/** Shared caption used as the default per-platform description if no
|
|
82
|
+
* platform-specific block is supplied. 1..8000 chars. */
|
|
83
|
+
caption: string;
|
|
84
|
+
/** Marks the caption as AI-enhanced; surfaces on the status page. */
|
|
85
|
+
aiEnhanced?: boolean;
|
|
86
|
+
youtube?: IYouTubeConfig;
|
|
87
|
+
tiktok?: ITikTokConfig;
|
|
88
|
+
facebook?: IFacebookPageConfig;
|
|
89
|
+
instagram?: IInstagramConfig;
|
|
90
|
+
schedule?: IScheduleConfig;
|
|
91
|
+
comment?: ICommentRequest;
|
|
92
|
+
tag?: string;
|
|
93
|
+
refId?: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Image-post create request (single-account target).
|
|
97
|
+
*/
|
|
98
|
+
interface ICreateImagePostToAccountRequest {
|
|
99
|
+
/** Account ID. */
|
|
100
|
+
accountId: string;
|
|
101
|
+
image: IImageMediaRequest;
|
|
102
|
+
caption: string;
|
|
103
|
+
aiEnhanced?: boolean;
|
|
104
|
+
youtube?: IYouTubeConfig;
|
|
105
|
+
tiktok?: ITikTokConfig;
|
|
106
|
+
facebook?: IFacebookPageConfig;
|
|
107
|
+
instagram?: IInstagramConfig;
|
|
108
|
+
schedule?: IScheduleConfig;
|
|
109
|
+
comment?: ICommentRequest;
|
|
110
|
+
tag?: string;
|
|
111
|
+
refId?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Optional post-publish comment.
|
|
115
|
+
* Adds a comment under each platform post once it is published.
|
|
116
|
+
*
|
|
117
|
+
* Pricing: +1 credit on top of the video charge (Pro plan).
|
|
118
|
+
* TikTok comments are not supported by the platform and will always
|
|
119
|
+
* be reported as `notSupported` in the status response.
|
|
120
|
+
*/
|
|
121
|
+
interface ICommentRequest {
|
|
122
|
+
/** Comment text (1..2200 characters). */
|
|
123
|
+
text: string;
|
|
124
|
+
/** Post the comment on Facebook (default: true). */
|
|
125
|
+
postToFacebook?: boolean;
|
|
126
|
+
/** Post the comment on Instagram (default: true). */
|
|
127
|
+
postToInstagram?: boolean;
|
|
128
|
+
/** Post the comment on YouTube (default: true). */
|
|
129
|
+
postToYoutube?: boolean;
|
|
130
|
+
/** Post the comment on TikTok (default: false — not supported by TikTok). */
|
|
131
|
+
postToTiktok?: boolean;
|
|
132
|
+
}
|
|
42
133
|
interface ICreateSocialPublisherPostRequest {
|
|
43
134
|
/** Workspace ID */
|
|
44
135
|
workspaceId: string;
|
|
45
136
|
source: SocialPublisherPostSourceType;
|
|
46
|
-
isAllowYouTube: boolean;
|
|
47
|
-
isAllowTiktok: boolean;
|
|
48
|
-
isAllowFacebookPage: boolean;
|
|
49
|
-
isAllowInstagram: boolean;
|
|
50
137
|
youtube?: IYouTubeConfig;
|
|
51
138
|
tiktok?: ITikTokConfig;
|
|
52
139
|
facebook?: IFacebookPageConfig;
|
|
@@ -55,6 +142,12 @@ interface ICreateSocialPublisherPostRequest {
|
|
|
55
142
|
thumbURL?: string;
|
|
56
143
|
postURL?: string;
|
|
57
144
|
schedule?: IScheduleConfig;
|
|
145
|
+
/**
|
|
146
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
147
|
+
* Once the video is published, a comment is added under each enabled
|
|
148
|
+
* platform post. TikTok is not supported.
|
|
149
|
+
*/
|
|
150
|
+
comment?: ICommentRequest;
|
|
58
151
|
/**
|
|
59
152
|
* Tag (optional)
|
|
60
153
|
* Use this field to filter posts by tag.
|
|
@@ -72,10 +165,6 @@ interface ICreateSocialPublisherAccountPostRequest {
|
|
|
72
165
|
/** Account ID */
|
|
73
166
|
accountId: string;
|
|
74
167
|
source: SocialPublisherPostSourceType;
|
|
75
|
-
isAllowYouTube: boolean;
|
|
76
|
-
isAllowTiktok: boolean;
|
|
77
|
-
isAllowFacebookPage: boolean;
|
|
78
|
-
isAllowInstagram: boolean;
|
|
79
168
|
youtube?: IYouTubeConfig;
|
|
80
169
|
tiktok?: ITikTokConfig;
|
|
81
170
|
facebook?: IFacebookPageConfig;
|
|
@@ -84,6 +173,12 @@ interface ICreateSocialPublisherAccountPostRequest {
|
|
|
84
173
|
thumbURL?: string;
|
|
85
174
|
postURL?: string;
|
|
86
175
|
schedule?: IScheduleConfig;
|
|
176
|
+
/**
|
|
177
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
178
|
+
* Once the video is published, a comment is added under each enabled
|
|
179
|
+
* platform post. TikTok is not supported.
|
|
180
|
+
*/
|
|
181
|
+
comment?: ICommentRequest;
|
|
87
182
|
/**
|
|
88
183
|
* Tag (optional)
|
|
89
184
|
* Use this field to filter posts by tag.
|
|
@@ -100,30 +195,34 @@ interface ICreateSocialPublisherAccountPostRequest {
|
|
|
100
195
|
interface IPostSetting {
|
|
101
196
|
/** Workspace ID */
|
|
102
197
|
workspaceId: string;
|
|
103
|
-
isAllowYouTube: boolean;
|
|
104
|
-
isAllowTiktok: boolean;
|
|
105
|
-
isAllowFacebookPage: boolean;
|
|
106
|
-
isAllowInstagram: boolean;
|
|
107
198
|
youtube?: IYouTubeConfig;
|
|
108
199
|
tiktok?: ITikTokConfig;
|
|
109
200
|
facebook?: IFacebookPageConfig;
|
|
110
201
|
instagram?: IInstagramConfig;
|
|
111
202
|
schedule?: IScheduleConfig;
|
|
112
203
|
source: SocialPublisherPostSourceType;
|
|
204
|
+
/** Optional post-publish comment (Pro plan, +1 credit). TikTok is not supported. */
|
|
205
|
+
comment?: ICommentRequest;
|
|
206
|
+
/** Optional caller-supplied tag, persisted on the created post for filtering. */
|
|
207
|
+
tag?: string;
|
|
208
|
+
/** Optional caller-supplied reference ID, persisted on the created post for filtering. */
|
|
209
|
+
refId?: string;
|
|
113
210
|
}
|
|
114
211
|
interface IAccountPostSetting {
|
|
115
212
|
/** Account ID */
|
|
116
213
|
accountId: string;
|
|
117
|
-
isAllowYouTube: boolean;
|
|
118
|
-
isAllowTiktok: boolean;
|
|
119
|
-
isAllowFacebookPage: boolean;
|
|
120
|
-
isAllowInstagram: boolean;
|
|
121
214
|
youtube?: IYouTubeConfig;
|
|
122
215
|
tiktok?: ITikTokConfig;
|
|
123
216
|
facebook?: IFacebookPageConfig;
|
|
124
217
|
instagram?: IInstagramConfig;
|
|
125
218
|
schedule?: IScheduleConfig;
|
|
126
219
|
source: SocialPublisherPostSourceType;
|
|
220
|
+
/** Optional post-publish comment (Pro plan, +1 credit). TikTok is not supported. */
|
|
221
|
+
comment?: ICommentRequest;
|
|
222
|
+
/** Optional caller-supplied tag, persisted on the created post for filtering. */
|
|
223
|
+
tag?: string;
|
|
224
|
+
/** Optional caller-supplied reference ID, persisted on the created post for filtering. */
|
|
225
|
+
refId?: string;
|
|
127
226
|
}
|
|
128
227
|
interface IGenerateUploadUrlsRequest {
|
|
129
228
|
thumbFileType?: string;
|
|
@@ -156,28 +255,23 @@ interface IPublishOptions {
|
|
|
156
255
|
*/
|
|
157
256
|
thumbnail?: File | string;
|
|
158
257
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*/
|
|
162
|
-
platforms: Array<"youtube" | "tiktok" | "facebook" | "instagram">;
|
|
163
|
-
/**
|
|
164
|
-
* YouTube-specific configuration
|
|
165
|
-
* Required if 'youtube' is in platforms array
|
|
258
|
+
* YouTube-specific configuration.
|
|
259
|
+
* Required if the workspace has a YouTube account connected.
|
|
166
260
|
*/
|
|
167
261
|
youtube?: IYouTubeConfig;
|
|
168
262
|
/**
|
|
169
|
-
* TikTok-specific configuration
|
|
170
|
-
* Required if
|
|
263
|
+
* TikTok-specific configuration.
|
|
264
|
+
* Required if the workspace has a TikTok account connected.
|
|
171
265
|
*/
|
|
172
266
|
tiktok?: ITikTokConfig;
|
|
173
267
|
/**
|
|
174
|
-
* Facebook Page-specific configuration
|
|
175
|
-
* Required if
|
|
268
|
+
* Facebook Page-specific configuration.
|
|
269
|
+
* Required if the workspace has a Facebook Page connected.
|
|
176
270
|
*/
|
|
177
271
|
facebook?: IFacebookPageConfig;
|
|
178
272
|
/**
|
|
179
|
-
* Instagram-specific configuration
|
|
180
|
-
* Required if
|
|
273
|
+
* Instagram-specific configuration.
|
|
274
|
+
* Required if the workspace has an Instagram account connected.
|
|
181
275
|
*/
|
|
182
276
|
instagram?: IInstagramConfig;
|
|
183
277
|
/**
|
|
@@ -194,6 +288,11 @@ interface IPublishOptions {
|
|
|
194
288
|
* Optional reference ID for external systems
|
|
195
289
|
*/
|
|
196
290
|
refId?: string;
|
|
291
|
+
/**
|
|
292
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
293
|
+
* TikTok comments are not supported.
|
|
294
|
+
*/
|
|
295
|
+
comment?: ICommentRequest;
|
|
197
296
|
}
|
|
198
297
|
/**
|
|
199
298
|
* Options for publishing to an account
|
|
@@ -221,28 +320,23 @@ interface IPublishToAccountOptions {
|
|
|
221
320
|
*/
|
|
222
321
|
thumbnail?: File | string;
|
|
223
322
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*/
|
|
227
|
-
platforms: Array<"youtube" | "tiktok" | "facebook" | "instagram">;
|
|
228
|
-
/**
|
|
229
|
-
* YouTube-specific configuration
|
|
230
|
-
* Required if 'youtube' is in platforms array
|
|
323
|
+
* YouTube-specific configuration.
|
|
324
|
+
* Required if the workspace has a YouTube account connected.
|
|
231
325
|
*/
|
|
232
326
|
youtube?: IYouTubeConfig;
|
|
233
327
|
/**
|
|
234
|
-
* TikTok-specific configuration
|
|
235
|
-
* Required if
|
|
328
|
+
* TikTok-specific configuration.
|
|
329
|
+
* Required if the workspace has a TikTok account connected.
|
|
236
330
|
*/
|
|
237
331
|
tiktok?: ITikTokConfig;
|
|
238
332
|
/**
|
|
239
|
-
* Facebook Page-specific configuration
|
|
240
|
-
* Required if
|
|
333
|
+
* Facebook Page-specific configuration.
|
|
334
|
+
* Required if the workspace has a Facebook Page connected.
|
|
241
335
|
*/
|
|
242
336
|
facebook?: IFacebookPageConfig;
|
|
243
337
|
/**
|
|
244
|
-
* Instagram-specific configuration
|
|
245
|
-
* Required if
|
|
338
|
+
* Instagram-specific configuration.
|
|
339
|
+
* Required if the workspace has an Instagram account connected.
|
|
246
340
|
*/
|
|
247
341
|
instagram?: IInstagramConfig;
|
|
248
342
|
/**
|
|
@@ -259,6 +353,11 @@ interface IPublishToAccountOptions {
|
|
|
259
353
|
* Optional reference ID for external systems
|
|
260
354
|
*/
|
|
261
355
|
refId?: string;
|
|
356
|
+
/**
|
|
357
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
358
|
+
* TikTok comments are not supported.
|
|
359
|
+
*/
|
|
360
|
+
comment?: ICommentRequest;
|
|
262
361
|
}
|
|
263
362
|
/**
|
|
264
363
|
* Base interface for quick publish options
|
|
@@ -310,6 +409,11 @@ interface IQuickPublishBaseOptions {
|
|
|
310
409
|
* @example 'external-id-123', 'crm-campaign-456'
|
|
311
410
|
*/
|
|
312
411
|
refId?: string;
|
|
412
|
+
/**
|
|
413
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
414
|
+
* TikTok comments are not supported.
|
|
415
|
+
*/
|
|
416
|
+
comment?: ICommentRequest;
|
|
313
417
|
}
|
|
314
418
|
/**
|
|
315
419
|
* Quick publish options for YouTube only
|
|
@@ -527,6 +631,44 @@ interface ISocialPublisherPostInfo {
|
|
|
527
631
|
}[];
|
|
528
632
|
socialPublisherAccountId: string | any;
|
|
529
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* Image-post metadata on the post status response.
|
|
636
|
+
* Only present when `type === "image"`.
|
|
637
|
+
*/
|
|
638
|
+
interface IImageDTO {
|
|
639
|
+
source: "image-file" | "image-url";
|
|
640
|
+
bucketKey?: string;
|
|
641
|
+
externalUrl?: string;
|
|
642
|
+
width?: number;
|
|
643
|
+
height?: number;
|
|
644
|
+
mimeType?: string;
|
|
645
|
+
/** True when the caption was AI-enhanced before publish. */
|
|
646
|
+
aiEnhanced?: boolean;
|
|
647
|
+
/** Set after the bucket cleanup job runs (uploaded files only). */
|
|
648
|
+
deletedFromBucketAt?: Date;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Per-platform comment status block returned on the post status response.
|
|
652
|
+
* Present only when the post was created with a `comment` payload.
|
|
653
|
+
*
|
|
654
|
+
* TikTok always returns `currentStatus = "notSupported"`.
|
|
655
|
+
*/
|
|
656
|
+
interface ICommentInfoDTO {
|
|
657
|
+
/** Whether the caller opted in for this platform (mirrors the request flag). */
|
|
658
|
+
isAllow?: boolean;
|
|
659
|
+
/** Current per-platform comment status. */
|
|
660
|
+
currentStatus?: CommentStatusType;
|
|
661
|
+
/** Last error message (when `currentStatus === "error"`). */
|
|
662
|
+
currentError?: string;
|
|
663
|
+
/** ID of the comment on the platform (when posted). */
|
|
664
|
+
externalCommentId?: string;
|
|
665
|
+
/** Public URL of the comment on the platform (when posted). */
|
|
666
|
+
commentURL?: string;
|
|
667
|
+
/** Timestamp the comment was successfully posted. */
|
|
668
|
+
postedAt?: Date;
|
|
669
|
+
/** Grouped history of status transitions for this platform comment. */
|
|
670
|
+
statusHistoryGrouped?: IBaseStatusHistoryGroupedDay<CommentStatusType>[];
|
|
671
|
+
}
|
|
530
672
|
interface ISocialPublisherPostPlatform {
|
|
531
673
|
postInfo: ISocialPublisherPostInfo;
|
|
532
674
|
}
|
|
@@ -564,7 +706,7 @@ interface ISocialPublisherPostResponse {
|
|
|
564
706
|
interface ISocialPublisherPostStatusResponse {
|
|
565
707
|
_id: string;
|
|
566
708
|
numbering: string;
|
|
567
|
-
type: "shortVideo";
|
|
709
|
+
type: "shortVideo" | "image";
|
|
568
710
|
source: SocialPublisherPostSourceType;
|
|
569
711
|
sourceURLs: {
|
|
570
712
|
/**
|
|
@@ -575,11 +717,17 @@ interface ISocialPublisherPostStatusResponse {
|
|
|
575
717
|
* Video URL, can be null if didn't upload any video or passed URL
|
|
576
718
|
*/
|
|
577
719
|
videoURL?: string;
|
|
720
|
+
/**
|
|
721
|
+
* Image URL (image-post type). Returned for posts of `type: "image"`.
|
|
722
|
+
*/
|
|
723
|
+
imageURL?: string;
|
|
578
724
|
/**
|
|
579
725
|
* Post URL, can be null if didn't upload any post or passed URL for platforms like facebook, tiktok, youtube
|
|
580
726
|
*/
|
|
581
727
|
postURL?: string;
|
|
582
728
|
};
|
|
729
|
+
/** Image-post metadata — only present when `type === "image"`. */
|
|
730
|
+
image?: IImageDTO;
|
|
583
731
|
currentStatus: SocialPublisherPostStatusType;
|
|
584
732
|
currentError: string;
|
|
585
733
|
currentStatusChangedAt: string;
|
|
@@ -633,15 +781,21 @@ interface ISocialPublisherPostTikTokPostDetails extends ISocialPublisherPostAcco
|
|
|
633
781
|
disable_stitch: boolean;
|
|
634
782
|
disable_comment: boolean;
|
|
635
783
|
privacy_level: string;
|
|
784
|
+
/** Per-platform comment status — TikTok always reports `notSupported`. */
|
|
785
|
+
commentInfo?: ICommentInfoDTO;
|
|
636
786
|
}
|
|
637
787
|
interface ISocialPublisherPostFacebookPagePostDetails extends ISocialPublisherPostAccount {
|
|
638
788
|
description: string;
|
|
639
789
|
title: string;
|
|
790
|
+
/** Per-platform comment status (only present when a comment was requested). */
|
|
791
|
+
commentInfo?: ICommentInfoDTO;
|
|
640
792
|
}
|
|
641
793
|
interface ISocialPublisherPostInstagramPostDetails extends ISocialPublisherPostAccount {
|
|
642
794
|
description: string;
|
|
643
795
|
share_to_feed: boolean;
|
|
644
796
|
is_published_to_both_feed_and_story: boolean;
|
|
797
|
+
/** Per-platform comment status (only present when a comment was requested). */
|
|
798
|
+
commentInfo?: ICommentInfoDTO;
|
|
645
799
|
}
|
|
646
800
|
interface ISocialPublisherPostYouTubePostDetails extends ISocialPublisherPostAccount {
|
|
647
801
|
title: string;
|
|
@@ -653,6 +807,8 @@ interface ISocialPublisherPostYouTubePostDetails extends ISocialPublisherPostAcc
|
|
|
653
807
|
categoryId: string;
|
|
654
808
|
localizationLanguages: string[];
|
|
655
809
|
localizations: any;
|
|
810
|
+
/** Per-platform comment status (only present when a comment was requested). */
|
|
811
|
+
commentInfo?: ICommentInfoDTO;
|
|
656
812
|
}
|
|
657
813
|
interface ISocialPublisherPostNextPreviousResponse {
|
|
658
814
|
nextId?: string;
|
|
@@ -729,6 +885,29 @@ declare class SocialPublisherPostClient {
|
|
|
729
885
|
* @param id - Optional ID for updating/retrying?
|
|
730
886
|
*/
|
|
731
887
|
private createToAccountByURL;
|
|
888
|
+
/**
|
|
889
|
+
* Create an image post targeting a workspace. The image is published to
|
|
890
|
+
* every account connected to the workspace (Facebook / Instagram / TikTok
|
|
891
|
+
* photo). YouTube community posts are always reported as `notSupported`
|
|
892
|
+
* on the status response — the YouTube Data API doesn't expose them to
|
|
893
|
+
* third-party apps. Cost: 5 credits + 1 if `comment` is provided.
|
|
894
|
+
*
|
|
895
|
+
* @example
|
|
896
|
+
* ```ts
|
|
897
|
+
* const postId = await client.createImagePostToWorkspace({
|
|
898
|
+
* workspaceId: "ws_123",
|
|
899
|
+
* image: { source: "image-url", externalUrl: "https://cdn.example.com/launch.jpg" },
|
|
900
|
+
* caption: "We shipped!",
|
|
901
|
+
* });
|
|
902
|
+
* ```
|
|
903
|
+
*/
|
|
904
|
+
createImagePostToWorkspace(data: ICreateImagePostToWorkspaceRequest, id?: string): Promise<string>;
|
|
905
|
+
/**
|
|
906
|
+
* Create an image post targeting a single account. The server derives the
|
|
907
|
+
* target platform from `account.platform`; image config blocks for other
|
|
908
|
+
* platforms in the request are ignored.
|
|
909
|
+
*/
|
|
910
|
+
createImagePostToAccount(data: ICreateImagePostToAccountRequest, id?: string): Promise<string>;
|
|
732
911
|
/**
|
|
733
912
|
* Handle thumbnail upload - accepts either File or URL string
|
|
734
913
|
* @param thumb - Thumbnail as File (will be uploaded) or URL string (will be passed directly)
|
|
@@ -778,14 +957,17 @@ declare class SocialPublisherPostClient {
|
|
|
778
957
|
* @param options - Simplified publishing options
|
|
779
958
|
* @returns Created post response
|
|
780
959
|
*
|
|
960
|
+
* The workspace's connected accounts (set up via the Posty5 dashboard)
|
|
961
|
+
* determine which platforms this post lands on — supply a config block
|
|
962
|
+
* for each connected platform.
|
|
963
|
+
*
|
|
781
964
|
* @example
|
|
782
965
|
* ```typescript
|
|
783
|
-
* //
|
|
784
|
-
* await client.
|
|
966
|
+
* // Workspace has a YouTube account connected → just supply youtube config
|
|
967
|
+
* await client.publishShortVideoToWorkspace({
|
|
785
968
|
* workspaceId: 'workspace-123',
|
|
786
969
|
* video: videoFile,
|
|
787
970
|
* thumbnail: thumbFile,
|
|
788
|
-
* platforms: ['youtube'],
|
|
789
971
|
* youtube: {
|
|
790
972
|
* title: 'My Video',
|
|
791
973
|
* description: 'Description',
|
|
@@ -793,21 +975,19 @@ declare class SocialPublisherPostClient {
|
|
|
793
975
|
* }
|
|
794
976
|
* });
|
|
795
977
|
*
|
|
796
|
-
* //
|
|
797
|
-
* await client.
|
|
978
|
+
* // Workspace has YouTube + TikTok connected → supply both configs
|
|
979
|
+
* await client.publishShortVideoToWorkspace({
|
|
798
980
|
* workspaceId: 'workspace-123',
|
|
799
981
|
* video: 'https://example.com/video.mp4',
|
|
800
982
|
* thumbnail: 'https://example.com/thumb.jpg',
|
|
801
|
-
* platforms: ['youtube', 'tiktok'],
|
|
802
983
|
* youtube: { title: 'Video', description: 'Desc', tags: [] },
|
|
803
984
|
* tiktok: { caption: 'Caption', privacy_level: 'public', disable_duet: false, disable_stitch: false, disable_comment: false }
|
|
804
985
|
* });
|
|
805
986
|
*
|
|
806
987
|
* // Repost from Facebook (auto-detected)
|
|
807
|
-
* await client.
|
|
988
|
+
* await client.publishShortVideoToWorkspace({
|
|
808
989
|
* workspaceId: 'workspace-123',
|
|
809
990
|
* video: 'https://facebook.com/video/12345',
|
|
810
|
-
* platforms: ['youtube'],
|
|
811
991
|
* youtube: { title: 'Reposted', description: 'From FB', tags: [] }
|
|
812
992
|
* });
|
|
813
993
|
* ```
|
|
@@ -832,4 +1012,4 @@ declare class SocialPublisherPostClient {
|
|
|
832
1012
|
private detectVideoSource;
|
|
833
1013
|
}
|
|
834
1014
|
|
|
835
|
-
export { type IAccountPostSetting, type IBaseStatusHistoryGroupedDay, type IBaseStatusHistoryGroupedItem, type ICreateSocialPublisherAccountPostRequest, type ICreateSocialPublisherPostRequest, type IDefaultSettingsResponse, type IFacebookPageConfig, type IGenerateUploadUrlsRequest, type IGenerateUploadUrlsResponse, type IInstagramConfig, type IListParams, type IPostSetting, type IPublishOptions, type IPublishToAccountOptions, type IQuickPublishAllOptions, type IQuickPublishBaseOptions, type IQuickPublishFacebookOptions, type IQuickPublishInstagramOptions, type IQuickPublishTikTokOptions, type IQuickPublishYouTubeOptions, type IScheduleConfig, type ISearchSocialPublisherPostResponse, type ISocialPublisherAccount, type ISocialPublisherPostAccount, type ISocialPublisherPostFacebookPagePostDetails, type ISocialPublisherPostInfo, type ISocialPublisherPostInstagramPostDetails, type ISocialPublisherPostNextPreviousResponse, type ISocialPublisherPostPlatform, type ISocialPublisherPostResponse, type ISocialPublisherPostStatusLog, type ISocialPublisherPostStatusResponse, type ISocialPublisherPostTikTokPostDetails, type ISocialPublisherPostYouTubePostDetails, type ISocialPublisherWorkspace, type ITikTokConfig, type IUploadConfig, type IYouTubeConfig, type SocialPublisherAccountAccountType, type SocialPublisherAccountPlatformType, type SocialPublisherAccountStatusType, type SocialPublisherPostAccountType, SocialPublisherPostClient, type SocialPublisherPostScheduleType, type SocialPublisherPostSourceType, type SocialPublisherPostStatusType, type SocialPublisherPostType };
|
|
1015
|
+
export { type CommentStatusType, type IAccountPostSetting, type IBaseStatusHistoryGroupedDay, type IBaseStatusHistoryGroupedItem, type ICommentInfoDTO, type ICommentRequest, type ICreateImagePostToAccountRequest, type ICreateImagePostToWorkspaceRequest, type ICreateSocialPublisherAccountPostRequest, type ICreateSocialPublisherPostRequest, type IDefaultSettingsResponse, type IFacebookPageConfig, type IGenerateUploadUrlsRequest, type IGenerateUploadUrlsResponse, type IImageDTO, type IImageMediaRequest, type IInstagramConfig, type IListParams, type IPostSetting, type IPublishOptions, type IPublishToAccountOptions, type IQuickPublishAllOptions, type IQuickPublishBaseOptions, type IQuickPublishFacebookOptions, type IQuickPublishInstagramOptions, type IQuickPublishTikTokOptions, type IQuickPublishYouTubeOptions, type IScheduleConfig, type ISearchSocialPublisherPostResponse, type ISocialPublisherAccount, type ISocialPublisherPostAccount, type ISocialPublisherPostFacebookPagePostDetails, type ISocialPublisherPostInfo, type ISocialPublisherPostInstagramPostDetails, type ISocialPublisherPostNextPreviousResponse, type ISocialPublisherPostPlatform, type ISocialPublisherPostResponse, type ISocialPublisherPostStatusLog, type ISocialPublisherPostStatusResponse, type ISocialPublisherPostTikTokPostDetails, type ISocialPublisherPostYouTubePostDetails, type ISocialPublisherWorkspace, type ITikTokConfig, type IUploadConfig, type IYouTubeConfig, type ImageSourceType, type SocialPublisherAccountAccountType, type SocialPublisherAccountPlatformType, type SocialPublisherAccountStatusType, type SocialPublisherPostAccountType, SocialPublisherPostClient, type SocialPublisherPostScheduleType, type SocialPublisherPostSourceType, type SocialPublisherPostStatusType, type SocialPublisherPostType };
|