lemmy-js-client 0.17.0-rc.2 → 0.17.0-rc.20

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.
@@ -1,2 +1,413 @@
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 });
9
+ exports.BlockCommunityResponse = exports.BlockCommunity = exports.TransferCommunity = exports.FollowCommunity = exports.RemoveCommunity = exports.DeleteCommunity = exports.EditCommunity = exports.AddModToCommunityResponse = exports.AddModToCommunity = exports.BanFromCommunityResponse = exports.BanFromCommunity = exports.ListCommunitiesResponse = exports.ListCommunities = exports.CommunityResponse = exports.CreateCommunity = exports.GetCommunityResponse = exports.GetCommunity = void 0;
10
+ var monads_1 = require("@sniptt/monads");
11
+ var class_transformer_1 = require("class-transformer");
12
+ var utils_1 = require("../../utils");
13
+ var source_1 = require("../source");
14
+ /**
15
+ * You can use either `id` or `name` as an id.
16
+ *
17
+ * To get a federated community by name, use `name@instance.tld` .
18
+ */
19
+ var GetCommunity = /** @class */ (function () {
20
+ function GetCommunity(init) {
21
+ Object.assign(this, init);
22
+ }
23
+ __decorate([
24
+ (0, class_transformer_1.Transform)(function (_a) {
25
+ var value = _a.value;
26
+ return (0, monads_1.Some)(value);
27
+ }, { toClassOnly: true }),
28
+ (0, class_transformer_1.Transform)(function (_a) {
29
+ var value = _a.value;
30
+ return (0, utils_1.toUndefined)(value);
31
+ }, { toPlainOnly: true }),
32
+ (0, class_transformer_1.Expose)()
33
+ ], GetCommunity.prototype, "id", void 0);
34
+ __decorate([
35
+ (0, class_transformer_1.Transform)(function (_a) {
36
+ var value = _a.value;
37
+ return (0, monads_1.Some)(value);
38
+ }, { toClassOnly: true }),
39
+ (0, class_transformer_1.Transform)(function (_a) {
40
+ var value = _a.value;
41
+ return (0, utils_1.toUndefined)(value);
42
+ }, { toPlainOnly: true }),
43
+ (0, class_transformer_1.Expose)()
44
+ ], GetCommunity.prototype, "name", void 0);
45
+ __decorate([
46
+ (0, class_transformer_1.Transform)(function (_a) {
47
+ var value = _a.value;
48
+ return (0, monads_1.Some)(value);
49
+ }, { toClassOnly: true }),
50
+ (0, class_transformer_1.Transform)(function (_a) {
51
+ var value = _a.value;
52
+ return (0, utils_1.toUndefined)(value);
53
+ }, { toPlainOnly: true }),
54
+ (0, class_transformer_1.Expose)()
55
+ ], GetCommunity.prototype, "auth", void 0);
56
+ return GetCommunity;
57
+ }());
58
+ exports.GetCommunity = GetCommunity;
59
+ var GetCommunityResponse = /** @class */ (function () {
60
+ function GetCommunityResponse() {
61
+ }
62
+ __decorate([
63
+ (0, class_transformer_1.Transform)(function (_a) {
64
+ var value = _a.value;
65
+ return (0, monads_1.Some)(value);
66
+ }, { toClassOnly: true }),
67
+ (0, class_transformer_1.Transform)(function (_a) {
68
+ var value = _a.value;
69
+ return (0, utils_1.toUndefined)(value);
70
+ }, { toPlainOnly: true }),
71
+ (0, class_transformer_1.Expose)(),
72
+ (0, class_transformer_1.Type)(function () { return source_1.Site; })
73
+ ], GetCommunityResponse.prototype, "site", void 0);
74
+ return GetCommunityResponse;
75
+ }());
76
+ exports.GetCommunityResponse = GetCommunityResponse;
77
+ var CreateCommunity = /** @class */ (function () {
78
+ function CreateCommunity(init) {
79
+ Object.assign(this, init);
80
+ }
81
+ __decorate([
82
+ (0, class_transformer_1.Transform)(function (_a) {
83
+ var value = _a.value;
84
+ return (0, monads_1.Some)(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
+ ], CreateCommunity.prototype, "description", void 0);
92
+ __decorate([
93
+ (0, class_transformer_1.Transform)(function (_a) {
94
+ var value = _a.value;
95
+ return (0, monads_1.Some)(value);
96
+ }, { toClassOnly: true }),
97
+ (0, class_transformer_1.Transform)(function (_a) {
98
+ var value = _a.value;
99
+ return (0, utils_1.toUndefined)(value);
100
+ }, { toPlainOnly: true }),
101
+ (0, class_transformer_1.Expose)()
102
+ ], CreateCommunity.prototype, "icon", void 0);
103
+ __decorate([
104
+ (0, class_transformer_1.Transform)(function (_a) {
105
+ var value = _a.value;
106
+ return (0, monads_1.Some)(value);
107
+ }, { toClassOnly: true }),
108
+ (0, class_transformer_1.Transform)(function (_a) {
109
+ var value = _a.value;
110
+ return (0, utils_1.toUndefined)(value);
111
+ }, { toPlainOnly: true }),
112
+ (0, class_transformer_1.Expose)()
113
+ ], CreateCommunity.prototype, "banner", void 0);
114
+ __decorate([
115
+ (0, class_transformer_1.Transform)(function (_a) {
116
+ var value = _a.value;
117
+ return (0, monads_1.Some)(value);
118
+ }, { toClassOnly: true }),
119
+ (0, class_transformer_1.Transform)(function (_a) {
120
+ var value = _a.value;
121
+ return (0, utils_1.toUndefined)(value);
122
+ }, { toPlainOnly: true }),
123
+ (0, class_transformer_1.Expose)()
124
+ ], CreateCommunity.prototype, "nsfw", void 0);
125
+ __decorate([
126
+ (0, class_transformer_1.Transform)(function (_a) {
127
+ var value = _a.value;
128
+ return (0, monads_1.Some)(value);
129
+ }, { toClassOnly: true }),
130
+ (0, class_transformer_1.Transform)(function (_a) {
131
+ var value = _a.value;
132
+ return (0, utils_1.toUndefined)(value);
133
+ }, { toPlainOnly: true }),
134
+ (0, class_transformer_1.Expose)()
135
+ ], CreateCommunity.prototype, "posting_restricted_to_mods", void 0);
136
+ return CreateCommunity;
137
+ }());
138
+ exports.CreateCommunity = CreateCommunity;
139
+ var CommunityResponse = /** @class */ (function () {
140
+ function CommunityResponse() {
141
+ }
142
+ return CommunityResponse;
143
+ }());
144
+ exports.CommunityResponse = CommunityResponse;
145
+ var ListCommunities = /** @class */ (function () {
146
+ function ListCommunities(init) {
147
+ Object.assign(this, init);
148
+ }
149
+ __decorate([
150
+ (0, class_transformer_1.Transform)(function (_a) {
151
+ var value = _a.value;
152
+ return (0, monads_1.Some)(value);
153
+ }, { toClassOnly: true }),
154
+ (0, class_transformer_1.Transform)(function (_a) {
155
+ var value = _a.value;
156
+ return (0, utils_1.toUndefined)(value);
157
+ }, { toPlainOnly: true }),
158
+ (0, class_transformer_1.Expose)()
159
+ ], ListCommunities.prototype, "type_", void 0);
160
+ __decorate([
161
+ (0, class_transformer_1.Transform)(function (_a) {
162
+ var value = _a.value;
163
+ return (0, monads_1.Some)(value);
164
+ }, { toClassOnly: true }),
165
+ (0, class_transformer_1.Transform)(function (_a) {
166
+ var value = _a.value;
167
+ return (0, utils_1.toUndefined)(value);
168
+ }, { toPlainOnly: true }),
169
+ (0, class_transformer_1.Expose)()
170
+ ], ListCommunities.prototype, "sort", void 0);
171
+ __decorate([
172
+ (0, class_transformer_1.Transform)(function (_a) {
173
+ var value = _a.value;
174
+ return (0, monads_1.Some)(value);
175
+ }, { toClassOnly: true }),
176
+ (0, class_transformer_1.Transform)(function (_a) {
177
+ var value = _a.value;
178
+ return (0, utils_1.toUndefined)(value);
179
+ }, { toPlainOnly: true }),
180
+ (0, class_transformer_1.Expose)()
181
+ ], ListCommunities.prototype, "page", void 0);
182
+ __decorate([
183
+ (0, class_transformer_1.Transform)(function (_a) {
184
+ var value = _a.value;
185
+ return (0, monads_1.Some)(value);
186
+ }, { toClassOnly: true }),
187
+ (0, class_transformer_1.Transform)(function (_a) {
188
+ var value = _a.value;
189
+ return (0, utils_1.toUndefined)(value);
190
+ }, { toPlainOnly: true }),
191
+ (0, class_transformer_1.Expose)()
192
+ ], ListCommunities.prototype, "limit", void 0);
193
+ __decorate([
194
+ (0, class_transformer_1.Transform)(function (_a) {
195
+ var value = _a.value;
196
+ return (0, monads_1.Some)(value);
197
+ }, { toClassOnly: true }),
198
+ (0, class_transformer_1.Transform)(function (_a) {
199
+ var value = _a.value;
200
+ return (0, utils_1.toUndefined)(value);
201
+ }, { toPlainOnly: true }),
202
+ (0, class_transformer_1.Expose)()
203
+ ], ListCommunities.prototype, "auth", void 0);
204
+ return ListCommunities;
205
+ }());
206
+ exports.ListCommunities = ListCommunities;
207
+ var ListCommunitiesResponse = /** @class */ (function () {
208
+ function ListCommunitiesResponse() {
209
+ }
210
+ return ListCommunitiesResponse;
211
+ }());
212
+ exports.ListCommunitiesResponse = ListCommunitiesResponse;
213
+ var BanFromCommunity = /** @class */ (function () {
214
+ function BanFromCommunity(init) {
215
+ Object.assign(this, init);
216
+ }
217
+ __decorate([
218
+ (0, class_transformer_1.Transform)(function (_a) {
219
+ var value = _a.value;
220
+ return (0, monads_1.Some)(value);
221
+ }, { toClassOnly: true }),
222
+ (0, class_transformer_1.Transform)(function (_a) {
223
+ var value = _a.value;
224
+ return (0, utils_1.toUndefined)(value);
225
+ }, { toPlainOnly: true }),
226
+ (0, class_transformer_1.Expose)()
227
+ ], BanFromCommunity.prototype, "remove_data", void 0);
228
+ __decorate([
229
+ (0, class_transformer_1.Transform)(function (_a) {
230
+ var value = _a.value;
231
+ return (0, monads_1.Some)(value);
232
+ }, { toClassOnly: true }),
233
+ (0, class_transformer_1.Transform)(function (_a) {
234
+ var value = _a.value;
235
+ return (0, utils_1.toUndefined)(value);
236
+ }, { toPlainOnly: true }),
237
+ (0, class_transformer_1.Expose)()
238
+ ], BanFromCommunity.prototype, "reason", void 0);
239
+ __decorate([
240
+ (0, class_transformer_1.Transform)(function (_a) {
241
+ var value = _a.value;
242
+ return (0, monads_1.Some)(value);
243
+ }, { toClassOnly: true }),
244
+ (0, class_transformer_1.Transform)(function (_a) {
245
+ var value = _a.value;
246
+ return (0, utils_1.toUndefined)(value);
247
+ }, { toPlainOnly: true }),
248
+ (0, class_transformer_1.Expose)()
249
+ ], BanFromCommunity.prototype, "expires", void 0);
250
+ return BanFromCommunity;
251
+ }());
252
+ exports.BanFromCommunity = BanFromCommunity;
253
+ var BanFromCommunityResponse = /** @class */ (function () {
254
+ function BanFromCommunityResponse() {
255
+ }
256
+ return BanFromCommunityResponse;
257
+ }());
258
+ exports.BanFromCommunityResponse = BanFromCommunityResponse;
259
+ var AddModToCommunity = /** @class */ (function () {
260
+ function AddModToCommunity(init) {
261
+ Object.assign(this, init);
262
+ }
263
+ return AddModToCommunity;
264
+ }());
265
+ exports.AddModToCommunity = AddModToCommunity;
266
+ var AddModToCommunityResponse = /** @class */ (function () {
267
+ function AddModToCommunityResponse() {
268
+ }
269
+ return AddModToCommunityResponse;
270
+ }());
271
+ exports.AddModToCommunityResponse = AddModToCommunityResponse;
272
+ /**
273
+ * Only mods can edit a community.
274
+ */
275
+ var EditCommunity = /** @class */ (function () {
276
+ function EditCommunity(init) {
277
+ Object.assign(this, init);
278
+ }
279
+ __decorate([
280
+ (0, class_transformer_1.Transform)(function (_a) {
281
+ var value = _a.value;
282
+ return (0, monads_1.Some)(value);
283
+ }, { toClassOnly: true }),
284
+ (0, class_transformer_1.Transform)(function (_a) {
285
+ var value = _a.value;
286
+ return (0, utils_1.toUndefined)(value);
287
+ }, { toPlainOnly: true }),
288
+ (0, class_transformer_1.Expose)()
289
+ ], EditCommunity.prototype, "title", void 0);
290
+ __decorate([
291
+ (0, class_transformer_1.Transform)(function (_a) {
292
+ var value = _a.value;
293
+ return (0, monads_1.Some)(value);
294
+ }, { toClassOnly: true }),
295
+ (0, class_transformer_1.Transform)(function (_a) {
296
+ var value = _a.value;
297
+ return (0, utils_1.toUndefined)(value);
298
+ }, { toPlainOnly: true }),
299
+ (0, class_transformer_1.Expose)()
300
+ ], EditCommunity.prototype, "description", void 0);
301
+ __decorate([
302
+ (0, class_transformer_1.Transform)(function (_a) {
303
+ var value = _a.value;
304
+ return (0, monads_1.Some)(value);
305
+ }, { toClassOnly: true }),
306
+ (0, class_transformer_1.Transform)(function (_a) {
307
+ var value = _a.value;
308
+ return (0, utils_1.toUndefined)(value);
309
+ }, { toPlainOnly: true }),
310
+ (0, class_transformer_1.Expose)()
311
+ ], EditCommunity.prototype, "icon", void 0);
312
+ __decorate([
313
+ (0, class_transformer_1.Transform)(function (_a) {
314
+ var value = _a.value;
315
+ return (0, monads_1.Some)(value);
316
+ }, { toClassOnly: true }),
317
+ (0, class_transformer_1.Transform)(function (_a) {
318
+ var value = _a.value;
319
+ return (0, utils_1.toUndefined)(value);
320
+ }, { toPlainOnly: true }),
321
+ (0, class_transformer_1.Expose)()
322
+ ], EditCommunity.prototype, "banner", void 0);
323
+ __decorate([
324
+ (0, class_transformer_1.Transform)(function (_a) {
325
+ var value = _a.value;
326
+ return (0, monads_1.Some)(value);
327
+ }, { toClassOnly: true }),
328
+ (0, class_transformer_1.Transform)(function (_a) {
329
+ var value = _a.value;
330
+ return (0, utils_1.toUndefined)(value);
331
+ }, { toPlainOnly: true }),
332
+ (0, class_transformer_1.Expose)()
333
+ ], EditCommunity.prototype, "nsfw", void 0);
334
+ __decorate([
335
+ (0, class_transformer_1.Transform)(function (_a) {
336
+ var value = _a.value;
337
+ return (0, monads_1.Some)(value);
338
+ }, { toClassOnly: true }),
339
+ (0, class_transformer_1.Transform)(function (_a) {
340
+ var value = _a.value;
341
+ return (0, utils_1.toUndefined)(value);
342
+ }, { toPlainOnly: true }),
343
+ (0, class_transformer_1.Expose)()
344
+ ], EditCommunity.prototype, "posting_restricted_to_mods", void 0);
345
+ return EditCommunity;
346
+ }());
347
+ exports.EditCommunity = EditCommunity;
348
+ var DeleteCommunity = /** @class */ (function () {
349
+ function DeleteCommunity(init) {
350
+ Object.assign(this, init);
351
+ }
352
+ return DeleteCommunity;
353
+ }());
354
+ exports.DeleteCommunity = DeleteCommunity;
355
+ /**
356
+ * Only admins can remove a community.
357
+ */
358
+ var RemoveCommunity = /** @class */ (function () {
359
+ function RemoveCommunity(init) {
360
+ Object.assign(this, init);
361
+ }
362
+ __decorate([
363
+ (0, class_transformer_1.Transform)(function (_a) {
364
+ var value = _a.value;
365
+ return (0, monads_1.Some)(value);
366
+ }, { toClassOnly: true }),
367
+ (0, class_transformer_1.Transform)(function (_a) {
368
+ var value = _a.value;
369
+ return (0, utils_1.toUndefined)(value);
370
+ }, { toPlainOnly: true }),
371
+ (0, class_transformer_1.Expose)()
372
+ ], RemoveCommunity.prototype, "reason", void 0);
373
+ __decorate([
374
+ (0, class_transformer_1.Transform)(function (_a) {
375
+ var value = _a.value;
376
+ return (0, monads_1.Some)(value);
377
+ }, { toClassOnly: true }),
378
+ (0, class_transformer_1.Transform)(function (_a) {
379
+ var value = _a.value;
380
+ return (0, utils_1.toUndefined)(value);
381
+ }, { toPlainOnly: true }),
382
+ (0, class_transformer_1.Expose)()
383
+ ], RemoveCommunity.prototype, "expires", void 0);
384
+ return RemoveCommunity;
385
+ }());
386
+ exports.RemoveCommunity = RemoveCommunity;
387
+ var FollowCommunity = /** @class */ (function () {
388
+ function FollowCommunity(init) {
389
+ Object.assign(this, init);
390
+ }
391
+ return FollowCommunity;
392
+ }());
393
+ exports.FollowCommunity = FollowCommunity;
394
+ var TransferCommunity = /** @class */ (function () {
395
+ function TransferCommunity(init) {
396
+ Object.assign(this, init);
397
+ }
398
+ return TransferCommunity;
399
+ }());
400
+ exports.TransferCommunity = TransferCommunity;
401
+ var BlockCommunity = /** @class */ (function () {
402
+ function BlockCommunity(init) {
403
+ Object.assign(this, init);
404
+ }
405
+ return BlockCommunity;
406
+ }());
407
+ exports.BlockCommunity = BlockCommunity;
408
+ var BlockCommunityResponse = /** @class */ (function () {
409
+ function BlockCommunityResponse() {
410
+ }
411
+ return BlockCommunityResponse;
412
+ }());
413
+ exports.BlockCommunityResponse = BlockCommunityResponse;
@@ -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];