@postrun/react 2.9.0 → 2.11.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.ts CHANGED
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { QueryClient, QueryKey } from '@tanstack/react-query';
5
- import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, XPostVariant, XPoll as XPoll$1, LinkedInPostVariant, InstagramPostVariant, TikTokPostVariant, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
5
+ import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, InstagramPostVariant, PostVariant, LinkedInPostVariant, TikTokPostVariant, XPostVariant, XPoll as XPoll$1, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
6
6
  export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, ValidationIssue, captionMaxFor } from '@postrun/js';
7
7
  import { TwitterComponents } from 'react-tweet';
8
8
 
@@ -977,16 +977,195 @@ declare function usePosts(query?: ListPostsQuery): _tanstack_react_query.UseQuer
977
977
  [key: string]: string | number | boolean;
978
978
  };
979
979
  variants: Array<{
980
+ platform: "x";
981
+ post_type: "text" | "single_image" | "multi_image" | "video";
982
+ settings: {
983
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
984
+ quote_tweet_id?: string;
985
+ poll?: {
986
+ options: Array<string>;
987
+ duration_minutes: number;
988
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
989
+ };
990
+ reply?: {
991
+ in_reply_to_tweet_id: string;
992
+ exclude_reply_user_ids?: Array<string>;
993
+ auto_populate_reply_metadata?: boolean;
994
+ };
995
+ community_id?: string;
996
+ for_super_followers_only?: boolean;
997
+ geo?: {
998
+ place_id: string;
999
+ };
1000
+ card_uri?: string;
1001
+ media_tagged_user_ids?: Array<string>;
1002
+ };
980
1003
  id: string;
981
1004
  object: "post_variant";
982
1005
  connection_id: string | null;
983
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
984
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
985
1006
  body: string | null;
986
1007
  status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1008
+ schedule_at: string | null;
1009
+ result: {
1010
+ platform_post_id: string;
1011
+ permalink: string | null;
1012
+ published_at: string;
1013
+ } | null;
1014
+ error: {
1015
+ code: string;
1016
+ message: string;
1017
+ display_error: string;
1018
+ } | null;
1019
+ media: Array<{
1020
+ media_id: string;
1021
+ position: number;
1022
+ crop_box: {
1023
+ [key: string]: unknown;
1024
+ } | null;
1025
+ alt_text_override: string | null;
1026
+ }>;
1027
+ } | {
1028
+ platform: "linkedin";
1029
+ post_type: "text" | "single_image" | "multi_image" | "video";
987
1030
  settings: {
988
- [key: string]: unknown;
1031
+ visibility: "PUBLIC" | "CONNECTIONS";
1032
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
1033
+ article?: {
1034
+ source: string;
1035
+ title?: string;
1036
+ description?: string;
1037
+ thumbnail_media_id?: string;
1038
+ };
1039
+ poll?: {
1040
+ question: string;
1041
+ options: Array<string>;
1042
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
1043
+ };
1044
+ document?: {
1045
+ title: string;
1046
+ };
1047
+ disable_reshare?: boolean;
1048
+ mentions?: Array<{
1049
+ type: "person" | "organization";
1050
+ name: string;
1051
+ urn: string;
1052
+ }>;
1053
+ };
1054
+ id: string;
1055
+ object: "post_variant";
1056
+ connection_id: string | null;
1057
+ body: string | null;
1058
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1059
+ schedule_at: string | null;
1060
+ result: {
1061
+ platform_post_id: string;
1062
+ permalink: string | null;
1063
+ published_at: string;
1064
+ } | null;
1065
+ error: {
1066
+ code: string;
1067
+ message: string;
1068
+ display_error: string;
1069
+ } | null;
1070
+ media: Array<{
1071
+ media_id: string;
1072
+ position: number;
1073
+ crop_box: {
1074
+ [key: string]: unknown;
1075
+ } | null;
1076
+ alt_text_override: string | null;
1077
+ }>;
1078
+ } | {
1079
+ platform: "facebook_page";
1080
+ post_type: "text" | "single_image" | "multi_image" | "reel";
1081
+ settings: {
1082
+ link?: string;
1083
+ };
1084
+ id: string;
1085
+ object: "post_variant";
1086
+ connection_id: string | null;
1087
+ body: string | null;
1088
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1089
+ schedule_at: string | null;
1090
+ result: {
1091
+ platform_post_id: string;
1092
+ permalink: string | null;
1093
+ published_at: string;
1094
+ } | null;
1095
+ error: {
1096
+ code: string;
1097
+ message: string;
1098
+ display_error: string;
1099
+ } | null;
1100
+ media: Array<{
1101
+ media_id: string;
1102
+ position: number;
1103
+ crop_box: {
1104
+ [key: string]: unknown;
1105
+ } | null;
1106
+ alt_text_override: string | null;
1107
+ }>;
1108
+ } | {
1109
+ platform: "instagram";
1110
+ post_type: "single_image" | "carousel" | "reel";
1111
+ settings: {
1112
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
1113
+ location_id?: string;
1114
+ user_tags?: Array<{
1115
+ username: string;
1116
+ x: number;
1117
+ y: number;
1118
+ }>;
1119
+ collaborators?: Array<string>;
1120
+ share_to_feed?: boolean;
1121
+ thumb_offset?: number;
1122
+ cover_url?: string;
1123
+ audio_name?: string;
1124
+ };
1125
+ id: string;
1126
+ object: "post_variant";
1127
+ connection_id: string | null;
1128
+ body: string | null;
1129
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1130
+ schedule_at: string | null;
1131
+ result: {
1132
+ platform_post_id: string;
1133
+ permalink: string | null;
1134
+ published_at: string;
1135
+ } | null;
1136
+ error: {
1137
+ code: string;
1138
+ message: string;
1139
+ display_error: string;
1140
+ } | null;
1141
+ media: Array<{
1142
+ media_id: string;
1143
+ position: number;
1144
+ crop_box: {
1145
+ [key: string]: unknown;
1146
+ } | null;
1147
+ alt_text_override: string | null;
1148
+ }>;
1149
+ } | {
1150
+ platform: "tiktok";
1151
+ post_type: "video" | "single_image" | "carousel";
1152
+ settings: {
1153
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
1154
+ disable_comment?: boolean;
1155
+ disable_duet?: boolean;
1156
+ disable_stitch?: boolean;
1157
+ video_cover_timestamp_ms?: number;
1158
+ photo_cover_index?: number;
1159
+ auto_add_music?: boolean;
1160
+ brand_content_toggle?: boolean;
1161
+ brand_organic_toggle?: boolean;
1162
+ is_aigc?: boolean;
989
1163
  };
1164
+ id: string;
1165
+ object: "post_variant";
1166
+ connection_id: string | null;
1167
+ body: string | null;
1168
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
990
1169
  schedule_at: string | null;
991
1170
  result: {
992
1171
  platform_post_id: string;
@@ -1038,16 +1217,34 @@ declare function usePostsInfinite(filters?: Omit<ListPostsQuery, 'limit' | 'offs
1038
1217
  [key: string]: string | number | boolean;
1039
1218
  };
1040
1219
  variants: Array<{
1220
+ platform: "x";
1221
+ post_type: "text" | "single_image" | "multi_image" | "video";
1222
+ settings: {
1223
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
1224
+ quote_tweet_id?: string;
1225
+ poll?: {
1226
+ options: Array<string>;
1227
+ duration_minutes: number;
1228
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
1229
+ };
1230
+ reply?: {
1231
+ in_reply_to_tweet_id: string;
1232
+ exclude_reply_user_ids?: Array<string>;
1233
+ auto_populate_reply_metadata?: boolean;
1234
+ };
1235
+ community_id?: string;
1236
+ for_super_followers_only?: boolean;
1237
+ geo?: {
1238
+ place_id: string;
1239
+ };
1240
+ card_uri?: string;
1241
+ media_tagged_user_ids?: Array<string>;
1242
+ };
1041
1243
  id: string;
1042
1244
  object: "post_variant";
1043
1245
  connection_id: string | null;
1044
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
1045
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
1046
1246
  body: string | null;
1047
1247
  status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1048
- settings: {
1049
- [key: string]: unknown;
1050
- };
1051
1248
  schedule_at: string | null;
1052
1249
  result: {
1053
1250
  platform_post_id: string;
@@ -1067,105 +1264,38 @@ declare function usePostsInfinite(filters?: Omit<ListPostsQuery, 'limit' | 'offs
1067
1264
  } | null;
1068
1265
  alt_text_override: string | null;
1069
1266
  }>;
1070
- }>;
1071
- created_at: string;
1072
- updated_at: string;
1073
- }>;
1074
- /**
1075
- * Calendar/queue view — list posts in a `schedule_at` date window, optionally
1076
- * narrowed to a profile and to one or more derived statuses (e.g. only
1077
- * `scheduled` + `failed`). Forwards the date-range + multi-status filters (and
1078
- * any `limit`/`offset`) to the generated `postsList` and returns the same typed
1079
- * `PostList` envelope. It shares the `postKeys.list(filters)` cache identity with
1080
- * `usePosts` but owns its own self-terminating poll: while ANY post in the
1081
- * window is in-flight it refetches (5s — a list is heavier than one detail), and
1082
- * stops once every item is terminal (or the window is empty). `live` is a
1083
- * separate option, never mixed into the API filter object; default-on, opt out
1084
- * with `{ live: false }`.
1085
- */
1086
- declare function useCalendar(filters?: CalendarFilters & Pick<ListPostsQuery, 'limit' | 'offset'>, options?: LiveOptions): _tanstack_react_query.UseQueryResult<NoInfer<{
1087
- object: "list";
1088
- data: Array<{
1089
- id: string;
1090
- object: "post";
1091
- profile_id: string;
1092
- external_id: string | null;
1093
- status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed";
1094
- schedule_at: string | null;
1095
- tags: Array<string>;
1096
- notes: string | null;
1097
- metadata: {
1098
- [key: string]: string | number | boolean;
1099
- };
1100
- variants: Array<{
1101
- id: string;
1102
- object: "post_variant";
1103
- connection_id: string | null;
1104
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
1105
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
1106
- body: string | null;
1107
- status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1108
- settings: {
1109
- [key: string]: unknown;
1267
+ } | {
1268
+ platform: "linkedin";
1269
+ post_type: "text" | "single_image" | "multi_image" | "video";
1270
+ settings: {
1271
+ visibility: "PUBLIC" | "CONNECTIONS";
1272
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
1273
+ article?: {
1274
+ source: string;
1275
+ title?: string;
1276
+ description?: string;
1277
+ thumbnail_media_id?: string;
1110
1278
  };
1111
- schedule_at: string | null;
1112
- result: {
1113
- platform_post_id: string;
1114
- permalink: string | null;
1115
- published_at: string;
1116
- } | null;
1117
- error: {
1118
- code: string;
1119
- message: string;
1120
- display_error: string;
1121
- } | null;
1122
- media: Array<{
1123
- media_id: string;
1124
- position: number;
1125
- crop_box: {
1126
- [key: string]: unknown;
1127
- } | null;
1128
- alt_text_override: string | null;
1279
+ poll?: {
1280
+ question: string;
1281
+ options: Array<string>;
1282
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
1283
+ };
1284
+ document?: {
1285
+ title: string;
1286
+ };
1287
+ disable_reshare?: boolean;
1288
+ mentions?: Array<{
1289
+ type: "person" | "organization";
1290
+ name: string;
1291
+ urn: string;
1129
1292
  }>;
1130
- }>;
1131
- created_at: string;
1132
- updated_at: string;
1133
- }>;
1134
- total: number;
1135
- limit: number;
1136
- offset: number;
1137
- has_more: boolean;
1138
- }>, Error>;
1139
- /**
1140
- * Retrieve a single post by id (its variants, schedule, and derived status).
1141
- * Auto-polls (2s) while the post is in-flight (`scheduled` / `publishing`) and
1142
- * stops once it reaches a terminal status — so a scheduled post visibly
1143
- * transitions with no manual refetch. `live` is on by default; pass
1144
- * `{ live: false }` to force a one-shot.
1145
- */
1146
- declare function usePost(id: string, options?: LiveOptions): _tanstack_react_query.UseQueryResult<NoInfer<{
1147
- id: string;
1148
- object: "post";
1149
- profile_id: string;
1150
- external_id: string | null;
1151
- status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed";
1152
- schedule_at: string | null;
1153
- tags: Array<string>;
1154
- notes: string | null;
1155
- metadata: {
1156
- [key: string]: string | number | boolean;
1157
- };
1158
- variants: Array<{
1293
+ };
1159
1294
  id: string;
1160
1295
  object: "post_variant";
1161
1296
  connection_id: string | null;
1162
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
1163
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
1164
1297
  body: string | null;
1165
1298
  status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1166
- settings: {
1167
- [key: string]: unknown;
1168
- };
1169
1299
  schedule_at: string | null;
1170
1300
  result: {
1171
1301
  platform_post_id: string;
@@ -1185,37 +1315,135 @@ declare function usePost(id: string, options?: LiveOptions): _tanstack_react_que
1185
1315
  } | null;
1186
1316
  alt_text_override: string | null;
1187
1317
  }>;
1188
- }>;
1189
- created_at: string;
1190
- updated_at: string;
1191
- }>, Error>;
1192
- /**
1193
- * Compose and create a post. Resolves the profile's connections, builds the full
1194
- * variant set from `{ content, channels }` (per the `buildCreatePost` rules), and
1195
- * sends it — the customer never assembles variants or passes a `connection_id`.
1196
- * `connectedChannels` is the set of posting platforms this profile can reach.
1197
- *
1198
- * ## Reading the publish outcome (do NOT stop at "it returned")
1199
- * On `publish: 'now'` the API returns the created post with a rollup `status` and
1200
- * a per-variant `status` + typed `error`. A 201 does NOT mean every platform
1201
- * published — one can silently fail while another succeeds. Surface the outcome
1202
- * via the derived fields, never assume success from a resolved `create`:
1203
- *
1204
- * - **`status`** — the rollup (`published | partially_published | failed |
1205
- * draft | scheduled`), `undefined` until the first `create` resolves.
1206
- * - **`isPublished`** — `true` ONLY when `status === 'published'`. This is the
1207
- * one "fully published" state; `partially_published` and `failed` are NOT
1208
- * success. Branch on this, not on the promise resolving.
1209
- * - **`failedVariants`** — the variants that failed, each with its typed
1210
- * `error` (`{ code, message }`); `[]` when none. Render "X failed: <message>".
1211
- *
1212
- * `create` still resolves with the FULL `Post` (read everything if you need to),
1213
- * and it NEVER throws on a failed/partial publish — a throw would discard the
1214
- * platforms that DID publish. A transport error (network / 4xx) still surfaces
1215
- * via `error` (and rejects `create`), exactly as before.
1318
+ } | {
1319
+ platform: "facebook_page";
1320
+ post_type: "text" | "single_image" | "multi_image" | "reel";
1321
+ settings: {
1322
+ link?: string;
1323
+ };
1324
+ id: string;
1325
+ object: "post_variant";
1326
+ connection_id: string | null;
1327
+ body: string | null;
1328
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1329
+ schedule_at: string | null;
1330
+ result: {
1331
+ platform_post_id: string;
1332
+ permalink: string | null;
1333
+ published_at: string;
1334
+ } | null;
1335
+ error: {
1336
+ code: string;
1337
+ message: string;
1338
+ display_error: string;
1339
+ } | null;
1340
+ media: Array<{
1341
+ media_id: string;
1342
+ position: number;
1343
+ crop_box: {
1344
+ [key: string]: unknown;
1345
+ } | null;
1346
+ alt_text_override: string | null;
1347
+ }>;
1348
+ } | {
1349
+ platform: "instagram";
1350
+ post_type: "single_image" | "carousel" | "reel";
1351
+ settings: {
1352
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
1353
+ location_id?: string;
1354
+ user_tags?: Array<{
1355
+ username: string;
1356
+ x: number;
1357
+ y: number;
1358
+ }>;
1359
+ collaborators?: Array<string>;
1360
+ share_to_feed?: boolean;
1361
+ thumb_offset?: number;
1362
+ cover_url?: string;
1363
+ audio_name?: string;
1364
+ };
1365
+ id: string;
1366
+ object: "post_variant";
1367
+ connection_id: string | null;
1368
+ body: string | null;
1369
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1370
+ schedule_at: string | null;
1371
+ result: {
1372
+ platform_post_id: string;
1373
+ permalink: string | null;
1374
+ published_at: string;
1375
+ } | null;
1376
+ error: {
1377
+ code: string;
1378
+ message: string;
1379
+ display_error: string;
1380
+ } | null;
1381
+ media: Array<{
1382
+ media_id: string;
1383
+ position: number;
1384
+ crop_box: {
1385
+ [key: string]: unknown;
1386
+ } | null;
1387
+ alt_text_override: string | null;
1388
+ }>;
1389
+ } | {
1390
+ platform: "tiktok";
1391
+ post_type: "video" | "single_image" | "carousel";
1392
+ settings: {
1393
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
1394
+ disable_comment?: boolean;
1395
+ disable_duet?: boolean;
1396
+ disable_stitch?: boolean;
1397
+ video_cover_timestamp_ms?: number;
1398
+ photo_cover_index?: number;
1399
+ auto_add_music?: boolean;
1400
+ brand_content_toggle?: boolean;
1401
+ brand_organic_toggle?: boolean;
1402
+ is_aigc?: boolean;
1403
+ };
1404
+ id: string;
1405
+ object: "post_variant";
1406
+ connection_id: string | null;
1407
+ body: string | null;
1408
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1409
+ schedule_at: string | null;
1410
+ result: {
1411
+ platform_post_id: string;
1412
+ permalink: string | null;
1413
+ published_at: string;
1414
+ } | null;
1415
+ error: {
1416
+ code: string;
1417
+ message: string;
1418
+ display_error: string;
1419
+ } | null;
1420
+ media: Array<{
1421
+ media_id: string;
1422
+ position: number;
1423
+ crop_box: {
1424
+ [key: string]: unknown;
1425
+ } | null;
1426
+ alt_text_override: string | null;
1427
+ }>;
1428
+ }>;
1429
+ created_at: string;
1430
+ updated_at: string;
1431
+ }>;
1432
+ /**
1433
+ * Calendar/queue view — list posts in a `schedule_at` date window, optionally
1434
+ * narrowed to a profile and to one or more derived statuses (e.g. only
1435
+ * `scheduled` + `failed`). Forwards the date-range + multi-status filters (and
1436
+ * any `limit`/`offset`) to the generated `postsList` and returns the same typed
1437
+ * `PostList` envelope. It shares the `postKeys.list(filters)` cache identity with
1438
+ * `usePosts` but owns its own self-terminating poll: while ANY post in the
1439
+ * window is in-flight it refetches (5s — a list is heavier than one detail), and
1440
+ * stops once every item is terminal (or the window is empty). `live` is a
1441
+ * separate option, never mixed into the API filter object; default-on, opt out
1442
+ * with `{ live: false }`.
1216
1443
  */
1217
- declare function useCreatePost(profileId: string): {
1218
- create: _tanstack_react_query.UseMutateAsyncFunction<{
1444
+ declare function useCalendar(filters?: CalendarFilters & Pick<ListPostsQuery, 'limit' | 'offset'>, options?: LiveOptions): _tanstack_react_query.UseQueryResult<NoInfer<{
1445
+ object: "list";
1446
+ data: Array<{
1219
1447
  id: string;
1220
1448
  object: "post";
1221
1449
  profile_id: string;
@@ -1228,16 +1456,85 @@ declare function useCreatePost(profileId: string): {
1228
1456
  [key: string]: string | number | boolean;
1229
1457
  };
1230
1458
  variants: Array<{
1459
+ platform: "x";
1460
+ post_type: "text" | "single_image" | "multi_image" | "video";
1461
+ settings: {
1462
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
1463
+ quote_tweet_id?: string;
1464
+ poll?: {
1465
+ options: Array<string>;
1466
+ duration_minutes: number;
1467
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
1468
+ };
1469
+ reply?: {
1470
+ in_reply_to_tweet_id: string;
1471
+ exclude_reply_user_ids?: Array<string>;
1472
+ auto_populate_reply_metadata?: boolean;
1473
+ };
1474
+ community_id?: string;
1475
+ for_super_followers_only?: boolean;
1476
+ geo?: {
1477
+ place_id: string;
1478
+ };
1479
+ card_uri?: string;
1480
+ media_tagged_user_ids?: Array<string>;
1481
+ };
1231
1482
  id: string;
1232
1483
  object: "post_variant";
1233
1484
  connection_id: string | null;
1234
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
1235
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
1236
1485
  body: string | null;
1237
1486
  status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1487
+ schedule_at: string | null;
1488
+ result: {
1489
+ platform_post_id: string;
1490
+ permalink: string | null;
1491
+ published_at: string;
1492
+ } | null;
1493
+ error: {
1494
+ code: string;
1495
+ message: string;
1496
+ display_error: string;
1497
+ } | null;
1498
+ media: Array<{
1499
+ media_id: string;
1500
+ position: number;
1501
+ crop_box: {
1502
+ [key: string]: unknown;
1503
+ } | null;
1504
+ alt_text_override: string | null;
1505
+ }>;
1506
+ } | {
1507
+ platform: "linkedin";
1508
+ post_type: "text" | "single_image" | "multi_image" | "video";
1238
1509
  settings: {
1239
- [key: string]: unknown;
1510
+ visibility: "PUBLIC" | "CONNECTIONS";
1511
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
1512
+ article?: {
1513
+ source: string;
1514
+ title?: string;
1515
+ description?: string;
1516
+ thumbnail_media_id?: string;
1517
+ };
1518
+ poll?: {
1519
+ question: string;
1520
+ options: Array<string>;
1521
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
1522
+ };
1523
+ document?: {
1524
+ title: string;
1525
+ };
1526
+ disable_reshare?: boolean;
1527
+ mentions?: Array<{
1528
+ type: "person" | "organization";
1529
+ name: string;
1530
+ urn: string;
1531
+ }>;
1240
1532
  };
1533
+ id: string;
1534
+ object: "post_variant";
1535
+ connection_id: string | null;
1536
+ body: string | null;
1537
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1241
1538
  schedule_at: string | null;
1242
1539
  result: {
1243
1540
  platform_post_id: string;
@@ -1257,37 +1554,97 @@ declare function useCreatePost(profileId: string): {
1257
1554
  } | null;
1258
1555
  alt_text_override: string | null;
1259
1556
  }>;
1260
- }>;
1261
- created_at: string;
1262
- updated_at: string;
1263
- dry_run: boolean;
1264
- executed: boolean;
1265
- }, Error, Omit<ComposePostInput, "profileId">, unknown>;
1266
- isPending: boolean;
1267
- error: Error | null;
1268
- data: {
1269
- id: string;
1270
- object: "post";
1271
- profile_id: string;
1272
- external_id: string | null;
1273
- status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed";
1274
- schedule_at: string | null;
1275
- tags: Array<string>;
1276
- notes: string | null;
1277
- metadata: {
1278
- [key: string]: string | number | boolean;
1279
- };
1280
- variants: Array<{
1557
+ } | {
1558
+ platform: "facebook_page";
1559
+ post_type: "text" | "single_image" | "multi_image" | "reel";
1560
+ settings: {
1561
+ link?: string;
1562
+ };
1281
1563
  id: string;
1282
1564
  object: "post_variant";
1283
1565
  connection_id: string | null;
1284
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
1285
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
1286
1566
  body: string | null;
1287
1567
  status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1568
+ schedule_at: string | null;
1569
+ result: {
1570
+ platform_post_id: string;
1571
+ permalink: string | null;
1572
+ published_at: string;
1573
+ } | null;
1574
+ error: {
1575
+ code: string;
1576
+ message: string;
1577
+ display_error: string;
1578
+ } | null;
1579
+ media: Array<{
1580
+ media_id: string;
1581
+ position: number;
1582
+ crop_box: {
1583
+ [key: string]: unknown;
1584
+ } | null;
1585
+ alt_text_override: string | null;
1586
+ }>;
1587
+ } | {
1588
+ platform: "instagram";
1589
+ post_type: "single_image" | "carousel" | "reel";
1288
1590
  settings: {
1289
- [key: string]: unknown;
1591
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
1592
+ location_id?: string;
1593
+ user_tags?: Array<{
1594
+ username: string;
1595
+ x: number;
1596
+ y: number;
1597
+ }>;
1598
+ collaborators?: Array<string>;
1599
+ share_to_feed?: boolean;
1600
+ thumb_offset?: number;
1601
+ cover_url?: string;
1602
+ audio_name?: string;
1603
+ };
1604
+ id: string;
1605
+ object: "post_variant";
1606
+ connection_id: string | null;
1607
+ body: string | null;
1608
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1609
+ schedule_at: string | null;
1610
+ result: {
1611
+ platform_post_id: string;
1612
+ permalink: string | null;
1613
+ published_at: string;
1614
+ } | null;
1615
+ error: {
1616
+ code: string;
1617
+ message: string;
1618
+ display_error: string;
1619
+ } | null;
1620
+ media: Array<{
1621
+ media_id: string;
1622
+ position: number;
1623
+ crop_box: {
1624
+ [key: string]: unknown;
1625
+ } | null;
1626
+ alt_text_override: string | null;
1627
+ }>;
1628
+ } | {
1629
+ platform: "tiktok";
1630
+ post_type: "video" | "single_image" | "carousel";
1631
+ settings: {
1632
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
1633
+ disable_comment?: boolean;
1634
+ disable_duet?: boolean;
1635
+ disable_stitch?: boolean;
1636
+ video_cover_timestamp_ms?: number;
1637
+ photo_cover_index?: number;
1638
+ auto_add_music?: boolean;
1639
+ brand_content_toggle?: boolean;
1640
+ brand_organic_toggle?: boolean;
1641
+ is_aigc?: boolean;
1290
1642
  };
1643
+ id: string;
1644
+ object: "post_variant";
1645
+ connection_id: string | null;
1646
+ body: string | null;
1647
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1291
1648
  schedule_at: string | null;
1292
1649
  result: {
1293
1650
  platform_post_id: string;
@@ -1308,25 +1665,921 @@ declare function useCreatePost(profileId: string): {
1308
1665
  alt_text_override: string | null;
1309
1666
  }>;
1310
1667
  }>;
1311
- created_at: string;
1312
- updated_at: string;
1313
- dry_run: boolean;
1314
- executed: boolean;
1315
- } | undefined;
1316
- reset: () => void;
1317
- status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed" | undefined;
1318
- isPublished: boolean;
1319
- failedVariants: {
1668
+ created_at: string;
1669
+ updated_at: string;
1670
+ }>;
1671
+ total: number;
1672
+ limit: number;
1673
+ offset: number;
1674
+ has_more: boolean;
1675
+ }>, Error>;
1676
+ /**
1677
+ * Retrieve a single post by id (its variants, schedule, and derived status).
1678
+ * Auto-polls (2s) while the post is in-flight (`scheduled` / `publishing`) and
1679
+ * stops once it reaches a terminal status — so a scheduled post visibly
1680
+ * transitions with no manual refetch. `live` is on by default; pass
1681
+ * `{ live: false }` to force a one-shot.
1682
+ */
1683
+ declare function usePost(id: string, options?: LiveOptions): _tanstack_react_query.UseQueryResult<NoInfer<{
1684
+ id: string;
1685
+ object: "post";
1686
+ profile_id: string;
1687
+ external_id: string | null;
1688
+ status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed";
1689
+ schedule_at: string | null;
1690
+ tags: Array<string>;
1691
+ notes: string | null;
1692
+ metadata: {
1693
+ [key: string]: string | number | boolean;
1694
+ };
1695
+ variants: Array<{
1696
+ platform: "x";
1697
+ post_type: "text" | "single_image" | "multi_image" | "video";
1698
+ settings: {
1699
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
1700
+ quote_tweet_id?: string;
1701
+ poll?: {
1702
+ options: Array<string>;
1703
+ duration_minutes: number;
1704
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
1705
+ };
1706
+ reply?: {
1707
+ in_reply_to_tweet_id: string;
1708
+ exclude_reply_user_ids?: Array<string>;
1709
+ auto_populate_reply_metadata?: boolean;
1710
+ };
1711
+ community_id?: string;
1712
+ for_super_followers_only?: boolean;
1713
+ geo?: {
1714
+ place_id: string;
1715
+ };
1716
+ card_uri?: string;
1717
+ media_tagged_user_ids?: Array<string>;
1718
+ };
1719
+ id: string;
1720
+ object: "post_variant";
1721
+ connection_id: string | null;
1722
+ body: string | null;
1723
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1724
+ schedule_at: string | null;
1725
+ result: {
1726
+ platform_post_id: string;
1727
+ permalink: string | null;
1728
+ published_at: string;
1729
+ } | null;
1730
+ error: {
1731
+ code: string;
1732
+ message: string;
1733
+ display_error: string;
1734
+ } | null;
1735
+ media: Array<{
1736
+ media_id: string;
1737
+ position: number;
1738
+ crop_box: {
1739
+ [key: string]: unknown;
1740
+ } | null;
1741
+ alt_text_override: string | null;
1742
+ }>;
1743
+ } | {
1744
+ platform: "linkedin";
1745
+ post_type: "text" | "single_image" | "multi_image" | "video";
1746
+ settings: {
1747
+ visibility: "PUBLIC" | "CONNECTIONS";
1748
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
1749
+ article?: {
1750
+ source: string;
1751
+ title?: string;
1752
+ description?: string;
1753
+ thumbnail_media_id?: string;
1754
+ };
1755
+ poll?: {
1756
+ question: string;
1757
+ options: Array<string>;
1758
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
1759
+ };
1760
+ document?: {
1761
+ title: string;
1762
+ };
1763
+ disable_reshare?: boolean;
1764
+ mentions?: Array<{
1765
+ type: "person" | "organization";
1766
+ name: string;
1767
+ urn: string;
1768
+ }>;
1769
+ };
1770
+ id: string;
1771
+ object: "post_variant";
1772
+ connection_id: string | null;
1773
+ body: string | null;
1774
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1775
+ schedule_at: string | null;
1776
+ result: {
1777
+ platform_post_id: string;
1778
+ permalink: string | null;
1779
+ published_at: string;
1780
+ } | null;
1781
+ error: {
1782
+ code: string;
1783
+ message: string;
1784
+ display_error: string;
1785
+ } | null;
1786
+ media: Array<{
1787
+ media_id: string;
1788
+ position: number;
1789
+ crop_box: {
1790
+ [key: string]: unknown;
1791
+ } | null;
1792
+ alt_text_override: string | null;
1793
+ }>;
1794
+ } | {
1795
+ platform: "facebook_page";
1796
+ post_type: "text" | "single_image" | "multi_image" | "reel";
1797
+ settings: {
1798
+ link?: string;
1799
+ };
1800
+ id: string;
1801
+ object: "post_variant";
1802
+ connection_id: string | null;
1803
+ body: string | null;
1804
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1805
+ schedule_at: string | null;
1806
+ result: {
1807
+ platform_post_id: string;
1808
+ permalink: string | null;
1809
+ published_at: string;
1810
+ } | null;
1811
+ error: {
1812
+ code: string;
1813
+ message: string;
1814
+ display_error: string;
1815
+ } | null;
1816
+ media: Array<{
1817
+ media_id: string;
1818
+ position: number;
1819
+ crop_box: {
1820
+ [key: string]: unknown;
1821
+ } | null;
1822
+ alt_text_override: string | null;
1823
+ }>;
1824
+ } | {
1825
+ platform: "instagram";
1826
+ post_type: "single_image" | "carousel" | "reel";
1827
+ settings: {
1828
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
1829
+ location_id?: string;
1830
+ user_tags?: Array<{
1831
+ username: string;
1832
+ x: number;
1833
+ y: number;
1834
+ }>;
1835
+ collaborators?: Array<string>;
1836
+ share_to_feed?: boolean;
1837
+ thumb_offset?: number;
1838
+ cover_url?: string;
1839
+ audio_name?: string;
1840
+ };
1841
+ id: string;
1842
+ object: "post_variant";
1843
+ connection_id: string | null;
1844
+ body: string | null;
1845
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1846
+ schedule_at: string | null;
1847
+ result: {
1848
+ platform_post_id: string;
1849
+ permalink: string | null;
1850
+ published_at: string;
1851
+ } | null;
1852
+ error: {
1853
+ code: string;
1854
+ message: string;
1855
+ display_error: string;
1856
+ } | null;
1857
+ media: Array<{
1858
+ media_id: string;
1859
+ position: number;
1860
+ crop_box: {
1861
+ [key: string]: unknown;
1862
+ } | null;
1863
+ alt_text_override: string | null;
1864
+ }>;
1865
+ } | {
1866
+ platform: "tiktok";
1867
+ post_type: "video" | "single_image" | "carousel";
1868
+ settings: {
1869
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
1870
+ disable_comment?: boolean;
1871
+ disable_duet?: boolean;
1872
+ disable_stitch?: boolean;
1873
+ video_cover_timestamp_ms?: number;
1874
+ photo_cover_index?: number;
1875
+ auto_add_music?: boolean;
1876
+ brand_content_toggle?: boolean;
1877
+ brand_organic_toggle?: boolean;
1878
+ is_aigc?: boolean;
1879
+ };
1880
+ id: string;
1881
+ object: "post_variant";
1882
+ connection_id: string | null;
1883
+ body: string | null;
1884
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1885
+ schedule_at: string | null;
1886
+ result: {
1887
+ platform_post_id: string;
1888
+ permalink: string | null;
1889
+ published_at: string;
1890
+ } | null;
1891
+ error: {
1892
+ code: string;
1893
+ message: string;
1894
+ display_error: string;
1895
+ } | null;
1896
+ media: Array<{
1897
+ media_id: string;
1898
+ position: number;
1899
+ crop_box: {
1900
+ [key: string]: unknown;
1901
+ } | null;
1902
+ alt_text_override: string | null;
1903
+ }>;
1904
+ }>;
1905
+ created_at: string;
1906
+ updated_at: string;
1907
+ }>, Error>;
1908
+ /**
1909
+ * Compose and create a post. Resolves the profile's connections, builds the full
1910
+ * variant set from `{ content, channels }` (per the `buildCreatePost` rules), and
1911
+ * sends it — the customer never assembles variants or passes a `connection_id`.
1912
+ * `connectedChannels` is the set of posting platforms this profile can reach.
1913
+ *
1914
+ * ## Reading the publish outcome (do NOT stop at "it returned")
1915
+ * On `publish: 'now'` the API returns the created post with a rollup `status` and
1916
+ * a per-variant `status` + typed `error`. A 201 does NOT mean every platform
1917
+ * published — one can silently fail while another succeeds. Surface the outcome
1918
+ * via the derived fields, never assume success from a resolved `create`:
1919
+ *
1920
+ * - **`status`** — the rollup (`published | partially_published | failed |
1921
+ * draft | scheduled`), `undefined` until the first `create` resolves.
1922
+ * - **`isPublished`** — `true` ONLY when `status === 'published'`. This is the
1923
+ * one "fully published" state; `partially_published` and `failed` are NOT
1924
+ * success. Branch on this, not on the promise resolving.
1925
+ * - **`failedVariants`** — the variants that failed, each with its typed
1926
+ * `error` (`{ code, message }`); `[]` when none. Render "X failed: <message>".
1927
+ *
1928
+ * `create` still resolves with the FULL `Post` (read everything if you need to),
1929
+ * and it NEVER throws on a failed/partial publish — a throw would discard the
1930
+ * platforms that DID publish. A transport error (network / 4xx) still surfaces
1931
+ * via `error` (and rejects `create`), exactly as before.
1932
+ */
1933
+ declare function useCreatePost(profileId: string): {
1934
+ create: _tanstack_react_query.UseMutateAsyncFunction<{
1935
+ id: string;
1936
+ object: "post";
1937
+ profile_id: string;
1938
+ external_id: string | null;
1939
+ status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed";
1940
+ schedule_at: string | null;
1941
+ tags: Array<string>;
1942
+ notes: string | null;
1943
+ metadata: {
1944
+ [key: string]: string | number | boolean;
1945
+ };
1946
+ variants: Array<{
1947
+ platform: "x";
1948
+ post_type: "text" | "single_image" | "multi_image" | "video";
1949
+ settings: {
1950
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
1951
+ quote_tweet_id?: string;
1952
+ poll?: {
1953
+ options: Array<string>;
1954
+ duration_minutes: number;
1955
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
1956
+ };
1957
+ reply?: {
1958
+ in_reply_to_tweet_id: string;
1959
+ exclude_reply_user_ids?: Array<string>;
1960
+ auto_populate_reply_metadata?: boolean;
1961
+ };
1962
+ community_id?: string;
1963
+ for_super_followers_only?: boolean;
1964
+ geo?: {
1965
+ place_id: string;
1966
+ };
1967
+ card_uri?: string;
1968
+ media_tagged_user_ids?: Array<string>;
1969
+ };
1970
+ id: string;
1971
+ object: "post_variant";
1972
+ connection_id: string | null;
1973
+ body: string | null;
1974
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1975
+ schedule_at: string | null;
1976
+ result: {
1977
+ platform_post_id: string;
1978
+ permalink: string | null;
1979
+ published_at: string;
1980
+ } | null;
1981
+ error: {
1982
+ code: string;
1983
+ message: string;
1984
+ display_error: string;
1985
+ } | null;
1986
+ media: Array<{
1987
+ media_id: string;
1988
+ position: number;
1989
+ crop_box: {
1990
+ [key: string]: unknown;
1991
+ } | null;
1992
+ alt_text_override: string | null;
1993
+ }>;
1994
+ } | {
1995
+ platform: "linkedin";
1996
+ post_type: "text" | "single_image" | "multi_image" | "video";
1997
+ settings: {
1998
+ visibility: "PUBLIC" | "CONNECTIONS";
1999
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
2000
+ article?: {
2001
+ source: string;
2002
+ title?: string;
2003
+ description?: string;
2004
+ thumbnail_media_id?: string;
2005
+ };
2006
+ poll?: {
2007
+ question: string;
2008
+ options: Array<string>;
2009
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
2010
+ };
2011
+ document?: {
2012
+ title: string;
2013
+ };
2014
+ disable_reshare?: boolean;
2015
+ mentions?: Array<{
2016
+ type: "person" | "organization";
2017
+ name: string;
2018
+ urn: string;
2019
+ }>;
2020
+ };
2021
+ id: string;
2022
+ object: "post_variant";
2023
+ connection_id: string | null;
2024
+ body: string | null;
2025
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2026
+ schedule_at: string | null;
2027
+ result: {
2028
+ platform_post_id: string;
2029
+ permalink: string | null;
2030
+ published_at: string;
2031
+ } | null;
2032
+ error: {
2033
+ code: string;
2034
+ message: string;
2035
+ display_error: string;
2036
+ } | null;
2037
+ media: Array<{
2038
+ media_id: string;
2039
+ position: number;
2040
+ crop_box: {
2041
+ [key: string]: unknown;
2042
+ } | null;
2043
+ alt_text_override: string | null;
2044
+ }>;
2045
+ } | {
2046
+ platform: "facebook_page";
2047
+ post_type: "text" | "single_image" | "multi_image" | "reel";
2048
+ settings: {
2049
+ link?: string;
2050
+ };
2051
+ id: string;
2052
+ object: "post_variant";
2053
+ connection_id: string | null;
2054
+ body: string | null;
2055
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2056
+ schedule_at: string | null;
2057
+ result: {
2058
+ platform_post_id: string;
2059
+ permalink: string | null;
2060
+ published_at: string;
2061
+ } | null;
2062
+ error: {
2063
+ code: string;
2064
+ message: string;
2065
+ display_error: string;
2066
+ } | null;
2067
+ media: Array<{
2068
+ media_id: string;
2069
+ position: number;
2070
+ crop_box: {
2071
+ [key: string]: unknown;
2072
+ } | null;
2073
+ alt_text_override: string | null;
2074
+ }>;
2075
+ } | {
2076
+ platform: "instagram";
2077
+ post_type: "single_image" | "carousel" | "reel";
2078
+ settings: {
2079
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
2080
+ location_id?: string;
2081
+ user_tags?: Array<{
2082
+ username: string;
2083
+ x: number;
2084
+ y: number;
2085
+ }>;
2086
+ collaborators?: Array<string>;
2087
+ share_to_feed?: boolean;
2088
+ thumb_offset?: number;
2089
+ cover_url?: string;
2090
+ audio_name?: string;
2091
+ };
2092
+ id: string;
2093
+ object: "post_variant";
2094
+ connection_id: string | null;
2095
+ body: string | null;
2096
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2097
+ schedule_at: string | null;
2098
+ result: {
2099
+ platform_post_id: string;
2100
+ permalink: string | null;
2101
+ published_at: string;
2102
+ } | null;
2103
+ error: {
2104
+ code: string;
2105
+ message: string;
2106
+ display_error: string;
2107
+ } | null;
2108
+ media: Array<{
2109
+ media_id: string;
2110
+ position: number;
2111
+ crop_box: {
2112
+ [key: string]: unknown;
2113
+ } | null;
2114
+ alt_text_override: string | null;
2115
+ }>;
2116
+ } | {
2117
+ platform: "tiktok";
2118
+ post_type: "video" | "single_image" | "carousel";
2119
+ settings: {
2120
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
2121
+ disable_comment?: boolean;
2122
+ disable_duet?: boolean;
2123
+ disable_stitch?: boolean;
2124
+ video_cover_timestamp_ms?: number;
2125
+ photo_cover_index?: number;
2126
+ auto_add_music?: boolean;
2127
+ brand_content_toggle?: boolean;
2128
+ brand_organic_toggle?: boolean;
2129
+ is_aigc?: boolean;
2130
+ };
2131
+ id: string;
2132
+ object: "post_variant";
2133
+ connection_id: string | null;
2134
+ body: string | null;
2135
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2136
+ schedule_at: string | null;
2137
+ result: {
2138
+ platform_post_id: string;
2139
+ permalink: string | null;
2140
+ published_at: string;
2141
+ } | null;
2142
+ error: {
2143
+ code: string;
2144
+ message: string;
2145
+ display_error: string;
2146
+ } | null;
2147
+ media: Array<{
2148
+ media_id: string;
2149
+ position: number;
2150
+ crop_box: {
2151
+ [key: string]: unknown;
2152
+ } | null;
2153
+ alt_text_override: string | null;
2154
+ }>;
2155
+ }>;
2156
+ created_at: string;
2157
+ updated_at: string;
2158
+ dry_run: boolean;
2159
+ executed: boolean;
2160
+ }, Error, Omit<ComposePostInput, "profileId">, unknown>;
2161
+ isPending: boolean;
2162
+ error: Error | null;
2163
+ data: {
2164
+ id: string;
2165
+ object: "post";
2166
+ profile_id: string;
2167
+ external_id: string | null;
2168
+ status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed";
2169
+ schedule_at: string | null;
2170
+ tags: Array<string>;
2171
+ notes: string | null;
2172
+ metadata: {
2173
+ [key: string]: string | number | boolean;
2174
+ };
2175
+ variants: Array<{
2176
+ platform: "x";
2177
+ post_type: "text" | "single_image" | "multi_image" | "video";
2178
+ settings: {
2179
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
2180
+ quote_tweet_id?: string;
2181
+ poll?: {
2182
+ options: Array<string>;
2183
+ duration_minutes: number;
2184
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
2185
+ };
2186
+ reply?: {
2187
+ in_reply_to_tweet_id: string;
2188
+ exclude_reply_user_ids?: Array<string>;
2189
+ auto_populate_reply_metadata?: boolean;
2190
+ };
2191
+ community_id?: string;
2192
+ for_super_followers_only?: boolean;
2193
+ geo?: {
2194
+ place_id: string;
2195
+ };
2196
+ card_uri?: string;
2197
+ media_tagged_user_ids?: Array<string>;
2198
+ };
2199
+ id: string;
2200
+ object: "post_variant";
2201
+ connection_id: string | null;
2202
+ body: string | null;
2203
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2204
+ schedule_at: string | null;
2205
+ result: {
2206
+ platform_post_id: string;
2207
+ permalink: string | null;
2208
+ published_at: string;
2209
+ } | null;
2210
+ error: {
2211
+ code: string;
2212
+ message: string;
2213
+ display_error: string;
2214
+ } | null;
2215
+ media: Array<{
2216
+ media_id: string;
2217
+ position: number;
2218
+ crop_box: {
2219
+ [key: string]: unknown;
2220
+ } | null;
2221
+ alt_text_override: string | null;
2222
+ }>;
2223
+ } | {
2224
+ platform: "linkedin";
2225
+ post_type: "text" | "single_image" | "multi_image" | "video";
2226
+ settings: {
2227
+ visibility: "PUBLIC" | "CONNECTIONS";
2228
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
2229
+ article?: {
2230
+ source: string;
2231
+ title?: string;
2232
+ description?: string;
2233
+ thumbnail_media_id?: string;
2234
+ };
2235
+ poll?: {
2236
+ question: string;
2237
+ options: Array<string>;
2238
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
2239
+ };
2240
+ document?: {
2241
+ title: string;
2242
+ };
2243
+ disable_reshare?: boolean;
2244
+ mentions?: Array<{
2245
+ type: "person" | "organization";
2246
+ name: string;
2247
+ urn: string;
2248
+ }>;
2249
+ };
2250
+ id: string;
2251
+ object: "post_variant";
2252
+ connection_id: string | null;
2253
+ body: string | null;
2254
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2255
+ schedule_at: string | null;
2256
+ result: {
2257
+ platform_post_id: string;
2258
+ permalink: string | null;
2259
+ published_at: string;
2260
+ } | null;
2261
+ error: {
2262
+ code: string;
2263
+ message: string;
2264
+ display_error: string;
2265
+ } | null;
2266
+ media: Array<{
2267
+ media_id: string;
2268
+ position: number;
2269
+ crop_box: {
2270
+ [key: string]: unknown;
2271
+ } | null;
2272
+ alt_text_override: string | null;
2273
+ }>;
2274
+ } | {
2275
+ platform: "facebook_page";
2276
+ post_type: "text" | "single_image" | "multi_image" | "reel";
2277
+ settings: {
2278
+ link?: string;
2279
+ };
2280
+ id: string;
2281
+ object: "post_variant";
2282
+ connection_id: string | null;
2283
+ body: string | null;
2284
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2285
+ schedule_at: string | null;
2286
+ result: {
2287
+ platform_post_id: string;
2288
+ permalink: string | null;
2289
+ published_at: string;
2290
+ } | null;
2291
+ error: {
2292
+ code: string;
2293
+ message: string;
2294
+ display_error: string;
2295
+ } | null;
2296
+ media: Array<{
2297
+ media_id: string;
2298
+ position: number;
2299
+ crop_box: {
2300
+ [key: string]: unknown;
2301
+ } | null;
2302
+ alt_text_override: string | null;
2303
+ }>;
2304
+ } | {
2305
+ platform: "instagram";
2306
+ post_type: "single_image" | "carousel" | "reel";
2307
+ settings: {
2308
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
2309
+ location_id?: string;
2310
+ user_tags?: Array<{
2311
+ username: string;
2312
+ x: number;
2313
+ y: number;
2314
+ }>;
2315
+ collaborators?: Array<string>;
2316
+ share_to_feed?: boolean;
2317
+ thumb_offset?: number;
2318
+ cover_url?: string;
2319
+ audio_name?: string;
2320
+ };
2321
+ id: string;
2322
+ object: "post_variant";
2323
+ connection_id: string | null;
2324
+ body: string | null;
2325
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2326
+ schedule_at: string | null;
2327
+ result: {
2328
+ platform_post_id: string;
2329
+ permalink: string | null;
2330
+ published_at: string;
2331
+ } | null;
2332
+ error: {
2333
+ code: string;
2334
+ message: string;
2335
+ display_error: string;
2336
+ } | null;
2337
+ media: Array<{
2338
+ media_id: string;
2339
+ position: number;
2340
+ crop_box: {
2341
+ [key: string]: unknown;
2342
+ } | null;
2343
+ alt_text_override: string | null;
2344
+ }>;
2345
+ } | {
2346
+ platform: "tiktok";
2347
+ post_type: "video" | "single_image" | "carousel";
2348
+ settings: {
2349
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
2350
+ disable_comment?: boolean;
2351
+ disable_duet?: boolean;
2352
+ disable_stitch?: boolean;
2353
+ video_cover_timestamp_ms?: number;
2354
+ photo_cover_index?: number;
2355
+ auto_add_music?: boolean;
2356
+ brand_content_toggle?: boolean;
2357
+ brand_organic_toggle?: boolean;
2358
+ is_aigc?: boolean;
2359
+ };
2360
+ id: string;
2361
+ object: "post_variant";
2362
+ connection_id: string | null;
2363
+ body: string | null;
2364
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2365
+ schedule_at: string | null;
2366
+ result: {
2367
+ platform_post_id: string;
2368
+ permalink: string | null;
2369
+ published_at: string;
2370
+ } | null;
2371
+ error: {
2372
+ code: string;
2373
+ message: string;
2374
+ display_error: string;
2375
+ } | null;
2376
+ media: Array<{
2377
+ media_id: string;
2378
+ position: number;
2379
+ crop_box: {
2380
+ [key: string]: unknown;
2381
+ } | null;
2382
+ alt_text_override: string | null;
2383
+ }>;
2384
+ }>;
2385
+ created_at: string;
2386
+ updated_at: string;
2387
+ dry_run: boolean;
2388
+ executed: boolean;
2389
+ } | undefined;
2390
+ reset: () => void;
2391
+ status: "draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed" | undefined;
2392
+ isPublished: boolean;
2393
+ failedVariants: ({
2394
+ platform: "x";
2395
+ post_type: "text" | "single_image" | "multi_image" | "video";
2396
+ settings: {
2397
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
2398
+ quote_tweet_id?: string;
2399
+ poll?: {
2400
+ options: Array<string>;
2401
+ duration_minutes: number;
2402
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
2403
+ };
2404
+ reply?: {
2405
+ in_reply_to_tweet_id: string;
2406
+ exclude_reply_user_ids?: Array<string>;
2407
+ auto_populate_reply_metadata?: boolean;
2408
+ };
2409
+ community_id?: string;
2410
+ for_super_followers_only?: boolean;
2411
+ geo?: {
2412
+ place_id: string;
2413
+ };
2414
+ card_uri?: string;
2415
+ media_tagged_user_ids?: Array<string>;
2416
+ };
2417
+ id: string;
2418
+ object: "post_variant";
2419
+ connection_id: string | null;
2420
+ body: string | null;
2421
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2422
+ schedule_at: string | null;
2423
+ result: {
2424
+ platform_post_id: string;
2425
+ permalink: string | null;
2426
+ published_at: string;
2427
+ } | null;
2428
+ error: {
2429
+ code: string;
2430
+ message: string;
2431
+ display_error: string;
2432
+ } | null;
2433
+ media: Array<{
2434
+ media_id: string;
2435
+ position: number;
2436
+ crop_box: {
2437
+ [key: string]: unknown;
2438
+ } | null;
2439
+ alt_text_override: string | null;
2440
+ }>;
2441
+ } | {
2442
+ platform: "linkedin";
2443
+ post_type: "text" | "single_image" | "multi_image" | "video";
2444
+ settings: {
2445
+ visibility: "PUBLIC" | "CONNECTIONS";
2446
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
2447
+ article?: {
2448
+ source: string;
2449
+ title?: string;
2450
+ description?: string;
2451
+ thumbnail_media_id?: string;
2452
+ };
2453
+ poll?: {
2454
+ question: string;
2455
+ options: Array<string>;
2456
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
2457
+ };
2458
+ document?: {
2459
+ title: string;
2460
+ };
2461
+ disable_reshare?: boolean;
2462
+ mentions?: Array<{
2463
+ type: "person" | "organization";
2464
+ name: string;
2465
+ urn: string;
2466
+ }>;
2467
+ };
2468
+ id: string;
2469
+ object: "post_variant";
2470
+ connection_id: string | null;
2471
+ body: string | null;
2472
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2473
+ schedule_at: string | null;
2474
+ result: {
2475
+ platform_post_id: string;
2476
+ permalink: string | null;
2477
+ published_at: string;
2478
+ } | null;
2479
+ error: {
2480
+ code: string;
2481
+ message: string;
2482
+ display_error: string;
2483
+ } | null;
2484
+ media: Array<{
2485
+ media_id: string;
2486
+ position: number;
2487
+ crop_box: {
2488
+ [key: string]: unknown;
2489
+ } | null;
2490
+ alt_text_override: string | null;
2491
+ }>;
2492
+ } | {
2493
+ platform: "facebook_page";
2494
+ post_type: "text" | "single_image" | "multi_image" | "reel";
2495
+ settings: {
2496
+ link?: string;
2497
+ };
2498
+ id: string;
2499
+ object: "post_variant";
2500
+ connection_id: string | null;
2501
+ body: string | null;
2502
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2503
+ schedule_at: string | null;
2504
+ result: {
2505
+ platform_post_id: string;
2506
+ permalink: string | null;
2507
+ published_at: string;
2508
+ } | null;
2509
+ error: {
2510
+ code: string;
2511
+ message: string;
2512
+ display_error: string;
2513
+ } | null;
2514
+ media: Array<{
2515
+ media_id: string;
2516
+ position: number;
2517
+ crop_box: {
2518
+ [key: string]: unknown;
2519
+ } | null;
2520
+ alt_text_override: string | null;
2521
+ }>;
2522
+ } | {
2523
+ platform: "instagram";
2524
+ post_type: "single_image" | "carousel" | "reel";
2525
+ settings: {
2526
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
2527
+ location_id?: string;
2528
+ user_tags?: Array<{
2529
+ username: string;
2530
+ x: number;
2531
+ y: number;
2532
+ }>;
2533
+ collaborators?: Array<string>;
2534
+ share_to_feed?: boolean;
2535
+ thumb_offset?: number;
2536
+ cover_url?: string;
2537
+ audio_name?: string;
2538
+ };
2539
+ id: string;
2540
+ object: "post_variant";
2541
+ connection_id: string | null;
2542
+ body: string | null;
2543
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2544
+ schedule_at: string | null;
2545
+ result: {
2546
+ platform_post_id: string;
2547
+ permalink: string | null;
2548
+ published_at: string;
2549
+ } | null;
2550
+ error: {
2551
+ code: string;
2552
+ message: string;
2553
+ display_error: string;
2554
+ } | null;
2555
+ media: Array<{
2556
+ media_id: string;
2557
+ position: number;
2558
+ crop_box: {
2559
+ [key: string]: unknown;
2560
+ } | null;
2561
+ alt_text_override: string | null;
2562
+ }>;
2563
+ } | {
2564
+ platform: "tiktok";
2565
+ post_type: "video" | "single_image" | "carousel";
2566
+ settings: {
2567
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
2568
+ disable_comment?: boolean;
2569
+ disable_duet?: boolean;
2570
+ disable_stitch?: boolean;
2571
+ video_cover_timestamp_ms?: number;
2572
+ photo_cover_index?: number;
2573
+ auto_add_music?: boolean;
2574
+ brand_content_toggle?: boolean;
2575
+ brand_organic_toggle?: boolean;
2576
+ is_aigc?: boolean;
2577
+ };
1320
2578
  id: string;
1321
2579
  object: "post_variant";
1322
2580
  connection_id: string | null;
1323
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
1324
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
1325
2581
  body: string | null;
1326
2582
  status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1327
- settings: {
1328
- [key: string]: unknown;
1329
- };
1330
2583
  schedule_at: string | null;
1331
2584
  result: {
1332
2585
  platform_post_id: string;
@@ -1346,7 +2599,7 @@ declare function useCreatePost(profileId: string): {
1346
2599
  } | null;
1347
2600
  alt_text_override: string | null;
1348
2601
  }>;
1349
- }[];
2602
+ })[];
1350
2603
  isReady: boolean;
1351
2604
  connectedChannels: ("tiktok" | "x" | "linkedin" | "facebook_page" | "instagram")[];
1352
2605
  };
@@ -1400,16 +2653,195 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1400
2653
  [key: string]: string | number | boolean;
1401
2654
  };
1402
2655
  variants: Array<{
2656
+ platform: "x";
2657
+ post_type: "text" | "single_image" | "multi_image" | "video";
2658
+ settings: {
2659
+ reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
2660
+ quote_tweet_id?: string;
2661
+ poll?: {
2662
+ options: Array<string>;
2663
+ duration_minutes: number;
2664
+ reply_settings?: "following" | "mentionedUsers" | "subscribers" | "verified";
2665
+ };
2666
+ reply?: {
2667
+ in_reply_to_tweet_id: string;
2668
+ exclude_reply_user_ids?: Array<string>;
2669
+ auto_populate_reply_metadata?: boolean;
2670
+ };
2671
+ community_id?: string;
2672
+ for_super_followers_only?: boolean;
2673
+ geo?: {
2674
+ place_id: string;
2675
+ };
2676
+ card_uri?: string;
2677
+ media_tagged_user_ids?: Array<string>;
2678
+ };
2679
+ id: string;
2680
+ object: "post_variant";
2681
+ connection_id: string | null;
2682
+ body: string | null;
2683
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2684
+ schedule_at: string | null;
2685
+ result: {
2686
+ platform_post_id: string;
2687
+ permalink: string | null;
2688
+ published_at: string;
2689
+ } | null;
2690
+ error: {
2691
+ code: string;
2692
+ message: string;
2693
+ display_error: string;
2694
+ } | null;
2695
+ media: Array<{
2696
+ media_id: string;
2697
+ position: number;
2698
+ crop_box: {
2699
+ [key: string]: unknown;
2700
+ } | null;
2701
+ alt_text_override: string | null;
2702
+ }>;
2703
+ } | {
2704
+ platform: "linkedin";
2705
+ post_type: "text" | "single_image" | "multi_image" | "video";
2706
+ settings: {
2707
+ visibility: "PUBLIC" | "CONNECTIONS";
2708
+ content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
2709
+ article?: {
2710
+ source: string;
2711
+ title?: string;
2712
+ description?: string;
2713
+ thumbnail_media_id?: string;
2714
+ };
2715
+ poll?: {
2716
+ question: string;
2717
+ options: Array<string>;
2718
+ duration: "ONE_DAY" | "THREE_DAYS" | "SEVEN_DAYS" | "FOURTEEN_DAYS";
2719
+ };
2720
+ document?: {
2721
+ title: string;
2722
+ };
2723
+ disable_reshare?: boolean;
2724
+ mentions?: Array<{
2725
+ type: "person" | "organization";
2726
+ name: string;
2727
+ urn: string;
2728
+ }>;
2729
+ };
2730
+ id: string;
2731
+ object: "post_variant";
2732
+ connection_id: string | null;
2733
+ body: string | null;
2734
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2735
+ schedule_at: string | null;
2736
+ result: {
2737
+ platform_post_id: string;
2738
+ permalink: string | null;
2739
+ published_at: string;
2740
+ } | null;
2741
+ error: {
2742
+ code: string;
2743
+ message: string;
2744
+ display_error: string;
2745
+ } | null;
2746
+ media: Array<{
2747
+ media_id: string;
2748
+ position: number;
2749
+ crop_box: {
2750
+ [key: string]: unknown;
2751
+ } | null;
2752
+ alt_text_override: string | null;
2753
+ }>;
2754
+ } | {
2755
+ platform: "facebook_page";
2756
+ post_type: "text" | "single_image" | "multi_image" | "reel";
2757
+ settings: {
2758
+ link?: string;
2759
+ };
2760
+ id: string;
2761
+ object: "post_variant";
2762
+ connection_id: string | null;
2763
+ body: string | null;
2764
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2765
+ schedule_at: string | null;
2766
+ result: {
2767
+ platform_post_id: string;
2768
+ permalink: string | null;
2769
+ published_at: string;
2770
+ } | null;
2771
+ error: {
2772
+ code: string;
2773
+ message: string;
2774
+ display_error: string;
2775
+ } | null;
2776
+ media: Array<{
2777
+ media_id: string;
2778
+ position: number;
2779
+ crop_box: {
2780
+ [key: string]: unknown;
2781
+ } | null;
2782
+ alt_text_override: string | null;
2783
+ }>;
2784
+ } | {
2785
+ platform: "instagram";
2786
+ post_type: "single_image" | "carousel" | "reel";
2787
+ settings: {
2788
+ media_type?: "IMAGE" | "CAROUSEL" | "REELS";
2789
+ location_id?: string;
2790
+ user_tags?: Array<{
2791
+ username: string;
2792
+ x: number;
2793
+ y: number;
2794
+ }>;
2795
+ collaborators?: Array<string>;
2796
+ share_to_feed?: boolean;
2797
+ thumb_offset?: number;
2798
+ cover_url?: string;
2799
+ audio_name?: string;
2800
+ };
1403
2801
  id: string;
1404
2802
  object: "post_variant";
1405
2803
  connection_id: string | null;
1406
- platform: "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
1407
- post_type: "text" | "single_image" | "multi_image" | "video" | "reel" | "carousel";
1408
2804
  body: string | null;
1409
2805
  status: "draft" | "scheduled" | "publishing" | "published" | "failed";
2806
+ schedule_at: string | null;
2807
+ result: {
2808
+ platform_post_id: string;
2809
+ permalink: string | null;
2810
+ published_at: string;
2811
+ } | null;
2812
+ error: {
2813
+ code: string;
2814
+ message: string;
2815
+ display_error: string;
2816
+ } | null;
2817
+ media: Array<{
2818
+ media_id: string;
2819
+ position: number;
2820
+ crop_box: {
2821
+ [key: string]: unknown;
2822
+ } | null;
2823
+ alt_text_override: string | null;
2824
+ }>;
2825
+ } | {
2826
+ platform: "tiktok";
2827
+ post_type: "video" | "single_image" | "carousel";
1410
2828
  settings: {
1411
- [key: string]: unknown;
2829
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
2830
+ disable_comment?: boolean;
2831
+ disable_duet?: boolean;
2832
+ disable_stitch?: boolean;
2833
+ video_cover_timestamp_ms?: number;
2834
+ photo_cover_index?: number;
2835
+ auto_add_music?: boolean;
2836
+ brand_content_toggle?: boolean;
2837
+ brand_organic_toggle?: boolean;
2838
+ is_aigc?: boolean;
1412
2839
  };
2840
+ id: string;
2841
+ object: "post_variant";
2842
+ connection_id: string | null;
2843
+ body: string | null;
2844
+ status: "draft" | "scheduled" | "publishing" | "published" | "failed";
1413
2845
  schedule_at: string | null;
1414
2846
  result: {
1415
2847
  platform_post_id: string;
@@ -1447,15 +2879,6 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1447
2879
  variants?: Array<{
1448
2880
  platform: "x";
1449
2881
  post_type: "text" | "single_image" | "multi_image" | "video";
1450
- connection_id: string;
1451
- body?: string;
1452
- media?: Array<{
1453
- media_id: string;
1454
- crop_box?: {
1455
- [key: string]: unknown;
1456
- } | null;
1457
- alt_text_override?: string | null;
1458
- }>;
1459
2882
  settings?: {
1460
2883
  reply_settings?: "everyone" | "following" | "mentionedUsers" | "subscribers" | "verified";
1461
2884
  quote_tweet_id?: string;
@@ -1477,9 +2900,6 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1477
2900
  card_uri?: string;
1478
2901
  media_tagged_user_ids?: Array<string>;
1479
2902
  };
1480
- } | {
1481
- platform: "linkedin";
1482
- post_type: "text" | "single_image" | "multi_image" | "video";
1483
2903
  connection_id: string;
1484
2904
  body?: string;
1485
2905
  media?: Array<{
@@ -1489,6 +2909,9 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1489
2909
  } | null;
1490
2910
  alt_text_override?: string | null;
1491
2911
  }>;
2912
+ } | {
2913
+ platform: "linkedin";
2914
+ post_type: "text" | "single_image" | "multi_image" | "video";
1492
2915
  settings: {
1493
2916
  visibility: "PUBLIC" | "CONNECTIONS";
1494
2917
  content_kind: "text" | "single_image" | "video" | "multi_image" | "document" | "article" | "poll";
@@ -1513,9 +2936,6 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1513
2936
  urn: string;
1514
2937
  }>;
1515
2938
  };
1516
- } | {
1517
- platform: "instagram";
1518
- post_type: "single_image" | "carousel" | "reel";
1519
2939
  connection_id: string;
1520
2940
  body?: string;
1521
2941
  media?: Array<{
@@ -1525,6 +2945,9 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1525
2945
  } | null;
1526
2946
  alt_text_override?: string | null;
1527
2947
  }>;
2948
+ } | {
2949
+ platform: "instagram";
2950
+ post_type: "single_image" | "carousel" | "reel";
1528
2951
  settings: {
1529
2952
  media_type?: "IMAGE" | "CAROUSEL" | "REELS";
1530
2953
  location_id?: string;
@@ -1539,9 +2962,6 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1539
2962
  cover_url?: string;
1540
2963
  audio_name?: string;
1541
2964
  };
1542
- } | {
1543
- platform: "facebook_page";
1544
- post_type: "text" | "single_image" | "multi_image" | "reel";
1545
2965
  connection_id: string;
1546
2966
  body?: string;
1547
2967
  media?: Array<{
@@ -1551,12 +2971,12 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1551
2971
  } | null;
1552
2972
  alt_text_override?: string | null;
1553
2973
  }>;
2974
+ } | {
2975
+ platform: "facebook_page";
2976
+ post_type: "text" | "single_image" | "multi_image" | "reel";
1554
2977
  settings?: {
1555
2978
  link?: string;
1556
2979
  };
1557
- } | {
1558
- platform: "tiktok";
1559
- post_type: "video" | "single_image" | "carousel";
1560
2980
  connection_id: string;
1561
2981
  body?: string;
1562
2982
  media?: Array<{
@@ -1566,6 +2986,9 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1566
2986
  } | null;
1567
2987
  alt_text_override?: string | null;
1568
2988
  }>;
2989
+ } | {
2990
+ platform: "tiktok";
2991
+ post_type: "video" | "single_image" | "carousel";
1569
2992
  settings?: {
1570
2993
  privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
1571
2994
  disable_comment?: boolean;
@@ -1578,6 +3001,15 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1578
3001
  brand_organic_toggle?: boolean;
1579
3002
  is_aigc?: boolean;
1580
3003
  };
3004
+ connection_id: string;
3005
+ body?: string;
3006
+ media?: Array<{
3007
+ media_id: string;
3008
+ crop_box?: {
3009
+ [key: string]: unknown;
3010
+ } | null;
3011
+ alt_text_override?: string | null;
3012
+ }>;
1581
3013
  }>;
