@holochain/client 0.16.4 → 0.16.6
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/common.d.ts +1 -3
- package/lib/api/common.js +3 -4
- package/lib/api/index.d.ts +1 -1
- package/lib/api/index.js +1 -1
- package/lib/hdk/action.d.ts +13 -3
- package/lib/hdk/index.d.ts +1 -0
- package/lib/hdk/index.js +1 -0
- package/lib/hdk/link.d.ts +19 -0
- package/package.json +1 -1
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:
|
|
12
|
+
const input = { type: tag, data: transformedInput };
|
|
13
13
|
const response = await requester(input, timeout);
|
|
14
14
|
const output = transform.output(response.data);
|
|
15
15
|
return output;
|
|
@@ -33,9 +33,8 @@ 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 (
|
|
37
|
-
const
|
|
38
|
-
const error = new HolochainError(errorName, res.data.data);
|
|
36
|
+
if (res.type === ERROR_TYPE) {
|
|
37
|
+
const error = new HolochainError(res.data.type, res.data.data);
|
|
39
38
|
return Promise.reject(error);
|
|
40
39
|
}
|
|
41
40
|
else {
|
package/lib/api/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export * from "./admin/index.js";
|
|
|
3
3
|
export * from "./app-agent/index.js";
|
|
4
4
|
export * from "./app/index.js";
|
|
5
5
|
export { IsoWebSocket, WsClient } from "./client.js";
|
|
6
|
-
export { CloneId, Requester, Transformer, getBaseRoleNameFromCloneId, isCloneId, } from "./common.js";
|
|
6
|
+
export { CloneId, HolochainError, Requester, Transformer, getBaseRoleNameFromCloneId, isCloneId, } from "./common.js";
|
|
7
7
|
export * from "./zome-call-signing.js";
|
package/lib/api/index.js
CHANGED
|
@@ -3,5 +3,5 @@ export * from "./admin/index.js";
|
|
|
3
3
|
export * from "./app-agent/index.js";
|
|
4
4
|
export * from "./app/index.js";
|
|
5
5
|
export { IsoWebSocket, WsClient } from "./client.js";
|
|
6
|
-
export { CloneId, getBaseRoleNameFromCloneId, isCloneId, } from "./common.js";
|
|
6
|
+
export { CloneId, HolochainError, getBaseRoleNameFromCloneId, isCloneId, } from "./common.js";
|
|
7
7
|
export * from "./zome-call-signing.js";
|
package/lib/hdk/action.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AgentPubKey, DnaHash, EntryHash, ActionHash, HoloHashed, Signature, Timestamp } from "../types.js";
|
|
2
|
-
import { EntryType } from "./entry.js";
|
|
2
|
+
import { Entry, EntryType } from "./entry.js";
|
|
3
|
+
import { LinkTag, LinkType, RateWeight } from "./link.js";
|
|
3
4
|
/**
|
|
4
5
|
* @public
|
|
5
6
|
*/
|
|
@@ -7,6 +8,13 @@ export interface SignedActionHashed<H extends Action = Action> {
|
|
|
7
8
|
hashed: HoloHashed<H>;
|
|
8
9
|
signature: Signature;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface RegisterAgentActivity {
|
|
15
|
+
action: SignedActionHashed;
|
|
16
|
+
cached_entry?: Entry;
|
|
17
|
+
}
|
|
10
18
|
/**
|
|
11
19
|
* @public
|
|
12
20
|
*/
|
|
@@ -75,8 +83,10 @@ export interface CreateLink {
|
|
|
75
83
|
prev_action: ActionHash;
|
|
76
84
|
base_address: EntryHash;
|
|
77
85
|
target_address: EntryHash;
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
zome_index: number;
|
|
87
|
+
link_type: LinkType;
|
|
88
|
+
tag: LinkTag;
|
|
89
|
+
weight: RateWeight;
|
|
80
90
|
}
|
|
81
91
|
/**
|
|
82
92
|
* @public
|
package/lib/hdk/index.d.ts
CHANGED
package/lib/hdk/index.js
CHANGED
package/lib/hdk/link.d.ts
CHANGED
|
@@ -15,6 +15,25 @@ export type ZomeIndex = number;
|
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
17
|
export type LinkType = number;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export type LinkTag = Uint8Array;
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export interface RateWeight {
|
|
26
|
+
bucket_id: RateBucketId;
|
|
27
|
+
units: RateUnits;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export type RateBucketId = number;
|
|
33
|
+
/**
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export type RateUnits = number;
|
|
18
37
|
/**
|
|
19
38
|
* @public
|
|
20
39
|
*/
|
package/package.json
CHANGED