lemmy-js-client 0.17.0-rc.5 → 0.17.0-rc.51

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,3 +1,4 @@
1
+ import { Option } from "@sniptt/monads";
1
2
  export declare const VERSION = "v3";
2
3
  /**
3
4
  * All of the websocket operations available.
@@ -15,16 +16,16 @@ export declare enum UserOperation {
15
16
  EditComment = 9,
16
17
  DeleteComment = 10,
17
18
  RemoveComment = 11,
18
- MarkCommentAsRead = 12,
19
- SaveComment = 13,
20
- CreateCommentLike = 14,
21
- GetPosts = 15,
22
- CreatePostLike = 16,
23
- EditPost = 17,
24
- DeletePost = 18,
25
- RemovePost = 19,
26
- LockPost = 20,
27
- StickyPost = 21,
19
+ SaveComment = 12,
20
+ CreateCommentLike = 13,
21
+ GetPosts = 14,
22
+ CreatePostLike = 15,
23
+ EditPost = 16,
24
+ DeletePost = 17,
25
+ RemovePost = 18,
26
+ LockPost = 19,
27
+ StickyPost = 20,
28
+ MarkPostAsRead = 21,
28
29
  SavePost = 22,
29
30
  EditCommunity = 23,
30
31
  DeleteCommunity = 24,
@@ -34,65 +35,78 @@ export declare enum UserOperation {
34
35
  GetReplies = 28,
35
36
  GetPersonMentions = 29,
36
37
  MarkPersonMentionAsRead = 30,
37
- GetModlog = 31,
38
- BanFromCommunity = 32,
39
- AddModToCommunity = 33,
40
- CreateSite = 34,
41
- EditSite = 35,
42
- GetSite = 36,
43
- AddAdmin = 37,
44
- GetUnreadRegistrationApplicationCount = 38,
45
- ListRegistrationApplications = 39,
46
- ApproveRegistrationApplication = 40,
47
- BanPerson = 41,
48
- GetBannedPersons = 42,
49
- Search = 43,
50
- ResolveObject = 44,
51
- MarkAllAsRead = 45,
52
- SaveUserSettings = 46,
53
- TransferCommunity = 47,
54
- LeaveAdmin = 48,
55
- DeleteAccount = 49,
56
- PasswordReset = 50,
57
- PasswordChange = 51,
58
- CreatePrivateMessage = 52,
59
- EditPrivateMessage = 53,
60
- DeletePrivateMessage = 54,
61
- MarkPrivateMessageAsRead = 55,
62
- GetPrivateMessages = 56,
63
- UserJoin = 57,
64
- GetComments = 58,
65
- GetSiteConfig = 59,
66
- SaveSiteConfig = 60,
67
- PostJoin = 61,
68
- CommunityJoin = 62,
69
- ChangePassword = 63,
70
- GetSiteMetadata = 64,
71
- BlockCommunity = 65,
72
- BlockPerson = 66,
73
- CreateCommentReport = 67,
74
- ResolveCommentReport = 68,
75
- ListCommentReports = 69,
76
- CreatePostReport = 70,
77
- ResolvePostReport = 71,
78
- ListPostReports = 72,
79
- GetReportCount = 73,
80
- GetUnreadCount = 74,
81
- VerifyEmail = 75
38
+ MarkCommentReplyAsRead = 31,
39
+ GetModlog = 32,
40
+ BanFromCommunity = 33,
41
+ AddModToCommunity = 34,
42
+ CreateSite = 35,
43
+ EditSite = 36,
44
+ GetSite = 37,
45
+ AddAdmin = 38,
46
+ GetUnreadRegistrationApplicationCount = 39,
47
+ ListRegistrationApplications = 40,
48
+ ApproveRegistrationApplication = 41,
49
+ BanPerson = 42,
50
+ GetBannedPersons = 43,
51
+ Search = 44,
52
+ ResolveObject = 45,
53
+ MarkAllAsRead = 46,
54
+ SaveUserSettings = 47,
55
+ TransferCommunity = 48,
56
+ LeaveAdmin = 49,
57
+ DeleteAccount = 50,
58
+ PasswordReset = 51,
59
+ PasswordChange = 52,
60
+ CreatePrivateMessage = 53,
61
+ EditPrivateMessage = 54,
62
+ DeletePrivateMessage = 55,
63
+ MarkPrivateMessageAsRead = 56,
64
+ CreatePrivateMessageReport = 57,
65
+ ResolvePrivateMessageReport = 58,
66
+ ListPrivateMessageReports = 59,
67
+ GetPrivateMessages = 60,
68
+ UserJoin = 61,
69
+ GetComments = 62,
70
+ PostJoin = 63,
71
+ CommunityJoin = 64,
72
+ ChangePassword = 65,
73
+ GetSiteMetadata = 66,
74
+ BlockCommunity = 67,
75
+ BlockPerson = 68,
76
+ PurgePerson = 69,
77
+ PurgeCommunity = 70,
78
+ PurgePost = 71,
79
+ PurgeComment = 72,
80
+ CreateCommentReport = 73,
81
+ ResolveCommentReport = 74,
82
+ ListCommentReports = 75,
83
+ CreatePostReport = 76,
84
+ ResolvePostReport = 77,
85
+ ListPostReports = 78,
86
+ GetReportCount = 79,
87
+ GetUnreadCount = 80,
88
+ VerifyEmail = 81
82
89
  }
83
90
  /**
84
- * Different sort types used in lemmy.
91
+ * Different post sort types used in lemmy.
85
92
  */
