x-twitter-scraper 0.1.0 → 0.2.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 (310) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +5 -5
  3. package/client.d.mts +2 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +2 -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/account.d.mts +19 -0
  11. package/resources/account.d.mts.map +1 -1
  12. package/resources/account.d.ts +19 -0
  13. package/resources/account.d.ts.map +1 -1
  14. package/resources/account.js +20 -1
  15. package/resources/account.js.map +1 -1
  16. package/resources/account.mjs +20 -1
  17. package/resources/account.mjs.map +1 -1
  18. package/resources/api-keys.d.mts +20 -0
  19. package/resources/api-keys.d.mts.map +1 -1
  20. package/resources/api-keys.d.ts +20 -0
  21. package/resources/api-keys.d.ts.map +1 -1
  22. package/resources/api-keys.js +20 -3
  23. package/resources/api-keys.js.map +1 -1
  24. package/resources/api-keys.mjs +20 -3
  25. package/resources/api-keys.mjs.map +1 -1
  26. package/resources/compose.d.mts +28 -3
  27. package/resources/compose.d.mts.map +1 -1
  28. package/resources/compose.d.ts +28 -3
  29. package/resources/compose.d.ts.map +1 -1
  30. package/resources/compose.js +9 -0
  31. package/resources/compose.js.map +1 -1
  32. package/resources/compose.mjs +9 -0
  33. package/resources/compose.mjs.map +1 -1
  34. package/resources/credits.d.mts +12 -0
  35. package/resources/credits.d.mts.map +1 -1
  36. package/resources/credits.d.ts +12 -0
  37. package/resources/credits.d.ts.map +1 -1
  38. package/resources/credits.js +12 -0
  39. package/resources/credits.js.map +1 -1
  40. package/resources/credits.mjs +12 -0
  41. package/resources/credits.mjs.map +1 -1
  42. package/resources/drafts.d.mts +33 -0
  43. package/resources/drafts.d.mts.map +1 -1
  44. package/resources/drafts.d.ts +33 -0
  45. package/resources/drafts.d.ts.map +1 -1
  46. package/resources/drafts.js +24 -0
  47. package/resources/drafts.js.map +1 -1
  48. package/resources/drafts.mjs +24 -0
  49. package/resources/drafts.mjs.map +1 -1
  50. package/resources/draws.d.mts +46 -1
  51. package/resources/draws.d.mts.map +1 -1
  52. package/resources/draws.d.ts +46 -1
  53. package/resources/draws.d.ts.map +1 -1
  54. package/resources/draws.js +27 -0
  55. package/resources/draws.js.map +1 -1
  56. package/resources/draws.mjs +27 -0
  57. package/resources/draws.mjs.map +1 -1
  58. package/resources/events.d.mts +25 -1
  59. package/resources/events.d.mts.map +1 -1
  60. package/resources/events.d.ts +25 -1
  61. package/resources/events.d.ts.map +1 -1
  62. package/resources/extractions.d.mts +74 -5
  63. package/resources/extractions.d.mts.map +1 -1
  64. package/resources/extractions.d.ts +74 -5
  65. package/resources/extractions.d.ts.map +1 -1
  66. package/resources/extractions.js +36 -0
  67. package/resources/extractions.js.map +1 -1
  68. package/resources/extractions.mjs +36 -0
  69. package/resources/extractions.mjs.map +1 -1
  70. package/resources/index.d.mts +1 -1
  71. package/resources/index.d.mts.map +1 -1
  72. package/resources/index.d.ts +1 -1
  73. package/resources/index.d.ts.map +1 -1
  74. package/resources/index.js.map +1 -1
  75. package/resources/index.mjs.map +1 -1
  76. package/resources/integrations.d.mts +77 -0
  77. package/resources/integrations.d.mts.map +1 -1
  78. package/resources/integrations.d.ts +77 -0
  79. package/resources/integrations.d.ts.map +1 -1
  80. package/resources/integrations.js +47 -0
  81. package/resources/integrations.js.map +1 -1
  82. package/resources/integrations.mjs +47 -0
  83. package/resources/integrations.mjs.map +1 -1
  84. package/resources/monitors.d.mts +46 -0
  85. package/resources/monitors.d.mts.map +1 -1
  86. package/resources/monitors.d.ts +46 -0
  87. package/resources/monitors.d.ts.map +1 -1
  88. package/resources/monitors.js +31 -0
  89. package/resources/monitors.js.map +1 -1
  90. package/resources/monitors.mjs +31 -0
  91. package/resources/monitors.mjs.map +1 -1
  92. package/resources/radar.d.mts +4 -1
  93. package/resources/radar.d.mts.map +1 -1
  94. package/resources/radar.d.ts +4 -1
  95. package/resources/radar.d.ts.map +1 -1
  96. package/resources/shared.d.mts +12 -0
  97. package/resources/shared.d.mts.map +1 -1
  98. package/resources/shared.d.ts +12 -0
  99. package/resources/shared.d.ts.map +1 -1
  100. package/resources/styles.d.mts +63 -4
  101. package/resources/styles.d.mts.map +1 -1
  102. package/resources/styles.d.ts +63 -4
  103. package/resources/styles.d.ts.map +1 -1
  104. package/resources/styles.js +55 -8
  105. package/resources/styles.js.map +1 -1
  106. package/resources/styles.mjs +55 -8
  107. package/resources/styles.mjs.map +1 -1
  108. package/resources/support/tickets.d.mts +34 -0
  109. package/resources/support/tickets.d.mts.map +1 -1
  110. package/resources/support/tickets.d.ts +34 -0
  111. package/resources/support/tickets.d.ts.map +1 -1
  112. package/resources/support/tickets.js +34 -0
  113. package/resources/support/tickets.js.map +1 -1
  114. package/resources/support/tickets.mjs +34 -0
  115. package/resources/support/tickets.mjs.map +1 -1
  116. package/resources/trends.d.mts +4 -1
  117. package/resources/trends.d.mts.map +1 -1
  118. package/resources/trends.d.ts +4 -1
  119. package/resources/trends.d.ts.map +1 -1
  120. package/resources/trends.js +1 -1
  121. package/resources/trends.mjs +1 -1
  122. package/resources/webhooks.d.mts +54 -0
  123. package/resources/webhooks.d.mts.map +1 -1
  124. package/resources/webhooks.d.ts +54 -0
  125. package/resources/webhooks.d.ts.map +1 -1
  126. package/resources/webhooks.js +36 -0
  127. package/resources/webhooks.js.map +1 -1
  128. package/resources/webhooks.mjs +36 -0
  129. package/resources/webhooks.mjs.map +1 -1
  130. package/resources/x/accounts.d.mts +59 -3
  131. package/resources/x/accounts.d.mts.map +1 -1
  132. package/resources/x/accounts.d.ts +59 -3
  133. package/resources/x/accounts.d.ts.map +1 -1
  134. package/resources/x/accounts.js +55 -5
  135. package/resources/x/accounts.js.map +1 -1
  136. package/resources/x/accounts.mjs +55 -5
  137. package/resources/x/accounts.mjs.map +1 -1
  138. package/resources/x/bookmarks.d.mts +11 -1
  139. package/resources/x/bookmarks.d.mts.map +1 -1
  140. package/resources/x/bookmarks.d.ts +11 -1
  141. package/resources/x/bookmarks.d.ts.map +1 -1
  142. package/resources/x/bookmarks.js +10 -0
  143. package/resources/x/bookmarks.js.map +1 -1
  144. package/resources/x/bookmarks.mjs +10 -0
  145. package/resources/x/bookmarks.mjs.map +1 -1
  146. package/resources/x/communities/communities.d.mts +118 -11
  147. package/resources/x/communities/communities.d.mts.map +1 -1
  148. package/resources/x/communities/communities.d.ts +118 -11
  149. package/resources/x/communities/communities.d.ts.map +1 -1
  150. package/resources/x/communities/communities.js +45 -16
  151. package/resources/x/communities/communities.js.map +1 -1
  152. package/resources/x/communities/communities.mjs +45 -16
  153. package/resources/x/communities/communities.mjs.map +1 -1
  154. package/resources/x/communities/index.d.mts +1 -1
  155. package/resources/x/communities/index.d.mts.map +1 -1
  156. package/resources/x/communities/index.d.ts +1 -1
  157. package/resources/x/communities/index.d.ts.map +1 -1
  158. package/resources/x/communities/index.js.map +1 -1
  159. package/resources/x/communities/index.mjs.map +1 -1
  160. package/resources/x/communities/join.d.mts +18 -2
  161. package/resources/x/communities/join.d.mts.map +1 -1
  162. package/resources/x/communities/join.d.ts +18 -2
  163. package/resources/x/communities/join.d.ts.map +1 -1
  164. package/resources/x/communities/join.js +16 -0
  165. package/resources/x/communities/join.js.map +1 -1
  166. package/resources/x/communities/join.mjs +16 -0
  167. package/resources/x/communities/join.mjs.map +1 -1
  168. package/resources/x/communities/tweets.d.mts +28 -5
  169. package/resources/x/communities/tweets.d.mts.map +1 -1
  170. package/resources/x/communities/tweets.d.ts +28 -5
  171. package/resources/x/communities/tweets.d.ts.map +1 -1
  172. package/resources/x/communities/tweets.js +20 -6
  173. package/resources/x/communities/tweets.js.map +1 -1
  174. package/resources/x/communities/tweets.mjs +20 -6
  175. package/resources/x/communities/tweets.mjs.map +1 -1
  176. package/resources/x/dm.d.mts +19 -2
  177. package/resources/x/dm.d.mts.map +1 -1
  178. package/resources/x/dm.d.ts +19 -2
  179. package/resources/x/dm.d.ts.map +1 -1
  180. package/resources/x/dm.js +17 -0
  181. package/resources/x/dm.js.map +1 -1
  182. package/resources/x/dm.mjs +17 -0
  183. package/resources/x/dm.mjs.map +1 -1
  184. package/resources/x/followers.d.mts +8 -0
  185. package/resources/x/followers.d.mts.map +1 -1
  186. package/resources/x/followers.d.ts +8 -0
  187. package/resources/x/followers.d.ts.map +1 -1
  188. package/resources/x/followers.js +8 -0
  189. package/resources/x/followers.js.map +1 -1
  190. package/resources/x/followers.mjs +8 -0
  191. package/resources/x/followers.mjs.map +1 -1
  192. package/resources/x/index.d.mts +2 -2
  193. package/resources/x/index.d.mts.map +1 -1
  194. package/resources/x/index.d.ts +2 -2
  195. package/resources/x/index.d.ts.map +1 -1
  196. package/resources/x/index.js.map +1 -1
  197. package/resources/x/index.mjs.map +1 -1
  198. package/resources/x/lists.d.mts +27 -6
  199. package/resources/x/lists.d.mts.map +1 -1
  200. package/resources/x/lists.d.ts +27 -6
  201. package/resources/x/lists.d.ts.map +1 -1
  202. package/resources/x/lists.js +23 -16
  203. package/resources/x/lists.js.map +1 -1
  204. package/resources/x/lists.mjs +23 -16
  205. package/resources/x/lists.mjs.map +1 -1
  206. package/resources/x/media.d.mts +17 -1
  207. package/resources/x/media.d.mts.map +1 -1
  208. package/resources/x/media.d.ts +17 -1
  209. package/resources/x/media.d.ts.map +1 -1
  210. package/resources/x/media.js +16 -0
  211. package/resources/x/media.js.map +1 -1
  212. package/resources/x/media.mjs +16 -0
  213. package/resources/x/media.mjs.map +1 -1
  214. package/resources/x/profile.d.mts +30 -3
  215. package/resources/x/profile.d.mts.map +1 -1
  216. package/resources/x/profile.d.ts +30 -3
  217. package/resources/x/profile.d.ts.map +1 -1
  218. package/resources/x/profile.js +27 -0
  219. package/resources/x/profile.js.map +1 -1
  220. package/resources/x/profile.mjs +27 -0
  221. package/resources/x/profile.mjs.map +1 -1
  222. package/resources/x/tweets/like.d.mts +18 -4
  223. package/resources/x/tweets/like.d.mts.map +1 -1
  224. package/resources/x/tweets/like.d.ts +18 -4
  225. package/resources/x/tweets/like.d.ts.map +1 -1
  226. package/resources/x/tweets/like.js +18 -4
  227. package/resources/x/tweets/like.js.map +1 -1
  228. package/resources/x/tweets/like.mjs +18 -4
  229. package/resources/x/tweets/like.mjs.map +1 -1
  230. package/resources/x/tweets/retweet.d.mts +18 -4
  231. package/resources/x/tweets/retweet.d.mts.map +1 -1
  232. package/resources/x/tweets/retweet.d.ts +18 -4
  233. package/resources/x/tweets/retweet.d.ts.map +1 -1
  234. package/resources/x/tweets/retweet.js +18 -4
  235. package/resources/x/tweets/retweet.js.map +1 -1
  236. package/resources/x/tweets/retweet.mjs +18 -4
  237. package/resources/x/tweets/retweet.mjs.map +1 -1
  238. package/resources/x/tweets/tweets.d.mts +146 -15
  239. package/resources/x/tweets/tweets.d.mts.map +1 -1
  240. package/resources/x/tweets/tweets.d.ts +146 -15
  241. package/resources/x/tweets/tweets.d.ts.map +1 -1
  242. package/resources/x/tweets/tweets.js +74 -10
  243. package/resources/x/tweets/tweets.js.map +1 -1
  244. package/resources/x/tweets/tweets.mjs +74 -10
  245. package/resources/x/tweets/tweets.mjs.map +1 -1
  246. package/resources/x/users/follow.d.mts +19 -4
  247. package/resources/x/users/follow.d.mts.map +1 -1
  248. package/resources/x/users/follow.d.ts +19 -4
  249. package/resources/x/users/follow.d.ts.map +1 -1
  250. package/resources/x/users/follow.js +19 -4
  251. package/resources/x/users/follow.js.map +1 -1
  252. package/resources/x/users/follow.mjs +19 -4
  253. package/resources/x/users/follow.mjs.map +1 -1
  254. package/resources/x/users/users.d.mts +94 -21
  255. package/resources/x/users/users.d.mts.map +1 -1
  256. package/resources/x/users/users.d.ts +94 -21
  257. package/resources/x/users/users.d.ts.map +1 -1
  258. package/resources/x/users/users.js +78 -33
  259. package/resources/x/users/users.js.map +1 -1
  260. package/resources/x/users/users.mjs +78 -33
  261. package/resources/x/users/users.mjs.map +1 -1
  262. package/resources/x/x.d.mts +42 -6
  263. package/resources/x/x.d.mts.map +1 -1
  264. package/resources/x/x.d.ts +42 -6
  265. package/resources/x/x.d.ts.map +1 -1
  266. package/resources/x/x.js +21 -5
  267. package/resources/x/x.js.map +1 -1
  268. package/resources/x/x.mjs +21 -5
  269. package/resources/x/x.mjs.map +1 -1
  270. package/src/client.ts +2 -0
  271. package/src/resources/account.ts +20 -1
  272. package/src/resources/api-keys.ts +23 -3
  273. package/src/resources/compose.ts +32 -1
  274. package/src/resources/credits.ts +12 -0
  275. package/src/resources/drafts.ts +33 -0
  276. package/src/resources/draws.ts +46 -1
  277. package/src/resources/events.ts +25 -1
  278. package/src/resources/extractions.ts +74 -5
  279. package/src/resources/index.ts +1 -0
  280. package/src/resources/integrations.ts +77 -0
  281. package/src/resources/monitors.ts +46 -0
  282. package/src/resources/radar.ts +4 -1
  283. package/src/resources/shared.ts +12 -0
  284. package/src/resources/styles.ts +67 -8
  285. package/src/resources/support/tickets.ts +34 -0
  286. package/src/resources/trends.ts +4 -1
  287. package/src/resources/webhooks.ts +54 -0
  288. package/src/resources/x/accounts.ts +72 -7
  289. package/src/resources/x/bookmarks.ts +11 -1
  290. package/src/resources/x/communities/communities.ts +142 -26
  291. package/src/resources/x/communities/index.ts +1 -1
  292. package/src/resources/x/communities/join.ts +18 -2
  293. package/src/resources/x/communities/tweets.ts +41 -11
  294. package/src/resources/x/dm.ts +19 -2
  295. package/src/resources/x/followers.ts +8 -0
  296. package/src/resources/x/index.ts +2 -0
  297. package/src/resources/x/lists.ts +30 -22
  298. package/src/resources/x/media.ts +17 -1
  299. package/src/resources/x/profile.ts +30 -3
  300. package/src/resources/x/tweets/like.ts +20 -6
  301. package/src/resources/x/tweets/retweet.ts +20 -14
  302. package/src/resources/x/tweets/tweets.ts +157 -27
  303. package/src/resources/x/users/follow.ts +21 -10
  304. package/src/resources/x/users/users.ts +103 -52
  305. package/src/resources/x/x.ts +50 -8
  306. package/src/version.ts +1 -1
  307. package/version.d.mts +1 -1
  308. package/version.d.ts +1 -1
  309. package/version.js +1 -1
  310. package/version.mjs +1 -1
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
+ import * as Shared from '../../shared';
4
5
  import * as JoinAPI from './join';
