@devvit/public-api 0.12.0-next-2025-03-31-81fa43e0f.0 → 0.12.0-next-2025-04-10-2ee75c532.0
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/apis/makeAPIClients.d.ts.map +1 -1
- package/apis/makeAPIClients.js +0 -3
- package/apis/reddit/RedditAPIClient.d.ts +37 -1
- package/apis/reddit/RedditAPIClient.d.ts.map +1 -1
- package/apis/reddit/RedditAPIClient.js +150 -113
- package/apis/reddit/common.d.ts +4 -1
- package/apis/reddit/common.d.ts.map +1 -1
- package/apis/reddit/index.d.ts +1104 -0
- package/apis/reddit/index.d.ts.map +1 -0
- package/apis/reddit/index.js +1435 -0
- package/apis/reddit/models/Comment.d.ts +2 -0
- package/apis/reddit/models/Comment.d.ts.map +1 -1
- package/apis/reddit/models/Comment.js +6 -2
- package/apis/reddit/models/ModAction.d.ts +0 -3
- package/apis/reddit/models/ModAction.d.ts.map +1 -1
- package/apis/reddit/models/ModAction.js +2 -1
- package/apis/reddit/models/Post.d.ts +3 -0
- package/apis/reddit/models/Post.d.ts.map +1 -1
- package/apis/reddit/models/Post.js +16 -7
- package/apis/reddit/models/Subreddit.d.ts +1 -19
- package/apis/reddit/models/Subreddit.d.ts.map +1 -1
- package/apis/reddit/models/Subreddit.js +15 -9
- package/apis/reddit/models/User.js +13 -0
- package/apis/reddit/models/Vault.d.ts +0 -3
- package/apis/reddit/models/Vault.d.ts.map +1 -1
- package/apis/reddit/models/Vault.js +7 -2
- package/apis/reddit/models/index.d.ts +1 -1
- package/apis/reddit/models/index.d.ts.map +1 -1
- package/apis/reddit/models/index.js +0 -1
- package/apis/reddit/tests/utils/createTestRedditApiContext.d.ts +7 -0
- package/apis/reddit/tests/utils/createTestRedditApiContext.d.ts.map +1 -0
- package/apis/reddit/tests/utils/{createTestRedditApiClient.js → createTestRedditApiContext.js} +12 -5
- package/apis/settings/SettingsClient.d.ts +3 -1
- package/apis/settings/SettingsClient.d.ts.map +1 -1
- package/apis/settings/SettingsClient.js +34 -0
- package/devvit/Devvit.d.ts.map +1 -1
- package/devvit/Devvit.js +11 -0
- package/devvit/internals/async-metadata.d.ts +2 -0
- package/devvit/internals/async-metadata.d.ts.map +1 -0
- package/devvit/internals/async-metadata.js +65 -0
- package/devvit/internals/blocks/BlocksReconciler.d.ts.map +1 -1
- package/devvit/internals/blocks/BlocksReconciler.js +12 -14
- package/devvit/internals/blocks/handler/BlocksHandler.d.ts.map +1 -1
- package/devvit/internals/blocks/handler/BlocksHandler.js +6 -3
- package/devvit/internals/blocks/handler/ContextBuilder.d.ts.map +1 -1
- package/devvit/internals/blocks/handler/ContextBuilder.js +0 -3
- package/devvit/internals/blocks/handler/useWebView.d.ts.map +1 -1
- package/devvit/internals/blocks/handler/useWebView.js +9 -8
- package/devvit/internals/context.d.ts.map +1 -1
- package/devvit/internals/context.js +3 -1
- package/devvit/internals/csrf.d.ts.map +1 -1
- package/devvit/internals/csrf.js +7 -8
- package/devvit/internals/helpers/devvitInternalMessage.d.ts +12 -0
- package/devvit/internals/helpers/devvitInternalMessage.d.ts.map +1 -0
- package/devvit/internals/helpers/devvitInternalMessage.js +17 -0
- package/devvit/internals/helpers/extendDevvitPrototype.d.ts +6 -1
- package/devvit/internals/helpers/extendDevvitPrototype.d.ts.map +1 -1
- package/devvit/internals/helpers/extendDevvitPrototype.js +9 -1
- package/devvit/internals/menu-items.d.ts.map +1 -1
- package/index.d.ts +2 -1
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/meta.json +231 -154
- package/meta.min.json +281 -127
- package/package.json +9 -9
- package/public-api.d.ts +2706 -2060
- package/public-api.iife.js +1734 -2217
- package/public-api.min.js +6 -6
- package/public-api.min.js.map +4 -4
- package/types/configuration.d.ts +2 -0
- package/types/configuration.d.ts.map +1 -1
- package/types/context.d.ts +2 -4
- package/types/context.d.ts.map +1 -1
- package/version.json +2 -2
- package/apis/reddit/tests/utils/createTestRedditApiClient.d.ts +0 -7
- package/apis/reddit/tests/utils/createTestRedditApiClient.d.ts.map +0 -1
|
@@ -9,12 +9,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var __RedditAPIClient_metadata, __RedditAPIClient_modMailService, __RedditAPIClient_currentUser, __RedditAPIClient_currentUsername;
|
|
13
13
|
import {} from '@devvit/protos';
|
|
14
14
|
import { Header } from '@devvit/shared-types/Header.js';
|
|
15
15
|
import { asT3ID, asT5ID, asTID, isT1ID, isT3ID } from '@devvit/shared-types/tid.js';
|
|
16
16
|
import { Devvit } from '../../devvit/Devvit.js';
|
|
17
|
-
import {
|
|
17
|
+
import { _getModerationLog, _getSubredditInfoById, _getSubredditInfoByName, _getSubredditLeaderboard, _getSubredditNameById, _getSubredditStyles, AboutLocations, Comment, Flair, FlairTemplate, getCurrentUsernameFromMetadata, ModMailService, ModNote, Post, PrivateMessage, Subreddit, User, Widget, WikiPage, } from './models/index.js';
|
|
18
|
+
import { getVaultByAddress, getVaultByUserId } from './models/Vault.js';
|
|
18
19
|
/**
|
|
19
20
|
* The Reddit API Client
|
|
20
21
|
*
|
|
@@ -40,14 +41,14 @@ import { AboutLocations, Comment, Flair, FlairTemplate, getCurrentUsernameFromMe
|
|
|
40
41
|
* }
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
|
-
export class
|
|
44
|
+
export class _RedditAPIClient {
|
|
44
45
|
constructor(metadata) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
__classPrivateFieldSet(this,
|
|
50
|
-
__classPrivateFieldSet(this,
|
|
46
|
+
__RedditAPIClient_metadata.set(this, void 0);
|
|
47
|
+
__RedditAPIClient_modMailService.set(this, void 0);
|
|
48
|
+
__RedditAPIClient_currentUser.set(this, void 0);
|
|
49
|
+
__RedditAPIClient_currentUsername.set(this, void 0);
|
|
50
|
+
__classPrivateFieldSet(this, __RedditAPIClient_metadata, metadata, "f");
|
|
51
|
+
__classPrivateFieldSet(this, __RedditAPIClient_modMailService, new ModMailService(metadata), "f");
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* Get ModMail API object
|
|
@@ -61,7 +62,7 @@ export class RedditAPIClient {
|
|
|
61
62
|
* ```
|
|
62
63
|
*/
|
|
63
64
|
get modMail() {
|
|
64
|
-
return __classPrivateFieldGet(this,
|
|
65
|
+
return __classPrivateFieldGet(this, __RedditAPIClient_modMailService, "f");
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
67
68
|
* Gets a {@link Subreddit} object by ID
|
|
@@ -75,7 +76,7 @@ export class RedditAPIClient {
|
|
|
75
76
|
* ```
|
|
76
77
|
*/
|
|
77
78
|
getSubredditById(id) {
|
|
78
|
-
return Subreddit.getById(asTID(id), __classPrivateFieldGet(this,
|
|
79
|
+
return Subreddit.getById(asTID(id), __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
79
80
|
}
|
|
80
81
|
/**
|
|
81
82
|
* Gets a {@link SubredditInfo} object by ID
|
|
@@ -88,7 +89,7 @@ export class RedditAPIClient {
|
|
|
88
89
|
* ```
|
|
89
90
|
*/
|
|
90
91
|
getSubredditInfoById(id) {
|
|
91
|
-
return
|
|
92
|
+
return _getSubredditInfoById(id, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
92
93
|
}
|
|
93
94
|
/**
|
|
94
95
|
* Gets a {@link Subreddit} object by name
|
|
@@ -102,7 +103,7 @@ export class RedditAPIClient {
|
|
|
102
103
|
* ```
|
|
103
104
|
*/
|
|
104
105
|
getSubredditByName(name) {
|
|
105
|
-
return Subreddit.getByName(name, __classPrivateFieldGet(this,
|
|
106
|
+
return Subreddit.getByName(name, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
106
107
|
}
|
|
107
108
|
/**
|
|
108
109
|
* Gets a {@link SubredditInfo} object by name
|
|
@@ -115,7 +116,7 @@ export class RedditAPIClient {
|
|
|
115
116
|
* ```
|
|
116
117
|
*/
|
|
117
118
|
getSubredditInfoByName(name) {
|
|
118
|
-
return
|
|
119
|
+
return _getSubredditInfoByName(name, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
122
|
* Add a removal reason to a subreddit
|
|
@@ -139,7 +140,7 @@ export class RedditAPIClient {
|
|
|
139
140
|
* @returns {string} Removal Reason ID
|
|
140
141
|
*/
|
|
141
142
|
addSubredditRemovalReason(subredditName, options) {
|
|
142
|
-
return Subreddit.addRemovalReason(subredditName, options.title, options.message, __classPrivateFieldGet(this,
|
|
143
|
+
return Subreddit.addRemovalReason(subredditName, options.title, options.message, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
143
144
|
}
|
|
144
145
|
/**
|
|
145
146
|
* Get the list of subreddit's removal reasons (ordered)
|
|
@@ -157,7 +158,7 @@ export class RedditAPIClient {
|
|
|
157
158
|
* @returns Ordered array of Removal Reasons
|
|
158
159
|
*/
|
|
159
160
|
getSubredditRemovalReasons(subredditName) {
|
|
160
|
-
return Subreddit.getRemovalReasons(subredditName, __classPrivateFieldGet(this,
|
|
161
|
+
return Subreddit.getRemovalReasons(subredditName, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
161
162
|
}
|
|
162
163
|
/**
|
|
163
164
|
* Retrieves the name of the current subreddit.
|
|
@@ -169,12 +170,12 @@ export class RedditAPIClient {
|
|
|
169
170
|
* ```
|
|
170
171
|
*/
|
|
171
172
|
async getCurrentSubredditName() {
|
|
172
|
-
const nameFromMetadata = __classPrivateFieldGet(this,
|
|
173
|
+
const nameFromMetadata = __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f")?.[Header.SubredditName]?.values[0];
|
|
173
174
|
if (nameFromMetadata) {
|
|
174
175
|
return nameFromMetadata;
|
|
175
176
|
}
|
|
176
|
-
const subredditId = __classPrivateFieldGet(this,
|
|
177
|
-
const nameFromId = await
|
|
177
|
+
const subredditId = __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f")?.[Header.Subreddit]?.values[0];
|
|
178
|
+
const nameFromId = await _getSubredditNameById(asT5ID(subredditId), __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
178
179
|
if (!nameFromId) {
|
|
179
180
|
throw new Error("Couldn't get current subreddit's name");
|
|
180
181
|
}
|
|
@@ -190,7 +191,7 @@ export class RedditAPIClient {
|
|
|
190
191
|
* ```
|
|
191
192
|
*/
|
|
192
193
|
async getCurrentSubreddit() {
|
|
193
|
-
const currentSubreddit = await Subreddit.getFromMetadata(__classPrivateFieldGet(this,
|
|
194
|
+
const currentSubreddit = await Subreddit.getFromMetadata(__classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
194
195
|
if (!currentSubreddit) {
|
|
195
196
|
throw new Error("Couldn't get current subreddit");
|
|
196
197
|
}
|
|
@@ -203,7 +204,7 @@ export class RedditAPIClient {
|
|
|
203
204
|
* @returns A Promise that resolves to a Post object.
|
|
204
205
|
*/
|
|
205
206
|
getPostById(id) {
|
|
206
|
-
return Post.getById(asTID(id), __classPrivateFieldGet(this,
|
|
207
|
+
return Post.getById(asTID(id), __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
207
208
|
}
|
|
208
209
|
/**
|
|
209
210
|
* Submits a new post to a subreddit.
|
|
@@ -223,9 +224,34 @@ export class RedditAPIClient {
|
|
|
223
224
|
* .build()
|
|
224
225
|
* });
|
|
225
226
|
* ```
|
|
227
|
+
*
|
|
228
|
+
* By default, `submitPost()` creates a Post on behalf of the App account, but it may be called on behalf of the User making the request by setting the option `runAs: RunAs.USER`.
|
|
229
|
+
* When using `runAs: RunAs.USER` to create an experience Post, you must specify the `userGeneratedContent` option. For example:
|
|
230
|
+
* @example
|
|
231
|
+
* ```ts
|
|
232
|
+
* import { RunAs } from '@devvit/public-api';
|
|
233
|
+
*
|
|
234
|
+
* const post = await reddit.submitPost({
|
|
235
|
+
* title: 'My Devvit Post',
|
|
236
|
+
* runAs: RunAs.USER,
|
|
237
|
+
* userGeneratedContent: {
|
|
238
|
+
* text: "hello there",
|
|
239
|
+
* imageUrls: ["https://styles.redditmedia.com/t5_5wa5ww/styles/communityIcon_wyopomb2xb0a1.png", "https://styles.redditmedia.com/t5_49fkib/styles/bannerBackgroundImage_5a4axis7cku61.png"]
|
|
240
|
+
},
|
|
241
|
+
* subredditName: await reddit.getCurrentSubredditName(),
|
|
242
|
+
* textFallback: {
|
|
243
|
+
* text: 'This is a Devvit post!',
|
|
244
|
+
* },
|
|
245
|
+
* preview: (
|
|
246
|
+
* <vstack height="100%" width="100%" alignment="middle center">
|
|
247
|
+
* <text size="large">Loading...</text>
|
|
248
|
+
* </vstack>
|
|
249
|
+
* ),
|
|
250
|
+
* });
|
|
251
|
+
* ```
|
|
226
252
|
*/
|
|
227
253
|
submitPost(options) {
|
|
228
|
-
return Post.submit(options, __classPrivateFieldGet(this,
|
|
254
|
+
return Post.submit(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
229
255
|
}
|
|
230
256
|
/**
|
|
231
257
|
* Crossposts a post to a subreddit.
|
|
@@ -237,7 +263,7 @@ export class RedditAPIClient {
|
|
|
237
263
|
* @returns - A Promise that resolves to a Post object.
|
|
238
264
|
*/
|
|
239
265
|
crosspost(options) {
|
|
240
|
-
return Post.crosspost(options, __classPrivateFieldGet(this,
|
|
266
|
+
return Post.crosspost(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
241
267
|
}
|
|
242
268
|
/**
|
|
243
269
|
* Gets a {@link User} object by ID
|
|
@@ -250,7 +276,7 @@ export class RedditAPIClient {
|
|
|
250
276
|
* ```
|
|
251
277
|
*/
|
|
252
278
|
getUserById(id) {
|
|
253
|
-
return User.getById(asTID(id), __classPrivateFieldGet(this,
|
|
279
|
+
return User.getById(asTID(id), __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
254
280
|
}
|
|
255
281
|
/**
|
|
256
282
|
* Gets a {@link User} object by username
|
|
@@ -267,7 +293,7 @@ export class RedditAPIClient {
|
|
|
267
293
|
* ```
|
|
268
294
|
*/
|
|
269
295
|
getUserByUsername(username) {
|
|
270
|
-
return User.getByUsername(username, __classPrivateFieldGet(this,
|
|
296
|
+
return User.getByUsername(username, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
271
297
|
}
|
|
272
298
|
/**
|
|
273
299
|
* Get the current calling user's username.
|
|
@@ -280,8 +306,8 @@ export class RedditAPIClient {
|
|
|
280
306
|
* ```
|
|
281
307
|
*/
|
|
282
308
|
async getCurrentUsername() {
|
|
283
|
-
__classPrivateFieldSet(this,
|
|
284
|
-
return __classPrivateFieldGet(this,
|
|
309
|
+
__classPrivateFieldSet(this, __RedditAPIClient_currentUsername, __classPrivateFieldGet(this, __RedditAPIClient_currentUsername, "f") ?? getCurrentUsernameFromMetadata(__classPrivateFieldGet(this, __RedditAPIClient_metadata, "f")), "f");
|
|
310
|
+
return __classPrivateFieldGet(this, __RedditAPIClient_currentUsername, "f");
|
|
285
311
|
}
|
|
286
312
|
/**
|
|
287
313
|
* Get the current calling user.
|
|
@@ -294,8 +320,8 @@ export class RedditAPIClient {
|
|
|
294
320
|
* ```
|
|
295
321
|
*/
|
|
296
322
|
async getCurrentUser() {
|
|
297
|
-
__classPrivateFieldSet(this,
|
|
298
|
-
return __classPrivateFieldGet(this,
|
|
323
|
+
__classPrivateFieldSet(this, __RedditAPIClient_currentUser, __classPrivateFieldGet(this, __RedditAPIClient_currentUser, "f") ?? this.getCurrentUsername().then((username) => username ? User.getByUsername(username, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f")) : undefined), "f");
|
|
324
|
+
return __classPrivateFieldGet(this, __RedditAPIClient_currentUser, "f");
|
|
299
325
|
}
|
|
300
326
|
/**
|
|
301
327
|
* Get the user that the app runs as on the provided metadata.
|
|
@@ -307,7 +333,7 @@ export class RedditAPIClient {
|
|
|
307
333
|
* ```
|
|
308
334
|
*/
|
|
309
335
|
getAppUser() {
|
|
310
|
-
return User.getFromMetadata(Header.AppUser, __classPrivateFieldGet(this,
|
|
336
|
+
return User.getFromMetadata(Header.AppUser, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
311
337
|
}
|
|
312
338
|
/**
|
|
313
339
|
* Get the snoovatar URL for a given username.
|
|
@@ -316,7 +342,7 @@ export class RedditAPIClient {
|
|
|
316
342
|
* @returns A Promise that resolves to a URL of the snoovatar image if it exists.
|
|
317
343
|
*/
|
|
318
344
|
getSnoovatarUrl(username) {
|
|
319
|
-
return User.getSnoovatarUrl(username, __classPrivateFieldGet(this,
|
|
345
|
+
return User.getSnoovatarUrl(username, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
320
346
|
}
|
|
321
347
|
/**
|
|
322
348
|
* Get a {@link Comment} object by ID
|
|
@@ -329,7 +355,7 @@ export class RedditAPIClient {
|
|
|
329
355
|
* ```
|
|
330
356
|
*/
|
|
331
357
|
getCommentById(id) {
|
|
332
|
-
return Comment.getById(asTID(id), __classPrivateFieldGet(this,
|
|
358
|
+
return Comment.getById(asTID(id), __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
333
359
|
}
|
|
334
360
|
/**
|
|
335
361
|
* Get a list of comments from a specific post or comment.
|
|
@@ -351,7 +377,7 @@ export class RedditAPIClient {
|
|
|
351
377
|
* ```
|
|
352
378
|
*/
|
|
353
379
|
getComments(options) {
|
|
354
|
-
return Comment.getComments(options, __classPrivateFieldGet(this,
|
|
380
|
+
return Comment.getComments(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
355
381
|
}
|
|
356
382
|
/**
|
|
357
383
|
* Get a list of comments by a specific user.
|
|
@@ -365,7 +391,7 @@ export class RedditAPIClient {
|
|
|
365
391
|
* @returns A Listing of Comment objects.
|
|
366
392
|
*/
|
|
367
393
|
getCommentsByUser(options) {
|
|
368
|
-
return Comment.getCommentsByUser(options, __classPrivateFieldGet(this,
|
|
394
|
+
return Comment.getCommentsByUser(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
369
395
|
}
|
|
370
396
|
/**
|
|
371
397
|
* Submit a new comment to a post or comment.
|
|
@@ -374,13 +400,24 @@ export class RedditAPIClient {
|
|
|
374
400
|
* @param options.id - The ID of the post or comment to comment on. e.g. 't3_1qjpg' for post and 't1_1qgif' for comment
|
|
375
401
|
* @param options.text - The text of the comment
|
|
376
402
|
* @param options.richtext - The rich text of the comment
|
|
403
|
+
* @param options.runAs - The user type to submit the comment as, eg 'APP' or 'USER'
|
|
377
404
|
* @returns A Promise that resolves to a Comment object.
|
|
405
|
+
* @example
|
|
406
|
+
* ```ts
|
|
407
|
+
* import { RunAs } from '@devvit/public-api';
|
|
408
|
+
*
|
|
409
|
+
* const comment = await reddit.submitComment({
|
|
410
|
+
* id: 't1_1qgif',
|
|
411
|
+
* text: 'Hello world!',
|
|
412
|
+
* runAs: RunAs.APP,
|
|
413
|
+
* })
|
|
414
|
+
* ```
|
|
378
415
|
*/
|
|
379
416
|
submitComment(options) {
|
|
380
417
|
return Comment.submit({
|
|
381
418
|
...options,
|
|
382
419
|
id: asTID(options.id),
|
|
383
|
-
}, __classPrivateFieldGet(this,
|
|
420
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
384
421
|
}
|
|
385
422
|
/**
|
|
386
423
|
* Get a list of controversial posts from a specific subreddit.
|
|
@@ -402,7 +439,7 @@ export class RedditAPIClient {
|
|
|
402
439
|
* ```
|
|
403
440
|
*/
|
|
404
441
|
getControversialPosts(options) {
|
|
405
|
-
return Post.getControversialPosts(options, __classPrivateFieldGet(this,
|
|
442
|
+
return Post.getControversialPosts(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
406
443
|
}
|
|
407
444
|
/**
|
|
408
445
|
* Get a list of controversial posts from a specific subreddit.
|
|
@@ -424,7 +461,7 @@ export class RedditAPIClient {
|
|
|
424
461
|
* ```
|
|
425
462
|
*/
|
|
426
463
|
getTopPosts(options) {
|
|
427
|
-
return Post.getTopPosts(options, __classPrivateFieldGet(this,
|
|
464
|
+
return Post.getTopPosts(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
428
465
|
}
|
|
429
466
|
/**
|
|
430
467
|
* Get a list of hot posts from a specific subreddit.
|
|
@@ -446,7 +483,7 @@ export class RedditAPIClient {
|
|
|
446
483
|
* ```
|
|
447
484
|
*/
|
|
448
485
|
getHotPosts(options) {
|
|
449
|
-
return Post.getHotPosts(options, __classPrivateFieldGet(this,
|
|
486
|
+
return Post.getHotPosts(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
450
487
|
}
|
|
451
488
|
/**
|
|
452
489
|
* Get a list of new posts from a specific subreddit.
|
|
@@ -466,7 +503,7 @@ export class RedditAPIClient {
|
|
|
466
503
|
* ```
|
|
467
504
|
*/
|
|
468
505
|
getNewPosts(options) {
|
|
469
|
-
return Post.getNewPosts(options, __classPrivateFieldGet(this,
|
|
506
|
+
return Post.getNewPosts(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
470
507
|
}
|
|
471
508
|
/**
|
|
472
509
|
* Get a list of hot posts from a specific subreddit.
|
|
@@ -488,7 +525,7 @@ export class RedditAPIClient {
|
|
|
488
525
|
* ```
|
|
489
526
|
*/
|
|
490
527
|
getRisingPosts(options) {
|
|
491
|
-
return Post.getRisingPosts(options, __classPrivateFieldGet(this,
|
|
528
|
+
return Post.getRisingPosts(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
492
529
|
}
|
|
493
530
|
/**
|
|
494
531
|
* Get a list of posts from a specific user.
|
|
@@ -502,7 +539,7 @@ export class RedditAPIClient {
|
|
|
502
539
|
* @returns A Listing of Post objects.
|
|
503
540
|
*/
|
|
504
541
|
getPostsByUser(options) {
|
|
505
|
-
return Post.getPostsByUser(options, __classPrivateFieldGet(this,
|
|
542
|
+
return Post.getPostsByUser(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
506
543
|
}
|
|
507
544
|
/**
|
|
508
545
|
* Get a list of posts and comments from a specific user.
|
|
@@ -516,7 +553,7 @@ export class RedditAPIClient {
|
|
|
516
553
|
* @returns A Listing of `Post` and `Comment` objects.
|
|
517
554
|
*/
|
|
518
555
|
getCommentsAndPostsByUser(options) {
|
|
519
|
-
return User.getOverview(options, __classPrivateFieldGet(this,
|
|
556
|
+
return User.getOverview(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
520
557
|
}
|
|
521
558
|
/**
|
|
522
559
|
* Get the moderation log for a subreddit.
|
|
@@ -540,7 +577,7 @@ export class RedditAPIClient {
|
|
|
540
577
|
* ```
|
|
541
578
|
*/
|
|
542
579
|
getModerationLog(options) {
|
|
543
|
-
return
|
|
580
|
+
return _getModerationLog(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
544
581
|
}
|
|
545
582
|
/**
|
|
546
583
|
* Get a list of users who have been approved to post in a subreddit.
|
|
@@ -556,7 +593,7 @@ export class RedditAPIClient {
|
|
|
556
593
|
return User.getSubredditUsersByType({
|
|
557
594
|
type: 'contributors',
|
|
558
595
|
...options,
|
|
559
|
-
}, __classPrivateFieldGet(this,
|
|
596
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
560
597
|
}
|
|
561
598
|
/**
|
|
562
599
|
* Approve a user to post in a subreddit.
|
|
@@ -569,7 +606,7 @@ export class RedditAPIClient {
|
|
|
569
606
|
username,
|
|
570
607
|
subredditName,
|
|
571
608
|
type: 'contributor',
|
|
572
|
-
}, __classPrivateFieldGet(this,
|
|
609
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
573
610
|
}
|
|
574
611
|
/**
|
|
575
612
|
* Remove a user's approval to post in a subreddit.
|
|
@@ -582,7 +619,7 @@ export class RedditAPIClient {
|
|
|
582
619
|
username,
|
|
583
620
|
subredditName,
|
|
584
621
|
type: 'contributor',
|
|
585
|
-
}, __classPrivateFieldGet(this,
|
|
622
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
586
623
|
}
|
|
587
624
|
/**
|
|
588
625
|
* Get a list of users who are wiki contributors of a subreddit.
|
|
@@ -598,7 +635,7 @@ export class RedditAPIClient {
|
|
|
598
635
|
return User.getSubredditUsersByType({
|
|
599
636
|
type: 'wikicontributors',
|
|
600
637
|
...options,
|
|
601
|
-
}, __classPrivateFieldGet(this,
|
|
638
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
602
639
|
}
|
|
603
640
|
/**
|
|
604
641
|
* Add a user as a wiki contributor for a subreddit.
|
|
@@ -611,7 +648,7 @@ export class RedditAPIClient {
|
|
|
611
648
|
username,
|
|
612
649
|
subredditName,
|
|
613
650
|
type: 'wikicontributor',
|
|
614
|
-
}, __classPrivateFieldGet(this,
|
|
651
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
615
652
|
}
|
|
616
653
|
/**
|
|
617
654
|
* Remove a user's wiki contributor status for a subreddit.
|
|
@@ -624,7 +661,7 @@ export class RedditAPIClient {
|
|
|
624
661
|
username,
|
|
625
662
|
subredditName,
|
|
626
663
|
type: 'wikicontributor',
|
|
627
|
-
}, __classPrivateFieldGet(this,
|
|
664
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
628
665
|
}
|
|
629
666
|
/**
|
|
630
667
|
* Get a list of users who are banned from a subreddit.
|
|
@@ -640,7 +677,7 @@ export class RedditAPIClient {
|
|
|
640
677
|
return User.getSubredditUsersByType({
|
|
641
678
|
type: 'banned',
|
|
642
679
|
...options,
|
|
643
|
-
}, __classPrivateFieldGet(this,
|
|
680
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
644
681
|
}
|
|
645
682
|
/**
|
|
646
683
|
* Ban a user from a subreddit.
|
|
@@ -664,7 +701,7 @@ export class RedditAPIClient {
|
|
|
664
701
|
note: options.note,
|
|
665
702
|
duration: options.duration,
|
|
666
703
|
banContext: options.context,
|
|
667
|
-
}, __classPrivateFieldGet(this,
|
|
704
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
668
705
|
}
|
|
669
706
|
/**
|
|
670
707
|
* Unban a user from a subreddit.
|
|
@@ -677,7 +714,7 @@ export class RedditAPIClient {
|
|
|
677
714
|
username,
|
|
678
715
|
subredditName,
|
|
679
716
|
type: 'banned',
|
|
680
|
-
}, __classPrivateFieldGet(this,
|
|
717
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
681
718
|
}
|
|
682
719
|
/**
|
|
683
720
|
* Get a list of users who are banned from contributing to the wiki on a subreddit.
|
|
@@ -693,7 +730,7 @@ export class RedditAPIClient {
|
|
|
693
730
|
return User.getSubredditUsersByType({
|
|
694
731
|
type: 'wikibanned',
|
|
695
732
|
...options,
|
|
696
|
-
}, __classPrivateFieldGet(this,
|
|
733
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
697
734
|
}
|
|
698
735
|
/**
|
|
699
736
|
* Ban a user from contributing to the wiki on a subreddit.
|
|
@@ -709,7 +746,7 @@ export class RedditAPIClient {
|
|
|
709
746
|
return User.createRelationship({
|
|
710
747
|
...options,
|
|
711
748
|
type: 'wikibanned',
|
|
712
|
-
}, __classPrivateFieldGet(this,
|
|
749
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
713
750
|
}
|
|
714
751
|
/**
|
|
715
752
|
*
|
|
@@ -721,7 +758,7 @@ export class RedditAPIClient {
|
|
|
721
758
|
username,
|
|
722
759
|
subredditName,
|
|
723
760
|
type: 'wikibanned',
|
|
724
|
-
}, __classPrivateFieldGet(this,
|
|
761
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
725
762
|
}
|
|
726
763
|
/**
|
|
727
764
|
* Get a list of users who are moderators for a subreddit.
|
|
@@ -737,7 +774,7 @@ export class RedditAPIClient {
|
|
|
737
774
|
return User.getSubredditUsersByType({
|
|
738
775
|
type: 'moderators',
|
|
739
776
|
...options,
|
|
740
|
-
}, __classPrivateFieldGet(this,
|
|
777
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
741
778
|
}
|
|
742
779
|
/**
|
|
743
780
|
* Invite a user to become a moderator of a subreddit.
|
|
@@ -753,7 +790,7 @@ export class RedditAPIClient {
|
|
|
753
790
|
subredditName: options.subredditName,
|
|
754
791
|
username: options.username,
|
|
755
792
|
permissions: options.permissions ?? [],
|
|
756
|
-
}, __classPrivateFieldGet(this,
|
|
793
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
757
794
|
}
|
|
758
795
|
/**
|
|
759
796
|
* Revoke a moderator invite for a user to a subreddit.
|
|
@@ -766,7 +803,7 @@ export class RedditAPIClient {
|
|
|
766
803
|
username,
|
|
767
804
|
subredditName,
|
|
768
805
|
type: 'moderator_invite',
|
|
769
|
-
}, __classPrivateFieldGet(this,
|
|
806
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
770
807
|
}
|
|
771
808
|
/**
|
|
772
809
|
* Remove a user as a moderator of a subreddit.
|
|
@@ -779,7 +816,7 @@ export class RedditAPIClient {
|
|
|
779
816
|
type: 'moderator',
|
|
780
817
|
subredditName,
|
|
781
818
|
username,
|
|
782
|
-
}, __classPrivateFieldGet(this,
|
|
819
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
783
820
|
}
|
|
784
821
|
/**
|
|
785
822
|
* Update the permissions of a moderator of a subreddit.
|
|
@@ -789,7 +826,7 @@ export class RedditAPIClient {
|
|
|
789
826
|
* @param permissions - The permissions to give the user. e.g ['posts', 'wiki']
|
|
790
827
|
*/
|
|
791
828
|
setModeratorPermissions(username, subredditName, permissions) {
|
|
792
|
-
return User.setModeratorPermissions(username, subredditName, permissions, __classPrivateFieldGet(this,
|
|
829
|
+
return User.setModeratorPermissions(username, subredditName, permissions, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
793
830
|
}
|
|
794
831
|
/**
|
|
795
832
|
* Get a list of users who are muted in a subreddit.
|
|
@@ -805,7 +842,7 @@ export class RedditAPIClient {
|
|
|
805
842
|
return User.getSubredditUsersByType({
|
|
806
843
|
type: 'muted',
|
|
807
844
|
...options,
|
|
808
|
-
}, __classPrivateFieldGet(this,
|
|
845
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
809
846
|
}
|
|
810
847
|
/**
|
|
811
848
|
* Mute a user in a subreddit. Muting a user prevents them from sending modmail.
|
|
@@ -819,7 +856,7 @@ export class RedditAPIClient {
|
|
|
819
856
|
return User.createRelationship({
|
|
820
857
|
...options,
|
|
821
858
|
type: 'muted',
|
|
822
|
-
}, __classPrivateFieldGet(this,
|
|
859
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
823
860
|
}
|
|
824
861
|
/**
|
|
825
862
|
* Unmute a user in a subreddit. Unmuting a user allows them to send modmail.
|
|
@@ -832,7 +869,7 @@ export class RedditAPIClient {
|
|
|
832
869
|
username,
|
|
833
870
|
subredditName,
|
|
834
871
|
type: 'muted',
|
|
835
|
-
}, __classPrivateFieldGet(this,
|
|
872
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
836
873
|
}
|
|
837
874
|
/**
|
|
838
875
|
* Get a list of mod notes related to a user in a subreddit.
|
|
@@ -846,7 +883,7 @@ export class RedditAPIClient {
|
|
|
846
883
|
* @returns A listing of ModNote objects.
|
|
847
884
|
*/
|
|
848
885
|
getModNotes(options) {
|
|
849
|
-
return ModNote.get(options, __classPrivateFieldGet(this,
|
|
886
|
+
return ModNote.get(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
850
887
|
}
|
|
851
888
|
/**
|
|
852
889
|
* Delete a mod note.
|
|
@@ -857,7 +894,7 @@ export class RedditAPIClient {
|
|
|
857
894
|
* @returns True if it was deleted successfully; false otherwise.
|
|
858
895
|
*/
|
|
859
896
|
deleteModNote(options) {
|
|
860
|
-
return ModNote.delete(options, __classPrivateFieldGet(this,
|
|
897
|
+
return ModNote.delete(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
861
898
|
}
|
|
862
899
|
/**
|
|
863
900
|
* Add a mod note.
|
|
@@ -875,7 +912,7 @@ export class RedditAPIClient {
|
|
|
875
912
|
...options,
|
|
876
913
|
redditId: options.redditId ? asTID(options.redditId) : undefined,
|
|
877
914
|
};
|
|
878
|
-
return ModNote.add(req, __classPrivateFieldGet(this,
|
|
915
|
+
return ModNote.add(req, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
879
916
|
}
|
|
880
917
|
/**
|
|
881
918
|
* Add a mod note for why a post or comment was removed
|
|
@@ -885,7 +922,7 @@ export class RedditAPIClient {
|
|
|
885
922
|
* @param options.modNote the reason for removal (maximum 100 characters) (optional)
|
|
886
923
|
*/
|
|
887
924
|
addRemovalNote(options) {
|
|
888
|
-
return ModNote.addRemovalNote(options, __classPrivateFieldGet(this,
|
|
925
|
+
return ModNote.addRemovalNote(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
889
926
|
}
|
|
890
927
|
/**
|
|
891
928
|
* Sends a private message to a user.
|
|
@@ -894,7 +931,7 @@ export class RedditAPIClient {
|
|
|
894
931
|
* @returns A Promise that resolves if the private message was successfully sent.
|
|
895
932
|
*/
|
|
896
933
|
async sendPrivateMessage(options) {
|
|
897
|
-
return PrivateMessage.send(options, __classPrivateFieldGet(this,
|
|
934
|
+
return PrivateMessage.send(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
898
935
|
}
|
|
899
936
|
/**
|
|
900
937
|
* Sends a private message to a user on behalf of a subreddit.
|
|
@@ -903,7 +940,7 @@ export class RedditAPIClient {
|
|
|
903
940
|
* @returns A Promise that resolves if the private message was successfully sent.
|
|
904
941
|
*/
|
|
905
942
|
async sendPrivateMessageAsSubreddit(options) {
|
|
906
|
-
return PrivateMessage.sendAsSubreddit(options, __classPrivateFieldGet(this,
|
|
943
|
+
return PrivateMessage.sendAsSubreddit(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
907
944
|
}
|
|
908
945
|
/**
|
|
909
946
|
* Approve a post or comment.
|
|
@@ -917,10 +954,10 @@ export class RedditAPIClient {
|
|
|
917
954
|
*/
|
|
918
955
|
async approve(id) {
|
|
919
956
|
if (isT1ID(id)) {
|
|
920
|
-
return Comment.approve(id, __classPrivateFieldGet(this,
|
|
957
|
+
return Comment.approve(id, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
921
958
|
}
|
|
922
959
|
else if (isT3ID(id)) {
|
|
923
|
-
return Post.approve(id, __classPrivateFieldGet(this,
|
|
960
|
+
return Post.approve(id, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
924
961
|
}
|
|
925
962
|
throw new Error('id must start with either t1_ or t3_');
|
|
926
963
|
}
|
|
@@ -937,10 +974,10 @@ export class RedditAPIClient {
|
|
|
937
974
|
*/
|
|
938
975
|
async remove(id, isSpam) {
|
|
939
976
|
if (isT1ID(id)) {
|
|
940
|
-
return Comment.remove(id, isSpam, __classPrivateFieldGet(this,
|
|
977
|
+
return Comment.remove(id, isSpam, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
941
978
|
}
|
|
942
979
|
else if (isT3ID(id)) {
|
|
943
|
-
return Post.remove(id, isSpam, __classPrivateFieldGet(this,
|
|
980
|
+
return Post.remove(id, isSpam, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
944
981
|
}
|
|
945
982
|
throw new Error('id must start with either t1_ or t3_');
|
|
946
983
|
}
|
|
@@ -951,7 +988,7 @@ export class RedditAPIClient {
|
|
|
951
988
|
* @returns A Promise that resolves with an array of FlairTemplate objects.
|
|
952
989
|
*/
|
|
953
990
|
async getPostFlairTemplates(subredditName) {
|
|
954
|
-
return FlairTemplate.getPostFlairTemplates(subredditName, __classPrivateFieldGet(this,
|
|
991
|
+
return FlairTemplate.getPostFlairTemplates(subredditName, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
955
992
|
}
|
|
956
993
|
/**
|
|
957
994
|
* Get the list of user flair templates for a subreddit.
|
|
@@ -960,7 +997,7 @@ export class RedditAPIClient {
|
|
|
960
997
|
* @returns A Promise that resolves with an array of FlairTemplate objects.
|
|
961
998
|
*/
|
|
962
999
|
async getUserFlairTemplates(subredditName) {
|
|
963
|
-
return FlairTemplate.getUserFlairTemplates(subredditName, __classPrivateFieldGet(this,
|
|
1000
|
+
return FlairTemplate.getUserFlairTemplates(subredditName, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
964
1001
|
}
|
|
965
1002
|
/**
|
|
966
1003
|
* Create a post flair template for a subreddit.
|
|
@@ -977,7 +1014,7 @@ export class RedditAPIClient {
|
|
|
977
1014
|
* @returns The created FlairTemplate object.
|
|
978
1015
|
*/
|
|
979
1016
|
async createPostFlairTemplate(options) {
|
|
980
|
-
return FlairTemplate.createPostFlairTemplate(options, __classPrivateFieldGet(this,
|
|
1017
|
+
return FlairTemplate.createPostFlairTemplate(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
981
1018
|
}
|
|
982
1019
|
/**
|
|
983
1020
|
* Create a user flair template for a subreddit.
|
|
@@ -994,7 +1031,7 @@ export class RedditAPIClient {
|
|
|
994
1031
|
* @returns The created FlairTemplate object.
|
|
995
1032
|
*/
|
|
996
1033
|
async createUserFlairTemplate(options) {
|
|
997
|
-
return FlairTemplate.createUserFlairTemplate(options, __classPrivateFieldGet(this,
|
|
1034
|
+
return FlairTemplate.createUserFlairTemplate(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
998
1035
|
}
|
|
999
1036
|
/**
|
|
1000
1037
|
* Edit a flair template for a subreddit. This can be either a post or user flair template.
|
|
@@ -1013,7 +1050,7 @@ export class RedditAPIClient {
|
|
|
1013
1050
|
* @returns The edited FlairTemplate object.
|
|
1014
1051
|
*/
|
|
1015
1052
|
async editFlairTemplate(options) {
|
|
1016
|
-
return FlairTemplate.editFlairTemplate(options, __classPrivateFieldGet(this,
|
|
1053
|
+
return FlairTemplate.editFlairTemplate(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1017
1054
|
}
|
|
1018
1055
|
/**
|
|
1019
1056
|
* Delete a flair template from a subreddit.
|
|
@@ -1022,7 +1059,7 @@ export class RedditAPIClient {
|
|
|
1022
1059
|
* @param flairTemplateId - The ID of the flair template to delete.
|
|
1023
1060
|
*/
|
|
1024
1061
|
async deleteFlairTemplate(subredditName, flairTemplateId) {
|
|
1025
|
-
return FlairTemplate.deleteFlairTemplate(subredditName, flairTemplateId, __classPrivateFieldGet(this,
|
|
1062
|
+
return FlairTemplate.deleteFlairTemplate(subredditName, flairTemplateId, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1026
1063
|
}
|
|
1027
1064
|
/**
|
|
1028
1065
|
* Set the flair for a user in a subreddit.
|
|
@@ -1037,7 +1074,7 @@ export class RedditAPIClient {
|
|
|
1037
1074
|
* @param options.textColor - The text color of the flair.
|
|
1038
1075
|
*/
|
|
1039
1076
|
async setUserFlair(options) {
|
|
1040
|
-
return Flair.setUserFlair(options, __classPrivateFieldGet(this,
|
|
1077
|
+
return Flair.setUserFlair(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1041
1078
|
}
|
|
1042
1079
|
/**
|
|
1043
1080
|
* Set the flair of multiple users in the same subreddit with a single API call.
|
|
@@ -1051,7 +1088,7 @@ export class RedditAPIClient {
|
|
|
1051
1088
|
* @returns {FlairCsvResult[]} - Array of statuses for each entry provided.
|
|
1052
1089
|
*/
|
|
1053
1090
|
async setUserFlairBatch(subredditName, flairs) {
|
|
1054
|
-
return Flair.setUserFlairBatch(subredditName, flairs, __classPrivateFieldGet(this,
|
|
1091
|
+
return Flair.setUserFlairBatch(subredditName, flairs, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1055
1092
|
}
|
|
1056
1093
|
/**
|
|
1057
1094
|
* Remove the flair for a user in a subreddit.
|
|
@@ -1060,7 +1097,7 @@ export class RedditAPIClient {
|
|
|
1060
1097
|
* @param username - The username of the user to remove the flair from.
|
|
1061
1098
|
*/
|
|
1062
1099
|
async removeUserFlair(subredditName, username) {
|
|
1063
|
-
return Flair.removeUserFlair(subredditName, username, __classPrivateFieldGet(this,
|
|
1100
|
+
return Flair.removeUserFlair(subredditName, username, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1064
1101
|
}
|
|
1065
1102
|
/**
|
|
1066
1103
|
* Set the flair for a post in a subreddit.
|
|
@@ -1075,7 +1112,7 @@ export class RedditAPIClient {
|
|
|
1075
1112
|
* @param options.textColor - The text color of the flair.
|
|
1076
1113
|
*/
|
|
1077
1114
|
async setPostFlair(options) {
|
|
1078
|
-
return Flair.setPostFlair(options, __classPrivateFieldGet(this,
|
|
1115
|
+
return Flair.setPostFlair(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1079
1116
|
}
|
|
1080
1117
|
/**
|
|
1081
1118
|
* Remove the flair for a post in a subreddit.
|
|
@@ -1084,7 +1121,7 @@ export class RedditAPIClient {
|
|
|
1084
1121
|
* @param postId - The ID of the post to remove the flair from.
|
|
1085
1122
|
*/
|
|
1086
1123
|
async removePostFlair(subredditName, postId) {
|
|
1087
|
-
return Flair.removePostFlair(subredditName, asT3ID(postId), __classPrivateFieldGet(this,
|
|
1124
|
+
return Flair.removePostFlair(subredditName, asT3ID(postId), __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1088
1125
|
}
|
|
1089
1126
|
/**
|
|
1090
1127
|
* Get the widgets for a subreddit.
|
|
@@ -1093,7 +1130,7 @@ export class RedditAPIClient {
|
|
|
1093
1130
|
* @returns - An array of Widget objects.
|
|
1094
1131
|
*/
|
|
1095
1132
|
async getWidgets(subredditName) {
|
|
1096
|
-
return Widget.getWidgets(subredditName, __classPrivateFieldGet(this,
|
|
1133
|
+
return Widget.getWidgets(subredditName, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1097
1134
|
}
|
|
1098
1135
|
/**
|
|
1099
1136
|
* Delete a widget from a subreddit.
|
|
@@ -1102,7 +1139,7 @@ export class RedditAPIClient {
|
|
|
1102
1139
|
* @param widgetId - The ID of the widget to delete.
|
|
1103
1140
|
*/
|
|
1104
1141
|
async deleteWidget(subredditName, widgetId) {
|
|
1105
|
-
return Widget.delete(subredditName, widgetId, __classPrivateFieldGet(this,
|
|
1142
|
+
return Widget.delete(subredditName, widgetId, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1106
1143
|
}
|
|
1107
1144
|
/**
|
|
1108
1145
|
* Add a widget to a subreddit.
|
|
@@ -1111,7 +1148,7 @@ export class RedditAPIClient {
|
|
|
1111
1148
|
* @returns - The added Widget object.
|
|
1112
1149
|
*/
|
|
1113
1150
|
async addWidget(widgetData) {
|
|
1114
|
-
return Widget.add(widgetData, __classPrivateFieldGet(this,
|
|
1151
|
+
return Widget.add(widgetData, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1115
1152
|
}
|
|
1116
1153
|
/**
|
|
1117
1154
|
* Reorder the widgets for a subreddit.
|
|
@@ -1120,7 +1157,7 @@ export class RedditAPIClient {
|
|
|
1120
1157
|
* @param orderByIds - An array of widget IDs in the order that they should be displayed.
|
|
1121
1158
|
*/
|
|
1122
1159
|
async reorderWidgets(subredditName, orderByIds) {
|
|
1123
|
-
return Widget.reorder(subredditName, orderByIds, __classPrivateFieldGet(this,
|
|
1160
|
+
return Widget.reorder(subredditName, orderByIds, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1124
1161
|
}
|
|
1125
1162
|
/**
|
|
1126
1163
|
* Get a wiki page from a subreddit.
|
|
@@ -1130,7 +1167,7 @@ export class RedditAPIClient {
|
|
|
1130
1167
|
* @returns The requested WikiPage object.
|
|
1131
1168
|
*/
|
|
1132
1169
|
async getWikiPage(subredditName, page) {
|
|
1133
|
-
return WikiPage.getPage(subredditName, page, __classPrivateFieldGet(this,
|
|
1170
|
+
return WikiPage.getPage(subredditName, page, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1134
1171
|
}
|
|
1135
1172
|
/**
|
|
1136
1173
|
* Get the wiki pages for a subreddit.
|
|
@@ -1139,7 +1176,7 @@ export class RedditAPIClient {
|
|
|
1139
1176
|
* @returns A list of the wiki page names for the subreddit.
|
|
1140
1177
|
*/
|
|
1141
1178
|
async getWikiPages(subredditName) {
|
|
1142
|
-
return WikiPage.getPages(subredditName, __classPrivateFieldGet(this,
|
|
1179
|
+
return WikiPage.getPages(subredditName, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1143
1180
|
}
|
|
1144
1181
|
/**
|
|
1145
1182
|
* Create a new wiki page for a subreddit.
|
|
@@ -1152,7 +1189,7 @@ export class RedditAPIClient {
|
|
|
1152
1189
|
* @returns - The created WikiPage object.
|
|
1153
1190
|
*/
|
|
1154
1191
|
async createWikiPage(options) {
|
|
1155
|
-
return WikiPage.createPage(options, __classPrivateFieldGet(this,
|
|
1192
|
+
return WikiPage.createPage(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1156
1193
|
}
|
|
1157
1194
|
/**
|
|
1158
1195
|
* Update a wiki page.
|
|
@@ -1165,7 +1202,7 @@ export class RedditAPIClient {
|
|
|
1165
1202
|
* @returns The updated WikiPage object.
|
|
1166
1203
|
*/
|
|
1167
1204
|
async updateWikiPage(options) {
|
|
1168
|
-
return WikiPage.updatePage(options, __classPrivateFieldGet(this,
|
|
1205
|
+
return WikiPage.updatePage(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1169
1206
|
}
|
|
1170
1207
|
/**
|
|
1171
1208
|
* Get the revisions for a wiki page.
|
|
@@ -1178,7 +1215,7 @@ export class RedditAPIClient {
|
|
|
1178
1215
|
* @returns A Listing of WikiPageRevision objects.
|
|
1179
1216
|
*/
|
|
1180
1217
|
getWikiPageRevisions(options) {
|
|
1181
|
-
return WikiPage.getPageRevisions(options, __classPrivateFieldGet(this,
|
|
1218
|
+
return WikiPage.getPageRevisions(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1182
1219
|
}
|
|
1183
1220
|
/**
|
|
1184
1221
|
* Revert a wiki page to a previous revision.
|
|
@@ -1188,7 +1225,7 @@ export class RedditAPIClient {
|
|
|
1188
1225
|
* @param revisionId - The ID of the revision to revert to.
|
|
1189
1226
|
*/
|
|
1190
1227
|
async revertWikiPage(subredditName, page, revisionId) {
|
|
1191
|
-
return WikiPage.revertPage(subredditName, page, revisionId, __classPrivateFieldGet(this,
|
|
1228
|
+
return WikiPage.revertPage(subredditName, page, revisionId, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1192
1229
|
}
|
|
1193
1230
|
/**
|
|
1194
1231
|
* Get the settings for a wiki page.
|
|
@@ -1198,7 +1235,7 @@ export class RedditAPIClient {
|
|
|
1198
1235
|
* @returns A WikiPageSettings object.
|
|
1199
1236
|
*/
|
|
1200
1237
|
async getWikiPageSettings(subredditName, page) {
|
|
1201
|
-
return WikiPage.getPageSettings(subredditName, page, __classPrivateFieldGet(this,
|
|
1238
|
+
return WikiPage.getPageSettings(subredditName, page, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1202
1239
|
}
|
|
1203
1240
|
/**
|
|
1204
1241
|
* Update the settings for a wiki page.
|
|
@@ -1211,7 +1248,7 @@ export class RedditAPIClient {
|
|
|
1211
1248
|
* @returns A WikiPageSettings object.
|
|
1212
1249
|
*/
|
|
1213
1250
|
async updateWikiPageSettings(options) {
|
|
1214
|
-
return WikiPage.updatePageSettings(options, __classPrivateFieldGet(this,
|
|
1251
|
+
return WikiPage.updatePageSettings(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1215
1252
|
}
|
|
1216
1253
|
/**
|
|
1217
1254
|
* Add an editor to a wiki page.
|
|
@@ -1221,7 +1258,7 @@ export class RedditAPIClient {
|
|
|
1221
1258
|
* @param username - The username of the user to add as an editor.
|
|
1222
1259
|
*/
|
|
1223
1260
|
async addEditorToWikiPage(subredditName, page, username) {
|
|
1224
|
-
return WikiPage.addEditor(subredditName, page, username, __classPrivateFieldGet(this,
|
|
1261
|
+
return WikiPage.addEditor(subredditName, page, username, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1225
1262
|
}
|
|
1226
1263
|
/**
|
|
1227
1264
|
* Remove an editor from a wiki page.
|
|
@@ -1231,7 +1268,7 @@ export class RedditAPIClient {
|
|
|
1231
1268
|
* @param username - The username of the user to remove as an editor.
|
|
1232
1269
|
*/
|
|
1233
1270
|
async removeEditorFromWikiPage(subredditName, page, username) {
|
|
1234
|
-
return WikiPage.removeEditor(subredditName, page, username, __classPrivateFieldGet(this,
|
|
1271
|
+
return WikiPage.removeEditor(subredditName, page, username, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1235
1272
|
}
|
|
1236
1273
|
/**
|
|
1237
1274
|
* Get private messages sent to the currently authenticated user.
|
|
@@ -1240,13 +1277,13 @@ export class RedditAPIClient {
|
|
|
1240
1277
|
* @param options.type - The type of messages to get.
|
|
1241
1278
|
*/
|
|
1242
1279
|
getMessages(options) {
|
|
1243
|
-
return PrivateMessage.getMessages(options, __classPrivateFieldGet(this,
|
|
1280
|
+
return PrivateMessage.getMessages(options, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1244
1281
|
}
|
|
1245
1282
|
/**
|
|
1246
1283
|
* Mark all private messages as read.
|
|
1247
1284
|
*/
|
|
1248
1285
|
markAllMessagesAsRead() {
|
|
1249
|
-
return PrivateMessage.markAllAsRead(__classPrivateFieldGet(this,
|
|
1286
|
+
return PrivateMessage.markAllAsRead(__classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1250
1287
|
}
|
|
1251
1288
|
/**
|
|
1252
1289
|
* Report a Post or Comment
|
|
@@ -1271,37 +1308,37 @@ export class RedditAPIClient {
|
|
|
1271
1308
|
thingId: thing.id,
|
|
1272
1309
|
srName: thing.subredditName,
|
|
1273
1310
|
usernames: thing.authorName,
|
|
1274
|
-
}, __classPrivateFieldGet(this,
|
|
1311
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1275
1312
|
}
|
|
1276
1313
|
getModQueue(options) {
|
|
1277
1314
|
return Subreddit.aboutLocation({
|
|
1278
1315
|
...options,
|
|
1279
1316
|
location: AboutLocations.Modqueue,
|
|
1280
|
-
}, __classPrivateFieldGet(this,
|
|
1317
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1281
1318
|
}
|
|
1282
1319
|
getReports(options) {
|
|
1283
1320
|
return Subreddit.aboutLocation({
|
|
1284
1321
|
...options,
|
|
1285
1322
|
location: AboutLocations.Reports,
|
|
1286
|
-
}, __classPrivateFieldGet(this,
|
|
1323
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1287
1324
|
}
|
|
1288
1325
|
getSpam(options) {
|
|
1289
1326
|
return Subreddit.aboutLocation({
|
|
1290
1327
|
...options,
|
|
1291
1328
|
location: AboutLocations.Spam,
|
|
1292
|
-
}, __classPrivateFieldGet(this,
|
|
1329
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1293
1330
|
}
|
|
1294
1331
|
getUnmoderated(options) {
|
|
1295
1332
|
return Subreddit.aboutLocation({
|
|
1296
1333
|
...options,
|
|
1297
1334
|
location: AboutLocations.Unmoderated,
|
|
1298
|
-
}, __classPrivateFieldGet(this,
|
|
1335
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1299
1336
|
}
|
|
1300
1337
|
getEdited(options) {
|
|
1301
1338
|
return Subreddit.aboutLocation({
|
|
1302
1339
|
...options,
|
|
1303
1340
|
location: AboutLocations.Edited,
|
|
1304
|
-
}, __classPrivateFieldGet(this,
|
|
1341
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1305
1342
|
}
|
|
1306
1343
|
/**
|
|
1307
1344
|
* Gets a {@link Vault} for the specified address.
|
|
@@ -1313,7 +1350,7 @@ export class RedditAPIClient {
|
|
|
1313
1350
|
* ```
|
|
1314
1351
|
*/
|
|
1315
1352
|
getVaultByAddress(address) {
|
|
1316
|
-
return getVaultByAddress(address, __classPrivateFieldGet(this,
|
|
1353
|
+
return getVaultByAddress(address, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1317
1354
|
}
|
|
1318
1355
|
/**
|
|
1319
1356
|
* Gets a {@link Vault} for the specified user.
|
|
@@ -1325,7 +1362,7 @@ export class RedditAPIClient {
|
|
|
1325
1362
|
* ```
|
|
1326
1363
|
*/
|
|
1327
1364
|
getVaultByUserId(userId) {
|
|
1328
|
-
return getVaultByUserId(asTID(userId), __classPrivateFieldGet(this,
|
|
1365
|
+
return getVaultByUserId(asTID(userId), __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1329
1366
|
}
|
|
1330
1367
|
/**
|
|
1331
1368
|
* Returns a leaderboard for a given subreddit ID.
|
|
@@ -1335,7 +1372,7 @@ export class RedditAPIClient {
|
|
|
1335
1372
|
* @returns {SubredditLeaderboard} Leaderboard for the given subreddit.
|
|
1336
1373
|
*/
|
|
1337
1374
|
getSubredditLeaderboard(subredditId) {
|
|
1338
|
-
return
|
|
1375
|
+
return _getSubredditLeaderboard(subredditId, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1339
1376
|
}
|
|
1340
1377
|
/**
|
|
1341
1378
|
* Returns the styles for a given subreddit ID.
|
|
@@ -1345,7 +1382,7 @@ export class RedditAPIClient {
|
|
|
1345
1382
|
* @returns {SubredditStyles} Styles for the given subreddit.
|
|
1346
1383
|
*/
|
|
1347
1384
|
getSubredditStyles(subredditId) {
|
|
1348
|
-
return
|
|
1385
|
+
return _getSubredditStyles(subredditId, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1349
1386
|
}
|
|
1350
1387
|
/**
|
|
1351
1388
|
* Subscribes to the subreddit in which the app is installed. No-op if the user is already subscribed.
|
|
@@ -1361,7 +1398,7 @@ export class RedditAPIClient {
|
|
|
1361
1398
|
srName: currentSubreddit.name,
|
|
1362
1399
|
sr: '',
|
|
1363
1400
|
skipInitialDefaults: true,
|
|
1364
|
-
}, __classPrivateFieldGet(this,
|
|
1401
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1365
1402
|
}
|
|
1366
1403
|
/**
|
|
1367
1404
|
* Unsubscribes from the subreddit in which the app is installed. No-op if the user isn't subscribed.
|
|
@@ -1377,7 +1414,7 @@ export class RedditAPIClient {
|
|
|
1377
1414
|
srName: currentSubreddit.name,
|
|
1378
1415
|
sr: '',
|
|
1379
1416
|
skipInitialDefaults: false,
|
|
1380
|
-
}, __classPrivateFieldGet(this,
|
|
1417
|
+
}, __classPrivateFieldGet(this, __RedditAPIClient_metadata, "f"));
|
|
1381
1418
|
}
|
|
1382
1419
|
}
|
|
1383
|
-
|
|
1420
|
+
__RedditAPIClient_metadata = new WeakMap(), __RedditAPIClient_modMailService = new WeakMap(), __RedditAPIClient_currentUser = new WeakMap(), __RedditAPIClient_currentUsername = new WeakMap();
|