Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Api

Hierarchy

  • Api

Index

Constructors

constructor

  • new Api(accessToken: string): Api

Properties

Private accessToken

accessToken: string

Methods

get

  • get(endpoint: string, params: any): Promise<any>
  • Gets an endpoint from the DeviantArt api.

    Parameters

    • endpoint: string
    • params: any

    Returns Promise<any>

Static cleanHTML

  • cleanHTML(str: string): string
  • Cleans html by stripping tags and entities.

    Parameters

    • str: string

    Returns string

Static formatJSON

  • Formats the raw json received to a more friendly version.

    Parameters

    • json: string

    Returns DeviationRSS

Static getNoLogin

  • getNoLogin(endpoint: string, params: any): Promise<any>
  • Used internally to get the access token in login

    Parameters

    • endpoint: string
    • params: any

    Returns Promise<any>

Static getRSS

  • getRSS(params: any, limit?: number): Promise<any[]>
  • Fetches xml from the RSS api and converts it to json.

    Parameters

    • params: any
    • Optional limit: number

    Returns Promise<any[]>

Static parseUrl

  • Parses the title, user, and numeric id from a url.

    Parameters

    • url: string

    Returns ParsedURL

Generated using TypeDoc