import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Whop from "../../../index.js"; import { LeadFormsClient } from "../resources/leadForms/client/Client.js"; import { PartnersClient } from "../resources/partners/client/Client.js"; import { PostsClient } from "../resources/posts/client/Client.js"; export declare namespace ExternalAccountsClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * An External Account represents an account on another platform linked to a Whop account or user, such as a Facebook page, Instagram account, TikTok account, or Klaviyo account. You connect it through OAuth or an API key, or Whop creates it for you. A connected social profile lets Whop run [ads](/api-reference/beta/ads/ad) under that profile's identity and promote its existing posts. External account IDs are prefixed `sacc_`. * * Use the External Accounts API to list connected accounts, [connect a profile through OAuth](/api-reference/beta/external-accounts/connect-an-external-account), [create a Whop-managed Facebook page or TikTok account, or connect a Klaviyo account with its API key](/api-reference/beta/external-accounts/create-an-external-account), disconnect an external account, list a connected profile's posts or a Facebook page's lead forms, and manage the creators an Instagram account runs partnership ads with. */ export declare class ExternalAccountsClient { protected readonly _options: NormalizedClientOptionsWithAuth; protected _partners: PartnersClient | undefined; protected _leadForms: LeadFormsClient | undefined; protected _posts: PostsClient | undefined; constructor(options?: ExternalAccountsClient.Options); get partners(): PartnersClient; get leadForms(): LeadFormsClient; get posts(): PostsClient; /** * Lists the external accounts linked to an account or user. * * @param {Whop.ListExternalAccountsRequest} request * @param {ExternalAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.externalAccounts.list() */ list(request?: Whop.ListExternalAccountsRequest, requestOptions?: ExternalAccountsClient.RequestOptions): Promise>; /** * Creates or returns a Whop-managed Facebook page or TikTok account for an account, or connects the account's existing Klaviyo account with a private API key. * * @param {Whop.CreateExternalAccountsRequest} request * @param {ExternalAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.externalAccounts.create({ * platform: "facebook" * }) */ create(request: Whop.CreateExternalAccountsRequest, requestOptions?: ExternalAccountsClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Starts an OAuth connection flow and returns an `authorize_url` to send the user to, where they connect an external account. Personal profile connections must be completed in a browser signed in as the Whop user who started the flow. * * @param {Whop.ConnectExternalAccountsRequest} request * @param {ExternalAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.externalAccounts.connect({ * platform: "meta_business", * redirect_url: "https://whop.com/dashboard/biz_xxxxxxxxxxxxxx/ads/settings" * }) */ connect(request: Whop.ConnectExternalAccountsRequest, requestOptions?: ExternalAccountsClient.RequestOptions): core.HttpResponsePromise; private __connect; /** * Disconnects an external account from an account or user without deleting the underlying platform account. * * @param {Whop.DeleteExternalAccountsRequest} request * @param {ExternalAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.externalAccounts.delete({ * id: "id" * }) */ delete(request: Whop.DeleteExternalAccountsRequest, requestOptions?: ExternalAccountsClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Refreshes the state of an external account. Use it to clear an `error` that has been resolved. * * @param {Whop.RefreshExternalAccountsRequest} request * @param {ExternalAccountsClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link Whop.TooManyRequestsError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.externalAccounts.refresh({ * id: "id" * }) */ refresh(request: Whop.RefreshExternalAccountsRequest, requestOptions?: ExternalAccountsClient.RequestOptions): core.HttpResponsePromise; private __refresh; }