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

createPrivateMessageReport

createSite

deleteAccount

deleteComment

deleteCommunity

deletePost

deletePrivateMessage

editComment

editCommunity

editPost

editPrivateMessage

editSite

featurePost

  • A moderator can feature a community post ( IE stick it to the top of a community ).

    HTTP.POST /post/feature

    Parameters

    Returns Promise<PostResponse>

followCommunity

getBannedPersons

getCaptcha

getComments

getCommunity

getModlog

getPersonDetails

getPersonMentions

getPost

getPosts

getPrivateMessages

getReplies

getReportCount

getSite

getSiteMetadata

getUnreadCount

getUnreadRegistrationApplicationCount

leaveAdmin

likeComment

likePost

listCommentReports

listCommunities

listPostReports

listPrivateMessageReports

listRegistrationApplications

lockPost

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

    HTTP.POST /post/lock

    Parameters

    Returns Promise<PostResponse>

login

markAllAsRead

markCommentReplyAsRead

markPersonMentionAsRead

markPostAsRead

markPrivateMessageAsRead

passwordChange

passwordReset

purgeComment

purgeCommunity

purgePerson

purgePost

register

removeComment

removeCommunity

removePost

resolveCommentReport

resolveObject

resolvePostReport

resolvePrivateMessageReport

saveComment

savePost

saveUserSettings

search

transferCommunity

verifyEmail

Private wrapper

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

    • BodyType: object

    • ResponseType

    Parameters

    • type_: HttpType
    • endpoint: string
    • form: BodyType

    Returns Promise<ResponseType>

Generated using TypeDoc