@keyhive/keyhive 0.0.0-alpha.42 → 0.0.0-alpha.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keyhive/keyhive",
3
- "version": "0.0.0-alpha.42",
3
+ "version": "0.0.0-alpha.44",
4
4
  "description": "",
5
5
  "main": "pkg/keyhive_wasm.js",
6
6
  "keywords": [],
@@ -11,25 +11,25 @@ export class Access {
11
11
  private constructor();
12
12
  free(): void;
13
13
  [Symbol.dispose](): void;
14
- static tryFromString(s: string): Access | undefined;
15
14
  toString(): string;
15
+ static tryFromString(s: string): Access | undefined;
16
16
  }
17
17
  export class Agent {
18
18
  private constructor();
19
19
  free(): void;
20
20
  [Symbol.dispose](): void;
21
+ isDocument(): boolean;
21
22
  toString(): string;
22
23
  isIndividual(): boolean;
23
24
  isGroup(): boolean;
24
- isDocument(): boolean;
25
25
  readonly id: Identifier;
26
26
  }
27
27
  export class Archive {
28
28
  free(): void;
29
29
  [Symbol.dispose](): void;
30
30
  constructor(bytes: Uint8Array);
31
- toBytes(): Uint8Array;
32
31
  tryToKeyhive(ciphertext_store: CiphertextStore, signer: Signer, event_handler: Function): Promise<Keyhive>;
32
+ toBytes(): Uint8Array;
33
33
  }
