@holochain/client 0.7.0 → 0.9.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 +18 -16
- package/lib/api/admin/types.js.map +1 -1
- package/lib/api/admin/websocket.d.ts +2 -1
- package/lib/api/admin/websocket.js +2 -1
- package/lib/api/admin/websocket.js.map +1 -1
- package/lib/api/app/types.d.ts +53 -3
- package/lib/api/app/websocket.d.ts +3 -1
- package/lib/api/app/websocket.js +2 -0
- package/lib/api/app/websocket.js.map +1 -1
- package/lib/api/client.d.ts +1 -0
- package/lib/api/common.d.ts +10 -0
- package/lib/api/common.js +22 -0
- package/lib/api/common.js.map +1 -1
- package/package.json +4 -3
package/lib/api/admin/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { AgentPubKey, CellId, DnaHash, DnaProperties, ActionHash, HoloHash, InstalledAppId, InstalledCell, KitsuneAgent, KitsuneSpace, RoleId, Signature } from "../../types.js";
|
|
3
3
|
import { DhtOp, Entry, Action } from "../../hdk/index.js";
|
|
4
4
|
import { Requester } from "../common.js";
|
|
5
|
+
import { ArchiveCloneCellRequest, ArchiveCloneCellResponse } from "../app/types.js";
|
|
5
6
|
export declare type AttachAppInterfaceRequest = {
|
|
6
7
|
port: number;
|
|
7
8
|
};
|
|
@@ -77,8 +78,10 @@ export declare type DumpFullStateResponse = FullStateDump;
|
|
|
77
78
|
export declare type GenerateAgentPubKeyRequest = void;
|
|
78
79
|
export declare type GenerateAgentPubKeyResponse = AgentPubKey;
|
|
79
80
|
export declare type RegisterDnaRequest = {
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
modifiers?: {
|
|
82
|
+
network_seed?: string;
|
|
83
|
+
properties?: DnaProperties;
|
|
84
|
+
};
|
|
82
85
|
} & DnaSource;
|
|
83
86
|
export declare type RegisterDnaResponse = HoloHash;
|
|
84
87
|
export declare type InstallAppRequest = {
|
|
@@ -91,15 +94,6 @@ export declare type UninstallAppRequest = {
|
|
|
91
94
|
installed_app_id: InstalledAppId;
|
|
92
95
|
};
|
|
93
96
|
export declare type UninstallAppResponse = null;
|
|
94
|
-
export declare type CreateCloneCellRequest = {
|
|
95
|
-
properties?: DnaProperties;
|
|
96
|
-
dna_hash: HoloHash;
|
|
97
|
-
agent_key: AgentPubKey;
|
|
98
|
-
installed_app_id: InstalledAppId;
|
|
99
|
-
role_id: RoleId;
|
|
100
|
-
membrane_proof?: MembraneProof;
|
|
101
|
-
};
|
|
102
|
-
export declare type CreateCloneCellResponse = CellId;
|
|
103
97
|
export declare type ResourceBytes = Buffer;
|
|
104
98
|
export declare type ResourceMap = {
|
|
105
99
|
[key: string]: ResourceBytes;
|
|
@@ -133,7 +127,7 @@ export declare type DnaVersionFlexible = {
|
|
|
133
127
|
export declare type AppRoleDnaManifest = {
|
|
134
128
|
location?: Location;
|
|
135
129
|
properties?: DnaProperties;
|
|
136
|
-
|
|
130
|
+
network_seed?: NetworkSeed;
|
|
137
131
|
version?: DnaVersionFlexible;
|
|
138
132
|
};
|
|
139
133
|
export declare type AppRoleManifest = {
|
|
@@ -156,14 +150,14 @@ export declare type AppBundleSource = {
|
|
|
156
150
|
} | {
|
|
157
151
|
path: string;
|
|
158
152
|
};
|
|
159
|
-
export declare type
|
|
153
|
+
export declare type NetworkSeed = string;
|
|
160
154
|
export declare type InstallAppBundleRequest = {
|
|
161
155
|
agent_key: AgentPubKey;
|
|
162
156
|
installed_app_id?: InstalledAppId;
|
|
163
157
|
membrane_proofs: {
|
|
164
158
|
[key: string]: MembraneProof;
|
|
165
159
|
};
|
|
166
|
-
|
|
160
|
+
network_seed?: NetworkSeed;
|
|
167
161
|
} & AppBundleSource;
|
|
168
162
|
export declare type InstallAppBundleResponse = InstalledAppInfo;
|
|
169
163
|
export declare type ListDnasRequest = void;
|
|
@@ -194,6 +188,13 @@ export declare type AddAgentInfoRequest = {
|
|
|
194
188
|
agent_infos: Array<AgentInfoSigned>;
|
|
195
189
|
};
|
|
196
190
|
export declare type AddAgentInfoResponse = any;
|
|
191
|
+
export declare type RestoreCloneCellRequest = ArchiveCloneCellRequest;
|
|
192
|
+
export declare type RestoreCloneCellResponse = ArchiveCloneCellResponse;
|
|
193
|
+
export interface DeleteArchivedCloneCellsRequest {
|
|
194
|
+
app_id: InstalledAppId;
|
|
195
|
+
role_id: RoleId;
|
|
196
|
+
}
|
|
197
|
+
export declare type DeleteArchivedCloneCellsResponse = void;
|
|
197
198
|
export interface AdminApi {
|
|
198
199
|
attachAppInterface: Requester<AttachAppInterfaceRequest, AttachAppInterfaceResponse>;
|
|
199
200
|
activateApp: Requester<ActivateAppRequest, ActivateAppResponse>;
|
|
@@ -207,7 +208,6 @@ export interface AdminApi {
|
|
|
207
208
|
registerDna: Requester<RegisterDnaRequest, RegisterDnaResponse>;
|
|
208
209
|
installApp: Requester<InstallAppRequest, InstallAppResponse>;
|
|
209
210
|
uninstallApp: Requester<UninstallAppRequest, UninstallAppResponse>;
|
|
210
|
-
createCloneCell: Requester<CreateCloneCellRequest, CreateCloneCellResponse>;
|
|
211
211
|
installAppBundle: Requester<InstallAppBundleRequest, InstallAppBundleResponse>;
|
|
212
212
|
listDnas: Requester<ListDnasRequest, ListDnasResponse>;
|
|
213
213
|
listCellIds: Requester<ListCellIdsRequest, ListCellIdsResponse>;
|
|
@@ -216,6 +216,8 @@ export interface AdminApi {
|
|
|
216
216
|
listAppInterfaces: Requester<ListAppInterfacesRequest, ListAppInterfacesResponse>;
|
|
217
217
|
requestAgentInfo: Requester<RequestAgentInfoRequest, RequestAgentInfoResponse>;
|
|
218
218
|
addAgentInfo: Requester<AddAgentInfoRequest, AddAgentInfoResponse>;
|
|
219
|
+
restoreCloneCell: Requester<RestoreCloneCellRequest, RestoreCloneCellResponse>;
|
|
220
|
+
deleteArchivedCloneCells: Requester<DeleteArchivedCloneCellsRequest, DeleteArchivedCloneCellsResponse>;
|
|
219
221
|
}
|
|
220
222
|
export declare type InstallAppDnaPayload = {
|
|
221
223
|
hash: HoloHash;
|
|
@@ -236,7 +238,7 @@ export declare type ZomeManifest = {
|
|
|
236
238
|
export declare type DnaManifest = {
|
|
237
239
|
manifest_version: string;
|
|
238
240
|
name: string;
|
|
239
|
-
|
|
241
|
+
network_seed?: NetworkSeed;
|
|
240
242
|
properties?: DnaProperties;
|
|
241
243
|
zomes: Array<ZomeManifest>;
|
|
242
244
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/admin/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/admin/types.ts"],"names":[],"mappings":"AAmNA,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;AACnB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B"}
|
|
@@ -36,7 +36,6 @@ export declare class AdminWebsocket implements Api.AdminApi {
|
|
|
36
36
|
installApp: Requester<Api.InstallAppRequest, Api.InstallAppResponse>;
|
|
37
37
|
uninstallApp: Requester<Api.UninstallAppRequest, Api.UninstallAppResponse>;
|
|
38
38
|
installAppBundle: Requester<Api.InstallAppBundleRequest, Api.InstallAppBundleResponse>;
|
|
39
|
-
createCloneCell: Requester<Api.CreateCloneCellRequest, Api.CreateCloneCellResponse>;
|
|
40
39
|
listDnas: Requester<Api.ListDnasRequest, Api.ListDnasResponse>;
|
|
41
40
|
listCellIds: Requester<Api.ListCellIdsRequest, Api.ListCellIdsResponse>;
|
|
42
41
|
listActiveApps: Requester<Api.ListActiveAppsRequest, Api.ListActiveAppsResponse>;
|
|
@@ -44,4 +43,6 @@ export declare class AdminWebsocket implements Api.AdminApi {
|
|
|
44
43
|
listAppInterfaces: Requester<Api.ListAppInterfacesRequest, Api.ListAppInterfacesResponse>;
|
|
45
44
|
requestAgentInfo: Requester<Api.RequestAgentInfoRequest, Api.RequestAgentInfoResponse>;
|
|
46
45
|
addAgentInfo: Requester<Api.AddAgentInfoRequest, Api.AddAgentInfoResponse>;
|
|
46
|
+
restoreCloneCell: Requester<Api.RestoreCloneCellRequest, Api.RestoreCloneCellResponse>;
|
|
47
|
+
deleteArchivedCloneCells: Requester<Api.DeleteArchivedCloneCellsRequest, Api.DeleteArchivedCloneCellsResponse>;
|
|
47
48
|
}
|
|
@@ -54,7 +54,6 @@ export class AdminWebsocket {
|
|
|
54
54
|
installApp = this._requester("install_app");
|
|
55
55
|
uninstallApp = this._requester("uninstall_app");
|
|
56
56
|
installAppBundle = this._requester("install_app_bundle");
|
|
57
|
-
createCloneCell = this._requester("create_clone_cell");
|
|
58
57
|
listDnas = this._requester("list_dnas");
|
|
59
58
|
listCellIds = this._requester("list_cell_ids");
|
|
60
59
|
// Deprecated
|
|
@@ -63,6 +62,8 @@ export class AdminWebsocket {
|
|
|
63
62
|
listAppInterfaces = this._requester("list_app_interfaces");
|
|
64
63
|
requestAgentInfo = this._requester("request_agent_info");
|
|
65
64
|
addAgentInfo = this._requester("add_agent_info");
|
|
65
|
+
restoreCloneCell = this._requester("restore_clone_cell");
|
|
66
|
+
deleteArchivedCloneCells = this._requester("delete_archived_clone_cells");
|
|
66
67
|
}
|
|
67
68
|
const listAppsTransform = {
|
|
68
69
|
input: (req) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/api/admin/websocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAe,oBAAoB,EAAa,MAAM,cAAc,CAAC;AAC5E,OAAO,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F,KAAK,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG;IACnB,MAAM,EAAE,CAAC,GAAW,EAAyB,EAAE;QAC7C,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;CACF,CAAC;AAEF,SAAS,qBAAqB,CAAC,aAAkC;IAC/D,QAAQ,aAAa,EAAE;QACrB,KAAK,GAAG,CAAC,eAAe,CAAC,OAAO;YAC9B,OAAO;gBACL,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,KAAK,GAAG,CAAC,eAAe,CAAC,OAAO;YAC9B,OAAO;gBACL,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,KAAK,GAAG,CAAC,eAAe,CAAC,MAAM;YAC7B,OAAO;gBACL,MAAM,EAAE,IAAI;aACb,CAAC;QACJ,KAAK,GAAG,CAAC,eAAe,CAAC,QAAQ;YAC/B,OAAO;gBACL,QAAQ,EAAE,IAAI;aACf,CAAC;QACJ,KAAK,GAAG,CAAC,eAAe,CAAC,OAAO;YAC9B,OAAO;gBACL,OAAO,EAAE,IAAI;aACd,CAAC;KACL;AACH,CAAC"}
|
package/lib/api/app/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CapSecret } from "../../hdk/capabilities.js";
|
|
2
|
-
import { AgentPubKey, CellId, InstalledAppId } from "../../types.js";
|
|
2
|
+
import { AgentPubKey, CellId, DnaProperties, InstalledAppId, InstalledCell, RoleId, Timestamp } from "../../types.js";
|
|
3
3
|
import { Requester } from "../common.js";
|
|
4
|
-
import { InstalledAppInfo } from "../admin/index.js";
|
|
4
|
+
import { InstalledAppInfo, MembraneProof, NetworkSeed } from "../admin/index.js";
|
|
5
5
|
export declare type CallZomeRequestGeneric<Payload> = {
|
|
6
6
|
cap_secret: CapSecret | null;
|
|
7
7
|
cell_id: CellId;
|
|
@@ -10,13 +10,63 @@ export declare type CallZomeRequestGeneric<Payload> = {
|
|
|
10
10
|
payload: Payload;
|
|
11
11
|
provenance: AgentPubKey;
|
|
12
12
|
};
|
|
13
|
-
export declare type CallZomeResponseGeneric<Payload> = Payload;
|
|
14
13
|
export declare type CallZomeRequest = CallZomeRequestGeneric<any>;
|
|
14
|
+
export declare type CallZomeResponseGeneric<Payload> = Payload;
|
|
15
15
|
export declare type CallZomeResponse = CallZomeResponseGeneric<any>;
|
|
16
16
|
export declare type AppInfoRequest = {
|
|
17
17
|
installed_app_id: InstalledAppId;
|
|
18
18
|
};
|
|
19
19
|
export declare type AppInfoResponse = InstalledAppInfo;
|
|
20
|
+
export interface CreateCloneCellRequest {
|
|
21
|
+
/**
|
|
22
|
+
* The app id that the DNA to clone belongs to
|
|
23
|
+
*/
|
|
24
|
+
app_id: InstalledAppId;
|
|
25
|
+
/**
|
|
26
|
+
* The DNA's role id to clone.
|
|
27
|
+
*/
|
|
28
|
+
role_id: RoleId;
|
|
29
|
+
/**
|
|
30
|
+
* Modifiers to set for the new cell.
|
|
31
|
+
* At least one of the modifiers must be set to obtain a distinct hash for
|
|
32
|
+
* the clone cell's DNA.
|
|
33
|
+
*/
|
|
34
|
+
modifiers: {
|
|
35
|
+
/**
|
|
36
|
+
* The network seed of a DNA is included in the computation of the DNA hash.
|
|
37
|
+
* The DNA hash in turn determines the network peers and the DHT, meaning
|
|
38
|
+
* that only peers with the same DNA hash of a shared DNA participate in the
|
|
39
|
+
* same network and co-create the DHT. To create a separate DHT for the DNA,
|
|
40
|
+
* a unique network seed can be specified.
|
|
41
|
+
*/
|
|
42
|
+
network_seed?: NetworkSeed;
|
|
43
|
+
/**
|
|
44
|
+
* Any arbitrary application properties can be included in this object to
|
|
45
|
+
* override the DNA properties.
|
|
46
|
+
*/
|
|
47
|
+
properties?: DnaProperties;
|
|
48
|
+
/**
|
|
49
|
+
* The time used to denote the origin of the network, used to calculate
|
|
50
|
+
* time windows during gossip.
|
|
51
|
+
* All Action timestamps must come after this time.
|
|
52
|
+
*/
|
|
53
|
+
origin_time?: Timestamp;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Optionally set a proof of membership for the new cell.
|
|
57
|
+
*/
|
|
58
|
+
membrane_proof?: MembraneProof;
|
|
59
|
+
/**
|
|
60
|
+
* Optionally a name for the DNA clone.
|
|
61
|
+
*/
|
|
62
|
+
name?: string;
|
|
63
|
+
}
|
|
64
|
+
export declare type CreateCloneCellResponse = InstalledCell;
|
|
65
|
+
export interface ArchiveCloneCellRequest {
|
|
66
|
+
app_id: InstalledAppId;
|
|
67
|
+
clone_cell_id: RoleId | CellId;
|
|
68
|
+
}
|
|
69
|
+
export declare type ArchiveCloneCellResponse = void;
|
|
20
70
|
export declare type AppSignal = {
|
|
21
71
|
type: string;
|
|
22
72
|
data: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InstalledAppId } from "../../types.js";
|
|
2
2
|
import { WsClient } from "../client.js";
|
|
3
3
|
import { Requester, Transformer } from "../common.js";
|
|
4
|
-
import { AppApi, AppInfoRequest, AppInfoResponse, AppSignalCb, CallZomeRequestGeneric, CallZomeResponseGeneric } from "./types.js";
|
|
4
|
+
import { AppApi, AppInfoRequest, AppInfoResponse, AppSignalCb, CallZomeRequestGeneric, CallZomeResponseGeneric, ArchiveCloneCellRequest, CreateCloneCellRequest, CreateCloneCellResponse, ArchiveCloneCellResponse } from "./types.js";
|
|
5
5
|
export declare class AppWebsocket implements AppApi {
|
|
6
6
|
client: WsClient;
|
|
7
7
|
defaultTimeout: number;
|
|
@@ -11,4 +11,6 @@ export declare class AppWebsocket implements AppApi {
|
|
|
11
11
|
_requester: <ReqO, ReqI, ResI, ResO>(tag: string, transformer?: Transformer<ReqO, ReqI, ResI, ResO> | undefined) => (req: ReqO, timeout?: number | undefined) => Promise<ResO>;
|
|
12
12
|
appInfo: Requester<AppInfoRequest, AppInfoResponse>;
|
|
13
13
|
callZome: Requester<CallZomeRequestGeneric<any>, CallZomeResponseGeneric<any>>;
|
|
14
|
+
createCloneCell: Requester<CreateCloneCellRequest, CreateCloneCellResponse>;
|
|
15
|
+
archiveCloneCell: Requester<ArchiveCloneCellRequest, ArchiveCloneCellResponse>;
|
|
14
16
|
}
|
package/lib/api/app/websocket.js
CHANGED
|
@@ -41,6 +41,8 @@ export class AppWebsocket {
|
|
|
41
41
|
_requester = (tag, transformer) => requesterTransformer((req, timeout) => promiseTimeout(this.client.request(req), tag, timeout || this.defaultTimeout).then(catchError), tag, transformer);
|
|
42
42
|
appInfo = this._requester("app_info", appInfoTransform(this));
|
|
43
43
|
callZome = this._requester("zome_call", callZomeTransform);
|
|
44
|
+
createCloneCell = this._requester("create_clone_cell");
|
|
45
|
+
archiveCloneCell = this._requester("archive_clone_cell");
|
|
44
46
|
}
|
|
45
47
|
const callZomeTransform = {
|
|
46
48
|
input: (req) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/api/app/websocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,UAAU,EACV,eAAe,EACf,cAAc,EAEd,oBAAoB,GAErB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../../src/api/app/websocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,UAAU,EACV,eAAe,EACf,cAAc,EAEd,oBAAoB,GAErB,MAAM,cAAc,CAAC;AActB,MAAM,OAAO,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AAC;IAEpD,eAAe,GACb,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAEvC,gBAAgB,GAGZ,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;CAC3C;AAED,MAAM,iBAAiB,GAKnB;IACF,KAAK,EAAE,CACL,GAAgC,EACI,EAAE;QACtC,OAAO;YACL,GAAG,GAAG;YACN,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;SAC7B,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,CACN,GAAwC,EACV,EAAE;QAChC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,CACvB,KAAmB,EAMnB,EAAE,CAAC,CAAC;IACJ,KAAK,EAAE,CAAC,GAAmB,EAAkB,EAAE;QAC7C,IAAI,KAAK,CAAC,sBAAsB,EAAE;YAChC,OAAO;gBACL,gBAAgB,EAAE,KAAK,CAAC,sBAAsB;aAC/C,CAAC;SACH;QAED,OAAO,GAAG,CAAC;IACb,CAAC;IACD,MAAM,EAAE,CAAC,GAAoB,EAAmB,EAAE;QAChD,OAAO,GAAG,CAAC;IACb,CAAC;CACF,CAAC,CAAC"}
|
package/lib/api/client.d.ts
CHANGED
package/lib/api/common.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RoleId } from "../types.js";
|
|
1
2
|
export declare const DEFAULT_TIMEOUT = 15000;
|
|
2
3
|
export declare type Transformer<ReqO, ReqI, ResI, ResO> = {
|
|
3
4
|
input: (req: ReqO) => ReqI;
|
|
@@ -17,3 +18,12 @@ export declare type Tagged<T> = {
|
|
|
17
18
|
export declare const requesterTransformer: <ReqO, ReqI, ResI, ResO>(requester: Requester<Tagged<ReqI>, Tagged<ResI>>, tag: string, transform?: Transformer<ReqO, ReqI, ResI, ResO>) => (req: ReqO, timeout?: number) => Promise<ResO>;
|
|
18
19
|
export declare const catchError: (res: any) => Promise<any>;
|
|
19
20
|
export declare const promiseTimeout: (promise: Promise<any>, tag: string, ms: number) => Promise<unknown>;
|
|
21
|
+
export declare class CloneId {
|
|
22
|
+
private static readonly CLONE_ID_DELIMITER;
|
|
23
|
+
private readonly roleId;
|
|
24
|
+
private readonly index;
|
|
25
|
+
constructor(roleId: RoleId, index: number);
|
|
26
|
+
static fromRoleId(roleId: RoleId): CloneId;
|
|
27
|
+
toString(): string;
|
|
28
|
+
getBaseRoleId(): string;
|
|
29
|
+
}
|
package/lib/api/common.js
CHANGED
|
@@ -38,4 +38,26 @@ export const promiseTimeout = (promise, tag, ms) => {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
+
export class CloneId {
|
|
42
|
+
static CLONE_ID_DELIMITER = ".";
|
|
43
|
+
roleId;
|
|
44
|
+
index;
|
|
45
|
+
constructor(roleId, index) {
|
|
46
|
+
this.roleId = roleId;
|
|
47
|
+
this.index = index;
|
|
48
|
+
}
|
|
49
|
+
static fromRoleId(roleId) {
|
|
50
|
+
const parts = roleId.split(CloneId.CLONE_ID_DELIMITER);
|
|
51
|
+
if (parts.length !== 2) {
|
|
52
|
+
throw new Error("Malformed clone id: must consist of {role id.clone index}");
|
|
53
|
+
}
|
|
54
|
+
return new CloneId(parts[0], parseInt(parts[1]));
|
|
55
|
+
}
|
|
56
|
+
toString() {
|
|
57
|
+
return `${this.roleId}${CloneId.CLONE_ID_DELIMITER}${this.index}`;
|
|
58
|
+
}
|
|
59
|
+
getBaseRoleId() {
|
|
60
|
+
return this.roleId;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
41
63
|
//# sourceMappingURL=common.js.map
|
package/lib/api/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/api/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/api/common.ts"],"names":[],"mappings":"AAEA,MAAM,UAA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AED,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holochain/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "A JavaScript client for the Holochain Conductor API",
|
|
5
5
|
"author": "Holochain Foundation <info@holochain.org> (http://holochain.org)",
|
|
6
6
|
"license": "CAL-1.0",
|
|
@@ -41,12 +41,13 @@
|
|
|
41
41
|
"eslint-config-prettier": "^8.5.0",
|
|
42
42
|
"eslint-plugin-prettier": "^4.0.0",
|
|
43
43
|
"eslint-plugin-tsdoc": "^0.2.16",
|
|
44
|
-
"isomorphic-ws": "^
|
|
44
|
+
"isomorphic-ws": "^5.0.0",
|
|
45
45
|
"prettier": "^2.6.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/js-yaml": "^3.12.7",
|
|
49
49
|
"@types/tape": "^4.13.2",
|
|
50
|
+
"@types/ws": "^8.5.3",
|
|
50
51
|
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
51
52
|
"@typescript-eslint/parser": "^5.27.0",
|
|
52
53
|
"eslint": "^8.16.0",
|
|
@@ -56,4 +57,4 @@
|
|
|
56
57
|
"ts-node": "^10.8.1",
|
|
57
58
|
"typescript": "^4.7.2"
|
|
58
59
|
}
|
|
59
|
-
}
|
|
60
|
+
}
|