@postrun/react 2.16.0 → 2.18.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.cjs +125 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.js +106 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
|
-
import { QueryClient, QueryKey } from '@tanstack/react-query';
|
|
4
|
+
import { QueryClient, QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
5
5
|
import * as _postrun_js from '@postrun/js';
|
|
6
6
|
import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, InstagramPostVariant, PostVariant, LinkedInPostVariant, TikTokPostVariant, XPostVariant, PostVariantInput, XPoll as XPoll$1, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
7
7
|
export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, UploadError, ValidationIssue, captionMaxFor } from '@postrun/js';
|
|
8
8
|
import { TwitterComponents } from 'react-tweet';
|
|
9
|
+
export * from '@postrun/js/query';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The value every hook and component reads from context: the typed SDK client
|
|
@@ -637,8 +638,9 @@ interface UseMediaUploadOptions {
|
|
|
637
638
|
/**
|
|
638
639
|
* Upload one OR many files and get back platform-validated assets. The hook owns
|
|
639
640
|
* the whole journey per file: create the asset (the API auto-detects
|
|
640
|
-
* kind/content_type from the bytes),
|
|
641
|
-
* poll until processing settles, and expose
|
|
641
|
+
* kind/content_type from the bytes), upload the bytes with a resumable multipart
|
|
642
|
+
* upload (live `progress`), poll until processing settles, and expose
|
|
643
|
+
* `media.per_platform` (per-target
|
|
642
644
|
* status, url, warnings,
|
|
643
645
|
* errors). Every file gets its own `MediaUploadItem` slot in `items`; `ready` is
|
|
644
646
|
* the settled assets to attach to a post; `remove`/`reset` abort in-flight work.
|
|
@@ -2400,7 +2402,7 @@ declare function useValidatePost(profileId: string): {
|
|
|
2400
2402
|
validate: (input: Omit<ComposePostInput, "profileId">) => Promise<PostValidation>;
|
|
2401
2403
|
publishable: boolean | undefined;
|
|
2402
2404
|
issues: {
|
|
2403
|
-
code: "unauthorized" | "forbidden" | "not_found" | "conflict" | "validation_failed" | "rate_limited" | "internal_error" | "idempotency_key_invalid" | "idempotency_key_reused" | "idempotency_request_in_progress" | "account_not_available" | "connection_reauth_required" | "connection_not_pending" | "not_implemented" | "connection_discovery_failed" | "tiktok_creator_info_unavailable" | "media_processing" | "not_publishable" | "invalid_connection" | "invalid_media" | "profile_scope_invalid" | "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" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_format_indeterminate" | "media_format_unsupported" | "media_count_invalid" | "body_too_long" | "content_missing" | "content_conflict" | "content_incomplete" | "content_kind_mismatch" | "media_type_mismatch" | "tag_limit_exceeded" | "reel_field_on_non_reel" | "field_placement_invalid" | "media_not_ready" | "media_failed" | "media_unsupported" | "media_kind_mismatch" | "variant_unparseable" | "publishing_unavailable" | "x_duplicate_content" | "x_not_authorized" | "x_access_not_permitted" | "x_rate_limited" | "x_publish_failed" | "x_media_upload_failed" | "linkedin_duplicate_content" | "linkedin_auth_expired" | "linkedin_permission_denied" | "linkedin_rate_limited" | "linkedin_media_processing" | "linkedin_media_failed" | "linkedin_media_upload_failed" | "linkedin_publish_failed" | "instagram_media_processing" | "instagram_container_expired" | "instagram_container_failed" | "instagram_rate_limited" | "instagram_not_authorized" | "instagram_publish_failed" | "facebook_reel_processing" | "facebook_reel_failed" | "facebook_rate_limited" | "facebook_not_authorized" | "facebook_publish_failed" | "tiktok_privacy_not_allowed" | "tiktok_duration_exceeds_max" | "tiktok_media_processing" | "tiktok_not_authorized" | "tiktok_rate_limited" | "tiktok_url_ownership_unverified" | "tiktok_unaudited_private_only" | "tiktok_spam_risk" | "tiktok_publish_failed" | "post_publish_failed" | "post_partially_published" | "connection_platform_mismatch" | "connection_removed";
|
|
2405
|
+
code: "unauthorized" | "forbidden" | "not_found" | "conflict" | "validation_failed" | "rate_limited" | "internal_error" | "idempotency_key_invalid" | "idempotency_key_reused" | "idempotency_request_in_progress" | "account_not_available" | "connection_reauth_required" | "connection_not_pending" | "not_implemented" | "connection_discovery_failed" | "tiktok_creator_info_unavailable" | "media_processing" | "media_upload_init_failed" | "media_upload_incomplete" | "not_publishable" | "invalid_connection" | "invalid_media" | "profile_scope_invalid" | "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" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_format_indeterminate" | "media_format_unsupported" | "media_count_invalid" | "body_too_long" | "content_missing" | "content_conflict" | "content_incomplete" | "content_kind_mismatch" | "media_type_mismatch" | "tag_limit_exceeded" | "reel_field_on_non_reel" | "field_placement_invalid" | "media_not_ready" | "media_failed" | "media_unsupported" | "media_kind_mismatch" | "variant_unparseable" | "publishing_unavailable" | "x_duplicate_content" | "x_not_authorized" | "x_access_not_permitted" | "x_rate_limited" | "x_publish_failed" | "x_media_upload_failed" | "linkedin_duplicate_content" | "linkedin_auth_expired" | "linkedin_permission_denied" | "linkedin_rate_limited" | "linkedin_media_processing" | "linkedin_media_failed" | "linkedin_media_upload_failed" | "linkedin_publish_failed" | "instagram_media_processing" | "instagram_container_expired" | "instagram_container_failed" | "instagram_rate_limited" | "instagram_daily_limit_reached" | "instagram_aspect_ratio_unsupported" | "instagram_media_unsupported" | "instagram_not_authorized" | "instagram_publish_failed" | "facebook_reel_processing" | "facebook_reel_failed" | "facebook_rate_limited" | "facebook_duplicate_content" | "facebook_temporarily_blocked" | "facebook_not_authorized" | "facebook_publish_failed" | "tiktok_privacy_not_allowed" | "tiktok_duration_exceeds_max" | "tiktok_media_processing" | "tiktok_not_authorized" | "tiktok_rate_limited" | "tiktok_url_ownership_unverified" | "tiktok_unaudited_private_only" | "tiktok_spam_risk" | "tiktok_file_format_invalid" | "tiktok_duration_invalid" | "tiktok_frame_rate_invalid" | "tiktok_resolution_invalid" | "tiktok_media_pull_failed" | "tiktok_server_error" | "tiktok_publish_failed" | "google_rate_limited" | "google_server_error" | "google_auth_expired" | "google_permission_denied" | "google_request_failed" | "post_publish_failed" | "post_partially_published" | "connection_platform_mismatch" | "connection_removed";
|
|
2404
2406
|
message: string;
|
|
2405
2407
|
hint?: string;
|
|
2406
2408
|
allowed?: Array<string>;
|
|
@@ -2834,6 +2836,32 @@ declare function useTikTokCreatorInfo(connectionId: string | null): _tanstack_re
|
|
|
2834
2836
|
max_video_duration_sec: number;
|
|
2835
2837
|
}>, Error>;
|
|
2836
2838
|
|
|
2839
|
+
/**
|
|
2840
|
+
* The paved FE path over the generated TanStack Query options. Pass a factory
|
|
2841
|
+
* that receives the configured client and returns one of the generated `*Options`
|
|
2842
|
+
* (e.g. `googleListCampaignsOptions`); the provider's client (Bearer via
|
|
2843
|
+
* `getToken`) and its isolated `QueryClient` are injected, so auth + caching just
|
|
2844
|
+
* work — no global client, no `<QueryClientProvider>` from the host app.
|
|
2845
|
+
*
|
|
2846
|
+
* const q = usePostrunQuery((client) =>
|
|
2847
|
+
* googleListCampaignsOptions({ client, path: { connection_id }, query }),
|
|
2848
|
+
* );
|
|
2849
|
+
*
|
|
2850
|
+
* Equivalent to the raw two-liner — `const { client, queryClient } = usePostrun();
|
|
2851
|
+
* useQuery(googleListCampaignsOptions({ client, ... }), queryClient)` — which a
|
|
2852
|
+
* customer can always write themselves; this is just sugar.
|
|
2853
|
+
*/
|
|
2854
|
+
declare function usePostrunQuery<TQueryFnData, TError, TData, TQueryKey extends QueryKey>(optionsFactory: (client: PostrunClient) => UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): UseQueryResult<TData, TError>;
|
|
2855
|
+
/**
|
|
2856
|
+
* The mutation counterpart — pass a factory returning a generated `*Mutation`
|
|
2857
|
+
* (e.g. `googlePauseCampaignMutation`); the configured client + `QueryClient` are
|
|
2858
|
+
* injected the same way.
|
|
2859
|
+
*
|
|
2860
|
+
* const m = usePostrunMutation((client) => googlePauseCampaignMutation({ client }));
|
|
2861
|
+
* m.mutate({ path: { connection_id, id } });
|
|
2862
|
+
*/
|
|
2863
|
+
declare function usePostrunMutation<TData, TError, TVariables, TContext>(optionsFactory: (client: PostrunClient) => UseMutationOptions<TData, TError, TVariables, TContext>): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
2864
|
+
|
|
2837
2865
|
/**
|
|
2838
2866
|
* A platform's FETCHED (read) variant — one member of a stored `Post`'s
|
|
2839
2867
|
* `variants`, as returned by `usePost`/`usePosts`/the calendar. Since the API's
|
|
@@ -3311,4 +3339,4 @@ declare function Declaration({ brandedContent }: {
|
|
|
3311
3339
|
brandedContent: boolean;
|
|
3312
3340
|
}): react.JSX.Element;
|
|
3313
3341
|
|
|
3314
|
-
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewVariant, type InstagramTheme, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewVariant, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewConnection, type PreviewMediaKind, type ReadPostVariant, type ReadyMedia, ReelPreview, type ReelPreviewProps, type ResolvedMedia, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, type TikTokPreviewVariant, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewQuotedTweet, type XPreviewVariant, connectionKeys, isReadyMedia, mediaKeys, postKeys, profileKeys, resolveVariantMedia, tiktokKeys, 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 };
|
|
3342
|
+
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewVariant, type InstagramTheme, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewVariant, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewConnection, type PreviewMediaKind, type ReadPostVariant, type ReadyMedia, ReelPreview, type ReelPreviewProps, type ResolvedMedia, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, type TikTokPreviewVariant, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewQuotedTweet, type XPreviewVariant, connectionKeys, isReadyMedia, mediaKeys, postKeys, profileKeys, resolveVariantMedia, tiktokKeys, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePostrunMutation, usePostrunQuery, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useTikTokCreatorInfo, useUpdateMedia, useUpdatePost, useUpdateProfile, useValidatePost };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
4
|
-
import { QueryClient, QueryKey } from '@tanstack/react-query';
|
|
4
|
+
import { QueryClient, QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
5
5
|
import * as _postrun_js from '@postrun/js';
|
|
6
6
|
import { PostrunClient, ListProfilesQuery, DiscoverableAccountList, Connection, ConnectionKind, ConnectionStatus, ListMediaQuery, ListPostsQuery, ConnectablePlatform, MediaResource, MediaTarget, Metadata, ComposePostInput, PostValidation, MediaKind, InstagramPostVariant, PostVariant, LinkedInPostVariant, TikTokPostVariant, XPostVariant, PostVariantInput, XPoll as XPoll$1, TikTokCreatorInfo, TikTokOptionsValue } from '@postrun/js';
|
|
7
7
|
export { PostValidation, PostVariant, PostVariantError, TIKTOK_CAPTION_MAX, TikTokCreatorInfo, UploadError, ValidationIssue, captionMaxFor } from '@postrun/js';
|
|
8
8
|
import { TwitterComponents } from 'react-tweet';
|
|
9
|
+
export * from '@postrun/js/query';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The value every hook and component reads from context: the typed SDK client
|
|
@@ -637,8 +638,9 @@ interface UseMediaUploadOptions {
|
|
|
637
638
|
/**
|
|
638
639
|
* Upload one OR many files and get back platform-validated assets. The hook owns
|
|
639
640
|
* the whole journey per file: create the asset (the API auto-detects
|
|
640
|
-
* kind/content_type from the bytes),
|
|
641
|
-
* poll until processing settles, and expose
|
|
641
|
+
* kind/content_type from the bytes), upload the bytes with a resumable multipart
|
|
642
|
+
* upload (live `progress`), poll until processing settles, and expose
|
|
643
|
+
* `media.per_platform` (per-target
|
|
642
644
|
* status, url, warnings,
|
|
643
645
|
* errors). Every file gets its own `MediaUploadItem` slot in `items`; `ready` is
|
|
644
646
|
* the settled assets to attach to a post; `remove`/`reset` abort in-flight work.
|
|
@@ -2400,7 +2402,7 @@ declare function useValidatePost(profileId: string): {
|
|
|
2400
2402
|
validate: (input: Omit<ComposePostInput, "profileId">) => Promise<PostValidation>;
|
|
2401
2403
|
publishable: boolean | undefined;
|
|
2402
2404
|
issues: {
|
|
2403
|
-
code: "unauthorized" | "forbidden" | "not_found" | "conflict" | "validation_failed" | "rate_limited" | "internal_error" | "idempotency_key_invalid" | "idempotency_key_reused" | "idempotency_request_in_progress" | "account_not_available" | "connection_reauth_required" | "connection_not_pending" | "not_implemented" | "connection_discovery_failed" | "tiktok_creator_info_unavailable" | "media_processing" | "not_publishable" | "invalid_connection" | "invalid_media" | "profile_scope_invalid" | "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" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_format_indeterminate" | "media_format_unsupported" | "media_count_invalid" | "body_too_long" | "content_missing" | "content_conflict" | "content_incomplete" | "content_kind_mismatch" | "media_type_mismatch" | "tag_limit_exceeded" | "reel_field_on_non_reel" | "field_placement_invalid" | "media_not_ready" | "media_failed" | "media_unsupported" | "media_kind_mismatch" | "variant_unparseable" | "publishing_unavailable" | "x_duplicate_content" | "x_not_authorized" | "x_access_not_permitted" | "x_rate_limited" | "x_publish_failed" | "x_media_upload_failed" | "linkedin_duplicate_content" | "linkedin_auth_expired" | "linkedin_permission_denied" | "linkedin_rate_limited" | "linkedin_media_processing" | "linkedin_media_failed" | "linkedin_media_upload_failed" | "linkedin_publish_failed" | "instagram_media_processing" | "instagram_container_expired" | "instagram_container_failed" | "instagram_rate_limited" | "instagram_not_authorized" | "instagram_publish_failed" | "facebook_reel_processing" | "facebook_reel_failed" | "facebook_rate_limited" | "facebook_not_authorized" | "facebook_publish_failed" | "tiktok_privacy_not_allowed" | "tiktok_duration_exceeds_max" | "tiktok_media_processing" | "tiktok_not_authorized" | "tiktok_rate_limited" | "tiktok_url_ownership_unverified" | "tiktok_unaudited_private_only" | "tiktok_spam_risk" | "tiktok_publish_failed" | "post_publish_failed" | "post_partially_published" | "connection_platform_mismatch" | "connection_removed";
|
|
2405
|
+
code: "unauthorized" | "forbidden" | "not_found" | "conflict" | "validation_failed" | "rate_limited" | "internal_error" | "idempotency_key_invalid" | "idempotency_key_reused" | "idempotency_request_in_progress" | "account_not_available" | "connection_reauth_required" | "connection_not_pending" | "not_implemented" | "connection_discovery_failed" | "tiktok_creator_info_unavailable" | "media_processing" | "media_upload_init_failed" | "media_upload_incomplete" | "not_publishable" | "invalid_connection" | "invalid_media" | "profile_scope_invalid" | "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" | "video_transform_failed" | "media_fetch_failed" | "document_format_unsupported" | "document_too_large" | "document_too_many_pages" | "media_format_indeterminate" | "media_format_unsupported" | "media_count_invalid" | "body_too_long" | "content_missing" | "content_conflict" | "content_incomplete" | "content_kind_mismatch" | "media_type_mismatch" | "tag_limit_exceeded" | "reel_field_on_non_reel" | "field_placement_invalid" | "media_not_ready" | "media_failed" | "media_unsupported" | "media_kind_mismatch" | "variant_unparseable" | "publishing_unavailable" | "x_duplicate_content" | "x_not_authorized" | "x_access_not_permitted" | "x_rate_limited" | "x_publish_failed" | "x_media_upload_failed" | "linkedin_duplicate_content" | "linkedin_auth_expired" | "linkedin_permission_denied" | "linkedin_rate_limited" | "linkedin_media_processing" | "linkedin_media_failed" | "linkedin_media_upload_failed" | "linkedin_publish_failed" | "instagram_media_processing" | "instagram_container_expired" | "instagram_container_failed" | "instagram_rate_limited" | "instagram_daily_limit_reached" | "instagram_aspect_ratio_unsupported" | "instagram_media_unsupported" | "instagram_not_authorized" | "instagram_publish_failed" | "facebook_reel_processing" | "facebook_reel_failed" | "facebook_rate_limited" | "facebook_duplicate_content" | "facebook_temporarily_blocked" | "facebook_not_authorized" | "facebook_publish_failed" | "tiktok_privacy_not_allowed" | "tiktok_duration_exceeds_max" | "tiktok_media_processing" | "tiktok_not_authorized" | "tiktok_rate_limited" | "tiktok_url_ownership_unverified" | "tiktok_unaudited_private_only" | "tiktok_spam_risk" | "tiktok_file_format_invalid" | "tiktok_duration_invalid" | "tiktok_frame_rate_invalid" | "tiktok_resolution_invalid" | "tiktok_media_pull_failed" | "tiktok_server_error" | "tiktok_publish_failed" | "google_rate_limited" | "google_server_error" | "google_auth_expired" | "google_permission_denied" | "google_request_failed" | "post_publish_failed" | "post_partially_published" | "connection_platform_mismatch" | "connection_removed";
|
|
2404
2406
|
message: string;
|
|
2405
2407
|
hint?: string;
|
|
2406
2408
|
allowed?: Array<string>;
|
|
@@ -2834,6 +2836,32 @@ declare function useTikTokCreatorInfo(connectionId: string | null): _tanstack_re
|
|
|
2834
2836
|
max_video_duration_sec: number;
|
|
2835
2837
|
}>, Error>;
|
|
2836
2838
|
|
|
2839
|
+
/**
|
|
2840
|
+
* The paved FE path over the generated TanStack Query options. Pass a factory
|
|
2841
|
+
* that receives the configured client and returns one of the generated `*Options`
|
|
2842
|
+
* (e.g. `googleListCampaignsOptions`); the provider's client (Bearer via
|
|
2843
|
+
* `getToken`) and its isolated `QueryClient` are injected, so auth + caching just
|
|
2844
|
+
* work — no global client, no `<QueryClientProvider>` from the host app.
|
|
2845
|
+
*
|
|
2846
|
+
* const q = usePostrunQuery((client) =>
|
|
2847
|
+
* googleListCampaignsOptions({ client, path: { connection_id }, query }),
|
|
2848
|
+
* );
|
|
2849
|
+
*
|
|
2850
|
+
* Equivalent to the raw two-liner — `const { client, queryClient } = usePostrun();
|
|
2851
|
+
* useQuery(googleListCampaignsOptions({ client, ... }), queryClient)` — which a
|
|
2852
|
+
* customer can always write themselves; this is just sugar.
|
|
2853
|
+
*/
|
|
2854
|
+
declare function usePostrunQuery<TQueryFnData, TError, TData, TQueryKey extends QueryKey>(optionsFactory: (client: PostrunClient) => UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>): UseQueryResult<TData, TError>;
|
|
2855
|
+
/**
|
|
2856
|
+
* The mutation counterpart — pass a factory returning a generated `*Mutation`
|
|
2857
|
+
* (e.g. `googlePauseCampaignMutation`); the configured client + `QueryClient` are
|
|
2858
|
+
* injected the same way.
|
|
2859
|
+
*
|
|
2860
|
+
* const m = usePostrunMutation((client) => googlePauseCampaignMutation({ client }));
|
|
2861
|
+
* m.mutate({ path: { connection_id, id } });
|
|
2862
|
+
*/
|
|
2863
|
+
declare function usePostrunMutation<TData, TError, TVariables, TContext>(optionsFactory: (client: PostrunClient) => UseMutationOptions<TData, TError, TVariables, TContext>): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
2864
|
+
|
|
2837
2865
|
/**
|
|
2838
2866
|
* A platform's FETCHED (read) variant — one member of a stored `Post`'s
|
|
2839
2867
|
* `variants`, as returned by `usePost`/`usePosts`/the calendar. Since the API's
|
|
@@ -3311,4 +3339,4 @@ declare function Declaration({ brandedContent }: {
|
|
|
3311
3339
|
brandedContent: boolean;
|
|
3312
3340
|
}): react.JSX.Element;
|
|
3313
3341
|
|
|
3314
|
-
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewVariant, type InstagramTheme, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewVariant, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewConnection, type PreviewMediaKind, type ReadPostVariant, type ReadyMedia, ReelPreview, type ReelPreviewProps, type ResolvedMedia, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, type TikTokPreviewVariant, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewQuotedTweet, type XPreviewVariant, connectionKeys, isReadyMedia, mediaKeys, postKeys, profileKeys, resolveVariantMedia, tiktokKeys, 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 };
|
|
3342
|
+
export { ArticleCard, type ArticleCardProps, AudienceSelect, type CalendarFilters, CommercialDisclosure, Connect, type ConnectErrorReason, type ConnectOutcome, type ConnectProps, type ConnectRenderApi, type ConnectState, type ConnectionsFilter, Declaration, type DiscoverableAccount, DocumentCard, type DocumentCardProps, type InfiniteList, InstagramPostPreview, type InstagramPostPreviewProps, type InstagramPreviewVariant, type InstagramTheme, InteractionToggles, LinkedInPostPreview, type LinkedInPostPreviewProps, type LinkedInPreviewVariant, type LiveOptions, type MediaUploadItem, type MediaUploadOptions, type MediaUploadStatus, Poll, type PollProps, type PostrunContextValue, PostrunProvider, type PostrunProviderProps, type PreviewConnection, type PreviewMediaKind, type ReadPostVariant, type ReadyMedia, ReelPreview, type ReelPreviewProps, type ResolvedMedia, TikTokCaptionField, type TikTokCaptionFieldProps, TikTokPostPreview, type TikTokPostPreviewProps, type TikTokPreviewVariant, TikTokPublishPanel, type TikTokPublishPanelProps, type TikTokTheme, type UseConnectParams, type UseConnectResult, type UseMediaUploadOptions, type UseMediaUploadResult, XPoll, type XPollProps, XPostPreview, type XPostPreviewProps, type XPreviewQuotedTweet, type XPreviewVariant, connectionKeys, isReadyMedia, mediaKeys, postKeys, profileKeys, resolveVariantMedia, tiktokKeys, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePostrunMutation, usePostrunQuery, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useTikTokCreatorInfo, useUpdateMedia, useUpdatePost, useUpdateProfile, useValidatePost };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createContext, memo, useMemo, useState, Fragment as Fragment$1, useRef, useLayoutEffect, useCallback, useEffect, createElement, useContext, useId } from 'react';
|
|
3
3
|
import { useInfiniteQuery, useQuery, useMutation, QueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { xPollDurationLabel, linkedinPollDurationLabel, createPostrunClient, profilesList, profilesGet, profilesCreate, profilesUpdate, profilesDelete, connectionsConnect, connectionsListByProfile, connectionsGet, connectionsListAccounts, connectionsSelect, connectionsDelete, mediaGet, mediaList, mediaUpdate, mediaDelete, postsList, postsGet, postsCreate, buildCreatePost, isPostPlatform, failedVariants, isPublished, postsValidate, postsUpdate, postsDelete, tiktokCreatorInfo, audiencePrivacyOptions, audienceUnselected, tiktokPrivacyLabel, parsePrivacyLevel, TIKTOK_AUDIENCE_REQUIRED_HINT,
|
|
4
|
+
import { xPollDurationLabel, linkedinPollDurationLabel, captionMaxFor, UploadError, TIKTOK_CAPTION_MAX, createPostrunClient, profilesList, profilesGet, profilesCreate, profilesUpdate, profilesDelete, connectionsConnect, connectionsListByProfile, connectionsGet, connectionsListAccounts, connectionsSelect, connectionsDelete, mediaGet, mediaList, mediaUpdate, mediaDelete, postsList, postsGet, postsCreate, buildCreatePost, isPostPlatform, failedVariants, isPublished, postsValidate, postsUpdate, postsDelete, tiktokCreatorInfo, audiencePrivacyOptions, audienceUnselected, tiktokPrivacyLabel, parsePrivacyLevel, TIKTOK_AUDIENCE_REQUIRED_HINT, commercialLabelNotice, commercialDisclosureIncomplete, setCommercialDisclosure, setBrandKind, TIKTOK_DISCLOSURE_REQUIRED_HINT, TIKTOK_BRANDED_CONTENT_POLICY_URL, TIKTOK_MUSIC_CONFIRMATION_URL, interactionRows, interactionValueKey, toggleInteraction, tiktokOptionsReady, TIKTOK_PROCESSING_NOTICE, brandedContentDeclared, mediaCreate, uploadFile, PostrunError } from '@postrun/js';
|
|
5
5
|
export { TIKTOK_CAPTION_MAX, UploadError, captionMaxFor } from '@postrun/js';
|
|
6
6
|
import Nango, { AuthError } from '@nangohq/frontend';
|
|
7
7
|
import pWaitFor, { TimeoutError } from 'p-wait-for';
|
|
8
8
|
import pLimit from 'p-limit';
|
|
9
|
+
import * as query_star from '@postrun/js/query';
|
|
9
10
|
import { enrichTweet, TweetContainer, TweetHeader, TweetInReplyTo, TweetBody, TweetMedia, QuotedTweet } from 'react-tweet';
|
|
10
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
12
|
import { FiMessageCircle, FiRepeat, FiHeart, FiBarChart2, FiShare, FiGlobe, FiUsers, FiThumbsUp, FiMessageSquare, FiSend, FiBookmark, FiMoreHorizontal, FiFileText } from 'react-icons/fi';
|
|
@@ -15,7 +16,86 @@ import useEmblaCarousel from 'embla-carousel-react';
|
|
|
15
16
|
import { MdVerified, MdMusicNote } from 'react-icons/md';
|
|
16
17
|
import { IoMusicalNotes } from 'react-icons/io5';
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
var __defProp = Object.defineProperty;
|
|
20
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
21
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
22
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
|
|
36
|
+
|
|
37
|
+
// src/index.ts
|
|
38
|
+
var index_exports = {};
|
|
39
|
+
__export(index_exports, {
|
|
40
|
+
ArticleCard: () => ArticleCard,
|
|
41
|
+
AudienceSelect: () => AudienceSelect,
|
|
42
|
+
CommercialDisclosure: () => CommercialDisclosure,
|
|
43
|
+
Connect: () => Connect,
|
|
44
|
+
Declaration: () => Declaration,
|
|
45
|
+
DocumentCard: () => DocumentCard,
|
|
46
|
+
InstagramPostPreview: () => InstagramPostPreview,
|
|
47
|
+
InteractionToggles: () => InteractionToggles,
|
|
48
|
+
LinkedInPostPreview: () => LinkedInPostPreview,
|
|
49
|
+
Poll: () => Poll,
|
|
50
|
+
PostrunProvider: () => PostrunProvider,
|
|
51
|
+
ReelPreview: () => ReelPreview,
|
|
52
|
+
TIKTOK_CAPTION_MAX: () => TIKTOK_CAPTION_MAX,
|
|
53
|
+
TikTokCaptionField: () => TikTokCaptionField,
|
|
54
|
+
TikTokPostPreview: () => TikTokPostPreview,
|
|
55
|
+
TikTokPublishPanel: () => TikTokPublishPanel,
|
|
56
|
+
UploadError: () => UploadError,
|
|
57
|
+
XPoll: () => XPoll,
|
|
58
|
+
XPostPreview: () => XPostPreview,
|
|
59
|
+
captionMaxFor: () => captionMaxFor,
|
|
60
|
+
connectionKeys: () => connectionKeys,
|
|
61
|
+
isReadyMedia: () => isReadyMedia,
|
|
62
|
+
mediaKeys: () => mediaKeys,
|
|
63
|
+
postKeys: () => postKeys,
|
|
64
|
+
profileKeys: () => profileKeys,
|
|
65
|
+
resolveVariantMedia: () => resolveVariantMedia,
|
|
66
|
+
tiktokKeys: () => tiktokKeys,
|
|
67
|
+
useCalendar: () => useCalendar,
|
|
68
|
+
useConnect: () => useConnect,
|
|
69
|
+
useConnection: () => useConnection,
|
|
70
|
+
useConnections: () => useConnections,
|
|
71
|
+
useCreatePost: () => useCreatePost,
|
|
72
|
+
useCreateProfile: () => useCreateProfile,
|
|
73
|
+
useDeleteMedia: () => useDeleteMedia,
|
|
74
|
+
useDeletePost: () => useDeletePost,
|
|
75
|
+
useDeleteProfile: () => useDeleteProfile,
|
|
76
|
+
useDisconnect: () => useDisconnect,
|
|
77
|
+
useDiscoverableAccounts: () => useDiscoverableAccounts,
|
|
78
|
+
useInfiniteList: () => useInfiniteList,
|
|
79
|
+
useMedia: () => useMedia,
|
|
80
|
+
useMediaInfinite: () => useMediaInfinite,
|
|
81
|
+
useMediaList: () => useMediaList,
|
|
82
|
+
useMediaUpload: () => useMediaUpload,
|
|
83
|
+
usePost: () => usePost,
|
|
84
|
+
usePostrun: () => usePostrun,
|
|
85
|
+
usePostrunMutation: () => usePostrunMutation,
|
|
86
|
+
usePostrunQuery: () => usePostrunQuery,
|
|
87
|
+
usePosts: () => usePosts,
|
|
88
|
+
usePostsInfinite: () => usePostsInfinite,
|
|
89
|
+
useProfile: () => useProfile,
|
|
90
|
+
useProfiles: () => useProfiles,
|
|
91
|
+
useProfilesInfinite: () => useProfilesInfinite,
|
|
92
|
+
useSelectAccount: () => useSelectAccount,
|
|
93
|
+
useTikTokCreatorInfo: () => useTikTokCreatorInfo,
|
|
94
|
+
useUpdateMedia: () => useUpdateMedia,
|
|
95
|
+
useUpdatePost: () => useUpdatePost,
|
|
96
|
+
useUpdateProfile: () => useUpdateProfile,
|
|
97
|
+
useValidatePost: () => useValidatePost
|
|
98
|
+
});
|
|
19
99
|
function createDefaultQueryClient() {
|
|
20
100
|
return new QueryClient({
|
|
21
101
|
defaultOptions: {
|
|
@@ -603,7 +683,10 @@ async function runUpload(client, file, options, signal, callbacks) {
|
|
|
603
683
|
}
|
|
604
684
|
})).data;
|
|
605
685
|
if (created.upload) {
|
|
606
|
-
await
|
|
686
|
+
await uploadFile(file, {
|
|
687
|
+
mediaId: created.id,
|
|
688
|
+
session: created.upload,
|
|
689
|
+
client,
|
|
607
690
|
onProgress: callbacks.onProgress,
|
|
608
691
|
signal
|
|
609
692
|
});
|
|
@@ -920,6 +1003,25 @@ function useTikTokCreatorInfo(connectionId) {
|
|
|
920
1003
|
);
|
|
921
1004
|
}
|
|
922
1005
|
|
|
1006
|
+
// src/query.ts
|
|
1007
|
+
var query_exports = {};
|
|
1008
|
+
__export(query_exports, {
|
|
1009
|
+
usePostrunMutation: () => usePostrunMutation,
|
|
1010
|
+
usePostrunQuery: () => usePostrunQuery
|
|
1011
|
+
});
|
|
1012
|
+
__reExport(query_exports, query_star);
|
|
1013
|
+
function usePostrunQuery(optionsFactory) {
|
|
1014
|
+
const { client, queryClient } = usePostrun();
|
|
1015
|
+
return useQuery(optionsFactory(client), queryClient);
|
|
1016
|
+
}
|
|
1017
|
+
function usePostrunMutation(optionsFactory) {
|
|
1018
|
+
const { client, queryClient } = usePostrun();
|
|
1019
|
+
return useMutation(optionsFactory(client), queryClient);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
// src/index.ts
|
|
1023
|
+
__reExport(index_exports, query_exports);
|
|
1024
|
+
|
|
923
1025
|
// src/preview/media-resolver.ts
|
|
924
1026
|
function previewKind(kind) {
|
|
925
1027
|
return kind === "image" || kind === "video" || kind === "gif" ? kind : null;
|
|
@@ -3350,6 +3452,6 @@ var postButtonStyle = {
|
|
|
3350
3452
|
transition: "opacity 160ms ease"
|
|
3351
3453
|
};
|
|
3352
3454
|
|
|
3353
|
-
export { ArticleCard, AudienceSelect, CommercialDisclosure, Connect, Declaration, DocumentCard, InstagramPostPreview, InteractionToggles, LinkedInPostPreview, Poll, PostrunProvider, ReelPreview, TikTokCaptionField, TikTokPostPreview, TikTokPublishPanel, XPoll, XPostPreview, connectionKeys, isReadyMedia, mediaKeys, postKeys, profileKeys, resolveVariantMedia, tiktokKeys, 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 };
|
|
3455
|
+
export { ArticleCard, AudienceSelect, CommercialDisclosure, Connect, Declaration, DocumentCard, InstagramPostPreview, InteractionToggles, LinkedInPostPreview, Poll, PostrunProvider, ReelPreview, TikTokCaptionField, TikTokPostPreview, TikTokPublishPanel, XPoll, XPostPreview, connectionKeys, isReadyMedia, mediaKeys, postKeys, profileKeys, resolveVariantMedia, tiktokKeys, useCalendar, useConnect, useConnection, useConnections, useCreatePost, useCreateProfile, useDeleteMedia, useDeletePost, useDeleteProfile, useDisconnect, useDiscoverableAccounts, useInfiniteList, useMedia, useMediaInfinite, useMediaList, useMediaUpload, usePost, usePostrun, usePostrunMutation, usePostrunQuery, usePosts, usePostsInfinite, useProfile, useProfiles, useProfilesInfinite, useSelectAccount, useTikTokCreatorInfo, useUpdateMedia, useUpdatePost, useUpdateProfile, useValidatePost };
|
|
3354
3456
|
//# sourceMappingURL=index.js.map
|
|
3355
3457
|
//# sourceMappingURL=index.js.map
|