@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.
- package/.eslintrc.js +166 -0
- package/.gitattributes +3 -0
- package/.github/FUNDING.yml +4 -0
- 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 +32 -0
- package/.github/workflows/publish.yml +23 -0
- package/.nvmrc +1 -0
- package/.prettierignore +3 -0
- package/.prettierrc +13 -0
- package/LICENSE +21 -0
- package/README.md +566 -0
- package/dist/cli.js +43 -0
- package/eslint.config.mjs +17 -0
- package/package.json +50 -0
- package/src/Rettiwt.ts +97 -0
- package/src/cli.ts +48 -0
- package/src/collections/Extractors.ts +155 -0
- package/src/collections/Groups.ts +81 -0
- package/src/collections/Requests.ts +89 -0
- package/src/collections/Tweet.ts +17 -0
- package/src/commands/DirectMessage.ts +62 -0
- package/src/commands/List.ts +90 -0
- package/src/commands/Tweet.ts +437 -0
- package/src/commands/User.ts +367 -0
- package/src/enums/Api.ts +10 -0
- package/src/enums/Authentication.ts +10 -0
- package/src/enums/Data.ts +13 -0
- package/src/enums/Logging.ts +14 -0
- package/src/enums/Media.ts +10 -0
- package/src/enums/Notification.ts +12 -0
- package/src/enums/Resource.ts +69 -0
- package/src/enums/Tweet.ts +8 -0
- package/src/enums/raw/Analytics.ts +32 -0
- package/src/enums/raw/Media.ts +10 -0
- package/src/enums/raw/Notification.ts +11 -0
- package/src/enums/raw/Tweet.ts +20 -0
- package/src/helper/CliUtils.ts +17 -0
- package/src/helper/JsonUtils.ts +70 -0
- package/src/index.ts +128 -0
- package/src/models/RettiwtConfig.ts +101 -0
- package/src/models/args/FetchArgs.ts +169 -0
- package/src/models/args/PostArgs.ts +93 -0
- package/src/models/args/ProfileArgs.ts +68 -0
- package/src/models/auth/AuthCookie.ts +58 -0
- package/src/models/auth/AuthCredential.ts +83 -0
- package/src/models/data/Analytics.ts +97 -0
- package/src/models/data/BookmarkFolder.ts +73 -0
- package/src/models/data/Conversation.ts +344 -0
- package/src/models/data/CursoredData.ts +64 -0
- package/src/models/data/DirectMessage.ts +335 -0
- package/src/models/data/Inbox.ts +124 -0
- package/src/models/data/List.ts +113 -0
- package/src/models/data/Notification.ts +84 -0
- package/src/models/data/Tweet.ts +388 -0
- package/src/models/data/User.ts +187 -0
- package/src/models/errors/TwitterError.ts +65 -0
- package/src/models/params/Variables.ts +62 -0
- package/src/requests/DirectMessage.ts +229 -0
- package/src/requests/List.ts +203 -0
- package/src/requests/Media.ts +67 -0
- package/src/requests/Tweet.ts +607 -0
- package/src/requests/User.ts +1191 -0
- package/src/services/internal/AuthService.ts +115 -0
- package/src/services/internal/ErrorService.ts +41 -0
- package/src/services/internal/LogService.ts +34 -0
- package/src/services/public/DirectMessageService.ts +159 -0
- package/src/services/public/FetcherService.ts +366 -0
- package/src/services/public/ListService.ts +241 -0
- package/src/services/public/TweetService.ts +886 -0
- package/src/services/public/UserService.ts +1154 -0
- package/src/types/ErrorHandler.ts +13 -0
- package/src/types/Fetch.ts +3 -0
- package/src/types/RettiwtConfig.ts +48 -0
- package/src/types/args/FetchArgs.ts +233 -0
- package/src/types/args/PostArgs.ts +142 -0
- package/src/types/args/ProfileArgs.ts +33 -0
- package/src/types/auth/AuthCookie.ts +22 -0
- package/src/types/auth/AuthCredential.ts +28 -0
- package/src/types/auth/TransactionHeader.ts +8 -0
- package/src/types/data/Analytics.ts +58 -0
- package/src/types/data/BookmarkFolder.ts +12 -0
- package/src/types/data/Conversation.ts +44 -0
- package/src/types/data/CursoredData.ts +24 -0
- package/src/types/data/DirectMessage.ts +33 -0
- package/src/types/data/Inbox.ts +23 -0
- package/src/types/data/List.ts +33 -0
- package/src/types/data/Notification.ts +26 -0
- package/src/types/data/Tweet.ts +99 -0
- package/src/types/data/User.ts +54 -0
- package/src/types/errors/TwitterError.ts +37 -0
- package/src/types/params/Variables.ts +41 -0
- package/src/types/raw/base/Analytic.ts +32 -0
- package/src/types/raw/base/BookmarkFolder.ts +12 -0
- package/src/types/raw/base/Cursor.ts +13 -0
- package/src/types/raw/base/Error.ts +38 -0
- package/src/types/raw/base/LimitedVisibilityTweet.ts +40 -0
- package/src/types/raw/base/List.ts +50 -0
- package/src/types/raw/base/Media.ts +53 -0
- package/src/types/raw/base/Message.ts +22 -0
- package/src/types/raw/base/Notification.ts +66 -0
- package/src/types/raw/base/Space.ts +35 -0
- package/src/types/raw/base/Tweet.ts +139 -0
- package/src/types/raw/base/User.ts +182 -0
- package/src/types/raw/composite/DataResult.ts +8 -0
- package/src/types/raw/composite/TimelineList.ts +10 -0
- package/src/types/raw/composite/TimelineTweet.ts +14 -0
- package/src/types/raw/composite/TimelineUser.ts +13 -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/generic/Response.ts +10 -0
- package/src/types/raw/list/AddMember.ts +175 -0
- package/src/types/raw/list/Details.ts +176 -0
- package/src/types/raw/list/Members.ts +154 -0
- package/src/types/raw/list/RemoveMember.ts +174 -0
- package/src/types/raw/list/Tweets.ts +2296 -0
- package/src/types/raw/media/FinalizeUpload.ts +20 -0
- package/src/types/raw/media/InitalizeUpload.ts +12 -0
- package/src/types/raw/media/LiveVideoStream.ts +21 -0
- package/src/types/raw/space/Details.ts +359 -0
- package/src/types/raw/tweet/Bookmark.ts +14 -0
- package/src/types/raw/tweet/Details.ts +210 -0
- package/src/types/raw/tweet/DetailsBulk.ts +338 -0
- package/src/types/raw/tweet/Like.ts +14 -0
- package/src/types/raw/tweet/Likers.ts +200 -0
- package/src/types/raw/tweet/Post.ts +150 -0
- package/src/types/raw/tweet/Replies.ts +539 -0
- package/src/types/raw/tweet/Retweet.ts +31 -0
- package/src/types/raw/tweet/Retweeters.ts +208 -0
- package/src/types/raw/tweet/Schedule.ts +18 -0
- package/src/types/raw/tweet/Search.ts +597 -0
- package/src/types/raw/tweet/Unbookmark.ts +14 -0
- package/src/types/raw/tweet/Unlike.ts +14 -0
- package/src/types/raw/tweet/Unpost.ts +20 -0
- package/src/types/raw/tweet/Unretweet.ts +31 -0
- package/src/types/raw/tweet/Unschedule.ts +14 -0
- package/src/types/raw/user/Affiliates.ts +179 -0
- package/src/types/raw/user/Analytics.ts +23 -0
- package/src/types/raw/user/BookmarkFolderTweets.ts +53 -0
- package/src/types/raw/user/BookmarkFolders.ts +41 -0
- package/src/types/raw/user/Bookmarks.ts +637 -0
- package/src/types/raw/user/Details.ts +185 -0
- package/src/types/raw/user/DetailsBulk.ts +104 -0
- package/src/types/raw/user/Follow.ts +280 -0
- package/src/types/raw/user/Followed.ts +1942 -0
- package/src/types/raw/user/Followers.ts +215 -0
- package/src/types/raw/user/Following.ts +215 -0
- package/src/types/raw/user/Highlights.ts +1287 -0
- package/src/types/raw/user/Likes.ts +1254 -0
- package/src/types/raw/user/Lists.ts +378 -0
- package/src/types/raw/user/Media.ts +1738 -0
- package/src/types/raw/user/Notifications.ts +499 -0
- package/src/types/raw/user/ProfileUpdate.ts +80 -0
- package/src/types/raw/user/Recommended.ts +2319 -0
- package/src/types/raw/user/Scheduled.ts +37 -0
- package/src/types/raw/user/Search.ts +230 -0
- package/src/types/raw/user/Subscriptions.ts +176 -0
- package/src/types/raw/user/Tweets.ts +1254 -0
- package/src/types/raw/user/TweetsAndReplies.ts +1254 -0
- package/src/types/raw/user/Unfollow.ts +280 -0
- package/tsconfig.json +97 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
import { IDataResult } from '../composite/DataResult';
|
|
4
|
+
import { IUser } from './User';
|
|
5
|
+
import { ITweet } from './Tweet';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents the raw data of a single Space.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ISpace {
|
|
13
|
+
rest_id: string;
|
|
14
|
+
state: string;
|
|
15
|
+
title: string;
|
|
16
|
+
media_key: string;
|
|
17
|
+
created_at: number;
|
|
18
|
+
started_at: number;
|
|
19
|
+
ended_at: string;
|
|
20
|
+
replay_start_time: number;
|
|
21
|
+
updated_at: number;
|
|
22
|
+
creator_results: IDataResult<IUser>;
|
|
23
|
+
conversation_controls: number;
|
|
24
|
+
disallow_join: boolean;
|
|
25
|
+
is_employee_only: boolean;
|
|
26
|
+
is_locked: boolean;
|
|
27
|
+
is_muted: boolean;
|
|
28
|
+
is_space_available_for_clipping: boolean;
|
|
29
|
+
is_space_available_for_replay: boolean;
|
|
30
|
+
narrow_cast_space_type: number;
|
|
31
|
+
no_incognito: boolean;
|
|
32
|
+
total_replay_watched: number;
|
|
33
|
+
total_live_listeners: number;
|
|
34
|
+
tweet_results: IDataResult<ITweet>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
import { IDataResult } from '../composite/DataResult';
|
|
4
|
+
import { IUser } from './User';
|
|
5
|
+
import { IMedia, IExtendedMedia } from './Media';
|
|
6
|
+
import { ILimitedVisibilityTweet } from './LimitedVisibilityTweet';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the raw data of a single Tweet.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface ITweet {
|
|
14
|
+
__typename: string;
|
|
15
|
+
rest_id: string;
|
|
16
|
+
core: ITweetCore;
|
|
17
|
+
edit_control: ITweetEditControl;
|
|
18
|
+
edit_perspective: ITweetEditPerspective;
|
|
19
|
+
is_translatable: boolean;
|
|
20
|
+
views?: ITweetViews;
|
|
21
|
+
source: string;
|
|
22
|
+
quoted_status_result: IDataResult<ITweet | ILimitedVisibilityTweet>;
|
|
23
|
+
note_tweet: ITweetNote;
|
|
24
|
+
legacy: ITweetLegacy;
|
|
25
|
+
quick_promote_eligibility: ITweetQuickPromoteEligibilityInfo;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ITweetCore {
|
|
29
|
+
user_results: IDataResult<IUser>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ITweetEditControl {
|
|
33
|
+
edit_tweet_ids: string[];
|
|
34
|
+
editable_until_msecs: string;
|
|
35
|
+
is_edit_eligible: boolean;
|
|
36
|
+
edits_remaining: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ITweetEditPerspective {
|
|
40
|
+
favorited: boolean;
|
|
41
|
+
retweeted: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ITweetViews {
|
|
45
|
+
count: string;
|
|
46
|
+
state: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ITweetNote {
|
|
50
|
+
is_expandable: boolean;
|
|
51
|
+
note_tweet_results: ITweetNoteResults;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ITweetNoteResults {
|
|
55
|
+
result: ITweetNoteResult;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ITweetNoteResult {
|
|
59
|
+
id: string;
|
|
60
|
+
text: string;
|
|
61
|
+
entity_set: IEntities;
|
|
62
|
+
richtext: IRichtext;
|
|
63
|
+
media: ITweetNoteMedia;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface IRichtext {
|
|
67
|
+
richtext_tags: IRichtextTag[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface IRichtextTag {
|
|
71
|
+
from_index: number;
|
|
72
|
+
to_index: number;
|
|
73
|
+
richtext_types: string[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ITweetNoteMedia {
|
|
77
|
+
inline_media: any[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ITweetLegacy {
|
|
81
|
+
bookmark_count?: number;
|
|
82
|
+
bookmarked: boolean;
|
|
83
|
+
created_at: string;
|
|
84
|
+
conversation_id_str: string;
|
|
85
|
+
display_text_range: number[];
|
|
86
|
+
entities: IEntities;
|
|
87
|
+
extended_entities: IExtendedEntities;
|
|
88
|
+
favorite_count?: number;
|
|
89
|
+
favorited: boolean;
|
|
90
|
+
full_text: string;
|
|
91
|
+
in_reply_to_status_id_str: string;
|
|
92
|
+
is_quote_status: boolean;
|
|
93
|
+
lang: string;
|
|
94
|
+
possibly_sensitive: boolean;
|
|
95
|
+
possibly_sensitive_editable: boolean;
|
|
96
|
+
quote_count?: number;
|
|
97
|
+
quoted_status_id_str: string;
|
|
98
|
+
reply_count?: number;
|
|
99
|
+
retweet_count?: number;
|
|
100
|
+
retweeted: boolean;
|
|
101
|
+
user_id_str: string;
|
|
102
|
+
id_str: string;
|
|
103
|
+
retweeted_status_result: IDataResult<ITweet | ILimitedVisibilityTweet>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface IEntities {
|
|
107
|
+
media: IMedia[];
|
|
108
|
+
user_mentions: IUserMention[];
|
|
109
|
+
urls: IUrl[];
|
|
110
|
+
hashtags: IHashtag[];
|
|
111
|
+
symbols: any[];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface IUserMention {
|
|
115
|
+
id_str: string;
|
|
116
|
+
name: string;
|
|
117
|
+
screen_name: string;
|
|
118
|
+
indices: number[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface IUrl {
|
|
122
|
+
display_url: string;
|
|
123
|
+
expanded_url: string;
|
|
124
|
+
url: string;
|
|
125
|
+
indices: number[];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface IHashtag {
|
|
129
|
+
indices: number[];
|
|
130
|
+
text: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface IExtendedEntities {
|
|
134
|
+
media: IExtendedMedia[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface ITweetQuickPromoteEligibilityInfo {
|
|
138
|
+
eligibility: string;
|
|
139
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
import { IUrl } from './Tweet';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents the raw data of a single User.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface IUser {
|
|
11
|
+
__typename: string;
|
|
12
|
+
id: string;
|
|
13
|
+
rest_id: string;
|
|
14
|
+
core?: IUserCore;
|
|
15
|
+
avatar?: IUserAvatar;
|
|
16
|
+
affiliates_highlighted_label: IAffiliatesHighlightedLabel;
|
|
17
|
+
has_graduated_access: boolean;
|
|
18
|
+
is_blue_verified: boolean;
|
|
19
|
+
profile_image_shape: string;
|
|
20
|
+
legacy: IUserLegacy;
|
|
21
|
+
location?: IUserLocation;
|
|
22
|
+
super_follow_eligible: boolean;
|
|
23
|
+
smart_blocked_by: boolean;
|
|
24
|
+
smart_blocking: boolean;
|
|
25
|
+
verified_phone_status: boolean;
|
|
26
|
+
legacy_extended_profile: ILegacyExtendedProfile;
|
|
27
|
+
is_profile_translatable: boolean;
|
|
28
|
+
verification_info: IVerificationInfo;
|
|
29
|
+
highlights_info: IHighlightsInfo;
|
|
30
|
+
business_account: IBusinessAccountInfo;
|
|
31
|
+
creator_subscriptions_count: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IUserCore {
|
|
35
|
+
created_at: string;
|
|
36
|
+
name: string;
|
|
37
|
+
screen_name: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface IUserAvatar {
|
|
41
|
+
image_url: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface IAffiliatesHighlightedLabel {
|
|
45
|
+
label: IAffiliateLabel;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface IAffiliateLabel {
|
|
49
|
+
url: IAffiliateUrl;
|
|
50
|
+
badge: IAffiliateBadge;
|
|
51
|
+
description: string;
|
|
52
|
+
longDescription: IAffiliateDescription;
|
|
53
|
+
userLabelType: string;
|
|
54
|
+
userLabelDisplayType: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface IAffiliateUrl {
|
|
58
|
+
url: string;
|
|
59
|
+
urlType: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface IAffiliateBadge {
|
|
63
|
+
url: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface IAffiliateDescription {
|
|
67
|
+
text: string;
|
|
68
|
+
entities: IAffiliateDescriptionEntity[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface IAffiliateDescriptionEntity {
|
|
72
|
+
fromIndex: number;
|
|
73
|
+
toIndex: number;
|
|
74
|
+
ref: IAffiliateHighlightedMention;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface IAffiliateHighlightedMention {
|
|
78
|
+
type: string;
|
|
79
|
+
screen_name: string;
|
|
80
|
+
mention_results: IAffiliateHighlightedMentionResults;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface IAffiliateHighlightedMentionResults {
|
|
84
|
+
result: IAffiliateHighlightedMentionResult;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface IAffiliateHighlightedMentionResult {
|
|
88
|
+
__typename: string;
|
|
89
|
+
legacy: IAffiliateHighlightedMentionResultLegacy;
|
|
90
|
+
rest_id: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface IAffiliateHighlightedMentionResultLegacy {
|
|
94
|
+
screen_name: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface IUserLegacy {
|
|
98
|
+
created_at?: string;
|
|
99
|
+
name?: string;
|
|
100
|
+
screen_name?: string;
|
|
101
|
+
location?: string;
|
|
102
|
+
followed_by?: boolean;
|
|
103
|
+
following?: boolean;
|
|
104
|
+
can_dm: boolean;
|
|
105
|
+
can_media_tag: boolean;
|
|
106
|
+
default_profile: boolean;
|
|
107
|
+
default_profile_image: boolean;
|
|
108
|
+
description: string;
|
|
109
|
+
entities: IProfileEntities;
|
|
110
|
+
fast_followers_count: number;
|
|
111
|
+
favourites_count: number;
|
|
112
|
+
followers_count: number;
|
|
113
|
+
friends_count: number;
|
|
114
|
+
has_custom_timelines: boolean;
|
|
115
|
+
is_translator: boolean;
|
|
116
|
+
listed_count: number;
|
|
117
|
+
media_count: number;
|
|
118
|
+
normal_followers_count: number;
|
|
119
|
+
pinned_tweet_ids_str: string[];
|
|
120
|
+
possibly_sensitive: boolean;
|
|
121
|
+
profile_banner_url: string;
|
|
122
|
+
profile_image_url_https?: string;
|
|
123
|
+
profile_interstitial_type: string;
|
|
124
|
+
statuses_count: number;
|
|
125
|
+
translator_type: string;
|
|
126
|
+
verified: boolean;
|
|
127
|
+
want_retweets: boolean;
|
|
128
|
+
withheld_in_countries: string[];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface IProfileEntities {
|
|
132
|
+
description: IProfileDescription;
|
|
133
|
+
url: IProfileUrl;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface IProfileDescription {
|
|
137
|
+
urls: IUrl[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface IProfileUrl {
|
|
141
|
+
urls: IUrl[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface IUserLocation {
|
|
145
|
+
location: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface ILegacyExtendedProfile {}
|
|
149
|
+
|
|
150
|
+
export interface IVerificationInfo {
|
|
151
|
+
reason: IVerificationReason;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface IVerificationReason {
|
|
155
|
+
description: IVerificationReasonDescription;
|
|
156
|
+
verified_since_msec: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface IVerificationReasonDescription {
|
|
160
|
+
text: string;
|
|
161
|
+
entities: IVerificationEntity[];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface IVerificationEntity {
|
|
165
|
+
from_index: number;
|
|
166
|
+
to_index: number;
|
|
167
|
+
ref: IVerificationRef;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface IVerificationRef {
|
|
171
|
+
url: string;
|
|
172
|
+
url_type: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface IHighlightsInfo {
|
|
176
|
+
can_highlight_tweets: boolean;
|
|
177
|
+
highlighted_tweets: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface IBusinessAccountInfo {
|
|
181
|
+
affiliates_count: number;
|
|
182
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
import { IDataResult } from './DataResult';
|
|
4
|
+
import { ITweet } from '../base/Tweet';
|
|
5
|
+
import { ILimitedVisibilityTweet } from '../base/LimitedVisibilityTweet';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Represents the raw data of a single timeline tweet.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface ITimelineTweet {
|
|
13
|
+
tweet_results: IDataResult<ITweet | ILimitedVisibilityTweet>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
import { IDataResult } from './DataResult';
|
|
4
|
+
import { IUser } from '../base/User';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents the raw data of a single timeline user.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface ITimelineUser {
|
|
12
|
+
user_results: IDataResult<IUser>;
|
|
13
|
+
}
|
|
@@ -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
|
+
}
|