86
93
  export declare enum SortType {
87
94
  /**
88
- * Posts sorted by the most recent comment.
95
+ * Posts sorted by hot, but bumped by new comments up to 2 days
89
96
  */
90
97
  Active = "Active",
91
98
  /**
92
- * Posts sorted by the published time.
99
+ * Posts sorted by a decaying rank.
93
100
  */
94
101
  Hot = "Hot",
102
+ /**
103
+ * Posts sorted by the published time.
104
+ */
95
105
  New = "New",
106
+ /**
107
+ * Posts sorted by the published time ascending
108
+ */
109
+ Old = "Old",
96
110
  /**
97
111
  * The top posts for this last day.
98
112
  */
@@ -122,6 +136,27 @@ export declare enum SortType {
122
136
  */
123
137
  NewComments = "NewComments"
124
138
  }
139
+ /**
140
+ * Different comment sort types used in lemmy.
141
+ */
142
+ export declare enum CommentSortType {
143
+ /**
144
+ * Comments sorted by a decaying rank.
145
+ */
146
+ Hot = "Hot",
147
+ /**
148
+ * Comments sorted by top score.
149
+ */
150
+ Top = "Top",
151
+ /**
152
+ * Comments sorted by new.
153
+ */
154
+ New = "New",
155
+ /**
156
+ * Comments sorted by old.
157
+ */
158
+ Old = "Old"
159
+ }
125
160
  /**
126
161
  * The different listing types for post and comment fetches.
127
162
  */
@@ -143,44 +178,41 @@ export declare enum SearchType {
143
178
  Url = "Url"
144
179
  }
145
180
  /**
146
- * A websocket response. Includes the return type.
147
- * Can be used like:
148
- *
149
- * ```ts
150
- * if (op == UserOperation.Search) {
151
- * let data = wsJsonToRes<SearchResponse>(msg).data;
152
- * }
153
- * ```
181
+ * Mod log action types
154
182
  */
155
- export interface WebSocketResponse<ResponseType> {
156
- op: UserOperation;
157
- /**
158
- * This contains the data for a websocket response.
159
- *
160
- * The correct response type if given is in [[LemmyHttp]].
161
- */
162
- data: ResponseType;
183
+ export declare enum ModlogActionType {
184
+ All = "All",
185
+ ModRemovePost = "ModRemovePost",
186
+ ModLockPost = "ModLockPost",
187
+ ModStickyPost = "ModStickyPost",
188
+ ModRemoveComment = "ModRemoveComment",
189
+ ModRemoveCommunity = "ModRemoveCommunity",
190
+ ModBanFromCommunity = "ModBanFromCommunity",
191
+ ModAddCommunity = "ModAddCommunity",
192
+ ModTransferCommunity = "ModTransferCommunity",
193
+ ModAdd = "ModAdd",
194
+ ModBan = "ModBan",
195
+ ModHideCommunity = "ModHideCommunity",
196
+ AdminPurgePerson = "AdminPurgePerson",
197
+ AdminPurgeCommunity = "AdminPurgeCommunity",
198
+ AdminPurgePost = "AdminPurgePost",
199
+ AdminPurgeComment = "AdminPurgeComment"
163
200
  }
164
201
  /**
165
- * A websocket JSON response that includes the errors.
202
+ * Different Subscribed states
166
203
  */
167
- export interface WebSocketJsonResponse<ResponseType> {
168
- op?: string;
169
- /**
170
- * This contains the data for a websocket response.
171
- *
172
- * The correct response type if given is in [[LemmyHttp]].
173
- */
174
- data?: ResponseType;
175
- error?: string;
176
- reconnect?: boolean;
204
+ export declare enum SubscribedType {
205
+ Subscribed = "Subscribed",
206
+ NotSubscribed = "NotSubscribed",
207
+ Pending = "Pending"
177
208
  }
178
209
  /**
179
210
  * A holder for a site's metadata ( such as opengraph tags ), used for post links.
180
211
  */
181
- export interface SiteMetadata {
182
- title?: string;
183
- description?: string;
184
- image?: string;
185
- html?: string;
212
+ export declare class SiteMetadata {
213
+ title: Option<string>;
214
+ description: Option<string>;
215
+ image: Option<string>;
216
+ html: Option<string>;
217
+ constructor(init: SiteMetadata);
186
218
  }
@@ -1,6 +1,14 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchType = exports.ListingType = exports.SortType = exports.UserOperation = exports.VERSION = void 0;
9
+ exports.SiteMetadata = exports.SubscribedType = exports.ModlogActionType = exports.SearchType = exports.ListingType = exports.CommentSortType = exports.SortType = exports.UserOperation = exports.VERSION = void 0;
10
+ var class_transformer_1 = require("class-transformer");
11
+ var utils_1 = require("../utils");
4
12
  exports.VERSION = "v3";
5
13
  /**
6
14
  * All of the websocket operations available.
@@ -19,16 +27,16 @@ var UserOperation;
19
27
  UserOperation[UserOperation["EditComment"] = 9] = "EditComment";
20
28
  UserOperation[UserOperation["DeleteComment"] = 10] = "DeleteComment";
21
29
  UserOperation[UserOperation["RemoveComment"] = 11] = "RemoveComment";
22
- UserOperation[UserOperation["MarkCommentAsRead"] = 12] = "MarkCommentAsRead";
23
- UserOperation[UserOperation["SaveComment"] = 13] = "SaveComment";
24
- UserOperation[UserOperation["CreateCommentLike"] = 14] = "CreateCommentLike";
25
- UserOperation[UserOperation["GetPosts"] = 15] = "GetPosts";
26
- UserOperation[UserOperation["CreatePostLike"] = 16] = "CreatePostLike";
27
- UserOperation[UserOperation["EditPost"] = 17] = "EditPost";
28
- UserOperation[UserOperation["DeletePost"] = 18] = "DeletePost";
29
- UserOperation[UserOperation["RemovePost"] = 19] = "RemovePost";
30
- UserOperation[UserOperation["LockPost"] = 20] = "LockPost";
31
- UserOperation[UserOperation["StickyPost"] = 21] = "StickyPost";
30
+ UserOperation[UserOperation["SaveComment"] = 12] = "SaveComment";
31
+ UserOperation[UserOperation["CreateCommentLike"] = 13] = "CreateCommentLike";
32
+ UserOperation[UserOperation["GetPosts"] = 14] = "GetPosts";
33
+ UserOperation[UserOperation["CreatePostLike"] = 15] = "CreatePostLike";
34
+ UserOperation[UserOperation["EditPost"] = 16] = "EditPost";
35
+ UserOperation[UserOperation["DeletePost"] = 17] = "DeletePost";
36
+ UserOperation[UserOperation["RemovePost"] = 18] = "RemovePost";
37
+ UserOperation[UserOperation["LockPost"] = 19] = "LockPost";
38
+ UserOperation[UserOperation["StickyPost"] = 20] = "StickyPost";
39
+ UserOperation[UserOperation["MarkPostAsRead"] = 21] = "MarkPostAsRead";
32
40
  UserOperation[UserOperation["SavePost"] = 22] = "SavePost";
33
41
  UserOperation[UserOperation["EditCommunity"] = 23] = "EditCommunity";
34
42
  UserOperation[UserOperation["DeleteCommunity"] = 24] = "DeleteCommunity";
@@ -38,66 +46,79 @@ var UserOperation;
38
46
  UserOperation[UserOperation["GetReplies"] = 28] = "GetReplies";
39
47
  UserOperation[UserOperation["GetPersonMentions"] = 29] = "GetPersonMentions";
40
48
  UserOperation[UserOperation["MarkPersonMentionAsRead"] = 30] = "MarkPersonMentionAsRead";
41
- UserOperation[UserOperation["GetModlog"] = 31] = "GetModlog";
42
- UserOperation[UserOperation["BanFromCommunity"] = 32] = "BanFromCommunity";
43
- UserOperation[UserOperation["AddModToCommunity"] = 33] = "AddModToCommunity";
44
- UserOperation[UserOperation["CreateSite"] = 34] = "CreateSite";
45
- UserOperation[UserOperation["EditSite"] = 35] = "EditSite";
46
- UserOperation[UserOperation["GetSite"] = 36] = "GetSite";
47
- UserOperation[UserOperation["AddAdmin"] = 37] = "AddAdmin";
48
- UserOperation[UserOperation["GetUnreadRegistrationApplicationCount"] = 38] = "GetUnreadRegistrationApplicationCount";
49
- UserOperation[UserOperation["ListRegistrationApplications"] = 39] = "ListRegistrationApplications";
50
- UserOperation[UserOperation["ApproveRegistrationApplication"] = 40] = "ApproveRegistrationApplication";
51
- UserOperation[UserOperation["BanPerson"] = 41] = "BanPerson";
52
- UserOperation[UserOperation["GetBannedPersons"] = 42] = "GetBannedPersons";
53
- UserOperation[UserOperation["Search"] = 43] = "Search";
54
- UserOperation[UserOperation["ResolveObject"] = 44] = "ResolveObject";
55
- UserOperation[UserOperation["MarkAllAsRead"] = 45] = "MarkAllAsRead";
56
- UserOperation[UserOperation["SaveUserSettings"] = 46] = "SaveUserSettings";
57
- UserOperation[UserOperation["TransferCommunity"] = 47] = "TransferCommunity";
58
- UserOperation[UserOperation["LeaveAdmin"] = 48] = "LeaveAdmin";
59
- UserOperation[UserOperation["DeleteAccount"] = 49] = "DeleteAccount";
60
- UserOperation[UserOperation["PasswordReset"] = 50] = "PasswordReset";
61
- UserOperation[UserOperation["PasswordChange"] = 51] = "PasswordChange";
62
- UserOperation[UserOperation["CreatePrivateMessage"] = 52] = "CreatePrivateMessage";
63
- UserOperation[UserOperation["EditPrivateMessage"] = 53] = "EditPrivateMessage";
64
- UserOperation[UserOperation["DeletePrivateMessage"] = 54] = "DeletePrivateMessage";
65
- UserOperation[UserOperation["MarkPrivateMessageAsRead"] = 55] = "MarkPrivateMessageAsRead";
66
- UserOperation[UserOperation["GetPrivateMessages"] = 56] = "GetPrivateMessages";
67
- UserOperation[UserOperation["UserJoin"] = 57] = "UserJoin";
68
- UserOperation[UserOperation["GetComments"] = 58] = "GetComments";
69
- UserOperation[UserOperation["GetSiteConfig"] = 59] = "GetSiteConfig";
70
- UserOperation[UserOperation["SaveSiteConfig"] = 60] = "SaveSiteConfig";
71
- UserOperation[UserOperation["PostJoin"] = 61] = "PostJoin";
72
- UserOperation[UserOperation["CommunityJoin"] = 62] = "CommunityJoin";
73
- UserOperation[UserOperation["ChangePassword"] = 63] = "ChangePassword";
74
- UserOperation[UserOperation["GetSiteMetadata"] = 64] = "GetSiteMetadata";
75
- UserOperation[UserOperation["BlockCommunity"] = 65] = "BlockCommunity";
76
- UserOperation[UserOperation["BlockPerson"] = 66] = "BlockPerson";
77
- UserOperation[UserOperation["CreateCommentReport"] = 67] = "CreateCommentReport";
78
- UserOperation[UserOperation["ResolveCommentReport"] = 68] = "ResolveCommentReport";
79
- UserOperation[UserOperation["ListCommentReports"] = 69] = "ListCommentReports";
80
- UserOperation[UserOperation["CreatePostReport"] = 70] = "CreatePostReport";
81
- UserOperation[UserOperation["ResolvePostReport"] = 71] = "ResolvePostReport";
82
- UserOperation[UserOperation["ListPostReports"] = 72] = "ListPostReports";
83
- UserOperation[UserOperation["GetReportCount"] = 73] = "GetReportCount";
84
- UserOperation[UserOperation["GetUnreadCount"] = 74] = "GetUnreadCount";
85
- UserOperation[UserOperation["VerifyEmail"] = 75] = "VerifyEmail";
49
+ UserOperation[UserOperation["MarkCommentReplyAsRead"] = 31] = "MarkCommentReplyAsRead";
50
+ UserOperation[UserOperation["GetModlog"] = 32] = "GetModlog";
51
+ UserOperation[UserOperation["BanFromCommunity"] = 33] = "BanFromCommunity";
52
+ UserOperation[UserOperation["AddModToCommunity"] = 34] = "AddModToCommunity";
53
+ UserOperation[UserOperation["CreateSite"] = 35] = "CreateSite";
54
+ UserOperation[UserOperation["EditSite"] = 36] = "EditSite";
55
+ UserOperation[UserOperation["GetSite"] = 37] = "GetSite";
56
+ UserOperation[UserOperation["AddAdmin"] = 38] = "AddAdmin";
57
+ UserOperation[UserOperation["GetUnreadRegistrationApplicationCount"] = 39] = "GetUnreadRegistrationApplicationCount";
58
+ UserOperation[UserOperation["ListRegistrationApplications"] = 40] = "ListRegistrationApplications";
59
+ UserOperation[UserOperation["ApproveRegistrationApplication"] = 41] = "ApproveRegistrationApplication";
60
+ UserOperation[UserOperation["BanPerson"] = 42] = "BanPerson";
61
+ UserOperation[UserOperation["GetBannedPersons"] = 43] = "GetBannedPersons";
62
+ UserOperation[UserOperation["Search"] = 44] = "Search";
63
+ UserOperation[UserOperation["ResolveObject"] = 45] = "ResolveObject";
64
+ UserOperation[UserOperation["MarkAllAsRead"] = 46] = "MarkAllAsRead";
65
+ UserOperation[UserOperation["SaveUserSettings"] = 47] = "SaveUserSettings";
66
+ UserOperation[UserOperation["TransferCommunity"] = 48] = "TransferCommunity";
67
+ UserOperation[UserOperation["LeaveAdmin"] = 49] = "LeaveAdmin";
68
+ UserOperation[UserOperation["DeleteAccount"] = 50] = "DeleteAccount";
69
+ UserOperation[UserOperation["PasswordReset"] = 51] = "PasswordReset";
70
+ UserOperation[UserOperation["PasswordChange"] = 52] = "PasswordChange";
71
+ UserOperation[UserOperation["CreatePrivateMessage"] = 53] = "CreatePrivateMessage";
72
+ UserOperation[UserOperation["EditPrivateMessage"] = 54] = "EditPrivateMessage";
73
+ UserOperation[UserOperation["DeletePrivateMessage"] = 55] = "DeletePrivateMessage";
74
+ UserOperation[UserOperation["MarkPrivateMessageAsRead"] = 56] = "MarkPrivateMessageAsRead";
75
+ UserOperation[UserOperation["CreatePrivateMessageReport"] = 57] = "CreatePrivateMessageReport";
76
+ UserOperation[UserOperation["ResolvePrivateMessageReport"] = 58] = "ResolvePrivateMessageReport";
77
+ UserOperation[UserOperation["ListPrivateMessageReports"] = 59] = "ListPrivateMessageReports";
78
+ UserOperation[UserOperation["GetPrivateMessages"] = 60] = "GetPrivateMessages";
79
+ UserOperation[UserOperation["UserJoin"] = 61] = "UserJoin";
80
+ UserOperation[UserOperation["GetComments"] = 62] = "GetComments";
81
+ UserOperation[UserOperation["PostJoin"] = 63] = "PostJoin";
82
+ UserOperation[UserOperation["CommunityJoin"] = 64] = "CommunityJoin";
83
+ UserOperation[UserOperation["ChangePassword"] = 65] = "ChangePassword";
84
+ UserOperation[UserOperation["GetSiteMetadata"] = 66] = "GetSiteMetadata";
85
+ UserOperation[UserOperation["BlockCommunity"] = 67] = "BlockCommunity";
86
+ UserOperation[UserOperation["BlockPerson"] = 68] = "BlockPerson";
87
+ UserOperation[UserOperation["PurgePerson"] = 69] = "PurgePerson";
88
+ UserOperation[UserOperation["PurgeCommunity"] = 70] = "PurgeCommunity";
89
+ UserOperation[UserOperation["PurgePost"] = 71] = "PurgePost";
90
+ UserOperation[UserOperation["PurgeComment"] = 72] = "PurgeComment";
91
+ UserOperation[UserOperation["CreateCommentReport"] = 73] = "CreateCommentReport";
92
+ UserOperation[UserOperation["ResolveCommentReport"] = 74] = "ResolveCommentReport";
93
+ UserOperation[UserOperation["ListCommentReports"] = 75] = "ListCommentReports";
94
+ UserOperation[UserOperation["CreatePostReport"] = 76] = "CreatePostReport";
95
+ UserOperation[UserOperation["ResolvePostReport"] = 77] = "ResolvePostReport";
96
+ UserOperation[UserOperation["ListPostReports"] = 78] = "ListPostReports";
97
+ UserOperation[UserOperation["GetReportCount"] = 79] = "GetReportCount";
98
+ UserOperation[UserOperation["GetUnreadCount"] = 80] = "GetUnreadCount";
99
+ UserOperation[UserOperation["VerifyEmail"] = 81] = "VerifyEmail";
86
100
  })(UserOperation = exports.UserOperation || (exports.UserOperation = {}));
87
101
  /**
88
- * Different sort types used in lemmy.
102
+ * Different post sort types used in lemmy.
89
103
  */
90
104
  var SortType;
91
105
  (function (SortType) {
92
106
  /**
93
- * Posts sorted by the most recent comment.
107
+ * Posts sorted by hot, but bumped by new comments up to 2 days
94
108
  */
95
109
  SortType["Active"] = "Active";
96
110
  /**
97
- * Posts sorted by the published time.
111
+ * Posts sorted by a decaying rank.
98
112
  */
99
113
  SortType["Hot"] = "Hot";
114
+ /**
115
+ * Posts sorted by the published time.
116
+ */
100
117
  SortType["New"] = "New";
118
+ /**
119
+ * Posts sorted by the published time ascending
120
+ */
121
+ SortType["Old"] = "Old";
101
122
  /**
102
123
  * The top posts for this last day.
103
124
  */
@@ -127,6 +148,28 @@ var SortType;
127
148
  */
128
149
  SortType["NewComments"] = "NewComments";
129
150
  })(SortType = exports.SortType || (exports.SortType = {}));
151
+ /**
152
+ * Different comment sort types used in lemmy.
153
+ */
154
+ var CommentSortType;
155
+ (function (CommentSortType) {
156
+ /**
157
+ * Comments sorted by a decaying rank.
158
+ */
159
+ CommentSortType["Hot"] = "Hot";
160
+ /**
161
+ * Comments sorted by top score.
162
+ */
163
+ CommentSortType["Top"] = "Top";
164
+ /**
165
+ * Comments sorted by new.
166
+ */
167
+ CommentSortType["New"] = "New";
168
+ /**
169
+ * Comments sorted by old.
170
+ */
171
+ CommentSortType["Old"] = "Old";
172
+ })(CommentSortType = exports.CommentSortType || (exports.CommentSortType = {}));
130
173
  /**
131
174
  * The different listing types for post and comment fetches.
132
175
  */
@@ -149,3 +192,88 @@ var SearchType;
149
192
  SearchType["Users"] = "Users";
150
193
  SearchType["Url"] = "Url";
151
194
  })(SearchType = exports.SearchType || (exports.SearchType = {}));
195
+ /**
196
+ * Mod log action types
197
+ */
198
+ var ModlogActionType;
199
+ (function (ModlogActionType) {
200
+ ModlogActionType["All"] = "All";
201
+ ModlogActionType["ModRemovePost"] = "ModRemovePost";
202
+ ModlogActionType["ModLockPost"] = "ModLockPost";
203
+ ModlogActionType["ModStickyPost"] = "ModStickyPost";
204
+ ModlogActionType["ModRemoveComment"] = "ModRemoveComment";
205
+ ModlogActionType["ModRemoveCommunity"] = "ModRemoveCommunity";
206
+ ModlogActionType["ModBanFromCommunity"] = "ModBanFromCommunity";
207
+ ModlogActionType["ModAddCommunity"] = "ModAddCommunity";
208
+ ModlogActionType["ModTransferCommunity"] = "ModTransferCommunity";
209
+ ModlogActionType["ModAdd"] = "ModAdd";
210
+ ModlogActionType["ModBan"] = "ModBan";
211
+ ModlogActionType["ModHideCommunity"] = "ModHideCommunity";
212
+ ModlogActionType["AdminPurgePerson"] = "AdminPurgePerson";
213
+ ModlogActionType["AdminPurgeCommunity"] = "AdminPurgeCommunity";
214
+ ModlogActionType["AdminPurgePost"] = "AdminPurgePost";
215
+ ModlogActionType["AdminPurgeComment"] = "AdminPurgeComment";
216
+ })(ModlogActionType = exports.ModlogActionType || (exports.ModlogActionType = {}));
217
+ /**
218
+ * Different Subscribed states
219
+ */
220
+ var SubscribedType;
221
+ (function (SubscribedType) {
222
+ SubscribedType["Subscribed"] = "Subscribed";
223
+ SubscribedType["NotSubscribed"] = "NotSubscribed";
224
+ SubscribedType["Pending"] = "Pending";
225
+ })(SubscribedType = exports.SubscribedType || (exports.SubscribedType = {}));
226
+ /**
227
+ * A holder for a site's metadata ( such as opengraph tags ), used for post links.
228
+ */
229
+ var SiteMetadata = /** @class */ (function () {
230
+ function SiteMetadata(init) {
231
+ Object.assign(this, init);
232
+ }
233
+ __decorate([
234
+ (0, class_transformer_1.Transform)(function (_a) {
235
+ var value = _a.value;
236
+ return (0, utils_1.toOption)(value);
237
+ }, { toClassOnly: true }),
238
+ (0, class_transformer_1.Transform)(function (_a) {
239
+ var value = _a.value;
240
+ return (0, utils_1.toUndefined)(value);
241
+ }, { toPlainOnly: true }),
242
+ (0, class_transformer_1.Expose)()
243
+ ], SiteMetadata.prototype, "title", void 0);
244
+ __decorate([
245
+ (0, class_transformer_1.Transform)(function (_a) {
246
+ var value = _a.value;
247
+ return (0, utils_1.toOption)(value);
248
+ }, { toClassOnly: true }),
249
+ (0, class_transformer_1.Transform)(function (_a) {
250
+ var value = _a.value;
251
+ return (0, utils_1.toUndefined)(value);
252
+ }, { toPlainOnly: true }),
253
+ (0, class_transformer_1.Expose)()
254
+ ], SiteMetadata.prototype, "description", void 0);
255
+ __decorate([
256
+ (0, class_transformer_1.Transform)(function (_a) {
257
+ var value = _a.value;
258
+ return (0, utils_1.toOption)(value);
259
+ }, { toClassOnly: true }),
260
+ (0, class_transformer_1.Transform)(function (_a) {
261
+ var value = _a.value;
262
+ return (0, utils_1.toUndefined)(value);
263
+ }, { toPlainOnly: true }),
264
+ (0, class_transformer_1.Expose)()
265
+ ], SiteMetadata.prototype, "image", void 0);
266
+ __decorate([
267
+ (0, class_transformer_1.Transform)(function (_a) {
268
+ var value = _a.value;
269
+ return (0, utils_1.toOption)(value);
270
+ }, { toClassOnly: true }),
271
+ (0, class_transformer_1.Transform)(function (_a) {
272
+ var value = _a.value;
273
+ return (0, utils_1.toUndefined)(value);
274
+ }, { toPlainOnly: true }),
275
+ (0, class_transformer_1.Expose)()
276
+ ], SiteMetadata.prototype, "html", void 0);
277
+ return SiteMetadata;
278
+ }());
279
+ exports.SiteMetadata = SiteMetadata;