import type { ApiClient } from "@promobase/sdk-runtime"; import { Cursor } from "@promobase/sdk-runtime"; import { metaPagination } from "../../pagination.ts"; import type { CTXPartnerAppWelcomeMessageFlowFields } from "./ctx-partner-app-welcome-message-flow.ts"; import type { ContentPublishingLimitResponseFields } from "./content-publishing-limit-response.ts"; import type { InsightsResultFields } from "./insights-result.ts"; import type { UnifiedThreadFields } from "./unified-thread.ts"; export interface IGUserForIGOnlyAPIFields { account_type: string; biography: string; followers_count: number; follows_count: number; id: string; media_count: number; name: string; profile_picture_url: string; user_id: number; username: string; website: string; } export interface IGUserForIGOnlyAPIListBusinessMessagingFeatureStatusParams { feature: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPIListContentPublishingLimitParams { since?: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPIListConversationsParams { folder?: string; platform?: string; tags?: string[]; user_id?: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPIListInsightsParams { breakdown?: string[]; metric: string[]; metric_type?: string; period: string[]; since?: string; timeframe?: string; until?: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPIListMediaParams { since?: string; until?: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateMediaParams { alt_text?: string; audio_name?: string; caption?: string; children?: string[]; collaborators?: string[]; cover_url?: string; image_url?: string; is_carousel_item?: boolean; location_id?: string; media_type?: string; product_tags?: Record[]; share_to_feed?: boolean; thumb_offset?: string; trial_params?: Record; upload_type?: string; user_tags?: Record[]; video_url?: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateMediapublishParams { creation_id: number; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateMentionsParams { comment_id?: string; media_id: string; message: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateMessageattachmentsParams { message: Record; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateMessagesParams { folder?: string; message?: Record; messaging_type?: string; payload?: string; recipient?: Record; reply_to?: Record; sender_action?: string; tag?: Record; thread_control?: Record; [key: string]: unknown; } export interface IGUserForIGOnlyAPIDeleteMessengerProfileParams { fields: string[]; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateMessengerProfileParams { ice_breakers?: Record[]; persistent_menu?: Record[]; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateSubscribedAppsParams { subscribed_fields: string[]; [key: string]: unknown; } export interface IGUserForIGOnlyAPIDeleteWelcomeMessageFlowsParams { flow_id?: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPIListWelcomeMessageFlowsParams { app_id?: string; flow_id?: string; [key: string]: unknown; } export interface IGUserForIGOnlyAPICreateWelcomeMessageFlowsParams { eligible_platforms?: string[]; flow_id?: string; name?: string; welcome_message_flow?: Record[]; [key: string]: unknown; } export function iGUserForIGOnlyAPINode(client: ApiClient, id: string) { return { __path: id, __brand: undefined as unknown as IGUserForIGOnlyAPIFields, get: (opts: { fields: F; params?: Record }) => client.get>(`${id}`, opts), businessMessagingFeatureStatus: )[]>(opts: { fields: F; params?: IGUserForIGOnlyAPIListBusinessMessagingFeatureStatusParams }) => new Cursor, F[number]>>(client, `${id}/business_messaging_feature_status`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), contentPublishingLimit: (opts: { fields: F; params?: IGUserForIGOnlyAPIListContentPublishingLimitParams }) => new Cursor>(client, `${id}/content_publishing_limit`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), conversations: (opts: { fields: F; params?: IGUserForIGOnlyAPIListConversationsParams }) => new Cursor>(client, `${id}/conversations`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), insights: (opts: { fields: F; params?: IGUserForIGOnlyAPIListInsightsParams }) => new Cursor>(client, `${id}/insights`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), liveMedia: )[]>(opts: { fields: F; params?: Record }) => new Cursor, F[number]>>(client, `${id}/live_media`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), media: { __path: `${id}/media`, __brand: undefined as unknown as Record, list: )[]>(opts: { fields: F; params?: IGUserForIGOnlyAPIListMediaParams }) => new Cursor, F[number]>>(client, `${id}/media`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), create: (params: IGUserForIGOnlyAPICreateMediaParams) => client.post>(`${id}/media`, params as Record), }, createMediapublish: (params: IGUserForIGOnlyAPICreateMediapublishParams) => client.post>(`${id}/mediapublish`, params as Record), createMention: (params: IGUserForIGOnlyAPICreateMentionsParams) => client.post>(`${id}/mentions`, params as Record), createMessageattachment: (params: IGUserForIGOnlyAPICreateMessageattachmentsParams) => client.post>(`${id}/messageattachments`, params as Record), createMessage: (params: IGUserForIGOnlyAPICreateMessagesParams) => client.post>(`${id}/messages`, params as Record), messengerProfile: { __path: `${id}/messenger_profile`, __brand: undefined as unknown as Record, list: )[]>(opts: { fields: F; params?: Record }) => new Cursor, F[number]>>(client, `${id}/messenger_profile`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), create: (params: IGUserForIGOnlyAPICreateMessengerProfileParams) => client.post>(`${id}/messenger_profile`, params as Record), delete: (params: IGUserForIGOnlyAPIDeleteMessengerProfileParams) => client.delete(`${id}/messenger_profile`, params as Record ?? {}), }, stories: )[]>(opts: { fields: F; params?: Record }) => new Cursor, F[number]>>(client, `${id}/stories`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), subscribedApps: { __path: `${id}/subscribed_apps`, __brand: undefined as unknown as Record, list: )[]>(opts: { fields: F; params?: Record }) => new Cursor, F[number]>>(client, `${id}/subscribed_apps`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), create: (params: IGUserForIGOnlyAPICreateSubscribedAppsParams) => client.post>(`${id}/subscribed_apps`, params as Record), delete: (params?: Record) => client.delete(`${id}/subscribed_apps`, params as Record ?? {}), }, tags: )[]>(opts: { fields: F; params?: Record }) => new Cursor, F[number]>>(client, `${id}/tags`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), welcomeMessageFlows: { __path: `${id}/welcome_message_flows`, __brand: undefined as unknown as CTXPartnerAppWelcomeMessageFlowFields, list: (opts: { fields: F; params?: IGUserForIGOnlyAPIListWelcomeMessageFlowsParams }) => new Cursor>(client, `${id}/welcome_message_flows`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), create: (params: IGUserForIGOnlyAPICreateWelcomeMessageFlowsParams) => client.post>(`${id}/welcome_message_flows`, params as Record), delete: (params: IGUserForIGOnlyAPIDeleteWelcomeMessageFlowsParams) => client.delete(`${id}/welcome_message_flows`, params as Record ?? {}), }, }; }