Class Firefish

Implements

Constructors

Properties

Methods

acceptFollowRequest addAccountsToList addReactionToAnnouncement blockAccount blockDomain bookmarkStatus cancel cancelScheduledStatus createApp createEmojiReaction createFeaturedTag createFilter createList deleteAccountsFromList deleteConversation deleteEmojiReaction deleteFeaturedTag deleteFilter deleteList deletePushSubscription deleteStatus directStreaming dismissInstanceAnnouncement dismissNotification dismissNotifications editStatus favouriteStatus fetchAccessToken followAccount followTag generateAuthUrlAndToken getAccount getAccountFavourites getAccountFollowers getAccountFollowing getAccountLists getAccountsInList getAccountStatuses getBlocks getBookmarks getConversationTimeline getDomainBlocks getEmojiReaction getEmojiReactions getEndorsements getFavourites getFeaturedTags getFilter getFilters getFollowedTags getFollowRequests getHomeTimeline getIdentityProof getInstance getInstanceActivity getInstanceAnnouncements getInstanceCustomEmojis getInstanceDirectory getInstancePeers getInstanceTrends getList getLists getListTimeline getLocalTimeline getMarkers getMedia getMutes getNotification getNotifications getPoll getPreferences getPublicTimeline getPushSubscription getRelationship getRelationships getScheduledStatus getScheduledStatuses getStatus getStatusContext getStatusFavouritedBy getStatusRebloggedBy getStatusSource getSuggestedTags getSuggestions getTag getTagTimeline listStreaming localStreaming lookupAccount muteAccount muteStatus pinAccount pinStatus postStatus publicStreaming readConversation readNotifications reblogStatus refreshToken registerAccount registerApp rejectFollowRequest removeReactionFromAnnouncement report revokeToken saveMarkers scheduleStatus search searchAccount setAccountNote streamingURL subscribeAccount subscribePushNotification tagStreaming unblockAccount unblockDomain unbookmarkStatus unfavouriteStatus unfollowAccount unfollowTag unmuteAccount unmuteStatus unpinAccount unpinStatus unreblogStatus unsubscribeAccount updateCredentials updateFilter updateList updateMedia updatePushSubscription uploadMedia userStreaming verifyAccountCredentials verifyAppCredentials votePoll

Constructors

  • Parameters

    • baseUrl: string

      hostname or base URL

    • accessToken: null | string = null

      access token from OAuth2 authorization

    • userAgent: null | string = DEFAULT_UA

      UserAgent is specified in header on request.

    Returns Firefish

Properties

baseUrl: string
client: Interface

