1.0.7 • Published 4 years ago

wdia-client-alpha v1.0.7

Weekly downloads
48
License
-
Repository
-
Last release
4 years ago

Client

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

Kind: global class

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

ParamTypeDefaultDescription
urlstringconnection url (use other params if not specified)
protocolstring"http"connection protocol
hoststringconnection host
portstringconnection port
tokenstringconnection 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

ParamTypeDescription
limitnumberlimit
offsetnumberoffset
orderarrayorder array (sequelize order)

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

get fieldsTemplates list

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

ParamTypeDescription
limitnumberlimit
offsetnumberoffset
orderarrayorder 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

ParamTypeDescription
limitnumberlimit
offsetnumberoffset
orderarrayorder array (sequelize order)
updatedAtdatecompanies with updatedAt greater than specified
namestringcompanies with name like specified
typenumbercompanies type (1 - service, 2 - verifier)
statearraycompanies 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

ParamTypeDescription
companyIdnumbercompany Id
limitnumberlimit
offsetnumberoffset
orderarrayorder array (sequelize order)
statearrayservices 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

ParamTypeDescription
limitnumberlimit
offsetnumberoffset
orderarrayorder array (sequelize order)
updatedAtdateservices with updatedAt greater than specified
namestringservices with name like specified
typenumberservices type
statearrayservices 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

ParamTypeDescription
limitnumberlimit
offsetnumberoffset
orderarrayorder array (sequelize order)
updatedAtdateverifiers with updatedAt greater than specified
namestringverifiers with name like specified
statearrayverifiers 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

ParamTypeDescription
hashstringhash of service
limitnumberlimit
offsetnumberoffset
orderarrayorder array (sequelize order)
updatedAtdateverifiers with updatedAt greater than specified
namestringverifiers with name like specified
statearrayverifiers 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

ParamTypeDescription
hashstringhash of verifier
limitnumberlimit
offsetnumberoffset
orderarrayorder array (sequelize order)
updatedAtdateservices with updatedAt greater than specified
namestringservices with name like specified
typenumberservices type
statearrayservices states

client.getServicePubKeys(hash) ⇒ Promise

get service`s keys (salts)

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

ParamTypeDescription
hashstringhash of service

client.getVerfierPubKeys(hash) ⇒ Promise

get verifier`s keys (salts)

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

ParamTypeDescription
hashstringhash of verifier

client.getProviderPubKeys(hash) ⇒ Promise

get verifier or service keys (salts)

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

ParamTypeDescription
hashstringhash 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

ParamTypeDescription
scriptHashstringscriptHash 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

ParamTypeDescription
scriptHashstringscriptHash 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

ParamTypeDescription
scriptHashstringscriptHash of verifier

client.getServiceFields(hash) ⇒ Promise

get service`s fields

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

ParamTypeDescription
hashstringhash of service

client.getVerifierFields(hash) ⇒ Promise

get verifier`s fields

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

ParamTypeDescription
hashstringhash of verifier

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

get service

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

ParamTypeDefaultDescription
hashstringservice hash
logobooleanfalseadd company logo to response (default: false)
fieldsbooleanfalseadd fields to response (default: false)

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

get verifier

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

ParamTypeDefaultDescription
hashstringverifier hash
logobooleanfalseadd company logo to response (default: false)
fieldsbooleanfalseadd 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

ParamTypeDescription
typenumberservice type
namestringname
descriptionstringdescription
urlstringurl
fieldsobjectfields {fieldId: truefalse}',

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

add verifier

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

ParamTypeDescription
namestringname
descriptionstringdescription
urlstringurl
fieldsobjectfields {fieldId: truefalse}

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

update company

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

ParamTypeDescription
namestringname
descriptionstringdescription
urlstringurl
detailsobjectdetails
logostringlogo 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

ParamTypeDescription
limitnumberlimit
offsetnumberoffset

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

add company user

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

ParamTypeDescription
emailstringemail
firstnamestringfirstname
lastnamestringlastname
rolenumberrole

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

ParamTypeDescription
hashstringhash
typenumberservice type
namestringname
descriptionstringdescription
urlstringurl
fieldsobjectfields {fieldId: truefalse}',

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

update verifier

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

ParamTypeDescription
hashstringhash
namestringname
descriptionstringdescription
urlstringurl
fieldsobjectfields {fieldId: truefalse}

client.addServicePubKeys(hash, keys) ⇒ Promise

add service keys (salts)

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

ParamTypeDescription
hashstringhash
keysarraykeys scriptHash

client.addVerifierPubKeys(hash, keys) ⇒ Promise

add verifier keys (salts)

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

ParamTypeDescription
hashstringhash
keysarraykeys scriptHash

client.disableServicePubKeys(keys) ⇒ Promise

disable service keys (salts)

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

ParamTypeDescription
keysarraykeys scriptHash

client.disableVerifierPubKeys(keys) ⇒ Promise

disable verifier keys (salts)

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

ParamTypeDescription
keysarraykeys scriptHash
1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago