@holochain/client 0.12.5 → 0.12.7
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 +177 -77
- package/lib/api/admin/websocket.d.ts +8 -2
- package/lib/api/admin/websocket.js +8 -2
- package/lib/api/app/types.d.ts +25 -17
- package/lib/api/app/websocket.d.ts +2 -2
- package/lib/api/app/websocket.js +35 -12
- package/lib/api/app-agent/types.d.ts +13 -8
- package/lib/api/app-agent/websocket.d.ts +11 -3
- package/lib/api/app-agent/websocket.js +23 -7
- package/lib/api/client.d.ts +15 -15
- package/lib/api/client.js +53 -26
- package/lib/api/common.d.ts +13 -5
- package/lib/api/common.js +22 -6
- package/lib/api/index.d.ts +2 -2
- package/lib/api/index.js +2 -2
- package/lib/api/zome-call-signing.d.ts +8 -9
- package/lib/api/zome-call-signing.js +15 -13
- package/lib/environments/launcher.d.ts +31 -3
- package/lib/environments/launcher.js +36 -4
- package/lib/hdk/action.d.ts +16 -6
- package/lib/hdk/capabilities.d.ts +17 -7
- package/lib/hdk/capabilities.js +9 -0
- package/lib/hdk/countersigning.d.ts +4 -4
- package/lib/hdk/dht-ops.d.ts +1 -1
- package/lib/hdk/entry.d.ts +4 -4
- package/lib/hdk/index.d.ts +1 -0
- package/lib/hdk/index.js +1 -0
- package/lib/hdk/link.d.ts +48 -0
- package/lib/hdk/link.js +1 -0
- package/lib/hdk/record.d.ts +2 -2
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types.d.ts +32 -23
- package/lib/utils/fake-hash.d.ts +8 -4
- package/lib/utils/fake-hash.js +25 -12
- package/lib/utils/hash-parts.d.ts +71 -0
- package/lib/utils/hash-parts.js +94 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/package.json +1 -1
package/lib/api/admin/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Action, DhtOp, Entry, ZomeCallCapGrant } from "../../hdk/index.js";
|
|
3
2
|
import { ActionHash, AgentPubKey, CellId, DnaHash, DnaProperties, Duration, HoloHash, HoloHashB64, InstalledAppId, KitsuneAgent, KitsuneSpace, RoleName, Signature, Timestamp, WasmHash } from "../../types.js";
|
|
4
3
|
import { Requester } from "../common.js";
|
|
@@ -6,32 +5,32 @@ import { DisableCloneCellRequest } from "../index.js";
|
|
|
6
5
|
/**
|
|
7
6
|
* @public
|
|
8
7
|
*/
|
|
9
|
-
export
|
|
10
|
-
port
|
|
8
|
+
export type AttachAppInterfaceRequest = {
|
|
9
|
+
port?: number;
|
|
11
10
|
};
|
|
12
11
|
/**
|
|
13
12
|
* @public
|
|
14
13
|
*/
|
|
15
|
-
export
|
|
14
|
+
export type AttachAppInterfaceResponse = {
|
|
16
15
|
port: number;
|
|
17
16
|
};
|
|
18
17
|
/**
|
|
19
18
|
* @public
|
|
20
19
|
*/
|
|
21
|
-
export
|
|
20
|
+
export type EnableAppRequest = {
|
|
22
21
|
installed_app_id: InstalledAppId;
|
|
23
22
|
};
|
|
24
23
|
/**
|
|
25
24
|
* @public
|
|
26
25
|
*/
|
|
27
|
-
export
|
|
26
|
+
export type EnableAppResponse = {
|
|
28
27
|
app: AppInfo;
|
|
29
28
|
errors: Array<[CellId, string]>;
|
|
30
29
|
};
|
|
31
30
|
/**
|
|
32
31
|
* @public
|
|
33
32
|
*/
|
|
34
|
-
export
|
|
33
|
+
export type DeactivationReason = {
|
|
35
34
|
never_activated: null;
|
|
36
35
|
} | {
|
|
37
36
|
normal: null;
|
|
@@ -43,13 +42,13 @@ export declare type DeactivationReason = {
|
|
|
43
42
|
/**
|
|
44
43
|
* @public
|
|
45
44
|
*/
|
|
46
|
-
export
|
|
45
|
+
export type PausedAppReason = {
|
|
47
46
|
error: string;
|
|
48
47
|
};
|
|
49
48
|
/**
|
|
50
49
|
* @public
|
|
51
50
|
*/
|
|
52
|
-
export
|
|
51
|
+
export type DisabledAppReason = {
|
|
53
52
|
never_started: null;
|
|
54
53
|
} | {
|
|
55
54
|
user: null;
|
|
@@ -59,7 +58,7 @@ export declare type DisabledAppReason = {
|
|
|
59
58
|
/**
|
|
60
59
|
* @public
|
|
61
60
|
*/
|
|
62
|
-
export
|
|
61
|
+
export type InstalledAppInfoStatus = {
|
|
63
62
|
paused: {
|
|
64
63
|
reason: PausedAppReason;
|
|
65
64
|
};
|
|
@@ -108,7 +107,7 @@ export declare enum CellType {
|
|
|
108
107
|
/**
|
|
109
108
|
* @public
|
|
110
109
|
*/
|
|
111
|
-
export
|
|
110
|
+
export type CellInfo = {
|
|
112
111
|
[CellType.Provisioned]: ProvisionedCell;
|
|
113
112
|
} | {
|
|
114
113
|
[CellType.Cloned]: ClonedCell;
|
|
@@ -118,7 +117,7 @@ export declare type CellInfo = {
|
|
|
118
117
|
/**
|
|
119
118
|
* @public
|
|
120
119
|
*/
|
|
121
|
-
export
|
|
120
|
+
export type AppInfo = {
|
|
122
121
|
agent_pub_key: AgentPubKey;
|
|
123
122
|
installed_app_id: InstalledAppId;
|
|
124
123
|
cell_info: Record<RoleName, Array<CellInfo>>;
|
|
@@ -127,60 +126,60 @@ export declare type AppInfo = {
|
|
|
127
126
|
/**
|
|
128
127
|
* @public
|
|
129
128
|
*/
|
|
130
|
-
export
|
|
129
|
+
export type MembraneProof = Uint8Array;
|
|
131
130
|
/**
|
|
132
131
|
* @public
|
|
133
132
|
*/
|
|
134
|
-
export
|
|
133
|
+
export type DisableAppRequest = {
|
|
135
134
|
installed_app_id: InstalledAppId;
|
|
136
135
|
};
|
|
137
136
|
/**
|
|
138
137
|
* @public
|
|
139
138
|
*/
|
|
140
|
-
export
|
|
139
|
+
export type DisableAppResponse = null;
|
|
141
140
|
/**
|
|
142
141
|
* @public
|
|
143
142
|
*/
|
|
144
|
-
export
|
|
143
|
+
export type StartAppRequest = {
|
|
145
144
|
installed_app_id: InstalledAppId;
|
|
146
145
|
};
|
|
147
146
|
/**
|
|
148
147
|
* @public
|
|
149
148
|
*/
|
|
150
|
-
export
|
|
149
|
+
export type StartAppResponse = boolean;
|
|
151
150
|
/**
|
|
152
151
|
* @public
|
|
153
152
|
*/
|
|
154
|
-
export
|
|
153
|
+
export type DumpStateRequest = {
|
|
155
154
|
cell_id: CellId;
|
|
156
155
|
};
|
|
157
156
|
/**
|
|
158
157
|
* @public
|
|
159
158
|
*/
|
|
160
|
-
export
|
|
159
|
+
export type DumpStateResponse = any;
|
|
161
160
|
/**
|
|
162
161
|
* @public
|
|
163
162
|
*/
|
|
164
|
-
export
|
|
163
|
+
export type DumpFullStateRequest = {
|
|
165
164
|
cell_id: CellId;
|
|
166
|
-
dht_ops_cursor
|
|
165
|
+
dht_ops_cursor?: number;
|
|
167
166
|
};
|
|
168
167
|
/**
|
|
169
168
|
* @public
|
|
170
169
|
*/
|
|
171
|
-
export
|
|
170
|
+
export type DumpFullStateResponse = FullStateDump;
|
|
172
171
|
/**
|
|
173
172
|
* @public
|
|
174
173
|
*/
|
|
175
|
-
export
|
|
174
|
+
export type GenerateAgentPubKeyRequest = void;
|
|
176
175
|
/**
|
|
177
176
|
* @public
|
|
178
177
|
*/
|
|
179
|
-
export
|
|
178
|
+
export type GenerateAgentPubKeyResponse = AgentPubKey;
|
|
180
179
|
/**
|
|
181
180
|
* @public
|
|
182
181
|
*/
|
|
183
|
-
export
|
|
182
|
+
export type RegisterDnaRequest = {
|
|
184
183
|
modifiers?: {
|
|
185
184
|
network_seed?: string;
|
|
186
185
|
properties?: DnaProperties;
|
|
@@ -189,28 +188,28 @@ export declare type RegisterDnaRequest = {
|
|
|
189
188
|
/**
|
|
190
189
|
* @public
|
|
191
190
|
*/
|
|
192
|
-
export
|
|
191
|
+
export type RegisterDnaResponse = HoloHash;
|
|
193
192
|
/**
|
|
194
193
|
* @public
|
|
195
194
|
*/
|
|
196
|
-
export
|
|
195
|
+
export type DnaModifiers = {
|
|
197
196
|
network_seed: NetworkSeed;
|
|
198
|
-
properties:
|
|
197
|
+
properties: Uint8Array;
|
|
199
198
|
origin_time: Timestamp;
|
|
200
199
|
quantum_time: Duration;
|
|
201
200
|
};
|
|
202
201
|
/**
|
|
203
202
|
* @public
|
|
204
203
|
*/
|
|
205
|
-
export
|
|
204
|
+
export type FunctionName = string;
|
|
206
205
|
/**
|
|
207
206
|
* @public
|
|
208
207
|
*/
|
|
209
|
-
export
|
|
208
|
+
export type ZomeName = string;
|
|
210
209
|
/**
|
|
211
210
|
* @public
|
|
212
211
|
*/
|
|
213
|
-
export
|
|
212
|
+
export type ZomeDefinition = [
|
|
214
213
|
ZomeName,
|
|
215
214
|
{
|
|
216
215
|
wasm_hash: WasmHash;
|
|
@@ -220,15 +219,15 @@ export declare type ZomeDefinition = [
|
|
|
220
219
|
/**
|
|
221
220
|
* @public
|
|
222
221
|
*/
|
|
223
|
-
export
|
|
222
|
+
export type IntegrityZome = ZomeDefinition;
|
|
224
223
|
/**
|
|
225
224
|
* @public
|
|
226
225
|
*/
|
|
227
|
-
export
|
|
226
|
+
export type CoordinatorZome = ZomeDefinition;
|
|
228
227
|
/**
|
|
229
228
|
* @public
|
|
230
229
|
*/
|
|
231
|
-
export
|
|
230
|
+
export type DnaDefinition = {
|
|
232
231
|
name: string;
|
|
233
232
|
modifiers: DnaModifiers;
|
|
234
233
|
integrity_zomes: IntegrityZome[];
|
|
@@ -237,29 +236,39 @@ export declare type DnaDefinition = {
|
|
|
237
236
|
/**
|
|
238
237
|
* @public
|
|
239
238
|
*/
|
|
240
|
-
export
|
|
239
|
+
export type GetDnaDefinitionRequest = DnaHash;
|
|
241
240
|
/**
|
|
242
241
|
* @public
|
|
243
242
|
*/
|
|
244
|
-
export
|
|
243
|
+
export type GetDnaDefinitionResponse = DnaDefinition;
|
|
245
244
|
/**
|
|
246
245
|
* @public
|
|
247
246
|
*/
|
|
248
|
-
export
|
|
247
|
+
export type UninstallAppRequest = {
|
|
249
248
|
installed_app_id: InstalledAppId;
|
|
250
249
|
};
|
|
251
250
|
/**
|
|
252
251
|
* @public
|
|
253
252
|
*/
|
|
254
|
-
export
|
|
253
|
+
export type UninstallAppResponse = null;
|
|
254
|
+
/**
|
|
255
|
+
* @public
|
|
256
|
+
*/
|
|
257
|
+
export type UpdateCoordinatorsRequest = {
|
|
258
|
+
dna_hash: DnaHash;
|
|
259
|
+
} & CoordinatorSource;
|
|
255
260
|
/**
|
|
256
261
|
* @public
|
|
257
262
|
*/
|
|
258
|
-
export
|
|
263
|
+
export type UpdateCoordinatorsResponse = void;
|
|
259
264
|
/**
|
|
260
265
|
* @public
|
|
261
266
|
*/
|
|
262
|
-
export
|
|
267
|
+
export type ResourceBytes = Uint8Array;
|
|
268
|
+
/**
|
|
269
|
+
* @public
|
|
270
|
+
*/
|
|
271
|
+
export type ResourceMap = {
|
|
263
272
|
[key: string]: ResourceBytes;
|
|
264
273
|
};
|
|
265
274
|
/**
|
|
@@ -297,7 +306,7 @@ export interface CellProvisioning {
|
|
|
297
306
|
/**
|
|
298
307
|
* @public
|
|
299
308
|
*/
|
|
300
|
-
export
|
|
309
|
+
export type Location = {
|
|
301
310
|
/**
|
|
302
311
|
* Expect file to be part of this bundle
|
|
303
312
|
*/
|
|
@@ -316,11 +325,11 @@ export declare type Location = {
|
|
|
316
325
|
/**
|
|
317
326
|
* @public
|
|
318
327
|
*/
|
|
319
|
-
export
|
|
328
|
+
export type DnaVersionSpec = Array<HoloHashB64>;
|
|
320
329
|
/**
|
|
321
330
|
* @public
|
|
322
331
|
*/
|
|
323
|
-
export
|
|
332
|
+
export type DnaVersionFlexible = {
|
|
324
333
|
singleton: HoloHashB64;
|
|
325
334
|
} | {
|
|
326
335
|
multiple: DnaVersionSpec;
|
|
@@ -328,7 +337,7 @@ export declare type DnaVersionFlexible = {
|
|
|
328
337
|
/**
|
|
329
338
|
* @public
|
|
330
339
|
*/
|
|
331
|
-
export
|
|
340
|
+
export type AppRoleDnaManifest = {
|
|
332
341
|
clone_limit?: number;
|
|
333
342
|
modifiers?: Partial<DnaModifiers>;
|
|
334
343
|
version?: DnaVersionFlexible;
|
|
@@ -336,7 +345,7 @@ export declare type AppRoleDnaManifest = {
|
|
|
336
345
|
/**
|
|
337
346
|
* @public
|
|
338
347
|
*/
|
|
339
|
-
export
|
|
348
|
+
export type AppRoleManifest = {
|
|
340
349
|
name: RoleName;
|
|
341
350
|
provisioning?: CellProvisioning;
|
|
342
351
|
dna: AppRoleDnaManifest;
|
|
@@ -344,7 +353,7 @@ export declare type AppRoleManifest = {
|
|
|
344
353
|
/**
|
|
345
354
|
* @public
|
|
346
355
|
*/
|
|
347
|
-
export
|
|
356
|
+
export type AppManifest = {
|
|
348
357
|
manifest_version: string;
|
|
349
358
|
name: string;
|
|
350
359
|
description?: string;
|
|
@@ -353,14 +362,14 @@ export declare type AppManifest = {
|
|
|
353
362
|
/**
|
|
354
363
|
* @public
|
|
355
364
|
*/
|
|
356
|
-
export
|
|
365
|
+
export type AppBundle = {
|
|
357
366
|
manifest: AppManifest;
|
|
358
367
|
resources: ResourceMap;
|
|
359
368
|
};
|
|
360
369
|
/**
|
|
361
370
|
* @public
|
|
362
371
|
*/
|
|
363
|
-
export
|
|
372
|
+
export type AppBundleSource = {
|
|
364
373
|
bundle: AppBundle;
|
|
365
374
|
} | {
|
|
366
375
|
path: string;
|
|
@@ -368,46 +377,67 @@ export declare type AppBundleSource = {
|
|
|
368
377
|
/**
|
|
369
378
|
* @public
|
|
370
379
|
*/
|
|
371
|
-
export
|
|
380
|
+
export type NetworkSeed = string;
|
|
372
381
|
/**
|
|
373
382
|
* @public
|
|
374
383
|
*/
|
|
375
|
-
export
|
|
384
|
+
export type InstallAppRequest = {
|
|
385
|
+
/**
|
|
386
|
+
* The agent to use when creating Cells for this App.
|
|
387
|
+
*/
|
|
376
388
|
agent_key: AgentPubKey;
|
|
389
|
+
/**
|
|
390
|
+
* The unique identifier for an installed app in this conductor.
|
|
391
|
+
* If not specified, it will be derived from the app name in the bundle manifest.
|
|
392
|
+
*/
|
|
377
393
|
installed_app_id?: InstalledAppId;
|
|
394
|
+
/**
|
|
395
|
+
* Include proof-of-membrane-membership data for cells that require it,
|
|
396
|
+
* keyed by the CellNick specified in the app bundle manifest.
|
|
397
|
+
*/
|
|
378
398
|
membrane_proofs: {
|
|
379
399
|
[key: string]: MembraneProof;
|
|
380
400
|
};
|
|
401
|
+
/**
|
|
402
|
+
* Optional global network seed override. If set will override the network seed value for all
|
|
403
|
+
* DNAs in the bundle.
|
|
404
|
+
*/
|
|
381
405
|
network_seed?: NetworkSeed;
|
|
406
|
+
/**
|
|
407
|
+
* Optional: If app installation fails due to genesis failure, normally the app will be immediately uninstalled.
|
|
408
|
+
* When this flag is set, the app is left installed with empty cells intact. This can be useful for
|
|
409
|
+
* using graft_records_onto_source_chain, or for diagnostics.
|
|
410
|
+
*/
|
|
411
|
+
ignore_genesis_failure?: boolean;
|
|
382
412
|
} & AppBundleSource;
|
|
383
413
|
/**
|
|
384
414
|
* @public
|
|
385
415
|
*/
|
|
386
|
-
export
|
|
416
|
+
export type InstallAppResponse = AppInfo;
|
|
387
417
|
/**
|
|
388
418
|
* @public
|
|
389
419
|
*/
|
|
390
|
-
export
|
|
420
|
+
export type ListDnasRequest = void;
|
|
391
421
|
/**
|
|
392
422
|
* @public
|
|
393
423
|
*/
|
|
394
|
-
export
|
|
424
|
+
export type ListDnasResponse = Array<string>;
|
|
395
425
|
/**
|
|
396
426
|
* @public
|
|
397
427
|
*/
|
|
398
|
-
export
|
|
428
|
+
export type ListCellIdsRequest = void;
|
|
399
429
|
/**
|
|
400
430
|
* @public
|
|
401
431
|
*/
|
|
402
|
-
export
|
|
432
|
+
export type ListCellIdsResponse = Array<CellId>;
|
|
403
433
|
/**
|
|
404
434
|
* @public
|
|
405
435
|
*/
|
|
406
|
-
export
|
|
436
|
+
export type ListActiveAppsRequest = void;
|
|
407
437
|
/**
|
|
408
438
|
* @public
|
|
409
439
|
*/
|
|
410
|
-
export
|
|
440
|
+
export type ListActiveAppsResponse = Array<InstalledAppId>;
|
|
411
441
|
/**
|
|
412
442
|
* @public
|
|
413
443
|
*/
|
|
@@ -421,55 +451,55 @@ export declare enum AppStatusFilter {
|
|
|
421
451
|
/**
|
|
422
452
|
* @public
|
|
423
453
|
*/
|
|
424
|
-
export
|
|
454
|
+
export type ListAppsRequest = {
|
|
425
455
|
status_filter?: AppStatusFilter;
|
|
426
456
|
};
|
|
427
457
|
/**
|
|
428
458
|
* @public
|
|
429
459
|
*/
|
|
430
|
-
export
|
|
460
|
+
export type ListAppsResponse = Array<AppInfo>;
|
|
431
461
|
/**
|
|
432
462
|
* @public
|
|
433
463
|
*/
|
|
434
|
-
export
|
|
464
|
+
export type ListAppInterfacesRequest = void;
|
|
435
465
|
/**
|
|
436
466
|
* @public
|
|
437
467
|
*/
|
|
438
|
-
export
|
|
468
|
+
export type ListAppInterfacesResponse = Array<number>;
|
|
439
469
|
/**
|
|
440
470
|
* This type is meant to be opaque
|
|
441
471
|
*
|
|
442
472
|
* @public
|
|
443
473
|
*/
|
|
444
|
-
export
|
|
474
|
+
export type AgentInfoSigned = unknown;
|
|
445
475
|
/**
|
|
446
476
|
* @public
|
|
447
477
|
*/
|
|
448
|
-
export
|
|
478
|
+
export type AgentInfoRequest = {
|
|
449
479
|
cell_id: CellId | null;
|
|
450
480
|
};
|
|
451
481
|
/**
|
|
452
482
|
* @public
|
|
453
483
|
*/
|
|
454
|
-
export
|
|
484
|
+
export type AgentInfoResponse = Array<AgentInfoSigned>;
|
|
455
485
|
/**
|
|
456
486
|
* @public
|
|
457
487
|
*/
|
|
458
|
-
export
|
|
488
|
+
export type AddAgentInfoRequest = {
|
|
459
489
|
agent_infos: Array<AgentInfoSigned>;
|
|
460
490
|
};
|
|
461
491
|
/**
|
|
462
492
|
* @public
|
|
463
493
|
*/
|
|
464
|
-
export
|
|
494
|
+
export type AddAgentInfoResponse = any;
|
|
465
495
|
/**
|
|
466
496
|
* @public
|
|
467
497
|
*/
|
|
468
|
-
export
|
|
498
|
+
export type DeleteCloneCellRequest = DisableCloneCellRequest;
|
|
469
499
|
/**
|
|
470
500
|
* @public
|
|
471
501
|
*/
|
|
472
|
-
export
|
|
502
|
+
export type DeleteCloneCellResponse = void;
|
|
473
503
|
/**
|
|
474
504
|
* @public
|
|
475
505
|
*/
|
|
@@ -487,11 +517,11 @@ export interface GrantZomeCallCapabilityRequest {
|
|
|
487
517
|
/**
|
|
488
518
|
* @public
|
|
489
519
|
*/
|
|
490
|
-
export
|
|
520
|
+
export type GrantZomeCallCapabilityResponse = void;
|
|
491
521
|
/**
|
|
492
522
|
* @public
|
|
493
523
|
*/
|
|
494
|
-
export
|
|
524
|
+
export type InstallAppDnaPayload = {
|
|
495
525
|
hash: HoloHash;
|
|
496
526
|
role_name: RoleName;
|
|
497
527
|
membrane_proof?: MembraneProof;
|
|
@@ -499,18 +529,46 @@ export declare type InstallAppDnaPayload = {
|
|
|
499
529
|
/**
|
|
500
530
|
* @public
|
|
501
531
|
*/
|
|
502
|
-
export
|
|
532
|
+
export type ZomeLocation = Location;
|
|
533
|
+
/**
|
|
534
|
+
* @public
|
|
535
|
+
*/
|
|
536
|
+
export interface ZomeDependency {
|
|
537
|
+
name: ZomeName;
|
|
538
|
+
}
|
|
503
539
|
/**
|
|
504
540
|
* @public
|
|
505
541
|
*/
|
|
506
|
-
export
|
|
542
|
+
export type ZomeManifest = {
|
|
507
543
|
name: string;
|
|
508
544
|
hash?: string;
|
|
545
|
+
dependencies?: ZomeDependency[];
|
|
509
546
|
} & ZomeLocation;
|
|
510
547
|
/**
|
|
511
548
|
* @public
|
|
512
549
|
*/
|
|
513
|
-
export
|
|
550
|
+
export interface CoordinatorManifest {
|
|
551
|
+
zomes: Array<ZomeManifest>;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* @public
|
|
555
|
+
*/
|
|
556
|
+
export interface CoordinatorBundle {
|
|
557
|
+
manifest: CoordinatorManifest;
|
|
558
|
+
resources: ResourceMap;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* @public
|
|
562
|
+
*/
|
|
563
|
+
export type CoordinatorSource = {
|
|
564
|
+
path: string;
|
|
565
|
+
} | {
|
|
566
|
+
bundle: CoordinatorBundle;
|
|
567
|
+
};
|
|
568
|
+
/**
|
|
569
|
+
* @public
|
|
570
|
+
*/
|
|
571
|
+
export type DnaManifest = {
|
|
514
572
|
/**
|
|
515
573
|
* Currently one "1" is supported
|
|
516
574
|
*/
|
|
@@ -536,14 +594,14 @@ export declare type DnaManifest = {
|
|
|
536
594
|
/**
|
|
537
595
|
* @public
|
|
538
596
|
*/
|
|
539
|
-
export
|
|
597
|
+
export type DnaBundle = {
|
|
540
598
|
manifest: DnaManifest;
|
|
541
599
|
resources: ResourceMap;
|
|
542
600
|
};
|
|
543
601
|
/**
|
|
544
602
|
* @public
|
|
545
603
|
*/
|
|
546
|
-
export
|
|
604
|
+
export type DnaSource = {
|
|
547
605
|
hash: HoloHash;
|
|
548
606
|
} | {
|
|
549
607
|
path: string;
|
|
@@ -553,13 +611,13 @@ export declare type DnaSource = {
|
|
|
553
611
|
/**
|
|
554
612
|
* @public
|
|
555
613
|
*/
|
|
556
|
-
export
|
|
614
|
+
export type Zomes = Array<[string, {
|
|
557
615
|
wasm_hash: Array<HoloHash>;
|
|
558
616
|
}]>;
|
|
559
617
|
/**
|
|
560
618
|
* @public
|
|
561
619
|
*/
|
|
562
|
-
export
|
|
620
|
+
export type WasmCode = [HoloHash, {
|
|
563
621
|
code: Array<number>;
|
|
564
622
|
}];
|
|
565
623
|
/**
|
|
@@ -624,6 +682,46 @@ export interface FullStateDump {
|
|
|
624
682
|
source_chain_dump: SourceChainJsonDump;
|
|
625
683
|
integration_dump: FullIntegrationStateDump;
|
|
626
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* @public
|
|
687
|
+
*/
|
|
688
|
+
export interface DnaStorageInfo {
|
|
689
|
+
authored_data_size: number;
|
|
690
|
+
authored_data_size_on_disk: number;
|
|
691
|
+
dht_data_size: number;
|
|
692
|
+
dht_data_size_on_disk: number;
|
|
693
|
+
cache_data_size: number;
|
|
694
|
+
cache_data_size_on_disk: number;
|
|
695
|
+
used_by: Array<InstalledAppId>;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* @public
|
|
699
|
+
*/
|
|
700
|
+
export interface DnaStorageBlob {
|
|
701
|
+
dna: DnaStorageInfo;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* @public
|
|
705
|
+
*/
|
|
706
|
+
export interface StorageInfo {
|
|
707
|
+
blobs: Array<DnaStorageBlob>;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* @public
|
|
711
|
+
*/
|
|
712
|
+
export type StorageInfoRequest = void;
|
|
713
|
+
/**
|
|
714
|
+
* @public
|
|
715
|
+
*/
|
|
716
|
+
export type StorageInfoResponse = StorageInfo;
|
|
717
|
+
/**
|
|
718
|
+
* @public
|
|
719
|
+
*/
|
|
720
|
+
export type DumpNetworkStatsRequest = void;
|
|
721
|
+
/**
|
|
722
|
+
* @public
|
|
723
|
+
*/
|
|
724
|
+
export type DumpNetworkStatsResponse = string;
|
|
627
725
|
/**
|
|
628
726
|
* @public
|
|
629
727
|
*/
|
|
@@ -646,4 +744,6 @@ export interface AdminApi {
|
|
|
646
744
|
addAgentInfo: Requester<AddAgentInfoRequest, AddAgentInfoResponse>;
|
|
647
745
|
deleteCloneCell: Requester<DeleteCloneCellRequest, DeleteCloneCellResponse>;
|
|
648
746
|
grantZomeCallCapability: Requester<GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse>;
|
|
747
|
+
storageInfo: Requester<StorageInfoRequest, StorageInfoResponse>;
|
|
748
|
+
dumpNetworkStats: Requester<DumpNetworkStatsRequest, DumpNetworkStatsResponse>;
|
|
649
749
|
}
|
|
@@ -2,7 +2,7 @@ import { CapSecret, GrantedFunctions } from "../../hdk/capabilities.js";
|
|
|
2
2
|
import type { AgentPubKey, CellId } from "../../types.js";
|
|
3
3
|
import { WsClient } from "../client.js";
|
|
4
4
|
import { Requester, Transformer } from "../common.js";
|
|
5
|
-
import { AddAgentInfoRequest, AddAgentInfoResponse, AdminApi, AgentInfoRequest, AgentInfoResponse, AttachAppInterfaceRequest, AttachAppInterfaceResponse, DeleteCloneCellRequest, DeleteCloneCellResponse, DisableAppRequest, DisableAppResponse, DumpFullStateRequest, DumpFullStateResponse, DumpStateRequest, DumpStateResponse, EnableAppRequest, EnableAppResponse, GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse, GetDnaDefinitionRequest, GetDnaDefinitionResponse, GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse, InstallAppRequest, InstallAppResponse, ListAppInterfacesRequest, ListAppInterfacesResponse, ListAppsRequest, ListAppsResponse, ListCellIdsRequest, ListCellIdsResponse, ListDnasRequest, ListDnasResponse, RegisterDnaRequest, RegisterDnaResponse, UninstallAppRequest, UninstallAppResponse } from "./types.js";
|
|
5
|
+
import { AddAgentInfoRequest, AddAgentInfoResponse, AdminApi, AgentInfoRequest, AgentInfoResponse, AttachAppInterfaceRequest, AttachAppInterfaceResponse, DeleteCloneCellRequest, DeleteCloneCellResponse, DisableAppRequest, DisableAppResponse, DumpFullStateRequest, DumpFullStateResponse, DumpNetworkStatsRequest, DumpNetworkStatsResponse, DumpStateRequest, DumpStateResponse, EnableAppRequest, EnableAppResponse, GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse, GetDnaDefinitionRequest, GetDnaDefinitionResponse, GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse, InstallAppRequest, InstallAppResponse, ListAppInterfacesRequest, ListAppInterfacesResponse, ListAppsRequest, ListAppsResponse, ListCellIdsRequest, ListCellIdsResponse, ListDnasRequest, ListDnasResponse, RegisterDnaRequest, RegisterDnaResponse, StorageInfoRequest, StorageInfoResponse, UninstallAppRequest, UninstallAppResponse, UpdateCoordinatorsRequest, UpdateCoordinatorsResponse } from "./types.js";
|
|
6
6
|
/**
|
|
7
7
|
* A class for interacting with a conductor's Admin API.
|
|
8
8
|
*
|
|
@@ -25,7 +25,7 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
25
25
|
* @param defaultTimeout - The default timeout for any request.
|
|
26
26
|
* @returns A promise for a new connected instance.
|
|
27
27
|
*/
|
|
28
|
-
static connect(url:
|
|
28
|
+
static connect(url: URL, defaultTimeout?: number): Promise<AdminWebsocket>;
|
|
29
29
|
_requester<ReqI, ReqO, ResI, ResO>(tag: string, transformer?: Transformer<ReqI, ReqO, ResI, ResO>): (req: ReqI, timeout?: number | undefined) => Promise<ResO>;
|
|
30
30
|
/**
|
|
31
31
|
* Send a request to open the given port for {@link AppWebsocket} connections.
|
|
@@ -70,6 +70,10 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
70
70
|
* Install the specified app into Holochain.
|
|
71
71
|
*/
|
|
72
72
|
installApp: Requester<InstallAppRequest, InstallAppResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Update coordinators for an installed app.
|
|
75
|
+
*/
|
|
76
|
+
updateCoordinators: Requester<UpdateCoordinatorsRequest, UpdateCoordinatorsResponse>;
|
|
73
77
|
/**
|
|
74
78
|
* List all registered DNAs.
|
|
75
79
|
*/
|
|
@@ -103,6 +107,8 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
103
107
|
* calls.
|
|
104
108
|
*/
|
|
105
109
|
grantZomeCallCapability: Requester<GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse>;
|
|
110
|
+
storageInfo: Requester<StorageInfoRequest, StorageInfoResponse>;
|
|
111
|
+
dumpNetworkStats: Requester<DumpNetworkStatsRequest, DumpNetworkStatsResponse>;
|
|
106
112
|
/**
|
|
107
113
|
* Grant a capability for signing zome calls.
|
|
108
114
|
*
|
|
@@ -34,7 +34,7 @@ export class AdminWebsocket {
|
|
|
34
34
|
// Check if we are in the launcher's environment, and if so, redirect the url to connect to
|
|
35
35
|
const env = getLauncherEnvironment();
|
|
36
36
|
if (env?.ADMIN_INTERFACE_PORT) {
|
|
37
|
-
url = `ws://127.0.0.1:${env.ADMIN_INTERFACE_PORT}
|
|
37
|
+
url = new URL(`ws://127.0.0.1:${env.ADMIN_INTERFACE_PORT}`);
|
|
38
38
|
}
|
|
39
39
|
const wsClient = await WsClient.connect(url);
|
|
40
40
|
return new AdminWebsocket(wsClient, defaultTimeout);
|
|
@@ -85,6 +85,10 @@ export class AdminWebsocket {
|
|
|
85
85
|
* Install the specified app into Holochain.
|
|
86
86
|
*/
|
|
87
87
|
installApp = this._requester("install_app");
|
|
88
|
+
/**
|
|
89
|
+
* Update coordinators for an installed app.
|
|
90
|
+
*/
|
|
91
|
+
updateCoordinators = this._requester("update_coordinators");
|
|
88
92
|
/**
|
|
89
93
|
* List all registered DNAs.
|
|
90
94
|
*/
|
|
@@ -118,6 +122,8 @@ export class AdminWebsocket {
|
|
|
118
122
|
* calls.
|
|
119
123
|
*/
|
|
120
124
|
grantZomeCallCapability = this._requester("grant_zome_call_capability");
|
|
125
|
+
storageInfo = this._requester("storage_info");
|
|
126
|
+
dumpNetworkStats = this._requester("dump_network_stats");
|
|
121
127
|
// zome call signing related methods
|
|
122
128
|
/**
|
|
123
129
|
* Grant a capability for signing zome calls.
|
|
@@ -153,7 +159,7 @@ export class AdminWebsocket {
|
|
|
153
159
|
* granted for all zomes and functions.
|
|
154
160
|
*/
|
|
155
161
|
authorizeSigningCredentials = async (cellId, functions) => {
|
|
156
|
-
const [keyPair, signingKey] = generateSigningKeyPair();
|
|
162
|
+
const [keyPair, signingKey] = await generateSigningKeyPair();
|
|
157
163
|
const capSecret = await this.grantSigningKey(cellId, functions || { [GrantedFunctionsType.All]: null }, signingKey);
|
|
158
164
|
setSigningCredentials(cellId, { capSecret, keyPair, signingKey });
|
|
159
165
|
};
|