Class: Registry

Defined in: src/registry.coffee

Overview

The representation of a connection to an Intermine Registry

Instance Method Summary

Instance Method Details

# (String) getFormat(intended = 'json')

Helper function to default to JSON format unless specified

Parameters:

  • intended ( String ) datatype to return if present

Returns:

  • ( String ) — datatype if provided or fallbacks to json data

# (Boolean) isEmpty(obj)

Helper function to check if an object is empty or not

Parameters:

  • obj ( Object ) to test if empty or has some properties

Returns:

  • ( Boolean ) — true if object doesnot have own properties

# (void) errorHandler(e)

Default error handler function to provide error stream if present or fallback to stdout

Parameters:

  • e ( Any ) Logs the parameter provided under error stream if present or under the logging stream

# (String) makePath(path = '', params = {}) Bound

Concatenates relative path with root and returns final path to call service from where to make the request

Parameters:

  • path ( String ) declare the scope from where to fetch the data

Returns:

  • ( String ) — Final scope relative to the root of the

# (Promise<Object>) makeRequest(method = 'GET', path = '', urlParams = {}, data = {}, cb = function() {})

Helper function to make request, to be augmented further as need arises

with callback attatched if provided

Parameters:

  • method ( String ) The HTTP method to use (one of GET, POST, PUT, DELETE).
  • path ( String ) The path fragment of the endpoint to use. The service's root will be prepended to obtain the full URI.
  • urlParams ( Object<String, String> ) The query paramters to be passed in the url (in form of key: value pairs)
  • data ( Object,Array ) The parameters to send to the service.
  • cb ( (data) -> ) A function that will be called on the results when received.

Returns:

  • ( Promise<Object> ) — A promise to yield a response object along

# (Promise<Array<Object>>) fetchMines(q = [], mines = [], cb = function() {}) Bound

Fetches instances of all known registry information

Parameters:

  • q ( Array<String> ) A list of words to look for in the instance name, organisms or brief description. If not given, all the instances are returned
  • mines ( Array<String> ) Three possible values: 'dev’, 'prod’ or 'all'. Retrieves the InterMine instances that are ‘development’ mines, all the mines or ‘production’ mines respectively.
  • cb ( -> ) A function to be attatched to the returned promise

Returns:

  • ( Promise<Array<Object>> ) — A promise which gets the results

# (Promise<Object>) fetchInstance(id = "", cb = function() {})

Fetches all the information of an instance by its instance id, name or namespace

Parameters:

  • id ( String ) Instance ID, Name or Namespace whose information has to be fetched
  • cb ( -> ) A function to be attatched to the returned Promise

Returns:

  • ( Promise<Object> ) — A promise which gets the results (and possibly has cb attatched to it)

# (Promise<Object>) fetchNamespace(url = "", cb = function() {})

Return the namespace assigned to the instance with URL given in input

Parameters:

  • url ( String ) URL to which the instance has been assigned whose namespace has to be fetched
  • cb ( -> ) A function to be attatched to the returned Promise

Returns:

  • ( Promise<Object> ) — A promise which gets the namespace (and possibly has cb attatched to it)

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: