Client library for interacting with seagull, Tidepool's user metadata service
require('seagull-client')(config, hostGetter, request);
hostGetter
-- an object from hakkenconfig
-- an object containing configuration parametersrequest
-- see amoeba httpClient
Generates an object with the members listed below.
getProfile (userId, token, cb)
Retrieves the user profile from metadatauserId
-- the Tidepool-assigned userIdtoken
-- a server token or the user tokencb (err, response)
err
-- null if no error, else an objectresponse
-- result from the /metadata/:userid/profile api call
getGroups (userId, token, cb)
Retrieves the user group information from metadatauserId
-- the Tidepool-assigned userIdtoken
-- a server token or the user tokencb (err, response)
err
-- null if no error, else an objectresponse
-- result from the /metadata/:userid/groups api call
getPrivatePair (userId, hashName, token, cb)
Gets a private pair from metadatauserId
-- the Tidepool-assigned userIdhashName
-- the name of the particular pair value to retrievetoken
-- a server token (user token not valid)cb (err, response)
err
-- null if no error, else an objectresponse
-- result from the /metadata/:userid/private api call
getCollection (userId, collectionName, token, cb)
Retrieves arbitrary collection information from metadatauserId
-- the Tidepool-assigned userIdcollectionName
-- the collection being retrievedtoken
-- a server token or the user tokencb (err, response)
err
-- null if no error, else an objectresponse
-- result from the /metadata/:userid/groups api call