x-twitter-scraper 0.20.0 → 0.22.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.
Files changed (226) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +121 -122
  3. package/client.d.mts +9 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +9 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +2 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +2 -2
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/events.d.mts +8 -0
  13. package/resources/events.d.mts.map +1 -1
  14. package/resources/events.d.ts +8 -0
  15. package/resources/events.d.ts.map +1 -1
  16. package/resources/extractions.d.mts +105 -5
  17. package/resources/extractions.d.mts.map +1 -1
  18. package/resources/extractions.d.ts +105 -5
  19. package/resources/extractions.d.ts.map +1 -1
  20. package/resources/index.d.mts +1 -1
  21. package/resources/index.d.mts.map +1 -1
  22. package/resources/index.d.ts +1 -1
  23. package/resources/index.d.ts.map +1 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs.map +1 -1
  26. package/resources/monitors/index.d.mts +1 -1
  27. package/resources/monitors/index.d.mts.map +1 -1
  28. package/resources/monitors/index.d.ts +1 -1
  29. package/resources/monitors/index.d.ts.map +1 -1
  30. package/resources/monitors/index.js.map +1 -1
  31. package/resources/monitors/index.mjs.map +1 -1
  32. package/resources/monitors/monitors.d.mts +38 -1
  33. package/resources/monitors/monitors.d.mts.map +1 -1
  34. package/resources/monitors/monitors.d.ts +38 -1
  35. package/resources/monitors/monitors.d.ts.map +1 -1
  36. package/resources/monitors/monitors.js +18 -0
  37. package/resources/monitors/monitors.js.map +1 -1
  38. package/resources/monitors/monitors.mjs +18 -0
  39. package/resources/monitors/monitors.mjs.map +1 -1
  40. package/resources/monitors/posts.d.mts +27 -0
  41. package/resources/monitors/posts.d.mts.map +1 -1
  42. package/resources/monitors/posts.d.ts +27 -0
  43. package/resources/monitors/posts.d.ts.map +1 -1
  44. package/resources/shared.d.mts +192 -5
  45. package/resources/shared.d.mts.map +1 -1
  46. package/resources/shared.d.ts +192 -5
  47. package/resources/shared.d.ts.map +1 -1
  48. package/resources/x/account-connection-attempts.d.mts +4 -0
  49. package/resources/x/account-connection-attempts.d.mts.map +1 -1
  50. package/resources/x/account-connection-attempts.d.ts +4 -0
  51. package/resources/x/account-connection-attempts.d.ts.map +1 -1
  52. package/resources/x/account-connection-links.d.mts +159 -0
  53. package/resources/x/account-connection-links.d.mts.map +1 -0
  54. package/resources/x/account-connection-links.d.ts +159 -0
  55. package/resources/x/account-connection-links.d.ts.map +1 -0
  56. package/resources/x/account-connection-links.js +82 -0
  57. package/resources/x/account-connection-links.js.map +1 -0
  58. package/resources/x/account-connection-links.mjs +78 -0
  59. package/resources/x/account-connection-links.mjs.map +1 -0
  60. package/resources/x/accounts.d.mts +13 -9
  61. package/resources/x/accounts.d.mts.map +1 -1
  62. package/resources/x/accounts.d.ts +13 -9
  63. package/resources/x/accounts.d.ts.map +1 -1
  64. package/resources/x/analysis.d.mts +540 -36
  65. package/resources/x/analysis.d.mts.map +1 -1
  66. package/resources/x/analysis.d.ts +540 -36
  67. package/resources/x/analysis.d.ts.map +1 -1
  68. package/resources/x/bookmarks.d.mts +5 -0
  69. package/resources/x/bookmarks.d.mts.map +1 -1
  70. package/resources/x/bookmarks.d.ts +5 -0
  71. package/resources/x/bookmarks.d.ts.map +1 -1
  72. package/resources/x/communities/communities.d.mts +2 -2
  73. package/resources/x/communities/communities.d.mts.map +1 -1
  74. package/resources/x/communities/communities.d.ts +2 -2
  75. package/resources/x/communities/communities.d.ts.map +1 -1
  76. package/resources/x/communities/communities.js.map +1 -1
  77. package/resources/x/communities/communities.mjs.map +1 -1
  78. package/resources/x/communities/join.d.mts +2 -2
  79. package/resources/x/communities/join.d.mts.map +1 -1
  80. package/resources/x/communities/join.d.ts +2 -2
  81. package/resources/x/communities/join.d.ts.map +1 -1
  82. package/resources/x/dm.d.mts +2 -2
  83. package/resources/x/dm.d.mts.map +1 -1
  84. package/resources/x/dm.d.ts +2 -2
  85. package/resources/x/dm.d.ts.map +1 -1
  86. package/resources/x/index.d.mts +3 -2
  87. package/resources/x/index.d.mts.map +1 -1
  88. package/resources/x/index.d.ts +3 -2
  89. package/resources/x/index.d.ts.map +1 -1
  90. package/resources/x/index.js +3 -1
  91. package/resources/x/index.js.map +1 -1
  92. package/resources/x/index.mjs +1 -0
  93. package/resources/x/index.mjs.map +1 -1
  94. package/resources/x/media.d.mts +48 -1
  95. package/resources/x/media.d.mts.map +1 -1
  96. package/resources/x/media.d.ts +48 -1
  97. package/resources/x/media.d.ts.map +1 -1
  98. package/resources/x/media.js.map +1 -1
  99. package/resources/x/media.mjs.map +1 -1
  100. package/resources/x/profile.d.mts +3 -3
  101. package/resources/x/profile.d.mts.map +1 -1
  102. package/resources/x/profile.d.ts +3 -3
  103. package/resources/x/profile.d.ts.map +1 -1
  104. package/resources/x/sports.d.mts +19 -1
  105. package/resources/x/sports.d.mts.map +1 -1
  106. package/resources/x/sports.d.ts +19 -1
  107. package/resources/x/sports.d.ts.map +1 -1
  108. package/resources/x/tweets/bookmark.d.mts +84 -0
  109. package/resources/x/tweets/bookmark.d.mts.map +1 -0
  110. package/resources/x/tweets/bookmark.d.ts +84 -0
  111. package/resources/x/tweets/bookmark.d.ts.map +1 -0
  112. package/resources/x/tweets/bookmark.js +55 -0
  113. package/resources/x/tweets/bookmark.js.map +1 -0
  114. package/resources/x/tweets/bookmark.mjs +51 -0
  115. package/resources/x/tweets/bookmark.mjs.map +1 -0
  116. package/resources/x/tweets/index.d.mts +1 -0
  117. package/resources/x/tweets/index.d.mts.map +1 -1
  118. package/resources/x/tweets/index.d.ts +1 -0
  119. package/resources/x/tweets/index.d.ts.map +1 -1
  120. package/resources/x/tweets/index.js +3 -1
  121. package/resources/x/tweets/index.js.map +1 -1
  122. package/resources/x/tweets/index.mjs +1 -0
  123. package/resources/x/tweets/index.mjs.map +1 -1
  124. package/resources/x/tweets/like.d.mts +2 -2
  125. package/resources/x/tweets/like.d.mts.map +1 -1
  126. package/resources/x/tweets/like.d.ts +2 -2
  127. package/resources/x/tweets/like.d.ts.map +1 -1
  128. package/resources/x/tweets/retweet.d.mts +2 -2
  129. package/resources/x/tweets/retweet.d.mts.map +1 -1
  130. package/resources/x/tweets/retweet.d.ts +2 -2
  131. package/resources/x/tweets/retweet.d.ts.map +1 -1
  132. package/resources/x/tweets/tweets.d.mts +45 -13
  133. package/resources/x/tweets/tweets.d.mts.map +1 -1
  134. package/resources/x/tweets/tweets.d.ts +45 -13
  135. package/resources/x/tweets/tweets.d.ts.map +1 -1
  136. package/resources/x/tweets/tweets.js +4 -0
  137. package/resources/x/tweets/tweets.js.map +1 -1
  138. package/resources/x/tweets/tweets.mjs +4 -0
  139. package/resources/x/tweets/tweets.mjs.map +1 -1
  140. package/resources/x/users/block.d.mts +84 -0
  141. package/resources/x/users/block.d.mts.map +1 -0
  142. package/resources/x/users/block.d.ts +84 -0
  143. package/resources/x/users/block.d.ts.map +1 -0
  144. package/resources/x/users/block.js +55 -0
  145. package/resources/x/users/block.js.map +1 -0
  146. package/resources/x/users/block.mjs +51 -0
  147. package/resources/x/users/block.mjs.map +1 -0
  148. package/resources/x/users/follow.d.mts +2 -2
  149. package/resources/x/users/follow.d.mts.map +1 -1
  150. package/resources/x/users/follow.d.ts +2 -2
  151. package/resources/x/users/follow.d.ts.map +1 -1
  152. package/resources/x/users/index.d.mts +3 -1
  153. package/resources/x/users/index.d.mts.map +1 -1
  154. package/resources/x/users/index.d.ts +3 -1
  155. package/resources/x/users/index.d.ts.map +1 -1
  156. package/resources/x/users/index.js +5 -1
  157. package/resources/x/users/index.js.map +1 -1
  158. package/resources/x/users/index.mjs +2 -0
  159. package/resources/x/users/index.mjs.map +1 -1
  160. package/resources/x/users/mute.d.mts +84 -0
  161. package/resources/x/users/mute.d.mts.map +1 -0
  162. package/resources/x/users/mute.d.ts +84 -0
  163. package/resources/x/users/mute.d.ts.map +1 -0
  164. package/resources/x/users/mute.js +55 -0
  165. package/resources/x/users/mute.js.map +1 -0
  166. package/resources/x/users/mute.mjs +51 -0
  167. package/resources/x/users/mute.mjs.map +1 -0
  168. package/resources/x/users/users.d.mts +359 -9
  169. package/resources/x/users/users.d.mts.map +1 -1
  170. package/resources/x/users/users.d.ts +359 -9
  171. package/resources/x/users/users.d.ts.map +1 -1
  172. package/resources/x/users/users.js +27 -1
  173. package/resources/x/users/users.js.map +1 -1
  174. package/resources/x/users/users.mjs +27 -1
  175. package/resources/x/users/users.mjs.map +1 -1
  176. package/resources/x/write-actions.d.mts +1 -1
  177. package/resources/x/write-actions.d.mts.map +1 -1
  178. package/resources/x/write-actions.d.ts +1 -1
  179. package/resources/x/write-actions.d.ts.map +1 -1
  180. package/resources/x/x.d.mts +17 -4
  181. package/resources/x/x.d.mts.map +1 -1
  182. package/resources/x/x.d.ts +17 -4
  183. package/resources/x/x.d.ts.map +1 -1
  184. package/resources/x/x.js +4 -0
  185. package/resources/x/x.js.map +1 -1
  186. package/resources/x/x.mjs +4 -0
  187. package/resources/x/x.mjs.map +1 -1
  188. package/src/client.ts +12 -2
  189. package/src/core/README.md +4 -0
  190. package/src/internal/README.md +6 -1
  191. package/src/resources/events.ts +10 -0
  192. package/src/resources/extractions.ts +125 -0
  193. package/src/resources/index.ts +2 -0
  194. package/src/resources/monitors/index.ts +2 -0
  195. package/src/resources/monitors/monitors.ts +49 -0
  196. package/src/resources/monitors/posts.ts +32 -0
  197. package/src/resources/shared.ts +223 -4
  198. package/src/resources/x/account-connection-attempts.ts +5 -0
  199. package/src/resources/x/account-connection-links.ts +215 -0
  200. package/src/resources/x/accounts.ts +15 -14
  201. package/src/resources/x/analysis.ts +618 -36
  202. package/src/resources/x/bookmarks.ts +6 -0
  203. package/src/resources/x/communities/communities.ts +12 -0
  204. package/src/resources/x/communities/join.ts +12 -0
  205. package/src/resources/x/dm.ts +12 -0
  206. package/src/resources/x/index.ts +16 -0
  207. package/src/resources/x/media.ts +64 -0
  208. package/src/resources/x/profile.ts +18 -0
  209. package/src/resources/x/sports.ts +22 -0
  210. package/src/resources/x/tweets/bookmark.ts +127 -0
  211. package/src/resources/x/tweets/index.ts +7 -0
  212. package/src/resources/x/tweets/like.ts +12 -0
  213. package/src/resources/x/tweets/retweet.ts +12 -0
  214. package/src/resources/x/tweets/tweets.ts +74 -10
  215. package/src/resources/x/users/block.ts +119 -0
  216. package/src/resources/x/users/follow.ts +12 -0
  217. package/src/resources/x/users/index.ts +20 -0
  218. package/src/resources/x/users/mute.ts +119 -0
  219. package/src/resources/x/users/users.ts +470 -7
  220. package/src/resources/x/write-actions.ts +6 -0
  221. package/src/resources/x/x.ts +50 -0
  222. package/src/version.ts +1 -1
  223. package/version.d.mts +1 -1
  224. package/version.d.ts +1 -1
  225. package/version.js +1 -1
  226. package/version.mjs +1 -1
