rettiwt-api 5.0.0-alpha.1 → 5.0.0-alpha.2
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/dist/Rettiwt.d.ts +10 -3
- package/dist/Rettiwt.js +19 -7
- package/dist/Rettiwt.js.map +1 -1
- package/dist/collections/Extractors.d.ts +35 -2
- package/dist/collections/Extractors.js +3 -0
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +3 -0
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.js +41 -41
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/Tweet.js +33 -7
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +12 -2
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Authentication.d.ts +2 -10
- package/dist/enums/Authentication.js +3 -12
- package/dist/enums/Authentication.js.map +1 -1
- package/dist/enums/Data.d.ts +3 -15
- package/dist/enums/Data.js +4 -17
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Media.d.ts +10 -0
- package/dist/enums/Media.js +15 -0
- package/dist/enums/Media.js.map +1 -0
- package/dist/enums/Notification.d.ts +12 -0
- package/dist/enums/Notification.js +17 -0
- package/dist/enums/Notification.js.map +1 -0
- package/dist/enums/Resource.d.ts +3 -0
- package/dist/enums/Resource.js +3 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/enums/raw/Analytics.d.ts +28 -0
- package/dist/enums/raw/Analytics.js +34 -0
- package/dist/enums/raw/Analytics.js.map +1 -0
- package/dist/enums/raw/Media.d.ts +10 -0
- package/dist/enums/raw/Media.js +15 -0
- package/dist/enums/raw/Media.js.map +1 -0
- package/dist/enums/raw/Notification.d.ts +11 -0
- package/dist/enums/raw/Notification.js +16 -0
- package/dist/enums/raw/Notification.js.map +1 -0
- package/dist/enums/raw/Tweet.d.ts +9 -0
- package/dist/enums/raw/Tweet.js +14 -0
- package/dist/enums/raw/Tweet.js.map +1 -0
- package/dist/helper/TidUtils.d.ts +2 -0
- package/dist/helper/TidUtils.js +162 -0
- package/dist/helper/TidUtils.js.map +1 -0
- package/dist/index.d.ts +75 -4
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/models/RettiwtConfig.d.ts +28 -0
- package/dist/models/RettiwtConfig.js +55 -0
- package/dist/models/RettiwtConfig.js.map +1 -0
- package/dist/models/args/FetchArgs.d.ts +46 -3
- package/dist/models/args/FetchArgs.js +107 -5
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +44 -16
- package/dist/models/args/PostArgs.js +61 -22
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/auth/AuthCookie.d.ts +2 -0
- package/dist/models/auth/AuthCookie.js +2 -0
- package/dist/models/auth/AuthCookie.js.map +1 -1
- package/dist/models/auth/AuthCredential.d.ts +2 -0
- package/dist/models/auth/AuthCredential.js +2 -0
- package/dist/models/auth/AuthCredential.js.map +1 -1
- package/dist/models/data/CursoredData.d.ts +4 -13
- package/dist/models/data/CursoredData.js +16 -23
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +5 -1
- package/dist/models/data/List.js +14 -0
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Notification.d.ts +7 -5
- package/dist/models/data/Notification.js +19 -8
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +29 -9
- package/dist/models/data/Tweet.js +103 -25
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +17 -8
- package/dist/models/data/User.js +63 -13
- package/dist/models/data/User.js.map +1 -1
- package/dist/models/errors/RettiwtError.d.ts +3 -2
- package/dist/models/errors/RettiwtError.js +3 -2
- package/dist/models/errors/RettiwtError.js.map +1 -1
- package/dist/models/params/Variables.d.ts +41 -0
- package/dist/models/params/Variables.js +61 -0
- package/dist/models/params/Variables.js.map +1 -0
- package/dist/requests/List.d.ts +24 -0
- package/dist/requests/List.js +122 -0
- package/dist/requests/List.js.map +1 -0
- package/dist/requests/Media.d.ts +21 -0
- package/dist/requests/Media.js +70 -0
- package/dist/requests/Media.js.map +1 -0
- package/dist/requests/Tweet.d.ts +75 -0
- package/dist/requests/Tweet.js +480 -0
- package/dist/requests/Tweet.js.map +1 -0
- package/dist/requests/User.d.ts +111 -0
- package/dist/requests/User.js +762 -0
- package/dist/requests/User.js.map +1 -0
- package/dist/services/internal/AuthService.d.ts +3 -5
- package/dist/services/internal/AuthService.js +5 -8
- package/dist/services/internal/AuthService.js.map +1 -1
- package/dist/services/internal/TidService.d.ts +44 -0
- package/dist/services/internal/TidService.js +162 -0
- package/dist/services/internal/TidService.js.map +1 -0
- package/dist/services/public/FetcherService.d.ts +20 -19
- package/dist/services/public/FetcherService.js +67 -49
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.d.ts +2 -2
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +35 -7
- package/dist/services/public/TweetService.js +54 -8
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +4 -4
- package/dist/services/public/UserService.js +25 -13
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +9 -10
- package/dist/types/args/FetchArgs.d.ts +71 -7
- package/dist/types/args/PostArgs.d.ts +62 -18
- package/dist/types/auth/AuthCookie.d.ts +2 -0
- package/dist/types/auth/AuthCredential.d.ts +2 -0
- package/dist/types/auth/TidDynamicArgs.d.ts +10 -0
- package/dist/types/auth/{AccountCredential.js → TidDynamicArgs.js} +1 -1
- package/dist/types/auth/TidDynamicArgs.js.map +1 -0
- package/dist/types/auth/TidHeader.d.ts +8 -0
- package/dist/types/{ReturnTypes.js → auth/TidHeader.js} +1 -1
- package/dist/types/auth/TidHeader.js.map +1 -0
- package/dist/types/auth/TidParams.d.ts +27 -0
- package/dist/types/auth/TidParams.js +3 -0
- package/dist/types/auth/TidParams.js.map +1 -0
- package/dist/types/auth/TidProvider.d.ts +18 -0
- package/dist/types/auth/TidProvider.js +3 -0
- package/dist/types/auth/TidProvider.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +1 -10
- package/dist/types/data/Notification.d.ts +2 -2
- package/dist/types/data/Tweet.d.ts +2 -2
- package/dist/types/params/Variables.d.ts +27 -0
- package/dist/types/params/Variables.js +3 -0
- package/dist/types/params/Variables.js.map +1 -0
- package/dist/types/raw/base/Analytic.d.ts +21 -0
- package/dist/types/raw/base/Analytic.js +4 -0
- package/dist/types/raw/base/Analytic.js.map +1 -0
- package/dist/types/raw/base/Cursor.d.ts +11 -0
- package/dist/types/raw/base/Cursor.js +4 -0
- package/dist/types/raw/base/Cursor.js.map +1 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.d.ts +32 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.js +4 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.js.map +1 -0
- package/dist/types/raw/base/List.d.ts +43 -0
- package/dist/types/raw/base/List.js +4 -0
- package/dist/types/raw/base/List.js.map +1 -0
- package/dist/types/raw/base/Media.d.ts +43 -0
- package/dist/types/raw/base/Media.js +4 -0
- package/dist/types/raw/base/Media.js.map +1 -0
- package/dist/types/raw/base/Notification.d.ts +53 -0
- package/dist/types/raw/base/Notification.js +4 -0
- package/dist/types/raw/base/Notification.js.map +1 -0
- package/dist/types/raw/base/Space.d.ts +32 -0
- package/dist/types/raw/base/Space.js +4 -0
- package/dist/types/raw/base/Space.js.map +1 -0
- package/dist/types/raw/base/Tweet.d.ts +119 -0
- package/dist/types/raw/base/Tweet.js +4 -0
- package/dist/types/raw/base/Tweet.js.map +1 -0
- package/dist/types/raw/base/User.d.ts +140 -0
- package/dist/types/raw/base/User.js +4 -0
- package/dist/types/raw/base/User.js.map +1 -0
- package/dist/types/raw/composite/DataResult.d.ts +8 -0
- package/dist/types/raw/composite/DataResult.js +3 -0
- package/dist/types/raw/composite/DataResult.js.map +1 -0
- package/dist/types/raw/composite/TimelineTweet.d.ts +11 -0
- package/dist/types/raw/composite/TimelineTweet.js +4 -0
- package/dist/types/raw/composite/TimelineTweet.js.map +1 -0
- package/dist/types/raw/composite/TimelineUser.d.ts +10 -0
- package/dist/types/raw/composite/TimelineUser.js +4 -0
- package/dist/types/raw/composite/TimelineUser.js.map +1 -0
- package/dist/types/raw/generic/Error.d.ts +30 -0
- package/dist/types/raw/generic/Error.js +3 -0
- package/dist/types/raw/generic/Error.js.map +1 -0
- package/dist/types/raw/generic/Response.d.ts +12 -0
- package/dist/types/raw/generic/Response.js +3 -0
- package/dist/types/raw/generic/Response.js.map +1 -0
- package/dist/types/raw/list/Details.d.ts +122 -0
- package/dist/types/raw/list/Details.js +4 -0
- package/dist/types/raw/list/Details.js.map +1 -0
- package/dist/types/raw/list/Members.d.ts +134 -0
- package/dist/types/raw/list/Members.js +4 -0
- package/dist/types/raw/list/Members.js.map +1 -0
- package/dist/types/raw/list/Tweets.d.ts +1968 -0
- package/dist/types/raw/list/Tweets.js +4 -0
- package/dist/types/raw/list/Tweets.js.map +1 -0
- package/dist/types/raw/media/FinalizeUpload.d.ts +18 -0
- package/dist/types/raw/media/FinalizeUpload.js +4 -0
- package/dist/types/raw/media/FinalizeUpload.js.map +1 -0
- package/dist/types/raw/media/InitalizeUpload.d.ts +10 -0
- package/dist/types/raw/media/InitalizeUpload.js +4 -0
- package/dist/types/raw/media/InitalizeUpload.js.map +1 -0
- package/dist/types/raw/media/LiveVideoStream.d.ts +19 -0
- package/dist/types/raw/media/LiveVideoStream.js +4 -0
- package/dist/types/raw/media/LiveVideoStream.js.map +1 -0
- package/dist/types/raw/space/Details.d.ts +315 -0
- package/dist/types/raw/space/Details.js +4 -0
- package/dist/types/raw/space/Details.js.map +1 -0
- package/dist/types/raw/tweet/Details.d.ts +183 -0
- package/dist/types/raw/tweet/Details.js +4 -0
- package/dist/types/raw/tweet/Details.js.map +1 -0
- package/dist/types/raw/tweet/Like.d.ts +12 -0
- package/dist/types/raw/tweet/Like.js +4 -0
- package/dist/types/raw/tweet/Like.js.map +1 -0
- package/dist/types/raw/tweet/Likers.d.ts +170 -0
- package/dist/types/raw/tweet/Likers.js +4 -0
- package/dist/types/raw/tweet/Likers.js.map +1 -0
- package/dist/types/raw/tweet/Post.d.ts +133 -0
- package/dist/types/raw/tweet/Post.js +4 -0
- package/dist/types/raw/tweet/Post.js.map +1 -0
- package/dist/types/raw/tweet/Replies.d.ts +465 -0
- package/dist/types/raw/tweet/Replies.js +4 -0
- package/dist/types/raw/tweet/Replies.js.map +1 -0
- package/dist/types/raw/tweet/Retweet.d.ts +25 -0
- package/dist/types/raw/tweet/Retweet.js +4 -0
- package/dist/types/raw/tweet/Retweet.js.map +1 -0
- package/dist/types/raw/tweet/Retweeters.d.ts +177 -0
- package/dist/types/raw/tweet/Retweeters.js +4 -0
- package/dist/types/raw/tweet/Retweeters.js.map +1 -0
- package/dist/types/raw/tweet/Schedule.d.ts +15 -0
- package/dist/types/raw/tweet/Schedule.js +4 -0
- package/dist/types/raw/tweet/Schedule.js.map +1 -0
- package/dist/types/raw/tweet/Search.d.ts +518 -0
- package/dist/types/raw/tweet/Search.js +4 -0
- package/dist/types/raw/tweet/Search.js.map +1 -0
- package/dist/types/raw/tweet/Unlike.d.ts +12 -0
- package/dist/types/raw/tweet/Unlike.js +4 -0
- package/dist/types/raw/tweet/Unlike.js.map +1 -0
- package/dist/types/raw/tweet/Unpost.d.ts +17 -0
- package/dist/types/raw/tweet/Unpost.js +4 -0
- package/dist/types/raw/tweet/Unpost.js.map +1 -0
- package/dist/types/raw/tweet/Unretweet.d.ts +25 -0
- package/dist/types/raw/tweet/Unretweet.js +4 -0
- package/dist/types/raw/tweet/Unretweet.js.map +1 -0
- package/dist/types/raw/tweet/Unschedule.d.ts +12 -0
- package/dist/types/raw/tweet/Unschedule.js +4 -0
- package/dist/types/raw/tweet/Unschedule.js.map +1 -0
- package/dist/types/raw/user/Affiliates.d.ts +154 -0
- package/dist/types/raw/user/Affiliates.js +4 -0
- package/dist/types/raw/user/Affiliates.js.map +1 -0
- package/dist/types/raw/user/Analytics.d.ts +32 -0
- package/dist/types/raw/user/Analytics.js +4 -0
- package/dist/types/raw/user/Analytics.js.map +1 -0
- package/dist/types/raw/user/Bookmarks.d.ts +550 -0
- package/dist/types/raw/user/Bookmarks.js +4 -0
- package/dist/types/raw/user/Bookmarks.js.map +1 -0
- package/dist/types/raw/user/Details.d.ts +157 -0
- package/dist/types/raw/user/Details.js +4 -0
- package/dist/types/raw/user/Details.js.map +1 -0
- package/dist/types/raw/user/Follow.d.ts +248 -0
- package/dist/types/raw/user/Follow.js +4 -0
- package/dist/types/raw/user/Follow.js.map +1 -0
- package/dist/types/raw/user/Followed.d.ts +1666 -0
- package/dist/types/raw/user/Followed.js +4 -0
- package/dist/types/raw/user/Followed.js.map +1 -0
- package/dist/types/raw/user/Followers.d.ts +182 -0
- package/dist/types/raw/user/Followers.js +4 -0
- package/dist/types/raw/user/Followers.js.map +1 -0
- package/dist/types/raw/user/Following.d.ts +182 -0
- package/dist/types/raw/user/Following.js +4 -0
- package/dist/types/raw/user/Following.js.map +1 -0
- package/dist/types/raw/user/Highlights.d.ts +1106 -0
- package/dist/types/raw/user/Highlights.js +4 -0
- package/dist/types/raw/user/Highlights.js.map +1 -0
- package/dist/types/raw/user/Likes.d.ts +1065 -0
- package/dist/types/raw/user/Likes.js +4 -0
- package/dist/types/raw/user/Likes.js.map +1 -0
- package/dist/types/raw/user/Media.d.ts +1492 -0
- package/dist/types/raw/user/Media.js +4 -0
- package/dist/types/raw/user/Media.js.map +1 -0
- package/dist/types/raw/user/Notifications.d.ts +142 -0
- package/dist/types/raw/user/Notifications.js +4 -0
- package/dist/types/raw/user/Notifications.js.map +1 -0
- package/dist/types/raw/user/Recommended.d.ts +1991 -0
- package/dist/types/raw/user/Recommended.js +4 -0
- package/dist/types/raw/user/Recommended.js.map +1 -0
- package/dist/types/raw/user/Scheduled.d.ts +31 -0
- package/dist/types/raw/user/Scheduled.js +4 -0
- package/dist/types/raw/user/Scheduled.js.map +1 -0
- package/dist/types/raw/user/Subscriptions.d.ts +151 -0
- package/dist/types/raw/user/Subscriptions.js +4 -0
- package/dist/types/raw/user/Subscriptions.js.map +1 -0
- package/dist/types/raw/user/Tweets.d.ts +1065 -0
- package/dist/types/raw/user/Tweets.js +4 -0
- package/dist/types/raw/user/Tweets.js.map +1 -0
- package/dist/types/raw/user/TweetsAndReplies.d.ts +1065 -0
- package/dist/types/raw/user/TweetsAndReplies.js +4 -0
- package/dist/types/raw/user/TweetsAndReplies.js.map +1 -0
- package/dist/types/raw/user/Unfollow.d.ts +248 -0
- package/dist/types/raw/user/Unfollow.js +4 -0
- package/dist/types/raw/user/Unfollow.js.map +1 -0
- package/package.json +3 -3
- package/src/Rettiwt.ts +22 -7
- package/src/collections/Extractors.ts +38 -34
- package/src/collections/Groups.ts +3 -0
- package/src/collections/Requests.ts +43 -42
- package/src/commands/Tweet.ts +35 -7
- package/src/commands/User.ts +13 -2
- package/src/enums/Authentication.ts +2 -11
- package/src/enums/Data.ts +3 -16
- package/src/enums/Media.ts +10 -0
- package/src/enums/Notification.ts +12 -0
- package/src/enums/Resource.ts +3 -0
- package/src/enums/raw/Analytics.ts +29 -0
- package/src/enums/raw/Media.ts +10 -0
- package/src/enums/raw/Notification.ts +11 -0
- package/src/enums/raw/Tweet.ts +9 -0
- package/src/helper/TidUtils.ts +189 -0
- package/src/index.ts +78 -43
- package/src/models/RettiwtConfig.ts +64 -0
- package/src/models/args/FetchArgs.ts +121 -5
- package/src/models/args/PostArgs.ts +61 -21
- package/src/models/auth/AuthCookie.ts +2 -0
- package/src/models/auth/AuthCredential.ts +2 -0
- package/src/models/data/CursoredData.ts +16 -24
- package/src/models/data/List.ts +16 -2
- package/src/models/data/Notification.ts +21 -12
- package/src/models/data/Tweet.ts +120 -39
- package/src/models/data/User.ts +71 -15
- package/src/models/errors/RettiwtError.ts +3 -2
- package/src/models/params/Variables.ts +62 -0
- package/src/requests/List.ts +121 -0
- package/src/requests/Media.ts +67 -0
- package/src/requests/Tweet.ts +496 -0
- package/src/requests/User.ts +783 -0
- package/src/services/internal/AuthService.ts +6 -11
- package/src/services/internal/TidService.ts +147 -0
- package/src/services/public/FetcherService.ts +78 -58
- package/src/services/public/ListService.ts +4 -4
- package/src/services/public/TweetService.ts +87 -40
- package/src/services/public/UserService.ts +47 -35
- package/src/types/RettiwtConfig.ts +11 -12
- package/src/types/args/FetchArgs.ts +92 -8
- package/src/types/args/PostArgs.ts +72 -22
- package/src/types/auth/AuthCookie.ts +2 -0
- package/src/types/auth/AuthCredential.ts +2 -0
- package/src/types/auth/TidDynamicArgs.ts +10 -0
- package/src/types/auth/TidHeader.ts +12 -0
- package/src/types/auth/TidParams.ts +36 -0
- package/src/types/auth/TidProvider.ts +19 -0
- package/src/types/data/CursoredData.ts +1 -11
- package/src/types/data/Notification.ts +2 -2
- package/src/types/data/Tweet.ts +2 -2
- package/src/types/params/Variables.ts +41 -0
- package/src/types/raw/base/Analytic.ts +26 -0
- package/src/types/raw/base/Cursor.ts +13 -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/Notification.ts +67 -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 +164 -0
- package/src/types/raw/composite/DataResult.ts +8 -0
- package/src/types/raw/composite/TimelineTweet.ts +14 -0
- package/src/types/raw/composite/TimelineUser.ts +13 -0
- package/src/types/raw/generic/Error.ts +35 -0
- package/src/types/raw/generic/Response.ts +13 -0
- package/src/types/raw/list/Details.ts +137 -0
- package/src/types/raw/list/Members.ts +154 -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/Details.ts +210 -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/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 +39 -0
- package/src/types/raw/user/Bookmarks.ts +637 -0
- package/src/types/raw/user/Details.ts +185 -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/Media.ts +1738 -0
- package/src/types/raw/user/Notifications.ts +175 -0
- package/src/types/raw/user/Recommended.ts +2319 -0
- package/src/types/raw/user/Scheduled.ts +37 -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/dist/models/auth/AccountCredential.d.ts +0 -13
- package/dist/models/auth/AccountCredential.js +0 -21
- package/dist/models/auth/AccountCredential.js.map +0 -1
- package/dist/types/ReturnTypes.d.ts +0 -21
- package/dist/types/ReturnTypes.js.map +0 -1
- package/dist/types/auth/AccountCredential.d.ts +0 -11
- package/dist/types/auth/AccountCredential.js.map +0 -1
- package/src/models/auth/AccountCredential.ts +0 -19
- package/src/types/ReturnTypes.ts +0 -24
- package/src/types/auth/AccountCredential.ts +0 -13
package/src/models/data/User.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ITimelineUser as IRawTimelineUser, IUser as IRawUser } from 'rettiwt-core';
|
|
2
|
-
|
|
3
1
|
import { ELogActions } from '../../enums/Logging';
|
|
4
2
|
import { findByFilter } from '../../helper/JsonUtils';
|
|
5
3
|
import { LogService } from '../../services/internal/LogService';
|
|
6
4
|
import { IUser } from '../../types/data/User';
|
|
5
|
+
import { IUser as IRawUser } from '../../types/raw/base/User';
|
|
6
|
+
import { ITimelineUser as IRawTimelineUser } from '../../types/raw/composite/TimelineUser';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The details of a single user.
|
|
@@ -33,7 +33,7 @@ export class User implements IUser {
|
|
|
33
33
|
this.id = user.rest_id;
|
|
34
34
|
this.userName = user.legacy.screen_name;
|
|
35
35
|
this.fullName = user.legacy.name;
|
|
36
|
-
this.createdAt = user.legacy.created_at;
|
|
36
|
+
this.createdAt = new Date(user.legacy.created_at).toISOString();
|
|
37
37
|
this.description = user.legacy.description.length ? user.legacy.description : undefined;
|
|
38
38
|
this.isVerified = user.is_blue_verified;
|
|
39
39
|
this.likeCount = user.legacy.favourites_count;
|
|
@@ -47,27 +47,26 @@ export class User implements IUser {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
* Extracts and deserializes
|
|
50
|
+
* Extracts and deserializes multiple target users from the given raw response data.
|
|
51
51
|
*
|
|
52
52
|
* @param response - The raw response data.
|
|
53
|
+
* @param ids - The ids of the target users.
|
|
53
54
|
*
|
|
54
|
-
* @returns The deserialized
|
|
55
|
-
*
|
|
56
|
-
* @internal
|
|
55
|
+
* @returns The target deserialized users.
|
|
57
56
|
*/
|
|
58
|
-
public static
|
|
59
|
-
|
|
57
|
+
public static multiple(response: NonNullable<unknown>, ids: string[]): User[] {
|
|
58
|
+
let users: User[] = [];
|
|
60
59
|
|
|
61
60
|
// Extracting the matching data
|
|
62
|
-
const extract = findByFilter<
|
|
61
|
+
const extract = findByFilter<IRawUser>(response, '__typename', 'User');
|
|
63
62
|
|
|
64
63
|
// Deserializing valid data
|
|
65
64
|
for (const item of extract) {
|
|
66
|
-
if (item.
|
|
65
|
+
if (item.legacy && item.legacy.created_at) {
|
|
67
66
|
// Logging
|
|
68
|
-
LogService.log(ELogActions.DESERIALIZE, { id: item.
|
|
67
|
+
LogService.log(ELogActions.DESERIALIZE, { id: item.rest_id });
|
|
69
68
|
|
|
70
|
-
users.push(new User(item
|
|
69
|
+
users.push(new User(item));
|
|
71
70
|
} else {
|
|
72
71
|
// Logging
|
|
73
72
|
LogService.log(ELogActions.WARNING, {
|
|
@@ -77,6 +76,11 @@ export class User implements IUser {
|
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
78
|
|
|
79
|
+
// Filtering only required user, if required
|
|
80
|
+
if (ids && ids.length) {
|
|
81
|
+
users = users.filter((user) => ids.includes(user.id));
|
|
82
|
+
}
|
|
83
|
+
|
|
80
84
|
return users;
|
|
81
85
|
}
|
|
82
86
|
|
|
@@ -86,8 +90,6 @@ export class User implements IUser {
|
|
|
86
90
|
* @param response - The raw response data.
|
|
87
91
|
*
|
|
88
92
|
* @returns The target deserialized user.
|
|
89
|
-
*
|
|
90
|
-
* @internal
|
|
91
93
|
*/
|
|
92
94
|
public static single(response: NonNullable<unknown>): User | undefined {
|
|
93
95
|
const users: User[] = [];
|
|
@@ -113,4 +115,58 @@ export class User implements IUser {
|
|
|
113
115
|
|
|
114
116
|
return users.length ? users[0] : undefined;
|
|
115
117
|
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Extracts and deserializes the timeline of users from the given raw response data.
|
|
121
|
+
*
|
|
122
|
+
* @param response - The raw response data.
|
|
123
|
+
*
|
|
124
|
+
* @returns The deserialized timeline of users.
|
|
125
|
+
*/
|
|
126
|
+
public static timeline(response: NonNullable<unknown>): User[] {
|
|
127
|
+
const users: User[] = [];
|
|
128
|
+
|
|
129
|
+
// Extracting the matching data
|
|
130
|
+
const extract = findByFilter<IRawTimelineUser>(response, '__typename', 'TimelineUser');
|
|
131
|
+
|
|
132
|
+
// Deserializing valid data
|
|
133
|
+
for (const item of extract) {
|
|
134
|
+
if (item.user_results?.result?.legacy) {
|
|
135
|
+
// Logging
|
|
136
|
+
LogService.log(ELogActions.DESERIALIZE, { id: item.user_results.result.rest_id });
|
|
137
|
+
|
|
138
|
+
users.push(new User(item.user_results.result));
|
|
139
|
+
} else {
|
|
140
|
+
// Logging
|
|
141
|
+
LogService.log(ELogActions.WARNING, {
|
|
142
|
+
action: ELogActions.DESERIALIZE,
|
|
143
|
+
message: `User not found, skipping`,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return users;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @returns A serializable JSON representation of `this` object.
|
|
153
|
+
*/
|
|
154
|
+
public toJSON(): IUser {
|
|
155
|
+
return {
|
|
156
|
+
createdAt: this.createdAt,
|
|
157
|
+
description: this.description,
|
|
158
|
+
followersCount: this.followersCount,
|
|
159
|
+
followingsCount: this.followingsCount,
|
|
160
|
+
fullName: this.fullName,
|
|
161
|
+
id: this.id,
|
|
162
|
+
isVerified: this.isVerified,
|
|
163
|
+
likeCount: this.likeCount,
|
|
164
|
+
location: this.location,
|
|
165
|
+
pinnedTweet: this.pinnedTweet,
|
|
166
|
+
profileBanner: this.profileBanner,
|
|
167
|
+
profileImage: this.profileImage,
|
|
168
|
+
statusesCount: this.statusesCount,
|
|
169
|
+
userName: this.userName,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
116
172
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { IMediaEntityVariable, IMediaVariable, IReplyVariable } from '../../types/params/Variables';
|
|
2
|
+
import { NewTweetMedia } from '../args/PostArgs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Media to be sent as payload.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export class MediaVariable implements IMediaVariable {
|
|
10
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
11
|
+
public media_entities: MediaEntityVariable[];
|
|
12
|
+
public possibly_sensitive: boolean;
|
|
13
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param media - The list of NewTweetMedia objects specifying the media items to be sent in the Tweet.
|
|
17
|
+
*/
|
|
18
|
+
public constructor(media: NewTweetMedia[]) {
|
|
19
|
+
this.media_entities = media.map((item) => new MediaEntityVariable(item));
|
|
20
|
+
this.possibly_sensitive = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Each media item in the media payload.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export class MediaEntityVariable implements IMediaEntityVariable {
|
|
30
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
31
|
+
public media_id: string;
|
|
32
|
+
public tagged_users: string[];
|
|
33
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param media - The NewTweetMedia object specifying the details of the media item to be included in the payload.
|
|
37
|
+
*/
|
|
38
|
+
public constructor(media: NewTweetMedia) {
|
|
39
|
+
this.media_id = media.id;
|
|
40
|
+
this.tagged_users = media.tags ?? [];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Reply specific details to be sent in payload.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export class ReplyVariable implements IReplyVariable {
|
|
50
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
51
|
+
public exclude_reply_user_ids: string[];
|
|
52
|
+
public in_reply_to_tweet_id: string;
|
|
53
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @param replyTo - The id of the Tweet to which this Tweet is a reply.
|
|
57
|
+
*/
|
|
58
|
+
public constructor(replyTo: string) {
|
|
59
|
+
this.in_reply_to_tweet_id = replyTo;
|
|
60
|
+
this.exclude_reply_user_ids = [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Collection of requests related to lists.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export class ListRequests {
|
|
9
|
+
/**
|
|
10
|
+
* @param id - The id of the list whose details are to be fetched.
|
|
11
|
+
*/
|
|
12
|
+
public static details(id: string): AxiosRequestConfig {
|
|
13
|
+
return {
|
|
14
|
+
method: 'get',
|
|
15
|
+
url: 'https://x.com/i/api/graphql/gO1_eYPohKYHwCG2m-1ZnQ/ListByRestId',
|
|
16
|
+
params: {
|
|
17
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
18
|
+
variables: JSON.stringify({ listId: id }),
|
|
19
|
+
features: JSON.stringify({
|
|
20
|
+
rweb_lists_timeline_redesign_enabled: true,
|
|
21
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
22
|
+
verified_phone_label_enabled: true,
|
|
23
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
24
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
25
|
+
}),
|
|
26
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
27
|
+
},
|
|
28
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @param id - The id of the list whose members are to be fetched.
|
|
34
|
+
* @param count - The number of members to fetch. Must be \<= 100.
|
|
35
|
+
* @param cursor - The cursor to the batch of members to fetch.
|
|
36
|
+
*/
|
|
37
|
+
public static members(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
38
|
+
return {
|
|
39
|
+
method: 'get',
|
|
40
|
+
url: 'https://x.com/i/api/graphql/dsJhIe3M0vCopjSfU6SlQw/ListMembers',
|
|
41
|
+
params: {
|
|
42
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
43
|
+
variables: JSON.stringify({
|
|
44
|
+
listId: id,
|
|
45
|
+
count: count,
|
|
46
|
+
cursor: cursor,
|
|
47
|
+
}),
|
|
48
|
+
features: JSON.stringify({
|
|
49
|
+
rweb_tipjar_consumption_enabled: true,
|
|
50
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
51
|
+
verified_phone_label_enabled: true,
|
|
52
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
53
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
54
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
55
|
+
communities_web_enable_tweet_community_results_fetch: true,
|
|
56
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
57
|
+
articles_preview_enabled: true,
|
|
58
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
59
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
60
|
+
view_counts_everywhere_api_enabled: true,
|
|
61
|
+
longform_notetweets_consumption_enabled: true,
|
|
62
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
63
|
+
tweet_awards_web_tipping_enabled: false,
|
|
64
|
+
creator_subscriptions_quote_tweet_preview_enabled: false,
|
|
65
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
66
|
+
standardized_nudges_misinfo: true,
|
|
67
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
68
|
+
rweb_video_timestamps_enabled: true,
|
|
69
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
70
|
+
longform_notetweets_inline_media_enabled: true,
|
|
71
|
+
responsive_web_enhance_cards_enabled: false,
|
|
72
|
+
}),
|
|
73
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @param id - The id of the list whose tweets are to be fetched.
|
|
80
|
+
* @param count - The number of tweets to fetch. Must be \<= 100.
|
|
81
|
+
* @param cursor - The cursor to the batch of tweets to fetch.
|
|
82
|
+
*/
|
|
83
|
+
public static tweets(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
84
|
+
return {
|
|
85
|
+
method: 'get',
|
|
86
|
+
url: 'https://x.com/i/api/graphql/naCjgapXCSCsbZ7qnnItQA/ListLatestTweetsTimeline',
|
|
87
|
+
params: {
|
|
88
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
89
|
+
variables: JSON.stringify({
|
|
90
|
+
listId: id,
|
|
91
|
+
count: count,
|
|
92
|
+
cursor: cursor,
|
|
93
|
+
}),
|
|
94
|
+
features: JSON.stringify({
|
|
95
|
+
rweb_lists_timeline_redesign_enabled: true,
|
|
96
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
97
|
+
verified_phone_label_enabled: true,
|
|
98
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
99
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
100
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
101
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
102
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
103
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
104
|
+
view_counts_everywhere_api_enabled: true,
|
|
105
|
+
longform_notetweets_consumption_enabled: true,
|
|
106
|
+
responsive_web_twitter_article_tweet_consumption_enabled: false,
|
|
107
|
+
tweet_awards_web_tipping_enabled: false,
|
|
108
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
109
|
+
standardized_nudges_misinfo: true,
|
|
110
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
111
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
112
|
+
longform_notetweets_inline_media_enabled: true,
|
|
113
|
+
responsive_web_media_download_video_enabled: false,
|
|
114
|
+
responsive_web_enhance_cards_enabled: false,
|
|
115
|
+
}),
|
|
116
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
117
|
+
},
|
|
118
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
4
|
+
import FormData from 'form-data';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Collection of requests related to media.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export class MediaRequests {
|
|
12
|
+
/**
|
|
13
|
+
* @param id - The allocated id of the media item to be uploaded.
|
|
14
|
+
* @param media - The media item to upload.
|
|
15
|
+
*/
|
|
16
|
+
public static appendUpload(id: string, media: string | ArrayBuffer): AxiosRequestConfig {
|
|
17
|
+
const data = new FormData();
|
|
18
|
+
data.append('media', typeof media == 'string' ? fs.createReadStream(media) : Buffer.from(media));
|
|
19
|
+
return {
|
|
20
|
+
method: 'post',
|
|
21
|
+
headers: { referer: 'https://x.com' },
|
|
22
|
+
url: 'https://upload.x.com/i/media/upload.json',
|
|
23
|
+
params: {
|
|
24
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
25
|
+
command: 'APPEND',
|
|
26
|
+
media_id: id,
|
|
27
|
+
segment_index: 0,
|
|
28
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
29
|
+
},
|
|
30
|
+
data: data,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param id - The allocated id of the media item.
|
|
36
|
+
*/
|
|
37
|
+
public static finalizeUpload(id: string): AxiosRequestConfig {
|
|
38
|
+
return {
|
|
39
|
+
method: 'post',
|
|
40
|
+
headers: { referer: 'https://x.com' },
|
|
41
|
+
url: 'https://upload.x.com/i/media/upload.json',
|
|
42
|
+
params: {
|
|
43
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
44
|
+
command: 'FINALIZE',
|
|
45
|
+
media_id: id,
|
|
46
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param size - The size (in bytes) of the media item to be uploaded.
|
|
53
|
+
*/
|
|
54
|
+
public static initializeUpload(size: number): AxiosRequestConfig {
|
|
55
|
+
return {
|
|
56
|
+
method: 'post',
|
|
57
|
+
headers: { referer: 'https://x.com' },
|
|
58
|
+
url: 'https://upload.x.com/i/media/upload.json',
|
|
59
|
+
params: {
|
|
60
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
61
|
+
command: 'INIT',
|
|
62
|
+
total_bytes: size,
|
|
63
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|