Methods

  • POST /api/app/create

    Create an application.

    Parameters

    • client_name: string

      Your application's name.

    • options: Partial<{
          redirect_uris: string;
          scopes: string[];
          website: string;
      }> = ...

      Form data.

    Returns Promise<AppData>

  • Create a filter.

    Parameters

    • _phrase: string
    • _context: string[]
    • Optional_options: {
          expires_in?: string;
          irreversible?: boolean;
          whole_word?: boolean;
      }
      • Optionalexpires_in?: string
      • Optionalirreversible?: boolean
      • Optionalwhole_word?: boolean

    Returns Promise<Response<Filter>>

    Filter

  • Edit a given status to change its text, sensitivity, media attachments, or poll. Note that editing a poll’s options will reset the votes.

    Parameters

    • _id: string
    • _options: {
          media_ids?: string[];
          poll?: {
              expires_in?: number;
              hide_totals?: boolean;
              multiple?: boolean;
              options?: string[];
          };
          sensitive?: boolean;
          spoiler_text?: string;
          status?: string;
      }
      • Optionalmedia_ids?: string[]
      • Optionalpoll?: {
            expires_in?: number;
            hide_totals?: boolean;
            multiple?: boolean;
            options?: string[];
        }
        • Optionalexpires_in?: number
        • Optionalhide_totals?: boolean
        • Optionalmultiple?: boolean
        • Optionaloptions?: string[]
      • Optionalsensitive?: boolean
      • Optionalspoiler_text?: string
      • Optionalstatus?: string

    Returns Promise<Response<Status>>

    Status

  • POST /api/auth/session/userkey

    Parameters

    • _client_id: null | string

      This parameter is not used in this method.

    • client_secret: string

      Application secret key which will be provided in createApp.

    • session_token: string

      Session token string which will be provided in generateAuthUrlAndToken.

    • Optional_redirect_uri: string

      This parameter is not used in this method.

    Returns Promise<TokenData>

  • POST /api/auth/session/generate

    Parameters

    • clientSecret: string

    Returns Promise<Session>

  • Favourites timeline of any user.

    Parameters

    • _id: string
    • Optional_options: {
          limit?: number;
          max_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

    Array of statuses.

  • POST /api/users/lists/show

    Parameters

    • id: string
    • Optional_options: {
          limit?: number;
          max_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Account[]>>

  • POST /api/users/notes

    Parameters

    • id: string
    • Optionaloptions: {
          exclude_reblogs: boolean;
          exclude_replies: boolean;
          limit?: number;
          max_id?: string;
          only_media?: boolean;
          pinned?: boolean;
          since_id?: string;
      }
      • exclude_reblogs: boolean
      • exclude_replies: boolean
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalonly_media?: boolean
      • Optionalpinned?: boolean
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

  • POST /api/blocking/list

    Parameters

    • Optionaloptions: {
          limit?: number;
          max_id?: string;
          min_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string

    Returns Promise<Response<Account[]>>

  • Statuses the user has bookmarked.

    Parameters

    • Optional_options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

    Array of statuses.

  • POST /api/notes/mentions

    Parameters

    • Optionaloptions: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Conversation[]>>

  • View domains the user has blocked.

    Parameters

    • Optional_options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string

    Returns Promise<Response<string[]>>

    Array of domain name.

  • Accounts that the user is currently featuring on their profile.

    Parameters

    • Optional_options: {
          limit?: number;
          max_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Account[]>>

    Array of accounts.

  • POST /api/notes/timeline

    Parameters

    • Optionaloptions: {
          limit?: number;
          local?: boolean;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionallocal?: boolean
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

  • View profile directory.

    Parameters

    • Optional_options: {
          limit?: number;
          local?: boolean;
          offset?: number;
          order?: "active" | "new";
      }
      • Optionallimit?: number
      • Optionallocal?: boolean
      • Optionaloffset?: number
      • Optionalorder?: "active" | "new"

    Returns Promise<Response<Account[]>>

    Array of accounts.

  • POST /api/notes/user-list-timeline

    Parameters

    • list_id: string
    • Optionaloptions: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

  • POST /api/notes/local-timeline

    Parameters

    • Optionaloptions: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          only_media?: boolean;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalonly_media?: boolean
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

  • POST /api/mute/list

    Parameters

    • Optionaloptions: {
          limit?: number;
          max_id?: string;
          min_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string

    Returns Promise<Response<Account[]>>

  • POST /api/i/notifications

    Parameters

    • Optionaloptions: {
          account_id?: string;
          exclude_type?: string[];
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optionalaccount_id?: string
      • Optionalexclude_type?: string[]
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<Notification[]>>

  • POST /api/notes/global-timeline

    Parameters

    • Optionaloptions: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          only_media?: boolean;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalonly_media?: boolean
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

  • View scheduled statuses.

    Parameters

    • Optional_options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalsince_id?: string

    Returns Promise<Response<ScheduledStatus[]>>

    Array of scheduled statuses.

  • POST /api/notes/search-by-tag

    Parameters

    • hashtag: string
    • Optionaloptions: {
          limit?: number;
          local?: boolean;
          max_id?: string;
          min_id?: string;
          only_media?: boolean;
          since_id?: string;
      }
      • Optionallimit?: number
      • Optionallocal?: boolean
      • Optionalmax_id?: string
      • Optionalmin_id?: string
      • Optionalonly_media?: boolean
      • Optionalsince_id?: string

    Returns Promise<Response<Status[]>>

  • Publish a status with the given parameters.

    Parameters

    • status: string

      Text content of status.

    • Optionaloptions: {
          in_reply_to_id?: string;
          language?: string;
          media_ids?: string[];
          poll?: {
              expires_in: number;
              hide_totals?: boolean;
              multiple?: boolean;
              options: string[];
          };
          quote_id?: string;
          scheduled_at?: string;
          sensitive?: boolean;
          spoiler_text?: string;
          visibility?: StatusVisibility;
      }
      • Optionalin_reply_to_id?: string

        ID of the status being replied to, if status is a reply.

      • Optionallanguage?: string

        ISO 639 language code for this status.

      • Optionalmedia_ids?: string[]

        Array of Attachment ids.

      • Optionalpoll?: {
            expires_in: number;
            hide_totals?: boolean;
            multiple?: boolean;
            options: string[];
        }

        Poll object.

        • expires_in: number
        • Optionalhide_totals?: boolean
        • Optionalmultiple?: boolean
        • options: string[]
      • Optionalquote_id?: string

        ID of the status being quoted to, if status is a quote.

      • Optionalscheduled_at?: string

        ISO 8601 Datetime at which to schedule a status.

      • Optionalsensitive?: boolean

        Mark status and attached media as sensitive?

      • Optionalspoiler_text?: string

        Text to be shown as a warning or subject before the actual content.

      • Optionalvisibility?: StatusVisibility

        Visibility of the posted status.

    Returns Promise<Response<Status>>

    Status. When options.scheduled_at is present, ScheduledStatus is returned instead.

  • Creates a user and account records. Returns an account access token for the app that initiated the request. The app should save this token for later, and should wait for the user to confirm their account by clicking a link in their email inbox.

    Parameters

    • _username: string
    • _email: string
    • _password: string
    • _agreement: boolean
    • _locale: string
    • Optional_reason: null | string

    Returns Promise<Response<Token>>

    An account token.

  • First, call createApp to get client_id and client_secret. Next, call generateAuthUrl to get authorization url.

    Parameters

    • client_name: string

      Form Data, which is sent to /api/v1/apps

    • options: Partial<{
          redirect_uris: string;
          scopes: string[];
          website: string;
      }> = ...

      Form Data, which is sent to /api/v1/apps. and properties should be snake_case

    Returns Promise<AppData>

  • POST /api/users/report-abuse

    Parameters

    • account_id: string
    • options: {
          category: Category;
          comment: string;
          forward?: boolean;
          rule_ids?: number[];
          status_ids?: string[];
      }
      • category: Category
      • comment: string
      • Optionalforward?: boolean
      • Optionalrule_ids?: number[]
      • Optionalstatus_ids?: string[]

    Returns Promise<Response<Report>>

  • Save your position in a timeline.

    Parameters

    • Optional_options: {
          home?: {
              last_read_id: string;
          };
          notifications?: {
              last_read_id: string;
          };
      }
      • Optionalhome?: {
            last_read_id: string;
        }
        • last_read_id: string
      • Optionalnotifications?: {
            last_read_id: string;
        }
        • last_read_id: string

    Returns Promise<Response<Marker>>

    Marker.

  • Perform a search.

    Parameters

    • q: string

      The search query.

    • Optionaloptions: {
          account_id?: string;
          exclude_unreviewed?: boolean;
          following?: boolean;
          limit?: number;
          max_id?: string;
          min_id?: string;
          offset?: number;
          resolve?: boolean;
          type: "accounts" | "hashtags" | "statuses";
      }
      • Optionalaccount_id?: string

        If provided, statuses returned will be authored only by this account.

      • Optionalexclude_unreviewed?: boolean

        Filter out unreviewed tags? Defaults to false.

      • Optionalfollowing?: boolean

        Only include accounts that the user is following. Defaults to false.

      • Optionallimit?: number

        Maximum number of results to load, per type. Defaults to 20. Max 40.

      • Optionalmax_id?: string

        Return results older than this id.

      • Optionalmin_id?: string

        Return results immediately newer than this id.

      • Optionaloffset?: number
      • Optionalresolve?: boolean

        Attempt WebFinger lookup. Defaults to false.

      • type: "accounts" | "hashtags" | "statuses"

        Enum of search target.

    Returns Promise<Response<Results>>

    Results.

  • POST /api/users/search

    Parameters

    • q: string
    • Optionaloptions: {
          following?: boolean;
          limit?: number;
          max_id?: string;
          resolve?: boolean;
          since_id?: string;
      }
      • Optionalfollowing?: boolean
      • Optionallimit?: number
      • Optionalmax_id?: string
      • Optionalresolve?: boolean
      • Optionalsince_id?: string

    Returns Promise<Response<Account[]>>

  • Subscribe to push notifications.

    Parameters

    • _subscription: {
          endpoint: string;
          keys: {
              auth: string;
              p256dh: string;
          };
      }
      • endpoint: string
      • keys: {
            auth: string;
            p256dh: string;
        }
        • auth: string
        • p256dh: string
    • Optional_data: null | {
          alerts: {
              favourite?: boolean;
              follow?: boolean;
              mention?: boolean;
              poll?: boolean;
              reblog?: boolean;
          };
      }

    Returns Promise<Response<PushSubscription>>

    PushSubscription.

  • POST /api/i/update

    Parameters

    • Optionaloptions: {
          avatar?: string;
          bot?: boolean;
          discoverable?: boolean;
          display_name?: string;
          fields_attributes?: {
              name: string;
              value: string;
          }[];
          header?: string;
          locked?: boolean;
          note?: string;
          source?: null | {
              language?: string;
              privacy?: string;
              sensitive?: boolean;
          };
      }
      • Optionalavatar?: string
      • Optionalbot?: boolean
      • Optionaldiscoverable?: boolean
      • Optionaldisplay_name?: string
      • Optionalfields_attributes?: {
            name: string;
            value: string;
        }[]
      • Optionalheader?: string
      • Optionallocked?: boolean
      • Optionalnote?: string
      • Optionalsource?: null | {
            language?: string;
            privacy?: string;
            sensitive?: boolean;
        }

    Returns Promise<Response<Account>>

  • Replaces a filter’s parameters in-place.

    Parameters

    • _id: string
    • _phrase: string
    • _context: string[]
    • Optional_options: {
          expires_in?: string;
          irreversible?: boolean;
          whole_word?: boolean;
      }
      • Optionalexpires_in?: string
      • Optionalirreversible?: boolean
      • Optionalwhole_word?: boolean

    Returns Promise<Response<Filter>>

    Filter

  • POST /api/drive/files/update

    Parameters

    • id: string
    • Optionaloptions: {
          description?: string;
          file?: any;
          focus?: string;
          is_sensitive?: boolean;
      }
      • Optionaldescription?: string
      • Optionalfile?: any
      • Optionalfocus?: string
      • Optionalis_sensitive?: boolean

    Returns Promise<Response<Attachment>>

  • Change types of notifications.

    Parameters

    • Optional_data: null | {
          alerts: {
              favourite?: boolean;
              follow?: boolean;
              mention?: boolean;
              poll?: boolean;
              reblog?: boolean;
          };
      }

    Returns Promise<Response<PushSubscription>>

    PushSubscription.