Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

superfaceai/superdriver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Superdriver

Level 5 self-driving client for Autonomous APIs. Superdriver is part of the superface communication mechanism. Visit superface.ai for more information.

Demo

You can see Superdriver in action at superface.glitch.me, view its sources and remix it at the Superface Glitch Project Page.

Usage

Node.js

NPM

$ npm install --save superdriver

YARN

$ yarn add superdriver

Browser

Superdriver is universal library working both in Node.js and browser. See the examples folder for more details.

Making Call

import { Consumer } from "superdriver"

const PROFILE_ID = "http://supermodel.io/weather/profile/WeatherAlerts"

const client = new Consumer({
  url: SERVICE_URL,
  mappingUrl: MAPPING_URL,
  profileId: PROFILE_ID
})

const response = await client.perform({
  operation: "RetrieveAlert",
  parameters: {
    addressLocality
  },
  response: [
    "title",
    "description",
    "severity",
    "startDate",
    "endDate"
  ]
})

Superdriver API

Superdriver has two main components Register and Consumer. The Register serves for interactions with the superface registry. It allows for registering and unregistering superface provider as well as for services lookup. The Consumer then performs profile operations with the selected provider.

Consumer:perform()

Perform an operation with the selected provider.

Register:findServices()

Query the superface registry returning providers implementing the requested profile.

Register:registerService()

Reqisters a provider at a superface registry.

Register:unregisterService()

Un-register (removes) a provider from a superface registry.

Contact

If you would like to contribute to the superface project or deploy an Autonomous API in your next application, please email hello@superface.ai or contact us at @superfaceai on Twitter.

About

DEPRECATED: The original version of Superface SDK based on ALPS profile and OAS extensions. Do not use.

Topics

Resources

License

Stars

Watchers

Forks