@holochain/client 0.20.0-dev.0 → 0.20.0-dev.2
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 +87 -39
- package/lib/api/admin/types.js +0 -3
- package/lib/api/admin/websocket.d.ts +14 -7
- package/lib/api/admin/websocket.js +13 -6
- package/lib/api/app/websocket.d.ts +13 -4
- package/lib/api/app/websocket.js +14 -3
- package/lib/api/client.d.ts +1 -1
- package/lib/api/client.js +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- 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
|
|
@@ -516,10 +492,7 @@ export type ListActiveAppsResponse = Array<InstalledAppId>;
|
|
|
516
492
|
*/
|
|
517
493
|
export declare enum AppStatusFilter {
|
|
518
494
|
Enabled = "enabled",
|
|
519
|
-
Disabled = "disabled"
|
|
520
|
-
Running = "running",
|
|
521
|
-
Stopped = "stopped",
|
|
522
|
-
Paused = "paused"
|
|
495
|
+
Disabled = "disabled"
|
|
523
496
|
}
|
|
524
497
|
/**
|
|
525
498
|
* @public
|
|
@@ -573,6 +546,24 @@ export type AddAgentInfoRequest = {
|
|
|
573
546
|
* @public
|
|
574
547
|
*/
|
|
575
548
|
export type AddAgentInfoResponse = unknown;
|
|
549
|
+
/**
|
|
550
|
+
* @public
|
|
551
|
+
*/
|
|
552
|
+
export interface PeerMetaInfoRequest {
|
|
553
|
+
url: string;
|
|
554
|
+
dna_hashes?: DnaHash[];
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* @public
|
|
558
|
+
*/
|
|
559
|
+
export type PeerMetaInfoResponse = Record<DnaHashB64, Record<string, PeerMetaInfo>>;
|
|
560
|
+
/**
|
|
561
|
+
* @public
|
|
562
|
+
*/
|
|
563
|
+
export interface PeerMetaInfo {
|
|
564
|
+
meta_value: string;
|
|
565
|
+
expires_at: Timestamp | null;
|
|
566
|
+
}
|
|
576
567
|
/**
|
|
577
568
|
* @public
|
|
578
569
|
*/
|
|
@@ -607,7 +598,62 @@ export interface GrantZomeCallCapabilityRequest {
|
|
|
607
598
|
/**
|
|
608
599
|
* @public
|
|
609
600
|
*/
|
|
610
|
-
export type GrantZomeCallCapabilityResponse =
|
|
601
|
+
export type GrantZomeCallCapabilityResponse = ActionHash;
|
|
602
|
+
/**
|
|
603
|
+
* @public
|
|
604
|
+
*/
|
|
605
|
+
export interface RevokeZomeCallCapabilityRequest {
|
|
606
|
+
/**
|
|
607
|
+
* The action hash of the capability to revoke.
|
|
608
|
+
*/
|
|
609
|
+
action_hash: ActionHash;
|
|
610
|
+
/**
|
|
611
|
+
* Cell ID of the cell for which to revoke the capability.
|
|
612
|
+
*/
|
|
613
|
+
cell_id: CellId;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* @public
|
|
617
|
+
*/
|
|
618
|
+
export type RevokeZomeCallCapabilityResponse = void;
|
|
619
|
+
/**
|
|
620
|
+
* @public
|
|
621
|
+
*/
|
|
622
|
+
export interface ListCapabilityGrantsRequest {
|
|
623
|
+
/**
|
|
624
|
+
* The app id for which to list the capability grants.
|
|
625
|
+
*/
|
|
626
|
+
installed_app_id: InstalledAppId;
|
|
627
|
+
/**
|
|
628
|
+
* Whether to include also revoked grants in the response.
|
|
629
|
+
*/
|
|
630
|
+
include_revoked: boolean;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* @public
|
|
634
|
+
*/
|
|
635
|
+
export type ListCapabilityGrantsResponse = Array<[CellId, CapGrantInfo[]]>;
|
|
636
|
+
/**
|
|
637
|
+
* @public
|
|
638
|
+
*/
|
|
639
|
+
export interface CapGrantInfo {
|
|
640
|
+
/**
|
|
641
|
+
* The cap grant data.
|
|
642
|
+
*/
|
|
643
|
+
cap_grant: ZomeCallCapGrant;
|
|
644
|
+
/**
|
|
645
|
+
* The action hash of the cap grant.
|
|
646
|
+
*/
|
|
647
|
+
action_hash: ActionHash;
|
|
648
|
+
/**
|
|
649
|
+
* The timestamp when the cap grant was created.
|
|
650
|
+
*/
|
|
651
|
+
created_at: Timestamp;
|
|
652
|
+
/**
|
|
653
|
+
* The timestamp when the cap grant was revoked, if it was revoked.
|
|
654
|
+
*/
|
|
655
|
+
revoked_at?: Timestamp;
|
|
656
|
+
}
|
|
611
657
|
/**
|
|
612
658
|
* @public
|
|
613
659
|
*/
|
|
@@ -924,7 +970,7 @@ export interface DumpNetworkMetricsRequest {
|
|
|
924
970
|
/**
|
|
925
971
|
* The DNA hash of the app network to dump.
|
|
926
972
|
*/
|
|
927
|
-
|
|
973
|
+
dna_hash?: DnaHash;
|
|
928
974
|
/**
|
|
929
975
|
* Include DHT summary in the response.
|
|
930
976
|
*/
|
|
@@ -1124,7 +1170,6 @@ export interface AdminApi {
|
|
|
1124
1170
|
dumpState: Requester<DumpStateRequest, DumpStateResponse>;
|
|
1125
1171
|
dumpFullState: Requester<DumpFullStateRequest, DumpFullStateResponse>;
|
|
1126
1172
|
generateAgentPubKey: Requester<GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse>;
|
|
1127
|
-
registerDna: Requester<RegisterDnaRequest, RegisterDnaResponse>;
|
|
1128
1173
|
getDnaDefinition: Requester<GetDnaDefinitionRequest, GetDnaDefinitionResponse>;
|
|
1129
1174
|
uninstallApp: Requester<UninstallAppRequest, UninstallAppResponse>;
|
|
1130
1175
|
installApp: Requester<InstallAppRequest, InstallAppResponse>;
|
|
@@ -1134,8 +1179,11 @@ export interface AdminApi {
|
|
|
1134
1179
|
listAppInterfaces: Requester<ListAppInterfacesRequest, ListAppInterfacesResponse>;
|
|
1135
1180
|
agentInfo: Requester<AgentInfoRequest, AgentInfoResponse>;
|
|
1136
1181
|
addAgentInfo: Requester<AddAgentInfoRequest, AddAgentInfoResponse>;
|
|
1182
|
+
peerMetaInfo: Requester<PeerMetaInfoRequest, PeerMetaInfoResponse>;
|
|
1137
1183
|
deleteCloneCell: Requester<DeleteCloneCellRequest, DeleteCloneCellResponse>;
|
|
1138
1184
|
grantZomeCallCapability: Requester<GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse>;
|
|
1185
|
+
revokeZomeCallCapability: Requester<RevokeZomeCallCapabilityRequest, RevokeZomeCallCapabilityResponse>;
|
|
1186
|
+
listCapabilityGrants: Requester<ListCapabilityGrantsRequest, ListCapabilityGrantsResponse>;
|
|
1139
1187
|
storageInfo: Requester<StorageInfoRequest, StorageInfoResponse>;
|
|
1140
1188
|
issueAppAuthenticationToken: Requester<IssueAppAuthenticationTokenRequest, IssueAppAuthenticationTokenResponse>;
|
|
1141
1189
|
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, 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,
|
|
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
|
*/
|
|
@@ -101,6 +95,10 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
101
95
|
* Add an existing agent to Holochain.
|
|
102
96
|
*/
|
|
103
97
|
addAgentInfo: Requester<AddAgentInfoRequest, AddAgentInfoResponse>;
|
|
98
|
+
/**
|
|
99
|
+
* Request peer meta info for a peer.
|
|
100
|
+
*/
|
|
101
|
+
peerMetaInfo: Requester<PeerMetaInfoRequest, PeerMetaInfoResponse>;
|
|
104
102
|
/**
|
|
105
103
|
* Delete a disabled clone cell.
|
|
106
104
|
*/
|
|
@@ -110,6 +108,15 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
110
108
|
* calls.
|
|
111
109
|
*/
|
|
112
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>;
|
|
113
120
|
storageInfo: Requester<StorageInfoRequest, StorageInfoResponse>;
|
|
114
121
|
issueAppAuthenticationToken: Requester<IssueAppAuthenticationTokenRequest, IssueAppAuthenticationTokenResponse>;
|
|
115
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
|
*/
|
|
@@ -117,6 +111,10 @@ export class AdminWebsocket {
|
|
|
117
111
|
* Add an existing agent to Holochain.
|
|
118
112
|
*/
|
|
119
113
|
addAgentInfo = this._requester("add_agent_info");
|
|
114
|
+
/**
|
|
115
|
+
* Request peer meta info for a peer.
|
|
116
|
+
*/
|
|
117
|
+
peerMetaInfo = this._requester("peer_meta_info");
|
|
120
118
|
/**
|
|
121
119
|
* Delete a disabled clone cell.
|
|
122
120
|
*/
|
|
@@ -126,6 +124,15 @@ export class AdminWebsocket {
|
|
|
126
124
|
* calls.
|
|
127
125
|
*/
|
|
128
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");
|
|
129
136
|
storageInfo = this._requester("storage_info");
|
|
130
137
|
issueAppAuthenticationToken = this._requester("issue_app_authentication_token");
|
|
131
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,6 +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 peerMetaInfoRequester;
|
|
22
23
|
private readonly callZomeRequester;
|
|
23
24
|
private readonly provideMemproofRequester;
|
|
24
25
|
private readonly enableAppRequester;
|
|
@@ -34,7 +35,6 @@ export declare class AppWebsocket implements AppClient {
|
|
|
34
35
|
/**
|
|
35
36
|
* Instance factory for creating an {@link AppWebsocket}.
|
|
36
37
|
*
|
|
37
|
-
* @param token - A token to authenticate the websocket connection. Get a token using AdminWebsocket#issueAppAuthenticationToken.
|
|
38
38
|
* @param options - {@link (WebsocketConnectionOptions:interface)}
|
|
39
39
|
* @returns A new instance of an AppWebsocket.
|
|
40
40
|
*/
|
|
@@ -50,9 +50,18 @@ export declare class AppWebsocket implements AppClient {
|
|
|
50
50
|
* Request the currently known agents of the app.
|
|
51
51
|
*
|
|
52
52
|
* @param req - An array of DNA hashes or null
|
|
53
|
+
* @param timeout - A timeout to override the default.
|
|
53
54
|
* @returns The app's agent infos as JSON string.
|
|
54
55
|
*/
|
|
55
56
|
agentInfo(req: AgentInfoRequest, timeout?: number): Promise<AgentInfoResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Request peer meta info for a peer by Url.
|
|
59
|
+
*
|
|
60
|
+
* @param req - The peer Url of the agent and an optional array of DNA hashes
|
|
61
|
+
* @param timeout - A timeout to override the default.
|
|
62
|
+
* @returns The meta info stored for this peer URL.
|
|
63
|
+
*/
|
|
64
|
+
peerMetaInfo(req: PeerMetaInfoRequest, timeout?: number): Promise<PeerMetaInfoResponse>;
|
|
56
65
|
/**
|
|
57
66
|
* Request network stats.
|
|
58
67
|
*
|
|
@@ -98,14 +107,14 @@ export declare class AppWebsocket implements AppClient {
|
|
|
98
107
|
* @param args - Specify the cell to clone.
|
|
99
108
|
* @returns The created clone cell.
|
|
100
109
|
*/
|
|
101
|
-
createCloneCell(args: CreateCloneCellRequest): Promise<ClonedCell>;
|
|
110
|
+
createCloneCell(args: CreateCloneCellRequest): Promise<import("../admin/types.js").ClonedCell>;
|
|
102
111
|
/**
|
|
103
112
|
* Enable a disabled clone cell.
|
|
104
113
|
*
|
|
105
114
|
* @param args - Specify the clone cell to enable.
|
|
106
115
|
* @returns The enabled clone cell.
|
|
107
116
|
*/
|
|
108
|
-
enableCloneCell(args: EnableCloneCellRequest): Promise<ClonedCell>;
|
|
117
|
+
enableCloneCell(args: EnableCloneCellRequest): Promise<import("../admin/types.js").ClonedCell>;
|
|
109
118
|
/**
|
|
110
119
|
* Disable an enabled clone cell.
|
|
111
120
|
*
|
package/lib/api/app/websocket.js
CHANGED
|
@@ -25,6 +25,7 @@ export class AppWebsocket {
|
|
|
25
25
|
cachedAppInfo;
|
|
26
26
|
appInfoRequester;
|
|
27
27
|
agentInfoRequester;
|
|
28
|
+
peerMetaInfoRequester;
|
|
28
29
|
callZomeRequester;
|
|
29
30
|
provideMemproofRequester;
|
|
30
31
|
enableAppRequester;
|
|
@@ -46,6 +47,7 @@ export class AppWebsocket {
|
|
|
46
47
|
this.cachedAppInfo = appInfo;
|
|
47
48
|
this.appInfoRequester = AppWebsocket.requester(this.client, "app_info", this.defaultTimeout);
|
|
48
49
|
this.agentInfoRequester = AppWebsocket.requester(this.client, "agent_info", this.defaultTimeout);
|
|
50
|
+
this.peerMetaInfoRequester = AppWebsocket.requester(this.client, "peer_meta_info", this.defaultTimeout);
|
|
49
51
|
this.callZomeRequester = AppWebsocket.requester(this.client, "call_zome", this.defaultTimeout, this.callZomeTransform);
|
|
50
52
|
this.provideMemproofRequester = AppWebsocket.requester(this.client, "provide_memproofs", this.defaultTimeout);
|
|
51
53
|
this.enableAppRequester = AppWebsocket.requester(this.client, "enable_app", this.defaultTimeout);
|
|
@@ -73,7 +75,6 @@ export class AppWebsocket {
|
|
|
73
75
|
/**
|
|
74
76
|
* Instance factory for creating an {@link AppWebsocket}.
|
|
75
77
|
*
|
|
76
|
-
* @param token - A token to authenticate the websocket connection. Get a token using AdminWebsocket#issueAppAuthenticationToken.
|
|
77
78
|
* @param options - {@link (WebsocketConnectionOptions:interface)}
|
|
78
79
|
* @returns A new instance of an AppWebsocket.
|
|
79
80
|
*/
|
|
@@ -115,11 +116,21 @@ export class AppWebsocket {
|
|
|
115
116
|
* Request the currently known agents of the app.
|
|
116
117
|
*
|
|
117
118
|
* @param req - An array of DNA hashes or null
|
|
119
|
+
* @param timeout - A timeout to override the default.
|
|
118
120
|
* @returns The app's agent infos as JSON string.
|
|
119
121
|
*/
|
|
120
122
|
async agentInfo(req, timeout) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
return await this.agentInfoRequester(req, timeout);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Request peer meta info for a peer by Url.
|
|
127
|
+
*
|
|
128
|
+
* @param req - The peer Url of the agent and an optional array of DNA hashes
|
|
129
|
+
* @param timeout - A timeout to override the default.
|
|
130
|
+
* @returns The meta info stored for this peer URL.
|
|
131
|
+
*/
|
|
132
|
+
async peerMetaInfo(req, timeout) {
|
|
133
|
+
return await this.peerMetaInfoRequester(req, timeout);
|
|
123
134
|
}
|
|
124
135
|
/**
|
|
125
136
|
* Request network stats.
|
package/lib/api/client.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface AppAuthenticationRequest {
|
|
|
20
20
|
export declare class WsClient extends Emittery {
|
|
21
21
|
socket: IsoWebSocket;
|
|
22
22
|
url: URL | undefined;
|
|
23
|
-
options: WsClientOptions;
|
|
23
|
+
options: WsClientOptions | undefined;
|
|
24
24
|
private pendingRequests;
|
|
25
25
|
private index;
|
|
26
26
|
private authenticationToken;
|
package/lib/api/client.js
CHANGED
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED