@keyhive/keyhive 0.0.0-alpha.1 → 0.0.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keyhive/keyhive",
3
- "version": "0.0.0-alpha.1",
3
+ "version": "0.0.0-alpha.2",
4
4
  "description": "",
5
5
  "main": "pkg/keyhive_wasm.js",
6
6
  "keywords": [],
@@ -11,7 +11,8 @@
11
11
  "types": "pkg/keyhive_wasm.d.ts",
12
12
  "files": [
13
13
  "pkg/*",
14
- "pkg-node/*"
14
+ "pkg-node/*",
15
+ "pkg-slim/*"
15
16
  ],
16
17
  "exports": {
17
18
  ".": {
@@ -23,6 +24,15 @@
23
24
  "import": "./pkg/keyhive_wasm.js",
24
25
  "require": "./pkg/keyhive_wasm.js",
25
26
  "types": "./pkg/keyhive_wasm.d.ts"
27
+ },
28
+ "./slim": {
29
+ "types": "./pkg-slim/index.d.ts",
30
+ "import": "./pkg-slim/index.js"
31
+ },
32
+ "./keyhive_wasm.wasm": "./pkg-slim/keyhive_wasm_bg.wasm",
33
+ "./keyhive_wasm.base64.js": {
34
+ "import": "./pkg-slim/keyhive_wasm_bg.wasm.base64.js",
35
+ "type": "./pkg-slim/keyhive_wasm_bg.wasm.base64.d.ts"
26
36
  }
27
37
  },
28
38
  "devDependencies": {
@@ -39,8 +49,9 @@
39
49
  "webpack-dev-server": "^5.2.2"
40
50
  },
41
51
  "scripts": {
42
- "build": "npm run build-node && npm run build-bundler",
52
+ "build": "pnpm run build-node && pnpm run build-bundler && pnpm run build-slim",
43
53
  "build-node": "wasm-pack build --out-dir pkg-node --target nodejs --release -- --features ingest_static",
44
- "build-bundler": "wasm-pack build --out-dir pkg --target bundler --release -- --features ingest_static"
54
+ "build-bundler": "wasm-pack build --out-dir pkg --target bundler --release -- --features ingest_static",
55
+ "build-slim": "node build_slim.js"
45
56
  }
46
57
  }
@@ -10,17 +10,20 @@ export function setPanicHook(): void;
10
10
  export class Access {
11
11
  private constructor();
12
12
  free(): void;
13
+ [Symbol.dispose](): void;
13
14
  static tryFromString(s: string): Access | undefined;
14
15
  toString(): string;
15
16
  }
16
17
  export class AddMemberError {
17
18
  private constructor();
18
19
  free(): void;
20
+ [Symbol.dispose](): void;
19
21
  message(): string;
20
22
  }
