@publishq/sdk 0.0.1 → 0.0.2

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.cts CHANGED
@@ -343,7 +343,7 @@ type ApiError = {
343
343
  };
344
344
  };
345
345
  };
346
- type ApiErrorCode = 'missing_auth' | 'invalid_auth_format' | 'invalid_api_key' | 'api_key_expired' | 'insufficient_scope' | 'validation_failed' | 'route_not_found' | 'internal_server_error' | 'rate_limit_exceeded' | 'post_not_found' | 'post_forbidden' | 'post_not_editable' | 'media_not_found' | 'media_in_use' | 'storage_limit_exceeded' | 'free_media_limit_exceeded' | 'free_pending_media_limit_exceeded' | 'file_required' | 'file_too_large' | 'unsupported_file_type' | 'unsupported_media_type' | 'invalid_file_extension' | 'social_accounts_not_found' | 'social_accounts_expired' | 'platform_validation_failed' | 'posting_limits_exceeded' | 'scheduled_at_required' | 'invalid_scheduled_at' | 'scheduled_at_too_soon' | 'reschedulable_posts_not_found' | 'workspace_not_found' | 'workspace_forbidden' | 'workspace_owner_required' | 'workspace_account_not_found' | 'workspace_account_conflict' | 'workspace_member_not_found' | 'workspace_member_conflict' | 'workspace_invitation_invalid' | 'workspace_invitation_expired';
346
+ type ApiErrorCode = 'missing_auth' | 'invalid_auth_format' | 'invalid_api_key' | 'api_key_expired' | 'insufficient_scope' | 'validation_failed' | 'route_not_found' | 'internal_server_error' | 'rate_limit_exceeded' | 'post_not_found' | 'post_forbidden' | 'post_not_editable' | 'media_not_found' | 'media_in_use' | 'media_upload_incomplete' | 'storage_limit_exceeded' | 'free_media_limit_exceeded' | 'free_pending_media_limit_exceeded' | 'file_required' | 'file_too_large' | 'unsupported_file_type' | 'unsupported_media_type' | 'invalid_file_extension' | 'social_accounts_not_found' | 'social_accounts_expired' | 'social_account_limit_exceeded' | 'platform_temporarily_unavailable' | 'platform_permission_missing' | 'platform_validation_failed' | 'posting_limits_exceeded' | 'scheduled_at_required' | 'invalid_scheduled_at' | 'scheduled_at_too_soon' | 'reschedulable_posts_not_found' | 'workspace_not_found' | 'workspace_forbidden' | 'workspace_owner_required' | 'workspace_limit_exceeded' | 'workspace_account_not_found' | 'workspace_account_conflict' | 'workspace_member_not_found' | 'workspace_member_conflict' | 'team_member_limit_exceeded' | 'workspace_invitation_invalid' | 'workspace_invitation_expired';
347
347
  type Pagination = {
348
348
  /**
349
349
  * Current page number (starting from 1).
@@ -582,6 +582,64 @@ type TwitterPlatformSpecificSettings = {
582
582
  durationMinutes: number;
583
583
  };
584
584
  };
585
+ /**
586
+ * Where the post came from. PUBLISHQ: created in PublishQ. IMPORTED: published directly on the platform and discovered during an analytics sync, so the post history stays complete.
587
+ */
588
+ type PostSource = 'PUBLISHQ' | 'IMPORTED';
589
+ type PostAnalytics = {
590
+ /**
591
+ * Views the platform reports for this post.
592
+ */
593
+ views: number;
594
+ /**
595
+ * Likes the platform reports for this post.
596
+ */
597
+ likes: number;
598
+ /**
599
+ * Comments the platform reports for this post.
600
+ */
601
+ comments: number;
602
+ /**
603
+ * Shares the platform reports for this post. 0 on platforms that do not disclose it (including YouTube).
604
+ */
605
+ shares: number;
606
+ /**
607
+ * Metrics only this platform reports, keyed by metric name — Bluesky bookmarks, for example. Every metric the platform reports is always present, 0 included, so no key has to be guessed. Empty on platforms that expose nothing beyond the fields above, and a metric that already has its own field is never repeated here.
608
+ */
609
+ extraMetrics: {
610
+ [key: string]: number;
611
+ };
612
+ /**
613
+ * When these numbers were last recorded. Metrics are refreshed in the background roughly once a day, and only stored when they change.
614
+ */
615
+ syncedAt: string;
616
+ };
617
+ type PublishFailure = {
618
+ /**
619
+ * What kind of action this failure needs. `RECONNECT`: the account has to be reconnected. `MEDIA`: the platform refused the attached file. `ACCOUNT_STATE`: the platform is blocking this account, so the fix is on the platform. `TRANSIENT`: the platform was unavailable and the same request can succeed unchanged. `MAYBE_PUBLISHED`: the platform reported an error for a post that may have gone out anyway. `UNKNOWN`: unrecognised, so read `errorMessage`.
620
+ */
621
+ kind: 'RECONNECT' | 'MEDIA' | 'ACCOUNT_STATE' | 'TRANSIENT' | 'MAYBE_PUBLISHED' | 'UNKNOWN';
622
+ /**
623
+ * Short label for this failure.
624
+ */
625
+ title: string;
626
+ /**
627
+ * One sentence about what the platform did.
628
+ */
629
+ whatHappened: string;
630
+ /**
631
+ * One sentence naming the next action.
632
+ */
633
+ whatToDo: string;
634
+ /**
635
+ * Whether retrying can succeed. False when the platform is blocking the account, since the same request will be refused the same way.
636
+ */
637
+ canRetry: boolean;
638
+ /**
639
+ * Whether the post may already be live. A publish is not idempotent and no platform accepts a deduplication key, so when this is true a retry can create a second copy: check the profile before retrying.
640
+ */
641
+ checkPlatformFirst: boolean;
642
+ };
585
643
  type PostAccount = {
586
644
  /**
587
645
  * The connected social account identifier.
@@ -605,6 +663,8 @@ type PostAccount = {
605
663
  * Error message from the platform if publishing failed for this account.
606
664
  */
607
665
  errorMessage?: string;
666
+ failure?: PublishFailure & unknown;
667
+ analytics?: PostAnalytics & unknown;
608
668
  postOverrides?: PostOverrides;
609
669
  platformSpecificSettings?: PlatformSpecificSettings;
610
670
  };
@@ -620,7 +680,7 @@ type PostOverrides = {
620
680
  */
621
681
  thumbnailTimestamp?: number;
622
682
  /**
623
- * Replacement media for this account. Completely replaces the post-level media.
683
+ * Replacement media for this account. Completely replaces the post-level media. Up to 35.
624
684
  */
625
685
  mediaIds?: Array<string>;
626
686
  };
@@ -793,6 +853,7 @@ type Post = {
793
853
  */
794
854
  content: string;
795
855
  status: PostStatus;
856
+ source: PostSource;
796
857
  /**
797
858
  * Human-readable error summary when one or more accounts failed.
798
859
  */
@@ -835,7 +896,7 @@ type CreatePostRequest = {
835
896
  */
836
897
  content?: string;
837
898
  /**
838
- * Media to attach to the post. Shared across all accounts unless an account provides its own mediaIds in postOverrides.
899
+ * Media to attach to the post, up to 35. Shared across all accounts unless an account provides its own mediaIds in postOverrides. Accepts IDs from Upload media and from Create media upload.
839
900
  */
840
901
  mediaIds?: Array<string>;
841
902
  /**
@@ -847,7 +908,7 @@ type CreatePostRequest = {
847
908
  */
848
909
  accounts: Array<CreatePostAccount>;
849
910
  /**
850
- * Schedule the post for a future date. If omitted and publishNow is false or absent, the post is saved as a draft.
911
+ * Schedule the post for a future date. If omitted and publishNow is false or absent, the post is saved as a draft. Accepts UTC (2026-04-01T12:00:00Z) or an explicit UTC offset (2026-04-01T14:00:00+02:00); a time without zone information is rejected.
851
912
  */
852
913
  scheduledAt?: string;
853
914
  /**
@@ -872,11 +933,11 @@ type UpdatePostRequest = {
872
933
  */
873
934
  content?: string;
874
935
  /**
875
- * New scheduled date for the post. Must be at least 1 minute in the future.
936
+ * New scheduled date for the post. Must be at least 1 minute in the future. Accepts UTC (2026-04-15T14:00:00Z) or an explicit UTC offset (2026-04-15T16:00:00+02:00); a time without zone information is rejected.
876
937
  */
877
938
  scheduledAt?: string;
878
939
  /**
879
- * Full replacement for the post media. If omitted, the existing media stays unchanged. If provided, it replaces the current media across all accounts in the post. Send an empty array to remove all media from the post.
940
+ * Full replacement for the post media, up to 35. If omitted, the existing media stays unchanged. If provided, it replaces the current media across all accounts in the post. Send an empty array to remove all media from the post.
880
941
  */
881
942
  mediaIds?: Array<string>;
882
943
  /**
@@ -1013,6 +1074,34 @@ type MediaListResponse = {
1013
1074
  type UploadMediaRequest = {
1014
1075
  file: Blob | File;
1015
1076
  };
1077
+ type CreateMediaUploadRequest = {
1078
+ /**
1079
+ * Name of the file you are uploading.
1080
+ */
1081
+ filename: string;
1082
+ /**
1083
+ * Content type of the file. One of: image/jpeg, image/png, image/gif, image/webp, video/mp4, video/webm, video/quicktime, video/x-msvideo.
1084
+ */
1085
+ contentType: string;
1086
+ /**
1087
+ * Exact size of the file in bytes. Your plan's file size limit and your storage are checked before you upload, and storage refuses a file of any other size. Each platform's own size limits are checked when you attach the media to a post.
1088
+ */
1089
+ fileSize: number;
1090
+ };
1091
+ type MediaUpload = {
1092
+ /**
1093
+ * Media ID of the file. Attach it to posts through mediaIds once the file is uploaded.
1094
+ */
1095
+ id: string;
1096
+ /**
1097
+ * Signed storage URL. PUT the file to it with the same Content-Type. It goes to storage, not to the PublishQ API, so send no Authorization header.
1098
+ */
1099
+ uploadUrl: string;
1100
+ /**
1101
+ * When uploadUrl stops accepting the file, 1 hour after it is created.
1102
+ */
1103
+ expiresAt: string;
1104
+ };
1016
1105
  type TikTokCreatorInfoResponse = {
1017
1106
  /**
1018
1107
  * Privacy levels available for this account. Use one of these values as `privacyLevel` in `platformSpecificSettings`.
@@ -1048,6 +1137,14 @@ type ListPostsData = {
1048
1137
  * Page size. Max 100.
1049
1138
  */
1050
1139
  limit?: number;
1140
+ /**
1141
+ * Also return posts imported from a connected platform (posts with source IMPORTED). Defaults to false: only posts created through PublishQ are returned.
1142
+ */
1143
+ includeImported?: boolean;
1144
+ /**
1145
+ * Return ONLY posts imported from a connected platform. Cannot be combined with includeImported.
1146
+ */
1147
+ onlyImported?: boolean;
1051
1148
  };
1052
1149
  url: '/posts';
1053
1150
  };
@@ -1092,6 +1189,18 @@ type CreatePostErrors = {
1092
1189
  * API key lacks the required scope
1093
1190
  */
1094
1191
  403: ApiError;
1192
+ /**
1193
+ * A media ID from Create media upload whose file has not been uploaded yet
1194
+ */
1195
+ 409: ApiError;
1196
+ /**
1197
+ * A media ID from Create media upload whose file is over the size limit, or does not fit in your plan storage
1198
+ */
1199
+ 413: ApiError;
1200
+ /**
1201
+ * A media ID from Create media upload whose file is not a supported type
1202
+ */
1203
+ 415: ApiError;
1095
1204
  /**
1096
1205
  * Rate limit exceeded
1097
1206
  */
@@ -1199,9 +1308,17 @@ type UpdatePostErrors = {
1199
1308
  */
1200
1309
  404: ApiError;
1201
1310
  /**
1202
- * Post cannot be updated (already published or publishing)
1311
+ * Post cannot be updated (already published or publishing), or a media ID from Create media upload whose file has not been uploaded yet
1203
1312
  */
1204
1313
  409: ApiError;
1314
+ /**
1315
+ * A media ID from Create media upload whose file is over the size limit, or does not fit in your plan storage
1316
+ */
1317
+ 413: ApiError;
1318
+ /**
1319
+ * A media ID from Create media upload whose file is not a supported type
1320
+ */
1321
+ 415: ApiError;
1205
1322
  /**
1206
1323
  * Rate limit exceeded
1207
1324
  */
@@ -1293,9 +1410,13 @@ type GetTikTokCreatorInfoData = {
1293
1410
  };
1294
1411
  type GetTikTokCreatorInfoErrors = {
1295
1412
  /**
1296
- * Invalid or missing API key
1413
+ * Invalid or missing API key, or the TikTok connection expired and has to be reconnected
1297
1414
  */
1298
1415
  401: ApiError;
1416
+ /**
1417
+ * TikTok has not granted a permission this call needs. The connection is otherwise intact and is left in place; reconnecting the account is what grants it.
1418
+ */
1419
+ 403: ApiError;
1299
1420
  /**
1300
1421
  * Account not found or not a TikTok account
1301
1422
  */
@@ -1304,6 +1425,10 @@ type GetTikTokCreatorInfoErrors = {
1304
1425
  * Rate limit exceeded
1305
1426
  */
1306
1427
  429: ApiError;
1428
+ /**
1429
+ * TikTok could not be reached. The values are read live from TikTok on every call, so no cached copy is returned in their place — retry shortly.
1430
+ */
1431
+ 503: ApiError;
1307
1432
  };
1308
1433
  type GetTikTokCreatorInfoError = GetTikTokCreatorInfoErrors[keyof GetTikTokCreatorInfoErrors];
1309
1434
  type GetTikTokCreatorInfoResponses = {
@@ -1522,6 +1647,100 @@ type GetMediaResponses = {
1522
1647
  200: Media$1;
1523
1648
  };
1524
1649
  type GetMediaResponse = GetMediaResponses[keyof GetMediaResponses];
1650
+ type CreateMediaUploadData = {
1651
+ body: CreateMediaUploadRequest;
1652
+ path?: never;
1653
+ query?: never;
1654
+ url: '/media/uploads';
1655
+ };
1656
+ type CreateMediaUploadErrors = {
1657
+ /**
1658
+ * Invalid upload request
1659
+ */
1660
+ 400: ApiError;
1661
+ /**
1662
+ * Invalid or missing API key
1663
+ */
1664
+ 401: ApiError;
1665
+ /**
1666
+ * Plan media limit reached
1667
+ */
1668
+ 402: ApiError;
1669
+ /**
1670
+ * API key lacks the required scope
1671
+ */
1672
+ 403: ApiError;
1673
+ /**
1674
+ * File too large, or not enough storage left on your plan
1675
+ */
1676
+ 413: ApiError;
1677
+ /**
1678
+ * Unsupported file type
1679
+ */
1680
+ 415: ApiError;
1681
+ /**
1682
+ * Rate limit exceeded
1683
+ */
1684
+ 429: ApiError;
1685
+ };
1686
+ type CreateMediaUploadError = CreateMediaUploadErrors[keyof CreateMediaUploadErrors];
1687
+ type CreateMediaUploadResponses = {
1688
+ /**
1689
+ * Upload created. Send the file to uploadUrl next.
1690
+ */
1691
+ 201: MediaUpload;
1692
+ };
1693
+ type CreateMediaUploadResponse = CreateMediaUploadResponses[keyof CreateMediaUploadResponses];
1694
+ type CompleteMediaUploadData = {
1695
+ body?: never;
1696
+ path: {
1697
+ id: string;
1698
+ };
1699
+ query?: never;
1700
+ url: '/media/uploads/{id}/complete';
1701
+ };
1702
+ type CompleteMediaUploadErrors = {
1703
+ /**
1704
+ * Invalid or missing API key
1705
+ */
1706
+ 401: ApiError;
1707
+ /**
1708
+ * Plan media limit reached
1709
+ */
1710
+ 402: ApiError;
1711
+ /**
1712
+ * API key lacks the required scope
1713
+ */
1714
+ 403: ApiError;
1715
+ /**
1716
+ * No upload or media with this id, or the upload expired
1717
+ */
1718
+ 404: ApiError;
1719
+ /**
1720
+ * The file has not finished uploading yet
1721
+ */
1722
+ 409: ApiError;
1723
+ /**
1724
+ * The file is over the size limit, or does not fit in your plan storage
1725
+ */
1726
+ 413: ApiError;
1727
+ /**
1728
+ * The file is not a supported type
1729
+ */
1730
+ 415: ApiError;
1731
+ /**
1732
+ * Rate limit exceeded
1733
+ */
1734
+ 429: ApiError;
1735
+ };
1736
+ type CompleteMediaUploadError = CompleteMediaUploadErrors[keyof CompleteMediaUploadErrors];
1737
+ type CompleteMediaUploadResponses = {
1738
+ /**
1739
+ * The file is in your media library
1740
+ */
1741
+ 200: Media$1;
1742
+ };
1743
+ type CompleteMediaUploadResponse = CompleteMediaUploadResponses[keyof CompleteMediaUploadResponses];
1525
1744
 
1526
1745
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
1527
1746
  /**
@@ -1540,7 +1759,7 @@ declare class Posts {
1540
1759
  /**
1541
1760
  * List posts
1542
1761
  *
1543
- * Returns a paginated list of posts.
1762
+ * Returns a paginated list of the posts you created through PublishQ. Posts imported from a connected platform are excluded by default; pass includeImported=true to get both, or onlyImported=true for only the imported ones.
1544
1763
  */
1545
1764
  static listPosts<ThrowOnError extends boolean = false>(options?: Options<ListPostsData, ThrowOnError>): RequestResult<ListPostsResponses, ListPostsErrors, ThrowOnError>;
1546
1765
  /**
@@ -1618,7 +1837,7 @@ declare class Media {
1618
1837
  /**
1619
1838
  * Upload media
1620
1839
  *
1621
- * Upload one media file with multipart form data. The returned media ID can then be attached to posts.
1840
+ * Upload a file smaller than 100 MB in a single request. It is the simplest way to upload: one call returns a media ID you can attach to posts. For bigger files, use Create media upload.
1622
1841
  */
1623
1842
  static uploadMedia<ThrowOnError extends boolean = false>(options: Options<UploadMediaData, ThrowOnError>): RequestResult<UploadMediaResponses, UploadMediaErrors, ThrowOnError>;
1624
1843
  /**
@@ -1627,6 +1846,23 @@ declare class Media {
1627
1846
  * Return one media file by ID, including its URL, source, and usage count.
1628
1847
  */
1629
1848
  static getMedia<ThrowOnError extends boolean = false>(options: Options<GetMediaData, ThrowOnError>): RequestResult<GetMediaResponses, GetMediaErrors, ThrowOnError>;
1849
+ /**
1850
+ * Create media upload
1851
+ *
1852
+ * Upload a file of up to 4 GB (500 MB on the Free plan) straight to storage:
1853
+ *
1854
+ * 1. Call this endpoint with `filename`, `contentType` and `fileSize`. You get back an `id` and an `uploadUrl`.
1855
+ * 2. `PUT` the file to `uploadUrl` with the same `Content-Type` header. Storage answers `200`, or `403` if the file is not exactly `fileSize` bytes.
1856
+ * 3. Optional: call Complete media upload to add the file to your media library now.
1857
+ * 4. Put the `id` in `mediaIds` when you create or update a post.
1858
+ */
1859
+ static createMediaUpload<ThrowOnError extends boolean = false>(options: Options<CreateMediaUploadData, ThrowOnError>): RequestResult<CreateMediaUploadResponses, CreateMediaUploadErrors, ThrowOnError>;
1860
+ /**
1861
+ * Complete media upload
1862
+ *
1863
+ * Optional. Adds a file uploaded through Create media upload to your media library now and returns it. Without this call the file is added the first time you use its id in a post, and an upload nobody completes or uses within 1 day expires.
1864
+ */
1865
+ static completeMediaUpload<ThrowOnError extends boolean = false>(options: Options<CompleteMediaUploadData, ThrowOnError>): RequestResult<CompleteMediaUploadResponses, CompleteMediaUploadErrors, ThrowOnError>;
1630
1866
  }
1631
1867
 
1632
1868
  declare const zApiErrorCode: z.ZodMiniEnum<{
@@ -1644,6 +1880,7 @@ declare const zApiErrorCode: z.ZodMiniEnum<{
1644
1880
  post_not_editable: "post_not_editable";
1645
1881
  media_not_found: "media_not_found";
1646
1882
  media_in_use: "media_in_use";
1883
+ media_upload_incomplete: "media_upload_incomplete";
1647
1884
  storage_limit_exceeded: "storage_limit_exceeded";
1648
1885
  free_media_limit_exceeded: "free_media_limit_exceeded";
1649
1886
  free_pending_media_limit_exceeded: "free_pending_media_limit_exceeded";
@@ -1654,6 +1891,9 @@ declare const zApiErrorCode: z.ZodMiniEnum<{
1654
1891
  invalid_file_extension: "invalid_file_extension";
1655
1892
  social_accounts_not_found: "social_accounts_not_found";
1656
1893
  social_accounts_expired: "social_accounts_expired";
1894
+ social_account_limit_exceeded: "social_account_limit_exceeded";
1895
+ platform_temporarily_unavailable: "platform_temporarily_unavailable";
1896
+ platform_permission_missing: "platform_permission_missing";
1657
1897
  platform_validation_failed: "platform_validation_failed";
1658
1898
  posting_limits_exceeded: "posting_limits_exceeded";
1659
1899
  scheduled_at_required: "scheduled_at_required";
@@ -1663,10 +1903,12 @@ declare const zApiErrorCode: z.ZodMiniEnum<{
1663
1903
  workspace_not_found: "workspace_not_found";
1664
1904
  workspace_forbidden: "workspace_forbidden";
1665
1905
  workspace_owner_required: "workspace_owner_required";
1906
+ workspace_limit_exceeded: "workspace_limit_exceeded";
1666
1907
  workspace_account_not_found: "workspace_account_not_found";
1667
1908
  workspace_account_conflict: "workspace_account_conflict";
1668
1909
  workspace_member_not_found: "workspace_member_not_found";
1669
1910
  workspace_member_conflict: "workspace_member_conflict";
1911
+ team_member_limit_exceeded: "team_member_limit_exceeded";
1670
1912
  workspace_invitation_invalid: "workspace_invitation_invalid";
1671
1913
  workspace_invitation_expired: "workspace_invitation_expired";
1672
1914
  }>;
@@ -1689,6 +1931,7 @@ declare const zApiError: z.ZodMiniObject<{
1689
1931
  post_not_editable: "post_not_editable";
1690
1932
  media_not_found: "media_not_found";
1691
1933
  media_in_use: "media_in_use";
1934
+ media_upload_incomplete: "media_upload_incomplete";
1692
1935
  storage_limit_exceeded: "storage_limit_exceeded";
1693
1936
  free_media_limit_exceeded: "free_media_limit_exceeded";
1694
1937
  free_pending_media_limit_exceeded: "free_pending_media_limit_exceeded";
@@ -1699,6 +1942,9 @@ declare const zApiError: z.ZodMiniObject<{
1699
1942
  invalid_file_extension: "invalid_file_extension";
1700
1943
  social_accounts_not_found: "social_accounts_not_found";
1701
1944
  social_accounts_expired: "social_accounts_expired";
1945
+ social_account_limit_exceeded: "social_account_limit_exceeded";
1946
+ platform_temporarily_unavailable: "platform_temporarily_unavailable";
1947
+ platform_permission_missing: "platform_permission_missing";
1702
1948
  platform_validation_failed: "platform_validation_failed";
1703
1949
  posting_limits_exceeded: "posting_limits_exceeded";
1704
1950
  scheduled_at_required: "scheduled_at_required";
@@ -1708,10 +1954,12 @@ declare const zApiError: z.ZodMiniObject<{
1708
1954
  workspace_not_found: "workspace_not_found";
1709
1955
  workspace_forbidden: "workspace_forbidden";
1710
1956
  workspace_owner_required: "workspace_owner_required";
1957
+ workspace_limit_exceeded: "workspace_limit_exceeded";
1711
1958
  workspace_account_not_found: "workspace_account_not_found";
1712
1959
  workspace_account_conflict: "workspace_account_conflict";
1713
1960
  workspace_member_not_found: "workspace_member_not_found";
1714
1961
  workspace_member_conflict: "workspace_member_conflict";
1962
+ team_member_limit_exceeded: "team_member_limit_exceeded";
1715
1963
  workspace_invitation_invalid: "workspace_invitation_invalid";
1716
1964
  workspace_invitation_expired: "workspace_invitation_expired";
1717
1965
  }>;
@@ -1872,6 +2120,36 @@ declare const zTwitterPlatformSpecificSettings: z.ZodMiniObject<{
1872
2120
  durationMinutes: z.ZodMiniNumberFormat;
1873
2121
  }, z.z.core.$strip>>;
1874
2122
  }, z.z.core.$strip>;
2123
+ /**
2124
+ * Where the post came from. PUBLISHQ: created in PublishQ. IMPORTED: published directly on the platform and discovered during an analytics sync, so the post history stays complete.
2125
+ */
2126
+ declare const zPostSource: z.ZodMiniEnum<{
2127
+ PUBLISHQ: "PUBLISHQ";
2128
+ IMPORTED: "IMPORTED";
2129
+ }>;
2130
+ declare const zPostAnalytics: z.ZodMiniObject<{
2131
+ views: z.ZodMiniNumberFormat;
2132
+ likes: z.ZodMiniNumberFormat;
2133
+ comments: z.ZodMiniNumberFormat;
2134
+ shares: z.ZodMiniNumberFormat;
2135
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
2136
+ syncedAt: z.z.iso.ZodMiniISODateTime;
2137
+ }, z.z.core.$strip>;
2138
+ declare const zPublishFailure: z.ZodMiniObject<{
2139
+ kind: z.ZodMiniEnum<{
2140
+ RECONNECT: "RECONNECT";
2141
+ MEDIA: "MEDIA";
2142
+ ACCOUNT_STATE: "ACCOUNT_STATE";
2143
+ TRANSIENT: "TRANSIENT";
2144
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
2145
+ UNKNOWN: "UNKNOWN";
2146
+ }>;
2147
+ title: z.ZodMiniString<string>;
2148
+ whatHappened: z.ZodMiniString<string>;
2149
+ whatToDo: z.ZodMiniString<string>;
2150
+ canRetry: z.ZodMiniBoolean<boolean>;
2151
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
2152
+ }, z.z.core.$strip>;
1875
2153
  declare const zSocialPlatform: z.ZodMiniEnum<{
1876
2154
  TWITTER: "TWITTER";
1877
2155
  INSTAGRAM: "INSTAGRAM";
@@ -2006,6 +2284,29 @@ declare const zPostAccount: z.ZodMiniObject<{
2006
2284
  externalUrl: z.ZodMiniOptional<z.ZodMiniURL>;
2007
2285
  publishedAt: z.ZodMiniOptional<z.z.iso.ZodMiniISODateTime>;
2008
2286
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
2287
+ failure: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
2288
+ kind: z.ZodMiniEnum<{
2289
+ RECONNECT: "RECONNECT";
2290
+ MEDIA: "MEDIA";
2291
+ ACCOUNT_STATE: "ACCOUNT_STATE";
2292
+ TRANSIENT: "TRANSIENT";
2293
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
2294
+ UNKNOWN: "UNKNOWN";
2295
+ }>;
2296
+ title: z.ZodMiniString<string>;
2297
+ whatHappened: z.ZodMiniString<string>;
2298
+ whatToDo: z.ZodMiniString<string>;
2299
+ canRetry: z.ZodMiniBoolean<boolean>;
2300
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
2301
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
2302
+ analytics: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
2303
+ views: z.ZodMiniNumberFormat;
2304
+ likes: z.ZodMiniNumberFormat;
2305
+ comments: z.ZodMiniNumberFormat;
2306
+ shares: z.ZodMiniNumberFormat;
2307
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
2308
+ syncedAt: z.z.iso.ZodMiniISODateTime;
2309
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
2009
2310
  postOverrides: z.ZodMiniOptional<z.ZodMiniObject<{
2010
2311
  content: z.ZodMiniOptional<z.ZodMiniString<string>>;
2011
2312
  thumbnailTimestamp: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -2108,6 +2409,10 @@ declare const zPost: z.ZodMiniObject<{
2108
2409
  PUBLISHED: "PUBLISHED";
2109
2410
  FAILED: "FAILED";
2110
2411
  }>;
2412
+ source: z.ZodMiniEnum<{
2413
+ PUBLISHQ: "PUBLISHQ";
2414
+ IMPORTED: "IMPORTED";
2415
+ }>;
2111
2416
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
2112
2417
  mediaIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUUID>>;
2113
2418
  deletedMediaCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -2137,6 +2442,29 @@ declare const zPost: z.ZodMiniObject<{
2137
2442
  externalUrl: z.ZodMiniOptional<z.ZodMiniURL>;
2138
2443
  publishedAt: z.ZodMiniOptional<z.z.iso.ZodMiniISODateTime>;
2139
2444
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
2445
+ failure: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
2446
+ kind: z.ZodMiniEnum<{
2447
+ RECONNECT: "RECONNECT";
2448
+ MEDIA: "MEDIA";
2449
+ ACCOUNT_STATE: "ACCOUNT_STATE";
2450
+ TRANSIENT: "TRANSIENT";
2451
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
2452
+ UNKNOWN: "UNKNOWN";
2453
+ }>;
2454
+ title: z.ZodMiniString<string>;
2455
+ whatHappened: z.ZodMiniString<string>;
2456
+ whatToDo: z.ZodMiniString<string>;
2457
+ canRetry: z.ZodMiniBoolean<boolean>;
2458
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
2459
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
2460
+ analytics: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
2461
+ views: z.ZodMiniNumberFormat;
2462
+ likes: z.ZodMiniNumberFormat;
2463
+ comments: z.ZodMiniNumberFormat;
2464
+ shares: z.ZodMiniNumberFormat;
2465
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
2466
+ syncedAt: z.z.iso.ZodMiniISODateTime;
2467
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
2140
2468
  postOverrides: z.ZodMiniOptional<z.ZodMiniObject<{
2141
2469
  content: z.ZodMiniOptional<z.ZodMiniString<string>>;
2142
2470
  thumbnailTimestamp: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -2241,6 +2569,10 @@ declare const zPostsResponse: z.ZodMiniObject<{
2241
2569
  PUBLISHED: "PUBLISHED";
2242
2570
  FAILED: "FAILED";
2243
2571
  }>;
2572
+ source: z.ZodMiniEnum<{
2573
+ PUBLISHQ: "PUBLISHQ";
2574
+ IMPORTED: "IMPORTED";
2575
+ }>;
2244
2576
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
2245
2577
  mediaIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUUID>>;
2246
2578
  deletedMediaCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -2270,6 +2602,29 @@ declare const zPostsResponse: z.ZodMiniObject<{
2270
2602
  externalUrl: z.ZodMiniOptional<z.ZodMiniURL>;
2271
2603
  publishedAt: z.ZodMiniOptional<z.z.iso.ZodMiniISODateTime>;
2272
2604
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
2605
+ failure: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
2606
+ kind: z.ZodMiniEnum<{
2607
+ RECONNECT: "RECONNECT";
2608
+ MEDIA: "MEDIA";
2609
+ ACCOUNT_STATE: "ACCOUNT_STATE";
2610
+ TRANSIENT: "TRANSIENT";
2611
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
2612
+ UNKNOWN: "UNKNOWN";
2613
+ }>;
2614
+ title: z.ZodMiniString<string>;
2615
+ whatHappened: z.ZodMiniString<string>;
2616
+ whatToDo: z.ZodMiniString<string>;
2617
+ canRetry: z.ZodMiniBoolean<boolean>;
2618
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
2619
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
2620
+ analytics: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
2621
+ views: z.ZodMiniNumberFormat;
2622
+ likes: z.ZodMiniNumberFormat;
2623
+ comments: z.ZodMiniNumberFormat;
2624
+ shares: z.ZodMiniNumberFormat;
2625
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
2626
+ syncedAt: z.z.iso.ZodMiniISODateTime;
2627
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
2273
2628
  postOverrides: z.ZodMiniOptional<z.ZodMiniObject<{
2274
2629
  content: z.ZodMiniOptional<z.ZodMiniString<string>>;
2275
2630
  thumbnailTimestamp: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -2800,6 +3155,16 @@ declare const zMediaListResponse: z.ZodMiniObject<{
2800
3155
  declare const zUploadMediaRequest: z.ZodMiniObject<{
2801
3156
  file: z.ZodMiniString<string>;
2802
3157
  }, z.z.core.$strip>;
3158
+ declare const zCreateMediaUploadRequest: z.ZodMiniObject<{
3159
+ filename: z.ZodMiniString<string>;
3160
+ contentType: z.ZodMiniString<string>;
3161
+ fileSize: z.ZodMiniNumberFormat;
3162
+ }, z.z.core.$strip>;
3163
+ declare const zMediaUpload: z.ZodMiniObject<{
3164
+ id: z.ZodMiniUUID;
3165
+ uploadUrl: z.ZodMiniURL;
3166
+ expiresAt: z.z.iso.ZodMiniISODateTime;
3167
+ }, z.z.core.$strip>;
2803
3168
  declare const zTikTokCreatorInfoResponse: z.ZodMiniObject<{
2804
3169
  privacyLevelOptions: z.ZodMiniArray<z.ZodMiniString<string>>;
2805
3170
  commentDisabled: z.ZodMiniBoolean<boolean>;
@@ -2819,6 +3184,8 @@ declare const zApiKeyScope: z.ZodMiniEnum<{
2819
3184
  declare const zListPostsQuery: z.ZodMiniObject<{
2820
3185
  page: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniNumberFormat>>;
2821
3186
  limit: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniNumberFormat>>;
3187
+ includeImported: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
3188
+ onlyImported: z.ZodMiniDefault<z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>>;
2822
3189
  }, z.z.core.$strip>;
2823
3190
  /**
2824
3191
  * Posts retrieved successfully
@@ -2834,6 +3201,10 @@ declare const zListPostsResponse: z.ZodMiniObject<{
2834
3201
  PUBLISHED: "PUBLISHED";
2835
3202
  FAILED: "FAILED";
2836
3203
  }>;
3204
+ source: z.ZodMiniEnum<{
3205
+ PUBLISHQ: "PUBLISHQ";
3206
+ IMPORTED: "IMPORTED";
3207
+ }>;
2837
3208
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
2838
3209
  mediaIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUUID>>;
2839
3210
  deletedMediaCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -2863,6 +3234,29 @@ declare const zListPostsResponse: z.ZodMiniObject<{
2863
3234
  externalUrl: z.ZodMiniOptional<z.ZodMiniURL>;
2864
3235
  publishedAt: z.ZodMiniOptional<z.z.iso.ZodMiniISODateTime>;
2865
3236
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
3237
+ failure: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3238
+ kind: z.ZodMiniEnum<{
3239
+ RECONNECT: "RECONNECT";
3240
+ MEDIA: "MEDIA";
3241
+ ACCOUNT_STATE: "ACCOUNT_STATE";
3242
+ TRANSIENT: "TRANSIENT";
3243
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
3244
+ UNKNOWN: "UNKNOWN";
3245
+ }>;
3246
+ title: z.ZodMiniString<string>;
3247
+ whatHappened: z.ZodMiniString<string>;
3248
+ whatToDo: z.ZodMiniString<string>;
3249
+ canRetry: z.ZodMiniBoolean<boolean>;
3250
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
3251
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
3252
+ analytics: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3253
+ views: z.ZodMiniNumberFormat;
3254
+ likes: z.ZodMiniNumberFormat;
3255
+ comments: z.ZodMiniNumberFormat;
3256
+ shares: z.ZodMiniNumberFormat;
3257
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
3258
+ syncedAt: z.z.iso.ZodMiniISODateTime;
3259
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
2866
3260
  postOverrides: z.ZodMiniOptional<z.ZodMiniObject<{
2867
3261
  content: z.ZodMiniOptional<z.ZodMiniString<string>>;
2868
3262
  thumbnailTimestamp: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -3079,6 +3473,10 @@ declare const zCreatePostResponse: z.ZodMiniObject<{
3079
3473
  PUBLISHED: "PUBLISHED";
3080
3474
  FAILED: "FAILED";
3081
3475
  }>;
3476
+ source: z.ZodMiniEnum<{
3477
+ PUBLISHQ: "PUBLISHQ";
3478
+ IMPORTED: "IMPORTED";
3479
+ }>;
3082
3480
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
3083
3481
  mediaIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUUID>>;
3084
3482
  deletedMediaCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -3108,6 +3506,29 @@ declare const zCreatePostResponse: z.ZodMiniObject<{
3108
3506
  externalUrl: z.ZodMiniOptional<z.ZodMiniURL>;
3109
3507
  publishedAt: z.ZodMiniOptional<z.z.iso.ZodMiniISODateTime>;
3110
3508
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
3509
+ failure: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3510
+ kind: z.ZodMiniEnum<{
3511
+ RECONNECT: "RECONNECT";
3512
+ MEDIA: "MEDIA";
3513
+ ACCOUNT_STATE: "ACCOUNT_STATE";
3514
+ TRANSIENT: "TRANSIENT";
3515
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
3516
+ UNKNOWN: "UNKNOWN";
3517
+ }>;
3518
+ title: z.ZodMiniString<string>;
3519
+ whatHappened: z.ZodMiniString<string>;
3520
+ whatToDo: z.ZodMiniString<string>;
3521
+ canRetry: z.ZodMiniBoolean<boolean>;
3522
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
3523
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
3524
+ analytics: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3525
+ views: z.ZodMiniNumberFormat;
3526
+ likes: z.ZodMiniNumberFormat;
3527
+ comments: z.ZodMiniNumberFormat;
3528
+ shares: z.ZodMiniNumberFormat;
3529
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
3530
+ syncedAt: z.z.iso.ZodMiniISODateTime;
3531
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
3111
3532
  postOverrides: z.ZodMiniOptional<z.ZodMiniObject<{
3112
3533
  content: z.ZodMiniOptional<z.ZodMiniString<string>>;
3113
3534
  thumbnailTimestamp: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -3224,6 +3645,10 @@ declare const zGetPostResponse: z.ZodMiniObject<{
3224
3645
  PUBLISHED: "PUBLISHED";
3225
3646
  FAILED: "FAILED";
3226
3647
  }>;
3648
+ source: z.ZodMiniEnum<{
3649
+ PUBLISHQ: "PUBLISHQ";
3650
+ IMPORTED: "IMPORTED";
3651
+ }>;
3227
3652
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
3228
3653
  mediaIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUUID>>;
3229
3654
  deletedMediaCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -3253,6 +3678,29 @@ declare const zGetPostResponse: z.ZodMiniObject<{
3253
3678
  externalUrl: z.ZodMiniOptional<z.ZodMiniURL>;
3254
3679
  publishedAt: z.ZodMiniOptional<z.z.iso.ZodMiniISODateTime>;
3255
3680
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
3681
+ failure: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3682
+ kind: z.ZodMiniEnum<{
3683
+ RECONNECT: "RECONNECT";
3684
+ MEDIA: "MEDIA";
3685
+ ACCOUNT_STATE: "ACCOUNT_STATE";
3686
+ TRANSIENT: "TRANSIENT";
3687
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
3688
+ UNKNOWN: "UNKNOWN";
3689
+ }>;
3690
+ title: z.ZodMiniString<string>;
3691
+ whatHappened: z.ZodMiniString<string>;
3692
+ whatToDo: z.ZodMiniString<string>;
3693
+ canRetry: z.ZodMiniBoolean<boolean>;
3694
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
3695
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
3696
+ analytics: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3697
+ views: z.ZodMiniNumberFormat;
3698
+ likes: z.ZodMiniNumberFormat;
3699
+ comments: z.ZodMiniNumberFormat;
3700
+ shares: z.ZodMiniNumberFormat;
3701
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
3702
+ syncedAt: z.z.iso.ZodMiniISODateTime;
3703
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
3256
3704
  postOverrides: z.ZodMiniOptional<z.ZodMiniObject<{
3257
3705
  content: z.ZodMiniOptional<z.ZodMiniString<string>>;
3258
3706
  thumbnailTimestamp: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -3463,6 +3911,10 @@ declare const zUpdatePostResponse: z.ZodMiniObject<{
3463
3911
  PUBLISHED: "PUBLISHED";
3464
3912
  FAILED: "FAILED";
3465
3913
  }>;
3914
+ source: z.ZodMiniEnum<{
3915
+ PUBLISHQ: "PUBLISHQ";
3916
+ IMPORTED: "IMPORTED";
3917
+ }>;
3466
3918
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
3467
3919
  mediaIds: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUUID>>;
3468
3920
  deletedMediaCount: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -3492,6 +3944,29 @@ declare const zUpdatePostResponse: z.ZodMiniObject<{
3492
3944
  externalUrl: z.ZodMiniOptional<z.ZodMiniURL>;
3493
3945
  publishedAt: z.ZodMiniOptional<z.z.iso.ZodMiniISODateTime>;
3494
3946
  errorMessage: z.ZodMiniOptional<z.ZodMiniString<string>>;
3947
+ failure: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3948
+ kind: z.ZodMiniEnum<{
3949
+ RECONNECT: "RECONNECT";
3950
+ MEDIA: "MEDIA";
3951
+ ACCOUNT_STATE: "ACCOUNT_STATE";
3952
+ TRANSIENT: "TRANSIENT";
3953
+ MAYBE_PUBLISHED: "MAYBE_PUBLISHED";
3954
+ UNKNOWN: "UNKNOWN";
3955
+ }>;
3956
+ title: z.ZodMiniString<string>;
3957
+ whatHappened: z.ZodMiniString<string>;
3958
+ whatToDo: z.ZodMiniString<string>;
3959
+ canRetry: z.ZodMiniBoolean<boolean>;
3960
+ checkPlatformFirst: z.ZodMiniBoolean<boolean>;
3961
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
3962
+ analytics: z.ZodMiniOptional<z.ZodMiniIntersection<z.ZodMiniObject<{
3963
+ views: z.ZodMiniNumberFormat;
3964
+ likes: z.ZodMiniNumberFormat;
3965
+ comments: z.ZodMiniNumberFormat;
3966
+ shares: z.ZodMiniNumberFormat;
3967
+ extraMetrics: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniNumberFormat>;
3968
+ syncedAt: z.z.iso.ZodMiniISODateTime;
3969
+ }, z.z.core.$strip>, z.ZodMiniUnknown>>;
3495
3970
  postOverrides: z.ZodMiniOptional<z.ZodMiniObject<{
3496
3971
  content: z.ZodMiniOptional<z.ZodMiniString<string>>;
3497
3972
  thumbnailTimestamp: z.ZodMiniOptional<z.ZodMiniNumberFormat>;
@@ -3769,11 +4244,45 @@ declare const zGetMediaResponse: z.ZodMiniObject<{
3769
4244
  created_at: z.z.iso.ZodMiniISODateTime;
3770
4245
  usageCount: z.ZodMiniNumberFormat;
3771
4246
  }, z.z.core.$strip>;
4247
+ declare const zCreateMediaUploadBody: z.ZodMiniObject<{
4248
+ filename: z.ZodMiniString<string>;
4249
+ contentType: z.ZodMiniString<string>;
4250
+ fileSize: z.ZodMiniNumberFormat;
4251
+ }, z.z.core.$strip>;
4252
+ /**
4253
+ * Upload created. Send the file to uploadUrl next.
4254
+ */
4255
+ declare const zCreateMediaUploadResponse: z.ZodMiniObject<{
4256
+ id: z.ZodMiniUUID;
4257
+ uploadUrl: z.ZodMiniURL;
4258
+ expiresAt: z.z.iso.ZodMiniISODateTime;
4259
+ }, z.z.core.$strip>;
4260
+ declare const zCompleteMediaUploadPath: z.ZodMiniObject<{
4261
+ id: z.ZodMiniUUID;
4262
+ }, z.z.core.$strip>;
4263
+ /**
4264
+ * The file is in your media library
4265
+ */
4266
+ declare const zCompleteMediaUploadResponse: z.ZodMiniObject<{
4267
+ id: z.ZodMiniUUID;
4268
+ type: z.ZodMiniEnum<{
4269
+ IMAGE: "IMAGE";
4270
+ VIDEO: "VIDEO";
4271
+ }>;
4272
+ url: z.ZodMiniURL;
4273
+ source: z.ZodMiniEnum<{
4274
+ UPLOAD: "UPLOAD";
4275
+ GENERATED: "GENERATED";
4276
+ AI_GENERATED: "AI_GENERATED";
4277
+ }>;
4278
+ created_at: z.z.iso.ZodMiniISODateTime;
4279
+ usageCount: z.ZodMiniNumberFormat;
4280
+ }, z.z.core.$strip>;
3772
4281
 
3773
4282
  interface PublishQOptions {
3774
4283
  /**
3775
4284
  * Your PublishQ API key (begins with `pq_live_`). Create one in the web app
3776
- * under **Settings → API Keys** and select the scopes you need.
4285
+ * under **API Keys** and select the scopes you need.
3777
4286
  */
3778
4287
  apiKey: string;
3779
4288
  /**
@@ -3951,6 +4460,16 @@ declare function createWorkspacesNamespace(client: Client): {
3951
4460
  response?: Response | undefined;
3952
4461
  }>;
3953
4462
  };
4463
+ /**
4464
+ * Returns the file with a usable `type`, inferring it from the filename when the
4465
+ * caller could not supply one. Anything that already declares a type, or whose
4466
+ * extension is unknown, is passed through untouched: guessing past that point
4467
+ * would be inventing a fact, and the API's own byte-level detection is the thing
4468
+ * that decides what the file really is.
4469
+ */
4470
+ declare function withInferredContentType(file: Blob | File): Blob | File;
4471
+ /** Files above this size are sent straight to storage through `createUpload`. */
4472
+ declare const STORAGE_UPLOAD_THRESHOLD_BYTES: number;
3954
4473
  declare function createMediaNamespace(client: Client): {
3955
4474
  /** List your uploaded and generated media files. Filter by id, type, source. Wraps `Media.listMedia`. */
3956
4475
  list: (query?: ListMediaData['query']) => Promise<({
@@ -3963,8 +4482,54 @@ declare function createMediaNamespace(client: Client): {
3963
4482
  request?: Request | undefined;
3964
4483
  response?: Response | undefined;
3965
4484
  }>;
3966
- /** Upload one media file (multipart) and get back a media ID to attach to posts. Wraps `Media.uploadMedia`. */
4485
+ /**
4486
+ * Upload one media file and get back a media ID to attach to posts. Wraps
4487
+ * `Media.uploadMedia`, or for files over `STORAGE_UPLOAD_THRESHOLD_BYTES`
4488
+ * runs `createUpload`, sends the file to storage and returns the finished
4489
+ * media from `completeUpload`. Both return the same `Media` object.
4490
+ *
4491
+ * The file's content type is filled in from its name when it has none, so a
4492
+ * file read off disk with `new File([buffer], 'photo.jpg')` is not sent as
4493
+ * `application/octet-stream` and refused. See `withInferredContentType`.
4494
+ */
3967
4495
  upload: (body: UploadMediaData['body']) => Promise<({
4496
+ data: undefined;
4497
+ error: ApiError;
4498
+ } & {
4499
+ request?: Request | undefined;
4500
+ response?: Response | undefined;
4501
+ }) | ({
4502
+ data: Media$1;
4503
+ error: undefined;
4504
+ } & {
4505
+ request?: Request | undefined;
4506
+ response?: Response | undefined;
4507
+ }) | {
4508
+ data: undefined;
4509
+ error: {
4510
+ error: {
4511
+ status: number;
4512
+ message: string;
4513
+ mediaId: string;
4514
+ storageResponse: string;
4515
+ };
4516
+ };
4517
+ request: Request;
4518
+ response: Response;
4519
+ }>;
4520
+ /** Get a storage upload URL for a file of up to 4 GB. Send the file there, then use the returned media ID in posts. Wraps `Media.createMediaUpload`. */
4521
+ createUpload: (body: CreateMediaUploadData['body']) => Promise<({
4522
+ data: MediaUpload;
4523
+ error: undefined;
4524
+ } | {
4525
+ data: undefined;
4526
+ error: ApiError;
4527
+ }) & {
4528
+ request?: Request | undefined;
4529
+ response?: Response | undefined;
4530
+ }>;
4531
+ /** Add a file sent to a `createUpload` URL to the media library now and return it. Optional: using the ID in a post does the same. Wraps `Media.completeMediaUpload`. */
4532
+ completeUpload: (id: string) => Promise<({
3968
4533
  data: Media$1;
3969
4534
  error: undefined;
3970
4535
  } | {
@@ -3987,4 +4552,4 @@ declare function createMediaNamespace(client: Client): {
3987
4552
  }>;
3988
4553
  };
3989
4554
 
3990
- export { type Account, Accounts, type AccountsResponse, type ApiError, type ApiErrorCode, type ApiKeyScope, type BlueskyPlatformSpecificSettings, type ClientOptions, type CreatePostAccount, type CreatePostData, type CreatePostError, type CreatePostErrors, type CreatePostRequest, type CreatePostResponse, type CreatePostResponses, type CreateWorkspaceData, type CreateWorkspaceError, type CreateWorkspaceErrors, type CreateWorkspaceRequest, type CreateWorkspaceResponse, type CreateWorkspaceResponses, type DeletePostData, type DeletePostError, type DeletePostErrors, type DeletePostResponse, type DeletePostResponses, type FacebookPlatformSpecificSettings, type GetMediaData, type GetMediaError, type GetMediaErrors, type GetMediaResponse, type GetMediaResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetTikTokCreatorInfoData, type GetTikTokCreatorInfoError, type GetTikTokCreatorInfoErrors, type GetTikTokCreatorInfoResponse, type GetTikTokCreatorInfoResponses, type GetWorkspaceData, type GetWorkspaceError, type GetWorkspaceErrors, type GetWorkspaceResponse, type GetWorkspaceResponses, type InstagramPlatformSpecificSettings, type InstagramTrialParams, type LinkedInPlatformSpecificSettings, type ListAccountsData, type ListAccountsError, type ListAccountsErrors, type ListAccountsResponse, type ListAccountsResponses, type ListMediaData, type ListMediaError, type ListMediaErrors, type ListMediaResponse, type ListMediaResponses, type ListPostsData, type ListPostsError, type ListPostsErrors, type ListPostsResponse, type ListPostsResponses, type ListWorkspacesData, type ListWorkspacesError, type ListWorkspacesErrors, type ListWorkspacesResponse, type ListWorkspacesResponses, type Media$1 as Media, Media as Media2, type MediaListResponse, type MediaSource, type MediaType, type Options, type Pagination, type PlatformSpecificSettings, type Post, type PostAccount, type PostOverrides, type PostStatus, Posts, type PostsResponse, PublishQ, type PublishQOptions, type RemovePostAccountData, type RemovePostAccountError, type RemovePostAccountErrors, type RemovePostAccountResponse, type RemovePostAccountResponses, type SocialPlatform, type SuccessMessage, type ThreadsPlatformSpecificSettings, type TikTokCreatorInfoResponse, type TikTokPlatformSpecificSettings, type TwitterPlatformSpecificSettings, type UpdatePostData, type UpdatePostError, type UpdatePostErrors, type UpdatePostRequest, type UpdatePostResponse, type UpdatePostResponses, type UploadMediaData, type UploadMediaError, type UploadMediaErrors, type UploadMediaRequest, type UploadMediaResponse, type UploadMediaResponses, type Workspace, Workspaces, type WorkspacesResponse, type YouTubePlatformSpecificSettings, PublishQ as default, zAccount, zAccountsResponse, zApiError, zApiErrorCode, zApiKeyScope, zBlueskyPlatformSpecificSettings, zCreatePostAccount, zCreatePostBody, zCreatePostRequest, zCreatePostResponse, zCreateWorkspaceBody, zCreateWorkspaceRequest, zCreateWorkspaceResponse, zDeletePostPath, zDeletePostResponse, zFacebookPlatformSpecificSettings, zGetMediaPath, zGetMediaResponse, zGetPostPath, zGetPostResponse, zGetTikTokCreatorInfoPath, zGetTikTokCreatorInfoResponse, zGetWorkspacePath, zGetWorkspaceResponse, zInstagramPlatformSpecificSettings, zInstagramTrialParams, zLinkedInPlatformSpecificSettings, zListAccountsQuery, zListAccountsResponse, zListMediaQuery, zListMediaResponse, zListPostsQuery, zListPostsResponse, zListWorkspacesResponse, zMedia, zMediaListResponse, zMediaSource, zMediaType, zPagination, zPlatformSpecificSettings, zPost, zPostAccount, zPostOverrides, zPostStatus, zPostsResponse, zRemovePostAccountPath, zRemovePostAccountResponse, zSocialPlatform, zSuccessMessage, zThreadsPlatformSpecificSettings, zTikTokCreatorInfoResponse, zTikTokPlatformSpecificSettings, zTwitterPlatformSpecificSettings, zUpdatePostBody, zUpdatePostPath, zUpdatePostRequest, zUpdatePostResponse, zUploadMediaBody, zUploadMediaRequest, zUploadMediaResponse, zWorkspace, zWorkspacesResponse, zYouTubePlatformSpecificSettings };
4555
+ export { type Account, Accounts, type AccountsResponse, type ApiError, type ApiErrorCode, type ApiKeyScope, type BlueskyPlatformSpecificSettings, type ClientOptions, type CompleteMediaUploadData, type CompleteMediaUploadError, type CompleteMediaUploadErrors, type CompleteMediaUploadResponse, type CompleteMediaUploadResponses, type CreateMediaUploadData, type CreateMediaUploadError, type CreateMediaUploadErrors, type CreateMediaUploadRequest, type CreateMediaUploadResponse, type CreateMediaUploadResponses, type CreatePostAccount, type CreatePostData, type CreatePostError, type CreatePostErrors, type CreatePostRequest, type CreatePostResponse, type CreatePostResponses, type CreateWorkspaceData, type CreateWorkspaceError, type CreateWorkspaceErrors, type CreateWorkspaceRequest, type CreateWorkspaceResponse, type CreateWorkspaceResponses, type DeletePostData, type DeletePostError, type DeletePostErrors, type DeletePostResponse, type DeletePostResponses, type FacebookPlatformSpecificSettings, type GetMediaData, type GetMediaError, type GetMediaErrors, type GetMediaResponse, type GetMediaResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetTikTokCreatorInfoData, type GetTikTokCreatorInfoError, type GetTikTokCreatorInfoErrors, type GetTikTokCreatorInfoResponse, type GetTikTokCreatorInfoResponses, type GetWorkspaceData, type GetWorkspaceError, type GetWorkspaceErrors, type GetWorkspaceResponse, type GetWorkspaceResponses, type InstagramPlatformSpecificSettings, type InstagramTrialParams, type LinkedInPlatformSpecificSettings, type ListAccountsData, type ListAccountsError, type ListAccountsErrors, type ListAccountsResponse, type ListAccountsResponses, type ListMediaData, type ListMediaError, type ListMediaErrors, type ListMediaResponse, type ListMediaResponses, type ListPostsData, type ListPostsError, type ListPostsErrors, type ListPostsResponse, type ListPostsResponses, type ListWorkspacesData, type ListWorkspacesError, type ListWorkspacesErrors, type ListWorkspacesResponse, type ListWorkspacesResponses, type Media$1 as Media, Media as Media2, type MediaListResponse, type MediaSource, type MediaType, type MediaUpload, type Options, type Pagination, type PlatformSpecificSettings, type Post, type PostAccount, type PostAnalytics, type PostOverrides, type PostSource, type PostStatus, Posts, type PostsResponse, type PublishFailure, PublishQ, type PublishQOptions, type RemovePostAccountData, type RemovePostAccountError, type RemovePostAccountErrors, type RemovePostAccountResponse, type RemovePostAccountResponses, STORAGE_UPLOAD_THRESHOLD_BYTES, type SocialPlatform, type SuccessMessage, type ThreadsPlatformSpecificSettings, type TikTokCreatorInfoResponse, type TikTokPlatformSpecificSettings, type TwitterPlatformSpecificSettings, type UpdatePostData, type UpdatePostError, type UpdatePostErrors, type UpdatePostRequest, type UpdatePostResponse, type UpdatePostResponses, type UploadMediaData, type UploadMediaError, type UploadMediaErrors, type UploadMediaRequest, type UploadMediaResponse, type UploadMediaResponses, type Workspace, Workspaces, type WorkspacesResponse, type YouTubePlatformSpecificSettings, PublishQ as default, withInferredContentType, zAccount, zAccountsResponse, zApiError, zApiErrorCode, zApiKeyScope, zBlueskyPlatformSpecificSettings, zCompleteMediaUploadPath, zCompleteMediaUploadResponse, zCreateMediaUploadBody, zCreateMediaUploadRequest, zCreateMediaUploadResponse, zCreatePostAccount, zCreatePostBody, zCreatePostRequest, zCreatePostResponse, zCreateWorkspaceBody, zCreateWorkspaceRequest, zCreateWorkspaceResponse, zDeletePostPath, zDeletePostResponse, zFacebookPlatformSpecificSettings, zGetMediaPath, zGetMediaResponse, zGetPostPath, zGetPostResponse, zGetTikTokCreatorInfoPath, zGetTikTokCreatorInfoResponse, zGetWorkspacePath, zGetWorkspaceResponse, zInstagramPlatformSpecificSettings, zInstagramTrialParams, zLinkedInPlatformSpecificSettings, zListAccountsQuery, zListAccountsResponse, zListMediaQuery, zListMediaResponse, zListPostsQuery, zListPostsResponse, zListWorkspacesResponse, zMedia, zMediaListResponse, zMediaSource, zMediaType, zMediaUpload, zPagination, zPlatformSpecificSettings, zPost, zPostAccount, zPostAnalytics, zPostOverrides, zPostSource, zPostStatus, zPostsResponse, zPublishFailure, zRemovePostAccountPath, zRemovePostAccountResponse, zSocialPlatform, zSuccessMessage, zThreadsPlatformSpecificSettings, zTikTokCreatorInfoResponse, zTikTokPlatformSpecificSettings, zTwitterPlatformSpecificSettings, zUpdatePostBody, zUpdatePostPath, zUpdatePostRequest, zUpdatePostResponse, zUploadMediaBody, zUploadMediaRequest, zUploadMediaResponse, zWorkspace, zWorkspacesResponse, zYouTubePlatformSpecificSettings };