@keyhive/keyhive 0.0.0-alpha.37 → 0.0.0-alpha.38

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.37",
3
+ "version": "0.0.0-alpha.38",
4
4
  "description": "",
5
5
  "main": "pkg/keyhive_wasm.js",
6
6
  "keywords": [],
@@ -140,11 +140,6 @@ export class Event {
140
140
  [Symbol.dispose](): void;
141
141
  tryIntoSignedDelegation(): SignedDelegation | undefined;
142
142
  tryIntoSignedRevocation(): SignedRevocation | undefined;
143
- /**
144
- * Converts the underlying [`Event`] to a [`StaticEvent`] and then
145
- * serializes it.
146
- */
147
- toBytes(): Uint8Array;
148
143
  readonly variant: string;
149
144
  readonly isDelegated: boolean;
150
145
  readonly isRevoked: boolean;
@@ -235,7 +230,6 @@ export class Keyhive {
235
230
  intoArchive(): Promise<Archive>;
236
231
  toArchive(): Promise<Archive>;
237
232
  ingestArchive(archive: Archive): Promise<void>;
238
- ingestEventsBytes(events_bytes_array: Array<any>): Promise<Array<any>>;
239
233
  stats(): Promise<Stats>;
240
234
  readonly id: IndividualId;
241
235
  readonly whoami: IndividualId;
@@ -340,6 +334,12 @@ export class Stats {
340
334
  private constructor();
341
335
  free(): void;
342
336
  [Symbol.dispose](): void;
337
+ toString(): string;
338
+ readonly individuals: bigint;
339
+ readonly groups: bigint;
340
+ readonly docs: bigint;
341
+ readonly delegations: bigint;
342
+ readonly revocations: bigint;
343
343
  }
344
344
  export class Summary {
345
345
  private constructor();
@@ -4,6 +4,21 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
6
 
7
+ function addToExternrefTable0(obj) {
8
+ const idx = wasm.__externref_table_alloc();
9
+ wasm.__wbindgen_export_2.set(idx, obj);
10
+ return idx;
11
+ }
12
+
13
+ function handleError(f, args) {
14
+ try {
15
+ return f.apply(this, args);
16
+ } catch (e) {
17
+ const idx = addToExternrefTable0(e);
18
+ wasm.__wbindgen_exn_store(idx);
19
+ }
20
+ }
21
+
7
22
  let cachedUint8ArrayMemory0 = null;
8
23
 
9
24
  function getUint8ArrayMemory0() {
@@ -34,21 +49,6 @@ function getStringFromWasm0(ptr, len) {
34
49
  return decodeText(ptr, len);
35
50
  }
36
51
 
37
- function addToExternrefTable0(obj) {
38
- const idx = wasm.__externref_table_alloc();
39
- wasm.__wbindgen_export_2.set(idx, obj);
40
- return idx;
41
- }
42
-
43
- function handleError(f, args) {
44
- try {
45
- return f.apply(this, args);
46
- } catch (e) {
47
- const idx = addToExternrefTable0(e);
48
- wasm.__wbindgen_exn_store(idx);
49
- }
50
- }
51
-
52
52
  function getArrayU8FromWasm0(ptr, len) {
53
53
  ptr = ptr >>> 0;
54
54
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -192,11 +192,22 @@ function debugString(val) {
192
192
  return className;
193
193
  }
194
194
 
195
+ function getArrayJsValueFromWasm0(ptr, len) {
196
+ ptr = ptr >>> 0;
197
+ const mem = getDataViewMemory0();
198
+ const result = [];
199
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
200
+ result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
201
+ }
202
+ wasm.__externref_drop_slice(ptr, len);
203
+ return result;
204
+ }
205
+
195
206
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
196
207
  ? { register: () => {}, unregister: () => {} }
197
208
  : new FinalizationRegistry(
198
209
  state => {
199
- wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
210
+ wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b);
200
211
  }
201
212
  );
202
213
 
@@ -214,7 +225,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
214
225
  return f(a, state.b, ...args);
215
226
  } finally {
216
227
  if (--state.cnt === 0) {
217
- wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
228
+ wasm.__wbindgen_export_7.get(state.dtor)(a, state.b);
218
229
  CLOSURE_DTORS.unregister(state);
219
230
  } else {
220
231
  state.a = a;
@@ -226,15 +237,14 @@ function makeMutClosure(arg0, arg1, dtor, f) {
226
237
  return real;
227
238
  }
228
239
 
229
- function getArrayJsValueFromWasm0(ptr, len) {
230
- ptr = ptr >>> 0;
231
- const mem = getDataViewMemory0();
232
- const result = [];
233
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
234
- result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
240
+ function passArrayJsValueToWasm0(array, malloc) {
241
+ const ptr = malloc(array.length * 4, 4) >>> 0;
242
+ for (let i = 0; i < array.length; i++) {
243
+ const add = addToExternrefTable0(array[i]);
244
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
235
245
  }
236
- wasm.__externref_drop_slice(ptr, len);
237
- return result;
246
+ WASM_VECTOR_LEN = array.length;
247
+ return ptr;
238
248
  }
239
249
 
240
250
  function passArray8ToWasm0(arg, malloc) {
@@ -249,16 +259,6 @@ function takeFromExternrefTable0(idx) {
249
259
  wasm.__externref_table_dealloc(idx);
250
260
  return value;
251
261
  }
252
-
253
- function passArrayJsValueToWasm0(array, malloc) {
254
- const ptr = malloc(array.length * 4, 4) >>> 0;
255
- for (let i = 0; i < array.length; i++) {
256
- const add = addToExternrefTable0(array[i]);
257
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
258
- }
259
- WASM_VECTOR_LEN = array.length;
260
- return ptr;
261
- }
262
262
  /**
263
263
  * Panic hook lets us get better error messages if our Rust code ever panics.
264
264
  *
@@ -269,12 +269,12 @@ export function setPanicHook() {
269
269
  wasm.setPanicHook();
270
270
  }
271
271
 
272
- function __wbg_adapter_12(arg0, arg1, arg2) {
273
- wasm.closure422_externref_shim(arg0, arg1, arg2);
272
+ function __wbg_adapter_14(arg0, arg1, arg2) {
273
+ wasm.closure427_externref_shim(arg0, arg1, arg2);
274
274
  }
275
275
 
276
- function __wbg_adapter_309(arg0, arg1, arg2, arg3) {
277
- wasm.closure580_externref_shim(arg0, arg1, arg2, arg3);
276
+ function __wbg_adapter_305(arg0, arg1, arg2, arg3) {
277
+ wasm.closure584_externref_shim(arg0, arg1, arg2, arg3);
278
278
  }
279
279
 
280
280
  const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1273,20 +1273,6 @@ export class Event {
1273
1273
  const ret = wasm.event_tryIntoSignedRevocation(this.__wbg_ptr);
1274
1274
  return ret === 0 ? undefined : SignedRevocation.__wrap(ret);
1275
1275
  }
1276
- /**
1277
- * Converts the underlying [`Event`] to a [`StaticEvent`] and then
1278
- * serializes it.
1279
- * @returns {Uint8Array}
1280
- */
1281
- toBytes() {
1282
- const ret = wasm.event_toBytes(this.__wbg_ptr);
1283
- if (ret[3]) {
1284
- throw takeFromExternrefTable0(ret[2]);
1285
- }
1286
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1287
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1288
- return v1;
1289
- }
1290
1276
  }
1291
1277
  if (Symbol.dispose) Event.prototype[Symbol.dispose] = Event.prototype.free;
1292
1278
 
@@ -1362,14 +1348,14 @@ export class Group {
1362
1348
  * @returns {Identifier}
1363
1349
  */
1364
1350
  get id() {
1365
- const ret = wasm.group_groupId(this.__wbg_ptr);
1351
+ const ret = wasm.doccontentrefs_docId(this.__wbg_ptr);
1366
1352
  return Identifier.__wrap(ret);
1367
1353
  }
1368
1354
  /**
1369
1355
  * @returns {GroupId}
1370
1356
  */
1371
1357
  get groupId() {
1372
- const ret = wasm.group_groupId(this.__wbg_ptr);
1358
+ const ret = wasm.doccontentrefs_docId(this.__wbg_ptr);
1373
1359
  return GroupId.__wrap(ret);
1374
1360
  }
1375
1361
  /**
@@ -1987,14 +1973,6 @@ export class Keyhive {
1987
1973
  const ret = wasm.keyhive_ingestArchive(this.__wbg_ptr, archive.__wbg_ptr);
1988
1974
  return ret;
1989
1975
  }
1990
- /**
1991
- * @param {Array<any>} events_bytes_array
1992
- * @returns {Promise<Array<any>>}
1993
- */
1994
- ingestEventsBytes(events_bytes_array) {
1995
- const ret = wasm.keyhive_ingestEventsBytes(this.__wbg_ptr, events_bytes_array);
1996
- return ret;
1997
- }
1998
1976
  /**
1999
1977
  * @returns {Promise<Stats>}
2000
1978
  */
@@ -2104,7 +2082,7 @@ export class Peer {
2104
2082
  * @returns {Identifier}
2105
2083
  */
2106
2084
  get id() {
2107
- const ret = wasm.doccontentrefs_docId(this.__wbg_ptr);
2085
+ const ret = wasm.peer_id(this.__wbg_ptr);
2108
2086
  return Identifier.__wrap(ret);
2109
2087
  }
2110
2088
  /**
@@ -2660,6 +2638,56 @@ export class Stats {
2660
2638
  const ptr = this.__destroy_into_raw();
2661
2639
  wasm.__wbg_stats_free(ptr, 0);
2662
2640
  }
2641
+ /**
2642
+ * @returns {bigint}
2643
+ */
2644
+ get individuals() {
2645
+ const ret = wasm.stats_individuals(this.__wbg_ptr);
2646
+ return BigInt.asUintN(64, ret);
2647
+ }
2648
+ /**
2649
+ * @returns {bigint}
2650
+ */
2651
+ get groups() {
2652
+ const ret = wasm.stats_groups(this.__wbg_ptr);
2653
+ return BigInt.asUintN(64, ret);
2654
+ }
2655
+ /**
2656
+ * @returns {bigint}
2657
+ */
2658
+ get docs() {
2659
+ const ret = wasm.stats_docs(this.__wbg_ptr);
2660
+ return BigInt.asUintN(64, ret);
2661
+ }
2662
+ /**
2663
+ * @returns {bigint}
2664
+ */
2665
+ get delegations() {
2666
+ const ret = wasm.stats_delegations(this.__wbg_ptr);
2667
+ return BigInt.asUintN(64, ret);
2668
+ }
2669
+ /**
2670
+ * @returns {bigint}
2671
+ */
2672
+ get revocations() {
2673
+ const ret = wasm.stats_revocations(this.__wbg_ptr);
2674
+ return BigInt.asUintN(64, ret);
2675
+ }
2676
+ /**
2677
+ * @returns {string}
2678
+ */
2679
+ toString() {
2680
+ let deferred1_0;
2681
+ let deferred1_1;
2682
+ try {
2683
+ const ret = wasm.stats_toString(this.__wbg_ptr);
2684
+ deferred1_0 = ret[0];
2685
+ deferred1_1 = ret[1];
2686
+ return getStringFromWasm0(ret[0], ret[1]);
2687
+ } finally {
2688
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2689
+ }
2690
+ }
2663
2691
  }
2664
2692
  if (Symbol.dispose) Stats.prototype[Symbol.dispose] = Stats.prototype.free;
2665
2693
 
@@ -2705,11 +2733,6 @@ export class Summary {
2705
2733
  }
2706
2734
  if (Symbol.dispose) Summary.prototype[Symbol.dispose] = Summary.prototype.free;
2707
2735
 
2708
- export function __wbg_Error_e17e777aac105295(arg0, arg1) {
2709
- const ret = Error(getStringFromWasm0(arg0, arg1));
2710
- return ret;
2711
- };
2712
-
2713
2736
  export function __wbg_access_new(arg0) {
2714
2737
  const ret = Access.__wrap(arg0);
2715
2738
  return ret;
@@ -2869,11 +2892,6 @@ export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(fu
2869
2892
  arg0.getRandomValues(arg1);
2870
2893
  }, arguments) };
2871
2894
 
2872
- export function __wbg_get_0da715ceaecea5c8(arg0, arg1) {
2873
- const ret = arg0[arg1 >>> 0];
2874
- return ret;
2875
- };
2876
-
2877
2895
  export function __wbg_get_458e874b43b18b25() { return handleError(function (arg0, arg1) {
2878
2896
  const ret = Reflect.get(arg0, arg1);
2879
2897
  return ret;
@@ -2915,11 +2933,6 @@ export function __wbg_keyhive_new(arg0) {
2915
2933
  return ret;
2916
2934
  };
2917
2935
 
2918
- export function __wbg_length_186546c51cd61acd(arg0) {
2919
- const ret = arg0.length;
2920
- return ret;
2921
- };
2922
-
2923
2936
  export function __wbg_length_6bb7e81f9d7713e4(arg0) {
2924
2937
  const ret = arg0.length;
2925
2938
  return ret;
@@ -2980,11 +2993,6 @@ export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
2980
2993
  return ret;
2981
2994
  };
2982
2995
 
2983
- export function __wbg_new_1f3a344cf3123716() {
2984
- const ret = new Array();
2985
- return ret;
2986
- };
2987
-
2988
2996
  export function __wbg_new_2e3c58a15f39f5f9(arg0, arg1) {
2989
2997
  try {
2990
2998
  var state0 = {a: arg0, b: arg1};
@@ -2992,7 +3000,7 @@ export function __wbg_new_2e3c58a15f39f5f9(arg0, arg1) {
2992
3000
  const a = state0.a;
2993
3001
  state0.a = 0;
2994
3002
  try {
2995
- return __wbg_adapter_309(a, state0.b, arg0, arg1);
3003
+ return __wbg_adapter_305(a, state0.b, arg0, arg1);
2996
3004
  } finally {
2997
3005
  state0.a = a;
2998
3006
  }
@@ -3019,11 +3027,6 @@ export function __wbg_new_da9dc54c5db29dfa(arg0, arg1) {
3019
3027
  return ret;
3020
3028
  };
3021
3029
 
3022
- export function __wbg_newfromslice_074c56947bd43469(arg0, arg1) {
3023
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
3024
- return ret;
3025
- };
3026
-
3027
3030
  export function __wbg_newnoargs_254190557c45b4ec(arg0, arg1) {
3028
3031
  const ret = new Function(getStringFromWasm0(arg0, arg1));
3029
3032
  return ret;
@@ -3048,11 +3051,6 @@ export function __wbg_prototypesetcall_3d4a26c1ed734349(arg0, arg1, arg2) {
3048
3051
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
3049
3052
  };
3050
3053
 
3051
- export function __wbg_push_330b2eb93e4e1212(arg0, arg1) {
3052
- const ret = arg0.push(arg1);
3053
- return ret;
3054
- };
3055
-
3056
3054
  export function __wbg_queueMicrotask_25d0739ac89e8c88(arg0) {
3057
3055
  queueMicrotask(arg0);
3058
3056
  };
@@ -3261,12 +3259,6 @@ export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
3261
3259
  throw new Error(getStringFromWasm0(arg0, arg1));
3262
3260
  };
3263
3261
 
3264
- export function __wbindgen_cast_135e7c4dddfc5e2a(arg0, arg1) {
3265
- // Cast intrinsic for `Closure(Closure { dtor_idx: 421, function: Function { arguments: [Externref], shim_idx: 422, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3266
- const ret = makeMutClosure(arg0, arg1, 421, __wbg_adapter_12);
3267
- return ret;
3268
- };
3269
-
3270
3262
  export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
3271
3263
  // Cast intrinsic for `Ref(String) -> Externref`.
3272
3264
  const ret = getStringFromWasm0(arg0, arg1);
@@ -3281,6 +3273,12 @@ export function __wbindgen_cast_25a0a844437d0e92(arg0, arg1) {
3281
3273
  return ret;
3282
3274
  };
3283
3275
 
3276
+ export function __wbindgen_cast_31c2247b25467632(arg0, arg1) {
3277
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 426, function: Function { arguments: [Externref], shim_idx: 427, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3278
+ const ret = makeMutClosure(arg0, arg1, 426, __wbg_adapter_14);
3279
+ return ret;
3280
+ };
3281
+
3284
3282
  export function __wbindgen_cast_6300122139088863(arg0, arg1) {
3285
3283
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
3286
3284
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
Binary file