wdia-client-alpha

1.0.7 • Public • Published

Client

Client class for WDIA. Token is optional but required for methods with auth.

Kind: global class

new Client([url], [protocol], [host], [port], [token])

Param Type Default Description
[url] string connection url (use other params if not specified)
[protocol] string "http" connection protocol
[host] string connection host
[port] string connection port
[token] string connection token (optional)

client.commonResources() ⇒ Promise

get common resources (states, types, sources)

Kind: instance method of Client
Returns: Promise - Promise with {states, types, sources}

client.fieldsList([limit], [offset], [order]) ⇒ Promise

get fields list

Kind: instance method of Client
Returns: Promise - Promise with array of fields

Param Type Description
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)

client.fieldsTemplatesList([limit], [offset], [order]) ⇒ Promise

get fieldsTemplates list

Kind: instance method of Client
Returns: Promise - Promise with array of fieldsTemplates

Param Type Description
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)

client.companiesList([limit], [offset], [order], [updatedAt], [name], [type], [state]) ⇒ Promise

get companies list

Kind: instance method of Client
Returns: Promise - Promise with array of companies and count

Param Type Description
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)
[updatedAt] date companies with updatedAt greater than specified
[name] string companies with name like specified
[type] number companies type (1 - service, 2 - verifier)
[state] array companies states

client.companyServicesList(companyId, [limit], [offset], [order], [state]) ⇒ Promise

get company services or verifiers

Kind: instance method of Client
Returns: Promise - Promise with array of services and count

Param Type Description
companyId number company Id
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)
[state] array services or verifiers states

client.servicesList([limit], [offset], [order], [updatedAt], [name], [type], [state]) ⇒ Promise

get services list

Kind: instance method of Client
Returns: Promise - Promise with array of services and count

Param Type Description
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)
[updatedAt] date services with updatedAt greater than specified
[name] string services with name like specified
[type] number services type
[state] array services states

client.verfiersList([limit], [offset], [order], [updatedAt], [name], [state]) ⇒ Promise

get verifiers list

Kind: instance method of Client
Returns: Promise - Promise with array of verifiers and count

Param Type Description
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)
[updatedAt] date verifiers with updatedAt greater than specified
[name] string verifiers with name like specified
[state] array verifiers states

client.serviceListVerifiers(hash, [limit], [offset], [order], [updatedAt], [name], [state]) ⇒ Promise

get verifiers list for service

Kind: instance method of Client
Returns: Promise - Promise with array of verifiers and count

Param Type Description
hash string hash of service
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)
[updatedAt] date verifiers with updatedAt greater than specified
[name] string verifiers with name like specified
[state] array verifiers states

client.verifierListServices(hash, [limit], [offset], [order], [updatedAt], [name], [type], [state]) ⇒ Promise

get services list for verifier

Kind: instance method of Client
Returns: Promise - Promise with array of services and count

Param Type Description
hash string hash of verifier
[limit] number limit
[offset] number offset
[order] array order array (sequelize order)
[updatedAt] date services with updatedAt greater than specified
[name] string services with name like specified
[type] number services type
[state] array services states

client.getServicePubKeys(hash) ⇒ Promise

get service`s keys (salts)

Kind: instance method of Client
Returns: Promise - Promise array of keys

Param Type Description
hash string hash of service

client.getVerfierPubKeys(hash) ⇒ Promise

get verifier`s keys (salts)

Kind: instance method of Client
Returns: Promise - Promise array of keys

Param Type Description
hash string hash of verifier

client.getProviderPubKeys(hash) ⇒ Promise

get verifier or service keys (salts)

Kind: instance method of Client
Returns: Promise - Promise array of keys

Param Type Description
hash string hash of verifier or service

client.checkServiceKey([scriptHash]) ⇒ Promise

check service key (salt)

Kind: instance method of Client
Returns: Promise - Promise object with service object and key state

Param Type Description
[scriptHash] string scriptHash of service

client.checkVerifierKey([scriptHash]) ⇒ Promise

check verifier key (salt)

Kind: instance method of Client
Returns: Promise - Promise object with verifier object and key state

Param Type Description
[scriptHash] string scriptHash of verifier

client.checkProviderKey([scriptHash]) ⇒ Promise

