@postrun/js 1.1.0 → 1.3.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/{chunk-YMVIGQGW.js → chunk-JBNHOK3M.js} +21 -4
- package/dist/chunk-JBNHOK3M.js.map +1 -0
- package/dist/{chunk-4AAUQJXR.js → chunk-KPF3GI7Z.js} +299 -3
- package/dist/chunk-KPF3GI7Z.js.map +1 -0
- package/dist/index.cjs +320 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -7
- package/dist/index.d.ts +43 -7
- package/dist/index.js +8 -42
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +298 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +300 -1
- package/dist/schemas/index.d.ts +300 -1
- package/dist/schemas/index.js +1 -1
- package/dist/server.cjs +296 -0
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -2
- package/dist/{types.gen-BHE-5ice.d.cts → types.gen-DeuF7WVq.d.cts} +691 -4
- package/dist/{types.gen-BHE-5ice.d.ts → types.gen-DeuF7WVq.d.ts} +691 -4
- package/package.json +1 -1
- package/dist/chunk-4AAUQJXR.js.map +0 -1
- package/dist/chunk-YMVIGQGW.js.map +0 -1
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
|
|
2
|
-
export {
|
|
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-DeuF7WVq.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-DeuF7WVq.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> & {
|
|
@@ -183,6 +183,14 @@ declare const postsGet: <ThrowOnError extends boolean = true>(options: Options<P
|
|
|
183
183
|
* Edits a post and/or transitions its publish state (`draft` / `schedule` / `now`). Valid only while the post is draft or scheduled. Send only the fields to change; providing `variants` replaces the whole set.
|
|
184
184
|
*/
|
|
185
185
|
declare const postsUpdate: <ThrowOnError extends boolean = true>(options: Options<PostsUpdateData, ThrowOnError>) => RequestResult<PostsUpdateResponses, PostsUpdateErrors, ThrowOnError>;
|
|
186
|
+
/**
|
|
187
|
+
* Validate a post
|
|
188
|
+
*
|
|
189
|
+
* **Authentication.** Secret `pr_` API key, or a browser-safe frontend token granting `posts:read` scoped to the target profile.
|
|
190
|
+
*
|
|
191
|
+
* Runs the exact ownership + publish-readiness checks the create path runs under dry_run, with no side effects. Returns a per-issue verdict (`publishable` + `issues[]`) on 200; a reference to a connection/media outside the profile is a typed 422.
|
|
192
|
+
*/
|
|
193
|
+
declare const postsValidate: <ThrowOnError extends boolean = true>(options: Options<PostsValidateData, ThrowOnError>) => RequestResult<PostsValidateResponses, PostsValidateErrors, ThrowOnError>;
|
|
186
194
|
/**
|
|
187
195
|
* Retrieve the Meta ad account
|
|
188
196
|
*
|
|
@@ -791,6 +799,25 @@ type PostStatus = NonNullable<ListPostsQuery['status']>[number];
|
|
|
791
799
|
type CreatePostInput = CreatePostBody;
|
|
792
800
|
/** The update-post request body — what `buildUpdatePost` produces. */
|
|
793
801
|
type UpdatePostInput = NonNullable<PostsUpdateData['body']>;
|
|
802
|
+
/**
|
|
803
|
+
* The validate-post request body — the composition-only subset of the create
|
|
804
|
+
* body (`profile_id` + `variants`). `buildCreatePost` produces a superset, so
|
|
805
|
+
* its output is structurally assignable here. Derived from the contract.
|
|
806
|
+
*/
|
|
807
|
+
type ValidatePostInput = NonNullable<PostsValidateData['body']>;
|
|
808
|
+
/**
|
|
809
|
+
* The server's publish-readiness verdict for a composed post — `{ object,
|
|
810
|
+
* publishable, issues }`. The SERVER is the sole authority on validity; the SDK
|
|
811
|
+
* only builds a best-effort payload and relays this result. Derived from the
|
|
812
|
+
* contract, never hand-declared.
|
|
813
|
+
*/
|
|
814
|
+
type PostValidation = PostsValidateResponse;
|
|
815
|
+
/**
|
|
816
|
+
* One typed, per-variant problem in a `PostValidation` — a closed-registry
|
|
817
|
+
* `code`, a human `message`, the `variant_index` + `path` it applies to, and the
|
|
818
|
+
* optional `hint`/`allowed`/`got` the rule produced. Narrowed from the contract.
|
|
819
|
+
*/
|
|
820
|
+
type ValidationIssue = PostValidation['issues'][number];
|
|
794
821
|
/** A posting platform — the variant discriminator (x / linkedin / …). */
|
|
795
822
|
type PostPlatform = PostVariantInput['platform'];
|
|
796
823
|
/** The allowed `post_type` union for a given platform. */
|
|
@@ -900,7 +927,14 @@ interface ComposeUpdateInput {
|
|
|
900
927
|
}
|
|
901
928
|
/** The connections a build resolves against (accepts a full `Connection[]`). */
|
|
902
929
|
type ConnectionRef = Pick<Connection, 'id' | 'platform'>;
|
|
903
|
-
/**
|
|
930
|
+
/**
|
|
931
|
+
* Thrown only for a genuine USAGE error the SDK can't paper over — an
|
|
932
|
+
* unresolvable connection, or a build with zero channels. It is NEVER thrown for
|
|
933
|
+
* a media/`post_type` combination: validity (which media pair with which
|
|
934
|
+
* post_type, document support, count limits, …) is the SERVER's job, surfaced as
|
|
935
|
+
* typed `ValidationIssue`s by `POST /v1/posts/validate`. `derivePostType` is
|
|
936
|
+
* best-effort SUGAR, so the SDK can always build an in-progress composition.
|
|
937
|
+
*/
|
|
904
938
|
declare class ComposeError extends Error {
|
|
905
939
|
constructor(message: string);
|
|
906
940
|
}
|
|
@@ -912,9 +946,11 @@ declare const POST_PLATFORMS: PostPlatform[];
|
|
|
912
946
|
/**
|
|
913
947
|
* Turn an ergonomic `{ content, channels }` input into the exact
|
|
914
948
|
* `CreatePostInput` the API expects — resolving each channel's connection,
|
|
915
|
-
* attaching the shared/overridden media, and deriving `post_type`
|
|
916
|
-
* media
|
|
917
|
-
*
|
|
949
|
+
* attaching the shared/overridden media, and deriving a best-effort `post_type`
|
|
950
|
+
* from that media (sugar — the server validates the real composition). The build
|
|
951
|
+
* is TOTAL: it never throws for a media/post_type combination, so an in-progress
|
|
952
|
+
* post can always be built to validate. The customer never assembles `variants[]`
|
|
953
|
+
* or sees a `connection_id`, and owns each channel's typed `settings`.
|
|
918
954
|
*/
|
|
919
955
|
declare function buildCreatePost(input: ComposePostInput, connections: readonly ConnectionRef[]): CreatePostInput;
|
|
920
956
|
/**
|
|
@@ -923,4 +959,4 @@ declare function buildCreatePost(input: ComposePostInput, connections: readonly
|
|
|
923
959
|
*/
|
|
924
960
|
declare function buildUpdatePost(input: ComposeUpdateInput, connections?: readonly ConnectionRef[]): UpdatePostInput;
|
|
925
961
|
|
|
926
|
-
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 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, 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, 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, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint };
|
|
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 };
|
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
|
|
2
|
-
export {
|
|
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-DeuF7WVq.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-DeuF7WVq.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> & {
|
|
@@ -183,6 +183,14 @@ declare const postsGet: <ThrowOnError extends boolean = true>(options: Options<P
|
|
|
183
183
|
* Edits a post and/or transitions its publish state (`draft` / `schedule` / `now`). Valid only while the post is draft or scheduled. Send only the fields to change; providing `variants` replaces the whole set.
|
|
184
184
|
*/
|
|
185
185
|
declare const postsUpdate: <ThrowOnError extends boolean = true>(options: Options<PostsUpdateData, ThrowOnError>) => RequestResult<PostsUpdateResponses, PostsUpdateErrors, ThrowOnError>;
|
|
186
|
+
/**
|
|
187
|
+
* Validate a post
|
|
188
|
+
*
|
|
189
|
+
* **Authentication.** Secret `pr_` API key, or a browser-safe frontend token granting `posts:read` scoped to the target profile.
|
|
190
|
+
*
|
|
191
|
+
* Runs the exact ownership + publish-readiness checks the create path runs under dry_run, with no side effects. Returns a per-issue verdict (`publishable` + `issues[]`) on 200; a reference to a connection/media outside the profile is a typed 422.
|
|
192
|
+
*/
|
|
193
|
+
declare const postsValidate: <ThrowOnError extends boolean = true>(options: Options<PostsValidateData, ThrowOnError>) => RequestResult<PostsValidateResponses, PostsValidateErrors, ThrowOnError>;
|
|
186
194
|
/**
|
|
187
195
|
* Retrieve the Meta ad account
|
|
188
196
|
*
|
|
@@ -791,6 +799,25 @@ type PostStatus = NonNullable<ListPostsQuery['status']>[number];
|
|
|
791
799
|
type CreatePostInput = CreatePostBody;
|
|
792
800
|
/** The update-post request body — what `buildUpdatePost` produces. */
|
|
793
801
|
type UpdatePostInput = NonNullable<PostsUpdateData['body']>;
|
|
802
|
+
/**
|
|
803
|
+
* The validate-post request body — the composition-only subset of the create
|
|
804
|
+
* body (`profile_id` + `variants`). `buildCreatePost` produces a superset, so
|
|
805
|
+
* its output is structurally assignable here. Derived from the contract.
|
|
806
|
+
*/
|
|
807
|
+
type ValidatePostInput = NonNullable<PostsValidateData['body']>;
|
|
808
|
+
/**
|
|
809
|
+
* The server's publish-readiness verdict for a composed post — `{ object,
|
|
810
|
+
* publishable, issues }`. The SERVER is the sole authority on validity; the SDK
|
|
811
|
+
* only builds a best-effort payload and relays this result. Derived from the
|
|
812
|
+
* contract, never hand-declared.
|
|
813
|
+
*/
|
|
814
|
+
type PostValidation = PostsValidateResponse;
|
|
815
|
+
/**
|
|
816
|
+
* One typed, per-variant problem in a `PostValidation` — a closed-registry
|
|
817
|
+
* `code`, a human `message`, the `variant_index` + `path` it applies to, and the
|
|
818
|
+
* optional `hint`/`allowed`/`got` the rule produced. Narrowed from the contract.
|
|
819
|
+
*/
|
|
820
|
+
type ValidationIssue = PostValidation['issues'][number];
|
|
794
821
|
/** A posting platform — the variant discriminator (x / linkedin / …). */
|
|
795
822
|
type PostPlatform = PostVariantInput['platform'];
|
|
796
823
|
/** The allowed `post_type` union for a given platform. */
|
|
@@ -900,7 +927,14 @@ interface ComposeUpdateInput {
|
|
|
900
927
|
}
|
|
901
928
|
/** The connections a build resolves against (accepts a full `Connection[]`). */
|
|
902
929
|
type ConnectionRef = Pick<Connection, 'id' | 'platform'>;
|
|
903
|
-
/**
|
|
930
|
+
/**
|
|
931
|
+
* Thrown only for a genuine USAGE error the SDK can't paper over — an
|
|
932
|
+
* unresolvable connection, or a build with zero channels. It is NEVER thrown for
|
|
933
|
+
* a media/`post_type` combination: validity (which media pair with which
|
|
934
|
+
* post_type, document support, count limits, …) is the SERVER's job, surfaced as
|
|
935
|
+
* typed `ValidationIssue`s by `POST /v1/posts/validate`. `derivePostType` is
|
|
936
|
+
* best-effort SUGAR, so the SDK can always build an in-progress composition.
|
|
937
|
+
*/
|
|
904
938
|
declare class ComposeError extends Error {
|
|
905
939
|
constructor(message: string);
|
|
906
940
|
}
|
|
@@ -912,9 +946,11 @@ declare const POST_PLATFORMS: PostPlatform[];
|
|
|
912
946
|
/**
|
|
913
947
|
* Turn an ergonomic `{ content, channels }` input into the exact
|
|
914
948
|
* `CreatePostInput` the API expects — resolving each channel's connection,
|
|
915
|
-
* attaching the shared/overridden media, and deriving `post_type`
|
|
916
|
-
* media
|
|
917
|
-
*
|
|
949
|
+
* attaching the shared/overridden media, and deriving a best-effort `post_type`
|
|
950
|
+
* from that media (sugar — the server validates the real composition). The build
|
|
951
|
+
* is TOTAL: it never throws for a media/post_type combination, so an in-progress
|
|
952
|
+
* post can always be built to validate. The customer never assembles `variants[]`
|
|
953
|
+
* or sees a `connection_id`, and owns each channel's typed `settings`.
|
|
918
954
|
*/
|
|
919
955
|
declare function buildCreatePost(input: ComposePostInput, connections: readonly ConnectionRef[]): CreatePostInput;
|
|
920
956
|
/**
|
|
@@ -923,4 +959,4 @@ declare function buildCreatePost(input: ComposePostInput, connections: readonly
|
|
|
923
959
|
*/
|
|
924
960
|
declare function buildUpdatePost(input: ComposeUpdateInput, connections?: readonly ConnectionRef[]): UpdatePostInput;
|
|
925
961
|
|
|
926
|
-
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 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, 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, 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, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, profilesCreate, profilesDelete, profilesGet, profilesList, profilesUpdate, tokensMint, webhooksCreateEndpoint, webhooksCreatePortal, webhooksDeleteEndpoint, webhooksGetEndpoint, webhooksListEndpoints, webhooksListEventTypes, webhooksPing, webhooksUpdateEndpoint } from './chunk-
|
|
2
|
-
import './chunk-
|
|
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-JBNHOK3M.js';
|
|
2
|
+
import './chunk-KPF3GI7Z.js';
|
|
3
3
|
|
|
4
4
|
// src/compose.ts
|
|
5
5
|
var ComposeError = class extends Error {
|
|
@@ -19,29 +19,15 @@ function countKinds(media) {
|
|
|
19
19
|
}
|
|
20
20
|
return { images, videos, documents };
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
if (countKinds(media).documents > 0) {
|
|
24
|
-
throw new ComposeError(`${platform} does not support document uploads.`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function deriveSinglePlacement(media, platform, videoType) {
|
|
22
|
+
function deriveSinglePlacement(media, videoType) {
|
|
28
23
|
const { images, videos } = countKinds(media);
|
|
29
|
-
if (
|
|
30
|
-
throw new ComposeError(
|
|
31
|
-
`${platform} can't combine images and video in one post \u2014 split them into separate posts.`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
if (videos > 1) {
|
|
35
|
-
throw new ComposeError(`${platform} allows at most one video per post.`);
|
|
36
|
-
}
|
|
37
|
-
if (videos === 1) return videoType;
|
|
24
|
+
if (videos >= 1) return videoType;
|
|
38
25
|
return images >= 2 ? "multi_image" : "single_image";
|
|
39
26
|
}
|
|
40
27
|
var xHandler = {
|
|
41
28
|
derivePostType: (media) => {
|
|
42
29
|
if (media.length === 0) return "text";
|
|
43
|
-
|
|
44
|
-
return deriveSinglePlacement(media, "X", "video");
|
|
30
|
+
return deriveSinglePlacement(media, "video");
|
|
45
31
|
},
|
|
46
32
|
buildVariant: ({ settings, postType, connectionId, body, media }) => ({
|
|
47
33
|
platform: "x",
|
|
@@ -56,12 +42,9 @@ var linkedInHandler = {
|
|
|
56
42
|
derivePostType: (media) => {
|
|
57
43
|
if (media.length === 0) return "text";
|
|
58
44
|
if (countKinds(media).documents > 0) {
|
|
59
|
-
if (media.length > 1) {
|
|
60
|
-
throw new ComposeError("A LinkedIn document post takes a single document.");
|
|
61
|
-
}
|
|
62
45
|
return "single_image";
|
|
63
46
|
}
|
|
64
|
-
return deriveSinglePlacement(media, "
|
|
47
|
+
return deriveSinglePlacement(media, "video");
|
|
65
48
|
},
|
|
66
49
|
buildVariant: ({ settings, postType, connectionId, body, media }) => ({
|
|
67
50
|
platform: "linkedin",
|
|
@@ -75,8 +58,7 @@ var linkedInHandler = {
|
|
|
75
58
|
var facebookHandler = {
|
|
76
59
|
derivePostType: (media) => {
|
|
77
60
|
if (media.length === 0) return "text";
|
|
78
|
-
|
|
79
|
-
return deriveSinglePlacement(media, "Facebook", "reel");
|
|
61
|
+
return deriveSinglePlacement(media, "reel");
|
|
80
62
|
},
|
|
81
63
|
buildVariant: ({ settings, postType, connectionId, body, media }) => ({
|
|
82
64
|
platform: "facebook_page",
|
|
@@ -89,10 +71,6 @@ var facebookHandler = {
|
|
|
89
71
|
};
|
|
90
72
|
var instagramHandler = {
|
|
91
73
|
derivePostType: (media) => {
|
|
92
|
-
if (media.length === 0) {
|
|
93
|
-
throw new ComposeError("Instagram requires at least one media item.");
|
|
94
|
-
}
|
|
95
|
-
rejectDocuments(media, "Instagram");
|
|
96
74
|
if (media.length >= 2) return "carousel";
|
|
97
75
|
return countKinds(media).videos === 1 ? "reel" : "single_image";
|
|
98
76
|
},
|
|
@@ -107,20 +85,8 @@ var instagramHandler = {
|
|
|
107
85
|
};
|
|
108
86
|
var tiktokHandler = {
|
|
109
87
|
derivePostType: (media) => {
|
|
110
|
-
if (media.length === 0) {
|
|
111
|
-
throw new ComposeError("TikTok requires at least one media item.");
|
|
112
|
-
}
|
|
113
|
-
rejectDocuments(media, "TikTok");
|
|
114
88
|
const { images, videos } = countKinds(media);
|
|
115
|
-
if (
|
|
116
|
-
throw new ComposeError(
|
|
117
|
-
"TikTok can't combine images and video in one post \u2014 split them into separate posts."
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
if (videos > 1) {
|
|
121
|
-
throw new ComposeError("TikTok allows at most one video per post.");
|
|
122
|
-
}
|
|
123
|
-
if (videos === 1) return "video";
|
|
89
|
+
if (videos >= 1) return "video";
|
|
124
90
|
return images >= 2 ? "carousel" : "single_image";
|
|
125
91
|
},
|
|
126
92
|
buildVariant: ({ settings, postType, connectionId, body, media }) => ({
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/compose.ts"],"names":[],"mappings":";;;;AAuEO,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;AA4BA,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,CAAK,IAAA,KAAS,OAAA,EAAS,MAAA,IAAU,CAAA;AAAA,SAAA,IAC5B,IAAA,CAAK,IAAA,KAAS,UAAA,EAAY,SAAA,IAAa,CAAA;AAAA,SAC3C,MAAA,IAAU,CAAA;AAAA,EACjB;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,MAAA,EAAQ,SAAA,EAAU;AACrC;AAEA,SAAS,eAAA,CAAgB,OAA8B,QAAA,EAAwB;AAC7E,EAAA,IAAI,UAAA,CAAW,KAAK,CAAA,CAAE,SAAA,GAAY,CAAA,EAAG;AACnC,IAAA,MAAM,IAAI,YAAA,CAAa,CAAA,EAAG,QAAQ,CAAA,mCAAA,CAAqC,CAAA;AAAA,EACzE;AACF;AAOA,SAAS,qBAAA,CACP,KAAA,EACA,QAAA,EACA,SAAA,EACoC;AACpC,EAAA,MAAM,EAAE,MAAA,EAAQ,MAAA,EAAO,GAAI,WAAW,KAAK,CAAA;AAC3C,EAAA,IAAI,MAAA,GAAS,CAAA,IAAK,MAAA,GAAS,CAAA,EAAG;AAC5B,IAAA,MAAM,IAAI,YAAA;AAAA,MACR,GAAG,QAAQ,CAAA,kFAAA;AAAA,K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AAGA,IAAM,qBAAA,GAAwB;AAAA,EAC5B,SAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA;AAMO,SAAS,eAAA,CACd,KAAA,EACA,WAAA,GAAwC,EAAC,EACxB;AACjB,EAAA,MAAM,eAAA,GAAkB,sBAAsB,IAAA,CAAK,CAAC,QAAQ,KAAA,CAAM,GAAG,MAAM,MAAS,CAAA;AACpF,EAAA,IAAI,CAAC,KAAA,CAAM,QAAA,IAAY,CAAC,eAAA,EAAiB;AACvC,IAAA,MAAM,IAAI,YAAA;AAAA,MACR;AAAA,KAEF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,aAAa,KAAA,CAAM,UAAA;AAAA,IACnB,aAAa,KAAA,CAAM,UAAA;AAAA,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/** Thrown when a post can't be composed (no connection, unsupported media, …). */\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: guess `post_type` from the media. Pure; only\n * runs when the caller doesn't pass `postType`.\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\nfunction rejectDocuments(media: readonly MediaInput[], platform: string): void {\n if (countKinds(media).documents > 0) {\n throw new ComposeError(`${platform} does not support document uploads.`);\n }\n}\n\n/**\n * X / LinkedIn / Facebook have no mixed-media placement: a post is text, images,\n * OR a single video — never a blend. Reject the combos that have no valid\n * post_type here (a clear local error), not as a server 422.\n */\nfunction deriveSinglePlacement<V extends 'video' | 'reel'>(\n media: readonly MediaInput[],\n platform: string,\n videoType: V,\n): 'single_image' | 'multi_image' | V {\n const { images, videos } = countKinds(media);\n if (images > 0 && videos > 0) {\n throw new ComposeError(\n `${platform} can't combine images and video in one post — split them into separate posts.`,\n );\n }\n if (videos > 1) {\n throw new ComposeError(`${platform} allows at most one video per post.`);\n }\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 rejectDocuments(media, 'X');\n return deriveSinglePlacement(media, 'X', '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.\n if (media.length > 1) {\n throw new ComposeError('A LinkedIn document post takes a single document.');\n }\n return 'single_image';\n }\n return deriveSinglePlacement(media, 'LinkedIn', '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 rejectDocuments(media, 'Facebook');\n return deriveSinglePlacement(media, 'Facebook', '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 if (media.length === 0) {\n throw new ComposeError('Instagram requires at least one media item.');\n }\n rejectDocuments(media, 'Instagram');\n // 2+ items is always a carousel (the API allows it to mix image/gif/video);\n // a lone item is a reel (video) or 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 if (media.length === 0) {\n throw new ComposeError('TikTok requires at least one media item.');\n }\n rejectDocuments(media, 'TikTok');\n const { images, videos } = countKinds(media);\n // TikTok keeps video and photo posts separate: a video post is one standalone\n // video; photos form a single image or a multi-photo carousel. No blend.\n if (images > 0 && videos > 0) {\n throw new ComposeError(\n \"TikTok can't combine images and video in one post — split them into separate posts.\",\n );\n }\n if (videos > 1) {\n throw new ComposeError('TikTok allows at most one video per post.');\n }\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 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 `post_type` from that\n * media. The customer never assembles `variants[]` or sees a `connection_id`,\n * 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/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,CAAK,IAAA,KAAS,OAAA,EAAS,MAAA,IAAU,CAAA;AAAA,SAAA,IAC5B,IAAA,CAAK,IAAA,KAAS,UAAA,EAAY,SAAA,IAAa,CAAA;AAAA,SAC3C,MAAA,IAAU,CAAA;AAAA,EACjB;AACA,EAAA,OAAO,EAAE,MAAA,EAAQ,MAAA,EAAQ,SAAA,EAAU;AACrC;AASA,SAAS,qBAAA,CACP,OACA,SAAA,EACoC;AACpC,EAAA,MAAM,EAAE,MAAA,EAAQ,MAAA,EAAO,GAAI,WAAW,KAAK,CAAA;AAC3C,EAAA,IAAI,MAAA,IAAU,GAAG,OAAO,SAAA;AACxB,EAAA,OAAO,MAAA,IAAU,IAAI,aAAA,GAAgB,cAAA;AACvC;AA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AC,GAAG,KAAA,CAAM,IAAI,CAAA,GAAI,MAAA;AAAA,IACrC,OAAO,KAAA,CAAM,KAAA;AAAA,IACb,SAAS,KAAA,CAAM,MAAA;AAAA,IACf,QAAA,EAAU,cAAc,KAAA,CAAM,OAAA,IAAW,EAAC,EAAG,KAAA,CAAM,UAAU,WAAW;AAAA,GAC1E;AACF;AAGA,IAAM,qBAAA,GAAwB;AAAA,EAC5B,SAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA;AAMO,SAAS,eAAA,CACd,KAAA,EACA,WAAA,GAAwC,EAAC,EACxB;AACjB,EAAA,MAAM,eAAA,GAAkB,sBAAsB,IAAA,CAAK,CAAC,QAAQ,KAAA,CAAM,GAAG,MAAM,MAAS,CAAA;AACpF,EAAA,IAAI,CAAC,KAAA,CAAM,QAAA,IAAY,CAAC,eAAA,EAAiB;AACvC,IAAA,MAAM,IAAI,YAAA;AAAA,MACR;AAAA,KAEF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,aAAa,KAAA,CAAM,UAAA;AAAA,IACnB,aAAa,KAAA,CAAM,UAAA;AAAA,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"]}
|