21
23
  export class Agent {
22
24
  private constructor();
23
25
  free(): void;
26
+ [Symbol.dispose](): void;
24
27
  toString(): string;
25
28
  isIndividual(): boolean;
26
29
  isGroup(): boolean;
@@ -29,6 +32,7 @@ export class Agent {
29
32
  }
30
33
  export class Archive {
31
34
  free(): void;
35
+ [Symbol.dispose](): void;
32
36
  constructor(bytes: Uint8Array);
33
37
  toBytes(): Uint8Array;
34
38
  tryToKeyhive(ciphertext_store: CiphertextStore, signer: Signer, event_handler: Function): Keyhive;
@@ -36,14 +40,17 @@ export class Archive {
36
40
  export class CannotParseEd25519SigningKey {
37
41
  private constructor();
38
42
  free(): void;
43
+ [Symbol.dispose](): void;
39
44
  }
40
45
  export class CannotParseIdentifier {
41
46
  private constructor();
42
47
  free(): void;
48
+ [Symbol.dispose](): void;
43
49
  }
44
50
  export class Capability {
45
51
  private constructor();
46
52
  free(): void;
53
+ [Symbol.dispose](): void;
47
54
  readonly who: Agent;
48
55
  readonly can: Access;
49
56
  readonly proof: SignedDelegation;
@@ -51,22 +58,26 @@ export class Capability {
51
58
  export class CgkaOperation {
52
59
  private constructor();
53
60
  free(): void;
61
+ [Symbol.dispose](): void;
54
62
  readonly variant: string;
55
63
  }
56
64
  export class ChangeRef {
57
65
  free(): void;
66
+ [Symbol.dispose](): void;
58
67
  constructor(bytes: Uint8Array);
59
68
  readonly bytes: Uint8Array;
60
69
  }
61
70
  export class CiphertextStore {
62
71
  private constructor();
63
72
  free(): void;
73
+ [Symbol.dispose](): void;
64
74
  static newInMemory(): CiphertextStore;
65
75
  static newFromWebStorage(storage: Storage): CiphertextStore;
66
76
  }
67
77
  export class ContactCard {
68
78
  private constructor();
69
79
  free(): void;
80
+ [Symbol.dispose](): void;
70
81
  signature(): Uint8Array;
71
82
  static fromJson(json: string): ContactCard;
72
83
  toJson(): string;
@@ -76,6 +87,7 @@ export class ContactCard {
76
87
  export class Delegation {
77
88
  private constructor();
78
89
  free(): void;
90
+ [Symbol.dispose](): void;
79
91
  readonly delegate: Agent;
80
92
  readonly can: Access;
81
93
  readonly proof: SignedDelegation | undefined;
@@ -84,9 +96,11 @@ export class Delegation {
84
96
  export class DelegationError {
85
97
  private constructor();
86
98
  free(): void;
99
+ [Symbol.dispose](): void;
87
100
  }
88
101
  export class DocContentRefs {
89
102
  free(): void;
103
+ [Symbol.dispose](): void;
90
104
  constructor(doc_id: DocumentId, change_hashes: ChangeRef[]);
91
105
  addChangeRef(hash: ChangeRef): void;
92
106
  readonly docId: DocumentId;
@@ -95,6 +109,7 @@ export class DocContentRefs {
95
109
  export class Document {
96
110
  private constructor();
97
111
  free(): void;
112
+ [Symbol.dispose](): void;
98
113
  toPeer(): Peer;
99
114
  toAgent(): Agent;
100
115
  readonly id: Identifier;
@@ -102,6 +117,7 @@ export class Document {
102
117
  }
103
118
  export class DocumentId {
104
119
  free(): void;
120
+ [Symbol.dispose](): void;
105
121
  constructor(bytes: Uint8Array);
106
122
  fromString(): string;
107
123
  toJsValue(): any;
@@ -110,6 +126,7 @@ export class DocumentId {
110
126
  export class Encrypted {
111
127
  private constructor();
112
128
  free(): void;
129
+ [Symbol.dispose](): void;
113
130
  toBytes(): Uint8Array;
114
131
  readonly ciphertext: Uint8Array;
115
132
  readonly nonce: Uint8Array;
@@ -120,12 +137,14 @@ export class Encrypted {
120
137
  export class EncryptedContentWithUpdate {
121
138
  private constructor();
122
139
  free(): void;
140
+ [Symbol.dispose](): void;
123
141
  encrypted_content(): Encrypted;
124
142
  update_op(): SignedCgkaOperation | undefined;
125
143
  }
126
144
  export class Event {
127
145
  private constructor();
128
146
  free(): void;
147
+ [Symbol.dispose](): void;
129
148
  tryIntoSignedDelegation(): SignedDelegation | undefined;
130
149
  tryIntoSignedRevocation(): SignedRevocation | undefined;
131
150
  readonly variant: string;
@@ -135,21 +154,25 @@ export class Event {
135
154
  export class GenerateDocError {
136
155
  private constructor();
137
156
  free(): void;
157
+ [Symbol.dispose](): void;
138
158
  message(): string;
139
159
  }
140
160
  export class GenerateWebCryptoError {
141
161
  private constructor();
142
162
  free(): void;
163
+ [Symbol.dispose](): void;
143
164
  message(): string;
144
165
  }
145
166
  export class GetCiphertextError {
146
167
  private constructor();
147
168
  free(): void;
169
+ [Symbol.dispose](): void;
148
170
  readonly message: string;
149
171
  }
150
172
  export class Group {
151
173
  private constructor();
152
174
  free(): void;
175
+ [Symbol.dispose](): void;
153
176
  toPeer(): Peer;
154
177
  toAgent(): Agent;
155
178
  toMembered(): Membered;
@@ -160,23 +183,27 @@ export class Group {
160
183
  export class GroupId {
161
184
  private constructor();
162
185
  free(): void;
186
+ [Symbol.dispose](): void;
163
187
  toString(): string;
164
188
  }
165
189
  export class History {
166
190
  private constructor();
167
191
  free(): void;
192
+ [Symbol.dispose](): void;
168
193
  delegations(): SignedDelegation[];
169
194
  revocations(): SignedRevocation[];
170
195
  contentRefs(): DocContentRefs[];
171
196
  }
172
197
  export class Identifier {
173
198
  free(): void;
199
+ [Symbol.dispose](): void;
174
200
  constructor(bytes: Uint8Array);
175
201
  toBytes(): Uint8Array;
176
202
  }
177
203
  export class Individual {
178
204
  private constructor();
179
205
  free(): void;
206
+ [Symbol.dispose](): void;
180
207
  toPeer(): Peer;
181
208
  toAgent(): Agent;
182
209
  pickPrekey(doc_id: DocumentId): ShareKey;
@@ -186,31 +213,38 @@ export class Individual {
186
213
  export class IndividualId {
187
214
  private constructor();
188
215
  free(): void;
216
+ [Symbol.dispose](): void;
189
217
  readonly bytes: Uint8Array;
190
218
  }
191
219
  export class Invocation {
192
220
  private constructor();
193
221
  free(): void;
222
+ [Symbol.dispose](): void;
194
223
  }
195
224
  export class JsDecryptError {
196
225
  private constructor();
197
226
  free(): void;
227
+ [Symbol.dispose](): void;
198
228
  }
199
229
  export class JsEncryptError {
200
230
  private constructor();
201
231
  free(): void;
232
+ [Symbol.dispose](): void;
202
233
  }
203
234
  export class JsReceivePreKeyOpError {
204
235
  private constructor();
205
236
  free(): void;
237
+ [Symbol.dispose](): void;
206
238
  }
207
239
  export class JsReceiveStaticEventError {
208
240
  private constructor();
209
241
  free(): void;
242
+ [Symbol.dispose](): void;
210
243
  }
211
244
  export class Keyhive {
212
245
  private constructor();
213
246
  free(): void;
247
+ [Symbol.dispose](): void;
214
248
  static init(signer: Signer, ciphertext_store: CiphertextStore, event_handler: Function): Promise<Keyhive>;
215
249
  generateGroup(coparents: Peer[]): Promise<Group>;
216
250
  generateDocument(coparents: Peer[], initial_content_ref_head: ChangeRef, more_initial_content_refs: ChangeRef[]): Promise<Document>;
@@ -240,10 +274,12 @@ export class Keyhive {
240
274
  export class Membered {
241
275
  private constructor();
242
276
  free(): void;
277
+ [Symbol.dispose](): void;
243
278
  }
244
279
  export class Peer {
245
280
  private constructor();
246
281
  free(): void;
282
+ [Symbol.dispose](): void;
247
283
  toString(): string;
248
284
  isIndividual(): boolean;
249
285
  isGroup(): boolean;
@@ -252,10 +288,12 @@ export class Peer {
252
288
  export class RemoveCiphertextError {
253
289
  private constructor();
254
290
  free(): void;
291
+ [Symbol.dispose](): void;
255
292
  }
256
293
  export class Revocation {
257
294
  private constructor();
258
295
  free(): void;
296
+ [Symbol.dispose](): void;
259
297
  readonly subject_id: Identifier;
260
298
  readonly revoked: SignedDelegation;
261
299
  readonly proof: SignedDelegation | undefined;
@@ -264,20 +302,24 @@ export class Revocation {
264
302
  export class RevokeMemberError {
265
303
  private constructor();
266
304
  free(): void;
305
+ [Symbol.dispose](): void;
267
306
  readonly message: string;
268
307
  }
269
308
  export class SerializationError {
270
309
  private constructor();
271
310
  free(): void;
311
+ [Symbol.dispose](): void;
272
312
  toError(): any;
273
313
  }
274
314
  export class ShareKey {
275
315
  private constructor();
276
316
  free(): void;
317
+ [Symbol.dispose](): void;
277
318
  }
278
319
  export class Signed {
279
320
  private constructor();
280
321
  free(): void;
322
+ [Symbol.dispose](): void;
281
323
  static fromBytes(bytes: Uint8Array): Signed;
282
324
  toBytes(): Uint8Array;
283
325
  verify(): boolean;
@@ -288,6 +330,7 @@ export class Signed {
288
330
  export class SignedCgkaOperation {
289
331
  private constructor();
290
332
  free(): void;
333
+ [Symbol.dispose](): void;
291
334
  verify(): boolean;
292
335
  readonly delegation: CgkaOperation;
293
336
  readonly verifyingKey: Uint8Array;
@@ -296,6 +339,7 @@ export class SignedCgkaOperation {
296
339
  export class SignedDelegation {
297
340
  private constructor();
298
341
  free(): void;
342
+ [Symbol.dispose](): void;
299
343
  verify(): boolean;
300
344
  readonly delegation: Delegation;
301
345
  readonly verifyingKey: Uint8Array;
@@ -304,10 +348,12 @@ export class SignedDelegation {
304
348
  export class SignedInvocation {
305
349
  private constructor();
306
350
  free(): void;
351
+ [Symbol.dispose](): void;
307
352
  }
308
353
  export class SignedRevocation {
309
354
  private constructor();
310
355
  free(): void;
356
+ [Symbol.dispose](): void;
311
357
  verify(): boolean;
312
358
  readonly delegation: Revocation;
313
359
  readonly verifyingKey: Uint8Array;
@@ -316,6 +362,7 @@ export class SignedRevocation {
316
362
  export class Signer {
317
363
  private constructor();
318
364
  free(): void;
365
+ [Symbol.dispose](): void;
319
366
  static generate(): Promise<Signer>;
320
367
  static generateMemory(): Signer;
321
368
  static generateWebCrypto(): Promise<Signer>;
@@ -329,22 +376,26 @@ export class Signer {
329
376
  export class SigningError {
330
377
  private constructor();
331
378
  free(): void;
379
+ [Symbol.dispose](): void;
332
380
  message(): string;
333
381
  }
334
382
  export class SimpleCapability {
335
383
  private constructor();
336
384
  free(): void;
385
+ [Symbol.dispose](): void;
337
386
  readonly who: Agent;
338
387
  readonly can: Access;
339
388
  }
340
389
  export class Summary {
341
390
  private constructor();
342
391
  free(): void;
392
+ [Symbol.dispose](): void;
343
393
  readonly doc: Document;
344
394
  readonly access: Access;
345
395
  }
346
396
  export class TryFromArchiveError {
347
397
  private constructor();
348
398
  free(): void;
399
+ [Symbol.dispose](): void;
349
400
  toError(): any;
350
401
  }