@keyhive/keyhive 0.1.0-alpha.4 → 0.1.0-alpha.6
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 +1 -1
- package/pkg/keyhive_wasm.d.ts +79 -40
- package/pkg/keyhive_wasm.js +1 -1
- package/pkg/keyhive_wasm_bg.js +214 -87
- package/pkg/keyhive_wasm_bg.wasm +0 -0
- package/pkg/keyhive_wasm_bg.wasm.d.ts +122 -108
- package/pkg-node/keyhive_wasm.d.ts +79 -40
- package/pkg-node/keyhive_wasm.js +217 -90
- package/pkg-node/keyhive_wasm_bg.wasm +0 -0
- package/pkg-node/keyhive_wasm_bg.wasm.d.ts +122 -108
- package/pkg-slim/keyhive_wasm.d.ts +201 -148
- package/pkg-slim/keyhive_wasm.js +214 -87
- package/pkg-slim/keyhive_wasm_bg.wasm +0 -0
- package/pkg-slim/keyhive_wasm_bg.wasm.base64.js +1 -1
- package/pkg-slim/keyhive_wasm_bg.wasm.d.ts +122 -108
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const __wbg_signedcgkaoperation_free: (a: number, b: number) => void;
|
|
5
|
-
export const signedcgkaoperation_delegation: (a: number) => number;
|
|
6
|
-
export const signedcgkaoperation_signature: (a: number) => [number, number];
|
|
7
|
-
export const signedcgkaoperation_verify: (a: number) => number;
|
|
8
|
-
export const signedcgkaoperation_verifyingKey: (a: number) => [number, number];
|
|
9
|
-
export const __wbg_invocation_free: (a: number, b: number) => void;
|
|
10
|
-
export const __wbg_signedinvocation_free: (a: number, b: number) => void;
|
|
11
|
-
export const symmetricDecrypt: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
12
|
-
export const symmetricEncrypt: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
13
4
|
export const __wbg_agent_free: (a: number, b: number) => void;
|
|
14
|
-
export const
|
|
15
|
-
export const __wbg_ciphertextstore_free: (a: number, b: number) => void;
|
|
16
|
-
export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_document_free: (a: number, b: number) => void;
|
|
17
6
|
export const __wbg_encryptedcontentwithupdate_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_encryptedkeyed_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_group_free: (a: number, b: number) => void;
|
|
18
9
|
export const __wbg_individual_free: (a: number, b: number) => void;
|
|
19
10
|
export const __wbg_keyhive_free: (a: number, b: number) => void;
|
|
20
11
|
export const __wbg_peer_free: (a: number, b: number) => void;
|
|
21
|
-
export const __wbg_revocation_free: (a: number, b: number) => void;
|
|
22
|
-
export const __wbg_stats_free: (a: number, b: number) => void;
|
|
23
12
|
export const agent_id: (a: number) => number;
|
|
24
13
|
export const agent_isDocument: (a: number) => number;
|
|
25
14
|
export const agent_isGroup: (a: number) => number;
|
|
@@ -27,29 +16,31 @@ export const agent_isIndividual: (a: number) => number;
|
|
|
27
16
|
export const agent_keyOpHashes: (a: number) => any;
|
|
28
17
|
export const agent_keyOps: (a: number) => any;
|
|
29
18
|
export const agent_toString: (a: number) => [number, number];
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
export const
|
|
36
|
-
export const
|
|
37
|
-
export const ciphertextstore_newFromWebStorage: (a: any) => number;
|
|
38
|
-
export const ciphertextstore_newInMemory: () => number;
|
|
39
|
-
export const doccontentrefs_addChangeId: (a: number, b: number) => any;
|
|
40
|
-
export const doccontentrefs_change_hashes: (a: number) => any;
|
|
41
|
-
export const doccontentrefs_docId: (a: number) => number;
|
|
42
|
-
export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
|
|
43
|
-
export const encryptedcontentwithupdate_applicationSecret: (a: number) => [number, number];
|
|
19
|
+
export const document___wasm_refgen_toJsDocument: (a: number) => number;
|
|
20
|
+
export const document_doc_id: (a: number) => number;
|
|
21
|
+
export const document_id: (a: number) => number;
|
|
22
|
+
export const document_members: (a: number) => any;
|
|
23
|
+
export const document_toAgent: (a: number) => number;
|
|
24
|
+
export const document_toMembered: (a: number) => number;
|
|
25
|
+
export const document_toPeer: (a: number) => number;
|
|
44
26
|
export const encryptedcontentwithupdate_encrypted_content: (a: number) => number;
|
|
45
27
|
export const encryptedcontentwithupdate_update_op: (a: number) => number;
|
|
46
|
-
export const
|
|
28
|
+
export const encryptedkeyed_applicationSecret: (a: number) => [number, number];
|
|
29
|
+
export const encryptedkeyed_encrypted_content: (a: number) => number;
|
|
30
|
+
export const encryptedkeyed_update_op: (a: number) => number;
|
|
31
|
+
export const group___wasm_refgen_toJsGroup: (a: number) => number;
|
|
32
|
+
export const group_members: (a: number) => any;
|
|
33
|
+
export const group_toAgent: (a: number) => number;
|
|
34
|
+
export const group_toMembered: (a: number) => number;
|
|
35
|
+
export const group_toPeer: (a: number) => number;
|
|
36
|
+
export const individual_individualId: (a: number) => number;
|
|
47
37
|
export const individual_pickPrekey: (a: number, b: number) => any;
|
|
48
38
|
export const individual_toAgent: (a: number) => number;
|
|
49
39
|
export const individual_toPeer: (a: number) => number;
|
|
50
40
|
export const keyhive_accessForDoc: (a: number, b: number, c: number) => any;
|
|
51
41
|
export const keyhive_addMember: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
52
42
|
export const keyhive_allAgentEvents: (a: number) => any;
|
|
43
|
+
export const keyhive_bestAccessForDoc: (a: number, b: number, c: number) => any;
|
|
53
44
|
export const keyhive_contactCard: (a: number) => any;
|
|
54
45
|
export const keyhive_docMemberCapabilities: (a: number, b: number) => any;
|
|
55
46
|
export const keyhive_eventHashesForAgent: (a: number, b: number) => any;
|
|
@@ -82,9 +73,10 @@ export const keyhive_rotatePrekey: (a: number, b: number) => any;
|
|
|
82
73
|
export const keyhive_stats: (a: number) => any;
|
|
83
74
|
export const keyhive_toArchive: (a: number) => any;
|
|
84
75
|
export const keyhive_tryDecrypt: (a: number, b: number, c: number) => any;
|
|
85
|
-
export const
|
|
76
|
+
export const keyhive_tryDecryptKeyed: (a: number, b: number, c: number) => any;
|
|
86
77
|
export const keyhive_tryEncrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
87
78
|
export const keyhive_tryEncryptArchive: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
79
|
+
export const keyhive_tryEncryptKeyed: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
88
80
|
export const keyhive_tryPcsKeyHash: (a: number, b: number) => any;
|
|
89
81
|
export const keyhive_trySign: (a: number, b: number, c: number) => any;
|
|
90
82
|
export const keyhive_whoami: (a: number) => number;
|
|
@@ -93,11 +85,57 @@ export const peer_isDocument: (a: number) => number;
|
|
|
93
85
|
export const peer_isGroup: (a: number) => number;
|
|
94
86
|
export const peer_isIndividual: (a: number) => number;
|
|
95
87
|
export const peer_toString: (a: number) => [number, number];
|
|
96
|
-
export const revocation_after: (a: number) => number;
|
|
97
|
-
export const revocation_proof: (a: number) => number;
|
|
98
|
-
export const revocation_revoked: (a: number) => number;
|
|
99
|
-
export const revocation_subject_id: (a: number) => number;
|
|
100
88
|
export const setPanicHook: () => void;
|
|
89
|
+
export const group_groupId: (a: number) => number;
|
|
90
|
+
export const group_id: (a: number) => number;
|
|
91
|
+
export const individual_id: (a: number) => number;
|
|
92
|
+
export const peer_id: (a: number) => number;
|
|
93
|
+
export const __wbg_signed_free: (a: number, b: number) => void;
|
|
94
|
+
export const __wbg_signedcgkaoperation_free: (a: number, b: number) => void;
|
|
95
|
+
export const signed_fromBytes: (a: number, b: number) => [number, number, number];
|
|
96
|
+
export const signed_payload: (a: number) => [number, number];
|
|
97
|
+
export const signed_signature: (a: number) => [number, number];
|
|
98
|
+
export const signed_toBytes: (a: number) => [number, number, number, number];
|
|
99
|
+
export const signed_verify: (a: number) => number;
|
|
100
|
+
export const signed_verifyingKey: (a: number) => [number, number];
|
|
101
|
+
export const signedcgkaoperation_delegation: (a: number) => number;
|
|
102
|
+
export const signedcgkaoperation_signature: (a: number) => [number, number];
|
|
103
|
+
export const signedcgkaoperation_verify: (a: number) => number;
|
|
104
|
+
export const signedcgkaoperation_verifyingKey: (a: number) => [number, number];
|
|
105
|
+
export const __wbg_archive_free: (a: number, b: number) => void;
|
|
106
|
+
export const __wbg_capability_free: (a: number, b: number) => void;
|
|
107
|
+
export const __wbg_delegation_free: (a: number, b: number) => void;
|
|
108
|
+
export const __wbg_history_free: (a: number, b: number) => void;
|
|
109
|
+
export const __wbg_membered_free: (a: number, b: number) => void;
|
|
110
|
+
export const __wbg_membership_free: (a: number, b: number) => void;
|
|
111
|
+
export const __wbg_signeddelegation_free: (a: number, b: number) => void;
|
|
112
|
+
export const __wbg_signedrevocation_free: (a: number, b: number) => void;
|
|
113
|
+
export const __wbg_stats_free: (a: number, b: number) => void;
|
|
114
|
+
export const __wbg_summary_free: (a: number, b: number) => void;
|
|
115
|
+
export const archive_toBytes: (a: number) => [number, number, number, number];
|
|
116
|
+
export const archive_tryToKeyhive: (a: number, b: number, c: number, d: any) => any;
|
|
117
|
+
export const archive_try_from_bytes: (a: number, b: number) => [number, number, number];
|
|
118
|
+
export const capability_can: (a: number) => number;
|
|
119
|
+
export const capability_proof: (a: number) => number;
|
|
120
|
+
export const capability_who: (a: number) => number;
|
|
121
|
+
export const delegation_after: (a: number) => number;
|
|
122
|
+
export const delegation_can: (a: number) => number;
|
|
123
|
+
export const delegation_delegate: (a: number) => number;
|
|
124
|
+
export const delegation_proof: (a: number) => number;
|
|
125
|
+
export const history_contentRefs: (a: number) => [number, number];
|
|
126
|
+
export const history_delegations: (a: number) => [number, number];
|
|
127
|
+
export const history_revocations: (a: number) => [number, number];
|
|
128
|
+
export const membership_can: (a: number) => number;
|
|
129
|
+
export const membership_who: (a: number) => number;
|
|
130
|
+
export const signeddelegation_delegation: (a: number) => number;
|
|
131
|
+
export const signeddelegation_signature: (a: number) => [number, number];
|
|
132
|
+
export const signeddelegation_subjectId: (a: number) => number;
|
|
133
|
+
export const signeddelegation_verify: (a: number) => number;
|
|
134
|
+
export const signeddelegation_verifyingKey: (a: number) => [number, number];
|
|
135
|
+
export const signedrevocation_delegation: (a: number) => number;
|
|
136
|
+
export const signedrevocation_signature: (a: number) => [number, number];
|
|
137
|
+
export const signedrevocation_verify: (a: number) => number;
|
|
138
|
+
export const signedrevocation_verifyingKey: (a: number) => [number, number];
|
|
101
139
|
export const stats_activePrekeyCount: (a: number) => bigint;
|
|
102
140
|
export const stats_cgkaOperations: (a: number) => bigint;
|
|
103
141
|
export const stats_delegations: (a: number) => bigint;
|
|
@@ -119,8 +157,8 @@ export const stats_prekeysExpanded: (a: number) => bigint;
|
|
|
119
157
|
export const stats_revocations: (a: number) => bigint;
|
|
120
158
|
export const stats_totalOps: (a: number) => bigint;
|
|
121
159
|
export const stats_totalPendingOps: (a: number) => bigint;
|
|
122
|
-
export const
|
|
123
|
-
export const
|
|
160
|
+
export const summary_access: (a: number) => number;
|
|
161
|
+
export const summary_doc: (a: number) => number;
|
|
124
162
|
export const __wbg_access_free: (a: number, b: number) => void;
|
|
125
163
|
export const __wbg_cannotparseed25519signingkey_free: (a: number, b: number) => void;
|
|
126
164
|
export const __wbg_cgkaoperation_free: (a: number, b: number) => void;
|
|
@@ -130,8 +168,19 @@ export const __wbg_encrypted_free: (a: number, b: number) => void;
|
|
|
130
168
|
export const __wbg_event_free: (a: number, b: number) => void;
|
|
131
169
|
export const __wbg_generatewebcryptoerror_free: (a: number, b: number) => void;
|
|
132
170
|
export const __wbg_groupid_free: (a: number, b: number) => void;
|
|
133
|
-
export const
|
|
171
|
+
export const __wbg_sharekey_free: (a: number, b: number) => void;
|
|
134
172
|
export const __wbg_signer_free: (a: number, b: number) => void;
|
|
173
|
+
export const access_admin: () => number;
|
|
174
|
+
export const access_atLeast: (a: number, b: number) => number;
|
|
175
|
+
export const access_compareTo: (a: number, b: number) => number;
|
|
176
|
+
export const access_edit: () => number;
|
|
177
|
+
export const access_equals: (a: number, b: number) => number;
|
|
178
|
+
export const access_fromString: (a: number, b: number) => [number, number, number];
|
|
179
|
+
export const access_isEditor: (a: number) => number;
|
|
180
|
+
export const access_isReader: (a: number) => number;
|
|
181
|
+
export const access_level: (a: number) => number;
|
|
182
|
+
export const access_read: () => number;
|
|
183
|
+
export const access_relay: () => number;
|
|
135
184
|
export const access_toString: (a: number) => [number, number];
|
|
136
185
|
export const access_tryFromString: (a: number, b: number) => number;
|
|
137
186
|
export const cgkaoperation_variant: (a: number) => [number, number];
|
|
@@ -162,7 +211,6 @@ export const event_tryIntoSignedRevocation: (a: number) => number;
|
|
|
162
211
|
export const event_variant: (a: number) => [number, number];
|
|
163
212
|
export const generatewebcryptoerror_message: (a: number) => [number, number];
|
|
164
213
|
export const groupid_toString: (a: number) => [number, number];
|
|
165
|
-
export const individualid_bytes: (a: number) => [number, number];
|
|
166
214
|
export const signer_clone: (a: number) => number;
|
|
167
215
|
export const signer_generate: () => any;
|
|
168
216
|
export const signer_generateMemory: () => number;
|
|
@@ -172,82 +220,48 @@ export const signer_trySign: (a: number, b: number, c: number) => any;
|
|
|
172
220
|
export const signer_variant: (a: number) => [number, number];
|
|
173
221
|
export const signer_verifyingKey: (a: number) => [number, number];
|
|
174
222
|
export const signer_webCryptoSigner: (a: any) => any;
|
|
223
|
+
export const symmetricDecrypt: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
224
|
+
export const symmetricEncrypt: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
175
225
|
export const encrypted_toBytes: (a: number) => [number, number];
|
|
176
|
-
export const
|
|
226
|
+
export const __wbg_invocation_free: (a: number, b: number) => void;
|
|
227
|
+
export const __wbg_signedinvocation_free: (a: number, b: number) => void;
|
|
177
228
|
export const __wbg_cannotparseidentifier_free: (a: number, b: number) => void;
|
|
178
|
-
export const __wbg_capability_free: (a: number, b: number) => void;
|
|
179
|
-
export const __wbg_changeid_free: (a: number, b: number) => void;
|
|
180
229
|
export const __wbg_identifier_free: (a: number, b: number) => void;
|
|
181
|
-
export const __wbg_membered_free: (a: number, b: number) => void;
|
|
182
|
-
export const __wbg_membership_free: (a: number, b: number) => void;
|
|
183
|
-
export const __wbg_sharekey_free: (a: number, b: number) => void;
|
|
184
|
-
export const __wbg_signed_free: (a: number, b: number) => void;
|
|
185
|
-
export const __wbg_signeddelegation_free: (a: number, b: number) => void;
|
|
186
|
-
export const __wbg_signedrevocation_free: (a: number, b: number) => void;
|
|
187
|
-
export const archive_toBytes: (a: number) => [number, number, number, number];
|
|
188
|
-
export const archive_tryToKeyhive: (a: number, b: number, c: number, d: any) => any;
|
|
189
|
-
export const archive_try_from_bytes: (a: number, b: number) => [number, number, number];
|
|
190
|
-
export const capability_can: (a: number) => number;
|
|
191
|
-
export const capability_proof: (a: number) => number;
|
|
192
|
-
export const capability_who: (a: number) => number;
|
|
193
|
-
export const changeid___wasm_refgen_toJsChangeId: (a: number) => number;
|
|
194
|
-
export const changeid_bytes: (a: number) => [number, number];
|
|
195
|
-
export const changeid_new: (a: number, b: number) => number;
|
|
196
230
|
export const identifier_new: (a: number, b: number) => [number, number, number];
|
|
197
231
|
export const identifier_publicId: () => number;
|
|
198
232
|
export const identifier_toBytes: (a: number) => [number, number];
|
|
199
|
-
export const
|
|
200
|
-
export const
|
|
201
|
-
export const
|
|
202
|
-
export const
|
|
203
|
-
export const
|
|
204
|
-
export const
|
|
205
|
-
export const
|
|
206
|
-
export const
|
|
207
|
-
export const
|
|
208
|
-
export const
|
|
209
|
-
export const
|
|
210
|
-
export const
|
|
211
|
-
export const
|
|
212
|
-
export const
|
|
213
|
-
export const
|
|
214
|
-
export const
|
|
215
|
-
export const
|
|
216
|
-
export const
|
|
217
|
-
export const
|
|
218
|
-
export const
|
|
219
|
-
export const
|
|
220
|
-
export const
|
|
221
|
-
export const
|
|
222
|
-
export const
|
|
223
|
-
export const
|
|
224
|
-
export const
|
|
225
|
-
export const
|
|
226
|
-
export const
|
|
227
|
-
export const
|
|
228
|
-
export const
|
|
229
|
-
export const
|
|
230
|
-
export const
|
|
231
|
-
export const document_doc_id: (a: number) => number;
|
|
232
|
-
export const document_id: (a: number) => number;
|
|
233
|
-
export const document_members: (a: number) => any;
|
|
234
|
-
export const document_toAgent: (a: number) => number;
|
|
235
|
-
export const document_toMembered: (a: number) => number;
|
|
236
|
-
export const document_toPeer: (a: number) => number;
|
|
237
|
-
export const group___wasm_refgen_toJsGroup: (a: number) => number;
|
|
238
|
-
export const group_members: (a: number) => any;
|
|
239
|
-
export const group_toAgent: (a: number) => number;
|
|
240
|
-
export const group_toMembered: (a: number) => number;
|
|
241
|
-
export const group_toPeer: (a: number) => number;
|
|
242
|
-
export const history_contentRefs: (a: number) => [number, number];
|
|
243
|
-
export const history_delegations: (a: number) => [number, number];
|
|
244
|
-
export const history_revocations: (a: number) => [number, number];
|
|
245
|
-
export const summary_access: (a: number) => number;
|
|
246
|
-
export const summary_doc: (a: number) => number;
|
|
247
|
-
export const group_groupId: (a: number) => number;
|
|
248
|
-
export const group_id: (a: number) => number;
|
|
249
|
-
export const wasm_bindgen__convert__closures_____invoke__h9887d5ab72723f8a: (a: number, b: number, c: any) => [number, number];
|
|
250
|
-
export const wasm_bindgen__convert__closures_____invoke__h58982df154245cbc: (a: number, b: number, c: any, d: any) => void;
|
|
233
|
+
export const __wbg_allagentevents_free: (a: number, b: number) => void;
|
|
234
|
+
export const __wbg_changeid_free: (a: number, b: number) => void;
|
|
235
|
+
export const __wbg_ciphertextstore_free: (a: number, b: number) => void;
|
|
236
|
+
export const __wbg_decryptedkeyed_free: (a: number, b: number) => void;
|
|
237
|
+
export const __wbg_doccontentrefs_free: (a: number, b: number) => void;
|
|
238
|
+
export const __wbg_individualid_free: (a: number, b: number) => void;
|
|
239
|
+
export const __wbg_revocation_free: (a: number, b: number) => void;
|
|
240
|
+
export const allagentevents_agentCgkaSources: (a: number) => any;
|
|
241
|
+
export const allagentevents_agentMembershipSources: (a: number) => any;
|
|
242
|
+
export const allagentevents_agentPrekeySources: (a: number) => any;
|
|
243
|
+
export const allagentevents_cgkaSources: (a: number) => any;
|
|
244
|
+
export const allagentevents_events: (a: number) => any;
|
|
245
|
+
export const allagentevents_membershipSources: (a: number) => any;
|
|
246
|
+
export const allagentevents_prekeySources: (a: number) => any;
|
|
247
|
+
export const changeid___wasm_refgen_toJsChangeId: (a: number) => number;
|
|
248
|
+
export const changeid_bytes: (a: number) => [number, number];
|
|
249
|
+
export const changeid_new: (a: number, b: number) => number;
|
|
250
|
+
export const ciphertextstore_newFromWebStorage: (a: any) => number;
|
|
251
|
+
export const ciphertextstore_newInMemory: () => number;
|
|
252
|
+
export const decryptedkeyed_applicationSecret: (a: number) => [number, number];
|
|
253
|
+
export const decryptedkeyed_plaintext: (a: number) => [number, number];
|
|
254
|
+
export const doccontentrefs_addChangeId: (a: number, b: number) => any;
|
|
255
|
+
export const doccontentrefs_change_hashes: (a: number) => any;
|
|
256
|
+
export const doccontentrefs_docId: (a: number) => number;
|
|
257
|
+
export const doccontentrefs_new: (a: number, b: number, c: number) => [number, number, number];
|
|
258
|
+
export const individualid_bytes: (a: number) => [number, number];
|
|
259
|
+
export const revocation_after: (a: number) => number;
|
|
260
|
+
export const revocation_proof: (a: number) => number;
|
|
261
|
+
export const revocation_revoked: (a: number) => number;
|
|
262
|
+
export const revocation_subject_id: (a: number) => number;
|
|
263
|
+
export const wasm_bindgen__convert__closures_____invoke__h264249ebd10d2c4e: (a: number, b: number, c: any) => [number, number];
|
|
264
|
+
export const wasm_bindgen__convert__closures_____invoke__h3240482818b7fa6b: (a: number, b: number, c: any, d: any) => void;
|
|
251
265
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
252
266
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
253
267
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
@@ -5,18 +5,56 @@ export class Access {
|
|
|
5
5
|
private constructor();
|
|
6
6
|
free(): void;
|
|
7
7
|
[Symbol.dispose](): void;
|
|
8
|
+
/**
|
|
9
|
+
* The ability to revoke any members of a group, not just those that they have causal senority over.
|
|
10
|
+
*/
|
|
11
|
+
static admin(): Access;
|
|
12
|
+
/**
|
|
13
|
+
* True if this level is at least as permissive as `other`.
|
|
14
|
+
*/
|
|
15
|
+
atLeast(other: Access): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Standard comparator result: -1 if less permissive than `other`,
|
|
18
|
+
* 0 if equal, 1 if more permissive.
|
|
19
|
+
*/
|
|
20
|
+
compareTo(other: Access): number;
|
|
21
|
+
/**
|
|
22
|
+
* The ability to edit (append ops to) the content of a document.
|
|
23
|
+
*/
|
|
24
|
+
static edit(): Access;
|
|
25
|
+
equals(other: Access): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Parse an access level, throwing on invalid input.
|
|
28
|
+
* Accepts "relay", "read", "edit", or "admin" (case-insensitive).
|
|
29
|
+
*/
|
|
30
|
+
static fromString(s: string): Access;
|
|
31
|
+
/**
|
|
32
|
+
* The ability to read (decrypt) the content of a document.
|
|
33
|
+
*/
|
|
34
|
+
static read(): Access;
|
|
35
|
+
/**
|
|
36
|
+
* The ability to retrieve bytes over the network.
|
|
37
|
+
*/
|
|
38
|
+
static relay(): Access;
|
|
8
39
|
toString(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Parse an access level, returning undefined on invalid input.
|
|
42
|
+
* Prefer `fromString`, which throws a descriptive error instead.
|
|
43
|
+
*/
|
|
9
44
|
static tryFromString(s: string): Access | undefined;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
45
|
+
/**
|
|
46
|
+
* True for Edit access or higher.
|
|
47
|
+
*/
|
|
48
|
+
readonly isEditor: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* True for Read access or higher.
|
|
51
|
+
*/
|
|
52
|
+
readonly isReader: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Numeric level for ordering: Relay = 0, Read = 1, Edit = 2, Admin = 3.
|
|
55
|
+
* Higher levels imply all lower levels.
|
|
56
|
+
*/
|
|
57
|
+
readonly level: number;
|
|
20
58
|
}
|
|
21
59
|
|
|
22
60
|
export class Agent {
|
|
@@ -127,16 +165,14 @@ export class ContactCard {
|
|
|
127
165
|
|
|
128
166
|
/**
|
|
129
167
|
* Plaintext plus the application secret key that decrypted it.
|
|
130
|
-
*
|
|
131
|
-
* The key lets the consumer recover the blob's external predecessor-secret
|
|
132
|
-
* chain and chain further encryptions onto it, without re-entering CGKA.
|
|
133
168
|
*/
|
|
134
|
-
export class
|
|
169
|
+
export class DecryptedKeyed {
|
|
135
170
|
private constructor();
|
|
136
171
|
free(): void;
|
|
137
172
|
[Symbol.dispose](): void;
|
|
138
173
|
/**
|
|
139
174
|
* The 32-byte application secret key used to decrypt this content.
|
|
175
|
+
* Treat as secret: do not log or persist unencrypted.
|
|
140
176
|
*/
|
|
141
177
|
readonly applicationSecret: Uint8Array;
|
|
142
178
|
readonly plaintext: Uint8Array;
|
|
@@ -192,8 +228,7 @@ export class Encrypted {
|
|
|
192
228
|
[Symbol.dispose](): void;
|
|
193
229
|
/**
|
|
194
230
|
* Decrypt this content with an explicit 32-byte application secret key,
|
|
195
|
-
* bypassing CGKA.
|
|
196
|
-
* predecessor-secret chain once it has recovered a blob's key.
|
|
231
|
+
* bypassing CGKA.
|
|
197
232
|
*/
|
|
198
233
|
decryptWithKey(key: Uint8Array): Uint8Array;
|
|
199
234
|
static fromBytes(bytes: Uint8Array): Encrypted;
|
|
@@ -212,11 +247,20 @@ export class EncryptedContentWithUpdate {
|
|
|
212
247
|
[Symbol.dispose](): void;
|
|
213
248
|
encrypted_content(): Encrypted;
|
|
214
249
|
update_op(): SignedCgkaOperation | undefined;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Encrypted content plus the application secret key it was encrypted under.
|
|
254
|
+
*/
|
|
255
|
+
export class EncryptedKeyed {
|
|
256
|
+
private constructor();
|
|
257
|
+
free(): void;
|
|
258
|
+
[Symbol.dispose](): void;
|
|
259
|
+
encrypted_content(): Encrypted;
|
|
260
|
+
update_op(): SignedCgkaOperation | undefined;
|
|
215
261
|
/**
|
|
216
262
|
* The 32-byte application secret key used to encrypt this content.
|
|
217
|
-
*
|
|
218
|
-
* Lets the consumer build the external predecessor-secret chain and chain
|
|
219
|
-
* further encryptions onto this blob.
|
|
263
|
+
* Treat as secret: do not log or persist unencrypted.
|
|
220
264
|
*/
|
|
221
265
|
readonly applicationSecret: Uint8Array;
|
|
222
266
|
}
|
|
@@ -313,12 +357,18 @@ export class Keyhive {
|
|
|
313
357
|
free(): void;
|
|
314
358
|
[Symbol.dispose](): void;
|
|
315
359
|
accessForDoc(id: Identifier, doc_id: DocumentId): Promise<Access | undefined>;
|
|
316
|
-
addMember(to_add: Agent, membered: Membered, access: Access, other_relevant_docs: Document[]): Promise<
|
|
360
|
+
addMember(to_add: Agent, membered: Membered, access: Access, other_relevant_docs: Document[]): Promise<SignedDelegation>;
|
|
317
361
|
/**
|
|
318
362
|
* Returns all agent events with deduplicated storage and two-tier indirection
|
|
319
363
|
* for membership, prekey, and CGKA ops.
|
|
320
364
|
*/
|
|
321
365
|
allAgentEvents(): Promise<AllAgentEvents>;
|
|
366
|
+
/**
|
|
367
|
+
* The most permissive of `id`'s direct access and the document's
|
|
368
|
+
* public access. Returns undefined if neither grants access (or the
|
|
369
|
+
* document is unknown).
|
|
370
|
+
*/
|
|
371
|
+
bestAccessForDoc(id: Identifier, doc_id: DocumentId): Promise<Access | undefined>;
|
|
322
372
|
contactCard(): Promise<ContactCard>;
|
|
323
373
|
docMemberCapabilities(doc_id: DocumentId): Promise<Membership[]>;
|
|
324
374
|
/**
|
|
@@ -334,14 +384,10 @@ export class Keyhive {
|
|
|
334
384
|
/**
|
|
335
385
|
* Force a PCS key rotation and return the new leaf secret, serialized as a
|
|
336
386
|
* one-entry `BTreeMap<ShareKey, ShareSecretKey>` (the exact format
|
|
337
|
-
* `importPrekeySecrets` accepts).
|
|
338
|
-
*
|
|
387
|
+
* `importPrekeySecrets` accepts).
|
|
388
|
+
* The returned bytes are secret key material: do not log or persist unencrypted.
|
|
339
389
|
*/
|
|
340
390
|
forcePcsUpdate(doc: Document): Promise<Uint8Array>;
|
|
341
|
-
/**
|
|
342
|
-
* Generate a document. Whether it provides forward secrecy is determined by
|
|
343
|
-
* this peer's forward-secrecy policy (chosen at `Keyhive.init`).
|
|
344
|
-
*/
|
|
345
391
|
generateDocument(coparents: Peer[], initial_content_ref_head: ChangeId, more_initial_content_refs: ChangeId[]): Promise<Document>;
|
|
346
392
|
generateGroup(js_coparents: Peer[]): Promise<Group>;
|
|
347
393
|
getAgent(id: Identifier): Promise<Agent | undefined>;
|
|
@@ -352,9 +398,6 @@ export class Keyhive {
|
|
|
352
398
|
importPrekeySecrets(bytes: Uint8Array): Promise<void>;
|
|
353
399
|
ingestArchive(archive: Archive): Promise<void>;
|
|
354
400
|
ingestEventsBytes(events_bytes_array: Array<any>): Promise<Array<any>>;
|
|
355
|
-
/**
|
|
356
|
-
* Initialize a peer.
|
|
357
|
-
*/
|
|
358
401
|
static init(signer: Signer, ciphertext_store: CiphertextStore, event_handler: Function): Promise<Keyhive>;
|
|
359
402
|
intoArchive(): Promise<Archive>;
|
|
360
403
|
membershipOpsForAgent(agent: Agent): Promise<Map<any, any>>;
|
|
@@ -369,13 +412,15 @@ export class Keyhive {
|
|
|
369
412
|
tryDecrypt(doc: Document, encrypted: Encrypted): Promise<Uint8Array>;
|
|
370
413
|
/**
|
|
371
414
|
* Decrypt content and also return the 32-byte application secret key used.
|
|
372
|
-
*
|
|
373
|
-
* The consumer follows the external predecessor-secret chain from this key
|
|
374
|
-
* with `Encrypted.decryptWithKey`, avoiding further CGKA dives.
|
|
375
415
|
*/
|
|
376
|
-
|
|
416
|
+
tryDecryptKeyed(doc: Document, encrypted: Encrypted): Promise<DecryptedKeyed>;
|
|
377
417
|
tryEncrypt(doc: Document, content_ref: ChangeId, js_pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
|
|
378
418
|
tryEncryptArchive(doc: Document, content_ref: ChangeId, pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedContentWithUpdate>;
|
|
419
|
+
/**
|
|
420
|
+
* Encrypt content and also return the application secret key it was
|
|
421
|
+
* encrypted under.
|
|
422
|
+
*/
|
|
423
|
+
tryEncryptKeyed(doc: Document, content_ref: ChangeId, js_pred_refs: ChangeId[], content: Uint8Array): Promise<EncryptedKeyed>;
|
|
379
424
|
tryPcsKeyHash(doc: Document): Promise<Uint8Array | undefined>;
|
|
380
425
|
trySign(data: Uint8Array): Promise<Signed>;
|
|
381
426
|
readonly id: IndividualId;
|
|
@@ -542,12 +587,6 @@ export function setPanicHook(): void;
|
|
|
542
587
|
export function symmetricDecrypt(key: Uint8Array, blob: Uint8Array): Uint8Array;
|
|
543
588
|
|
|
544
589
|
/**
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
* `associated_data` flavors the synthetic nonce (e.g. the document or content
|
|
548
|
-
* id) so identical plaintext under the same key in different contexts produces
|
|
549
|
-
* distinct ciphertext. Returns `nonce(24) || ciphertext` (the ciphertext
|
|
550
|
-
* includes the Poly1305 tag). The nonce is carried in the output, so
|
|
551
|
-
* [`symmetric_decrypt`] does not need the associated data.
|
|
590
|
+
* Encrypt `plaintext` under a 32-byte `key`, returning `nonce(24) || ciphertext`.
|
|
552
591
|
*/
|
|
553
592
|
export function symmetricEncrypt(key: Uint8Array, plaintext: Uint8Array, associated_data: Uint8Array): Uint8Array;
|