lemmy-js-client 0.17.0-rc.56 → 0.17.0-rc.59
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/dist/http.js +1 -1
- package/dist/interfaces/api/community.d.ts +5 -0
- package/dist/interfaces/api/community.js +33 -0
- package/dist/interfaces/api/site.d.ts +6 -7
- package/dist/interfaces/api/site.js +13 -27
- package/dist/interfaces/source.d.ts +6 -2
- package/dist/interfaces/source.js +7 -1
- package/package.json +2 -2
package/dist/http.js
CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
26
26
|
function step(op) {
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
28
|
-
while (_) try {
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
31
31
|
switch (op[0]) {
|
@@ -19,6 +19,8 @@ export declare class GetCommunityResponse {
|
|
19
19
|
site: Option<Site>;
|
20
20
|
moderators: CommunityModeratorView[];
|
21
21
|
online: number;
|
22
|
+
discussion_languages: number[];
|
23
|
+
default_post_language: Option<number>;
|
22
24
|
}
|
23
25
|
export declare class CreateCommunity {
|
24
26
|
name: string;
|
@@ -28,11 +30,13 @@ export declare class CreateCommunity {
|
|
28
30
|
banner: Option<string>;
|
29
31
|
nsfw: Option<boolean>;
|
30
32
|
posting_restricted_to_mods: Option<boolean>;
|
33
|
+
discussion_languages: Option<number[]>;
|
31
34
|
auth: string;
|
32
35
|
constructor(init: CreateCommunity);
|
33
36
|
}
|
34
37
|
export declare class CommunityResponse {
|
35
38
|
community_view: CommunityView;
|
39
|
+
discussion_languages: number[];
|
36
40
|
}
|
37
41
|
export declare class ListCommunities {
|
38
42
|
type_: Option<ListingType>;
|
@@ -86,6 +90,7 @@ export declare class EditCommunity {
|
|
86
90
|
banner: Option<string>;
|
87
91
|
nsfw: Option<boolean>;
|
88
92
|
posting_restricted_to_mods: Option<boolean>;
|
93
|
+
discussion_languages: Option<number[]>;
|
89
94
|
auth: string;
|
90
95
|
constructor(init: EditCommunity);
|
91
96
|
}
|
@@ -78,6 +78,17 @@ var GetCommunityResponse = /** @class */ (function () {
|
|
78
78
|
__decorate([
|
79
79
|
(0, class_transformer_1.Type)(function () { return views_1.CommunityModeratorView; })
|
80
80
|
], GetCommunityResponse.prototype, "moderators", void 0);
|
81
|
+
__decorate([
|
82
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
83
|
+
var value = _a.value;
|
84
|
+
return (0, utils_1.toOption)(value);
|
85
|
+
}, { toClassOnly: true }),
|
86
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
87
|
+
var value = _a.value;
|
88
|
+
return (0, utils_1.toUndefined)(value);
|
89
|
+
}, { toPlainOnly: true }),
|
90
|
+
(0, class_transformer_1.Expose)()
|
91
|
+
], GetCommunityResponse.prototype, "default_post_language", void 0);
|
81
92
|
return GetCommunityResponse;
|
82
93
|
}());
|
83
94
|
exports.GetCommunityResponse = GetCommunityResponse;
|
@@ -140,6 +151,17 @@ var CreateCommunity = /** @class */ (function () {
|
|
140
151
|
}, { toPlainOnly: true }),
|
141
152
|
(0, class_transformer_1.Expose)()
|
142
153
|
], CreateCommunity.prototype, "posting_restricted_to_mods", void 0);
|
154
|
+
__decorate([
|
155
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
156
|
+
var value = _a.value;
|
157
|
+
return (0, utils_1.toOption)(value);
|
158
|
+
}, { toClassOnly: true }),
|
159
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
160
|
+
var value = _a.value;
|
161
|
+
return (0, utils_1.toUndefined)(value);
|
162
|
+
}, { toPlainOnly: true }),
|
163
|
+
(0, class_transformer_1.Expose)()
|
164
|
+
], CreateCommunity.prototype, "discussion_languages", void 0);
|
143
165
|
return CreateCommunity;
|
144
166
|
}());
|
145
167
|
exports.CreateCommunity = CreateCommunity;
|
@@ -361,6 +383,17 @@ var EditCommunity = /** @class */ (function () {
|
|
361
383
|
}, { toPlainOnly: true }),
|
362
384
|
(0, class_transformer_1.Expose)()
|
363
385
|
], EditCommunity.prototype, "posting_restricted_to_mods", void 0);
|
386
|
+
__decorate([
|
387
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
388
|
+
var value = _a.value;
|
389
|
+
return (0, utils_1.toOption)(value);
|
390
|
+
}, { toClassOnly: true }),
|
391
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
392
|
+
var value = _a.value;
|
393
|
+
return (0, utils_1.toUndefined)(value);
|
394
|
+
}, { toPlainOnly: true }),
|
395
|
+
(0, class_transformer_1.Expose)()
|
396
|
+
], EditCommunity.prototype, "discussion_languages", void 0);
|
364
397
|
return EditCommunity;
|
365
398
|
}());
|
366
399
|
exports.EditCommunity = EditCommunity;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Option } from "@sniptt/monads";
|
2
2
|
import "reflect-metadata";
|
3
3
|
import { ListingType, ModlogActionType, SearchType, SortType } from "../others";
|
4
|
-
import { Language, Tagline } from "../source";
|
4
|
+
import { Language, RegistrationMode, Tagline } from "../source";
|
5
5
|
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";
|
6
6
|
/**
|
7
7
|
* Search lemmy for different types of data.
|
@@ -65,17 +65,15 @@ export declare class CreateSite {
|
|
65
65
|
icon: Option<string>;
|
66
66
|
banner: Option<string>;
|
67
67
|
enable_downvotes: Option<boolean>;
|
68
|
-
open_registration: Option<boolean>;
|
69
68
|
enable_nsfw: Option<boolean>;
|
70
69
|
community_creation_admin_only: Option<boolean>;
|
71
70
|
require_email_verification: Option<boolean>;
|
72
|
-
|
71
|
+
registration_mode: Option<RegistrationMode>;
|
73
72
|
application_question: Option<string>;
|
74
73
|
private_instance: Option<boolean>;
|
75
74
|
default_theme: Option<string>;
|
76
75
|
default_post_listing_type: Option<string>;
|
77
76
|
application_email_admins: Option<boolean>;
|
78
|
-
auth: string;
|
79
77
|
hide_modlog_mod_names: Option<boolean>;
|
80
78
|
discussion_languages: Option<number[]>;
|
81
79
|
legal_information: Option<string>;
|
@@ -100,6 +98,8 @@ export declare class CreateSite {
|
|
100
98
|
captcha_difficulty: Option<string>;
|
101
99
|
allowed_instances: Option<string[]>;
|
102
100
|
blocked_instances: Option<string[]>;
|
101
|
+
taglines: Option<string[]>;
|
102
|
+
auth: string;
|
103
103
|
constructor(init: CreateSite);
|
104
104
|
}
|
105
105
|
export declare class EditSite {
|
@@ -109,11 +109,10 @@ export declare class EditSite {
|
|
109
109
|
icon: Option<string>;
|
110
110
|
banner: Option<string>;
|
111
111
|
enable_downvotes: Option<boolean>;
|
112
|
-
open_registration: Option<boolean>;
|
113
112
|
enable_nsfw: Option<boolean>;
|
114
113
|
community_creation_admin_only: Option<boolean>;
|
115
114
|
require_email_verification: Option<boolean>;
|
116
|
-
|
115
|
+
registration_mode: Option<RegistrationMode>;
|
117
116
|
application_question: Option<string>;
|
118
117
|
private_instance: Option<boolean>;
|
119
118
|
default_theme: Option<string>;
|
@@ -177,7 +176,7 @@ export declare class MyUserInfo {
|
|
177
176
|
moderates: CommunityModeratorView[];
|
178
177
|
community_blocks: CommunityBlockView[];
|
179
178
|
person_blocks: PersonBlockView[];
|
180
|
-
discussion_languages:
|
179
|
+
discussion_languages: number[];
|
181
180
|
}
|
182
181
|
export declare class LeaveAdmin {
|
183
182
|
auth: string;
|
@@ -319,17 +319,6 @@ var CreateSite = /** @class */ (function () {
|
|
319
319
|
}, { toPlainOnly: true }),
|
320
320
|
(0, class_transformer_1.Expose)()
|
321
321
|
], CreateSite.prototype, "enable_downvotes", void 0);
|
322
|
-
__decorate([
|
323
|
-
(0, class_transformer_1.Transform)(function (_a) {
|
324
|
-
var value = _a.value;
|
325
|
-
return (0, utils_1.toOption)(value);
|
326
|
-
}, { toClassOnly: true }),
|
327
|
-
(0, class_transformer_1.Transform)(function (_a) {
|
328
|
-
var value = _a.value;
|
329
|
-
return (0, utils_1.toUndefined)(value);
|
330
|
-
}, { toPlainOnly: true }),
|
331
|
-
(0, class_transformer_1.Expose)()
|
332
|
-
], CreateSite.prototype, "open_registration", void 0);
|
333
322
|
__decorate([
|
334
323
|
(0, class_transformer_1.Transform)(function (_a) {
|
335
324
|
var value = _a.value;
|
@@ -373,7 +362,7 @@ var CreateSite = /** @class */ (function () {
|
|
373
362
|
return (0, utils_1.toUndefined)(value);
|
374
363
|
}, { toPlainOnly: true }),
|
375
364
|
(0, class_transformer_1.Expose)()
|
376
|
-
], CreateSite.prototype, "
|
365
|
+
], CreateSite.prototype, "registration_mode", void 0);
|
377
366
|
__decorate([
|
378
367
|
(0, class_transformer_1.Transform)(function (_a) {
|
379
368
|
var value = _a.value;
|
@@ -693,6 +682,17 @@ var CreateSite = /** @class */ (function () {
|
|
693
682
|
}, { toPlainOnly: true }),
|
694
683
|
(0, class_transformer_1.Expose)()
|
695
684
|
], CreateSite.prototype, "blocked_instances", void 0);
|
685
|
+
__decorate([
|
686
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
687
|
+
var value = _a.value;
|
688
|
+
return (0, utils_1.toOption)(value);
|
689
|
+
}, { toClassOnly: true }),
|
690
|
+
(0, class_transformer_1.Transform)(function (_a) {
|
691
|
+
var value = _a.value;
|
692
|
+
return (0, utils_1.toUndefined)(value);
|
693
|
+
}, { toPlainOnly: true }),
|
694
|
+
(0, class_transformer_1.Expose)()
|
695
|
+
], CreateSite.prototype, "taglines", void 0);
|
696
696
|
return CreateSite;
|
697
697
|
}());
|
698
698
|
exports.CreateSite = CreateSite;
|
@@ -766,17 +766,6 @@ var EditSite = /** @class */ (function () {
|
|
766
766
|
}, { toPlainOnly: true }),
|
767
767
|
(0, class_transformer_1.Expose)()
|
768
768
|
], EditSite.prototype, "enable_downvotes", void 0);
|
769
|
-
__decorate([
|
770
|
-
(0, class_transformer_1.Transform)(function (_a) {
|
771
|
-
var value = _a.value;
|
772
|
-
return (0, utils_1.toOption)(value);
|
773
|
-
}, { toClassOnly: true }),
|
774
|
-
(0, class_transformer_1.Transform)(function (_a) {
|
775
|
-
var value = _a.value;
|
776
|
-
return (0, utils_1.toUndefined)(value);
|
777
|
-
}, { toPlainOnly: true }),
|
778
|
-
(0, class_transformer_1.Expose)()
|
779
|
-
], EditSite.prototype, "open_registration", void 0);
|
780
769
|
__decorate([
|
781
770
|
(0, class_transformer_1.Transform)(function (_a) {
|
782
771
|
var value = _a.value;
|
@@ -820,7 +809,7 @@ var EditSite = /** @class */ (function () {
|
|
820
809
|
return (0, utils_1.toUndefined)(value);
|
821
810
|
}, { toPlainOnly: true }),
|
822
811
|
(0, class_transformer_1.Expose)()
|
823
|
-
], EditSite.prototype, "
|
812
|
+
], EditSite.prototype, "registration_mode", void 0);
|
824
813
|
__decorate([
|
825
814
|
(0, class_transformer_1.Transform)(function (_a) {
|
826
815
|
var value = _a.value;
|
@@ -1253,9 +1242,6 @@ var MyUserInfo = /** @class */ (function () {
|
|
1253
1242
|
__decorate([
|
1254
1243
|
(0, class_transformer_1.Type)(function () { return views_1.PersonBlockView; })
|
1255
1244
|
], MyUserInfo.prototype, "person_blocks", void 0);
|
1256
|
-
__decorate([
|
1257
|
-
(0, class_transformer_1.Type)(function () { return source_1.Language; })
|
1258
|
-
], MyUserInfo.prototype, "discussion_languages", void 0);
|
1259
1245
|
return MyUserInfo;
|
1260
1246
|
}());
|
1261
1247
|
exports.MyUserInfo = MyUserInfo;
|
@@ -55,16 +55,20 @@ export declare class Site {
|
|
55
55
|
public_key: string;
|
56
56
|
instance_id: number;
|
57
57
|
}
|
58
|
+
export declare enum RegistrationMode {
|
59
|
+
Closed = "closed",
|
60
|
+
RequireApplication = "require_application",
|
61
|
+
Open = "open"
|
62
|
+
}
|
58
63
|
export declare class LocalSite {
|
59
64
|
id: number;
|
60
65
|
site_id: number;
|
61
66
|
site_setup: boolean;
|
62
67
|
enable_downvotes: boolean;
|
63
|
-
|
68
|
+
registration_mode: RegistrationMode;
|
64
69
|
enable_nsfw: boolean;
|
65
70
|
community_creation_admin_only: boolean;
|
66
71
|
require_email_verification: boolean;
|
67
|
-
require_application: boolean;
|
68
72
|
application_question: Option<string>;
|
69
73
|
private_instance: boolean;
|
70
74
|
default_theme: string;
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
7
|
};
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
9
|
-
exports.Tagline = exports.PrivateMessageReport = exports.Language = exports.RegistrationApplication = exports.CommentReply = exports.PersonMention = exports.Comment = exports.CommentReport = exports.CommunitySafe = exports.AdminPurgeComment = exports.AdminPurgePost = exports.AdminPurgeCommunity = exports.AdminPurgePerson = exports.ModAdd = exports.ModTransferCommunity = exports.ModAddCommunity = exports.ModBan = exports.ModBanFromCommunity = exports.ModRemoveCommunity = exports.ModRemoveComment = exports.ModFeaturePost = exports.ModLockPost = exports.ModRemovePost = exports.PasswordResetRequest = exports.Post = exports.PostReport = exports.PrivateMessage = exports.LocalSiteRateLimit = exports.LocalSite = exports.Site = exports.PersonSafe = exports.LocalUserSettings = void 0;
|
9
|
+
exports.Tagline = exports.PrivateMessageReport = exports.Language = exports.RegistrationApplication = exports.CommentReply = exports.PersonMention = exports.Comment = exports.CommentReport = exports.CommunitySafe = exports.AdminPurgeComment = exports.AdminPurgePost = exports.AdminPurgeCommunity = exports.AdminPurgePerson = exports.ModAdd = exports.ModTransferCommunity = exports.ModAddCommunity = exports.ModBan = exports.ModBanFromCommunity = exports.ModRemoveCommunity = exports.ModRemoveComment = exports.ModFeaturePost = exports.ModLockPost = exports.ModRemovePost = exports.PasswordResetRequest = exports.Post = exports.PostReport = exports.PrivateMessage = exports.LocalSiteRateLimit = exports.LocalSite = exports.RegistrationMode = exports.Site = exports.PersonSafe = exports.LocalUserSettings = void 0;
|
10
10
|
var class_transformer_1 = require("class-transformer");
|
11
11
|
var utils_1 = require("../utils");
|
12
12
|
var LocalUserSettings = /** @class */ (function () {
|
@@ -181,6 +181,12 @@ var Site = /** @class */ (function () {
|
|
181
181
|
return Site;
|
182
182
|
}());
|
183
183
|
exports.Site = Site;
|
184
|
+
var RegistrationMode;
|
185
|
+
(function (RegistrationMode) {
|
186
|
+
RegistrationMode["Closed"] = "closed";
|
187
|
+
RegistrationMode["RequireApplication"] = "require_application";
|
188
|
+
RegistrationMode["Open"] = "open";
|
189
|
+
})(RegistrationMode = exports.RegistrationMode || (exports.RegistrationMode = {}));
|
184
190
|
var LocalSite = /** @class */ (function () {
|
185
191
|
function LocalSite() {
|
186
192
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "lemmy-js-client",
|
3
|
-
"version": "0.17.0-rc.
|
3
|
+
"version": "0.17.0-rc.59",
|
4
4
|
"description": "A javascript / typescript client for Lemmy",
|
5
5
|
"repository": "https://github.com/LemmyNet/lemmy-js-client",
|
6
6
|
"license": "AGPL-3.0",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"scripts": {
|
14
14
|
"build": "tsc",
|
15
15
|
"docs": "typedoc src/index.ts --sourcefile-url-prefix 'https://github.com/LemmyNet/lemmy-js-client/tree/main/src/'",
|
16
|
-
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src",
|
16
|
+
"lint": "tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check src",
|
17
17
|
"prepare": "yarn run build && husky install"
|
18
18
|
},
|
19
19
|
"lint-staged": {
|