check service or verifier key (salt)

Kind: instance method of Client
Returns: Promise - Promise object with service or verifier object and key state

Param Type Description
[scriptHash] string scriptHash of verifier

client.getServiceFields(hash) ⇒ Promise

get service`s fields

Kind: instance method of Client
Returns: Promise - Promise with array of fields

Param Type Description
hash string hash of service

client.getVerifierFields(hash) ⇒ Promise

get verifier`s fields

Kind: instance method of Client
Returns: Promise - Promise with array of fields

Param Type Description
hash string hash of verifier

client.getService(hash, [logo], [fields]) ⇒ Promise

get service

Kind: instance method of Client
Returns: Promise - Promise with service

Param Type Default Description
hash string service hash
[logo] boolean false add company logo to response (default: false)
[fields] boolean false add fields to response (default: false)

client.getVerifier(hash, [logo], [fields]) ⇒ Promise

get verifier

Kind: instance method of Client
Returns: Promise - Promise with verifier

Param Type Default Description
hash string verifier hash
[logo] boolean false add company logo to response (default: false)
[fields] boolean false add fields to response (default: false)

client.addService(type, name, [description], url, fields) ⇒ Promise

add service

Kind: instance method of Client
Returns: Promise - Promise with service

Param Type Description
type number service type
name string name
[description] string description
url string url
fields object fields {[fieldId]: true

client.addVerifier(name, [description], url, fields) ⇒ Promise

add verifier

Kind: instance method of Client
Returns: Promise - Promise with verifier

Param Type Description
name string name
[description] string description
url string url
fields object fields {[fieldId]: true

client.updateCompany([name], [description], [url], [details], [logo]) ⇒ Promise

update company

Kind: instance method of Client
Returns: Promise - Promise with service

Param Type Description
[name] string name
[description] string description
[url] string url
[details] object details
[logo] string logo file in base64 (null - if you want remove previous)

client.getUserRoles([limit], [offset]) ⇒ Promise

get user roles

Kind: instance method of Client
Returns: Promise - Promise with roles

Param Type Description
[limit] number limit
[offset] number offset

client.addCompanyUser(email, firstname, lastname, role) ⇒ Promise

add company user

Kind: instance method of Client
Returns: Promise - Promise with service

Param Type Description
email string email
firstname string firstname
lastname string lastname
role number role

client.getCompanyUsers() ⇒ Promise

get company users

Kind: instance method of Client
Returns: Promise - Promise with service

client.updateService(hash, [type], [name], [description], [url], [fields]) ⇒ Promise

update service

Kind: instance method of Client
Returns: Promise - Promise with service

Param Type Description
hash string hash
[type] number service type
[name] string name
[description] string description
[url] string url
[fields] object fields {[fieldId]: true

client.updateVerifier(hash, [name], [description], [url], [fields]) ⇒ Promise

update verifier

Kind: instance method of Client
Returns: Promise - Promise with verifier

Param Type Description
hash string hash
[name] string name
[description] string description
[url] string url
[fields] object fields {[fieldId]: true

client.addServicePubKeys(hash, keys) ⇒ Promise

add service keys (salts)

Kind: instance method of Client
Returns: Promise - Promise with keys and status

Param Type Description
hash string hash
keys array keys [scriptHash]

client.addVerifierPubKeys(hash, keys) ⇒ Promise

add verifier keys (salts)

Kind: instance method of Client
Returns: Promise - Promise with keys and status

Param Type Description
hash string hash
keys array keys [scriptHash]

client.disableServicePubKeys(keys) ⇒ Promise

disable service keys (salts)

Kind: instance method of Client
Returns: Promise - Promise with result

Param Type Description
keys array keys [scriptHash]

client.disableVerifierPubKeys(keys) ⇒ Promise

disable verifier keys (salts)

Kind: instance method of Client
Returns: Promise - Promise with result

Param Type Description
keys array keys [scriptHash]

Readme

Keywords

none

Package Sidebar

Install

npm i wdia-client-alpha

Weekly Downloads

1

Version

1.0.7

License

none

Unpacked Size

41.9 kB

Total Files

4

Last publish

Collaborators

  • kolerts
  • volkoff