@posty5/social-publisher-post 4.0.0 → 4.2.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/dist/index.d.mts CHANGED
@@ -1,10 +1,18 @@
1
1
  import { IPaginationResponse, HttpClient, IPaginationParams } from '@posty5/core';
2
+ export { HttpClient, IHttpClientConfig, IPosty5Config, uploadToR2 } from '@posty5/core';
2
3
 
3
- type SocialPublisherPostStatusType = "pending" | "processing" | "processingInPlatform" | "failedByPlatform" | "done" | "error" | "canceled" | "needsMaintenance" | "invalidVideoURL" | "invalidPostVideoURL" | "retrying";
4
- type SocialPublisherPostType = "shortVideo";
4
+ type SocialPublisherPostStatusType = "pending" | "processing" | "processingInPlatform" | "failedByPlatform" | "done" | "error" | "canceled" | "needsMaintenance" | "invalidVideoURL" | "invalidPostVideoURL" | "retrying" | "removing" | "removed" | "removeFailed";
5
+ /**
6
+ * Content type of a post.
7
+ *
8
+ * `longVideo` was added in 4.2.0; `image` and `text` were always returned by
9
+ * the API but missing from this union. Code that switches on this field must
10
+ * handle values it does not recognise — the set grows as the platform does.
11
+ */
12
+ type SocialPublisherPostType = "shortVideo" | "longVideo" | "image" | "text";
5
13
  type SocialPublisherPostAccountType = "youtube" | "facebook" | "instagram" | "tiktok";
6
14
  type SocialPublisherPostScheduleType = "now" | "schedule";
7
- type SocialPublisherPostSourceType = "video-file" | "video-url" | "facebook-video" | "youtube-video" | "tiktok-video";
15
+ type SocialPublisherPostSourceType = "video-file" | "video-url";
8
16
  /**
9
17
  * Status of the optional post-publish comment, reported per-platform.
10
18
  * - `pending`: queued, waiting for the parent post to be published
@@ -71,7 +79,10 @@ interface IImageMediaRequest {
71
79
  }
72
80
  /**
73
81
  * Image-post create request (workspace target).
74
- * Image posts cost **5 credits** + 1 for an optional auto-comment.
82
+ * Image posts cost **50 credits**, and each comment that actually posts is a
83
+ * further **25**. Both numbers come from the API's plan data
84
+ * (`socialMediaPublisher.imagePost` and `socialMediaPublisher.commentOnPost`);
85
+ * the "5 credits + 1" this line used to carry was wrong on both halves.
75
86
  * YouTube community posts are always reported as `notSupported`.
76
87
  */
