emusks 2.3.2 → 2.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emusks",
3
- "version": "2.3.2",
3
+ "version": "2.3.4",
4
4
  "description": "Reverse-engineered Twitter API client. Log in and interact with the unofficial X API using any client identity - web, Android, iOS, or TweetDeck",
5
5
  "keywords": [
6
6
  "client",
@@ -32,7 +32,7 @@
32
32
  "cycletls": "^2.0.5",
33
33
  "linkedom": "^0.18.12",
34
34
  "tweetnacl": "^1.0.3",
35
- "x-client-transaction-id": "^0.2.0"
35
+ "x-client-transaction-id": "^0.3.1"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@roamhq/wrtc": "^0.10.0"
@@ -267,3 +267,70 @@ export async function userSearch(communityId, query, opts = {}) {
267
267
  },
268
268
  });
269
269
  }
270
+
271
+ const TIMELINE_FIELD_TOGGLES = {
272
+ withArticlePlainText: false,
273
+ withArticleRichContentState: false,
274
+ withAuxiliaryUserLabels: false,
275
+ };
276
+
277
+ export async function home(opts = {}) {
278
+ return await this.graphql("CommunitiesMainPageTimeline", {
279
+ variables: { count: opts.count || 20, cursor: opts.cursor, ...opts.variables },
280
+ });
281
+ }
282
+
283
+ export async function browse(opts = {}) {
284
+ return await this.graphql("CommunityDiscoveryTimeline", {
285
+ variables: { count: opts.count || 20, cursor: opts.cursor, ...opts.variables },
286
+ });
287
+ }
288
+
289
+ export async function myMemberships(opts = {}) {
290
+ return await this.graphql("CommunitiesMembershipsSlice", {
291
+ variables: { cursor: opts.cursor, ...opts.variables },
292
+ });
293
+ }
294
+
295
+ export async function publicTimeline(communityId, opts = {}) {
296
+ if (!communityId) throw new Error("publicTimeline requires a communityId");
297
+ return await this.graphql("CommunityTweetsLoggedOutTimeline", {
298
+ variables: {
299
+ communityId,
300
+ count: opts.count || 20,
301
+ cursor: opts.cursor,
302
+ rankingMode: opts.rankingMode || "Recency",
303
+ withCommunity: true,
304
+ ...opts.variables,
305
+ },
306
+ fieldToggles: TIMELINE_FIELD_TOGGLES,
307
+ });
308
+ }
309
+
310
+ export async function publicRanked(communityId, opts = {}) {
311
+ if (!communityId) throw new Error("publicRanked requires a communityId");
312
+ return await this.graphql("CommunityTweetsRankedLoggedOutTimeline", {
313
+ variables: {
314
+ communityId,
315
+ count: opts.count || 20,
316
+ cursor: opts.cursor,
317
+ withCommunity: true,
318
+ ...opts.variables,
319
+ },
320
+ fieldToggles: TIMELINE_FIELD_TOGGLES,
321
+ });
322
+ }
323
+
324
+ export async function publicMedia(communityId, opts = {}) {
325
+ if (!communityId) throw new Error("publicMedia requires a communityId");
326
+ return await this.graphql("CommunityMediaLoggedOutTimeline", {
327
+ variables: {
328
+ communityId,
329
+ count: opts.count || 20,
330
+ cursor: opts.cursor,
331
+ withCommunity: true,
332
+ ...opts.variables,
333
+ },
334
+ fieldToggles: TIMELINE_FIELD_TOGGLES,
335
+ });
336
+ }