import Response from "../util/Response"; import { AxiosPromise } from "axios"; /** Human-readable earning categories returned by influencer payout APIs. */ export type InfluencerPayoutSourceType = "campaign_compensation" | "ad_revenue_share" | "subscription_residual" | "manual_adjustment"; /** Auditable metrics and creator-content attribution attached to a payout. */ export interface InfluencerPayoutBreakdown { label?: string; payment_method?: "flat" | "performance" | "hybrid"; provider?: string; period_start?: string; period_end?: string; impressions?: number; clicks?: number; short_link_id?: string | null; short_link_click_id?: string | null; social_media_post_id?: string | null; tracking_link_label?: string | null; social_platform?: string | null; social_post_url?: string | null; } /** One campaign or advertising earning payable to the authenticated influencer. */ export interface InfluencerPayout { id: string; user_id: string; campaign_id: string; amount: number; currency: string; status: "pending" | "completed" | "failed"; payout_date?: string | null; source_type: InfluencerPayoutSourceType; source_label: string; source_reference_id?: string | null; breakdown?: InfluencerPayoutBreakdown; campaign?: Record; } /** Optional filters for the authenticated influencer's payout history. */ export interface InfluencerPayoutQuery { campaign_id?: string; month?: number; year?: number; amount?: number; status?: "pending" | "completed" | "failed"; source_type?: InfluencerPayoutSourceType; orderBy?: "created_at" | "amount"; orderDirection?: "asc" | "desc"; } /** Delivery state for the authenticated user's registered email address. */ export type EmailDeliveryState = "healthy" | "suppressed"; /** Recovery action selected by the API for the current suppression category. */ export type EmailDeliveryRecoveryAction = "none" | "self_service" | "change_email" | "contact_support"; /** Self-service and fallback actions available for an email-delivery state. */ export interface EmailDeliveryRecovery { allowed: boolean; action: EmailDeliveryRecoveryAction; requires_acknowledgement: boolean; account_verified?: boolean; change_email_path?: string; support_path?: string; } /** Current delivery state for the authenticated user's registered email. */ export interface EmailDeliveryStatus { state: EmailDeliveryState; action_required: boolean; email: string | null; category: string | null; provider: string | null; suppressed_at: string | null; display_reason: string | null; recovery: EmailDeliveryRecovery; restored_now?: boolean; } /** Explicit confirmation required to remove an eligible active suppression. */ export interface RestoreEmailDeliveryRequest { acknowledged: true; } declare class Users { /** * List all the users. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userList * * @returns promise */ static list(params?: Record): AxiosPromise>; /** * Updates a users information. Requires the users JSON Web Token (JWT) for them to update their profile. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser * * @param data The date to be passed when creating a competiton. * * @returns Promise */ static update(data: object, params?: Record): AxiosPromise>; /** * Gets the current users information based on the current Json Web Token (JWT). * * @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe * * @param user_id The id of the user to update. * @param data The data to update. * * @returns promise */ static me(params?: Record): AxiosPromise>; /** * Gets the delivery and suppression state for the authenticated user's * current registered email address. */ static emailDeliveryStatus(): AxiosPromise>; /** * Removes an eligible active suppression for the authenticated user's * current verified email address. */ static restoreEmailDelivery(data: RestoreEmailDeliveryRequest): AxiosPromise>; /** * Gets the campaigns the users has been invited too. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe * * @param user_id The id of the user to update. * @param data The data to update. * * @returns promise */ static getCampaignInvites(params?: Record): AxiosPromise>; /** * Gets the authenticated influencer's payouts from campaigns and attributed * game advertising. Advertising revenue is returned as a separate additive * source with provider-period metrics and tracking-link/social-post IDs. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe * * @param params Optional campaign, date, status, source, and ordering filters. * * @returns promise */ static getPayouts(params?: InfluencerPayoutQuery): AxiosPromise>; /** * Sync the current influencer's information. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe * * @param user_id The id of the user to update. * @param data The data to update. * * @returns promise */ static syncInfluencer(params?: Record): AxiosPromise>; /** * Create profile data for an influencer based on their synced information and social media posts. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/generateUserInfluencerProfile * * @param user_id The id of the user to update. * @param data The data to update. * * @returns promise */ static generateInfluencerProfile(params?: Record): AxiosPromise>; /** * Will follow and unfollow a user. If the user is not being following, it will follow the user. If they are following, it will unfollow the user. The current JWT is used for the follower. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userToggleFollow * * @param user_id The id fo the user to retrieve. * * @returns promise */ static followToggle(user_id: string): AxiosPromise>; /** * Show a users profile. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/showUser * * @param user_id The id of the user to delete. * @returns promise */ static profile(user_id: string): AxiosPromise>; /** * Retrieves a user's one time login token based on a users JWT. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userOneTimeLoginToken * * * @returns promise */ static oneTimeLoginToken(): AxiosPromise>; /** * Updates the avatar image for the user using a File object. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage * * @param file The file object to upload. * @param data Any additional data to pass along to the upload. * * @returns promise */ static uploadAvatarImageFile(file: File, data?: object): AxiosPromise>; /** * Updates the avatar image for the user using a Blob. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadAvatarImage * * @param blob The blob to upload. * @param data Any additional data to pass along to the upload * * @returns promise */ static uploadAvatarImageBlob(blob: Blob, data?: object): AxiosPromise>; /** * Upload a banner image for the user, as a File object. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage * * @param file The file object to upload. * @param data Any additional data to pass along to the upload. * * @returns promise */ static uploadBannerImageFile(file: File, data?: object): AxiosPromise>; /** * Upload a banner image for the user, as a Blob. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userUploadBannerImage * * @param file The blob to upload. * @param data Any additional data to pass along to the upload. * * @returns promise */ static uploadBannerImageBlob(blob: Blob, data?: object): AxiosPromise>; /** * Creates a donation page for that user by syncing their information with various * payment service. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static createDonationPage(): AxiosPromise>; /** * Clear Twitches authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearTwitchAuth(): AxiosPromise>; /** * Clear Facebook authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearFacebookAuth(): AxiosPromise>; /** * Clear Google authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearGoogleAuth(): AxiosPromise>; /** * Clear Gmail Workspace authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/clearGmailAuth * * @returns promise */ static clearGmailAuth(): AxiosPromise>; /** * Clear Stripe authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearStripeAuth(): AxiosPromise>; /** * Clear TikTok authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearTikTokAuth(): AxiosPromise>; /** * Clear YouTube authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearYoutubeAuth(): AxiosPromise>; /** * Clear Reddit authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearRedditAuth(): AxiosPromise>; /** * Clear Docusign authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/clearDocusignAuth * * @returns promise */ static clearDocusignAuth(): AxiosPromise>; /** * Clear Twitter authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearTwitterAuth(): AxiosPromise>; /** * Clear StreamElements authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static clearStreamElementsAuth(): AxiosPromise>; /** * Returns a list of tips received by the authenticated user for a given month and year * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static getTipsReceivedForMonth(params?: Record): AxiosPromise>; /** * Returns a list of tips given by the authenticated user for a given month and year. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static getTipsGivenForMonth(params?: Record): AxiosPromise>; /** * Returns the aggregated monthly tips received by the authenticated user over a certain number of months. Defaults to 12 months if not provided. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static aggregateMonthlyReceivedTips(params?: Record): AxiosPromise>; /** * Returns the aggregated monthly tips given by the authenticated user over a certain number of months. Defaults to 12 months if not provided. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static aggregateMonthlyGivenTips(params?: Record): AxiosPromise>; /** * Returns the user associated Youtube a channels a user has. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userCreateDonationPage * * @returns promise */ static getFacebookGroups(params?: Record): AxiosPromise>; /** * Add a genre to a user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser * * @param data The genre information to be passed to update the genre information. * * @returns Promise */ static addGenre(data: object, params?: Record): AxiosPromise>; /** * Remove a genre from a user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser * * @param genre_id The id of the genre to remove. * * @returns Promise */ static removeGenre(genre_id: string, params?: Record): AxiosPromise>; /** * Add a type to a user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser * * @param data The genre information to be passed to update the type information. * * @returns Promise */ static addType(data: object, params?: Record): AxiosPromise>; /** * Remove a genre from a user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/updateUser * * @param genre_id The id of the genre to remove. * * @returns Promise */ static removeType(type_id: string, params?: Record): AxiosPromise>; /** * Verify a user's account to complete their sign-up process. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/verifyAccount * * @param data The genre information to be passed to update the type information. * * @returns Promise */ static verifyAccount(data: object, params?: Record): AxiosPromise>; /** * Gets the instagram accounts associated with the user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/getInstagramAccounts * * @returns promise */ static getInstagramAccounts(params?: Record): AxiosPromise>; /** * Gets the Facebook Pages associated with the user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/getFacebookPages * * @returns Promise resolving to the list of Facebook Pages */ static getFacebookPages(params?: Record): AxiosPromise>; /** * Gets the subreddits the user is subscribed to. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubreddits * * @returns Promise resolving to the list of subreddits */ static getSubreddits(params?: Record): AxiosPromise>; /** * Gets the flairs for a specific subreddit. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditFlairs * * @param subreddit The name of the subreddit to get flairs for. * @returns Promise resolving to the list of flairs */ static getSubredditFlairs(subreddit: string, params?: Record): AxiosPromise>; /** * Search all the users with advanced meilisearch options * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userSearch * * @returns promise */ static search(params?: Record): AxiosPromise>; /** * Resends the verification email to the authenticated user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/resendVerificationEmail * * @returns Promise */ static resendVerificationEmail(): AxiosPromise>; /** * Clear Instagram authentication information from the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/clearInstagramAuth * * @returns promise */ static clearInstagramAuth(): AxiosPromise>; /** * Gets the rules for a specific subreddit. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditRules * * @param subreddit The name of the subreddit to get rules for. * @returns Promise resolving to the list of rules */ static getSubredditRules(subreddit: string, params?: Record): AxiosPromise>; /** * Get a list of games the current user has played. * Includes playtime and last played timestamps. */ static playedGames(params?: Record): AxiosPromise>; /** * Get all stats for a user, optionally filtered by title_id. */ static getProgressionStats(user_id: string, params?: { title_id?: string; }): AxiosPromise>; /** * Get all achievements for a user. */ static getProgressionAchievements(user_id: string, params?: { title_id?: string; status?: string; }): AxiosPromise>; /** * Get the raw gameplay history (Run Records) for a user. */ static getProgressionHistory(user_id: string, params?: { title_id?: string; page?: number; }): AxiosPromise>; /** * List the authenticated user's media library (clips, screenshots, AI generated). * * @param params Optional filters: { type: 'clip'|'screenshot'|'ai_generated', title_id: string } */ static listMedia(params?: Record): AxiosPromise>; /** * Add a Media record to the user's personal library. * * @param data { media_id: string, type: string, title_id?: string, label?: string, studio_metadata?: object } */ static storeMedia(data: object): AxiosPromise>; /** * Retrieve details for a specific library item. */ static viewMedia(id: string): AxiosPromise>; /** * Update a library item's label or metadata. */ static updateMedia(id: string, data: object): AxiosPromise>; /** * Remove an item from the user's library (Soft Delete). */ static deleteMedia(id: string): AxiosPromise>; /** * Apply AI transformations (Style Transfer/Upscale) to a library item. * * @param id The UUID of the UserMedia record. * @param data { prompt: string, tool: 'style_transfer'|'upscale' } */ static modifyMedia(id: string, data: { prompt: string; tool: string; }): AxiosPromise>; /** * Get AI-generated suggestions for the best 15-second window to trim a video. */ static suggestSmartTrim(id: string): AxiosPromise>; /** * Share a library item to social media as User Generated Content (UGC). * This uses the player media share route, not the developer/scheduler post route. * * @param id The UUID of the UserMedia record. * @param data Player post payload, including platform/channel/schedule options. */ static shareMedia(id: string, data: { platform: string; social_platform?: string; title?: string; content: string; status?: 'pending' | 'scheduled' | string; scheduled_at?: string; main_channel_id?: string; sub_channel_id?: string; token?: string; track_links?: boolean; media_type?: string; [key: string]: any; }): AxiosPromise>; /** * List all gifts purchased by the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userSentGifts * * @param params Optional filters: title_id, status, gift_type, min_amount, max_amount, start_date, end_date, sort_by, sort_order. * @returns promise */ static sentGifts(params?: Record): AxiosPromise>; /** * List all gifts received by the current user. * * @see https://api.glitch.fun/api/documentation#/Users%20Route/userReceivedGifts * * @param params Optional filters: title_id, status, start_date, sort_by. * @returns promise */ static receivedGifts(params?: Record): AxiosPromise>; } export default Users;