Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ChapterService

Index

Constructors

constructor

Properties

debug

debug: logger.IDebugger

Private req

Methods

getChapter

  • Return a chapter given its unique ID.

    Parameters

    • chapterID: number

      ID of the chapter to get.

    Returns Promise<RoyalResponse<Chapter>>

getComments

  • Return an array of comments for a given chapter.

    Parameters

    • chapterID: number

      ID of the chapter to get comments from.

    • Default value page: number | "last" = 1

      Either the page of comments to load, or 'last'.

    Returns Promise<RoyalResponse<ChapterComment[]>>

Private isValidNewChapter

  • Basic checks for a chapter opjects' validity.

    Parameters

    Returns boolean

postComment

  • postComment(chapterID: number, content: string): Promise<RoyalResponse<null>>
  • Post a comment for a given fiction.

    Parameters

    • chapterID: number

      ID of the chapter to post a comment to.

    • content: string

      Content to post, seperate paragraphs with '\n'.

    Returns Promise<RoyalResponse<null>>

publish

  • Add a chapter to a given fiction.

    Parameters

    • fictionID: number

      ID of the fiction to publish a chapter for.

    • chapter: NewChapter

      Object describing the chapter.

    Returns Promise<RoyalResponse<NewChapter>>

Private requireAuth

  • requireAuth(): void
  • Throw if the requester doesn't have authentication.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc