@postrun/js 2.0.0 → 2.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.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TDataShape, O as Options$1, C as Client, a as ClientMeta, b as ConnectionsConnectData, R as RequestResult, c as ConnectionsConnectResponses, d as ConnectionsConnectErrors, e as ConnectionsDeleteData, f as ConnectionsDeleteResponses, g as ConnectionsDeleteErrors, h as ConnectionsGetData, i as ConnectionsGetResponses, j as ConnectionsGetErrors, k as ConnectionsListAccountsData, l as ConnectionsListAccountsResponses, m as ConnectionsListAccountsErrors, n as ConnectionsListByProfileData, o as ConnectionsListByProfileResponses, p as ConnectionsListByProfileErrors, q as ConnectionsSelectData, r as ConnectionsSelectResponses, s as ConnectionsSelectErrors, G as GoogleCreateAdData, t as GoogleCreateAdResponses, u as GoogleCreateAdErrors, v as GoogleCreateAdGroupData, w as GoogleCreateAdGroupResponses, x as GoogleCreateAdGroupErrors, y as GoogleCreateBudgetData, z as GoogleCreateBudgetResponses, A as GoogleCreateBudgetErrors, B as GoogleCreateCampaignData, D as GoogleCreateCampaignResponses, E as GoogleCreateCampaignErrors, F as GoogleCreateConversionActionData, H as GoogleCreateConversionActionResponses, I as GoogleCreateConversionActionErrors, J as GoogleCreateDisplayAdData, K as GoogleCreateDisplayAdResponses, L as GoogleCreateDisplayAdErrors, M as GoogleCreateKeywordData, N as GoogleCreateKeywordResponses, P as GoogleCreateKeywordErrors, Q as GoogleDeleteAdData, S as GoogleDeleteAdResponses, U as GoogleDeleteAdErrors, V as GoogleDeleteAdGroupData, W as GoogleDeleteAdGroupResponses, X as GoogleDeleteAdGroupErrors, Y as GoogleDeleteBudgetData, Z as GoogleDeleteBudgetResponses, _ as GoogleDeleteBudgetErrors, $ as GoogleDeleteCampaignData, a0 as GoogleDeleteCampaignResponses, a1 as GoogleDeleteCampaignErrors, a2 as GoogleDeleteKeywordData, a3 as GoogleDeleteKeywordResponses, a4 as GoogleDeleteKeywordErrors, a5 as GoogleEditAdGroupData, a6 as GoogleEditAdGroupResponses, a7 as GoogleEditAdGroupErrors, a8 as GoogleEditBudgetData, a9 as GoogleEditBudgetResponses, aa as GoogleEditBudgetErrors, ab as GoogleEditCampaignData, ac as GoogleEditCampaignResponses, ad as GoogleEditCampaignErrors, ae as GoogleEnableAdData, af as GoogleEnableAdResponses, ag as GoogleEnableAdErrors, ah as GoogleEnableAdGroupData, ai as GoogleEnableAdGroupResponses, aj as GoogleEnableAdGroupErrors, ak as GoogleEnableCampaignData, al as GoogleEnableCampaignResponses, am as GoogleEnableCampaignErrors, an as GoogleEnableKeywordData, ao as GoogleEnableKeywordResponses, ap as GoogleEnableKeywordErrors, aq as GoogleGetAccountData, ar as GoogleGetAccountResponses, as as GoogleGetAccountErrors, at as GoogleGetAdData, au as GoogleGetAdResponses, av as GoogleGetAdErrors, aw as GoogleGetAdGroupData, ax as GoogleGetAdGroupResponses, ay as GoogleGetAdGroupErrors, az as GoogleGetCampaignData, aA as GoogleGetCampaignResponses, aB as GoogleGetCampaignErrors, aC as GoogleGetConversionActionData, aD as GoogleGetConversionActionResponses, aE as GoogleGetConversionActionErrors, aF as GoogleGetInsightsData, aG as GoogleGetInsightsResponses, aH as GoogleGetInsightsErrors, aI as GoogleGetKeywordData, aJ as GoogleGetKeywordResponses, aK as GoogleGetKeywordErrors, aL as GoogleListAdGroupsData, aM as GoogleListAdGroupsResponses, aN as GoogleListAdGroupsErrors, aO as GoogleListAdsData, aP as GoogleListAdsResponses, aQ as GoogleListAdsErrors, aR as GoogleListCampaignsData, aS as GoogleListCampaignsResponses, aT as GoogleListCampaignsErrors, aU as GoogleListConversionActionsData, aV as GoogleListConversionActionsResponses, aW as GoogleListConversionActionsErrors, aX as GoogleListConversionGoalsData, aY as GoogleListConversionGoalsResponses, aZ as GoogleListConversionGoalsErrors, a_ as GoogleListKeywordsData, a$ as GoogleListKeywordsResponses, b0 as GoogleListKeywordsErrors, b1 as GooglePauseAdData, b2 as GooglePauseAdResponses, b3 as GooglePauseAdErrors, b4 as GooglePauseAdGroupData, b5 as GooglePauseAdGroupResponses, b6 as GooglePauseAdGroupErrors, b7 as GooglePauseCampaignData, b8 as GooglePauseCampaignResponses, b9 as GooglePauseCampaignErrors, ba as GooglePauseKeywordData, bb as GooglePauseKeywordResponses, bc as GooglePauseKeywordErrors, bd as GoogleRunGaqlData, be as GoogleRunGaqlResponses, bf as GoogleRunGaqlErrors, bg as GoogleSetAdGroupBidsData, bh as GoogleSetAdGroupBidsResponses, bi as GoogleSetAdGroupBidsErrors, bj as GoogleSetConversionGoalData, bk as GoogleSetConversionGoalResponses, bl as GoogleSetConversionGoalErrors, bm as GoogleSetKeywordBidData, bn as GoogleSetKeywordBidResponses, bo as GoogleSetKeywordBidErrors, bp as GoogleUploadConversionsData, bq as GoogleUploadConversionsResponses, br as GoogleUploadConversionsErrors, bs as GoogleUploadImageAssetData, bt as GoogleUploadImageAssetResponses, bu as GoogleUploadImageAssetErrors, bv as LogsGetData, bw as LogsGetResponses, bx as LogsGetErrors, by as LogsListData, bz as LogsListResponses, bA as LogsListErrors, bB as MediaCreateData, bC as MediaCreateResponses, bD as MediaCreateErrors, bE as MediaDeleteData, bF as MediaDeleteResponses, bG as MediaDeleteErrors, bH as MediaGetData, bI as MediaGetResponses, bJ as MediaGetErrors, bK as MediaListData, bL as MediaListResponses, bM as MediaListErrors, bN as MediaUpdateData, bO as MediaUpdateResponses, bP as MediaUpdateErrors, bQ as MetaAccountData, bR as MetaAccountResponses, bS as MetaAccountErrors, bT as MetaAdData, bU as MetaAdResponses, bV as MetaAdErrors, bW as MetaAdsData, bX as MetaAdsResponses, bY as MetaAdsErrors, bZ as MetaAdsetData, b_ as MetaAdsetResponses, b$ as MetaAdsetErrors, c0 as MetaAdsetsData, c1 as MetaAdsetsResponses, c2 as MetaAdsetsErrors, c3 as MetaCampaignData, c4 as MetaCampaignResponses, c5 as MetaCampaignErrors, c6 as MetaCampaignsData, c7 as MetaCampaignsResponses, c8 as MetaCampaignsErrors, c9 as MetaInsightsData, ca as MetaInsightsResponses, cb as MetaInsightsErrors, cc as PostsCreateData, cd as PostsCreateResponses, ce as PostsCreateErrors, cf as PostsDeleteData, cg as PostsDeleteResponses, ch as PostsDeleteErrors, ci as PostsGetData, cj as PostsGetResponses, ck as PostsGetErrors, cl as PostsListData, cm as PostsListResponses, cn as PostsListErrors, co as PostsUpdateData, cp as PostsUpdateResponses, cq as PostsUpdateErrors, cr as PostsValidateData, cs as PostsValidateResponses, ct as PostsValidateErrors, cu as ProfilesCreateData, cv as ProfilesCreateResponses, cw as ProfilesCreateErrors, cx as ProfilesDeleteData, cy as ProfilesDeleteResponses, cz as ProfilesDeleteErrors, cA as ProfilesGetData, cB as ProfilesGetResponses, cC as ProfilesGetErrors, cD as ProfilesListData, cE as ProfilesListResponses, cF as ProfilesListErrors, cG as ProfilesUpdateData, cH as ProfilesUpdateResponses, cI as ProfilesUpdateErrors, cJ as TokensMintData, cK as TokensMintResponses, cL as TokensMintErrors, cM as WebhooksCreateEndpointData, cN as WebhooksCreateEndpointResponses, cO as WebhooksCreateEndpointErrors, cP as WebhooksCreatePortalData, cQ as WebhooksCreatePortalResponses, cR as WebhooksCreatePortalErrors, cS as WebhooksDeleteEndpointData, cT as WebhooksDeleteEndpointResponses, cU as WebhooksDeleteEndpointErrors, cV as WebhooksGetEndpointData, cW as WebhooksGetEndpointResponses, cX as WebhooksGetEndpointErrors, cY as WebhooksListEndpointsData, cZ as WebhooksListEndpointsResponses, c_ as WebhooksListEndpointsErrors, c$ as WebhooksListEventTypesData, d0 as WebhooksListEventTypesResponses, d1 as WebhooksListEventTypesErrors, d2 as WebhooksPingData, d3 as WebhooksPingResponses, d4 as WebhooksPingErrors, d5 as WebhooksUpdateEndpointData, d6 as WebhooksUpdateEndpointResponses, d7 as WebhooksUpdateEndpointErrors, d8 as ErrorCode, d9 as MediaGetResponse, da as ConnectionsConnectResponse, db as ConnectionsGetResponse, dc as ConnectionsListByProfileResponse, dd as MediaCreateResponse, de as ConnectionsListAccountsResponse, df as MediaListResponse, dg as PostsGetResponse, dh as PostsListResponse, di as PostsValidateResponse, dj as ProfilesGetResponse, dk as ProfilesListResponse } from './types.gen-0ufzFdld.cjs';
2
- export { dl as ClientOptions, dm as ConnectionsConnectError, dn as ConnectionsDeleteError, dp as ConnectionsDeleteResponse, dq as ConnectionsGetError, dr as ConnectionsListAccountsError, ds as ConnectionsListByProfileError, dt as ConnectionsSelectError, du as ConnectionsSelectResponse, dv as GoogleCreateAdError, dw as GoogleCreateAdGroupError, dx as GoogleCreateAdGroupResponse, dy as GoogleCreateAdResponse, dz as GoogleCreateBudgetError, dA as GoogleCreateBudgetResponse, dB as GoogleCreateCampaignError, dC as GoogleCreateCampaignResponse, dD as GoogleCreateConversionActionError, dE as GoogleCreateConversionActionResponse, dF as GoogleCreateDisplayAdError, dG as GoogleCreateDisplayAdResponse, dH as GoogleCreateKeywordError, dI as GoogleCreateKeywordResponse, dJ as GoogleDeleteAdError, dK as GoogleDeleteAdGroupError, dL as GoogleDeleteAdGroupResponse, dM as GoogleDeleteAdResponse, dN as GoogleDeleteBudgetError, dO as GoogleDeleteBudgetResponse, dP as GoogleDeleteCampaignError, dQ as GoogleDeleteCampaignResponse, dR as GoogleDeleteKeywordError, dS as GoogleDeleteKeywordResponse, dT as GoogleEditAdGroupError, dU as GoogleEditAdGroupResponse, dV as GoogleEditBudgetError, dW as GoogleEditBudgetResponse, dX as GoogleEditCampaignError, dY as GoogleEditCampaignResponse, dZ as GoogleEnableAdError, d_ as GoogleEnableAdGroupError, d$ as GoogleEnableAdGroupResponse, e0 as GoogleEnableAdResponse, e1 as GoogleEnableCampaignError, e2 as GoogleEnableCampaignResponse, e3 as GoogleEnableKeywordError, e4 as GoogleEnableKeywordResponse, e5 as GoogleGetAccountError, e6 as GoogleGetAccountResponse, e7 as GoogleGetAdError, e8 as GoogleGetAdGroupError, e9 as GoogleGetAdGroupResponse, ea as GoogleGetAdResponse, eb as GoogleGetCampaignError, ec as GoogleGetCampaignResponse, ed as GoogleGetConversionActionError, ee as GoogleGetConversionActionResponse, ef as GoogleGetInsightsError, eg as GoogleGetInsightsResponse, eh as GoogleGetKeywordError, ei as GoogleGetKeywordResponse, ej as GoogleListAdGroupsError, ek as GoogleListAdGroupsResponse, el as GoogleListAdsError, em as GoogleListAdsResponse, en as GoogleListCampaignsError, eo as GoogleListCampaignsResponse, ep as GoogleListConversionActionsError, eq as GoogleListConversionActionsResponse, er as GoogleListConversionGoalsError, es as GoogleListConversionGoalsResponse, et as GoogleListKeywordsError, eu as GoogleListKeywordsResponse, ev as GooglePauseAdError, ew as GooglePauseAdGroupError, ex as GooglePauseAdGroupResponse, ey as GooglePauseAdResponse, ez as GooglePauseCampaignError, eA as GooglePauseCampaignResponse, eB as GooglePauseKeywordError, eC as GooglePauseKeywordResponse, eD as GoogleRunGaqlError, eE as GoogleRunGaqlResponse, eF as GoogleSetAdGroupBidsError, eG as GoogleSetAdGroupBidsResponse, eH as GoogleSetConversionGoalError, eI as GoogleSetConversionGoalResponse, eJ as GoogleSetKeywordBidError, eK as GoogleSetKeywordBidResponse, eL as GoogleUploadConversionsError, eM as GoogleUploadConversionsResponse, eN as GoogleUploadImageAssetError, eO as GoogleUploadImageAssetResponse, eP as LogsGetError, eQ as LogsGetResponse, eR as LogsListError, eS as LogsListResponse, eT as MediaCreateError, eU as MediaDeleteError, eV as MediaDeleteResponse, eW as MediaGetError, eX as MediaListError, eY as MediaUpdateError, eZ as MediaUpdateResponse, e_ as MetaAccountError, e$ as MetaAccountResponse, f0 as MetaAdError, f1 as MetaAdResponse, f2 as MetaAdsError, f3 as MetaAdsResponse, f4 as MetaAdsetError, f5 as MetaAdsetResponse, f6 as MetaAdsetsError, f7 as MetaAdsetsResponse, f8 as MetaCampaignError, f9 as MetaCampaignResponse, fa as MetaCampaignsError, fb as MetaCampaignsResponse, fc as MetaInsightsError, fd as MetaInsightsResponse, fe as PostrunClient, ff as PostrunClientOptions, fg as PostsCreateError, fh as PostsCreateResponse, fi as PostsDeleteError, fj as PostsDeleteResponse, fk as PostsGetError, fl as PostsListError, fm as PostsUpdateError, fn as PostsUpdateResponse, fo as PostsValidateError, fp as ProfilesCreateError, fq as ProfilesCreateResponse, fr as ProfilesDeleteError, fs as ProfilesDeleteResponse, ft as ProfilesGetError, fu as ProfilesListError, fv as ProfilesUpdateError, fw as ProfilesUpdateResponse, fx as TokensMintError, fy as TokensMintResponse, fz as WebhooksCreateEndpointError, fA as WebhooksCreateEndpointResponse, fB as WebhooksCreatePortalError, fC as WebhooksCreatePortalResponse, fD as WebhooksDeleteEndpointError, fE as WebhooksDeleteEndpointResponse, fF as WebhooksGetEndpointError, fG as WebhooksGetEndpointResponse, fH as WebhooksListEndpointsError, fI as WebhooksListEndpointsResponse, fJ as WebhooksListEventTypesError, fK as WebhooksListEventTypesResponse, fL as WebhooksPingError, fM as WebhooksPingResponse, fN as WebhooksUpdateEndpointError, fO as WebhooksUpdateEndpointResponse, fP as createPostrunClient } from './types.gen-0ufzFdld.cjs';
1
+ import { T as TDataShape, O as Options$1, C as Client, a as ClientMeta, b as ConnectionsConnectData, R as RequestResult, c as ConnectionsConnectResponses, d as ConnectionsConnectErrors, e as ConnectionsDeleteData, f as ConnectionsDeleteResponses, g as ConnectionsDeleteErrors, h as ConnectionsGetData, i as ConnectionsGetResponses, j as ConnectionsGetErrors, k as ConnectionsListAccountsData, l as ConnectionsListAccountsResponses, m as ConnectionsListAccountsErrors, n as ConnectionsListByProfileData, o as ConnectionsListByProfileResponses, p as ConnectionsListByProfileErrors, q as ConnectionsSelectData, r as ConnectionsSelectResponses, s as ConnectionsSelectErrors, G as GoogleCreateAdData, t as GoogleCreateAdResponses, u as GoogleCreateAdErrors, v as GoogleCreateAdGroupData, w as GoogleCreateAdGroupResponses, x as GoogleCreateAdGroupErrors, y as GoogleCreateBudgetData, z as GoogleCreateBudgetResponses, A as GoogleCreateBudgetErrors, B as GoogleCreateCampaignData, D as GoogleCreateCampaignResponses, E as GoogleCreateCampaignErrors, F as GoogleCreateConversionActionData, H as GoogleCreateConversionActionResponses, I as GoogleCreateConversionActionErrors, J as GoogleCreateDisplayAdData, K as GoogleCreateDisplayAdResponses, L as GoogleCreateDisplayAdErrors, M as GoogleCreateKeywordData, N as GoogleCreateKeywordResponses, P as GoogleCreateKeywordErrors, Q as GoogleDeleteAdData, S as GoogleDeleteAdResponses, U as GoogleDeleteAdErrors, V as GoogleDeleteAdGroupData, W as GoogleDeleteAdGroupResponses, X as GoogleDeleteAdGroupErrors, Y as GoogleDeleteBudgetData, Z as GoogleDeleteBudgetResponses, _ as GoogleDeleteBudgetErrors, $ as GoogleDeleteCampaignData, a0 as GoogleDeleteCampaignResponses, a1 as GoogleDeleteCampaignErrors, a2 as GoogleDeleteKeywordData, a3 as GoogleDeleteKeywordResponses, a4 as GoogleDeleteKeywordErrors, a5 as GoogleEditAdGroupData, a6 as GoogleEditAdGroupResponses, a7 as GoogleEditAdGroupErrors, a8 as GoogleEditBudgetData, a9 as GoogleEditBudgetResponses, aa as GoogleEditBudgetErrors, ab as GoogleEditCampaignData, ac as GoogleEditCampaignResponses, ad as GoogleEditCampaignErrors, ae as GoogleEnableAdData, af as GoogleEnableAdResponses, ag as GoogleEnableAdErrors, ah as GoogleEnableAdGroupData, ai as GoogleEnableAdGroupResponses, aj as GoogleEnableAdGroupErrors, ak as GoogleEnableCampaignData, al as GoogleEnableCampaignResponses, am as GoogleEnableCampaignErrors, an as GoogleEnableKeywordData, ao as GoogleEnableKeywordResponses, ap as GoogleEnableKeywordErrors, aq as GoogleGetAccountData, ar as GoogleGetAccountResponses, as as GoogleGetAccountErrors, at as GoogleGetAdData, au as GoogleGetAdResponses, av as GoogleGetAdErrors, aw as GoogleGetAdGroupData, ax as GoogleGetAdGroupResponses, ay as GoogleGetAdGroupErrors, az as GoogleGetCampaignData, aA as GoogleGetCampaignResponses, aB as GoogleGetCampaignErrors, aC as GoogleGetConversionActionData, aD as GoogleGetConversionActionResponses, aE as GoogleGetConversionActionErrors, aF as GoogleGetInsightsData, aG as GoogleGetInsightsResponses, aH as GoogleGetInsightsErrors, aI as GoogleGetKeywordData, aJ as GoogleGetKeywordResponses, aK as GoogleGetKeywordErrors, aL as GoogleListAdGroupsData, aM as GoogleListAdGroupsResponses, aN as GoogleListAdGroupsErrors, aO as GoogleListAdsData, aP as GoogleListAdsResponses, aQ as GoogleListAdsErrors, aR as GoogleListCampaignsData, aS as GoogleListCampaignsResponses, aT as GoogleListCampaignsErrors, aU as GoogleListConversionActionsData, aV as GoogleListConversionActionsResponses, aW as GoogleListConversionActionsErrors, aX as GoogleListConversionGoalsData, aY as GoogleListConversionGoalsResponses, aZ as GoogleListConversionGoalsErrors, a_ as GoogleListKeywordsData, a$ as GoogleListKeywordsResponses, b0 as GoogleListKeywordsErrors, b1 as GooglePauseAdData, b2 as GooglePauseAdResponses, b3 as GooglePauseAdErrors, b4 as GooglePauseAdGroupData, b5 as GooglePauseAdGroupResponses, b6 as GooglePauseAdGroupErrors, b7 as GooglePauseCampaignData, b8 as GooglePauseCampaignResponses, b9 as GooglePauseCampaignErrors, ba as GooglePauseKeywordData, bb as GooglePauseKeywordResponses, bc as GooglePauseKeywordErrors, bd as GoogleRunGaqlData, be as GoogleRunGaqlResponses, bf as GoogleRunGaqlErrors, bg as GoogleSetAdGroupBidsData, bh as GoogleSetAdGroupBidsResponses, bi as GoogleSetAdGroupBidsErrors, bj as GoogleSetConversionGoalData, bk as GoogleSetConversionGoalResponses, bl as GoogleSetConversionGoalErrors, bm as GoogleSetKeywordBidData, bn as GoogleSetKeywordBidResponses, bo as GoogleSetKeywordBidErrors, bp as GoogleUploadConversionsData, bq as GoogleUploadConversionsResponses, br as GoogleUploadConversionsErrors, bs as GoogleUploadImageAssetData, bt as GoogleUploadImageAssetResponses, bu as GoogleUploadImageAssetErrors, bv as LogsGetData, bw as LogsGetResponses, bx as LogsGetErrors, by as LogsListData, bz as LogsListResponses, bA as LogsListErrors, bB as MediaCreateData, bC as MediaCreateResponses, bD as MediaCreateErrors, bE as MediaDeleteData, bF as MediaDeleteResponses, bG as MediaDeleteErrors, bH as MediaGetData, bI as MediaGetResponses, bJ as MediaGetErrors, bK as MediaListData, bL as MediaListResponses, bM as MediaListErrors, bN as MediaUpdateData, bO as MediaUpdateResponses, bP as MediaUpdateErrors, bQ as MetaAccountData, bR as MetaAccountResponses, bS as MetaAccountErrors, bT as MetaAdData, bU as MetaAdResponses, bV as MetaAdErrors, bW as MetaAdsData, bX as MetaAdsResponses, bY as MetaAdsErrors, bZ as MetaAdsetData, b_ as MetaAdsetResponses, b$ as MetaAdsetErrors, c0 as MetaAdsetsData, c1 as MetaAdsetsResponses, c2 as MetaAdsetsErrors, c3 as MetaCampaignData, c4 as MetaCampaignResponses, c5 as MetaCampaignErrors, c6 as MetaCampaignsData, c7 as MetaCampaignsResponses, c8 as MetaCampaignsErrors, c9 as MetaInsightsData, ca as MetaInsightsResponses, cb as MetaInsightsErrors, cc as PostsCreateData, cd as PostsCreateResponses, ce as PostsCreateErrors, cf as PostsDeleteData, cg as PostsDeleteResponses, ch as PostsDeleteErrors, ci as PostsGetData, cj as PostsGetResponses, ck as PostsGetErrors, cl as PostsListData, cm as PostsListResponses, cn as PostsListErrors, co as PostsUpdateData, cp as PostsUpdateResponses, cq as PostsUpdateErrors, cr as PostsValidateData, cs as PostsValidateResponses, ct as PostsValidateErrors, cu as ProfilesCreateData, cv as ProfilesCreateResponses, cw as ProfilesCreateErrors, cx as ProfilesDeleteData, cy as ProfilesDeleteResponses, cz as ProfilesDeleteErrors, cA as ProfilesGetData, cB as ProfilesGetResponses, cC as ProfilesGetErrors, cD as ProfilesListData, cE as ProfilesListResponses, cF as ProfilesListErrors, cG as ProfilesUpdateData, cH as ProfilesUpdateResponses, cI as ProfilesUpdateErrors, cJ as TiktokCreatorInfoData, cK as TiktokCreatorInfoResponses, cL as TiktokCreatorInfoErrors, cM as TokensMintData, cN as TokensMintResponses, cO as TokensMintErrors, cP as WebhooksCreateEndpointData, cQ as WebhooksCreateEndpointResponses, cR as WebhooksCreateEndpointErrors, cS as WebhooksCreatePortalData, cT as WebhooksCreatePortalResponses, cU as WebhooksCreatePortalErrors, cV as WebhooksDeleteEndpointData, cW as WebhooksDeleteEndpointResponses, cX as WebhooksDeleteEndpointErrors, cY as WebhooksGetEndpointData, cZ as WebhooksGetEndpointResponses, c_ as WebhooksGetEndpointErrors, c$ as WebhooksListEndpointsData, d0 as WebhooksListEndpointsResponses, d1 as WebhooksListEndpointsErrors, d2 as WebhooksListEventTypesData, d3 as WebhooksListEventTypesResponses, d4 as WebhooksListEventTypesErrors, d5 as WebhooksPingData, d6 as WebhooksPingResponses, d7 as WebhooksPingErrors, d8 as WebhooksUpdateEndpointData, d9 as WebhooksUpdateEndpointResponses, da as WebhooksUpdateEndpointErrors, db as ErrorCode, dc as MediaGetResponse, dd as ConnectionsConnectResponse, de as ConnectionsGetResponse, df as ConnectionsListByProfileResponse, dg as MediaCreateResponse, dh as ConnectionsListAccountsResponse, di as MediaListResponse, dj as PostsGetResponse, dk as PostsListResponse, dl as PostsValidateResponse, dm as ProfilesGetResponse, dn as ProfilesListResponse, dp as TiktokCreatorInfoResponse } from './types.gen-CzxuwPxe.cjs';
2
+ export { dq as ClientOptions, dr as ConnectionsConnectError, ds as ConnectionsDeleteError, dt as ConnectionsDeleteResponse, du as ConnectionsGetError, dv as ConnectionsListAccountsError, dw as ConnectionsListByProfileError, dx as ConnectionsSelectError, dy as ConnectionsSelectResponse, dz as GoogleCreateAdError, dA as GoogleCreateAdGroupError, dB as GoogleCreateAdGroupResponse, dC as GoogleCreateAdResponse, dD as GoogleCreateBudgetError, dE as GoogleCreateBudgetResponse, dF as GoogleCreateCampaignError, dG as GoogleCreateCampaignResponse, dH as GoogleCreateConversionActionError, dI as GoogleCreateConversionActionResponse, dJ as GoogleCreateDisplayAdError, dK as GoogleCreateDisplayAdResponse, dL as GoogleCreateKeywordError, dM as GoogleCreateKeywordResponse, dN as GoogleDeleteAdError, dO as GoogleDeleteAdGroupError, dP as GoogleDeleteAdGroupResponse, dQ as GoogleDeleteAdResponse, dR as GoogleDeleteBudgetError, dS as GoogleDeleteBudgetResponse, dT as GoogleDeleteCampaignError, dU as GoogleDeleteCampaignResponse, dV as GoogleDeleteKeywordError, dW as GoogleDeleteKeywordResponse, dX as GoogleEditAdGroupError, dY as GoogleEditAdGroupResponse, dZ as GoogleEditBudgetError, d_ as GoogleEditBudgetResponse, d$ as GoogleEditCampaignError, e0 as GoogleEditCampaignResponse, e1 as GoogleEnableAdError, e2 as GoogleEnableAdGroupError, e3 as GoogleEnableAdGroupResponse, e4 as GoogleEnableAdResponse, e5 as GoogleEnableCampaignError, e6 as GoogleEnableCampaignResponse, e7 as GoogleEnableKeywordError, e8 as GoogleEnableKeywordResponse, e9 as GoogleGetAccountError, ea as GoogleGetAccountResponse, eb as GoogleGetAdError, ec as GoogleGetAdGroupError, ed as GoogleGetAdGroupResponse, ee as GoogleGetAdResponse, ef as GoogleGetCampaignError, eg as GoogleGetCampaignResponse, eh as GoogleGetConversionActionError, ei as GoogleGetConversionActionResponse, ej as GoogleGetInsightsError, ek as GoogleGetInsightsResponse, el as GoogleGetKeywordError, em as GoogleGetKeywordResponse, en as GoogleListAdGroupsError, eo as GoogleListAdGroupsResponse, ep as GoogleListAdsError, eq as GoogleListAdsResponse, er as GoogleListCampaignsError, es as GoogleListCampaignsResponse, et as GoogleListConversionActionsError, eu as GoogleListConversionActionsResponse, ev as GoogleListConversionGoalsError, ew as GoogleListConversionGoalsResponse, ex as GoogleListKeywordsError, ey as GoogleListKeywordsResponse, ez as GooglePauseAdError, eA as GooglePauseAdGroupError, eB as GooglePauseAdGroupResponse, eC as GooglePauseAdResponse, eD as GooglePauseCampaignError, eE as GooglePauseCampaignResponse, eF as GooglePauseKeywordError, eG as GooglePauseKeywordResponse, eH as GoogleRunGaqlError, eI as GoogleRunGaqlResponse, eJ as GoogleSetAdGroupBidsError, eK as GoogleSetAdGroupBidsResponse, eL as GoogleSetConversionGoalError, eM as GoogleSetConversionGoalResponse, eN as GoogleSetKeywordBidError, eO as GoogleSetKeywordBidResponse, eP as GoogleUploadConversionsError, eQ as GoogleUploadConversionsResponse, eR as GoogleUploadImageAssetError, eS as GoogleUploadImageAssetResponse, eT as LogsGetError, eU as LogsGetResponse, eV as LogsListError, eW as LogsListResponse, eX as MediaCreateError, eY as MediaDeleteError, eZ as MediaDeleteResponse, e_ as MediaGetError, e$ as MediaListError, f0 as MediaUpdateError, f1 as MediaUpdateResponse, f2 as MetaAccountError, f3 as MetaAccountResponse, f4 as MetaAdError, f5 as MetaAdResponse, f6 as MetaAdsError, f7 as MetaAdsResponse, f8 as MetaAdsetError, f9 as MetaAdsetResponse, fa as MetaAdsetsError, fb as MetaAdsetsResponse, fc as MetaCampaignError, fd as MetaCampaignResponse, fe as MetaCampaignsError, ff as MetaCampaignsResponse, fg as MetaInsightsError, fh as MetaInsightsResponse, fi as PostrunClient, fj as PostrunClientOptions, fk as PostsCreateError, fl as PostsCreateResponse, fm as PostsDeleteError, fn as PostsDeleteResponse, fo as PostsGetError, fp as PostsListError, fq as PostsUpdateError, fr as PostsUpdateResponse, fs as PostsValidateError, ft as ProfilesCreateError, fu as ProfilesCreateResponse, fv as ProfilesDeleteError, fw as ProfilesDeleteResponse, fx as ProfilesGetError, fy as ProfilesListError, fz as ProfilesUpdateError, fA as ProfilesUpdateResponse, fB as TiktokCreatorInfoError, fC as TokensMintError, fD as TokensMintResponse, fE as WebhooksCreateEndpointError, fF as WebhooksCreateEndpointResponse, fG as WebhooksCreatePortalError, fH as WebhooksCreatePortalResponse, fI as WebhooksDeleteEndpointError, fJ as WebhooksDeleteEndpointResponse, fK as WebhooksGetEndpointError, fL as WebhooksGetEndpointResponse, fM as WebhooksListEndpointsError, fN as WebhooksListEndpointsResponse, fO as WebhooksListEventTypesError, fP as WebhooksListEventTypesResponse, fQ as WebhooksPingError, fR as WebhooksPingResponse, fS as WebhooksUpdateEndpointError, fT as WebhooksUpdateEndpointResponse, fU as createPostrunClient } from './types.gen-CzxuwPxe.cjs';
3
3
  import * as z from 'zod';
