@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,179 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The raw data received when fetching the analytic overview of the user.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface IUserAffiliatesResponse {
|
|
9
|
+
data: Data;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Data {
|
|
13
|
+
user: User;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface User {
|
|
17
|
+
result: Result;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Result {
|
|
21
|
+
__typename: string;
|
|
22
|
+
timeline: Timeline;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Timeline {
|
|
26
|
+
timeline: Timeline2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface Timeline2 {
|
|
30
|
+
instructions: Instruction[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface Instruction {
|
|
34
|
+
type: string;
|
|
35
|
+
entries: Entry[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Entry {
|
|
39
|
+
entryId: string;
|
|
40
|
+
sortIndex: string;
|
|
41
|
+
content: Content;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface Content {
|
|
45
|
+
entryType: string;
|
|
46
|
+
__typename: string;
|
|
47
|
+
itemContent?: ItemContent;
|
|
48
|
+
clientEventInfo?: ClientEventInfo;
|
|
49
|
+
value?: string;
|
|
50
|
+
cursorType?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface ItemContent {
|
|
54
|
+
itemType: string;
|
|
55
|
+
__typename: string;
|
|
56
|
+
user_results: UserResults;
|
|
57
|
+
userDisplayType: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface UserResults {
|
|
61
|
+
result: Result2;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface Result2 {
|
|
65
|
+
__typename: string;
|
|
66
|
+
id: string;
|
|
67
|
+
rest_id: string;
|
|
68
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel;
|
|
69
|
+
has_graduated_access: boolean;
|
|
70
|
+
parody_commentary_fan_label: string;
|
|
71
|
+
is_blue_verified: boolean;
|
|
72
|
+
profile_image_shape: string;
|
|
73
|
+
legacy: Legacy;
|
|
74
|
+
tipjar_settings: TipjarSettings;
|
|
75
|
+
verified_phone_status: boolean;
|
|
76
|
+
professional?: Professional;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface AffiliatesHighlightedLabel {
|
|
80
|
+
label: Label;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface Label {
|
|
84
|
+
url: Url;
|
|
85
|
+
badge: Badge;
|
|
86
|
+
description: string;
|
|
87
|
+
userLabelType: string;
|
|
88
|
+
userLabelDisplayType: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
interface Url {
|
|
92
|
+
url: string;
|
|
93
|
+
urlType: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
interface Badge {
|
|
97
|
+
url: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
interface Legacy {
|
|
101
|
+
following: boolean;
|
|
102
|
+
can_dm: boolean;
|
|
103
|
+
can_media_tag: boolean;
|
|
104
|
+
created_at: string;
|
|
105
|
+
default_profile: boolean;
|
|
106
|
+
default_profile_image: boolean;
|
|
107
|
+
description: string;
|
|
108
|
+
entities: Entities;
|
|
109
|
+
fast_followers_count: number;
|
|
110
|
+
favourites_count: number;
|
|
111
|
+
followers_count: number;
|
|
112
|
+
friends_count: number;
|
|
113
|
+
has_custom_timelines: boolean;
|
|
114
|
+
is_translator: boolean;
|
|
115
|
+
listed_count: number;
|
|
116
|
+
location: string;
|
|
117
|
+
media_count: number;
|
|
118
|
+
name: string;
|
|
119
|
+
normal_followers_count: number;
|
|
120
|
+
pinned_tweet_ids_str: string[];
|
|
121
|
+
possibly_sensitive: boolean;
|
|
122
|
+
profile_image_url_https: string;
|
|
123
|
+
profile_interstitial_type: string;
|
|
124
|
+
screen_name: string;
|
|
125
|
+
statuses_count: number;
|
|
126
|
+
translator_type: string;
|
|
127
|
+
url?: string;
|
|
128
|
+
verified: boolean;
|
|
129
|
+
verified_type: string;
|
|
130
|
+
want_retweets: boolean;
|
|
131
|
+
withheld_in_countries: any[];
|
|
132
|
+
profile_banner_url?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface Entities {
|
|
136
|
+
description: Description;
|
|
137
|
+
url?: Url3;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface Description {
|
|
141
|
+
urls: Url2[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
interface Url2 {
|
|
145
|
+
display_url: string;
|
|
146
|
+
expanded_url: string;
|
|
147
|
+
url: string;
|
|
148
|
+
indices: number[];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface Url3 {
|
|
152
|
+
urls: Url4[];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface Url4 {
|
|
156
|
+
display_url: string;
|
|
157
|
+
expanded_url: string;
|
|
158
|
+
url: string;
|
|
159
|
+
indices: number[];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface TipjarSettings {}
|
|
163
|
+
|
|
164
|
+
interface Professional {
|
|
165
|
+
rest_id: string;
|
|
166
|
+
professional_type: string;
|
|
167
|
+
category: Category[];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface Category {
|
|
171
|
+
id: number;
|
|
172
|
+
name: string;
|
|
173
|
+
icon_name: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface ClientEventInfo {
|
|
177
|
+
component: string;
|
|
178
|
+
element: string;
|
|
179
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { IAnalytics } from '../base/Analytic';
|
|
3
|
+
/**
|
|
4
|
+
* The raw data received when fetching the analytic overview of the user.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface IUserAnalyticsResponse {
|
|
9
|
+
data: Data;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Data {
|
|
13
|
+
viewer_v2: ViewerV2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ViewerV2 {
|
|
17
|
+
user_results: UserResults;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface UserResults {
|
|
21
|
+
id: string;
|
|
22
|
+
result: IAnalytics;
|
|
23
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The raw data received when fetching tweets from a bookmark folder.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface IUserBookmarkFolderTweetsResponse {
|
|
9
|
+
data: Data;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Data {
|
|
13
|
+
bookmark_collection_timeline: BookmarkCollectionTimeline;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface BookmarkCollectionTimeline {
|
|
17
|
+
timeline: Timeline;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Timeline {
|
|
21
|
+
instructions: Instruction[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface Instruction {
|
|
25
|
+
type: string;
|
|
26
|
+
entries?: Entry[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface Entry {
|
|
30
|
+
entryId: string;
|
|
31
|
+
sortIndex: string;
|
|
32
|
+
content: Content;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Content {
|
|
36
|
+
entryType: string;
|
|
37
|
+
__typename: string;
|
|
38
|
+
itemContent?: ItemContent;
|
|
39
|
+
value?: string;
|
|
40
|
+
cursorType?: string;
|
|
41
|
+
stopOnEmptyResponse?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface ItemContent {
|
|
45
|
+
itemType: string;
|
|
46
|
+
__typename: string;
|
|
47
|
+
tweet_results: TweetResults;
|
|
48
|
+
tweetDisplayType: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface TweetResults {
|
|
52
|
+
result: any; // Uses the same tweet structure as regular bookmarks
|
|
53
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The raw data received when fetching bookmark folders.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface IUserBookmarkFoldersResponse {
|
|
9
|
+
data: Data;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Data {
|
|
13
|
+
viewer: Viewer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Viewer {
|
|
17
|
+
user_results: UserResults;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface UserResults {
|
|
21
|
+
result: Result;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface Result {
|
|
25
|
+
__typename: string;
|
|
26
|
+
bookmark_collections_slice: BookmarkCollectionsSlice;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface BookmarkCollectionsSlice {
|
|
30
|
+
items: BookmarkCollectionItem[];
|
|
31
|
+
slice_info: SliceInfo;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface BookmarkCollectionItem {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface SliceInfo {
|
|
40
|
+
next_cursor?: string;
|
|
41
|
+
}
|