1582
3014
  }, unknown>;
1583
3015
  /** Delete a post by id; on success the lists refresh and its detail is dropped. */
@@ -1617,6 +3049,27 @@ declare function useTikTokCreatorInfo(connectionId: string | null): _tanstack_re
1617
3049
  max_video_duration_sec: number;
1618
3050
  }>, Error>;
1619
3051
 
3052
+ /**
3053
+ * A platform's FETCHED (read) variant — one member of a stored `Post`'s
3054
+ * `variants`, as returned by `usePost`/`usePosts`/the calendar. Since the API's
3055
+ * read variant is now a typed discriminated union, it carries the SAME typed
3056
+ * `settings`/`body`/`post_type`/`media` the write variant does, plus the
3057
+ * read-only `id`/`status`/`result`/`error`.
3058
+ */
3059
+ type ReadPostVariant<P extends PostVariant['platform']> = Extract<PostVariant, {
3060
+ platform: P;
3061
+ }>;
3062
+ /**
3063
+ * What a preview's `variant` prop accepts: EITHER the compose-time **write**
3064
+ * variant (`XPostVariant`, …) OR the fetched **read** variant. Both expose the
3065
+ * typed `settings`, `body`, `post_type`, and `media[].alt_text_override` the cards
3066
+ * read — so you can hand a preview a post you just built OR one you fetched from
3067
+ * the API, with no transform.
3068
+ */
3069
+ type XPreviewVariant = XPostVariant | ReadPostVariant<'x'>;
3070
+ type LinkedInPreviewVariant = LinkedInPostVariant | ReadPostVariant<'linkedin'>;
3071
+ type TikTokPreviewVariant = TikTokPostVariant | ReadPostVariant<'tiktok'>;
3072
+ type InstagramPreviewVariant = InstagramPostVariant | ReadPostVariant<'instagram'>;
1620
3073
  /**
1621
3074
  * Public input types for the post-preview components.
1622
3075
  *
@@ -1716,8 +3169,9 @@ interface XPreviewQuotedTweet {
1716
3169
  declare function toPreviewMedia(items: readonly MediaUploadItem[]): PreviewMedia[];
1717
3170
 
1718
3171
  interface XPostPreviewProps {
1719
- /** The X variant from our schema — the content source, untouched. */
1720
- variant: XPostVariant;
3172
+ /** The X variant — either a compose-time write variant or a fetched read
3173
+ * variant (both carry the typed settings/body the card renders). */
3174
+ variant: XPreviewVariant;
1721
3175
  /** Author identity (not stored on our connection — supplied by you). */