@@ -4,6 +4,14 @@
4
4
 
5
5
  import { APIResource } from '../../../core/resource';
6
6
  import * as Shared from '../../shared';
7
+ import * as BookmarkAPI from './bookmark';
8
+ import {
9
+ Bookmark,
10
+ BookmarkCreateParams,
11
+ BookmarkCreateResponse,
12
+ BookmarkDeleteParams,
13
+ BookmarkDeleteResponse,
14
+ } from './bookmark';
7
15
  import * as LikeAPI from './like';
8
16
  import { Like, LikeCreateParams, LikeCreateResponse, LikeDeleteParams, LikeDeleteResponse } from './like';
9
17
  import * as RetweetAPI from './retweet';
@@ -20,6 +28,7 @@ import { RequestOptions } from '../../../internal/request-options';
20
28
  import { path } from '../../../internal/utils/path';
21
29
 
22
30
  export class Tweets extends APIResource {
31
+ bookmark: BookmarkAPI.Bookmark = new BookmarkAPI.Bookmark(this._client);
23
32
  like: LikeAPI.Like = new LikeAPI.Like(this._client);
24
33
  retweet: RetweetAPI.Retweet = new RetweetAPI.Retweet(this._client);
25
34
 
@@ -440,6 +449,11 @@ export interface TweetDetail {
440
449
  */
441
450
  communityName?: string;
442
451
 
452
+ /**
453
+ * Why X shows no Community for the post. Omitted when X names no reason.
454
+ */
455
+ communityUnavailable?: Shared.CommunityUnavailable;
456
+
443
457
  /**
444
458
  * Community Note presentation metadata returned by X.
445
459
  */
@@ -1845,8 +1859,14 @@ export interface TweetCreateResponse {
1845
1859
  | 'unlike'
1846
1860
  | 'retweet'
1847
1861
  | 'unretweet'
1862
+ | 'bookmark'
1863
+ | 'unbookmark'
1848
1864
  | 'follow'
1849
1865
  | 'unfollow'
1866
+ | 'block'
1867
+ | 'unblock'
1868
+ | 'mute'
1869
+ | 'unmute'
1850
1870
  | 'remove_follower'
1851
1871
  | 'send_dm'
1852
1872
  | 'delete_dm'
@@ -2132,8 +2152,14 @@ export interface TweetDeleteResponse {
2132
2152
  | 'unlike'
2133
2153
  | 'retweet'
2134
2154
  | 'unretweet'
2155
+ | 'bookmark'
2156
+ | 'unbookmark'
2135
2157
  | 'follow'
2136
2158
  | 'unfollow'
2159
+ | 'block'
2160
+ | 'unblock'
2161
+ | 'mute'
2162
+ | 'unmute'
2137
2163
  | 'remove_follower'
2138
2164
  | 'send_dm'
2139
2165
  | 'delete_dm'
@@ -2830,6 +2856,7 @@ export namespace TweetGetRepliesResponse {
2830
2856
  | 'page_cap'
2831
2857
  | 'partial_view'
2832
2858
  | 'repeated_cursor'
2859
+ | 'reported_held'
2833
2860
  | 'window_covered'
2834
2861
  | 'window_passed';
2835
2862
 
@@ -2992,7 +3019,8 @@ export namespace TweetResolveLinksResponse {
2992
3019
  * Tweet & reply coverage keeps shape, filters, aliases & billing. Unprefixed
2993
3020
  * cursors are legacy.
2994
3021
  */
2995
- export type TweetSearchResponse = Shared.PaginatedTweets | TweetSearchResponse.TweetSearchCoverageResponse;
3022
+ export type TweetSearchResponse =
3023
+ Shared.FilterablePaginatedTweets | TweetSearchResponse.TweetSearchCoverageResponse;
2996
3024
 
2997
3025
  export namespace TweetSearchResponse {
2998
3026
  /**
@@ -3461,6 +3489,13 @@ export interface TweetCreateParams {
3461
3489
  */
3462
3490
  media?: Array<string>;
3463
3491
 
3492
+ /**
3493
+ * Body param: Media IDs from `client.x.media.upload`, uploaded with this account.
3494
+ * IDs last 24 hours. Send up to 4 image IDs or exactly 1 video ID. Send `media` or
3495
+ * `media_ids`, not both. Media adds 2 credits per started MB across all files.
3496
+ */
3497
+ media_ids?: Array<string>;
3498
+
3464
3499
  /**
3465
3500
  * Body param: The post to reply to. Any X post ID works, from 1 to 19 digits.
3466
3501
  */
@@ -5085,16 +5120,17 @@ export interface TweetResolveLinksParams {
5085
5120
 
5086
5121
  export interface TweetSearchParams {
5087
5122
  /**
5088
- * Query, Tweet ID, or URL. Alias query. Hyphens negate terms. Use exactPhrase for
5089
- * literals. Valid bounds apply per page. `since:` & `until:` dates are UTC days,
5090
- * written YYYY-MM-DD. 25/12/2026 & 12/25/2026 also work, since each has 1 reading.
5091
- * 04/01/2026 has 2 & answers 424 with the form to write. `since_time:` &
5092
- * `until_time:` take Unix seconds or an ISO 8601 time. `list:` takes a public
5093
- * List's ID. A private List answers 404 list_not_found. X searches up to 512
5094
- * characters. A longer query answers 424 before any read, unless a term of its
5095
- * first OR group fits alone.
5123
+ * Query, Tweet ID, or URL. Alias query. Optional when fromUser, keywords or another
5124
+ * field forms the search. Without either, it answers 400 missing_query. Hyphens
5125
+ * negate terms. Use exactPhrase for literals. Valid bounds apply per page. `since:`
5126
+ * & `until:` dates are UTC days, written YYYY-MM-DD. 25/12/2026 & 12/25/2026 also
5127
+ * work, since each has 1 reading. 04/01/2026 has 2 & answers 424 with the form to
5128
+ * write. `since_time:` & `until_time:` take Unix seconds or an ISO 8601 time.
5129
+ * `list:` takes a public List's ID. A private List answers 404 list_not_found. X
5130
+ * searches up to 512 characters. A longer query answers 424 before any read, unless
5131
+ * a term of its first OR group fits alone.
5096
5132
  */
5097
- q: string;
5133
+ q?: string;
5098
5134
 
5099
5135
  /**
5100
5136
  * Raw advanced search query appended as-is.
@@ -5182,6 +5218,16 @@ export interface TweetSearchParams {
5182
5218
  */
5183
5219
  hashtags?: string;
5184
5220
 
5221
+ /**
5222
+ * Keep only posts whose photos show this. Send charts, screenshots, product_photos,
5223
+ * memes or people, or describe it in words, such as a rocket. AI-powered analysis
5224
+ * checks posts with photos X doesn't mark sensitive & keeps scores of 0.5 or more.
5225
+ * Other posts stay out at no charge. Each kept post costs 2 credits, the AI analysis
5226
+ * price, instead of the read price, & a post the filter drops costs nothing.
5227
+ * imageFilter states the cutoff & counts.
5228
+ */
5229
+ imageShows?: string;
5230
+
5185
5231
  /**
5186
5232
  * Only replies to this tweet ID.
5187
5233
  */
@@ -5394,6 +5440,15 @@ export interface TweetSearchParams {
5394
5440
  */
5395
5441
  textOnlyTerms?: string;
5396
5442
 
5443
+ /**
5444
+ * Keep only posts about this topic. AI-powered analysis asks "Is this post about
5445
+ * <topic>?" of each post & keeps scores of 0.5 or more. It reads post text & safe
5446
+ * photos. Each kept post costs 2 credits, the AI analysis price, instead of the read
5447
+ * price, & a post the filter drops costs nothing. limit counts checked posts, & only
5448
+ * kept posts come back. topicFilter states the cutoff & counts.
5449
+ */
5450
+ topic?: string;
5451
+
5397
5452
  /**
5398
5453
  * Filter replies sent to a username.
5399
5454
  */
@@ -5458,6 +5513,7 @@ export interface TweetTranslateParams {
5458
5513
  omit?: string;
5459
5514
  }
5460
5515
 
5516
+ Tweets.Bookmark = Bookmark;
5461
5517
  Tweets.Like = Like;
5462
5518
  Tweets.Retweet = Retweet;
5463
5519
 
@@ -5499,6 +5555,14 @@ export declare namespace Tweets {
5499
5555
  type TweetTranslateParams as TweetTranslateParams,
5500
5556
  };
5501
5557
 
5558
+ export {
5559
+ Bookmark as Bookmark,
5560
+ type BookmarkCreateResponse as BookmarkCreateResponse,
5561
+ type BookmarkDeleteResponse as BookmarkDeleteResponse,
5562
+ type BookmarkCreateParams as BookmarkCreateParams,
5563
+ type BookmarkDeleteParams as BookmarkDeleteParams,
5564
+ };
5565
+
5502
5566
  export {
5503
5567
  Like as Like,
5504
5568
  type LikeCreateResponse as LikeCreateResponse,
@@ -0,0 +1,119 @@
1
+ // SPDX-FileCopyrightText: 2026 Xquik contributors
2
+ //
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
5
+ import { APIResource } from '../../../core/resource';
6
+ import * as WriteActionsAPI from '../write-actions';
7
+ import { APIPromise } from '../../../core/api-promise';
8
+ import { buildHeaders } from '../../../internal/headers';
9
+ import { RequestOptions } from '../../../internal/request-options';
10
+ import { path } from '../../../internal/utils/path';
11
+
12
+ /**
13
+ * X write actions (tweets, likes, follows, DMs)
14
+ */
15
+ export class Block extends APIResource {
16
+ /**
17
+ * Blocks a user through a connected X account. X removes follows both ways, and
18
+ * unblocking doesn't restore them.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const block = await client.x.users.block.create('id', {
23
+ * account: '@elonmusk',
24
+ * 'Idempotency-Key': 'Idempotency-Key',
25
+ * });
26
+ * ```
27
+ */
28
+ create(id: string, params: BlockCreateParams, options?: RequestOptions): APIPromise<BlockCreateResponse> {
29
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
30
+ return this._client.post(path`/x/users/${id}/block`, {
31
+ body,
32
+ ...options,
33
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
34
+ });
35
+ }
36
+
37
+ /**
38
+ * Unblocks a user through a connected X account.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const response = await client.x.users.block.delete('id', {
43
+ * account: '@elonmusk',
44
+ * 'Idempotency-Key': 'Idempotency-Key',
45
+ * });
46
+ * ```
47
+ */
48
+ delete(id: string, params: BlockDeleteParams, options?: RequestOptions): APIPromise<BlockDeleteResponse> {
49
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
50
+ return this._client.delete(path`/x/users/${id}/block`, {
51
+ body,
52
+ ...options,
53
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
54
+ });
55
+ }
56
+ }
57
+
58
+ export type BlockCreateResponse = WriteActionsAPI.WriteActionRetrieveResponse;
59
+
60
+ export type BlockDeleteResponse = WriteActionsAPI.WriteActionRetrieveResponse;
61
+
62
+ export interface BlockCreateParams {
63
+ /**
64
+ * Body param: X account identifier (@username or account ID)
65
+ */
66
+ account: string;
67
+
68
+ /**
69
+ * Header param: Use one unique value per intended write. Reuse it only for an
70
+ * identical retry. A matching retry returns the first answer again, with
71
+ * idempotent: true added. It keeps the first status, body & Retry-After. It sends
72
+ * nothing to X & charges nothing. While the first request runs, a retry returns
73
+ * 202 & the action. Different input returns 409. Protection lasts at least 90
74
+ * days.
75
+ */
76
+ 'Idempotency-Key': string;
77
+
78
+ /**
79
+ * Header param: A long write answers 202 with a status link, then lands on X.
80
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
81
+ * the write is still running then, the API answers 202 with Location. Poll
82
+ * Location until `terminal` is true, and don't send the write again.
83
+ */
84
+ Prefer?: string;
85
+ }
86
+
87
+ export interface BlockDeleteParams {
88
+ /**
89
+ * Body param: X account identifier (@username or account ID)
90
+ */
91
+ account: string;
92
+
93
+ /**
94
+ * Header param: Use one unique value per intended write. Reuse it only for an
95
+ * identical retry. A matching retry returns the first answer again, with
96
+ * idempotent: true added. It keeps the first status, body & Retry-After. It sends
97
+ * nothing to X & charges nothing. While the first request runs, a retry returns
98
+ * 202 & the action. Different input returns 409. Protection lasts at least 90
99
+ * days.
100
+ */
101
+ 'Idempotency-Key': string;
102
+
103
+ /**
104
+ * Header param: A long write answers 202 with a status link, then lands on X.
105
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
106
+ * the write is still running then, the API answers 202 with Location. Poll
107
+ * Location until `terminal` is true, and don't send the write again.
108
+ */
109
+ Prefer?: string;
110
+ }
111
+
112
+ export declare namespace Block {
113
+ export {
114
+ type BlockCreateResponse as BlockCreateResponse,
115
+ type BlockDeleteResponse as BlockDeleteResponse,
116
+ type BlockCreateParams as BlockCreateParams,
117
+ type BlockDeleteParams as BlockDeleteParams,
118
+ };
119
+ }
@@ -80,8 +80,14 @@ export interface FollowCreateResponse {
80
80
  | 'unlike'
81
81
  | 'retweet'
82
82
  | 'unretweet'
83
+ | 'bookmark'
84
+ | 'unbookmark'
83
85
  | 'follow'
84
86
  | 'unfollow'
87
+ | 'block'
88
+ | 'unblock'
89
+ | 'mute'
90
+ | 'unmute'
85
91
  | 'remove_follower'
86
92
  | 'send_dm'
87
93
  | 'delete_dm'
@@ -331,8 +337,14 @@ export interface FollowDeleteAllResponse {
331
337
  | 'unlike'
332
338
  | 'retweet'
333
339
  | 'unretweet'
340
+ | 'bookmark'
341
+ | 'unbookmark'
334
342
  | 'follow'
335
343
  | 'unfollow'
344
+ | 'block'
345
+ | 'unblock'
346
+ | 'mute'
347
+ | 'unmute'
336
348
  | 'remove_follower'
337
349
  | 'send_dm'
338
350
  | 'delete_dm'
@@ -2,6 +2,13 @@
2
2
  //
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ export {
6
+ Block,
7
+ type BlockCreateResponse,
8
+ type BlockDeleteResponse,
9
+ type BlockCreateParams,
10
+ type BlockDeleteParams,
11
+ } from './block';
5
12
  export {
6
13
  Follow,
7
14
  type FollowCreateResponse,
@@ -9,11 +16,23 @@ export {
9
16
  type FollowCreateParams,
10
17
  type FollowDeleteAllParams,
11
18
  } from './follow';
19
+ export {
20
+ Mute,
21
+ type MuteCreateResponse,
22
+ type MuteDeleteResponse,
23
+ type MuteCreateParams,
24
+ type MuteDeleteParams,
25
+ } from './mute';
12
26
  export {
13
27
  Users,
14
28
  type UserRemoveFollowerResponse,
15
29
  type UserRetrieveBatchResponse,
16
30
  type UserRetrieveBatchTweetsResponse,
31
+ type UserRetrieveFollowerAuditResponse,
32
+ type FollowerAudit,
33
+ type AuditedFollower,
34
+ type FollowerClass,
35
+ type FollowerValueCount,
17
36
  type UserRetrieveFollowerIDsResponse,
18
37
  type UserRetrieveFollowersResponse,
19
38
  type UserRetrieveFollowingResponse,
@@ -32,6 +51,7 @@ export {
32
51
  type UserRetrieveArticlesParams,
33
52
  type UserRetrieveBatchParams,
34
53
  type UserRetrieveBatchTweetsParams,
54
+ type UserRetrieveFollowerAuditParams,
35
55
  type UserRetrieveFollowerIDsParams,
36
56
  type UserRetrieveFollowersParams,
37
57
  type UserRetrieveFollowersYouKnowParams,
@@ -0,0 +1,119 @@
1
+ // SPDX-FileCopyrightText: 2026 Xquik contributors
2
+ //
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
5
+ import { APIResource } from '../../../core/resource';
6
+ import * as WriteActionsAPI from '../write-actions';
7
+ import { APIPromise } from '../../../core/api-promise';
8
+ import { buildHeaders } from '../../../internal/headers';
9
+ import { RequestOptions } from '../../../internal/request-options';
10
+ import { path } from '../../../internal/utils/path';
11
+
12
+ /**
13
+ * X write actions (tweets, likes, follows, DMs)
14
+ */
15
+ export class Mute extends APIResource {
16
+ /**
17
+ * Mutes a user through a connected X account. The user's posts leave that
18
+ * account's timelines, and X doesn't tell the user.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const mute = await client.x.users.mute.create('id', {
23
+ * account: '@elonmusk',
24
+ * 'Idempotency-Key': 'Idempotency-Key',
25
+ * });
26
+ * ```
27
+ */
28
+ create(id: string, params: MuteCreateParams, options?: RequestOptions): APIPromise<MuteCreateResponse> {
29
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
30
+ return this._client.post(path`/x/users/${id}/mute`, {
31
+ body,
32
+ ...options,
33
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
34
+ });
35
+ }
36
+
37
+ /**
38
+ * Unmutes a user through a connected X account.
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const response = await client.x.users.mute.delete('id', {
43
+ * account: '@elonmusk',
44
+ * 'Idempotency-Key': 'Idempotency-Key',
45
+ * });
46
+ * ```
47
+ */
48
+ delete(id: string, params: MuteDeleteParams, options?: RequestOptions): APIPromise<MuteDeleteResponse> {
49
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
50
+ return this._client.delete(path`/x/users/${id}/mute`, {
51
+ body,
52
+ ...options,
53
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
54
+ });
55
+ }
56
+ }
57
+
58
+ export type MuteCreateResponse = WriteActionsAPI.WriteActionRetrieveResponse;
59
+
60
+ export type MuteDeleteResponse = WriteActionsAPI.WriteActionRetrieveResponse;
61
+
62
+ export interface MuteCreateParams {
63
+ /**
64
+ * Body param: X account identifier (@username or account ID)
65
+ */
66
+ account: string;
67
+
68
+ /**
69
+ * Header param: Use one unique value per intended write. Reuse it only for an
70
+ * identical retry. A matching retry returns the first answer again, with
71
+ * idempotent: true added. It keeps the first status, body & Retry-After. It sends
72
+ * nothing to X & charges nothing. While the first request runs, a retry returns
73
+ * 202 & the action. Different input returns 409. Protection lasts at least 90
74
+ * days.
75
+ */
76
+ 'Idempotency-Key': string;
77
+
78
+ /**
79
+ * Header param: A long write answers 202 with a status link, then lands on X.
80
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
81
+ * the write is still running then, the API answers 202 with Location. Poll
82
+ * Location until `terminal` is true, and don't send the write again.
83
+ */
84
+ Prefer?: string;
85
+ }
86
+
87
+ export interface MuteDeleteParams {
88
+ /**
89
+ * Body param: X account identifier (@username or account ID)
90
+ */
91
+ account: string;
92
+
93
+ /**
94
+ * Header param: Use one unique value per intended write. Reuse it only for an
95
+ * identical retry. A matching retry returns the first answer again, with
96
+ * idempotent: true added. It keeps the first status, body & Retry-After. It sends
97
+ * nothing to X & charges nothing. While the first request runs, a retry returns
98
+ * 202 & the action. Different input returns 409. Protection lasts at least 90
99
+ * days.
100
+ */
101
+ 'Idempotency-Key': string;
102
+
103
+ /**
104
+ * Header param: A long write answers 202 with a status link, then lands on X.
105
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
106
+ * the write is still running then, the API answers 202 with Location. Poll
107
+ * Location until `terminal` is true, and don't send the write again.
108
+ */
109
+ Prefer?: string;
110
+ }
111
+
112
+ export declare namespace Mute {
113
+ export {
114
+ type MuteCreateResponse as MuteCreateResponse,
115
+ type MuteDeleteResponse as MuteDeleteResponse,
116
+ type MuteCreateParams as MuteCreateParams,
117
+ type MuteDeleteParams as MuteDeleteParams,
118
+ };
119
+ }