@keyhive/keyhive 0.0.0-alpha.0 → 0.0.0-alpha.1

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.0",
3
+ "version": "0.0.0-alpha.1",
4
4
  "description": "",
5
5
  "main": "pkg/keyhive_wasm.js",
6
6
  "keywords": [],
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "scripts": {
42
42
  "build": "npm run build-node && npm run build-bundler",
43
- "build-node": "wasm-pack build --out-dir pkg-node --target nodejs --release",
44
- "build-bundler": "wasm-pack build --out-dir pkg --target bundler --release"
43
+ "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"
45
45
  }
46
46
  }
@@ -232,6 +232,7 @@ export class Keyhive {
232
232
  accessForDoc(id: Identifier, doc_id: DocumentId): Access | undefined;
233
233
  intoArchive(): Archive;
234
234
  toArchive(): Archive;
235
+ ingestArchive(archive: Archive): Promise<void>;
235
236
  readonly id: IndividualId;
236
237
  readonly whoami: IndividualId;
237
238
  readonly idString: string;
@@ -255,16 +255,6 @@ function _assertClass(instance, klass) {
255
255
  throw new Error(`expected instance of ${klass.name}`);
256
256
  }
257
257
  }
258
-
259
- function passArrayJsValueToWasm0(array, malloc) {
260
- const ptr = malloc(array.length * 4, 4) >>> 0;
261
- for (let i = 0; i < array.length; i++) {
262
- const add = addToExternrefTable0(array[i]);
263
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
264
- }
265
- WASM_VECTOR_LEN = array.length;
266
- return ptr;
267
- }
268
258
  /**
269
259
  * Panic hook lets us get better error messages if our Rust code ever panics.
270
260
  *
@@ -275,12 +265,21 @@ export function setPanicHook() {
275
265
  wasm.setPanicHook();
276
266
  }
277
267
 
268
+ function passArrayJsValueToWasm0(array, malloc) {
269
+ const ptr = malloc(array.length * 4, 4) >>> 0;
270
+ for (let i = 0; i < array.length; i++) {
271
+ const add = addToExternrefTable0(array[i]);
272
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
273
+ }
274
+ WASM_VECTOR_LEN = array.length;
275
+ return ptr;
276
+ }
278
277
  function __wbg_adapter_12(arg0, arg1, arg2) {
279
- wasm.closure388_externref_shim(arg0, arg1, arg2);
278
+ wasm.closure423_externref_shim(arg0, arg1, arg2);
280
279
  }
281
280
 
282
- function __wbg_adapter_269(arg0, arg1, arg2, arg3) {
283
- wasm.closure525_externref_shim(arg0, arg1, arg2, arg3);
281
+ function __wbg_adapter_272(arg0, arg1, arg2, arg3) {
282
+ wasm.closure571_externref_shim(arg0, arg1, arg2, arg3);
284
283
  }
285
284
 
286
285
  const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1850,6 +1849,14 @@ const JsReceiveStaticEventErrorFinalization = (typeof FinalizationRegistry === '
1850
1849
 
1851
1850
  export class JsReceiveStaticEventError {
1852
1851
 
1852
+ static __wrap(ptr) {
1853
+ ptr = ptr >>> 0;
1854
+ const obj = Object.create(JsReceiveStaticEventError.prototype);
1855
+ obj.__wbg_ptr = ptr;
1856
+ JsReceiveStaticEventErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1857
+ return obj;
1858
+ }
1859
+
1853
1860
  __destroy_into_raw() {
1854
1861
  const ptr = this.__wbg_ptr;
1855
1862
  this.__wbg_ptr = 0;
@@ -2161,6 +2168,15 @@ export class Keyhive {
2161
2168
  const ret = wasm.keyhive_toArchive(this.__wbg_ptr);
2162
2169
  return Archive.__wrap(ret);
2163
2170
  }
2171
+ /**
2172
+ * @param {Archive} archive
2173
+ * @returns {Promise<void>}
2174
+ */
2175
+ ingestArchive(archive) {
2176
+ _assertClass(archive, Archive);
2177
+ const ret = wasm.keyhive_ingestArchive(this.__wbg_ptr, archive.__wbg_ptr);
2178
+ return ret;
2179
+ }
2164
2180
  }
2165
2181
 
2166
2182
  const MemberedFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -3145,6 +3161,11 @@ export function __wbg_jsreceiveprekeyoperror_new(arg0) {
3145
3161
  return ret;
3146
3162
  };
3147
3163
 
