Interface MegalodonInterface

Hierarchy

  • MegalodonInterface

Implemented by

Methods

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

Methods

  • POST /api/v1/lists/:id/accounts

    Parameters

    • id: string

      Target list ID.

    • account_ids: string[]

      Array of account IDs to add to the list.

    Returns Promise<Response<{}>>

  • Call /api/v1/apps

    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>

  • POST /api/v1/filters

    Returns

    Filter

    Parameters

    • phrase: string

      Text to be filtered.

    • context: string[]

      Array of enumerable strings home, notifications, public, thread, account. At least one context must be specified.

    • Optional options: {
          expires_in?: string;
          irreversible?: boolean;
          whole_word?: boolean;
      }
      • Optional expires_in?: string

        ISO 8601 Datetime for when the filter expires.

      • Optional irreversible?: boolean

        Should the server irreversibly drop matching entities from home and notifications?

      • Optional whole_word?: boolean

        Consider word boundaries?

    Returns Promise<Response<Filter>>

  • DELETE /api/v1/lists/:id/accounts

    Parameters

    • id: string

      Target list ID.

    • account_ids: string[]

      Array of account IDs to add to the list.

    Returns Promise<Response<{}>>

  • POST /oauth/token

    Fetch OAuth access token. Get an access token based client_id and client_secret and authorization code.

    Parameters

    • client_id: null | string

      will be generated by #createApp or #registerApp

    • client_secret: string

      will be generated by #createApp or #registerApp

    • code: string

      will be generated by the link of #generateAuthUrl or #registerApp

    • Optional redirect_uri: string

      must be the same uri as the time when you register your OAuth application

    Returns Promise<TokenData>

  • GET /api/v1/pleroma/accounts/:id/favourites

    Returns

    Array of statuses.

    Parameters

    • id: string

      Target account ID.

    • Optional options: {
          limit?: number;
          max_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return.

      • Optional max_id?: string

        Return results order than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/accounts/:id/followers

    Returns

    The array of accounts.

    Parameters

    • id: string

      The account ID.

    • Optional options: {
          get_all?: boolean;
          limit?: number;
          max_id?: string;
          since_id?: string;
          sleep_ms?: number;
      }
      • Optional get_all?: boolean
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

      • Optional sleep_ms?: number

    Returns Promise<Response<Entity.Account[]>>

  • GET /api/v1/accounts/:id/following

    Returns

    The array of accounts.

    Parameters

    • id: string

      The account ID.

    • Optional options: {
          get_all?: boolean;
          limit?: number;
          max_id?: string;
          since_id?: string;
          sleep_ms?: number;
      }
      • Optional get_all?: boolean
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

      • Optional sleep_ms?: number

    Returns Promise<Response<Entity.Account[]>>

  • GET /api/v1/accounts/:id/statuses

    Returns

    Account's statuses.

    Parameters

    • id: string

      The account ID.

    • Optional options: {
          exclude_reblogs?: boolean;
          exclude_replies?: boolean;
          limit?: number;
          max_id?: string;
          min_id?: string;
          only_media?: boolean;
          pinned?: boolean;
          since_id?: string;
      }
      • Optional exclude_reblogs?: boolean

        Return statuses which exclude reblogs.

      • Optional exclude_replies?: boolean

        Return statuses which exclude replies.

      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results newer than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional pinned?: boolean

        Return statuses which include pinned statuses.

      • Optional since_id?: string

        Return results newer than ID but starting with most recent.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/lists/:id/accounts

    Returns

    Array of accounts.

    Parameters

    • id: string

      Target list ID.

    • Optional options: {
          limit?: number;
          max_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

  • GET /api/v1/blocks

    Returns

    Array of accounts.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<Entity.Account[]>>

  • GET /api/v1/bookmarks

    Returns

    Array of statuses.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/conversations

    Returns

    Array of statuses.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Conversation[]>>

  • GET /api/v1/domain_blocks

    Returns

    Array of domain name.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<string[]>>

  • GET /api/v1/endorsements

    Returns

    Array of accounts.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

  • GET /api/v1/favourites

    Returns

    Array of statuses.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/timelines/home

    Returns

    Array of statuses.

    Parameters

    • Optional options: {
          limit?: number;
          local?: boolean;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional local?: boolean

        Show only local statuses? Defaults to false.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/directory

    Returns

    Array of accounts.

    Parameters

    • Optional options: {
          limit?: number;
          local?: boolean;
          offset?: number;
          order?: "active" | "new";
      }
      • Optional limit?: number

        How many accounts to load. Default 40.

      • Optional local?: boolean

        Only return local accounts.

      • Optional offset?: number

        How many accounts to skip before returning results. Default 0.

      • Optional order?: "active" | "new"

        Order of results.

    Returns Promise<Response<Entity.Account[]>>

  • GET /api/v1/timelines/list/:list_id

    Returns

    Array of statuses.

    Parameters

    • list_id: string

      Local ID of the list in the database.

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/timelines/public

    Returns

    Array of statuses.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          only_media?: boolean;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/mutes

    Returns

    Array of accounts.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<Entity.Account[]>>

  • GET /api/v1/notifications

    Returns

    Array of notifications.

    Parameters

    • Optional options: {
          account_id?: string;
          exclude_types?: string[];
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optional account_id?: string

        Return only notifications received from this account.

      • Optional exclude_types?: string[]

        Array of types to exclude.

      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Notification[]>>

  • GET /api/v1/timelines/public

    Returns

    Array of statuses.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          only_media?: boolean;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • GET /api/v1/scheduled_statuses

    Returns

    Array of scheduled statuses.

    Parameters

    • Optional options: {
          limit?: number;
          max_id?: string;
          min_id?: string;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<ScheduledStatus[]>>

  • GET /api/v1/statuses/:id/context

    Get parent and child statuses.

    Returns

    Context

    Parameters

    • id: string

      The target status id.

    • Optional options: {
          limit?: number;
          max_id?: string;
          since_id?: string;
      }
      • Optional limit?: number
      • Optional max_id?: string
      • Optional since_id?: string

    Returns Promise<Response<Context>>

  • GET /api/v1/timelines/tag/:hashtag

    Returns

    Array of statuses.

    Parameters

    • hashtag: string

      Content of a #hashtag, not including # symbol.

    • Optional options: {
          limit?: number;
          local?: boolean;
          max_id?: string;
          min_id?: string;
          only_media?: boolean;
          since_id?: string;
      }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional local?: boolean

        Show only local statuses? Defaults to false.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

  • POST /api/v1/statuses

    Returns

    Status

    Parameters

    • status: string

      Text content of status.

    • Optional options: {
          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?: "direct" | "private" | "public" | "unlisted";
      }
      • Optional in_reply_to_id?: string

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

      • Optional language?: string

        ISO 639 language code for this status.

      • Optional media_ids?: string[]

        Array of Attachment ids.

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

        Poll object.

        • expires_in: number
        • Optional hide_totals?: boolean
        • Optional multiple?: boolean
        • options: string[]
      • Optional quote_id?: string

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

      • Optional scheduled_at?: string

        ISO 8601 Datetime at which to schedule a status.

      • Optional sensitive?: boolean

        Mark status and attached media as sensitive?

      • Optional spoiler_text?: string

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

      • Optional visibility?: "direct" | "private" | "public" | "unlisted"

        Visibility of the posted status.

    Returns Promise<Response<Entity.Status>>

  • POST /oauth/token

    Refresh OAuth access token. Send refresh token and get new access token.

    Parameters

    • client_id: string

      will be generated by #createApp or #registerApp

    • client_secret: string

      will be generated by #createApp or #registerApp

    • refresh_token: string

      will be get #fetchAccessToken

    Returns Promise<TokenData>

  • POST /api/v1/accounts

    Returns

    An account token.

    Parameters

    • username: string

      Username for the account.

    • email: string

      Email for the account.

    • password: string

      Password for the account.

    • agreement: boolean

      Whether the user agrees to the local rules, terms, and policies.

    • locale: string

      The language of the confirmation email that will be sent

    • Optional reason: null | string

      Text that will be reviewed by moderators if registrations require manual approval.

    Returns Promise<Response<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/v1/reports

    Returns

    Report

    Parameters

    • account_id: string

      Target account ID.

    • comment: string

      Reason of the report.

    • Optional options: {
          forward?: boolean;
          status_ids?: string[];
      }
      • Optional forward?: boolean

        If the account is remote, should the report be forwarded to the remote admin?

      • Optional status_ids?: string[]

        Array of Statuses ids to attach to the report.

    Returns Promise<Response<Report>>

  • POST /oauth/revoke

    Revoke an OAuth token.

    Parameters

    • client_id: string

      will be generated by #createApp or #registerApp

    • client_secret: string

      will be generated by #createApp or #registerApp

    • token: string

      will be get #fetchAccessToken

    Returns Promise<Response<{}>>

  • POST /api/v1/markers

    Returns

    Marker.

    Parameters

    • Optional options: {
          home?: {
              last_read_id: string;
          };
          notifications?: {
              last_read_id: string;
          };
      }
      • Optional home?: {
            last_read_id: string;
        }

        Marker position of the last read status ID in home timeline.

        • last_read_id: string
      • Optional notifications?: {
            last_read_id: string;
        }

        Marker position of the last read notification ID in notifications.

        • last_read_id: string

    Returns Promise<Response<Marker>>

  • PUT /api/v1/scheduled_statuses/:id

    Returns

    ScheduledStatus.

    Parameters

    • id: string

      Target scheduled status ID.

    • Optional scheduled_at: null | string

      ISO 8601 Datetime at which the status will be published.

    Returns Promise<Response<ScheduledStatus>>

  • GET /api/v2/search

    Returns

    Results.

    Parameters

    • q: string

      The search query.

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

      Enum of search target.

    • Optional options: {
          account_id?: string;
          exclude_unreviewed?: boolean;
          following?: boolean;
          limit?: number;
          max_id?: string;
          min_id?: string;
          offset?: number;
          resolve?: boolean;
      }
      • Optional account_id?: string

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

      • Optional exclude_unreviewed?: boolean

        Filter out unreviewed tags? Defaults to false.

      • Optional following?: boolean

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

      • Optional limit?: number

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

      • Optional max_id?: string

        Return results older than this id.

      • Optional min_id?: string

        Return results immediately newer than this id.

      • Optional offset?: number
      • Optional resolve?: boolean

        Attempt WebFinger lookup. Defaults to false.

    Returns Promise<Response<Results>>

  • GET /api/v1/accounts/search

    Returns

    The array of accounts.

    Parameters

    • q: string

      Search query.

    • Optional options: {
          following?: boolean;
          limit?: number;
          max_id?: string;
          resolve?: boolean;
          since_id?: string;
      }
      • Optional following?: boolean
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional resolve?: boolean
      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

  • POST /api/v1/push/subscription

    Returns

    PushSubscription.

    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>>

  • PATCH /api/v1/accounts/update_credentials

    Returns

    An account.

    Parameters

    • Optional options: {
          avatar?: string;
          bot?: boolean;
          discoverable?: boolean;
          display_name?: string;
          fields_attributes?: {
              name: string;
              value: string;
          }[];
          header?: string;
          locked?: boolean;
          note?: string;
          source?: {
              language?: string;
              privacy?: string;
              sensitive?: boolean;
          };
      }
      • Optional avatar?: string
      • Optional bot?: boolean
      • Optional discoverable?: boolean
      • Optional display_name?: string
      • Optional fields_attributes?: {
            name: string;
            value: string;
        }[]
      • Optional header?: string
      • Optional locked?: boolean
      • Optional note?: string
      • Optional source?: {
            language?: string;
            privacy?: string;
            sensitive?: boolean;
        }
        • Optional language?: string
        • Optional privacy?: string
        • Optional sensitive?: boolean

    Returns Promise<Response<Entity.Account>>

  • PUT /api/v1/filters/:id

    Returns

    Filter

    Parameters

    • id: string

      The filter ID.

    • phrase: string

      Text to be filtered.

    • context: string[]

      Array of enumerable strings home, notifications, public, thread, account. At least one context must be specified.

    • Optional options: {
          expires_in?: string;
          irreversible?: boolean;
          whole_word?: boolean;
      }
      • Optional expires_in?: string

        ISO 8601 Datetime for when the filter expires.

      • Optional irreversible?: boolean

        Should the server irreversibly drop matching entities from home and notifications?

      • Optional whole_word?: boolean

        Consider word boundaries?

    Returns Promise<Response<Filter>>

  • PUT /api/v1/media/:id

    Returns

    Attachment

    Parameters

    • id: string

      Target media ID.

    • Optional options: {
          description?: string;
          file?: any;
          focus?: string;
          is_sensitive?: boolean;
      }
      • Optional description?: string

        A plain-text description of the media.

      • Optional file?: any

        The file to be attached, using multipart form data.

      • Optional focus?: string

        Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0.

      • Optional is_sensitive?: boolean

        Whether the media is sensitive.

    Returns Promise<Response<Attachment>>

  • PUT /api/v1/push/subscription

    Returns

    PushSubscription.

    Parameters

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

    Returns Promise<Response<PushSubscription>>

  • POST /api/v2/media

    Returns

    Attachment

    Parameters

    • file: any

      The file to be attached, using multipart form data.

    • Optional options: {
          description?: string;
          focus?: string;
      }
      • Optional description?: string

        A plain-text description of the media.

      • Optional focus?: string

        Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0.

    Returns Promise<Response<Attachment | AsyncAttachment>>

  • POST /api/v1/polls/:id/votes

    Returns

    Poll

    Parameters

    • id: string

      Target poll ID.

    • choices: number[]

      Array of own votes containing index for each option (starting from 0).

    • Optional status_id: null | string

    Returns Promise<Response<Poll>>

Generated using TypeDoc