@holochain/client 0.20.0-dev.1 → 0.20.0-rc.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 +1 -0
- package/lib/api/admin/types.d.ts +82 -73
- package/lib/api/admin/types.js +0 -3
- package/lib/api/admin/websocket.d.ts +12 -9
- package/lib/api/admin/websocket.js +11 -8
- package/lib/api/app/websocket.d.ts +9 -8
- package/lib/api/app/websocket.js +9 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -182,6 +182,7 @@ You need a version (`stable` toolchain) of Rust available.
|
|
|
182
182
|
You need `holochain` and `hc` on your path, best to get them from nix with `nix-shell`.
|
|
183
183
|
|
|
184
184
|
To perform the pre-requisite DNA compilation steps, and run the Nodejs test, run:
|
|
185
|
+
|
|
185
186
|
```bash
|
|
186
187
|
nix develop
|
|
187
188
|
./build-fixture.sh
|
package/lib/api/admin/types.d.ts
CHANGED
|
@@ -32,10 +32,7 @@ export type EnableAppRequest = {
|
|
|
32
32
|
/**
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
|
-
export type EnableAppResponse =
|
|
36
|
-
app: AppInfo;
|
|
37
|
-
errors: Array<[CellId, string]>;
|
|
38
|
-
};
|
|
35
|
+
export type EnableAppResponse = AppInfo;
|
|
39
36
|
/**
|
|
40
37
|
* @public
|
|
41
38
|
*/
|
|
@@ -59,20 +56,13 @@ export type DisabledAppReason = {
|
|
|
59
56
|
/**
|
|
60
57
|
* @public
|
|
61
58
|
*/
|
|
62
|
-
export type
|
|
63
|
-
type: "paused";
|
|
64
|
-
value: {
|
|
65
|
-
reason: PausedAppReason;
|
|
66
|
-
};
|
|
67
|
-
} | {
|
|
59
|
+
export type AppStatus = {
|
|
68
60
|
type: "disabled";
|
|
69
|
-
value:
|
|
70
|
-
reason: DisabledAppReason;
|
|
71
|
-
};
|
|
61
|
+
value: DisabledAppReason;
|
|
72
62
|
} | {
|
|
73
|
-
type: "
|
|
63
|
+
type: "enabled";
|
|
74
64
|
} | {
|
|
75
|
-
type: "
|
|
65
|
+
type: "awaiting_memproofs";
|
|
76
66
|
};
|
|
77
67
|
/**
|
|
78
68
|
* @public
|
|
@@ -129,7 +119,7 @@ export type AppInfo = {
|
|
|
129
119
|
agent_pub_key: AgentPubKey;
|
|
130
120
|
installed_app_id: InstalledAppId;
|
|
131
121
|
cell_info: Record<RoleName, Array<CellInfo>>;
|
|
132
|
-
status:
|
|
122
|
+
status: AppStatus;
|
|
133
123
|
installed_at: Timestamp;
|
|
134
124
|
};
|
|
135
125
|
/**
|
|
@@ -240,20 +230,6 @@ export type RevokeAgentKeyRequest = {
|
|
|
240
230
|
* @public
|
|
241
231
|
*/
|
|
242
232
|
export type RevokeAgentKeyResponse = [CellId, string][];
|
|
243
|
-
/**
|
|
244
|
-
* @public
|
|
245
|
-
*/
|
|
246
|
-
export type RegisterDnaRequest = {
|
|
247
|
-
source: DnaSource;
|
|
248
|
-
modifiers?: {
|
|
249
|
-
network_seed?: string;
|
|
250
|
-
properties?: DnaProperties;
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
/**
|
|
254
|
-
* @public
|
|
255
|
-
*/
|
|
256
|
-
export type RegisterDnaResponse = HoloHash;
|
|
257
233
|
/**
|
|
258
234
|
* @public
|
|
259
235
|
*/
|
|
@@ -300,7 +276,7 @@ export type DnaDefinition = {
|
|
|
300
276
|
/**
|
|
301
277
|
* @public
|
|
302
278
|
*/
|
|
303
|
-
export type GetDnaDefinitionRequest =
|
|
279
|
+
export type GetDnaDefinitionRequest = CellId;
|
|
304
280
|
/**
|
|
305
281
|
* @public
|
|
306
282
|
*/
|
|
@@ -320,7 +296,7 @@ export type UninstallAppResponse = null;
|
|
|
320
296
|
*/
|
|
321
297
|
export type UpdateCoordinatorsRequest = {
|
|
322
298
|
source: CoordinatorSource;
|
|
323
|
-
|
|
299
|
+
cell_id: CellId;
|
|
324
300
|
};
|
|
325
301
|
/**
|
|
326
302
|
* @public
|
|
@@ -368,25 +344,6 @@ export interface CellProvisioning {
|
|
|
368
344
|
strategy: CellProvisioningStrategy;
|
|
369
345
|
deferred?: boolean;
|
|
370
346
|
}
|
|
371
|
-
/**
|
|
372
|
-
* @public
|
|
373
|
-
*/
|
|
374
|
-
export type Location = {
|
|
375
|
-
/**
|
|
376
|
-
* Expect file to be part of this bundle
|
|
377
|
-
*/
|
|
378
|
-
bundled: string;
|
|
379
|
-
} | {
|
|
380
|
-
/**
|
|
381
|
-
* Get file from local filesystem (not bundled)
|
|
382
|
-
*/
|
|
383
|
-
path: string;
|
|
384
|
-
} | {
|
|
385
|
-
/**
|
|
386
|
-
* Get file from URL
|
|
387
|
-
*/
|
|
388
|
-
url: string;
|
|
389
|
-
};
|
|
390
347
|
/**
|
|
391
348
|
* @public
|
|
392
349
|
*/
|
|
@@ -403,10 +360,11 @@ export type DnaVersionFlexible = {
|
|
|
403
360
|
* @public
|
|
404
361
|
*/
|
|
405
362
|
export type AppRoleDnaManifest = {
|
|
406
|
-
|
|
363
|
+
path?: string;
|
|
407
364
|
modifiers?: Partial<DnaModifiers>;
|
|
408
|
-
|
|
409
|
-
|
|
365
|
+
installed_hash?: DnaHash;
|
|
366
|
+
clone_limit?: number;
|
|
367
|
+
};
|
|
410
368
|
/**
|
|
411
369
|
* @public
|
|
412
370
|
*/
|
|
@@ -419,7 +377,7 @@ export type AppRoleManifest = {
|
|
|
419
377
|
* @public
|
|
420
378
|
*/
|
|
421
379
|
export type AppManifest = {
|
|
422
|
-
manifest_version:
|
|
380
|
+
manifest_version: "0";
|
|
423
381
|
name: string;
|
|
424
382
|
description?: string;
|
|
425
383
|
roles: Array<AppRoleManifest>;
|
|
@@ -516,10 +474,7 @@ export type ListActiveAppsResponse = Array<InstalledAppId>;
|
|
|
516
474
|
*/
|
|
517
475
|
export declare enum AppStatusFilter {
|
|
518
476
|
Enabled = "enabled",
|
|
519
|
-
Disabled = "disabled"
|
|
520
|
-
Running = "running",
|
|
521
|
-
Stopped = "stopped",
|
|
522
|
-
Paused = "paused"
|
|
477
|
+
Disabled = "disabled"
|
|
523
478
|
}
|
|
524
479
|
/**
|
|
525
480
|
* @public
|
|
@@ -576,20 +531,20 @@ export type AddAgentInfoResponse = unknown;
|
|
|
576
531
|
/**
|
|
577
532
|
* @public
|
|
578
533
|
*/
|
|
579
|
-
export interface
|
|
534
|
+
export interface PeerMetaInfoRequest {
|
|
580
535
|
url: string;
|
|
581
536
|
dna_hashes?: DnaHash[];
|
|
582
537
|
}
|
|
583
538
|
/**
|
|
584
539
|
* @public
|
|
585
540
|
*/
|
|
586
|
-
export type
|
|
541
|
+
export type PeerMetaInfoResponse = Record<DnaHashB64, Record<string, PeerMetaInfo>>;
|
|
587
542
|
/**
|
|
588
543
|
* @public
|
|
589
544
|
*/
|
|
590
|
-
export interface
|
|
545
|
+
export interface PeerMetaInfo {
|
|
591
546
|
meta_value: string;
|
|
592
|
-
expires_at:
|
|
547
|
+
expires_at: Timestamp | null;
|
|
593
548
|
}
|
|
594
549
|
/**
|
|
595
550
|
* @public
|
|
@@ -625,7 +580,62 @@ export interface GrantZomeCallCapabilityRequest {
|
|
|
625
580
|
/**
|
|
626
581
|
* @public
|
|
627
582
|
*/
|
|
628
|
-
export type GrantZomeCallCapabilityResponse =
|
|
583
|
+
export type GrantZomeCallCapabilityResponse = ActionHash;
|
|
584
|
+
/**
|
|
585
|
+
* @public
|
|
586
|
+
*/
|
|
587
|
+
export interface RevokeZomeCallCapabilityRequest {
|
|
588
|
+
/**
|
|
589
|
+
* The action hash of the capability to revoke.
|
|
590
|
+
*/
|
|
591
|
+
action_hash: ActionHash;
|
|
592
|
+
/**
|
|
593
|
+
* Cell ID of the cell for which to revoke the capability.
|
|
594
|
+
*/
|
|
595
|
+
cell_id: CellId;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* @public
|
|
599
|
+
*/
|
|
600
|
+
export type RevokeZomeCallCapabilityResponse = void;
|
|
601
|
+
/**
|
|
602
|
+
* @public
|
|
603
|
+
*/
|
|
604
|
+
export interface ListCapabilityGrantsRequest {
|
|
605
|
+
/**
|
|
606
|
+
* The app id for which to list the capability grants.
|
|
607
|
+
*/
|
|
608
|
+
installed_app_id: InstalledAppId;
|
|
609
|
+
/**
|
|
610
|
+
* Whether to include also revoked grants in the response.
|
|
611
|
+
*/
|
|
612
|
+
include_revoked: boolean;
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* @public
|
|
616
|
+
*/
|
|
617
|
+
export type ListCapabilityGrantsResponse = Array<[CellId, CapGrantInfo[]]>;
|
|
618
|
+
/**
|
|
619
|
+
* @public
|
|
620
|
+
*/
|
|
621
|
+
export interface CapGrantInfo {
|
|
622
|
+
/**
|
|
623
|
+
* The cap grant data.
|
|
624
|
+
*/
|
|
625
|
+
cap_grant: ZomeCallCapGrant;
|
|
626
|
+
/**
|
|
627
|
+
* The action hash of the cap grant.
|
|
628
|
+
*/
|
|
629
|
+
action_hash: ActionHash;
|
|
630
|
+
/**
|
|
631
|
+
* The timestamp when the cap grant was created.
|
|
632
|
+
*/
|
|
633
|
+
created_at: Timestamp;
|
|
634
|
+
/**
|
|
635
|
+
* The timestamp when the cap grant was revoked, if it was revoked.
|
|
636
|
+
*/
|
|
637
|
+
revoked_at?: Timestamp;
|
|
638
|
+
}
|
|
629
639
|
/**
|
|
630
640
|
* @public
|
|
631
641
|
*/
|
|
@@ -634,10 +644,6 @@ export type InstallAppDnaPayload = {
|
|
|
634
644
|
role_name: RoleName;
|
|
635
645
|
membrane_proof?: MembraneProof;
|
|
636
646
|
};
|
|
637
|
-
/**
|
|
638
|
-
* @public
|
|
639
|
-
*/
|
|
640
|
-
export type ZomeLocation = Location;
|
|
641
647
|
/**
|
|
642
648
|
* @public
|
|
643
649
|
*/
|
|
@@ -649,9 +655,10 @@ export interface ZomeDependency {
|
|
|
649
655
|
*/
|
|
650
656
|
export type ZomeManifest = {
|
|
651
657
|
name: string;
|
|
658
|
+
path: string;
|
|
652
659
|
hash?: string;
|
|
653
660
|
dependencies?: ZomeDependency[];
|
|
654
|
-
}
|
|
661
|
+
};
|
|
655
662
|
/**
|
|
656
663
|
* @public
|
|
657
664
|
*/
|
|
@@ -680,9 +687,9 @@ export type CoordinatorSource = {
|
|
|
680
687
|
*/
|
|
681
688
|
export type DnaManifest = {
|
|
682
689
|
/**
|
|
683
|
-
*
|
|
690
|
+
* No finalized version yet, hence only "0" is supported.
|
|
684
691
|
*/
|
|
685
|
-
manifest_version:
|
|
692
|
+
manifest_version: "0";
|
|
686
693
|
/**
|
|
687
694
|
* The friendly "name" of a Holochain DNA.
|
|
688
695
|
*/
|
|
@@ -942,7 +949,7 @@ export interface DumpNetworkMetricsRequest {
|
|
|
942
949
|
/**
|
|
943
950
|
* The DNA hash of the app network to dump.
|
|
944
951
|
*/
|
|
945
|
-
|
|
952
|
+
dna_hash?: DnaHash;
|
|
946
953
|
/**
|
|
947
954
|
* Include DHT summary in the response.
|
|
948
955
|
*/
|
|
@@ -1142,7 +1149,6 @@ export interface AdminApi {
|
|
|
1142
1149
|
dumpState: Requester<DumpStateRequest, DumpStateResponse>;
|
|
1143
1150
|
dumpFullState: Requester<DumpFullStateRequest, DumpFullStateResponse>;
|
|
1144
1151
|
generateAgentPubKey: Requester<GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse>;
|
|
1145
|
-
registerDna: Requester<RegisterDnaRequest, RegisterDnaResponse>;
|
|
1146
1152
|
getDnaDefinition: Requester<GetDnaDefinitionRequest, GetDnaDefinitionResponse>;
|
|
1147
1153
|
uninstallApp: Requester<UninstallAppRequest, UninstallAppResponse>;
|
|
1148
1154
|
installApp: Requester<InstallAppRequest, InstallAppResponse>;
|
|
@@ -1152,8 +1158,11 @@ export interface AdminApi {
|
|
|
1152
1158
|
listAppInterfaces: Requester<ListAppInterfacesRequest, ListAppInterfacesResponse>;
|
|
1153
1159
|
agentInfo: Requester<AgentInfoRequest, AgentInfoResponse>;
|
|
1154
1160
|
addAgentInfo: Requester<AddAgentInfoRequest, AddAgentInfoResponse>;
|
|
1161
|
+
peerMetaInfo: Requester<PeerMetaInfoRequest, PeerMetaInfoResponse>;
|
|
1155
1162
|
deleteCloneCell: Requester<DeleteCloneCellRequest, DeleteCloneCellResponse>;
|
|
1156
1163
|
grantZomeCallCapability: Requester<GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse>;
|
|
1164
|
+
revokeZomeCallCapability: Requester<RevokeZomeCallCapabilityRequest, RevokeZomeCallCapabilityResponse>;
|
|
1165
|
+
listCapabilityGrants: Requester<ListCapabilityGrantsRequest, ListCapabilityGrantsResponse>;
|
|
1157
1166
|
storageInfo: Requester<StorageInfoRequest, StorageInfoResponse>;
|
|
1158
1167
|
issueAppAuthenticationToken: Requester<IssueAppAuthenticationTokenRequest, IssueAppAuthenticationTokenResponse>;
|
|
1159
1168
|
dumpNetworkStats: Requester<DumpNetworkStatsRequest, DumpNetworkStatsResponse>;
|
package/lib/api/admin/types.js
CHANGED
|
@@ -48,7 +48,4 @@ export var AppStatusFilter;
|
|
|
48
48
|
(function (AppStatusFilter) {
|
|
49
49
|
AppStatusFilter["Enabled"] = "enabled";
|
|
50
50
|
AppStatusFilter["Disabled"] = "disabled";
|
|
51
|
-
AppStatusFilter["Running"] = "running";
|
|
52
|
-
AppStatusFilter["Stopped"] = "stopped";
|
|
53
|
-
AppStatusFilter["Paused"] = "paused";
|
|
54
51
|
})(AppStatusFilter || (AppStatusFilter = {}));
|
|
@@ -2,7 +2,7 @@ import { CapSecret, GrantedFunctions } from "../../hdk/index.js";
|
|
|
2
2
|
import type { AgentPubKey, CellId } from "../../types.js";
|
|
3
3
|
import { WsClient } from "../client.js";
|
|
4
4
|
import { Requester, Transformer, WebsocketConnectionOptions } from "../common.js";
|
|
5
|
-
import { AddAgentInfoRequest, AddAgentInfoResponse, AdminApi, AgentInfoRequest, AgentInfoResponse,
|
|
5
|
+
import { AddAgentInfoRequest, AddAgentInfoResponse, AdminApi, AgentInfoRequest, AgentInfoResponse, PeerMetaInfoResponse, PeerMetaInfoRequest, AttachAppInterfaceRequest, AttachAppInterfaceResponse, DeleteCloneCellRequest, DeleteCloneCellResponse, DisableAppRequest, DisableAppResponse, DumpFullStateRequest, DumpFullStateResponse, DumpNetworkMetricsRequest, DumpNetworkMetricsResponse, DumpNetworkStatsRequest, DumpNetworkStatsResponse, DumpStateRequest, DumpStateResponse, EnableAppRequest, EnableAppResponse, GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse, GetDnaDefinitionRequest, GetDnaDefinitionResponse, GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse, InstallAppRequest, InstallAppResponse, IssueAppAuthenticationTokenRequest, IssueAppAuthenticationTokenResponse, ListAppInterfacesRequest, ListAppInterfacesResponse, ListAppsRequest, ListAppsResponse, ListCellIdsRequest, ListCellIdsResponse, ListDnasRequest, ListDnasResponse, RevokeZomeCallCapabilityRequest, RevokeZomeCallCapabilityResponse, RevokeAgentKeyRequest, RevokeAgentKeyResponse, StorageInfoRequest, StorageInfoResponse, UninstallAppRequest, UninstallAppResponse, UpdateCoordinatorsRequest, UpdateCoordinatorsResponse, ListCapabilityGrantsRequest, ListCapabilityGrantsResponse } from "./types.js";
|
|
6
6
|
/**
|
|
7
7
|
* A class for interacting with a conductor's Admin API.
|
|
8
8
|
*
|
|
@@ -55,12 +55,6 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
55
55
|
* Generate a new agent pub key.
|
|
56
56
|
*/
|
|
57
57
|
revokeAgentKey: Requester<RevokeAgentKeyRequest, RevokeAgentKeyResponse>;
|
|
58
|
-
/**
|
|
59
|
-
* Register a DNA for later app installation.
|
|
60
|
-
*
|
|
61
|
-
* Stores the given DNA into the Holochain DNA database and returns the hash of it.
|
|
62
|
-
*/
|
|
63
|
-
registerDna: Requester<RegisterDnaRequest, RegisterDnaResponse>;
|
|
64
58
|
/**
|
|
65
59
|
* Get the DNA definition for the specified DNA hash.
|
|
66
60
|
*/
|
|
@@ -102,9 +96,9 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
102
96
|
*/
|
|
103
97
|
addAgentInfo: Requester<AddAgentInfoRequest, AddAgentInfoResponse>;
|
|
104
98
|
/**
|
|
105
|
-
* Request
|
|
99
|
+
* Request peer meta info for a peer.
|
|
106
100
|
*/
|
|
107
|
-
|
|
101
|
+
peerMetaInfo: Requester<PeerMetaInfoRequest, PeerMetaInfoResponse>;
|
|
108
102
|
/**
|
|
109
103
|
* Delete a disabled clone cell.
|
|
110
104
|
*/
|
|
@@ -114,6 +108,15 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
114
108
|
* calls.
|
|
115
109
|
*/
|
|
116
110
|
grantZomeCallCapability: Requester<GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Revoke a zome call capability for an agent, which was previously granted
|
|
113
|
+
* using {@link AdminWebsocket.grantZomeCallCapability}.
|
|
114
|
+
*/
|
|
115
|
+
revokeZomeCallCapability: Requester<RevokeZomeCallCapabilityRequest, RevokeZomeCallCapabilityResponse>;
|
|
116
|
+
/**
|
|
117
|
+
* List all capability grants for all cells.
|
|
118
|
+
*/
|
|
119
|
+
listCapabilityGrants: Requester<ListCapabilityGrantsRequest, ListCapabilityGrantsResponse>;
|
|
117
120
|
storageInfo: Requester<StorageInfoRequest, StorageInfoResponse>;
|
|
118
121
|
issueAppAuthenticationToken: Requester<IssueAppAuthenticationTokenRequest, IssueAppAuthenticationTokenResponse>;
|
|
119
122
|
dumpNetworkStats: Requester<DumpNetworkStatsRequest, DumpNetworkStatsResponse>;
|
|
@@ -71,12 +71,6 @@ export class AdminWebsocket {
|
|
|
71
71
|
* Generate a new agent pub key.
|
|
72
72
|
*/
|
|
73
73
|
revokeAgentKey = this._requester("revoke_agent_key");
|
|
74
|
-
/**
|
|
75
|
-
* Register a DNA for later app installation.
|
|
76
|
-
*
|
|
77
|
-
* Stores the given DNA into the Holochain DNA database and returns the hash of it.
|
|
78
|
-
*/
|
|
79
|
-
registerDna = this._requester("register_dna");
|
|
80
74
|
/**
|
|
81
75
|
* Get the DNA definition for the specified DNA hash.
|
|
82
76
|
*/
|
|
@@ -118,9 +112,9 @@ export class AdminWebsocket {
|
|
|
118
112
|
*/
|
|
119
113
|
addAgentInfo = this._requester("add_agent_info");
|
|
120
114
|
/**
|
|
121
|
-
* Request
|
|
115
|
+
* Request peer meta info for a peer.
|
|
122
116
|
*/
|
|
123
|
-
|
|
117
|
+
peerMetaInfo = this._requester("peer_meta_info");
|
|
124
118
|
/**
|
|
125
119
|
* Delete a disabled clone cell.
|
|
126
120
|
*/
|
|
@@ -130,6 +124,15 @@ export class AdminWebsocket {
|
|
|
130
124
|
* calls.
|
|
131
125
|
*/
|
|
132
126
|
grantZomeCallCapability = this._requester("grant_zome_call_capability");
|
|
127
|
+
/**
|
|
128
|
+
* Revoke a zome call capability for an agent, which was previously granted
|
|
129
|
+
* using {@link AdminWebsocket.grantZomeCallCapability}.
|
|
130
|
+
*/
|
|
131
|
+
revokeZomeCallCapability = this._requester("revoke_zome_call_capability");
|
|
132
|
+
/**
|
|
133
|
+
* List all capability grants for all cells.
|
|
134
|
+
*/
|
|
135
|
+
listCapabilityGrants = this._requester("list_capability_grants");
|
|
133
136
|
storageInfo = this._requester("storage_info");
|
|
134
137
|
issueAppAuthenticationToken = this._requester("issue_app_authentication_token");
|
|
135
138
|
dumpNetworkStats = this._requester("dump_network_stats");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnsubscribeFunction } from "emittery";
|
|
2
2
|
import { AgentPubKey, InstalledAppId, RoleName } from "../../types.js";
|
|
3
|
-
import { AgentInfoRequest, AgentInfoResponse,
|
|
3
|
+
import { AgentInfoRequest, AgentInfoResponse, PeerMetaInfoRequest, PeerMetaInfoResponse, AppInfo, DumpNetworkMetricsRequest, DumpNetworkMetricsResponse, DumpNetworkStatsResponse, MemproofMap } from "../admin/index.js";
|
|
4
4
|
import { WsClient } from "../client.js";
|
|
5
5
|
import { AbandonCountersigningSessionStateRequest, AppClient, AppEvents, AppWebsocketConnectionOptions, CallZomeRequest, CallZomeRequestSigned, CreateCloneCellRequest, DisableCloneCellRequest, EnableCloneCellRequest, GetCountersigningSessionStateRequest, GetCountersigningSessionStateResponse, PublishCountersigningSessionStateRequest, RoleNameCallZomeRequest, SignalCb } from "./types.js";
|
|
6
6
|
/**
|
|
@@ -19,7 +19,7 @@ export declare class AppWebsocket implements AppClient {
|
|
|
19
19
|
cachedAppInfo?: AppInfo | null;
|
|
20
20
|
private readonly appInfoRequester;
|
|
21
21
|
private readonly agentInfoRequester;
|
|
22
|
-
private readonly
|
|
22
|
+
private readonly peerMetaInfoRequester;
|
|
23
23
|
private readonly callZomeRequester;
|
|
24
24
|
private readonly provideMemproofRequester;
|
|
25
25
|
private readonly enableAppRequester;
|
|
@@ -35,7 +35,6 @@ export declare class AppWebsocket implements AppClient {
|
|
|
35
35
|
/**
|
|
36
36
|
* Instance factory for creating an {@link AppWebsocket}.
|
|
37
37
|
*
|
|
38
|
-
* @param token - A token to authenticate the websocket connection. Get a token using AdminWebsocket#issueAppAuthenticationToken.
|
|
39
38
|
* @param options - {@link (WebsocketConnectionOptions:interface)}
|
|
40
39
|
* @returns A new instance of an AppWebsocket.
|
|
41
40
|
*/
|
|
@@ -51,16 +50,18 @@ export declare class AppWebsocket implements AppClient {
|
|
|
51
50
|
* Request the currently known agents of the app.
|
|
52
51
|
*
|
|
53
52
|
* @param req - An array of DNA hashes or null
|
|
53
|
+
* @param timeout - A timeout to override the default.
|
|
54
54
|
* @returns The app's agent infos as JSON string.
|
|
55
55
|
*/
|
|
56
56
|
agentInfo(req: AgentInfoRequest, timeout?: number): Promise<AgentInfoResponse>;
|
|
57
57
|
/**
|
|
58
|
-
* Request
|
|
58
|
+
* Request peer meta info for a peer by Url.
|
|
59
59
|
*
|
|
60
60
|
* @param req - The peer Url of the agent and an optional array of DNA hashes
|
|
61
|
-
* @
|
|
61
|
+
* @param timeout - A timeout to override the default.
|
|
62
|
+
* @returns The meta info stored for this peer URL.
|
|
62
63
|
*/
|
|
63
|
-
|
|
64
|
+
peerMetaInfo(req: PeerMetaInfoRequest, timeout?: number): Promise<PeerMetaInfoResponse>;
|
|
64
65
|
/**
|
|
65
66
|
* Request network stats.
|
|
66
67
|
*
|
|
@@ -106,14 +107,14 @@ export declare class AppWebsocket implements AppClient {
|
|
|
106
107
|
* @param args - Specify the cell to clone.
|
|
107
108
|
* @returns The created clone cell.
|
|
108
109
|
*/
|
|
109
|
-
createCloneCell(args: CreateCloneCellRequest): Promise<ClonedCell>;
|
|
110
|
+
createCloneCell(args: CreateCloneCellRequest): Promise<import("../admin/types.js").ClonedCell>;
|
|
110
111
|
/**
|
|
111
112
|
* Enable a disabled clone cell.
|
|
112
113
|
*
|
|
113
114
|
* @param args - Specify the clone cell to enable.
|
|
114
115
|
* @returns The enabled clone cell.
|
|
115
116
|
*/
|
|
116
|
-
enableCloneCell(args: EnableCloneCellRequest): Promise<ClonedCell>;
|
|
117
|
+
enableCloneCell(args: EnableCloneCellRequest): Promise<import("../admin/types.js").ClonedCell>;
|
|
117
118
|
/**
|
|
118
119
|
* Disable an enabled clone cell.
|
|
119
120
|
*
|
package/lib/api/app/websocket.js
CHANGED
|
@@ -25,7 +25,7 @@ export class AppWebsocket {
|
|
|
25
25
|
cachedAppInfo;
|
|
26
26
|
appInfoRequester;
|
|
27
27
|
agentInfoRequester;
|
|
28
|
-
|
|
28
|
+
peerMetaInfoRequester;
|
|
29
29
|
callZomeRequester;
|
|
30
30
|
provideMemproofRequester;
|
|
31
31
|
enableAppRequester;
|
|
@@ -47,7 +47,7 @@ export class AppWebsocket {
|
|
|
47
47
|
this.cachedAppInfo = appInfo;
|
|
48
48
|
this.appInfoRequester = AppWebsocket.requester(this.client, "app_info", this.defaultTimeout);
|
|
49
49
|
this.agentInfoRequester = AppWebsocket.requester(this.client, "agent_info", this.defaultTimeout);
|
|
50
|
-
this.
|
|
50
|
+
this.peerMetaInfoRequester = AppWebsocket.requester(this.client, "peer_meta_info", this.defaultTimeout);
|
|
51
51
|
this.callZomeRequester = AppWebsocket.requester(this.client, "call_zome", this.defaultTimeout, this.callZomeTransform);
|
|
52
52
|
this.provideMemproofRequester = AppWebsocket.requester(this.client, "provide_memproofs", this.defaultTimeout);
|
|
53
53
|
this.enableAppRequester = AppWebsocket.requester(this.client, "enable_app", this.defaultTimeout);
|
|
@@ -75,7 +75,6 @@ export class AppWebsocket {
|
|
|
75
75
|
/**
|
|
76
76
|
* Instance factory for creating an {@link AppWebsocket}.
|
|
77
77
|
*
|
|
78
|
-
* @param token - A token to authenticate the websocket connection. Get a token using AdminWebsocket#issueAppAuthenticationToken.
|
|
79
78
|
* @param options - {@link (WebsocketConnectionOptions:interface)}
|
|
80
79
|
* @returns A new instance of an AppWebsocket.
|
|
81
80
|
*/
|
|
@@ -117,21 +116,21 @@ export class AppWebsocket {
|
|
|
117
116
|
* Request the currently known agents of the app.
|
|
118
117
|
*
|
|
119
118
|
* @param req - An array of DNA hashes or null
|
|
119
|
+
* @param timeout - A timeout to override the default.
|
|
120
120
|
* @returns The app's agent infos as JSON string.
|
|
121
121
|
*/
|
|
122
122
|
async agentInfo(req, timeout) {
|
|
123
|
-
|
|
124
|
-
return agentInfos;
|
|
123
|
+
return await this.agentInfoRequester(req, timeout);
|
|
125
124
|
}
|
|
126
125
|
/**
|
|
127
|
-
* Request
|
|
126
|
+
* Request peer meta info for a peer by Url.
|
|
128
127
|
*
|
|
129
128
|
* @param req - The peer Url of the agent and an optional array of DNA hashes
|
|
130
|
-
* @
|
|
129
|
+
* @param timeout - A timeout to override the default.
|
|
130
|
+
* @returns The meta info stored for this peer URL.
|
|
131
131
|
*/
|
|
132
|
-
async
|
|
133
|
-
|
|
134
|
-
return agentInfos;
|
|
132
|
+
async peerMetaInfo(req, timeout) {
|
|
133
|
+
return await this.peerMetaInfoRequester(req, timeout);
|
|
135
134
|
}
|
|
136
135
|
/**
|
|
137
136
|
* Request network stats.
|
package/package.json
CHANGED