@oada/client
Advanced tools
Comparing version 4.1.1 to 4.1.2
@@ -31,2 +31,2 @@ /** | ||
userAgent: string; | ||
}): Promise<HttpClient | WebSocketClient>; | ||
}): Promise<WebSocketClient | HttpClient>; |
@@ -379,3 +379,3 @@ /** | ||
const pathArray = toArrayPath(request.path); | ||
const { data, tree, path, timeout } = request; | ||
const { data, tree, path, timeout, headers } = request; | ||
if (tree) { | ||
@@ -394,3 +394,3 @@ // We could go to all the trouble of re-implementing tree puts for posts, | ||
headers: { | ||
...request.headers, | ||
...headers, | ||
'authorization': `Bearer ${__classPrivateFieldGet(this, _OADAClient_token, "f")}`, | ||
@@ -397,0 +397,0 @@ 'content-type': contentType, |
@@ -19,3 +19,4 @@ /** | ||
import { context as _context } from 'fetch-h2'; | ||
const nodeRequire = createRequire(import.meta.url); // construct the require method | ||
const nodeRequire = createRequire(import.meta.url); // Construct the require method | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
const { name, version } = nodeRequire('../package.json'); | ||
@@ -22,0 +23,0 @@ const ourAgent = `${name}/${version}`; |
@@ -69,3 +69,3 @@ /** | ||
__classPrivateFieldSet(this, _HttpClient_token, token, "f"); | ||
__classPrivateFieldSet(this, _HttpClient_status, 1 /* Connecting */, "f"); | ||
__classPrivateFieldSet(this, _HttpClient_status, 1 /* ConnectionStatus.Connecting */, "f"); | ||
// "Open" the http connection: just make sure a HEAD succeeds | ||
@@ -84,3 +84,3 @@ trace('Opening HTTP connection to HEAD %s/bookmarks w/authorization: Bearer %s', __classPrivateFieldGet(this, _HttpClient_domain, "f"), __classPrivateFieldGet(this, _HttpClient_token, "f")); | ||
trace('Initial HEAD succeeded, emitting "open"'); | ||
__classPrivateFieldSet(this, _HttpClient_status, 2 /* Connected */, "f"); | ||
__classPrivateFieldSet(this, _HttpClient_status, 2 /* ConnectionStatus.Connected */, "f"); | ||
this.emit('open'); | ||
@@ -90,3 +90,3 @@ } | ||
trace('Initial HEAD failed, emitting "close"'); | ||
__classPrivateFieldSet(this, _HttpClient_status, 0 /* Disconnected */, "f"); | ||
__classPrivateFieldSet(this, _HttpClient_status, 0 /* ConnectionStatus.Disconnected */, "f"); | ||
this.emit('close'); | ||
@@ -104,3 +104,3 @@ } | ||
async disconnect() { | ||
__classPrivateFieldSet(this, _HttpClient_status, 0 /* Disconnected */, "f"); | ||
__classPrivateFieldSet(this, _HttpClient_status, 0 /* ConnectionStatus.Disconnected */, "f"); | ||
// Close our connections | ||
@@ -116,3 +116,3 @@ if ('disconnectAll' in __classPrivateFieldGet(this, _HttpClient_context, "f")) { | ||
isConnected() { | ||
return __classPrivateFieldGet(this, _HttpClient_status, "f") === 2 /* Connected */; | ||
return __classPrivateFieldGet(this, _HttpClient_status, "f") === 2 /* ConnectionStatus.Connected */; | ||
} | ||
@@ -119,0 +119,0 @@ /** Wait for the connection to open */ |
@@ -62,3 +62,3 @@ /** | ||
__classPrivateFieldSet(this, _WebSocketClient_domain, domain.replace(/^http/, 'ws'), "f"); | ||
__classPrivateFieldSet(this, _WebSocketClient_status, 1 /* Connecting */, "f"); | ||
__classPrivateFieldSet(this, _WebSocketClient_status, 1 /* ConnectionStatus.Connecting */, "f"); | ||
// Create websocket connection | ||
@@ -80,3 +80,3 @@ const ws = new ReconnectingWebSocket(__classPrivateFieldGet(this, _WebSocketClient_domain, "f"), [], { | ||
trace('Connection opened'); | ||
__classPrivateFieldSet(this, _WebSocketClient_status, 2 /* Connected */, "f"); | ||
__classPrivateFieldSet(this, _WebSocketClient_status, 2 /* ConnectionStatus.Connected */, "f"); | ||
this.emit('open'); | ||
@@ -86,3 +86,3 @@ }); | ||
trace('Connection closed'); | ||
__classPrivateFieldSet(this, _WebSocketClient_status, 0 /* Disconnected */, "f"); | ||
__classPrivateFieldSet(this, _WebSocketClient_status, 0 /* ConnectionStatus.Disconnected */, "f"); | ||
this.emit('close'); | ||
@@ -103,3 +103,3 @@ }); | ||
async disconnect() { | ||
if (__classPrivateFieldGet(this, _WebSocketClient_status, "f") === 0 /* Disconnected */) { | ||
if (__classPrivateFieldGet(this, _WebSocketClient_status, "f") === 0 /* ConnectionStatus.Disconnected */) { | ||
return; | ||
@@ -112,3 +112,3 @@ } | ||
isConnected() { | ||
return __classPrivateFieldGet(this, _WebSocketClient_status, "f") === 2 /* Connected */; | ||
return __classPrivateFieldGet(this, _WebSocketClient_status, "f") === 2 /* ConnectionStatus.Connected */; | ||
} | ||
@@ -115,0 +115,0 @@ /** Wait for the connection to open */ |
@@ -541,3 +541,3 @@ /** | ||
}, | ||
{ timeout, signal: restart.signal } | ||
{ timeout, signal: restart.signal as AbortSignal } | ||
); | ||
@@ -881,3 +881,3 @@ | ||
const { data, tree, path, timeout } = request; | ||
const { data, tree, path, timeout, headers } = request; | ||
if (tree) { | ||
@@ -898,3 +898,3 @@ // We could go to all the trouble of re-implementing tree puts for posts, | ||
headers: { | ||
...request.headers, | ||
...headers, | ||
'authorization': `Bearer ${this.#token}`, | ||
@@ -901,0 +901,0 @@ 'content-type': contentType, |
@@ -22,3 +22,4 @@ /** | ||
const nodeRequire = createRequire(import.meta.url); // construct the require method | ||
const nodeRequire = createRequire(import.meta.url); // Construct the require method | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
const { name, version } = nodeRequire('../package.json'); | ||
@@ -25,0 +26,0 @@ |
{ | ||
"name": "@oada/client", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "A lightweight client tool to interact with an OADA-compliant server", | ||
@@ -71,3 +71,3 @@ "repository": "https://github.com/OADA/client", | ||
"dependencies": { | ||
"@oada/types": "^2.0.1", | ||
"@oada/types": "^3.0.2", | ||
"abort-controller": "^3.0.0", | ||
@@ -83,3 +83,3 @@ "buffer": "^6.0.3", | ||
"fetch-h2": "^3.0.2", | ||
"file-type": "^17.1.1", | ||
"file-type": "^17.1.2", | ||
"isomorphic-timers-promises": "^1.0.1", | ||
@@ -94,3 +94,3 @@ "isomorphic-ws": "^4.0.1", | ||
"utf-8-validate": "^5.0.9", | ||
"ws": "^8.7.0", | ||
"ws": "^8.8.0", | ||
"xksuid": "^0.0.3" | ||
@@ -100,9 +100,9 @@ }, | ||
"@ava/typescript": "^3.0.1", | ||
"@tsconfig/node14": "^1.0.1", | ||
"@tsconfig/node14": "^1.0.3", | ||
"@types/debug": "^4.1.7", | ||
"@types/node": "^16.11.36", | ||
"@types/node": "^16.11.41", | ||
"@types/ws": "^8.5.3", | ||
"@typescript-eslint/eslint-plugin": "^5.27.0", | ||
"@typescript-eslint/parser": "^5.27.0", | ||
"@yarnpkg/sdks": "3.0.0-rc.6", | ||
"@typescript-eslint/eslint-plugin": "^5.29.0", | ||
"@typescript-eslint/parser": "^5.29.0", | ||
"@yarnpkg/sdks": "3.0.0-rc.9", | ||
"ava": "4.0.0-rc.1", | ||
@@ -112,3 +112,3 @@ "axios": "^0.27.2", | ||
"dotenv": "^16.0.1", | ||
"eslint": "^8.16.0", | ||
"eslint": "^8.18.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -138,6 +138,6 @@ "eslint-config-xo": "^0.41.0", | ||
"eslint-plugin-unicorn": "^42.0.0", | ||
"prettier": "^2.6.2", | ||
"typescript": "4.6.4" | ||
"prettier": "^2.7.1", | ||
"typescript": "4.7.4" | ||
}, | ||
"packageManager": "yarn@3.2.1" | ||
} |
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
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
378606
6420
+ Added@oada/types@3.5.3(transitive)
+ Addedajv@8.12.0(transitive)
- Removed@oada/types@2.0.1(transitive)
- Removedajv@8.11.0(transitive)
Updated@oada/types@^3.0.2
Updatedfile-type@^17.1.2
Updatedws@^8.8.0