@synonymdev/pubky 0.1.12 → 0.1.14
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/browser.js +41 -9
- package/index.cjs +40 -8
- package/package.json +1 -1
- package/pubky.d.ts +9 -4
- package/pubky_bg.wasm +0 -0
package/index.cjs
CHANGED
|
@@ -313,8 +313,19 @@ class Keypair {
|
|
|
313
313
|
* @returns {Keypair}
|
|
314
314
|
*/
|
|
315
315
|
static fromSecretKey(secret_key) {
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
try {
|
|
317
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
318
|
+
wasm.keypair_fromSecretKey(retptr, addHeapObject(secret_key));
|
|
319
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
320
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
321
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
322
|
+
if (r2) {
|
|
323
|
+
throw takeObject(r1);
|
|
324
|
+
}
|
|
325
|
+
return Keypair.__wrap(r0);
|
|
326
|
+
} finally {
|
|
327
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
328
|
+
}
|
|
318
329
|
}
|
|
319
330
|
/**
|
|
320
331
|
* Returns the secret key of this keypair.
|
|
@@ -543,22 +554,27 @@ class PubkyClient {
|
|
|
543
554
|
return takeObject(ret);
|
|
544
555
|
}
|
|
545
556
|
/**
|
|
546
|
-
* Returns a list of Pubky
|
|
547
|
-
* respecting the `cursor`, `reverse` and `limit` options.
|
|
557
|
+
* Returns a list of Pubky urls (as strings).
|
|
548
558
|
*
|
|
549
|
-
* `
|
|
559
|
+
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
560
|
+
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
561
|
+
* or a path (to a file or directory) relative to the `url`
|
|
562
|
+
* - `reverse`: List in reverse order
|
|
563
|
+
* - `limit` Limit the number of urls in the response
|
|
564
|
+
* - `shallow`: List directories and files, instead of flat list of files.
|
|
550
565
|
* @param {string} url
|
|
551
566
|
* @param {string | undefined} [cursor]
|
|
552
567
|
* @param {boolean | undefined} [reverse]
|
|
553
568
|
* @param {number | undefined} [limit]
|
|
569
|
+
* @param {boolean | undefined} [shallow]
|
|
554
570
|
* @returns {Promise<Array<any>>}
|
|
555
571
|
*/
|
|
556
|
-
list(url, cursor, reverse, limit) {
|
|
572
|
+
list(url, cursor, reverse, limit, shallow) {
|
|
557
573
|
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
558
574
|
const len0 = WASM_VECTOR_LEN;
|
|
559
575
|
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
576
|
var len1 = WASM_VECTOR_LEN;
|
|
561
|
-
const ret = wasm.pubkyclient_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit);
|
|
577
|
+
const ret = wasm.pubkyclient_list(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(reverse) ? 0xFFFFFF : reverse ? 1 : 0, isLikeNone(limit) ? 0xFFFFFF : limit, isLikeNone(shallow) ? 0xFFFFFF : shallow ? 1 : 0);
|
|
562
578
|
return takeObject(ret);
|
|
563
579
|
}
|
|
564
580
|
}
|
|
@@ -982,6 +998,17 @@ module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
|
|
982
998
|
return addHeapObject(ret);
|
|
983
999
|
};
|
|
984
1000
|
|
|
1001
|
+
module.exports.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
|
|
1002
|
+
let result;
|
|
1003
|
+
try {
|
|
1004
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
1005
|
+
} catch (_) {
|
|
1006
|
+
result = false;
|
|
1007
|
+
}
|
|
1008
|
+
const ret = result;
|
|
1009
|
+
return ret;
|
|
1010
|
+
};
|
|
1011
|
+
|
|
985
1012
|
module.exports.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
|
|
986
1013
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
987
1014
|
return addHeapObject(ret);
|
|
@@ -997,6 +1024,11 @@ module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
|
|
|
997
1024
|
return ret;
|
|
998
1025
|
};
|
|
999
1026
|
|
|
1027
|
+
module.exports.__wbg_byteLength_58f7b4fab1919d44 = function(arg0) {
|
|
1028
|
+
const ret = getObject(arg0).byteLength;
|
|
1029
|
+
return ret;
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1000
1032
|
module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
|
1001
1033
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
1002
1034
|
};
|
|
@@ -1038,7 +1070,7 @@ module.exports.__wbindgen_memory = function() {
|
|
|
1038
1070
|
return addHeapObject(ret);
|
|
1039
1071
|
};
|
|
1040
1072
|
|
|
1041
|
-
module.exports.
|
|
1073
|
+
module.exports.__wbindgen_closure_wrapper1801 = function(arg0, arg1, arg2) {
|
|
1042
1074
|
const ret = makeMutClosure(arg0, arg1, 295, __wbg_adapter_26);
|
|
1043
1075
|
return addHeapObject(ret);
|
|
1044
1076
|
};
|
package/package.json
CHANGED
package/pubky.d.ts
CHANGED
|
@@ -118,17 +118,22 @@ export class PubkyClient {
|
|
|
118
118
|
*/
|
|
119
119
|
delete(url: string): Promise<void>;
|
|
120
120
|
/**
|
|
121
|
-
* Returns a list of Pubky
|
|
122
|
-
* respecting the `cursor`, `reverse` and `limit` options.
|
|
121
|
+
* Returns a list of Pubky urls (as strings).
|
|
123
122
|
*
|
|
124
|
-
* `
|
|
123
|
+
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
124
|
+
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
125
|
+
* or a path (to a file or directory) relative to the `url`
|
|
126
|
+
* - `reverse`: List in reverse order
|
|
127
|
+
* - `limit` Limit the number of urls in the response
|
|
128
|
+
* - `shallow`: List directories and files, instead of flat list of files.
|
|
125
129
|
* @param {string} url
|
|
126
130
|
* @param {string | undefined} [cursor]
|
|
127
131
|
* @param {boolean | undefined} [reverse]
|
|
128
132
|
* @param {number | undefined} [limit]
|
|
133
|
+
* @param {boolean | undefined} [shallow]
|
|
129
134
|
* @returns {Promise<Array<any>>}
|
|
130
135
|
*/
|
|
131
|
-
list(url: string, cursor?: string, reverse?: boolean, limit?: number): Promise<Array<any>>;
|
|
136
|
+
list(url: string, cursor?: string, reverse?: boolean, limit?: number, shallow?: boolean): Promise<Array<any>>;
|
|
132
137
|
}
|
|
133
138
|
/**
|
|
134
139
|
*/
|
package/pubky_bg.wasm
CHANGED
|
Binary file
|