@holochain/client 0.12.4 → 0.12.6
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 +73 -73
- package/lib/api/app/types.d.ts +15 -15
- package/lib/api/app/websocket.js +9 -5
- package/lib/api/app-agent/types.d.ts +7 -7
- package/lib/api/client.js +3 -3
- package/lib/api/common.d.ts +4 -4
- package/lib/api/zome-call-signing.d.ts +1 -1
- package/lib/environments/launcher.d.ts +6 -0
- package/lib/environments/launcher.js +2 -0
- package/lib/hdk/action.d.ts +3 -3
- package/lib/hdk/capabilities.d.ts +4 -4
- 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/record.d.ts +2 -2
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types.d.ts +23 -23
- package/package.json +1 -1
package/lib/api/admin/types.d.ts
CHANGED
|
@@ -6,32 +6,32 @@ import { DisableCloneCellRequest } from "../index.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type AttachAppInterfaceRequest = {
|
|
10
10
|
port: number;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type AttachAppInterfaceResponse = {
|
|
16
16
|
port: number;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type EnableAppRequest = {
|
|
22
22
|
installed_app_id: InstalledAppId;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* @public
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export type EnableAppResponse = {
|
|
28
28
|
app: AppInfo;
|
|
29
29
|
errors: Array<[CellId, string]>;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type DeactivationReason = {
|
|
35
35
|
never_activated: null;
|
|
36
36
|
} | {
|
|
37
37
|
normal: null;
|
|
@@ -43,13 +43,13 @@ export declare type DeactivationReason = {
|
|
|
43
43
|
/**
|
|
44
44
|
* @public
|
|
45
45
|
*/
|
|
46
|
-
export
|
|
46
|
+
export type PausedAppReason = {
|
|
47
47
|
error: string;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* @public
|
|
51
51
|
*/
|
|
52
|
-
export
|
|
52
|
+
export type DisabledAppReason = {
|
|
53
53
|
never_started: null;
|
|
54
54
|
} | {
|
|
55
55
|
user: null;
|
|
@@ -59,7 +59,7 @@ export declare type DisabledAppReason = {
|
|
|
59
59
|
/**
|
|
60
60
|
* @public
|
|
61
61
|
*/
|
|
62
|
-
export
|
|
62
|
+
export type InstalledAppInfoStatus = {
|
|
63
63
|
paused: {
|
|
64
64
|
reason: PausedAppReason;
|
|
65
65
|
};
|
|
@@ -108,7 +108,7 @@ export declare enum CellType {
|
|
|
108
108
|
/**
|
|
109
109
|
* @public
|
|
110
110
|
*/
|
|
111
|
-
export
|
|
111
|
+
export type CellInfo = {
|
|
112
112
|
[CellType.Provisioned]: ProvisionedCell;
|
|
113
113
|
} | {
|
|
114
114
|
[CellType.Cloned]: ClonedCell;
|
|
@@ -118,7 +118,7 @@ export declare type CellInfo = {
|
|
|
118
118
|
/**
|
|
119
119
|
* @public
|
|
120
120
|
*/
|
|
121
|
-
export
|
|
121
|
+
export type AppInfo = {
|
|
122
122
|
agent_pub_key: AgentPubKey;
|
|
123
123
|
installed_app_id: InstalledAppId;
|
|
124
124
|
cell_info: Record<RoleName, Array<CellInfo>>;
|
|
@@ -127,60 +127,60 @@ export declare type AppInfo = {
|
|
|
127
127
|
/**
|
|
128
128
|
* @public
|
|
129
129
|
*/
|
|
130
|
-
export
|
|
130
|
+
export type MembraneProof = Buffer;
|
|
131
131
|
/**
|
|
132
132
|
* @public
|
|
133
133
|
*/
|
|
134
|
-
export
|
|
134
|
+
export type DisableAppRequest = {
|
|
135
135
|
installed_app_id: InstalledAppId;
|
|
136
136
|
};
|
|
137
137
|
/**
|
|
138
138
|
* @public
|
|
139
139
|
*/
|
|
140
|
-
export
|
|
140
|
+
export type DisableAppResponse = null;
|
|
141
141
|
/**
|
|
142
142
|
* @public
|
|
143
143
|
*/
|
|
144
|
-
export
|
|
144
|
+
export type StartAppRequest = {
|
|
145
145
|
installed_app_id: InstalledAppId;
|
|
146
146
|
};
|
|
147
147
|
/**
|
|
148
148
|
* @public
|
|
149
149
|
*/
|
|
150
|
-
export
|
|
150
|
+
export type StartAppResponse = boolean;
|
|
151
151
|
/**
|
|
152
152
|
* @public
|
|
153
153
|
*/
|
|
154
|
-
export
|
|
154
|
+
export type DumpStateRequest = {
|
|
155
155
|
cell_id: CellId;
|
|
156
156
|
};
|
|
157
157
|
/**
|
|
158
158
|
* @public
|
|
159
159
|
*/
|
|
160
|
-
export
|
|
160
|
+
export type DumpStateResponse = any;
|
|
161
161
|
/**
|
|
162
162
|
* @public
|
|
163
163
|
*/
|
|
164
|
-
export
|
|
164
|
+
export type DumpFullStateRequest = {
|
|
165
165
|
cell_id: CellId;
|
|
166
166
|
dht_ops_cursor: number | undefined;
|
|
167
167
|
};
|
|
168
168
|
/**
|
|
169
169
|
* @public
|
|
170
170
|
*/
|
|
171
|
-
export
|
|
171
|
+
export type DumpFullStateResponse = FullStateDump;
|
|
172
172
|
/**
|
|
173
173
|
* @public
|
|
174
174
|
*/
|
|
175
|
-
export
|
|
175
|
+
export type GenerateAgentPubKeyRequest = void;
|
|
176
176
|
/**
|
|
177
177
|
* @public
|
|
178
178
|
*/
|
|
179
|
-
export
|
|
179
|
+
export type GenerateAgentPubKeyResponse = AgentPubKey;
|
|
180
180
|
/**
|
|
181
181
|
* @public
|
|
182
182
|
*/
|
|
183
|
-
export
|
|
183
|
+
export type RegisterDnaRequest = {
|
|
184
184
|
modifiers?: {
|
|
185
185
|
network_seed?: string;
|
|
186
186
|
properties?: DnaProperties;
|
|
@@ -189,11 +189,11 @@ export declare type RegisterDnaRequest = {
|
|
|
189
189
|
/**
|
|
190
190
|
* @public
|
|
191
191
|
*/
|
|
192
|
-
export
|
|
192
|
+
export type RegisterDnaResponse = HoloHash;
|
|
193
193
|
/**
|
|
194
194
|
* @public
|
|
195
195
|
*/
|
|
196
|
-
export
|
|
196
|
+
export type DnaModifiers = {
|
|
197
197
|
network_seed: NetworkSeed;
|
|
198
198
|
properties: DnaProperties;
|
|
199
199
|
origin_time: Timestamp;
|
|
@@ -202,15 +202,15 @@ export declare type DnaModifiers = {
|
|
|
202
202
|
/**
|
|
203
203
|
* @public
|
|
204
204
|
*/
|
|
205
|
-
export
|
|
205
|
+
export type FunctionName = string;
|
|
206
206
|
/**
|
|
207
207
|
* @public
|
|
208
208
|
*/
|
|
209
|
-
export
|
|
209
|
+
export type ZomeName = string;
|
|
210
210
|
/**
|
|
211
211
|
* @public
|
|
212
212
|
*/
|
|
213
|
-
export
|
|
213
|
+
export type ZomeDefinition = [
|
|
214
214
|
ZomeName,
|
|
215
215
|
{
|
|
216
216
|
wasm_hash: WasmHash;
|
|
@@ -220,15 +220,15 @@ export declare type ZomeDefinition = [
|
|
|
220
220
|
/**
|
|
221
221
|
* @public
|
|
222
222
|
*/
|
|
223
|
-
export
|
|
223
|
+
export type IntegrityZome = ZomeDefinition;
|
|
224
224
|
/**
|
|
225
225
|
* @public
|
|
226
226
|
*/
|
|
227
|
-
export
|
|
227
|
+
export type CoordinatorZome = ZomeDefinition;
|
|
228
228
|
/**
|
|
229
229
|
* @public
|
|
230
230
|
*/
|
|
231
|
-
export
|
|
231
|
+
export type DnaDefinition = {
|
|
232
232
|
name: string;
|
|
233
233
|
modifiers: DnaModifiers;
|
|
234
234
|
integrity_zomes: IntegrityZome[];
|
|
@@ -237,29 +237,29 @@ export declare type DnaDefinition = {
|
|
|
237
237
|
/**
|
|
238
238
|
* @public
|
|
239
239
|
*/
|
|
240
|
-
export
|
|
240
|
+
export type GetDnaDefinitionRequest = DnaHash;
|
|
241
241
|
/**
|
|
242
242
|
* @public
|
|
243
243
|
*/
|
|
244
|
-
export
|
|
244
|
+
export type GetDnaDefinitionResponse = DnaDefinition;
|
|
245
245
|
/**
|
|
246
246
|
* @public
|
|
247
247
|
*/
|
|
248
|
-
export
|
|
248
|
+
export type UninstallAppRequest = {
|
|
249
249
|
installed_app_id: InstalledAppId;
|
|
250
250
|
};
|
|
251
251
|
/**
|
|
252
252
|
* @public
|
|
253
253
|
*/
|
|
254
|
-
export
|
|
254
|
+
export type UninstallAppResponse = null;
|
|
255
255
|
/**
|
|
256
256
|
* @public
|
|
257
257
|
*/
|
|
258
|
-
export
|
|
258
|
+
export type ResourceBytes = Uint8Array;
|
|
259
259
|
/**
|
|
260
260
|
* @public
|
|
261
261
|
*/
|
|
262
|
-
export
|
|
262
|
+
export type ResourceMap = {
|
|
263
263
|
[key: string]: ResourceBytes;
|
|
264
264
|
};
|
|
265
265
|
/**
|
|
@@ -297,7 +297,7 @@ export interface CellProvisioning {
|
|
|
297
297
|
/**
|
|
298
298
|
* @public
|
|
299
299
|
*/
|
|
300
|
-
export
|
|
300
|
+
export type Location = {
|
|
301
301
|
/**
|
|
302
302
|
* Expect file to be part of this bundle
|
|
303
303
|
*/
|
|
@@ -316,11 +316,11 @@ export declare type Location = {
|
|
|
316
316
|
/**
|
|
317
317
|
* @public
|
|
318
318
|
*/
|
|
319
|
-
export
|
|
319
|
+
export type DnaVersionSpec = Array<HoloHashB64>;
|
|
320
320
|
/**
|
|
321
321
|
* @public
|
|
322
322
|
*/
|
|
323
|
-
export
|
|
323
|
+
export type DnaVersionFlexible = {
|
|
324
324
|
singleton: HoloHashB64;
|
|
325
325
|
} | {
|
|
326
326
|
multiple: DnaVersionSpec;
|
|
@@ -328,7 +328,7 @@ export declare type DnaVersionFlexible = {
|
|
|
328
328
|
/**
|
|
329
329
|
* @public
|
|
330
330
|
*/
|
|
331
|
-
export
|
|
331
|
+
export type AppRoleDnaManifest = {
|
|
332
332
|
clone_limit?: number;
|
|
333
333
|
modifiers?: Partial<DnaModifiers>;
|
|
334
334
|
version?: DnaVersionFlexible;
|
|
@@ -336,7 +336,7 @@ export declare type AppRoleDnaManifest = {
|
|
|
336
336
|
/**
|
|
337
337
|
* @public
|
|
338
338
|
*/
|
|
339
|
-
export
|
|
339
|
+
export type AppRoleManifest = {
|
|
340
340
|
name: RoleName;
|
|
341
341
|
provisioning?: CellProvisioning;
|
|
342
342
|
dna: AppRoleDnaManifest;
|
|
@@ -344,7 +344,7 @@ export declare type AppRoleManifest = {
|
|
|
344
344
|
/**
|
|
345
345
|
* @public
|
|
346
346
|
*/
|
|
347
|
-
export
|
|
347
|
+
export type AppManifest = {
|
|
348
348
|
manifest_version: string;
|
|
349
349
|
name: string;
|
|
350
350
|
description?: string;
|
|
@@ -353,14 +353,14 @@ export declare type AppManifest = {
|
|
|
353
353
|
/**
|
|
354
354
|
* @public
|
|
355
355
|
*/
|
|
356
|
-
export
|
|
356
|
+
export type AppBundle = {
|
|
357
357
|
manifest: AppManifest;
|
|
358
358
|
resources: ResourceMap;
|
|
359
359
|
};
|
|
360
360
|
/**
|
|
361
361
|
* @public
|
|
362
362
|
*/
|
|
363
|
-
export
|
|
363
|
+
export type AppBundleSource = {
|
|
364
364
|
bundle: AppBundle;
|
|
365
365
|
} | {
|
|
366
366
|
path: string;
|
|
@@ -368,11 +368,11 @@ export declare type AppBundleSource = {
|
|
|
368
368
|
/**
|
|
369
369
|
* @public
|
|
370
370
|
*/
|
|
371
|
-
export
|
|
371
|
+
export type NetworkSeed = string;
|
|
372
372
|
/**
|
|
373
373
|
* @public
|
|
374
374
|
*/
|
|
375
|
-
export
|
|
375
|
+
export type InstallAppRequest = {
|
|
376
376
|
agent_key: AgentPubKey;
|
|
377
377
|
installed_app_id?: InstalledAppId;
|
|
378
378
|
membrane_proofs: {
|
|
@@ -383,31 +383,31 @@ export declare type InstallAppRequest = {
|
|
|
383
383
|
/**
|
|
384
384
|
* @public
|
|
385
385
|
*/
|
|
386
|
-
export
|
|
386
|
+
export type InstallAppResponse = AppInfo;
|
|
387
387
|
/**
|
|
388
388
|
* @public
|
|
389
389
|
*/
|
|
390
|
-
export
|
|
390
|
+
export type ListDnasRequest = void;
|
|
391
391
|
/**
|
|
392
392
|
* @public
|
|
393
393
|
*/
|
|
394
|
-
export
|
|
394
|
+
export type ListDnasResponse = Array<string>;
|
|
395
395
|
/**
|
|
396
396
|
* @public
|
|
397
397
|
*/
|
|
398
|
-
export
|
|
398
|
+
export type ListCellIdsRequest = void;
|
|
399
399
|
/**
|
|
400
400
|
* @public
|
|
401
401
|
*/
|
|
402
|
-
export
|
|
402
|
+
export type ListCellIdsResponse = Array<CellId>;
|
|
403
403
|
/**
|
|
404
404
|
* @public
|
|
405
405
|
*/
|
|
406
|
-
export
|
|
406
|
+
export type ListActiveAppsRequest = void;
|
|
407
407
|
/**
|
|
408
408
|
* @public
|
|
409
409
|
*/
|
|
410
|
-
export
|
|
410
|
+
export type ListActiveAppsResponse = Array<InstalledAppId>;
|
|
411
411
|
/**
|
|
412
412
|
* @public
|
|
413
413
|
*/
|
|
@@ -421,55 +421,55 @@ export declare enum AppStatusFilter {
|
|
|
421
421
|
/**
|
|
422
422
|
* @public
|
|
423
423
|
*/
|
|
424
|
-
export
|
|
424
|
+
export type ListAppsRequest = {
|
|
425
425
|
status_filter?: AppStatusFilter;
|
|
426
426
|
};
|
|
427
427
|
/**
|
|
428
428
|
* @public
|
|
429
429
|
*/
|
|
430
|
-
export
|
|
430
|
+
export type ListAppsResponse = Array<AppInfo>;
|
|
431
431
|
/**
|
|
432
432
|
* @public
|
|
433
433
|
*/
|
|
434
|
-
export
|
|
434
|
+
export type ListAppInterfacesRequest = void;
|
|
435
435
|
/**
|
|
436
436
|
* @public
|
|
437
437
|
*/
|
|
438
|
-
export
|
|
438
|
+
export type ListAppInterfacesResponse = Array<number>;
|
|
439
439
|
/**
|
|
440
440
|
* This type is meant to be opaque
|
|
441
441
|
*
|
|
442
442
|
* @public
|
|
443
443
|
*/
|
|
444
|
-
export
|
|
444
|
+
export type AgentInfoSigned = unknown;
|
|
445
445
|
/**
|
|
446
446
|
* @public
|
|
447
447
|
*/
|
|
448
|
-
export
|
|
448
|
+
export type AgentInfoRequest = {
|
|
449
449
|
cell_id: CellId | null;
|
|
450
450
|
};
|
|
451
451
|
/**
|
|
452
452
|
* @public
|
|
453
453
|
*/
|
|
454
|
-
export
|
|
454
|
+
export type AgentInfoResponse = Array<AgentInfoSigned>;
|
|
455
455
|
/**
|
|
456
456
|
* @public
|
|
457
457
|
*/
|
|
458
|
-
export
|
|
458
|
+
export type AddAgentInfoRequest = {
|
|
459
459
|
agent_infos: Array<AgentInfoSigned>;
|
|
460
460
|
};
|
|
461
461
|
/**
|
|
462
462
|
* @public
|
|
463
463
|
*/
|
|
464
|
-
export
|
|
464
|
+
export type AddAgentInfoResponse = any;
|
|
465
465
|
/**
|
|
466
466
|
* @public
|
|
467
467
|
*/
|
|
468
|
-
export
|
|
468
|
+
export type DeleteCloneCellRequest = DisableCloneCellRequest;
|
|
469
469
|
/**
|
|
470
470
|
* @public
|
|
471
471
|
*/
|
|
472
|
-
export
|
|
472
|
+
export type DeleteCloneCellResponse = void;
|
|
473
473
|
/**
|
|
474
474
|
* @public
|
|
475
475
|
*/
|
|
@@ -487,11 +487,11 @@ export interface GrantZomeCallCapabilityRequest {
|
|
|
487
487
|
/**
|
|
488
488
|
* @public
|
|
489
489
|
*/
|
|
490
|
-
export
|
|
490
|
+
export type GrantZomeCallCapabilityResponse = void;
|
|
491
491
|
/**
|
|
492
492
|
* @public
|
|
493
493
|
*/
|
|
494
|
-
export
|
|
494
|
+
export type InstallAppDnaPayload = {
|
|
495
495
|
hash: HoloHash;
|
|
496
496
|
role_name: RoleName;
|
|
497
497
|
membrane_proof?: MembraneProof;
|
|
@@ -499,18 +499,18 @@ export declare type InstallAppDnaPayload = {
|
|
|
499
499
|
/**
|
|
500
500
|
* @public
|
|
501
501
|
*/
|
|
502
|
-
export
|
|
502
|
+
export type ZomeLocation = Location;
|
|
503
503
|
/**
|
|
504
504
|
* @public
|
|
505
505
|
*/
|
|
506
|
-
export
|
|
506
|
+
export type ZomeManifest = {
|
|
507
507
|
name: string;
|
|
508
508
|
hash?: string;
|
|
509
509
|
} & ZomeLocation;
|
|
510
510
|
/**
|
|
511
511
|
* @public
|
|
512
512
|
*/
|
|
513
|
-
export
|
|
513
|
+
export type DnaManifest = {
|
|
514
514
|
/**
|
|
515
515
|
* Currently one "1" is supported
|
|
516
516
|
*/
|
|
@@ -536,14 +536,14 @@ export declare type DnaManifest = {
|
|
|
536
536
|
/**
|
|
537
537
|
* @public
|
|
538
538
|
*/
|
|
539
|
-
export
|
|
539
|
+
export type DnaBundle = {
|
|
540
540
|
manifest: DnaManifest;
|
|
541
541
|
resources: ResourceMap;
|
|
542
542
|
};
|
|
543
543
|
/**
|
|
544
544
|
* @public
|
|
545
545
|
*/
|
|
546
|
-
export
|
|
546
|
+
export type DnaSource = {
|
|
547
547
|
hash: HoloHash;
|
|
548
548
|
} | {
|
|
549
549
|
path: string;
|
|
@@ -553,13 +553,13 @@ export declare type DnaSource = {
|
|
|
553
553
|
/**
|
|
554
554
|
* @public
|
|
555
555
|
*/
|
|
556
|
-
export
|
|
556
|
+
export type Zomes = Array<[string, {
|
|
557
557
|
wasm_hash: Array<HoloHash>;
|
|
558
558
|
}]>;
|
|
559
559
|
/**
|
|
560
560
|
* @public
|
|
561
561
|
*/
|
|
562
|
-
export
|
|
562
|
+
export type WasmCode = [HoloHash, {
|
|
563
563
|
code: Array<number>;
|
|
564
564
|
}];
|
|
565
565
|
/**
|
package/lib/api/app/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Requester } from "../common.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type CallZomeRequestGeneric<Payload> = {
|
|
8
8
|
cell_id: CellId;
|
|
9
9
|
zome_name: ZomeName;
|
|
10
10
|
fn_name: FunctionName;
|
|
@@ -14,25 +14,25 @@ export declare type CallZomeRequestGeneric<Payload> = {
|
|
|
14
14
|
/**
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type CallZomeRequest = CallZomeRequestGeneric<any>;
|
|
18
18
|
/**
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type CallZomeResponseGeneric<Payload> = Payload;
|
|
22
22
|
/**
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type CallZomeResponse = CallZomeResponseGeneric<any>;
|
|
26
26
|
/**
|
|
27
27
|
* @public
|
|
28
28
|
*/
|
|
29
|
-
export
|
|
29
|
+
export type AppInfoRequest = {
|
|
30
30
|
installed_app_id: InstalledAppId;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
|
-
export
|
|
35
|
+
export type AppInfoResponse = AppInfo;
|
|
36
36
|
/**
|
|
37
37
|
* @public
|
|
38
38
|
*/
|
|
@@ -83,7 +83,7 @@ export interface CreateCloneCellRequest {
|
|
|
83
83
|
/**
|
|
84
84
|
* @public
|
|
85
85
|
*/
|
|
86
|
-
export
|
|
86
|
+
export type CreateCloneCellResponse = ClonedCell;
|
|
87
87
|
/**
|
|
88
88
|
* @public
|
|
89
89
|
*/
|
|
@@ -100,15 +100,15 @@ export interface DisableCloneCellRequest {
|
|
|
100
100
|
/**
|
|
101
101
|
* @public
|
|
102
102
|
*/
|
|
103
|
-
export
|
|
103
|
+
export type DisableCloneCellResponse = void;
|
|
104
104
|
/**
|
|
105
105
|
* @public
|
|
106
106
|
*/
|
|
107
|
-
export
|
|
107
|
+
export type EnableCloneCellRequest = DisableCloneCellRequest;
|
|
108
108
|
/**
|
|
109
109
|
* @public
|
|
110
110
|
*/
|
|
111
|
-
export
|
|
111
|
+
export type EnableCloneCellResponse = CreateCloneCellResponse;
|
|
112
112
|
/**
|
|
113
113
|
* @public
|
|
114
114
|
*/
|
|
@@ -128,7 +128,7 @@ export declare const SignalType: {
|
|
|
128
128
|
/**
|
|
129
129
|
* @public
|
|
130
130
|
*/
|
|
131
|
-
export
|
|
131
|
+
export type Signal = {
|
|
132
132
|
[SignalType.App]: EncodedAppSignal;
|
|
133
133
|
} | {
|
|
134
134
|
[SignalType.System]: unknown;
|
|
@@ -136,7 +136,7 @@ export declare type Signal = {
|
|
|
136
136
|
/**
|
|
137
137
|
* @public
|
|
138
138
|
*/
|
|
139
|
-
export
|
|
139
|
+
export type EncodedAppSignal = {
|
|
140
140
|
cell_id: CellId;
|
|
141
141
|
zome_name: string;
|
|
142
142
|
signal: Uint8Array;
|
|
@@ -144,7 +144,7 @@ export declare type EncodedAppSignal = {
|
|
|
144
144
|
/**
|
|
145
145
|
* @public
|
|
146
146
|
*/
|
|
147
|
-
export
|
|
147
|
+
export type AppSignal = {
|
|
148
148
|
cell_id: CellId;
|
|
149
149
|
zome_name: string;
|
|
150
150
|
payload: unknown;
|
|
@@ -152,11 +152,11 @@ export declare type AppSignal = {
|
|
|
152
152
|
/**
|
|
153
153
|
* @public
|
|
154
154
|
*/
|
|
155
|
-
export
|
|
155
|
+
export type AppSignalCb = (signal: AppSignal) => void;
|
|
156
156
|
/**
|
|
157
157
|
* @public
|
|
158
158
|
*/
|
|
159
|
-
export
|
|
159
|
+
export type NetworkInfoResponse = NetworkInfo[];
|
|
160
160
|
/**
|
|
161
161
|
* @public
|
|
162
162
|
*/
|
package/lib/api/app/websocket.js
CHANGED
|
@@ -2,7 +2,7 @@ import { hashZomeCall } from "@holochain/serialization";
|
|
|
2
2
|
import { decode, encode } from "@msgpack/msgpack";
|
|
3
3
|
import Emittery from "emittery";
|
|
4
4
|
import nacl from "tweetnacl";
|
|
5
|
-
import { getLauncherEnvironment, isLauncher, signZomeCallTauri, } from "../../environments/launcher.js";
|
|
5
|
+
import { getHostZomeCallSigner, getLauncherEnvironment, isLauncher, signZomeCallTauri, } from "../../environments/launcher.js";
|
|
6
6
|
import { encodeHashToBase64 } from "../../utils/base64.js";
|
|
7
7
|
import { WsClient } from "../client.js";
|
|
8
8
|
import { catchError, DEFAULT_TIMEOUT, promiseTimeout, requesterTransformer, } from "../common.js";
|
|
@@ -87,10 +87,14 @@ const callZomeTransform = {
|
|
|
87
87
|
if ("signature" in request) {
|
|
88
88
|
return request;
|
|
89
89
|
}
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
const hostSigner = getHostZomeCallSigner();
|
|
91
|
+
if (hostSigner) {
|
|
92
|
+
return hostSigner.signZomeCall(request);
|
|
93
|
+
}
|
|
94
|
+
else if (isLauncher) {
|
|
95
|
+
return signZomeCallTauri(request);
|
|
96
|
+
}
|
|
97
|
+
return signZomeCall(request);
|
|
94
98
|
},
|
|
95
99
|
output: (response) => decode(response),
|
|
96
100
|
};
|
|
@@ -5,35 +5,35 @@ import { CreateCloneCellRequest, CreateCloneCellResponse, DisableCloneCellRespon
|
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type NonProvenanceCallZomeRequest = Omit<CallZomeRequest, "provenance">;
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type RoleNameCallZomeRequest = Omit<NonProvenanceCallZomeRequest, "cell_id"> & {
|
|
13
13
|
role_name: RoleName;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export type RoleNameCallZomeRequestSigned = Omit<CallZomeRequestSigned, "cell_id"> & {
|
|
19
19
|
role_name: RoleName;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type AppAgentCallZomeRequest = NonProvenanceCallZomeRequest | RoleNameCallZomeRequest | CallZomeRequestSigned | RoleNameCallZomeRequestSigned;
|
|
25
25
|
/**
|
|
26
26
|
* @public
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type AppCreateCloneCellRequest = Omit<CreateCloneCellRequest, "app_id">;
|
|
29
29
|
/**
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export type AppEnableCloneCellRequest = Omit<EnableCloneCellRequest, "app_id">;
|
|
33
33
|
/**
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export type AppDisableCloneCellRequest = Omit<DisableCloneCellRequest, "app_id">;
|
|
37
37
|
/**
|
|
38
38
|
* @public
|
|
39
39
|
*/
|
package/lib/api/client.js
CHANGED
|
@@ -64,16 +64,16 @@ export class WsClient extends Emittery {
|
|
|
64
64
|
console.error(`Got unrecognized Websocket message type: ${message.type}`);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
socket.
|
|
67
|
+
socket.onclose = (event) => {
|
|
68
68
|
const pendingRequestIds = Object.keys(this.pendingRequests).map((id) => parseInt(id));
|
|
69
69
|
if (pendingRequestIds.length) {
|
|
70
70
|
pendingRequestIds.forEach((id) => {
|
|
71
|
-
const error = new Error(`Websocket closed with pending requests. Close event: ${event}, request id: ${id}`);
|
|
71
|
+
const error = new Error(`Websocket closed with pending requests. Close event code: ${event.code}, request id: ${id}`);
|
|
72
72
|
this.pendingRequests[id].reject(error);
|
|
73
73
|
delete this.pendingRequests[id];
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* Instance factory for creating WsClients.
|
package/lib/api/common.d.ts
CHANGED
|
@@ -3,22 +3,22 @@ export declare const DEFAULT_TIMEOUT = 15000;
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type Transformer<ReqI, ReqO, ResI, ResO> = {
|
|
7
7
|
input: (req: ReqI) => ReqO;
|
|
8
8
|
output: (res: ResI) => ResO;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type Requester<Req, Res> = (req: Req, timeout?: number) => Promise<Res>;
|
|
14
14
|
/**
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export type RequesterUnit<Res> = () => Promise<Res>;
|
|
18
18
|
/**
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export type Tagged<T> = {
|
|
22
22
|
type: string;
|
|
23
23
|
data: T;
|
|
24
24
|
};
|
|
@@ -5,12 +5,18 @@ export interface LauncherEnvironment {
|
|
|
5
5
|
ADMIN_INTERFACE_PORT?: number;
|
|
6
6
|
INSTALLED_APP_ID?: InstalledAppId;
|
|
7
7
|
}
|
|
8
|
+
export interface HostZomeCallSigner {
|
|
9
|
+
signZomeCall: (request: CallZomeRequest) => Promise<CallZomeRequestSigned>;
|
|
10
|
+
}
|
|
8
11
|
declare const __HC_LAUNCHER_ENV__ = "__HC_LAUNCHER_ENV__";
|
|
12
|
+
declare const __HC_ZOME_CALL_SIGNER__ = "__HC_ZOME_CALL_SIGNER__";
|
|
9
13
|
export declare const isLauncher: boolean;
|
|
10
14
|
export declare const getLauncherEnvironment: () => LauncherEnvironment | undefined;
|
|
15
|
+
export declare const getHostZomeCallSigner: () => HostZomeCallSigner | undefined;
|
|
11
16
|
declare global {
|
|
12
17
|
interface Window {
|
|
13
18
|
[__HC_LAUNCHER_ENV__]: LauncherEnvironment | undefined;
|
|
19
|
+
[__HC_ZOME_CALL_SIGNER__]?: HostZomeCallSigner;
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
22
|
export declare const signZomeCallTauri: (request: CallZomeRequest) => Promise<CallZomeRequestSigned>;
|
|
@@ -2,8 +2,10 @@ import { invoke } from "@tauri-apps/api/tauri";
|
|
|
2
2
|
import { getNonceExpiration, randomNonce, } from "../api/index.js";
|
|
3
3
|
import { encode } from "@msgpack/msgpack";
|
|
4
4
|
const __HC_LAUNCHER_ENV__ = "__HC_LAUNCHER_ENV__";
|
|
5
|
+
const __HC_ZOME_CALL_SIGNER__ = "__HC_ZOME_CALL_SIGNER__";
|
|
5
6
|
export const isLauncher = typeof window === "object" && __HC_LAUNCHER_ENV__ in window;
|
|
6
7
|
export const getLauncherEnvironment = () => isLauncher ? window[__HC_LAUNCHER_ENV__] : undefined;
|
|
8
|
+
export const getHostZomeCallSigner = () => globalThis.window && globalThis.window[__HC_ZOME_CALL_SIGNER__];
|
|
7
9
|
export const signZomeCallTauri = async (request) => {
|
|
8
10
|
const zomeCallUnsigned = {
|
|
9
11
|
provenance: Array.from(request.provenance),
|
package/lib/hdk/action.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface SignedActionHashed<H extends Action = Action> {
|
|
|
10
10
|
/**
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type ActionHashed = HoloHashed<Action>;
|
|
14
14
|
/**
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
@@ -29,11 +29,11 @@ export declare enum ActionType {
|
|
|
29
29
|
/**
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export type Action = Dna | AgentValidationPkg | InitZomesComplete | CreateLink | DeleteLink | OpenChain | CloseChain | Delete | NewEntryAction;
|
|
33
33
|
/**
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export type NewEntryAction = Create | Update;
|
|
37
37
|
/**
|
|
38
38
|
* @public
|
|
39
39
|
*/
|
|
@@ -3,7 +3,7 @@ import { AgentPubKey } from "../types.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type CapSecret = Uint8Array;
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
@@ -22,7 +22,7 @@ export declare enum GrantedFunctionsType {
|
|
|
22
22
|
/**
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
25
|
+
export type GrantedFunctions = {
|
|
26
26
|
[GrantedFunctionsType.All]: null;
|
|
27
27
|
} | {
|
|
28
28
|
[GrantedFunctionsType.Listed]: [ZomeName, FunctionName][];
|
|
@@ -38,7 +38,7 @@ export interface ZomeCallCapGrant {
|
|
|
38
38
|
/**
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
41
|
+
export type CapAccess = "Unrestricted" | {
|
|
42
42
|
Transferable: {
|
|
43
43
|
secret: CapSecret;
|
|
44
44
|
};
|
|
@@ -51,7 +51,7 @@ export declare type CapAccess = "Unrestricted" | {
|
|
|
51
51
|
/**
|
|
52
52
|
* @public
|
|
53
53
|
*/
|
|
54
|
-
export
|
|
54
|
+
export type CapGrant = {
|
|
55
55
|
ChainAuthor: AgentPubKey;
|
|
56
56
|
} | {
|
|
57
57
|
RemoteAgent: ZomeCallCapGrant;
|
|
@@ -28,7 +28,7 @@ export interface CounterSigningSessionTimes {
|
|
|
28
28
|
/**
|
|
29
29
|
* @public
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export type ActionBase = {
|
|
32
32
|
Create: CreateBase;
|
|
33
33
|
} | {
|
|
34
34
|
Update: UpdateBase;
|
|
@@ -50,15 +50,15 @@ export interface UpdateBase {
|
|
|
50
50
|
/**
|
|
51
51
|
* @public
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type CounterSigningAgents = Array<[AgentPubKey, Array<Role>]>;
|
|
54
54
|
/**
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export type PreflightBytes = Uint8Array;
|
|
58
58
|
/**
|
|
59
59
|
* @public
|
|
60
60
|
*/
|
|
61
|
-
export
|
|
61
|
+
export type Role = number;
|
|
62
62
|
/**
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
package/lib/hdk/dht-ops.d.ts
CHANGED
package/lib/hdk/entry.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { CounterSigningSessionData } from "./countersigning.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type EntryVisibility = {
|
|
8
8
|
Public: null;
|
|
9
9
|
} | {
|
|
10
10
|
Private: null;
|
|
@@ -12,7 +12,7 @@ export declare type EntryVisibility = {
|
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type AppEntryDef = {
|
|
16
16
|
entry_index: number;
|
|
17
17
|
zome_index: number;
|
|
18
18
|
visibility: EntryVisibility;
|
|
@@ -20,7 +20,7 @@ export declare type AppEntryDef = {
|
|
|
20
20
|
/**
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export type EntryType = "Agent" | {
|
|
24
24
|
App: AppEntryDef;
|
|
25
25
|
} | "CapClaim" | "CapGrant";
|
|
26
26
|
/**
|
|
@@ -33,4 +33,4 @@ export interface EntryContent<E extends string, C> {
|
|
|
33
33
|
/**
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App", Uint8Array> | EntryContent<"CounterSign", [CounterSigningSessionData, Uint8Array]> | EntryContent<"CapGrant", ZomeCallCapGrant> | EntryContent<"CapClaim", CapClaim>;
|
package/lib/hdk/record.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import { Entry } from "./entry.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export type Record = {
|
|
7
7
|
signed_action: SignedActionHashed;
|
|
8
8
|
entry: RecordEntry;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export type RecordEntry = {
|
|
14
14
|
Present: Entry;
|
|
15
15
|
} | {
|
|
16
16
|
Hidden: void;
|
package/lib/tsdoc-metadata.json
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @public
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export type HoloHash = Uint8Array;
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type AgentPubKey = HoloHash;
|
|
9
9
|
/**
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type DnaHash = HoloHash;
|
|
13
13
|
/**
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type WasmHash = HoloHash;
|
|
17
17
|
/**
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type EntryHash = HoloHash;
|
|
21
21
|
/**
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type ActionHash = HoloHash;
|
|
25
25
|
/**
|
|
26
26
|
* @public
|
|
27
27
|
*/
|
|
28
|
-
export
|
|
28
|
+
export type AnyDhtHash = HoloHash;
|
|
29
29
|
/**
|
|
30
30
|
* @public
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export type KitsuneAgent = Uint8Array;
|
|
33
33
|
/**
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export type KitsuneSpace = Uint8Array;
|
|
37
37
|
/** Base64 hash types */
|
|
38
38
|
/**
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
export
|
|
41
|
+
export type HoloHashB64 = string;
|
|
42
42
|
/**
|
|
43
43
|
* @public
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type AgentPubKeyB64 = HoloHashB64;
|
|
46
46
|
/**
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
export
|
|
49
|
+
export type DnaHashB64 = HoloHashB64;
|
|
50
50
|
/**
|
|
51
51
|
* @public
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type WasmHashB64 = HoloHashB64;
|
|
54
54
|
/**
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export type EntryHashB64 = HoloHashB64;
|
|
58
58
|
/**
|
|
59
59
|
* @public
|
|
60
60
|
*/
|
|
61
|
-
export
|
|
61
|
+
export type ActionHashB64 = HoloHashB64;
|
|
62
62
|
/**
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
|
65
|
-
export
|
|
65
|
+
export type AnyDhtHashB64 = HoloHashB64;
|
|
66
66
|
/**
|
|
67
67
|
* @public
|
|
68
68
|
*/
|
|
69
|
-
export
|
|
69
|
+
export type InstalledAppId = string;
|
|
70
70
|
/**
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
export
|
|
73
|
+
export type Signature = Uint8Array;
|
|
74
74
|
/**
|
|
75
75
|
* @public
|
|
76
76
|
*/
|
|
77
|
-
export
|
|
77
|
+
export type CellId = [DnaHash, AgentPubKey];
|
|
78
78
|
/**
|
|
79
79
|
* @public
|
|
80
80
|
*/
|
|
81
|
-
export
|
|
81
|
+
export type DnaProperties = any;
|
|
82
82
|
/**
|
|
83
83
|
* @public
|
|
84
84
|
*/
|
|
85
|
-
export
|
|
85
|
+
export type RoleName = string;
|
|
86
86
|
/**
|
|
87
87
|
* @public
|
|
88
88
|
*/
|
|
89
|
-
export
|
|
89
|
+
export type InstalledCell = {
|
|
90
90
|
cell_id: CellId;
|
|
91
91
|
role_name: RoleName;
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
94
|
* @public
|
|
95
95
|
*/
|
|
96
|
-
export
|
|
96
|
+
export type Timestamp = number;
|
|
97
97
|
/**
|
|
98
98
|
* @public
|
|
99
99
|
*/
|
package/package.json
CHANGED