@ddd-qc/cell-proxy 0.9.8 → 0.10.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/README.md +4 -0
- package/dist/CellProxy.d.ts +58 -57
- package/dist/CellProxy.js +165 -154
- package/dist/CellProxy.js.map +1 -1
- package/dist/ConductorAppProxy.d.ts +74 -71
- package/dist/ConductorAppProxy.js +338 -296
- package/dist/ConductorAppProxy.js.map +1 -1
- package/dist/ZomeProxy.d.ts +34 -27
- package/dist/ZomeProxy.js +56 -38
- package/dist/ZomeProxy.js.map +1 -1
- package/dist/hcl.d.ts +26 -30
- package/dist/hcl.js +56 -90
- package/dist/hcl.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -7
- package/dist/mixins.d.ts +40 -42
- package/dist/mixins.js +50 -36
- package/dist/mixins.js.map +1 -1
- package/dist/types.d.ts +30 -32
- package/dist/types.js +31 -32
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +37 -30
- package/dist/utils.js +108 -80
- package/dist/utils.js.map +1 -1
- package/package.json +4 -6
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# cell-proxy
|
|
2
2
|
|
|
3
|
+
**Compatible with:**
|
|
4
|
+
- **HDK v0.1.0-beta-rc.1** & **HDI v0.2.0-beta-rc.2**
|
|
5
|
+
- **@holochain/client v0.11.2**
|
|
6
|
+
-
|
|
3
7
|
Proxy classes and helpers for managing a [Holochain](https://www.npmjs.com/package/@holochain/client) AppWebsocket and calling zome functions on cells.
|
|
4
8
|
The intent is to make the development of web UI of Holochain apps in javascript / typescript faster & easier by providing a straightforward API for communicating with a Conductor, and some basic logging features.
|
|
5
9
|
|
package/dist/CellProxy.d.ts
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import { CallZomeRequest, CapSecret,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/** -- Methods -- */
|
|
40
|
-
dumpSignals(): void;
|
|
41
|
-
/** Pass call request to conductor proxy and log it */
|
|
42
|
-
executeZomeCall(reqLog: RequestLog): Promise<ResponseLog>;
|
|
43
|
-
/**
|
|
44
|
-
* callZome() with "Mutex" (for calls that writes to source-chain)
|
|
45
|
-
* TODO: Implement call queue instead of mutex
|
|
46
|
-
*/
|
|
47
|
-
callZomeBlocking(zome_name: ZomeName, fn_name: string, payload: any, cap_secret: CapSecret | null, timeout?: number): Promise<any>;
|
|
48
|
-
/** */
|
|
49
|
-
callZome(zome_name: ZomeName, fn_name: string, payload: any, cap_secret: CapSecret | null, timeout?: number): Promise<any>;
|
|
50
|
-
/**
|
|
51
|
-
* Calls the `entry_defs()` zome function and
|
|
52
|
-
* returns an array of all the zome's AppEntryDefNames and visibility
|
|
53
|
-
*/
|
|
54
|
-
callEntryDefs(zomeName: ZomeName): Promise<[string, boolean][]>;
|
|
55
|
-
/** */
|
|
56
|
-
dumpLogs(zomeName?: ZomeName): void;
|
|
57
|
-
}
|
|
1
|
+
import { CallZomeRequest, CapSecret, ZomeName, Cell } from "@holochain/client";
|
|
2
|
+
import { ConductorAppProxy } from "./ConductorAppProxy";
|
|
3
|
+
import { Empty } from "./mixins";
|
|
4
|
+
export interface RequestLog {
|
|
5
|
+
request: CallZomeRequest;
|
|
6
|
+
timeout: number;
|
|
7
|
+
requestTimestamp: number;
|
|
8
|
+
executionTimestamp: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ResponseLog {
|
|
11
|
+
success?: any;
|
|
12
|
+
failure?: any;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
requestIndex: number;
|
|
15
|
+
}
|
|
16
|
+
declare const CellProxy_base: (abstract new (...args: any[]) => {
|
|
17
|
+
_cell?: Cell;
|
|
18
|
+
readonly cell: Cell;
|
|
19
|
+
readonly cellId: import("@holochain/client").CellId;
|
|
20
|
+
readonly dnaHash: string;
|
|
21
|
+
readonly agentPubKey: string; /** -- Fields -- */
|
|
22
|
+
}) & typeof Empty;
|
|
23
|
+
/**
|
|
24
|
+
* Proxy for a running DNA.
|
|
25
|
+
* It logs and queues ZomeCalls.
|
|
26
|
+
* It holds a reference to its ConductorAppProxy and its InstalledCell.
|
|
27
|
+
* This class is expected to be used by ZomeProxies.
|
|
28
|
+
*/
|
|
29
|
+
export declare class CellProxy extends CellProxy_base {
|
|
30
|
+
private _conductor;
|
|
31
|
+
/** Ctor */
|
|
32
|
+
constructor(_conductor: ConductorAppProxy, cell: Cell, defaultTimeout?: number);
|
|
33
|
+
/** -- Fields -- */
|
|
34
|
+
defaultTimeout: number;
|
|
35
|
+
/** append only logs */
|
|
36
|
+
private _requestLog;
|
|
37
|
+
private _responseLog;
|
|
38
|
+
private _canCallBlocking;
|
|
39
|
+
/** -- Methods -- */
|
|
40
|
+
dumpSignals(): void;
|
|
41
|
+
/** Pass call request to conductor proxy and log it */
|
|
42
|
+
executeZomeCall(reqLog: RequestLog): Promise<ResponseLog>;
|
|
43
|
+
/**
|
|
44
|
+
* callZome() with "Mutex" (for calls that writes to source-chain)
|
|
45
|
+
* TODO: Implement call queue instead of mutex
|
|
46
|
+
*/
|
|
47
|
+
callZomeBlocking(zome_name: ZomeName, fn_name: string, payload: any, cap_secret: CapSecret | null, timeout?: number): Promise<any>;
|
|
48
|
+
/** */
|
|
49
|
+
callZome(zome_name: ZomeName, fn_name: string, payload: any, cap_secret: CapSecret | null, timeout?: number): Promise<any>;
|
|
50
|
+
/**
|
|
51
|
+
* Calls the `entry_defs()` zome function and
|
|
52
|
+
* returns an array of all the zome's AppEntryDefNames and visibility
|
|
53
|
+
*/
|
|
54
|
+
callEntryDefs(zomeName: ZomeName): Promise<[string, boolean][]>;
|
|
55
|
+
/** */
|
|
56
|
+
dumpLogs(zomeName?: ZomeName): void;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
package/dist/CellProxy.js
CHANGED
|
@@ -1,155 +1,166 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
//console.log(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { encodeHashToBase64 } from "@holochain/client";
|
|
3
|
+
import { anyToB64, delay, prettyDate, prettyDuration } from "./utils";
|
|
4
|
+
import { CellMixin, Empty } from "./mixins";
|
|
5
|
+
/**
|
|
6
|
+
* Proxy for a running DNA.
|
|
7
|
+
* It logs and queues ZomeCalls.
|
|
8
|
+
* It holds a reference to its ConductorAppProxy and its InstalledCell.
|
|
9
|
+
* This class is expected to be used by ZomeProxies.
|
|
10
|
+
*/
|
|
11
|
+
export class CellProxy extends CellMixin(Empty) {
|
|
12
|
+
/** Ctor */
|
|
13
|
+
constructor(_conductor, cell,
|
|
14
|
+
//public readonly dnaDef: MyDnaDef,
|
|
15
|
+
defaultTimeout) {
|
|
16
|
+
super();
|
|
17
|
+
this._conductor = _conductor;
|
|
18
|
+
//private _blockingRequestQueue: Queue<RequestLog> = new Queue();
|
|
19
|
+
/** append only logs */
|
|
20
|
+
this._requestLog = [];
|
|
21
|
+
this._responseLog = [];
|
|
22
|
+
this._canCallBlocking = true;
|
|
23
|
+
this._cell = cell;
|
|
24
|
+
console.log(`CellProxy.ctor`, cell);
|
|
25
|
+
this.defaultTimeout = defaultTimeout ? defaultTimeout : 10 * 1000;
|
|
26
|
+
}
|
|
27
|
+
// /** -- ICell interface -- */
|
|
28
|
+
//
|
|
29
|
+
// get dnaHash(): DnaHashB64 { return encodeHashToBase64(this.cell.cell_id[0]) }
|
|
30
|
+
// get agentPubKey(): AgentPubKeyB64 { return encodeHashToBase64(this.cell.cell_id[1]) }
|
|
31
|
+
/** -- Methods -- */
|
|
32
|
+
// /** */
|
|
33
|
+
// addSignalHandler(handler: AppSignalCb): SignalUnsubscriber {
|
|
34
|
+
// return this._conductor.addSignalHandler(handler, this.cellId);
|
|
35
|
+
// }
|
|
36
|
+
dumpSignals() {
|
|
37
|
+
this._conductor.dumpSignals(this.cell.cell_id);
|
|
38
|
+
}
|
|
39
|
+
/** Pass call request to conductor proxy and log it */
|
|
40
|
+
executeZomeCall(reqLog) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
reqLog.executionTimestamp = Date.now();
|
|
43
|
+
const requestIndex = this._requestLog.length;
|
|
44
|
+
this._requestLog.push(reqLog);
|
|
45
|
+
try {
|
|
46
|
+
const response = yield this._conductor.callZome(reqLog.request, reqLog.timeout);
|
|
47
|
+
const respLog = { requestIndex, success: response, timestamp: Date.now() };
|
|
48
|
+
this._responseLog.push(respLog);
|
|
49
|
+
return respLog;
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
const respLog = { requestIndex, failure: e, timestamp: Date.now() };
|
|
53
|
+
this._responseLog.push(respLog);
|
|
54
|
+
return respLog;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* callZome() with "Mutex" (for calls that writes to source-chain)
|
|
60
|
+
* TODO: Implement call queue instead of mutex
|
|
61
|
+
*/
|
|
62
|
+
callZomeBlocking(zome_name, fn_name, payload, cap_secret, timeout) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
timeout = timeout ? timeout : this.defaultTimeout;
|
|
65
|
+
const req = {
|
|
66
|
+
cap_secret, zome_name, fn_name, payload,
|
|
67
|
+
cell_id: this.cell.cell_id,
|
|
68
|
+
provenance: this.cell.cell_id[1],
|
|
69
|
+
};
|
|
70
|
+
const log = { request: req, timeout, requestTimestamp: Date.now() };
|
|
71
|
+
while (!this._canCallBlocking && Date.now() - log.requestTimestamp < timeout) {
|
|
72
|
+
yield delay(1);
|
|
73
|
+
}
|
|
74
|
+
if (Date.now() - log.requestTimestamp >= timeout) {
|
|
75
|
+
console.warn({ requestLogs: this._requestLog });
|
|
76
|
+
return Promise.reject("Waiting for zomeCall execution timed-out");
|
|
77
|
+
}
|
|
78
|
+
this._canCallBlocking = false;
|
|
79
|
+
const respLog = yield this.executeZomeCall(log);
|
|
80
|
+
this._canCallBlocking = true;
|
|
81
|
+
if (respLog.failure) {
|
|
82
|
+
this.dumpSignals();
|
|
83
|
+
this.dumpLogs(zome_name);
|
|
84
|
+
return Promise.reject(respLog.failure);
|
|
85
|
+
}
|
|
86
|
+
return respLog.success;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/** */
|
|
90
|
+
callZome(zome_name, fn_name, payload, cap_secret, timeout) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
timeout = timeout ? timeout : this.defaultTimeout;
|
|
93
|
+
const req = {
|
|
94
|
+
cap_secret, zome_name, fn_name, payload,
|
|
95
|
+
cell_id: this.cell.cell_id,
|
|
96
|
+
provenance: this.cell.cell_id[1],
|
|
97
|
+
};
|
|
98
|
+
const log = { request: req, timeout, requestTimestamp: Date.now() };
|
|
99
|
+
const respLog = yield this.executeZomeCall(log);
|
|
100
|
+
if (respLog.failure) {
|
|
101
|
+
this.dumpSignals();
|
|
102
|
+
this.dumpLogs(zome_name);
|
|
103
|
+
return Promise.reject(respLog.failure);
|
|
104
|
+
}
|
|
105
|
+
return respLog.success;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Calls the `entry_defs()` zome function and
|
|
110
|
+
* returns an array of all the zome's AppEntryDefNames and visibility
|
|
111
|
+
*/
|
|
112
|
+
callEntryDefs(zomeName) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
//console.log("callEntryDefs()", zomeName)
|
|
115
|
+
try {
|
|
116
|
+
const entryDefs = yield this.callZome(zomeName, "entry_defs", null, null, 2 * 1000);
|
|
117
|
+
//console.debug("getEntryDefs() for " + this.zomeName + " result:")
|
|
118
|
+
//console.log({entryDefs})
|
|
119
|
+
let result = [];
|
|
120
|
+
for (const def of entryDefs.Defs) {
|
|
121
|
+
const name = def.id.App;
|
|
122
|
+
result.push([name, def.visibility.hasOwnProperty('Public')]);
|
|
123
|
+
}
|
|
124
|
+
//console.log({result})
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
console.error("Calling getEntryDefs() on " + zomeName + " failed: ");
|
|
129
|
+
console.error({ e });
|
|
130
|
+
return Promise.reject(e);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
// /** TODO once we have getDnaDefinition() api */
|
|
135
|
+
// dumpAllZomes() {
|
|
136
|
+
// // FIXME get DNA DEF
|
|
137
|
+
// for (const zomeName of dnaDef) {
|
|
138
|
+
// this.dumpLogs(zomeName)
|
|
139
|
+
// }
|
|
140
|
+
// }
|
|
141
|
+
/** */
|
|
142
|
+
dumpLogs(zomeName) {
|
|
143
|
+
let result = [];
|
|
144
|
+
for (const response of this._responseLog) {
|
|
145
|
+
const requestLog = this._requestLog[response.requestIndex];
|
|
146
|
+
if (zomeName && requestLog.request.zome_name != zomeName) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const startTime = prettyDate(new Date(requestLog.requestTimestamp));
|
|
150
|
+
const waitTime = prettyDuration(new Date(requestLog.executionTimestamp - requestLog.requestTimestamp));
|
|
151
|
+
const duration = prettyDuration(new Date(response.timestamp - requestLog.requestTimestamp));
|
|
152
|
+
const input = requestLog.request.payload instanceof Uint8Array ? encodeHashToBase64(requestLog.request.payload) : requestLog.request.payload;
|
|
153
|
+
const output = anyToB64(response.failure ? response.failure : response.success);
|
|
154
|
+
const log = zomeName
|
|
155
|
+
? { startTime, fnName: requestLog.request.fn_name, input, output, duration, waitTime }
|
|
156
|
+
: { startTime, zomeName: requestLog.request.zome_name, fnName: requestLog.request.fn_name, input, output, duration, waitTime };
|
|
157
|
+
result.push(log);
|
|
158
|
+
}
|
|
159
|
+
console.warn(`Dumping logs for cell "${this._conductor.getLocations(this.cellId)}"`);
|
|
160
|
+
if (zomeName) {
|
|
161
|
+
console.warn(` - For zome "${zomeName}"`);
|
|
162
|
+
}
|
|
163
|
+
console.table(result);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
155
166
|
//# sourceMappingURL=CellProxy.js.map
|
package/dist/CellProxy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellProxy.js","sourceRoot":"","sources":["../src/CellProxy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CellProxy.js","sourceRoot":"","sources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