@posty5/social-publisher-post 5.1.0 → 5.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,7 +1,9 @@
1
1
  import { IPaginationResponse, HttpClient, IPaginationParams } from '@posty5/core';
2
2
  export { HttpClient, IHttpClientConfig, IPosty5Config, uploadToR2 } from '@posty5/core';
3
3
 
4
- type SocialPublisherPostStatusType = "pending" | "processing" | "processingInPlatform" | "failedByPlatform" | "done" | "error" | "canceled" | "needsMaintenance" | "invalidVideoURL" | "invalidPostVideoURL" | "retrying" | "removing" | "removed" | "removeFailed";
4
+ type SocialPublisherPostStatusType = "pending" | "processing" | "processingInPlatform" | "failedByPlatform" | "done" | "error" | "canceled" | "needsMaintenance" | "invalidVideoURL" | "invalidPostVideoURL" | "retrying" | "removing" | "removed" | "removeFailed"
5
+ /** Removed from some platforms while at least one copy is still live (5.2.0). */
6
+ | "partiallyRemoved";
5
7
  /**
6
8
  * Content type of a post.
7
9
  *
@@ -23,6 +25,8 @@ type SocialPublisherPostSourceType = "video-file" | "video-url";
23
25
  * - `notSupported`: platform does not allow programmatic comments (TikTok)
24
26
  */
25
27
  type CommentStatusType = "pending" | "processing" | "done" | "error" | "skipped" | "notSupported";
28
+ /** A platform `removePost` can target on its own (5.2.0). */
29
+ type SocialPublisherPostRemovePlatformType = "youtube" | "facebook" | "instagram" | "tiktok" | "threads" | "twitter";
26
30
  type SocialPublisherAccountPlatformType = "youtube" | "facebook" | "tiktok";
27
31
  type SocialPublisherAccountAccountType = "facebook" | "instagram" | "youtube" | "tiktok";
28
32
  type SocialPublisherAccountStatusType = "active" | "inactive" | "authenticationExpired";
@@ -1017,7 +1021,8 @@ interface IRemovePostResponse {
1017
1021
  _id: string;
1018
1022
  /** The post's new version */
1019
1023
  __v: number;
1020
- results: Partial<Record<"youtube" | "facebook" | "instagram" | "tiktok", IRemovePostPlatformResult>>;
1024
+ /** One entry per platform the removal targeted: only `platform` when one was passed. */
1025
+ results: Partial<Record<SocialPublisherPostRemovePlatformType, IRemovePostPlatformResult>>;
1021
1026
  }
