@holochain/client
Advanced tools
Comparing version 0.16.3 to 0.17.0-dev.0
@@ -22,3 +22,5 @@ import { RoleName } from "../types.js"; | ||
export type Tagged<T> = { | ||
type: string; | ||
type: { | ||
[tag: string]: null; | ||
}; | ||
data: T; | ||
@@ -25,0 +27,0 @@ }; |
@@ -12,3 +12,3 @@ const ERROR_TYPE = "error"; | ||
const transformedInput = await transform.input(req); | ||
const input = { type: tag, data: transformedInput }; | ||
const input = { type: { [tag]: null }, data: transformedInput }; | ||
const response = await requester(input, timeout); | ||
@@ -37,4 +37,5 @@ const output = transform.output(response.data); | ||
export const catchError = (res) => { | ||
if (res.type === ERROR_TYPE) { | ||
const error = new HolochainError(res.data.type, res.data.data); | ||
if (ERROR_TYPE in res.type) { | ||
const errorName = Object.keys(res.data.type)[0]; | ||
const error = new HolochainError(errorName, res.data.data); | ||
return Promise.reject(error); | ||
@@ -41,0 +42,0 @@ } |
{ | ||
"name": "@holochain/client", | ||
"version": "0.16.3", | ||
"version": "0.17.0-dev.0", | ||
"description": "A JavaScript client for the Holochain Conductor API", | ||
@@ -5,0 +5,0 @@ "author": "Holochain Foundation <info@holochain.org> (http://holochain.org)", |
@@ -22,2 +22,4 @@ [![Project](https://img.shields.io/badge/Project-Holochain-blue.svg?style=flat-square)](http://holochain.org/) | ||
**JS client v0.17.x** are compatible with **Holochain v0.3.x**. | ||
To install from NPM, run | ||
@@ -24,0 +26,0 @@ ```bash |
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
106424
3411
177