rettiwt-api 6.0.7 → 6.1.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 (220) hide show
  1. package/.github/ISSUE_TEMPLATE/bug-report.yml +57 -0
  2. package/.github/ISSUE_TEMPLATE/feature-request.yml +20 -0
  3. package/.github/ISSUE_TEMPLATE/question.yml +15 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
  5. package/.github/workflows/ci.yml +33 -0
  6. package/.nvmrc +1 -0
  7. package/README.md +30 -6
  8. package/dist/Rettiwt.d.ts +3 -0
  9. package/dist/Rettiwt.js +4 -0
  10. package/dist/Rettiwt.js.map +1 -1
  11. package/dist/cli.js +2 -0
  12. package/dist/cli.js.map +1 -1
  13. package/dist/collections/Extractors.d.ts +24 -0
  14. package/dist/collections/Extractors.js +14 -0
  15. package/dist/collections/Extractors.js.map +1 -1
  16. package/dist/collections/Groups.js +11 -0
  17. package/dist/collections/Groups.js.map +1 -1
  18. package/dist/collections/Requests.js +12 -0
  19. package/dist/collections/Requests.js.map +1 -1
  20. package/dist/commands/DirectMessage.d.ts +10 -0
  21. package/dist/commands/DirectMessage.js +57 -0
  22. package/dist/commands/DirectMessage.js.map +1 -0
  23. package/dist/commands/List.js +44 -3
  24. package/dist/commands/List.js.map +1 -1
  25. package/dist/commands/Tweet.js +29 -1
  26. package/dist/commands/Tweet.js.map +1 -1
  27. package/dist/commands/User.js +39 -1
  28. package/dist/commands/User.js.map +1 -1
  29. package/dist/enums/Data.d.ts +3 -1
  30. package/dist/enums/Data.js +2 -0
  31. package/dist/enums/Data.js.map +1 -1
  32. package/dist/enums/Resource.d.ts +11 -0
  33. package/dist/enums/Resource.js +12 -0
  34. package/dist/enums/Resource.js.map +1 -1
  35. package/dist/enums/raw/Analytics.d.ts +6 -3
  36. package/dist/enums/raw/Analytics.js +5 -2
  37. package/dist/enums/raw/Analytics.js.map +1 -1
  38. package/dist/index.d.ts +15 -0
  39. package/dist/index.js +8 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/models/args/FetchArgs.d.ts +9 -0
  42. package/dist/models/args/FetchArgs.js +16 -0
  43. package/dist/models/args/FetchArgs.js.map +1 -1
  44. package/dist/models/args/PostArgs.d.ts +1 -0
  45. package/dist/models/args/PostArgs.js +2 -0
  46. package/dist/models/args/PostArgs.js.map +1 -1
  47. package/dist/models/data/Analytics.d.ts +43 -0
  48. package/dist/models/data/Analytics.js +92 -0
  49. package/dist/models/data/Analytics.js.map +1 -0
  50. package/dist/models/data/Conversation.d.ts +93 -0
  51. package/dist/models/data/Conversation.js +293 -0
  52. package/dist/models/data/Conversation.js.map +1 -0
  53. package/dist/models/data/CursoredData.d.ts +2 -1
  54. package/dist/models/data/CursoredData.js +6 -1
  55. package/dist/models/data/CursoredData.js.map +1 -1
  56. package/dist/models/data/DirectMessage.d.ts +105 -0
  57. package/dist/models/data/DirectMessage.js +284 -0
  58. package/dist/models/data/DirectMessage.js.map +1 -0
  59. package/dist/models/data/Inbox.d.ts +44 -0
  60. package/dist/models/data/Inbox.js +106 -0
  61. package/dist/models/data/Inbox.js.map +1 -0
  62. package/dist/models/data/List.d.ts +20 -0
  63. package/dist/models/data/List.js +50 -1
  64. package/dist/models/data/List.js.map +1 -1
  65. package/dist/models/data/Tweet.d.ts +6 -6
  66. package/dist/models/data/Tweet.js +4 -2
  67. package/dist/models/data/Tweet.js.map +1 -1
  68. package/dist/models/data/User.d.ts +2 -0
  69. package/dist/models/data/User.js +6 -0
  70. package/dist/models/data/User.js.map +1 -1
  71. package/dist/requests/DirectMessage.d.ts +28 -0
  72. package/dist/requests/DirectMessage.js +149 -0
  73. package/dist/requests/DirectMessage.js.map +1 -0
  74. package/dist/requests/List.d.ts +10 -0
  75. package/dist/requests/List.js +52 -0
  76. package/dist/requests/List.js.map +1 -1
  77. package/dist/requests/Tweet.d.ts +8 -0
  78. package/dist/requests/Tweet.js +30 -0
  79. package/dist/requests/Tweet.js.map +1 -1
  80. package/dist/requests/User.d.ts +8 -1
  81. package/dist/requests/User.js +67 -8
  82. package/dist/requests/User.js.map +1 -1
  83. package/dist/services/public/DirectMessageService.d.ts +100 -0
  84. package/dist/services/public/DirectMessageService.js +143 -0
  85. package/dist/services/public/DirectMessageService.js.map +1 -0
  86. package/dist/services/public/FetcherService.d.ts +3 -2
  87. package/dist/services/public/FetcherService.js +64 -3
  88. package/dist/services/public/FetcherService.js.map +1 -1
  89. package/dist/services/public/ListService.d.ts +85 -0
  90. package/dist/services/public/ListService.js +111 -0
  91. package/dist/services/public/ListService.js.map +1 -1
  92. package/dist/services/public/TweetService.d.ts +56 -0
  93. package/dist/services/public/TweetService.js +72 -0
  94. package/dist/services/public/TweetService.js.map +1 -1
  95. package/dist/services/public/UserService.d.ts +61 -2
  96. package/dist/services/public/UserService.js +89 -0
  97. package/dist/services/public/UserService.js.map +1 -1
  98. package/dist/types/args/FetchArgs.d.ts +69 -12
  99. package/dist/types/args/PostArgs.d.ts +29 -11
  100. package/dist/types/data/Analytics.d.ts +42 -0
  101. package/dist/types/data/Analytics.js +3 -0
  102. package/dist/types/data/Analytics.js.map +1 -0
  103. package/dist/types/data/Conversation.d.ts +32 -0
  104. package/dist/types/data/Conversation.js +3 -0
  105. package/dist/types/data/Conversation.js.map +1 -0
  106. package/dist/types/data/CursoredData.d.ts +4 -1
  107. package/dist/types/data/DirectMessage.d.ts +25 -0
  108. package/dist/types/data/DirectMessage.js +3 -0
  109. package/dist/types/data/DirectMessage.js.map +1 -0
  110. package/dist/types/data/Inbox.d.ts +18 -0
  111. package/dist/types/data/Inbox.js +3 -0
  112. package/dist/types/data/Inbox.js.map +1 -0
  113. package/dist/types/data/List.d.ts +5 -1
  114. package/dist/types/data/Tweet.d.ts +6 -6
  115. package/dist/types/data/User.d.ts +4 -0
  116. package/dist/types/raw/base/Analytic.d.ts +6 -1
  117. package/dist/types/raw/base/Message.d.ts +16 -0
  118. package/dist/types/raw/base/Message.js +4 -0
  119. package/dist/types/raw/base/Message.js.map +1 -0
  120. package/dist/types/raw/base/Tweet.d.ts +6 -6
  121. package/dist/types/raw/base/User.d.ts +2 -1
  122. package/dist/types/raw/composite/TimelineList.d.ts +9 -0
  123. package/dist/types/raw/composite/TimelineList.js +3 -0
  124. package/dist/types/raw/composite/TimelineList.js.map +1 -0
  125. package/dist/types/raw/dm/Conversation.d.ts +55 -0
  126. package/dist/types/raw/dm/Conversation.js +4 -0
  127. package/dist/types/raw/dm/Conversation.js.map +1 -0
  128. package/dist/types/raw/dm/InboxInitial.d.ts +137 -0
  129. package/dist/types/raw/dm/InboxInitial.js +4 -0
  130. package/dist/types/raw/dm/InboxInitial.js.map +1 -0
  131. package/dist/types/raw/dm/InboxTimeline.d.ts +287 -0
  132. package/dist/types/raw/dm/InboxTimeline.js +4 -0
  133. package/dist/types/raw/dm/InboxTimeline.js.map +1 -0
  134. package/dist/types/raw/dm/UserUpdates.d.ts +41 -0
  135. package/dist/types/raw/dm/UserUpdates.js +4 -0
  136. package/dist/types/raw/dm/UserUpdates.js.map +1 -0
  137. package/dist/types/raw/list/AddMember.d.ts +151 -0
  138. package/dist/types/raw/list/AddMember.js +4 -0
  139. package/dist/types/raw/list/AddMember.js.map +1 -0
  140. package/dist/types/raw/list/Details.d.ts +44 -13
  141. package/dist/types/raw/list/RemoveMember.d.ts +150 -0
  142. package/dist/types/raw/list/RemoveMember.js +4 -0
  143. package/dist/types/raw/list/RemoveMember.js.map +1 -0
  144. package/dist/types/raw/tweet/Bookmark.d.ts +12 -0
  145. package/dist/types/raw/tweet/Bookmark.js +4 -0
  146. package/dist/types/raw/tweet/Bookmark.js.map +1 -0
  147. package/dist/types/raw/tweet/Unbookmark.d.ts +11 -0
  148. package/dist/types/raw/tweet/Unbookmark.js +4 -0
  149. package/dist/types/raw/tweet/Unbookmark.js.map +1 -0
  150. package/dist/types/raw/user/Analytics.d.ts +6 -18
  151. package/dist/types/raw/user/Analytics.js +0 -1
  152. package/dist/types/raw/user/Analytics.js.map +1 -1
  153. package/dist/types/raw/user/Lists.d.ts +319 -0
  154. package/dist/types/raw/user/Lists.js +4 -0
  155. package/dist/types/raw/user/Lists.js.map +1 -0
  156. package/eslint.config.mjs +1 -1
  157. package/package.json +13 -6
  158. package/playground/.env.example +1 -0
  159. package/playground/README.md +53 -0
  160. package/playground/index.js +15 -0
  161. package/playground/package.json +15 -0
  162. package/src/Rettiwt.ts +5 -0
  163. package/src/cli.ts +2 -0
  164. package/src/collections/Extractors.ts +29 -0
  165. package/src/collections/Groups.ts +11 -0
  166. package/src/collections/Requests.ts +20 -0
  167. package/src/commands/DirectMessage.ts +62 -0
  168. package/src/commands/List.ts +44 -3
  169. package/src/commands/Tweet.ts +29 -1
  170. package/src/commands/User.ts +65 -1
  171. package/src/enums/Data.ts +2 -0
  172. package/src/enums/Resource.ts +13 -0
  173. package/src/enums/raw/Analytics.ts +5 -2
  174. package/src/index.ts +15 -0
  175. package/src/models/args/FetchArgs.ts +17 -0
  176. package/src/models/args/PostArgs.ts +2 -0
  177. package/src/models/data/Analytics.ts +97 -0
  178. package/src/models/data/Conversation.ts +344 -0
  179. package/src/models/data/CursoredData.ts +7 -2
  180. package/src/models/data/DirectMessage.ts +335 -0
  181. package/src/models/data/Inbox.ts +124 -0
  182. package/src/models/data/List.ts +60 -1
  183. package/src/models/data/Tweet.ts +10 -8
  184. package/src/models/data/User.ts +6 -0
  185. package/src/requests/DirectMessage.ts +233 -0
  186. package/src/requests/List.ts +58 -0
  187. package/src/requests/Tweet.ts +32 -0
  188. package/src/requests/User.ts +70 -7
  189. package/src/services/public/DirectMessageService.ts +159 -0
  190. package/src/services/public/FetcherService.ts +86 -4
  191. package/src/services/public/ListService.ts +127 -0
  192. package/src/services/public/TweetService.ts +82 -0
  193. package/src/services/public/UserService.ts +110 -2
  194. package/src/types/args/FetchArgs.ts +77 -12
  195. package/src/types/args/PostArgs.ts +31 -11
  196. package/src/types/data/Analytics.ts +58 -0
  197. package/src/types/data/Conversation.ts +44 -0
  198. package/src/types/data/CursoredData.ts +4 -1
  199. package/src/types/data/DirectMessage.ts +33 -0
  200. package/src/types/data/Inbox.ts +23 -0
  201. package/src/types/data/List.ts +7 -1
  202. package/src/types/data/Tweet.ts +6 -6
  203. package/src/types/data/User.ts +6 -0
  204. package/src/types/raw/base/Analytic.ts +7 -1
  205. package/src/types/raw/base/Message.ts +22 -0
  206. package/src/types/raw/base/Tweet.ts +6 -6
  207. package/src/types/raw/base/User.ts +2 -1
  208. package/src/types/raw/composite/TimelineList.ts +10 -0
  209. package/src/types/raw/dm/Conversation.ts +59 -0
  210. package/src/types/raw/dm/InboxInitial.ts +155 -0
  211. package/src/types/raw/dm/InboxTimeline.ts +301 -0
  212. package/src/types/raw/dm/UserUpdates.ts +46 -0
  213. package/src/types/raw/list/AddMember.ts +175 -0
  214. package/src/types/raw/list/Details.ts +52 -13
  215. package/src/types/raw/list/RemoveMember.ts +174 -0
  216. package/src/types/raw/tweet/Bookmark.ts +14 -0
  217. package/src/types/raw/tweet/Unbookmark.ts +14 -0
  218. package/src/types/raw/user/Analytics.ts +6 -22
  219. package/src/types/raw/user/Lists.ts +378 -0
  220. package/tsconfig.json +1 -1
