@oada/client
Advanced tools
Comparing version 2.6.1 to 2.6.2
@@ -76,3 +76,3 @@ /// <reference types="node" /> | ||
path: string; | ||
data: Json; | ||
data: Body; | ||
contentType?: string; | ||
@@ -85,3 +85,3 @@ revIfMatch?: number; | ||
path: string; | ||
data: Json; | ||
data: Body; | ||
contentType?: string; | ||
@@ -88,0 +88,0 @@ tree?: object; |
@@ -42,2 +42,3 @@ "use strict"; | ||
const buffer_1 = require("buffer"); | ||
const file_type_1 = require("file-type"); | ||
const utils = __importStar(require("./utils")); | ||
@@ -252,2 +253,3 @@ const websocket_1 = require("./websocket"); | ||
async put(request) { | ||
var _a, _b; | ||
// convert string path to array | ||
@@ -330,3 +332,5 @@ // (e.g., /bookmarks/abc/def -> ['bookmarks', 'abc', 'def']) | ||
const contentType = request.contentType || // 1) get content-type from the argument | ||
(request.data && request.data["_type"]) || // 2) get content-type from the resource body | ||
(buffer_1.Buffer.isBuffer(request.data) && | ||
((_a = (await file_type_1.fromBuffer(request.data))) === null || _a === void 0 ? void 0 : _a.mime)) || | ||
((_b = request.data) === null || _b === void 0 ? void 0 : _b["_type"]) || // 2) get content-type from the resource body | ||
(request.tree | ||
@@ -351,2 +355,3 @@ ? utils.getObjectAtPath(request.tree, pathArray)["_type"] // 3) get content-type from the tree | ||
async post(request) { | ||
var _a, _b; | ||
// convert string path to array | ||
@@ -365,3 +370,5 @@ // (e.g., /bookmarks/abc/def -> ['bookmarks', 'abc', 'def']) | ||
const contentType = request.contentType || // 1) get content-type from the argument | ||
(request.data && request.data["_type"]) || // 2) get content-type from the resource body | ||
(buffer_1.Buffer.isBuffer(request.data) && | ||
((_a = (await file_type_1.fromBuffer(request.data))) === null || _a === void 0 ? void 0 : _a.mime)) || | ||
((_b = request.data) === null || _b === void 0 ? void 0 : _b["_type"]) || // 2) get content-type from the resource body | ||
(request.tree | ||
@@ -368,0 +375,0 @@ ? utils.getObjectAtPath(request.tree, pathArray)["_type"] // 3) get content-type from the tree |
{ | ||
"name": "@oada/client", | ||
"version": "2.6.1", | ||
"version": "2.6.2", | ||
"description": "A lightweight client tool to interact with an OADA-compliant server", | ||
@@ -34,2 +34,3 @@ "repository": "https://github.com/OADA/client", | ||
"fetch-h2": "^3.0.0", | ||
"file-type": "^16.5.3", | ||
"isomorphic-ws": "^4.0.1", | ||
@@ -61,3 +62,3 @@ "ksuid": "^2.0.0", | ||
}, | ||
"packageManager": "yarn@3.0.0" | ||
"packageManager": "yarn@3.0.1" | ||
} |
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
96640
1394
13
+ Addedfile-type@^16.5.3
+ Added@tokenizer/token@0.3.0(transitive)
+ Addedfile-type@16.5.4(transitive)
+ Addedpeek-readable@4.1.0(transitive)
+ Addedreadable-web-to-node-stream@3.0.2(transitive)
+ Addedstrtok3@6.3.0(transitive)
+ Addedtoken-types@4.2.1(transitive)