77
88
  interface ICreateImagePostToWorkspaceRequest {
@@ -88,7 +99,24 @@ interface ICreateImagePostToWorkspaceRequest {
88
99
  facebook?: IFacebookPageConfig;
89
100
  instagram?: IInstagramConfig;
90
101
  schedule?: IScheduleConfig;
102
+ /**
103
+ * A single post-publish comment.
104
+ *
105
+ * @deprecated Use {@link comments} instead. Kept for one major version so
106
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
107
+ * so send one or the other.
108
+ */
91
109
  comment?: ICommentRequest;
110
+ /**
111
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
112
+ * post.
113
+ *
114
+ * Each carries its own delay, its own optional image and its own per-platform
115
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
116
+ * comment that actually posts; a comment aimed at no enabled platform is
117
+ * dropped before it is charged.
118
+ */
119
+ comments?: ICommentRequest[];
92
120
  tag?: string;
93
121
  refId?: string;
94
122
  }
@@ -106,21 +134,80 @@ interface ICreateImagePostToAccountRequest {
106
134
  facebook?: IFacebookPageConfig;
107
135
  instagram?: IInstagramConfig;
108
136
  schedule?: IScheduleConfig;
137
+ /**
138
+ * A single post-publish comment.
139
+ *
140
+ * @deprecated Use {@link comments} instead. Kept for one major version so
141
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
142
+ * so send one or the other.
143
+ */
109
144
  comment?: ICommentRequest;
145
+ /**
146
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
147
+ * post.
148
+ *
149
+ * Each carries its own delay, its own optional image and its own per-platform
150
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
151
+ * comment that actually posts; a comment aimed at no enabled platform is
152
+ * dropped before it is charged.
153
+ */
154
+ comments?: ICommentRequest[];
110
155
  tag?: string;
111
156
  refId?: string;
112
157
  }
158
+ /** At most this many comments may ride on one post. Enforced server-side. */
159
+ declare const MAX_POST_COMMENTS = 5;
160
+ /** Longest a comment may be. */
161
+ declare const MAX_COMMENT_LENGTH = 2200;
162
+ /** Longest a comment may wait after the post before it is published. */
163
+ declare const MAX_COMMENT_DELAY_MINUTES: number;
113
164
  /**
114
- * Optional post-publish comment.
115
- * Adds a comment under each platform post once it is published.
165
+ * One post-publish comment.
116
166
  *
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.
167
+ * Posted under each enabled platform post once the post itself is live, either
168
+ * immediately or after a delay.
169
+ *
170
+ * **Pricing: 25 credits per comment**, charged per comment that actually posts —
171
+ * not per post, and not "+1". Earlier versions of this file documented "+1
172
+ * credit", which was never the price: the API charges
173
+ * `socialMediaPublisher.commentOnPost`, which its plan data prices at 25. A
174
+ * comment aimed at no enabled platform is dropped before it is charged.
175
+ *
176
+ * **TikTok is not supported** and never will be through this API: TikTok exposes
177
+ * no public comment-posting endpoint. A comment aimed at it reports
178
+ * `notSupported` rather than failing.
179
+ *
180
+ * **An image is Facebook only.** Instagram's and YouTube's comment endpoints are
181
+ * text-only, so an image bound for either is dropped with a reason rather than
182
+ * failing the comment.
120
183
  */
121
184
  interface ICommentRequest {
122
- /** Comment text (1..2200 characters). */
185
+ /** Comment text (1..{@link MAX_COMMENT_LENGTH} characters). Required. */
123
186
  text: string;
187
+ /**
188
+ * How long to wait after the post is published, in minutes.
189
+ *
190
+ * `0` or omitted posts it as soon as the post is live. Maximum
191
+ * {@link MAX_COMMENT_DELAY_MINUTES} (24 hours) — the API refuses more.
192
+ */
193
+ delayMinutes?: number;
194
+ /**
195
+ * A publicly reachable image to attach. **Facebook only** (see above).
196
+ *
197
+ * Use this OR {@link imageStorageKey}, not both. A URL costs us no storage and
198
+ * is available on every plan; uploading is plan-gated.
199
+ */
200
+ imageUrl?: string;
201
+ /**
202
+ * The storage key of an image uploaded through the account's
203
+ * `default-comments/upload-urls` endpoint.
204
+ *
205
+ * Prefer {@link imageUrl} unless you have uploaded the bytes yourself: the key
206
+ * is what tells the API the object is OURS, which is what its cleanup path
207
+ * uses when the post or the comment is deleted. Sending a public URL in this
208
+ * field makes the image read as external and it will never be cleaned up.
209
+ */
210
+ imageStorageKey?: string;
124
211
  /** Post the comment on Facebook (default: true). */
125
212
  postToFacebook?: boolean;
126
213
  /** Post the comment on Instagram (default: true). */
@@ -140,14 +227,25 @@ interface ICreateSocialPublisherPostRequest {
140
227
  instagram?: IInstagramConfig;
141
228
  videoURL?: string;
142
229
  thumbURL?: string;
143
- postURL?: string;
144
230
  schedule?: IScheduleConfig;
145
231
  /**
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.
232
+ * A single post-publish comment.
233
+ *
234
+ * @deprecated Use {@link comments} instead. Kept for one major version so
235
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
236
+ * so send one or the other.
149
237
  */
150
238
  comment?: ICommentRequest;
239
+ /**
240
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
241
+ * post.
242
+ *
243
+ * Each carries its own delay, its own optional image and its own per-platform
244
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
245
+ * comment that actually posts; a comment aimed at no enabled platform is
246
+ * dropped before it is charged.
247
+ */
248
+ comments?: ICommentRequest[];
151
249
  /**
152
250
  * Tag (optional)
153
251
  * Use this field to filter posts by tag.
@@ -171,14 +269,25 @@ interface ICreateSocialPublisherAccountPostRequest {
171
269
  instagram?: IInstagramConfig;
172
270
  videoURL?: string;
173
271
  thumbURL?: string;
174
- postURL?: string;
175
272
  schedule?: IScheduleConfig;
176
273
  /**
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.
274
+ * A single post-publish comment.
275
+ *
276
+ * @deprecated Use {@link comments} instead. Kept for one major version so
277
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
278
+ * so send one or the other.
180
279
  */
181
280
  comment?: ICommentRequest;
281
+ /**
282
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
283
+ * post.
284
+ *
285
+ * Each carries its own delay, its own optional image and its own per-platform
286
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
287
+ * comment that actually posts; a comment aimed at no enabled platform is
288
+ * dropped before it is charged.
289
+ */
290
+ comments?: ICommentRequest[];
182
291
  /**
183
292
  * Tag (optional)
184
293
  * Use this field to filter posts by tag.
@@ -201,8 +310,24 @@ interface IPostSetting {
201
310
  instagram?: IInstagramConfig;
202
311
  schedule?: IScheduleConfig;
203
312
  source: SocialPublisherPostSourceType;
204
- /** Optional post-publish comment (Pro plan, +1 credit). TikTok is not supported. */
313
+ /**
314
+ * A single post-publish comment.
315
+ *
316
+ * @deprecated Use {@link comments} instead. Kept for one major version so
317
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
318
+ * so send one or the other.
319
+ */
205
320
  comment?: ICommentRequest;
321
+ /**
322
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
323
+ * post.
324
+ *
325
+ * Each carries its own delay, its own optional image and its own per-platform
326
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
327
+ * comment that actually posts; a comment aimed at no enabled platform is
328
+ * dropped before it is charged.
329
+ */
330
+ comments?: ICommentRequest[];
206
331
  /** Optional caller-supplied tag, persisted on the created post for filtering. */
207
332
  tag?: string;
208
333
  /** Optional caller-supplied reference ID, persisted on the created post for filtering. */
@@ -217,8 +342,24 @@ interface IAccountPostSetting {
217
342
  instagram?: IInstagramConfig;
218
343
  schedule?: IScheduleConfig;
219
344
  source: SocialPublisherPostSourceType;
220
- /** Optional post-publish comment (Pro plan, +1 credit). TikTok is not supported. */
345
+ /**
346
+ * A single post-publish comment.
347
+ *
348
+ * @deprecated Use {@link comments} instead. Kept for one major version so
349
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
350
+ * so send one or the other.
351
+ */
221
352
  comment?: ICommentRequest;
353
+ /**
354
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
355
+ * post.
356
+ *
357
+ * Each carries its own delay, its own optional image and its own per-platform
358
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
359
+ * comment that actually posts; a comment aimed at no enabled platform is
360
+ * dropped before it is charged.
361
+ */
362
+ comments?: ICommentRequest[];
222
363
  /** Optional caller-supplied tag, persisted on the created post for filtering. */
223
364
  tag?: string;
224
365
  /** Optional caller-supplied reference ID, persisted on the created post for filtering. */
@@ -227,6 +368,13 @@ interface IAccountPostSetting {
227
368
  interface IGenerateUploadUrlsRequest {
228
369
  thumbFileType?: string;
229
370
  videoFileType?: string;
371
+ /**
372
+ * Post type these uploads are for. Sending `"longVideo"` makes the server
373
+ * check plan gating and affordability now, before you spend an hour
374
+ * uploading something that cannot be published. The duration-accurate
375
+ * charge still happens when the post is created.
376
+ */
377
+ postType?: SocialPublisherPostType;
230
378
  }
231
379
  /**
232
380
  * Simplified options for the unified publish() method
@@ -241,10 +389,9 @@ interface IPublishOptions {
241
389
  * Video source (required)
242
390
  * Can be:
243
391
  * - File object (will be uploaded)
244
- * - Direct video URL (http://... or https://...)
245
- * - Facebook video URL (auto-detected for repost)
246
- * - TikTok video URL (auto-detected for repost)
247
- * - YouTube Shorts URL (auto-detected for repost)
392
+ * - Direct video file URL (http://... or https://...)
393
+ *
394
+ * Third-party platform URLs are not supported by the public SDK.
248
395
  */
249
396
  video: File | string;
250
397
  /**
@@ -289,10 +436,23 @@ interface IPublishOptions {
289
436
  */
290
437
  refId?: string;
291
438
  /**
292
- * Optional post-publish comment (Pro plan, +1 credit).
293
- * TikTok comments are not supported.
439
+ * A single post-publish comment.
440
+ *
441
+ * @deprecated Use {@link comments} instead. Kept for one major version so
442
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
443
+ * so send one or the other.
294
444
  */
295
445
  comment?: ICommentRequest;
446
+ /**
447
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
448
+ * post.
449
+ *
450
+ * Each carries its own delay, its own optional image and its own per-platform
451
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
452
+ * comment that actually posts; a comment aimed at no enabled platform is
453
+ * dropped before it is charged.
454
+ */
455
+ comments?: ICommentRequest[];
296
456
  }
297
457
  /**
298
458
  * Options for publishing to an account
@@ -306,10 +466,9 @@ interface IPublishToAccountOptions {
306
466
  * Video source (required)
307
467
  * Can be:
308
468
  * - File object (will be uploaded)
309
- * - Direct video URL (http://... or https://...)
310
- * - Facebook video URL (auto-detected for repost)
311
- * - TikTok video URL (auto-detected for repost)
312
- * - YouTube Shorts URL (auto-detected for repost)
469
+ * - Direct video file URL (http://... or https://...)
470
+ *
471
+ * Third-party platform URLs are not supported by the public SDK.
313
472
  */
314
473
  video: File | string;
315
474
  /**
@@ -354,10 +513,23 @@ interface IPublishToAccountOptions {
354
513
  */
355
514
  refId?: string;
356
515
  /**
357
- * Optional post-publish comment (Pro plan, +1 credit).
358
- * TikTok comments are not supported.
516
+ * A single post-publish comment.
517
+ *
518
+ * @deprecated Use {@link comments} instead. Kept for one major version so
519
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
520
+ * so send one or the other.
359
521
  */
360
522
  comment?: ICommentRequest;
523
+ /**
524
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
525
+ * post.
526
+ *
527
+ * Each carries its own delay, its own optional image and its own per-platform
528
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
529
+ * comment that actually posts; a comment aimed at no enabled platform is
530
+ * dropped before it is charged.
531
+ */
532
+ comments?: ICommentRequest[];
361
533
  }
362
534
  /**
363
535
  * Base interface for quick publish options
@@ -373,7 +545,7 @@ interface IQuickPublishBaseOptions {
373
545
  * Video source (required)
374
546
  * Can be:
375
547
  * - File object: Will be uploaded to cloud storage
376
- * - URL string: Direct video URL or platform URL (Facebook, TikTok, YouTube)
548
+ * - URL string: Direct video file URL for original or authorized content
377
549
  *
378
550
  * Supported formats: .mp4, .mov, .avi, .mkv, .webm
379
551
  */
@@ -410,10 +582,23 @@ interface IQuickPublishBaseOptions {
410
582
  */
411
583
  refId?: string;
412
584
  /**
413
- * Optional post-publish comment (Pro plan, +1 credit).
414
- * TikTok comments are not supported.
585
+ * A single post-publish comment.
586
+ *
587
+ * @deprecated Use {@link comments} instead. Kept for one major version so
588
+ * existing callers keep compiling; the API refuses a request carrying BOTH,
589
+ * so send one or the other.
415
590
  */
416
591
  comment?: ICommentRequest;
592
+ /**
593
+ * Up to {@link MAX_POST_COMMENTS} post-publish comments, in the order they
594
+ * post.
595
+ *
596
+ * Each carries its own delay, its own optional image and its own per-platform
597
+ * flags — see {@link ICommentRequest}. **25 credits each**, charged per
598
+ * comment that actually posts; a comment aimed at no enabled platform is
599
+ * dropped before it is charged.
600
+ */
601
+ comments?: ICommentRequest[];
417
602
  }
418
603
  /**
419
604
  * Quick publish options for YouTube only
@@ -575,41 +760,144 @@ interface IListParams {
575
760
  "instagram.postInfo.isAllow"?: boolean;
576
761
  "tiktok.postInfo.isAllow"?: boolean;
577
762
  }
763
+ /**
764
+ * Longest video the API accepts for a `longVideo` post: 60 minutes.
765
+ * Exported so callers can check a file before starting an upload, but the
766
+ * server measures the real duration and is the only authority on it.
767
+ */
768
+ declare const LONG_VIDEO_MAX_DURATION_SECONDS = 3600;
769
+ /** One charge unit covers each started 5 minutes of video. */
770
+ declare const LONG_VIDEO_CREDIT_UNIT_SECONDS = 300;
771
+ /**
772
+ * Options for {@link SocialPublisherPostClient.publishLongVideoToWorkspace}.
773
+ *
774
+ * Identical to {@link IPublishOptions} apart from `onProgress` — a 60-minute
775
+ * upload is long enough that a caller needs to report it — and the absence of
776
+ * any duration field. The duration is measured server-side from the file, and
777
+ * the price is derived from that measurement, so a client-supplied duration
778
+ * would be a client-supplied price.
779
+ */
780
+ interface ILongVideoUploadControls {
781
+ /**
782
+ * Called once the upload exists on the server, with its URL.
783
+ *
784
+ * Persist this if you want to resume the same transfer after a crash or a
785
+ * page reload: the ticket expires in minutes, but an upload that already
786
+ * exists resumes by its own URL and is unaffected. Pass it back as
787
+ * `resumeFrom`.
788
+ */
789
+ onUploadUrl?: (uploadUrl: string) => void;
790
+ /**
791
+ * Resume a previous attempt instead of starting a new upload. Use the URL
792
+ * handed to `onUploadUrl` on the earlier run.
793
+ */
794
+ resumeFrom?: string;
795
+ /**
796
+ * Abort the transfer. What has already been uploaded stays on the server and
797
+ * can be resumed with `resumeFrom`; no post is created, so nothing is
798
+ * charged.
799
+ */
800
+ signal?: AbortSignal;
801
+ /**
802
+ * Discard the partial upload when `signal` fires, instead of leaving it
803
+ * resumable.
804
+ *
805
+ * Off by default: in most interfaces "pause" and "cancel" are the same
806
+ * button, and a user who paused a 40-minute video does not expect to start
807
+ * over. Set it where the abort really is final — a closed wizard, a replaced
808
+ * file — so the server stops holding megabytes nobody will claim.
809
+ *
810
+ * Best-effort. A failed termination is not reported, because the server
811
+ * expires abandoned uploads after 24 hours regardless.
812
+ */
813
+ terminateOnAbort?: boolean;
814
+ }
815
+ interface IPublishLongVideoOptions extends IPublishOptions, ILongVideoUploadControls {
816
+ /**
817
+ * Called as the upload proceeds, with a percentage.
818
+ *
819
+ * Resumable transfers report per chunk — 8MiB of an hour-long file at a time
820
+ * — so this moves continuously. It falls back to 0 then 100 only on a server
821
+ * without the resumable service, where the single signed PUT would need
822
+ * `XMLHttpRequest` to report anything in between.
823
+ */
824
+ onProgress?: (progress: number) => void;
825
+ }
826
+ /** Account-targeted counterpart of {@link IPublishLongVideoOptions}. */
827
+ interface IPublishLongVideoToAccountOptions extends IPublishToAccountOptions, ILongVideoUploadControls {
828
+ /** See the note on {@link IPublishLongVideoOptions.onProgress}. */
829
+ onProgress?: (progress: number) => void;
830
+ }
831
+ /**
832
+ * Re-schedule (or edit) a post that has not published yet.
833
+ *
834
+ * Only posts still pending with a future publish time accept this; anything
835
+ * that has started publishing is refused by the server.
836
+ */
837
+ interface IReschedulePostRequest {
838
+ /** New publish moment. Pass a `Date`, or `"now"` to publish immediately. */
839
+ schedule: "now" | Date;
840
+ /** Optionally replace the caption at the same time. */
841
+ caption?: string;
842
+ }
578
843
 
579
844
  interface IUploadConfig {
580
845
  url: string;
581
846
  fields: Record<string, string>;
582
847
  }
848
+ /**
849
+ * One upload destination the API authorized.
850
+ *
851
+ * The same slot is offered two ways. `uploadFileURL` is a signed R2 PUT — one
852
+ * request, no resume. The `tus*` fields describe the same destination as a
853
+ * resumable transfer. Both land the file at `fileURL`, so nothing downstream
854
+ * cares which was used.
855
+ *
856
+ * The resumable fields are optional on purpose: an API not deployed with the
857
+ * resumable service omits them, and clients fall back to the signed PUT.
858
+ */
859
+ interface IUploadTarget {
860
+ /** Public URL of the finished object. Known before the upload starts. */
861
+ fileURL: string | undefined;
862
+ /** Signed URL for a single PUT. */
863
+ uploadFileURL: string | undefined;
864
+ /** Object key inside the bucket. */
865
+ bucketFilePath: string | undefined;
866
+ /**
867
+ * Absolute tus endpoint for this same destination, when resumable uploads
868
+ * are configured.
869
+ */
870
+ tusEndpoint?: string;
871
+ /**
872
+ * Signed capability naming this exact destination, sent as the tus
873
+ * `Upload-Metadata` key `ticket`. Short-lived, and never to be logged or
874
+ * persisted.
875
+ */
876
+ ticket?: string;
877
+ /** When the ticket stops being accepted for creating an upload. */
878
+ ticketExpiresAt?: string;
879
+ /** Maximum accepted size in bytes, so a client can fail fast. */
880
+ maxSize?: number;
881
+ }
583
882
  interface IGenerateUploadUrlsResponse {
584
883
  postId: string;
585
- thumb: {
586
- /**
587
- * Public URL to access file from Cloud Bucket
588
- */
589
- fileURL: string | undefined;
590
- /**
591
- * Upload URL to upload file to Cloud Bucket (Signed URL)
592
- */
593
- uploadFileURL: string | undefined;
594
- /**
595
- * Path in Cloud Bucket
596
- */
597
- bucketFilePath: string | undefined;
598
- };
599
- video: {
600
- /**
601
- * Public URL to access file from Cloud Bucket
602
- */
603
- fileURL: string | undefined;
604
- /**
605
- * Upload URL to upload file to Cloud Bucket (Signed URL)
606
- */
607
- uploadFileURL: string | undefined;
608
- /**
609
- * Path in Cloud Bucket
610
- */
611
- bucketFilePath: string | undefined;
612
- };
884
+ thumb: IUploadTarget;
885
+ video: IUploadTarget;
886
+ }
887
+ /**
888
+ * Per-platform outcome of a {@link SocialPublisherPostClient.removePost} call.
889
+ * `notSupported` marks platforms (Instagram, TikTok) whose API can't delete a
890
+ * published post; `skipped` marks platforms that had nothing to delete.
891
+ */
892
+ interface IRemovePostPlatformResult {
893
+ success: boolean;
894
+ notSupported?: boolean;
895
+ skipped?: boolean;
896
+ error?: string;
897
+ }
898
+ interface IRemovePostResponse {
899
+ _id: string;
900
+ results: Partial<Record<"youtube" | "facebook" | "instagram" | "tiktok", IRemovePostPlatformResult>>;
613
901
  }
614
902
  interface ISocialPublisherPostStatusLog {
615
903
  status: SocialPublisherPostStatusType;
@@ -649,7 +937,11 @@ interface IImageDTO {
649
937
  }
650
938
  /**
651
939
  * Per-platform comment status block returned on the post status response.
652
- * Present only when the post was created with a `comment` payload.
940
+ * Present only when the post was created with a comment payload.
941
+ *
942
+ * With a LIST of comments this describes the first one; the whole list, one
943
+ * entry per comment, is {@link ICommentStatusDTO}[] on `comments`. The singular
944
+ * block is kept so a caller written against one comment keeps reading.
653
945
  *
654
946
  * TikTok always returns `currentStatus = "notSupported"`.
655
947
  */
@@ -669,6 +961,25 @@ interface ICommentInfoDTO {
669
961
  /** Grouped history of status transitions for this platform comment. */
670
962
  statusHistoryGrouped?: IBaseStatusHistoryGroupedDay<CommentStatusType>[];
671
963
  }
964
+ /**
965
+ * One comment's status on one platform.
966
+ *
967
+ * `order` is the position it posts in, which is also the position it was sent
968
+ * in — the API takes the order from the array rather than from a field on the
969
+ * comment, so two comments cannot claim the same slot.
970
+ */
971
+ interface ICommentStatusDTO extends ICommentInfoDTO {
972
+ /** Position in the list, from 0. Also the order it posts in. */
973
+ order: number;
974
+ /** The text as it was sent, so a status row is readable without the request. */
975
+ text?: string;
976
+ /** Minutes waited after the post went live. `0` means immediately. */
977
+ delayMinutes?: number;
978
+ /** The image attached, if any. Facebook only; dropped elsewhere with a reason. */
979
+ imageUrl?: string;
980
+ /** Set when this comment was copied from the account's saved defaults. */
981
+ defaultCommentId?: string;
982
+ }
672
983
  interface ISocialPublisherPostPlatform {
673
984
  postInfo: ISocialPublisherPostInfo;
674
985
  }
@@ -702,11 +1013,22 @@ interface ISocialPublisherPostResponse {
702
1013
  };
703
1014
  refId: string;
704
1015
  tag: string;
1016
+ type?: "shortVideo" | "longVideo" | "image" | string;
1017
+ source?: SocialPublisherPostSourceType | string;
1018
+ sourceURLs?: {
1019
+ thumbURL?: string;
1020
+ videoURL?: string;
1021
+ postURL?: string;
1022
+ imageURL?: string;
1023
+ };
1024
+ image?: {
1025
+ externalUrl?: string;
1026
+ };
705
1027
  }
706
1028
  interface ISocialPublisherPostStatusResponse {
707
1029
  _id: string;
708
1030
  numbering: string;
709
- type: "shortVideo" | "image";
1031
+ type: "shortVideo" | "longVideo" | "image";
710
1032
  source: SocialPublisherPostSourceType;
711
1033
  sourceURLs: {
712
1034
  /**
@@ -721,13 +1043,11 @@ interface ISocialPublisherPostStatusResponse {
721
1043
  * Image URL (image-post type). Returned for posts of `type: "image"`.
722
1044
  */
723
1045
  imageURL?: string;
724
- /**
725
- * Post URL, can be null if didn't upload any post or passed URL for platforms like facebook, tiktok, youtube
726
- */
727
- postURL?: string;
728
1046
  };
729
1047
  /** Image-post metadata — only present when `type === "image"`. */
730
1048
  image?: IImageDTO;
1049
+ /** Long-video metadata — only present when `type === "longVideo"`. */
1050
+ video?: IVideoDTO;
731
1051
  currentStatus: SocialPublisherPostStatusType;
732
1052
  currentError: string;
733
1053
  currentStatusChangedAt: string;
@@ -744,6 +1064,10 @@ interface ISocialPublisherPostStatusResponse {
744
1064
  scheduledAt: Date;
745
1065
  executedAt: Date;
746
1066
  };
1067
+ /** Custom reference id supplied when the post was created. */
1068
+ refId?: string;
1069
+ /** Custom tag supplied when the post was created. */
1070
+ tag?: string;
747
1071
  }
748
1072
  interface ISocialPublisherWorkspace {
749
1073
  _id: string;
@@ -783,12 +1107,22 @@ interface ISocialPublisherPostTikTokPostDetails extends ISocialPublisherPostAcco
783
1107
  privacy_level: string;
784
1108
  /** Per-platform comment status — TikTok always reports `notSupported`. */
785
1109
  commentInfo?: ICommentInfoDTO;
1110
+ /** One entry per comment, every one of them `notSupported` on TikTok. */
1111
+ comments?: ICommentStatusDTO[];
786
1112
  }
787
1113
  interface ISocialPublisherPostFacebookPagePostDetails extends ISocialPublisherPostAccount {
788
1114
  description: string;
789
1115
  title: string;
790
1116
  /** Per-platform comment status (only present when a comment was requested). */
791
1117
  commentInfo?: ICommentInfoDTO;
1118
+ /**
1119
+ * One entry per comment on this platform, in posting order.
1120
+ *
1121
+ * Present when the post was created with `comments[]`. `commentInfo` above
1122
+ * mirrors the first entry, so a caller written before the list existed keeps
1123
+ * working.
1124
+ */
1125
+ comments?: ICommentStatusDTO[];
792
1126
  }
793
1127
  interface ISocialPublisherPostInstagramPostDetails extends ISocialPublisherPostAccount {
794
1128
  description: string;
@@ -796,6 +1130,14 @@ interface ISocialPublisherPostInstagramPostDetails extends ISocialPublisherPostA
796
1130
  is_published_to_both_feed_and_story: boolean;
797
1131
  /** Per-platform comment status (only present when a comment was requested). */
798
1132
  commentInfo?: ICommentInfoDTO;
1133
+ /**
1134
+ * One entry per comment on this platform, in posting order.
1135
+ *
1136
+ * Present when the post was created with `comments[]`. `commentInfo` above
1137
+ * mirrors the first entry, so a caller written before the list existed keeps
1138
+ * working.
1139
+ */
1140
+ comments?: ICommentStatusDTO[];
799
1141
  }
800
1142
  interface ISocialPublisherPostYouTubePostDetails extends ISocialPublisherPostAccount {
801
1143
  title: string;
@@ -809,6 +1151,14 @@ interface ISocialPublisherPostYouTubePostDetails extends ISocialPublisherPostAcc
809
1151
  localizations: any;
810
1152
  /** Per-platform comment status (only present when a comment was requested). */
811
1153
  commentInfo?: ICommentInfoDTO;
1154
+ /**
1155
+ * One entry per comment on this platform, in posting order.
1156
+ *
1157
+ * Present when the post was created with `comments[]`. `commentInfo` above
1158
+ * mirrors the first entry, so a caller written before the list existed keeps
1159
+ * working.
1160
+ */
1161
+ comments?: ICommentStatusDTO[];
812
1162
  }
813
1163
  interface ISocialPublisherPostNextPreviousResponse {
814
1164
  nextId?: string;
@@ -826,6 +1176,89 @@ interface IBaseStatusHistoryGroupedItem<StatusType> {
826
1176
  time: Date;
827
1177
  status: StatusType;
828
1178
  }
1179
+ /**
1180
+ * Long-video metadata carried on a post. Present only when the post's `type`
1181
+ * is `longVideo`.
1182
+ */
1183
+ interface IVideoDTO {
1184
+ /** Duration measured server-side, in seconds. */
1185
+ durationSeconds: number;
1186
+ /** Charge units billed — one per started 5 minutes. */
1187
+ creditUnits?: number;
1188
+ container?: string;
1189
+ videoCodec?: string;
1190
+ audioCodec?: string;
1191
+ width?: number;
1192
+ height?: number;
1193
+ sizeBytes?: number;
1194
+ }
1195
+ /** What one platform would do with a video of a given length. */
1196
+ interface ILongVideoPlatformVerdict {
1197
+ platform: "youtube" | "facebook" | "instagram" | "tiktok";
1198
+ accepted: boolean;
1199
+ /** The limit that applied, in seconds, when one did. */
1200
+ limitSeconds?: number;
1201
+ /** Why the platform refused. Present only when `accepted` is false. */
1202
+ reason?: string;
1203
+ }
1204
+ /**
1205
+ * Result of {@link SocialPublisherPostClient.getLongVideoQuote} — what the
1206
+ * post will cost, before committing to it.
1207
+ */
1208
+ interface ILongVideoQuoteResponse {
1209
+ /** Duration measured server-side, in seconds, rounded up. */
1210
+ durationSeconds: number;
1211
+ /** The ceiling the API enforces (3600). */
1212
+ maxDurationSeconds: number;
1213
+ /** False when the video is over the ceiling; `reason` then says by how much. */
1214
+ withinLimit: boolean;
1215
+ /** Charge units — one per started 5 minutes. Zero when over the limit. */
1216
+ units: number;
1217
+ /** This plan's cost per unit (50 by default). */
1218
+ creditsPerUnit: number;
1219
+ /** Total credits the post will cost. */
1220
+ credits: number;
1221
+ /** True when the plan does not include long video posting. */
1222
+ isGated: boolean;
1223
+ container?: string;
1224
+ videoCodec?: string;
1225
+ width?: number;
1226
+ height?: number;
1227
+ /** What each platform would do with a video this long. */
1228
+ platforms: ILongVideoPlatformVerdict[];
1229
+ /** Present only when `withinLimit` is false. */
1230
+ reason?: string;
1231
+ }
1232
+ /**
1233
+ * A connected platform dropped from a workspace post because the video is too
1234
+ * long for it. The rest of the post still publishes.
1235
+ */
1236
+ interface ILongVideoRefusedTarget {
1237
+ platform: "youtube" | "facebook" | "instagram" | "tiktok";
1238
+ /** Names that platform's limit and this video's length. */
1239
+ reason: string;
1240
+ }
1241
+ /**
1242
+ * Result of publishing a long video. Unlike the short-video helpers, which
1243
+ * return just an id, this carries what was measured and what was charged —
1244
+ * and which targets, if any, were dropped for exceeding their own limit.
1245
+ */
1246
+ interface IPublishLongVideoResult {
1247
+ /** Created post ID. */
1248
+ _id: string;
1249
+ /** Duration measured server-side, in seconds. */
1250
+ durationSeconds: number;
1251
+ /** Charge units billed. */
1252
+ creditUnits: number;
1253
+ /** Credits actually charged. */
1254
+ credits: number;
1255
+ /**
1256
+ * Targets dropped because the video exceeded their duration limit. Empty
1257
+ * when every connected account accepted it. Always empty for account-targeted
1258
+ * posts, which are refused outright rather than partially published.
1259
+ */
1260
+ refusedTargets: ILongVideoRefusedTarget[];
1261
+ }
829
1262
 
830
1263
  /**
831
1264
  * Social Publisher Post Client
@@ -856,6 +1289,26 @@ declare class SocialPublisherPostClient {
856
1289
  * @param data - File information
857
1290
  */
858
1291
  private generateUploadUrls;
1292
+ /**
1293
+ * Remove (delete) a post's published media directly from the connected
1294
+ * platform pages. Runs synchronously on the server — the media is deleted
1295
+ * from the platform immediately, not via a background job.
1296
+ *
1297
+ * Cost: 50 credits, charged ONLY when the removal succeeds (at least one
1298
+ * platform cleared and no delete-capable platform failed). Instagram and
1299
+ * TikTok expose no delete API, so a post published only to those platforms
1300
+ * cannot be removed programmatically and no credits are charged.
1301
+ *
1302
+ * @param id - Post ID
1303
+ * @returns Per-platform removal results
1304
+ *
1305
+ * @example
1306
+ * ```ts
1307
+ * const { results } = await client.removePost("post_123");
1308
+ * // results.youtube?.success === true
1309
+ * ```
1310
+ */
1311
+ removePost(id: string): Promise<IRemovePostResponse>;
859
1312
  /**
860
1313
  * Get next and previous post IDs
861
1314
  * @param id - Current Post ID
@@ -930,14 +1383,6 @@ declare class SocialPublisherPostClient {
930
1383
  * @returns Created post response
931
1384
  */
932
1385
  private publishShortVideoToWorkspaceByURL;
933
- /**
934
- * Publish a repost video from TikTok
935
- * @param settings - Post creation settings
936
- * @param videoURL - TikTok video URL (tiktok.com, vm.tiktok.com)
937
- * @param thumb - Optional thumbnail image file or URL string
938
- * @returns Created post response
939
- */
940
- private publishRepostVideoToWorkspace;
941
1386
  /**
942
1387
  * Publish a short video to account by uploading a video file
943
1388
  */
@@ -947,12 +1392,9 @@ declare class SocialPublisherPostClient {
947
1392
  */
948
1393
  private publishShortVideoToAccountByURL;
949
1394
  /**
950
- * Publish a repost video to account
951
- */
952
- private publishRepostVideoToAccount;
953
- /**
954
- * Publish a video to multiple social media platforms with auto-detection
955
- * This is the recommended method for most use cases.
1395
+ * Publish a video to connected social media accounts.
1396
+ * Use original or authorized content only. TikTok Direct Post requires
1397
+ * the creator-controlled Posty5 review and confirmation flow.
956
1398
  *
957
1399
  * @param options - Simplified publishing options
958
1400
  * @returns Created post response
@@ -984,17 +1426,12 @@ declare class SocialPublisherPostClient {
984
1426
  * tiktok: { caption: 'Caption', privacy_level: 'public', disable_duet: false, disable_stitch: false, disable_comment: false }
985
1427
  * });
986
1428
  *
987
- * // Repost from Facebook (auto-detected)
988
- * await client.publishShortVideoToWorkspace({
989
- * workspaceId: 'workspace-123',
990
- * video: 'https://facebook.com/video/12345',
991
- * youtube: { title: 'Reposted', description: 'From FB', tags: [] }
992
- * });
993
1429
  * ```
994
1430
  */
995
1431
  publishShortVideoToWorkspace(options: IPublishOptions): Promise<string>;
996
1432
  /**
997
- * Publish a video to multiple social media platforms with auto-detection (Account)
1433
+ * Publish a video to a connected social media account.
1434
+ * Use original or authorized content only.
998
1435
  *
999
1436
  * @param options - Simplified publishing options for account
1000
1437
  * @returns Created post response
@@ -1005,11 +1442,193 @@ declare class SocialPublisherPostClient {
1005
1442
  */
1006
1443
  publishShortVideo(options: IPublishOptions): Promise<string>;
1007
1444
  /**
1008
- * Auto-detect video source type
1445
+ * Price a long video before publishing it. Neither creates nor charges
1446
+ * anything.
1447
+ *
1448
+ * The server reads the video, measures its duration, and returns the exact
1449
+ * cost plus what each platform would do with a video that long. Show this
1450
+ * before the user commits — the units come from the same function the create
1451
+ * call charges with, so the quote and the bill cannot disagree.
1452
+ *
1453
+ * @param videoURL - URL of an uploaded or externally hosted video
1454
+ *
1455
+ * @example
1456
+ * ```ts
1457
+ * const quote = await client.getLongVideoQuote(fileURL);
1458
+ * if (!quote.withinLimit) throw new Error(quote.reason);
1459
+ * console.log(`${quote.durationSeconds}s costs ${quote.credits} credits`);
1460
+ * const blocked = quote.platforms.filter((p) => !p.accepted);
1461
+ * ```
1462
+ */
1463
+ getLongVideoQuote(videoURL: string): Promise<ILongVideoQuoteResponse>;
1464
+ /**
1465
+ * Publish a video of up to 60 minutes to every account connected to a
1466
+ * workspace.
1467
+ *
1468
+ * Handles the whole sequence for an uploaded file: request an upload
1469
+ * destination, push the bytes, then create the post. Pass a URL instead of a
1470
+ * `File` to publish something already hosted elsewhere.
1471
+ *
1472
+ * Cost is duration-based — 50 credits per started 5 minutes — so a 12-minute
1473
+ * video costs 150. Call {@link getLongVideoQuote} first if you need to show
1474
+ * the price. The duration is measured server-side; there is no duration
1475
+ * option here because a client-supplied one would be a client-supplied price.
1476
+ *
1477
+ * Platforms differ on what they accept: a 40-minute video publishes to
1478
+ * YouTube and Facebook but is refused by Instagram, whose Reels cap at 15
1479
+ * minutes. Those targets come back in `refusedTargets` — the post still
1480
+ * publishes to the rest.
1481
+ *
1482
+ * @example
1483
+ * ```ts
1484
+ * const result = await client.publishLongVideoToWorkspace({
1485
+ * workspaceId: "ws_123",
1486
+ * video: recordingFile,
1487
+ * youtube: { title: "Full session", description: "...", tags: ["workshop"] },
1488
+ * onProgress: (p) => console.log(`${p}%`),
1489
+ * });
1490
+ * console.log(`Charged ${result.credits} credits for ${result.durationSeconds}s`);
1491
+ * for (const t of result.refusedTargets) console.warn(t.reason);
1492
+ * ```
1493
+ */
1494
+ publishLongVideoToWorkspace(options: IPublishLongVideoOptions): Promise<IPublishLongVideoResult>;
1495
+ /**
1496
+ * Publish a video of up to 60 minutes to a single connected account.
1497
+ *
1498
+ * With one target there is no partial success: if that platform will not take
1499
+ * a video this long, the whole call is refused and nothing is charged. See
1500
+ * {@link publishLongVideoToWorkspace} for the cost model.
1501
+ */
1502
+ publishLongVideoToAccount(options: IPublishLongVideoToAccountOptions): Promise<IPublishLongVideoResult>;
1503
+ /**
1504
+ * Re-schedule a post that has not published yet, or send it out now.
1505
+ *
1506
+ * Free — this costs no credits. Only posts still pending with a future
1507
+ * publish time are eligible; anything that has started publishing is refused
1508
+ * by the server with a reason.
1509
+ *
1510
+ * @example
1511
+ * ```ts
1512
+ * await client.reschedulePost("post_123", { schedule: new Date("2026-09-01T09:00:00Z") });
1513
+ * await client.reschedulePost("post_123", { schedule: "now" });
1514
+ * ```
1515
+ */
1516
+ reschedulePost(id: string, data: IReschedulePostRequest): Promise<void>;
1517
+ /**
1518
+ * Delete a post that has not published yet, releasing its uploaded media in
1519
+ * the same request.
1520
+ *
1521
+ * Free, and nothing is refunded — nothing was charged for a post that never
1522
+ * went out. A post that HAS published is refused; use {@link removePost} to
1523
+ * take down media that is already live.
1524
+ *
1525
+ * @example
1526
+ * ```ts
1527
+ * await client.deletePost("post_123");
1528
+ * ```
1529
+ */
1530
+ deletePost(id: string): Promise<void>;
1531
+ /**
1532
+ * Upload a long video and return the URL to publish from.
1533
+ *
1534
+ * Declares `postType: "longVideo"` so the server refuses now — on plan gating
1535
+ * or an empty balance — rather than after an hour of transfer.
1536
+ */
1537
+ private uploadLongVideo;
1538
+ /** Translate the friendly `"now" | Date` form into the wire shape. */
1539
+ private buildSchedule;
1540
+ /**
1541
+ * Guarantee the shape callers destructure. An older server that does not yet
1542
+ * return the duration fields would otherwise hand back `undefined` where the
1543
+ * types promise numbers.
1544
+ */
1545
+ private normaliseLongVideoResult;
1546
+ /**
1547
+ * Auto-detect video source type.
1548
+ *
1009
1549
  * @param video - File or URL string
1010
1550
  * @returns Detected source type and video
1011
1551
  */
1012
1552
  private detectVideoSource;
1013
1553
  }
1014
1554
 
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 };
1555
+ /**
1556
+ * Resumable uploads (tus 1.0.0) for large media.
1557
+ *
1558
+ * A signed PUT is all-or-nothing: a dropped connection at 90% of an hour-long
1559
+ * video starts again from zero. The API offers the same destination as a
1560
+ * resumable transfer, and this is the client for it.
1561
+ *
1562
+ * The protocol subset needed here is small — create, patch, head — so it is
1563
+ * implemented directly rather than by pulling `tus-js-client` into a published
1564
+ * SDK's dependency tree. What is deliberately NOT implemented is fingerprint
1565
+ * storage: resuming across page loads needs somewhere to persist the upload
1566
+ * URL, which is the caller's decision, not a library's. Pass `uploadUrl` back
1567
+ * in to resume an earlier attempt yourself.
1568
+ */
1569
+
1570
+ /**
1571
+ * 8MiB matches the server's multipart part size, so one PATCH becomes one R2
1572
+ * part with no server-side re-buffering. It also caps how much progress a
1573
+ * dropped connection can cost.
1574
+ */
1575
+ declare const DEFAULT_CHUNK_SIZE: number;
1576
+ interface IResumableUploadOptions {
1577
+ /** Called with 0-100 as the transfer proceeds. */
1578
+ onProgress?: (progress: number) => void;
1579
+ /**
1580
+ * Called once the upload exists on the server, with its URL. Persist this to
1581
+ * resume the same transfer later — the ticket expires, but an upload that
1582
+ * already exists resumes by its own URL and is unaffected.
1583
+ */
1584
+ onUploadUrl?: (uploadUrl: string) => void;
1585
+ /** Resume a previous attempt instead of creating a new upload. */
1586
+ uploadUrl?: string;
1587
+ /** Bytes per PATCH. Defaults to the server's 8MiB part size. */
1588
+ chunkSize?: number;
1589
+ /** Abort the transfer. A partially uploaded file can be resumed later. */
1590
+ signal?: AbortSignal;
1591
+ /**
1592
+ * Tell the server to discard the partial upload when `signal` fires.
1593
+ *
1594
+ * Off by default, and deliberately so: the reason abort leaves the bytes in
1595
+ * place is that "cancel" and "pause" are the same gesture in most UIs, and a
1596
+ * user who paused a 40-minute video does not expect to start over. Turn this
1597
+ * on where the abort really is final — a wizard the user closed, a file they
1598
+ * replaced — so the server stops holding megabytes nobody will claim.
1599
+ *
1600
+ * Best-effort: a failed termination is swallowed, because the caller is
1601
+ * already being handed an AbortError and the server expires the upload on its
1602
+ * own after 24h regardless.
1603
+ */
1604
+ terminateOnAbort?: boolean;
1605
+ /** Content type stamped on the request when the blob does not carry one. */
1606
+ fallbackType?: string;
1607
+ }
1608
+ /**
1609
+ * Whether this target can be uploaded resumably. A server without the resumable
1610
+ * service configured simply omits these fields, and callers fall back.
1611
+ */
1612
+ declare function supportsResumableUpload(target: IUploadTarget): boolean;
1613
+ /**
1614
+ * Discard an upload the server is still holding (tus Termination extension).
1615
+ *
1616
+ * Exported because the decision is the caller's: an upload URL persisted from
1617
+ * `onUploadUrl` outlives the transfer that created it, and only the caller knows
1618
+ * whether the user means to come back to it. Without this the bytes sit on the
1619
+ * server until its 24h expiry sweep.
1620
+ *
1621
+ * Resolves `true` when the server confirms, `false` when it refuses or is
1622
+ * unreachable — never throws, since nothing useful can be done about a failed
1623
+ * cleanup of something that expires on its own.
1624
+ */
1625
+ declare function terminateUpload(uploadUrl: string): Promise<boolean>;
1626
+ /**
1627
+ * Upload a file resumably, returning the public URL it lands at.
1628
+ *
1629
+ * `target.fileURL` came back with the ticket, so the final URL is known up
1630
+ * front and there is no completion body to parse.
1631
+ */
1632
+ declare function uploadResumable(target: IUploadTarget, file: Blob, options?: IResumableUploadOptions): Promise<string>;
1633
+
1634
+ export { type CommentStatusType, DEFAULT_CHUNK_SIZE, type IAccountPostSetting, type IBaseStatusHistoryGroupedDay, type IBaseStatusHistoryGroupedItem, type ICommentInfoDTO, type ICommentRequest, type ICommentStatusDTO, 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 ILongVideoPlatformVerdict, type ILongVideoQuoteResponse, type ILongVideoRefusedTarget, type ILongVideoUploadControls, type IPostSetting, type IPublishLongVideoOptions, type IPublishLongVideoResult, type IPublishLongVideoToAccountOptions, type IPublishOptions, type IPublishToAccountOptions, type IQuickPublishAllOptions, type IQuickPublishBaseOptions, type IQuickPublishFacebookOptions, type IQuickPublishInstagramOptions, type IQuickPublishTikTokOptions, type IQuickPublishYouTubeOptions, type IRemovePostPlatformResult, type IRemovePostResponse, type IReschedulePostRequest, type IResumableUploadOptions, 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 IUploadTarget, type IVideoDTO, type IYouTubeConfig, type ImageSourceType, LONG_VIDEO_CREDIT_UNIT_SECONDS, LONG_VIDEO_MAX_DURATION_SECONDS, MAX_COMMENT_DELAY_MINUTES, MAX_COMMENT_LENGTH, MAX_POST_COMMENTS, type SocialPublisherAccountAccountType, type SocialPublisherAccountPlatformType, type SocialPublisherAccountStatusType, type SocialPublisherPostAccountType, SocialPublisherPostClient, type SocialPublisherPostScheduleType, type SocialPublisherPostSourceType, type SocialPublisherPostStatusType, type SocialPublisherPostType, supportsResumableUpload, terminateUpload, uploadResumable };