lemmy-js-client 0.17.0-rc.60 → 0.17.0-rc.62
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
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
[](https://github.com/LemmyNet/lemmy-js-client/issues)
|
5
5
|
[](LICENSE)
|
6
6
|

|
7
|
+
|
7
8
|
</div>
|
8
9
|
|
9
10
|
# lemmy-js-client
|
@@ -21,14 +22,14 @@ A javascript / typescript http and websocket client and type system for [Lemmy](
|
|
21
22
|
[LemmyWebsocket docs](https://join-lemmy.org/api/classes/LemmyWebsocket.html)
|
22
23
|
|
23
24
|
```ts
|
24
|
-
import { Login, LemmyWebsocket } from
|
25
|
+
import { Login, LemmyWebsocket } from "lemmy-js-client";
|
25
26
|
|
26
27
|
let client: LemmyWebsocket = new LemmyWebsocket();
|
27
28
|
|
28
|
-
let form =
|
29
|
+
let form: Login = {
|
29
30
|
username_or_email: "my_email@email.tld",
|
30
31
|
password: "my_pass",
|
31
|
-
}
|
32
|
+
};
|
32
33
|
|
33
34
|
this.ws.send(client.login(form));
|
34
35
|
```
|
@@ -44,3 +45,21 @@ let baseUrl = 'https://lemmy.ml';
|
|
44
45
|
let client: LemmyHttp = new LemmyHttp(baseUrl, headers?);
|
45
46
|
let jwt = await client.httpLogin(loginForm).jwt;
|
46
47
|
```
|
48
|
+
|
49
|
+
## Development
|
50
|
+
|
51
|
+
You can use [yalc](https://github.com/wclr/yalc) to develop and test changes locally:
|
52
|
+
|
53
|
+
```
|
54
|
+
yarn global add yalc
|
55
|
+
|
56
|
+
# Go to lemmy-js-client dir
|
57
|
+
yalc publish --push
|
58
|
+
|
59
|
+
# Go to your client dir
|
60
|
+
yalc add lemmy-js-client
|
61
|
+
|
62
|
+
# To do updates, go back to the lemmy-js-client dir
|
63
|
+
# This also updates it, in every dir you've added it.
|
64
|
+
yalc publish --push
|
65
|
+
```
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ListingType, ModlogActionType, SearchType, SortType } from "../others";
|
2
|
-
import { Language, Tagline } from "../source";
|
2
|
+
import { Language, RegistrationMode, Tagline } from "../source";
|
3
3
|
import { AdminPurgeCommentView, AdminPurgeCommunityView, AdminPurgePersonView, AdminPurgePostView, CommentView, CommunityBlockView, CommunityFollowerView, CommunityModeratorView, CommunityView, LocalUserSettingsView, ModAddCommunityView, ModAddView, ModBanFromCommunityView, ModBanView, ModFeaturePostView, ModLockPostView, ModRemoveCommentView, ModRemoveCommunityView, ModRemovePostView, ModTransferCommunityView, PersonBlockView, PersonViewSafe, PostView, RegistrationApplicationView, SiteView } from "../views";
|
4
4
|
/**
|
5
5
|
* Search lemmy for different types of data.
|
@@ -61,11 +61,10 @@ export interface CreateSite {
|
|
61
61
|
icon?: string;
|
62
62
|
banner?: string;
|
63
63
|
enable_downvotes?: boolean;
|
64
|
-
open_registration?: boolean;
|
65
64
|
enable_nsfw?: boolean;
|
66
65
|
community_creation_admin_only?: boolean;
|
67
66
|
require_email_verification?: boolean;
|
68
|
-
|
67
|
+
registration_mode?: RegistrationMode;
|
69
68
|
application_question?: string;
|
70
69
|
private_instance?: boolean;
|
71
70
|
default_theme?: string;
|
@@ -105,11 +104,10 @@ export interface EditSite {
|
|
105
104
|
icon?: string;
|
106
105
|
banner?: string;
|
107
106
|
enable_downvotes?: boolean;
|
108
|
-
open_registration?: boolean;
|
109
107
|
enable_nsfw?: boolean;
|
110
108
|
community_creation_admin_only?: boolean;
|
111
109
|
require_email_verification?: boolean;
|
112
|
-
|
110
|
+
registration_mode?: RegistrationMode;
|
113
111
|
application_question?: string;
|
114
112
|
private_instance?: boolean;
|
115
113
|
default_theme?: string;
|
@@ -4,6 +4,6 @@ exports.RegistrationMode = void 0;
|
|
4
4
|
var RegistrationMode;
|
5
5
|
(function (RegistrationMode) {
|
6
6
|
RegistrationMode["Closed"] = "closed";
|
7
|
-
RegistrationMode["RequireApplication"] = "
|
7
|
+
RegistrationMode["RequireApplication"] = "requireapplication";
|
8
8
|
RegistrationMode["Open"] = "open";
|
9
9
|
})(RegistrationMode = exports.RegistrationMode || (exports.RegistrationMode = {}));
|
package/package.json
CHANGED