@glagan/rettiwt-api 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/.eslintrc.js +166 -0
  2. package/.gitattributes +3 -0
  3. package/.github/FUNDING.yml +4 -0
  4. package/.github/ISSUE_TEMPLATE/bug-report.yml +57 -0
  5. package/.github/ISSUE_TEMPLATE/feature-request.yml +20 -0
  6. package/.github/ISSUE_TEMPLATE/question.yml +15 -0
  7. package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
  8. package/.github/workflows/ci.yml +32 -0
  9. package/.github/workflows/publish.yml +23 -0
  10. package/.nvmrc +1 -0
  11. package/.prettierignore +3 -0
  12. package/.prettierrc +13 -0
  13. package/LICENSE +21 -0
  14. package/README.md +566 -0
  15. package/dist/cli.js +43 -0
  16. package/eslint.config.mjs +17 -0
  17. package/package.json +50 -0
  18. package/src/Rettiwt.ts +97 -0
  19. package/src/cli.ts +48 -0
  20. package/src/collections/Extractors.ts +155 -0
  21. package/src/collections/Groups.ts +81 -0
  22. package/src/collections/Requests.ts +89 -0
  23. package/src/collections/Tweet.ts +17 -0
  24. package/src/commands/DirectMessage.ts +62 -0
  25. package/src/commands/List.ts +90 -0
  26. package/src/commands/Tweet.ts +437 -0
  27. package/src/commands/User.ts +367 -0
  28. package/src/enums/Api.ts +10 -0
  29. package/src/enums/Authentication.ts +10 -0
  30. package/src/enums/Data.ts +13 -0
  31. package/src/enums/Logging.ts +14 -0
  32. package/src/enums/Media.ts +10 -0
  33. package/src/enums/Notification.ts +12 -0
  34. package/src/enums/Resource.ts +69 -0
  35. package/src/enums/Tweet.ts +8 -0
  36. package/src/enums/raw/Analytics.ts +32 -0
  37. package/src/enums/raw/Media.ts +10 -0
  38. package/src/enums/raw/Notification.ts +11 -0
  39. package/src/enums/raw/Tweet.ts +20 -0
  40. package/src/helper/CliUtils.ts +17 -0
  41. package/src/helper/JsonUtils.ts +70 -0
  42. package/src/index.ts +128 -0
  43. package/src/models/RettiwtConfig.ts +101 -0
  44. package/src/models/args/FetchArgs.ts +169 -0
  45. package/src/models/args/PostArgs.ts +93 -0
  46. package/src/models/args/ProfileArgs.ts +68 -0
  47. package/src/models/auth/AuthCookie.ts +58 -0
  48. package/src/models/auth/AuthCredential.ts +83 -0
  49. package/src/models/data/Analytics.ts +97 -0
  50. package/src/models/data/BookmarkFolder.ts +73 -0
  51. package/src/models/data/Conversation.ts +344 -0
  52. package/src/models/data/CursoredData.ts +64 -0
  53. package/src/models/data/DirectMessage.ts +335 -0
  54. package/src/models/data/Inbox.ts +124 -0
  55. package/src/models/data/List.ts +113 -0
  56. package/src/models/data/Notification.ts +84 -0
  57. package/src/models/data/Tweet.ts +388 -0
  58. package/src/models/data/User.ts +187 -0
  59. package/src/models/errors/TwitterError.ts +65 -0
  60. package/src/models/params/Variables.ts +62 -0
  61. package/src/requests/DirectMessage.ts +229 -0
  62. package/src/requests/List.ts +203 -0
  63. package/src/requests/Media.ts +67 -0
  64. package/src/requests/Tweet.ts +607 -0
  65. package/src/requests/User.ts +1191 -0
  66. package/src/services/internal/AuthService.ts +115 -0
  67. package/src/services/internal/ErrorService.ts +41 -0
  68. package/src/services/internal/LogService.ts +34 -0
  69. package/src/services/public/DirectMessageService.ts +159 -0
  70. package/src/services/public/FetcherService.ts +366 -0
  71. package/src/services/public/ListService.ts +241 -0
  72. package/src/services/public/TweetService.ts +886 -0
  73. package/src/services/public/UserService.ts +1154 -0
  74. package/src/types/ErrorHandler.ts +13 -0
  75. package/src/types/Fetch.ts +3 -0
  76. package/src/types/RettiwtConfig.ts +48 -0
  77. package/src/types/args/FetchArgs.ts +233 -0
  78. package/src/types/args/PostArgs.ts +142 -0
  79. package/src/types/args/ProfileArgs.ts +33 -0
  80. package/src/types/auth/AuthCookie.ts +22 -0
  81. package/src/types/auth/AuthCredential.ts +28 -0
  82. package/src/types/auth/TransactionHeader.ts +8 -0
  83. package/src/types/data/Analytics.ts +58 -0
  84. package/src/types/data/BookmarkFolder.ts +12 -0
  85. package/src/types/data/Conversation.ts +44 -0
  86. package/src/types/data/CursoredData.ts +24 -0
  87. package/src/types/data/DirectMessage.ts +33 -0
  88. package/src/types/data/Inbox.ts +23 -0
  89. package/src/types/data/List.ts +33 -0
  90. package/src/types/data/Notification.ts +26 -0
  91. package/src/types/data/Tweet.ts +99 -0
  92. package/src/types/data/User.ts +54 -0
  93. package/src/types/errors/TwitterError.ts +37 -0
  94. package/src/types/params/Variables.ts +41 -0
  95. package/src/types/raw/base/Analytic.ts +32 -0
  96. package/src/types/raw/base/BookmarkFolder.ts +12 -0
  97. package/src/types/raw/base/Cursor.ts +13 -0
  98. package/src/types/raw/base/Error.ts +38 -0
  99. package/src/types/raw/base/LimitedVisibilityTweet.ts +40 -0
  100. package/src/types/raw/base/List.ts +50 -0
  101. package/src/types/raw/base/Media.ts +53 -0
  102. package/src/types/raw/base/Message.ts +22 -0
  103. package/src/types/raw/base/Notification.ts +66 -0
  104. package/src/types/raw/base/Space.ts +35 -0
  105. package/src/types/raw/base/Tweet.ts +139 -0
  106. package/src/types/raw/base/User.ts +182 -0
  107. package/src/types/raw/composite/DataResult.ts +8 -0
  108. package/src/types/raw/composite/TimelineList.ts +10 -0
  109. package/src/types/raw/composite/TimelineTweet.ts +14 -0
  110. package/src/types/raw/composite/TimelineUser.ts +13 -0
  111. package/src/types/raw/dm/Conversation.ts +59 -0
  112. package/src/types/raw/dm/InboxInitial.ts +155 -0
  113. package/src/types/raw/dm/InboxTimeline.ts +301 -0
  114. package/src/types/raw/dm/UserUpdates.ts +46 -0
  115. package/src/types/raw/generic/Response.ts +10 -0
  116. package/src/types/raw/list/AddMember.ts +175 -0
  117. package/src/types/raw/list/Details.ts +176 -0
  118. package/src/types/raw/list/Members.ts +154 -0
  119. package/src/types/raw/list/RemoveMember.ts +174 -0
  120. package/src/types/raw/list/Tweets.ts +2296 -0
  121. package/src/types/raw/media/FinalizeUpload.ts +20 -0
  122. package/src/types/raw/media/InitalizeUpload.ts +12 -0
  123. package/src/types/raw/media/LiveVideoStream.ts +21 -0
  124. package/src/types/raw/space/Details.ts +359 -0
  125. package/src/types/raw/tweet/Bookmark.ts +14 -0
  126. package/src/types/raw/tweet/Details.ts +210 -0
  127. package/src/types/raw/tweet/DetailsBulk.ts +338 -0
  128. package/src/types/raw/tweet/Like.ts +14 -0
  129. package/src/types/raw/tweet/Likers.ts +200 -0
  130. package/src/types/raw/tweet/Post.ts +150 -0
  131. package/src/types/raw/tweet/Replies.ts +539 -0
  132. package/src/types/raw/tweet/Retweet.ts +31 -0
  133. package/src/types/raw/tweet/Retweeters.ts +208 -0
  134. package/src/types/raw/tweet/Schedule.ts +18 -0
  135. package/src/types/raw/tweet/Search.ts +597 -0
  136. package/src/types/raw/tweet/Unbookmark.ts +14 -0
  137. package/src/types/raw/tweet/Unlike.ts +14 -0
  138. package/src/types/raw/tweet/Unpost.ts +20 -0
  139. package/src/types/raw/tweet/Unretweet.ts +31 -0
  140. package/src/types/raw/tweet/Unschedule.ts +14 -0
  141. package/src/types/raw/user/Affiliates.ts +179 -0
  142. package/src/types/raw/user/Analytics.ts +23 -0
  143. package/src/types/raw/user/BookmarkFolderTweets.ts +53 -0
  144. package/src/types/raw/user/BookmarkFolders.ts +41 -0
  145. package/src/types/raw/user/Bookmarks.ts +637 -0
  146. package/src/types/raw/user/Details.ts +185 -0
  147. package/src/types/raw/user/DetailsBulk.ts +104 -0
  148. package/src/types/raw/user/Follow.ts +280 -0
  149. package/src/types/raw/user/Followed.ts +1942 -0
  150. package/src/types/raw/user/Followers.ts +215 -0
  151. package/src/types/raw/user/Following.ts +215 -0
  152. package/src/types/raw/user/Highlights.ts +1287 -0
  153. package/src/types/raw/user/Likes.ts +1254 -0
  154. package/src/types/raw/user/Lists.ts +378 -0
  155. package/src/types/raw/user/Media.ts +1738 -0
  156. package/src/types/raw/user/Notifications.ts +499 -0
  157. package/src/types/raw/user/ProfileUpdate.ts +80 -0
  158. package/src/types/raw/user/Recommended.ts +2319 -0
  159. package/src/types/raw/user/Scheduled.ts +37 -0
  160. package/src/types/raw/user/Search.ts +230 -0
  161. package/src/types/raw/user/Subscriptions.ts +176 -0
  162. package/src/types/raw/user/Tweets.ts +1254 -0
  163. package/src/types/raw/user/TweetsAndReplies.ts +1254 -0
  164. package/src/types/raw/user/Unfollow.ts +280 -0
  165. package/tsconfig.json +97 -0
