rettiwt-api 6.0.8 → 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.
- package/.github/ISSUE_TEMPLATE/bug-report.yml +57 -0
- package/.github/ISSUE_TEMPLATE/feature-request.yml +20 -0
- package/.github/ISSUE_TEMPLATE/question.yml +15 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
- package/.github/workflows/ci.yml +33 -0
- package/.nvmrc +1 -0
- package/README.md +30 -6
- package/dist/Rettiwt.d.ts +3 -0
- package/dist/Rettiwt.js +4 -0
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +24 -0
- package/dist/collections/Extractors.js +14 -0
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +11 -0
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.js +12 -0
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/DirectMessage.d.ts +10 -0
- package/dist/commands/DirectMessage.js +57 -0
- package/dist/commands/DirectMessage.js.map +1 -0
- package/dist/commands/List.js +44 -3
- package/dist/commands/List.js.map +1 -1
- package/dist/commands/Tweet.js +29 -1
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +39 -1
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Data.d.ts +3 -1
- package/dist/enums/Data.js +2 -0
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Resource.d.ts +11 -0
- package/dist/enums/Resource.js +12 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/enums/raw/Analytics.d.ts +6 -3
- package/dist/enums/raw/Analytics.js +5 -2
- package/dist/enums/raw/Analytics.js.map +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/models/args/FetchArgs.d.ts +9 -0
- package/dist/models/args/FetchArgs.js +16 -0
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +1 -0
- package/dist/models/args/PostArgs.js +2 -0
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/data/Analytics.d.ts +43 -0
- package/dist/models/data/Analytics.js +92 -0
- package/dist/models/data/Analytics.js.map +1 -0
- package/dist/models/data/Conversation.d.ts +93 -0
- package/dist/models/data/Conversation.js +293 -0
- package/dist/models/data/Conversation.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +2 -1
- package/dist/models/data/CursoredData.js +6 -1
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/DirectMessage.d.ts +105 -0
- package/dist/models/data/DirectMessage.js +284 -0
- package/dist/models/data/DirectMessage.js.map +1 -0
- package/dist/models/data/Inbox.d.ts +44 -0
- package/dist/models/data/Inbox.js +106 -0
- package/dist/models/data/Inbox.js.map +1 -0
- package/dist/models/data/List.d.ts +20 -0
- package/dist/models/data/List.js +50 -1
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +6 -6
- package/dist/models/data/Tweet.js +4 -2
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +2 -0
- package/dist/models/data/User.js +6 -0
- package/dist/models/data/User.js.map +1 -1
- package/dist/requests/DirectMessage.d.ts +28 -0
- package/dist/requests/DirectMessage.js +149 -0
- package/dist/requests/DirectMessage.js.map +1 -0
- package/dist/requests/List.d.ts +10 -0
- package/dist/requests/List.js +52 -0
- package/dist/requests/List.js.map +1 -1
- package/dist/requests/Tweet.d.ts +8 -0
- package/dist/requests/Tweet.js +30 -0
- package/dist/requests/Tweet.js.map +1 -1
- package/dist/requests/User.d.ts +8 -1
- package/dist/requests/User.js +67 -8
- package/dist/requests/User.js.map +1 -1
- package/dist/services/public/DirectMessageService.d.ts +100 -0
- package/dist/services/public/DirectMessageService.js +143 -0
- package/dist/services/public/DirectMessageService.js.map +1 -0
- package/dist/services/public/FetcherService.d.ts +2 -2
- package/dist/services/public/FetcherService.js +2 -2
- package/dist/services/public/ListService.d.ts +85 -0
- package/dist/services/public/ListService.js +111 -0
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +56 -0
- package/dist/services/public/TweetService.js +72 -0
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +61 -2
- package/dist/services/public/UserService.js +89 -0
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/args/FetchArgs.d.ts +69 -12
- package/dist/types/args/PostArgs.d.ts +29 -11
- package/dist/types/data/Analytics.d.ts +42 -0
- package/dist/types/data/Analytics.js +3 -0
- package/dist/types/data/Analytics.js.map +1 -0
- package/dist/types/data/Conversation.d.ts +32 -0
- package/dist/types/data/Conversation.js +3 -0
- package/dist/types/data/Conversation.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +4 -1
- package/dist/types/data/DirectMessage.d.ts +25 -0
- package/dist/types/data/DirectMessage.js +3 -0
- package/dist/types/data/DirectMessage.js.map +1 -0
- package/dist/types/data/Inbox.d.ts +18 -0
- package/dist/types/data/Inbox.js +3 -0
- package/dist/types/data/Inbox.js.map +1 -0
- package/dist/types/data/List.d.ts +5 -1
- package/dist/types/data/Tweet.d.ts +6 -6
- package/dist/types/data/User.d.ts +4 -0
- package/dist/types/raw/base/Analytic.d.ts +6 -1
- package/dist/types/raw/base/Message.d.ts +16 -0
- package/dist/types/raw/base/Message.js +4 -0
- package/dist/types/raw/base/Message.js.map +1 -0
- package/dist/types/raw/base/Tweet.d.ts +6 -6
- package/dist/types/raw/base/User.d.ts +2 -1
- package/dist/types/raw/composite/TimelineList.d.ts +9 -0
- package/dist/types/raw/composite/TimelineList.js +3 -0
- package/dist/types/raw/composite/TimelineList.js.map +1 -0
- package/dist/types/raw/dm/Conversation.d.ts +55 -0
- package/dist/types/raw/dm/Conversation.js +4 -0
- package/dist/types/raw/dm/Conversation.js.map +1 -0
- package/dist/types/raw/dm/InboxInitial.d.ts +137 -0
- package/dist/types/raw/dm/InboxInitial.js +4 -0
- package/dist/types/raw/dm/InboxInitial.js.map +1 -0
- package/dist/types/raw/dm/InboxTimeline.d.ts +287 -0
- package/dist/types/raw/dm/InboxTimeline.js +4 -0
- package/dist/types/raw/dm/InboxTimeline.js.map +1 -0
- package/dist/types/raw/dm/UserUpdates.d.ts +41 -0
- package/dist/types/raw/dm/UserUpdates.js +4 -0
- package/dist/types/raw/dm/UserUpdates.js.map +1 -0
- package/dist/types/raw/list/AddMember.d.ts +151 -0
- package/dist/types/raw/list/AddMember.js +4 -0
- package/dist/types/raw/list/AddMember.js.map +1 -0
- package/dist/types/raw/list/Details.d.ts +44 -13
- package/dist/types/raw/list/RemoveMember.d.ts +150 -0
- package/dist/types/raw/list/RemoveMember.js +4 -0
- package/dist/types/raw/list/RemoveMember.js.map +1 -0
- package/dist/types/raw/tweet/Bookmark.d.ts +12 -0
- package/dist/types/raw/tweet/Bookmark.js +4 -0
- package/dist/types/raw/tweet/Bookmark.js.map +1 -0
- package/dist/types/raw/tweet/Unbookmark.d.ts +11 -0
- package/dist/types/raw/tweet/Unbookmark.js +4 -0
- package/dist/types/raw/tweet/Unbookmark.js.map +1 -0
- package/dist/types/raw/user/Analytics.d.ts +6 -18
- package/dist/types/raw/user/Analytics.js +0 -1
- package/dist/types/raw/user/Analytics.js.map +1 -1
- package/dist/types/raw/user/Lists.d.ts +319 -0
- package/dist/types/raw/user/Lists.js +4 -0
- package/dist/types/raw/user/Lists.js.map +1 -0
- package/eslint.config.mjs +1 -1
- package/package.json +11 -6
- package/playground/.env.example +1 -0
- package/playground/README.md +53 -0
- package/playground/index.js +15 -0
- package/playground/package.json +15 -0
- package/src/Rettiwt.ts +5 -0
- package/src/cli.ts +2 -0
- package/src/collections/Extractors.ts +29 -0
- package/src/collections/Groups.ts +11 -0
- package/src/collections/Requests.ts +20 -0
- package/src/commands/DirectMessage.ts +62 -0
- package/src/commands/List.ts +44 -3
- package/src/commands/Tweet.ts +29 -1
- package/src/commands/User.ts +65 -1
- package/src/enums/Data.ts +2 -0
- package/src/enums/Resource.ts +13 -0
- package/src/enums/raw/Analytics.ts +5 -2
- package/src/index.ts +15 -0
- package/src/models/args/FetchArgs.ts +17 -0
- package/src/models/args/PostArgs.ts +2 -0
- package/src/models/data/Analytics.ts +97 -0
- package/src/models/data/Conversation.ts +344 -0
- package/src/models/data/CursoredData.ts +7 -2
- package/src/models/data/DirectMessage.ts +335 -0
- package/src/models/data/Inbox.ts +124 -0
- package/src/models/data/List.ts +60 -1
- package/src/models/data/Tweet.ts +10 -8
- package/src/models/data/User.ts +6 -0
- package/src/requests/DirectMessage.ts +233 -0
- package/src/requests/List.ts +58 -0
- package/src/requests/Tweet.ts +32 -0
- package/src/requests/User.ts +70 -7
- package/src/services/public/DirectMessageService.ts +159 -0
- package/src/services/public/FetcherService.ts +2 -2
- package/src/services/public/ListService.ts +127 -0
- package/src/services/public/TweetService.ts +82 -0
- package/src/services/public/UserService.ts +110 -2
- package/src/types/args/FetchArgs.ts +77 -12
- package/src/types/args/PostArgs.ts +31 -11
- package/src/types/data/Analytics.ts +58 -0
- package/src/types/data/Conversation.ts +44 -0
- package/src/types/data/CursoredData.ts +4 -1
- package/src/types/data/DirectMessage.ts +33 -0
- package/src/types/data/Inbox.ts +23 -0
- package/src/types/data/List.ts +7 -1
- package/src/types/data/Tweet.ts +6 -6
- package/src/types/data/User.ts +6 -0
- package/src/types/raw/base/Analytic.ts +7 -1
- package/src/types/raw/base/Message.ts +22 -0
- package/src/types/raw/base/Tweet.ts +6 -6
- package/src/types/raw/base/User.ts +2 -1
- package/src/types/raw/composite/TimelineList.ts +10 -0
- package/src/types/raw/dm/Conversation.ts +59 -0
- package/src/types/raw/dm/InboxInitial.ts +155 -0
- package/src/types/raw/dm/InboxTimeline.ts +301 -0
- package/src/types/raw/dm/UserUpdates.ts +46 -0
- package/src/types/raw/list/AddMember.ts +175 -0
- package/src/types/raw/list/Details.ts +52 -13
- package/src/types/raw/list/RemoveMember.ts +174 -0
- package/src/types/raw/tweet/Bookmark.ts +14 -0
- package/src/types/raw/tweet/Unbookmark.ts +14 -0
- package/src/types/raw/user/Analytics.ts +6 -22
- package/src/types/raw/user/Lists.ts +378 -0
- package/tsconfig.json +1 -1
|
@@ -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
|
+
}
|
package/src/types/data/List.ts
CHANGED
|
@@ -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
|
|
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
|
|
package/src/types/data/Tweet.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
63
|
+
viewCount?: number;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
package/src/types/data/User.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
96
|
+
quote_count?: number;
|
|
97
97
|
quoted_status_id_str: string;
|
|
98
|
-
reply_count
|
|
99
|
-
retweet_count
|
|
98
|
+
reply_count?: number;
|
|
99
|
+
retweet_count?: number;
|
|
100
100
|
retweeted: boolean;
|
|
101
101
|
user_id_str: string;
|
|
102
102
|
id_str: string;
|
|
@@ -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
|
+
}
|