5
6
  import { Join, JoinCreateParams, JoinDeleteAllParams } from './join';
6
7
  import * as TweetsAPI from './tweets';
7
- import { TweetListParams, Tweets } from './tweets';
8
+ import { TweetListByCommunityParams, TweetListParams, Tweets } from './tweets';
8
9
  import { APIPromise } from '../../../core/api-promise';
9
- import { buildHeaders } from '../../../internal/headers';
10
10
  import { RequestOptions } from '../../../internal/request-options';
11
11
  import { path } from '../../../internal/utils/path';
12
12
 
@@ -16,6 +16,15 @@ export class Communities extends APIResource {
16
16
 
17
17
  /**
18
18
  * Create community
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const community = await client.x.communities.create({
23
+ * account: '@elonmusk',
24
+ * name: 'Example Name',
25
+ * description: 'A community for Tesla enthusiasts',
26
+ * });
27
+ * ```
19
28
  */
20
29
  create(body: CommunityCreateParams, options?: RequestOptions): APIPromise<CommunityCreateResponse> {
21
30
  return this._client.post('/x/communities', { body, ...options });
@@ -23,6 +32,14 @@ export class Communities extends APIResource {
23
32
 
24
33
  /**
25
34
  * Delete community
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * const community = await client.x.communities.delete('id', {
39
+ * account: '@elonmusk',
40
+ * community_name: 'Tesla Fans',
41
+ * });
42
+ * ```
26
43
  */
27
44
  delete(
28
45
  id: string,
@@ -34,6 +51,13 @@ export class Communities extends APIResource {
34
51
 
35
52
  /**
36
53
  * Get community details
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const response = await client.x.communities.retrieveInfo(
58
+ * 'id',
59
+ * );
60
+ * ```
37
61
  */
38
62
  retrieveInfo(id: string, options?: RequestOptions): APIPromise<CommunityRetrieveInfoResponse> {
39
63
  return this._client.get(path`/x/communities/${id}/info`, options);
@@ -41,46 +65,58 @@ export class Communities extends APIResource {
41
65
 
42
66
  /**
43
67
  * Get community members
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const paginatedUsers =
72
+ * await client.x.communities.retrieveMembers('id');
73
+ * ```
44
74
  */
45
75
  retrieveMembers(
46
76
  id: string,
47
77
  query: CommunityRetrieveMembersParams | null | undefined = {},
48
78
  options?: RequestOptions,
49
- ): APIPromise<void> {
50
- return this._client.get(path`/x/communities/${id}/members`, {
51
- query,
52
- ...options,
53
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
54
- });
79
+ ): APIPromise<Shared.PaginatedUsers> {
80
+ return this._client.get(path`/x/communities/${id}/members`, { query, ...options });
55
81
  }
56
82
 
57
83
  /**
58
84
  * Get community moderators
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const paginatedUsers =
89
+ * await client.x.communities.retrieveModerators('id');
90
+ * ```
59
91
  */
60
92
  retrieveModerators(
61
93
  id: string,
62
94
  query: CommunityRetrieveModeratorsParams | null | undefined = {},
63
95
  options?: RequestOptions,
64
- ): APIPromise<void> {
65
- return this._client.get(path`/x/communities/${id}/moderators`, {
66
- query,
67
- ...options,
68
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
69
- });
96
+ ): APIPromise<Shared.PaginatedUsers> {
97
+ return this._client.get(path`/x/communities/${id}/moderators`, { query, ...options });
70
98
  }
71
99
 
72
100
  /**
73
101
  * Search tweets across communities
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * const paginatedTweets =
106
+ * await client.x.communities.retrieveSearch({ q: 'q' });
107
+ * ```
74
108
  */
75
- retrieveSearch(query: CommunityRetrieveSearchParams, options?: RequestOptions): APIPromise<void> {
76
- return this._client.get('/x/communities/search', {
77
- query,
78
- ...options,
79
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
80
- });
109
+ retrieveSearch(
110
+ query: CommunityRetrieveSearchParams,
111
+ options?: RequestOptions,
112
+ ): APIPromise<Shared.PaginatedTweets> {
113
+ return this._client.get('/x/communities/search', { query, ...options });
81
114
  }
82
115
  }
83
116
 
117
+ /**
118
+ * Result of a community join or leave action.
119
+ */
84
120
  export interface CommunityActionResult {
85
121
  communityId: string;
86
122
 
@@ -105,12 +141,88 @@ export interface CommunityRetrieveInfoResponse {
105
141
  /**
106
142
  * Community info object
107
143
  */
108
- community: unknown;
144
+ community: CommunityRetrieveInfoResponse.Community;
145
+ }
146
+
147
+ export namespace CommunityRetrieveInfoResponse {
148
+ /**
149
+ * Community info object
150
+ */
151
+ export interface Community {
152
+ /**
153
+ * Unique community identifier
154
+ */
155
+ id: string;
156
+
157
+ /**
158
+ * Community banner image URL
159
+ */
160
+ banner_url?: string;
161
+
162
+ /**
163
+ * Community creation timestamp
164
+ */
165
+ created_at?: string;
166
+
167
+ /**
168
+ * About text for the community
169
+ */
170
+ description?: string;
171
+
172
+ /**
173
+ * Join policy (open or restricted)
174
+ */
175
+ join_policy?: string;
176
+
177
+ /**
178
+ * Total member count
179
+ */
180
+ member_count?: number;
181
+
182
+ /**
183
+ * Total moderator count
184
+ */
185
+ moderator_count?: number;
186
+
187
+ /**
188
+ * Display name of the community
189
+ */
190
+ name?: string;
191
+
192
+ /**
193
+ * Primary topic
194
+ */
195
+ primary_topic?: Community.PrimaryTopic;
196
+
197
+ /**
198
+ * Community rules
199
+ */
200
+ rules?: Array<Community.Rule>;
201
+ }
202
+
203
+ export namespace Community {
204
+ /**
205
+ * Primary topic
206
+ */
207
+ export interface PrimaryTopic {
208
+ id?: string;
209
+
210
+ name?: string;
211
+ }
212
+
213
+ export interface Rule {
214
+ id?: string;
215
+
216
+ description?: string;
217
+
218
+ name?: string;
219
+ }
220
+ }
109
221
  }
110
222
 
111
223
  export interface CommunityCreateParams {
112
224
  /**
113
- * X account (@username or account ID)
225
+ * X account (@username or ID) creating the community
114
226
  */
115
227
  account: string;
116
228
 
@@ -127,7 +239,7 @@ export interface CommunityCreateParams {
127
239
 
128
240
  export interface CommunityDeleteParams {
129
241
  /**
130
- * X account (@username or account ID)
242
+ * X account (@username or ID) deleting the community
131
243
  */
132
244
  account: string;
133
245
 
@@ -146,7 +258,7 @@ export interface CommunityRetrieveMembersParams {
146
258
 
147
259
  export interface CommunityRetrieveModeratorsParams {
148
260
  /**
149
- * Pagination cursor
261
+ * Pagination cursor for community moderators
150
262
  */
151
263
  cursor?: string;
152
264
  }
@@ -158,7 +270,7 @@ export interface CommunityRetrieveSearchParams {
158
270
  q: string;
159
271
 
160
272
  /**
161
- * Pagination cursor
273
+ * Pagination cursor for community search
162
274
  */
163
275
  cursor?: string;
164
276
 
@@ -190,5 +302,9 @@ export declare namespace Communities {
190
302
  type JoinDeleteAllParams as JoinDeleteAllParams,
191
303
  };
192
304
 
193
- export { Tweets as Tweets, type TweetListParams as TweetListParams };
305
+ export {
306
+ Tweets as Tweets,
307
+ type TweetListParams as TweetListParams,
308
+ type TweetListByCommunityParams as TweetListByCommunityParams,
309
+ };
194
310
  }
@@ -13,4 +13,4 @@ export {
13
13
  type CommunityRetrieveSearchParams,
14
14
  } from './communities';
15
15
  export { Join, type JoinCreateParams, type JoinDeleteAllParams } from './join';
16
- export { Tweets, type TweetListParams } from './tweets';
16
+ export { Tweets, type TweetListParams, type TweetListByCommunityParams } from './tweets';
@@ -12,6 +12,14 @@ import { path } from '../../../internal/utils/path';
12
12
  export class Join extends APIResource {
13
13
  /**
14
14
  * Join community
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const communityActionResult =
19
+ * await client.x.communities.join.create('id', {
20
+ * account: '@elonmusk',
21
+ * });
22
+ * ```
15
23
  */
16
24
  create(
17
25
  id: string,
@@ -23,6 +31,14 @@ export class Join extends APIResource {
23
31
 
24
32
  /**
25
33
  * Leave community
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const communityActionResult =
38
+ * await client.x.communities.join.deleteAll('id', {
39
+ * account: '@elonmusk',
40
+ * });
41
+ * ```
26
42
  */
27
43
  deleteAll(
28
44
  id: string,
@@ -35,14 +51,14 @@ export class Join extends APIResource {
35
51
 
36
52
  export interface JoinCreateParams {
37
53
  /**
38
- * X account (@username or account ID)
54
+ * X account identifier (@username or account ID)
39
55
  */
40
56
  account: string;
41
57
  }
42
58
 
43
59
  export interface JoinDeleteAllParams {
44
60
  /**
45
- * X account (@username or account ID)
61
+ * X account identifier (@username or account ID)
46
62
  */
47
63
  account: string;
48
64
  }
@@ -1,9 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
+ import * as Shared from '../../shared';
4
5
  import { APIPromise } from '../../../core/api-promise';
5
- import { buildHeaders } from '../../../internal/headers';
6
6
  import { RequestOptions } from '../../../internal/request-options';
7
+ import { path } from '../../../internal/utils/path';
7
8
 
8
9
  /**
9
10
  * X data lookups (subscription required)
@@ -11,33 +12,62 @@ import { RequestOptions } from '../../../internal/request-options';
11
12
  export class Tweets extends APIResource {
12
13
  /**
13
14
  * Search tweets across all communities
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const paginatedTweets =
19
+ * await client.x.communities.tweets.list({ q: 'q' });
20
+ * ```
14
21
  */
15
- list(query: TweetListParams, options?: RequestOptions): APIPromise<void> {
16
- return this._client.get('/x/communities/tweets', {
17
- query,
18
- ...options,
19
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
20
- });
22
+ list(query: TweetListParams, options?: RequestOptions): APIPromise<Shared.PaginatedTweets> {
23
+ return this._client.get('/x/communities/tweets', { query, ...options });
24
+ }
25
+
26
+ /**
27
+ * Get community tweets
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const paginatedTweets =
32
+ * await client.x.communities.tweets.listByCommunity('id');
33
+ * ```
34
+ */
35
+ listByCommunity(
36
+ id: string,
37
+ query: TweetListByCommunityParams | null | undefined = {},
38
+ options?: RequestOptions,
39
+ ): APIPromise<Shared.PaginatedTweets> {
40
+ return this._client.get(path`/x/communities/${id}/tweets`, { query, ...options });
21
41
  }
22
42
  }
23
43
 
24
44
  export interface TweetListParams {
25
45
  /**
26
- * Search query
46
+ * Search query for cross-community tweets
27
47
  */
28
48
  q: string;
29
49
 
30
50
  /**
31
- * Pagination cursor
51
+ * Pagination cursor for cross-community results
32
52
  */
33
53
  cursor?: string;
34
54
 
35
55
  /**
36
- * Sort order (Latest or Top)
56
+ * Sort order for cross-community results (Latest or Top)
37
57
  */
38
58
  queryType?: string;
39
59
  }
40
60
 
61
+ export interface TweetListByCommunityParams {
62
+ /**
63
+ * Pagination cursor for community tweets
64
+ */
65
+ cursor?: string;
66
+ }
67
+
41
68
  export declare namespace Tweets {
42
- export { type TweetListParams as TweetListParams };
69
+ export {
70
+ type TweetListParams as TweetListParams,
71
+ type TweetListByCommunityParams as TweetListByCommunityParams,
72
+ };
43
73
  }
@@ -8,6 +8,13 @@ import { path } from '../../internal/utils/path';
8
8
  export class Dm extends APIResource {
9
9
  /**
10
10
  * Get DM conversation history
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const response = await client.x.dm.retrieveHistory(
15
+ * 'userId',
16
+ * );
17
+ * ```
11
18
  */
12
19
  retrieveHistory(
13
20
  userID: string,
@@ -19,6 +26,16 @@ export class Dm extends APIResource {
19
26
 
20
27
  /**
21
28
  * Send direct message
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.x.dm.send('userId', {
33
+ * account: '@elonmusk',
34
+ * text: 'Example text content',
35
+ * media_ids: ['1234567890123456789'],
36
+ * reply_to_message_id: '1234567890123456789',
37
+ * });
38
+ * ```
22
39
  */
23
40
  send(userID: string, body: DmSendParams, options?: RequestOptions): APIPromise<DmSendResponse> {
24
41
  return this._client.post(path`/x/dm/${userID}`, { body, ...options });
@@ -55,7 +72,7 @@ export interface DmSendResponse {
55
72
 
56
73
  export interface DmRetrieveHistoryParams {
57
74
  /**
58
- * Pagination cursor from previous response
75
+ * Pagination cursor for DM history
59
76
  */
60
77
  cursor?: string;
61
78
 
@@ -67,7 +84,7 @@ export interface DmRetrieveHistoryParams {
67
84
 
68
85
  export interface DmSendParams {
69
86
  /**
70
- * X account (@username or account ID)
87
+ * X account (@username or ID) sending the DM
71
88
  */
72
89
  account: string;
73
90
 
@@ -10,6 +10,14 @@ import { RequestOptions } from '../../internal/request-options';
10
10
  export class Followers extends APIResource {
11
11
  /**
12
12
  * Check follow relationship
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const response = await client.x.followers.check({
17
+ * source: 'source',
18
+ * target: 'target',
19
+ * });
20
+ * ```
13
21
  */
14
22
  check(query: FollowerCheckParams, options?: RequestOptions): APIPromise<FollowerCheckResponse> {
15
23
  return this._client.get('/x/followers/check', { query, ...options });
@@ -7,6 +7,7 @@ export {
7
7
  type AccountCreateResponse,
8
8
  type AccountListResponse,
9
9
  type AccountDeleteResponse,
10
+ type AccountBulkRetryResponse,
10
11
  type AccountReauthResponse,
11
12
  type AccountCreateParams,
12
13
  type AccountReauthParams,
@@ -90,6 +91,7 @@ export {
90
91
  X,
91
92
  type XGetArticleResponse,
92
93
  type XGetNotificationsResponse,
94
+ type XGetTrendsResponse,
93
95
  type XGetHomeTimelineParams,
94
96
  type XGetNotificationsParams,
95
97
  } from './x';
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as Shared from '../shared';
4
5
  import { APIPromise } from '../../core/api-promise';
5
- import { buildHeaders } from '../../internal/headers';
6
6
  import { RequestOptions } from '../../internal/request-options';
7
7
  import { path } from '../../internal/utils/path';
8
8
 
@@ -12,67 +12,75 @@ import { path } from '../../internal/utils/path';
12
12
  export class Lists extends APIResource {
13
13
  /**
14
14
  * Get list followers
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const paginatedUsers =
19
+ * await client.x.lists.retrieveFollowers('id');
20
+ * ```
15
21
  */
16
22
  retrieveFollowers(
17
23
  id: string,
18
24
  query: ListRetrieveFollowersParams | null | undefined = {},
19
25
  options?: RequestOptions,
20
- ): APIPromise<void> {
21
- return this._client.get(path`/x/lists/${id}/followers`, {
22
- query,
23
- ...options,
24
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
25
- });
26
+ ): APIPromise<Shared.PaginatedUsers> {
27
+ return this._client.get(path`/x/lists/${id}/followers`, { query, ...options });
26
28
  }
27
29
 
28
30
  /**
29
31
  * Get list members
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const paginatedUsers = await client.x.lists.retrieveMembers(
36
+ * 'id',
37
+ * );
38
+ * ```
30
39
  */
31
40
  retrieveMembers(
32
41
  id: string,
33
42
  query: ListRetrieveMembersParams | null | undefined = {},
34
43
  options?: RequestOptions,
35
- ): APIPromise<void> {
36
- return this._client.get(path`/x/lists/${id}/members`, {
37
- query,
38
- ...options,
39
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
40
- });
44
+ ): APIPromise<Shared.PaginatedUsers> {
45
+ return this._client.get(path`/x/lists/${id}/members`, { query, ...options });
41
46
  }
42
47
 
43
48
  /**
44
49
  * Get list tweets
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const paginatedTweets = await client.x.lists.retrieveTweets(
54
+ * 'id',
55
+ * );
56
+ * ```
45
57
  */
46
58
  retrieveTweets(
47
59
  id: string,
48
60
  query: ListRetrieveTweetsParams | null | undefined = {},
49
61
  options?: RequestOptions,
50
- ): APIPromise<void> {
51
- return this._client.get(path`/x/lists/${id}/tweets`, {
52
- query,
53
- ...options,
54
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
55
- });
62
+ ): APIPromise<Shared.PaginatedTweets> {
63
+ return this._client.get(path`/x/lists/${id}/tweets`, { query, ...options });
56
64
  }
57
65
  }
58
66
 
59
67
  export interface ListRetrieveFollowersParams {
60
68
  /**
61
- * Pagination cursor
69
+ * Pagination cursor for list followers
62
70
  */
63
71
  cursor?: string;
64
72
  }
65
73
 
66
74
  export interface ListRetrieveMembersParams {
67
75
  /**
68
- * Pagination cursor
76
+ * Pagination cursor for list members
69
77
  */
70
78
  cursor?: string;
71
79
  }
72
80
 
73
81
  export interface ListRetrieveTweetsParams {
74
82
  /**
75
- * Pagination cursor
83
+ * Pagination cursor for list tweets
76
84
  */
77
85
  cursor?: string;
78
86
 
@@ -12,6 +12,13 @@ import { multipartFormRequestOptions } from '../../internal/uploads';
12
12
  export class Media extends APIResource {
13
13
  /**
14
14
  * Download tweet media
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const response = await client.x.media.download({
19
+ * tweetInput: 'https://x.com/elonmusk/status/1234567890',
20
+ * });
21
+ * ```
15
22
  */
16
23
  download(body: MediaDownloadParams, options?: RequestOptions): APIPromise<MediaDownloadResponse> {
17
24
  return this._client.post('/x/media/download', { body, ...options });
@@ -19,6 +26,15 @@ export class Media extends APIResource {
19
26
 
20
27
  /**
21
28
  * Upload media
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.x.media.upload({
33
+ * account: '@elonmusk',
34
+ * file: fs.createReadStream('path/to/file'),
35
+ * is_long_video: true,
36
+ * });
37
+ * ```
22
38
  */
23
39
  upload(body: MediaUploadParams, options?: RequestOptions): APIPromise<MediaUploadResponse> {
24
40
  return this._client.post('/x/media', multipartFormRequestOptions({ body, ...options }, this._client));
@@ -57,7 +73,7 @@ export interface MediaDownloadParams {
57
73
 
58
74
  export interface MediaUploadParams {
59
75
  /**
60
- * X account (@username or account ID)
76
+ * X account (@username or ID) uploading media
61
77
  */
62
78
  account: string;
63
79
 
@@ -12,6 +12,17 @@ import { multipartFormRequestOptions } from '../../internal/uploads';
12
12
  export class Profile extends APIResource {
13
13
  /**
14
14
  * Update X profile
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const profile = await client.x.profile.update({
19
+ * account: '@elonmusk',
20
+ * description: 'description_value',
21
+ * location: 'location_value',
22
+ * name: 'Example Name',
23
+ * url: 'https://xquik.com/example',
24
+ * });
25
+ * ```
15
26
  */
16
27
  update(body: ProfileUpdateParams, options?: RequestOptions): APIPromise<ProfileUpdateResponse> {
17
28
  return this._client.patch('/x/profile', { body, ...options });
@@ -19,6 +30,14 @@ export class Profile extends APIResource {
19
30
 
20
31
  /**
21
32
  * Update profile avatar
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const response = await client.x.profile.updateAvatar({
37
+ * account: '@elonmusk',
38
+ * file: fs.createReadStream('path/to/file'),
39
+ * });
40
+ * ```
22
41
  */
23
42
  updateAvatar(
24
43
  body: ProfileUpdateAvatarParams,
@@ -32,6 +51,14 @@ export class Profile extends APIResource {
32
51
 
33
52
  /**
34
53
  * Update profile banner
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const response = await client.x.profile.updateBanner({
58
+ * account: '@elonmusk',
59
+ * file: fs.createReadStream('path/to/file'),
60
+ * });
61
+ * ```
35
62
  */
36
63
  updateBanner(
37
64
  body: ProfileUpdateBannerParams,
@@ -58,7 +85,7 @@ export interface ProfileUpdateBannerResponse {
58
85
 
59
86
  export interface ProfileUpdateParams {
60
87
  /**
61
- * X account (@username or account ID)
88
+ * X account (@username or ID) to update profile
62
89
  */
63
90
  account: string;
64
91
 
@@ -82,7 +109,7 @@ export interface ProfileUpdateParams {
82
109
 
83
110
  export interface ProfileUpdateAvatarParams {
84
111
  /**
85
- * X account (@username or account ID)
112
+ * X account (@username or ID) for avatar update
86
113
  */
87
114
  account: string;
88
115
 
@@ -94,7 +121,7 @@ export interface ProfileUpdateAvatarParams {
94
121
 
95
122
  export interface ProfileUpdateBannerParams {
96
123
  /**
97
- * X account (@username or account ID)
124
+ * X account (@username or ID) for banner update
98
125
  */
99
126
  account: string;
100
127