npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wdia-client-alpha

v1.0.7

Published

Node.js wdia client

Downloads

17

Readme

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 || false}', |

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 || false} |

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 || false}', |

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 || false} |

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] |