x-twitter-scraper 0.1.0 → 0.2.1

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 +31 -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
@@ -12,20 +12,42 @@ import { path } from '../internal/utils/path';
12
12
  export class Styles extends APIResource {
13
13
  /**
14
14
  * Get cached style profile
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const styleProfile = await client.styles.retrieve('id');
19
+ * ```
15
20
  */
16
- retrieve(username: string, options?: RequestOptions): APIPromise<StyleProfile> {
17
- return this._client.get(path`/styles/${username}`, options);
21
+ retrieve(id: string, options?: RequestOptions): APIPromise<StyleProfile> {
22
+ return this._client.get(path`/styles/${id}`, options);
18
23
  }
19
24
 
20
25
  /**
21
26
  * Save style profile with custom tweets
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const styleProfile = await client.styles.update('id', {
31
+ * label: 'Professional Voice',
32
+ * tweets: [
33
+ * {
34
+ * text: 'Excited to share our latest research findings.',
35
+ * },
36
+ * ],
37
+ * });
38
+ * ```
22
39
  */
23
- update(username: string, body: StyleUpdateParams, options?: RequestOptions): APIPromise<StyleProfile> {
24
- return this._client.put(path`/styles/${username}`, { body, ...options });
40
+ update(id: string, body: StyleUpdateParams, options?: RequestOptions): APIPromise<StyleProfile> {
41
+ return this._client.put(path`/styles/${id}`, { body, ...options });
25
42
  }
26
43
 
27
44
  /**
28
45
  * List cached style profiles
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const styles = await client.styles.list();
50
+ * ```
29
51
  */
30
52
  list(options?: RequestOptions): APIPromise<StyleListResponse> {
31
53
  return this._client.get('/styles', options);
@@ -33,9 +55,14 @@ export class Styles extends APIResource {
33
55
 
34
56
  /**
35
57
  * Delete a style profile
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * await client.styles.delete('id');
62
+ * ```
36
63
  */
37
- delete(username: string, options?: RequestOptions): APIPromise<void> {
38
- return this._client.delete(path`/styles/${username}`, {
64
+ delete(id: string, options?: RequestOptions): APIPromise<void> {
65
+ return this._client.delete(path`/styles/${id}`, {
39
66
  ...options,
40
67
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
41
68
  });
@@ -43,6 +70,13 @@ export class Styles extends APIResource {
43
70
 
44
71
  /**
45
72
  * Analyze writing style from recent tweets
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * const styleProfile = await client.styles.analyze({
77
+ * username: 'elonmusk',
78
+ * });
79
+ * ```
46
80
  */
47
81
  analyze(body: StyleAnalyzeParams, options?: RequestOptions): APIPromise<StyleProfile> {
48
82
  return this._client.post('/styles', { body, ...options });
@@ -50,6 +84,14 @@ export class Styles extends APIResource {
50
84
 
51
85
  /**
52
86
  * Compare two style profiles
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const response = await client.styles.compare({
91
+ * username1: 'username1',
92
+ * username2: 'username2',
93
+ * });
94
+ * ```
53
95
  */
54
96
  compare(query: StyleCompareParams, options?: RequestOptions): APIPromise<StyleCompareResponse> {
55
97
  return this._client.get('/styles/compare', { query, ...options });
@@ -57,12 +99,20 @@ export class Styles extends APIResource {
57
99
 
58
100
  /**
59
101
  * Get engagement metrics for style tweets
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * const response = await client.styles.getPerformance('id');
106
+ * ```
60
107
  */
61
- getPerformance(username: string, options?: RequestOptions): APIPromise<StyleGetPerformanceResponse> {
62
- return this._client.get(path`/styles/${username}/performance`, options);
108
+ getPerformance(id: string, options?: RequestOptions): APIPromise<StyleGetPerformanceResponse> {
109
+ return this._client.get(path`/styles/${id}/performance`, options);
63
110
  }
64
111
  }
65
112
 
113
+ /**
114
+ * Full style profile with sampled tweets used for tone analysis.
115
+ */
66
116
  export interface StyleProfile {
67
117
  fetchedAt: string;
68
118
 
@@ -87,6 +137,9 @@ export namespace StyleProfile {
87
137
  }
88
138
  }
89
139
 
140
+ /**
141
+ * Style profile summary with tweet count and ownership flag.
142
+ */
90
143
  export interface StyleProfileSummary {
91
144
  fetchedAt: string;
92
145
 
@@ -102,8 +155,14 @@ export interface StyleListResponse {
102
155
  }
103
156
 
104
157
  export interface StyleCompareResponse {
158
+ /**
159
+ * Full style profile with sampled tweets used for tone analysis.
160
+ */
105
161
  style1: StyleProfile;
106
162
 
163
+ /**
164
+ * Full style profile with sampled tweets used for tone analysis.
165
+ */
107
166
  style2: StyleProfile;
108
167
  }
109
168
 
@@ -11,6 +11,14 @@ import { path } from '../../internal/utils/path';
11
11
  export class Tickets extends APIResource {
12
12
  /**
13
13
  * Create a support ticket
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const ticket = await client.support.tickets.create({
18
+ * body: 'I am unable to connect my X account. Please help.',
19
+ * subject: 'Cannot connect X account',
20
+ * });
21
+ * ```
14
22
  */
15
23
  create(body: TicketCreateParams, options?: RequestOptions): APIPromise<TicketCreateResponse> {
16
24
  return this._client.post('/support/tickets', { body, ...options });
@@ -18,6 +26,13 @@ export class Tickets extends APIResource {
18
26
 
19
27
  /**
20
28
  * Get ticket with all messages
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const ticket = await client.support.tickets.retrieve(
33
+ * 'messages_value',
34
+ * );
35
+ * ```
21
36
  */
22
37
  retrieve(id: string, options?: RequestOptions): APIPromise<TicketRetrieveResponse> {
23
38
  return this._client.get(path`/support/tickets/${id}`, options);
@@ -25,6 +40,13 @@ export class Tickets extends APIResource {
25
40
 
26
41
  /**
27
42
  * Update ticket status
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const ticket = await client.support.tickets.update('id', {
47
+ * status: 'resolved',
48
+ * });
49
+ * ```
28
50
  */
29
51
  update(id: string, body: TicketUpdateParams, options?: RequestOptions): APIPromise<TicketUpdateResponse> {
30
52
  return this._client.patch(path`/support/tickets/${id}`, { body, ...options });
@@ -32,6 +54,11 @@ export class Tickets extends APIResource {
32
54
 
33
55
  /**
34
56
  * List user's support tickets
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const tickets = await client.support.tickets.list();
61
+ * ```
35
62
  */
36
63
  list(options?: RequestOptions): APIPromise<TicketListResponse> {
37
64
  return this._client.get('/support/tickets', options);
@@ -39,6 +66,13 @@ export class Tickets extends APIResource {
39
66
 
40
67
  /**
41
68
  * Reply to a support ticket
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const response = await client.support.tickets.reply('id', {
73
+ * body: 'Thank you for the update.',
74
+ * });
75
+ * ```
42
76
  */
43
77
  reply(id: string, body: TicketReplyParams, options?: RequestOptions): APIPromise<TicketReplyResponse> {
44
78
  return this._client.post(path`/support/tickets/${id}/messages`, { body, ...options });
@@ -9,7 +9,7 @@ import { RequestOptions } from '../internal/request-options';
9
9
  */
10
10
  export class Trends extends APIResource {
11
11
  /**
12
- * Get trending topics
12
+ * Get regional trending topics
13
13
  */
14
14
  list(
15
15
  query: TrendListParams | null | undefined = {},
@@ -40,6 +40,9 @@ export namespace TrendListResponse {
40
40
  }
41
41
 
42
42
  export interface TrendListParams {
43
+ /**
44
+ * Number of trending topics to return (1-50, default 30)
45
+ */
43
46
  count?: number;
44
47
 
45
48
  /**
@@ -12,6 +12,14 @@ import { path } from '../internal/utils/path';
12
12
  export class Webhooks extends APIResource {
13
13
  /**
14
14
  * Create webhook
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const webhook = await client.webhooks.create({
19
+ * eventTypes: ['tweet.new', 'follower.gained'],
20
+ * url: 'https://example.com/webhook',
21
+ * });
22
+ * ```
15
23
  */
16
24
  create(body: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse> {
17
25
  return this._client.post('/webhooks', { body, ...options });
@@ -19,6 +27,14 @@ export class Webhooks extends APIResource {
19
27
 
20
28
  /**
21
29
  * Update webhook
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const webhook = await client.webhooks.update('id', {
34
+ * isActive: true,
35
+ * url: 'https://example.com/webhook',
36
+ * });
37
+ * ```
22
38
  */
23
39
  update(id: string, body: WebhookUpdateParams, options?: RequestOptions): APIPromise<Webhook> {
24
40
  return this._client.patch(path`/webhooks/${id}`, { body, ...options });
@@ -26,6 +42,11 @@ export class Webhooks extends APIResource {
26
42
 
27
43
  /**
28
44
  * List webhooks
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const webhooks = await client.webhooks.list();
49
+ * ```
29
50
  */
30
51
  list(options?: RequestOptions): APIPromise<WebhookListResponse> {
31
52
  return this._client.get('/webhooks', options);
@@ -33,6 +54,11 @@ export class Webhooks extends APIResource {
33
54
 
34
55
  /**
35
56
  * Deactivate webhook
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * const response = await client.webhooks.deactivate('id');
61
+ * ```
36
62
  */
37
63
  deactivate(id: string, options?: RequestOptions): APIPromise<WebhookDeactivateResponse> {
38
64
  return this._client.delete(path`/webhooks/${id}`, options);
@@ -40,6 +66,11 @@ export class Webhooks extends APIResource {
40
66
 
41
67
  /**
42
68
  * List webhook deliveries
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const response = await client.webhooks.listDeliveries('id');
73
+ * ```
43
74
  */
44
75
  listDeliveries(id: string, options?: RequestOptions): APIPromise<WebhookListDeliveriesResponse> {
45
76
  return this._client.get(path`/webhooks/${id}/deliveries`, options);
@@ -47,12 +78,20 @@ export class Webhooks extends APIResource {
47
78
 
48
79
  /**
49
80
  * Test webhook endpoint
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const response = await client.webhooks.test('id');
85
+ * ```
50
86
  */
51
87
  test(id: string, options?: RequestOptions): APIPromise<WebhookTestResponse> {
52
88
  return this._client.post(path`/webhooks/${id}/test`, options);
53
89
  }
54
90
  }
55
91
 
92
+ /**
93
+ * Webhook delivery attempt record with status and retry count.
94
+ */
56
95
  export interface Delivery {
57
96
  id: string;
58
97
 
@@ -71,11 +110,17 @@ export interface Delivery {
71
110
  lastStatusCode?: number;
72
111
  }
73
112
 
113
+ /**
114
+ * Webhook endpoint registered to receive event deliveries.
115
+ */
74
116
  export interface Webhook {
75
117
  id: string;
76
118
 
77
119
  createdAt: string;
78
120
 
121
+ /**
122
+ * Array of event types to subscribe to.
123
+ */
79
124
  eventTypes: Array<Shared.EventType>;
80
125
 
81
126
  isActive: boolean;
@@ -88,6 +133,9 @@ export interface WebhookCreateResponse {
88
133
 
89
134
  createdAt: string;
90
135
 
136
+ /**
137
+ * Array of event types to subscribe to.
138
+ */
91
139
  eventTypes: Array<Shared.EventType>;
92
140
 
93
141
  secret: string;
@@ -116,6 +164,9 @@ export interface WebhookTestResponse {
116
164
  }
117
165
 
118
166
  export interface WebhookCreateParams {
167
+ /**
168
+ * Array of event types to subscribe to.
169
+ */
119
170
  eventTypes: Array<Shared.EventType>;
120
171
 
121
172
  /**
@@ -125,6 +176,9 @@ export interface WebhookCreateParams {
125
176
  }
126
177
 
127
178
  export interface WebhookUpdateParams {
179
+ /**
180
+ * Array of event types to subscribe to.
181
+ */
128
182
  eventTypes?: Array<Shared.EventType>;
129
183
 
130
184
  isActive?: boolean;
@@ -11,40 +11,94 @@ import { path } from '../../internal/utils/path';
11
11
  export class Accounts extends APIResource {
12
12
  /**
13
13
  * Connect X account
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const account = await client.x.accounts.create({
18
+ * email: 'user@example.com',
19
+ * password: 's3cur3Pa$$w0rd',
20
+ * username: 'elonmusk',
21
+ * });
22
+ * ```
14
23
  */
15
24
  create(body: AccountCreateParams, options?: RequestOptions): APIPromise<AccountCreateResponse> {
16
- return this._client.post('/x/accounts', { body, ...options, __security: {} });
25
+ return this._client.post('/x/accounts', { body, ...options, __security: { apiKeyAuth: true } });
17
26
  }
18
27
 
19
28
  /**
20
29
  * Get X account details
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const xAccountDetail = await client.x.accounts.retrieve(
34
+ * 'id',
35
+ * );
36
+ * ```
21
37
  */
22
38
  retrieve(id: string, options?: RequestOptions): APIPromise<XAccountDetail> {
23
- return this._client.get(path`/x/accounts/${id}`, { ...options, __security: {} });
39
+ return this._client.get(path`/x/accounts/${id}`, { ...options, __security: { apiKeyAuth: true } });
24
40
  }
25
41
 
26
42
  /**
27
43
  * List connected X accounts
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const accounts = await client.x.accounts.list();
48
+ * ```
28
49
  */
29
50
  list(options?: RequestOptions): APIPromise<AccountListResponse> {
30
- return this._client.get('/x/accounts', { ...options, __security: {} });
51
+ return this._client.get('/x/accounts', { ...options, __security: { apiKeyAuth: true } });
31
52
  }
32
53
 
33
54
  /**
34
55
  * Disconnect X account
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const account = await client.x.accounts.delete('id');
60
+ * ```
35
61
  */
36
62
  delete(id: string, options?: RequestOptions): APIPromise<AccountDeleteResponse> {
37
- return this._client.delete(path`/x/accounts/${id}`, { ...options, __security: {} });
63
+ return this._client.delete(path`/x/accounts/${id}`, { ...options, __security: { apiKeyAuth: true } });
64
+ }
65
+
66
+ /**
67
+ * Clears loginFailedAt and loginFailureReason for all accounts with transient or
68
+ * automated failure reasons, making them eligible for retry on next use.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const response = await client.x.accounts.bulkRetry();
73
+ * ```
74
+ */
75
+ bulkRetry(options?: RequestOptions): APIPromise<AccountBulkRetryResponse> {
76
+ return this._client.post('/x/accounts/bulk-retry', { ...options, __security: { apiKeyAuth: true } });
38
77
  }
39
78
 
40
79
  /**
41
80
  * Re-authenticate X account
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const response = await client.x.accounts.reauth('id', {
85
+ * password: 'password_value',
86
+ * totp_secret: 'totp_secret_value',
87
+ * });
88
+ * ```
42
89
  */
43
90
  reauth(id: string, body: AccountReauthParams, options?: RequestOptions): APIPromise<AccountReauthResponse> {
44
- return this._client.post(path`/x/accounts/${id}/reauth`, { body, ...options, __security: {} });
91
+ return this._client.post(path`/x/accounts/${id}/reauth`, {
92
+ body,
93
+ ...options,
94
+ __security: { apiKeyAuth: true },
95
+ });
45
96
  }
46
97
  }
47
98
 
99
+ /**
100
+ * Linked X account summary with username and connection status.
101
+ */
48
102
  export interface XAccount {
49
103
  id: string;
50
104
 
@@ -57,6 +111,9 @@ export interface XAccount {
57
111
  xUsername: string;
58
112
  }
59
113
 
114
+ /**
115
+ * Full X account details including proxy, cookies, and update timestamp.
116
+ */
60
117
  export interface XAccountDetail {
61
118
  id: string;
62
119
 
@@ -93,6 +150,13 @@ export interface AccountDeleteResponse {
93
150
  success: true;
94
151
  }
95
152
 
153
+ export interface AccountBulkRetryResponse {
154
+ /**
155
+ * Number of accounts cleared
156
+ */
157
+ cleared: number;
158
+ }
159
+
96
160
  export interface AccountReauthResponse {
97
161
  id: string;
98
162
 
@@ -130,12 +194,12 @@ export interface AccountCreateParams {
130
194
 
131
195
  export interface AccountReauthParams {
132
196
  /**
133
- * Account password
197
+ * Updated account password
134
198
  */
135
199
  password: string;
136
200
 
137
201
  /**
138
- * TOTP secret for 2FA
202
+ * TOTP secret for 2FA re-authentication
139
203
  */
140
204
  totp_secret?: string;
141
205
  }
@@ -147,6 +211,7 @@ export declare namespace Accounts {
147
211
  type AccountCreateResponse as AccountCreateResponse,
148
212
  type AccountListResponse as AccountListResponse,
149
213
  type AccountDeleteResponse as AccountDeleteResponse,
214
+ type AccountBulkRetryResponse as AccountBulkRetryResponse,
150
215
  type AccountReauthResponse as AccountReauthResponse,
151
216
  type AccountCreateParams as AccountCreateParams,
152
217
  type AccountReauthParams as AccountReauthParams,
@@ -11,6 +11,11 @@ import { RequestOptions } from '../../internal/request-options';
11
11
  export class Bookmarks extends APIResource {
12
12
  /**
13
13
  * Get bookmarked tweets
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const paginatedTweets = await client.x.bookmarks.list();
18
+ * ```
14
19
  */
15
20
  list(
16
21
  query: BookmarkListParams | null | undefined = {},
@@ -21,6 +26,11 @@ export class Bookmarks extends APIResource {
21
26
 
22
27
  /**
23
28
  * Get bookmark folders
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response = await client.x.bookmarks.retrieveFolders();
33
+ * ```
24
34
  */
25
35
  retrieveFolders(options?: RequestOptions): APIPromise<BookmarkRetrieveFoldersResponse> {
26
36
  return this._client.get('/x/bookmarks/folders', options);
@@ -45,7 +55,7 @@ export namespace BookmarkRetrieveFoldersResponse {
45
55
 
46
56
  export interface BookmarkListParams {
47
57
  /**
48
- * Pagination cursor from previous response
58
+ * Pagination cursor for bookmarks
49
59
  */
50
60
  cursor?: string;
51
61