Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@oada/client

Package Overview
Dependencies
Maintainers
8
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oada/client

A lightweight client tool to interact with an OADA-compliant server

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-77.36%
Maintainers
8
Weekly downloads
 
Created
Source

@oada/client

A lightweight client tool for interacting with an OADA-complient server

@oada/client@oada/oada-cache
LanguageTypeScriptJavaScript
Supported protocolswebsocketwebsocket, HTTP
Internal cacheNoYes

Usage

Connect

var client = require("@oada/client")
var connection = await client.connect({
  domain: "api.oada.com",
  token: "abc"
})

GET

Single GET
var response = await connection.get({ path: '/bookmarks/test' })
Recursive GET
var dataTree = {
  "bookmarks": {
    "_type": "application/vnd.oada.bookmarks.1+json",
    "_rev": 0,
    "thing": {
      "_type": "application/json",
      "_rev": 0,
      "abc": {
        "*": {
          "_type": "application/json",
      	  "_rev": 0,
        }
      }
    }
  }
}
var response = await connection.get({
  path: '/bookmarks/thing',
  tree: dataTree
})
Watch
var response = await connection.get({
  path: '/bookmarks/test',
  watchCallback: d => {
    console.log(d);
  }
})

PUT

Single PUT
var response = await connection.put({
  path: "/bookmarks/test",
  data: { thing: "abc" },
  contentType: "application/json"
})
Tree PUT
var dataTree = {
  "bookmarks": {
    "_type": "application/vnd.oada.bookmarks.1+json",
    "_rev": 0,
    "thing": {
      "_type": "application/json",
      "_rev": 0,
      "abc": {
        "*": {
          "_type": "application/json",
      	  "_rev": 0,
        }
      }
    }
  }
}
var response = await connection.put({
  path: '/bookmarks/thing/abc/xyz/zzz',
  tree: dataTree,
  data: { test: "something" }
})

HEAD

var response = await connection.head({ path: '/bookmarks/test' })

FAQs

Package last updated on 04 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc