Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LemmyHttp

Helps build lemmy HTTP requests.

Hierarchy

  • LemmyHttp

Index

Constructors

constructor

  • new LemmyHttp(baseUrl: string, headers?: {}): LemmyHttp
  • Generates a new instance of LemmyHttp.

    Parameters

    • baseUrl: string

      the base url, without the vX version: https://lemmy.ml -> goes to https://lemmy.ml/api/vX

    • Optional headers: {}

      optional headers. Should contain x-real-ip and x-forwarded-for .

      • [key: string]: string

    Returns LemmyHttp

Properties

Private apiUrl

apiUrl: string

Private headers

headers: {} = {}

Type declaration

  • [key: string]: string

Methods

addAdmin

addModToCommunity

approveRegistrationApplication

banFromCommunity

banPerson

blockCommunity

blockPerson

Private buildFullUrl

  • buildFullUrl(endpoint: string): string
  • Parameters

    • endpoint: string

    Returns string

changePassword

createComment

createCommentReport

createCommunity

createPost

createPostReport

createPrivateMessage

createSite

deleteAccount

deleteComment

deleteCommunity

deletePost

deletePrivateMessage

editComment

editCommunity

editPost

editPrivateMessage

editSite

followCommunity

getBannedPersons

getCaptcha

getComments

getCommunity

getModlog

getPersonDetails

getPersonMentions

getPost

getPosts

getPrivateMessages

getReplies

getReportCount

getSite

getSiteConfig

getSiteMetadata

getUnreadCount

getUnreadRegistrationApplicationCount

leaveAdmin

likeComment

likePost

listCommentReports

listCommunities

listPostReports

listRegistrationApplications

lockPost

  • A moderator can lock a post ( IE disable new comments ). HTTP.POST /post/lock

    Parameters

    Returns Promise<PostResponse>

login

markAllAsRead

markCommentAsRead

markPersonMentionAsRead

markPostAsRead

markPrivateMessageAsRead

passwordChange

passwordReset

register

removeComment

removeCommunity

removePost

resolveCommentReport

resolveObject

resolvePostReport

saveComment

savePost

saveSiteConfig

saveUserSettings

search

stickyPost

  • A moderator can sticky a post ( IE stick it to the top of a community ). HTTP.POST /post/sticky

    Parameters

    Returns Promise<PostResponse>

transferCommunity

verifyEmail

Private wrapper

  • wrapper<ResponseType, MessageType>(type_: HttpType, endpoint: string, form: MessageType): Promise<ResponseType>
  • Type parameters

    • ResponseType

    • MessageType

    Parameters

    • type_: HttpType
    • endpoint: string
    • form: MessageType

    Returns Promise<ResponseType>

Generated using TypeDoc