@libsql/hrana-client
Advanced tools
Comparing version 0.6.2 to 0.7.0
@@ -341,12 +341,12 @@ "use strict"; | ||
} | ||
else if (encoding === "protobuf") { | ||
if (encoding === "protobuf") { | ||
const respData = await resp.arrayBuffer(); | ||
return (0, index_js_1.readProtobufMessage)(new Uint8Array(respData), protobuf_decode_js_1.PipelineRespBody); | ||
} | ||
else { | ||
throw (0, util_js_1.impossible)(encoding, "Impossible encoding"); | ||
} | ||
await resp.body?.cancel(); | ||
throw (0, util_js_1.impossible)(encoding, "Impossible encoding"); | ||
} | ||
async function errorFromResponse(resp) { | ||
const respType = resp.headers.get("content-type") ?? "text/plain"; | ||
let message = `Server returned HTTP status ${resp.status}`; | ||
if (respType === "application/json") { | ||
@@ -357,4 +357,4 @@ const respBody = await resp.json(); | ||
} | ||
return new errors_js_1.HttpServerError(message, resp.status); | ||
} | ||
let message = `Server returned HTTP status ${resp.status}`; | ||
if (respType === "text/plain") { | ||
@@ -365,4 +365,6 @@ const respBody = (await resp.text()).trim(); | ||
} | ||
return new errors_js_1.HttpServerError(message, resp.status); | ||
} | ||
await resp.body?.cancel(); | ||
return new errors_js_1.HttpServerError(message, resp.status); | ||
} |
@@ -337,12 +337,12 @@ import { Request, Headers } from "@libsql/isomorphic-fetch"; | ||
} | ||
else if (encoding === "protobuf") { | ||
if (encoding === "protobuf") { | ||
const respData = await resp.arrayBuffer(); | ||
return readProtobufMessage(new Uint8Array(respData), protobuf_PipelineRespBody); | ||
} | ||
else { | ||
throw impossible(encoding, "Impossible encoding"); | ||
} | ||
await resp.body?.cancel(); | ||
throw impossible(encoding, "Impossible encoding"); | ||
} | ||
async function errorFromResponse(resp) { | ||
const respType = resp.headers.get("content-type") ?? "text/plain"; | ||
let message = `Server returned HTTP status ${resp.status}`; | ||
if (respType === "application/json") { | ||
@@ -353,4 +353,4 @@ const respBody = await resp.json(); | ||
} | ||
return new HttpServerError(message, resp.status); | ||
} | ||
let message = `Server returned HTTP status ${resp.status}`; | ||
if (respType === "text/plain") { | ||
@@ -361,4 +361,6 @@ const respBody = (await resp.text()).trim(); | ||
} | ||
return new HttpServerError(message, resp.status); | ||
} | ||
await resp.body?.cancel(); | ||
return new HttpServerError(message, resp.status); | ||
} |
{ | ||
"name": "@libsql/hrana-client", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"keywords": [ | ||
@@ -48,3 +48,3 @@ "hrana", | ||
"dependencies": { | ||
"@libsql/isomorphic-fetch": "^0.2.1", | ||
"@libsql/isomorphic-fetch": "^0.3.1", | ||
"@libsql/isomorphic-ws": "^0.1.5", | ||
@@ -51,0 +51,0 @@ "js-base64": "^3.7.5", |
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
305582
8527
+ Added@libsql/isomorphic-fetch@0.3.1(transitive)
- Removed@libsql/isomorphic-fetch@0.2.5(transitive)