@posty5/social-publisher-post 3.0.0 → 4.1.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 +928 -957
- package/dist/index.d.mts +245 -87
- package/dist/index.d.ts +245 -87
- package/dist/index.js +17573 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17558 -110
- package/dist/index.mjs.map +1 -1
- package/package.json +60 -61
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { IPaginationResponse, HttpClient, IPaginationParams } from '@posty5/core';
|
|
2
|
+
export { HttpClient, IHttpClientConfig, IPosty5Config, uploadToR2 } from '@posty5/core';
|
|
2
3
|
|
|
3
4
|
type SocialPublisherPostStatusType = "pending" | "processing" | "processingInPlatform" | "failedByPlatform" | "done" | "error" | "canceled" | "needsMaintenance" | "invalidVideoURL" | "invalidPostVideoURL" | "retrying";
|
|
4
5
|
type SocialPublisherPostType = "shortVideo";
|
|
5
6
|
type SocialPublisherPostAccountType = "youtube" | "facebook" | "instagram" | "tiktok";
|
|
6
7
|
type SocialPublisherPostScheduleType = "now" | "schedule";
|
|
7
|
-
type SocialPublisherPostSourceType = "video-file" | "video-url"
|
|
8
|
+
type SocialPublisherPostSourceType = "video-file" | "video-url";
|
|
9
|
+
/**
|
|
10
|
+
* Status of the optional post-publish comment, reported per-platform.
|
|
11
|
+
* - `pending`: queued, waiting for the parent post to be published
|
|
12
|
+
* - `processing`: comment request is in flight
|
|
13
|
+
* - `done`: comment posted successfully
|
|
14
|
+
* - `error`: comment failed (see `currentError`)
|
|
15
|
+
* - `skipped`: caller opted out for this platform (e.g. postToFacebook=false)
|
|
16
|
+
* - `notSupported`: platform does not allow programmatic comments (TikTok)
|
|
17
|
+
*/
|
|
18
|
+
type CommentStatusType = "pending" | "processing" | "done" | "error" | "skipped" | "notSupported";
|
|
8
19
|
type SocialPublisherAccountPlatformType = "youtube" | "facebook" | "tiktok";
|
|
9
20
|
type SocialPublisherAccountAccountType = "facebook" | "instagram" | "youtube" | "tiktok";
|
|
10
21
|
type SocialPublisherAccountStatusType = "active" | "inactive" | "authenticationExpired";
|
|
@@ -39,22 +50,104 @@ interface IScheduleConfig {
|
|
|
39
50
|
type: SocialPublisherPostScheduleType;
|
|
40
51
|
scheduledAt?: Date;
|
|
41
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Image-post source — uploaded to our bucket or fetched from a public URL.
|
|
55
|
+
*/
|
|
56
|
+
type ImageSourceType = "image-file" | "image-url";
|
|
57
|
+
/**
|
|
58
|
+
* Image-post media block. One of `bucketKey` (uploaded) or `externalUrl`
|
|
59
|
+
* (image-url) must be provided, matching the `source` discriminator.
|
|
60
|
+
*/
|
|
61
|
+
interface IImageMediaRequest {
|
|
62
|
+
source: ImageSourceType;
|
|
63
|
+
/** Bucket file URL returned by `generate-upload-urls` (when source = image-file). */
|
|
64
|
+
bucketKey?: string;
|
|
65
|
+
/** Direct public image URL (when source = image-url). */
|
|
66
|
+
externalUrl?: string;
|
|
67
|
+
/** Optional metadata — server uses for soft validation. */
|
|
68
|
+
width?: number;
|
|
69
|
+
height?: number;
|
|
70
|
+
/** e.g. "image/jpeg", "image/png", "image/webp". */
|
|
71
|
+
mimeType?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Image-post create request (workspace target).
|
|
75
|
+
* Image posts cost **5 credits** + 1 for an optional auto-comment.
|
|
76
|
+
* YouTube community posts are always reported as `notSupported`.
|
|
77
|
+
*/
|
|
78
|
+
interface ICreateImagePostToWorkspaceRequest {
|
|
79
|
+
/** Workspace ID. */
|
|
80
|
+
workspaceId: string;
|
|
81
|
+
image: IImageMediaRequest;
|
|
82
|
+
/** Shared caption used as the default per-platform description if no
|
|
83
|
+
* platform-specific block is supplied. 1..8000 chars. */
|
|
84
|
+
caption: string;
|
|
85
|
+
/** Marks the caption as AI-enhanced; surfaces on the status page. */
|
|
86
|
+
aiEnhanced?: boolean;
|
|
87
|
+
youtube?: IYouTubeConfig;
|
|
88
|
+
tiktok?: ITikTokConfig;
|
|
89
|
+
facebook?: IFacebookPageConfig;
|
|
90
|
+
instagram?: IInstagramConfig;
|
|
91
|
+
schedule?: IScheduleConfig;
|
|
92
|
+
comment?: ICommentRequest;
|
|
93
|
+
tag?: string;
|
|
94
|
+
refId?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Image-post create request (single-account target).
|
|
98
|
+
*/
|
|
99
|
+
interface ICreateImagePostToAccountRequest {
|
|
100
|
+
/** Account ID. */
|
|
101
|
+
accountId: string;
|
|
102
|
+
image: IImageMediaRequest;
|
|
103
|
+
caption: string;
|
|
104
|
+
aiEnhanced?: boolean;
|
|
105
|
+
youtube?: IYouTubeConfig;
|
|
106
|
+
tiktok?: ITikTokConfig;
|
|
107
|
+
facebook?: IFacebookPageConfig;
|
|
108
|
+
instagram?: IInstagramConfig;
|
|
109
|
+
schedule?: IScheduleConfig;
|
|
110
|
+
comment?: ICommentRequest;
|
|
111
|
+
tag?: string;
|
|
112
|
+
refId?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Optional post-publish comment.
|
|
116
|
+
* Adds a comment under each platform post once it is published.
|
|
117
|
+
*
|
|
118
|
+
* Pricing: +1 credit on top of the video charge (Pro plan).
|
|
119
|
+
* TikTok comments are not supported by the platform and will always
|
|
120
|
+
* be reported as `notSupported` in the status response.
|
|
121
|
+
*/
|
|
122
|
+
interface ICommentRequest {
|
|
123
|
+
/** Comment text (1..2200 characters). */
|
|
124
|
+
text: string;
|
|
125
|
+
/** Post the comment on Facebook (default: true). */
|
|
126
|
+
postToFacebook?: boolean;
|
|
127
|
+
/** Post the comment on Instagram (default: true). */
|
|
128
|
+
postToInstagram?: boolean;
|
|
129
|
+
/** Post the comment on YouTube (default: true). */
|
|
130
|
+
postToYoutube?: boolean;
|
|
131
|
+
/** Post the comment on TikTok (default: false — not supported by TikTok). */
|
|
132
|
+
postToTiktok?: boolean;
|
|
133
|
+
}
|
|
42
134
|
interface ICreateSocialPublisherPostRequest {
|
|
43
135
|
/** Workspace ID */
|
|
44
136
|
workspaceId: string;
|
|
45
137
|
source: SocialPublisherPostSourceType;
|
|
46
|
-
isAllowYouTube: boolean;
|
|
47
|
-
isAllowTiktok: boolean;
|
|
48
|
-
isAllowFacebookPage: boolean;
|
|
49
|
-
isAllowInstagram: boolean;
|
|
50
138
|
youtube?: IYouTubeConfig;
|
|
51
139
|
tiktok?: ITikTokConfig;
|
|
52
140
|
facebook?: IFacebookPageConfig;
|
|
53
141
|
instagram?: IInstagramConfig;
|
|
54
142
|
videoURL?: string;
|
|
55
143
|
thumbURL?: string;
|
|
56
|
-
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,18 +165,19 @@ 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;
|
|
82
171
|
instagram?: IInstagramConfig;
|
|
83
172
|
videoURL?: string;
|
|
84
173
|
thumbURL?: string;
|
|
85
|
-
postURL?: string;
|
|
86
174
|
schedule?: IScheduleConfig;
|
|
175
|
+
/**
|
|
176
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
177
|
+
* Once the video is published, a comment is added under each enabled
|
|
178
|
+
* platform post. TikTok is not supported.
|
|
179
|
+
*/
|
|
180
|
+
comment?: ICommentRequest;
|
|
87
181
|
/**
|
|
88
182
|
* Tag (optional)
|
|
89
183
|
* Use this field to filter posts by tag.
|
|
@@ -100,30 +194,34 @@ interface ICreateSocialPublisherAccountPostRequest {
|
|
|
100
194
|
interface IPostSetting {
|
|
101
195
|
/** Workspace ID */
|
|
102
196
|
workspaceId: string;
|
|
103
|
-
isAllowYouTube: boolean;
|
|
104
|
-
isAllowTiktok: boolean;
|
|
105
|
-
isAllowFacebookPage: boolean;
|
|
106
|
-
isAllowInstagram: boolean;
|
|
107
197
|
youtube?: IYouTubeConfig;
|
|
108
198
|
tiktok?: ITikTokConfig;
|
|
109
199
|
facebook?: IFacebookPageConfig;
|
|
110
200
|
instagram?: IInstagramConfig;
|
|
111
201
|
schedule?: IScheduleConfig;
|
|
112
202
|
source: SocialPublisherPostSourceType;
|
|
203
|
+
/** Optional post-publish comment (Pro plan, +1 credit). TikTok is not supported. */
|
|
204
|
+
comment?: ICommentRequest;
|
|
205
|
+
/** Optional caller-supplied tag, persisted on the created post for filtering. */
|
|
206
|
+
tag?: string;
|
|
207
|
+
/** Optional caller-supplied reference ID, persisted on the created post for filtering. */
|
|
208
|
+
refId?: string;
|
|
113
209
|
}
|
|
114
210
|
interface IAccountPostSetting {
|
|
115
211
|
/** Account ID */
|
|
116
212
|
accountId: string;
|
|
117
|
-
isAllowYouTube: boolean;
|
|
118
|
-
isAllowTiktok: boolean;
|
|
119
|
-
isAllowFacebookPage: boolean;
|
|
120
|
-
isAllowInstagram: boolean;
|
|
121
213
|
youtube?: IYouTubeConfig;
|
|
122
214
|
tiktok?: ITikTokConfig;
|
|
123
215
|
facebook?: IFacebookPageConfig;
|
|
124
216
|
instagram?: IInstagramConfig;
|
|
125
217
|
schedule?: IScheduleConfig;
|
|
126
218
|
source: SocialPublisherPostSourceType;
|
|
219
|
+
/** Optional post-publish comment (Pro plan, +1 credit). TikTok is not supported. */
|
|
220
|
+
comment?: ICommentRequest;
|
|
221
|
+
/** Optional caller-supplied tag, persisted on the created post for filtering. */
|
|
222
|
+
tag?: string;
|
|
223
|
+
/** Optional caller-supplied reference ID, persisted on the created post for filtering. */
|
|
224
|
+
refId?: string;
|
|
127
225
|
}
|
|
128
226
|
interface IGenerateUploadUrlsRequest {
|
|
129
227
|
thumbFileType?: string;
|
|
@@ -142,10 +240,9 @@ interface IPublishOptions {
|
|
|
142
240
|
* Video source (required)
|
|
143
241
|
* Can be:
|
|
144
242
|
* - File object (will be uploaded)
|
|
145
|
-
* - Direct video URL (http://... or https://...)
|
|
146
|
-
*
|
|
147
|
-
* -
|
|
148
|
-
* - YouTube Shorts URL (auto-detected for repost)
|
|
243
|
+
* - Direct video file URL (http://... or https://...)
|
|
244
|
+
*
|
|
245
|
+
* Third-party platform URLs are not supported by the public SDK.
|
|
149
246
|
*/
|
|
150
247
|
video: File | string;
|
|
151
248
|
/**
|
|
@@ -156,28 +253,23 @@ interface IPublishOptions {
|
|
|
156
253
|
*/
|
|
157
254
|
thumbnail?: File | string;
|
|
158
255
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*/
|
|
162
|
-
platforms: Array<"youtube" | "tiktok" | "facebook" | "instagram">;
|
|
163
|
-
/**
|
|
164
|
-
* YouTube-specific configuration
|
|
165
|
-
* Required if 'youtube' is in platforms array
|
|
256
|
+
* YouTube-specific configuration.
|
|
257
|
+
* Required if the workspace has a YouTube account connected.
|
|
166
258
|
*/
|
|
167
259
|
youtube?: IYouTubeConfig;
|
|
168
260
|
/**
|
|
169
|
-
* TikTok-specific configuration
|
|
170
|
-
* Required if
|
|
261
|
+
* TikTok-specific configuration.
|
|
262
|
+
* Required if the workspace has a TikTok account connected.
|
|
171
263
|
*/
|
|
172
264
|
tiktok?: ITikTokConfig;
|
|
173
265
|
/**
|
|
174
|
-
* Facebook Page-specific configuration
|
|
175
|
-
* Required if
|
|
266
|
+
* Facebook Page-specific configuration.
|
|
267
|
+
* Required if the workspace has a Facebook Page connected.
|
|
176
268
|
*/
|
|
177
269
|
facebook?: IFacebookPageConfig;
|
|
178
270
|
/**
|
|
179
|
-
* Instagram-specific configuration
|
|
180
|
-
* Required if
|
|
271
|
+
* Instagram-specific configuration.
|
|
272
|
+
* Required if the workspace has an Instagram account connected.
|
|
181
273
|
*/
|
|
182
274
|
instagram?: IInstagramConfig;
|
|
183
275
|
/**
|
|
@@ -194,6 +286,11 @@ interface IPublishOptions {
|
|
|
194
286
|
* Optional reference ID for external systems
|
|
195
287
|
*/
|
|
196
288
|
refId?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
291
|
+
* TikTok comments are not supported.
|
|
292
|
+
*/
|
|
293
|
+
comment?: ICommentRequest;
|
|
197
294
|
}
|
|
198
295
|
/**
|
|
199
296
|
* Options for publishing to an account
|
|
@@ -207,10 +304,9 @@ interface IPublishToAccountOptions {
|
|
|
207
304
|
* Video source (required)
|
|
208
305
|
* Can be:
|
|
209
306
|
* - File object (will be uploaded)
|
|
210
|
-
* - Direct video URL (http://... or https://...)
|
|
211
|
-
*
|
|
212
|
-
* -
|
|
213
|
-
* - YouTube Shorts URL (auto-detected for repost)
|
|
307
|
+
* - Direct video file URL (http://... or https://...)
|
|
308
|
+
*
|
|
309
|
+
* Third-party platform URLs are not supported by the public SDK.
|
|
214
310
|
*/
|
|
215
311
|
video: File | string;
|
|
216
312
|
/**
|
|
@@ -221,28 +317,23 @@ interface IPublishToAccountOptions {
|
|
|
221
317
|
*/
|
|
222
318
|
thumbnail?: File | string;
|
|
223
319
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*/
|
|
227
|
-
platforms: Array<"youtube" | "tiktok" | "facebook" | "instagram">;
|
|
228
|
-
/**
|
|
229
|
-
* YouTube-specific configuration
|
|
230
|
-
* Required if 'youtube' is in platforms array
|
|
320
|
+
* YouTube-specific configuration.
|
|
321
|
+
* Required if the workspace has a YouTube account connected.
|
|
231
322
|
*/
|
|
232
323
|
youtube?: IYouTubeConfig;
|
|
233
324
|
/**
|
|
234
|
-
* TikTok-specific configuration
|
|
235
|
-
* Required if
|
|
325
|
+
* TikTok-specific configuration.
|
|
326
|
+
* Required if the workspace has a TikTok account connected.
|
|
236
327
|
*/
|
|
237
328
|
tiktok?: ITikTokConfig;
|
|
238
329
|
/**
|
|
239
|
-
* Facebook Page-specific configuration
|
|
240
|
-
* Required if
|
|
330
|
+
* Facebook Page-specific configuration.
|
|
331
|
+
* Required if the workspace has a Facebook Page connected.
|
|
241
332
|
*/
|
|
242
333
|
facebook?: IFacebookPageConfig;
|
|
243
334
|
/**
|
|
244
|
-
* Instagram-specific configuration
|
|
245
|
-
* Required if
|
|
335
|
+
* Instagram-specific configuration.
|
|
336
|
+
* Required if the workspace has an Instagram account connected.
|
|
246
337
|
*/
|
|
247
338
|
instagram?: IInstagramConfig;
|
|
248
339
|
/**
|
|
@@ -259,6 +350,11 @@ interface IPublishToAccountOptions {
|
|
|
259
350
|
* Optional reference ID for external systems
|
|
260
351
|
*/
|
|
261
352
|
refId?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
355
|
+
* TikTok comments are not supported.
|
|
356
|
+
*/
|
|
357
|
+
comment?: ICommentRequest;
|
|
262
358
|
}
|
|
263
359
|
/**
|
|
264
360
|
* Base interface for quick publish options
|
|
@@ -274,7 +370,7 @@ interface IQuickPublishBaseOptions {
|
|
|
274
370
|
* Video source (required)
|
|
275
371
|
* Can be:
|
|
276
372
|
* - File object: Will be uploaded to cloud storage
|
|
277
|
-
* - URL string: Direct video URL
|
|
373
|
+
* - URL string: Direct video file URL for original or authorized content
|
|
278
374
|
*
|
|
279
375
|
* Supported formats: .mp4, .mov, .avi, .mkv, .webm
|
|
280
376
|
*/
|
|
@@ -310,6 +406,11 @@ interface IQuickPublishBaseOptions {
|
|
|
310
406
|
* @example 'external-id-123', 'crm-campaign-456'
|
|
311
407
|
*/
|
|
312
408
|
refId?: string;
|
|
409
|
+
/**
|
|
410
|
+
* Optional post-publish comment (Pro plan, +1 credit).
|
|
411
|
+
* TikTok comments are not supported.
|
|
412
|
+
*/
|
|
413
|
+
comment?: ICommentRequest;
|
|
313
414
|
}
|
|
314
415
|
/**
|
|
315
416
|
* Quick publish options for YouTube only
|
|
@@ -527,6 +628,44 @@ interface ISocialPublisherPostInfo {
|
|
|
527
628
|
}[];
|
|
528
629
|
socialPublisherAccountId: string | any;
|
|
529
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Image-post metadata on the post status response.
|
|
633
|
+
* Only present when `type === "image"`.
|
|
634
|
+
*/
|
|
635
|
+
interface IImageDTO {
|
|
636
|
+
source: "image-file" | "image-url";
|
|
637
|
+
bucketKey?: string;
|
|
638
|
+
externalUrl?: string;
|
|
639
|
+
width?: number;
|
|
640
|
+
height?: number;
|
|
641
|
+
mimeType?: string;
|
|
642
|
+
/** True when the caption was AI-enhanced before publish. */
|
|
643
|
+
aiEnhanced?: boolean;
|
|
644
|
+
/** Set after the bucket cleanup job runs (uploaded files only). */
|
|
645
|
+
deletedFromBucketAt?: Date;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Per-platform comment status block returned on the post status response.
|
|
649
|
+
* Present only when the post was created with a `comment` payload.
|
|
650
|
+
*
|
|
651
|
+
* TikTok always returns `currentStatus = "notSupported"`.
|
|
652
|
+
*/
|
|
653
|
+
interface ICommentInfoDTO {
|
|
654
|
+
/** Whether the caller opted in for this platform (mirrors the request flag). */
|
|
655
|
+
isAllow?: boolean;
|
|
656
|
+
/** Current per-platform comment status. */
|
|
657
|
+
currentStatus?: CommentStatusType;
|
|
658
|
+
/** Last error message (when `currentStatus === "error"`). */
|
|
659
|
+
currentError?: string;
|
|
660
|
+
/** ID of the comment on the platform (when posted). */
|
|
661
|
+
externalCommentId?: string;
|
|
662
|
+
/** Public URL of the comment on the platform (when posted). */
|
|
663
|
+
commentURL?: string;
|
|
664
|
+
/** Timestamp the comment was successfully posted. */
|
|
665
|
+
postedAt?: Date;
|
|
666
|
+
/** Grouped history of status transitions for this platform comment. */
|
|
667
|
+
statusHistoryGrouped?: IBaseStatusHistoryGroupedDay<CommentStatusType>[];
|
|
668
|
+
}
|
|
530
669
|
interface ISocialPublisherPostPlatform {
|
|
531
670
|
postInfo: ISocialPublisherPostInfo;
|
|
532
671
|
}
|
|
@@ -564,7 +703,7 @@ interface ISocialPublisherPostResponse {
|
|
|
564
703
|
interface ISocialPublisherPostStatusResponse {
|
|
565
704
|
_id: string;
|
|
566
705
|
numbering: string;
|
|
567
|
-
type: "shortVideo";
|
|
706
|
+
type: "shortVideo" | "image";
|
|
568
707
|
source: SocialPublisherPostSourceType;
|
|
569
708
|
sourceURLs: {
|
|
570
709
|
/**
|
|
@@ -576,10 +715,12 @@ interface ISocialPublisherPostStatusResponse {
|
|
|
576
715
|
*/
|
|
577
716
|
videoURL?: string;
|
|
578
717
|
/**
|
|
579
|
-
*
|
|
718
|
+
* Image URL (image-post type). Returned for posts of `type: "image"`.
|
|
580
719
|
*/
|
|
581
|
-
|
|
720
|
+
imageURL?: string;
|
|
582
721
|
};
|
|
722
|
+
/** Image-post metadata — only present when `type === "image"`. */
|
|
723
|
+
image?: IImageDTO;
|
|
583
724
|
currentStatus: SocialPublisherPostStatusType;
|
|
584
725
|
currentError: string;
|
|
585
726
|
currentStatusChangedAt: string;
|
|
@@ -633,15 +774,21 @@ interface ISocialPublisherPostTikTokPostDetails extends ISocialPublisherPostAcco
|
|
|
633
774
|
disable_stitch: boolean;
|
|
634
775
|
disable_comment: boolean;
|
|
635
776
|
privacy_level: string;
|
|
777
|
+
/** Per-platform comment status — TikTok always reports `notSupported`. */
|
|
778
|
+
commentInfo?: ICommentInfoDTO;
|
|
636
779
|
}
|
|
637
780
|
interface ISocialPublisherPostFacebookPagePostDetails extends ISocialPublisherPostAccount {
|
|
638
781
|
description: string;
|
|
639
782
|
title: string;
|
|
783
|
+
/** Per-platform comment status (only present when a comment was requested). */
|
|
784
|
+
commentInfo?: ICommentInfoDTO;
|
|
640
785
|
}
|
|
641
786
|
interface ISocialPublisherPostInstagramPostDetails extends ISocialPublisherPostAccount {
|
|
642
787
|
description: string;
|
|
643
788
|
share_to_feed: boolean;
|
|
644
789
|
is_published_to_both_feed_and_story: boolean;
|
|
790
|
+
/** Per-platform comment status (only present when a comment was requested). */
|
|
791
|
+
commentInfo?: ICommentInfoDTO;
|
|
645
792
|
}
|
|
646
793
|
interface ISocialPublisherPostYouTubePostDetails extends ISocialPublisherPostAccount {
|
|
647
794
|
title: string;
|
|
@@ -653,6 +800,8 @@ interface ISocialPublisherPostYouTubePostDetails extends ISocialPublisherPostAcc
|
|
|
653
800
|
categoryId: string;
|
|
654
801
|
localizationLanguages: string[];
|
|
655
802
|
localizations: any;
|
|
803
|
+
/** Per-platform comment status (only present when a comment was requested). */
|
|
804
|
+
commentInfo?: ICommentInfoDTO;
|
|
656
805
|
}
|
|
657
806
|
interface ISocialPublisherPostNextPreviousResponse {
|
|
658
807
|
nextId?: string;
|
|
@@ -729,6 +878,29 @@ declare class SocialPublisherPostClient {
|
|
|
729
878
|
* @param id - Optional ID for updating/retrying?
|
|
730
879
|
*/
|
|
731
880
|
private createToAccountByURL;
|
|
881
|
+
/**
|
|
882
|
+
* Create an image post targeting a workspace. The image is published to
|
|
883
|
+
* every account connected to the workspace (Facebook / Instagram / TikTok
|
|
884
|
+
* photo). YouTube community posts are always reported as `notSupported`
|
|
885
|
+
* on the status response — the YouTube Data API doesn't expose them to
|
|
886
|
+
* third-party apps. Cost: 5 credits + 1 if `comment` is provided.
|
|
887
|
+
*
|
|
888
|
+
* @example
|
|
889
|
+
* ```ts
|
|
890
|
+
* const postId = await client.createImagePostToWorkspace({
|
|
891
|
+
* workspaceId: "ws_123",
|
|
892
|
+
* image: { source: "image-url", externalUrl: "https://cdn.example.com/launch.jpg" },
|
|
893
|
+
* caption: "We shipped!",
|
|
894
|
+
* });
|
|
895
|
+
* ```
|
|
896
|
+
*/
|
|
897
|
+
createImagePostToWorkspace(data: ICreateImagePostToWorkspaceRequest, id?: string): Promise<string>;
|
|
898
|
+
/**
|
|
899
|
+
* Create an image post targeting a single account. The server derives the
|
|
900
|
+
* target platform from `account.platform`; image config blocks for other
|
|
901
|
+
* platforms in the request are ignored.
|
|
902
|
+
*/
|
|
903
|
+
createImagePostToAccount(data: ICreateImagePostToAccountRequest, id?: string): Promise<string>;
|
|
732
904
|
/**
|
|
733
905
|
* Handle thumbnail upload - accepts either File or URL string
|
|
734
906
|
* @param thumb - Thumbnail as File (will be uploaded) or URL string (will be passed directly)
|
|
@@ -751,14 +923,6 @@ declare class SocialPublisherPostClient {
|
|
|
751
923
|
* @returns Created post response
|
|
752
924
|
*/
|
|
753
925
|
private publishShortVideoToWorkspaceByURL;
|
|
754
|
-
/**
|
|
755
|
-
* Publish a repost video from TikTok
|
|
756
|
-
* @param settings - Post creation settings
|
|
757
|
-
* @param videoURL - TikTok video URL (tiktok.com, vm.tiktok.com)
|
|
758
|
-
* @param thumb - Optional thumbnail image file or URL string
|
|
759
|
-
* @returns Created post response
|
|
760
|
-
*/
|
|
761
|
-
private publishRepostVideoToWorkspace;
|
|
762
926
|
/**
|
|
763
927
|
* Publish a short video to account by uploading a video file
|
|
764
928
|
*/
|
|
@@ -768,24 +932,24 @@ declare class SocialPublisherPostClient {
|
|
|
768
932
|
*/
|
|
769
933
|
private publishShortVideoToAccountByURL;
|
|
770
934
|
/**
|
|
771
|
-
* Publish a
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Publish a video to multiple social media platforms with auto-detection
|
|
776
|
-
* This is the recommended method for most use cases.
|
|
935
|
+
* Publish a video to connected social media accounts.
|
|
936
|
+
* Use original or authorized content only. TikTok Direct Post requires
|
|
937
|
+
* the creator-controlled Posty5 review and confirmation flow.
|
|
777
938
|
*
|
|
778
939
|
* @param options - Simplified publishing options
|
|
779
940
|
* @returns Created post response
|
|
780
941
|
*
|
|
942
|
+
* The workspace's connected accounts (set up via the Posty5 dashboard)
|
|
943
|
+
* determine which platforms this post lands on — supply a config block
|
|
944
|
+
* for each connected platform.
|
|
945
|
+
*
|
|
781
946
|
* @example
|
|
782
947
|
* ```typescript
|
|
783
|
-
* //
|
|
784
|
-
* await client.
|
|
948
|
+
* // Workspace has a YouTube account connected → just supply youtube config
|
|
949
|
+
* await client.publishShortVideoToWorkspace({
|
|
785
950
|
* workspaceId: 'workspace-123',
|
|
786
951
|
* video: videoFile,
|
|
787
952
|
* thumbnail: thumbFile,
|
|
788
|
-
* platforms: ['youtube'],
|
|
789
953
|
* youtube: {
|
|
790
954
|
* title: 'My Video',
|
|
791
955
|
* description: 'Description',
|
|
@@ -793,28 +957,21 @@ declare class SocialPublisherPostClient {
|
|
|
793
957
|
* }
|
|
794
958
|
* });
|
|
795
959
|
*
|
|
796
|
-
* //
|
|
797
|
-
* await client.
|
|
960
|
+
* // Workspace has YouTube + TikTok connected → supply both configs
|
|
961
|
+
* await client.publishShortVideoToWorkspace({
|
|
798
962
|
* workspaceId: 'workspace-123',
|
|
799
963
|
* video: 'https://example.com/video.mp4',
|
|
800
964
|
* thumbnail: 'https://example.com/thumb.jpg',
|
|
801
|
-
* platforms: ['youtube', 'tiktok'],
|
|
802
965
|
* youtube: { title: 'Video', description: 'Desc', tags: [] },
|
|
803
966
|
* tiktok: { caption: 'Caption', privacy_level: 'public', disable_duet: false, disable_stitch: false, disable_comment: false }
|
|
804
967
|
* });
|
|
805
968
|
*
|
|
806
|
-
* // Repost from Facebook (auto-detected)
|
|
807
|
-
* await client.publish({
|
|
808
|
-
* workspaceId: 'workspace-123',
|
|
809
|
-
* video: 'https://facebook.com/video/12345',
|
|
810
|
-
* platforms: ['youtube'],
|
|
811
|
-
* youtube: { title: 'Reposted', description: 'From FB', tags: [] }
|
|
812
|
-
* });
|
|
813
969
|
* ```
|
|
814
970
|
*/
|
|
815
971
|
publishShortVideoToWorkspace(options: IPublishOptions): Promise<string>;
|
|
816
972
|
/**
|
|
817
|
-
* Publish a video to
|
|
973
|
+
* Publish a video to a connected social media account.
|
|
974
|
+
* Use original or authorized content only.
|
|
818
975
|
*
|
|
819
976
|
* @param options - Simplified publishing options for account
|
|
820
977
|
* @returns Created post response
|
|
@@ -825,11 +982,12 @@ declare class SocialPublisherPostClient {
|
|
|
825
982
|
*/
|
|
826
983
|
publishShortVideo(options: IPublishOptions): Promise<string>;
|
|
827
984
|
/**
|
|
828
|
-
* Auto-detect video source type
|
|
985
|
+
* Auto-detect video source type.
|
|
986
|
+
*
|
|
829
987
|
* @param video - File or URL string
|
|
830
988
|
* @returns Detected source type and video
|
|
831
989
|
*/
|
|
832
990
|
private detectVideoSource;
|
|
833
991
|
}
|
|
834
992
|
|
|
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 };
|
|
993
|
+
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 };
|