Skip to content

Commit a35bf82

Browse files
authored
fix: Add back the article tweet field (#628)
1 parent 4ca23a3 commit a35bf82

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/types/v2/tweet.definition.v2.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ export type NoteTweetEntitiesV2 = Omit<TweetEntitiesV2, 'annotations'>;
183183

184184
export type TTweetReplySettingsV2 = 'mentionedUsers' | 'following' | 'everyone';
185185

186+
export interface TweetArticleV2 {
187+
cover_media?: MediaObjectV2;
188+
media_entities?: MediaObjectV2[];
189+
}
190+
186191
export interface SendTweetV2Params {
187192
direct_message_deep_link?: string;
188193
for_super_followers_only?: 'True' | 'False';
@@ -238,6 +243,7 @@ export interface TweetV2 {
238243
source?: string;
239244
note_tweet?: NoteTweetV2;
240245
community_id?: string;
246+
article?: TweetArticleV2;
241247
}
242248

243249
export interface ApiV2Includes {

src/types/v2/tweet.v2.types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ export interface TweetV2UserTimelineParams extends TweetV2PaginableTimelineParam
3939
}
4040

4141
// eslint-disable-next-line @typescript-eslint/no-empty-interface
42-
export interface TweetV2HomeTimelineParams extends TweetV2UserTimelineParams {}
42+
export interface TweetV2HomeTimelineParams extends TweetV2UserTimelineParams { }
4343

44-
export type TTweetv2Expansion = 'attachments.poll_ids' | 'attachments.media_keys'
44+
export type TTweetv2Expansion = 'attachments.poll_ids' | 'attachments.media_keys' | 'attachments.media_source_tweet'
4545
| 'author_id' | 'referenced_tweets.id' | 'in_reply_to_user_id' | 'edit_history_tweet_ids'
46-
| 'geo.place_id' | 'entities.mentions.username' | 'referenced_tweets.id.author_id';
46+
| 'geo.place_id' | 'entities.mentions.username' | 'referenced_tweets.id.author_id'
47+
| 'article.cover_media' | 'article.media_entities'
48+
| 'entities.note.mentions.username' | 'referenced_tweets.id.attachments.media_keys';
4749
export type TTweetv2MediaField = keyof MediaObjectV2;
4850
export type TTweetv2PlaceField = keyof PlaceV2;
4951
export type TTweetv2PollField = keyof PollV2;

0 commit comments

Comments
 (0)