1022
1027
  interface ISocialPublisherPostStatusLog {
1023
1028
  status: SocialPublisherPostStatusType;
@@ -1424,7 +1429,15 @@ declare class SocialPublisherPostClient {
1424
1429
  * cannot be removed programmatically and no credits are charged.
1425
1430
  *
1426
1431
  * @param id - Post ID
1432
+ * Pass `platform` to remove the post from that one platform only. The other
1433
+ * platforms keep their copies and the post becomes `partiallyRemoved`. The
1434
+ * post must have been published there (platform status `done` or
1435
+ * `removeFailed`), or the API refuses the call. A `partiallyRemoved` post can
1436
+ * be removed again. Needs the API with per-platform removal.
1437
+ *
1438
+ * @param id - Post ID
1427
1439
  * @param version - The post's `__v` as you read it. A stale one throws `ConflictError`.
1440
+ * @param platform - Optional (5.2.0): remove from this platform only. Omit to remove from every platform.
1428
1441
  * @returns Per-platform removal results, `__v` set to the post's new version
1429
1442
  *
1430
1443
  * @example
@@ -1432,9 +1445,12 @@ declare class SocialPublisherPostClient {
1432
1445
  * const post = await client.getStatus("post_123");
1433
1446
  * const { results } = await client.removePost("post_123", post.__v);
1434
1447
  * // results.youtube?.success === true
1448
+ *
1449
+ * // Only the YouTube copy:
1450
+ * await client.removePost("post_123", post.__v, "youtube");
1435
1451
  * ```
1436
1452
  */
1437
- removePost(id: string, version: number): Promise<IRemovePostResponse>;
1453
+ removePost(id: string, version: number, platform?: SocialPublisherPostRemovePlatformType): Promise<IRemovePostResponse>;
1438
1454
  /**
1439
1455
  * Get next and previous post IDs
1440
1456
  * @param id - Current Post ID
@@ -1782,4 +1798,4 @@ declare function terminateUpload(uploadUrl: string): Promise<boolean>;
1782
1798
  */
1783
1799
  declare function uploadResumable(target: IUploadTarget, file: Blob, options?: IResumableUploadOptions): Promise<string>;
1784
1800
 
1785
- export { type CommentStatusType, DEFAULT_CHUNK_SIZE, type IAccountPostSetting, type IBaseStatusHistoryGroupedDay, type IBaseStatusHistoryGroupedItem, type ICommentInfoDTO, type ICommentRequest, type ICommentStatusDTO, type ICreateImagePostToAccountRequest, type ICreateImagePostToWorkspaceRequest, type ICreatePostResult, type ICreateSocialPublisherAccountPostRequest, type ICreateSocialPublisherPostRequest, type ICreateStoryPostBase, type ICreateStoryPostToAccountRequest, type ICreateStoryPostToWorkspaceRequest, type ICreateTextPostBase, type ICreateTextPostToAccountRequest, type ICreateTextPostToWorkspaceRequest, type IDefaultSettingsResponse, type IFacebookPageConfig, type IFacebookTextConfig, type IGenerateUploadUrlsRequest, type IGenerateUploadUrlsResponse, type IImageDTO, type IImageMediaRequest, type IInstagramConfig, type IListParams, type ILongVideoPlatformVerdict, type ILongVideoQuoteResponse, type ILongVideoRefusedTarget, type ILongVideoUploadControls, type IPostSetting, type IPostUtmConfig, 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 IThreadsTextConfig, type ITikTokConfig, type ITwitterTextConfig, 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 };
1801
+ export { type CommentStatusType, DEFAULT_CHUNK_SIZE, type IAccountPostSetting, type IBaseStatusHistoryGroupedDay, type IBaseStatusHistoryGroupedItem, type ICommentInfoDTO, type ICommentRequest, type ICommentStatusDTO, type ICreateImagePostToAccountRequest, type ICreateImagePostToWorkspaceRequest, type ICreatePostResult, type ICreateSocialPublisherAccountPostRequest, type ICreateSocialPublisherPostRequest, type ICreateStoryPostBase, type ICreateStoryPostToAccountRequest, type ICreateStoryPostToWorkspaceRequest, type ICreateTextPostBase, type ICreateTextPostToAccountRequest, type ICreateTextPostToWorkspaceRequest, type IDefaultSettingsResponse, type IFacebookPageConfig, type IFacebookTextConfig, type IGenerateUploadUrlsRequest, type IGenerateUploadUrlsResponse, type IImageDTO, type IImageMediaRequest, type IInstagramConfig, type IListParams, type ILongVideoPlatformVerdict, type ILongVideoQuoteResponse, type ILongVideoRefusedTarget, type ILongVideoUploadControls, type IPostSetting, type IPostUtmConfig, 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 IThreadsTextConfig, type ITikTokConfig, type ITwitterTextConfig, 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 SocialPublisherPostRemovePlatformType, type SocialPublisherPostScheduleType, type SocialPublisherPostSourceType, type SocialPublisherPostStatusType, type SocialPublisherPostType, supportsResumableUpload, terminateUpload, uploadResumable };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { IPaginationResponse, HttpClient, IPaginationParams } from '@posty5/core';
2
2
  export { HttpClient, IHttpClientConfig, IPosty5Config, uploadToR2 } from '@posty5/core';
3
3
 
4
- type SocialPublisherPostStatusType = "pending" | "processing" | "processingInPlatform" | "failedByPlatform" | "done" | "error" | "canceled" | "needsMaintenance" | "invalidVideoURL" | "invalidPostVideoURL" | "retrying" | "removing" | "removed" | "removeFailed";
4
+ type SocialPublisherPostStatusType = "pending" | "processing" | "processingInPlatform" | "failedByPlatform" | "done" | "error" | "canceled" | "needsMaintenance" | "invalidVideoURL" | "invalidPostVideoURL" | "retrying" | "removing" | "removed" | "removeFailed"
5
+ /** Removed from some platforms while at least one copy is still live (5.2.0). */
6
+ | "partiallyRemoved";
5
7
  /**
6
8
  * Content type of a post.
7
9
  *
@@ -23,6 +25,8 @@ type SocialPublisherPostSourceType = "video-file" | "video-url";
23
25
  * - `notSupported`: platform does not allow programmatic comments (TikTok)
24
26
  */
25
27
  type CommentStatusType = "pending" | "processing" | "done" | "error" | "skipped" | "notSupported";
28
+ /** A platform `removePost` can target on its own (5.2.0). */
29
+ type SocialPublisherPostRemovePlatformType = "youtube" | "facebook" | "instagram" | "tiktok" | "threads" | "twitter";
26
30
  type SocialPublisherAccountPlatformType = "youtube" | "facebook" | "tiktok";
27
31
  type SocialPublisherAccountAccountType = "facebook" | "instagram" | "youtube" | "tiktok";
28
32
  type SocialPublisherAccountStatusType = "active" | "inactive" | "authenticationExpired";
@@ -1017,7 +1021,8 @@ interface IRemovePostResponse {
1017
1021
  _id: string;
1018
1022
  /** The post's new version */
1019
1023
  __v: number;
1020
- results: Partial<Record<"youtube" | "facebook" | "instagram" | "tiktok", IRemovePostPlatformResult>>;
1024
+ /** One entry per platform the removal targeted: only `platform` when one was passed. */
1025
+ results: Partial<Record<SocialPublisherPostRemovePlatformType, IRemovePostPlatformResult>>;
1021
1026
  }
1022
1027
  interface ISocialPublisherPostStatusLog {
1023
1028
  status: SocialPublisherPostStatusType;
@@ -1424,7 +1429,15 @@ declare class SocialPublisherPostClient {
1424
1429
  * cannot be removed programmatically and no credits are charged.
1425
1430
  *
1426
1431
  * @param id - Post ID
1432
+ * Pass `platform` to remove the post from that one platform only. The other
1433
+ * platforms keep their copies and the post becomes `partiallyRemoved`. The
1434
+ * post must have been published there (platform status `done` or
1435
+ * `removeFailed`), or the API refuses the call. A `partiallyRemoved` post can
1436
+ * be removed again. Needs the API with per-platform removal.
1437
+ *
1438
+ * @param id - Post ID
1427
1439
  * @param version - The post's `__v` as you read it. A stale one throws `ConflictError`.
1440
+ * @param platform - Optional (5.2.0): remove from this platform only. Omit to remove from every platform.
1428
1441
  * @returns Per-platform removal results, `__v` set to the post's new version
1429
1442
  *
1430
1443
  * @example
@@ -1432,9 +1445,12 @@ declare class SocialPublisherPostClient {
1432
1445
  * const post = await client.getStatus("post_123");
1433
1446
  * const { results } = await client.removePost("post_123", post.__v);
1434
1447
  * // results.youtube?.success === true
1448
+ *
1449
+ * // Only the YouTube copy:
1450
+ * await client.removePost("post_123", post.__v, "youtube");
1435
1451
  * ```
1436
1452
  */
1437
- removePost(id: string, version: number): Promise<IRemovePostResponse>;
1453
+ removePost(id: string, version: number, platform?: SocialPublisherPostRemovePlatformType): Promise<IRemovePostResponse>;
1438
1454
  /**
1439
1455
  * Get next and previous post IDs
1440
1456
  * @param id - Current Post ID
@@ -1782,4 +1798,4 @@ declare function terminateUpload(uploadUrl: string): Promise<boolean>;
1782
1798
  */
1783
1799
  declare function uploadResumable(target: IUploadTarget, file: Blob, options?: IResumableUploadOptions): Promise<string>;
1784
1800
 
1785
- export { type CommentStatusType, DEFAULT_CHUNK_SIZE, type IAccountPostSetting, type IBaseStatusHistoryGroupedDay, type IBaseStatusHistoryGroupedItem, type ICommentInfoDTO, type ICommentRequest, type ICommentStatusDTO, type ICreateImagePostToAccountRequest, type ICreateImagePostToWorkspaceRequest, type ICreatePostResult, type ICreateSocialPublisherAccountPostRequest, type ICreateSocialPublisherPostRequest, type ICreateStoryPostBase, type ICreateStoryPostToAccountRequest, type ICreateStoryPostToWorkspaceRequest, type ICreateTextPostBase, type ICreateTextPostToAccountRequest, type ICreateTextPostToWorkspaceRequest, type IDefaultSettingsResponse, type IFacebookPageConfig, type IFacebookTextConfig, type IGenerateUploadUrlsRequest, type IGenerateUploadUrlsResponse, type IImageDTO, type IImageMediaRequest, type IInstagramConfig, type IListParams, type ILongVideoPlatformVerdict, type ILongVideoQuoteResponse, type ILongVideoRefusedTarget, type ILongVideoUploadControls, type IPostSetting, type IPostUtmConfig, 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 IThreadsTextConfig, type ITikTokConfig, type ITwitterTextConfig, 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 };
1801
+ export { type CommentStatusType, DEFAULT_CHUNK_SIZE, type IAccountPostSetting, type IBaseStatusHistoryGroupedDay, type IBaseStatusHistoryGroupedItem, type ICommentInfoDTO, type ICommentRequest, type ICommentStatusDTO, type ICreateImagePostToAccountRequest, type ICreateImagePostToWorkspaceRequest, type ICreatePostResult, type ICreateSocialPublisherAccountPostRequest, type ICreateSocialPublisherPostRequest, type ICreateStoryPostBase, type ICreateStoryPostToAccountRequest, type ICreateStoryPostToWorkspaceRequest, type ICreateTextPostBase, type ICreateTextPostToAccountRequest, type ICreateTextPostToWorkspaceRequest, type IDefaultSettingsResponse, type IFacebookPageConfig, type IFacebookTextConfig, type IGenerateUploadUrlsRequest, type IGenerateUploadUrlsResponse, type IImageDTO, type IImageMediaRequest, type IInstagramConfig, type IListParams, type ILongVideoPlatformVerdict, type ILongVideoQuoteResponse, type ILongVideoRefusedTarget, type ILongVideoUploadControls, type IPostSetting, type IPostUtmConfig, 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 IThreadsTextConfig, type ITikTokConfig, type ITwitterTextConfig, 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 SocialPublisherPostRemovePlatformType, type SocialPublisherPostScheduleType, type SocialPublisherPostSourceType, type SocialPublisherPostStatusType, type SocialPublisherPostType, supportsResumableUpload, terminateUpload, uploadResumable };
package/dist/index.js CHANGED
@@ -12024,7 +12024,7 @@ var require_follow_redirects = __commonJS({
12024
12024
  return URL2 && value instanceof URL2;
12025
12025
  }
12026
12026
  function escapeRegex(regex) {
12027
- return regex.replace(/[[\]\\/()*+?.^$|]/g, "\\$&");
12027
+ return regex.replace(/[\^$\\.*+?()[\]{}|]/g, "\\$&");
12028
12028
  }
12029
12029
  module.exports = wrap({ http: http3, https: https2 });
12030
12030
  module.exports.wrap = wrap;
@@ -14132,7 +14132,7 @@ var import_https_proxy_agent = __toESM(require_dist());
14132
14132
  var import_follow_redirects = __toESM(require_follow_redirects());
14133
14133
 
14134
14134
  // ../node_modules/axios/lib/env/data.js
14135
- var VERSION = "1.21.0";
14135
+ var VERSION = "1.21.1";
14136
14136
 
14137
14137
  // ../node_modules/axios/lib/helpers/parseProtocol.js
14138
14138
  function parseProtocol(url2) {
@@ -17609,8 +17609,11 @@ function throwIfCancellationRequested(config) {
17609
17609
  throw new CanceledError_default(null, config);
17610
17610
  }
17611
17611
  }
17612
- function elapsedSince(start) {
17613
- return Math.max(0, Date.now() - start);
17612
+ function resolveClock() {
17613
+ return typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
17614
+ }
17615
+ function elapsedSince(now, start) {
17616
+ return Math.max(0, Math.round(now() - start));
17614
17617
  }
17615
17618
  function dispatchRequest(_config) {
17616
17619
  const config = utils_default.toSafeFlatObject(_config);
@@ -17621,11 +17624,12 @@ function dispatchRequest(_config) {
17621
17624
  config.headers.setContentType("application/x-www-form-urlencoded", false);
17622
17625
  }
17623
17626
  const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
17624
- const start = Date.now();
17627
+ const now = resolveClock();
17628
+ const start = now();
17625
17629
  return adapter2(config).then(
17626
17630
  function onAdapterResolution(response) {
17627
17631
  throwIfCancellationRequested(config);
17628
- response.duration = elapsedSince(start);
17632
+ response.duration = elapsedSince(now, start);
17629
17633
  config.response = response;
17630
17634
  try {
17631
17635
  response.data = transformData.call(config, config.transformResponse, response);
@@ -17639,7 +17643,7 @@ function dispatchRequest(_config) {
17639
17643
  if (!isCancel(reason)) {
17640
17644
  throwIfCancellationRequested(config);
17641
17645
  if (reason && reason.response) {
17642
- reason.response.duration = elapsedSince(start);
17646
+ reason.response.duration = elapsedSince(now, start);
17643
17647
  config.response = reason.response;
17644
17648
  try {
17645
17649
  reason.response.data = transformData.call(
@@ -19164,7 +19168,15 @@ var SocialPublisherPostClient = class {
19164
19168
  * cannot be removed programmatically and no credits are charged.
19165
19169
  *
19166
19170
  * @param id - Post ID
19171
+ * Pass `platform` to remove the post from that one platform only. The other
19172
+ * platforms keep their copies and the post becomes `partiallyRemoved`. The
19173
+ * post must have been published there (platform status `done` or
19174
+ * `removeFailed`), or the API refuses the call. A `partiallyRemoved` post can
19175
+ * be removed again. Needs the API with per-platform removal.
19176
+ *
19177
+ * @param id - Post ID
19167
19178
  * @param version - The post's `__v` as you read it. A stale one throws `ConflictError`.
19179
+ * @param platform - Optional (5.2.0): remove from this platform only. Omit to remove from every platform.
19168
19180
  * @returns Per-platform removal results, `__v` set to the post's new version
19169
19181
  *
19170
19182
  * @example
@@ -19172,11 +19184,15 @@ var SocialPublisherPostClient = class {
19172
19184
  * const post = await client.getStatus("post_123");
19173
19185
  * const { results } = await client.removePost("post_123", post.__v);
19174
19186
  * // results.youtube?.success === true
19187
+ *
19188
+ * // Only the YouTube copy:
19189
+ * await client.removePost("post_123", post.__v, "youtube");
19175
19190
  * ```
19176
19191
  */
19177
- async removePost(id, version) {
19192
+ async removePost(id, version, platform) {
19178
19193
  assertVersion(version);
19179
- const response = await this.http.post(`${this.basePath}/${encodeURIComponent(id)}/remove`, {}, { version });
19194
+ const body = platform ? { platform } : {};
19195
+ const response = await this.http.post(`${this.basePath}/${encodeURIComponent(id)}/remove`, body, { version });
19180
19196
  return withVersion(response, id);
19181
19197
  }
19182
19198
  /**