Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PBE

Hierarchy

  • PBE

Index

Constructors

  • new PBE(api_url: string): PBE
  • The constructor function is a special function that is called when an object is created from a class

    Parameters

    • api_url: string

      The URL of the API you want to use.

    Returns PBE

Properties

api_url: string

Methods

  • It takes a slug and a boolean, and returns a promise that resolves to a PostData object or an Error object

    Parameters

    • slug: string

      The slug of the post you want to get.

    • raw: boolean = false

    Returns Promise<PostData | Error>

    An PostData object or an Error object.

  • It returns an array of post metadata, or an error

    Parameters

    • offset: number = 0

    Returns Promise<Error | Metadata[]>

    An array of Metadata objects or an Error object.

  • get_posts_with_tag(tag: string, offset?: number): Promise<Error | Metadata[]>
  • Get every post containing the given tag

    Parameters

    • tag: string

      The tag you want to search for.

    • offset: number = 0

    Returns Promise<Error | Metadata[]>

    An array of metadata objects or an error object.

  • It takes a query string and returns an array of metadata objects or an error

    Parameters

    • query: string

      The query string to search for.

    Returns Promise<Error | SearchResult[]>

    An array of Metadata objects or an Error object.

  • submit_feedback(thumbs_up: boolean, post_slug: string, feedback?: string): Promise<Error>
  • It sends a POST request to the API endpoint /api/v1/feedback/ with the parameters thumbs_up, post_slug, and feedback

    Parameters

    • thumbs_up: boolean

      boolean - True if the user liked the post, false if they didn't.

    • post_slug: string

      The slug of the post you want to submit feedback for.

    • Optional feedback: string

    Returns Promise<Error>

    An object with a message and http_status_code

Generated using TypeDoc