4
4
 
5
5
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
@@ -591,6 +591,14 @@ declare const googleUploadConversions: <ThrowOnError extends boolean = true>(opt
591
591
  * Uploads a Postrun image asset (its validated Google Ads rendition) to the connection’s account as an `image` asset, returning the new resource id + resource_name to chain into an ad/asset assembly. Pass `dry_run: true` to validate against Google without creating anything (Google’s native validate_only). The media asset must have a ready Google Ads rendition, else a 409.
592
592
  */
593
593
  declare const googleUploadImageAsset: <ThrowOnError extends boolean = true>(options: Options<GoogleUploadImageAssetData, ThrowOnError>) => RequestResult<GoogleUploadImageAssetResponses, GoogleUploadImageAssetErrors, ThrowOnError>;
594
+ /**
595
+ * Retrieve TikTok creator info
596
+ *
597
+ * **Authentication.** Secret `pr_` API key, or a browser-safe frontend token granting `connections:read` scoped to the profile that owns the connection.
598
+ *
599
+ * Retrieves the TikTok creator's publish options live from TikTok — required by TikTok's Content Posting policy to render the publishing UI: the creator nickname + avatar, the privacy options to offer (with no default), and the Comment/Duet/Stitch flags to disable. Returns 404 if the connection does not exist in your account or is not a TikTok connection, 409 if the TikTok account must be reconnected, and 502 if TikTok’s creator-info call fails.
600
+ */
601
+ declare const tiktokCreatorInfo: <ThrowOnError extends boolean = true>(options: Options<TiktokCreatorInfoData, ThrowOnError>) => RequestResult<TiktokCreatorInfoResponses, TiktokCreatorInfoErrors, ThrowOnError>;
594
602
  /**
595
603
  * List request logs
596
604
  *
@@ -760,6 +768,22 @@ type ConnectSession = ConnectionsConnectResponse;
760
768
  type ConnectablePlatform = NonNullable<ConnectionsConnectData['body']>['platform'];
761
769
  /** Accounts discoverable on a pending connection, for the selection step. */
762
770
  type DiscoverableAccountList = ConnectionsListAccountsResponse;
771
+ /**
772
+ * A TikTok creator's live publish options for a connection — the data TikTok's
773
+ * Content Posting policy REQUIRES the publishing UI to render: `creator`
774
+ * (nickname + avatar), the `privacy_options` to offer (with NO default), the
775
+ * positive `interaction` (allowed) flags for Comment/Duet/Stitch toggles, and
776
+ * `max_video_duration_sec`. Derived from the contract, never hand-declared.
777
+ */
778
+ type TikTokCreatorInfo = TiktokCreatorInfoResponse;
779
+ /**
780
+ * One TikTok privacy level — a member of the closed audience union
781
+ * (`PUBLIC_TO_EVERYONE` / `MUTUAL_FOLLOW_FRIENDS` / `FOLLOWER_OF_CREATOR` /
782
+ * `SELF_ONLY`). The per-account ALLOWED subset is `TikTokCreatorInfo.privacy_options`;
783
+ * this is one value from it (what you bind a dropdown option to). Derived from
784
+ * the contract, never hand-declared; render it with {@link tiktokPrivacyLabel}.
785
+ */
786
+ type TikTokPrivacyLevel = TikTokCreatorInfo['privacy_options'][number];
763
787
  /** Request body to select an account on a pending connection. */
764
788
  type SelectAccountInput = NonNullable<ConnectionsSelectData['body']>;
765
789
  /** The create/update post body, derived from the contract. */
@@ -785,6 +809,35 @@ type LinkedInPostVariant = Extract<PostVariantInput, {
785
809
  }>;
786
810
  /** A post — its variants, schedule, and derived status (the read resource). */
787
811
  type Post = PostsGetResponse;
812
+ /**
813
+ * One per-platform variant on a RETURNED post (the read resource): its own
814
+ * `status`, a typed `error` ({@link PostVariantError}) when it failed, and a
815
+ * `result` (platform id + permalink) when it published. Derived from the post
816
+ * resource, never hand-declared. (For inspecting compose-time native `settings`,
817
+ * prefer {@link PostVariantInput}; on read `settings` is opaque.)
818
+ */
819
+ type PostVariant = Post['variants'][number];
820
+ /**
821
+ * A variant's typed publish failure — `{ code, message }`. The `code` is the
822
+ * adapter's own minted reason (`x_access_not_permitted`, `linkedin_auth_expired`,
823
+ * …); it stays a `string` because adapter codes are minted outside the API's
824
+ * closed registry. Derived from the variant, never hand-declared.
825
+ */
826
+ type PostVariantError = NonNullable<PostVariant['error']>;
827
+ /**
828
+ * Did the post fully publish? `true` ONLY when the rollup `status` is
829
+ * `'published'` — `partially_published` and `failed` are NOT success. The single
830
+ * pure predicate every surface (SDK, React hook, composer) shares, so "success"
831
+ * has exactly one definition.
832
+ */
833
+ declare const isPublished: (post: Post) => boolean;
834
+ /**
835
+ * The variants that FAILED to publish, each carrying its typed {@link
836
+ * PostVariantError}. Empty when none failed. The pure helper behind
837
+ * `useCreatePost().failedVariants` — usable directly from a non-React caller so
838
+ * the "which platforms failed, and why" projection has one definition.
839
+ */
840
+ declare const failedVariants: (post: Post) => PostVariant[];
788
841
  /** A page of posts (the calendar/queue list). */
789
842
  type PostList = PostsListResponse;
790
843
  /** Query parameters for listing posts (filters + pagination). */
@@ -877,6 +930,18 @@ type Metadata = NonNullable<CreateMediaInput['metadata']>;
877
930
  */
878
931
  type MetadataFilter = NonNullable<ListMediaQuery['metadata']>;
879
932
 
933
+ /**
934
+ * Map a TikTok privacy level to a short, human label for the composer's privacy
935
+ * dropdown — the presentation the API deliberately keeps OFF the wire (the
936
+ * `creator-info` response returns the typed `privacy_options`; the SDK owns how
937
+ * they read).
938
+ *
939
+ * Exhaustive over the closed `TikTokPrivacyLevel` union with no `default` branch,
940
+ * so adding a TikTok privacy level upstream surfaces as a compile error here
941
+ * rather than silently rendering a raw enum string.
942
+ */
943
+ declare function tiktokPrivacyLabel(value: TikTokPrivacyLevel): string;
944
+
880
945
  /** A media attachment — the uploaded asset (or just its id + kind). */
881
946
  type MediaInput = Pick<MediaResource, 'id' | 'kind'>;
882
947
  /** Base content, shared across channels unless a channel overrides it. */
@@ -959,4 +1024,4 @@ declare function buildCreatePost(input: ComposePostInput, connections: readonly
959
1024
  */
960
1025
  declare function buildUpdatePost(input: ComposeUpdateInput, connections?: readonly ConnectionRef[]): UpdatePostInput;
961
1026
 
962
- export { type ChannelConfig, type Channels, ComposeError, type ComposePostInput, type ComposeUpdateInput, type ConnectSession, type ConnectablePlatform, type Connection, type ConnectionKind, type ConnectionList, type ConnectionRef, type ConnectionStatus, ConnectionsConnectData, ConnectionsConnectErrors, ConnectionsConnectResponse, ConnectionsConnectResponses, ConnectionsDeleteData, ConnectionsDeleteErrors, ConnectionsDeleteResponses, ConnectionsGetData, ConnectionsGetErrors, ConnectionsGetResponse, ConnectionsGetResponses, ConnectionsListAccountsData, ConnectionsListAccountsErrors, ConnectionsListAccountsResponse, ConnectionsListAccountsResponses, ConnectionsListByProfileData, ConnectionsListByProfileErrors, ConnectionsListByProfileResponse, ConnectionsListByProfileResponses, ConnectionsSelectData, ConnectionsSelectErrors, ConnectionsSelectResponses, type CreateMediaInput, type CreateMediaResult, type CreatePostInput, type CreateProfileInput, type DiscoverableAccountList, ErrorCode, GoogleCreateAdData, GoogleCreateAdErrors, GoogleCreateAdGroupData, GoogleCreateAdGroupErrors, GoogleCreateAdGroupResponses, GoogleCreateAdResponses, GoogleCreateBudgetData, GoogleCreateBudgetErrors, GoogleCreateBudgetResponses, GoogleCreateCampaignData, GoogleCreateCampaignErrors, GoogleCreateCampaignResponses, GoogleCreateConversionActionData, GoogleCreateConversionActionErrors, GoogleCreateConversionActionResponses, GoogleCreateDisplayAdData, GoogleCreateDisplayAdErrors, GoogleCreateDisplayAdResponses, GoogleCreateKeywordData, GoogleCreateKeywordErrors, GoogleCreateKeywordResponses, GoogleDeleteAdData, GoogleDeleteAdErrors, GoogleDeleteAdGroupData, GoogleDeleteAdGroupErrors, GoogleDeleteAdGroupResponses, GoogleDeleteAdResponses, GoogleDeleteBudgetData, GoogleDeleteBudgetErrors, GoogleDeleteBudgetResponses, GoogleDeleteCampaignData, GoogleDeleteCampaignErrors, GoogleDeleteCampaignResponses, GoogleDeleteKeywordData, GoogleDeleteKeywordErrors, GoogleDeleteKeywordResponses, GoogleEditAdGroupData, GoogleEditAdGroupErrors, GoogleEditAdGroupResponses, GoogleEditBudgetData, GoogleEditBudgetErrors, GoogleEditBudgetResponses, GoogleEditCampaignData, GoogleEditCampaignErrors, GoogleEditCampaignResponses, GoogleEnableAdData, GoogleEnableAdErrors, GoogleEnableAdGroupData, GoogleEnableAdGroupErrors, GoogleEnableAdGroupResponses, GoogleEnableAdResponses, GoogleEnableCampaignData, GoogleEnableCampaignErrors, GoogleEnableCampaignResponses, GoogleEnableKeywordData, GoogleEnableKeywordErrors, GoogleEnableKeywordResponses, GoogleGetAccountData, GoogleGetAccountErrors, GoogleGetAccountResponses, GoogleGetAdData, GoogleGetAdErrors, GoogleGetAdGroupData, GoogleGetAdGroupErrors, GoogleGetAdGroupResponses, GoogleGetAdResponses, GoogleGetCampaignData, GoogleGetCampaignErrors, GoogleGetCampaignResponses, GoogleGetConversionActionData, GoogleGetConversionActionErrors, GoogleGetConversionActionResponses, GoogleGetInsightsData, GoogleGetInsightsErrors, GoogleGetInsightsResponses, GoogleGetKeywordData, GoogleGetKeywordErrors, GoogleGetKeywordResponses, GoogleListAdGroupsData, GoogleListAdGroupsErrors, GoogleListAdGroupsResponses, GoogleListAdsData, GoogleListAdsErrors, GoogleListAdsResponses, GoogleListCampaignsData, GoogleListCampaignsErrors, GoogleListCampaignsResponses, GoogleListConversionActionsData, GoogleListConversionActionsErrors, GoogleListConversionActionsResponses, GoogleListConversionGoalsData, GoogleListConversionGoalsErrors, GoogleListConversionGoalsResponses, GoogleListKeywordsData, GoogleListKeywordsErrors, GoogleListKeywordsResponses, GooglePauseAdData, GooglePauseAdErrors, GooglePauseAdGroupData, GooglePauseAdGroupErrors, GooglePauseAdGroupResponses, GooglePauseAdResponses, GooglePauseCampaignData, GooglePauseCampaignErrors, GooglePauseCampaignResponses, GooglePauseKeywordData, GooglePauseKeywordErrors, GooglePauseKeywordResponses, GoogleRunGaqlData, GoogleRunGaqlErrors, GoogleRunGaqlResponses, GoogleSetAdGroupBidsData, GoogleSetAdGroupBidsErrors, GoogleSetAdGroupBidsResponses, GoogleSetConversionGoalData, GoogleSetConversionGoalErrors, GoogleSetConversionGoalResponses, GoogleSetKeywordBidData, GoogleSetKeywordBidErrors, GoogleSetKeywordBidResponses, GoogleUploadConversionsData, GoogleUploadConversionsErrors, GoogleUploadConversionsResponses, GoogleUploadImageAssetData, GoogleUploadImageAssetErrors, GoogleUploadImageAssetResponses, type LinkedInPostVariant, type ListConnectionsQuery, type ListMediaQuery, type ListPostsQuery, type ListProfilesQuery, LogsGetData, LogsGetErrors, LogsGetResponses, LogsListData, LogsListErrors, LogsListResponses, MediaCreateData, MediaCreateErrors, MediaCreateResponse, MediaCreateResponses, MediaDeleteData, MediaDeleteErrors, MediaDeleteResponses, MediaGetData, MediaGetErrors, MediaGetResponse, MediaGetResponses, type MediaInput, type MediaKind, type MediaList, MediaListData, MediaListErrors, MediaListResponse, MediaListResponses, type MediaResource, type MediaStatus, type MediaTarget, MediaUpdateData, MediaUpdateErrors, MediaUpdateResponses, MetaAccountData, MetaAccountErrors, MetaAccountResponses, MetaAdData, MetaAdErrors, MetaAdResponses, MetaAdsData, MetaAdsErrors, MetaAdsResponses, MetaAdsetData, MetaAdsetErrors, MetaAdsetResponses, MetaAdsetsData, MetaAdsetsErrors, MetaAdsetsResponses, MetaCampaignData, MetaCampaignErrors, MetaCampaignResponses, MetaCampaignsData, MetaCampaignsErrors, MetaCampaignsResponses, MetaInsightsData, MetaInsightsErrors, MetaInsightsResponses, type Metadata, type MetadataFilter, type Options, POST_PLATFORMS, type Post, type PostContent, type PostList, type PostMetadata, type PostPlatform, type PostStatus, type PostTypeFor, type PostValidation, type PostVariantInput, PostrunError, type PostrunErrorCode, type PostrunFieldError, type PostrunProblem, PostsCreateData, PostsCreateErrors, PostsCreateResponses, PostsDeleteData, PostsDeleteErrors, PostsDeleteResponses, PostsGetData, PostsGetErrors, PostsGetResponse, PostsGetResponses, PostsListData, PostsListErrors, PostsListResponse, PostsListResponses, PostsUpdateData, PostsUpdateErrors, PostsUpdateResponses, PostsValidateData, PostsValidateErrors, PostsValidateResponse, PostsValidateResponses, type Profile, type ProfileList, ProfilesCreateData, ProfilesCreateErrors, ProfilesCreateResponses, ProfilesDeleteData, ProfilesDeleteErrors, ProfilesDeleteResponses, ProfilesGetData, ProfilesGetErrors, ProfilesGetResponse, ProfilesGetResponses, ProfilesListData, ProfilesListErrors, ProfilesListResponse, ProfilesListResponses, ProfilesUpdateData, ProfilesUpdateErrors, ProfilesUpdateResponses, type PublishMode, type SelectAccountInput, type SettingsFor, TokensMintData, TokensMintErrors, TokensMintResponses, type UpdateMediaInput, type UpdatePostInput, type UpdateProfileInput, type UploadTarget, type ValidatePostInput, type ValidationIssue, WebhooksCreateEndpointData, WebhooksCreateEndpointErrors, WebhooksCreateEndpointResponses, WebhooksCreatePortalData, WebhooksCreatePortalErrors, WebhooksCreatePortalResponses, WebhooksDeleteEndpointData, WebhooksDeleteEndpointErrors, WebhooksDeleteEndpointResponses, WebhooksGetEndpointData, WebhooksGetEndpointErrors, WebhooksGetEndpointResponses, WebhooksListEndpointsData, WebhooksListEndpointsErrors, WebhooksListEndpointsResponses, WebhooksListEventTypesData, WebhooksListEventTypesErrors, WebhooksListEventTypesResponses, WebhooksPingData, WebhooksPingErrors, WebhooksPingResponses, WebhooksUpdateEndpointData, WebhooksUpdateEndpointErrors, WebhooksUpdateEndpointResponses, type XPostVariant, buildCreatePost, buildUpdatePost, connectionsConnect, connectionsDelete, connectionsGet, connectionsListAccounts, connectionsListByProfile, connectionsSelect, googleCreateAd, googleCreateAdGroup, googleCreateBudget, googleCreateCampaign, googleCreateConversionAction, googleCreateDisplayAd, googleCreateKeyword, googleDeleteAd, googleDeleteAdGroup, googleDeleteBudget, googleDeleteCampaign, googleDeleteKeyword, googleEditAdGroup, googleEditBudget, googleEditCampaign, googleEnableAd, googleEnableAdGroup, googleEnableCampaign, googleEnableKeyword, googleGetAccount, googleGetAd, googleGetAdGroup, googleGetCampaign, googleGetConversionAction, googleGetInsights, googleGetKeyword, googleListAdGroups, googleListAds, googleListCampaigns, googleListConversionActions, googleListConversionGoals, googleListKeywords, googlePauseAd, googlePauseAdGroup, googlePauseCampaign, googlePauseKeyword, googleRunGaql, googleSetAdGroupBids, googleSetConversionGoal, googleSetKeywordBid, googleUploadConversions, googleUploadImageAsset, isPostPlatform, logsGet, logsList, mediaCreate, mediaDelete, mediaGet, mediaList, mediaUpdate, metaAccount, metaAd, metaAds, metaAdset, metaAdsets, metaCampaign, metaCampaigns, metaInsights, postsCreate, postsDelete, postsGet, postsList, postsUpdate, postsValidate, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint };
1027
+ export { type ChannelConfig, type Channels, ComposeError, type ComposePostInput, type ComposeUpdateInput, type ConnectSession, type ConnectablePlatform, type Connection, type ConnectionKind, type ConnectionList, type ConnectionRef, type ConnectionStatus, ConnectionsConnectData, ConnectionsConnectErrors, ConnectionsConnectResponse, ConnectionsConnectResponses, ConnectionsDeleteData, ConnectionsDeleteErrors, ConnectionsDeleteResponses, ConnectionsGetData, ConnectionsGetErrors, ConnectionsGetResponse, ConnectionsGetResponses, ConnectionsListAccountsData, ConnectionsListAccountsErrors, ConnectionsListAccountsResponse, ConnectionsListAccountsResponses, ConnectionsListByProfileData, ConnectionsListByProfileErrors, ConnectionsListByProfileResponse, ConnectionsListByProfileResponses, ConnectionsSelectData, ConnectionsSelectErrors, ConnectionsSelectResponses, type CreateMediaInput, type CreateMediaResult, type CreatePostInput, type CreateProfileInput, type DiscoverableAccountList, ErrorCode, GoogleCreateAdData, GoogleCreateAdErrors, GoogleCreateAdGroupData, GoogleCreateAdGroupErrors, GoogleCreateAdGroupResponses, GoogleCreateAdResponses, GoogleCreateBudgetData, GoogleCreateBudgetErrors, GoogleCreateBudgetResponses, GoogleCreateCampaignData, GoogleCreateCampaignErrors, GoogleCreateCampaignResponses, GoogleCreateConversionActionData, GoogleCreateConversionActionErrors, GoogleCreateConversionActionResponses, GoogleCreateDisplayAdData, GoogleCreateDisplayAdErrors, GoogleCreateDisplayAdResponses, GoogleCreateKeywordData, GoogleCreateKeywordErrors, GoogleCreateKeywordResponses, GoogleDeleteAdData, GoogleDeleteAdErrors, GoogleDeleteAdGroupData, GoogleDeleteAdGroupErrors, GoogleDeleteAdGroupResponses, GoogleDeleteAdResponses, GoogleDeleteBudgetData, GoogleDeleteBudgetErrors, GoogleDeleteBudgetResponses, GoogleDeleteCampaignData, GoogleDeleteCampaignErrors, GoogleDeleteCampaignResponses, GoogleDeleteKeywordData, GoogleDeleteKeywordErrors, GoogleDeleteKeywordResponses, GoogleEditAdGroupData, GoogleEditAdGroupErrors, GoogleEditAdGroupResponses, GoogleEditBudgetData, GoogleEditBudgetErrors, GoogleEditBudgetResponses, GoogleEditCampaignData, GoogleEditCampaignErrors, GoogleEditCampaignResponses, GoogleEnableAdData, GoogleEnableAdErrors, GoogleEnableAdGroupData, GoogleEnableAdGroupErrors, GoogleEnableAdGroupResponses, GoogleEnableAdResponses, GoogleEnableCampaignData, GoogleEnableCampaignErrors, GoogleEnableCampaignResponses, GoogleEnableKeywordData, GoogleEnableKeywordErrors, GoogleEnableKeywordResponses, GoogleGetAccountData, GoogleGetAccountErrors, GoogleGetAccountResponses, GoogleGetAdData, GoogleGetAdErrors, GoogleGetAdGroupData, GoogleGetAdGroupErrors, GoogleGetAdGroupResponses, GoogleGetAdResponses, GoogleGetCampaignData, GoogleGetCampaignErrors, GoogleGetCampaignResponses, GoogleGetConversionActionData, GoogleGetConversionActionErrors, GoogleGetConversionActionResponses, GoogleGetInsightsData, GoogleGetInsightsErrors, GoogleGetInsightsResponses, GoogleGetKeywordData, GoogleGetKeywordErrors, GoogleGetKeywordResponses, GoogleListAdGroupsData, GoogleListAdGroupsErrors, GoogleListAdGroupsResponses, GoogleListAdsData, GoogleListAdsErrors, GoogleListAdsResponses, GoogleListCampaignsData, GoogleListCampaignsErrors, GoogleListCampaignsResponses, GoogleListConversionActionsData, GoogleListConversionActionsErrors, GoogleListConversionActionsResponses, GoogleListConversionGoalsData, GoogleListConversionGoalsErrors, GoogleListConversionGoalsResponses, GoogleListKeywordsData, GoogleListKeywordsErrors, GoogleListKeywordsResponses, GooglePauseAdData, GooglePauseAdErrors, GooglePauseAdGroupData, GooglePauseAdGroupErrors, GooglePauseAdGroupResponses, GooglePauseAdResponses, GooglePauseCampaignData, GooglePauseCampaignErrors, GooglePauseCampaignResponses, GooglePauseKeywordData, GooglePauseKeywordErrors, GooglePauseKeywordResponses, GoogleRunGaqlData, GoogleRunGaqlErrors, GoogleRunGaqlResponses, GoogleSetAdGroupBidsData, GoogleSetAdGroupBidsErrors, GoogleSetAdGroupBidsResponses, GoogleSetConversionGoalData, GoogleSetConversionGoalErrors, GoogleSetConversionGoalResponses, GoogleSetKeywordBidData, GoogleSetKeywordBidErrors, GoogleSetKeywordBidResponses, GoogleUploadConversionsData, GoogleUploadConversionsErrors, GoogleUploadConversionsResponses, GoogleUploadImageAssetData, GoogleUploadImageAssetErrors, GoogleUploadImageAssetResponses, type LinkedInPostVariant, type ListConnectionsQuery, type ListMediaQuery, type ListPostsQuery, type ListProfilesQuery, LogsGetData, LogsGetErrors, LogsGetResponses, LogsListData, LogsListErrors, LogsListResponses, MediaCreateData, MediaCreateErrors, MediaCreateResponse, MediaCreateResponses, MediaDeleteData, MediaDeleteErrors, MediaDeleteResponses, MediaGetData, MediaGetErrors, MediaGetResponse, MediaGetResponses, type MediaInput, type MediaKind, type MediaList, MediaListData, MediaListErrors, MediaListResponse, MediaListResponses, type MediaResource, type MediaStatus, type MediaTarget, MediaUpdateData, MediaUpdateErrors, MediaUpdateResponses, MetaAccountData, MetaAccountErrors, MetaAccountResponses, MetaAdData, MetaAdErrors, MetaAdResponses, MetaAdsData, MetaAdsErrors, MetaAdsResponses, MetaAdsetData, MetaAdsetErrors, MetaAdsetResponses, MetaAdsetsData, MetaAdsetsErrors, MetaAdsetsResponses, MetaCampaignData, MetaCampaignErrors, MetaCampaignResponses, MetaCampaignsData, MetaCampaignsErrors, MetaCampaignsResponses, MetaInsightsData, MetaInsightsErrors, MetaInsightsResponses, type Metadata, type MetadataFilter, type Options, POST_PLATFORMS, type Post, type PostContent, type PostList, type PostMetadata, type PostPlatform, type PostStatus, type PostTypeFor, type PostValidation, type PostVariant, type PostVariantError, type PostVariantInput, PostrunError, type PostrunErrorCode, type PostrunFieldError, type PostrunProblem, PostsCreateData, PostsCreateErrors, PostsCreateResponses, PostsDeleteData, PostsDeleteErrors, PostsDeleteResponses, PostsGetData, PostsGetErrors, PostsGetResponse, PostsGetResponses, PostsListData, PostsListErrors, PostsListResponse, PostsListResponses, PostsUpdateData, PostsUpdateErrors, PostsUpdateResponses, PostsValidateData, PostsValidateErrors, PostsValidateResponse, PostsValidateResponses, type Profile, type ProfileList, ProfilesCreateData, ProfilesCreateErrors, ProfilesCreateResponses, ProfilesDeleteData, ProfilesDeleteErrors, ProfilesDeleteResponses, ProfilesGetData, ProfilesGetErrors, ProfilesGetResponse, ProfilesGetResponses, ProfilesListData, ProfilesListErrors, ProfilesListResponse, ProfilesListResponses, ProfilesUpdateData, ProfilesUpdateErrors, ProfilesUpdateResponses, type PublishMode, type SelectAccountInput, type SettingsFor, type TikTokCreatorInfo, type TikTokPrivacyLevel, TiktokCreatorInfoData, TiktokCreatorInfoErrors, TiktokCreatorInfoResponse, TiktokCreatorInfoResponses, TokensMintData, TokensMintErrors, TokensMintResponses, type UpdateMediaInput, type UpdatePostInput, type UpdateProfileInput, type UploadTarget, type ValidatePostInput, type ValidationIssue, WebhooksCreateEndpointData, WebhooksCreateEndpointErrors, WebhooksCreateEndpointResponses, WebhooksCreatePortalData, WebhooksCreatePortalErrors, WebhooksCreatePortalResponses, WebhooksDeleteEndpointData, WebhooksDeleteEndpointErrors, WebhooksDeleteEndpointResponses, WebhooksGetEndpointData, WebhooksGetEndpointErrors, WebhooksGetEndpointResponses, WebhooksListEndpointsData, WebhooksListEndpointsErrors, WebhooksListEndpointsResponses, WebhooksListEventTypesData, WebhooksListEventTypesErrors, WebhooksListEventTypesResponses, WebhooksPingData, WebhooksPingErrors, WebhooksPingResponses, WebhooksUpdateEndpointData, WebhooksUpdateEndpointErrors, WebhooksUpdateEndpointResponses, type XPostVariant, buildCreatePost, buildUpdatePost, connectionsConnect, connectionsDelete, connectionsGet, connectionsListAccounts, connectionsListByProfile, connectionsSelect, failedVariants, googleCreateAd, googleCreateAdGroup, googleCreateBudget, googleCreateCampaign, googleCreateConversionAction, googleCreateDisplayAd, googleCreateKeyword, googleDeleteAd, googleDeleteAdGroup, googleDeleteBudget, googleDeleteCampaign, googleDeleteKeyword, googleEditAdGroup, googleEditBudget, googleEditCampaign, googleEnableAd, googleEnableAdGroup, googleEnableCampaign, googleEnableKeyword, googleGetAccount, googleGetAd, googleGetAdGroup, googleGetCampaign, googleGetConversionAction, googleGetInsights, googleGetKeyword, googleListAdGroups, googleListAds, googleListCampaigns, googleListConversionActions, googleListConversionGoals, googleListKeywords, googlePauseAd, googlePauseAdGroup, googlePauseCampaign, googlePauseKeyword, googleRunGaql, googleSetAdGroupBids, googleSetConversionGoal, googleSetKeywordBid, googleUploadConversions, googleUploadImageAsset, isPostPlatform, isPublished, logsGet, logsList, mediaCreate, mediaDelete, mediaGet, mediaList, mediaUpdate, metaAccount, metaAd, metaAds, metaAdset, metaAdsets, metaCampaign, metaCampaigns, metaInsights, postsCreate, postsDelete, postsGet, postsList, postsUpdate, postsValidate, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tiktokCreatorInfo, tiktokPrivacyLabel, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TDataShape, O as Options$1, C as Client, a as ClientMeta, b as ConnectionsConnectData, R as RequestResult, c as ConnectionsConnectResponses, d as ConnectionsConnectErrors, e as ConnectionsDeleteData, f as ConnectionsDeleteResponses, g as ConnectionsDeleteErrors, h as ConnectionsGetData, i as ConnectionsGetResponses, j as ConnectionsGetErrors, k as ConnectionsListAccountsData, l as ConnectionsListAccountsResponses, m as ConnectionsListAccountsErrors, n as ConnectionsListByProfileData, o as ConnectionsListByProfileResponses, p as ConnectionsListByProfileErrors, q as ConnectionsSelectData, r as ConnectionsSelectResponses, s as ConnectionsSelectErrors, G as GoogleCreateAdData, t as GoogleCreateAdResponses, u as GoogleCreateAdErrors, v as GoogleCreateAdGroupData, w as GoogleCreateAdGroupResponses, x as GoogleCreateAdGroupErrors, y as GoogleCreateBudgetData, z as GoogleCreateBudgetResponses, A as GoogleCreateBudgetErrors, B as GoogleCreateCampaignData, D as GoogleCreateCampaignResponses, E as GoogleCreateCampaignErrors, F as GoogleCreateConversionActionData, H as GoogleCreateConversionActionResponses, I as GoogleCreateConversionActionErrors, J as GoogleCreateDisplayAdData, K as GoogleCreateDisplayAdResponses, L as GoogleCreateDisplayAdErrors, M as GoogleCreateKeywordData, N as GoogleCreateKeywordResponses, P as GoogleCreateKeywordErrors, Q as GoogleDeleteAdData, S as GoogleDeleteAdResponses, U as GoogleDeleteAdErrors, V as GoogleDeleteAdGroupData, W as GoogleDeleteAdGroupResponses, X as GoogleDeleteAdGroupErrors, Y as GoogleDeleteBudgetData, Z as GoogleDeleteBudgetResponses, _ as GoogleDeleteBudgetErrors, $ as GoogleDeleteCampaignData, a0 as GoogleDeleteCampaignResponses, a1 as GoogleDeleteCampaignErrors, a2 as GoogleDeleteKeywordData, a3 as GoogleDeleteKeywordResponses, a4 as GoogleDeleteKeywordErrors, a5 as GoogleEditAdGroupData, a6 as GoogleEditAdGroupResponses, a7 as GoogleEditAdGroupErrors, a8 as GoogleEditBudgetData, a9 as GoogleEditBudgetResponses, aa as GoogleEditBudgetErrors, ab as GoogleEditCampaignData, ac as GoogleEditCampaignResponses, ad as GoogleEditCampaignErrors, ae as GoogleEnableAdData, af as GoogleEnableAdResponses, ag as GoogleEnableAdErrors, ah as GoogleEnableAdGroupData, ai as GoogleEnableAdGroupResponses, aj as GoogleEnableAdGroupErrors, ak as GoogleEnableCampaignData, al as GoogleEnableCampaignResponses, am as GoogleEnableCampaignErrors, an as GoogleEnableKeywordData, ao as GoogleEnableKeywordResponses, ap as GoogleEnableKeywordErrors, aq as GoogleGetAccountData, ar as GoogleGetAccountResponses, as as GoogleGetAccountErrors, at as GoogleGetAdData, au as GoogleGetAdResponses, av as GoogleGetAdErrors, aw as GoogleGetAdGroupData, ax as GoogleGetAdGroupResponses, ay as GoogleGetAdGroupErrors, az as GoogleGetCampaignData, aA as GoogleGetCampaignResponses, aB as GoogleGetCampaignErrors, aC as GoogleGetConversionActionData, aD as GoogleGetConversionActionResponses, aE as GoogleGetConversionActionErrors, aF as GoogleGetInsightsData, aG as GoogleGetInsightsResponses, aH as GoogleGetInsightsErrors, aI as GoogleGetKeywordData, aJ as GoogleGetKeywordResponses, aK as GoogleGetKeywordErrors, aL as GoogleListAdGroupsData, aM as GoogleListAdGroupsResponses, aN as GoogleListAdGroupsErrors, aO as GoogleListAdsData, aP as GoogleListAdsResponses, aQ as GoogleListAdsErrors, aR as GoogleListCampaignsData, aS as GoogleListCampaignsResponses, aT as GoogleListCampaignsErrors, aU as GoogleListConversionActionsData, aV as GoogleListConversionActionsResponses, aW as GoogleListConversionActionsErrors, aX as GoogleListConversionGoalsData, aY as GoogleListConversionGoalsResponses, aZ as GoogleListConversionGoalsErrors, a_ as GoogleListKeywordsData, a$ as GoogleListKeywordsResponses, b0 as GoogleListKeywordsErrors, b1 as GooglePauseAdData, b2 as GooglePauseAdResponses, b3 as GooglePauseAdErrors, b4 as GooglePauseAdGroupData, b5 as GooglePauseAdGroupResponses, b6 as GooglePauseAdGroupErrors, b7 as GooglePauseCampaignData, b8 as GooglePauseCampaignResponses, b9 as GooglePauseCampaignErrors, ba as GooglePauseKeywordData, bb as GooglePauseKeywordResponses, bc as GooglePauseKeywordErrors, bd as GoogleRunGaqlData, be as GoogleRunGaqlResponses, bf as GoogleRunGaqlErrors, bg as GoogleSetAdGroupBidsData, bh as GoogleSetAdGroupBidsResponses, bi as GoogleSetAdGroupBidsErrors, bj as GoogleSetConversionGoalData, bk as GoogleSetConversionGoalResponses, bl as GoogleSetConversionGoalErrors, bm as GoogleSetKeywordBidData, bn as GoogleSetKeywordBidResponses, bo as GoogleSetKeywordBidErrors, bp as GoogleUploadConversionsData, bq as GoogleUploadConversionsResponses, br as GoogleUploadConversionsErrors, bs as GoogleUploadImageAssetData, bt as GoogleUploadImageAssetResponses, bu as GoogleUploadImageAssetErrors, bv as LogsGetData, bw as LogsGetResponses, bx as LogsGetErrors, by as LogsListData, bz as LogsListResponses, bA as LogsListErrors, bB as MediaCreateData, bC as MediaCreateResponses, bD as MediaCreateErrors, bE as MediaDeleteData, bF as MediaDeleteResponses, bG as MediaDeleteErrors, bH as MediaGetData, bI as MediaGetResponses, bJ as MediaGetErrors, bK as MediaListData, bL as MediaListResponses, bM as MediaListErrors, bN as MediaUpdateData, bO as MediaUpdateResponses, bP as MediaUpdateErrors, bQ as MetaAccountData, bR as MetaAccountResponses, bS as MetaAccountErrors, bT as MetaAdData, bU as MetaAdResponses, bV as MetaAdErrors, bW as MetaAdsData, bX as MetaAdsResponses, bY as MetaAdsErrors, bZ as MetaAdsetData, b_ as MetaAdsetResponses, b$ as MetaAdsetErrors, c0 as MetaAdsetsData, c1 as MetaAdsetsResponses, c2 as MetaAdsetsErrors, c3 as MetaCampaignData, c4 as MetaCampaignResponses, c5 as MetaCampaignErrors, c6 as MetaCampaignsData, c7 as MetaCampaignsResponses, c8 as MetaCampaignsErrors, c9 as MetaInsightsData, ca as MetaInsightsResponses, cb as MetaInsightsErrors, cc as PostsCreateData, cd as PostsCreateResponses, ce as PostsCreateErrors, cf as PostsDeleteData, cg as PostsDeleteResponses, ch as PostsDeleteErrors, ci as PostsGetData, cj as PostsGetResponses, ck as PostsGetErrors, cl as PostsListData, cm as PostsListResponses, cn as PostsListErrors, co as PostsUpdateData, cp as PostsUpdateResponses, cq as PostsUpdateErrors, cr as PostsValidateData, cs as PostsValidateResponses, ct as PostsValidateErrors, cu as ProfilesCreateData, cv as ProfilesCreateResponses, cw as ProfilesCreateErrors, cx as ProfilesDeleteData, cy as ProfilesDeleteResponses, cz as ProfilesDeleteErrors, cA as ProfilesGetData, cB as ProfilesGetResponses, cC as ProfilesGetErrors, cD as ProfilesListData, cE as ProfilesListResponses, cF as ProfilesListErrors, cG as ProfilesUpdateData, cH as ProfilesUpdateResponses, cI as ProfilesUpdateErrors, cJ as TokensMintData, cK as TokensMintResponses, cL as TokensMintErrors, cM as WebhooksCreateEndpointData, cN as WebhooksCreateEndpointResponses, cO as WebhooksCreateEndpointErrors, cP as WebhooksCreatePortalData, cQ as WebhooksCreatePortalResponses, cR as WebhooksCreatePortalErrors, cS as WebhooksDeleteEndpointData, cT as WebhooksDeleteEndpointResponses, cU as WebhooksDeleteEndpointErrors, cV as WebhooksGetEndpointData, cW as WebhooksGetEndpointResponses, cX as WebhooksGetEndpointErrors, cY as WebhooksListEndpointsData, cZ as WebhooksListEndpointsResponses, c_ as WebhooksListEndpointsErrors, c$ as WebhooksListEventTypesData, d0 as WebhooksListEventTypesResponses, d1 as WebhooksListEventTypesErrors, d2 as WebhooksPingData, d3 as WebhooksPingResponses, d4 as WebhooksPingErrors, d5 as WebhooksUpdateEndpointData, d6 as WebhooksUpdateEndpointResponses, d7 as WebhooksUpdateEndpointErrors, d8 as ErrorCode, d9 as MediaGetResponse, da as ConnectionsConnectResponse, db as ConnectionsGetResponse, dc as ConnectionsListByProfileResponse, dd as MediaCreateResponse, de as ConnectionsListAccountsResponse, df as MediaListResponse, dg as PostsGetResponse, dh as PostsListResponse, di as PostsValidateResponse, dj as ProfilesGetResponse, dk as ProfilesListResponse } from './types.gen-0ufzFdld.js';
2
- export { dl as ClientOptions, dm as ConnectionsConnectError, dn as ConnectionsDeleteError, dp as ConnectionsDeleteResponse, dq as ConnectionsGetError, dr as ConnectionsListAccountsError, ds as ConnectionsListByProfileError, dt as ConnectionsSelectError, du as ConnectionsSelectResponse, dv as GoogleCreateAdError, dw as GoogleCreateAdGroupError, dx as GoogleCreateAdGroupResponse, dy as GoogleCreateAdResponse, dz as GoogleCreateBudgetError, dA as GoogleCreateBudgetResponse, dB as GoogleCreateCampaignError, dC as GoogleCreateCampaignResponse, dD as GoogleCreateConversionActionError, dE as GoogleCreateConversionActionResponse, dF as GoogleCreateDisplayAdError, dG as GoogleCreateDisplayAdResponse, dH as GoogleCreateKeywordError, dI as GoogleCreateKeywordResponse, dJ as GoogleDeleteAdError, dK as GoogleDeleteAdGroupError, dL as GoogleDeleteAdGroupResponse, dM as GoogleDeleteAdResponse, dN as GoogleDeleteBudgetError, dO as GoogleDeleteBudgetResponse, dP as GoogleDeleteCampaignError, dQ as GoogleDeleteCampaignResponse, dR as GoogleDeleteKeywordError, dS as GoogleDeleteKeywordResponse, dT as GoogleEditAdGroupError, dU as GoogleEditAdGroupResponse, dV as GoogleEditBudgetError, dW as GoogleEditBudgetResponse, dX as GoogleEditCampaignError, dY as GoogleEditCampaignResponse, dZ as GoogleEnableAdError, d_ as GoogleEnableAdGroupError, d$ as GoogleEnableAdGroupResponse, e0 as GoogleEnableAdResponse, e1 as GoogleEnableCampaignError, e2 as GoogleEnableCampaignResponse, e3 as GoogleEnableKeywordError, e4 as GoogleEnableKeywordResponse, e5 as GoogleGetAccountError, e6 as GoogleGetAccountResponse, e7 as GoogleGetAdError, e8 as GoogleGetAdGroupError, e9 as GoogleGetAdGroupResponse, ea as GoogleGetAdResponse, eb as GoogleGetCampaignError, ec as GoogleGetCampaignResponse, ed as GoogleGetConversionActionError, ee as GoogleGetConversionActionResponse, ef as GoogleGetInsightsError, eg as GoogleGetInsightsResponse, eh as GoogleGetKeywordError, ei as GoogleGetKeywordResponse, ej as GoogleListAdGroupsError, ek as GoogleListAdGroupsResponse, el as GoogleListAdsError, em as GoogleListAdsResponse, en as GoogleListCampaignsError, eo as GoogleListCampaignsResponse, ep as GoogleListConversionActionsError, eq as GoogleListConversionActionsResponse, er as GoogleListConversionGoalsError, es as GoogleListConversionGoalsResponse, et as GoogleListKeywordsError, eu as GoogleListKeywordsResponse, ev as GooglePauseAdError, ew as GooglePauseAdGroupError, ex as GooglePauseAdGroupResponse, ey as GooglePauseAdResponse, ez as GooglePauseCampaignError, eA as GooglePauseCampaignResponse, eB as GooglePauseKeywordError, eC as GooglePauseKeywordResponse, eD as GoogleRunGaqlError, eE as GoogleRunGaqlResponse, eF as GoogleSetAdGroupBidsError, eG as GoogleSetAdGroupBidsResponse, eH as GoogleSetConversionGoalError, eI as GoogleSetConversionGoalResponse, eJ as GoogleSetKeywordBidError, eK as GoogleSetKeywordBidResponse, eL as GoogleUploadConversionsError, eM as GoogleUploadConversionsResponse, eN as GoogleUploadImageAssetError, eO as GoogleUploadImageAssetResponse, eP as LogsGetError, eQ as LogsGetResponse, eR as LogsListError, eS as LogsListResponse, eT as MediaCreateError, eU as MediaDeleteError, eV as MediaDeleteResponse, eW as MediaGetError, eX as MediaListError, eY as MediaUpdateError, eZ as MediaUpdateResponse, e_ as MetaAccountError, e$ as MetaAccountResponse, f0 as MetaAdError, f1 as MetaAdResponse, f2 as MetaAdsError, f3 as MetaAdsResponse, f4 as MetaAdsetError, f5 as MetaAdsetResponse, f6 as MetaAdsetsError, f7 as MetaAdsetsResponse, f8 as MetaCampaignError, f9 as MetaCampaignResponse, fa as MetaCampaignsError, fb as MetaCampaignsResponse, fc as MetaInsightsError, fd as MetaInsightsResponse, fe as PostrunClient, ff as PostrunClientOptions, fg as PostsCreateError, fh as PostsCreateResponse, fi as PostsDeleteError, fj as PostsDeleteResponse, fk as PostsGetError, fl as PostsListError, fm as PostsUpdateError, fn as PostsUpdateResponse, fo as PostsValidateError, fp as ProfilesCreateError, fq as ProfilesCreateResponse, fr as ProfilesDeleteError, fs as ProfilesDeleteResponse, ft as ProfilesGetError, fu as ProfilesListError, fv as ProfilesUpdateError, fw as ProfilesUpdateResponse, fx as TokensMintError, fy as TokensMintResponse, fz as WebhooksCreateEndpointError, fA as WebhooksCreateEndpointResponse, fB as WebhooksCreatePortalError, fC as WebhooksCreatePortalResponse, fD as WebhooksDeleteEndpointError, fE as WebhooksDeleteEndpointResponse, fF as WebhooksGetEndpointError, fG as WebhooksGetEndpointResponse, fH as WebhooksListEndpointsError, fI as WebhooksListEndpointsResponse, fJ as WebhooksListEventTypesError, fK as WebhooksListEventTypesResponse, fL as WebhooksPingError, fM as WebhooksPingResponse, fN as WebhooksUpdateEndpointError, fO as WebhooksUpdateEndpointResponse, fP as createPostrunClient } from './types.gen-0ufzFdld.js';
1
+ import { T as TDataShape, O as Options$1, C as Client, a as ClientMeta, b as ConnectionsConnectData, R as RequestResult, c as ConnectionsConnectResponses, d as ConnectionsConnectErrors, e as ConnectionsDeleteData, f as ConnectionsDeleteResponses, g as ConnectionsDeleteErrors, h as ConnectionsGetData, i as ConnectionsGetResponses, j as ConnectionsGetErrors, k as ConnectionsListAccountsData, l as ConnectionsListAccountsResponses, m as ConnectionsListAccountsErrors, n as ConnectionsListByProfileData, o as ConnectionsListByProfileResponses, p as ConnectionsListByProfileErrors, q as ConnectionsSelectData, r as ConnectionsSelectResponses, s as ConnectionsSelectErrors, G as GoogleCreateAdData, t as GoogleCreateAdResponses, u as GoogleCreateAdErrors, v as GoogleCreateAdGroupData, w as GoogleCreateAdGroupResponses, x as GoogleCreateAdGroupErrors, y as GoogleCreateBudgetData, z as GoogleCreateBudgetResponses, A as GoogleCreateBudgetErrors, B as GoogleCreateCampaignData, D as GoogleCreateCampaignResponses, E as GoogleCreateCampaignErrors, F as GoogleCreateConversionActionData, H as GoogleCreateConversionActionResponses, I as GoogleCreateConversionActionErrors, J as GoogleCreateDisplayAdData, K as GoogleCreateDisplayAdResponses, L as GoogleCreateDisplayAdErrors, M as GoogleCreateKeywordData, N as GoogleCreateKeywordResponses, P as GoogleCreateKeywordErrors, Q as GoogleDeleteAdData, S as GoogleDeleteAdResponses, U as GoogleDeleteAdErrors, V as GoogleDeleteAdGroupData, W as GoogleDeleteAdGroupResponses, X as GoogleDeleteAdGroupErrors, Y as GoogleDeleteBudgetData, Z as GoogleDeleteBudgetResponses, _ as GoogleDeleteBudgetErrors, $ as GoogleDeleteCampaignData, a0 as GoogleDeleteCampaignResponses, a1 as GoogleDeleteCampaignErrors, a2 as GoogleDeleteKeywordData, a3 as GoogleDeleteKeywordResponses, a4 as GoogleDeleteKeywordErrors, a5 as GoogleEditAdGroupData, a6 as GoogleEditAdGroupResponses, a7 as GoogleEditAdGroupErrors, a8 as GoogleEditBudgetData, a9 as GoogleEditBudgetResponses, aa as GoogleEditBudgetErrors, ab as GoogleEditCampaignData, ac as GoogleEditCampaignResponses, ad as GoogleEditCampaignErrors, ae as GoogleEnableAdData, af as GoogleEnableAdResponses, ag as GoogleEnableAdErrors, ah as GoogleEnableAdGroupData, ai as GoogleEnableAdGroupResponses, aj as GoogleEnableAdGroupErrors, ak as GoogleEnableCampaignData, al as GoogleEnableCampaignResponses, am as GoogleEnableCampaignErrors, an as GoogleEnableKeywordData, ao as GoogleEnableKeywordResponses, ap as GoogleEnableKeywordErrors, aq as GoogleGetAccountData, ar as GoogleGetAccountResponses, as as GoogleGetAccountErrors, at as GoogleGetAdData, au as GoogleGetAdResponses, av as GoogleGetAdErrors, aw as GoogleGetAdGroupData, ax as GoogleGetAdGroupResponses, ay as GoogleGetAdGroupErrors, az as GoogleGetCampaignData, aA as GoogleGetCampaignResponses, aB as GoogleGetCampaignErrors, aC as GoogleGetConversionActionData, aD as GoogleGetConversionActionResponses, aE as GoogleGetConversionActionErrors, aF as GoogleGetInsightsData, aG as GoogleGetInsightsResponses, aH as GoogleGetInsightsErrors, aI as GoogleGetKeywordData, aJ as GoogleGetKeywordResponses, aK as GoogleGetKeywordErrors, aL as GoogleListAdGroupsData, aM as GoogleListAdGroupsResponses, aN as GoogleListAdGroupsErrors, aO as GoogleListAdsData, aP as GoogleListAdsResponses, aQ as GoogleListAdsErrors, aR as GoogleListCampaignsData, aS as GoogleListCampaignsResponses, aT as GoogleListCampaignsErrors, aU as GoogleListConversionActionsData, aV as GoogleListConversionActionsResponses, aW as GoogleListConversionActionsErrors, aX as GoogleListConversionGoalsData, aY as GoogleListConversionGoalsResponses, aZ as GoogleListConversionGoalsErrors, a_ as GoogleListKeywordsData, a$ as GoogleListKeywordsResponses, b0 as GoogleListKeywordsErrors, b1 as GooglePauseAdData, b2 as GooglePauseAdResponses, b3 as GooglePauseAdErrors, b4 as GooglePauseAdGroupData, b5 as GooglePauseAdGroupResponses, b6 as GooglePauseAdGroupErrors, b7 as GooglePauseCampaignData, b8 as GooglePauseCampaignResponses, b9 as GooglePauseCampaignErrors, ba as GooglePauseKeywordData, bb as GooglePauseKeywordResponses, bc as GooglePauseKeywordErrors, bd as GoogleRunGaqlData, be as GoogleRunGaqlResponses, bf as GoogleRunGaqlErrors, bg as GoogleSetAdGroupBidsData, bh as GoogleSetAdGroupBidsResponses, bi as GoogleSetAdGroupBidsErrors, bj as GoogleSetConversionGoalData, bk as GoogleSetConversionGoalResponses, bl as GoogleSetConversionGoalErrors, bm as GoogleSetKeywordBidData, bn as GoogleSetKeywordBidResponses, bo as GoogleSetKeywordBidErrors, bp as GoogleUploadConversionsData, bq as GoogleUploadConversionsResponses, br as GoogleUploadConversionsErrors, bs as GoogleUploadImageAssetData, bt as GoogleUploadImageAssetResponses, bu as GoogleUploadImageAssetErrors, bv as LogsGetData, bw as LogsGetResponses, bx as LogsGetErrors, by as LogsListData, bz as LogsListResponses, bA as LogsListErrors, bB as MediaCreateData, bC as MediaCreateResponses, bD as MediaCreateErrors, bE as MediaDeleteData, bF as MediaDeleteResponses, bG as MediaDeleteErrors, bH as MediaGetData, bI as MediaGetResponses, bJ as MediaGetErrors, bK as MediaListData, bL as MediaListResponses, bM as MediaListErrors, bN as MediaUpdateData, bO as MediaUpdateResponses, bP as MediaUpdateErrors, bQ as MetaAccountData, bR as MetaAccountResponses, bS as MetaAccountErrors, bT as MetaAdData, bU as MetaAdResponses, bV as MetaAdErrors, bW as MetaAdsData, bX as MetaAdsResponses, bY as MetaAdsErrors, bZ as MetaAdsetData, b_ as MetaAdsetResponses, b$ as MetaAdsetErrors, c0 as MetaAdsetsData, c1 as MetaAdsetsResponses, c2 as MetaAdsetsErrors, c3 as MetaCampaignData, c4 as MetaCampaignResponses, c5 as MetaCampaignErrors, c6 as MetaCampaignsData, c7 as MetaCampaignsResponses, c8 as MetaCampaignsErrors, c9 as MetaInsightsData, ca as MetaInsightsResponses, cb as MetaInsightsErrors, cc as PostsCreateData, cd as PostsCreateResponses, ce as PostsCreateErrors, cf as PostsDeleteData, cg as PostsDeleteResponses, ch as PostsDeleteErrors, ci as PostsGetData, cj as PostsGetResponses, ck as PostsGetErrors, cl as PostsListData, cm as PostsListResponses, cn as PostsListErrors, co as PostsUpdateData, cp as PostsUpdateResponses, cq as PostsUpdateErrors, cr as PostsValidateData, cs as PostsValidateResponses, ct as PostsValidateErrors, cu as ProfilesCreateData, cv as ProfilesCreateResponses, cw as ProfilesCreateErrors, cx as ProfilesDeleteData, cy as ProfilesDeleteResponses, cz as ProfilesDeleteErrors, cA as ProfilesGetData, cB as ProfilesGetResponses, cC as ProfilesGetErrors, cD as ProfilesListData, cE as ProfilesListResponses, cF as ProfilesListErrors, cG as ProfilesUpdateData, cH as ProfilesUpdateResponses, cI as ProfilesUpdateErrors, cJ as TiktokCreatorInfoData, cK as TiktokCreatorInfoResponses, cL as TiktokCreatorInfoErrors, cM as TokensMintData, cN as TokensMintResponses, cO as TokensMintErrors, cP as WebhooksCreateEndpointData, cQ as WebhooksCreateEndpointResponses, cR as WebhooksCreateEndpointErrors, cS as WebhooksCreatePortalData, cT as WebhooksCreatePortalResponses, cU as WebhooksCreatePortalErrors, cV as WebhooksDeleteEndpointData, cW as WebhooksDeleteEndpointResponses, cX as WebhooksDeleteEndpointErrors, cY as WebhooksGetEndpointData, cZ as WebhooksGetEndpointResponses, c_ as WebhooksGetEndpointErrors, c$ as WebhooksListEndpointsData, d0 as WebhooksListEndpointsResponses, d1 as WebhooksListEndpointsErrors, d2 as WebhooksListEventTypesData, d3 as WebhooksListEventTypesResponses, d4 as WebhooksListEventTypesErrors, d5 as WebhooksPingData, d6 as WebhooksPingResponses, d7 as WebhooksPingErrors, d8 as WebhooksUpdateEndpointData, d9 as WebhooksUpdateEndpointResponses, da as WebhooksUpdateEndpointErrors, db as ErrorCode, dc as MediaGetResponse, dd as ConnectionsConnectResponse, de as ConnectionsGetResponse, df as ConnectionsListByProfileResponse, dg as MediaCreateResponse, dh as ConnectionsListAccountsResponse, di as MediaListResponse, dj as PostsGetResponse, dk as PostsListResponse, dl as PostsValidateResponse, dm as ProfilesGetResponse, dn as ProfilesListResponse, dp as TiktokCreatorInfoResponse } from './types.gen-CzxuwPxe.js';
2
+ export { dq as ClientOptions, dr as ConnectionsConnectError, ds as ConnectionsDeleteError, dt as ConnectionsDeleteResponse, du as ConnectionsGetError, dv as ConnectionsListAccountsError, dw as ConnectionsListByProfileError, dx as ConnectionsSelectError, dy as ConnectionsSelectResponse, dz as GoogleCreateAdError, dA as GoogleCreateAdGroupError, dB as GoogleCreateAdGroupResponse, dC as GoogleCreateAdResponse, dD as GoogleCreateBudgetError, dE as GoogleCreateBudgetResponse, dF as GoogleCreateCampaignError, dG as GoogleCreateCampaignResponse, dH as GoogleCreateConversionActionError, dI as GoogleCreateConversionActionResponse, dJ as GoogleCreateDisplayAdError, dK as GoogleCreateDisplayAdResponse, dL as GoogleCreateKeywordError, dM as GoogleCreateKeywordResponse, dN as GoogleDeleteAdError, dO as GoogleDeleteAdGroupError, dP as GoogleDeleteAdGroupResponse, dQ as GoogleDeleteAdResponse, dR as GoogleDeleteBudgetError, dS as GoogleDeleteBudgetResponse, dT as GoogleDeleteCampaignError, dU as GoogleDeleteCampaignResponse, dV as GoogleDeleteKeywordError, dW as GoogleDeleteKeywordResponse, dX as GoogleEditAdGroupError, dY as GoogleEditAdGroupResponse, dZ as GoogleEditBudgetError, d_ as GoogleEditBudgetResponse, d$ as GoogleEditCampaignError, e0 as GoogleEditCampaignResponse, e1 as GoogleEnableAdError, e2 as GoogleEnableAdGroupError, e3 as GoogleEnableAdGroupResponse, e4 as GoogleEnableAdResponse, e5 as GoogleEnableCampaignError, e6 as GoogleEnableCampaignResponse, e7 as GoogleEnableKeywordError, e8 as GoogleEnableKeywordResponse, e9 as GoogleGetAccountError, ea as GoogleGetAccountResponse, eb as GoogleGetAdError, ec as GoogleGetAdGroupError, ed as GoogleGetAdGroupResponse, ee as GoogleGetAdResponse, ef as GoogleGetCampaignError, eg as GoogleGetCampaignResponse, eh as GoogleGetConversionActionError, ei as GoogleGetConversionActionResponse, ej as GoogleGetInsightsError, ek as GoogleGetInsightsResponse, el as GoogleGetKeywordError, em as GoogleGetKeywordResponse, en as GoogleListAdGroupsError, eo as GoogleListAdGroupsResponse, ep as GoogleListAdsError, eq as GoogleListAdsResponse, er as GoogleListCampaignsError, es as GoogleListCampaignsResponse, et as GoogleListConversionActionsError, eu as GoogleListConversionActionsResponse, ev as GoogleListConversionGoalsError, ew as GoogleListConversionGoalsResponse, ex as GoogleListKeywordsError, ey as GoogleListKeywordsResponse, ez as GooglePauseAdError, eA as GooglePauseAdGroupError, eB as GooglePauseAdGroupResponse, eC as GooglePauseAdResponse, eD as GooglePauseCampaignError, eE as GooglePauseCampaignResponse, eF as GooglePauseKeywordError, eG as GooglePauseKeywordResponse, eH as GoogleRunGaqlError, eI as GoogleRunGaqlResponse, eJ as GoogleSetAdGroupBidsError, eK as GoogleSetAdGroupBidsResponse, eL as GoogleSetConversionGoalError, eM as GoogleSetConversionGoalResponse, eN as GoogleSetKeywordBidError, eO as GoogleSetKeywordBidResponse, eP as GoogleUploadConversionsError, eQ as GoogleUploadConversionsResponse, eR as GoogleUploadImageAssetError, eS as GoogleUploadImageAssetResponse, eT as LogsGetError, eU as LogsGetResponse, eV as LogsListError, eW as LogsListResponse, eX as MediaCreateError, eY as MediaDeleteError, eZ as MediaDeleteResponse, e_ as MediaGetError, e$ as MediaListError, f0 as MediaUpdateError, f1 as MediaUpdateResponse, f2 as MetaAccountError, f3 as MetaAccountResponse, f4 as MetaAdError, f5 as MetaAdResponse, f6 as MetaAdsError, f7 as MetaAdsResponse, f8 as MetaAdsetError, f9 as MetaAdsetResponse, fa as MetaAdsetsError, fb as MetaAdsetsResponse, fc as MetaCampaignError, fd as MetaCampaignResponse, fe as MetaCampaignsError, ff as MetaCampaignsResponse, fg as MetaInsightsError, fh as MetaInsightsResponse, fi as PostrunClient, fj as PostrunClientOptions, fk as PostsCreateError, fl as PostsCreateResponse, fm as PostsDeleteError, fn as PostsDeleteResponse, fo as PostsGetError, fp as PostsListError, fq as PostsUpdateError, fr as PostsUpdateResponse, fs as PostsValidateError, ft as ProfilesCreateError, fu as ProfilesCreateResponse, fv as ProfilesDeleteError, fw as ProfilesDeleteResponse, fx as ProfilesGetError, fy as ProfilesListError, fz as ProfilesUpdateError, fA as ProfilesUpdateResponse, fB as TiktokCreatorInfoError, fC as TokensMintError, fD as TokensMintResponse, fE as WebhooksCreateEndpointError, fF as WebhooksCreateEndpointResponse, fG as WebhooksCreatePortalError, fH as WebhooksCreatePortalResponse, fI as WebhooksDeleteEndpointError, fJ as WebhooksDeleteEndpointResponse, fK as WebhooksGetEndpointError, fL as WebhooksGetEndpointResponse, fM as WebhooksListEndpointsError, fN as WebhooksListEndpointsResponse, fO as WebhooksListEventTypesError, fP as WebhooksListEventTypesResponse, fQ as WebhooksPingError, fR as WebhooksPingResponse, fS as WebhooksUpdateEndpointError, fT as WebhooksUpdateEndpointResponse, fU as createPostrunClient } from './types.gen-CzxuwPxe.js';
3
3
  import * as z from 'zod';
4
4
 
5
5
  type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
@@ -591,6 +591,14 @@ declare const googleUploadConversions: <ThrowOnError extends boolean = true>(opt
591
591
  * Uploads a Postrun image asset (its validated Google Ads rendition) to the connection’s account as an `image` asset, returning the new resource id + resource_name to chain into an ad/asset assembly. Pass `dry_run: true` to validate against Google without creating anything (Google’s native validate_only). The media asset must have a ready Google Ads rendition, else a 409.
592
592
  */
593
593
  declare const googleUploadImageAsset: <ThrowOnError extends boolean = true>(options: Options<GoogleUploadImageAssetData, ThrowOnError>) => RequestResult<GoogleUploadImageAssetResponses, GoogleUploadImageAssetErrors, ThrowOnError>;
594
+ /**
595
+ * Retrieve TikTok creator info
596
+ *
597
+ * **Authentication.** Secret `pr_` API key, or a browser-safe frontend token granting `connections:read` scoped to the profile that owns the connection.
598
+ *
599
+ * Retrieves the TikTok creator's publish options live from TikTok — required by TikTok's Content Posting policy to render the publishing UI: the creator nickname + avatar, the privacy options to offer (with no default), and the Comment/Duet/Stitch flags to disable. Returns 404 if the connection does not exist in your account or is not a TikTok connection, 409 if the TikTok account must be reconnected, and 502 if TikTok’s creator-info call fails.
600
+ */
601
+ declare const tiktokCreatorInfo: <ThrowOnError extends boolean = true>(options: Options<TiktokCreatorInfoData, ThrowOnError>) => RequestResult<TiktokCreatorInfoResponses, TiktokCreatorInfoErrors, ThrowOnError>;
594
602
  /**
595
603
  * List request logs
596
604
  *
@@ -760,6 +768,22 @@ type ConnectSession = ConnectionsConnectResponse;
760
768
  type ConnectablePlatform = NonNullable<ConnectionsConnectData['body']>['platform'];
761
769
  /** Accounts discoverable on a pending connection, for the selection step. */
762
770
  type DiscoverableAccountList = ConnectionsListAccountsResponse;
771
+ /**
772
+ * A TikTok creator's live publish options for a connection — the data TikTok's
773
+ * Content Posting policy REQUIRES the publishing UI to render: `creator`
774
+ * (nickname + avatar), the `privacy_options` to offer (with NO default), the
775
+ * positive `interaction` (allowed) flags for Comment/Duet/Stitch toggles, and
776
+ * `max_video_duration_sec`. Derived from the contract, never hand-declared.
777
+ */
778
+ type TikTokCreatorInfo = TiktokCreatorInfoResponse;
779
+ /**
780
+ * One TikTok privacy level — a member of the closed audience union
781
+ * (`PUBLIC_TO_EVERYONE` / `MUTUAL_FOLLOW_FRIENDS` / `FOLLOWER_OF_CREATOR` /
782
+ * `SELF_ONLY`). The per-account ALLOWED subset is `TikTokCreatorInfo.privacy_options`;
783
+ * this is one value from it (what you bind a dropdown option to). Derived from
784
+ * the contract, never hand-declared; render it with {@link tiktokPrivacyLabel}.
785
+ */
786
+ type TikTokPrivacyLevel = TikTokCreatorInfo['privacy_options'][number];
763
787
  /** Request body to select an account on a pending connection. */
764
788
  type SelectAccountInput = NonNullable<ConnectionsSelectData['body']>;
765
789
  /** The create/update post body, derived from the contract. */
@@ -785,6 +809,35 @@ type LinkedInPostVariant = Extract<PostVariantInput, {
785
809
  }>;
786
810
  /** A post — its variants, schedule, and derived status (the read resource). */
787
811
  type Post = PostsGetResponse;
812
+ /**
813
+ * One per-platform variant on a RETURNED post (the read resource): its own
814
+ * `status`, a typed `error` ({@link PostVariantError}) when it failed, and a
815
+ * `result` (platform id + permalink) when it published. Derived from the post
816
+ * resource, never hand-declared. (For inspecting compose-time native `settings`,
817
+ * prefer {@link PostVariantInput}; on read `settings` is opaque.)
818
+ */
819
+ type PostVariant = Post['variants'][number];
820
+ /**
821
+ * A variant's typed publish failure — `{ code, message }`. The `code` is the
822
+ * adapter's own minted reason (`x_access_not_permitted`, `linkedin_auth_expired`,
823
+ * …); it stays a `string` because adapter codes are minted outside the API's
824
+ * closed registry. Derived from the variant, never hand-declared.
825
+ */
826
+ type PostVariantError = NonNullable<PostVariant['error']>;
827
+ /**
828
+ * Did the post fully publish? `true` ONLY when the rollup `status` is
829
+ * `'published'` — `partially_published` and `failed` are NOT success. The single
830
+ * pure predicate every surface (SDK, React hook, composer) shares, so "success"
831
+ * has exactly one definition.
832
+ */
833
+ declare const isPublished: (post: Post) => boolean;
834
+ /**
835
+ * The variants that FAILED to publish, each carrying its typed {@link
836
+ * PostVariantError}. Empty when none failed. The pure helper behind
837
+ * `useCreatePost().failedVariants` — usable directly from a non-React caller so
838
+ * the "which platforms failed, and why" projection has one definition.
839
+ */
840
+ declare const failedVariants: (post: Post) => PostVariant[];
788
841
  /** A page of posts (the calendar/queue list). */
789
842
  type PostList = PostsListResponse;
790
843
  /** Query parameters for listing posts (filters + pagination). */
@@ -877,6 +930,18 @@ type Metadata = NonNullable<CreateMediaInput['metadata']>;
877
930
  */
878
931
  type MetadataFilter = NonNullable<ListMediaQuery['metadata']>;
879
932
 
933
+ /**
934
+ * Map a TikTok privacy level to a short, human label for the composer's privacy
935
+ * dropdown — the presentation the API deliberately keeps OFF the wire (the
936
+ * `creator-info` response returns the typed `privacy_options`; the SDK owns how
937
+ * they read).
938
+ *
939
+ * Exhaustive over the closed `TikTokPrivacyLevel` union with no `default` branch,
940
+ * so adding a TikTok privacy level upstream surfaces as a compile error here
941
+ * rather than silently rendering a raw enum string.
942
+ */
943
+ declare function tiktokPrivacyLabel(value: TikTokPrivacyLevel): string;
944
+
880
945
  /** A media attachment — the uploaded asset (or just its id + kind). */
881
946
  type MediaInput = Pick<MediaResource, 'id' | 'kind'>;
882
947
  /** Base content, shared across channels unless a channel overrides it. */
@@ -959,4 +1024,4 @@ declare function buildCreatePost(input: ComposePostInput, connections: readonly
959
1024
  */
960
1025
  declare function buildUpdatePost(input: ComposeUpdateInput, connections?: readonly ConnectionRef[]): UpdatePostInput;
961
1026
 
962
- export { type ChannelConfig, type Channels, ComposeError, type ComposePostInput, type ComposeUpdateInput, type ConnectSession, type ConnectablePlatform, type Connection, type ConnectionKind, type ConnectionList, type ConnectionRef, type ConnectionStatus, ConnectionsConnectData, ConnectionsConnectErrors, ConnectionsConnectResponse, ConnectionsConnectResponses, ConnectionsDeleteData, ConnectionsDeleteErrors, ConnectionsDeleteResponses, ConnectionsGetData, ConnectionsGetErrors, ConnectionsGetResponse, ConnectionsGetResponses, ConnectionsListAccountsData, ConnectionsListAccountsErrors, ConnectionsListAccountsResponse, ConnectionsListAccountsResponses, ConnectionsListByProfileData, ConnectionsListByProfileErrors, ConnectionsListByProfileResponse, ConnectionsListByProfileResponses, ConnectionsSelectData, ConnectionsSelectErrors, ConnectionsSelectResponses, type CreateMediaInput, type CreateMediaResult, type CreatePostInput, type CreateProfileInput, type DiscoverableAccountList, ErrorCode, GoogleCreateAdData, GoogleCreateAdErrors, GoogleCreateAdGroupData, GoogleCreateAdGroupErrors, GoogleCreateAdGroupResponses, GoogleCreateAdResponses, GoogleCreateBudgetData, GoogleCreateBudgetErrors, GoogleCreateBudgetResponses, GoogleCreateCampaignData, GoogleCreateCampaignErrors, GoogleCreateCampaignResponses, GoogleCreateConversionActionData, GoogleCreateConversionActionErrors, GoogleCreateConversionActionResponses, GoogleCreateDisplayAdData, GoogleCreateDisplayAdErrors, GoogleCreateDisplayAdResponses, GoogleCreateKeywordData, GoogleCreateKeywordErrors, GoogleCreateKeywordResponses, GoogleDeleteAdData, GoogleDeleteAdErrors, GoogleDeleteAdGroupData, GoogleDeleteAdGroupErrors, GoogleDeleteAdGroupResponses, GoogleDeleteAdResponses, GoogleDeleteBudgetData, GoogleDeleteBudgetErrors, GoogleDeleteBudgetResponses, GoogleDeleteCampaignData, GoogleDeleteCampaignErrors, GoogleDeleteCampaignResponses, GoogleDeleteKeywordData, GoogleDeleteKeywordErrors, GoogleDeleteKeywordResponses, GoogleEditAdGroupData, GoogleEditAdGroupErrors, GoogleEditAdGroupResponses, GoogleEditBudgetData, GoogleEditBudgetErrors, GoogleEditBudgetResponses, GoogleEditCampaignData, GoogleEditCampaignErrors, GoogleEditCampaignResponses, GoogleEnableAdData, GoogleEnableAdErrors, GoogleEnableAdGroupData, GoogleEnableAdGroupErrors, GoogleEnableAdGroupResponses, GoogleEnableAdResponses, GoogleEnableCampaignData, GoogleEnableCampaignErrors, GoogleEnableCampaignResponses, GoogleEnableKeywordData, GoogleEnableKeywordErrors, GoogleEnableKeywordResponses, GoogleGetAccountData, GoogleGetAccountErrors, GoogleGetAccountResponses, GoogleGetAdData, GoogleGetAdErrors, GoogleGetAdGroupData, GoogleGetAdGroupErrors, GoogleGetAdGroupResponses, GoogleGetAdResponses, GoogleGetCampaignData, GoogleGetCampaignErrors, GoogleGetCampaignResponses, GoogleGetConversionActionData, GoogleGetConversionActionErrors, GoogleGetConversionActionResponses, GoogleGetInsightsData, GoogleGetInsightsErrors, GoogleGetInsightsResponses, GoogleGetKeywordData, GoogleGetKeywordErrors, GoogleGetKeywordResponses, GoogleListAdGroupsData, GoogleListAdGroupsErrors, GoogleListAdGroupsResponses, GoogleListAdsData, GoogleListAdsErrors, GoogleListAdsResponses, GoogleListCampaignsData, GoogleListCampaignsErrors, GoogleListCampaignsResponses, GoogleListConversionActionsData, GoogleListConversionActionsErrors, GoogleListConversionActionsResponses, GoogleListConversionGoalsData, GoogleListConversionGoalsErrors, GoogleListConversionGoalsResponses, GoogleListKeywordsData, GoogleListKeywordsErrors, GoogleListKeywordsResponses, GooglePauseAdData, GooglePauseAdErrors, GooglePauseAdGroupData, GooglePauseAdGroupErrors, GooglePauseAdGroupResponses, GooglePauseAdResponses, GooglePauseCampaignData, GooglePauseCampaignErrors, GooglePauseCampaignResponses, GooglePauseKeywordData, GooglePauseKeywordErrors, GooglePauseKeywordResponses, GoogleRunGaqlData, GoogleRunGaqlErrors, GoogleRunGaqlResponses, GoogleSetAdGroupBidsData, GoogleSetAdGroupBidsErrors, GoogleSetAdGroupBidsResponses, GoogleSetConversionGoalData, GoogleSetConversionGoalErrors, GoogleSetConversionGoalResponses, GoogleSetKeywordBidData, GoogleSetKeywordBidErrors, GoogleSetKeywordBidResponses, GoogleUploadConversionsData, GoogleUploadConversionsErrors, GoogleUploadConversionsResponses, GoogleUploadImageAssetData, GoogleUploadImageAssetErrors, GoogleUploadImageAssetResponses, type LinkedInPostVariant, type ListConnectionsQuery, type ListMediaQuery, type ListPostsQuery, type ListProfilesQuery, LogsGetData, LogsGetErrors, LogsGetResponses, LogsListData, LogsListErrors, LogsListResponses, MediaCreateData, MediaCreateErrors, MediaCreateResponse, MediaCreateResponses, MediaDeleteData, MediaDeleteErrors, MediaDeleteResponses, MediaGetData, MediaGetErrors, MediaGetResponse, MediaGetResponses, type MediaInput, type MediaKind, type MediaList, MediaListData, MediaListErrors, MediaListResponse, MediaListResponses, type MediaResource, type MediaStatus, type MediaTarget, MediaUpdateData, MediaUpdateErrors, MediaUpdateResponses, MetaAccountData, MetaAccountErrors, MetaAccountResponses, MetaAdData, MetaAdErrors, MetaAdResponses, MetaAdsData, MetaAdsErrors, MetaAdsResponses, MetaAdsetData, MetaAdsetErrors, MetaAdsetResponses, MetaAdsetsData, MetaAdsetsErrors, MetaAdsetsResponses, MetaCampaignData, MetaCampaignErrors, MetaCampaignResponses, MetaCampaignsData, MetaCampaignsErrors, MetaCampaignsResponses, MetaInsightsData, MetaInsightsErrors, MetaInsightsResponses, type Metadata, type MetadataFilter, type Options, POST_PLATFORMS, type Post, type PostContent, type PostList, type PostMetadata, type PostPlatform, type PostStatus, type PostTypeFor, type PostValidation, type PostVariantInput, PostrunError, type PostrunErrorCode, type PostrunFieldError, type PostrunProblem, PostsCreateData, PostsCreateErrors, PostsCreateResponses, PostsDeleteData, PostsDeleteErrors, PostsDeleteResponses, PostsGetData, PostsGetErrors, PostsGetResponse, PostsGetResponses, PostsListData, PostsListErrors, PostsListResponse, PostsListResponses, PostsUpdateData, PostsUpdateErrors, PostsUpdateResponses, PostsValidateData, PostsValidateErrors, PostsValidateResponse, PostsValidateResponses, type Profile, type ProfileList, ProfilesCreateData, ProfilesCreateErrors, ProfilesCreateResponses, ProfilesDeleteData, ProfilesDeleteErrors, ProfilesDeleteResponses, ProfilesGetData, ProfilesGetErrors, ProfilesGetResponse, ProfilesGetResponses, ProfilesListData, ProfilesListErrors, ProfilesListResponse, ProfilesListResponses, ProfilesUpdateData, ProfilesUpdateErrors, ProfilesUpdateResponses, type PublishMode, type SelectAccountInput, type SettingsFor, TokensMintData, TokensMintErrors, TokensMintResponses, type UpdateMediaInput, type UpdatePostInput, type UpdateProfileInput, type UploadTarget, type ValidatePostInput, type ValidationIssue, WebhooksCreateEndpointData, WebhooksCreateEndpointErrors, WebhooksCreateEndpointResponses, WebhooksCreatePortalData, WebhooksCreatePortalErrors, WebhooksCreatePortalResponses, WebhooksDeleteEndpointData, WebhooksDeleteEndpointErrors, WebhooksDeleteEndpointResponses, WebhooksGetEndpointData, WebhooksGetEndpointErrors, WebhooksGetEndpointResponses, WebhooksListEndpointsData, WebhooksListEndpointsErrors, WebhooksListEndpointsResponses, WebhooksListEventTypesData, WebhooksListEventTypesErrors, WebhooksListEventTypesResponses, WebhooksPingData, WebhooksPingErrors, WebhooksPingResponses, WebhooksUpdateEndpointData, WebhooksUpdateEndpointErrors, WebhooksUpdateEndpointResponses, type XPostVariant, buildCreatePost, buildUpdatePost, connectionsConnect, connectionsDelete, connectionsGet, connectionsListAccounts, connectionsListByProfile, connectionsSelect, googleCreateAd, googleCreateAdGroup, googleCreateBudget, googleCreateCampaign, googleCreateConversionAction, googleCreateDisplayAd, googleCreateKeyword, googleDeleteAd, googleDeleteAdGroup, googleDeleteBudget, googleDeleteCampaign, googleDeleteKeyword, googleEditAdGroup, googleEditBudget, googleEditCampaign, googleEnableAd, googleEnableAdGroup, googleEnableCampaign, googleEnableKeyword, googleGetAccount, googleGetAd, googleGetAdGroup, googleGetCampaign, googleGetConversionAction, googleGetInsights, googleGetKeyword, googleListAdGroups, googleListAds, googleListCampaigns, googleListConversionActions, googleListConversionGoals, googleListKeywords, googlePauseAd, googlePauseAdGroup, googlePauseCampaign, googlePauseKeyword, googleRunGaql, googleSetAdGroupBids, googleSetConversionGoal, googleSetKeywordBid, googleUploadConversions, googleUploadImageAsset, isPostPlatform, logsGet, logsList, mediaCreate, mediaDelete, mediaGet, mediaList, mediaUpdate, metaAccount, metaAd, metaAds, metaAdset, metaAdsets, metaCampaign, metaCampaigns, metaInsights, postsCreate, postsDelete, postsGet, postsList, postsUpdate, postsValidate, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint };
1027
+ export { type ChannelConfig, type Channels, ComposeError, type ComposePostInput, type ComposeUpdateInput, type ConnectSession, type ConnectablePlatform, type Connection, type ConnectionKind, type ConnectionList, type ConnectionRef, type ConnectionStatus, ConnectionsConnectData, ConnectionsConnectErrors, ConnectionsConnectResponse, ConnectionsConnectResponses, ConnectionsDeleteData, ConnectionsDeleteErrors, ConnectionsDeleteResponses, ConnectionsGetData, ConnectionsGetErrors, ConnectionsGetResponse, ConnectionsGetResponses, ConnectionsListAccountsData, ConnectionsListAccountsErrors, ConnectionsListAccountsResponse, ConnectionsListAccountsResponses, ConnectionsListByProfileData, ConnectionsListByProfileErrors, ConnectionsListByProfileResponse, ConnectionsListByProfileResponses, ConnectionsSelectData, ConnectionsSelectErrors, ConnectionsSelectResponses, type CreateMediaInput, type CreateMediaResult, type CreatePostInput, type CreateProfileInput, type DiscoverableAccountList, ErrorCode, GoogleCreateAdData, GoogleCreateAdErrors, GoogleCreateAdGroupData, GoogleCreateAdGroupErrors, GoogleCreateAdGroupResponses, GoogleCreateAdResponses, GoogleCreateBudgetData, GoogleCreateBudgetErrors, GoogleCreateBudgetResponses, GoogleCreateCampaignData, GoogleCreateCampaignErrors, GoogleCreateCampaignResponses, GoogleCreateConversionActionData, GoogleCreateConversionActionErrors, GoogleCreateConversionActionResponses, GoogleCreateDisplayAdData, GoogleCreateDisplayAdErrors, GoogleCreateDisplayAdResponses, GoogleCreateKeywordData, GoogleCreateKeywordErrors, GoogleCreateKeywordResponses, GoogleDeleteAdData, GoogleDeleteAdErrors, GoogleDeleteAdGroupData, GoogleDeleteAdGroupErrors, GoogleDeleteAdGroupResponses, GoogleDeleteAdResponses, GoogleDeleteBudgetData, GoogleDeleteBudgetErrors, GoogleDeleteBudgetResponses, GoogleDeleteCampaignData, GoogleDeleteCampaignErrors, GoogleDeleteCampaignResponses, GoogleDeleteKeywordData, GoogleDeleteKeywordErrors, GoogleDeleteKeywordResponses, GoogleEditAdGroupData, GoogleEditAdGroupErrors, GoogleEditAdGroupResponses, GoogleEditBudgetData, GoogleEditBudgetErrors, GoogleEditBudgetResponses, GoogleEditCampaignData, GoogleEditCampaignErrors, GoogleEditCampaignResponses, GoogleEnableAdData, GoogleEnableAdErrors, GoogleEnableAdGroupData, GoogleEnableAdGroupErrors, GoogleEnableAdGroupResponses, GoogleEnableAdResponses, GoogleEnableCampaignData, GoogleEnableCampaignErrors, GoogleEnableCampaignResponses, GoogleEnableKeywordData, GoogleEnableKeywordErrors, GoogleEnableKeywordResponses, GoogleGetAccountData, GoogleGetAccountErrors, GoogleGetAccountResponses, GoogleGetAdData, GoogleGetAdErrors, GoogleGetAdGroupData, GoogleGetAdGroupErrors, GoogleGetAdGroupResponses, GoogleGetAdResponses, GoogleGetCampaignData, GoogleGetCampaignErrors, GoogleGetCampaignResponses, GoogleGetConversionActionData, GoogleGetConversionActionErrors, GoogleGetConversionActionResponses, GoogleGetInsightsData, GoogleGetInsightsErrors, GoogleGetInsightsResponses, GoogleGetKeywordData, GoogleGetKeywordErrors, GoogleGetKeywordResponses, GoogleListAdGroupsData, GoogleListAdGroupsErrors, GoogleListAdGroupsResponses, GoogleListAdsData, GoogleListAdsErrors, GoogleListAdsResponses, GoogleListCampaignsData, GoogleListCampaignsErrors, GoogleListCampaignsResponses, GoogleListConversionActionsData, GoogleListConversionActionsErrors, GoogleListConversionActionsResponses, GoogleListConversionGoalsData, GoogleListConversionGoalsErrors, GoogleListConversionGoalsResponses, GoogleListKeywordsData, GoogleListKeywordsErrors, GoogleListKeywordsResponses, GooglePauseAdData, GooglePauseAdErrors, GooglePauseAdGroupData, GooglePauseAdGroupErrors, GooglePauseAdGroupResponses, GooglePauseAdResponses, GooglePauseCampaignData, GooglePauseCampaignErrors, GooglePauseCampaignResponses, GooglePauseKeywordData, GooglePauseKeywordErrors, GooglePauseKeywordResponses, GoogleRunGaqlData, GoogleRunGaqlErrors, GoogleRunGaqlResponses, GoogleSetAdGroupBidsData, GoogleSetAdGroupBidsErrors, GoogleSetAdGroupBidsResponses, GoogleSetConversionGoalData, GoogleSetConversionGoalErrors, GoogleSetConversionGoalResponses, GoogleSetKeywordBidData, GoogleSetKeywordBidErrors, GoogleSetKeywordBidResponses, GoogleUploadConversionsData, GoogleUploadConversionsErrors, GoogleUploadConversionsResponses, GoogleUploadImageAssetData, GoogleUploadImageAssetErrors, GoogleUploadImageAssetResponses, type LinkedInPostVariant, type ListConnectionsQuery, type ListMediaQuery, type ListPostsQuery, type ListProfilesQuery, LogsGetData, LogsGetErrors, LogsGetResponses, LogsListData, LogsListErrors, LogsListResponses, MediaCreateData, MediaCreateErrors, MediaCreateResponse, MediaCreateResponses, MediaDeleteData, MediaDeleteErrors, MediaDeleteResponses, MediaGetData, MediaGetErrors, MediaGetResponse, MediaGetResponses, type MediaInput, type MediaKind, type MediaList, MediaListData, MediaListErrors, MediaListResponse, MediaListResponses, type MediaResource, type MediaStatus, type MediaTarget, MediaUpdateData, MediaUpdateErrors, MediaUpdateResponses, MetaAccountData, MetaAccountErrors, MetaAccountResponses, MetaAdData, MetaAdErrors, MetaAdResponses, MetaAdsData, MetaAdsErrors, MetaAdsResponses, MetaAdsetData, MetaAdsetErrors, MetaAdsetResponses, MetaAdsetsData, MetaAdsetsErrors, MetaAdsetsResponses, MetaCampaignData, MetaCampaignErrors, MetaCampaignResponses, MetaCampaignsData, MetaCampaignsErrors, MetaCampaignsResponses, MetaInsightsData, MetaInsightsErrors, MetaInsightsResponses, type Metadata, type MetadataFilter, type Options, POST_PLATFORMS, type Post, type PostContent, type PostList, type PostMetadata, type PostPlatform, type PostStatus, type PostTypeFor, type PostValidation, type PostVariant, type PostVariantError, type PostVariantInput, PostrunError, type PostrunErrorCode, type PostrunFieldError, type PostrunProblem, PostsCreateData, PostsCreateErrors, PostsCreateResponses, PostsDeleteData, PostsDeleteErrors, PostsDeleteResponses, PostsGetData, PostsGetErrors, PostsGetResponse, PostsGetResponses, PostsListData, PostsListErrors, PostsListResponse, PostsListResponses, PostsUpdateData, PostsUpdateErrors, PostsUpdateResponses, PostsValidateData, PostsValidateErrors, PostsValidateResponse, PostsValidateResponses, type Profile, type ProfileList, ProfilesCreateData, ProfilesCreateErrors, ProfilesCreateResponses, ProfilesDeleteData, ProfilesDeleteErrors, ProfilesDeleteResponses, ProfilesGetData, ProfilesGetErrors, ProfilesGetResponse, ProfilesGetResponses, ProfilesListData, ProfilesListErrors, ProfilesListResponse, ProfilesListResponses, ProfilesUpdateData, ProfilesUpdateErrors, ProfilesUpdateResponses, type PublishMode, type SelectAccountInput, type SettingsFor, type TikTokCreatorInfo, type TikTokPrivacyLevel, TiktokCreatorInfoData, TiktokCreatorInfoErrors, TiktokCreatorInfoResponse, TiktokCreatorInfoResponses, TokensMintData, TokensMintErrors, TokensMintResponses, type UpdateMediaInput, type UpdatePostInput, type UpdateProfileInput, type UploadTarget, type ValidatePostInput, type ValidationIssue, WebhooksCreateEndpointData, WebhooksCreateEndpointErrors, WebhooksCreateEndpointResponses, WebhooksCreatePortalData, WebhooksCreatePortalErrors, WebhooksCreatePortalResponses, WebhooksDeleteEndpointData, WebhooksDeleteEndpointErrors, WebhooksDeleteEndpointResponses, WebhooksGetEndpointData, WebhooksGetEndpointErrors, WebhooksGetEndpointResponses, WebhooksListEndpointsData, WebhooksListEndpointsErrors, WebhooksListEndpointsResponses, WebhooksListEventTypesData, WebhooksListEventTypesErrors, WebhooksListEventTypesResponses, WebhooksPingData, WebhooksPingErrors, WebhooksPingResponses, WebhooksUpdateEndpointData, WebhooksUpdateEndpointErrors, WebhooksUpdateEndpointResponses, type XPostVariant, buildCreatePost, buildUpdatePost, connectionsConnect, connectionsDelete, connectionsGet, connectionsListAccounts, connectionsListByProfile, connectionsSelect, failedVariants, googleCreateAd, googleCreateAdGroup, googleCreateBudget, googleCreateCampaign, googleCreateConversionAction, googleCreateDisplayAd, googleCreateKeyword, googleDeleteAd, googleDeleteAdGroup, googleDeleteBudget, googleDeleteCampaign, googleDeleteKeyword, googleEditAdGroup, googleEditBudget, googleEditCampaign, googleEnableAd, googleEnableAdGroup, googleEnableCampaign, googleEnableKeyword, googleGetAccount, googleGetAd, googleGetAdGroup, googleGetCampaign, googleGetConversionAction, googleGetInsights, googleGetKeyword, googleListAdGroups, googleListAds, googleListCampaigns, googleListConversionActions, googleListConversionGoals, googleListKeywords, googlePauseAd, googlePauseAdGroup, googlePauseCampaign, googlePauseKeyword, googleRunGaql, googleSetAdGroupBids, googleSetConversionGoal, googleSetKeywordBid, googleUploadConversions, googleUploadImageAsset, isPostPlatform, isPublished, logsGet, logsList, mediaCreate, mediaDelete, mediaGet, mediaList, mediaUpdate, metaAccount, metaAd, metaAds, metaAdset, metaAdsets, metaCampaign, metaCampaigns, metaInsights, postsCreate, postsDelete, postsGet, postsList, postsUpdate, postsValidate, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tiktokCreatorInfo, tiktokPrivacyLabel, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint };
package/dist/index.js CHANGED
@@ -1,5 +1,23 @@
1
- export { PostrunError, connectionsConnect, connectionsDelete, connectionsGet, connectionsListAccounts, connectionsListByProfile, connectionsSelect, createPostrunClient, googleCreateAd, googleCreateAdGroup, googleCreateBudget, googleCreateCampaign, googleCreateConversionAction, googleCreateDisplayAd, googleCreateKeyword, googleDeleteAd, googleDeleteAdGroup, googleDeleteBudget, googleDeleteCampaign, googleDeleteKeyword, googleEditAdGroup, googleEditBudget, googleEditCampaign, googleEnableAd, googleEnableAdGroup, googleEnableCampaign, googleEnableKeyword, googleGetAccount, googleGetAd, googleGetAdGroup, googleGetCampaign, googleGetConversionAction, googleGetInsights, googleGetKeyword, googleListAdGroups, googleListAds, googleListCampaigns, googleListConversionActions, googleListConversionGoals, googleListKeywords, googlePauseAd, googlePauseAdGroup, googlePauseCampaign, googlePauseKeyword, googleRunGaql, googleSetAdGroupBids, googleSetConversionGoal, googleSetKeywordBid, googleUploadConversions, googleUploadImageAsset, logsGet, logsList, mediaCreate, mediaDelete, mediaGet, mediaList, mediaUpdate, metaAccount, metaAd, metaAds, metaAdset, metaAdsets, metaCampaign, metaCampaigns, metaInsights, postsCreate, postsDelete, postsGet, postsList, postsUpdate, postsValidate, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint } from './chunk-XXB7GZ3H.js';
2
- import './chunk-EFB6IKZF.js';
1
+ export { PostrunError, connectionsConnect, connectionsDelete, connectionsGet, connectionsListAccounts, connectionsListByProfile, connectionsSelect, createPostrunClient, googleCreateAd, googleCreateAdGroup, googleCreateBudget, googleCreateCampaign, googleCreateConversionAction, googleCreateDisplayAd, googleCreateKeyword, googleDeleteAd, googleDeleteAdGroup, googleDeleteBudget, googleDeleteCampaign, googleDeleteKeyword, googleEditAdGroup, googleEditBudget, googleEditCampaign, googleEnableAd, googleEnableAdGroup, googleEnableCampaign, googleEnableKeyword, googleGetAccount, googleGetAd, googleGetAdGroup, googleGetCampaign, googleGetConversionAction, googleGetInsights, googleGetKeyword, googleListAdGroups, googleListAds, googleListCampaigns, googleListConversionActions, googleListConversionGoals, googleListKeywords, googlePauseAd, googlePauseAdGroup, googlePauseCampaign, googlePauseKeyword, googleRunGaql, googleSetAdGroupBids, googleSetConversionGoal, googleSetKeywordBid, googleUploadConversions, googleUploadImageAsset, logsGet, logsList, mediaCreate, mediaDelete, mediaGet, mediaList, mediaUpdate, metaAccount, metaAd, metaAds, metaAdset, metaAdsets, metaCampaign, metaCampaigns, metaInsights, postsCreate, postsDelete, postsGet, postsList, postsUpdate, postsValidate, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tiktokCreatorInfo, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint } from './chunk-YVCFLH5K.js';
2
+ import './chunk-GOQVIAPL.js';
3
+
4
+ // src/resources.ts
5
+ var isPublished = (post) => post.status === "published";
6
+ var failedVariants = (post) => post.variants.filter((variant) => variant.status === "failed");
7
+
8
+ // src/tiktok.ts
9
+ function tiktokPrivacyLabel(value) {
10
+ switch (value) {
11
+ case "PUBLIC_TO_EVERYONE":
12
+ return "Everyone";
13
+ case "MUTUAL_FOLLOW_FRIENDS":
14
+ return "Friends";
15
+ case "FOLLOWER_OF_CREATOR":
16
+ return "Followers";
17
+ case "SELF_ONLY":
18
+ return "Only you";
19
+ }
20
+ }
3
21
 
4
22
  // src/compose.ts
5
23
  var ComposeError = class extends Error {
@@ -190,6 +208,6 @@ function buildUpdatePost(input, connections = []) {
190
208
  };
191
209
  }
192
210
 
193
- export { ComposeError, POST_PLATFORMS, buildCreatePost, buildUpdatePost, isPostPlatform };
211
+ export { ComposeError, POST_PLATFORMS, buildCreatePost, buildUpdatePost, failedVariants, isPostPlatform, isPublished, tiktokPrivacyLabel };
194
212
  //# sourceMappingURL=index.js.map
195
213
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/compose.ts"],"names":[],"mappings":";;;;AA8EO,IAAM,YAAA,GAAN,cAA2B,KAAA,CAAM;AAAA,EACtC,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,cAAA;AAAA,EACd;AACF;AA+BA,SAAS,WAAW,KAAA,EAA8B;AAChD,EAAA,IAAI,MAAA,GAAS,CAAA;AACb,EAAA,IAAI,MAAA,GAAS,CAAA;AACb,EAAA,IAAI,SAAA,GAAY,CAAA;AAChB,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACxB,IAAA,IAAI,IAAA,CAA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A,IACnB,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,MAAM,KAAA,CAAM,IAAA,GAAO,CAAC,GAAG,KAAA,CAAM,IAAI,CAAA,GAAI,MAAA;AAAA,IACrC,OAAO,KAAA,CAAM,KAAA;AAAA,IACb,SAAS,KAAA,CAAM,MAAA;AAAA,IACf,QAAA,EAAU,KAAA,CAAM,QAAA,GACZ,aAAA,CAAc,KAAA,CAAM,OAAA,IAAW,EAAC,EAAG,KAAA,CAAM,QAAA,EAAU,WAAW,CAAA,GAC9D;AAAA,GACN;AACF","file":"index.js","sourcesContent":["import type {\n Connection,\n CreatePostInput,\n MediaResource,\n PostMetadata,\n PostPlatform,\n PostTypeFor,\n PostVariantInput,\n PublishMode,\n SettingsFor,\n UpdatePostInput,\n} from './resources';\n\n/* --------------------------------- types --------------------------------- */\n\n/** A media attachment — the uploaded asset (or just its id + kind). */\nexport type MediaInput = Pick<MediaResource, 'id' | 'kind'>;\n\n/** Base content, shared across channels unless a channel overrides it. */\nexport interface PostContent {\n body?: string;\n media?: readonly MediaInput[];\n}\n\n/**\n * One channel's config. The SDK owns the plumbing (connection, media, assembly)\n * and derives `post_type` from the media; the CUSTOMER owns `settings` — the\n * platform's native, fully-typed config. An Instagram setting on an X channel is\n * a compile error. `postType` is an optional override of the derived value.\n */\nexport interface ChannelConfig<P extends PostPlatform> {\n settings: SettingsFor<P>;\n postType?: PostTypeFor<P>;\n body?: string;\n media?: readonly MediaInput[];\n connectionId?: string;\n}\n\n/** Channels keyed by platform — each value typed to that platform. */\nexport type Channels = { [P in PostPlatform]?: ChannelConfig<P> };\n\nexport interface ComposePostInput {\n profileId: string;\n content?: PostContent;\n channels: Channels;\n publish?: PublishMode;\n scheduleAt?: string;\n externalId?: string;\n metadata?: PostMetadata;\n tags?: readonly string[];\n notes?: string;\n dryRun?: boolean;\n}\n\n/** A post edit. Omit `channels` for a light edit; include it to rebuild variants. */\nexport interface ComposeUpdateInput {\n content?: PostContent;\n channels?: Channels;\n publish?: PublishMode;\n scheduleAt?: string;\n externalId?: string;\n metadata?: PostMetadata;\n tags?: readonly string[];\n notes?: string;\n dryRun?: boolean;\n}\n\n/** The connections a build resolves against (accepts a full `Connection[]`). */\nexport type ConnectionRef = Pick<Connection, 'id' | 'platform'>;\n\n/**\n * Thrown only for a genuine USAGE error the SDK can't paper over — an\n * unresolvable connection, or a build with zero channels. It is NEVER thrown for\n * a media/`post_type` combination: validity (which media pair with which\n * post_type, document support, count limits, …) is the SERVER's job, surfaced as\n * typed `ValidationIssue`s by `POST /v1/posts/validate`. `derivePostType` is\n * best-effort SUGAR, so the SDK can always build an in-progress composition.\n */\nexport class ComposeError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ComposeError';\n }\n}\n\ntype VariantFor<P extends PostPlatform> = Extract<PostVariantInput, { platform: P }>;\n\n/* ----------------------------- platform handlers -------------------------- */\n\n/** What a handler receives once `post_type` is resolved (derived or explicit). */\ninterface ResolvedChannel<P extends PostPlatform> {\n settings: SettingsFor<P>;\n postType: PostTypeFor<P>;\n connectionId: string;\n body: string | undefined;\n media: readonly { media_id: string }[];\n}\n\n/**\n * Each platform implements two layers:\n * - `derivePostType` — the SUGAR: a BEST-EFFORT default `post_type` guessed from\n * the media. Pure and TOTAL — it NEVER throws and never decides validity; it\n * only runs when the caller doesn't pass `postType`. The SERVER\n * (`POST /v1/posts/validate`) is the sole authority on whether the\n * composition is publishable, returning typed `ValidationIssue`s.\n * - `buildVariant` — the explicit CORE: assemble the typed variant from a\n * resolved channel. Passes `settings` straight through (the customer owns it).\n * Splitting them keeps the core stable and the derivation purely additive.\n */\ninterface PlatformHandler<P extends PostPlatform> {\n derivePostType(media: readonly MediaInput[]): PostTypeFor<P>;\n buildVariant(resolved: ResolvedChannel<P>): VariantFor<P>;\n}\n\nfunction countKinds(media: readonly MediaInput[]) {\n let images = 0;\n let videos = 0;\n let documents = 0;\n for (const item of media) {\n if (item.kind === 'video') videos += 1;\n else if (item.kind === 'document') documents += 1;\n else images += 1; // image | gif\n }\n return { images, videos, documents };\n}\n\n/**\n * X / LinkedIn / Facebook have no mixed-media placement: a post is text, images,\n * OR a single video. This is a BEST-EFFORT guess — it never throws. When a video\n * is present it wins the placement (`video`/`reel`), else 2+ images is\n * `multi_image` and a lone item is `single_image`. The SERVER rules on whether\n * the actual combination (a blend, >1 video, a document) is publishable.\n */\nfunction deriveSinglePlacement<V extends 'video' | 'reel'>(\n media: readonly MediaInput[],\n videoType: V,\n): 'single_image' | 'multi_image' | V {\n const { images, videos } = countKinds(media);\n if (videos >= 1) return videoType;\n return images >= 2 ? 'multi_image' : 'single_image';\n}\n\nconst xHandler: PlatformHandler<'x'> = {\n derivePostType: (media) => {\n if (media.length === 0) return 'text';\n return deriveSinglePlacement(media, 'video');\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'x',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst linkedInHandler: PlatformHandler<'linkedin'> = {\n derivePostType: (media) => {\n if (media.length === 0) return 'text';\n if (countKinds(media).documents > 0) {\n // A document rides as a `single_image` post_type; the customer sets\n // `content_kind: 'document'` in settings — we don't infer it. Best-effort:\n // multi-document is a server concern, not a local throw.\n return 'single_image';\n }\n return deriveSinglePlacement(media, 'video');\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'linkedin',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst facebookHandler: PlatformHandler<'facebook_page'> = {\n derivePostType: (media) => {\n if (media.length === 0) return 'text';\n return deriveSinglePlacement(media, 'reel');\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'facebook_page',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst instagramHandler: PlatformHandler<'instagram'> = {\n derivePostType: (media) => {\n // Best-effort: empty media falls back to `single_image` (the server rules on\n // whether Instagram needs media). 2+ items is a carousel (the API allows it\n // to mix image/gif/video); a lone video is a reel, else a single image.\n if (media.length >= 2) return 'carousel';\n return countKinds(media).videos === 1 ? 'reel' : 'single_image';\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'instagram',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst tiktokHandler: PlatformHandler<'tiktok'> = {\n derivePostType: (media) => {\n // Best-effort: TikTok keeps video and photo posts separate (a video post is\n // one standalone video; photos form a single image or a multi-photo\n // carousel). A video present wins `video`; else 2+ images is a carousel and a\n // lone item is `single_image`. The SERVER rules on a blend / >1 video / docs /\n // empty media.\n const { images, videos } = countKinds(media);\n if (videos >= 1) return 'video';\n return images >= 2 ? 'carousel' : 'single_image';\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'tiktok',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\n/**\n * The handler registry. A `Record<PostPlatform, …>` (no optional keys), so a\n * platform the contract defines without a handler here is a COMPILE ERROR.\n */\nconst PLATFORM_HANDLERS: { [P in PostPlatform]: PlatformHandler<P> } = {\n x: xHandler,\n linkedin: linkedInHandler,\n facebook_page: facebookHandler,\n instagram: instagramHandler,\n tiktok: tiktokHandler,\n};\n\n/** Narrow any platform string to a posting platform. */\nexport function isPostPlatform(value: string): value is PostPlatform {\n return Object.prototype.hasOwnProperty.call(PLATFORM_HANDLERS, value);\n}\n\n/** Posting platforms — the single source, derived from the handler registry\n * (the `.filter` type-guard narrows `string[]` → `PostPlatform[]`, cast-free). */\nexport const POST_PLATFORMS: PostPlatform[] =\n Object.keys(PLATFORM_HANDLERS).filter(isPostPlatform);\n\n/* -------------------------------- assembly -------------------------------- */\n\nfunction resolveConnectionId(\n platform: PostPlatform,\n connectionId: string | undefined,\n connections: readonly ConnectionRef[],\n): string {\n if (connectionId) return connectionId;\n const match = connections.find((connection) => connection.platform === platform);\n if (!match) {\n throw new ComposeError(\n `No connection for \"${platform}\" on this profile. Connect the account or pass connectionId.`,\n );\n }\n return match.id;\n}\n\n/** Resolve one channel into its typed variant. Generic over the concrete `P`, so\n * the handler / config / result stay correlated with no cast. */\nfunction buildChannel<P extends PostPlatform>(\n handler: PlatformHandler<P>,\n platform: P,\n config: ChannelConfig<P>,\n content: PostContent,\n connections: readonly ConnectionRef[],\n): VariantFor<P> {\n const media = config.media ?? content.media ?? [];\n return handler.buildVariant({\n settings: config.settings,\n postType: config.postType ?? handler.derivePostType(media),\n connectionId: resolveConnectionId(platform, config.connectionId, connections),\n body: config.body ?? content.body,\n media: media.map((item) => ({ media_id: item.id })),\n });\n}\n\n/**\n * Resolve ONE platform's channel, or `undefined` when the caller didn't include\n * it. Generic over the concrete `P`, so `channels[platform]` and\n * `PLATFORM_HANDLERS[platform]` stay correlated to the same platform with no cast.\n * Wrapping the registry lookup in this generic is what lets `buildVariants`\n * iterate `POST_PLATFORMS` (a union) without the per-member variance error.\n */\nfunction collectChannel<P extends PostPlatform>(\n platform: P,\n channels: Channels,\n content: PostContent,\n connections: readonly ConnectionRef[],\n): VariantFor<P> | undefined {\n const config = channels[platform];\n if (!config) return undefined;\n return buildChannel(\n PLATFORM_HANDLERS[platform],\n platform,\n config,\n content,\n connections,\n );\n}\n\nfunction buildVariants(\n content: PostContent,\n channels: Channels,\n connections: readonly ConnectionRef[],\n): PostVariantInput[] {\n // Driven by POST_PLATFORMS (derived from the exhaustive PLATFORM_HANDLERS), so a\n // new platform added to the registry is dispatched here automatically — no\n // hand-maintained per-platform branch to forget (the gap that once dropped TikTok).\n const variants = POST_PLATFORMS.flatMap((platform) => {\n const variant = collectChannel(platform, channels, content, connections);\n return variant ? [variant] : [];\n });\n\n if (variants.length === 0) {\n // The ONE retained composition-level guard: \"you called build with no\n // channels\" is a programmer USAGE error, not a per-end-user validity judgment.\n // It is NOT a verdict on whether any media/post_type combination is\n // publishable — that authority lives entirely on the server.\n throw new ComposeError('At least one channel is required.');\n }\n return variants;\n}\n\n/**\n * Turn an ergonomic `{ content, channels }` input into the exact\n * `CreatePostInput` the API expects — resolving each channel's connection,\n * attaching the shared/overridden media, and deriving a best-effort `post_type`\n * from that media (sugar — the server validates the real composition). The build\n * is TOTAL: it never throws for a media/post_type combination, so an in-progress\n * post can always be built to validate. The customer never assembles `variants[]`\n * or sees a `connection_id`, and owns each channel's typed `settings`.\n */\nexport function buildCreatePost(\n input: ComposePostInput,\n connections: readonly ConnectionRef[],\n): CreatePostInput {\n return {\n profile_id: input.profileId,\n publish: input.publish,\n schedule_at: input.scheduleAt,\n external_id: input.externalId,\n metadata: input.metadata,\n tags: input.tags ? [...input.tags] : undefined,\n notes: input.notes,\n dry_run: input.dryRun,\n variants: buildVariants(input.content ?? {}, input.channels, connections),\n };\n}\n\n/** The envelope fields the API counts as a real edit (`dry_run` deliberately not). */\nconst MUTABLE_ENVELOPE_KEYS = [\n 'publish',\n 'scheduleAt',\n 'externalId',\n 'metadata',\n 'tags',\n 'notes',\n] as const satisfies readonly (keyof ComposeUpdateInput)[];\n\n/**\n * Build an `UpdatePostInput`. With `channels`, the full variant set is rebuilt\n * (the API's PATCH replaces it); without it, only the envelope changes.\n */\nexport function buildUpdatePost(\n input: ComposeUpdateInput,\n connections: readonly ConnectionRef[] = [],\n): UpdatePostInput {\n const changesEnvelope = MUTABLE_ENVELOPE_KEYS.some((key) => input[key] !== undefined);\n if (!input.channels && !changesEnvelope) {\n throw new ComposeError(\n 'A post update must change at least one field — pass content/channels or an ' +\n 'envelope field (publish, scheduleAt, tags, …).',\n );\n }\n\n return {\n publish: input.publish,\n schedule_at: input.scheduleAt,\n external_id: input.externalId,\n metadata: input.metadata,\n tags: input.tags ? [...input.tags] : undefined,\n notes: input.notes,\n dry_run: input.dryRun,\n variants: input.channels\n ? buildVariants(input.content ?? {}, input.channels, connections)\n : undefined,\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/resources.ts","../src/tiktok.ts","../src/compose.ts"],"names":[],"mappings":";;;;AAqJO,IAAM,WAAA,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etResponse,\n ConnectionsListAccountsResponse,\n ConnectionsListByProfileData,\n ConnectionsListByProfileResponse,\n ConnectionsSelectData,\n MediaCreateData,\n MediaCreateResponse,\n MediaGetResponse,\n MediaListData,\n MediaListResponse,\n MediaUpdateData,\n PostsCreateData,\n PostsGetResponse,\n PostsListData,\n PostsListResponse,\n PostsUpdateData,\n PostsValidateData,\n PostsValidateResponse,\n ProfilesCreateData,\n ProfilesGetResponse,\n ProfilesListData,\n ProfilesListResponse,\n ProfilesUpdateData,\n TiktokCreatorInfoResponse,\n} from './client/types.gen';\n\n/**\n * Resource and input shapes, DERIVED from the generated Hey API operation types\n * (`*Data` = request `{ body, path, query }`, `*Response` = success body). Never\n * hand-declared — there is exactly one definition of each, sourced from the\n * contract, so `pnpm generate` keeps them in lockstep with the live API.\n */\n\n/** A profile — a client/brand workspace. */\nexport type Profile = ProfilesGetResponse;\n\n/** A page of profiles (the list envelope). */\nexport type ProfileList = ProfilesListResponse;\n\n/** Query parameters for listing profiles (filters + pagination). */\nexport type ListProfilesQuery = NonNullable<ProfilesListData['query']>;\n\n/** Request body to create a profile. */\nexport type CreateProfileInput = NonNullable<ProfilesCreateData['body']>;\n\n/** Request body to update a profile (send only what changes). */\nexport type UpdateProfileInput = NonNullable<ProfilesUpdateData['body']>;\n\n/** A connected social/ads account on a profile. */\nexport type Connection = ConnectionsGetResponse;\n\n/** A page of a profile's connections. */\nexport type ConnectionList = ConnectionsListByProfileResponse;\n\n/** Query filters for listing a profile's connections (kind / status / pagination). */\nexport type ListConnectionsQuery = NonNullable<\n ConnectionsListByProfileData['query']\n>;\n\n/** A connection's kind — `posting` (social) or `ads`. From the contract. */\nexport type ConnectionKind = NonNullable<ListConnectionsQuery['kind']>;\n\n/** A connection's lifecycle status — `pending` / `active` / `needs_reauth`. */\nexport type ConnectionStatus = NonNullable<ListConnectionsQuery['status']>;\n\n/** The session returned when starting a connect (OAuth) flow. */\nexport type ConnectSession = ConnectionsConnectResponse;\n\n/** A platform a connection can start an OAuth connect flow for. */\nexport type ConnectablePlatform =\n NonNullable<ConnectionsConnectData['body']>['platform'];\n\n/** Accounts discoverable on a pending connection, for the selection step. */\nexport type DiscoverableAccountList = ConnectionsListAccountsResponse;\n\n/**\n * A TikTok creator's live publish options for a connection — the data TikTok's\n * Content Posting policy REQUIRES the publishing UI to render: `creator`\n * (nickname + avatar), the `privacy_options` to offer (with NO default), the\n * positive `interaction` (allowed) flags for Comment/Duet/Stitch toggles, and\n * `max_video_duration_sec`. Derived from the contract, never hand-declared.\n */\nexport type TikTokCreatorInfo = TiktokCreatorInfoResponse;\n\n/**\n * One TikTok privacy level — a member of the closed audience union\n * (`PUBLIC_TO_EVERYONE` / `MUTUAL_FOLLOW_FRIENDS` / `FOLLOWER_OF_CREATOR` /\n * `SELF_ONLY`). The per-account ALLOWED subset is `TikTokCreatorInfo.privacy_options`;\n * this is one value from it (what you bind a dropdown option to). Derived from\n * the contract, never hand-declared; render it with {@link tiktokPrivacyLabel}.\n */\nexport type TikTokPrivacyLevel = TikTokCreatorInfo['privacy_options'][number];\n\n/** Request body to select an account on a pending connection. */\nexport type SelectAccountInput = NonNullable<ConnectionsSelectData['body']>;\n\n/** The create/update post body, derived from the contract. */\ntype CreatePostBody = NonNullable<PostsCreateData['body']>;\n\n/**\n * One channel's variant on WRITE — the per-platform discriminated-union member\n * with fully typed native `settings`. Preferred over the read resource's variant\n * for anything that inspects settings (on read, `settings` is an opaque record);\n * it is also the compose-time shape, which is exactly what a live preview renders.\n */\nexport type PostVariantInput = CreatePostBody['variants'][number];\n\n/** The X (Twitter) member of the write variant union — typed native settings\n * (`quote_tweet_id`, `reply`, `poll`, …). Narrowed from the contract, never\n * hand-declared. */\nexport type XPostVariant = Extract<PostVariantInput, { platform: 'x' }>;\n\n/** The LinkedIn member of the write variant union — typed native settings\n * (`content_kind`, `visibility`, `article`, `poll`, `document`, `mentions`).\n * Narrowed from the contract, never hand-declared. */\nexport type LinkedInPostVariant = Extract<\n PostVariantInput,\n { platform: 'linkedin' }\n>;\n\n/** A post — its variants, schedule, and derived status (the read resource). */\nexport type Post = PostsGetResponse;\n\n/**\n * One per-platform variant on a RETURNED post (the read resource): its own\n * `status`, a typed `error` ({@link PostVariantError}) when it failed, and a\n * `result` (platform id + permalink) when it published. Derived from the post\n * resource, never hand-declared. (For inspecting compose-time native `settings`,\n * prefer {@link PostVariantInput}; on read `settings` is opaque.)\n */\nexport type PostVariant = Post['variants'][number];\n\n/**\n * A variant's typed publish failure — `{ code, message }`. The `code` is the\n * adapter's own minted reason (`x_access_not_permitted`, `linkedin_auth_expired`,\n * …); it stays a `string` because adapter codes are minted outside the API's\n * closed registry. Derived from the variant, never hand-declared.\n */\nexport type PostVariantError = NonNullable<PostVariant['error']>;\n\n/**\n * Did the post fully publish? `true` ONLY when the rollup `status` is\n * `'published'` — `partially_published` and `failed` are NOT success. The single\n * pure predicate every surface (SDK, React hook, composer) shares, so \"success\"\n * has exactly one definition.\n */\nexport const isPublished = (post: Post): boolean =>\n post.status === 'published';\n\n/**\n * The variants that FAILED to publish, each carrying its typed {@link\n * PostVariantError}. Empty when none failed. The pure helper behind\n * `useCreatePost().failedVariants` — usable directly from a non-React caller so\n * the \"which platforms failed, and why\" projection has one definition.\n */\nexport const failedVariants = (post: Post): PostVariant[] =>\n post.variants.filter((variant) => variant.status === 'failed');\n\n/** A page of posts (the calendar/queue list). */\nexport type PostList = PostsListResponse;\n\n/** Query parameters for listing posts (filters + pagination). */\nexport type ListPostsQuery = NonNullable<PostsListData['query']>;\n\n/**\n * A post's derived rollup status — the values accepted by the list `status`\n * filter (draft / scheduled / publishing / partially_published / published /\n * failed). Sourced from the generated query contract, never hand-listed.\n */\nexport type PostStatus = NonNullable<ListPostsQuery['status']>[number];\n\n/** The full create-post request body — what `buildCreatePost` produces. */\nexport type CreatePostInput = CreatePostBody;\n\n/** The update-post request body — what `buildUpdatePost` produces. */\nexport type UpdatePostInput = NonNullable<PostsUpdateData['body']>;\n\n/**\n * The validate-post request body — the composition-only subset of the create\n * body (`profile_id` + `variants`). `buildCreatePost` produces a superset, so\n * its output is structurally assignable here. Derived from the contract.\n */\nexport type ValidatePostInput = NonNullable<PostsValidateData['body']>;\n\n/**\n * The server's publish-readiness verdict for a composed post — `{ object,\n * publishable, issues }`. The SERVER is the sole authority on validity; the SDK\n * only builds a best-effort payload and relays this result. Derived from the\n * contract, never hand-declared.\n */\nexport type PostValidation = PostsValidateResponse;\n\n/**\n * One typed, per-variant problem in a `PostValidation` — a closed-registry\n * `code`, a human `message`, the `variant_index` + `path` it applies to, and the\n * optional `hint`/`allowed`/`got` the rule produced. Narrowed from the contract.\n */\nexport type ValidationIssue = PostValidation['issues'][number];\n\n/** A posting platform — the variant discriminator (x / linkedin / …). */\nexport type PostPlatform = PostVariantInput['platform'];\n\n/** The allowed `post_type` union for a given platform. */\nexport type PostTypeFor<P extends PostPlatform> = Extract<\n PostVariantInput,\n { platform: P }\n>['post_type'];\n\n/** The native `settings` shape for a given platform (typed per channel). */\nexport type SettingsFor<P extends PostPlatform> = Extract<\n PostVariantInput,\n { platform: P }\n>['settings'];\n\n/** Publish mode: `now` | `schedule` | `draft`. */\nexport type PublishMode = NonNullable<CreatePostBody['publish']>;\n\n/** Customer metadata on a post (the shared scalar map). */\nexport type PostMetadata = NonNullable<CreatePostBody['metadata']>;\n\n/** A media asset (image/video/gif/document) with its per-platform renditions. */\nexport type MediaResource = MediaGetResponse;\n\n/**\n * A media asset's kind (image / video / gif / document), from the contract. The\n * resource's `kind` is nullable only in the transient pre-detection `uploading`\n * window; this is the concrete family, so it strips that null — what you pass to\n * create/upload and switch over on a settled asset.\n */\nexport type MediaKind = NonNullable<MediaResource['kind']>;\n\n/** A media render target — a post platform or `google_ads`. */\nexport type MediaTarget = NonNullable<\n NonNullable<MediaCreateData['body']>['targets']\n>[number];\n\n/** The create-media response: the resource plus a signed upload target. */\nexport type CreateMediaResult = MediaCreateResponse;\n\n/** The signed direct-to-storage upload target returned on create. */\nexport type UploadTarget = NonNullable<CreateMediaResult['upload']>;\n\n/** Request body to create a media asset. */\nexport type CreateMediaInput = NonNullable<MediaCreateData['body']>;\n\n/** Request body to update a media asset (alt text / metadata / extend targets). */\nexport type UpdateMediaInput = NonNullable<MediaUpdateData['body']>;\n\n/** A page of media assets (the list envelope). */\nexport type MediaList = MediaListResponse;\n\n/** Query parameters for listing media (filters + pagination). */\nexport type ListMediaQuery = NonNullable<MediaListData['query']>;\n\n/**\n * A media asset's lifecycle state — the values the list `status` filter accepts\n * (uploading / processing / ready / failed). From the contract, never hand-listed.\n */\nexport type MediaStatus = NonNullable<ListMediaQuery['status']>;\n\n/**\n * Customer metadata — a flat scalar map (`string | number | boolean`; ≤50 keys,\n * keys ≤40 chars, ≤500-char strings, 16 KiB serialized). The contract uses this\n * SAME shape on every stored resource (profiles / posts / media); this alias is\n * derived from the media write body as a stable representative, so it's the type\n * to annotate metadata you send — never `Record<string, unknown>`. (The three\n * resources share one structural shape in the spec; were the API ever to diverge\n * one, prefer that resource's own `*['metadata']` for it.)\n */\nexport type Metadata = NonNullable<CreateMediaInput['metadata']>;\n\n/**\n * A metadata filter for list endpoints — the same scalar map, matched by exact\n * containment (multiple keys ANDed; omit for no filter). Pass the object directly\n * from the SDK/React hooks; the client URL-encodes it for the REST query.\n */\nexport type MetadataFilter = NonNullable<ListMediaQuery['metadata']>;\n","import type { TikTokPrivacyLevel } from './resources';\n\n/**\n * Map a TikTok privacy level to a short, human label for the composer's privacy\n * dropdown — the presentation the API deliberately keeps OFF the wire (the\n * `creator-info` response returns the typed `privacy_options`; the SDK owns how\n * they read).\n *\n * Exhaustive over the closed `TikTokPrivacyLevel` union with no `default` branch,\n * so adding a TikTok privacy level upstream surfaces as a compile error here\n * rather than silently rendering a raw enum string.\n */\nexport function tiktokPrivacyLabel(value: TikTokPrivacyLevel): string {\n switch (value) {\n case 'PUBLIC_TO_EVERYONE':\n return 'Everyone';\n case 'MUTUAL_FOLLOW_FRIENDS':\n return 'Friends';\n case 'FOLLOWER_OF_CREATOR':\n return 'Followers';\n case 'SELF_ONLY':\n return 'Only you';\n }\n}\n","import type {\n Connection,\n CreatePostInput,\n MediaResource,\n PostMetadata,\n PostPlatform,\n PostTypeFor,\n PostVariantInput,\n PublishMode,\n SettingsFor,\n UpdatePostInput,\n} from './resources';\n\n/* --------------------------------- types --------------------------------- */\n\n/** A media attachment — the uploaded asset (or just its id + kind). */\nexport type MediaInput = Pick<MediaResource, 'id' | 'kind'>;\n\n/** Base content, shared across channels unless a channel overrides it. */\nexport interface PostContent {\n body?: string;\n media?: readonly MediaInput[];\n}\n\n/**\n * One channel's config. The SDK owns the plumbing (connection, media, assembly)\n * and derives `post_type` from the media; the CUSTOMER owns `settings` — the\n * platform's native, fully-typed config. An Instagram setting on an X channel is\n * a compile error. `postType` is an optional override of the derived value.\n */\nexport interface ChannelConfig<P extends PostPlatform> {\n settings: SettingsFor<P>;\n postType?: PostTypeFor<P>;\n body?: string;\n media?: readonly MediaInput[];\n connectionId?: string;\n}\n\n/** Channels keyed by platform — each value typed to that platform. */\nexport type Channels = { [P in PostPlatform]?: ChannelConfig<P> };\n\nexport interface ComposePostInput {\n profileId: string;\n content?: PostContent;\n channels: Channels;\n publish?: PublishMode;\n scheduleAt?: string;\n externalId?: string;\n metadata?: PostMetadata;\n tags?: readonly string[];\n notes?: string;\n dryRun?: boolean;\n}\n\n/** A post edit. Omit `channels` for a light edit; include it to rebuild variants. */\nexport interface ComposeUpdateInput {\n content?: PostContent;\n channels?: Channels;\n publish?: PublishMode;\n scheduleAt?: string;\n externalId?: string;\n metadata?: PostMetadata;\n tags?: readonly string[];\n notes?: string;\n dryRun?: boolean;\n}\n\n/** The connections a build resolves against (accepts a full `Connection[]`). */\nexport type ConnectionRef = Pick<Connection, 'id' | 'platform'>;\n\n/**\n * Thrown only for a genuine USAGE error the SDK can't paper over — an\n * unresolvable connection, or a build with zero channels. It is NEVER thrown for\n * a media/`post_type` combination: validity (which media pair with which\n * post_type, document support, count limits, …) is the SERVER's job, surfaced as\n * typed `ValidationIssue`s by `POST /v1/posts/validate`. `derivePostType` is\n * best-effort SUGAR, so the SDK can always build an in-progress composition.\n */\nexport class ComposeError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'ComposeError';\n }\n}\n\ntype VariantFor<P extends PostPlatform> = Extract<PostVariantInput, { platform: P }>;\n\n/* ----------------------------- platform handlers -------------------------- */\n\n/** What a handler receives once `post_type` is resolved (derived or explicit). */\ninterface ResolvedChannel<P extends PostPlatform> {\n settings: SettingsFor<P>;\n postType: PostTypeFor<P>;\n connectionId: string;\n body: string | undefined;\n media: readonly { media_id: string }[];\n}\n\n/**\n * Each platform implements two layers:\n * - `derivePostType` — the SUGAR: a BEST-EFFORT default `post_type` guessed from\n * the media. Pure and TOTAL — it NEVER throws and never decides validity; it\n * only runs when the caller doesn't pass `postType`. The SERVER\n * (`POST /v1/posts/validate`) is the sole authority on whether the\n * composition is publishable, returning typed `ValidationIssue`s.\n * - `buildVariant` — the explicit CORE: assemble the typed variant from a\n * resolved channel. Passes `settings` straight through (the customer owns it).\n * Splitting them keeps the core stable and the derivation purely additive.\n */\ninterface PlatformHandler<P extends PostPlatform> {\n derivePostType(media: readonly MediaInput[]): PostTypeFor<P>;\n buildVariant(resolved: ResolvedChannel<P>): VariantFor<P>;\n}\n\nfunction countKinds(media: readonly MediaInput[]) {\n let images = 0;\n let videos = 0;\n let documents = 0;\n for (const item of media) {\n if (item.kind === 'video') videos += 1;\n else if (item.kind === 'document') documents += 1;\n else images += 1; // image | gif\n }\n return { images, videos, documents };\n}\n\n/**\n * X / LinkedIn / Facebook have no mixed-media placement: a post is text, images,\n * OR a single video. This is a BEST-EFFORT guess — it never throws. When a video\n * is present it wins the placement (`video`/`reel`), else 2+ images is\n * `multi_image` and a lone item is `single_image`. The SERVER rules on whether\n * the actual combination (a blend, >1 video, a document) is publishable.\n */\nfunction deriveSinglePlacement<V extends 'video' | 'reel'>(\n media: readonly MediaInput[],\n videoType: V,\n): 'single_image' | 'multi_image' | V {\n const { images, videos } = countKinds(media);\n if (videos >= 1) return videoType;\n return images >= 2 ? 'multi_image' : 'single_image';\n}\n\nconst xHandler: PlatformHandler<'x'> = {\n derivePostType: (media) => {\n if (media.length === 0) return 'text';\n return deriveSinglePlacement(media, 'video');\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'x',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst linkedInHandler: PlatformHandler<'linkedin'> = {\n derivePostType: (media) => {\n if (media.length === 0) return 'text';\n if (countKinds(media).documents > 0) {\n // A document rides as a `single_image` post_type; the customer sets\n // `content_kind: 'document'` in settings — we don't infer it. Best-effort:\n // multi-document is a server concern, not a local throw.\n return 'single_image';\n }\n return deriveSinglePlacement(media, 'video');\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'linkedin',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst facebookHandler: PlatformHandler<'facebook_page'> = {\n derivePostType: (media) => {\n if (media.length === 0) return 'text';\n return deriveSinglePlacement(media, 'reel');\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'facebook_page',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst instagramHandler: PlatformHandler<'instagram'> = {\n derivePostType: (media) => {\n // Best-effort: empty media falls back to `single_image` (the server rules on\n // whether Instagram needs media). 2+ items is a carousel (the API allows it\n // to mix image/gif/video); a lone video is a reel, else a single image.\n if (media.length >= 2) return 'carousel';\n return countKinds(media).videos === 1 ? 'reel' : 'single_image';\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'instagram',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\nconst tiktokHandler: PlatformHandler<'tiktok'> = {\n derivePostType: (media) => {\n // Best-effort: TikTok keeps video and photo posts separate (a video post is\n // one standalone video; photos form a single image or a multi-photo\n // carousel). A video present wins `video`; else 2+ images is a carousel and a\n // lone item is `single_image`. The SERVER rules on a blend / >1 video / docs /\n // empty media.\n const { images, videos } = countKinds(media);\n if (videos >= 1) return 'video';\n return images >= 2 ? 'carousel' : 'single_image';\n },\n buildVariant: ({ settings, postType, connectionId, body, media }) => ({\n platform: 'tiktok',\n post_type: postType,\n connection_id: connectionId,\n body,\n media: [...media],\n settings,\n }),\n};\n\n/**\n * The handler registry. A `Record<PostPlatform, …>` (no optional keys), so a\n * platform the contract defines without a handler here is a COMPILE ERROR.\n */\nconst PLATFORM_HANDLERS: { [P in PostPlatform]: PlatformHandler<P> } = {\n x: xHandler,\n linkedin: linkedInHandler,\n facebook_page: facebookHandler,\n instagram: instagramHandler,\n tiktok: tiktokHandler,\n};\n\n/** Narrow any platform string to a posting platform. */\nexport function isPostPlatform(value: string): value is PostPlatform {\n return Object.prototype.hasOwnProperty.call(PLATFORM_HANDLERS, value);\n}\n\n/** Posting platforms — the single source, derived from the handler registry\n * (the `.filter` type-guard narrows `string[]` → `PostPlatform[]`, cast-free). */\nexport const POST_PLATFORMS: PostPlatform[] =\n Object.keys(PLATFORM_HANDLERS).filter(isPostPlatform);\n\n/* -------------------------------- assembly -------------------------------- */\n\nfunction resolveConnectionId(\n platform: PostPlatform,\n connectionId: string | undefined,\n connections: readonly ConnectionRef[],\n): string {\n if (connectionId) return connectionId;\n const match = connections.find((connection) => connection.platform === platform);\n if (!match) {\n throw new ComposeError(\n `No connection for \"${platform}\" on this profile. Connect the account or pass connectionId.`,\n );\n }\n return match.id;\n}\n\n/** Resolve one channel into its typed variant. Generic over the concrete `P`, so\n * the handler / config / result stay correlated with no cast. */\nfunction buildChannel<P extends PostPlatform>(\n handler: PlatformHandler<P>,\n platform: P,\n config: ChannelConfig<P>,\n content: PostContent,\n connections: readonly ConnectionRef[],\n): VariantFor<P> {\n const media = config.media ?? content.media ?? [];\n return handler.buildVariant({\n settings: config.settings,\n postType: config.postType ?? handler.derivePostType(media),\n connectionId: resolveConnectionId(platform, config.connectionId, connections),\n body: config.body ?? content.body,\n media: media.map((item) => ({ media_id: item.id })),\n });\n}\n\n/**\n * Resolve ONE platform's channel, or `undefined` when the caller didn't include\n * it. Generic over the concrete `P`, so `channels[platform]` and\n * `PLATFORM_HANDLERS[platform]` stay correlated to the same platform with no cast.\n * Wrapping the registry lookup in this generic is what lets `buildVariants`\n * iterate `POST_PLATFORMS` (a union) without the per-member variance error.\n */\nfunction collectChannel<P extends PostPlatform>(\n platform: P,\n channels: Channels,\n content: PostContent,\n connections: readonly ConnectionRef[],\n): VariantFor<P> | undefined {\n const config = channels[platform];\n if (!config) return undefined;\n return buildChannel(\n PLATFORM_HANDLERS[platform],\n platform,\n config,\n content,\n connections,\n );\n}\n\nfunction buildVariants(\n content: PostContent,\n channels: Channels,\n connections: readonly ConnectionRef[],\n): PostVariantInput[] {\n // Driven by POST_PLATFORMS (derived from the exhaustive PLATFORM_HANDLERS), so a\n // new platform added to the registry is dispatched here automatically — no\n // hand-maintained per-platform branch to forget (the gap that once dropped TikTok).\n const variants = POST_PLATFORMS.flatMap((platform) => {\n const variant = collectChannel(platform, channels, content, connections);\n return variant ? [variant] : [];\n });\n\n if (variants.length === 0) {\n // The ONE retained composition-level guard: \"you called build with no\n // channels\" is a programmer USAGE error, not a per-end-user validity judgment.\n // It is NOT a verdict on whether any media/post_type combination is\n // publishable — that authority lives entirely on the server.\n throw new ComposeError('At least one channel is required.');\n }\n return variants;\n}\n\n/**\n * Turn an ergonomic `{ content, channels }` input into the exact\n * `CreatePostInput` the API expects — resolving each channel's connection,\n * attaching the shared/overridden media, and deriving a best-effort `post_type`\n * from that media (sugar — the server validates the real composition). The build\n * is TOTAL: it never throws for a media/post_type combination, so an in-progress\n * post can always be built to validate. The customer never assembles `variants[]`\n * or sees a `connection_id`, and owns each channel's typed `settings`.\n */\nexport function buildCreatePost(\n input: ComposePostInput,\n connections: readonly ConnectionRef[],\n): CreatePostInput {\n return {\n profile_id: input.profileId,\n publish: input.publish,\n schedule_at: input.scheduleAt,\n external_id: input.externalId,\n metadata: input.metadata,\n tags: input.tags ? [...input.tags] : undefined,\n notes: input.notes,\n dry_run: input.dryRun,\n variants: buildVariants(input.content ?? {}, input.channels, connections),\n };\n}\n\n/** The envelope fields the API counts as a real edit (`dry_run` deliberately not). */\nconst MUTABLE_ENVELOPE_KEYS = [\n 'publish',\n 'scheduleAt',\n 'externalId',\n 'metadata',\n 'tags',\n 'notes',\n] as const satisfies readonly (keyof ComposeUpdateInput)[];\n\n/**\n * Build an `UpdatePostInput`. With `channels`, the full variant set is rebuilt\n * (the API's PATCH replaces it); without it, only the envelope changes.\n */\nexport function buildUpdatePost(\n input: ComposeUpdateInput,\n connections: readonly ConnectionRef[] = [],\n): UpdatePostInput {\n const changesEnvelope = MUTABLE_ENVELOPE_KEYS.some((key) => input[key] !== undefined);\n if (!input.channels && !changesEnvelope) {\n throw new ComposeError(\n 'A post update must change at least one field — pass content/channels or an ' +\n 'envelope field (publish, scheduleAt, tags, …).',\n );\n }\n\n return {\n publish: input.publish,\n schedule_at: input.scheduleAt,\n external_id: input.externalId,\n metadata: input.metadata,\n tags: input.tags ? [...input.tags] : undefined,\n notes: input.notes,\n dry_run: input.dryRun,\n variants: input.channels\n ? buildVariants(input.content ?? {}, input.channels, connections)\n : undefined,\n };\n}\n"]}