new Dashboard(uriopt)
Initialize a new dashboard api connection to URI
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
uri |
string |
<optional> |
'https://dashboard-service.zippie.org' |
Dashboard service URI |
- Source:
Example
const Dashboard = require('../lib/dashboard.js')
const api = new Dashboard('https://dashboard-service.zippie.org')
api.initWithKey(SERVICE_KEY)
api.CheckAllowed(some_key, permission)
.then(isAllowed => {
console.info(some_key, permission, isAllowed)
})
.catch(error => {
console.error('Error:', error)
})
Methods
AcceptInvite(name, email, invite) → {PublicKey}
Parameters:
Name | Type | Description |
---|---|---|
name |
String | |
email |
String | |
invite |
Object |
- Source:
AssignPermission(pubkey, tag) → {Boolean}
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
PublicKey | |
tag |
String |
- Source:
CheckAllowed(pubkey, tag) → {Boolean}
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
PublicKey | |
tag |
String |
- Source:
CreateApplication(orgpub, name, info) → {PublicKey}
Create a new organisation application
Parameters:
Name | Type | Description |
---|---|---|
orgpub |
PublicKey | |
name |
String | |
info |
ApplicationInfo |
- Source:
CreateOrganisation(name) → {String}
Create a new empty named organisation.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The name of the organisation |
- Source:
GetApplicationInfo(pubkey) → {ApplicationInfo}
Get application metadata
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
PublicKey |
- Source:
GetOrganisationInfo(orgpub) → {OrganisationInfo}
Get the organisation metadata
Parameters:
Name | Type | Description |
---|---|---|
orgpub |
PublicKey |
Organisation public key |
- Source:
GetUserInfo(pubkey) → {UserInfo}
Get user metadata
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
Buffer |
User public key |
- Source:
initWithKey(key)
Initialize dashboard API connection using provided user private key.
Parameters:
Name | Type | Description |
---|---|---|
key |
* |
- Source:
Example
const Dashboard = require('../lib/dashboard.js')
const api = new Dashboard('https://dashboard-service.zippie.org')
api.initWithKey(SERVICE_KEY)
api.CheckAllowed(some_key, permission)
.then(isAllowed => {
console.info(some_key, permission, isAllowed)
})
.catch(error => {
console.error('Error:', error)
})
initWithVault(vault, derive)
Initialize dashboard API connection using vault and key derivation path.
Parameters:
Name | Type | Description |
---|---|---|
vault |
* | |
derive |
* |
- Source:
Example
const Dashboard = require('../lib/dashboard.js')
const api = new Dashboard('https://dashboard-service.zippie.org')
api.initWithVault(vault, 'm/0')
api.CheckAllowed(some_key, permission)
.then(isAllowed => {
console.info(some_key, permission, isAllowed)
})
.catch(error => {
console.error('Error:', error)
})
InviteUser(email, orgpub, role) → {String}
Generate an authenticated message which expires in 1 hour. This is then sent to the supplied email via FMS.
Parameters:
Name | Type | Description |
---|---|---|
email |
String | |
orgpub |
PublicKey | |
role |
String |
- Source:
ListApplications(orgpub) → {Array.<ApplicationListItem>}
List application members of an organisation.
Parameters:
Name | Type | Description |
---|---|---|
orgpub |
PublicKey |
Organisation public key |
- Source:
ListOrganisations(userpub) → {Array.<OrganisationListItem>}
Get a list of all organisations in database, or if pubkey supplied, get organisations that the user is a part of.
Parameters:
Name | Type | Description |
---|---|---|
userpub |
PublicKey |
Users public key. |
- Source:
ListUsers(orgpub) → {Array.<UserListItem>}
Parameters:
Name | Type | Description |
---|---|---|
orgpub |
PublicKey |
Organisation public key |
- Source:
RemoveApplication(orgpub, pubkey) → {Boolean}
Remove an application from the database
Parameters:
Name | Type | Description |
---|---|---|
orgpub |
PublicKey | |
pubkey |
PublicKey |
- Source:
RemoveOrganisation(pubkey) → {Boolean}
Remove an organistaion from the database
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
PublicKey |
- Source:
RemovePermission(pubkey, tag) → {Boolean}
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
PublicKey | |
tag |
String |
- Source:
RemoveUser(orgpub, pubkey) → {Boolean}
Remove a user from the database
Parameters:
Name | Type | Description |
---|---|---|
orgpub |
PublicKey | |
pubkey |
PublicKey |
- Source:
SetApplicationInfo(pubkey, info) → {Boolean}
Set application metadata
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
PublicKey | |
info |
ApplicationInfo |
- Source:
SetOrganisationInfo(orgpub, info) → {Boolean}
Set the organisation metadata. (Setting a field to null removes it)
Parameters:
Name | Type | Description |
---|---|---|
orgpub |
PublicKey |
Organisation public key |
info |
Object |
Changes to metadata |
- Source:
SetUserInfo(pubkey, info) → {Boolean}
Set user metadata, setting property to null removes it.
Parameters:
Name | Type | Description |
---|---|---|
pubkey |
Buffer |
User public key |
info |
Object |
User metadata modifications |
- Source: