UNPKG

@nekofar/warpcast

Version:

TypeScript client for interacting with Warpcast APIs

2,154 lines (2,153 loc) 73.3 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/client/schemas.gen.ts var schemas_gen_exports = {}; __export(schemas_gen_exports, { ActionSchema: () => ActionSchema, ApiKeySchema: () => ApiKeySchema, AppsByAuthorResponseSchema: () => AppsByAuthorResponseSchema, AttachEmbedsResponseSchema: () => AttachEmbedsResponseSchema, BadRequestErrorSchema: () => BadRequestErrorSchema, BioSchema: () => BioSchema, BookmarkedCastSchema: () => BookmarkedCastSchema, BookmarkedCastsResponseSchema: () => BookmarkedCastsResponseSchema, CastActionSchema: () => CastActionSchema, CastCreatedResponseSchema: () => CastCreatedResponseSchema, CastHashResponseSchema: () => CastHashResponseSchema, CastQuoteSchema: () => CastQuoteSchema, CastQuotesResponseSchema: () => CastQuotesResponseSchema, CastRecastersResponseSchema: () => CastRecastersResponseSchema, CastSchema: () => CastSchema, ChannelFollowStatusResponseSchema: () => ChannelFollowStatusResponseSchema, ChannelFollowStatusSchema: () => ChannelFollowStatusSchema, ChannelFollowerSchema: () => ChannelFollowerSchema, ChannelFollowersResponseSchema: () => ChannelFollowersResponseSchema, ChannelFollowersYouKnowResponseSchema: () => ChannelFollowersYouKnowResponseSchema, ChannelListResponseSchema: () => ChannelListResponseSchema, ChannelResponseSchema: () => ChannelResponseSchema, ChannelSchema: () => ChannelSchema, ChannelStreaksResponseSchema: () => ChannelStreaksResponseSchema, ChannelUsersResponseSchema: () => ChannelUsersResponseSchema, DirectCastConversationCategorizationRequestSchema: () => DirectCastConversationCategorizationRequestSchema, DirectCastConversationCategorizationResponseSchema: () => DirectCastConversationCategorizationResponseSchema, DirectCastConversationMessageTtlRequestSchema: () => DirectCastConversationMessageTtlRequestSchema, DirectCastConversationMessageTtlResponseSchema: () => DirectCastConversationMessageTtlResponseSchema, DirectCastConversationMessagesResponseSchema: () => DirectCastConversationMessagesResponseSchema, DirectCastConversationNotificationsRequestSchema: () => DirectCastConversationNotificationsRequestSchema, DirectCastConversationNotificationsResponseSchema: () => DirectCastConversationNotificationsResponseSchema, DirectCastConversationResponseSchema: () => DirectCastConversationResponseSchema, DirectCastConversationSchema: () => DirectCastConversationSchema, DirectCastConversationViewerContextSchema: () => DirectCastConversationViewerContextSchema, DirectCastInboxResponseSchema: () => DirectCastInboxResponseSchema, DirectCastInboxResultSchema: () => DirectCastInboxResultSchema, DirectCastManuallyMarkUnreadRequestSchema: () => DirectCastManuallyMarkUnreadRequestSchema, DirectCastMessageMentionSchema: () => DirectCastMessageMentionSchema, DirectCastMessageMetadataSchema: () => DirectCastMessageMetadataSchema, DirectCastMessageReactionRequestSchema: () => DirectCastMessageReactionRequestSchema, DirectCastMessageReactionResponseSchema: () => DirectCastMessageReactionResponseSchema, DirectCastMessageReactionSchema: () => DirectCastMessageReactionSchema, DirectCastMessageSchema: () => DirectCastMessageSchema, DirectCastMessageViewerContextSchema: () => DirectCastMessageViewerContextSchema, DirectCastPinConversationRequestSchema: () => DirectCastPinConversationRequestSchema, DirectCastSendRequestSchema: () => DirectCastSendRequestSchema, DirectCastSendResponseSchema: () => DirectCastSendResponseSchema, DiscoverChannelsResponseSchema: () => DiscoverChannelsResponseSchema, DraftCastSchema: () => DraftCastSchema, DraftCreatedResponseSchema: () => DraftCreatedResponseSchema, DraftSchema: () => DraftSchema, DraftsResponseSchema: () => DraftsResponseSchema, ErrorResponseSchema: () => ErrorResponseSchema, FavoriteFramesResponseSchema: () => FavoriteFramesResponseSchema, FeedItemsResponseSchema: () => FeedItemsResponseSchema, FrameAppSchema: () => FrameAppSchema, FrameAppsResponseSchema: () => FrameAppsResponseSchema, FrameSchema: () => FrameSchema, GenericBadRequestErrorSchema: () => GenericBadRequestErrorSchema, GenericResponseSchema: () => GenericResponseSchema, HighlightedChannelsResponseSchema: () => HighlightedChannelsResponseSchema, ImageEmbedSchema: () => ImageEmbedSchema, InvitesAvailableResponseSchema: () => InvitesAvailableResponseSchema, LocationSchema: () => LocationSchema, MiniAppSchema: () => MiniAppSchema, MutedKeywordPropertiesSchema: () => MutedKeywordPropertiesSchema, MutedKeywordSchema: () => MutedKeywordSchema, MutedKeywordsResponseSchema: () => MutedKeywordsResponseSchema, NotificationsResponseSchema: () => NotificationsResponseSchema, OnboardingStateResponseSchema: () => OnboardingStateResponseSchema, OnboardingStateSchema: () => OnboardingStateSchema, PaginatedResponseSchema: () => PaginatedResponseSchema, PaginationCursorSchema: () => PaginationCursorSchema, ProfilePictureSchema: () => ProfilePictureSchema, ProfileSchema: () => ProfileSchema, RankedMiniAppSchema: () => RankedMiniAppSchema, RawChannelResponseSchema: () => RawChannelResponseSchema, RawChannelSchema: () => RawChannelSchema, RecasterSchema: () => RecasterSchema, RewardsLeaderboardResponseSchema: () => RewardsLeaderboardResponseSchema, RewardsMetadataResponseSchema: () => RewardsMetadataResponseSchema, RewardsScoresResponseSchema: () => RewardsScoresResponseSchema, SearchChannelsResponseSchema: () => SearchChannelsResponseSchema, SponsoredInvitesResponseSchema: () => SponsoredInvitesResponseSchema, StarterPackResponseSchema: () => StarterPackResponseSchema, StarterPackSchema: () => StarterPackSchema, StarterPackUpdateRequestSchema: () => StarterPackUpdateRequestSchema, StarterPackUsersResponseSchema: () => StarterPackUsersResponseSchema, StarterPacksResponseSchema: () => StarterPacksResponseSchema, SuccessResponseSchema: () => SuccessResponseSchema, SuggestedUsersResponseSchema: () => SuggestedUsersResponseSchema, TopMiniAppsResponseSchema: () => TopMiniAppsResponseSchema, UnseenCountsResponseSchema: () => UnseenCountsResponseSchema, UrlEmbedSchema: () => UrlEmbedSchema, UserAppContextResponseSchema: () => UserAppContextResponseSchema, UserByFidResponseSchema: () => UserByFidResponseSchema, UserExtrasSchema: () => UserExtrasSchema, UserPreferencesResponseSchema: () => UserPreferencesResponseSchema, UserResponseSchema: () => UserResponseSchema, UserSchema: () => UserSchema, UserThreadCastsResponseSchema: () => UserThreadCastsResponseSchema, UserWithExtrasSchema: () => UserWithExtrasSchema, UsersResponseSchema: () => UsersResponseSchema, UsersWithCountResponseSchema: () => UsersWithCountResponseSchema, ValidationErrorSchema: () => ValidationErrorSchema, VerifiedAddressSchema: () => VerifiedAddressSchema, VideoEmbedSchema: () => VideoEmbedSchema, ViewerContextSchema: () => ViewerContextSchema, WinnerSchema: () => WinnerSchema, mini_app_ViewerContextSchema: () => mini_app_ViewerContextSchema, user_response_UserResponseSchema: () => user_response_UserResponseSchema }); module.exports = __toCommonJS(schemas_gen_exports); var ProfilePictureSchema = { type: "object", properties: { url: { type: "string", format: "uri" }, verified: { type: "boolean" } } }; var BioSchema = { type: "object", properties: { text: { type: "string" }, mentions: { type: "array", items: {} }, channelMentions: { type: "array", items: {} } } }; var LocationSchema = { type: "object", properties: { placeId: { type: "string" }, description: { type: "string" } } }; var ProfileSchema = { type: "object", properties: { bio: { $ref: "#/components/schemas/Bio" }, location: { $ref: "#/components/schemas/Location" } } }; var ViewerContextSchema = { type: "object", properties: { following: { type: "boolean" }, followedBy: { type: "boolean" }, enableNotifications: { type: "boolean" }, canSendDirectCasts: { type: "boolean" }, hasUploadedInboxKeys: { type: "boolean" } } }; var UserSchema = { type: "object", required: ["fid", "displayName", "username"], properties: { fid: { type: "integer" }, username: { type: "string" }, displayName: { type: "string" }, pfp: { $ref: "#/components/schemas/ProfilePicture" }, profile: { $ref: "#/components/schemas/Profile" }, followerCount: { type: "integer" }, followingCount: { type: "integer" }, viewerContext: { $ref: "#/components/schemas/ViewerContext" } } }; var OnboardingStateSchema = { type: "object", properties: { id: { type: "string", format: "uuid" }, email: { type: "string", format: "email" }, user: { $ref: "#/components/schemas/User" }, hasOnboarding: { type: "boolean" }, hasConfirmedEmail: { type: "boolean" }, handledConnectAddress: { type: "boolean" }, canRegisterUsername: { type: "boolean" }, needsRegistrationPayment: { type: "boolean" }, hasFid: { type: "boolean" }, hasFname: { type: "boolean" }, hasDelegatedSigner: { type: "boolean" }, hasSetupProfile: { type: "boolean" }, hasCompletedRegistration: { type: "boolean" }, hasStorage: { type: "boolean" }, handledPushNotificationsNudge: { type: "boolean" }, handledContactsNudge: { type: "boolean" }, handledInterestsNudge: { type: "boolean" }, hasValidPaidInvite: { type: "boolean" }, hasWarpcastWalletAddress: { type: "boolean" }, hasPhone: { type: "boolean" }, needsPhone: { type: "boolean" }, sponsoredRegisterEligible: { type: "boolean" }, geoRestricted: { type: "boolean" } } }; var OnboardingStateResponseSchema = { type: "object", properties: { result: { type: "object", properties: { state: { $ref: "#/components/schemas/OnboardingState" } } } } }; var ErrorResponseSchema = { type: "object", properties: { errors: { type: "array", items: { type: "object", properties: { message: { type: "string", description: "Error message describing the issue" } } } } } }; var UserWithExtrasSchema = { allOf: [ { $ref: "#/components/schemas/User" }, { type: "object", properties: { connectedAccounts: { type: "array", items: {} } } } ] }; var UserExtrasSchema = { type: "object", properties: { fid: { type: "integer" }, custodyAddress: { type: "string" }, ethWallets: { type: "array", items: { type: "string" } }, solanaWallets: { type: "array", items: { type: "string" } }, walletLabels: { type: "array", items: { type: "object", properties: { address: { type: "string" }, labels: { type: "array", items: { type: "string" } } } } }, v2: { type: "boolean" }, publicSpamLabel: { type: "string" } } }; var UserByFidResponseSchema = { type: "object", properties: { result: { type: "object", properties: { user: { $ref: "#/components/schemas/UserWithExtras" }, collectionsOwned: { type: "array", items: {} }, extras: { $ref: "#/components/schemas/UserExtras" } } } } }; var ValidationErrorSchema = { type: "object", description: "Represents a single validation error", properties: { instancePath: { type: "string", description: "JSON Pointer to the part of the request that failed validation", example: "/fid" }, schemaPath: { type: "string", description: "JSON Schema path that was violated", example: "ApiFid/type" }, keyword: { type: "string", description: "The JSON Schema keyword that failed", example: "type" }, params: { type: "object", description: "Additional parameters describing the validation error", additionalProperties: true, example: { type: "integer" } }, message: { type: "string", description: "Human-readable error description", example: "must be integer" } }, required: ["instancePath", "schemaPath", "keyword", "message"] }; var BadRequestErrorSchema = { type: "object", description: "Standard 400 Bad Request error response", properties: { errors: { type: "array", description: "Array of validation errors", items: { $ref: "#/components/schemas/ValidationError" } } }, required: ["errors"] }; var DirectCastMessageReactionSchema = { type: "object", required: ["reaction", "count"], properties: { reaction: { type: "string", description: "Emoji used for the reaction", example: "\u{1F525}" }, count: { type: "integer", minimum: 1, description: "Number of users who reacted with this emoji", example: 3 }, emoji: { type: "string", description: "Emoji used for the reaction (legacy field)" }, userFids: { type: "array", items: { type: "integer" }, description: "List of Farcaster IDs who reacted" } } }; var DirectCastMessageViewerContextSchema = { type: "object", properties: { isLastReadMessage: { type: "boolean", description: "Whether this is the last read message", example: false }, focused: { type: "boolean", description: "Whether the message is focused", example: false }, reactions: { type: "array", items: { type: "string" }, description: "User's reactions to this message" } } }; var DirectCastMessageSchema = { type: "object", required: [ "conversationId", "senderFid", "messageId", "serverTimestamp", "type", "message", "hasMention", "reactions", "isPinned", "isDeleted", "senderContext" ], properties: { conversationId: { type: "string", description: "ID of the conversation this message belongs to" }, senderFid: { type: "integer", description: "Farcaster ID of the message sender" }, messageId: { type: "string", description: "Unique identifier for the message" }, serverTimestamp: { type: "integer", format: "int64", description: "Server timestamp when message was sent (Unix milliseconds)", example: 1753112479748 }, type: { type: "string", enum: [ "text", "image", "reaction", "link", "group_membership_addition", "pin_message", "message_ttl_change" ], description: "Type of the message", example: "text" }, message: { type: "string", description: "Content of the message" }, hasMention: { type: "boolean", description: "Whether the message contains mentions", example: false }, reactions: { type: "array", items: { $ref: "#/components/schemas/DirectCastMessageReaction" }, description: "List of reactions to the message" }, isPinned: { type: "boolean", description: "Whether the message is pinned", example: false }, isDeleted: { type: "boolean", description: "Whether the message is deleted", example: false }, senderContext: { $ref: "#/components/schemas/User" }, viewerContext: { $ref: "#/components/schemas/DirectCastMessageViewerContext" }, inReplyTo: { $ref: "#/components/schemas/DirectCastMessage" }, metadata: { $ref: "#/components/schemas/DirectCastMessageMetadata" }, actionTargetUserContext: { $ref: "#/components/schemas/User" }, isProgrammatic: { type: "boolean", description: "Whether the message was sent programmatically", example: false }, mentions: { type: "array", items: { $ref: "#/components/schemas/DirectCastMessageMention" }, description: "List of mentions in the message" } } }; var DirectCastMessageMetadataSchema = { type: "object", properties: { casts: { type: "array", items: { type: "object", additionalProperties: true }, description: "Cast metadata if message contains cast references" }, urls: { type: "array", items: { type: "object", additionalProperties: true }, description: "URL metadata if message contains links" }, medias: { type: "array", items: { type: "object", additionalProperties: true }, description: "Media metadata if message contains media" } } }; var DirectCastMessageMentionSchema = { type: "object", required: ["user", "textIndex", "length"], properties: { user: { $ref: "#/components/schemas/User" }, textIndex: { type: "integer", description: "Starting index of the mention in the message text", example: 19 }, length: { type: "integer", description: "Length of the mention text", example: 8 } } }; var DirectCastConversationViewerContextSchema = { type: "object", properties: { access: { type: "string", enum: ["read-write", "read-only"], description: "Access level for the conversation", example: "read-write" }, category: { type: "string", description: "Category of the conversation", example: "default" }, archived: { type: "boolean", description: "Whether the conversation is archived", example: false }, lastReadAt: { type: "integer", format: "int64", description: "Timestamp of last read (Unix milliseconds)", example: 1753650746109 }, muted: { type: "boolean", description: "Whether the conversation is muted", example: false }, manuallyMarkedUnread: { type: "boolean", description: "Whether the conversation is manually marked as unread", example: false }, pinned: { type: "boolean", description: "Whether the conversation is pinned", example: false }, unreadCount: { type: "integer", minimum: 0, description: "Number of unread messages", example: 0 }, unreadMentionsCount: { type: "integer", minimum: 0, description: "Number of unread mentions", example: 0 }, counterParty: { $ref: "#/components/schemas/User", description: "The other participant in a 1:1 conversation" }, tag: { type: "string", description: "Tag associated with the conversation", example: "automated" } } }; var DirectCastConversationSchema = { type: "object", required: [ "conversationId", "isGroup", "createdAt", "viewerContext", "adminFids", "lastReadTime" ], properties: { conversationId: { type: "string", description: "Unique identifier for the conversation" }, name: { type: "string", description: "Name of the conversation (for group conversations)" }, description: { type: "string", description: "Description of the conversation" }, photoUrl: { type: "string", format: "uri", description: "URL of the conversation photo" }, adminFids: { type: "array", items: { type: "integer" }, description: "List of admin Farcaster IDs" }, removedFids: { type: "array", items: { type: "integer" }, description: "List of removed Farcaster IDs" }, participants: { type: "array", items: { $ref: "#/components/schemas/User" }, description: "List of conversation participants" }, lastReadTime: { type: "integer", format: "int64", description: "Timestamp of last read time (Unix milliseconds)", example: 1741871452933 }, selfLastReadTime: { type: "integer", format: "int64", description: "Timestamp of viewer's last read time (Unix milliseconds)", example: 1753650746109 }, pinnedMessages: { type: "array", items: { $ref: "#/components/schemas/DirectCastMessage" }, description: "List of pinned messages in the conversation" }, hasPinnedMessages: { type: "boolean", description: "Whether the conversation has pinned messages", example: false }, isGroup: { type: "boolean", description: "Whether this is a group conversation", example: true }, isCollectionTokenGated: { type: "boolean", description: "Whether the conversation is collection token gated", example: false }, activeParticipantsCount: { type: "integer", minimum: 0, description: "Number of active participants in the conversation", example: 2 }, messageTTLDays: { oneOf: [ { type: "integer", minimum: 0, description: "Number of days until message expires" }, { type: "string", enum: ["Infinity"], description: "Messages never expire" } ], description: 'Message time-to-live in days, or "Infinity" for no expiration', examples: [365, "Infinity"] }, createdAt: { type: "integer", format: "int64", description: "Timestamp when conversation was created (Unix milliseconds)", example: 1709952982363 }, unreadCount: { type: "integer", minimum: 0, description: "Number of unread messages", example: 0 }, muted: { type: "boolean", description: "Whether the conversation is muted", example: false }, hasMention: { type: "boolean", description: "Whether the conversation has mentions", example: false }, lastMessage: { $ref: "#/components/schemas/DirectCastMessage" }, viewerContext: { $ref: "#/components/schemas/DirectCastConversationViewerContext" } } }; var DirectCastInboxResultSchema = { type: "object", required: [ "hasArchived", "hasUnreadRequests", "requestsCount", "conversations" ], properties: { hasArchived: { type: "boolean", description: "Whether user has archived conversations", example: false }, hasUnreadRequests: { type: "boolean", description: "Whether user has unread conversation requests", example: false }, requestsCount: { type: "integer", minimum: 0, description: "Total number of conversation requests", example: 12 }, conversations: { type: "array", items: { $ref: "#/components/schemas/DirectCastConversation" } } } }; var PaginationCursorSchema = { type: "object", properties: { cursor: { type: "string", description: "Base64 encoded cursor for pagination" } }, additionalProperties: true }; var DirectCastInboxResponseSchema = { type: "object", required: ["result"], properties: { result: { $ref: "#/components/schemas/DirectCastInboxResult" }, next: { $ref: "#/components/schemas/PaginationCursor" } } }; var CastActionSchema = { type: "object", properties: { id: { type: "string" }, name: { type: "string" }, octicon: { type: "string" }, actionUrl: { type: "string" }, action: { type: "object", properties: { actionType: { type: "string" }, postUrl: { type: "string" } } } } }; var UserAppContextResponseSchema = { type: "object", properties: { result: { type: "object", properties: { context: { type: "object", properties: { canAddLinks: { type: "boolean" }, showConnectedApps: { type: "boolean" }, signerRequestsEnabled: { type: "boolean" }, prompts: { type: "array", items: {} }, adminForChannelKeys: { type: "array", items: { type: "string" } }, modOfChannelKeys: { type: "array", items: { type: "string" } }, memberOfChannelKeys: { type: "array", items: { type: "string" } }, canEditAllChannels: { type: "boolean" }, canUploadVideo: { type: "boolean" }, statsigEnabled: { type: "boolean" }, shouldPromptForPushNotifications: { type: "boolean" }, shouldPromptForUserFollowsSyncContacts: { type: "boolean" }, castActions: { type: "array", items: { $ref: "#/components/schemas/CastAction" } }, canAddCastAction: { type: "boolean" }, enabledCastAction: { $ref: "#/components/schemas/CastAction" }, notificationTabsV2: { type: "array", items: { type: "object", properties: { id: { type: "string" }, name: { type: "string" } } } }, enabledVideoAutoplay: { type: "boolean" }, regularCastByteLimit: { type: "integer" }, longCastByteLimit: { type: "integer" }, newUserStatus: { type: "object" }, country: { type: "string" }, higherClientEventSamplingRateEnabled: { type: "boolean" } } } } } } }; var UserPreferencesResponseSchema = { type: "object", properties: { result: { type: "object", properties: { preferences: { type: "object", additionalProperties: true } } } } }; var ChannelSchema = { type: "object", properties: { type: { type: "string" }, key: { type: "string" }, name: { type: "string" }, imageUrl: { type: "string" }, fastImageUrl: { type: "string" }, feeds: { type: "array", items: { type: "object", properties: { name: { type: "string" }, type: { type: "string" } } } }, description: { type: "string" }, followerCount: { type: "integer" }, memberCount: { type: "integer" }, showCastSourceLabels: { type: "boolean" }, showCastTags: { type: "boolean" }, sectionRank: { type: "integer" }, subscribable: { type: "boolean" }, publicCasting: { type: "boolean" }, inviteCode: { type: "string" }, headerImageUrl: { type: "string" }, headerAction: { type: "object", properties: { title: { type: "string" }, target: { type: "string" } } }, headerActionMetadata: { type: "object", additionalProperties: true }, viewerContext: { type: "object", properties: { following: { type: "boolean" }, isMember: { type: "boolean" }, hasUnseenItems: { type: "boolean" }, favoritePosition: { type: "integer" }, activityRank: { type: "integer" }, canCast: { type: "boolean" } } } } }; var HighlightedChannelsResponseSchema = { type: "object", properties: { result: { type: "object", properties: { channels: { type: "array", items: { $ref: "#/components/schemas/Channel" } }, viewerContext: { type: "object", properties: { defaultFeed: { type: "string" } } } } } } }; var ImageEmbedSchema = { type: "object", properties: { type: { type: "string", enum: ["image"] }, url: { type: "string" }, sourceUrl: { type: "string" }, media: { type: "object", properties: { version: { type: "string" }, width: { type: "integer" }, height: { type: "integer" }, staticRaster: { type: "string" }, mimeType: { type: "string" } } }, alt: { type: "string" } } }; var UrlEmbedSchema = { type: "object", required: ["type", "openGraph"], properties: { type: { type: "string", enum: ["url"] }, openGraph: { type: "object", required: ["url"], properties: { url: { type: "string" }, sourceUrl: { type: "string" }, title: { type: "string" }, description: { type: "string" }, domain: { type: "string" }, image: { type: "string" }, useLargeImage: { type: "boolean" } } } } }; var VideoEmbedSchema = { type: "object", properties: { type: { type: "string", enum: ["video"] } } }; var RecasterSchema = { type: "object", properties: { fid: { type: "integer" }, username: { type: "string" }, displayName: { type: "string" }, recastHash: { type: "string" } } }; var CastSchema = { type: "object", required: [ "hash", "author", "text", "timestamp", "replies", "reactions", "recasts", "watches", "processedCastText" ], properties: { hash: { type: "string", description: "Unique hash identifier for the cast" }, threadHash: { type: "string", description: "Hash identifier for the thread this cast belongs to" }, parentHash: { type: "string", description: "Hash identifier of the parent cast (if this is a reply)" }, parentSource: { type: "object", properties: { type: { type: "string", enum: ["url"] }, url: { type: "string" } } }, author: { $ref: "#/components/schemas/User" }, text: { type: "string", description: "The text content of the cast" }, timestamp: { type: "integer", format: "int64", description: "Unix timestamp in milliseconds" }, mentions: { type: "array", items: { $ref: "#/components/schemas/User" } }, embeds: { type: "object", properties: { images: { type: "array", items: { $ref: "#/components/schemas/ImageEmbed" } }, urls: { type: "array", items: { $ref: "#/components/schemas/UrlEmbed" } }, videos: { type: "array", items: { $ref: "#/components/schemas/VideoEmbed" } }, unknowns: { type: "array", items: { type: "object" } }, processedCastText: { type: "string" }, groupInvites: { type: "array", items: { type: "object" } } } }, replies: { type: "object", required: ["count"], properties: { count: { type: "integer" } } }, reactions: { type: "object", required: ["count"], properties: { count: { type: "integer" } } }, recasts: { type: "object", required: ["count"], properties: { count: { type: "integer" }, recasters: { type: "array", items: { $ref: "#/components/schemas/Recaster" } } } }, watches: { type: "object", required: ["count"], properties: { count: { type: "integer" } } }, recast: { type: "boolean" }, tags: { type: "array", items: { type: "object", properties: { type: { type: "string" }, id: { type: "string" }, name: { type: "string" }, imageUrl: { type: "string" } } } }, quoteCount: { type: "integer" }, combinedRecastCount: { type: "integer" }, channel: { type: "object", properties: { key: { type: "string" }, name: { type: "string" }, imageUrl: { type: "string" }, authorContext: { type: "object", properties: { role: { type: "string" }, restricted: { type: "boolean" }, banned: { type: "boolean" } } }, authorRole: { type: "string" } } }, viewerContext: { type: "object", properties: { reacted: { type: "boolean" }, recast: { type: "boolean" }, bookmarked: { type: "boolean" } } } } }; var FeedItemsResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", required: ["items", "replaceFeed"], properties: { items: { type: "array", items: { type: "object", required: ["id", "timestamp", "cast"], properties: { id: { type: "string" }, timestamp: { type: "integer" }, cast: { $ref: "#/components/schemas/Cast" }, otherParticipants: { type: "array", items: { $ref: "#/components/schemas/User" } } } } }, latestMainCastTimestamp: { type: "integer" }, feedTopSeenAtTimestamp: { type: "integer" }, replaceFeed: { type: "boolean" } } } } }; var GenericResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", additionalProperties: true } } }; var UserResponseSchema = { allOf: [ { $ref: "#/components/schemas/GenericResponse" }, { type: "object", required: ["result"], properties: { result: { type: "object", properties: { user: { $ref: "#/components/schemas/UserWithExtras" }, collectionsOwned: { type: "array", items: { type: "object" } }, extras: { $ref: "#/components/schemas/UserExtras" } } } } } ] }; var PaginatedResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", additionalProperties: true }, next: { $ref: "#/components/schemas/PaginationCursor" } } }; var SuggestedUsersResponseSchema = { allOf: [ { $ref: "#/components/schemas/PaginatedResponse" }, { type: "object", properties: { result: { type: "object", properties: { users: { type: "array", items: { type: "object", additionalProperties: true } } } } } } ] }; var FavoriteFramesResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", required: ["frames"], properties: { frames: { type: "array", items: { type: "object", additionalProperties: true } } } } } }; var ChannelStreaksResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", additionalProperties: true } } }; var UnseenCountsResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", properties: { notificationsCount: { type: "integer" }, notificationTabs: { type: "array", items: { type: "object", required: ["tab", "unseenCount"], properties: { tab: { type: "string" }, unseenCount: { type: "integer" } } } }, inboxCount: { type: "integer" }, channelFeeds: { type: "array", items: { type: "object", required: ["channelKey", "feedType", "hasNewItems"], properties: { channelKey: { type: "string" }, feedType: { type: "string" }, hasNewItems: { type: "boolean" } } } }, warpTransactionCount: { type: "integer" } } } } }; var UserThreadCastsResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", required: ["casts"], properties: { casts: { type: "array", items: { type: "object", additionalProperties: true } } } } } }; var ChannelFollowersYouKnowResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", required: ["users", "totalCount"], properties: { users: { type: "array", items: { type: "object", additionalProperties: true } }, totalCount: { type: "integer" } } } } }; var SuccessResponseSchema = { allOf: [ { $ref: "#/components/schemas/GenericResponse" }, { type: "object", properties: { result: { type: "object", required: ["success"], properties: { success: { type: "boolean", description: "Whether the operation was successful" } } } } } ] }; var NotificationsResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", properties: { notifications: { type: "array", items: { type: "object", additionalProperties: true } } } } } }; var DirectCastConversationResponseSchema = { allOf: [ { $ref: "#/components/schemas/GenericResponse" }, { type: "object", properties: { result: { type: "object", required: ["conversation"], properties: { conversation: { $ref: "#/components/schemas/DirectCastConversation" } } } } } ] }; var DirectCastConversationCategorizationRequestSchema = { type: "object", required: ["conversationId", "category"], properties: { conversationId: { type: "string", description: "ID of the conversation to categorize", example: "17838-20146" }, category: { type: "string", description: "Category to assign to the conversation", example: "archived" } } }; var DirectCastConversationMessagesResponseSchema = { allOf: [ { $ref: "#/components/schemas/PaginatedResponse" }, { type: "object", properties: { result: { type: "object", required: ["messages"], properties: { messages: { type: "array", items: { $ref: "#/components/schemas/DirectCastMessage" } } } } } } ] }; var DirectCastConversationMessageTtlRequestSchema = { type: "object", required: ["conversationId", "ttl"], properties: { conversationId: { type: "string", description: "ID of the conversation to set message TTL for", example: "12590-20146" }, ttl: { type: "integer", description: "Time to live for messages in days", example: 365 } } }; var DirectCastConversationNotificationsRequestSchema = { type: "object", required: ["conversationId", "muted"], properties: { conversationId: { type: "string", description: "ID of the conversation to update notification settings for", example: "17838-20146" }, muted: { type: "boolean", description: "Whether to mute notifications for this conversation", example: false } } }; var DirectCastSendRequestSchema = { type: "object", required: ["conversationId", "recipientFids", "messageId", "type", "message"], properties: { conversationId: { type: "string", description: "ID of the conversation to send the message to" }, recipientFids: { type: "array", items: { type: "integer" }, description: "Array of Farcaster IDs of message recipients", example: [17838, 861305] }, messageId: { type: "string", description: "Unique identifier for the message" }, type: { type: "string", enum: ["text", "image", "reaction", "link"], description: "Type of the message", example: "text" }, message: { type: "string", description: "Content of the message" }, inReplyToId: { type: "string", description: "ID of the message this is replying to (optional)" } } }; var DirectCastManuallyMarkUnreadRequestSchema = { type: "object", required: ["conversationId"], properties: { conversationId: { type: "string", description: "ID of the conversation to mark as unread" } } }; var DirectCastMessageReactionRequestSchema = { type: "object", required: ["conversationId", "messageId", "reaction"], properties: { conversationId: { type: "string", description: "ID of the conversation containing the message", example: "12590-20146" }, messageId: { type: "string", description: "ID of the message to react to", example: "17c7f0b459ff8f625fc35bba6a89c817" }, reaction: { type: "string", description: "Emoji reaction to add or remove", example: "\u{1F44D}" } } }; var DirectCastPinConversationRequestSchema = { type: "object", required: ["conversationId"], properties: { conversationId: { type: "string", description: "ID of the conversation to pin" } } }; var DiscoverChannelsResponseSchema = { allOf: [ { $ref: "#/components/schemas/GenericResponse" }, { type: "object", properties: { result: { type: "object", properties: { channels: { type: "array", items: { type: "object", additionalProperties: true } } } } } } ] }; var InvitesAvailableResponseSchema = { allOf: [ { $ref: "#/components/schemas/GenericResponse" }, { type: "object", properties: { result: { type: "object", required: ["allocatedInvitesCount", "availableInvitesCount"], properties: { allocatedInvitesCount: { type: "integer", description: "Total number of invites allocated to the user" }, availableInvitesCount: { type: "integer", description: "Number of invites currently available to send" } } } } } ] }; var SponsoredInvitesResponseSchema = { allOf: [ { $ref: "#/components/schemas/GenericResponse" }, { type: "object", properties: { result: { type: "object", properties: { invites: { type: "array", items: { type: "object" } } } } }, additionalProperties: true } ] }; var RewardsLeaderboardResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", required: ["leaderboard"], properties: { leaderboard: { type: "object", required: ["type", "users"], properties: { type: { type: "string" }, users: { type: "array", items: { type: "object", properties: { user: { type: "object", additionalProperties: true }, score: { type: "integer" }, rank: { type: "integer" } } } } } } } } } }; var RewardsScoresResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", required: ["scores"], properties: { scores: { type: "array", items: { type: "object", properties: { type: { type: "string" }, user: { type: "object", additionalProperties: true }, allTimeScore: { type: "integer" }, currentPeriodScore: { type: "integer" }, previousPeriodScore: { type: "integer" } } } } } } } }; var RewardsMetadataResponseSchema = { type: "object", required: ["result"], properties: { result: { type: "object", required: [ "type", "lastUpdateTimestamp", "currentPeriodStartTimestamp", "currentPeriodEndTimestamp" ], properties: { metadata: { type: "object", properties: { type: { type: "string" }, lastUpdateTimestamp: { type: "integer" }, currentPeriodStartTimestamp: { type: "integer" }, currentPeriodEndTimestamp: { type: "integer" }, tiers: { type: "array", items: { type: "object", additionalProperties: true } }, proportionalPayout: { type: