@postrun/react 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.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, ConnectablePlatform, MediaTarget, MediaKind, CreateMediaInput, MediaResource, ListPostsQuery, ComposePostInput, XPostVariant, LinkedInPostVariant } from '@postrun/js';
5
+ import { PostrunClient, ListProfilesQuery, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaTarget, MediaKind, Metadata, MediaResource, ComposePostInput, XPostVariant, LinkedInPostVariant } from '@postrun/js';
6
6
  import { TwitterComponents } from 'react-tweet';
7
7
 
8
8
  /**
@@ -191,6 +191,109 @@ declare function useDeleteProfile(): _tanstack_react_query.UseMutationResult<{
191
191
  deleted: true;
192
192
  }, Error, string, unknown>;
193
193
 
194
+ /** The connection-list filter that keys the cache (social/ads + lifecycle). */
195
+ interface ConnectionsFilter {
196
+ kind?: ConnectionKind;
197
+ status?: ConnectionStatus;
198
+ }
199
+ /**
200
+ * Query-key factory for profiles. Hierarchical so a mutation can invalidate at
201
+ * the right granularity: `lists()` after a create, `detail(id)` after an update.
202
+ */
203
+ declare const profileKeys: {
204
+ all: readonly ["postrun", "profiles"];
205
+ lists: () => readonly ["postrun", "profiles", "list"];
206
+ list: (query?: ListProfilesQuery) => readonly ["postrun", "profiles", "list", {
207
+ limit?: number;
208
+ offset?: number;
209
+ external_id?: string;
210
+ metadata?: {
211
+ [key: string]: string | number | boolean;
212
+ };
213
+ }];
214
+ infinite: (query?: Omit<ListProfilesQuery, "limit" | "offset">) => readonly ["postrun", "profiles", "list", "infinite", Omit<{
215
+ limit?: number;
216
+ offset?: number;
217
+ external_id?: string;
218
+ metadata?: {
219
+ [key: string]: string | number | boolean;
220
+ };
221
+ }, "limit" | "offset">];
222
+ details: () => readonly ["postrun", "profiles", "detail"];
223
+ detail: (id: string) => readonly ["postrun", "profiles", "detail", string];
224
+ };
225
+ /** Query-key factory for posts (list filtered by query; detail by id). */
226
+ declare const postKeys: {
227
+ all: readonly ["postrun", "posts"];
228
+ lists: () => readonly ["postrun", "posts", "list"];
229
+ list: (query?: ListPostsQuery) => readonly ["postrun", "posts", "list", {
230
+ limit?: number;
231
+ offset?: number;
232
+ profile_id?: string;
233
+ external_id?: string;
234
+ metadata?: {
235
+ [key: string]: string | number | boolean;
236
+ };
237
+ scheduled_after?: string;
238
+ scheduled_before?: string;
239
+ updated_after?: string;
240
+ status?: Array<"draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed">;
241
+ }];
242
+ infinite: (query?: Omit<ListPostsQuery, "limit" | "offset">) => readonly ["postrun", "posts", "list", "infinite", Omit<{
243
+ limit?: number;
244
+ offset?: number;
245
+ profile_id?: string;
246
+ external_id?: string;
247
+ metadata?: {
248
+ [key: string]: string | number | boolean;
249
+ };
250
+ scheduled_after?: string;
251
+ scheduled_before?: string;
252
+ updated_after?: string;
253
+ status?: Array<"draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed">;
254
+ }, "limit" | "offset">];
255
+ details: () => readonly ["postrun", "posts", "detail"];
256
+ detail: (id: string) => readonly ["postrun", "posts", "detail", string];
257
+ };
258
+ /** Query-key factory for media assets (list filtered by query; detail by id). */
259
+ declare const mediaKeys: {
260
+ all: readonly ["postrun", "media"];
261
+ lists: () => readonly ["postrun", "media", "list"];
262
+ list: (query?: ListMediaQuery) => readonly ["postrun", "media", "list", {
263
+ limit?: number;
264
+ offset?: number;
265
+ profile_id?: string;
266
+ status?: "uploading" | "processing" | "ready" | "failed";
267
+ kind?: "image" | "video" | "gif" | "document";
268
+ external_id?: string;
269
+ metadata?: {
270
+ [key: string]: string | number | boolean;
271
+ };
272
+ }];
273
+ infinite: (query?: Omit<ListMediaQuery, "limit" | "offset">) => readonly ["postrun", "media", "list", "infinite", Omit<{
274
+ limit?: number;
275
+ offset?: number;
276
+ profile_id?: string;
277
+ status?: "uploading" | "processing" | "ready" | "failed";
278
+ kind?: "image" | "video" | "gif" | "document";
279
+ external_id?: string;
280
+ metadata?: {
281
+ [key: string]: string | number | boolean;
282
+ };
283
+ }, "limit" | "offset">];
284
+ details: () => readonly ["postrun", "media", "detail"];
285
+ detail: (id: string) => readonly ["postrun", "media", "detail", string];
286
+ };
287
+ /** Query-key factory for connections (lists keyed by owning profile). */
288
+ declare const connectionKeys: {
289
+ all: readonly ["postrun", "connections"];
290
+ lists: () => readonly ["postrun", "connections", "list"];
291
+ list: (profileId: string, filter?: ConnectionsFilter) => readonly ["postrun", "connections", "list", string, ConnectionsFilter];
292
+ details: () => readonly ["postrun", "connections", "detail"];
293
+ detail: (id: string) => readonly ["postrun", "connections", "detail", string];
294
+ accounts: (id: string) => readonly ["postrun", "connections", "accounts", string];
295
+ };
296
+
194
297
  interface ConnectParams {
195
298
  /** The profile to attach the new connection to. */
196
299
  profileId: string;
@@ -205,19 +308,29 @@ interface ConnectParams {
205
308
  * On return, the new connection appears via `useConnections`.
206
309
  */
207
310
  declare function useConnect(): _tanstack_react_query.UseMutationResult<{
208
- connect_session_token: string;
209
- connect_url: string;
311
+ hosted_connect_url: string;
312
+ connect_token: string;
210
313
  expires_at: string;
211
314
  }, Error, ConnectParams, unknown>;
212
- /** List a profile's connected accounts. */
213
- declare function useConnections(profileId: string): _tanstack_react_query.UseQueryResult<NoInfer<{
315
+ /**
316
+ * List a profile's connected accounts. Pass a `filter` to narrow by `kind`
317
+ * (`posting` = social, `ads`) or `status` — e.g. a composer fetches
318
+ * `{ kind: 'posting' }` to show only the social accounts it can publish to.
319
+ */
320
+ declare function useConnections(profileId: string, filter?: ConnectionsFilter): _tanstack_react_query.UseQueryResult<NoInfer<{
214
321
  object: "list";
215
322
  data: Array<{
216
323
  id: string;
217
324
  profile_id: string;
218
325
  platform: "meta_ads" | "google_ads" | "tiktok_ads" | "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
326
+ kind: "posting" | "ads";
327
+ status: "pending" | "active" | "needs_reauth";
219
328
  external_account_id: string | null;
220
329
  external_account_name: string | null;
330
+ username: string | null;
331
+ avatar_url: string | null;
332
+ profile_url: string | null;
333
+ reauth_at: string | null;
221
334
  currency: string | null;
222
335
  created_at: string | null;
223
336
  updated_at: string | null;
@@ -232,8 +345,14 @@ declare function useConnection(id: string): _tanstack_react_query.UseQueryResult
232
345
  id: string;
233
346
  profile_id: string;
234
347
  platform: "meta_ads" | "google_ads" | "tiktok_ads" | "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
348
+ kind: "posting" | "ads";
349
+ status: "pending" | "active" | "needs_reauth";
235
350
  external_account_id: string | null;
236
351
  external_account_name: string | null;
352
+ username: string | null;
353
+ avatar_url: string | null;
354
+ profile_url: string | null;
355
+ reauth_at: string | null;
237
356
  currency: string | null;
238
357
  created_at: string | null;
239
358
  updated_at: string | null;
@@ -245,9 +364,15 @@ declare function useDiscoverableAccounts(id: string): _tanstack_react_query.UseQ
245
364
  external_account_id: string;
246
365
  name: string | null;
247
366
  currency: string | null;
367
+ username?: string | null;
368
+ avatar_url?: string | null;
369
+ profile_url?: string | null;
248
370
  instagram?: {
249
371
  external_account_id: string;
250
372
  name: string | null;
373
+ username?: string | null;
374
+ avatar_url?: string | null;
375
+ profile_url?: string | null;
251
376
  } | null;
252
377
  }>;
253
378
  }>, Error>;
@@ -256,8 +381,14 @@ declare function useSelectAccount(): _tanstack_react_query.UseMutationResult<{
256
381
  id: string;
257
382
  profile_id: string;
258
383
  platform: "meta_ads" | "google_ads" | "tiktok_ads" | "x" | "linkedin" | "facebook_page" | "instagram" | "tiktok";
384
+ kind: "posting" | "ads";
385
+ status: "pending" | "active" | "needs_reauth";
259
386
  external_account_id: string | null;
260
387
  external_account_name: string | null;
388
+ username: string | null;
389
+ avatar_url: string | null;
390
+ profile_url: string | null;
391
+ reauth_at: string | null;
261
392
  currency: string | null;
262
393
  created_at: string | null;
263
394
  updated_at: string | null;
@@ -287,7 +418,7 @@ interface MediaUploadOptions {
287
418
  raw?: boolean;
288
419
  altText?: string;
289
420
  externalId?: string;
290
- metadata?: CreateMediaInput['metadata'];
421
+ metadata?: Metadata;
291
422
  }
292
423
  /**
293
424
  * Upload a file and get back a platform-validated asset. The hook owns the whole
@@ -306,11 +437,12 @@ declare function useMediaUpload(): {
306
437
  id: string;
307
438
  object: "media";
308
439
  profile_id: string;
309
- kind: "image" | "video" | "gif" | "document";
440
+ kind: "image" | "video" | "gif" | "document" | null;
441
+ content_type: string | null;
310
442
  status: "uploading" | "processing" | "ready" | "failed";
311
443
  raw: boolean;
312
444
  error: {
313
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
445
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
314
446
  message: string;
315
447
  hint?: string;
316
448
  allowed?: Array<string>;
@@ -332,14 +464,14 @@ declare function useMediaUpload(): {
332
464
  height: number | null;
333
465
  bytes: number | null;
334
466
  warnings: Array<{
335
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
467
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
336
468
  message: string;
337
469
  hint?: string;
338
470
  allowed?: Array<string>;
339
471
  got?: string;
340
472
  }>;
341
473
  errors: Array<{
342
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
474
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
343
475
  message: string;
344
476
  hint?: string;
345
477
  allowed?: Array<string>;
@@ -361,11 +493,12 @@ declare function useMedia(id: string): _tanstack_react_query.UseQueryResult<NoIn
361
493
  id: string;
362
494
  object: "media";
363
495
  profile_id: string;
364
- kind: "image" | "video" | "gif" | "document";
496
+ kind: "image" | "video" | "gif" | "document" | null;
497
+ content_type: string | null;
365
498
  status: "uploading" | "processing" | "ready" | "failed";
366
499
  raw: boolean;
367
500
  error: {
368
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
501
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
369
502
  message: string;
370
503
  hint?: string;
371
504
  allowed?: Array<string>;
@@ -387,14 +520,14 @@ declare function useMedia(id: string): _tanstack_react_query.UseQueryResult<NoIn
387
520
  height: number | null;
388
521
  bytes: number | null;
389
522
  warnings: Array<{
390
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
523
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
391
524
  message: string;
392
525
  hint?: string;
393
526
  allowed?: Array<string>;
394
527
  got?: string;
395
528
  }>;
396
529
  errors: Array<{
397
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
530
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
398
531
  message: string;
399
532
  hint?: string;
400
533
  allowed?: Array<string>;
@@ -409,16 +542,143 @@ declare function useMedia(id: string): _tanstack_react_query.UseQueryResult<NoIn
409
542
  created_at: string;
410
543
  updated_at: string;
411
544
  }>, Error>;
545
+ /**
546
+ * List media assets under the account, newest first. Filter by `profile_id`,
547
+ * `status`, `kind`, your own `external_id`, or `metadata` (exact-match
548
+ * containment), with offset `limit`/`offset` pagination. Returns one page; use
549
+ * `useMediaInfinite` for a load-more feed.
550
+ */
551
+ declare function useMediaList(query?: ListMediaQuery): _tanstack_react_query.UseQueryResult<NoInfer<{
552
+ object: "list";
553
+ data: Array<{
554
+ id: string;
555
+ object: "media";
556
+ profile_id: string;
557
+ kind: "image" | "video" | "gif" | "document" | null;
558
+ content_type: string | null;
559
+ status: "uploading" | "processing" | "ready" | "failed";
560
+ raw: boolean;
561
+ error: {
562
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
563
+ message: string;
564
+ hint?: string;
565
+ allowed?: Array<string>;
566
+ got?: string;
567
+ } | null;
568
+ source: {
569
+ format: string;
570
+ bytes: number;
571
+ width: number | null;
572
+ height: number | null;
573
+ duration_ms: number | null;
574
+ } | null;
575
+ alt_text: string | null;
576
+ per_platform: {
577
+ [key: string]: {
578
+ status: "processing" | "ready" | "failed";
579
+ url: string | null;
580
+ width: number | null;
581
+ height: number | null;
582
+ bytes: number | null;
583
+ warnings: Array<{
584
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
585
+ message: string;
586
+ hint?: string;
587
+ allowed?: Array<string>;
588
+ got?: string;
589
+ }>;
590
+ errors: Array<{
591
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
592
+ message: string;
593
+ hint?: string;
594
+ allowed?: Array<string>;
595
+ got?: string;
596
+ }>;
597
+ };
598
+ };
599
+ external_id: string | null;
600
+ metadata: {
601
+ [key: string]: string | number | boolean;
602
+ };
603
+ created_at: string;
604
+ updated_at: string;
605
+ }>;
606
+ total: number;
607
+ limit: number;
608
+ offset: number;
609
+ has_more: boolean;
610
+ }>, Error>;
611
+ /**
612
+ * Load-more / infinite-scroll view over the media list — same filters as
613
+ * `useMediaList` minus pagination, which the helper drives. Returns
614
+ * `{ items, total, loadMore, hasMore, … }`.
615
+ */
616
+ declare function useMediaInfinite(filters?: Omit<ListMediaQuery, 'limit' | 'offset'>, options?: {
617
+ pageSize?: number;
618
+ }): InfiniteList<{
619
+ id: string;
620
+ object: "media";
621
+ profile_id: string;
622
+ kind: "image" | "video" | "gif" | "document" | null;
623
+ content_type: string | null;
624
+ status: "uploading" | "processing" | "ready" | "failed";
625
+ raw: boolean;
626
+ error: {
627
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
628
+ message: string;
629
+ hint?: string;
630
+ allowed?: Array<string>;
631
+ got?: string;
632
+ } | null;
633
+ source: {
634
+ format: string;
635
+ bytes: number;
636
+ width: number | null;
637
+ height: number | null;
638
+ duration_ms: number | null;
639
+ } | null;
640
+ alt_text: string | null;
641
+ per_platform: {
642
+ [key: string]: {
643
+ status: "processing" | "ready" | "failed";
644
+ url: string | null;
645
+ width: number | null;
646
+ height: number | null;
647
+ bytes: number | null;
648
+ warnings: Array<{
649
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
650
+ message: string;
651
+ hint?: string;
652
+ allowed?: Array<string>;
653
+ got?: string;
654
+ }>;
655
+ errors: Array<{
656
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
657
+ message: string;
658
+ hint?: string;
659
+ allowed?: Array<string>;
660
+ got?: string;
661
+ }>;
662
+ };
663
+ };
664
+ external_id: string | null;
665
+ metadata: {
666
+ [key: string]: string | number | boolean;
667
+ };
668
+ created_at: string;
669
+ updated_at: string;
670
+ }>;
412
671
  /** Update a media asset: alt text / metadata / external_id, or extend targets. */
413
672
  declare function useUpdateMedia(): _tanstack_react_query.UseMutationResult<{
414
673
  id: string;
415
674
  object: "media";
416
675
  profile_id: string;
417
- kind: "image" | "video" | "gif" | "document";
676
+ kind: "image" | "video" | "gif" | "document" | null;
677
+ content_type: string | null;
418
678
  status: "uploading" | "processing" | "ready" | "failed";
419
679
  raw: boolean;
420
680
  error: {
421
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
681
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
422
682
  message: string;
423
683
  hint?: string;
424
684
  allowed?: Array<string>;
@@ -440,14 +700,14 @@ declare function useUpdateMedia(): _tanstack_react_query.UseMutationResult<{
440
700
  height: number | null;
441
701
  bytes: number | null;
442
702
  warnings: Array<{
443
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
703
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
444
704
  message: string;
445
705
  hint?: string;
446
706
  allowed?: Array<string>;
447
707
  got?: string;
448
708
  }>;
449
709
  errors: Array<{
450
- code: "media_unprobeable" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
710
+ code: "media_unprobeable" | "media_format_indeterminate" | "media_too_large" | "media_aspect_ratio_unsupported" | "media_resolution_too_low" | "media_gif_unsupported" | "media_format_recompressed" | "media_resolution_downscaled" | "video_container_unsupported" | "video_codec_unsupported" | "video_audio_codec_unsupported" | "video_too_large" | "video_too_small" | "video_dimensions_unsupported" | "video_dimensions_too_large" | "video_fps_unsupported" | "video_fps_too_low" | "video_aspect_unsupported" | "video_duration_too_short" | "video_duration_exceeds_max" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_unsupported";
451
711
  message: string;
452
712
  hint?: string;
453
713
  allowed?: Array<string>;
@@ -829,7 +1089,7 @@ declare function useCreatePost(profileId: string): {
829
1089
  } | undefined;
830
1090
  reset: () => void;
831
1091
  isReady: boolean;
832
- connectedChannels: ("x" | "linkedin" | "facebook_page" | "instagram")[];
1092
+ connectedChannels: ("x" | "linkedin" | "facebook_page" | "tiktok" | "instagram")[];
833
1093
  };
834
1094
  /**
835
1095
  * Update a post by id. Pass a light edit directly (`{ schedule_at }`,
@@ -1002,6 +1262,30 @@ declare function useUpdatePost(postId: string): _tanstack_react_query.UseMutatio
1002
1262
  settings?: {
1003
1263
  link?: string;
1004
1264
  };
1265
+ } | {
1266
+ platform: "tiktok";
1267
+ post_type: "video" | "single_image" | "carousel";
1268
+ connection_id: string;
1269
+ body?: string;
1270
+ media?: Array<{
1271
+ media_id: string;
1272
+ crop_box?: {
1273
+ [key: string]: unknown;
1274
+ } | null;
1275
+ alt_text_override?: string | null;
1276
+ }>;
1277
+ settings?: {
1278
+ privacy_level?: "PUBLIC_TO_EVERYONE" | "MUTUAL_FOLLOW_FRIENDS" | "FOLLOWER_OF_CREATOR" | "SELF_ONLY";
1279
+ disable_comment?: boolean;
1280
+ disable_duet?: boolean;
1281
+ disable_stitch?: boolean;
1282
+ video_cover_timestamp_ms?: number;
1283
+ photo_cover_index?: number;
1284
+ auto_add_music?: boolean;
1285
+ brand_content_toggle?: boolean;
1286
+ brand_organic_toggle?: boolean;
1287
+ is_aigc?: boolean;
1288
+ };
1005
1289
  }>;
1006
1290
  }, unknown>;
1007
1291
  /** Delete a post by id; on success the lists refresh and its detail is dropped. */
@@ -1011,81 +1295,6 @@ declare function useDeletePost(): _tanstack_react_query.UseMutationResult<{
1011
1295
  deleted: true;
1012
1296
  }, Error, string, unknown>;
1013
1297
 
1014
- /**
1015
- * Query-key factory for profiles. Hierarchical so a mutation can invalidate at
1016
- * the right granularity: `lists()` after a create, `detail(id)` after an update.
1017
- */
1018
- declare const profileKeys: {
1019
- all: readonly ["postrun", "profiles"];
1020
- lists: () => readonly ["postrun", "profiles", "list"];
1021
- list: (query?: ListProfilesQuery) => readonly ["postrun", "profiles", "list", {
1022
- limit?: number;
1023
- offset?: number;
1024
- external_id?: string;
1025
- metadata?: {
1026
- [key: string]: string | number | boolean;
1027
- };
1028
- }];
1029
- infinite: (query?: ListProfilesQuery) => readonly ["postrun", "profiles", "list", "infinite", {
1030
- limit?: number;
1031
- offset?: number;
1032
- external_id?: string;
1033
- metadata?: {
1034
- [key: string]: string | number | boolean;
1035
- };
1036
- }];
1037
- details: () => readonly ["postrun", "profiles", "detail"];
1038
- detail: (id: string) => readonly ["postrun", "profiles", "detail", string];
1039
- };
1040
- /** Query-key factory for posts (list filtered by query; detail by id). */
1041
- declare const postKeys: {
1042
- all: readonly ["postrun", "posts"];
1043
- lists: () => readonly ["postrun", "posts", "list"];
1044
- list: (query?: ListPostsQuery) => readonly ["postrun", "posts", "list", {
1045
- limit?: number;
1046
- offset?: number;
1047
- profile_id?: string;
1048
- external_id?: string;
1049
- metadata?: {
1050
- [key: string]: string | number | boolean;
1051
- };
1052
- scheduled_after?: string;
1053
- scheduled_before?: string;
1054
- updated_after?: string;
1055
- status?: Array<"draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed">;
1056
- }];
1057
- infinite: (query?: ListPostsQuery) => readonly ["postrun", "posts", "list", "infinite", {
1058
- limit?: number;
1059
- offset?: number;
1060
- profile_id?: string;
1061
- external_id?: string;
1062
- metadata?: {
1063
- [key: string]: string | number | boolean;
1064
- };
1065
- scheduled_after?: string;
1066
- scheduled_before?: string;
1067
- updated_after?: string;
1068
- status?: Array<"draft" | "scheduled" | "publishing" | "partially_published" | "published" | "failed">;
1069
- }];
1070
- details: () => readonly ["postrun", "posts", "detail"];
1071
- detail: (id: string) => readonly ["postrun", "posts", "detail", string];
1072
- };
1073
- /** Query-key factory for media assets (single-asset only; no list endpoint yet). */
1074
- declare const mediaKeys: {
1075
- all: readonly ["postrun", "media"];
1076
- details: () => readonly ["postrun", "media", "detail"];
1077
- detail: (id: string) => readonly ["postrun", "media", "detail", string];
1078
- };
1079
- /** Query-key factory for connections (lists keyed by owning profile). */
1080
- declare const connectionKeys: {
1081
- all: readonly ["postrun", "connections"];
1082
- lists: () => readonly ["postrun", "connections", "list"];
1083
- list: (profileId: string) => readonly ["postrun", "connections", "list", string];
1084
- details: () => readonly ["postrun", "connections", "detail"];
1085
- detail: (id: string) => readonly ["postrun", "connections", "detail", string];
1086
- accounts: (id: string) => readonly ["postrun", "connections", "accounts", string];
1087
- };
1088
-
1089
1298
  /**
1090
1299
  * Public input types for the post-preview components. These describe data the
1091
1300
  * CUSTOMER supplies for presentation — NOT shapes from our OpenAPI contract — so
@@ -1234,4 +1443,4 @@ declare function LinkedInPostPreviewImpl({ variant, author, media, theme, time,
1234
1443
  * absorbs unstable media arrays). */
1235
1444
  declare const LinkedInPostPreview: react.MemoExoticComponent<typeof LinkedInPostPreviewImpl>;
1236
1445
 
1237
- export { type CalendarFilters, type ConnectParams, type InfiniteList, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LiveOptions, type MediaUploadOptions, type MediaUploadStatus, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, UploadError, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, connectionKeys, mediaKeys, postKeys, profileKeys, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaUpload, usePost, usePostrun, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useUpdateMedia, useUpdatePost, useUpdateProfile };
1446
+ export { type CalendarFilters, type ConnectParams, type ConnectionsFilter, type InfiniteList, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewAuthor, type LiveOptions, type MediaUploadOptions, type MediaUploadStatus, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewMedia, type PreviewMediaKind, UploadError, XPostPreview, type XPostPreviewProps, type XPreviewAuthor, type XPreviewMedia, type XPreviewQuotedTweet, connectionKeys, mediaKeys, postKeys, profileKeys, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useUpdateMedia, useUpdatePost, useUpdateProfile };