34
34
  export class CannotParseEd25519SigningKey {
35
35
  private constructor();
@@ -45,8 +45,8 @@ export class Capability {
45
45
  private constructor();
46
46
  free(): void;
47
47
  [Symbol.dispose](): void;
48
- readonly who: Agent;
49
48
  readonly can: Access;
49
+ readonly who: Agent;
50
50
  readonly proof: SignedDelegation;
51
51
  }
52
52
  export class CgkaOperation {
@@ -58,11 +58,11 @@ export class CgkaOperation {
58
58
  export class ChangeId {
59
59
  free(): void;
60
60
  [Symbol.dispose](): void;
61
- constructor(bytes: Uint8Array);
62
61
  /**
63
62
  * r" Upcasts to the JS-import type for [`#ty_ident`].
64
63
  */
65
64
  __wasm_refgen_toChangeId(): ChangeId;
65
+ constructor(bytes: Uint8Array);
66
66
  readonly bytes: Uint8Array;
67
67
  }
68
68
  export class CiphertextStore {
@@ -76,50 +76,51 @@ export class ContactCard {
76
76
  private constructor();
77
77
  free(): void;
78
78
  [Symbol.dispose](): void;
79
- signature(): Uint8Array;
79
+ toJson(): string;
80
80
  toAgent(): Agent;
81
81
  static fromJson(json: string): ContactCard;
82
- toJson(): string;
83
- readonly id: IndividualId;
82
+ signature(): Uint8Array;
83
+ readonly individualId: IndividualId;
84
+ readonly id: Identifier;
84
85
  readonly shareKey: ShareKey;
85
86
  }
86
87
  export class Delegation {
87
88
  private constructor();
88
89
  free(): void;
89
90
  [Symbol.dispose](): void;
90
- readonly delegate: Agent;
91
91
  readonly can: Access;
92
- readonly proof: SignedDelegation | undefined;
93
92
  readonly after: History;
93
+ readonly proof: SignedDelegation | undefined;
94
+ readonly delegate: Agent;
94
95
  }
95
96
  export class DocContentRefs {
96
97
  free(): void;
97
98
  [Symbol.dispose](): void;
98
- constructor(doc_id: DocumentId, change_hashes: ChangeId[]);
99
99
  addChangeId(hash: ChangeId): Promise<void>;
100
- readonly docId: DocumentId;
100
+ constructor(doc_id: DocumentId, change_hashes: ChangeId[]);
101
101
  readonly change_hashes: Promise<ChangeId[]>;
102
+ readonly docId: DocumentId;
102
103
  }
103
104
  export class Document {
104
105
  private constructor();
105
106
  free(): void;
106
107
  [Symbol.dispose](): void;
107
- toPeer(): Peer;
108
- toAgent(): Agent;
109
108
  toMembered(): Membered;
110
109
  /**
111
110
  * r" Upcasts to the JS-import type for [`#ty_ident`].
112
111
  */
113
112
  __wasm_refgen_toDocument(): Document;
113
+ toPeer(): Peer;
114
+ toAgent(): Agent;
114
115
  readonly id: Identifier;
115
116
  readonly doc_id: DocumentId;
116
117
  }
117
118
  export class DocumentId {
118
119
  free(): void;
119
120
  [Symbol.dispose](): void;
120
- constructor(bytes: Uint8Array);
121
- toString(): string;
122
121
  toJsValue(): any;
122
+ toString(): string;
123
+ constructor(bytes: Uint8Array);
123
124
  toBytes(): Uint8Array;
124
125
  }
125
126
  export class Encrypted {
@@ -128,9 +129,9 @@ export class Encrypted {
128
129
  [Symbol.dispose](): void;
129
130
  toBytes(): Uint8Array;
130
131
  readonly ciphertext: Uint8Array;
131
- readonly nonce: Uint8Array;
132
- readonly pcs_key_hash: Uint8Array;
133
132
  readonly content_ref: Uint8Array;
133
+ readonly pcs_key_hash: Uint8Array;
134
+ readonly nonce: Uint8Array;
134
135
  readonly pred_refs: Uint8Array;
135
136
  }
136
137
  export class EncryptedContentWithUpdate {
@@ -151,9 +152,9 @@ export class Event {
151
152
  * serializes it.
152
153
  */
153
154
  toBytes(): Uint8Array;
154
- readonly variant: string;
155
- readonly isDelegated: boolean;
156
155
  readonly isRevoked: boolean;
156
+ readonly isDelegated: boolean;
157
+ readonly variant: string;
157
158
  }
158
159
  export class GenerateWebCryptoError {
159
160
  private constructor();
@@ -165,14 +166,14 @@ export class Group {
165
166
  private constructor();
166
167
  free(): void;
167
168
  [Symbol.dispose](): void;
168
- members(): Promise<Capability[]>;
169
- toPeer(): Peer;
170
- toAgent(): Agent;
171
169
  toMembered(): Membered;
172
170
  /**
173
171
  * r" Upcasts to the JS-import type for [`#ty_ident`].
174
172
  */
175
173
  __wasm_refgen_toGroup(): Group;
174
+ members(): Promise<Capability[]>;
175
+ toPeer(): Peer;
176
+ toAgent(): Agent;
176
177
  readonly id: Identifier;
177
178
  readonly groupId: GroupId;
178
179
  }
@@ -200,11 +201,11 @@ export class Individual {
200
201
  private constructor();
201
202
  free(): void;
202
203
  [Symbol.dispose](): void;
204
+ pickPrekey(doc_id: DocumentId): Promise<ShareKey>;
203
205
  toPeer(): Peer;
204
206
  toAgent(): Agent;
205
- pickPrekey(doc_id: DocumentId): Promise<ShareKey>;
206
- readonly id: Identifier;
207
207
  readonly individualId: IndividualId;
208
+ readonly id: Identifier;
208
209
  }
209
210
  export class IndividualId {
210
211
  private constructor();
@@ -221,36 +222,36 @@ export class Keyhive {
221
222
  private constructor();
222
223
  free(): void;
223
224
  [Symbol.dispose](): void;
224
- static init(signer: Signer, ciphertext_store: CiphertextStore, event_handler: Function): Promise<Keyhive>;
225
- generateGroup(js_coparents: Peer[]): Promise<Group>;
226
- generateDocument(coparents: Peer[], initial_content_ref_head: ChangeId, more_initial_content_refs: ChangeId[]): Promise<Document>;
227
- trySign(data: Uint8Array): Promise<Signed>;
228
- tryEncrypt(doc: Document, content_ref: ChangeId, js_pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
229
- tryEncryptArchive(doc: Document, content_ref: ChangeId, pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
230
- tryDecrypt(doc: Document, encrypted: Encrypted): Promise<Uint8Array>;
231
225
  addMember(to_add: Agent, membered: Membered, access: Access, other_relevant_docs: Document[]): Promise<SignedDelegation>;
232
- revokeMember(to_revoke: Agent, retain_all_other_members: boolean, membered: Membered): Promise<SignedRevocation[]>;
233
- reachableDocs(): Promise<Summary[]>;
234
- forcePcsUpdate(doc: Document): Promise<void>;
235
- rotatePrekey(prekey: ShareKey): Promise<ShareKey>;
236
- expandPrekeys(): Promise<ShareKey>;
226
+ toArchive(): Promise<Archive>;
227
+ tryDecrypt(doc: Document, encrypted: Encrypted): Promise<Uint8Array>;
228
+ tryEncrypt(doc: Document, content_ref: ChangeId, js_pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
237
229
  contactCard(): Promise<ContactCard>;
238
- receiveContactCard(contact_card: ContactCard): Promise<Individual>;
239
- getAgent(id: Identifier): Promise<Agent | undefined>;
240
- eventsForAgent(agent: Agent): Promise<Map<any, any>>;
241
- membershipOpsForAgent(agent: Agent): Promise<Map<any, any>>;
242
- getGroup(group_id: GroupId): Promise<Group | undefined>;
230
+ generateDocument(coparents: Peer[], initial_content_ref_head: ChangeId, more_initial_content_refs: ChangeId[]): Promise<Document>;
243
231
  getDocument(doc_id: DocumentId): Promise<Document | undefined>;
244
- docMemberCapabilities(doc_id: DocumentId): Promise<Membership[]>;
245
- accessForDoc(id: Identifier, doc_id: DocumentId): Promise<Access | undefined>;
246
232
  intoArchive(): Promise<Archive>;
247
- toArchive(): Promise<Archive>;
233
+ revokeMember(to_revoke: Agent, retain_all_other_members: boolean, membered: Membered): Promise<SignedRevocation[]>;
234
+ rotatePrekey(prekey: ShareKey): Promise<ShareKey>;
235
+ accessForDoc(id: Identifier, doc_id: DocumentId): Promise<Access | undefined>;
236
+ expandPrekeys(): Promise<ShareKey>;
237
+ generateGroup(js_coparents: Peer[]): Promise<Group>;
248
238
  ingestArchive(archive: Archive): Promise<void>;
239
+ reachableDocs(): Promise<Summary[]>;
240
+ eventsForAgent(agent: Agent): Promise<Map<any, any>>;
241
+ forcePcsUpdate(doc: Document): Promise<void>;
249
242
  ingestEventsBytes(events_bytes_array: Array<any>): Promise<Array<any>>;
243
+ tryEncryptArchive(doc: Document, content_ref: ChangeId, pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
244
+ receiveContactCard(contact_card: ContactCard): Promise<Individual>;
245
+ docMemberCapabilities(doc_id: DocumentId): Promise<Membership[]>;
246
+ membershipOpsForAgent(agent: Agent): Promise<Map<any, any>>;
247
+ static init(signer: Signer, ciphertext_store: CiphertextStore, event_handler: Function): Promise<Keyhive>;
250
248
  stats(): Promise<Stats>;
249
+ trySign(data: Uint8Array): Promise<Signed>;
250
+ getAgent(id: Identifier): Promise<Agent | undefined>;
251
+ getGroup(group_id: GroupId): Promise<Group | undefined>;
252
+ readonly individual: Promise<Individual>;
251
253
  readonly id: IndividualId;
252
254
  readonly whoami: IndividualId;
253
- readonly individual: Promise<Individual>;
254
255
  readonly idString: string;
255
256
  }
256
257
  export class Membered {
@@ -262,21 +263,21 @@ export class Membership {
262
263
  private constructor();
263
264
  free(): void;
264
265
  [Symbol.dispose](): void;
265
- readonly who: Agent;
266
266
  readonly can: Access;
267
+ readonly who: Agent;
267
268
  }
268
269
  export class Peer {
269
270
  private constructor();
270
271
  free(): void;
271
272
  [Symbol.dispose](): void;
273
+ isDocument(): boolean;
272
274
  toString(): string;
273
275
  isIndividual(): boolean;
274
- isGroup(): boolean;
275
- isDocument(): boolean;
276
276
  /**
277
277
  * r" Upcasts to the JS-import type for [`#ty_ident`].
278
278
  */
279
279
  __wasm_refgen_toPeer(): Peer;
280
+ isGroup(): boolean;
280
281
  readonly id: Identifier;
281
282
  }
282
283
  export class Revocation {
@@ -284,9 +285,9 @@ export class Revocation {
284
285
  free(): void;
285
286
  [Symbol.dispose](): void;
286
287
  readonly subject_id: Identifier;
287
- readonly revoked: SignedDelegation;
288
- readonly proof: SignedDelegation | undefined;
289
288
  readonly after: History;
289
+ readonly proof: SignedDelegation | undefined;
290
+ readonly revoked: SignedDelegation;
290
291
  }
291
292
  export class ShareKey {
292
293
  private constructor();
@@ -298,10 +299,10 @@ export class Signed {
298
299
  free(): void;
299
300
  [Symbol.dispose](): void;
300
301
  static fromBytes(bytes: Uint8Array): Signed;
301
- toBytes(): Uint8Array;
302
302
  verify(): boolean;
303
- readonly payload: Uint8Array;
303
+ toBytes(): Uint8Array;
304
304
  readonly verifyingKey: Uint8Array;
305
+ readonly payload: Uint8Array;
305
306
  readonly signature: Uint8Array;
306
307
  }
307
308
  export class SignedCgkaOperation {
@@ -340,25 +341,25 @@ export class Signer {
340
341
  private constructor();
341
342
  free(): void;
342
343
  [Symbol.dispose](): void;
343
- static generate(): Promise<Signer>;
344
344
  static generateMemory(): Signer;
345
+ static webCryptoSigner(keypair: any): Promise<Signer>;
345
346
  static generateWebCrypto(): Promise<Signer>;
346
347
  static memorySignerFromBytes(bytes: Uint8Array): Signer;
347
- static webCryptoSigner(keypair: any): Promise<Signer>;
348
- trySign(bytes: Uint8Array): Promise<Signed>;
348
+ static generate(): Promise<Signer>;
349
349
  clone(): Signer;
350
- readonly variant: string;
350
+ trySign(bytes: Uint8Array): Promise<Signed>;
351
351
  readonly verifyingKey: Uint8Array;
352
+ readonly variant: string;
352
353
  }
353
354
  export class Stats {
354
355
  private constructor();
355
356
  free(): void;
356
357
  [Symbol.dispose](): void;
357
- readonly individuals: bigint;
358
- readonly groups: bigint;
359
- readonly docs: bigint;
360
358
  readonly delegations: bigint;
359
+ readonly individuals: bigint;
361
360
  readonly revocations: bigint;
361
+ readonly docs: bigint;
362
+ readonly groups: bigint;
362
363
  }
363
364
  export class Summary {
364
365
  private constructor();