@holochain/client 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/admin/types.d.ts +1 -1
- package/lib/api/common.d.ts +3 -1
- package/lib/api/common.js +4 -3
- package/lib/hdk/capabilities.d.ts +13 -3
- package/lib/hdk/capabilities.js +9 -0
- package/lib/hdk/link.d.ts +25 -1
- package/package.json +2 -2
package/lib/api/admin/types.d.ts
CHANGED
package/lib/api/common.d.ts
CHANGED
package/lib/api/common.js
CHANGED
|
@@ -9,7 +9,7 @@ export const DEFAULT_TIMEOUT = 60000;
|
|
|
9
9
|
*/
|
|
10
10
|
export const requesterTransformer = (requester, tag, transform = identityTransformer) => async (req, timeout) => {
|
|
11
11
|
const transformedInput = await transform.input(req);
|
|
12
|
-
const input = { type: tag, data: transformedInput };
|
|
12
|
+
const input = { type: { [tag]: null }, data: transformedInput };
|
|
13
13
|
const response = await requester(input, timeout);
|
|
14
14
|
const output = transform.output(response.data);
|
|
15
15
|
return output;
|
|
@@ -33,8 +33,9 @@ export class HolochainError extends Error {
|
|
|
33
33
|
}
|
|
34
34
|
// this determines the error format of all error responses
|
|
35
35
|
export const catchError = (res) => {
|
|
36
|
-
if (res.type
|
|
37
|
-
const
|
|
36
|
+
if (ERROR_TYPE in res.type) {
|
|
37
|
+
const errorName = Object.keys(res.data.type)[0];
|
|
38
|
+
const error = new HolochainError(errorName, res.data.data);
|
|
38
39
|
return Promise.reject(error);
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
@@ -38,12 +38,22 @@ export interface ZomeCallCapGrant {
|
|
|
38
38
|
/**
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
42
|
-
|
|
41
|
+
export declare enum CapAccessType {
|
|
42
|
+
Unrestricted = "Unrestricted",
|
|
43
|
+
Transferable = "Transferable",
|
|
44
|
+
Assigned = "Assigned"
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export type CapAccess = {
|
|
50
|
+
[CapAccessType.Unrestricted]: null;
|
|
51
|
+
} | {
|
|
52
|
+
[CapAccessType.Transferable]: {
|
|
43
53
|
secret: CapSecret;
|
|
44
54
|
};
|
|
45
55
|
} | {
|
|
46
|
-
Assigned: {
|
|
56
|
+
[CapAccessType.Assigned]: {
|
|
47
57
|
secret: CapSecret;
|
|
48
58
|
assignees: AgentPubKey[];
|
|
49
59
|
};
|
package/lib/hdk/capabilities.js
CHANGED
|
@@ -6,3 +6,12 @@ export var GrantedFunctionsType;
|
|
|
6
6
|
GrantedFunctionsType["All"] = "All";
|
|
7
7
|
GrantedFunctionsType["Listed"] = "Listed";
|
|
8
8
|
})(GrantedFunctionsType || (GrantedFunctionsType = {}));
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export var CapAccessType;
|
|
13
|
+
(function (CapAccessType) {
|
|
14
|
+
CapAccessType["Unrestricted"] = "Unrestricted";
|
|
15
|
+
CapAccessType["Transferable"] = "Transferable";
|
|
16
|
+
CapAccessType["Assigned"] = "Assigned";
|
|
17
|
+
})(CapAccessType || (CapAccessType = {}));
|
package/lib/hdk/link.d.ts
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
|
-
import { ActionHash, EntryHash, ExternalHash } from "../types.js";
|
|
1
|
+
import { ActionHash, AgentPubKey, EntryHash, ExternalHash, Timestamp } from "../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
5
|
export type AnyLinkableHash = EntryHash | ActionHash | ExternalHash;
|
|
6
|
+
/**
|
|
7
|
+
* An internal zome index within the DNA, from 0 to 255.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export type ZomeIndex = number;
|
|
12
|
+
/**
|
|
13
|
+
* An internal link type index within the DNA, from 0 to 255.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export type LinkType = number;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export interface Link {
|
|
22
|
+
author: AgentPubKey;
|
|
23
|
+
target: AnyLinkableHash;
|
|
24
|
+
timestamp: Timestamp;
|
|
25
|
+
zome_index: ZomeIndex;
|
|
26
|
+
link_type: LinkType;
|
|
27
|
+
tag: Uint8Array;
|
|
28
|
+
create_link_hash: ActionHash;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holochain/client",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"description": "A JavaScript client for the Holochain Conductor API",
|
|
5
5
|
"author": "Holochain Foundation <info@holochain.org> (http://holochain.org)",
|
|
6
6
|
"license": "CAL-1.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://github.com/holochain/holochain-client-js#readme",
|
|
20
20
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
21
|
+
"node": ">=18.0.0 || >=20.0.0"
|
|
22
22
|
},
|
|
23
23
|
"main": "lib/index.js",
|
|
24
24
|
"module": "lib/index.js",
|