API Docs for:
Show:

Charmworld0 Class

Extends Base
Module: store.charm
Parent Module: store

Api helper for the updated charmworld api v0.

Methods

_makeRequest

(
  • args
)
private

Send the actual request and handle response from the api.

Parameters:

  • args Object

    any query params and arguments required.

_resultsToCharmlist

(
  • JSON
)
private

Given a result list, turn that into a BrowserCharmList object for the application to use.

Parameters:

  • JSON Object

    decoded data from response.

charm

(
  • charmID
  • callbacks
  • bindScope
)

Api call to fetch a charm's details.

Parameters:

  • charmID String

    the charm to fetch.

  • callbacks Object

    the success/failure callbacks to use.

  • bindScope Object

    the scope of this in the callbacks.

file

(
  • charmID
  • filename
  • callbacks
  • bindScope
)

Fetch the contents of a charm's file.

Parameters:

  • charmID String

    the id of the charm's file we want.

  • filename String

    the path/name of the file to fetch content.

  • callbacks Object

    the success/failure callbacks.

  • bindScope Object

    the scope for this in the callbacks.

initializer

(
  • cfg
)

Initialize the API helper. Constructs a reusable datasource for all calls.

Parameters:

  • cfg Object

    configuration object.

interesting

() Object

Fetch the interesting landing content from the charmworld api.

Returns:

Object: data loaded from the api call.

qa

(
  • charmID
  • callbacks
  • bindScope
)

Load the QA data for a specific charm.

Parameters:

  • charmID String

    the charm to fetch qa data for.

  • callbacks Object

    the success/failure callbacks to use.

  • bindScope Object

    the scope for 'this' in the callbacks.

Attributes

apiHost

String

Required attribute for the host to talk to for api calls.

Default: undefined

datasource

Datasource

Auto constructed datasource object based on the apiHost attribute.