1722
3176
  author: XPreviewAuthor;
1723
3177
  /** Resolved media pixels (URLs or compose-time File blobs). */
@@ -1789,8 +3243,9 @@ type LinkedInTheme = 'light' | 'dark' | 'auto';
1789
3243
  * the `--pr-li-*` CSS variables the card reads.
1790
3244
  */
1791
3245
  interface LinkedInPostPreviewProps {
1792
- /** The LinkedIn variant from our schema — the content source, untouched. */
1793
- variant: LinkedInPostVariant;
3246
+ /** The LinkedIn variant — either a compose-time write variant or a fetched read
3247
+ * variant (both carry the typed settings/body the card renders). */
3248
+ variant: LinkedInPreviewVariant;
1794
3249
  /** Author identity (LinkedIn stores no avatar/headline on our connection). */
1795
3250
  author: LinkedInPreviewAuthor;
1796
3251
  /** Resolved media pixels (URLs or compose-time File blobs). */
@@ -1880,8 +3335,9 @@ type InstagramTheme = 'light' | 'dark' | 'auto';
1880
3335
  * already-published posts), referencing the real IG feed + Postiz.
1881
3336
  */
1882
3337
  interface InstagramPostPreviewProps {
1883
- /** The Instagram variant from our schema — the content source, untouched. */
1884
- variant: InstagramPostVariant;
3338
+ /** The Instagram variant — either a compose-time write variant or a fetched
3339
+ * read variant (both carry the typed settings/body the card renders). */
3340
+ variant: InstagramPreviewVariant;
1885
3341
  /** Author identity (SDK-driven; `verified` is a presentation extra). */
1886
3342
  author: InstagramPreviewAuthor;
1887
3343
  /** Resolved media pixels (processed URLs or compose-time File blobs). */
@@ -1899,6 +3355,8 @@ interface ReelPreviewProps {
1899
3355
  author: InstagramPreviewAuthor;
1900
3356
  body: string;
1901
3357
  media: readonly ResolvedMedia[];
3358
+ /** Media is referenced but its pixels aren't resolved yet (still processing). */
3359
+ pending?: boolean;
1902
3360
  /** The reel's audio label (`settings.audio_name`); defaults to "Original audio". */
1903
3361
  audioName?: string;
1904
3362
  className?: string;
@@ -1911,7 +3369,7 @@ interface ReelPreviewProps {
1911
3369
  * counts). Always dark, like the real Reels surface. The caption uses the shared
1912
3370
  * `ExpandableText` fold so the full text is readable (no silent truncation).
1913
3371
  */
1914
- declare function ReelPreview({ author, body, media, audioName, className, style, }: ReelPreviewProps): react.JSX.Element;
3372
+ declare function ReelPreview({ author, body, media, pending, audioName, className, style, }: ReelPreviewProps): react.JSX.Element;
1915
3373
 
1916
3374
  /**
1917
3375
  * Public props for the TikTok post preview — a faithful render of how a post will
@@ -1923,8 +3381,9 @@ declare function ReelPreview({ author, body, media, audioName, className, style,
1923
3381
  * chunks add the editable caption + the consent-gated Post button.
1924
3382
  */
1925
3383
  interface TikTokPostPreviewProps {
1926
- /** The TikTok variant from our schema — the content source, untouched. */
1927
- variant: TikTokPostVariant;
3384
+ /** The TikTok variant — either a compose-time write variant or a fetched read
3385
+ * variant (both carry the typed settings/body the card renders). */
3386
+ variant: TikTokPreviewVariant;
1928
3387
  /** Live creator info (nickname/avatar, audience options, interaction flags). */
1929
3388
  creatorInfo: TikTokCreatorInfo;
1930
3389
  /** Resolved media pixels (processed URLs or compose-time File blobs). */
@@ -2046,4 +3505,4 @@ declare function Declaration({ brandedContent }: {
2046
3505
  brandedContent: boolean;
2047
3506
  }): react.JSX.Element;
2048
3507
 
2049
- export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionIdentity, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewAuthor, type InstagramTheme, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, ReelPreview, type ReelPreviewProps, type ResolvedMedia, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, UploadError, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, connectionKeys, mediaKeys, postKeys, profileKeys, tiktokKeys, toPreviewMedia, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useTikTokCreatorInfo, useUpdateMedia, useUpdatePost, useUpdateProfile, useValidatePost };
3508
+ export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionIdentity, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewAuthor, type InstagramPreviewVariant, type InstagramTheme, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LinkedInPreviewVariant, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, type ReadPostVariant, ReelPreview, type ReelPreviewProps, type ResolvedMedia, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, type TikTokPreviewVariant, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, UploadError, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, type XPreviewVariant, connectionKeys, mediaKeys, postKeys, profileKeys, tiktokKeys, toPreviewMedia, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useTikTokCreatorInfo, useUpdateMedia, useUpdatePost, useUpdateProfile, useValidatePost };