3164
+ export function __wbg_jsreceivestaticeventerror_new(arg0) {
3165
+ const ret = JsReceiveStaticEventError.__wrap(arg0);
3166
+ return ret;
3167
+ };
3168
+
3148
3169
  export function __wbg_keyhive_new(arg0) {
3149
3170
  const ret = Keyhive.__wrap(arg0);
3150
3171
  return ret;
@@ -3177,7 +3198,7 @@ export function __wbg_new_d5e3800b120e37e1(arg0, arg1) {
3177
3198
  const a = state0.a;
3178
3199
  state0.a = 0;
3179
3200
  try {
3180
- return __wbg_adapter_269(a, state0.b, arg0, arg1);
3201
+ return __wbg_adapter_272(a, state0.b, arg0, arg1);
3181
3202
  } finally {
3182
3203
  state0.a = a;
3183
3204
  }
@@ -3397,9 +3418,9 @@ export function __wbg_wbindgenthrow_4c11a24fca429ccf(arg0, arg1) {
3397
3418
  throw new Error(getStringFromWasm0(arg0, arg1));
3398
3419
  };
3399
3420
 
3400
- export function __wbindgen_cast_068e29f6a3bbf711(arg0, arg1) {
3401
- // Cast intrinsic for `Closure(Closure { dtor_idx: 387, function: Function { arguments: [Externref], shim_idx: 388, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3402
- const ret = makeMutClosure(arg0, arg1, 387, __wbg_adapter_12);
3421
+ export function __wbindgen_cast_133053e9d0cd85aa(arg0, arg1) {
3422
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 422, function: Function { arguments: [Externref], shim_idx: 423, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3423
+ const ret = makeMutClosure(arg0, arg1, 422, __wbg_adapter_12);
3403
3424
  return ret;
3404
3425
  };
3405
3426
 
Binary file
@@ -1,8 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_signedinvocation_free: (a: number, b: number) => void;
5
- export const __wbg_invocation_free: (a: number, b: number) => void;
4
+ export const __wbg_changeref_free: (a: number, b: number) => void;
5
+ export const changeref_new: (a: number, b: number) => number;
6
+ export const changeref_bytes: (a: number) => [number, number];
7
+ export const __wbg_individualid_free: (a: number, b: number) => void;
8
+ export const individualid_bytes: (a: number) => [number, number];
6
9
  export const __wbg_archive_free: (a: number, b: number) => void;
7
10
  export const archive_try_from_bytes: (a: number, b: number) => [number, number, number];
8
11
  export const archive_toBytes: (a: number) => [number, number, number, number];
@@ -11,79 +14,24 @@ export const __wbg_tryfromarchiveerror_free: (a: number, b: number) => void;
11
14
  export const tryfromarchiveerror_toError: (a: number) => any;
12
15
  export const __wbg_serializationerror_free: (a: number, b: number) => void;
13
16
  export const serializationerror_toError: (a: number) => any;
14
- export const __wbg_signed_free: (a: number, b: number) => void;
15
- export const signed_fromBytes: (a: number, b: number) => number;
16
- export const signed_toBytes: (a: number) => [number, number];
17
- export const signed_verify: (a: number) => number;
18
- export const signed_payload: (a: number) => [number, number];
19
- export const signed_verifyingKey: (a: number) => [number, number];
20
- export const signed_signature: (a: number) => [number, number];
21
17
  export const __wbg_document_free: (a: number, b: number) => void;
22
18
  export const document_id: (a: number) => number;
23
19
  export const document_doc_id: (a: number) => number;
24
20
  export const document_toPeer: (a: number) => number;
25
21
  export const document_toAgent: (a: number) => number;
26
- export const __wbg_individual_free: (a: number, b: number) => void;
27
- export const individual_toPeer: (a: number) => number;
28
- export const individual_toAgent: (a: number) => number;
29
- export const individual_id: (a: number) => number;
30
- export const individual_individualId: (a: number) => number;
31
- export const individual_pickPrekey: (a: number, b: number) => number;
32
- export const __wbg_addmembererror_free: (a: number, b: number) => void;
33
- export const addmembererror_message: (a: number) => [number, number];
34
- export const __wbg_changeref_free: (a: number, b: number) => void;
35
- export const changeref_new: (a: number, b: number) => number;
36
- export const changeref_bytes: (a: number) => [number, number];
37
- export const __wbg_ciphertextstore_free: (a: number, b: number) => void;
38
- export const ciphertextstore_newInMemory: () => number;
39
- export const ciphertextstore_newFromWebStorage: (a: any) => number;
40
- export const __wbg_removeciphertexterror_free: (a: number, b: number) => void;
41
- export const __wbg_getciphertexterror_free: (a: number, b: number) => void;
42
- export const getciphertexterror_message: (a: number) => [number, number];
43
- export const __wbg_contactcard_free: (a: number, b: number) => void;
44
- export const contactcard_id: (a: number) => number;
45
- export const contactcard_shareKey: (a: number) => number;
46
- export const contactcard_signature: (a: number) => [number, number];
47
- export const contactcard_fromJson: (a: number, b: number) => [number, number, number];
48
- export const contactcard_toJson: (a: number) => [number, number, number, number];
49
- export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
50
- export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
51
- export const doccontentrefs_addChangeRef: (a: number, b: number) => void;
52
- export const doccontentrefs_docId: (a: number) => number;
53
- export const doccontentrefs_change_hashes: (a: number) => [number, number];
54
- export const __wbg_documentid_free: (a: number, b: number) => void;
55
- export const documentid_new: (a: number, b: number) => [number, number, number];
56
- export const documentid_fromString: (a: number) => [number, number];
57
- export const documentid_toJsValue: (a: number) => any;
58
- export const documentid_toBytes: (a: number) => [number, number];
59
- export const __wbg_encrypted_free: (a: number, b: number) => void;
60
- export const encrypted_ciphertext: (a: number) => [number, number];
61
- export const encrypted_nonce: (a: number) => [number, number];
62
- export const encrypted_pcs_key_hash: (a: number) => [number, number];
63
- export const encrypted_content_ref: (a: number) => [number, number];
64
- export const encrypted_pred_refs: (a: number) => [number, number];
65
- export const __wbg_history_free: (a: number, b: number) => void;
66
- export const history_delegations: (a: number) => [number, number];
67
- export const history_revocations: (a: number) => [number, number];
68
- export const history_contentRefs: (a: number) => [number, number];
69
- export const __wbg_revokemembererror_free: (a: number, b: number) => void;
70
- export const revokemembererror_message: (a: number) => [number, number];
71
- export const __wbg_signer_free: (a: number, b: number) => void;
72
- export const signer_generate: () => any;
73
- export const signer_generateMemory: () => number;
74
- export const signer_generateWebCrypto: () => any;
75
- export const signer_memorySignerFromBytes: (a: number, b: number) => [number, number, number];
76
- export const signer_webCryptoSigner: (a: any) => any;
77
- export const signer_variant: (a: number) => [number, number];
78
- export const signer_trySign: (a: number, b: number, c: number) => any;
79
- export const signer_verifyingKey: (a: number) => [number, number];
80
- export const signer_clone: (a: number) => number;
81
- export const __wbg_cannotparseed25519signingkey_free: (a: number, b: number) => void;
82
- export const __wbg_generatewebcryptoerror_free: (a: number, b: number) => void;
83
- export const generatewebcryptoerror_message: (a: number) => [number, number];
84
- export const __wbg_signingerror_free: (a: number, b: number) => void;
85
- export const signingerror_message: (a: number) => [number, number];
86
- export const encrypted_toBytes: (a: number) => [number, number];
22
+ export const __wbg_group_free: (a: number, b: number) => void;
23
+ export const group_id: (a: number) => number;
24
+ export const group_groupId: (a: number) => number;
25
+ export const group_members: (a: number) => [number, number];
26
+ export const group_toPeer: (a: number) => number;
27
+ export const group_toAgent: (a: number) => number;
28
+ export const group_toMembered: (a: number) => number;
29
+ export const __wbg_invocation_free: (a: number, b: number) => void;
30
+ export const __wbg_membered_free: (a: number, b: number) => void;
31
+ export const __wbg_signedinvocation_free: (a: number, b: number) => void;
32
+ export const __wbg_summary_free: (a: number, b: number) => void;
33
+ export const summary_doc: (a: number) => number;
34
+ export const summary_access: (a: number) => number;
87
35
  export const __wbg_access_free: (a: number, b: number) => void;
88
36
  export const access_tryFromString: (a: number, b: number) => number;
89
37
  export const access_toString: (a: number) => [number, number];
@@ -100,14 +48,18 @@ export const capability_proof: (a: number) => number;
100
48
  export const __wbg_simplecapability_free: (a: number, b: number) => void;
101
49
  export const simplecapability_who: (a: number) => number;
102
50
  export const simplecapability_can: (a: number) => number;
103
- export const __wbg_cgkaoperation_free: (a: number, b: number) => void;
104
- export const cgkaoperation_variant: (a: number) => [number, number];
105
51
  export const __wbg_delegation_free: (a: number, b: number) => void;
106
52
  export const delegation_delegate: (a: number) => number;
107
53
  export const delegation_can: (a: number) => number;
108
54
  export const delegation_proof: (a: number) => number;
109
55
  export const delegation_after: (a: number) => number;
110
56
  export const __wbg_delegationerror_free: (a: number, b: number) => void;
57
+ export const __wbg_encrypted_free: (a: number, b: number) => void;
58
+ export const encrypted_ciphertext: (a: number) => [number, number];
59
+ export const encrypted_nonce: (a: number) => [number, number];
60
+ export const encrypted_pcs_key_hash: (a: number) => [number, number];
61
+ export const encrypted_content_ref: (a: number) => [number, number];
62
+ export const encrypted_pred_refs: (a: number) => [number, number];
111
63
  export const __wbg_encryptedcontentwithupdate_free: (a: number, b: number) => void;
112
64
  export const encryptedcontentwithupdate_encrypted_content: (a: number) => number;
113
65
  export const encryptedcontentwithupdate_update_op: (a: number) => number;
@@ -119,11 +71,10 @@ export const event_tryIntoSignedDelegation: (a: number) => number;
119
71
  export const event_tryIntoSignedRevocation: (a: number) => number;
120
72
  export const __wbg_generatedocerror_free: (a: number, b: number) => void;
121
73
  export const generatedocerror_message: (a: number) => [number, number];
122
- export const __wbg_groupid_free: (a: number, b: number) => void;
123
- export const groupid_toString: (a: number) => [number, number];
124
- export const __wbg_individualid_free: (a: number, b: number) => void;
125
- export const individualid_bytes: (a: number) => [number, number];
126
- export const __wbg_membered_free: (a: number, b: number) => void;
74
+ export const __wbg_history_free: (a: number, b: number) => void;
75
+ export const history_delegations: (a: number) => [number, number];
76
+ export const history_revocations: (a: number) => [number, number];
77
+ export const history_contentRefs: (a: number) => [number, number];
127
78
  export const __wbg_peer_free: (a: number, b: number) => void;
128
79
  export const peer_toString: (a: number) => [number, number];
129
80
  export const peer_isIndividual: (a: number) => number;
@@ -134,6 +85,14 @@ export const revocation_subject_id: (a: number) => number;
134
85
  export const revocation_revoked: (a: number) => number;
135
86
  export const revocation_proof: (a: number) => number;
136
87
  export const revocation_after: (a: number) => number;
88
+ export const __wbg_sharekey_free: (a: number, b: number) => void;
89
+ export const __wbg_signed_free: (a: number, b: number) => void;
90
+ export const signed_fromBytes: (a: number, b: number) => number;
91
+ export const signed_toBytes: (a: number) => [number, number];
92
+ export const signed_verify: (a: number) => number;
93
+ export const signed_payload: (a: number) => [number, number];
94
+ export const signed_verifyingKey: (a: number) => [number, number];
95
+ export const signed_signature: (a: number) => [number, number];
137
96
  export const __wbg_signedcgkaoperation_free: (a: number, b: number) => void;
138
97
  export const signedcgkaoperation_verify: (a: number) => number;
139
98
  export const signedcgkaoperation_delegation: (a: number) => number;
@@ -149,20 +108,8 @@ export const signedrevocation_verify: (a: number) => number;
149
108
  export const signedrevocation_delegation: (a: number) => number;
150
109
  export const signedrevocation_verifyingKey: (a: number) => [number, number];
151
110
  export const signedrevocation_signature: (a: number) => [number, number];
152
- export const __wbg_summary_free: (a: number, b: number) => void;
153
- export const summary_doc: (a: number) => number;
154
- export const summary_access: (a: number) => number;
155
- export const __wbg_group_free: (a: number, b: number) => void;
156
- export const group_id: (a: number) => number;
157
- export const group_groupId: (a: number) => number;
158
- export const group_members: (a: number) => [number, number];
159
- export const group_toPeer: (a: number) => number;
160
- export const group_toAgent: (a: number) => number;
161
- export const group_toMembered: (a: number) => number;
162
- export const __wbg_identifier_free: (a: number, b: number) => void;
163
- export const identifier_new: (a: number, b: number) => [number, number, number];
164
- export const identifier_toBytes: (a: number) => [number, number];
165
- export const __wbg_cannotparseidentifier_free: (a: number, b: number) => void;
111
+ export const setPanicHook: () => void;
112
+ export const encrypted_toBytes: (a: number) => [number, number];
166
113
  export const __wbg_keyhive_free: (a: number, b: number) => void;
167
114
  export const keyhive_init: (a: number, b: number, c: any) => any;
168
115
  export const keyhive_id: (a: number) => number;
@@ -187,13 +134,67 @@ export const keyhive_docMemberCapabilities: (a: number, b: number) => [number, n
187
134
  export const keyhive_accessForDoc: (a: number, b: number, c: number) => number;
188
135
  export const keyhive_intoArchive: (a: number) => number;
189
136
  export const keyhive_toArchive: (a: number) => number;
137
+ export const keyhive_ingestArchive: (a: number, b: number) => any;
190
138
  export const __wbg_jsreceiveprekeyoperror_free: (a: number, b: number) => void;
191
139
  export const __wbg_jsencrypterror_free: (a: number, b: number) => void;
192
140
  export const __wbg_jsdecrypterror_free: (a: number, b: number) => void;
193
141
  export const __wbg_jsreceivestaticeventerror_free: (a: number, b: number) => void;
194
142
  export const keyhive_whoami: (a: number) => number;
195
- export const __wbg_sharekey_free: (a: number, b: number) => void;
196
- export const setPanicHook: () => void;
143
+ export const __wbg_addmembererror_free: (a: number, b: number) => void;
144
+ export const addmembererror_message: (a: number) => [number, number];
145
+ export const __wbg_cgkaoperation_free: (a: number, b: number) => void;
146
+ export const cgkaoperation_variant: (a: number) => [number, number];
147
+ export const __wbg_ciphertextstore_free: (a: number, b: number) => void;
148
+ export const ciphertextstore_newInMemory: () => number;
149
+ export const ciphertextstore_newFromWebStorage: (a: any) => number;
150
+ export const __wbg_removeciphertexterror_free: (a: number, b: number) => void;
151
+ export const __wbg_getciphertexterror_free: (a: number, b: number) => void;
152
+ export const getciphertexterror_message: (a: number) => [number, number];
153
+ export const __wbg_contactcard_free: (a: number, b: number) => void;
154
+ export const contactcard_id: (a: number) => number;
155
+ export const contactcard_shareKey: (a: number) => number;
156
+ export const contactcard_signature: (a: number) => [number, number];
157
+ export const contactcard_fromJson: (a: number, b: number) => [number, number, number];
158
+ export const contactcard_toJson: (a: number) => [number, number, number, number];
159
+ export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
160
+ export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
161
+ export const doccontentrefs_addChangeRef: (a: number, b: number) => void;
162
+ export const doccontentrefs_docId: (a: number) => number;
163
+ export const doccontentrefs_change_hashes: (a: number) => [number, number];
164
+ export const __wbg_documentid_free: (a: number, b: number) => void;
165
+ export const documentid_new: (a: number, b: number) => [number, number, number];
166
+ export const documentid_fromString: (a: number) => [number, number];
167
+ export const documentid_toJsValue: (a: number) => any;
168
+ export const documentid_toBytes: (a: number) => [number, number];
169
+ export const __wbg_groupid_free: (a: number, b: number) => void;
170
+ export const groupid_toString: (a: number) => [number, number];
171
+ export const __wbg_identifier_free: (a: number, b: number) => void;
172
+ export const identifier_toBytes: (a: number) => [number, number];
173
+ export const __wbg_cannotparseidentifier_free: (a: number, b: number) => void;
174
+ export const __wbg_individual_free: (a: number, b: number) => void;
175
+ export const individual_toPeer: (a: number) => number;
176
+ export const individual_toAgent: (a: number) => number;
177
+ export const individual_id: (a: number) => number;
178
+ export const individual_individualId: (a: number) => number;
179
+ export const individual_pickPrekey: (a: number, b: number) => number;
180
+ export const __wbg_revokemembererror_free: (a: number, b: number) => void;
181
+ export const revokemembererror_message: (a: number) => [number, number];
182
+ export const __wbg_signer_free: (a: number, b: number) => void;
183
+ export const signer_generate: () => any;
184
+ export const signer_generateMemory: () => number;
185
+ export const signer_generateWebCrypto: () => any;
186
+ export const signer_memorySignerFromBytes: (a: number, b: number) => [number, number, number];
187
+ export const signer_webCryptoSigner: (a: any) => any;
188
+ export const signer_variant: (a: number) => [number, number];
189
+ export const signer_trySign: (a: number, b: number, c: number) => any;
190
+ export const signer_verifyingKey: (a: number) => [number, number];
191
+ export const signer_clone: (a: number) => number;
192
+ export const __wbg_cannotparseed25519signingkey_free: (a: number, b: number) => void;
193
+ export const __wbg_generatewebcryptoerror_free: (a: number, b: number) => void;
194
+ export const generatewebcryptoerror_message: (a: number) => [number, number];
195
+ export const __wbg_signingerror_free: (a: number, b: number) => void;
196
+ export const signingerror_message: (a: number) => [number, number];
197
+ export const identifier_new: (a: number, b: number) => [number, number, number];
197
198
  export const __wbindgen_exn_store: (a: number) => void;
198
199
  export const __externref_table_alloc: () => number;
199
200
  export const __wbindgen_export_2: WebAssembly.Table;
@@ -203,6 +204,6 @@ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) =>
203
204
  export const __wbindgen_export_6: WebAssembly.Table;
204
205
  export const __externref_drop_slice: (a: number, b: number) => void;
205
206
  export const __externref_table_dealloc: (a: number) => void;
206
- export const closure388_externref_shim: (a: number, b: number, c: any) => void;
207
- export const closure525_externref_shim: (a: number, b: number, c: any, d: any) => void;
207
+ export const closure423_externref_shim: (a: number, b: number, c: any) => void;
208
+ export const closure571_externref_shim: (a: number, b: number, c: any, d: any) => void;
208
209
  export const __wbindgen_start: () => void;
@@ -232,6 +232,7 @@ export class Keyhive {
232
232
  accessForDoc(id: Identifier, doc_id: DocumentId): Access | undefined;
233
233
  intoArchive(): Archive;
234
234
  toArchive(): Archive;
235
+ ingestArchive(archive: Archive): Promise<void>;
235
236
  readonly id: IndividualId;
236
237
  readonly whoami: IndividualId;
237
238
  readonly idString: string;
@@ -243,16 +243,6 @@ function _assertClass(instance, klass) {
243
243
  throw new Error(`expected instance of ${klass.name}`);
244
244
  }
245
245
  }
246
-
247
- function passArrayJsValueToWasm0(array, malloc) {
248
- const ptr = malloc(array.length * 4, 4) >>> 0;
249
- for (let i = 0; i < array.length; i++) {
250
- const add = addToExternrefTable0(array[i]);
251
- getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
252
- }
253
- WASM_VECTOR_LEN = array.length;
254
- return ptr;
255
- }
256
246
  /**
257
247
  * Panic hook lets us get better error messages if our Rust code ever panics.
258
248
  *
@@ -263,12 +253,21 @@ module.exports.setPanicHook = function() {
263
253
  wasm.setPanicHook();
264
254
  };
265
255
 
266
- function __wbg_adapter_12(arg0, arg1, arg2) {
267
- wasm.closure388_externref_shim(arg0, arg1, arg2);
256
+ function passArrayJsValueToWasm0(array, malloc) {
257
+ const ptr = malloc(array.length * 4, 4) >>> 0;
258
+ for (let i = 0; i < array.length; i++) {
259
+ const add = addToExternrefTable0(array[i]);
260
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
261
+ }
262
+ WASM_VECTOR_LEN = array.length;
263
+ return ptr;
264
+ }
265
+ function __wbg_adapter_8(arg0, arg1, arg2) {
266
+ wasm.closure423_externref_shim(arg0, arg1, arg2);
268
267
  }
269
268
 
270
- function __wbg_adapter_269(arg0, arg1, arg2, arg3) {
271
- wasm.closure525_externref_shim(arg0, arg1, arg2, arg3);
269
+ function __wbg_adapter_272(arg0, arg1, arg2, arg3) {
270
+ wasm.closure571_externref_shim(arg0, arg1, arg2, arg3);
272
271
  }
273
272
 
274
273
  const AccessFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1870,6 +1869,14 @@ const JsReceiveStaticEventErrorFinalization = (typeof FinalizationRegistry === '
1870
1869
 
1871
1870
  class JsReceiveStaticEventError {
1872
1871
 
1872
+ static __wrap(ptr) {
1873
+ ptr = ptr >>> 0;
1874
+ const obj = Object.create(JsReceiveStaticEventError.prototype);
1875
+ obj.__wbg_ptr = ptr;
1876
+ JsReceiveStaticEventErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1877
+ return obj;
1878
+ }
1879
+
1873
1880
  __destroy_into_raw() {
1874
1881
  const ptr = this.__wbg_ptr;
1875
1882
  this.__wbg_ptr = 0;
@@ -2182,6 +2189,15 @@ class Keyhive {
2182
2189
  const ret = wasm.keyhive_toArchive(this.__wbg_ptr);
2183
2190
  return Archive.__wrap(ret);
2184
2191
  }
2192
+ /**
2193
+ * @param {Archive} archive
2194
+ * @returns {Promise<void>}
2195
+ */
2196
+ ingestArchive(archive) {
2197
+ _assertClass(archive, Archive);
2198
+ const ret = wasm.keyhive_ingestArchive(this.__wbg_ptr, archive.__wbg_ptr);
2199
+ return ret;
2200
+ }
2185
2201
  }
2186
2202
  module.exports.Keyhive = Keyhive;
2187
2203
 
@@ -3184,6 +3200,11 @@ module.exports.__wbg_jsreceiveprekeyoperror_new = function(arg0) {
3184
3200
  return ret;
3185
3201
  };
3186
3202
 
3203
+ module.exports.__wbg_jsreceivestaticeventerror_new = function(arg0) {
3204
+ const ret = JsReceiveStaticEventError.__wrap(arg0);
3205
+ return ret;
3206
+ };
3207
+
3187
3208
  module.exports.__wbg_keyhive_new = function(arg0) {
3188
3209
  const ret = Keyhive.__wrap(arg0);
3189
3210
  return ret;
@@ -3216,7 +3237,7 @@ module.exports.__wbg_new_d5e3800b120e37e1 = function(arg0, arg1) {
3216
3237
  const a = state0.a;
3217
3238
  state0.a = 0;
3218
3239
  try {
3219
- return __wbg_adapter_269(a, state0.b, arg0, arg1);
3240
+ return __wbg_adapter_272(a, state0.b, arg0, arg1);
3220
3241
  } finally {
3221
3242
  state0.a = a;
3222
3243
  }
@@ -3436,9 +3457,9 @@ module.exports.__wbg_wbindgenthrow_4c11a24fca429ccf = function(arg0, arg1) {
3436
3457
  throw new Error(getStringFromWasm0(arg0, arg1));
3437
3458
  };
3438
3459
 
3439
- module.exports.__wbindgen_cast_068e29f6a3bbf711 = function(arg0, arg1) {
3440
- // Cast intrinsic for `Closure(Closure { dtor_idx: 387, function: Function { arguments: [Externref], shim_idx: 388, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3441
- const ret = makeMutClosure(arg0, arg1, 387, __wbg_adapter_12);
3460
+ module.exports.__wbindgen_cast_133053e9d0cd85aa = function(arg0, arg1) {
3461
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 422, function: Function { arguments: [Externref], shim_idx: 423, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
3462
+ const ret = makeMutClosure(arg0, arg1, 422, __wbg_adapter_8);
3442
3463
  return ret;
3443
3464
  };
3444
3465
 
Binary file
@@ -1,8 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_signedinvocation_free: (a: number, b: number) => void;
5
- export const __wbg_invocation_free: (a: number, b: number) => void;
4
+ export const __wbg_changeref_free: (a: number, b: number) => void;
5
+ export const changeref_new: (a: number, b: number) => number;
6
+ export const changeref_bytes: (a: number) => [number, number];
7
+ export const __wbg_individualid_free: (a: number, b: number) => void;
8
+ export const individualid_bytes: (a: number) => [number, number];
6
9
  export const __wbg_archive_free: (a: number, b: number) => void;
7
10
  export const archive_try_from_bytes: (a: number, b: number) => [number, number, number];
8
11
  export const archive_toBytes: (a: number) => [number, number, number, number];
@@ -11,79 +14,24 @@ export const __wbg_tryfromarchiveerror_free: (a: number, b: number) => void;
11
14
  export const tryfromarchiveerror_toError: (a: number) => any;
12
15
  export const __wbg_serializationerror_free: (a: number, b: number) => void;
13
16
  export const serializationerror_toError: (a: number) => any;
14
- export const __wbg_signed_free: (a: number, b: number) => void;
15
- export const signed_fromBytes: (a: number, b: number) => number;
16
- export const signed_toBytes: (a: number) => [number, number];
17
- export const signed_verify: (a: number) => number;
18
- export const signed_payload: (a: number) => [number, number];
19
- export const signed_verifyingKey: (a: number) => [number, number];
20
- export const signed_signature: (a: number) => [number, number];
21
17
  export const __wbg_document_free: (a: number, b: number) => void;
22
18
  export const document_id: (a: number) => number;
23
19
  export const document_doc_id: (a: number) => number;
24
20
  export const document_toPeer: (a: number) => number;
25
21
  export const document_toAgent: (a: number) => number;
26
- export const __wbg_individual_free: (a: number, b: number) => void;
27
- export const individual_toPeer: (a: number) => number;
28
- export const individual_toAgent: (a: number) => number;
29
- export const individual_id: (a: number) => number;
30
- export const individual_individualId: (a: number) => number;
31
- export const individual_pickPrekey: (a: number, b: number) => number;
32
- export const __wbg_addmembererror_free: (a: number, b: number) => void;
33
- export const addmembererror_message: (a: number) => [number, number];
34
- export const __wbg_changeref_free: (a: number, b: number) => void;
35
- export const changeref_new: (a: number, b: number) => number;
36
- export const changeref_bytes: (a: number) => [number, number];
37
- export const __wbg_ciphertextstore_free: (a: number, b: number) => void;
38
- export const ciphertextstore_newInMemory: () => number;
39
- export const ciphertextstore_newFromWebStorage: (a: any) => number;
40
- export const __wbg_removeciphertexterror_free: (a: number, b: number) => void;
41
- export const __wbg_getciphertexterror_free: (a: number, b: number) => void;
42
- export const getciphertexterror_message: (a: number) => [number, number];
43
- export const __wbg_contactcard_free: (a: number, b: number) => void;
44
- export const contactcard_id: (a: number) => number;
45
- export const contactcard_shareKey: (a: number) => number;
46
- export const contactcard_signature: (a: number) => [number, number];
47
- export const contactcard_fromJson: (a: number, b: number) => [number, number, number];
48
- export const contactcard_toJson: (a: number) => [number, number, number, number];
49
- export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
50
- export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
51
- export const doccontentrefs_addChangeRef: (a: number, b: number) => void;
52
- export const doccontentrefs_docId: (a: number) => number;
53
- export const doccontentrefs_change_hashes: (a: number) => [number, number];
54
- export const __wbg_documentid_free: (a: number, b: number) => void;
55
- export const documentid_new: (a: number, b: number) => [number, number, number];
56
- export const documentid_fromString: (a: number) => [number, number];
57
- export const documentid_toJsValue: (a: number) => any;
58
- export const documentid_toBytes: (a: number) => [number, number];
59
- export const __wbg_encrypted_free: (a: number, b: number) => void;
60
- export const encrypted_ciphertext: (a: number) => [number, number];
61
- export const encrypted_nonce: (a: number) => [number, number];
62
- export const encrypted_pcs_key_hash: (a: number) => [number, number];
63
- export const encrypted_content_ref: (a: number) => [number, number];
64
- export const encrypted_pred_refs: (a: number) => [number, number];
65
- export const __wbg_history_free: (a: number, b: number) => void;
66
- export const history_delegations: (a: number) => [number, number];
67
- export const history_revocations: (a: number) => [number, number];
68
- export const history_contentRefs: (a: number) => [number, number];
69
- export const __wbg_revokemembererror_free: (a: number, b: number) => void;
70
- export const revokemembererror_message: (a: number) => [number, number];
71
- export const __wbg_signer_free: (a: number, b: number) => void;
72
- export const signer_generate: () => any;
73
- export const signer_generateMemory: () => number;
74
- export const signer_generateWebCrypto: () => any;
75
- export const signer_memorySignerFromBytes: (a: number, b: number) => [number, number, number];
76
- export const signer_webCryptoSigner: (a: any) => any;
77
- export const signer_variant: (a: number) => [number, number];
78
- export const signer_trySign: (a: number, b: number, c: number) => any;
79
- export const signer_verifyingKey: (a: number) => [number, number];
80
- export const signer_clone: (a: number) => number;
81
- export const __wbg_cannotparseed25519signingkey_free: (a: number, b: number) => void;
82
- export const __wbg_generatewebcryptoerror_free: (a: number, b: number) => void;
83
- export const generatewebcryptoerror_message: (a: number) => [number, number];
84
- export const __wbg_signingerror_free: (a: number, b: number) => void;
85
- export const signingerror_message: (a: number) => [number, number];
86
- export const encrypted_toBytes: (a: number) => [number, number];
22
+ export const __wbg_group_free: (a: number, b: number) => void;
23
+ export const group_id: (a: number) => number;
24
+ export const group_groupId: (a: number) => number;
25
+ export const group_members: (a: number) => [number, number];
26
+ export const group_toPeer: (a: number) => number;
27
+ export const group_toAgent: (a: number) => number;
28
+ export const group_toMembered: (a: number) => number;
29
+ export const __wbg_invocation_free: (a: number, b: number) => void;
30
+ export const __wbg_membered_free: (a: number, b: number) => void;
31
+ export const __wbg_signedinvocation_free: (a: number, b: number) => void;
32
+ export const __wbg_summary_free: (a: number, b: number) => void;
33
+ export const summary_doc: (a: number) => number;
34
+ export const summary_access: (a: number) => number;
87
35
  export const __wbg_access_free: (a: number, b: number) => void;
88
36
  export const access_tryFromString: (a: number, b: number) => number;
89
37
  export const access_toString: (a: number) => [number, number];
@@ -100,14 +48,18 @@ export const capability_proof: (a: number) => number;
100
48
  export const __wbg_simplecapability_free: (a: number, b: number) => void;
101
49
  export const simplecapability_who: (a: number) => number;
102
50
  export const simplecapability_can: (a: number) => number;
103
- export const __wbg_cgkaoperation_free: (a: number, b: number) => void;
104
- export const cgkaoperation_variant: (a: number) => [number, number];
105
51
  export const __wbg_delegation_free: (a: number, b: number) => void;
106
52
  export const delegation_delegate: (a: number) => number;
107
53
  export const delegation_can: (a: number) => number;
108
54
  export const delegation_proof: (a: number) => number;
109
55
  export const delegation_after: (a: number) => number;
110
56
  export const __wbg_delegationerror_free: (a: number, b: number) => void;
57
+ export const __wbg_encrypted_free: (a: number, b: number) => void;
58
+ export const encrypted_ciphertext: (a: number) => [number, number];
59
+ export const encrypted_nonce: (a: number) => [number, number];
60
+ export const encrypted_pcs_key_hash: (a: number) => [number, number];
61
+ export const encrypted_content_ref: (a: number) => [number, number];
62
+ export const encrypted_pred_refs: (a: number) => [number, number];
111
63
  export const __wbg_encryptedcontentwithupdate_free: (a: number, b: number) => void;
112
64
  export const encryptedcontentwithupdate_encrypted_content: (a: number) => number;
113
65
  export const encryptedcontentwithupdate_update_op: (a: number) => number;
@@ -119,11 +71,10 @@ export const event_tryIntoSignedDelegation: (a: number) => number;
119
71
  export const event_tryIntoSignedRevocation: (a: number) => number;
120
72
  export const __wbg_generatedocerror_free: (a: number, b: number) => void;
121
73
  export const generatedocerror_message: (a: number) => [number, number];
122
- export const __wbg_groupid_free: (a: number, b: number) => void;
123
- export const groupid_toString: (a: number) => [number, number];
124
- export const __wbg_individualid_free: (a: number, b: number) => void;
125
- export const individualid_bytes: (a: number) => [number, number];
126
- export const __wbg_membered_free: (a: number, b: number) => void;
74
+ export const __wbg_history_free: (a: number, b: number) => void;
75
+ export const history_delegations: (a: number) => [number, number];
76
+ export const history_revocations: (a: number) => [number, number];
77
+ export const history_contentRefs: (a: number) => [number, number];
127
78
  export const __wbg_peer_free: (a: number, b: number) => void;
128
79
  export const peer_toString: (a: number) => [number, number];
129
80
  export const peer_isIndividual: (a: number) => number;
@@ -134,6 +85,14 @@ export const revocation_subject_id: (a: number) => number;
134
85
  export const revocation_revoked: (a: number) => number;
135
86
  export const revocation_proof: (a: number) => number;
136
87
  export const revocation_after: (a: number) => number;
88
+ export const __wbg_sharekey_free: (a: number, b: number) => void;
89
+ export const __wbg_signed_free: (a: number, b: number) => void;
90
+ export const signed_fromBytes: (a: number, b: number) => number;
91
+ export const signed_toBytes: (a: number) => [number, number];
92
+ export const signed_verify: (a: number) => number;
93
+ export const signed_payload: (a: number) => [number, number];
94
+ export const signed_verifyingKey: (a: number) => [number, number];
95
+ export const signed_signature: (a: number) => [number, number];
137
96
  export const __wbg_signedcgkaoperation_free: (a: number, b: number) => void;
138
97
  export const signedcgkaoperation_verify: (a: number) => number;
139
98
  export const signedcgkaoperation_delegation: (a: number) => number;
@@ -149,20 +108,8 @@ export const signedrevocation_verify: (a: number) => number;
149
108
  export const signedrevocation_delegation: (a: number) => number;
150
109
  export const signedrevocation_verifyingKey: (a: number) => [number, number];
151
110
  export const signedrevocation_signature: (a: number) => [number, number];
152
- export const __wbg_summary_free: (a: number, b: number) => void;
153
- export const summary_doc: (a: number) => number;
154
- export const summary_access: (a: number) => number;
155
- export const __wbg_group_free: (a: number, b: number) => void;
156
- export const group_id: (a: number) => number;
157
- export const group_groupId: (a: number) => number;
158
- export const group_members: (a: number) => [number, number];
159
- export const group_toPeer: (a: number) => number;
160
- export const group_toAgent: (a: number) => number;
161
- export const group_toMembered: (a: number) => number;
162
- export const __wbg_identifier_free: (a: number, b: number) => void;
163
- export const identifier_new: (a: number, b: number) => [number, number, number];
164
- export const identifier_toBytes: (a: number) => [number, number];
165
- export const __wbg_cannotparseidentifier_free: (a: number, b: number) => void;
111
+ export const setPanicHook: () => void;
112
+ export const encrypted_toBytes: (a: number) => [number, number];
166
113
  export const __wbg_keyhive_free: (a: number, b: number) => void;
167
114
  export const keyhive_init: (a: number, b: number, c: any) => any;
168
115
  export const keyhive_id: (a: number) => number;
@@ -187,13 +134,67 @@ export const keyhive_docMemberCapabilities: (a: number, b: number) => [number, n
187
134
  export const keyhive_accessForDoc: (a: number, b: number, c: number) => number;
188
135
  export const keyhive_intoArchive: (a: number) => number;
189
136
  export const keyhive_toArchive: (a: number) => number;
137
+ export const keyhive_ingestArchive: (a: number, b: number) => any;
190
138
  export const __wbg_jsreceiveprekeyoperror_free: (a: number, b: number) => void;
191
139
  export const __wbg_jsencrypterror_free: (a: number, b: number) => void;
192
140
  export const __wbg_jsdecrypterror_free: (a: number, b: number) => void;
193
141
  export const __wbg_jsreceivestaticeventerror_free: (a: number, b: number) => void;
194
142
  export const keyhive_whoami: (a: number) => number;
195
- export const __wbg_sharekey_free: (a: number, b: number) => void;
196
- export const setPanicHook: () => void;
143
+ export const __wbg_addmembererror_free: (a: number, b: number) => void;
144
+ export const addmembererror_message: (a: number) => [number, number];
145
+ export const __wbg_cgkaoperation_free: (a: number, b: number) => void;
146
+ export const cgkaoperation_variant: (a: number) => [number, number];
147
+ export const __wbg_ciphertextstore_free: (a: number, b: number) => void;
148
+ export const ciphertextstore_newInMemory: () => number;
149
+ export const ciphertextstore_newFromWebStorage: (a: any) => number;
150
+ export const __wbg_removeciphertexterror_free: (a: number, b: number) => void;
151
+ export const __wbg_getciphertexterror_free: (a: number, b: number) => void;
152
+ export const getciphertexterror_message: (a: number) => [number, number];
153
+ export const __wbg_contactcard_free: (a: number, b: number) => void;
154
+ export const contactcard_id: (a: number) => number;
155
+ export const contactcard_shareKey: (a: number) => number;
156
+ export const contactcard_signature: (a: number) => [number, number];
157
+ export const contactcard_fromJson: (a: number, b: number) => [number, number, number];
158
+ export const contactcard_toJson: (a: number) => [number, number, number, number];
159
+ export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
160
+ export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
161
+ export const doccontentrefs_addChangeRef: (a: number, b: number) => void;
162
+ export const doccontentrefs_docId: (a: number) => number;
163
+ export const doccontentrefs_change_hashes: (a: number) => [number, number];
164
+ export const __wbg_documentid_free: (a: number, b: number) => void;
165
+ export const documentid_new: (a: number, b: number) => [number, number, number];
166
+ export const documentid_fromString: (a: number) => [number, number];
167
+ export const documentid_toJsValue: (a: number) => any;
168
+ export const documentid_toBytes: (a: number) => [number, number];
169
+ export const __wbg_groupid_free: (a: number, b: number) => void;
170
+ export const groupid_toString: (a: number) => [number, number];
171
+ export const __wbg_identifier_free: (a: number, b: number) => void;
172
+ export const identifier_toBytes: (a: number) => [number, number];
173
+ export const __wbg_cannotparseidentifier_free: (a: number, b: number) => void;
174
+ export const __wbg_individual_free: (a: number, b: number) => void;
175
+ export const individual_toPeer: (a: number) => number;
176
+ export const individual_toAgent: (a: number) => number;
177
+ export const individual_id: (a: number) => number;
178
+ export const individual_individualId: (a: number) => number;
179
+ export const individual_pickPrekey: (a: number, b: number) => number;
180
+ export const __wbg_revokemembererror_free: (a: number, b: number) => void;
181
+ export const revokemembererror_message: (a: number) => [number, number];
182
+ export const __wbg_signer_free: (a: number, b: number) => void;
183
+ export const signer_generate: () => any;
184
+ export const signer_generateMemory: () => number;
185
+ export const signer_generateWebCrypto: () => any;
186
+ export const signer_memorySignerFromBytes: (a: number, b: number) => [number, number, number];
187
+ export const signer_webCryptoSigner: (a: any) => any;
188
+ export const signer_variant: (a: number) => [number, number];
189
+ export const signer_trySign: (a: number, b: number, c: number) => any;
190
+ export const signer_verifyingKey: (a: number) => [number, number];
191
+ export const signer_clone: (a: number) => number;
192
+ export const __wbg_cannotparseed25519signingkey_free: (a: number, b: number) => void;
193
+ export const __wbg_generatewebcryptoerror_free: (a: number, b: number) => void;
194
+ export const generatewebcryptoerror_message: (a: number) => [number, number];
195
+ export const __wbg_signingerror_free: (a: number, b: number) => void;
196
+ export const signingerror_message: (a: number) => [number, number];
197
+ export const identifier_new: (a: number, b: number) => [number, number, number];
197
198
  export const __wbindgen_exn_store: (a: number) => void;
198
199
  export const __externref_table_alloc: () => number;
199
200
  export const __wbindgen_export_2: WebAssembly.Table;
@@ -203,6 +204,6 @@ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) =>
203
204
  export const __wbindgen_export_6: WebAssembly.Table;
204
205
  export const __externref_drop_slice: (a: number, b: number) => void;
205
206
  export const __externref_table_dealloc: (a: number) => void;
206
- export const closure388_externref_shim: (a: number, b: number, c: any) => void;
207
- export const closure525_externref_shim: (a: number, b: number, c: any, d: any) => void;
207
+ export const closure423_externref_shim: (a: number, b: number, c: any) => void;
208
+ export const closure571_externref_shim: (a: number, b: number, c: any, d: any) => void;
208
209
  export const __wbindgen_start: () => void;