x-twitter-scraper 0.19.0 → 0.21.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 (257) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +120 -120
  3. package/client.d.mts +7 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/activity.d.mts +18 -2
  11. package/resources/activity.d.mts.map +1 -1
  12. package/resources/activity.d.ts +18 -2
  13. package/resources/activity.d.ts.map +1 -1
  14. package/resources/credits.d.mts +5 -0
  15. package/resources/credits.d.mts.map +1 -1
  16. package/resources/credits.d.ts +5 -0
  17. package/resources/credits.d.ts.map +1 -1
  18. package/resources/extractions.d.mts +153 -5
  19. package/resources/extractions.d.mts.map +1 -1
  20. package/resources/extractions.d.ts +153 -5
  21. package/resources/extractions.d.ts.map +1 -1
  22. package/resources/index.d.mts +1 -1
  23. package/resources/index.d.mts.map +1 -1
  24. package/resources/index.d.ts +1 -1
  25. package/resources/index.d.ts.map +1 -1
  26. package/resources/index.js.map +1 -1
  27. package/resources/index.mjs.map +1 -1
  28. package/resources/monitors/index.d.mts +1 -1
  29. package/resources/monitors/index.d.mts.map +1 -1
  30. package/resources/monitors/index.d.ts +1 -1
  31. package/resources/monitors/index.d.ts.map +1 -1
  32. package/resources/monitors/index.js.map +1 -1
  33. package/resources/monitors/index.mjs.map +1 -1
  34. package/resources/monitors/monitors.d.mts +38 -1
  35. package/resources/monitors/monitors.d.mts.map +1 -1
  36. package/resources/monitors/monitors.d.ts +38 -1
  37. package/resources/monitors/monitors.d.ts.map +1 -1
  38. package/resources/monitors/monitors.js +18 -0
  39. package/resources/monitors/monitors.js.map +1 -1
  40. package/resources/monitors/monitors.mjs +18 -0
  41. package/resources/monitors/monitors.mjs.map +1 -1
  42. package/resources/monitors/posts.d.mts +27 -0
  43. package/resources/monitors/posts.d.mts.map +1 -1
  44. package/resources/monitors/posts.d.ts +27 -0
  45. package/resources/monitors/posts.d.ts.map +1 -1
  46. package/resources/radar.d.mts +9 -0
  47. package/resources/radar.d.mts.map +1 -1
  48. package/resources/radar.d.ts +9 -0
  49. package/resources/radar.d.ts.map +1 -1
  50. package/resources/shared.d.mts +175 -5
  51. package/resources/shared.d.mts.map +1 -1
  52. package/resources/shared.d.ts +175 -5
  53. package/resources/shared.d.ts.map +1 -1
  54. package/resources/x/account-connection-attempts.d.mts +4 -0
  55. package/resources/x/account-connection-attempts.d.mts.map +1 -1
  56. package/resources/x/account-connection-attempts.d.ts +4 -0
  57. package/resources/x/account-connection-attempts.d.ts.map +1 -1
  58. package/resources/x/account-connection-links.d.mts +159 -0
  59. package/resources/x/account-connection-links.d.mts.map +1 -0
  60. package/resources/x/account-connection-links.d.ts +159 -0
  61. package/resources/x/account-connection-links.d.ts.map +1 -0
  62. package/resources/x/account-connection-links.js +82 -0
  63. package/resources/x/account-connection-links.js.map +1 -0
  64. package/resources/x/account-connection-links.mjs +78 -0
  65. package/resources/x/account-connection-links.mjs.map +1 -0
  66. package/resources/x/accounts.d.mts +13 -9
  67. package/resources/x/accounts.d.mts.map +1 -1
  68. package/resources/x/accounts.d.ts +13 -9
  69. package/resources/x/accounts.d.ts.map +1 -1
  70. package/resources/x/analysis.d.mts +540 -36
  71. package/resources/x/analysis.d.mts.map +1 -1
  72. package/resources/x/analysis.d.ts +540 -36
  73. package/resources/x/analysis.d.ts.map +1 -1
  74. package/resources/x/bookmarks.d.mts +5 -0
  75. package/resources/x/bookmarks.d.mts.map +1 -1
  76. package/resources/x/bookmarks.d.ts +5 -0
  77. package/resources/x/bookmarks.d.ts.map +1 -1
  78. package/resources/x/communities/communities.d.mts +19 -2
  79. package/resources/x/communities/communities.d.mts.map +1 -1
  80. package/resources/x/communities/communities.d.ts +19 -2
  81. package/resources/x/communities/communities.d.ts.map +1 -1
  82. package/resources/x/communities/communities.js +7 -4
  83. package/resources/x/communities/communities.js.map +1 -1
  84. package/resources/x/communities/communities.mjs +7 -4
  85. package/resources/x/communities/communities.mjs.map +1 -1
  86. package/resources/x/communities/join.d.mts +16 -2
  87. package/resources/x/communities/join.d.mts.map +1 -1
  88. package/resources/x/communities/join.d.ts +16 -2
  89. package/resources/x/communities/join.d.ts.map +1 -1
  90. package/resources/x/communities/join.js +4 -4
  91. package/resources/x/communities/join.js.map +1 -1
  92. package/resources/x/communities/join.mjs +4 -4
  93. package/resources/x/communities/join.mjs.map +1 -1
  94. package/resources/x/dm.d.mts +16 -2
  95. package/resources/x/dm.d.mts.map +1 -1
  96. package/resources/x/dm.d.ts +16 -2
  97. package/resources/x/dm.d.ts.map +1 -1
  98. package/resources/x/dm.js +4 -4
  99. package/resources/x/dm.js.map +1 -1
  100. package/resources/x/dm.mjs +4 -4
  101. package/resources/x/dm.mjs.map +1 -1
  102. package/resources/x/index.d.mts +2 -1
  103. package/resources/x/index.d.mts.map +1 -1
  104. package/resources/x/index.d.ts +2 -1
  105. package/resources/x/index.d.ts.map +1 -1
  106. package/resources/x/index.js +3 -1
  107. package/resources/x/index.js.map +1 -1
  108. package/resources/x/index.mjs +1 -0
  109. package/resources/x/index.mjs.map +1 -1
  110. package/resources/x/media.d.mts +55 -1
  111. package/resources/x/media.d.mts.map +1 -1
  112. package/resources/x/media.d.ts +55 -1
  113. package/resources/x/media.d.ts.map +1 -1
  114. package/resources/x/media.js +2 -2
  115. package/resources/x/media.js.map +1 -1
  116. package/resources/x/media.mjs +2 -2
  117. package/resources/x/media.mjs.map +1 -1
  118. package/resources/x/profile.d.mts +24 -3
  119. package/resources/x/profile.d.mts.map +1 -1
  120. package/resources/x/profile.d.ts +24 -3
  121. package/resources/x/profile.d.ts.map +1 -1
  122. package/resources/x/profile.js +6 -6
  123. package/resources/x/profile.js.map +1 -1
  124. package/resources/x/profile.mjs +6 -6
  125. package/resources/x/profile.mjs.map +1 -1
  126. package/resources/x/tweets/bookmark.d.mts +84 -0
  127. package/resources/x/tweets/bookmark.d.mts.map +1 -0
  128. package/resources/x/tweets/bookmark.d.ts +84 -0
  129. package/resources/x/tweets/bookmark.d.ts.map +1 -0
  130. package/resources/x/tweets/bookmark.js +55 -0
  131. package/resources/x/tweets/bookmark.js.map +1 -0
  132. package/resources/x/tweets/bookmark.mjs +51 -0
  133. package/resources/x/tweets/bookmark.mjs.map +1 -0
  134. package/resources/x/tweets/index.d.mts +1 -0
  135. package/resources/x/tweets/index.d.mts.map +1 -1
  136. package/resources/x/tweets/index.d.ts +1 -0
  137. package/resources/x/tweets/index.d.ts.map +1 -1
  138. package/resources/x/tweets/index.js +3 -1
  139. package/resources/x/tweets/index.js.map +1 -1
  140. package/resources/x/tweets/index.mjs +1 -0
  141. package/resources/x/tweets/index.mjs.map +1 -1
  142. package/resources/x/tweets/like.d.mts +16 -2
  143. package/resources/x/tweets/like.d.mts.map +1 -1
  144. package/resources/x/tweets/like.d.ts +16 -2
  145. package/resources/x/tweets/like.d.ts.map +1 -1
  146. package/resources/x/tweets/like.js +4 -4
  147. package/resources/x/tweets/like.js.map +1 -1
  148. package/resources/x/tweets/like.mjs +4 -4
  149. package/resources/x/tweets/like.mjs.map +1 -1
  150. package/resources/x/tweets/retweet.d.mts +16 -2
  151. package/resources/x/tweets/retweet.d.mts.map +1 -1
  152. package/resources/x/tweets/retweet.d.ts +16 -2
  153. package/resources/x/tweets/retweet.d.ts.map +1 -1
  154. package/resources/x/tweets/retweet.js +4 -4
  155. package/resources/x/tweets/retweet.js.map +1 -1
  156. package/resources/x/tweets/retweet.mjs +4 -4
  157. package/resources/x/tweets/retweet.mjs.map +1 -1
  158. package/resources/x/tweets/tweets.d.mts +68 -13
  159. package/resources/x/tweets/tweets.d.mts.map +1 -1
  160. package/resources/x/tweets/tweets.d.ts +68 -13
  161. package/resources/x/tweets/tweets.d.ts.map +1 -1
  162. package/resources/x/tweets/tweets.js +8 -4
  163. package/resources/x/tweets/tweets.js.map +1 -1
  164. package/resources/x/tweets/tweets.mjs +8 -4
  165. package/resources/x/tweets/tweets.mjs.map +1 -1
  166. package/resources/x/users/block.d.mts +84 -0
  167. package/resources/x/users/block.d.mts.map +1 -0
  168. package/resources/x/users/block.d.ts +84 -0
  169. package/resources/x/users/block.d.ts.map +1 -0
  170. package/resources/x/users/block.js +55 -0
  171. package/resources/x/users/block.js.map +1 -0
  172. package/resources/x/users/block.mjs +51 -0
  173. package/resources/x/users/block.mjs.map +1 -0
  174. package/resources/x/users/follow.d.mts +16 -2
  175. package/resources/x/users/follow.d.mts.map +1 -1
  176. package/resources/x/users/follow.d.ts +16 -2
  177. package/resources/x/users/follow.d.ts.map +1 -1
  178. package/resources/x/users/follow.js +4 -4
  179. package/resources/x/users/follow.js.map +1 -1
  180. package/resources/x/users/follow.mjs +4 -4
  181. package/resources/x/users/follow.mjs.map +1 -1
  182. package/resources/x/users/index.d.mts +3 -1
  183. package/resources/x/users/index.d.mts.map +1 -1
  184. package/resources/x/users/index.d.ts +3 -1
  185. package/resources/x/users/index.d.ts.map +1 -1
  186. package/resources/x/users/index.js +5 -1
  187. package/resources/x/users/index.js.map +1 -1
  188. package/resources/x/users/index.mjs +2 -0
  189. package/resources/x/users/index.mjs.map +1 -1
  190. package/resources/x/users/mute.d.mts +84 -0
  191. package/resources/x/users/mute.d.mts.map +1 -0
  192. package/resources/x/users/mute.d.ts +84 -0
  193. package/resources/x/users/mute.d.ts.map +1 -0
  194. package/resources/x/users/mute.js +55 -0
  195. package/resources/x/users/mute.js.map +1 -0
  196. package/resources/x/users/mute.mjs +51 -0
  197. package/resources/x/users/mute.mjs.map +1 -0
  198. package/resources/x/users/users.d.mts +783 -9
  199. package/resources/x/users/users.d.mts.map +1 -1
  200. package/resources/x/users/users.d.ts +783 -9
  201. package/resources/x/users/users.d.ts.map +1 -1
  202. package/resources/x/users/users.js +44 -3
  203. package/resources/x/users/users.js.map +1 -1
  204. package/resources/x/users/users.mjs +44 -3
  205. package/resources/x/users/users.mjs.map +1 -1
  206. package/resources/x/write-actions.d.mts +1 -1
  207. package/resources/x/write-actions.d.mts.map +1 -1
  208. package/resources/x/write-actions.d.ts +1 -1
  209. package/resources/x/write-actions.d.ts.map +1 -1
  210. package/resources/x/x.d.mts +15 -2
  211. package/resources/x/x.d.mts.map +1 -1
  212. package/resources/x/x.d.ts +15 -2
  213. package/resources/x/x.d.ts.map +1 -1
  214. package/resources/x/x.js +4 -0
  215. package/resources/x/x.js.map +1 -1
  216. package/resources/x/x.mjs +4 -0
  217. package/resources/x/x.mjs.map +1 -1
  218. package/src/client.ts +9 -0
  219. package/src/core/README.md +4 -0
  220. package/src/internal/README.md +6 -1
  221. package/src/resources/activity.ts +41 -2
  222. package/src/resources/credits.ts +6 -0
  223. package/src/resources/extractions.ts +183 -0
  224. package/src/resources/index.ts +2 -0
  225. package/src/resources/monitors/index.ts +2 -0
  226. package/src/resources/monitors/monitors.ts +49 -0
  227. package/src/resources/monitors/posts.ts +32 -0
  228. package/src/resources/radar.ts +10 -0
  229. package/src/resources/shared.ts +213 -4
  230. package/src/resources/x/account-connection-attempts.ts +5 -0
  231. package/src/resources/x/account-connection-links.ts +215 -0
  232. package/src/resources/x/accounts.ts +15 -14
  233. package/src/resources/x/analysis.ts +618 -36
  234. package/src/resources/x/bookmarks.ts +6 -0
  235. package/src/resources/x/communities/communities.ts +35 -4
  236. package/src/resources/x/communities/join.ts +32 -4
  237. package/src/resources/x/dm.ts +32 -4
  238. package/src/resources/x/index.ts +18 -0
  239. package/src/resources/x/media.ts +74 -2
  240. package/src/resources/x/profile.ts +48 -6
  241. package/src/resources/x/tweets/bookmark.ts +127 -0
  242. package/src/resources/x/tweets/index.ts +7 -0
  243. package/src/resources/x/tweets/like.ts +32 -4
  244. package/src/resources/x/tweets/retweet.ts +32 -4
  245. package/src/resources/x/tweets/tweets.ts +104 -14
  246. package/src/resources/x/users/block.ts +119 -0
  247. package/src/resources/x/users/follow.ts +32 -4
  248. package/src/resources/x/users/index.ts +23 -0
  249. package/src/resources/x/users/mute.ts +119 -0
  250. package/src/resources/x/users/users.ts +1063 -89
  251. package/src/resources/x/write-actions.ts +6 -0
  252. package/src/resources/x/x.ts +54 -0
  253. package/src/version.ts +1 -1
  254. package/version.d.mts +1 -1
  255. package/version.d.ts +1 -1
  256. package/version.js +1 -1
  257. package/version.mjs +1 -1
