@synonymdev/pubky 0.4.0 → 0.4.2-rc2
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/README.md +66 -27
- package/index.cjs +288 -327
- package/index.js +292 -332
- package/package.json +1 -1
- package/pubky.d.ts +39 -24
- package/pubky_bg.wasm +0 -0
package/package.json
CHANGED
package/pubky.d.ts
CHANGED
|
@@ -32,36 +32,13 @@ export class AuthRequest {
|
|
|
32
32
|
}
|
|
33
33
|
export class Client {
|
|
34
34
|
free(): void;
|
|
35
|
-
/**
|
|
36
|
-
* Create Client with default Settings including default relays
|
|
37
|
-
*/
|
|
38
|
-
constructor();
|
|
39
|
-
/**
|
|
40
|
-
* Create a client with with configurations appropriate for local testing:
|
|
41
|
-
* - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
|
|
42
|
-
* - transform `pubky://<pkarr public key>` to `http://<pkarr public key` instead of `https:`
|
|
43
|
-
* and read the homeserver HTTP port from the [reserved service parameter key](pubky_common::constants::reserved_param_keys::HTTP_PORT)
|
|
44
|
-
*/
|
|
45
|
-
static testnet(): Client;
|
|
46
|
-
fetch(url: string, request_init?: any | null): Promise<Promise<any>>;
|
|
47
|
-
/**
|
|
48
|
-
* Returns a list of Pubky urls (as strings).
|
|
49
|
-
*
|
|
50
|
-
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
51
|
-
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
52
|
-
* or a path (to a file or directory) relative to the `url`
|
|
53
|
-
* - `reverse`: List in reverse order
|
|
54
|
-
* - `limit` Limit the number of urls in the response
|
|
55
|
-
* - `shallow`: List directories and files, instead of flat list of files.
|
|
56
|
-
*/
|
|
57
|
-
list(url: string, cursor?: string | null, reverse?: boolean | null, limit?: number | null, shallow?: boolean | null): Promise<Array<any>>;
|
|
58
35
|
/**
|
|
59
36
|
* Signup to a homeserver and update Pkarr accordingly.
|
|
60
37
|
*
|
|
61
38
|
* The homeserver is a Pkarr domain name, where the TLD is a Pkarr public key
|
|
62
39
|
* for example "pubky.o4dksfbqk85ogzdb5osziw6befigbuxmuxkuxq8434q89uj56uyy"
|
|
63
40
|
*/
|
|
64
|
-
signup(keypair: Keypair, homeserver: PublicKey): Promise<Session>;
|
|
41
|
+
signup(keypair: Keypair, homeserver: PublicKey, signup_token?: string | null): Promise<Session>;
|
|
65
42
|
/**
|
|
66
43
|
* Check the current session for a given Pubky in its homeserver.
|
|
67
44
|
*
|
|
@@ -90,6 +67,44 @@ export class Client {
|
|
|
90
67
|
* source of the pubkyauth request url.
|
|
91
68
|
*/
|
|
92
69
|
sendAuthToken(keypair: Keypair, pubkyauth_url: string): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Republish the user's PKarr record pointing to their homeserver.
|
|
72
|
+
*
|
|
73
|
+
* This method will republish the record if no record exists or if the existing record
|
|
74
|
+
* is older than 6 hours.
|
|
75
|
+
*
|
|
76
|
+
* The method is intended for clients and key managers (e.g., pubky-ring) to
|
|
77
|
+
* keep the records of active users fresh and available in the DHT and relays.
|
|
78
|
+
* It is intended to be used only after failed signin due to homeserver resolution
|
|
79
|
+
* failure. This method is lighter than performing a re-signup into the last known
|
|
80
|
+
* homeserver, but does not return a session token, so a signin must be done after
|
|
81
|
+
* republishing. On a failed signin due to homeserver resolution failure, a key
|
|
82
|
+
* manager should always attempt to republish the last known homeserver.
|
|
83
|
+
*/
|
|
84
|
+
republishHomeserver(keypair: Keypair, host: PublicKey): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Create Client with default Settings including default relays
|
|
87
|
+
*/
|
|
88
|
+
constructor();
|
|
89
|
+
/**
|
|
90
|
+
* Create a client with with configurations appropriate for local testing:
|
|
91
|
+
* - set Pkarr relays to `["http://localhost:15411"]` instead of default relay.
|
|
92
|
+
* - transform `pubky://<pkarr public key>` to `http://<pkarr public key` instead of `https:`
|
|
93
|
+
* and read the homeserver HTTP port from the [reserved service parameter key](pubky_common::constants::reserved_param_keys::HTTP_PORT)
|
|
94
|
+
*/
|
|
95
|
+
static testnet(): Client;
|
|
96
|
+
fetch(url: string, request_init?: any | null): Promise<Promise<any>>;
|
|
97
|
+
/**
|
|
98
|
+
* Returns a list of Pubky urls (as strings).
|
|
99
|
+
*
|
|
100
|
+
* - `url`: The Pubky url (string) to the directory you want to list its content.
|
|
101
|
+
* - `cursor`: Either a full `pubky://` Url (from previous list response),
|
|
102
|
+
* or a path (to a file or directory) relative to the `url`
|
|
103
|
+
* - `reverse`: List in reverse order
|
|
104
|
+
* - `limit` Limit the number of urls in the response
|
|
105
|
+
* - `shallow`: List directories and files, instead of flat list of files.
|
|
106
|
+
*/
|
|
107
|
+
list(url: string, cursor?: string | null, reverse?: boolean | null, limit?: number | null, shallow?: boolean | null): Promise<Array<any>>;
|
|
93
108
|
}
|
|
94
109
|
export class Keypair {
|
|
95
110
|
private constructor();
|
package/pubky_bg.wasm
CHANGED
|
Binary file
|