Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Moebooru

Hierarchy

Index

Constructors

constructor

Properties

base

base: string

Base URI of a booru site

Protected converter

converter: Converter = MoebooruConverter

Optional options

options: Map<string, any>

Stores any global options for the booru. This has different members based on the booru type.

Protected Optional pCredentials

pCredentials: Credentials

Stores credentials for authentication. From outside the class, use credentials accessor or set it in the constructor directly.

Private pSalt

pSalt: string = "{}"

Salt used when hashing passwords, depends on the site you want to access. Use {} where the password should go.

// Example with Konachan's salt
konachan.salt = 'So-I-Heard-You-Like-Mupkids-?--{}--'

Protected uriBuilder

uriBuilder: UriBuilder = MoebooruUriBuilder

xml

xml: false = false

Accessors

credentials

Protected fetchOptions

  • get fetchOptions(): object

loggedIn

  • get loggedIn(): boolean

salt

  • get salt(): string
  • set salt(s: string): void

Methods

Private addAuth

  • addAuth(uri: string): string

artist

  • artist(name: string): Promise<Artist>

artists

comment

  • comment(id: number | string): Promise<Comment>

comments

favorite

  • favorite(id: number): Promise<boolean>

Protected fetch

  • fetch(path: string, config?: undefined | object): Promise<any>
  • GET an API call result as an object

    Parameters

    • path: string

      Part of the URI appended to the base

    • Optional config: undefined | object

      Axios config object

    Returns Promise<any>

Protected genericQuery

  • genericQuery(type: string, query: Query.Any): Promise<any[]>

Protected genericSingle

  • genericSingle(type: string, id: number): Promise<any>

note

  • note(): Promise<Note>

notes

  • Get an array of Notes that match a query

    Parameters

    • query: Notes

      Notes search query object

    Returns Promise<Note[]>

  • Get back the Post you passed in with the notes field populated

    Parameters

    • post: Post

      The post to find notes for

    Returns Promise<Post>

pool

  • pool(id: number | string): Promise<Pool>
  • Get a single Pool by ID

    Parameters

    • id: number | string

      ID of the pool

    Returns Promise<Pool>

pools

post

  • post(id: number): Promise<Post>

posts

unfavorite

  • unfavorite(id: number): Promise<boolean>

user

  • user(id: number): Promise<User>

users

vote

  • vote(id: number, score: 0 | 1 | 2 | 3): Promise<boolean>

wiki

  • wiki(id: number | string): Promise<Wiki>
  • Get a single Wiki page by ID

    Parameters

    • id: number | string

      ID of the wiki page

    Returns Promise<Wiki>

wikis

Generated using TypeDoc