@unparallel/connector-ri
v3.0.0
Published
This connector implements the logic needed to connect the SDK-RI, providing an abstraction used by the Web-RI.
Downloads
15
Readme
Connector-RI
This connector implements the logic needed to connect the SDK-RI, providing an abstraction used by the Web-RI.
Installation
npm install @unparallel/connector-ri
How to use
import Connector from '@unparallel/connector-ri'
const connector = new Connector(SDK_RI_ENDPOINT, LOG_LEVEL)
// SDK_RI_ENDPOINT: pilot endpoint
// LOG_LEVEL (optional): logs level (more info: https://github.com/jonnyreeves/js-logger)
Available functions
getOfferingTemplate(accessToken, idToken) // get template for register an offering
getOfferings(accessToken, idToken) // get list of offerings
getProviders(accessToken, idToken) // get list of providers
getCategories(accessToken, idToken) // get list of categories
getOffering(accessToken, idToken, OFFERING_ID) // get details for a specific offering
getProviderOfferings(accessToken, idToken, PROVIDER_ID) // get list of offerings from a provider
getCategoryOfferings(accessToken, idToken, CATEGORY) // get list of offering from a category
getOfferingsByCategory(accessToken, idToken) // get list of offerings by categories
getOfferingContractParameters(accessToken, idToken, OFFERING_ID) // get list of contract parameters from a specific category
registerOffering(accessToken, idToken, DATA) // register a new offering
deleteOffering(accessToken, idToken, OFFERING_ID) // delete an offering
updateOffering(accessToken, idToken, DATA) // update an offering
Example
const offerings = await connector.getProviderOfferings(accessToken, idToken, PROVIDER_ID)
Credits
This repository has been created by:
Márcio Mateus [email protected]
Pedro Ferreira [email protected]
License
The code in ths repository is licensed under the MIT License.