rettiwt-api 5.0.0-alpha.0 → 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/.eslintrc.js +2 -3
- package/.github/workflows/documentation.yml +1 -1
- package/.github/workflows/publish-alpha.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/.prettierignore +1 -1
- package/.tool-versions +1 -1
- package/README.md +100 -100
- package/dist/Rettiwt.d.ts +10 -3
- package/dist/Rettiwt.js +31 -12
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +8 -11
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +36 -2
- package/dist/collections/Extractors.js +41 -69
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +5 -1
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.d.ts +3 -3
- package/dist/collections/Requests.js +41 -40
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/List.js +21 -78
- package/dist/commands/List.js.map +1 -1
- package/dist/commands/Tweet.js +214 -373
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +138 -305
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Authentication.d.ts +10 -0
- package/dist/enums/Authentication.js +15 -0
- package/dist/enums/Authentication.js.map +1 -0
- package/dist/enums/Data.d.ts +3 -3
- package/dist/enums/Data.js +3 -3
- 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 +4 -0
- package/dist/enums/Resource.js +4 -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/CliUtils.js +1 -2
- package/dist/helper/CliUtils.js.map +1 -1
- package/dist/helper/JsonUtils.js +6 -11
- package/dist/helper/JsonUtils.js.map +1 -1
- 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 -5
- package/dist/index.js +26 -6
- 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 +16 -102
- package/dist/models/args/FetchArgs.js +105 -407
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +16 -73
- package/dist/models/args/PostArgs.js +43 -236
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/auth/AuthCookie.d.ts +21 -0
- package/dist/models/auth/AuthCookie.js +55 -0
- package/dist/models/auth/AuthCookie.js.map +1 -0
- package/dist/models/auth/AuthCredential.d.ts +30 -0
- package/dist/models/auth/AuthCredential.js +78 -0
- package/dist/models/auth/AuthCredential.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +5 -15
- package/dist/models/data/CursoredData.js +25 -32
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +7 -9
- package/dist/models/data/List.js +24 -4
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Notification.d.ts +10 -24
- package/dist/models/data/Notification.js +38 -36
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +34 -31
- package/dist/models/data/Tweet.js +186 -112
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +19 -23
- package/dist/models/data/User.js +92 -32
- package/dist/models/data/User.js.map +1 -1
- package/dist/models/errors/ApiError.js +8 -24
- package/dist/models/errors/ApiError.js.map +1 -1
- package/dist/models/errors/HttpError.js +8 -24
- package/dist/models/errors/HttpError.js.map +1 -1
- package/dist/models/errors/RettiwtError.d.ts +3 -2
- package/dist/models/errors/RettiwtError.js +8 -25
- package/dist/models/errors/RettiwtError.js.map +1 -1
- package/dist/models/errors/TimeoutError.js +5 -22
- package/dist/models/errors/TimeoutError.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 +60 -0
- package/dist/services/internal/AuthService.js +106 -0
- package/dist/services/internal/AuthService.js.map +1 -0
- package/dist/services/internal/ErrorService.js +38 -40
- package/dist/services/internal/ErrorService.js.map +1 -1
- package/dist/services/internal/LogService.d.ts +0 -6
- package/dist/services/internal/LogService.js +12 -32
- package/dist/services/internal/LogService.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 +22 -19
- package/dist/services/public/FetcherService.js +126 -153
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.d.ts +2 -2
- package/dist/services/public/ListService.js +31 -100
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +63 -10
- package/dist/services/public/TweetService.js +255 -387
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +4 -4
- package/dist/services/public/UserService.js +199 -386
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +17 -10
- package/dist/types/args/FetchArgs.d.ts +123 -0
- package/dist/types/{ReturnTypes.js → args/FetchArgs.js} +1 -1
- package/dist/types/args/FetchArgs.js.map +1 -0
- package/dist/types/args/PostArgs.d.ts +100 -0
- package/dist/types/args/PostArgs.js +3 -0
- package/dist/types/args/PostArgs.js.map +1 -0
- package/dist/types/auth/AuthCookie.d.ts +15 -0
- package/dist/types/auth/AuthCookie.js +3 -0
- package/dist/types/auth/AuthCookie.js.map +1 -0
- package/dist/types/auth/AuthCredential.d.ts +23 -0
- package/dist/types/auth/AuthCredential.js +3 -0
- package/dist/types/auth/AuthCredential.js.map +1 -0
- package/dist/types/auth/TidDynamicArgs.d.ts +10 -0
- package/dist/types/auth/TidDynamicArgs.js +3 -0
- package/dist/types/auth/TidDynamicArgs.js.map +1 -0
- package/dist/types/auth/TidHeader.d.ts +8 -0
- package/dist/types/auth/TidHeader.js +3 -0
- 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 +16 -0
- package/dist/types/data/CursoredData.js +3 -0
- package/dist/types/data/CursoredData.js.map +1 -0
- package/dist/types/data/List.d.ts +21 -0
- package/dist/types/data/List.js +3 -0
- package/dist/types/data/List.js.map +1 -0
- package/dist/types/data/Notification.d.ts +20 -0
- package/dist/types/data/Notification.js +3 -0
- package/dist/types/data/Notification.js.map +1 -0
- package/dist/types/data/Tweet.d.ts +71 -0
- package/dist/types/data/Tweet.js +3 -0
- package/dist/types/data/Tweet.js.map +1 -0
- package/dist/types/data/User.d.ts +35 -0
- package/dist/types/data/User.js +3 -0
- package/dist/types/data/User.js.map +1 -0
- 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/eslint.config.mjs +17 -0
- package/package.json +22 -19
- package/src/Rettiwt.ts +22 -7
- package/src/cli.ts +0 -2
- package/src/collections/Extractors.ts +40 -34
- package/src/collections/Groups.ts +4 -0
- package/src/collections/Requests.ts +46 -44
- package/src/commands/Tweet.ts +35 -7
- package/src/commands/User.ts +13 -2
- package/src/enums/Authentication.ts +10 -0
- package/src/enums/Data.ts +3 -3
- package/src/enums/Media.ts +10 -0
- package/src/enums/Notification.ts +12 -0
- package/src/enums/Resource.ts +4 -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/JsonUtils.ts +1 -1
- package/src/helper/TidUtils.ts +189 -0
- package/src/index.ts +78 -44
- package/src/models/RettiwtConfig.ts +64 -0
- package/src/models/args/FetchArgs.ts +86 -436
- package/src/models/args/PostArgs.ts +24 -249
- package/src/models/auth/AuthCookie.ts +58 -0
- package/src/models/auth/AuthCredential.ts +85 -0
- package/src/models/data/CursoredData.ts +21 -26
- package/src/models/data/List.ts +18 -15
- package/src/models/data/Notification.ts +25 -38
- package/src/models/data/Tweet.ts +143 -104
- package/src/models/data/User.ts +74 -44
- 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/{public → internal}/AuthService.ts +28 -60
- package/src/services/internal/LogService.ts +4 -19
- package/src/services/internal/TidService.ts +147 -0
- package/src/services/public/FetcherService.ts +89 -59
- package/src/services/public/ListService.ts +4 -4
- package/src/services/public/TweetService.ts +129 -42
- package/src/services/public/UserService.ts +49 -37
- package/src/types/RettiwtConfig.ts +18 -12
- package/src/types/args/FetchArgs.ts +148 -0
- package/src/types/args/PostArgs.ts +112 -0
- package/src/types/auth/AuthCookie.ts +22 -0
- package/src/types/auth/AuthCredential.ts +28 -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 +18 -0
- package/src/types/data/List.ts +27 -0
- package/src/types/data/Notification.ts +26 -0
- package/src/types/data/Tweet.ts +96 -0
- package/src/types/data/User.ts +48 -0
- 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/tsconfig.json +7 -5
- package/.eslintignore +0 -3
- package/dist/commands/Auth.d.ts +0 -10
- package/dist/commands/Auth.js +0 -101
- package/dist/commands/Auth.js.map +0 -1
- package/dist/models/errors/DataValidationError.d.ts +0 -30
- package/dist/models/errors/DataValidationError.js +0 -34
- package/dist/models/errors/DataValidationError.js.map +0 -1
- package/dist/services/public/AuthService.d.ts +0 -91
- package/dist/services/public/AuthService.js +0 -205
- package/dist/services/public/AuthService.js.map +0 -1
- package/dist/types/ReturnTypes.d.ts +0 -21
- package/dist/types/ReturnTypes.js.map +0 -1
- package/src/commands/Auth.ts +0 -46
- package/src/models/errors/DataValidationError.ts +0 -44
- package/src/types/ReturnTypes.ts +0 -24
|
@@ -0,0 +1,783 @@
|
|
|
1
|
+
import qs from 'querystring';
|
|
2
|
+
|
|
3
|
+
import { AxiosRequestConfig } from 'axios';
|
|
4
|
+
|
|
5
|
+
import { ERawAnalyticsGranularity, ERawAnalyticsMetric } from '../enums/raw/Analytics';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Collection of requests related to users.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export class UserRequests {
|
|
13
|
+
/**
|
|
14
|
+
* @param id - The id of the user whose affiliates are to be fetched.
|
|
15
|
+
* @param count - The number of affiliates to fetch. Only works as a lower limit when used with a cursor.
|
|
16
|
+
* @param cursor - The cursor to the batch of affiliates to fetch.
|
|
17
|
+
*/
|
|
18
|
+
public static affiliates(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
19
|
+
return {
|
|
20
|
+
method: 'get',
|
|
21
|
+
url: 'https://x.com/i/api/graphql/0M9yTHGhZjdIIxIcI9H2xQ/UserBusinessProfileTeamTimeline',
|
|
22
|
+
params: {
|
|
23
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
24
|
+
variables: JSON.stringify({
|
|
25
|
+
userId: id,
|
|
26
|
+
count: count,
|
|
27
|
+
cursor: cursor,
|
|
28
|
+
teamName: 'NotAssigned',
|
|
29
|
+
includePromotedContent: false,
|
|
30
|
+
withClientEventToken: false,
|
|
31
|
+
withVoice: false,
|
|
32
|
+
}),
|
|
33
|
+
features: JSON.stringify({
|
|
34
|
+
profile_label_improvements_pcf_label_in_post_enabled: true,
|
|
35
|
+
rweb_tipjar_consumption_enabled: true,
|
|
36
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
37
|
+
verified_phone_label_enabled: true,
|
|
38
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
39
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
40
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
41
|
+
premium_content_api_read_enabled: false,
|
|
42
|
+
communities_web_enable_tweet_community_results_fetch: true,
|
|
43
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
44
|
+
responsive_web_grok_analyze_button_fetch_trends_enabled: false,
|
|
45
|
+
responsive_web_grok_analyze_post_followups_enabled: true,
|
|
46
|
+
responsive_web_jetfuel_frame: false,
|
|
47
|
+
responsive_web_grok_share_attachment_enabled: true,
|
|
48
|
+
articles_preview_enabled: true,
|
|
49
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
50
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
51
|
+
view_counts_everywhere_api_enabled: true,
|
|
52
|
+
longform_notetweets_consumption_enabled: true,
|
|
53
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
54
|
+
tweet_awards_web_tipping_enabled: false,
|
|
55
|
+
responsive_web_grok_analysis_button_from_backend: true,
|
|
56
|
+
creator_subscriptions_quote_tweet_preview_enabled: false,
|
|
57
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
58
|
+
standardized_nudges_misinfo: true,
|
|
59
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
60
|
+
rweb_video_timestamps_enabled: true,
|
|
61
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
62
|
+
longform_notetweets_inline_media_enabled: true,
|
|
63
|
+
responsive_web_grok_image_annotation_enabled: false,
|
|
64
|
+
responsive_web_enhance_cards_enabled: false,
|
|
65
|
+
}),
|
|
66
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @param fromTime - The start time of the analytic data to be fetched.
|
|
73
|
+
* @param toTime - The end time of the analytic data to be fetched.
|
|
74
|
+
* @param granularity - The granularity of the analytic data to be fetched.
|
|
75
|
+
* @param requestedMetrics - The metrics to be fetched.
|
|
76
|
+
*/
|
|
77
|
+
public static analytics(
|
|
78
|
+
fromTime: Date,
|
|
79
|
+
toTime: Date,
|
|
80
|
+
granularity: ERawAnalyticsGranularity,
|
|
81
|
+
requestedMetrics: ERawAnalyticsMetric[],
|
|
82
|
+
): AxiosRequestConfig {
|
|
83
|
+
return {
|
|
84
|
+
method: 'get',
|
|
85
|
+
url: 'https://x.com/i/api/graphql/NlJ6RM-hgHxt-iu9cPQz7A/overviewDataUserQuery',
|
|
86
|
+
params: {
|
|
87
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
88
|
+
from_time: fromTime,
|
|
89
|
+
to_time: toTime,
|
|
90
|
+
granularity: granularity,
|
|
91
|
+
requested_metrics: requestedMetrics,
|
|
92
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
93
|
+
},
|
|
94
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @param count - The number of bookmarks to fetch.
|
|
100
|
+
* @param cursor - The cursor to the batch of bookmarks to fetch.
|
|
101
|
+
*/
|
|
102
|
+
public static bookmarks(count?: number, cursor?: string): AxiosRequestConfig {
|
|
103
|
+
return {
|
|
104
|
+
method: 'get',
|
|
105
|
+
url: 'https://x.com/i/api/graphql/qToeLeMs43Q8cr7tRYXmaQ/Bookmarks',
|
|
106
|
+
params: {
|
|
107
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
108
|
+
variables: JSON.stringify({
|
|
109
|
+
count: count,
|
|
110
|
+
cursor: cursor,
|
|
111
|
+
includePromotedContent: false,
|
|
112
|
+
}),
|
|
113
|
+
features: JSON.stringify({
|
|
114
|
+
graphql_timeline_v2_bookmark_timeline: true,
|
|
115
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
116
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
117
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
118
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
119
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
120
|
+
view_counts_everywhere_api_enabled: true,
|
|
121
|
+
longform_notetweets_consumption_enabled: true,
|
|
122
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
123
|
+
tweet_awards_web_tipping_enabled: false,
|
|
124
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
125
|
+
longform_notetweets_inline_media_enabled: true,
|
|
126
|
+
rweb_video_timestamps_enabled: true,
|
|
127
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
128
|
+
verified_phone_label_enabled: false,
|
|
129
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
130
|
+
standardized_nudges_misinfo: true,
|
|
131
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
132
|
+
responsive_web_media_download_video_enabled: false,
|
|
133
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
134
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
135
|
+
responsive_web_enhance_cards_enabled: false,
|
|
136
|
+
}),
|
|
137
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
138
|
+
},
|
|
139
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @param ids - The IDs of the users whose details are to be fetched.
|
|
145
|
+
*/
|
|
146
|
+
public static bulkDetailsByIds(ids: string[]): AxiosRequestConfig {
|
|
147
|
+
return {
|
|
148
|
+
method: 'get',
|
|
149
|
+
url: 'https://x.com/i/api/graphql/PyRggX3LQweP9nSF6PHliA/UsersByRestIds',
|
|
150
|
+
params: {
|
|
151
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
152
|
+
variables: JSON.stringify({ userIds: ids }),
|
|
153
|
+
features: JSON.stringify({
|
|
154
|
+
profile_label_improvements_pcf_label_in_post_enabled: false,
|
|
155
|
+
rweb_tipjar_consumption_enabled: false,
|
|
156
|
+
responsive_web_graphql_exclude_directive_enabled: false,
|
|
157
|
+
verified_phone_label_enabled: false,
|
|
158
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
159
|
+
responsive_web_graphql_timeline_navigation_enabled: false,
|
|
160
|
+
}),
|
|
161
|
+
fieldToggles: JSON.stringify({ withAuxiliaryUserLabels: false }),
|
|
162
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
163
|
+
},
|
|
164
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @param id - The id of the user whose details are to be fetched.
|
|
170
|
+
*/
|
|
171
|
+
public static detailsById(id: string): AxiosRequestConfig {
|
|
172
|
+
return {
|
|
173
|
+
method: 'get',
|
|
174
|
+
url: 'https://x.com/i/api/graphql/i_0UQ54YrCyqLUvgGzXygA/UserByRestId',
|
|
175
|
+
params: {
|
|
176
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
177
|
+
variables: JSON.stringify({ userId: id, withSafetyModeUserFields: true }),
|
|
178
|
+
features: JSON.stringify({
|
|
179
|
+
hidden_profile_likes_enabled: false,
|
|
180
|
+
hidden_profile_subscriptions_enabled: false,
|
|
181
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
182
|
+
verified_phone_label_enabled: true,
|
|
183
|
+
subscriptions_verification_info_verified_since_enabled: true,
|
|
184
|
+
highlights_tweets_tab_ui_enabled: true,
|
|
185
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
186
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
187
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
188
|
+
}),
|
|
189
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
190
|
+
},
|
|
191
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @param userName - The username of the user whose details are to be fetched.
|
|
197
|
+
*/
|
|
198
|
+
public static detailsByUsername(userName: string): AxiosRequestConfig {
|
|
199
|
+
return {
|
|
200
|
+
method: 'get',
|
|
201
|
+
url: 'https://x.com/i/api/graphql/oUZZZ8Oddwxs8Cd3iW3UEA/UserByScreenName',
|
|
202
|
+
params: {
|
|
203
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
204
|
+
variables: JSON.stringify({ screen_name: userName, withSafetyModeUserFields: true }),
|
|
205
|
+
features: JSON.stringify({
|
|
206
|
+
hidden_profile_likes_enabled: false,
|
|
207
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
208
|
+
verified_phone_label_enabled: true,
|
|
209
|
+
subscriptions_verification_info_verified_since_enabled: true,
|
|
210
|
+
highlights_tweets_tab_ui_enabled: true,
|
|
211
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
212
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
213
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
214
|
+
}),
|
|
215
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
216
|
+
},
|
|
217
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @param id - The id of the user to follow.
|
|
223
|
+
*/
|
|
224
|
+
public static follow(id: string): AxiosRequestConfig {
|
|
225
|
+
return {
|
|
226
|
+
method: 'post',
|
|
227
|
+
url: 'https://x.com/i/api/1.1/friendships/create.json',
|
|
228
|
+
data: qs.stringify({
|
|
229
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
230
|
+
user_id: id,
|
|
231
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
232
|
+
}),
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @param count - The number of timeline items to fetch. Only works as a lower limit when used with a cursor.
|
|
238
|
+
* @param cursor - The cursor to the batch of followed timeline items to fetch.
|
|
239
|
+
*/
|
|
240
|
+
public static followed(count?: number, cursor?: string): AxiosRequestConfig {
|
|
241
|
+
return {
|
|
242
|
+
method: 'get',
|
|
243
|
+
url: 'https://x.com/i/api/graphql/9EwYy8pLBOSFlEoSP2STiQ/HomeLatestTimeline',
|
|
244
|
+
params: {
|
|
245
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
246
|
+
variables: JSON.stringify({
|
|
247
|
+
count: count,
|
|
248
|
+
cursor: cursor,
|
|
249
|
+
includePromotedContent: false,
|
|
250
|
+
latestControlAvailable: true,
|
|
251
|
+
withCommunity: false,
|
|
252
|
+
}),
|
|
253
|
+
features: JSON.stringify({
|
|
254
|
+
rweb_tipjar_consumption_enabled: true,
|
|
255
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
256
|
+
verified_phone_label_enabled: true,
|
|
257
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
258
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
259
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
260
|
+
communities_web_enable_tweet_community_results_fetch: true,
|
|
261
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
262
|
+
articles_preview_enabled: false,
|
|
263
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
264
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
265
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
266
|
+
view_counts_everywhere_api_enabled: true,
|
|
267
|
+
longform_notetweets_consumption_enabled: true,
|
|
268
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
269
|
+
tweet_awards_web_tipping_enabled: false,
|
|
270
|
+
creator_subscriptions_quote_tweet_preview_enabled: false,
|
|
271
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
272
|
+
standardized_nudges_misinfo: true,
|
|
273
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
274
|
+
tweet_with_visibility_results_prefer_gql_media_interstitial_enabled: false,
|
|
275
|
+
rweb_video_timestamps_enabled: true,
|
|
276
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
277
|
+
longform_notetweets_inline_media_enabled: true,
|
|
278
|
+
responsive_web_enhance_cards_enabled: false,
|
|
279
|
+
}),
|
|
280
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
281
|
+
},
|
|
282
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @param id - The id of the user whose followers are to be fetched.
|
|
288
|
+
* @param count - The number of followers to fetch. Only works as a lower limit when used with a cursor.
|
|
289
|
+
* @param cursor - The cursor to the batch of followers to fetch.
|
|
290
|
+
*/
|
|
291
|
+
public static followers(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
292
|
+
return {
|
|
293
|
+
method: 'get',
|
|
294
|
+
url: 'https://x.com/i/api/graphql/6y5TB_HrwQM0FBGDiNfoEA/Followers',
|
|
295
|
+
params: {
|
|
296
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
297
|
+
variables: JSON.stringify({
|
|
298
|
+
userId: id,
|
|
299
|
+
count: count,
|
|
300
|
+
cursor: cursor,
|
|
301
|
+
includePromotedContent: false,
|
|
302
|
+
}),
|
|
303
|
+
features: JSON.stringify({
|
|
304
|
+
rweb_lists_timeline_redesign_enabled: true,
|
|
305
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
306
|
+
verified_phone_label_enabled: true,
|
|
307
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
308
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
309
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
310
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
311
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
312
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
313
|
+
view_counts_everywhere_api_enabled: true,
|
|
314
|
+
longform_notetweets_consumption_enabled: true,
|
|
315
|
+
responsive_web_twitter_article_tweet_consumption_enabled: false,
|
|
316
|
+
tweet_awards_web_tipping_enabled: false,
|
|
317
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
318
|
+
standardized_nudges_misinfo: true,
|
|
319
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
320
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
321
|
+
longform_notetweets_inline_media_enabled: true,
|
|
322
|
+
responsive_web_media_download_video_enabled: false,
|
|
323
|
+
responsive_web_enhance_cards_enabled: false,
|
|
324
|
+
}),
|
|
325
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
326
|
+
},
|
|
327
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @param id - The id of the user whose followings are to be fetched.
|
|
333
|
+
* @param count - The number of followings to fetch. Only works as a lower limit when used with a cursor.
|
|
334
|
+
* @param cursor - The cursor to the batch of followings to fetch.
|
|
335
|
+
*/
|
|
336
|
+
public static following(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
337
|
+
return {
|
|
338
|
+
method: 'get',
|
|
339
|
+
url: 'https://x.com/i/api/graphql/V8zHw0SZijWORSsb-FNrng/Following',
|
|
340
|
+
params: {
|
|
341
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
342
|
+
variables: JSON.stringify({
|
|
343
|
+
userId: id,
|
|
344
|
+
count: count,
|
|
345
|
+
cursor: cursor,
|
|
346
|
+
includePromotedContent: false,
|
|
347
|
+
}),
|
|
348
|
+
features: JSON.stringify({
|
|
349
|
+
rweb_lists_timeline_redesign_enabled: true,
|
|
350
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
351
|
+
verified_phone_label_enabled: true,
|
|
352
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
353
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
354
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
355
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
356
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
357
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
358
|
+
view_counts_everywhere_api_enabled: true,
|
|
359
|
+
longform_notetweets_consumption_enabled: true,
|
|
360
|
+
responsive_web_twitter_article_tweet_consumption_enabled: false,
|
|
361
|
+
tweet_awards_web_tipping_enabled: false,
|
|
362
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
363
|
+
standardized_nudges_misinfo: true,
|
|
364
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
365
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
366
|
+
longform_notetweets_inline_media_enabled: true,
|
|
367
|
+
responsive_web_media_download_video_enabled: false,
|
|
368
|
+
responsive_web_enhance_cards_enabled: false,
|
|
369
|
+
}),
|
|
370
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
371
|
+
},
|
|
372
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* @param id - The id of the user whose highlights are to be fetched.
|
|
378
|
+
* @param count - The number of highlights to fetch. Only works as a lower limit when used with a cursor.
|
|
379
|
+
* @param cursor - The cursor to the batch of highlights to fetch.
|
|
380
|
+
*/
|
|
381
|
+
public static highlights(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
382
|
+
return {
|
|
383
|
+
method: 'get',
|
|
384
|
+
url: 'https://x.com/i/api/graphql/Tqc024xHjye_svtpHJ236Q/UserHighlightsTweets',
|
|
385
|
+
params: {
|
|
386
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
387
|
+
variables: JSON.stringify({
|
|
388
|
+
userId: id,
|
|
389
|
+
count: count,
|
|
390
|
+
cursor: cursor,
|
|
391
|
+
includePromotedContent: false,
|
|
392
|
+
withVoice: false,
|
|
393
|
+
}),
|
|
394
|
+
features: JSON.stringify({
|
|
395
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
396
|
+
verified_phone_label_enabled: true,
|
|
397
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
398
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
399
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
400
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
401
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
402
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
403
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
404
|
+
view_counts_everywhere_api_enabled: true,
|
|
405
|
+
longform_notetweets_consumption_enabled: true,
|
|
406
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
407
|
+
tweet_awards_web_tipping_enabled: false,
|
|
408
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
409
|
+
standardized_nudges_misinfo: true,
|
|
410
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
411
|
+
rweb_video_timestamps_enabled: true,
|
|
412
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
413
|
+
longform_notetweets_inline_media_enabled: true,
|
|
414
|
+
responsive_web_enhance_cards_enabled: false,
|
|
415
|
+
}),
|
|
416
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
417
|
+
},
|
|
418
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @param id - The id of the user whose likes are to be fetched.
|
|
424
|
+
* @param count - The number of likes to fetch. Only works as a lower limit when used with a cursor.
|
|
425
|
+
* @param cursor - The cursor to the batch of likes to fetch.
|
|
426
|
+
*/
|
|
427
|
+
public static likes(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
428
|
+
return {
|
|
429
|
+
method: 'get',
|
|
430
|
+
url: 'https://x.com/i/api/graphql/kgZtsNyE46T3JaEf2nF9vw/Likes',
|
|
431
|
+
params: {
|
|
432
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
433
|
+
variables: JSON.stringify({
|
|
434
|
+
userId: id,
|
|
435
|
+
count: count,
|
|
436
|
+
cursor: cursor,
|
|
437
|
+
includePromotedContent: false,
|
|
438
|
+
withClientEventToken: false,
|
|
439
|
+
withBirdwatchNotes: false,
|
|
440
|
+
withVoice: false,
|
|
441
|
+
withV2Timeline: false,
|
|
442
|
+
}),
|
|
443
|
+
features: JSON.stringify({
|
|
444
|
+
rweb_lists_timeline_redesign_enabled: true,
|
|
445
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
446
|
+
verified_phone_label_enabled: true,
|
|
447
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
448
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
449
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
450
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
451
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
452
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
453
|
+
view_counts_everywhere_api_enabled: true,
|
|
454
|
+
longform_notetweets_consumption_enabled: true,
|
|
455
|
+
responsive_web_twitter_article_tweet_consumption_enabled: false,
|
|
456
|
+
tweet_awards_web_tipping_enabled: false,
|
|
457
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
458
|
+
standardized_nudges_misinfo: true,
|
|
459
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
460
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
461
|
+
longform_notetweets_inline_media_enabled: true,
|
|
462
|
+
responsive_web_media_download_video_enabled: false,
|
|
463
|
+
responsive_web_enhance_cards_enabled: false,
|
|
464
|
+
}),
|
|
465
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
466
|
+
},
|
|
467
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* @param id - The id of the user whose media is to be fetched.
|
|
473
|
+
* @param count - The number of media to fetch. Only works as a lower limit when used with a cursor.
|
|
474
|
+
* @param cursor - The cursor to the batch of media to fetch.
|
|
475
|
+
*/
|
|
476
|
+
public static media(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
477
|
+
return {
|
|
478
|
+
method: 'get',
|
|
479
|
+
url: 'https://x.com/i/api/graphql/EnIWTNQ8Tum-7t1NnZHOEQ/UserMedia',
|
|
480
|
+
params: {
|
|
481
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
482
|
+
variables: JSON.stringify({
|
|
483
|
+
userId: id,
|
|
484
|
+
count: count,
|
|
485
|
+
cursor: cursor,
|
|
486
|
+
includePromotedContent: false,
|
|
487
|
+
withClientEventToken: false,
|
|
488
|
+
withBirdwatchNotes: false,
|
|
489
|
+
withVoice: false,
|
|
490
|
+
withV2Timeline: false,
|
|
491
|
+
}),
|
|
492
|
+
features: JSON.stringify({
|
|
493
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
494
|
+
verified_phone_label_enabled: true,
|
|
495
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
496
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
497
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
498
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
499
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
500
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
501
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
502
|
+
view_counts_everywhere_api_enabled: true,
|
|
503
|
+
longform_notetweets_consumption_enabled: true,
|
|
504
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
505
|
+
tweet_awards_web_tipping_enabled: false,
|
|
506
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
507
|
+
standardized_nudges_misinfo: true,
|
|
508
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
509
|
+
rweb_video_timestamps_enabled: true,
|
|
510
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
511
|
+
longform_notetweets_inline_media_enabled: true,
|
|
512
|
+
responsive_web_enhance_cards_enabled: false,
|
|
513
|
+
}),
|
|
514
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
515
|
+
},
|
|
516
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* @param count - The number of notifications to fetch.
|
|
522
|
+
* @param cursor - The cursor to the batch of notifications to fetch.
|
|
523
|
+
*/
|
|
524
|
+
public static notifications(count?: number, cursor?: string): AxiosRequestConfig {
|
|
525
|
+
return {
|
|
526
|
+
method: 'get',
|
|
527
|
+
url: 'https://x.com/i/api/2/notifications/all.json',
|
|
528
|
+
params: {
|
|
529
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
530
|
+
include_profile_interstitial_type: 1,
|
|
531
|
+
include_blocking: 1,
|
|
532
|
+
include_blocked_by: 1,
|
|
533
|
+
include_followed_by: 1,
|
|
534
|
+
include_want_retweets: 1,
|
|
535
|
+
include_mute_edge: 1,
|
|
536
|
+
include_can_dm: 1,
|
|
537
|
+
include_can_media_tag: 1,
|
|
538
|
+
include_ext_is_blue_verified: 1,
|
|
539
|
+
include_ext_verified_type: 1,
|
|
540
|
+
include_ext_profile_image_shape: 1,
|
|
541
|
+
skip_status: 1,
|
|
542
|
+
cards_platform: 'Web-12',
|
|
543
|
+
include_cards: 1,
|
|
544
|
+
include_ext_alt_text: true,
|
|
545
|
+
include_ext_limited_action_results: true,
|
|
546
|
+
include_quote_count: true,
|
|
547
|
+
include_reply_count: 1,
|
|
548
|
+
tweet_mode: 'extended',
|
|
549
|
+
include_ext_views: true,
|
|
550
|
+
include_entities: true,
|
|
551
|
+
include_user_entities: true,
|
|
552
|
+
include_ext_media_color: true,
|
|
553
|
+
include_ext_media_availability: true,
|
|
554
|
+
include_ext_sensitive_media_warning: true,
|
|
555
|
+
include_ext_trusted_friends_metadata: true,
|
|
556
|
+
send_error_codes: true,
|
|
557
|
+
simple_quoted_tweet: true,
|
|
558
|
+
count: count,
|
|
559
|
+
cursor: cursor,
|
|
560
|
+
ext: 'mediaStats%2ChighlightedLabel%2CvoiceInfo%2CbirdwatchPivot%2CsuperFollowMetadata%2CunmentionInfo%2CeditControl%2Carticle',
|
|
561
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
562
|
+
},
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* @param count - The number of timeline items to fetch. Only works as a lower limit when used with a cursor.
|
|
568
|
+
* @param cursor - The cursor to the batch of recommended timeline items to fetch.
|
|
569
|
+
*/
|
|
570
|
+
public static recommended(count?: number, cursor?: string): AxiosRequestConfig {
|
|
571
|
+
return {
|
|
572
|
+
method: 'get',
|
|
573
|
+
url: 'https://x.com/i/api/graphql/q1x0puFIVMzsbx2Yoh-usA/HomeTimeline',
|
|
574
|
+
params: {
|
|
575
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
576
|
+
variables: JSON.stringify({
|
|
577
|
+
count: count,
|
|
578
|
+
cursor: cursor,
|
|
579
|
+
includePromotedContent: false,
|
|
580
|
+
latestControlAvailable: true,
|
|
581
|
+
withCommunity: false,
|
|
582
|
+
seenTweetIds: [],
|
|
583
|
+
}),
|
|
584
|
+
features: JSON.stringify({
|
|
585
|
+
rweb_tipjar_consumption_enabled: true,
|
|
586
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
587
|
+
verified_phone_label_enabled: true,
|
|
588
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
589
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
590
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
591
|
+
communities_web_enable_tweet_community_results_fetch: true,
|
|
592
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
593
|
+
articles_preview_enabled: false,
|
|
594
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
595
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
596
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
597
|
+
view_counts_everywhere_api_enabled: true,
|
|
598
|
+
longform_notetweets_consumption_enabled: true,
|
|
599
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
600
|
+
tweet_awards_web_tipping_enabled: false,
|
|
601
|
+
creator_subscriptions_quote_tweet_preview_enabled: false,
|
|
602
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
603
|
+
standardized_nudges_misinfo: true,
|
|
604
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
605
|
+
tweet_with_visibility_results_prefer_gql_media_interstitial_enabled: false,
|
|
606
|
+
rweb_video_timestamps_enabled: true,
|
|
607
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
608
|
+
longform_notetweets_inline_media_enabled: true,
|
|
609
|
+
responsive_web_enhance_cards_enabled: false,
|
|
610
|
+
}),
|
|
611
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
612
|
+
},
|
|
613
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
public static scheduled(): AxiosRequestConfig {
|
|
618
|
+
return {
|
|
619
|
+
method: 'get',
|
|
620
|
+
url: 'https://x.com/i/api/graphql/ITtjAzvlZni2wWXwf295Qg/FetchScheduledTweets?variables=%7B%22ascending%22%3Atrue%7D',
|
|
621
|
+
params: {
|
|
622
|
+
variables: JSON.stringify({ ascending: true }),
|
|
623
|
+
},
|
|
624
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* @param id - The id of the user whose subscriptions are to be fetched.
|
|
630
|
+
* @param count - The number of subscriptions to fetch. Only works as a lower limit when used with a cursor.
|
|
631
|
+
* @param cursor - The cursor to the batch of subscriptions to fetch.
|
|
632
|
+
*/
|
|
633
|
+
public static subscriptions(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
634
|
+
return {
|
|
635
|
+
method: 'get',
|
|
636
|
+
url: 'https://x.com/i/api/graphql/UWlxAhUnBNK0BYmeqNPqAw/UserCreatorSubscriptions',
|
|
637
|
+
params: {
|
|
638
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
639
|
+
variables: JSON.stringify({
|
|
640
|
+
userId: id,
|
|
641
|
+
count: count,
|
|
642
|
+
cursor: cursor,
|
|
643
|
+
includePromotedContent: false,
|
|
644
|
+
}),
|
|
645
|
+
features: JSON.stringify({
|
|
646
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
647
|
+
verified_phone_label_enabled: true,
|
|
648
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
649
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
650
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
651
|
+
c9s_tweet_anatomy_moderator_badge_enabled: true,
|
|
652
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
653
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
654
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
655
|
+
view_counts_everywhere_api_enabled: true,
|
|
656
|
+
longform_notetweets_consumption_enabled: true,
|
|
657
|
+
responsive_web_twitter_article_tweet_consumption_enabled: true,
|
|
658
|
+
tweet_awards_web_tipping_enabled: false,
|
|
659
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
660
|
+
standardized_nudges_misinfo: true,
|
|
661
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
662
|
+
rweb_video_timestamps_enabled: true,
|
|
663
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
664
|
+
longform_notetweets_inline_media_enabled: true,
|
|
665
|
+
responsive_web_enhance_cards_enabled: false,
|
|
666
|
+
}),
|
|
667
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
668
|
+
},
|
|
669
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* @param id - The id of the user whose timeline tweets are to be fetched.
|
|
675
|
+
* @param count - The number of timeline tweets to fetch. Only works as a lower limit when used with a cursor.
|
|
676
|
+
* @param cursor - The cursor to the batch of timeline tweets to fetch.
|
|
677
|
+
*/
|
|
678
|
+
public static tweets(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
679
|
+
return {
|
|
680
|
+
method: 'get',
|
|
681
|
+
url: 'https://x.com/i/api/graphql/9bXBrlmUXOHFZEq0DuvYWA/UserTweets',
|
|
682
|
+
params: {
|
|
683
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
684
|
+
variables: JSON.stringify({
|
|
685
|
+
userId: id,
|
|
686
|
+
count: count,
|
|
687
|
+
cursor: cursor,
|
|
688
|
+
includePromotedContent: false,
|
|
689
|
+
withQuickPromoteEligibilityTweetFields: false,
|
|
690
|
+
withVoice: false,
|
|
691
|
+
withV2Timeline: false,
|
|
692
|
+
}),
|
|
693
|
+
features: JSON.stringify({
|
|
694
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
695
|
+
verified_phone_label_enabled: true,
|
|
696
|
+
responsive_web_home_pinned_timelines_enabled: false,
|
|
697
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
698
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
699
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
700
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
701
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
702
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
703
|
+
view_counts_everywhere_api_enabled: true,
|
|
704
|
+
longform_notetweets_consumption_enabled: true,
|
|
705
|
+
responsive_web_twitter_article_tweet_consumption_enabled: false,
|
|
706
|
+
tweet_awards_web_tipping_enabled: false,
|
|
707
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
708
|
+
standardized_nudges_misinfo: true,
|
|
709
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
710
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
711
|
+
longform_notetweets_inline_media_enabled: true,
|
|
712
|
+
responsive_web_media_download_video_enabled: false,
|
|
713
|
+
responsive_web_enhance_cards_enabled: false,
|
|
714
|
+
}),
|
|
715
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
716
|
+
},
|
|
717
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* @param id - The id of the user whose timeline tweets and replies are to be fetched.
|
|
723
|
+
* @param count - The number of timeline tweets and replies to fetch. Only works as a lower limit when used with a cursor.
|
|
724
|
+
* @param cursor - The cursor to the batch of timeline tweets and replies to fetch.
|
|
725
|
+
*/
|
|
726
|
+
public static tweetsAndReplies(id: string, count?: number, cursor?: string): AxiosRequestConfig {
|
|
727
|
+
return {
|
|
728
|
+
method: 'get',
|
|
729
|
+
url: 'https://x.com/i/api/graphql/JFsmXeZ0h-hs934UFSfayw/UserTweetsAndReplies',
|
|
730
|
+
params: {
|
|
731
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
732
|
+
variables: JSON.stringify({
|
|
733
|
+
userId: id,
|
|
734
|
+
count: count,
|
|
735
|
+
cursor: cursor,
|
|
736
|
+
includePromotedContent: false,
|
|
737
|
+
withCommunity: false,
|
|
738
|
+
withVoice: false,
|
|
739
|
+
withV2Timeline: false,
|
|
740
|
+
}),
|
|
741
|
+
features: JSON.stringify({
|
|
742
|
+
responsive_web_graphql_exclude_directive_enabled: true,
|
|
743
|
+
verified_phone_label_enabled: true,
|
|
744
|
+
responsive_web_home_pinned_timelines_enabled: true,
|
|
745
|
+
creator_subscriptions_tweet_preview_api_enabled: true,
|
|
746
|
+
responsive_web_graphql_timeline_navigation_enabled: true,
|
|
747
|
+
responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
|
|
748
|
+
tweetypie_unmention_optimization_enabled: true,
|
|
749
|
+
responsive_web_edit_tweet_api_enabled: true,
|
|
750
|
+
graphql_is_translatable_rweb_tweet_is_translatable_enabled: true,
|
|
751
|
+
view_counts_everywhere_api_enabled: true,
|
|
752
|
+
longform_notetweets_consumption_enabled: true,
|
|
753
|
+
responsive_web_twitter_article_tweet_consumption_enabled: false,
|
|
754
|
+
tweet_awards_web_tipping_enabled: false,
|
|
755
|
+
freedom_of_speech_not_reach_fetch_enabled: true,
|
|
756
|
+
standardized_nudges_misinfo: true,
|
|
757
|
+
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: true,
|
|
758
|
+
longform_notetweets_rich_text_read_enabled: true,
|
|
759
|
+
longform_notetweets_inline_media_enabled: true,
|
|
760
|
+
responsive_web_media_download_video_enabled: false,
|
|
761
|
+
responsive_web_enhance_cards_enabled: false,
|
|
762
|
+
}),
|
|
763
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
764
|
+
},
|
|
765
|
+
paramsSerializer: { encode: encodeURIComponent },
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* @param id - The id of the user to be unfollowed.
|
|
771
|
+
*/
|
|
772
|
+
public static unfollow(id: string): AxiosRequestConfig {
|
|
773
|
+
return {
|
|
774
|
+
method: 'post',
|
|
775
|
+
url: 'https://x.com/i/api/1.1/friendships/destroy.json',
|
|
776
|
+
data: qs.stringify({
|
|
777
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
778
|
+
user_id: id,
|
|
779
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
780
|
+
}),
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
}
|