@@ -9,13 +9,15 @@ export interface IPostArgs {
9
9
  *
10
10
  * @remarks
11
11
  * Required only when posting using the following resources:
12
- * - {@link EResourceType.TWEET_LIKE}
13
- * - {@link EResourceType.TWEET_RETWEET}
14
- * - {@link EResourceType.TWEET_UNLIKE}
15
- * - {@link EResourceType.TWEET_UNPOST}
16
- * - {@link EResourceType.TWEET_UNRETWEET}
17
- * - {@link EResourceType.USER_FOLLOW}
18
- * - {@link EResourceType.USER_UNFOLLOW}
12
+ * - {@link ResourceType.TWEET_BOOKMARK}
13
+ * - {@link ResourceType.TWEET_LIKE}
14
+ * - {@link ResourceType.TWEET_RETWEET}
15
+ * - {@link ResourceType.TWEET_UNBOOKMARK}
16
+ * - {@link ResourceType.TWEET_UNLIKE}
17
+ * - {@link ResourceType.TWEET_UNPOST}
18
+ * - {@link ResourceType.TWEET_UNRETWEET}
19
+ * - {@link ResourceType.USER_FOLLOW}
20
+ * - {@link ResourceType.USER_UNFOLLOW}
19
21
  */
20
22
  id?: string;
21
23
 
@@ -23,7 +25,7 @@ export interface IPostArgs {
23
25
  * The tweet that is to be posted.
24
26
  *
25
27
  * @remarks
26
- * Required only when posting a tweet using {@link EResourceType.TWEET_POST}
28
+ * Required only when posting a tweet using {@link ResourceType.TWEET_POST}
27
29
  */
28
30
  tweet?: INewTweet;
29
31
 
@@ -32,11 +34,29 @@ export interface IPostArgs {
32
34
  *
33
35
  * @remarks
34
36
  * Required only when uploading a media using the following resources:
35
- * - {@link EResourceType.MEDIA_UPLOAD_APPEND}
36
- * - {@link EResourceType.MEDIA_UPLOAD_FINALIZE}
37
- * - {@link EResourceType.MEDIA_UPLOAD_INITIALIZE}
37
+ * - {@link ResourceType.MEDIA_UPLOAD_APPEND}
38
+ * - {@link ResourceType.MEDIA_UPLOAD_FINALIZE}
39
+ * - {@link ResourceType.MEDIA_UPLOAD_INITIALIZE}
38
40
  */
39
41
  upload?: IUploadArgs;
42
+
43
+ /**
44
+ * The id of the target user.
45
+ *
46
+ * @remarks
47
+ * Required only for the following resources:
48
+ * - {@link ResourceType.LIST_MEMBER_ADD}
49
+ * - {@link ResourceType.LIST_MEMBER_REMOVE}
50
+ */
51
+ userId?: string;
52
+
53
+ /**
54
+ * The id of the conversation to delete.
55
+ *
56
+ * @remarks
57
+ * Required only when deleting a conversation using {@link ResourceType.DM_DELETE_CONVERSATION}
58
+ */
59
+ conversationId?: string;
40
60
  }
41
61
 
42
62
  /**
@@ -0,0 +1,58 @@
1
+ import type { IAnalyticsMetric } from '../../types/raw/base/Analytic';
2
+ /**
3
+ * The details of the analytic result of the connected User.
4
+ *
5
+ * @public
6
+ */
7
+ export interface IAnalytics {
8
+ /** The creation date of user's account. */
9
+ createdAt: string;
10
+
11
+ /** Total followers number */
12
+ followers: number;
13
+
14
+ /** Total verified followers */
15
+ verifiedFollowers: number;
16
+
17
+ /** Total impressions on the given period */
18
+ impressions: number;
19
+
20
+ /** Total profile visits on the given period */
21
+ profileVisits: number;
22
+
23
+ /** Total Engagements on the given period */
24
+ engagements: number;
25
+
26
+ /** Total Follows on the given period */
27
+ follows: number;
28
+
29
+ /** Total Replies on the given period */
30
+ replies: number;
31
+
32
+ /** Total Likes on the given period */
33
+ likes: number;
34
+
35
+ /** Total Retweets on the given period */
36
+ retweets: number;
37
+
38
+ /** Total Bookmark on the given period */
39
+ bookmarks: number;
40
+
41
+ /** Total Shares on the given period */
42
+ shares: number;
43
+
44
+ /** Total CreateTweets on the given period */
45
+ createTweets: number;
46
+
47
+ /** Total CreateQuote on the given period */
48
+ createQuote: number;
49
+
50
+ /** Total Unfollows on the given period */
51
+ unfollows: number;
52
+
53
+ /** Total CreateReply on the given period */
54
+ createReply: number;
55
+
56
+ /** Organic metrics times series */
57
+ organicMetricsTimeSeries: IAnalyticsMetric[];
58
+ }
@@ -0,0 +1,44 @@
1
+ import { IDirectMessage } from './DirectMessage';
2
+
3
+ /**
4
+ * The details of a single conversation.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IConversation {
9
+ /** The unique identifier of the conversation. */
10
+ id: string;
11
+
12
+ /** The type of conversation (ONE_TO_ONE or GROUP_DM). */
13
+ type: 'ONE_TO_ONE' | 'GROUP_DM';
14
+
15
+ /** Array of participant user IDs. */
16
+ participants: string[];
17
+
18
+ /** The name of the conversation (for group DMs). */
19
+ name?: string;
20
+
21
+ /** URL to the conversation avatar (for group DMs). */
22
+ avatarUrl?: string;
23
+
24
+ /** Whether the conversation is trusted. */
25
+ trusted: boolean;
26
+
27
+ /** Whether the conversation is muted. */
28
+ muted: boolean;
29
+
30
+ /** Whether notifications are disabled. */
31
+ notificationsDisabled: boolean;
32
+
33
+ /** The timestamp of the last activity (ISO 8601 format). */
34
+ lastActivityAt: string;
35
+
36
+ /** The ID of the last message. */
37
+ lastMessageId?: string;
38
+
39
+ /** Whether there are more messages to load. */
40
+ hasMore: boolean;
41
+
42
+ /** Array of messages in this conversation. */
43
+ messages: IDirectMessage[];
44
+ }
@@ -1,3 +1,6 @@
1
+ import { IConversation } from './Conversation';
2
+ import { IDirectMessage } from './DirectMessage';
3
+ import { IList } from './List';
1
4
  import { INotification } from './Notification';
2
5
  import { ITweet } from './Tweet';
3
6
  import { IUser } from './User';
@@ -9,7 +12,7 @@ import { IUser } from './User';
9
12
  *
10
13
  * @public
11
14
  */
12
- export interface ICursoredData<T extends INotification | ITweet | IUser> {
15
+ export interface ICursoredData<T extends IDirectMessage | IConversation | INotification | ITweet | IUser | IList> {
13
16
  /** The batch of data of the given type. */
14
17
  list: T[];
15
18
 
@@ -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
+ }
@@ -7,15 +7,21 @@ export interface IList {
7
7
  /** The date and time of creation of the list, int UTC string format. */
8
8
  createdAt: string;
9
9
 
10
- /** The rest id of the user who created the list. */
10
+ /** The ID of the user who created the list. */
11
11
  createdBy: string;
12
12
 
13
13
  /** The list description. */
14
14
  description?: string;
15
15
 
16
+ /** Whether the user is following the list or not. */
17
+ isFollowing: boolean;
18
+
16
19
  /** The rest id of the list. */
17
20
  id: string;
18
21
 
22
+ /** Whether the user is a member of the list or not. */
23
+ isMember: boolean;
24
+
19
25
  /** The number of memeber of the list. */
20
26
  memberCount: number;
21
27
 
@@ -9,7 +9,7 @@ import { IUser } from './User';
9
9
  */
10
10
  export interface ITweet {
11
11
  /** The number of bookmarks of a tweet. */
12
- bookmarkCount: number;
12
+ bookmarkCount?: number;
13
13
 
14
14
  /** The ID of tweet which started the current conversation. */
15
15
  conversationId: string;
@@ -30,25 +30,25 @@ export interface ITweet {
30
30
  lang: string;
31
31
 
32
32
  /** The number of likes of the tweet. */
33
- likeCount: number;
33
+ likeCount?: number;
34
34
 
35
35
  /** The urls of the media contents of the tweet (if any). */
36
36
  media?: ITweetMedia[];
37
37
 
38
38
  /** The number of quotes of the tweet. */
39
- quoteCount: number;
39
+ quoteCount?: number;
40
40
 
41
41
  /** The tweet which is quoted in the tweet. */
42
42
  quoted?: ITweet;
43
43
 
44
44
  /** The number of replies to the tweet. */
45
- replyCount: number;
45
+ replyCount?: number;
46
46
 
47
47
  /** The rest id of the tweet to which the tweet is a reply. */
48
48
  replyTo?: string;
49
49
 
50
50
  /** The number of retweets of the tweet. */
51
- retweetCount: number;
51
+ retweetCount?: number;
52
52
 
53
53
  /** The tweet which is retweeted in this tweet (if any). */
54
54
  retweetedTweet?: ITweet;
@@ -60,7 +60,7 @@ export interface ITweet {
60
60
  url: string;
61
61
 
62
62
  /** The number of views of a tweet. */
63
- viewCount: number;
63
+ viewCount?: number;
64
64
  }
65
65
 
66
66
  /**
@@ -22,6 +22,12 @@ export interface IUser {
22
22
  /** The rest id of the user. */
23
23
  id: string;
24
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
+
25
31
  /** Whether the account is verified or not. */
26
32
  isVerified: boolean;
27
33
 
@@ -8,11 +8,17 @@
8
8
  export interface IAnalytics {
9
9
  __typename: string;
10
10
  organic_metrics_time_series: IAnalyticsMetric[];
11
+ verified_follower_count: string;
12
+ relationship_counts: IAnalyticsRelationships;
11
13
  id: string;
12
14
  }
13
15
 
16
+ export interface IAnalyticsRelationships {
17
+ followers: number;
18
+ }
19
+
14
20
  export interface IAnalyticsMetric {
15
- metric_value: IAnalyticsMetricValue[];
21
+ metric_values: IAnalyticsMetricValue[];
16
22
  timestamp: IAnalyticsTimeStamp;
17
23
  }
18
24
 
@@ -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
+ }
@@ -17,7 +17,7 @@ export interface ITweet {
17
17
  edit_control: ITweetEditControl;
18
18
  edit_perspective: ITweetEditPerspective;
19
19
  is_translatable: boolean;
20
- views: ITweetViews;
20
+ views?: ITweetViews;
21
21
  source: string;
22
22
  quoted_status_result: IDataResult<ITweet | ILimitedVisibilityTweet>;
23
23
  note_tweet: ITweetNote;
@@ -78,14 +78,14 @@ export interface ITweetNoteMedia {
78
78
  }
79
79
 
80
80
  export interface ITweetLegacy {
81
- bookmark_count: number;
81
+ bookmark_count?: number;
82
82
  bookmarked: boolean;
83
83
  created_at: string;
84
84
  conversation_id_str: string;
85
85
  display_text_range: number[];
86
86
  entities: IEntities;
87
87
  extended_entities: IExtendedEntities;
88
- favorite_count: number;
88
+ favorite_count?: number;
89
89
  favorited: boolean;
90
90
  full_text: string;
91
91
  in_reply_to_status_id_str: string;
@@ -93,10 +93,10 @@ export interface ITweetLegacy {
93
93
  lang: string;
94
94
  possibly_sensitive: boolean;
95
95
  possibly_sensitive_editable: boolean;
96
- quote_count: number;
96
+ quote_count?: number;
97
97
  quoted_status_id_str: string;
98
- reply_count: number;
99
- retweet_count: number;
98
+ reply_count?: number;
99
+ retweet_count?: number;
100
100
  retweeted: boolean;
101
101
  user_id_str: string;
102
102
  id_str: string;
@@ -82,7 +82,8 @@ export interface IAffiliateHighlightedMentionResultLegacy {
82
82
  }
83
83
 
84
84
  export interface IUserLegacy {
85
- following: boolean;
85
+ followed_by?: boolean;
86
+ following?: boolean;
86
87
  can_dm: boolean;
87
88
  can_media_tag: boolean;
88
89
  created_at: string;
@@ -0,0 +1,10 @@
1
+ import { IList } from '../base/List';
2
+
3
+ /**
4
+ * Represents the raw data of a single timeline tweet.
5
+ *
6
+ * @public
7
+ */
8
+ export interface ITimelineList {
9
+ list: IList;
10
+ }
@@ -0,0 +1,59 @@
1
+ /* eslint-disable */
2
+
3
+ import { Users, Conversations } from './InboxInitial';
4
+
5
+ /**
6
+ * The raw data received when fetching a specific conversation timeline.
7
+ *
8
+ * @public
9
+ */
10
+ export interface IConversationTimelineResponse {
11
+ conversation_timeline: ConversationTimeline;
12
+ }
13
+
14
+ interface ConversationTimeline {
15
+ status: 'HAS_MORE' | 'AT_END';
16
+ min_entry_id: string;
17
+ max_entry_id: string;
18
+ entries: ConversationEntry[];
19
+ users: Users;
20
+ conversations: Conversations;
21
+ }
22
+
23
+ type ConversationEntry = { message: ConversationMessage } | { trust_conversation: TrustConversation };
24
+
25
+ export interface ConversationMessage {
26
+ id: string;
27
+ time: string;
28
+ request_id: string;
29
+ conversation_id: string;
30
+ message_data: ConversationMessageData;
31
+ }
32
+
33
+ interface ConversationMessageData {
34
+ id: string;
35
+ time: string;
36
+ recipient_id: string;
37
+ sender_id: string;
38
+ text: string;
39
+ edit_count?: number;
40
+ message_reactions?: MessageReaction[];
41
+ }
42
+
43
+ interface MessageReaction {
44
+ id: string;
45
+ time: string;
46
+ conversation_id: string;
47
+ message_id: string;
48
+ reaction_key: string;
49
+ emoji_reaction: string;
50
+ sender_id: string;
51
+ }
52
+
53
+ interface TrustConversation {
54
+ id: string;
55
+ time: string;
56
+ request_id: string;
57
+ conversation_id: string;
58
+ reason: string; // e.g., "accept"
59
+ }
@@ -0,0 +1,155 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * The raw data received when fetching the initial state of the DM inbox.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IInboxInitialResponse {
9
+ inbox_initial_state: InboxInitialState;
10
+ }
11
+
12
+ export interface InboxInitialState {
13
+ last_seen_event_id: string;
14
+ trusted_last_seen_event_id: string;
15
+ untrusted_last_seen_event_id: string;
16
+ cursor: string;
17
+ inbox_timelines: InboxTimelines;
18
+ entries: Entry[];
19
+ users: Users;
20
+ conversations: Conversations;
21
+ }
22
+
23
+ interface InboxTimelines {
24
+ trusted: TimelineStatus;
25
+ untrusted: TimelineStatus;
26
+ untrusted_low_quality: TimelineStatus;
27
+ }
28
+
29
+ interface TimelineStatus {
30
+ status: string; // "HAS_MORE" | "AT_END"
31
+ min_entry_id: string;
32
+ }
33
+
34
+ interface Entry {
35
+ message: Message;
36
+ }
37
+
38
+ export interface Message {
39
+ id: string;
40
+ time: string;
41
+ affects_sort: boolean;
42
+ request_id: string;
43
+ conversation_id: string;
44
+ message_data: MessageData;
45
+ }
46
+
47
+ interface MessageData {
48
+ id: string;
49
+ time: string;
50
+ recipient_id: string;
51
+ sender_id: string;
52
+ text: string;
53
+ edit_count: number;
54
+ }
55
+
56
+ export interface Users {
57
+ [userId: string]: User;
58
+ }
59
+
60
+ interface User {
61
+ id: number;
62
+ id_str: string;
63
+ name: string;
64
+ screen_name: string;
65
+ profile_image_url: string;
66
+ profile_image_url_https: string;
67
+ following: boolean;
68
+ follow_request_sent: boolean;
69
+ description: string;
70
+ entities: UserEntities;
71
+ verified: boolean;
72
+ is_blue_verified: boolean;
73
+ protected: boolean;
74
+ blocking: boolean;
75
+ subscribed_by: boolean;
76
+ can_media_tag: boolean;
77
+ dm_blocked_by: boolean;
78
+ dm_blocking: boolean;
79
+ created_at: string;
80
+ friends_count: number;
81
+ followers_count: number;
82
+ }
83
+
84
+ interface UserEntities {
85
+ url: UrlEntity;
86
+ description: DescriptionEntity;
87
+ }
88
+
89
+ interface UrlEntity {
90
+ urls: UrlInfo[];
91
+ }
92
+
93
+ interface DescriptionEntity {
94
+ urls: UrlInfo[];
95
+ }
96
+
97
+ interface UrlInfo {
98
+ url: string;
99
+ expanded_url: string;
100
+ display_url: string;
101
+ indices: [number, number];
102
+ }
103
+
104
+ export interface Conversations {
105
+ [conversationId: string]: Conversation;
106
+ }
107
+
108
+ export interface Conversation {
109
+ conversation_id: string;
110
+ type: 'GROUP_DM' | 'ONE_TO_ONE';
111
+ sort_event_id: string;
112
+ sort_timestamp: string;
113
+ participants: Participant[];
114
+ nsfw: boolean;
115
+ notifications_disabled: boolean;
116
+ mention_notifications_disabled: boolean;
117
+ last_read_event_id: string;
118
+ trusted: boolean;
119
+ low_quality: boolean;
120
+ muted: boolean;
121
+ status: 'HAS_MORE' | 'AT_END';
122
+ min_entry_id: string;
123
+ max_entry_id: string;
124
+ create_time?: string; // Only for GROUP_DM
125
+ created_by_user_id?: string; // Only for GROUP_DM
126
+ name?: string; // Only for GROUP_DM
127
+ avatar_image_https?: string; // Only for GROUP_DM
128
+ avatar?: ConversationAvatar; // Only for GROUP_DM
129
+ read_only?: boolean; // Only for ONE_TO_ONE
130
+ social_proof?: SocialProof[]; // Only for untrusted conversations
131
+ }
132
+
133
+ interface ConversationAvatar {
134
+ image: {
135
+ original_info: {
136
+ url: string;
137
+ width: number;
138
+ height: number;
139
+ };
140
+ };
141
+ }
142
+
143
+ interface Participant {
144
+ user_id: string;
145
+ join_time?: string; // Only for GROUP_DM
146
+ last_read_event_id?: string;
147
+ join_conversation_event_id?: string; // Only for GROUP_DM
148
+ is_admin?: boolean; // Only for GROUP_DM
149
+ }
150
+
151
+ export interface SocialProof {
152
+ proof_type: string; // e.g., "mutual_friends"
153
+ users: any[]; // Array of users (structure depends on proof_type)
154
+ total: number;
155
+ }