Constructor
new User(usernameopt, authopt, apiBaseopt)
Create a User.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
username |
string
|
<optional> |
the user to use for user-scoped queries |
|
auth |
Requestable.auth
|
<optional> |
information required to authenticate to ApiWay |
|
apiBase |
string
|
<optional> |
https://api.apiway.io |
the base ApiWay API URL |
Methods
getProfile(userIdopt, cbopt) → {Promise}
Get the user's profile
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
userId |
string
|
<optional> |
|
cb |
Requestable.callback
|
<optional> |
will receive the list of repositories |
Returns:
- Type:
-
Promise
- the promise for the http request
updateProfile(options, cbopt) → {Promise}
Update user's profile (Will create a new user if not exist)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
object
|
- |
|
cb |
Requestable.callback
|
<optional> |
will receive the API response |
Returns:
- Type:
-
Promise
- the promise for the http request