@@ -0,0 +1,154 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * The raw data received when fetching the members of a tweet list.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IListMembersResponse {
9
+ data: Data;
10
+ }
11
+
12
+ interface Data {
13
+ list: List;
14
+ }
15
+
16
+ interface List {
17
+ members_timeline: MembersTimeline;
18
+ }
19
+
20
+ interface MembersTimeline {
21
+ timeline: Timeline;
22
+ }
23
+
24
+ interface Timeline {
25
+ instructions: Instruction[];
26
+ }
27
+
28
+ interface Instruction {
29
+ type: string;
30
+ entries: Entry[];
31
+ }
32
+
33
+ interface Entry {
34
+ entryId: string;
35
+ sortIndex: string;
36
+ content: Content;
37
+ }
38
+
39
+ interface Content {
40
+ entryType: string;
41
+ __typename: string;
42
+ itemContent?: ItemContent;
43
+ clientEventInfo?: ClientEventInfo;
44
+ value?: string;
45
+ cursorType?: string;
46
+ }
47
+
48
+ interface ItemContent {
49
+ itemType: string;
50
+ __typename: string;
51
+ user_results: UserResults;
52
+ userDisplayType: string;
53
+ }
54
+
55
+ interface UserResults {
56
+ result: Result;
57
+ }
58
+
59
+ interface Result {
60
+ __typename: string;
61
+ id: string;
62
+ rest_id: string;
63
+ affiliates_highlighted_label: AffiliatesHighlightedLabel;
64
+ has_graduated_access: boolean;
65
+ is_blue_verified: boolean;
66
+ profile_image_shape: string;
67
+ legacy: Legacy;
68
+ tipjar_settings: TipjarSettings;
69
+ verified_phone_status: boolean;
70
+ professional?: Professional;
71
+ }
72
+
73
+ interface AffiliatesHighlightedLabel {}
74
+
75
+ interface Legacy {
76
+ following: boolean;
77
+ can_dm: boolean;
78
+ can_media_tag: boolean;
79
+ created_at: string;
80
+ default_profile: boolean;
81
+ default_profile_image: boolean;
82
+ description: string;
83
+ entities: Entities;
84
+ fast_followers_count: number;
85
+ favourites_count: number;
86
+ followers_count: number;
87
+ friends_count: number;
88
+ has_custom_timelines: boolean;
89
+ is_translator: boolean;
90
+ listed_count: number;
91
+ location: string;
92
+ media_count: number;
93
+ name: string;
94
+ normal_followers_count: number;
95
+ pinned_tweet_ids_str: string[];
96
+ possibly_sensitive: boolean;
97
+ profile_banner_url?: string;
98
+ profile_image_url_https: string;
99
+ profile_interstitial_type: string;
100
+ screen_name: string;
101
+ statuses_count: number;
102
+ translator_type: string;
103
+ verified: boolean;
104
+ want_retweets: boolean;
105
+ withheld_in_countries: any[];
106
+ url?: string;
107
+ verified_type?: string;
108
+ }
109
+
110
+ interface Entities {
111
+ description: Description;
112
+ url?: Url2;
113
+ }
114
+
115
+ interface Description {
116
+ urls: Url[];
117
+ }
118
+
119
+ interface Url {
120
+ display_url: string;
121
+ expanded_url: string;
122
+ url: string;
123
+ indices: number[];
124
+ }
125
+
126
+ interface Url2 {
127
+ urls: Url3[];
128
+ }
129
+
130
+ interface Url3 {
131
+ display_url: string;
132
+ expanded_url: string;
133
+ url: string;
134
+ indices: number[];
135
+ }
136
+
137
+ interface TipjarSettings {}
138
+
139
+ interface Professional {
140
+ rest_id: string;
141
+ professional_type: string;
142
+ category: Category[];
143
+ }
144
+
145
+ interface Category {
146
+ id: number;
147
+ name: string;
148
+ icon_name: string;
149
+ }
150
+
151
+ interface ClientEventInfo {
152
+ component: string;
153
+ element: string;
154
+ }
@@ -0,0 +1,174 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * The raw data received after removing a member from a tweet list.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IListMemberRemoveResponse {
9
+ data: Data;
10
+ }
11
+
12
+ export interface Data {
13
+ list: List;
14
+ }
15
+
16
+ export interface List {
17
+ created_at: number;
18
+ default_banner_media: DefaultBannerMedia;
19
+ default_banner_media_results: DefaultBannerMediaResults;
20
+ description: string;
21
+ facepile_urls: any[];
22
+ following: boolean;
23
+ id: string;
24
+ id_str: string;
25
+ is_member: boolean;
26
+ member_count: number;
27
+ mode: string;
28
+ muting: boolean;
29
+ name: string;
30
+ pinning: boolean;
31
+ subscriber_count: number;
32
+ user_results: UserResults;
33
+ }
34
+
35
+ export interface DefaultBannerMedia {
36
+ media_info: MediaInfo;
37
+ }
38
+
39
+ export interface MediaInfo {
40
+ original_img_url: string;
41
+ original_img_width: number;
42
+ original_img_height: number;
43
+ salient_rect: SalientRect;
44
+ }
45
+
46
+ export interface SalientRect {
47
+ left: number;
48
+ top: number;
49
+ width: number;
50
+ height: number;
51
+ }
52
+
53
+ export interface DefaultBannerMediaResults {
54
+ result: Result;
55
+ }
56
+
57
+ export interface Result {
58
+ id: string;
59
+ media_key: string;
60
+ media_id: string;
61
+ media_info: MediaInfo2;
62
+ __typename: string;
63
+ }
64
+
65
+ export interface MediaInfo2 {
66
+ __typename: string;
67
+ original_img_height: number;
68
+ original_img_width: number;
69
+ original_img_url: string;
70
+ salient_rect: SalientRect2;
71
+ }
72
+
73
+ export interface SalientRect2 {
74
+ height: number;
75
+ left: number;
76
+ top: number;
77
+ width: number;
78
+ }
79
+
80
+ export interface UserResults {
81
+ result: Result2;
82
+ }
83
+
84
+ export interface Result2 {
85
+ __typename: string;
86
+ id: string;
87
+ rest_id: string;
88
+ affiliates_highlighted_label: AffiliatesHighlightedLabel;
89
+ avatar: Avatar;
90
+ core: Core;
91
+ dm_permissions: DmPermissions;
92
+ has_graduated_access: boolean;
93
+ is_blue_verified: boolean;
94
+ legacy: Legacy;
95
+ location: Location;
96
+ media_permissions: MediaPermissions;
97
+ parody_commentary_fan_label: string;
98
+ profile_image_shape: string;
99
+ privacy: Privacy;
100
+ relationship_perspectives: RelationshipPerspectives;
101
+ tipjar_settings: TipjarSettings;
102
+ verification: Verification;
103
+ verified_phone_status: boolean;
104
+ }
105
+
106
+ export interface AffiliatesHighlightedLabel {}
107
+
108
+ export interface Avatar {
109
+ image_url: string;
110
+ }
111
+
112
+ export interface Core {
113
+ created_at: string;
114
+ name: string;
115
+ screen_name: string;
116
+ }
117
+
118
+ export interface DmPermissions {
119
+ can_dm: boolean;
120
+ }
121
+
122
+ export interface Legacy {
123
+ default_profile: boolean;
124
+ default_profile_image: boolean;
125
+ description: string;
126
+ entities: Entities;
127
+ fast_followers_count: number;
128
+ favourites_count: number;
129
+ followers_count: number;
130
+ friends_count: number;
131
+ has_custom_timelines: boolean;
132
+ is_translator: boolean;
133
+ listed_count: number;
134
+ media_count: number;
135
+ needs_phone_verification: boolean;
136
+ normal_followers_count: number;
137
+ pinned_tweet_ids_str: any[];
138
+ possibly_sensitive: boolean;
139
+ profile_interstitial_type: string;
140
+ statuses_count: number;
141
+ translator_type: string;
142
+ want_retweets: boolean;
143
+ withheld_in_countries: any[];
144
+ }
145
+
146
+ export interface Entities {
147
+ description: Description;
148
+ }
149
+
150
+ export interface Description {
151
+ urls: any[];
152
+ }
153
+
154
+ export interface Location {
155
+ location: string;
156
+ }
157
+
158
+ export interface MediaPermissions {
159
+ can_media_tag: boolean;
160
+ }
161
+
162
+ export interface Privacy {
163
+ protected: boolean;
164
+ }
165
+
166
+ export interface RelationshipPerspectives {
167
+ following: boolean;
168
+ }
169
+
170
+ export interface TipjarSettings {}
171
+
172
+ export interface Verification {
173
+ verified: boolean;
174
+ }