@keyhive/keyhive 0.0.0-alpha.57g → 0.0.0-alpha.58b

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.57g",
3
+ "version": "0.0.0-alpha.58b",
4
4
  "description": "",
5
5
  "main": "pkg/keyhive_wasm.js",
6
6
  "keywords": [],
@@ -163,6 +163,8 @@ export class Encrypted {
163
163
  private constructor();
164
164
  free(): void;
165
165
  [Symbol.dispose](): void;
166
+ static fromBytes(bytes: Uint8Array): Encrypted;
167
+ serialize(): Uint8Array;
166
168
  toBytes(): Uint8Array;
167
169
  readonly ciphertext: Uint8Array;
168
170
  readonly content_ref: Uint8Array;
@@ -831,6 +831,19 @@ export class Encrypted {
831
831
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
832
832
  return v1;
833
833
  }
834
+ /**
835
+ * @param {Uint8Array} bytes
836
+ * @returns {Encrypted}
837
+ */
838
+ static fromBytes(bytes) {
839
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
840
+ const len0 = WASM_VECTOR_LEN;
841
+ const ret = wasm.encrypted_fromBytes(ptr0, len0);
842
+ if (ret[2]) {
843
+ throw takeFromExternrefTable0(ret[1]);
844
+ }
845
+ return Encrypted.__wrap(ret[0]);
846
+ }
834
847
  /**
835
848
  * @returns {Uint8Array}
836
849
  */
@@ -858,6 +871,18 @@ export class Encrypted {
858
871
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
859
872
  return v1;
860
873
  }
874
+ /**
875
+ * @returns {Uint8Array}
876
+ */
877
+ serialize() {
878
+ const ret = wasm.encrypted_serialize(this.__wbg_ptr);
879
+ if (ret[3]) {
880
+ throw takeFromExternrefTable0(ret[2]);
881
+ }
882
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
883
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
884
+ return v1;
885
+ }
861
886
  /**
862
887
  * @returns {Uint8Array}
863
888
  */
@@ -2487,19 +2512,19 @@ export function __wbg_Error_bce6d499ff0a4aff(arg0, arg1) {
2487
2512
  const ret = Error(getStringFromWasm0(arg0, arg1));
2488
2513
  return ret;
2489
2514
  }
2490
- export function __wbg___wasm_refgen_toJsChangeId_6ccc69ca295f07d8(arg0) {
2515
+ export function __wbg___wasm_refgen_toJsChangeId_1a4e8d260f698820(arg0) {
2491
2516
  const ret = arg0.__wasm_refgen_toJsChangeId();
2492
2517
  _assertClass(ret, ChangeId);
2493
2518
  var ptr1 = ret.__destroy_into_raw();
2494
2519
  return ptr1;
2495
2520
  }
2496
- export function __wbg___wasm_refgen_toJsDocument_403a685db7b2e2de(arg0) {
2521
+ export function __wbg___wasm_refgen_toJsDocument_bb9bc0924846047d(arg0) {
2497
2522
  const ret = arg0.__wasm_refgen_toJsDocument();
2498
2523
  _assertClass(ret, Document);
2499
2524
  var ptr1 = ret.__destroy_into_raw();
2500
2525
  return ptr1;
2501
2526
  }
2502
- export function __wbg___wasm_refgen_toJsPeer_4156830842f18fa5(arg0) {
2527
+ export function __wbg___wasm_refgen_toJsPeer_17636bceb3369eeb(arg0) {
2503
2528
  const ret = arg0.__wasm_refgen_toJsPeer();
2504
2529
  _assertClass(ret, Peer);
2505
2530
  var ptr1 = ret.__destroy_into_raw();
@@ -2956,7 +2981,7 @@ export function __wbg_warn_9d7408e9659996aa(arg0, arg1, arg2, arg3, arg4, arg5,
2956
2981
  }
2957
2982
  }
2958
2983
  export function __wbindgen_cast_0000000000000001(arg0, arg1) {
2959
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 705, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2984
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 704, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2960
2985
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4e3599ad4d40dc92);
2961
2986
  return ret;
2962
2987
  }
Binary file
@@ -1,24 +1,16 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_agent_free: (a: number, b: number) => void;
5
4
  export const __wbg_allagentevents_free: (a: number, b: number) => void;
6
- export const __wbg_archive_free: (a: number, b: number) => void;
5
+ export const __wbg_capability_free: (a: number, b: number) => void;
7
6
  export const __wbg_ciphertextstore_free: (a: number, b: number) => void;
8
- export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
9
- export const __wbg_encryptedcontentwithupdate_free: (a: number, b: number) => void;
10
- export const __wbg_individual_free: (a: number, b: number) => void;
7
+ export const __wbg_delegation_free: (a: number, b: number) => void;
8
+ export const __wbg_document_free: (a: number, b: number) => void;
9
+ export const __wbg_group_free: (a: number, b: number) => void;
11
10
  export const __wbg_individualid_free: (a: number, b: number) => void;
12
- export const __wbg_keyhive_free: (a: number, b: number) => void;
13
- export const __wbg_peer_free: (a: number, b: number) => void;
14
- export const __wbg_signedcgkaoperation_free: (a: number, b: number) => void;
15
- export const agent_id: (a: number) => number;
16
- export const agent_isDocument: (a: number) => number;
17
- export const agent_isGroup: (a: number) => number;
18
- export const agent_isIndividual: (a: number) => number;
19
- export const agent_keyOpHashes: (a: number) => any;
20
- export const agent_keyOps: (a: number) => any;
21
- export const agent_toString: (a: number) => [number, number];
11
+ export const __wbg_membered_free: (a: number, b: number) => void;
12
+ export const __wbg_revocation_free: (a: number, b: number) => void;
13
+ export const __wbg_summary_free: (a: number, b: number) => void;
22
14
  export const allagentevents_agentCgkaSources: (a: number) => any;
23
15
  export const allagentevents_agentMembershipSources: (a: number) => any;
24
16
  export const allagentevents_agentPrekeySources: (a: number) => any;
@@ -26,91 +18,73 @@ export const allagentevents_cgkaSources: (a: number) => any;
26
18
  export const allagentevents_events: (a: number) => any;
27
19
  export const allagentevents_membershipSources: (a: number) => any;
28
20
  export const allagentevents_prekeySources: (a: number) => any;
29
- export const archive_toBytes: (a: number) => [number, number, number, number];
30
- export const archive_tryToKeyhive: (a: number, b: number, c: number, d: any) => any;
31
- export const archive_try_from_bytes: (a: number, b: number) => [number, number, number];
21
+ export const capability_can: (a: number) => number;
22
+ export const capability_proof: (a: number) => number;
23
+ export const capability_who: (a: number) => number;
32
24
  export const ciphertextstore_newFromWebStorage: (a: any) => number;
33
25
  export const ciphertextstore_newInMemory: () => number;
34
- export const doccontentrefs_addChangeId: (a: number, b: number) => any;
35
- export const doccontentrefs_change_hashes: (a: number) => any;
36
- export const doccontentrefs_docId: (a: number) => number;
37
- export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
38
- export const encryptedcontentwithupdate_encrypted_content: (a: number) => number;
39
- export const encryptedcontentwithupdate_update_op: (a: number) => number;
40
- export const individual_id: (a: number) => number;
41
- export const individual_individualId: (a: number) => number;
42
- export const individual_pickPrekey: (a: number, b: number) => any;
43
- export const individual_toAgent: (a: number) => number;
44
- export const individual_toPeer: (a: number) => number;
26
+ export const delegation_after: (a: number) => number;
27
+ export const delegation_can: (a: number) => number;
28
+ export const delegation_delegate: (a: number) => number;
29
+ export const delegation_proof: (a: number) => number;
30
+ export const document___wasm_refgen_toJsDocument: (a: number) => number;
31
+ export const document_doc_id: (a: number) => number;
32
+ export const document_id: (a: number) => number;
33
+ export const document_members: (a: number) => any;
34
+ export const document_toAgent: (a: number) => number;
35
+ export const document_toMembered: (a: number) => number;
36
+ export const document_toPeer: (a: number) => number;
37
+ export const group___wasm_refgen_toJsGroup: (a: number) => number;
38
+ export const group_members: (a: number) => any;
39
+ export const group_toAgent: (a: number) => number;
40
+ export const group_toMembered: (a: number) => number;
41
+ export const group_toPeer: (a: number) => number;
45
42
  export const individualid_bytes: (a: number) => [number, number];
46
- export const keyhive_accessForDoc: (a: number, b: number, c: number) => any;
47
- export const keyhive_addMember: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
48
- export const keyhive_allAgentEvents: (a: number) => any;
49
- export const keyhive_contactCard: (a: number) => any;
50
- export const keyhive_docMemberCapabilities: (a: number, b: number) => any;
51
- export const keyhive_eventHashesForAgent: (a: number, b: number) => any;
52
- export const keyhive_eventsForAgent: (a: number, b: number) => any;
53
- export const keyhive_expandPrekeys: (a: number) => any;
54
- export const keyhive_exportPrekeySecrets: (a: number) => any;
55
- export const keyhive_forcePcsUpdate: (a: number, b: number) => any;
56
- export const keyhive_generateDocument: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
57
- export const keyhive_generateGroup: (a: number, b: number, c: number) => any;
58
- export const keyhive_getAgent: (a: number, b: number) => any;
59
- export const keyhive_getDocument: (a: number, b: number) => any;
60
- export const keyhive_getExistingContactCard: (a: number) => any;
61
- export const keyhive_getGroup: (a: number, b: number) => any;
62
- export const keyhive_getIndividual: (a: number, b: number) => any;
63
- export const keyhive_id: (a: number) => number;
64
- export const keyhive_idString: (a: number) => [number, number];
65
- export const keyhive_importPrekeySecrets: (a: number, b: number, c: number) => any;
66
- export const keyhive_individual: (a: number) => any;
67
- export const keyhive_ingestArchive: (a: number, b: number) => any;
68
- export const keyhive_ingestEventsBytes: (a: number, b: any) => any;
69
- export const keyhive_init: (a: number, b: number, c: any) => any;
70
- export const keyhive_intoArchive: (a: number) => any;
71
- export const keyhive_membershipOpsForAgent: (a: number, b: number) => any;
72
- export const keyhive_pendingEventHashes: (a: number) => any;
73
- export const keyhive_reachableDocs: (a: number) => any;
74
- export const keyhive_receiveContactCard: (a: number, b: number) => any;
75
- export const keyhive_revokeMember: (a: number, b: number, c: number, d: number) => any;
76
- export const keyhive_revokedMembersForDoc: (a: number, b: number) => any;
77
- export const keyhive_rotatePrekey: (a: number, b: number) => any;
78
- export const keyhive_stats: (a: number) => any;
79
- export const keyhive_toArchive: (a: number) => any;
80
- export const keyhive_tryDecrypt: (a: number, b: number, c: number) => any;
81
- export const keyhive_tryEncrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
82
- export const keyhive_tryEncryptArchive: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
83
- export const keyhive_trySign: (a: number, b: number, c: number) => any;
84
- export const keyhive_whoami: (a: number) => number;
85
- export const peer___wasm_refgen_toJsPeer: (a: number) => number;
86
- export const peer_isDocument: (a: number) => number;
87
- export const peer_isGroup: (a: number) => number;
88
- export const peer_isIndividual: (a: number) => number;
89
- export const peer_toString: (a: number) => [number, number];
43
+ export const revocation_after: (a: number) => number;
44
+ export const revocation_proof: (a: number) => number;
45
+ export const revocation_revoked: (a: number) => number;
46
+ export const revocation_subject_id: (a: number) => number;
90
47
  export const setPanicHook: () => void;
91
- export const signedcgkaoperation_delegation: (a: number) => number;
92
- export const signedcgkaoperation_signature: (a: number) => [number, number];
93
- export const signedcgkaoperation_verify: (a: number) => number;
94
- export const signedcgkaoperation_verifyingKey: (a: number) => [number, number];
95
- export const peer_id: (a: number) => number;
96
- export const __wbg_changeid_free: (a: number, b: number) => void;
97
- export const __wbg_invocation_free: (a: number, b: number) => void;
98
- export const __wbg_sharekey_free: (a: number, b: number) => void;
99
- export const __wbg_signedinvocation_free: (a: number, b: number) => void;
100
- export const changeid___wasm_refgen_toJsChangeId: (a: number) => number;
101
- export const changeid_bytes: (a: number) => [number, number];
102
- export const changeid_new: (a: number, b: number) => number;
48
+ export const summary_access: (a: number) => number;
49
+ export const summary_doc: (a: number) => number;
50
+ export const group_groupId: (a: number) => number;
51
+ export const group_id: (a: number) => number;
103
52
  export const __wbg_access_free: (a: number, b: number) => void;
53
+ export const __wbg_signedinvocation_free: (a: number, b: number) => void;
54
+ export const __wbg_stats_free: (a: number, b: number) => void;
55
+ export const access_toString: (a: number) => [number, number];
56
+ export const access_tryFromString: (a: number, b: number) => number;
57
+ export const stats_activePrekeyCount: (a: number) => bigint;
58
+ export const stats_cgkaOperations: (a: number) => bigint;
59
+ export const stats_delegations: (a: number) => bigint;
60
+ export const stats_docs: (a: number) => bigint;
61
+ export const stats_groups: (a: number) => bigint;
62
+ export const stats_individuals: (a: number) => bigint;
63
+ export const stats_pendingCgkaOperation: (a: number) => bigint;
64
+ export const stats_pendingCgkaOperationByActive: (a: number) => bigint;
65
+ export const stats_pendingDelegated: (a: number) => bigint;
66
+ export const stats_pendingDelegatedByActive: (a: number) => bigint;
67
+ export const stats_pendingPrekeyRotated: (a: number) => bigint;
68
+ export const stats_pendingPrekeyRotatedByActive: (a: number) => bigint;
69
+ export const stats_pendingPrekeysExpanded: (a: number) => bigint;
70
+ export const stats_pendingPrekeysExpandedByActive: (a: number) => bigint;
71
+ export const stats_pendingRevoked: (a: number) => bigint;
72
+ export const stats_pendingRevokedByActive: (a: number) => bigint;
73
+ export const stats_prekeyRotations: (a: number) => bigint;
74
+ export const stats_prekeysExpanded: (a: number) => bigint;
75
+ export const stats_revocations: (a: number) => bigint;
76
+ export const stats_totalOps: (a: number) => bigint;
77
+ export const stats_totalPendingOps: (a: number) => bigint;
104
78
  export const __wbg_cannotparseed25519signingkey_free: (a: number, b: number) => void;
105
79
  export const __wbg_cgkaoperation_free: (a: number, b: number) => void;
106
80
  export const __wbg_contactcard_free: (a: number, b: number) => void;
107
81
  export const __wbg_documentid_free: (a: number, b: number) => void;
82
+ export const __wbg_encrypted_free: (a: number, b: number) => void;
108
83
  export const __wbg_event_free: (a: number, b: number) => void;
109
84
  export const __wbg_generatewebcryptoerror_free: (a: number, b: number) => void;
110
85
  export const __wbg_groupid_free: (a: number, b: number) => void;
86
+ export const __wbg_history_free: (a: number, b: number) => void;
111
87
  export const __wbg_signer_free: (a: number, b: number) => void;
112
- export const access_toString: (a: number) => [number, number];
113
- export const access_tryFromString: (a: number, b: number) => number;
114
88
  export const cgkaoperation_variant: (a: number) => [number, number];
115
89
  export const contactcard_fromJson: (a: number, b: number) => [number, number, number];
116
90
  export const contactcard_id: (a: number) => number;
@@ -123,6 +97,13 @@ export const documentid_new: (a: number, b: number) => [number, number, number];
123
97
  export const documentid_toBytes: (a: number) => [number, number];
124
98
  export const documentid_toJsValue: (a: number) => any;
125
99
  export const documentid_toString: (a: number) => [number, number];
100
+ export const encrypted_ciphertext: (a: number) => [number, number];
101
+ export const encrypted_content_ref: (a: number) => [number, number];
102
+ export const encrypted_fromBytes: (a: number, b: number) => [number, number, number];
103
+ export const encrypted_nonce: (a: number) => [number, number];
104
+ export const encrypted_pcs_key_hash: (a: number) => [number, number];
105
+ export const encrypted_pred_refs: (a: number) => [number, number];
106
+ export const encrypted_serialize: (a: number) => [number, number, number, number];
126
107
  export const event_isDelegated: (a: number) => number;
127
108
  export const event_isRevoked: (a: number) => number;
128
109
  export const event_toBytes: (a: number) => [number, number, number, number];
@@ -131,6 +112,9 @@ export const event_tryIntoSignedRevocation: (a: number) => number;
131
112
  export const event_variant: (a: number) => [number, number];
132
113
  export const generatewebcryptoerror_message: (a: number) => [number, number];
133
114
  export const groupid_toString: (a: number) => [number, number];
115
+ export const history_contentRefs: (a: number) => [number, number];
116
+ export const history_delegations: (a: number) => [number, number];
117
+ export const history_revocations: (a: number) => [number, number];
134
118
  export const signer_clone: (a: number) => number;
135
119
  export const signer_generate: () => any;
136
120
  export const signer_generateMemory: () => number;
@@ -140,58 +124,23 @@ export const signer_trySign: (a: number, b: number, c: number) => any;
140
124
  export const signer_variant: (a: number) => [number, number];
141
125
  export const signer_verifyingKey: (a: number) => [number, number];
142
126
  export const signer_webCryptoSigner: (a: any) => any;
143
- export const __wbg_capability_free: (a: number, b: number) => void;
144
- export const __wbg_delegation_free: (a: number, b: number) => void;
145
- export const __wbg_document_free: (a: number, b: number) => void;
146
- export const __wbg_encrypted_free: (a: number, b: number) => void;
147
- export const __wbg_group_free: (a: number, b: number) => void;
148
- export const __wbg_history_free: (a: number, b: number) => void;
149
- export const __wbg_membered_free: (a: number, b: number) => void;
150
- export const __wbg_revocation_free: (a: number, b: number) => void;
151
- export const __wbg_summary_free: (a: number, b: number) => void;
152
- export const capability_can: (a: number) => number;
153
- export const capability_proof: (a: number) => number;
154
- export const capability_who: (a: number) => number;
155
- export const delegation_after: (a: number) => number;
156
- export const delegation_can: (a: number) => number;
157
- export const delegation_delegate: (a: number) => number;
158
- export const delegation_proof: (a: number) => number;
159
- export const document___wasm_refgen_toJsDocument: (a: number) => number;
160
- export const document_doc_id: (a: number) => number;
161
- export const document_id: (a: number) => number;
162
- export const document_members: (a: number) => any;
163
- export const document_toAgent: (a: number) => number;
164
- export const document_toMembered: (a: number) => number;
165
- export const document_toPeer: (a: number) => number;
166
- export const encrypted_ciphertext: (a: number) => [number, number];
167
- export const encrypted_content_ref: (a: number) => [number, number];
168
- export const encrypted_nonce: (a: number) => [number, number];
169
- export const encrypted_pcs_key_hash: (a: number) => [number, number];
170
- export const encrypted_pred_refs: (a: number) => [number, number];
171
- export const group___wasm_refgen_toJsGroup: (a: number) => number;
172
- export const group_members: (a: number) => any;
173
- export const group_toAgent: (a: number) => number;
174
- export const group_toMembered: (a: number) => number;
175
- export const group_toPeer: (a: number) => number;
176
- export const history_contentRefs: (a: number) => [number, number];
177
- export const history_delegations: (a: number) => [number, number];
178
- export const history_revocations: (a: number) => [number, number];
179
- export const revocation_after: (a: number) => number;
180
- export const revocation_proof: (a: number) => number;
181
- export const revocation_revoked: (a: number) => number;
182
- export const revocation_subject_id: (a: number) => number;
183
- export const summary_access: (a: number) => number;
184
- export const summary_doc: (a: number) => number;
185
- export const group_groupId: (a: number) => number;
186
- export const group_id: (a: number) => number;
187
127
  export const encrypted_toBytes: (a: number) => [number, number];
128
+ export const __wbg_archive_free: (a: number, b: number) => void;
188
129
  export const __wbg_cannotparseidentifier_free: (a: number, b: number) => void;
130
+ export const __wbg_changeid_free: (a: number, b: number) => void;
189
131
  export const __wbg_identifier_free: (a: number, b: number) => void;
132
+ export const __wbg_invocation_free: (a: number, b: number) => void;
190
133
  export const __wbg_membership_free: (a: number, b: number) => void;
134
+ export const __wbg_sharekey_free: (a: number, b: number) => void;
191
135
  export const __wbg_signed_free: (a: number, b: number) => void;
192
136
  export const __wbg_signeddelegation_free: (a: number, b: number) => void;
193
137
  export const __wbg_signedrevocation_free: (a: number, b: number) => void;
194
- export const __wbg_stats_free: (a: number, b: number) => void;
138
+ export const archive_toBytes: (a: number) => [number, number, number, number];
139
+ export const archive_tryToKeyhive: (a: number, b: number, c: number, d: any) => any;
140
+ export const archive_try_from_bytes: (a: number, b: number) => [number, number, number];
141
+ export const changeid___wasm_refgen_toJsChangeId: (a: number) => number;
142
+ export const changeid_bytes: (a: number) => [number, number];
143
+ export const changeid_new: (a: number, b: number) => number;
195
144
  export const identifier_new: (a: number, b: number) => [number, number, number];
196
145
  export const identifier_publicId: () => number;
197
146
  export const identifier_toBytes: (a: number) => [number, number];
@@ -212,27 +161,80 @@ export const signedrevocation_delegation: (a: number) => number;
212
161
  export const signedrevocation_signature: (a: number) => [number, number];
213
162
  export const signedrevocation_verify: (a: number) => number;
214
163
  export const signedrevocation_verifyingKey: (a: number) => [number, number];
215
- export const stats_activePrekeyCount: (a: number) => bigint;
216
- export const stats_cgkaOperations: (a: number) => bigint;
217
- export const stats_delegations: (a: number) => bigint;
218
- export const stats_docs: (a: number) => bigint;
219
- export const stats_groups: (a: number) => bigint;
220
- export const stats_individuals: (a: number) => bigint;
221
- export const stats_pendingCgkaOperation: (a: number) => bigint;
222
- export const stats_pendingCgkaOperationByActive: (a: number) => bigint;
223
- export const stats_pendingDelegated: (a: number) => bigint;
224
- export const stats_pendingDelegatedByActive: (a: number) => bigint;
225
- export const stats_pendingPrekeyRotated: (a: number) => bigint;
226
- export const stats_pendingPrekeyRotatedByActive: (a: number) => bigint;
227
- export const stats_pendingPrekeysExpanded: (a: number) => bigint;
228
- export const stats_pendingPrekeysExpandedByActive: (a: number) => bigint;
229
- export const stats_pendingRevoked: (a: number) => bigint;
230
- export const stats_pendingRevokedByActive: (a: number) => bigint;
231
- export const stats_prekeyRotations: (a: number) => bigint;
232
- export const stats_prekeysExpanded: (a: number) => bigint;
233
- export const stats_revocations: (a: number) => bigint;
234
- export const stats_totalOps: (a: number) => bigint;
235
- export const stats_totalPendingOps: (a: number) => bigint;
164
+ export const __wbg_agent_free: (a: number, b: number) => void;
165
+ export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
166
+ export const __wbg_encryptedcontentwithupdate_free: (a: number, b: number) => void;
167
+ export const __wbg_individual_free: (a: number, b: number) => void;
168
+ export const __wbg_keyhive_free: (a: number, b: number) => void;
169
+ export const __wbg_peer_free: (a: number, b: number) => void;
170
+ export const __wbg_signedcgkaoperation_free: (a: number, b: number) => void;
171
+ export const agent_id: (a: number) => number;
172
+ export const agent_isDocument: (a: number) => number;
173
+ export const agent_isGroup: (a: number) => number;
174
+ export const agent_isIndividual: (a: number) => number;
175
+ export const agent_keyOpHashes: (a: number) => any;
176
+ export const agent_keyOps: (a: number) => any;
177
+ export const agent_toString: (a: number) => [number, number];
178
+ export const doccontentrefs_addChangeId: (a: number, b: number) => any;
179
+ export const doccontentrefs_change_hashes: (a: number) => any;
180
+ export const doccontentrefs_docId: (a: number) => number;
181
+ export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
182
+ export const encryptedcontentwithupdate_encrypted_content: (a: number) => number;
183
+ export const encryptedcontentwithupdate_update_op: (a: number) => number;
184
+ export const individual_id: (a: number) => number;
185
+ export const individual_individualId: (a: number) => number;
186
+ export const individual_pickPrekey: (a: number, b: number) => any;
187
+ export const individual_toAgent: (a: number) => number;
188
+ export const individual_toPeer: (a: number) => number;
189
+ export const keyhive_accessForDoc: (a: number, b: number, c: number) => any;
190
+ export const keyhive_addMember: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
191
+ export const keyhive_allAgentEvents: (a: number) => any;
192
+ export const keyhive_contactCard: (a: number) => any;
193
+ export const keyhive_docMemberCapabilities: (a: number, b: number) => any;
194
+ export const keyhive_eventHashesForAgent: (a: number, b: number) => any;
195
+ export const keyhive_eventsForAgent: (a: number, b: number) => any;
196
+ export const keyhive_expandPrekeys: (a: number) => any;
197
+ export const keyhive_exportPrekeySecrets: (a: number) => any;
198
+ export const keyhive_forcePcsUpdate: (a: number, b: number) => any;
199
+ export const keyhive_generateDocument: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
200
+ export const keyhive_generateGroup: (a: number, b: number, c: number) => any;
201
+ export const keyhive_getAgent: (a: number, b: number) => any;
202
+ export const keyhive_getDocument: (a: number, b: number) => any;
203
+ export const keyhive_getExistingContactCard: (a: number) => any;
204
+ export const keyhive_getGroup: (a: number, b: number) => any;
205
+ export const keyhive_getIndividual: (a: number, b: number) => any;
206
+ export const keyhive_id: (a: number) => number;
207
+ export const keyhive_idString: (a: number) => [number, number];
208
+ export const keyhive_importPrekeySecrets: (a: number, b: number, c: number) => any;
209
+ export const keyhive_individual: (a: number) => any;
210
+ export const keyhive_ingestArchive: (a: number, b: number) => any;
211
+ export const keyhive_ingestEventsBytes: (a: number, b: any) => any;
212
+ export const keyhive_init: (a: number, b: number, c: any) => any;
213
+ export const keyhive_intoArchive: (a: number) => any;
214
+ export const keyhive_membershipOpsForAgent: (a: number, b: number) => any;
215
+ export const keyhive_pendingEventHashes: (a: number) => any;
216
+ export const keyhive_reachableDocs: (a: number) => any;
217
+ export const keyhive_receiveContactCard: (a: number, b: number) => any;
218
+ export const keyhive_revokeMember: (a: number, b: number, c: number, d: number) => any;
219
+ export const keyhive_revokedMembersForDoc: (a: number, b: number) => any;
220
+ export const keyhive_rotatePrekey: (a: number, b: number) => any;
221
+ export const keyhive_stats: (a: number) => any;
222
+ export const keyhive_toArchive: (a: number) => any;
223
+ export const keyhive_tryDecrypt: (a: number, b: number, c: number) => any;
224
+ export const keyhive_tryEncrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
225
+ export const keyhive_tryEncryptArchive: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
226
+ export const keyhive_trySign: (a: number, b: number, c: number) => any;
227
+ export const keyhive_whoami: (a: number) => number;
228
+ export const peer___wasm_refgen_toJsPeer: (a: number) => number;
229
+ export const peer_isDocument: (a: number) => number;
230
+ export const peer_isGroup: (a: number) => number;
231
+ export const peer_isIndividual: (a: number) => number;
232
+ export const peer_toString: (a: number) => [number, number];
233
+ export const signedcgkaoperation_delegation: (a: number) => number;
234
+ export const signedcgkaoperation_signature: (a: number) => [number, number];
235
+ export const signedcgkaoperation_verify: (a: number) => number;
236
+ export const signedcgkaoperation_verifyingKey: (a: number) => [number, number];
237
+ export const peer_id: (a: number) => number;
236
238
  export const wasm_bindgen__convert__closures_____invoke__h4e3599ad4d40dc92: (a: number, b: number, c: any) => [number, number];
237
239
  export const wasm_bindgen__convert__closures_____invoke__h4137895ee1426b42: (a: number, b: number, c: any, d: any) => void;
238
240
  export const __wbindgen_malloc: (a: number, b: number) => number;
package/pkg/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "Brooklyn Zelenka <hello@brooklynzelenka.com>"
8
8
  ],
9
9
  "description": "WebAssembly wrappers for keyhive_core",
10
- "version": "0.3.0",
10
+ "version": "0.4.0",
11
11
  "license": "Apache-2.0",
12
12
  "repository": {
13
13
  "type": "git",
@@ -163,6 +163,8 @@ export class Encrypted {
163
163
  private constructor();
164
164
  free(): void;
165
165
  [Symbol.dispose](): void;
166
+ static fromBytes(bytes: Uint8Array): Encrypted;
167
+ serialize(): Uint8Array;
166
168
  toBytes(): Uint8Array;
167
169
  readonly ciphertext: Uint8Array;
168
170
  readonly content_ref: Uint8Array;
@@ -848,6 +848,19 @@ class Encrypted {
848
848
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
849
849
  return v1;
850
850
  }
851
+ /**
852
+ * @param {Uint8Array} bytes
853
+ * @returns {Encrypted}
854
+ */
855
+ static fromBytes(bytes) {
856
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
857
+ const len0 = WASM_VECTOR_LEN;
858
+ const ret = wasm.encrypted_fromBytes(ptr0, len0);
859
+ if (ret[2]) {
860
+ throw takeFromExternrefTable0(ret[1]);
861
+ }
862
+ return Encrypted.__wrap(ret[0]);
863
+ }
851
864
  /**
852
865
  * @returns {Uint8Array}
853
866
  */
@@ -875,6 +888,18 @@ class Encrypted {
875
888
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
876
889
  return v1;
877
890
  }
891
+ /**
892
+ * @returns {Uint8Array}
893
+ */
894
+ serialize() {
895
+ const ret = wasm.encrypted_serialize(this.__wbg_ptr);
896
+ if (ret[3]) {
897
+ throw takeFromExternrefTable0(ret[2]);
898
+ }
899
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
900
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
901
+ return v1;
902
+ }
878
903
  /**
879
904
  * @returns {Uint8Array}
880
905
  */
@@ -2533,19 +2558,19 @@ function __wbg_get_imports() {
2533
2558
  const ret = Error(getStringFromWasm0(arg0, arg1));
2534
2559
  return ret;
2535
2560
  },
2536
- __wbg___wasm_refgen_toJsChangeId_6ccc69ca295f07d8: function(arg0) {
2561
+ __wbg___wasm_refgen_toJsChangeId_1a4e8d260f698820: function(arg0) {
2537
2562
  const ret = arg0.__wasm_refgen_toJsChangeId();
2538
2563
  _assertClass(ret, ChangeId);
2539
2564
  var ptr1 = ret.__destroy_into_raw();
2540
2565
  return ptr1;
2541
2566
  },
2542
- __wbg___wasm_refgen_toJsDocument_403a685db7b2e2de: function(arg0) {
2567
+ __wbg___wasm_refgen_toJsDocument_bb9bc0924846047d: function(arg0) {
2543
2568
  const ret = arg0.__wasm_refgen_toJsDocument();
2544
2569
  _assertClass(ret, Document);
2545
2570
  var ptr1 = ret.__destroy_into_raw();
2546
2571
  return ptr1;
2547
2572
  },
2548
- __wbg___wasm_refgen_toJsPeer_4156830842f18fa5: function(arg0) {
2573
+ __wbg___wasm_refgen_toJsPeer_17636bceb3369eeb: function(arg0) {
2549
2574
  const ret = arg0.__wasm_refgen_toJsPeer();
2550
2575
  _assertClass(ret, Peer);
2551
2576
  var ptr1 = ret.__destroy_into_raw();
@@ -3002,7 +3027,7 @@ function __wbg_get_imports() {
3002
3027
  }
3003
3028
  },
3004
3029
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
3005
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 705, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3030
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 704, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
3006
3031
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h4e3599ad4d40dc92);
3007
3032
  return ret;
3008
3033
  },
Binary file