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
package/.eslintrc.js
CHANGED
|
@@ -17,9 +17,8 @@ module.exports = {
|
|
|
17
17
|
node: true,
|
|
18
18
|
jest: true,
|
|
19
19
|
},
|
|
20
|
-
ignorePatterns: ['.eslintrc.js'],
|
|
20
|
+
ignorePatterns: ['.eslintrc.js', 'eslint.config.mjs'],
|
|
21
21
|
rules: {
|
|
22
|
-
'@typescript-eslint/ban-ts-comment': 'off',
|
|
23
22
|
'@typescript-eslint/naming-convention': [
|
|
24
23
|
'warn',
|
|
25
24
|
{
|
|
@@ -136,7 +135,7 @@ module.exports = {
|
|
|
136
135
|
},
|
|
137
136
|
],
|
|
138
137
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
139
|
-
'@typescript-eslint/no-inferrable-types': '
|
|
138
|
+
'@typescript-eslint/no-inferrable-types': 'warn',
|
|
140
139
|
'tsdoc/syntax': 'warn',
|
|
141
140
|
'sort-imports': [
|
|
142
141
|
'warn',
|
package/.prettierignore
CHANGED
package/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
nodejs
|
|
1
|
+
nodejs 22.13.1
|
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ A CLI tool and an API for fetching data from Twitter for free!
|
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- NodeJS 20
|
|
8
|
+
- A working Twitter account (optional)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -21,44 +21,44 @@ For using the package in your own project, you can install it as a [dependency](
|
|
|
21
21
|
|
|
22
22
|
Rettiwt-API can be used with or without logging in to Twitter. As such, the two authentication strategies are:
|
|
23
23
|
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
24
|
+
- 'guest' authentication (without logging in) grants access to the following resources/actions:
|
|
25
|
+
|
|
26
|
+
- Tweet Details
|
|
27
|
+
- User Details (by username)
|
|
28
|
+
- User Replies Timeline
|
|
29
|
+
- User Timeline
|
|
30
|
+
|
|
31
|
+
- 'user' authentication (logging in) grants access to the following resources/actions:
|
|
32
|
+
|
|
33
|
+
- List Tweets
|
|
34
|
+
- List Members
|
|
35
|
+
- Tweet Details
|
|
36
|
+
- Tweet Like
|
|
37
|
+
- Tweet Media Upload
|
|
38
|
+
- Tweet Post
|
|
39
|
+
- Tweet Retweet
|
|
40
|
+
- Tweet Retweeters
|
|
41
|
+
- Tweet Schedule
|
|
42
|
+
- Tweet Search
|
|
43
|
+
- Tweet Stream
|
|
44
|
+
- Tweet Unlike
|
|
45
|
+
- Tweet Unpost
|
|
46
|
+
- Tweet Unretweet
|
|
47
|
+
- User Bookmarks
|
|
48
|
+
- User Details (by username or id)
|
|
49
|
+
- User Follow
|
|
50
|
+
- User Followed Feed
|
|
51
|
+
- User Followers
|
|
52
|
+
- User Following
|
|
53
|
+
- User Highlights
|
|
54
|
+
- User Likes
|
|
55
|
+
- User Media
|
|
56
|
+
- User Notification
|
|
57
|
+
- User Recommended Feed
|
|
58
|
+
- User Replies Timeline
|
|
59
|
+
- User Subscriptions
|
|
60
|
+
- User Timeline
|
|
61
|
+
- User Unfollow
|
|
62
62
|
|
|
63
63
|
By default, Rettiwt-API uses 'guest' authentication. If however, access to the full set of resources is required, 'user' authentication can be used. This is done by using the cookies associated with your Twitter/X account, and encoding them into an `API_KEY` for convenience. The said `API_KEY` can be obtained by using a browser extension, as follows:
|
|
64
64
|
|
|
@@ -84,8 +84,8 @@ By default, Rettiwt-API uses 'guest' authentication. If however, access to the f
|
|
|
84
84
|
|
|
85
85
|
#### Notes:
|
|
86
86
|
|
|
87
|
-
-
|
|
88
|
-
-
|
|
87
|
+
- `API_KEY` created in this way should last 5 years from the date of login, as long as the credentials to the account aren't changed.
|
|
88
|
+
- This approach can also be done without going into incognito/in-private mode, in which case you can either login as usual or skip the login step if you're already logged in, and continue from the steps after login. However, this makes the `API_KEY` to last only as long as the Twitter/X account isn't logged out of (you may exit the browser as usual) or 5 years, whichever comes first. That's why it's recommended to use incognito/in-private mode, so that the `API_KEY` isn't accidentially revoked by logging out.
|
|
89
89
|
|
|
90
90
|
### 2. Using the CLI (Borked):
|
|
91
91
|
|
|
@@ -102,33 +102,33 @@ By default, Rettiwt-API uses 'guest' authentication. If however, access to the f
|
|
|
102
102
|
|
|
103
103
|
#### Notes:
|
|
104
104
|
|
|
105
|
-
-
|
|
105
|
+
- The `API_KEY` created in this way expires after one year from the day it was generated.
|
|
106
106
|
|
|
107
107
|
## The API_KEY
|
|
108
108
|
|
|
109
109
|
The API_KEY generated by logging in is what allows Rettiwt-API to authenticate as a logged in user while interacting with the Twitter API ('user' authentication). As such it is a very sensitive information and therefore, must be stored securely. The following points must be kept in mind while using the API_KEY for 'user' authentication:
|
|
110
110
|
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
111
|
+
- The API_KEY is generated by logging into Twitter using the email, username and password and encoding the returned cookies as a base64 string. This encoded string is the API_KEY.
|
|
112
|
+
- The API_KEY provides the same level of authorization as any standard Twitter account, nothing more, nothing less.
|
|
113
|
+
- Since generation of API_KEY is equivalent to logging in to Twitter, repeated generation attempts might trigger Twitter's anti-bot measures, the same way repeated login attempts do.
|
|
114
|
+
- Therefore, it is recommended to generate the API_KEY only once, then use it every time it is needed.
|
|
115
|
+
- Do not generate an API_KEY if it has not expired yet!
|
|
116
116
|
|
|
117
117
|
## Notes for non-programmers
|
|
118
118
|
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
119
|
+
- If you have no idea of programming, it's recommended to use the CLI.
|
|
120
|
+
- The CLI provides an easy to use interface which does not require any knowledge of JavaScript or programming
|
|
121
|
+
- Please skip to [CLI-Usage](https://rishikant181.github.io/Rettiwt-API/#md:cli-usage) for details.
|
|
122
122
|
|
|
123
123
|
## Usage as a dependency
|
|
124
124
|
|
|
125
125
|
Rettiwt-API can be used as a dependency for your NodeJS project. In such a case, it is not required to install Rettiwt-API globally and you may install it locally in the root of your project using the command:
|
|
126
126
|
|
|
127
|
-
-
|
|
127
|
+
- `npm install --save rettiwt-api` (using npm)
|
|
128
128
|
|
|
129
129
|
or
|
|
130
130
|
|
|
131
|
-
-
|
|
131
|
+
- `yarn add rettiwt-api` (using yarn)
|
|
132
132
|
|
|
133
133
|
However, in this case, for accessing the CLI, you will be required to prepend the CLI commands with `npx` in order to tell NodeJS to use the locally installed package.
|
|
134
134
|
|
|
@@ -142,14 +142,14 @@ When used as a dependency, the [Rettiwt](https://rishikant181.github.io/Rettiwt-
|
|
|
142
142
|
|
|
143
143
|
A new Rettiwt instance can be initialized using the following code snippets:
|
|
144
144
|
|
|
145
|
-
-
|
|
146
|
-
-
|
|
145
|
+
- `const rettiwt = new Rettiwt()` (for 'guest' authentication)
|
|
146
|
+
- `const rettiwt = new Rettiwt({ apiKey: API_KEY })` (for 'user' authentication)
|
|
147
147
|
|
|
148
148
|
The Rettiwt class has three members:
|
|
149
149
|
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
150
|
+
- `auth` memeber, for managing authentication
|
|
151
|
+
- `tweet` member, for accessing resources related to tweets
|
|
152
|
+
- `user` member, for accessing resources related to users
|
|
153
153
|
|
|
154
154
|
For details regarding usage of these members for accessing the Twitter API, refer to [Features](https://rishikant181.github.io/Rettiwt-API/#md:features).
|
|
155
155
|
|
|
@@ -257,9 +257,9 @@ rettiwt.auth.login('<email>', '<username>', '<password>')
|
|
|
257
257
|
|
|
258
258
|
Where,
|
|
259
259
|
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
260
|
+
- `<email>` is the email associated with the Twitter account to be logged into.
|
|
261
|
+
- `<username>` is the username associated with the Twitter account.
|
|
262
|
+
- `<password>` is the password to the Twitter account.
|
|
263
263
|
|
|
264
264
|
## Using a proxy
|
|
265
265
|
|
|
@@ -284,7 +284,7 @@ This issue can be bypassed by using a proxy only for authentication, using the f
|
|
|
284
284
|
|
|
285
285
|
Where,
|
|
286
286
|
|
|
287
|
-
-
|
|
287
|
+
- `PROXY_URL` is the URL to the proxy server to use.
|
|
288
288
|
|
|
289
289
|
Authentication proxy is required only in the following two scenarios:
|
|
290
290
|
|
|
@@ -306,7 +306,7 @@ const rettiwt = new Rettiwt({ apiKey: API_KEY, logging: true });
|
|
|
306
306
|
|
|
307
307
|
Rettiwt-API also provides direct access to the raw response data, bypassing any preprocessing by the library itself. This can be achieved by using the [`FetcherService`](https://rishikant181.github.io/Rettiwt-API/classes/FetcherService.html) class instead of the `Rettiwt` class, as demonstrated by the example below, which fetches the raw details of a user with the username 'user1':
|
|
308
308
|
|
|
309
|
-
-
|
|
309
|
+
- ### JavaScript example:
|
|
310
310
|
|
|
311
311
|
```js
|
|
312
312
|
import { FetcherService, EResourceType } from 'rettiwt-api';
|
|
@@ -325,7 +325,7 @@ fetcher
|
|
|
325
325
|
});
|
|
326
326
|
```
|
|
327
327
|
|
|
328
|
-
-
|
|
328
|
+
- ### TypeScript example:
|
|
329
329
|
|
|
330
330
|
```ts
|
|
331
331
|
import { FetcherService, EResourceType, IUserDetailsResponse } from 'rettiwt-api';
|
|
@@ -352,48 +352,48 @@ So far, the following operations are supported:
|
|
|
352
352
|
|
|
353
353
|
### Authentication
|
|
354
354
|
|
|
355
|
-
-
|
|
356
|
-
-
|
|
355
|
+
- [Logging in as user](https://rishikant181.github.io/Rettiwt-API/classes/AuthService.html#login)
|
|
356
|
+
- [Logging in as guest](https://rishikant181.github.io/Rettiwt-API/classes/AuthService.html#guest)
|
|
357
357
|
|
|
358
358
|
### List
|
|
359
359
|
|
|
360
|
-
-
|
|
361
|
-
-
|
|
360
|
+
- [Getting the members of a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/ListService.html#members)
|
|
361
|
+
- [Getting the list of tweets from a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/ListService.html#tweets)
|
|
362
362
|
|
|
363
363
|
### Tweets
|
|
364
364
|
|
|
365
|
-
-
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
-
|
|
365
|
+
- [Getting the details of a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#details)
|
|
366
|
+
- [Liking a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#like)
|
|
367
|
+
- [Getting the list of tweets from a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#list)
|
|
368
|
+
- [Posting a new tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#post)
|
|
369
|
+
- [Retweeting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#retweet)
|
|
370
|
+
- [Getting the list of users who retweeted a given tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#retweeters)
|
|
371
|
+
- [Scheduling a new tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#schedule)
|
|
372
|
+
- [Searching for the list of tweets that match a given filter](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#search)
|
|
373
|
+
- [Streaming filtered tweets in pseudo-realtime](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#stream)
|
|
374
|
+
- [Unliking a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unlike)
|
|
375
|
+
- [Unposting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unpost)
|
|
376
|
+
- [Unretweeting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unretweet)
|
|
377
|
+
- [Unscheduling a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unschedule)
|
|
378
|
+
- [Uploading a media file for a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#upload)
|
|
379
379
|
|
|
380
380
|
### Users
|
|
381
381
|
|
|
382
|
-
-
|
|
383
|
-
-
|
|
384
|
-
-
|
|
385
|
-
-
|
|
386
|
-
-
|
|
387
|
-
-
|
|
388
|
-
-
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
393
|
-
-
|
|
394
|
-
-
|
|
395
|
-
-
|
|
396
|
-
-
|
|
382
|
+
- [Getting the list of tweets bookmarked by the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#bookmarks)
|
|
383
|
+
- [Getting the details of a user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#details)
|
|
384
|
+
- [Following a given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#follow)
|
|
385
|
+
- [Getting the followed feed of the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#followed)
|
|
386
|
+
- [Getting the list of users who follow the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#followers)
|
|
387
|
+
- [Getting the list of users who are followed by the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#following)
|
|
388
|
+
- [Getting the list of highlighted tweets of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#highlights)
|
|
389
|
+
- [Getting the list of tweets liked by the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#likes)
|
|
390
|
+
- [Getting the media timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#media)
|
|
391
|
+
- [Streaming notifications of the logged-in user in pseudo-realtime](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#notifications)
|
|
392
|
+
- [Getting the recommended feed of the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#recommended)
|
|
393
|
+
- [Getting the replies timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#replies)
|
|
394
|
+
- [Getting the list of subscriptions of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#subscriptions)
|
|
395
|
+
- [Getting the tweet timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#timeline)
|
|
396
|
+
- [Unfollowing a given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#unfollow)
|
|
397
397
|
|
|
398
398
|
## CLI Usage
|
|
399
399
|
|
|
@@ -410,8 +410,8 @@ By default, the CLI operates in 'guest' authentication. If you want to use 'user
|
|
|
410
410
|
|
|
411
411
|
Help for the CLI can be obtained from the CLI itself:
|
|
412
412
|
|
|
413
|
-
-
|
|
414
|
-
-
|
|
413
|
+
- For help regarding the available commands, use the command `rettiwt help`
|
|
414
|
+
- For help regarding a specific command, use the command `rettiwt help <command_name>`
|
|
415
415
|
|
|
416
416
|
## API Reference
|
|
417
417
|
|
|
@@ -419,7 +419,7 @@ The complete API reference can be found at [this](https://rishikant181.github.io
|
|
|
419
419
|
|
|
420
420
|
## Additional information
|
|
421
421
|
|
|
422
|
-
-
|
|
422
|
+
- This API uses the cookies of a Twitter account to fetch data from Twitter and as such, there is always a chance (although a measly one) of getting the account banned by Twitter algorithm.
|
|
423
423
|
|
|
424
424
|
## Donation
|
|
425
425
|
|
package/dist/Rettiwt.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AuthService } from './services/public/AuthService';
|
|
2
1
|
import { ListService } from './services/public/ListService';
|
|
3
2
|
import { TweetService } from './services/public/TweetService';
|
|
4
3
|
import { UserService } from './services/public/UserService';
|
|
@@ -45,8 +44,8 @@ import { IRettiwtConfig } from './types/RettiwtConfig';
|
|
|
45
44
|
* @public
|
|
46
45
|
*/
|
|
47
46
|
export declare class Rettiwt {
|
|
48
|
-
/** The
|
|
49
|
-
|
|
47
|
+
/** The configuration for Rettiwt. */
|
|
48
|
+
private _config;
|
|
50
49
|
/** The instance used to fetch data related to lists. */
|
|
51
50
|
list: ListService;
|
|
52
51
|
/** The instance used to fetch data related to tweets. */
|
|
@@ -59,4 +58,12 @@ export declare class Rettiwt {
|
|
|
59
58
|
* @param config - The config object for configuring the Rettiwt instance.
|
|
60
59
|
*/
|
|
61
60
|
constructor(config?: IRettiwtConfig);
|
|
61
|
+
/** Set the API key for the current instance. */
|
|
62
|
+
set apiKey(apiKey: string | undefined);
|
|
63
|
+
/** Set the custom headers for the current instance. */
|
|
64
|
+
set headers(headers: {
|
|
65
|
+
[key: string]: string;
|
|
66
|
+
});
|
|
67
|
+
/** Set the proxy URL for the current instance. */
|
|
68
|
+
set proxyUrl(proxyUrl: URL);
|
|
62
69
|
}
|
package/dist/Rettiwt.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Rettiwt = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const RettiwtConfig_1 = require("./models/RettiwtConfig");
|
|
5
|
+
const ListService_1 = require("./services/public/ListService");
|
|
6
|
+
const TweetService_1 = require("./services/public/TweetService");
|
|
7
|
+
const UserService_1 = require("./services/public/UserService");
|
|
8
8
|
/**
|
|
9
9
|
* The class for accessing Twitter API.
|
|
10
10
|
*
|
|
@@ -46,19 +46,38 @@ var UserService_1 = require("./services/public/UserService");
|
|
|
46
46
|
*
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
class Rettiwt {
|
|
50
|
+
/** The configuration for Rettiwt. */
|
|
51
|
+
_config;
|
|
52
|
+
/** The instance used to fetch data related to lists. */
|
|
53
|
+
list;
|
|
54
|
+
/** The instance used to fetch data related to tweets. */
|
|
55
|
+
tweet;
|
|
56
|
+
/** The instance used to fetch data related to users. */
|
|
57
|
+
user;
|
|
50
58
|
/**
|
|
51
59
|
* Initializes a new Rettiwt instance using the given api key.
|
|
52
60
|
*
|
|
53
61
|
* @param config - The config object for configuring the Rettiwt instance.
|
|
54
62
|
*/
|
|
55
|
-
|
|
56
|
-
this.
|
|
57
|
-
this.list = new ListService_1.ListService(
|
|
58
|
-
this.tweet = new TweetService_1.TweetService(
|
|
59
|
-
this.user = new UserService_1.UserService(
|
|
63
|
+
constructor(config) {
|
|
64
|
+
this._config = new RettiwtConfig_1.RettiwtConfig(config);
|
|
65
|
+
this.list = new ListService_1.ListService(this._config);
|
|
66
|
+
this.tweet = new TweetService_1.TweetService(this._config);
|
|
67
|
+
this.user = new UserService_1.UserService(this._config);
|
|
60
68
|
}
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
/** Set the API key for the current instance. */
|
|
70
|
+
set apiKey(apiKey) {
|
|
71
|
+
this._config.apiKey = apiKey;
|
|
72
|
+
}
|
|
73
|
+
/** Set the custom headers for the current instance. */
|
|
74
|
+
set headers(headers) {
|
|
75
|
+
this._config.headers = headers;
|
|
76
|
+
}
|
|
77
|
+
/** Set the proxy URL for the current instance. */
|
|
78
|
+
set proxyUrl(proxyUrl) {
|
|
79
|
+
this._config.proxyUrl = proxyUrl;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
63
82
|
exports.Rettiwt = Rettiwt;
|
|
64
83
|
//# sourceMappingURL=Rettiwt.js.map
|
package/dist/Rettiwt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rettiwt.js","sourceRoot":"","sources":["../src/Rettiwt.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Rettiwt.js","sourceRoot":"","sources":["../src/Rettiwt.ts"],"names":[],"mappings":";;;AAAA,0DAAuD;AACvD,+DAA4D;AAC5D,iEAA8D;AAC9D,+DAA4D;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAa,OAAO;IACnB,qCAAqC;IAC7B,OAAO,CAAgB;IAE/B,wDAAwD;IACjD,IAAI,CAAc;IAEzB,yDAAyD;IAClD,KAAK,CAAe;IAE3B,wDAAwD;IACjD,IAAI,CAAc;IAEzB;;;;OAIG;IACH,YAAmB,MAAuB;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,6BAAa,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,gDAAgD;IAChD,IAAW,MAAM,CAAC,MAA0B;QAC3C,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IAC9B,CAAC;IAED,uDAAuD;IACvD,IAAW,OAAO,CAAC,OAAkC;QACpD,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,kDAAkD;IAClD,IAAW,QAAQ,CAAC,QAAa;QAChC,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAClC,CAAC;CACD;AAvCD,0BAuCC"}
|
package/dist/cli.js
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
|
-
var _a;
|
|
7
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var Rettiwt_1 = require("./Rettiwt");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const List_1 = __importDefault(require("./commands/List"));
|
|
9
|
+
const Tweet_1 = __importDefault(require("./commands/Tweet"));
|
|
10
|
+
const User_1 = __importDefault(require("./commands/User"));
|
|
11
|
+
const Rettiwt_1 = require("./Rettiwt");
|
|
14
12
|
// Creating a new commandline program
|
|
15
|
-
|
|
13
|
+
const program = (0, commander_1.createCommand)('rettiwt')
|
|
16
14
|
.description('A CLI tool for accessing the Twitter API for free!')
|
|
17
15
|
.passThroughOptions()
|
|
18
16
|
.enablePositionalOptions();
|
|
@@ -25,8 +23,8 @@ program
|
|
|
25
23
|
// Parsing the program to get supplied options
|
|
26
24
|
program.parse();
|
|
27
25
|
// Initializing Rettiwt instance using the given options
|
|
28
|
-
|
|
29
|
-
apiKey:
|
|
26
|
+
const rettiwt = new Rettiwt_1.Rettiwt({
|
|
27
|
+
apiKey: process.env.API_KEY ?? program.opts().key,
|
|
30
28
|
logging: program.opts().log ? true : false,
|
|
31
29
|
proxyUrl: program.opts().proxy,
|
|
32
30
|
timeout: program.opts().timeout ? Number(program.opts().timeout) : undefined,
|
|
@@ -35,7 +33,6 @@ var rettiwt = new Rettiwt_1.Rettiwt({
|
|
|
35
33
|
program.addCommand((0, List_1.default)(rettiwt));
|
|
36
34
|
program.addCommand((0, Tweet_1.default)(rettiwt));
|
|
37
35
|
program.addCommand((0, User_1.default)(rettiwt));
|
|
38
|
-
program.addCommand((0, Auth_1.default)(rettiwt));
|
|
39
36
|
// Finalizing the CLI
|
|
40
37
|
program.parse();
|
|
41
38
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAA0C;AAE1C,2DAAmC;AACnC,6DAAqC;AACrC,2DAAmC;AACnC,uCAAoC;AAEpC,qCAAqC;AACrC,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,SAAS,CAAC;KACtC,WAAW,CAAC,oDAAoD,CAAC;KACjE,kBAAkB,EAAE;KACpB,uBAAuB,EAAE,CAAC;AAE5B,iBAAiB;AACjB,OAAO;KACL,MAAM,CAAC,oBAAoB,EAAE,uCAAuC,CAAC;KACrE,MAAM,CAAC,WAAW,EAAE,2BAA2B,CAAC;KAChD,MAAM,CAAC,sBAAsB,EAAE,6BAA6B,CAAC;KAC7D,MAAM,CAAC,wBAAwB,EAAE,mDAAmD,CAAC,CAAC;AAExF,8CAA8C;AAC9C,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,wDAAwD;AACxD,MAAM,OAAO,GAAY,IAAI,iBAAO,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAK,OAAO,CAAC,IAAI,EAAE,CAAC,GAAc;IAC7D,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;IAC1C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,KAAY;IACrC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;CAC5E,CAAC,CAAC;AAEH,sBAAsB;AACtB,OAAO,CAAC,UAAU,CAAC,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC,CAAC;AAElC,qBAAqB;AACrB,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,8 +1,38 @@
|
|
|
1
|
-
import { IInitializeMediaUploadResponse, IListMembersResponse, IListTweetsResponse, ITweetDetailsResponse, ITweetLikeResponse, ITweetPostResponse, ITweetRepliesResponse, ITweetRetweetersResponse, ITweetRetweetResponse, ITweetScheduleResponse, ITweetSearchResponse, ITweetUnlikeResponse, ITweetUnpostResponse, ITweetUnretweetResponse, ITweetUnscheduleResponse, IUserBookmarksResponse, IUserDetailsResponse, IUserFollowedResponse, IUserFollowersResponse, IUserFollowingResponse, IUserFollowResponse, IUserHighlightsResponse, IUserLikesResponse, IUserMediaResponse, IUserNotificationsResponse, IUserRecommendedResponse, IUserSubscriptionsResponse, IUserTweetsAndRepliesResponse, IUserTweetsResponse, IUserUnfollowResponse } from 'rettiwt-core';
|
|
2
1
|
import { CursoredData } from '../models/data/CursoredData';
|
|
3
2
|
import { Notification } from '../models/data/Notification';
|
|
4
3
|
import { Tweet } from '../models/data/Tweet';
|
|
5
4
|
import { User } from '../models/data/User';
|
|
5
|
+
import { IListMembersResponse } from '../types/raw/list/Members';
|
|
6
|
+
import { IListTweetsResponse } from '../types/raw/list/Tweets';
|
|
7
|
+
import { IMediaInitializeUploadResponse } from '../types/raw/media/InitalizeUpload';
|
|
8
|
+
import { ITweetDetailsResponse } from '../types/raw/tweet/Details';
|
|
9
|
+
import { ITweetLikeResponse } from '../types/raw/tweet/Like';
|
|
10
|
+
import { ITweetLikersResponse } from '../types/raw/tweet/Likers';
|
|
11
|
+
import { ITweetPostResponse } from '../types/raw/tweet/Post';
|
|
12
|
+
import { ITweetRepliesResponse } from '../types/raw/tweet/Replies';
|
|
13
|
+
import { ITweetRetweetResponse } from '../types/raw/tweet/Retweet';
|
|
14
|
+
import { ITweetRetweetersResponse } from '../types/raw/tweet/Retweeters';
|
|
15
|
+
import { ITweetScheduleResponse } from '../types/raw/tweet/Schedule';
|
|
16
|
+
import { ITweetSearchResponse } from '../types/raw/tweet/Search';
|
|
17
|
+
import { ITweetUnlikeResponse } from '../types/raw/tweet/Unlike';
|
|
18
|
+
import { ITweetUnpostResponse } from '../types/raw/tweet/Unpost';
|
|
19
|
+
import { ITweetUnretweetResponse } from '../types/raw/tweet/Unretweet';
|
|
20
|
+
import { ITweetUnscheduleResponse } from '../types/raw/tweet/Unschedule';
|
|
21
|
+
import { IUserBookmarksResponse } from '../types/raw/user/Bookmarks';
|
|
22
|
+
import { IUserDetailsResponse } from '../types/raw/user/Details';
|
|
23
|
+
import { IUserFollowResponse } from '../types/raw/user/Follow';
|
|
24
|
+
import { IUserFollowedResponse } from '../types/raw/user/Followed';
|
|
25
|
+
import { IUserFollowersResponse } from '../types/raw/user/Followers';
|
|
26
|
+
import { IUserFollowingResponse } from '../types/raw/user/Following';
|
|
27
|
+
import { IUserHighlightsResponse } from '../types/raw/user/Highlights';
|
|
28
|
+
import { IUserLikesResponse } from '../types/raw/user/Likes';
|
|
29
|
+
import { IUserMediaResponse } from '../types/raw/user/Media';
|
|
30
|
+
import { IUserNotificationsResponse } from '../types/raw/user/Notifications';
|
|
31
|
+
import { IUserRecommendedResponse } from '../types/raw/user/Recommended';
|
|
32
|
+
import { IUserSubscriptionsResponse } from '../types/raw/user/Subscriptions';
|
|
33
|
+
import { IUserTweetsResponse } from '../types/raw/user/Tweets';
|
|
34
|
+
import { IUserTweetsAndRepliesResponse } from '../types/raw/user/TweetsAndReplies';
|
|
35
|
+
import { IUserUnfollowResponse } from '../types/raw/user/Unfollow';
|
|
6
36
|
/**
|
|
7
37
|
* Collection of data extractors for each resource.
|
|
8
38
|
*
|
|
@@ -13,11 +43,14 @@ export declare const extractors: {
|
|
|
13
43
|
LIST_TWEETS: (response: IListTweetsResponse) => CursoredData<Tweet>;
|
|
14
44
|
MEDIA_UPLOAD_APPEND: () => void;
|
|
15
45
|
MEDIA_UPLOAD_FINALIZE: () => void;
|
|
16
|
-
MEDIA_UPLOAD_INITIALIZE: (response:
|
|
46
|
+
MEDIA_UPLOAD_INITIALIZE: (response: IMediaInitializeUploadResponse) => string;
|
|
17
47
|
TWEET_DETAILS: (response: ITweetDetailsResponse, id: string) => Tweet | undefined;
|
|
18
48
|
TWEET_DETAILS_ALT: (response: ITweetRepliesResponse, id: string) => Tweet | undefined;
|
|
49
|
+
TWEET_DETAILS_BULK: (response: NonNullable<unknown>, ids: string[]) => Tweet[];
|
|
19
50
|
TWEET_LIKE: (response: ITweetLikeResponse) => boolean;
|
|
51
|
+
TWEET_LIKERS: (response: ITweetLikersResponse) => CursoredData<User>;
|
|
20
52
|
TWEET_POST: (response: ITweetPostResponse) => string;
|
|
53
|
+
TWEET_REPLIES: (response: ITweetDetailsResponse) => CursoredData<Tweet>;
|
|
21
54
|
TWEET_RETWEET: (response: ITweetRetweetResponse) => boolean;
|
|
22
55
|
TWEET_RETWEETERS: (response: ITweetRetweetersResponse) => CursoredData<User>;
|
|
23
56
|
TWEET_SCHEDULE: (response: ITweetScheduleResponse) => string;
|
|
@@ -29,6 +62,7 @@ export declare const extractors: {
|
|
|
29
62
|
USER_BOOKMARKS: (response: IUserBookmarksResponse) => CursoredData<Tweet>;
|
|
30
63
|
USER_DETAILS_BY_USERNAME: (response: IUserDetailsResponse) => User | undefined;
|
|
31
64
|
USER_DETAILS_BY_ID: (response: IUserDetailsResponse) => User | undefined;
|
|
65
|
+
USER_DETAILS_BY_IDS_BULK: (response: NonNullable<unknown>, ids: string[]) => User[];
|
|
32
66
|
USER_FEED_FOLLOWED: (response: IUserFollowedResponse) => CursoredData<Tweet>;
|
|
33
67
|
USER_FEED_RECOMMENDED: (response: IUserRecommendedResponse) => CursoredData<Tweet>;
|
|
34
68
|
USER_FOLLOW: (response: IUserFollowResponse) => boolean;
|