@oada/client
Advanced tools
Comparing version 2.1.2-beta.0 to 2.2.1
@@ -104,3 +104,3 @@ "use strict"; | ||
let headers = {}; | ||
if (request.rev) { | ||
if (typeof (request.rev) !== 'undefined') { | ||
headers["x-oada-rev"] = request.rev; | ||
@@ -107,0 +107,0 @@ } |
@@ -35,2 +35,8 @@ "use strict"; | ||
})(ConnectionStatus || (ConnectionStatus = {})); | ||
class BetterWebSocket extends WebSocket { | ||
constructor(url, protocols = [], _a = {}) { | ||
var { maxPayload = 0 } = _a, rest = __rest(_a, ["maxPayload"]); | ||
super(url, protocols, Object.assign({ maxPayload }, rest)); | ||
} | ||
} | ||
class WebSocketClient extends events_1.EventEmitter { | ||
@@ -44,3 +50,3 @@ constructor(domain, concurrency = 10) { | ||
const ws = new reconnecting_websocket_1.default("wss://" + this._domain, [], { | ||
WebSocket, | ||
WebSocket: BetterWebSocket, | ||
}); | ||
@@ -47,0 +53,0 @@ ws.onopen = () => { |
{ | ||
"name": "@oada/client", | ||
"version": "2.1.2-beta.0", | ||
"version": "2.2.1", | ||
"description": "A lightweight client tool to interact with an OADA-compliant server", | ||
@@ -22,3 +22,3 @@ "repository": "https://github.com/OADA/client", | ||
"dependencies": { | ||
"@oada/types": "^1.2.0-beta.18", | ||
"@oada/types": "^1.2.0", | ||
"cross-fetch": "^3.0.6", | ||
@@ -25,0 +25,0 @@ "debug": "^4.1.1", |
@@ -5,9 +5,12 @@ # @oada/client | ||
| | `@oada/client` | `@oada/oada-cache` | | ||
| --- | --- | --- | | ||
| Language | TypeScript | JavaScript | | ||
| Supported protocols | websocket | websocket, HTTP | | ||
| Internal cache | No | Yes | | ||
[![npm](https://img.shields.io/npm/v/@oada/client)](https://www.npmjs.com/package/@oada/client) | ||
## Installation | ||
This module is available through npm. To install the module, simply run: | ||
```bash | ||
$ npm install @oada/client | ||
``` | ||
## Usage | ||
@@ -20,4 +23,4 @@ | ||
const connection = await client.connect({ | ||
domain: "api.oada.com", | ||
token: "abc" | ||
domain: "api.oada.com", // domain of OADA server | ||
token: "abc" // token | ||
}) | ||
@@ -24,0 +27,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
63756
924
1
142
Updated@oada/types@^1.2.0