@holochain/client 0.4.3 → 0.5.0
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 +6 -6
- package/lib/hdk/{header.d.ts → action.d.ts} +37 -37
- package/lib/hdk/action.js +14 -0
- package/lib/hdk/{header.js.map → action.js.map} +1 -1
- package/lib/hdk/dht-ops.d.ts +10 -14
- package/lib/hdk/dht-ops.js +10 -10
- package/lib/hdk/dht-ops.js.map +1 -1
- package/lib/hdk/index.d.ts +2 -1
- package/lib/hdk/index.js +2 -1
- package/lib/hdk/index.js.map +1 -1
- package/lib/hdk/record.d.ts +16 -0
- package/lib/hdk/record.js +2 -0
- package/lib/hdk/record.js.map +1 -0
- package/lib/types.d.ts +1 -1
- package/package.json +1 -1
- package/lib/hdk/header.js +0 -14
package/lib/api/admin/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AgentPubKey, CellId, DnaHash, DnaProperties,
|
|
3
|
-
import { DhtOp, Entry,
|
|
2
|
+
import { AgentPubKey, CellId, DnaHash, DnaProperties, ActionHash, HoloHash, InstalledAppId, InstalledCell, KitsuneAgent, KitsuneSpace, RoleId, Signature } from "../../types.js";
|
|
3
|
+
import { DhtOp, Entry, Action } from "../../hdk/index.js";
|
|
4
4
|
import { Requester } from "../common.js";
|
|
5
5
|
export declare type AttachAppInterfaceRequest = {
|
|
6
6
|
port: number;
|
|
@@ -274,14 +274,14 @@ export interface FullIntegrationStateDump {
|
|
|
274
274
|
integrated: Array<DhtOp>;
|
|
275
275
|
dht_ops_cursor: number;
|
|
276
276
|
}
|
|
277
|
-
export interface
|
|
277
|
+
export interface SourceChainJsonRecord {
|
|
278
278
|
signature: Signature;
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
action_address: ActionHash;
|
|
280
|
+
action: Action;
|
|
281
281
|
entry: Entry | undefined;
|
|
282
282
|
}
|
|
283
283
|
export interface SourceChainJsonDump {
|
|
284
|
-
|
|
284
|
+
records: Array<SourceChainJsonRecord>;
|
|
285
285
|
published_ops_count: number;
|
|
286
286
|
}
|
|
287
287
|
export interface FullStateDump {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AgentPubKey, DnaHash, EntryHash,
|
|
1
|
+
import { AgentPubKey, DnaHash, EntryHash, ActionHash, HoloHashed, Signature, Timestamp } from "../types.js";
|
|
2
2
|
import { EntryType } from "./entry.js";
|
|
3
|
-
export interface
|
|
3
|
+
export interface SignedActionHashed<H extends Action = Action> {
|
|
4
4
|
hashed: HoloHashed<H>;
|
|
5
5
|
signature: Signature;
|
|
6
6
|
}
|
|
7
|
-
export declare type
|
|
8
|
-
export declare enum
|
|
7
|
+
export declare type ActionHashed = HoloHashed<Action>;
|
|
8
|
+
export declare enum ActionType {
|
|
9
9
|
Dna = "Dna",
|
|
10
10
|
AgentValidationPkg = "AgentValidationPkg",
|
|
11
11
|
InitZomesComplete = "InitZomesComplete",
|
|
@@ -17,91 +17,91 @@ export declare enum HeaderType {
|
|
|
17
17
|
Update = "Update",
|
|
18
18
|
Delete = "Delete"
|
|
19
19
|
}
|
|
20
|
-
export declare type
|
|
21
|
-
export declare type
|
|
20
|
+
export declare type Action = Dna | AgentValidationPkg | InitZomesComplete | CreateLink | DeleteLink | OpenChain | CloseChain | Delete | NewEntryAction;
|
|
21
|
+
export declare type NewEntryAction = Create | Update;
|
|
22
22
|
export interface Dna {
|
|
23
|
-
type:
|
|
23
|
+
type: ActionType.Dna;
|
|
24
24
|
author: AgentPubKey;
|
|
25
25
|
timestamp: Timestamp;
|
|
26
26
|
hash: DnaHash;
|
|
27
27
|
}
|
|
28
28
|
export interface AgentValidationPkg {
|
|
29
|
-
type:
|
|
29
|
+
type: ActionType.AgentValidationPkg;
|
|
30
30
|
author: AgentPubKey;
|
|
31
31
|
timestamp: Timestamp;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
action_seq: number;
|
|
33
|
+
prev_action: ActionHash;
|
|
34
34
|
membrane_proof: any;
|
|
35
35
|
}
|
|
36
36
|
export interface InitZomesComplete {
|
|
37
|
-
type:
|
|
37
|
+
type: ActionType.InitZomesComplete;
|
|
38
38
|
author: AgentPubKey;
|
|
39
39
|
timestamp: Timestamp;
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
action_seq: number;
|
|
41
|
+
prev_action: ActionHash;
|
|
42
42
|
}
|
|
43
43
|
export interface CreateLink {
|
|
44
|
-
type:
|
|
44
|
+
type: ActionType.CreateLink;
|
|
45
45
|
author: AgentPubKey;
|
|
46
46
|
timestamp: Timestamp;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
action_seq: number;
|
|
48
|
+
prev_action: ActionHash;
|
|
49
49
|
base_address: EntryHash;
|
|
50
50
|
target_address: EntryHash;
|
|
51
51
|
zome_id: number;
|
|
52
52
|
tag: any;
|
|
53
53
|
}
|
|
54
54
|
export interface DeleteLink {
|
|
55
|
-
type:
|
|
55
|
+
type: ActionType.DeleteLink;
|
|
56
56
|
author: AgentPubKey;
|
|
57
57
|
timestamp: Timestamp;
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
action_seq: number;
|
|
59
|
+
prev_action: ActionHash;
|
|
60
60
|
base_address: EntryHash;
|
|
61
|
-
link_add_address:
|
|
61
|
+
link_add_address: ActionHash;
|
|
62
62
|
}
|
|
63
63
|
export interface OpenChain {
|
|
64
|
-
type:
|
|
64
|
+
type: ActionType.OpenChain;
|
|
65
65
|
author: AgentPubKey;
|
|
66
66
|
timestamp: Timestamp;
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
action_seq: number;
|
|
68
|
+
prev_action: ActionHash;
|
|
69
69
|
prev_dna_hash: DnaHash;
|
|
70
70
|
}
|
|
71
71
|
export interface CloseChain {
|
|
72
|
-
type:
|
|
72
|
+
type: ActionType.CloseChain;
|
|
73
73
|
author: AgentPubKey;
|
|
74
74
|
timestamp: Timestamp;
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
action_seq: number;
|
|
76
|
+
prev_action: ActionHash;
|
|
77
77
|
new_dna_hash: DnaHash;
|
|
78
78
|
}
|
|
79
79
|
export interface Update {
|
|
80
|
-
type:
|
|
80
|
+
type: ActionType.Update;
|
|
81
81
|
author: AgentPubKey;
|
|
82
82
|
timestamp: Timestamp;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
action_seq: number;
|
|
84
|
+
prev_action: ActionHash;
|
|
85
|
+
original_action_address: ActionHash;
|
|
86
86
|
original_entry_address: EntryHash;
|
|
87
87
|
entry_type: EntryType;
|
|
88
88
|
entry_hash: EntryHash;
|
|
89
89
|
}
|
|
90
90
|
export interface Delete {
|
|
91
|
-
type:
|
|
91
|
+
type: ActionType.Delete;
|
|
92
92
|
author: AgentPubKey;
|
|
93
93
|
timestamp: Timestamp;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
deletes_address:
|
|
94
|
+
action_seq: number;
|
|
95
|
+
prev_action: ActionHash;
|
|
96
|
+
deletes_address: ActionHash;
|
|
97
97
|
deletes_entry_address: EntryHash;
|
|
98
98
|
}
|
|
99
99
|
export interface Create {
|
|
100
|
-
type:
|
|
100
|
+
type: ActionType.Create;
|
|
101
101
|
author: AgentPubKey;
|
|
102
102
|
timestamp: Timestamp;
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
action_seq: number;
|
|
104
|
+
prev_action: ActionHash;
|
|
105
105
|
entry_type: EntryType;
|
|
106
106
|
entry_hash: EntryHash;
|
|
107
107
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var ActionType;
|
|
2
|
+
(function (ActionType) {
|
|
3
|
+
ActionType["Dna"] = "Dna";
|
|
4
|
+
ActionType["AgentValidationPkg"] = "AgentValidationPkg";
|
|
5
|
+
ActionType["InitZomesComplete"] = "InitZomesComplete";
|
|
6
|
+
ActionType["CreateLink"] = "CreateLink";
|
|
7
|
+
ActionType["DeleteLink"] = "DeleteLink";
|
|
8
|
+
ActionType["OpenChain"] = "OpenChain";
|
|
9
|
+
ActionType["CloseChain"] = "CloseChain";
|
|
10
|
+
ActionType["Create"] = "Create";
|
|
11
|
+
ActionType["Update"] = "Update";
|
|
12
|
+
ActionType["Delete"] = "Delete";
|
|
13
|
+
})(ActionType || (ActionType = {}));
|
|
14
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/hdk/action.ts"],"names":[],"mappings":"AAkBA,MAAM,CAAN,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,uDAAyC,CAAA;IACzC,qDAAuC,CAAA;IACvC,uCAAyB,CAAA;IACzB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;IACzB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EAXW,UAAU,KAAV,UAAU,QAWrB"}
|
package/lib/hdk/dht-ops.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { Signature } from "../types.js";
|
|
2
2
|
import { Entry } from "./entry.js";
|
|
3
|
-
import { CreateLink, Delete, DeleteLink,
|
|
3
|
+
import { CreateLink, Delete, DeleteLink, Action, NewEntryAction, Update } from "./action.js";
|
|
4
4
|
export declare enum DhtOpType {
|
|
5
|
-
|
|
5
|
+
StoreRecord = "StoreRecord",
|
|
6
6
|
StoreEntry = "StoreEntry",
|
|
7
7
|
RegisterAgentActivity = "RegisterAgentActivity",
|
|
8
8
|
RegisterUpdatedContent = "RegisterUpdatedContent",
|
|
9
|
-
|
|
9
|
+
RegisterUpdatedRecord = "RegisterUpdatedRecord",
|
|
10
10
|
RegisterDeletedBy = "RegisterDeletedBy",
|
|
11
|
-
|
|
11
|
+
RegisterDeletedEntryAction = "RegisterDeletedEntryAction",
|
|
12
12
|
RegisterAddLink = "RegisterAddLink",
|
|
13
13
|
RegisterRemoveLink = "RegisterRemoveLink"
|
|
14
14
|
}
|
|
15
15
|
export declare type DhtOp = {
|
|
16
|
-
[DhtOpType.
|
|
16
|
+
[DhtOpType.StoreRecord]: [Signature, Action, Entry | undefined];
|
|
17
17
|
} | {
|
|
18
|
-
[DhtOpType.StoreEntry]: [Signature,
|
|
18
|
+
[DhtOpType.StoreEntry]: [Signature, NewEntryAction, Entry];
|
|
19
19
|
} | {
|
|
20
|
-
[DhtOpType.RegisterAgentActivity]: [Signature,
|
|
20
|
+
[DhtOpType.RegisterAgentActivity]: [Signature, Action];
|
|
21
21
|
} | {
|
|
22
22
|
[DhtOpType.RegisterUpdatedContent]: [
|
|
23
23
|
Signature,
|
|
@@ -25,21 +25,17 @@ export declare type DhtOp = {
|
|
|
25
25
|
Entry | undefined
|
|
26
26
|
];
|
|
27
27
|
} | {
|
|
28
|
-
[DhtOpType.
|
|
29
|
-
Signature,
|
|
30
|
-
Update,
|
|
31
|
-
Entry | undefined
|
|
32
|
-
];
|
|
28
|
+
[DhtOpType.RegisterUpdatedRecord]: [Signature, Update, Entry | undefined];
|
|
33
29
|
} | {
|
|
34
30
|
[DhtOpType.RegisterDeletedBy]: [Signature, Delete];
|
|
35
31
|
} | {
|
|
36
|
-
[DhtOpType.
|
|
32
|
+
[DhtOpType.RegisterDeletedEntryAction]: [Signature, Delete];
|
|
37
33
|
} | {
|
|
38
34
|
[DhtOpType.RegisterAddLink]: [Signature, CreateLink];
|
|
39
35
|
} | {
|
|
40
36
|
[DhtOpType.RegisterRemoveLink]: [Signature, DeleteLink];
|
|
41
37
|
};
|
|
42
38
|
export declare function getDhtOpType(op: DhtOp): DhtOpType;
|
|
43
|
-
export declare function
|
|
39
|
+
export declare function getDhtOpAction(op: DhtOp): Action;
|
|
44
40
|
export declare function getDhtOpEntry(op: DhtOp): Entry | undefined;
|
|
45
41
|
export declare function getDhtOpSignature(op: DhtOp): Signature;
|
package/lib/hdk/dht-ops.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
// https://github.com/holochain/holochain/blob/develop/crates/types/src/dht_op.rs
|
|
2
2
|
export var DhtOpType;
|
|
3
3
|
(function (DhtOpType) {
|
|
4
|
-
DhtOpType["
|
|
4
|
+
DhtOpType["StoreRecord"] = "StoreRecord";
|
|
5
5
|
DhtOpType["StoreEntry"] = "StoreEntry";
|
|
6
6
|
DhtOpType["RegisterAgentActivity"] = "RegisterAgentActivity";
|
|
7
7
|
DhtOpType["RegisterUpdatedContent"] = "RegisterUpdatedContent";
|
|
8
|
-
DhtOpType["
|
|
8
|
+
DhtOpType["RegisterUpdatedRecord"] = "RegisterUpdatedRecord";
|
|
9
9
|
DhtOpType["RegisterDeletedBy"] = "RegisterDeletedBy";
|
|
10
|
-
DhtOpType["
|
|
10
|
+
DhtOpType["RegisterDeletedEntryAction"] = "RegisterDeletedEntryAction";
|
|
11
11
|
DhtOpType["RegisterAddLink"] = "RegisterAddLink";
|
|
12
12
|
DhtOpType["RegisterRemoveLink"] = "RegisterRemoveLink";
|
|
13
13
|
})(DhtOpType || (DhtOpType = {}));
|
|
14
14
|
export function getDhtOpType(op) {
|
|
15
15
|
return Object.keys(op)[0];
|
|
16
16
|
}
|
|
17
|
-
export function
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
17
|
+
export function getDhtOpAction(op) {
|
|
18
|
+
const action = Object.values(op)[0][1];
|
|
19
|
+
if (action.author)
|
|
20
|
+
return action;
|
|
21
21
|
else {
|
|
22
|
-
const
|
|
22
|
+
const actionType = Object.keys(action)[0];
|
|
23
23
|
return {
|
|
24
|
-
type:
|
|
25
|
-
...
|
|
24
|
+
type: actionType,
|
|
25
|
+
...action[actionType],
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
}
|
package/lib/hdk/dht-ops.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dht-ops.js","sourceRoot":"","sources":["../../src/hdk/dht-ops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,CAAC;AACjC,CAAC"}
|
package/lib/hdk/index.d.ts
CHANGED
package/lib/hdk/index.js
CHANGED
package/lib/hdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hdk/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SignedActionHashed } from "./action.js";
|
|
2
|
+
export declare type Record = {
|
|
3
|
+
signed_action: SignedActionHashed;
|
|
4
|
+
entry: RecordEntry;
|
|
5
|
+
};
|
|
6
|
+
export declare type RecordEntry = {
|
|
7
|
+
Present: {
|
|
8
|
+
entry: Uint8Array;
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
Hidden: void;
|
|
12
|
+
} | {
|
|
13
|
+
NotApplicable: void;
|
|
14
|
+
} | {
|
|
15
|
+
NotStored: void;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/hdk/record.ts"],"names":[],"mappings":""}
|
package/lib/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare type HoloHash = Uint8Array;
|
|
|
2
2
|
export declare type AgentPubKey = HoloHash;
|
|
3
3
|
export declare type DnaHash = HoloHash;
|
|
4
4
|
export declare type EntryHash = HoloHash;
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type ActionHash = HoloHash;
|
|
6
6
|
export declare type AnyDhtHash = HoloHash;
|
|
7
7
|
export declare type KitsuneAgent = Uint8Array;
|
|
8
8
|
export declare type KitsuneSpace = Uint8Array;
|
package/package.json
CHANGED
package/lib/hdk/header.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export var HeaderType;
|
|
2
|
-
(function (HeaderType) {
|
|
3
|
-
HeaderType["Dna"] = "Dna";
|
|
4
|
-
HeaderType["AgentValidationPkg"] = "AgentValidationPkg";
|
|
5
|
-
HeaderType["InitZomesComplete"] = "InitZomesComplete";
|
|
6
|
-
HeaderType["CreateLink"] = "CreateLink";
|
|
7
|
-
HeaderType["DeleteLink"] = "DeleteLink";
|
|
8
|
-
HeaderType["OpenChain"] = "OpenChain";
|
|
9
|
-
HeaderType["CloseChain"] = "CloseChain";
|
|
10
|
-
HeaderType["Create"] = "Create";
|
|
11
|
-
HeaderType["Update"] = "Update";
|
|
12
|
-
HeaderType["Delete"] = "Delete";
|
|
13
|
-
})(HeaderType || (HeaderType = {}));
|
|
14
|
-
//# sourceMappingURL=header.js.map
|