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 - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

1

dist/websocket.js

@@ -35,3 +35,2 @@ "use strict";

constructor(domain, concurrency = 10) {
console.log("domain", domain);
this._domain = domain;

@@ -38,0 +37,0 @@ this._requests = new Map();

2

package.json
{
"name": "@oada/client",
"version": "1.1.2",
"version": "1.1.3",
"description": "A lightweight client tool to interact with an OADA-compliant server",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -17,4 +17,4 @@ # @oada/client

```javascript
var client = require("@oada/client")
var connection = await client.connect({
const client = require("@oada/client")
const connection = await client.connect({
domain: "api.oada.com",

@@ -30,3 +30,3 @@ token: "abc"

```javascript
var response = await connection.get({
const response = await connection.get({
path: '/bookmarks/test',

@@ -40,3 +40,3 @@ timeout: 1000 // timeout in milliseconds (optional)

``` javascript
var dataTree = {
const dataTree = {
"bookmarks": {

@@ -57,3 +57,3 @@ "_type": "application/vnd.oada.bookmarks.1+json",

}
var response = await connection.get({
const response = await connection.get({
path: '/bookmarks/thing',

@@ -67,4 +67,5 @@ tree: dataTree,

A watch request can be issued by passing a callback function to `watchCallback` argument of a GET request.
```javascript
var response = await connection.get({
const response = await connection.get({
path: '/bookmarks/test',

@@ -78,2 +79,19 @@ watchCallback: d => {

Alternatively, one could explicitly send a `watch` request as follows.
```javascript
const requestId = await connection.watch({
path: '/bookmarks/test',
rev: 1, // optional
watchCallback: d => {
console.log(d);
},
timeout: 1000 // timeout in milliseconds (optional)
})
```
To unwatch a resource, use the `unwatch` request.
```javascript
const response = await connection.unwatch(requestId);
```
### PUT

@@ -84,3 +102,3 @@

```javascript
var response = await connection.put({
const response = await connection.put({
path: "/bookmarks/test",

@@ -96,3 +114,3 @@ data: { thing: "abc" },

``` javascript
var dataTree = {
const dataTree = {
"bookmarks": {

@@ -113,3 +131,3 @@ "_type": "application/vnd.oada.bookmarks.1+json",

}
var response = await connection.put({
const response = await connection.put({
path: '/bookmarks/thing/abc/xyz/zzz',

@@ -125,3 +143,3 @@ tree: dataTree,

```javascript
var response = await connection.head({
const response = await connection.head({
path: '/bookmarks/test',

@@ -128,0 +146,0 @@ timeout: 1000 // timeout in milliseconds (optional)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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