x-twitter-scraper 0.18.0 → 0.20.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.
- package/CHANGELOG.md +48 -0
- package/README.md +1 -0
- package/client.d.mts +7 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/account.d.mts +1 -1
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +1 -1
- package/resources/account.d.ts.map +1 -1
- package/resources/activity.d.mts +230 -0
- package/resources/activity.d.mts.map +1 -0
- package/resources/activity.d.ts +230 -0
- package/resources/activity.d.ts.map +1 -0
- package/resources/activity.js +67 -0
- package/resources/activity.js.map +1 -0
- package/resources/activity.mjs +63 -0
- package/resources/activity.mjs.map +1 -0
- package/resources/credits.d.mts +29 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +29 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs.map +1 -1
- package/resources/events.d.mts +69 -0
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +69 -0
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +2 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +2 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +56 -0
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +56 -0
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/posts.d.mts +45 -1
- package/resources/monitors/posts.d.mts.map +1 -1
- package/resources/monitors/posts.d.ts +45 -1
- package/resources/monitors/posts.d.ts.map +1 -1
- package/resources/monitors/posts.js +1 -1
- package/resources/monitors/posts.mjs +1 -1
- package/resources/radar.d.mts +9 -0
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +9 -0
- package/resources/radar.d.ts.map +1 -1
- package/resources/shared.d.mts +67 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +67 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscribe.d.mts +11 -0
- package/resources/subscribe.d.mts.map +1 -1
- package/resources/subscribe.d.ts +11 -0
- package/resources/subscribe.d.ts.map +1 -1
- package/resources/subscribe.js.map +1 -1
- package/resources/subscribe.mjs.map +1 -1
- package/resources/x/communities/communities.d.mts +17 -0
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +17 -0
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +7 -4
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +7 -4
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +14 -0
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +14 -0
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +4 -4
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +4 -4
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/dm.d.mts +14 -0
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +14 -0
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +4 -4
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +4 -4
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/index.d.mts +2 -2
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +2 -2
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/media.d.mts +43 -0
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +43 -0
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +2 -2
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs +2 -2
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +21 -0
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +21 -0
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +6 -6
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs +6 -6
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/sports.d.mts +309 -2
- package/resources/x/sports.d.mts.map +1 -1
- package/resources/x/sports.d.ts +309 -2
- package/resources/x/sports.d.ts.map +1 -1
- package/resources/x/sports.js +49 -1
- package/resources/x/sports.js.map +1 -1
- package/resources/x/sports.mjs +49 -1
- package/resources/x/sports.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts +14 -0
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts +14 -0
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.js +4 -4
- package/resources/x/tweets/like.js.map +1 -1
- package/resources/x/tweets/like.mjs +4 -4
- package/resources/x/tweets/like.mjs.map +1 -1
- package/resources/x/tweets/retweet.d.mts +14 -0
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts +14 -0
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.js +4 -4
- package/resources/x/tweets/retweet.js.map +1 -1
- package/resources/x/tweets/retweet.mjs +4 -4
- package/resources/x/tweets/retweet.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +58 -0
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +58 -0
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +4 -4
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +4 -4
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/follow.d.mts +14 -0
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts +14 -0
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.js +4 -4
- package/resources/x/users/follow.js.map +1 -1
- package/resources/x/users/follow.mjs +4 -4
- package/resources/x/users/follow.mjs.map +1 -1
- package/resources/x/users/index.d.mts +1 -1
- package/resources/x/users/index.d.mts.map +1 -1
- package/resources/x/users/index.d.ts +1 -1
- package/resources/x/users/index.d.ts.map +1 -1
- package/resources/x/users/index.js.map +1 -1
- package/resources/x/users/index.mjs.map +1 -1
- package/resources/x/users/users.d.mts +425 -1
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +425 -1
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +17 -2
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +17 -2
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/x.d.mts +4 -4
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +4 -4
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs.map +1 -1
- package/skills/x-twitter-scraper/references/api-endpoints-draws.md +13 -13
- package/skills/x-twitter-scraper/references/draws.md +3 -3
- package/skills/x-twitter-scraper/references/python-examples.md +2 -2
- package/src/client.ts +23 -0
- package/src/resources/account.ts +1 -1
- package/src/resources/activity.ts +341 -0
- package/src/resources/credits.ts +35 -0
- package/src/resources/events.ts +85 -1
- package/src/resources/extractions.ts +67 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/monitors/posts.ts +58 -1
- package/src/resources/radar.ts +10 -0
- package/src/resources/shared.ts +123 -0
- package/src/resources/subscribe.ts +13 -0
- package/src/resources/x/communities/communities.ts +23 -4
- package/src/resources/x/communities/join.ts +20 -4
- package/src/resources/x/dm.ts +20 -4
- package/src/resources/x/index.ts +13 -0
- package/src/resources/x/media.ts +60 -2
- package/src/resources/x/profile.ts +30 -6
- package/src/resources/x/sports.ts +379 -1
- package/src/resources/x/tweets/like.ts +20 -4
- package/src/resources/x/tweets/retweet.ts +20 -4
- package/src/resources/x/tweets/tweets.ts +70 -4
- package/src/resources/x/users/follow.ts +20 -4
- package/src/resources/x/users/index.ts +3 -0
- package/src/resources/x/users/users.ts +513 -2
- package/src/resources/x/x.ts +26 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -20,7 +20,7 @@ export class Posts extends APIResource {
|
|
|
20
20
|
* @example
|
|
21
21
|
* ```ts
|
|
22
22
|
* const postMonitor = await client.monitors.posts.create({
|
|
23
|
-
* post: 'https://x.com/
|
|
23
|
+
* post: 'https://x.com/NASA/status/2102882545427714266',
|
|
24
24
|
* });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
@@ -192,6 +192,21 @@ export interface PostMonitor {
|
|
|
192
192
|
|
|
193
193
|
authorName: string;
|
|
194
194
|
|
|
195
|
+
/**
|
|
196
|
+
* The author's profile picture. Omitted when X shows none.
|
|
197
|
+
*/
|
|
198
|
+
authorAvatarUrl?: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The author's verified badge on X. Omitted when the author has none.
|
|
202
|
+
*/
|
|
203
|
+
authorVerified?: 'blue' | 'business' | 'government';
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Photos, videos & GIFs on the post, in X's order.
|
|
207
|
+
*/
|
|
208
|
+
media: Array<PostMonitor.Media>;
|
|
209
|
+
|
|
195
210
|
/**
|
|
196
211
|
* Text of the newest version Xquik read.
|
|
197
212
|
*/
|
|
@@ -214,6 +229,12 @@ export interface PostMonitor {
|
|
|
214
229
|
*/
|
|
215
230
|
nextBillingAt: string;
|
|
216
231
|
|
|
232
|
+
/**
|
|
233
|
+
* The post's counts when tracking began. Each metric's gain counts from here.
|
|
234
|
+
* views is null when X showed no view count.
|
|
235
|
+
*/
|
|
236
|
+
baseline: PostMonitor.Baseline;
|
|
237
|
+
|
|
217
238
|
/**
|
|
218
239
|
* The 6 metrics of a post.
|
|
219
240
|
*/
|
|
@@ -238,6 +259,42 @@ export interface PostMonitor {
|
|
|
238
259
|
pausedAt?: string;
|
|
239
260
|
}
|
|
240
261
|
|
|
262
|
+
export namespace PostMonitor {
|
|
263
|
+
/**
|
|
264
|
+
* 1 photo, video or GIF on the post.
|
|
265
|
+
*/
|
|
266
|
+
export interface Media {
|
|
267
|
+
kind: 'gif' | 'photo' | 'video';
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The image URL. For a video or GIF, its preview image.
|
|
271
|
+
*/
|
|
272
|
+
url: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The post's counts when tracking began.
|
|
277
|
+
*/
|
|
278
|
+
export interface Baseline {
|
|
279
|
+
/**
|
|
280
|
+
* When tracking began.
|
|
281
|
+
*/
|
|
282
|
+
at: string;
|
|
283
|
+
|
|
284
|
+
views: number | null;
|
|
285
|
+
|
|
286
|
+
likes: number;
|
|
287
|
+
|
|
288
|
+
retweets: number;
|
|
289
|
+
|
|
290
|
+
replies: number;
|
|
291
|
+
|
|
292
|
+
quotes: number;
|
|
293
|
+
|
|
294
|
+
bookmarks: number;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
241
298
|
/**
|
|
242
299
|
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
243
300
|
* when X shows no count.
|
package/src/resources/radar.ts
CHANGED
|
@@ -136,6 +136,11 @@ export namespace RadarItem {
|
|
|
136
136
|
|
|
137
137
|
selftext?: string;
|
|
138
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Tone of an English post title, from the VADER word list.
|
|
141
|
+
*/
|
|
142
|
+
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
143
|
+
|
|
139
144
|
/**
|
|
140
145
|
* Current items use html. json and rss are retained for legacy rows.
|
|
141
146
|
*/
|
|
@@ -145,6 +150,11 @@ export namespace RadarItem {
|
|
|
145
150
|
|
|
146
151
|
upvoteRatio?: number;
|
|
147
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Reddit lists the post ranks in. now is the popular feed, and the rest are top
|
|
155
|
+
* lists of that window.
|
|
156
|
+
*/
|
|
157
|
+
windows?: Array<'now' | 'hour' | 'day' | 'week' | 'month' | 'year'>;
|
|
148
158
|
[k: string]: unknown;
|
|
149
159
|
}
|
|
150
160
|
}
|
package/src/resources/shared.ts
CHANGED
|
@@ -500,6 +500,43 @@ export namespace ContentDisclosure {
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
+
/**
|
|
504
|
+
* ISO 4217 code of a currency Xquik charges in.
|
|
505
|
+
*/
|
|
506
|
+
export type Currency =
|
|
507
|
+
| 'USD'
|
|
508
|
+
| 'EUR'
|
|
509
|
+
| 'GBP'
|
|
510
|
+
| 'TRY'
|
|
511
|
+
| 'JPY'
|
|
512
|
+
| 'CNY'
|
|
513
|
+
| 'KRW'
|
|
514
|
+
| 'CAD'
|
|
515
|
+
| 'AUD'
|
|
516
|
+
| 'MXN'
|
|
517
|
+
| 'AED'
|
|
518
|
+
| 'BRL'
|
|
519
|
+
| 'CHF'
|
|
520
|
+
| 'CZK'
|
|
521
|
+
| 'DKK'
|
|
522
|
+
| 'HKD'
|
|
523
|
+
| 'HUF'
|
|
524
|
+
| 'IDR'
|
|
525
|
+
| 'ILS'
|
|
526
|
+
| 'INR'
|
|
527
|
+
| 'MYR'
|
|
528
|
+
| 'NOK'
|
|
529
|
+
| 'NZD'
|
|
530
|
+
| 'PHP'
|
|
531
|
+
| 'PLN'
|
|
532
|
+
| 'QAR'
|
|
533
|
+
| 'RON'
|
|
534
|
+
| 'SAR'
|
|
535
|
+
| 'SEK'
|
|
536
|
+
| 'SGD'
|
|
537
|
+
| 'THB'
|
|
538
|
+
| 'ZAR';
|
|
539
|
+
|
|
503
540
|
/**
|
|
504
541
|
* A parent, quoted or retweeted tweet. It has the TweetPublicData fields and an
|
|
505
542
|
* author. Nesting stops after 4 levels.
|
|
@@ -661,6 +698,11 @@ export interface EmbeddedTweet {
|
|
|
661
698
|
*/
|
|
662
699
|
limitedActions?: Array<SearchTweet.LimitedAction>;
|
|
663
700
|
|
|
701
|
+
/**
|
|
702
|
+
* The live event the post belongs to, such as an election.
|
|
703
|
+
*/
|
|
704
|
+
liveEventContext?: SearchTweet.LiveEventContext;
|
|
705
|
+
|
|
664
706
|
/**
|
|
665
707
|
* Media, omitted when unavailable.
|
|
666
708
|
*/
|
|
@@ -779,6 +821,12 @@ export interface EmbeddedTweet {
|
|
|
779
821
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
780
822
|
>;
|
|
781
823
|
|
|
824
|
+
/**
|
|
825
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
826
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
827
|
+
*/
|
|
828
|
+
unknownFields?: Array<'text'>;
|
|
829
|
+
|
|
782
830
|
/**
|
|
783
831
|
* User IDs that left this conversation.
|
|
784
832
|
*/
|
|
@@ -842,7 +890,12 @@ export namespace Error {
|
|
|
842
890
|
| 'account_not_found'
|
|
843
891
|
| 'account_required'
|
|
844
892
|
| 'account_restricted'
|
|
893
|
+
| 'api_key_expired'
|
|
894
|
+
| 'api_key_budget_reached'
|
|
895
|
+
| 'api_key_revoked'
|
|
896
|
+
| 'ip_not_allowed'
|
|
845
897
|
| 'api_key_limit_reached'
|
|
898
|
+
| 'api_key_paused'
|
|
846
899
|
| 'article_not_found'
|
|
847
900
|
| 'closed'
|
|
848
901
|
| 'dm_not_permitted'
|
|
@@ -860,11 +913,13 @@ export namespace Error {
|
|
|
860
913
|
| 'invalid_username'
|
|
861
914
|
| 'invalid_json'
|
|
862
915
|
| 'insufficient_credits'
|
|
916
|
+
| 'insufficient_scope'
|
|
863
917
|
| 'job_not_found'
|
|
864
918
|
| 'login_cooldown'
|
|
865
919
|
| 'login_failed'
|
|
866
920
|
| 'media_download_failed'
|
|
867
921
|
| 'media_too_large'
|
|
922
|
+
| 'media_unavailable'
|
|
868
923
|
| 'missing_params'
|
|
869
924
|
| 'missing_query'
|
|
870
925
|
| 'monitor_already_exists'
|
|
@@ -872,8 +927,11 @@ export namespace Error {
|
|
|
872
927
|
| 'no_media'
|
|
873
928
|
| 'no_credits'
|
|
874
929
|
| 'no_subscription'
|
|
930
|
+
| 'extraction_terminal'
|
|
875
931
|
| 'not_found'
|
|
876
932
|
| 'payment_failed'
|
|
933
|
+
| 'post_unavailable'
|
|
934
|
+
| 'price_changed'
|
|
877
935
|
| 'rate_limit_exceeded'
|
|
878
936
|
| 'service_unavailable'
|
|
879
937
|
| 'session_required'
|
|
@@ -962,6 +1020,7 @@ export namespace Error {
|
|
|
962
1020
|
| 'x_api_unauthorized'
|
|
963
1021
|
| 'x_auth_failure'
|
|
964
1022
|
| 'x_automation_refused'
|
|
1023
|
+
| 'x_community_creation_closed'
|
|
965
1024
|
| 'x_community_not_joined'
|
|
966
1025
|
| 'x_community_not_selectable'
|
|
967
1026
|
| 'x_community_post_public'
|
|
@@ -1397,6 +1456,11 @@ export interface SearchTweet {
|
|
|
1397
1456
|
*/
|
|
1398
1457
|
limitedActions?: Array<SearchTweet.LimitedAction>;
|
|
1399
1458
|
|
|
1459
|
+
/**
|
|
1460
|
+
* The live event the post belongs to, such as an election.
|
|
1461
|
+
*/
|
|
1462
|
+
liveEventContext?: SearchTweet.LiveEventContext;
|
|
1463
|
+
|
|
1400
1464
|
/**
|
|
1401
1465
|
* Media, omitted when unavailable.
|
|
1402
1466
|
*/
|
|
@@ -1518,6 +1582,12 @@ export interface SearchTweet {
|
|
|
1518
1582
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
1519
1583
|
>;
|
|
1520
1584
|
|
|
1585
|
+
/**
|
|
1586
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
1587
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
1588
|
+
*/
|
|
1589
|
+
unknownFields?: Array<'text'>;
|
|
1590
|
+
|
|
1521
1591
|
/**
|
|
1522
1592
|
* User IDs that left this conversation.
|
|
1523
1593
|
*/
|
|
@@ -2074,6 +2144,23 @@ export namespace SearchTweet {
|
|
|
2074
2144
|
}
|
|
2075
2145
|
}
|
|
2076
2146
|
|
|
2147
|
+
export interface LiveEventContext {
|
|
2148
|
+
/**
|
|
2149
|
+
* The event's image.
|
|
2150
|
+
*/
|
|
2151
|
+
imageUrl?: string;
|
|
2152
|
+
|
|
2153
|
+
/**
|
|
2154
|
+
* Event name.
|
|
2155
|
+
*/
|
|
2156
|
+
title?: string;
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* The event's page on X.
|
|
2160
|
+
*/
|
|
2161
|
+
url?: string;
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2077
2164
|
/**
|
|
2078
2165
|
* Complete Note Tweet content and rich-text metadata.
|
|
2079
2166
|
*/
|
|
@@ -2458,6 +2545,13 @@ export namespace SearchTweet {
|
|
|
2458
2545
|
* Public post & user this reaction references.
|
|
2459
2546
|
*/
|
|
2460
2547
|
export interface ReactionContext {
|
|
2548
|
+
/**
|
|
2549
|
+
* The post this one reacts to, with the same fields. X often sends only its
|
|
2550
|
+
* ID, author & edit history. Then unknownFields lists text, and the flags X
|
|
2551
|
+
* did not send are left out.
|
|
2552
|
+
*/
|
|
2553
|
+
reactedToPost?: { [key: string]: unknown };
|
|
2554
|
+
|
|
2461
2555
|
/**
|
|
2462
2556
|
* Referenced post ID.
|
|
2463
2557
|
*/
|
|
@@ -2793,6 +2887,12 @@ export interface TweetMedia {
|
|
|
2793
2887
|
*/
|
|
2794
2888
|
durationMillis?: number;
|
|
2795
2889
|
|
|
2890
|
+
/**
|
|
2891
|
+
* True when the author edited this media in X's own editor before posting.
|
|
2892
|
+
* Absent when X sends no editor info.
|
|
2893
|
+
*/
|
|
2894
|
+
editedWithNativeEditor?: boolean;
|
|
2895
|
+
|
|
2796
2896
|
/**
|
|
2797
2897
|
* Embeddable status.
|
|
2798
2898
|
*/
|
|
@@ -3359,6 +3459,12 @@ export namespace UserProfile {
|
|
|
3359
3459
|
* Organization affiliation label shown on an X profile.
|
|
3360
3460
|
*/
|
|
3361
3461
|
export interface AffiliatesHighlightedLabel {
|
|
3462
|
+
/**
|
|
3463
|
+
* More labels X shows beside the affiliation, such as an automated account's
|
|
3464
|
+
* owner.
|
|
3465
|
+
*/
|
|
3466
|
+
auxiliaryLabels?: Array<AffiliatesHighlightedLabel.AuxiliaryLabel>;
|
|
3467
|
+
|
|
3362
3468
|
badgeUrl?: string;
|
|
3363
3469
|
|
|
3364
3470
|
description?: string;
|
|
@@ -3377,6 +3483,23 @@ export namespace UserProfile {
|
|
|
3377
3483
|
userLabelType?: string;
|
|
3378
3484
|
}
|
|
3379
3485
|
|
|
3486
|
+
export namespace AffiliatesHighlightedLabel {
|
|
3487
|
+
/**
|
|
3488
|
+
* A label X shows on an X profile beside its affiliation label.
|
|
3489
|
+
*/
|
|
3490
|
+
export interface AuxiliaryLabel {
|
|
3491
|
+
badgeUrl?: string;
|
|
3492
|
+
|
|
3493
|
+
description?: string;
|
|
3494
|
+
|
|
3495
|
+
url?: string;
|
|
3496
|
+
|
|
3497
|
+
userLabelDisplayType?: string;
|
|
3498
|
+
|
|
3499
|
+
userLabelType?: string;
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3380
3503
|
/**
|
|
3381
3504
|
* The parts of the birthday the account made public.
|
|
3382
3505
|
*/
|
|
@@ -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 { RequestOptions } from '../internal/request-options';
|
|
8
9
|
|
|
@@ -35,9 +36,21 @@ export interface SubscribeCreateResponse {
|
|
|
35
36
|
status: 'checkout_created' | 'already_subscribed' | 'payment_issue';
|
|
36
37
|
|
|
37
38
|
url: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Currency the checkout charges. Only a checkout_created answer has it.
|
|
42
|
+
*/
|
|
43
|
+
chargedCurrency?: Shared.Currency;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
export interface SubscribeCreateParams {
|
|
47
|
+
/**
|
|
48
|
+
* Currency to pay in, USD by default. Lowercase codes work too. Each renewal
|
|
49
|
+
* charges the same amount before tax. chargedCurrency shows the currency
|
|
50
|
+
* charged.
|
|
51
|
+
*/
|
|
52
|
+
currency?: Shared.Currency;
|
|
53
|
+
|
|
41
54
|
/**
|
|
42
55
|
* Subscription tier to pre-select.
|
|
43
56
|
*/
|
|
@@ -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
|
|
|
@@ -894,6 +897,14 @@ export interface CommunityCreateParams {
|
|
|
894
897
|
*/
|
|
895
898
|
'Idempotency-Key': string;
|
|
896
899
|
|
|
900
|
+
/**
|
|
901
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
902
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
903
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
904
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
905
|
+
*/
|
|
906
|
+
Prefer?: string;
|
|
907
|
+
|
|
897
908
|
/**
|
|
898
909
|
* Body param: Community description
|
|
899
910
|
*/
|
|
@@ -920,6 +931,14 @@ export interface CommunityDeleteParams {
|
|
|
920
931
|
* days.
|
|
921
932
|
*/
|
|
922
933
|
'Idempotency-Key': string;
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
937
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
938
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
939
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
940
|
+
*/
|
|
941
|
+
Prefer?: string;
|
|
923
942
|
}
|
|
924
943
|
|
|
925
944
|
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
|
}
|
|
@@ -580,6 +580,14 @@ export interface JoinCreateParams {
|
|
|
580
580
|
* days.
|
|
581
581
|
*/
|
|
582
582
|
'Idempotency-Key': string;
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
586
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
587
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
588
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
589
|
+
*/
|
|
590
|
+
Prefer?: string;
|
|
583
591
|
}
|
|
584
592
|
|
|
585
593
|
export interface JoinDeleteAllParams {
|
|
@@ -597,6 +605,14 @@ export interface JoinDeleteAllParams {
|
|
|
597
605
|
* days.
|
|
598
606
|
*/
|
|
599
607
|
'Idempotency-Key': string;
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
611
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
612
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
613
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
614
|
+
*/
|
|
615
|
+
Prefer?: string;
|
|
600
616
|
}
|
|
601
617
|
|
|
602
618
|
export declare namespace Join {
|
package/src/resources/x/dm.ts
CHANGED
|
@@ -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
|
}
|
|
@@ -638,6 +638,14 @@ export interface DmDeleteMessageParams {
|
|
|
638
638
|
* days.
|
|
639
639
|
*/
|
|
640
640
|
'Idempotency-Key': string;
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
644
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
645
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
646
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
647
|
+
*/
|
|
648
|
+
Prefer?: string;
|
|
641
649
|
}
|
|
642
650
|
|
|
643
651
|
export interface DmRetrieveHistoryParams {
|
|
@@ -680,6 +688,14 @@ export interface DmSendParams {
|
|
|
680
688
|
*/
|
|
681
689
|
'Idempotency-Key': string;
|
|
682
690
|
|
|
691
|
+
/**
|
|
692
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
693
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
694
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
695
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
696
|
+
*/
|
|
697
|
+
Prefer?: string;
|
|
698
|
+
|
|
683
699
|
/**
|
|
684
700
|
* Body param: Optional array containing exactly 1 uploaded media ID.
|
|
685
701
|
*/
|
package/src/resources/x/index.ts
CHANGED
|
@@ -190,6 +190,8 @@ export {
|
|
|
190
190
|
type UserRetrieveListMembershipsResponse,
|
|
191
191
|
type UserRetrieveListsResponse,
|
|
192
192
|
type UserRetrieveLiveResponse,
|
|
193
|
+
type ShadowbanReport,
|
|
194
|
+
type ShadowbanVerdict,
|
|
193
195
|
type UserRetrieveVerifiedFollowersResponse,
|
|
194
196
|
type UserTranslateBioResponse,
|
|
195
197
|
type UserRetrieveParams,
|
|
@@ -213,6 +215,7 @@ export {
|
|
|
213
215
|
type UserRetrieveMentionsParams,
|
|
214
216
|
type UserRetrieveRepliesParams,
|
|
215
217
|
type UserRetrieveSearchParams,
|
|
218
|
+
type UserRetrieveShadowbanParams,
|
|
216
219
|
type UserRetrieveSimilarParams,
|
|
217
220
|
type UserRetrieveSubscriptionsParams,
|
|
218
221
|
type UserRetrieveTweetsParams,
|
|
@@ -294,6 +297,7 @@ export {
|
|
|
294
297
|
type SportRetrieveBoxScoreParams,
|
|
295
298
|
type SportRetrievePlaysParams,
|
|
296
299
|
type SportsTeamRecord,
|
|
300
|
+
type SportsTeamGame,
|
|
297
301
|
type SportsGameAudienceViewers,
|
|
298
302
|
type SportsGameAudienceTeamPick,
|
|
299
303
|
type SportsGameAudienceTeamPicks,
|
|
@@ -301,4 +305,13 @@ export {
|
|
|
301
305
|
type SportsGameAudienceChat,
|
|
302
306
|
type SportsGameAudience,
|
|
303
307
|
type SportRetrieveAudienceParams,
|
|
308
|
+
type FootballRosterTeam,
|
|
309
|
+
type FootballRoster,
|
|
310
|
+
type FootballPlayerProp,
|
|
311
|
+
type FootballPropCategory,
|
|
312
|
+
type FootballProps,
|
|
313
|
+
type SportsGamePosts,
|
|
314
|
+
type SportRetrieveRosterParams,
|
|
315
|
+
type SportRetrievePlayerPropsParams,
|
|
316
|
+
type SportListPostsParams,
|
|
304
317
|
} from './sports';
|
package/src/resources/x/media.ts
CHANGED
|
@@ -37,14 +37,14 @@ export class Media extends APIResource {
|
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
39
|
upload(params: MediaUploadParams, options?: RequestOptions): APIPromise<MediaUploadResponse> {
|
|
40
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
40
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
41
41
|
return this._client.post(
|
|
42
42
|
'/x/media',
|
|
43
43
|
maybeMultipartFormRequestOptions(
|
|
44
44
|
{
|
|
45
45
|
body,
|
|
46
46
|
...options,
|
|
47
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
47
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
48
48
|
},
|
|
49
49
|
this._client,
|
|
50
50
|
),
|
|
@@ -57,6 +57,11 @@ export interface MediaDownloadResponse {
|
|
|
57
57
|
|
|
58
58
|
galleryUrl?: string;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The post's files saved to your gallery. Single downloads only.
|
|
62
|
+
*/
|
|
63
|
+
items?: Array<MediaDownloadResponse.Item>;
|
|
64
|
+
|
|
60
65
|
totalMedia?: number;
|
|
61
66
|
|
|
62
67
|
totalTweets?: number;
|
|
@@ -64,6 +69,51 @@ export interface MediaDownloadResponse {
|
|
|
64
69
|
tweetId?: string;
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
export namespace MediaDownloadResponse {
|
|
73
|
+
/**
|
|
74
|
+
* 1 file saved to your gallery.
|
|
75
|
+
*/
|
|
76
|
+
export interface Item {
|
|
77
|
+
/**
|
|
78
|
+
* Gallery file ID.
|
|
79
|
+
*/
|
|
80
|
+
id: string;
|
|
81
|
+
|
|
82
|
+
tweetId: string;
|
|
83
|
+
|
|
84
|
+
mediaType: 'photo' | 'video' | 'animated_gif';
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Saved copy of the file.
|
|
88
|
+
*/
|
|
89
|
+
mediaUrl: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* File size in bytes, as a string.
|
|
93
|
+
*/
|
|
94
|
+
fileSize: string | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* When the file joined your gallery.
|
|
98
|
+
*/
|
|
99
|
+
createdAt: string;
|
|
100
|
+
|
|
101
|
+
authorUsername: string;
|
|
102
|
+
|
|
103
|
+
authorDisplayName: string;
|
|
104
|
+
|
|
105
|
+
authorAvatar: string | null;
|
|
106
|
+
|
|
107
|
+
tweetText: string;
|
|
108
|
+
|
|
109
|
+
likes: number | null;
|
|
110
|
+
|
|
111
|
+
retweets: number | null;
|
|
112
|
+
|
|
113
|
+
views: number | null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
67
117
|
/**
|
|
68
118
|
* Durable write record. Poll statusUrl until terminal is true. Reusing its
|
|
69
119
|
* Idempotency-Key returns this record. Create another action only when safeToRetry
|
|
@@ -371,6 +421,14 @@ export interface MediaUploadParams {
|
|
|
371
421
|
* days.
|
|
372
422
|
*/
|
|
373
423
|
'Idempotency-Key': string;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
427
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
428
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
429
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
430
|
+
*/
|
|
431
|
+
Prefer?: string;
|
|
374
432
|
}
|
|
375
433
|
|
|
376
434
|
export declare namespace Media {
|