@glagan/rettiwt-api 7.0.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 (165) hide show
  1. package/.eslintrc.js +166 -0
  2. package/.gitattributes +3 -0
  3. package/.github/FUNDING.yml +4 -0
  4. package/.github/ISSUE_TEMPLATE/bug-report.yml +57 -0
  5. package/.github/ISSUE_TEMPLATE/feature-request.yml +20 -0
  6. package/.github/ISSUE_TEMPLATE/question.yml +15 -0
  7. package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
  8. package/.github/workflows/ci.yml +32 -0
  9. package/.github/workflows/publish.yml +23 -0
  10. package/.nvmrc +1 -0
  11. package/.prettierignore +3 -0
  12. package/.prettierrc +13 -0
  13. package/LICENSE +21 -0
  14. package/README.md +566 -0
  15. package/dist/cli.js +43 -0
  16. package/eslint.config.mjs +17 -0
  17. package/package.json +50 -0
  18. package/src/Rettiwt.ts +97 -0
  19. package/src/cli.ts +48 -0
  20. package/src/collections/Extractors.ts +155 -0
  21. package/src/collections/Groups.ts +81 -0
  22. package/src/collections/Requests.ts +89 -0
  23. package/src/collections/Tweet.ts +17 -0
  24. package/src/commands/DirectMessage.ts +62 -0
  25. package/src/commands/List.ts +90 -0
  26. package/src/commands/Tweet.ts +437 -0
  27. package/src/commands/User.ts +367 -0
  28. package/src/enums/Api.ts +10 -0
  29. package/src/enums/Authentication.ts +10 -0
  30. package/src/enums/Data.ts +13 -0
  31. package/src/enums/Logging.ts +14 -0
  32. package/src/enums/Media.ts +10 -0
  33. package/src/enums/Notification.ts +12 -0
  34. package/src/enums/Resource.ts +69 -0
  35. package/src/enums/Tweet.ts +8 -0
  36. package/src/enums/raw/Analytics.ts +32 -0
  37. package/src/enums/raw/Media.ts +10 -0
  38. package/src/enums/raw/Notification.ts +11 -0
  39. package/src/enums/raw/Tweet.ts +20 -0
  40. package/src/helper/CliUtils.ts +17 -0
  41. package/src/helper/JsonUtils.ts +70 -0
  42. package/src/index.ts +128 -0
  43. package/src/models/RettiwtConfig.ts +101 -0
  44. package/src/models/args/FetchArgs.ts +169 -0
  45. package/src/models/args/PostArgs.ts +93 -0
  46. package/src/models/args/ProfileArgs.ts +68 -0
  47. package/src/models/auth/AuthCookie.ts +58 -0
  48. package/src/models/auth/AuthCredential.ts +83 -0
  49. package/src/models/data/Analytics.ts +97 -0
  50. package/src/models/data/BookmarkFolder.ts +73 -0
  51. package/src/models/data/Conversation.ts +344 -0
  52. package/src/models/data/CursoredData.ts +64 -0
  53. package/src/models/data/DirectMessage.ts +335 -0
  54. package/src/models/data/Inbox.ts +124 -0
  55. package/src/models/data/List.ts +113 -0
  56. package/src/models/data/Notification.ts +84 -0
  57. package/src/models/data/Tweet.ts +388 -0
  58. package/src/models/data/User.ts +187 -0
  59. package/src/models/errors/TwitterError.ts +65 -0
  60. package/src/models/params/Variables.ts +62 -0
  61. package/src/requests/DirectMessage.ts +229 -0
  62. package/src/requests/List.ts +203 -0
  63. package/src/requests/Media.ts +67 -0
  64. package/src/requests/Tweet.ts +607 -0
  65. package/src/requests/User.ts +1191 -0
  66. package/src/services/internal/AuthService.ts +115 -0
  67. package/src/services/internal/ErrorService.ts +41 -0
  68. package/src/services/internal/LogService.ts +34 -0
  69. package/src/services/public/DirectMessageService.ts +159 -0
  70. package/src/services/public/FetcherService.ts +366 -0
  71. package/src/services/public/ListService.ts +241 -0
  72. package/src/services/public/TweetService.ts +886 -0
  73. package/src/services/public/UserService.ts +1154 -0
  74. package/src/types/ErrorHandler.ts +13 -0
  75. package/src/types/Fetch.ts +3 -0
  76. package/src/types/RettiwtConfig.ts +48 -0
  77. package/src/types/args/FetchArgs.ts +233 -0
  78. package/src/types/args/PostArgs.ts +142 -0
  79. package/src/types/args/ProfileArgs.ts +33 -0
  80. package/src/types/auth/AuthCookie.ts +22 -0
  81. package/src/types/auth/AuthCredential.ts +28 -0
  82. package/src/types/auth/TransactionHeader.ts +8 -0
  83. package/src/types/data/Analytics.ts +58 -0
  84. package/src/types/data/BookmarkFolder.ts +12 -0
  85. package/src/types/data/Conversation.ts +44 -0
  86. package/src/types/data/CursoredData.ts +24 -0
  87. package/src/types/data/DirectMessage.ts +33 -0
  88. package/src/types/data/Inbox.ts +23 -0
  89. package/src/types/data/List.ts +33 -0
  90. package/src/types/data/Notification.ts +26 -0
  91. package/src/types/data/Tweet.ts +99 -0
  92. package/src/types/data/User.ts +54 -0
  93. package/src/types/errors/TwitterError.ts +37 -0
  94. package/src/types/params/Variables.ts +41 -0
  95. package/src/types/raw/base/Analytic.ts +32 -0
  96. package/src/types/raw/base/BookmarkFolder.ts +12 -0
  97. package/src/types/raw/base/Cursor.ts +13 -0
  98. package/src/types/raw/base/Error.ts +38 -0
  99. package/src/types/raw/base/LimitedVisibilityTweet.ts +40 -0
  100. package/src/types/raw/base/List.ts +50 -0
  101. package/src/types/raw/base/Media.ts +53 -0
  102. package/src/types/raw/base/Message.ts +22 -0
  103. package/src/types/raw/base/Notification.ts +66 -0
  104. package/src/types/raw/base/Space.ts +35 -0
  105. package/src/types/raw/base/Tweet.ts +139 -0
  106. package/src/types/raw/base/User.ts +182 -0
  107. package/src/types/raw/composite/DataResult.ts +8 -0
  108. package/src/types/raw/composite/TimelineList.ts +10 -0
  109. package/src/types/raw/composite/TimelineTweet.ts +14 -0
  110. package/src/types/raw/composite/TimelineUser.ts +13 -0
  111. package/src/types/raw/dm/Conversation.ts +59 -0
  112. package/src/types/raw/dm/InboxInitial.ts +155 -0
  113. package/src/types/raw/dm/InboxTimeline.ts +301 -0
  114. package/src/types/raw/dm/UserUpdates.ts +46 -0
  115. package/src/types/raw/generic/Response.ts +10 -0
  116. package/src/types/raw/list/AddMember.ts +175 -0
  117. package/src/types/raw/list/Details.ts +176 -0
  118. package/src/types/raw/list/Members.ts +154 -0
  119. package/src/types/raw/list/RemoveMember.ts +174 -0
  120. package/src/types/raw/list/Tweets.ts +2296 -0
  121. package/src/types/raw/media/FinalizeUpload.ts +20 -0
  122. package/src/types/raw/media/InitalizeUpload.ts +12 -0
  123. package/src/types/raw/media/LiveVideoStream.ts +21 -0
  124. package/src/types/raw/space/Details.ts +359 -0
  125. package/src/types/raw/tweet/Bookmark.ts +14 -0
  126. package/src/types/raw/tweet/Details.ts +210 -0
  127. package/src/types/raw/tweet/DetailsBulk.ts +338 -0
  128. package/src/types/raw/tweet/Like.ts +14 -0
  129. package/src/types/raw/tweet/Likers.ts +200 -0
  130. package/src/types/raw/tweet/Post.ts +150 -0
  131. package/src/types/raw/tweet/Replies.ts +539 -0
  132. package/src/types/raw/tweet/Retweet.ts +31 -0
  133. package/src/types/raw/tweet/Retweeters.ts +208 -0
  134. package/src/types/raw/tweet/Schedule.ts +18 -0
  135. package/src/types/raw/tweet/Search.ts +597 -0
  136. package/src/types/raw/tweet/Unbookmark.ts +14 -0
  137. package/src/types/raw/tweet/Unlike.ts +14 -0
  138. package/src/types/raw/tweet/Unpost.ts +20 -0
  139. package/src/types/raw/tweet/Unretweet.ts +31 -0
  140. package/src/types/raw/tweet/Unschedule.ts +14 -0
  141. package/src/types/raw/user/Affiliates.ts +179 -0
  142. package/src/types/raw/user/Analytics.ts +23 -0
  143. package/src/types/raw/user/BookmarkFolderTweets.ts +53 -0
  144. package/src/types/raw/user/BookmarkFolders.ts +41 -0
  145. package/src/types/raw/user/Bookmarks.ts +637 -0
  146. package/src/types/raw/user/Details.ts +185 -0
  147. package/src/types/raw/user/DetailsBulk.ts +104 -0
  148. package/src/types/raw/user/Follow.ts +280 -0
  149. package/src/types/raw/user/Followed.ts +1942 -0
  150. package/src/types/raw/user/Followers.ts +215 -0
  151. package/src/types/raw/user/Following.ts +215 -0
  152. package/src/types/raw/user/Highlights.ts +1287 -0
  153. package/src/types/raw/user/Likes.ts +1254 -0
  154. package/src/types/raw/user/Lists.ts +378 -0
  155. package/src/types/raw/user/Media.ts +1738 -0
  156. package/src/types/raw/user/Notifications.ts +499 -0
  157. package/src/types/raw/user/ProfileUpdate.ts +80 -0
  158. package/src/types/raw/user/Recommended.ts +2319 -0
  159. package/src/types/raw/user/Scheduled.ts +37 -0
  160. package/src/types/raw/user/Search.ts +230 -0
  161. package/src/types/raw/user/Subscriptions.ts +176 -0
  162. package/src/types/raw/user/Tweets.ts +1254 -0
  163. package/src/types/raw/user/TweetsAndReplies.ts +1254 -0
  164. package/src/types/raw/user/Unfollow.ts +280 -0
  165. package/tsconfig.json +97 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The details of a single direct message.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IDirectMessage {
7
+ /** The unique identifier of the message. */
8
+ id: string;
9
+
10
+ /** The ID of the conversation this message belongs to. */
11
+ conversationId: string;
12
+
13
+ /** The ID of the user who sent the message. */
14
+ senderId: string;
15
+
16
+ /** The ID of the user who received the message (for one-to-one conversations). */
17
+ recipientId?: string;
18
+
19
+ /** The text content of the message. */
20
+ text: string;
21
+
22
+ /** The timestamp when the message was sent (ISO 8601 format). */
23
+ createdAt: string;
24
+
25
+ /** Array of media URLs attached to the message. */
26
+ mediaUrls?: string[];
27
+
28
+ /** Number of times the message has been edited. */
29
+ editCount?: number;
30
+
31
+ /** Whether the message has been read. */
32
+ read?: boolean;
33
+ }
@@ -0,0 +1,23 @@
1
+ import { IConversation } from './Conversation';
2
+
3
+ /**
4
+ * The details of a DM inbox containing conversations and metadata.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IInbox {
9
+ /** List of conversations in the inbox. */
10
+ conversations: IConversation[];
11
+
12
+ /** The cursor for pagination of conversations. */
13
+ cursor: string;
14
+
15
+ /** The ID of the last seen event. */
16
+ lastSeenEventId: string;
17
+
18
+ /** The ID of the last seen trusted event. */
19
+ trustedLastSeenEventId: string;
20
+
21
+ /** The ID of the last seen untrusted event. */
22
+ untrustedLastSeenEventId: string;
23
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The details of a single Twitter List.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IList {
7
+ /** The date and time of creation of the list, int UTC string format. */
8
+ createdAt: string;
9
+
10
+ /** The ID of the user who created the list. */
11
+ createdBy: string;
12
+
13
+ /** The list description. */
14
+ description?: string;
15
+
16
+ /** Whether the user is following the list or not. */
17
+ isFollowing: boolean;
18
+
19
+ /** The rest id of the list. */
20
+ id: string;
21
+
22
+ /** Whether the user is a member of the list or not. */
23
+ isMember: boolean;
24
+
25
+ /** The number of memeber of the list. */
26
+ memberCount: number;
27
+
28
+ /** The name of the list. */
29
+ name: string;
30
+
31
+ /** The number of subscribers of the list. */
32
+ subscriberCount: number;
33
+ }
@@ -0,0 +1,26 @@
1
+ import { NotificationType } from '../../enums/Notification';
2
+
3
+ /**
4
+ * The details of a single notification.
5
+ *
6
+ * @public
7
+ */
8
+ export interface INotification {
9
+ /** The list of id of the users from whom the notification was received. */
10
+ from: string[];
11
+
12
+ /** The id of the notification. */
13
+ id: string;
14
+
15
+ /** The text contents of the notification. */
16
+ message: string;
17
+
18
+ /** The date/time at which the notification was received. */
19
+ receivedAt: string;
20
+
21
+ /** The list of id of the target tweet(s) of the notification. */
22
+ target: string[];
23
+
24
+ /** The type of notification. */
25
+ type?: NotificationType;
26
+ }
@@ -0,0 +1,99 @@
1
+ import { MediaType } from '../../enums/Media';
2
+
3
+ import { IUser } from './User';
4
+
5
+ /**
6
+ * The details of a single tweet.
7
+ *
8
+ * @public
9
+ */
10
+ export interface ITweet {
11
+ /** The number of bookmarks of a tweet. */
12
+ bookmarkCount?: number;
13
+
14
+ /** The ID of tweet which started the current conversation. */
15
+ conversationId: string;
16
+
17
+ /** The creation date of the tweet. */
18
+ createdAt: string;
19
+
20
+ /** Additional tweet entities like urls, mentions, etc. */
21
+ entities: ITweetEntities;
22
+
23
+ /** The full text content of the tweet. */
24
+ fullText: string;
25
+
26
+ /** The rest id of the tweet. */
27
+ id: string;
28
+
29
+ /** The language in which the tweet is written. */
30
+ lang: string;
31
+
32
+ /** The number of likes of the tweet. */
33
+ likeCount?: number;
34
+
35
+ /** The urls of the media contents of the tweet (if any). */
36
+ media?: ITweetMedia[];
37
+
38
+ /** The number of quotes of the tweet. */
39
+ quoteCount?: number;
40
+
41
+ /** The tweet which is quoted in the tweet. */
42
+ quoted?: ITweet;
43
+
44
+ /** The number of replies to the tweet. */
45
+ replyCount?: number;
46
+
47
+ /** The rest id of the tweet to which the tweet is a reply. */
48
+ replyTo?: string;
49
+
50
+ /** The number of retweets of the tweet. */
51
+ retweetCount?: number;
52
+
53
+ /** The tweet which is retweeted in this tweet (if any). */
54
+ retweetedTweet?: ITweet;
55
+
56
+ /** The details of the user who made the tweet. */
57
+ tweetBy: IUser;
58
+
59
+ /** The URL to the tweet. */
60
+ url: string;
61
+
62
+ /** The number of views of a tweet. */
63
+ viewCount?: number;
64
+ }
65
+
66
+ /**
67
+ * The different types parsed entities like urls, media, mentions, hashtags, etc.
68
+ *
69
+ * @public
70
+ */
71
+ export interface ITweetEntities {
72
+ /** The list of hashtags mentioned in the tweet. */
73
+ hashtags: string[];
74
+
75
+ /** The list of IDs of users mentioned in the tweet. */
76
+ mentionedUsers: string[];
77
+
78
+ /** The list of urls mentioned in the tweet. */
79
+ urls: string[];
80
+ }
81
+
82
+ /**
83
+ * The details of a single media content included in a tweet.
84
+ *
85
+ * @public
86
+ */
87
+ export interface ITweetMedia {
88
+ /** The ID of the media. */
89
+ id: string;
90
+
91
+ /** The thumbnail URL for the video content of the tweet. */
92
+ thumbnailUrl?: string;
93
+
94
+ /** The type of media. */
95
+ type: MediaType;
96
+
97
+ /** The direct URL to the media. */
98
+ url: string;
99
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The details of a single user.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IUser {
7
+ /** The creation date of user's account. */
8
+ createdAt: string;
9
+
10
+ /** The user's description. */
11
+ description?: string;
12
+
13
+ /** The number of followers of the user. */
14
+ followersCount: number;
15
+
16
+ /** The number of following of the user. */
17
+ followingsCount: number;
18
+
19
+ /** The full name of the user. */
20
+ fullName: string;
21
+
22
+ /** The rest id of the user. */
23
+ id: string;
24
+
25
+ /** Whether the user is being followed by the logged-in user. Available only when logged in. */
26
+ isFollowed?: boolean;
27
+
28
+ /** Whether the user is following the logged-in user. Available only when logged in. */
29
+ isFollowing?: boolean;
30
+
31
+ /** Whether the account is verified or not. */
32
+ isVerified: boolean;
33
+
34
+ /** The number of tweets liked by the user. */
35
+ likeCount: number;
36
+
37
+ /** The location of user as provided by user. */
38
+ location?: string;
39
+
40
+ /** The rest id of the tweet pinned in the user's profile. */
41
+ pinnedTweet?: string;
42
+
43
+ /** The url of the profile banner image. */
44
+ profileBanner?: string;
45
+
46
+ /** The url of the profile image. */
47
+ profileImage: string;
48
+
49
+ /** The number of tweets made by the user. */
50
+ statusesCount: number;
51
+
52
+ /** The username/screenname of the user. */
53
+ userName: string;
54
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The error thrown by Twitter API.
3
+ *
4
+ * @public
5
+ */
6
+ export interface ITwitterError extends Error {
7
+ /** The details of each error. */
8
+ details: ITwitterErrorDetails[];
9
+
10
+ /** The error message in the response. */
11
+ message: string;
12
+
13
+ /** The name of the error response. */
14
+ name: string;
15
+
16
+ /** The response status code. */
17
+ status: number;
18
+ }
19
+
20
+ /**
21
+ * The error details.
22
+ *
23
+ * @public
24
+ */
25
+ export interface ITwitterErrorDetails {
26
+ /** The internal error code. */
27
+ code: number;
28
+
29
+ /** The message associated with the error. */
30
+ message: string;
31
+
32
+ /** The name of the error. */
33
+ name?: string;
34
+
35
+ /** The type of error. */
36
+ type?: string;
37
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Media to be sent as payload.
3
+ *
4
+ * @internal
5
+ */
6
+ export interface IMediaVariable {
7
+ /* eslint-disable @typescript-eslint/naming-convention */
8
+
9
+ media_entities: IMediaEntityVariable[];
10
+ possibly_sensitive: boolean;
11
+
12
+ /* eslint-enable @typescript-eslint/naming-convention */
13
+ }
14
+
15
+ /**
16
+ * Each media item in the media payload.
17
+ *
18
+ * @internal
19
+ */
20
+ export interface IMediaEntityVariable {
21
+ /* eslint-disable @typescript-eslint/naming-convention */
22
+
23
+ media_id: string;
24
+ tagged_users: string[];
25
+
26
+ /* eslint-enable @typescript-eslint/naming-convention */
27
+ }
28
+
29
+ /**
30
+ * Reply specific details to be sent in payload.
31
+ *
32
+ * @internal
33
+ */
34
+ export interface IReplyVariable {
35
+ /* eslint-disable @typescript-eslint/naming-convention */
36
+
37
+ exclude_reply_user_ids: string[];
38
+ in_reply_to_tweet_id: string;
39
+
40
+ /* eslint-enable @typescript-eslint/naming-convention */
41
+ }
@@ -0,0 +1,32 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * Represents the raw data of the analytic result of the User.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IAnalytics {
9
+ __typename: string;
10
+ organic_metrics_time_series: IAnalyticsMetric[];
11
+ verified_follower_count: string;
12
+ relationship_counts: IAnalyticsRelationships;
13
+ id: string;
14
+ }
15
+
16
+ export interface IAnalyticsRelationships {
17
+ followers: number;
18
+ }
19
+
20
+ export interface IAnalyticsMetric {
21
+ metric_values: IAnalyticsMetricValue[];
22
+ timestamp: IAnalyticsTimeStamp;
23
+ }
24
+
25
+ export interface IAnalyticsMetricValue {
26
+ metric_value: number;
27
+ metric_type: string;
28
+ }
29
+
30
+ export interface IAnalyticsTimeStamp {
31
+ iso8601_time: string;
32
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Represents the raw data of a single BookmarkFolder.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IBookmarkFolder {
7
+ /** The unique identifier for the folder. */
8
+ id: string;
9
+
10
+ /** The display name of the folder. */
11
+ name: string;
12
+ }
@@ -0,0 +1,13 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * Represents a cursor object used for pagination.
5
+ *
6
+ * @public
7
+ */
8
+ export interface ICursor {
9
+ entryType: string;
10
+ __typename: string;
11
+ value: string;
12
+ cursorType: string;
13
+ }
@@ -0,0 +1,38 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * Error details for multiple errors.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IErrorData {
9
+ data: unknown;
10
+ errors: IErrorDetails[];
11
+ }
12
+
13
+ /**
14
+ * Error details of a single error.
15
+ *
16
+ * @public
17
+ */
18
+ export interface IErrorDetails {
19
+ message: string;
20
+ extensions?: IErrorExtensions;
21
+ code: number;
22
+ kind?: string;
23
+ name?: string;
24
+ source?: string;
25
+ tracing?: IErrorTracing;
26
+ }
27
+
28
+ export interface IErrorExtensions {
29
+ name: string;
30
+ source: string;
31
+ code: number;
32
+ kind: string;
33
+ tracing: IErrorTracing;
34
+ }
35
+
36
+ export interface IErrorTracing {
37
+ trace_id: string;
38
+ }
@@ -0,0 +1,40 @@
1
+ /* eslint-disable */
2
+
3
+ import { ITweet } from './Tweet';
4
+
5
+ /**
6
+ * Represents the raw data of a single Tweet with limited visibility actions.
7
+ *
8
+ * @public
9
+ */
10
+ export interface ILimitedVisibilityTweet {
11
+ __typename: string;
12
+ tweet: ITweet;
13
+ limitedActionResults: ITweetLimitedActionResults;
14
+ }
15
+
16
+ export interface ITweetLimitedActionResults {
17
+ limited_actions: ITweetLimitedAction[];
18
+ }
19
+
20
+ export interface ITweetLimitedAction {
21
+ action: string;
22
+ prompt: ILimitedActionPrompt;
23
+ }
24
+
25
+ export interface ILimitedActionPrompt {
26
+ __typename: string;
27
+ cta_type: string;
28
+ headline: IPromptHeadline;
29
+ subtext: IPromptSubtext;
30
+ }
31
+
32
+ export interface IPromptHeadline {
33
+ text: string;
34
+ entities: any[];
35
+ }
36
+
37
+ export interface IPromptSubtext {
38
+ text: string;
39
+ entities: any[];
40
+ }
@@ -0,0 +1,50 @@
1
+ /* eslint-disable */
2
+
3
+ import { IDataResult } from '../composite/DataResult';
4
+ import { IUser } from './User';
5
+
6
+ /**
7
+ * Represents the raw data of a single List.
8
+ *
9
+ * @public
10
+ */
11
+ export interface IList {
12
+ created_at: number;
13
+ default_banner_media: IDefaultBannerMedia;
14
+ default_banner_media_results: IDefaultBannerMediaResults;
15
+ description: string;
16
+ following: boolean;
17
+ id: string;
18
+ id_str: string;
19
+ is_member: boolean;
20
+ member_count: number;
21
+ mode: string;
22
+ muting: boolean;
23
+ name: string;
24
+ subscriber_count: number;
25
+ user_results: IDataResult<IUser>;
26
+ facepile_urls: string[];
27
+ followers_context: string;
28
+ members_context: string;
29
+ }
30
+
31
+ export interface IDefaultBannerMedia {
32
+ media_info: IBannerMediaInfo;
33
+ }
34
+
35
+ export interface IDefaultBannerMediaResults {
36
+ result: IBannerMediaResult;
37
+ }
38
+
39
+ export interface IBannerMediaResult {
40
+ id: string;
41
+ media_key: string;
42
+ media_id: string;
43
+ media_info: IBannerMediaInfo;
44
+ }
45
+
46
+ export interface IBannerMediaInfo {
47
+ original_img_url: string;
48
+ original_img_width: number;
49
+ original_img_height: number;
50
+ }
@@ -0,0 +1,53 @@
1
+ /* eslint-disable */
2
+
3
+ import { RawMediaType } from '../../../enums/raw/Media';
4
+
5
+ /**
6
+ * Represents the raw data of a single Media.
7
+ *
8
+ * @public
9
+ */
10
+ export interface IMedia {
11
+ display_url: string;
12
+ expanded_url: string;
13
+ id_str: string;
14
+ media_url_https: string;
15
+ type: RawMediaType;
16
+ url: string;
17
+ }
18
+
19
+ export interface IExtendedMedia extends IMedia {
20
+ media_key: string;
21
+ ext_media_availability: IMediaAvailability;
22
+ additional_media_info?: IAdditionalMediaInfo;
23
+ mediaStats?: IMediaStats;
24
+ video_info?: IVideoInfo;
25
+ }
26
+
27
+ export interface IMediaAvailability {
28
+ status: string;
29
+ }
30
+
31
+ export interface IAdditionalMediaInfo {
32
+ monetizable: boolean;
33
+ }
34
+
35
+ export interface IMediaStats {
36
+ viewCount: number;
37
+ }
38
+
39
+ export interface IMediaAvailability {
40
+ status: string;
41
+ }
42
+
43
+ export interface IVideoInfo {
44
+ aspect_ratio: number[];
45
+ duration_millis: number;
46
+ variants: IVideoVariant[];
47
+ }
48
+
49
+ export interface IVideoVariant {
50
+ bitrate: number;
51
+ content_type: string;
52
+ url: string;
53
+ }
@@ -0,0 +1,22 @@
1
+ /* eslint-disable */
2
+
3
+ import { ConversationMessage } from '../dm/Conversation';
4
+ import { Message } from '../dm/InboxInitial';
5
+ import { TimelineMessage } from '../dm/InboxTimeline';
6
+
7
+ // Extract the message_data types
8
+ type ConversationMessageData = ConversationMessage['message_data'];
9
+ type InboxMessageData = Message['message_data'];
10
+ type TimelineMessageData = TimelineMessage['message_data'];
11
+
12
+ // Create unified message_data type that includes all possible fields
13
+ type UnifiedMessageData = InboxMessageData & Partial<ConversationMessageData> & Partial<TimelineMessageData>;
14
+
15
+ export interface IMessage {
16
+ id: string;
17
+ time: string;
18
+ affects_sort?: boolean;
19
+ request_id: string;
20
+ conversation_id: string;
21
+ message_data: UnifiedMessageData;
22
+ }
@@ -0,0 +1,66 @@
1
+ /* eslint-disable */
2
+
3
+ import { RawNotificationType } from '../../../enums/raw/Notification';
4
+ import { IDataResult } from '../composite/DataResult';
5
+ import { ITweet } from './Tweet';
6
+ import { IUser } from './User';
7
+
8
+ /**
9
+ * Represents the raw data of a single Notification.
10
+ *
11
+ * @public
12
+ */
13
+ export interface INotification {
14
+ itemType: string;
15
+ __typename: string;
16
+ id: string;
17
+ notification_icon: RawNotificationType;
18
+ rich_message: INotificationRichMessage;
19
+ notification_url: INotificationUrl;
20
+ template: INoticiationTemplate;
21
+ timestamp_ms: string;
22
+ }
23
+
24
+ export interface INotificationRichMessage {
25
+ rtl: boolean;
26
+ text: string;
27
+ entities: INotificationEntity[];
28
+ }
29
+
30
+ export interface INotificationEntity {
31
+ fromIndex: number;
32
+ toIndex: number;
33
+ ref: INotificationEntityRef;
34
+ }
35
+
36
+ export interface INotificationEntityRef {
37
+ type: string;
38
+ user_results: IDataResult<IUser>;
39
+ }
40
+
41
+ export interface INotificationUrl {
42
+ url: string;
43
+ urlType: string;
44
+ urtEndpointOptions?: INotificationUrtEndpointOptions;
45
+ }
46
+
47
+ export interface INotificationUrtEndpointOptions {
48
+ cacheId: string;
49
+ title: string;
50
+ }
51
+
52
+ export interface INoticiationTemplate {
53
+ __typename: string;
54
+ target_objects: INotificationTargetObject[];
55
+ from_users: INotificationFromUser[];
56
+ }
57
+
58
+ export interface INotificationTargetObject {
59
+ __typename: string;
60
+ tweet_results: IDataResult<ITweet>;
61
+ }
62
+
63
+ export interface INotificationFromUser {
64
+ __typename: string;
65
+ user_results: IDataResult<IUser>;
66
+ }