@functionland/fula-client 0.2.22 → 0.2.24
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/fula_js.d.ts +12 -3
- package/fula_js.js +20 -11
- package/fula_js_bg.wasm +0 -0
- package/package.json +1 -1
package/fula_js.d.ts
CHANGED
|
@@ -47,12 +47,21 @@ export function deleteBucket(client: EncryptedClient, name: string): Promise<voi
|
|
|
47
47
|
export function deleteEncrypted(client: EncryptedClient, bucket: string, key: string): Promise<void>;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* Derive a 32-byte key from context and input
|
|
50
|
+
* Derive a 32-byte key from context and input using Argon2id (memory-hard KDF)
|
|
51
51
|
*
|
|
52
|
-
* Use this to derive encryption keys from Google credentials:
|
|
52
|
+
* Use this to derive encryption keys from Google credentials with brute-force resistance:
|
|
53
53
|
* ```javascript
|
|
54
|
-
* const key = deriveKey('
|
|
54
|
+
* const key = deriveKey('fula-files-v1', new TextEncoder().encode(`google:${userId}:${email}`));
|
|
55
55
|
* ```
|
|
56
|
+
*
|
|
57
|
+
* Parameters:
|
|
58
|
+
* - Memory: 64 MiB
|
|
59
|
+
* - Iterations: 3
|
|
60
|
+
* - Parallelism: 1 (for cross-platform consistency)
|
|
61
|
+
*
|
|
62
|
+
* @param context - Context string used as salt (e.g., "fula-files-v1")
|
|
63
|
+
* @param input - Input bytes (e.g., UTF-8 encoded credentials)
|
|
64
|
+
* @returns 32-byte derived key
|
|
56
65
|
*/
|
|
57
66
|
export function deriveKey(context: string, input: Uint8Array): Uint8Array;
|
|
58
67
|
|
package/fula_js.js
CHANGED
|
@@ -380,12 +380,21 @@ export function deleteEncrypted(client, bucket, key) {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
/**
|
|
383
|
-
* Derive a 32-byte key from context and input
|
|
383
|
+
* Derive a 32-byte key from context and input using Argon2id (memory-hard KDF)
|
|
384
384
|
*
|
|
385
|
-
* Use this to derive encryption keys from Google credentials:
|
|
385
|
+
* Use this to derive encryption keys from Google credentials with brute-force resistance:
|
|
386
386
|
* ```javascript
|
|
387
|
-
* const key = deriveKey('
|
|
387
|
+
* const key = deriveKey('fula-files-v1', new TextEncoder().encode(`google:${userId}:${email}`));
|
|
388
388
|
* ```
|
|
389
|
+
*
|
|
390
|
+
* Parameters:
|
|
391
|
+
* - Memory: 64 MiB
|
|
392
|
+
* - Iterations: 3
|
|
393
|
+
* - Parallelism: 1 (for cross-platform consistency)
|
|
394
|
+
*
|
|
395
|
+
* @param context - Context string used as salt (e.g., "fula-files-v1")
|
|
396
|
+
* @param input - Input bytes (e.g., UTF-8 encoded credentials)
|
|
397
|
+
* @returns 32-byte derived key
|
|
389
398
|
* @param {string} context
|
|
390
399
|
* @param {Uint8Array} input
|
|
391
400
|
* @returns {Uint8Array}
|
|
@@ -1169,19 +1178,14 @@ function __wbg_get_imports() {
|
|
|
1169
1178
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1170
1179
|
return ret;
|
|
1171
1180
|
};
|
|
1172
|
-
imports.wbg.__wbindgen_cast_293162629359ccc7 = function(arg0, arg1) {
|
|
1173
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 284, function: Function { arguments: [], shim_idx: 285, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1174
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h175e7795724731f3, wasm_bindgen__convert__closures_____invoke__h137a7db9bfc1a698);
|
|
1175
|
-
return ret;
|
|
1176
|
-
};
|
|
1177
1181
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
1178
1182
|
// Cast intrinsic for `U64 -> Externref`.
|
|
1179
1183
|
const ret = BigInt.asUintN(64, arg0);
|
|
1180
1184
|
return ret;
|
|
1181
1185
|
};
|
|
1182
|
-
imports.wbg.
|
|
1183
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1184
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1186
|
+
imports.wbg.__wbindgen_cast_6b8383c0ec1ae211 = function(arg0, arg1) {
|
|
1187
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 289, function: Function { arguments: [], shim_idx: 290, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1188
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h175e7795724731f3, wasm_bindgen__convert__closures_____invoke__h137a7db9bfc1a698);
|
|
1185
1189
|
return ret;
|
|
1186
1190
|
};
|
|
1187
1191
|
imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
|
|
@@ -1191,6 +1195,11 @@ function __wbg_get_imports() {
|
|
|
1191
1195
|
const ret = v0;
|
|
1192
1196
|
return ret;
|
|
1193
1197
|
};
|
|
1198
|
+
imports.wbg.__wbindgen_cast_7d99ab386ec3ade6 = function(arg0, arg1) {
|
|
1199
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 324, function: Function { arguments: [Externref], shim_idx: 325, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1200
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf1f5673d74edd4c1, wasm_bindgen__convert__closures_____invoke__hfca1d4c99c3f4fb2);
|
|
1201
|
+
return ret;
|
|
1202
|
+
};
|
|
1194
1203
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
1195
1204
|
// Cast intrinsic for `I64 -> Externref`.
|
|
1196
1205
|
const ret = arg0;
|
package/fula_js_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@functionland/fula-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "JavaScript/TypeScript SDK for Fula decentralized storage - client-side encryption with cross-platform key compatibility",
|
|
6
6
|
"main": "fula_js.js",
|