@@ -156,6 +156,12 @@ export interface BookmarkListParams {
156
156
  * Optional bookmark folder ID. Folders need X Premium.
157
157
  */
158
158
  folderId?: string;
159
+
160
+ /**
161
+ * Items per page, 1 to 100, default 20. Source, filters or credits can return
162
+ * fewer. Follow next_cursor for more pages.
163
+ */
164
+ pageSize?: number;
159
165
  }
160
166
 
161
167
  export interface BookmarkRetrieveFoldersParams {
@@ -29,6 +29,9 @@ export class Communities extends APIResource {
29
29
  /**
30
30
  * Creates an X Community through a connected account.
31
31
  *
32
+ * @deprecated X isn't accepting new Communities. This call answers
33
+ * `x_community_creation_closed` & charges nothing.
34
+ *
32
35
  * @example
33
36
  * ```ts
34
37
  * const community = await client.x.communities.create({
@@ -40,11 +43,11 @@ export class Communities extends APIResource {
40
43
  * ```
41
44
  */
42
45
  create(params: CommunityCreateParams, options?: RequestOptions): APIPromise<CommunityCreateResponse> {
43
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
46
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
44
47
  return this._client.post('/x/communities', {
45
48
  body,
46
49
  ...options,
47
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
50
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
48
51
  });
49
52
  }
50
53
 
@@ -68,11 +71,11 @@ export class Communities extends APIResource {
68
71
  params: CommunityDeleteParams,
69
72
  options?: RequestOptions,
70
73
  ): APIPromise<CommunityDeleteResponse> {
71
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
74
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
72
75
  return this._client.delete(path`/x/communities/${id}`, {
73
76
  body,
74
77
  ...options,
75
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
78
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
76
79
  });
77
80
  }
78
81
 
@@ -350,8 +353,14 @@ export interface CommunityCreateResponse {
350
353
  | 'unlike'
351
354
  | 'retweet'
352
355
  | 'unretweet'
356
+ | 'bookmark'
357
+ | 'unbookmark'
353
358
  | 'follow'
354
359
  | 'unfollow'
360
+ | 'block'
361
+ | 'unblock'
362
+ | 'mute'
363
+ | 'unmute'
355
364
  | 'remove_follower'
356
365
  | 'send_dm'
357
366
  | 'delete_dm'
@@ -601,8 +610,14 @@ export interface CommunityDeleteResponse {
601
610
  | 'unlike'
602
611
  | 'retweet'
603
612
  | 'unretweet'
613
+ | 'bookmark'
614
+ | 'unbookmark'
604
615
  | 'follow'
605
616
  | 'unfollow'
617
+ | 'block'
618
+ | 'unblock'
619
+ | 'mute'
620
+ | 'unmute'
606
621
  | 'remove_follower'
607
622
  | 'send_dm'
608
623
  | 'delete_dm'
@@ -894,6 +909,14 @@ export interface CommunityCreateParams {
894
909
  */
895
910
  'Idempotency-Key': string;
896
911
 
912
+ /**
913
+ * Header param: A long write answers 202 with a status link, then lands on X.
914
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
915
+ * the write is still running then, the API answers 202 with Location. Poll
916
+ * Location until `terminal` is true, and don't send the write again.
917
+ */
918
+ Prefer?: string;
919
+
897
920
  /**
898
921
  * Body param: Community description
899
922
  */
@@ -920,6 +943,14 @@ export interface CommunityDeleteParams {
920
943
  * days.
921
944
  */
922
945
  'Idempotency-Key': string;
946
+
947
+ /**
948
+ * Header param: A long write answers 202 with a status link, then lands on X.
949
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
950
+ * the write is still running then, the API answers 202 with Location. Poll
951
+ * Location until `terminal` is true, and don't send the write again.
952
+ */
953
+ Prefer?: string;
923
954
  }
924
955
 
925
956
  export interface CommunityFindParams {
@@ -27,11 +27,11 @@ export class Join extends APIResource {
27
27
  * ```
28
28
  */
29
29
  create(id: string, params: JoinCreateParams, options?: RequestOptions): APIPromise<JoinCreateResponse> {
30
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
30
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
31
31
  return this._client.post(path`/x/communities/${id}/join`, {
32
32
  body,
33
33
  ...options,
34
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
34
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
35
35
  });
36
36
  }
37
37
 
@@ -54,11 +54,11 @@ export class Join extends APIResource {
54
54
  params: JoinDeleteAllParams,
55
55
  options?: RequestOptions,
56
56
  ): APIPromise<JoinDeleteAllResponse> {
57
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
57
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
58
58
  return this._client.delete(path`/x/communities/${id}/join`, {
59
59
  body,
60
60
  ...options,
61
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
61
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
62
62
  });
63
63
  }
64
64
  }
@@ -83,8 +83,14 @@ export interface JoinCreateResponse {
83
83
  | 'unlike'
84
84
  | 'retweet'
85
85
  | 'unretweet'
86
+ | 'bookmark'
87
+ | 'unbookmark'
86
88
  | 'follow'
87
89
  | 'unfollow'
90
+ | 'block'
91
+ | 'unblock'
92
+ | 'mute'
93
+ | 'unmute'
88
94
  | 'remove_follower'
89
95
  | 'send_dm'
90
96
  | 'delete_dm'
@@ -334,8 +340,14 @@ export interface JoinDeleteAllResponse {
334
340
  | 'unlike'
335
341
  | 'retweet'
336
342
  | 'unretweet'
343
+ | 'bookmark'
344
+ | 'unbookmark'
337
345
  | 'follow'
338
346
  | 'unfollow'
347
+ | 'block'
348
+ | 'unblock'
349
+ | 'mute'
350
+ | 'unmute'
339
351
  | 'remove_follower'
340
352
  | 'send_dm'
341
353
  | 'delete_dm'
@@ -580,6 +592,14 @@ export interface JoinCreateParams {
580
592
  * days.
581
593
  */
582
594
  'Idempotency-Key': string;
595
+
596
+ /**
597
+ * Header param: A long write answers 202 with a status link, then lands on X.
598
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
599
+ * the write is still running then, the API answers 202 with Location. Poll
600
+ * Location until `terminal` is true, and don't send the write again.
601
+ */
602
+ Prefer?: string;
583
603
  }
584
604
 
585
605
  export interface JoinDeleteAllParams {
@@ -597,6 +617,14 @@ export interface JoinDeleteAllParams {
597
617
  * days.
598
618
  */
599
619
  'Idempotency-Key': string;
620
+
621
+ /**
622
+ * Header param: A long write answers 202 with a status link, then lands on X.
623
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
624
+ * the write is still running then, the API answers 202 with Location. Poll
625
+ * Location until `terminal` is true, and don't send the write again.
626
+ */
627
+ Prefer?: string;
600
628
  }
601
629
 
602
630
  export declare namespace Join {
@@ -31,11 +31,11 @@ export class Dm extends APIResource {
31
31
  params: DmDeleteMessageParams,
32
32
  options?: RequestOptions,
33
33
  ): APIPromise<DmDeleteMessageResponse> {
34
- const { userId, account, 'Idempotency-Key': idempotencyKey } = params;
34
+ const { userId, account, 'Idempotency-Key': idempotencyKey, Prefer: prefer } = params;
35
35
  return this._client.delete(path`/x/dm/${userId}/messages/${messageID}`, {
36
36
  query: { account },
37
37
  ...options,
38
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
38
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
39
39
  });
40
40
  }
41
41
 
@@ -74,11 +74,11 @@ export class Dm extends APIResource {
74
74
  * ```
75
75
  */
76
76
  send(userID: string, params: DmSendParams, options?: RequestOptions): APIPromise<DmSendResponse> {
77
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
77
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
78
78
  return this._client.post(path`/x/dm/${userID}`, {
79
79
  body,
80
80
  ...options,
81
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
81
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
82
82
  });
83
83
  }
84
84
  }
@@ -103,8 +103,14 @@ export interface DmDeleteMessageResponse {
103
103
  | 'unlike'
104
104
  | 'retweet'
105
105
  | 'unretweet'
106
+ | 'bookmark'
107
+ | 'unbookmark'
106
108
  | 'follow'
107
109
  | 'unfollow'
110
+ | 'block'
111
+ | 'unblock'
112
+ | 'mute'
113
+ | 'unmute'
108
114
  | 'remove_follower'
109
115
  | 'send_dm'
110
116
  | 'delete_dm'
@@ -385,8 +391,14 @@ export interface DmSendResponse {
385
391
  | 'unlike'
386
392
  | 'retweet'
387
393
  | 'unretweet'
394
+ | 'bookmark'
395
+ | 'unbookmark'
388
396
  | 'follow'
389
397
  | 'unfollow'
398
+ | 'block'
399
+ | 'unblock'
400
+ | 'mute'
401
+ | 'unmute'
390
402
  | 'remove_follower'
391
403
  | 'send_dm'
392
404
  | 'delete_dm'
@@ -638,6 +650,14 @@ export interface DmDeleteMessageParams {
638
650
  * days.
639
651
  */
640
652
  'Idempotency-Key': string;
653
+
654
+ /**
655
+ * Header param: A long write answers 202 with a status link, then lands on X.
656
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
657
+ * the write is still running then, the API answers 202 with Location. Poll
658
+ * Location until `terminal` is true, and don't send the write again.
659
+ */
660
+ Prefer?: string;
641
661
  }
642
662
 
643
663
  export interface DmRetrieveHistoryParams {
@@ -680,6 +700,14 @@ export interface DmSendParams {
680
700
  */
681
701
  'Idempotency-Key': string;
682
702
 
703
+ /**
704
+ * Header param: A long write answers 202 with a status link, then lands on X.
705
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
706
+ * the write is still running then, the API answers 202 with Location. Poll
707
+ * Location until `terminal` is true, and don't send the write again.
708
+ */
709
+ Prefer?: string;
710
+
683
711
  /**
684
712
  * Body param: Optional array containing exactly 1 uploaded media ID.
685
713
  */
@@ -6,6 +6,15 @@ export {
6
6
  AccountConnectionAttempts,
7
7
  type AccountConnectionAttemptRetrieveResponse,
8
8
  } from './account-connection-attempts';
9
+ export {
10
+ AccountConnectionLinks,
11
+ type XAccountConnectionLink,
12
+ type AccountConnectionLinkCreateResponse,
13
+ type AccountConnectionLinkListResponse,
14
+ type AccountConnectionLinkDeleteResponse,
15
+ type AccountConnectionLinkCreateParams,
16
+ type AccountConnectionLinkListParams,
17
+ } from './account-connection-links';
9
18
  export {
10
19
  AccountConnectionChallenges,
11
20
  type AccountConnectionChallengeSubmitResponse,
@@ -182,6 +191,11 @@ export {
182
191
  type UserRemoveFollowerResponse,
183
192
  type UserRetrieveBatchResponse,
184
193
  type UserRetrieveBatchTweetsResponse,
194
+ type UserRetrieveFollowerAuditResponse,
195
+ type FollowerAudit,
196
+ type AuditedFollower,
197
+ type FollowerClass,
198
+ type FollowerValueCount,
185
199
  type UserRetrieveFollowerIDsResponse,
186
200
  type UserRetrieveFollowersResponse,
187
201
  type UserRetrieveFollowingResponse,
@@ -190,6 +204,8 @@ export {
190
204
  type UserRetrieveListMembershipsResponse,
191
205
  type UserRetrieveListsResponse,
192
206
  type UserRetrieveLiveResponse,
207
+ type ShadowbanReport,
208
+ type ShadowbanVerdict,
193
209
  type UserRetrieveVerifiedFollowersResponse,
194
210
  type UserTranslateBioResponse,
195
211
  type UserRetrieveParams,
@@ -198,6 +214,7 @@ export {
198
214
  type UserRetrieveArticlesParams,
199
215
  type UserRetrieveBatchParams,
200
216
  type UserRetrieveBatchTweetsParams,
217
+ type UserRetrieveFollowerAuditParams,
201
218
  type UserRetrieveFollowerIDsParams,
202
219
  type UserRetrieveFollowersParams,
203
220
  type UserRetrieveFollowersYouKnowParams,
@@ -213,6 +230,7 @@ export {
213
230
  type UserRetrieveMentionsParams,
214
231
  type UserRetrieveRepliesParams,
215
232
  type UserRetrieveSearchParams,
233
+ type UserRetrieveShadowbanParams,
216
234
  type UserRetrieveSimilarParams,
217
235
  type UserRetrieveSubscriptionsParams,
218
236
  type UserRetrieveTweetsParams,
@@ -3,6 +3,7 @@
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
 
5
5
  import { APIResource } from '../../core/resource';
6
+ import * as Shared from '../shared';
6
7
  import { APIPromise } from '../../core/api-promise';
7
8
  import { type Uploadable } from '../../core/uploads';
8
9
  import { buildHeaders } from '../../internal/headers';
@@ -37,14 +38,14 @@ export class Media extends APIResource {
37
38
  * ```
38
39
  */
39
40
  upload(params: MediaUploadParams, options?: RequestOptions): APIPromise<MediaUploadResponse> {
40
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
41
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
41
42
  return this._client.post(
42
43
  '/x/media',
43
44
  maybeMultipartFormRequestOptions(
44
45
  {
45
46
  body,
46
47
  ...options,
47
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
48
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
48
49
  },
49
50
  this._client,
50
51
  ),
@@ -55,18 +56,39 @@ export class Media extends APIResource {
55
56
  export interface MediaDownloadResponse {
56
57
  cacheHit?: boolean;
57
58
 
59
+ /**
60
+ * Posts Xquik couldn't read, at no charge. Send them again.
61
+ */
62
+ failedTweetIds?: Array<string>;
63
+
58
64
  galleryUrl?: string;
59
65
 
66
+ /**
67
+ * What the image filter asked & how many posts it kept. Present when the request
68
+ * sent imageShows.
69
+ */
70
+ imageFilter?: Shared.ImageFilterSummary;
71
+
60
72
  /**
61
73
  * The post's files saved to your gallery. Single downloads only.
62
74
  */
63
75
  items?: Array<MediaDownloadResponse.Item>;
64
76
 
77
+ /**
78
+ * Posts with no media to save, at no charge.
79
+ */
80
+ noMediaTweetIds?: Array<string>;
81
+
65
82
  totalMedia?: number;
66
83
 
67
84
  totalTweets?: number;
68
85
 
69
86
  tweetId?: string;
87
+
88
+ /**
89
+ * Posts Xquik had no time to read, at no charge. Send them again.
90
+ */
91
+ unprocessedTweetIds?: Array<string>;
70
92
  }
71
93
 
72
94
  export namespace MediaDownloadResponse {
@@ -88,6 +110,18 @@ export namespace MediaDownloadResponse {
88
110
  */
89
111
  mediaUrl: string;
90
112
 
113
+ /**
114
+ * Cover image of a video or GIF. Null for photos & files first saved to Xquik
115
+ * before 2026-11-03.
116
+ */
117
+ posterUrl: string | null;
118
+
119
+ /**
120
+ * The MP4 sizes X stores for a video, highest bitrate first. Empty for photos,
121
+ * GIFs & files first saved to Xquik before 2026-11-03.
122
+ */
123
+ qualities: Array<Item.Quality>;
124
+
91
125
  /**
92
126
  * File size in bytes, as a string.
93
127
  */
@@ -112,6 +146,21 @@ export namespace MediaDownloadResponse {
112
146
 
113
147
  views: number | null;
114
148
  }
149
+
150
+ export namespace Item {
151
+ /**
152
+ * 1 MP4 size of the video.
153
+ */
154
+ export interface Quality {
155
+ bitrate: number;
156
+
157
+ height: number;
158
+
159
+ url: string;
160
+
161
+ width: number;
162
+ }
163
+ }
115
164
  }
116
165
 
117
166
  /**
@@ -134,8 +183,14 @@ export interface MediaUploadResponse {
134
183
  | 'unlike'
135
184
  | 'retweet'
136
185
  | 'unretweet'
186
+ | 'bookmark'
187
+ | 'unbookmark'
137
188
  | 'follow'
138
189
  | 'unfollow'
190
+ | 'block'
191
+ | 'unblock'
192
+ | 'mute'
193
+ | 'unmute'
139
194
  | 'remove_follower'
140
195
  | 'send_dm'
141
196
  | 'delete_dm'
@@ -366,6 +421,15 @@ export namespace MediaUploadResponse {
366
421
  }
367
422
 
368
423
  export interface MediaDownloadParams {
424
+ /**
425
+ * Save only posts whose photos show this. Send charts, screenshots, product_photos,
426
+ * memes or people, or describe it in words, such as a rocket. AI-powered analysis
427
+ * checks posts with photos X doesn't mark sensitive & keeps scores of 0.5 or more.
428
+ * Each post saved costs 2 credits, the AI analysis price, on top of its save price,
429
+ * & a post the filter drops costs nothing. imageFilter states the cutoff & counts.
430
+ */
431
+ imageShows?: string;
432
+
369
433
  /**
370
434
  * Numeric tweet ID alias for tweetInput
371
435
  */
@@ -421,6 +485,14 @@ export interface MediaUploadParams {
421
485
  * days.
422
486
  */
423
487
  'Idempotency-Key': string;
488
+
489
+ /**
490
+ * Header param: A long write answers 202 with a status link, then lands on X.
491
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
492
+ * the write is still running then, the API answers 202 with Location. Poll
493
+ * Location until `terminal` is true, and don't send the write again.
494
+ */
495
+ Prefer?: string;
424
496
  }
425
497
 
426
498
  export declare namespace Media {
@@ -29,11 +29,11 @@ export class Profile extends APIResource {
29
29
  * ```
30
30
  */
31
31
  update(params: ProfileUpdateParams, options?: RequestOptions): APIPromise<ProfileUpdateResponse> {
32
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
32
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
33
33
  return this._client.patch('/x/profile', {
34
34
  body,
35
35
  ...options,
36
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
36
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
37
37
  });
38
38
  }
39
39
 
@@ -53,14 +53,14 @@ export class Profile extends APIResource {
53
53
  params: ProfileUpdateAvatarParams,
54
54
  options?: RequestOptions,
55
55
  ): APIPromise<ProfileUpdateAvatarResponse> {
56
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
56
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
57
57
  return this._client.patch(
58
58
  '/x/profile/avatar',
59
59
  maybeMultipartFormRequestOptions(
60
60
  {
61
61
  body,
62
62
  ...options,
63
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
63
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
64
64
  },
65
65
  this._client,
66
66
  ),
@@ -83,14 +83,14 @@ export class Profile extends APIResource {
83
83
  params: ProfileUpdateBannerParams,
84
84
  options?: RequestOptions,
85
85
  ): APIPromise<ProfileUpdateBannerResponse> {
86
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
86
+ const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
87
87
  return this._client.patch(
88
88
  '/x/profile/banner',
89
89
  maybeMultipartFormRequestOptions(
90
90
  {
91
91
  body,
92
92
  ...options,
93
- headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
93
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
94
94
  },
95
95
  this._client,
96
96
  ),
@@ -118,8 +118,14 @@ export interface ProfileUpdateResponse {
118
118
  | 'unlike'
119
119
  | 'retweet'
120
120
  | 'unretweet'
121
+ | 'bookmark'
122
+ | 'unbookmark'
121
123
  | 'follow'
122
124
  | 'unfollow'
125
+ | 'block'
126
+ | 'unblock'
127
+ | 'mute'
128
+ | 'unmute'
123
129
  | 'remove_follower'
124
130
  | 'send_dm'
125
131
  | 'delete_dm'
@@ -369,8 +375,14 @@ export interface ProfileUpdateAvatarResponse {
369
375
  | 'unlike'
370
376
  | 'retweet'
371
377
  | 'unretweet'
378
+ | 'bookmark'
379
+ | 'unbookmark'
372
380
  | 'follow'
373
381
  | 'unfollow'
382
+ | 'block'
383
+ | 'unblock'
384
+ | 'mute'
385
+ | 'unmute'
374
386
  | 'remove_follower'
375
387
  | 'send_dm'
376
388
  | 'delete_dm'
@@ -620,8 +632,14 @@ export interface ProfileUpdateBannerResponse {
620
632
  | 'unlike'
621
633
  | 'retweet'
622
634
  | 'unretweet'
635
+ | 'bookmark'
636
+ | 'unbookmark'
623
637
  | 'follow'
624
638
  | 'unfollow'
639
+ | 'block'
640
+ | 'unblock'
641
+ | 'mute'
642
+ | 'unmute'
625
643
  | 'remove_follower'
626
644
  | 'send_dm'
627
645
  | 'delete_dm'
@@ -867,6 +885,14 @@ export interface ProfileUpdateParams {
867
885
  */
868
886
  'Idempotency-Key': string;
869
887
 
888
+ /**
889
+ * Header param: A long write answers 202 with a status link, then lands on X.
890
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
891
+ * the write is still running then, the API answers 202 with Location. Poll
892
+ * Location until `terminal` is true, and don't send the write again.
893
+ */
894
+ Prefer?: string;
895
+
870
896
  /**
871
897
  * Body param: Bio, up to 160 characters. An emoji counts as 2.
872
898
  */
@@ -913,6 +939,14 @@ export interface ProfileUpdateAvatarParams {
913
939
  * days.
914
940
  */
915
941
  'Idempotency-Key': string;
942
+
943
+ /**
944
+ * Header param: A long write answers 202 with a status link, then lands on X.
945
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
946
+ * the write is still running then, the API answers 202 with Location. Poll
947
+ * Location until `terminal` is true, and don't send the write again.
948
+ */
949
+ Prefer?: string;
916
950
  }
917
951
 
918
952
  export interface ProfileUpdateBannerParams {
@@ -940,6 +974,14 @@ export interface ProfileUpdateBannerParams {
940
974
  * days.
941
975
  */
942
976
  'Idempotency-Key': string;
977
+
978
+ /**
979
+ * Header param: A long write answers 202 with a status link, then lands on X.
980
+ * `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
981
+ * the write is still running then, the API answers 202 with Location. Poll
982
+ * Location until `terminal` is true, and don't send the write again.
983
+ */
984
+ Prefer?: string;
943
985
  }
944
986
 
945
987
  export declare namespace Profile {