rettiwt-api 5.0.0-alpha.1 → 5.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Rettiwt.d.ts +10 -3
- package/dist/Rettiwt.js +19 -7
- package/dist/Rettiwt.js.map +1 -1
- package/dist/collections/Extractors.d.ts +35 -2
- package/dist/collections/Extractors.js +3 -0
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +3 -0
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.js +41 -41
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/Tweet.js +33 -7
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +12 -2
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Authentication.d.ts +2 -10
- package/dist/enums/Authentication.js +3 -12
- package/dist/enums/Authentication.js.map +1 -1
- package/dist/enums/Data.d.ts +3 -15
- package/dist/enums/Data.js +4 -17
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Media.d.ts +10 -0
- package/dist/enums/Media.js +15 -0
- package/dist/enums/Media.js.map +1 -0
- package/dist/enums/Notification.d.ts +12 -0
- package/dist/enums/Notification.js +17 -0
- package/dist/enums/Notification.js.map +1 -0
- package/dist/enums/Resource.d.ts +3 -0
- package/dist/enums/Resource.js +3 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/enums/raw/Analytics.d.ts +28 -0
- package/dist/enums/raw/Analytics.js +34 -0
- package/dist/enums/raw/Analytics.js.map +1 -0
- package/dist/enums/raw/Media.d.ts +10 -0
- package/dist/enums/raw/Media.js +15 -0
- package/dist/enums/raw/Media.js.map +1 -0
- package/dist/enums/raw/Notification.d.ts +11 -0
- package/dist/enums/raw/Notification.js +16 -0
- package/dist/enums/raw/Notification.js.map +1 -0
- package/dist/enums/raw/Tweet.d.ts +9 -0
- package/dist/enums/raw/Tweet.js +14 -0
- package/dist/enums/raw/Tweet.js.map +1 -0
- package/dist/helper/TidUtils.d.ts +2 -0
- package/dist/helper/TidUtils.js +162 -0
- package/dist/helper/TidUtils.js.map +1 -0
- package/dist/index.d.ts +75 -4
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/models/RettiwtConfig.d.ts +28 -0
- package/dist/models/RettiwtConfig.js +55 -0
- package/dist/models/RettiwtConfig.js.map +1 -0
- package/dist/models/args/FetchArgs.d.ts +46 -3
- package/dist/models/args/FetchArgs.js +107 -5
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +44 -16
- package/dist/models/args/PostArgs.js +61 -22
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/auth/AuthCookie.d.ts +2 -0
- package/dist/models/auth/AuthCookie.js +2 -0
- package/dist/models/auth/AuthCookie.js.map +1 -1
- package/dist/models/auth/AuthCredential.d.ts +2 -0
- package/dist/models/auth/AuthCredential.js +2 -0
- package/dist/models/auth/AuthCredential.js.map +1 -1
- package/dist/models/data/CursoredData.d.ts +4 -13
- package/dist/models/data/CursoredData.js +16 -23
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +5 -1
- package/dist/models/data/List.js +14 -0
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Notification.d.ts +7 -5
- package/dist/models/data/Notification.js +19 -8
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +29 -9
- package/dist/models/data/Tweet.js +103 -25
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +17 -8
- package/dist/models/data/User.js +63 -13
- package/dist/models/data/User.js.map +1 -1
- package/dist/models/errors/RettiwtError.d.ts +3 -2
- package/dist/models/errors/RettiwtError.js +3 -2
- package/dist/models/errors/RettiwtError.js.map +1 -1
- package/dist/models/params/Variables.d.ts +41 -0
- package/dist/models/params/Variables.js +61 -0
- package/dist/models/params/Variables.js.map +1 -0
- package/dist/requests/List.d.ts +24 -0
- package/dist/requests/List.js +122 -0
- package/dist/requests/List.js.map +1 -0
- package/dist/requests/Media.d.ts +21 -0
- package/dist/requests/Media.js +70 -0
- package/dist/requests/Media.js.map +1 -0
- package/dist/requests/Tweet.d.ts +75 -0
- package/dist/requests/Tweet.js +500 -0
- package/dist/requests/Tweet.js.map +1 -0
- package/dist/requests/User.d.ts +111 -0
- package/dist/requests/User.js +762 -0
- package/dist/requests/User.js.map +1 -0
- package/dist/services/internal/AuthService.d.ts +3 -5
- package/dist/services/internal/AuthService.js +5 -8
- package/dist/services/internal/AuthService.js.map +1 -1
- package/dist/services/internal/TidService.d.ts +44 -0
- package/dist/services/internal/TidService.js +162 -0
- package/dist/services/internal/TidService.js.map +1 -0
- package/dist/services/public/FetcherService.d.ts +20 -19
- package/dist/services/public/FetcherService.js +67 -49
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.d.ts +2 -2
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +35 -7
- package/dist/services/public/TweetService.js +54 -8
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +4 -4
- package/dist/services/public/UserService.js +25 -13
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +9 -10
- package/dist/types/args/FetchArgs.d.ts +71 -7
- package/dist/types/args/PostArgs.d.ts +62 -18
- package/dist/types/auth/AuthCookie.d.ts +2 -0
- package/dist/types/auth/AuthCredential.d.ts +2 -0
- package/dist/types/auth/TidDynamicArgs.d.ts +10 -0
- package/dist/types/auth/{AccountCredential.js → TidDynamicArgs.js} +1 -1
- package/dist/types/auth/TidDynamicArgs.js.map +1 -0
- package/dist/types/auth/TidHeader.d.ts +8 -0
- package/dist/types/{ReturnTypes.js → auth/TidHeader.js} +1 -1
- package/dist/types/auth/TidHeader.js.map +1 -0
- package/dist/types/auth/TidParams.d.ts +27 -0
- package/dist/types/auth/TidParams.js +3 -0
- package/dist/types/auth/TidParams.js.map +1 -0
- package/dist/types/auth/TidProvider.d.ts +18 -0
- package/dist/types/auth/TidProvider.js +3 -0
- package/dist/types/auth/TidProvider.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +1 -10
- package/dist/types/data/Notification.d.ts +2 -2
- package/dist/types/data/Tweet.d.ts +2 -2
- package/dist/types/params/Variables.d.ts +27 -0
- package/dist/types/params/Variables.js +3 -0
- package/dist/types/params/Variables.js.map +1 -0
- package/dist/types/raw/base/Analytic.d.ts +21 -0
- package/dist/types/raw/base/Analytic.js +4 -0
- package/dist/types/raw/base/Analytic.js.map +1 -0
- package/dist/types/raw/base/Cursor.d.ts +11 -0
- package/dist/types/raw/base/Cursor.js +4 -0
- package/dist/types/raw/base/Cursor.js.map +1 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.d.ts +32 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.js +4 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.js.map +1 -0
- package/dist/types/raw/base/List.d.ts +43 -0
- package/dist/types/raw/base/List.js +4 -0
- package/dist/types/raw/base/List.js.map +1 -0
- package/dist/types/raw/base/Media.d.ts +43 -0
- package/dist/types/raw/base/Media.js +4 -0
- package/dist/types/raw/base/Media.js.map +1 -0
- package/dist/types/raw/base/Notification.d.ts +53 -0
- package/dist/types/raw/base/Notification.js +4 -0
- package/dist/types/raw/base/Notification.js.map +1 -0
- package/dist/types/raw/base/Space.d.ts +32 -0
- package/dist/types/raw/base/Space.js +4 -0
- package/dist/types/raw/base/Space.js.map +1 -0
- package/dist/types/raw/base/Tweet.d.ts +119 -0
- package/dist/types/raw/base/Tweet.js +4 -0
- package/dist/types/raw/base/Tweet.js.map +1 -0
- package/dist/types/raw/base/User.d.ts +140 -0
- package/dist/types/raw/base/User.js +4 -0
- package/dist/types/raw/base/User.js.map +1 -0
- package/dist/types/raw/composite/DataResult.d.ts +8 -0
- package/dist/types/raw/composite/DataResult.js +3 -0
- package/dist/types/raw/composite/DataResult.js.map +1 -0
- package/dist/types/raw/composite/TimelineTweet.d.ts +11 -0
- package/dist/types/raw/composite/TimelineTweet.js +4 -0
- package/dist/types/raw/composite/TimelineTweet.js.map +1 -0
- package/dist/types/raw/composite/TimelineUser.d.ts +10 -0
- package/dist/types/raw/composite/TimelineUser.js +4 -0
- package/dist/types/raw/composite/TimelineUser.js.map +1 -0
- package/dist/types/raw/generic/Error.d.ts +30 -0
- package/dist/types/raw/generic/Error.js +3 -0
- package/dist/types/raw/generic/Error.js.map +1 -0
- package/dist/types/raw/generic/Response.d.ts +12 -0
- package/dist/types/raw/generic/Response.js +3 -0
- package/dist/types/raw/generic/Response.js.map +1 -0
- package/dist/types/raw/list/Details.d.ts +122 -0
- package/dist/types/raw/list/Details.js +4 -0
- package/dist/types/raw/list/Details.js.map +1 -0
- package/dist/types/raw/list/Members.d.ts +134 -0
- package/dist/types/raw/list/Members.js +4 -0
- package/dist/types/raw/list/Members.js.map +1 -0
- package/dist/types/raw/list/Tweets.d.ts +1968 -0
- package/dist/types/raw/list/Tweets.js +4 -0
- package/dist/types/raw/list/Tweets.js.map +1 -0
- package/dist/types/raw/media/FinalizeUpload.d.ts +18 -0
- package/dist/types/raw/media/FinalizeUpload.js +4 -0
- package/dist/types/raw/media/FinalizeUpload.js.map +1 -0
- package/dist/types/raw/media/InitalizeUpload.d.ts +10 -0
- package/dist/types/raw/media/InitalizeUpload.js +4 -0
- package/dist/types/raw/media/InitalizeUpload.js.map +1 -0
- package/dist/types/raw/media/LiveVideoStream.d.ts +19 -0
- package/dist/types/raw/media/LiveVideoStream.js +4 -0
- package/dist/types/raw/media/LiveVideoStream.js.map +1 -0
- package/dist/types/raw/space/Details.d.ts +315 -0
- package/dist/types/raw/space/Details.js +4 -0
- package/dist/types/raw/space/Details.js.map +1 -0
- package/dist/types/raw/tweet/Details.d.ts +183 -0
- package/dist/types/raw/tweet/Details.js +4 -0
- package/dist/types/raw/tweet/Details.js.map +1 -0
- package/dist/types/raw/tweet/Like.d.ts +12 -0
- package/dist/types/raw/tweet/Like.js +4 -0
- package/dist/types/raw/tweet/Like.js.map +1 -0
- package/dist/types/raw/tweet/Likers.d.ts +170 -0
- package/dist/types/raw/tweet/Likers.js +4 -0
- package/dist/types/raw/tweet/Likers.js.map +1 -0
- package/dist/types/raw/tweet/Post.d.ts +133 -0
- package/dist/types/raw/tweet/Post.js +4 -0
- package/dist/types/raw/tweet/Post.js.map +1 -0
- package/dist/types/raw/tweet/Replies.d.ts +465 -0
- package/dist/types/raw/tweet/Replies.js +4 -0
- package/dist/types/raw/tweet/Replies.js.map +1 -0
- package/dist/types/raw/tweet/Retweet.d.ts +25 -0
- package/dist/types/raw/tweet/Retweet.js +4 -0
- package/dist/types/raw/tweet/Retweet.js.map +1 -0
- package/dist/types/raw/tweet/Retweeters.d.ts +177 -0
- package/dist/types/raw/tweet/Retweeters.js +4 -0
- package/dist/types/raw/tweet/Retweeters.js.map +1 -0
- package/dist/types/raw/tweet/Schedule.d.ts +15 -0
- package/dist/types/raw/tweet/Schedule.js +4 -0
- package/dist/types/raw/tweet/Schedule.js.map +1 -0
- package/dist/types/raw/tweet/Search.d.ts +518 -0
- package/dist/types/raw/tweet/Search.js +4 -0
- package/dist/types/raw/tweet/Search.js.map +1 -0
- package/dist/types/raw/tweet/Unlike.d.ts +12 -0
- package/dist/types/raw/tweet/Unlike.js +4 -0
- package/dist/types/raw/tweet/Unlike.js.map +1 -0
- package/dist/types/raw/tweet/Unpost.d.ts +17 -0
- package/dist/types/raw/tweet/Unpost.js +4 -0
- package/dist/types/raw/tweet/Unpost.js.map +1 -0
- package/dist/types/raw/tweet/Unretweet.d.ts +25 -0
- package/dist/types/raw/tweet/Unretweet.js +4 -0
- package/dist/types/raw/tweet/Unretweet.js.map +1 -0
- package/dist/types/raw/tweet/Unschedule.d.ts +12 -0
- package/dist/types/raw/tweet/Unschedule.js +4 -0
- package/dist/types/raw/tweet/Unschedule.js.map +1 -0
- package/dist/types/raw/user/Affiliates.d.ts +154 -0
- package/dist/types/raw/user/Affiliates.js +4 -0
- package/dist/types/raw/user/Affiliates.js.map +1 -0
- package/dist/types/raw/user/Analytics.d.ts +32 -0
- package/dist/types/raw/user/Analytics.js +4 -0
- package/dist/types/raw/user/Analytics.js.map +1 -0
- package/dist/types/raw/user/Bookmarks.d.ts +550 -0
- package/dist/types/raw/user/Bookmarks.js +4 -0
- package/dist/types/raw/user/Bookmarks.js.map +1 -0
- package/dist/types/raw/user/Details.d.ts +157 -0
- package/dist/types/raw/user/Details.js +4 -0
- package/dist/types/raw/user/Details.js.map +1 -0
- package/dist/types/raw/user/Follow.d.ts +248 -0
- package/dist/types/raw/user/Follow.js +4 -0
- package/dist/types/raw/user/Follow.js.map +1 -0
- package/dist/types/raw/user/Followed.d.ts +1666 -0
- package/dist/types/raw/user/Followed.js +4 -0
- package/dist/types/raw/user/Followed.js.map +1 -0
- package/dist/types/raw/user/Followers.d.ts +182 -0
- package/dist/types/raw/user/Followers.js +4 -0
- package/dist/types/raw/user/Followers.js.map +1 -0
- package/dist/types/raw/user/Following.d.ts +182 -0
- package/dist/types/raw/user/Following.js +4 -0
- package/dist/types/raw/user/Following.js.map +1 -0
- package/dist/types/raw/user/Highlights.d.ts +1106 -0
- package/dist/types/raw/user/Highlights.js +4 -0
- package/dist/types/raw/user/Highlights.js.map +1 -0
- package/dist/types/raw/user/Likes.d.ts +1065 -0
- package/dist/types/raw/user/Likes.js +4 -0
- package/dist/types/raw/user/Likes.js.map +1 -0
- package/dist/types/raw/user/Media.d.ts +1492 -0
- package/dist/types/raw/user/Media.js +4 -0
- package/dist/types/raw/user/Media.js.map +1 -0
- package/dist/types/raw/user/Notifications.d.ts +142 -0
- package/dist/types/raw/user/Notifications.js +4 -0
- package/dist/types/raw/user/Notifications.js.map +1 -0
- package/dist/types/raw/user/Recommended.d.ts +1991 -0
- package/dist/types/raw/user/Recommended.js +4 -0
- package/dist/types/raw/user/Recommended.js.map +1 -0
- package/dist/types/raw/user/Scheduled.d.ts +31 -0
- package/dist/types/raw/user/Scheduled.js +4 -0
- package/dist/types/raw/user/Scheduled.js.map +1 -0
- package/dist/types/raw/user/Subscriptions.d.ts +151 -0
- package/dist/types/raw/user/Subscriptions.js +4 -0
- package/dist/types/raw/user/Subscriptions.js.map +1 -0
- package/dist/types/raw/user/Tweets.d.ts +1065 -0
- package/dist/types/raw/user/Tweets.js +4 -0
- package/dist/types/raw/user/Tweets.js.map +1 -0
- package/dist/types/raw/user/TweetsAndReplies.d.ts +1065 -0
- package/dist/types/raw/user/TweetsAndReplies.js +4 -0
- package/dist/types/raw/user/TweetsAndReplies.js.map +1 -0
- package/dist/types/raw/user/Unfollow.d.ts +248 -0
- package/dist/types/raw/user/Unfollow.js +4 -0
- package/dist/types/raw/user/Unfollow.js.map +1 -0
- package/package.json +3 -3
- package/src/Rettiwt.ts +22 -7
- package/src/collections/Extractors.ts +38 -34
- package/src/collections/Groups.ts +3 -0
- package/src/collections/Requests.ts +43 -42
- package/src/commands/Tweet.ts +35 -7
- package/src/commands/User.ts +13 -2
- package/src/enums/Authentication.ts +2 -11
- package/src/enums/Data.ts +3 -16
- package/src/enums/Media.ts +10 -0
- package/src/enums/Notification.ts +12 -0
- package/src/enums/Resource.ts +3 -0
- package/src/enums/raw/Analytics.ts +29 -0
- package/src/enums/raw/Media.ts +10 -0
- package/src/enums/raw/Notification.ts +11 -0
- package/src/enums/raw/Tweet.ts +9 -0
- package/src/helper/TidUtils.ts +189 -0
- package/src/index.ts +78 -43
- package/src/models/RettiwtConfig.ts +64 -0
- package/src/models/args/FetchArgs.ts +121 -5
- package/src/models/args/PostArgs.ts +61 -21
- package/src/models/auth/AuthCookie.ts +2 -0
- package/src/models/auth/AuthCredential.ts +2 -0
- package/src/models/data/CursoredData.ts +16 -24
- package/src/models/data/List.ts +16 -2
- package/src/models/data/Notification.ts +21 -12
- package/src/models/data/Tweet.ts +120 -39
- package/src/models/data/User.ts +71 -15
- package/src/models/errors/RettiwtError.ts +3 -2
- package/src/models/params/Variables.ts +62 -0
- package/src/requests/List.ts +121 -0
- package/src/requests/Media.ts +67 -0
- package/src/requests/Tweet.ts +516 -0
- package/src/requests/User.ts +783 -0
- package/src/services/internal/AuthService.ts +6 -11
- package/src/services/internal/TidService.ts +147 -0
- package/src/services/public/FetcherService.ts +78 -58
- package/src/services/public/ListService.ts +4 -4
- package/src/services/public/TweetService.ts +87 -40
- package/src/services/public/UserService.ts +47 -35
- package/src/types/RettiwtConfig.ts +11 -12
- package/src/types/args/FetchArgs.ts +92 -8
- package/src/types/args/PostArgs.ts +72 -22
- package/src/types/auth/AuthCookie.ts +2 -0
- package/src/types/auth/AuthCredential.ts +2 -0
- package/src/types/auth/TidDynamicArgs.ts +10 -0
- package/src/types/auth/TidHeader.ts +12 -0
- package/src/types/auth/TidParams.ts +36 -0
- package/src/types/auth/TidProvider.ts +19 -0
- package/src/types/data/CursoredData.ts +1 -11
- package/src/types/data/Notification.ts +2 -2
- package/src/types/data/Tweet.ts +2 -2
- package/src/types/params/Variables.ts +41 -0
- package/src/types/raw/base/Analytic.ts +26 -0
- package/src/types/raw/base/Cursor.ts +13 -0
- package/src/types/raw/base/LimitedVisibilityTweet.ts +40 -0
- package/src/types/raw/base/List.ts +50 -0
- package/src/types/raw/base/Media.ts +53 -0
- package/src/types/raw/base/Notification.ts +67 -0
- package/src/types/raw/base/Space.ts +35 -0
- package/src/types/raw/base/Tweet.ts +139 -0
- package/src/types/raw/base/User.ts +164 -0
- package/src/types/raw/composite/DataResult.ts +8 -0
- package/src/types/raw/composite/TimelineTweet.ts +14 -0
- package/src/types/raw/composite/TimelineUser.ts +13 -0
- package/src/types/raw/generic/Error.ts +35 -0
- package/src/types/raw/generic/Response.ts +13 -0
- package/src/types/raw/list/Details.ts +137 -0
- package/src/types/raw/list/Members.ts +154 -0
- package/src/types/raw/list/Tweets.ts +2296 -0
- package/src/types/raw/media/FinalizeUpload.ts +20 -0
- package/src/types/raw/media/InitalizeUpload.ts +12 -0
- package/src/types/raw/media/LiveVideoStream.ts +21 -0
- package/src/types/raw/space/Details.ts +359 -0
- package/src/types/raw/tweet/Details.ts +210 -0
- package/src/types/raw/tweet/Like.ts +14 -0
- package/src/types/raw/tweet/Likers.ts +200 -0
- package/src/types/raw/tweet/Post.ts +150 -0
- package/src/types/raw/tweet/Replies.ts +539 -0
- package/src/types/raw/tweet/Retweet.ts +31 -0
- package/src/types/raw/tweet/Retweeters.ts +208 -0
- package/src/types/raw/tweet/Schedule.ts +18 -0
- package/src/types/raw/tweet/Search.ts +597 -0
- package/src/types/raw/tweet/Unlike.ts +14 -0
- package/src/types/raw/tweet/Unpost.ts +20 -0
- package/src/types/raw/tweet/Unretweet.ts +31 -0
- package/src/types/raw/tweet/Unschedule.ts +14 -0
- package/src/types/raw/user/Affiliates.ts +179 -0
- package/src/types/raw/user/Analytics.ts +39 -0
- package/src/types/raw/user/Bookmarks.ts +637 -0
- package/src/types/raw/user/Details.ts +185 -0
- package/src/types/raw/user/Follow.ts +280 -0
- package/src/types/raw/user/Followed.ts +1942 -0
- package/src/types/raw/user/Followers.ts +215 -0
- package/src/types/raw/user/Following.ts +215 -0
- package/src/types/raw/user/Highlights.ts +1287 -0
- package/src/types/raw/user/Likes.ts +1254 -0
- package/src/types/raw/user/Media.ts +1738 -0
- package/src/types/raw/user/Notifications.ts +175 -0
- package/src/types/raw/user/Recommended.ts +2319 -0
- package/src/types/raw/user/Scheduled.ts +37 -0
- package/src/types/raw/user/Subscriptions.ts +176 -0
- package/src/types/raw/user/Tweets.ts +1254 -0
- package/src/types/raw/user/TweetsAndReplies.ts +1254 -0
- package/src/types/raw/user/Unfollow.ts +280 -0
- package/dist/models/auth/AccountCredential.d.ts +0 -13
- package/dist/models/auth/AccountCredential.js +0 -21
- package/dist/models/auth/AccountCredential.js.map +0 -1
- package/dist/types/ReturnTypes.d.ts +0 -21
- package/dist/types/ReturnTypes.js.map +0 -1
- package/dist/types/auth/AccountCredential.d.ts +0 -11
- package/dist/types/auth/AccountCredential.js.map +0 -1
- package/src/models/auth/AccountCredential.ts +0 -19
- package/src/types/ReturnTypes.ts +0 -24
- package/src/types/auth/AccountCredential.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListService.js","sourceRoot":"","sources":["../../../src/services/public/ListService.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ListService.js","sourceRoot":"","sources":["../../../src/services/public/ListService.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAC1D,mDAAqD;AAQrD,qDAAkD;AAElD,MAAa,WAAY,SAAQ,+BAAc;IAC9C;;;;OAIG;IACH,YAAmB,MAAqB;QACvC,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACI,KAAK,CAAC,OAAO,CAAC,EAAU,EAAE,KAAc,EAAE,MAAe;QAC/D,MAAM,QAAQ,GAAkB,wBAAa,CAAC,YAAY,CAAC;QAE3D,mCAAmC;QACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAuB,QAAQ,EAAE;YACnE,EAAE,EAAE,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,yBAAyB;QACzB,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACI,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,KAAc,EAAE,MAAe;QAC9D,MAAM,QAAQ,GAAG,wBAAa,CAAC,WAAW,CAAC;QAE3C,2BAA2B;QAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAsB,QAAQ,EAAE;YAClE,EAAE,EAAE,EAAE;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,yBAAyB;QACzB,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE5C,oDAAoD;QACpD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAE5F,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AApGD,kCAoGC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ESearchResultType, INewTweet, TweetFilter } from 'rettiwt-core';
|
|
2
1
|
import { CursoredData } from '../../models/data/CursoredData';
|
|
3
2
|
import { Tweet } from '../../models/data/Tweet';
|
|
4
3
|
import { User } from '../../models/data/User';
|
|
5
|
-
import {
|
|
4
|
+
import { RettiwtConfig } from '../../models/RettiwtConfig';
|
|
5
|
+
import { ITweetFilter } from '../../types/args/FetchArgs';
|
|
6
|
+
import { INewTweet } from '../../types/args/PostArgs';
|
|
6
7
|
import { FetcherService } from './FetcherService';
|
|
7
8
|
/**
|
|
8
9
|
* Handles interacting with resources related to tweets.
|
|
@@ -15,11 +16,11 @@ export declare class TweetService extends FetcherService {
|
|
|
15
16
|
*
|
|
16
17
|
* @internal
|
|
17
18
|
*/
|
|
18
|
-
constructor(config
|
|
19
|
+
constructor(config: RettiwtConfig);
|
|
19
20
|
/**
|
|
20
21
|
* Get the details of a tweet.
|
|
21
22
|
*
|
|
22
|
-
* @param id - The id of the target tweet.
|
|
23
|
+
* @param id - The id(s) of the target tweet/tweets.
|
|
23
24
|
*
|
|
24
25
|
* @returns
|
|
25
26
|
* The details of the tweet with the given id.
|
|
@@ -42,7 +43,7 @@ export declare class TweetService extends FetcherService {
|
|
|
42
43
|
* });
|
|
43
44
|
* ```
|
|
44
45
|
*/
|
|
45
|
-
details(id:
|
|
46
|
+
details<T extends string | string[]>(id: T): Promise<T extends string ? Tweet | undefined : Tweet[]>;
|
|
46
47
|
/**
|
|
47
48
|
* Like a tweet.
|
|
48
49
|
*
|
|
@@ -68,6 +69,33 @@ export declare class TweetService extends FetcherService {
|
|
|
68
69
|
* ```
|
|
69
70
|
*/
|
|
70
71
|
like(id: string): Promise<boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* Get the list of users who liked a tweet. Only works for your own tweets.
|
|
74
|
+
*
|
|
75
|
+
* @param id - The id of the target tweet.
|
|
76
|
+
* @param count - The number of likers to fetch, must be \<= 100.
|
|
77
|
+
* @param cursor - The cursor to the batch of likers to fetch.
|
|
78
|
+
*
|
|
79
|
+
* @returns The list of users who liked the given tweet.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```
|
|
83
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
84
|
+
*
|
|
85
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
86
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
87
|
+
*
|
|
88
|
+
* // Fetching the most recent 100 likers of the Tweet with id '1234567890'
|
|
89
|
+
* rettiwt.tweet.likers('1234567890')
|
|
90
|
+
* .then(res => {
|
|
91
|
+
* console.log(res);
|
|
92
|
+
* })
|
|
93
|
+
* .catch(err => {
|
|
94
|
+
* console.log(err);
|
|
95
|
+
* });
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
likers(id: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
|
|
71
99
|
/**
|
|
72
100
|
* Get the list of tweets from a tweet list.
|
|
73
101
|
*
|
|
@@ -313,7 +341,7 @@ export declare class TweetService extends FetcherService {
|
|
|
313
341
|
*
|
|
314
342
|
* @remarks For details about available filters, refer to {@link TweetFilter}
|
|
315
343
|
*/
|
|
316
|
-
search(filter:
|
|
344
|
+
search(filter: ITweetFilter, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
317
345
|
/**
|
|
318
346
|
* Stream tweets in pseudo real-time using a filter.
|
|
319
347
|
*
|
|
@@ -346,7 +374,7 @@ export declare class TweetService extends FetcherService {
|
|
|
346
374
|
* streamTweets();
|
|
347
375
|
* ```
|
|
348
376
|
*/
|
|
349
|
-
stream(filter:
|
|
377
|
+
stream(filter: ITweetFilter, pollingInterval?: number): AsyncGenerator<Tweet>;
|
|
350
378
|
/**
|
|
351
379
|
* Unlike a tweet.
|
|
352
380
|
*
|
|
@@ -22,7 +22,7 @@ class TweetService extends FetcherService_1.FetcherService {
|
|
|
22
22
|
/**
|
|
23
23
|
* Get the details of a tweet.
|
|
24
24
|
*
|
|
25
|
-
* @param id - The id of the target tweet.
|
|
25
|
+
* @param id - The id(s) of the target tweet/tweets.
|
|
26
26
|
*
|
|
27
27
|
* @returns
|
|
28
28
|
* The details of the tweet with the given id.
|
|
@@ -47,8 +47,8 @@ class TweetService extends FetcherService_1.FetcherService {
|
|
|
47
47
|
*/
|
|
48
48
|
async details(id) {
|
|
49
49
|
let resource;
|
|
50
|
-
// If user is authenticated
|
|
51
|
-
if (this.userId != undefined) {
|
|
50
|
+
// If user is authenticated and details of single tweet required
|
|
51
|
+
if (this.config.userId != undefined && typeof id == 'string') {
|
|
52
52
|
resource = Resource_1.EResourceType.TWEET_DETAILS_ALT;
|
|
53
53
|
// Fetching raw tweet details
|
|
54
54
|
const response = await this.request(resource, { id: id });
|
|
@@ -56,13 +56,22 @@ class TweetService extends FetcherService_1.FetcherService {
|
|
|
56
56
|
const data = Extractors_1.extractors[resource](response, id);
|
|
57
57
|
return data;
|
|
58
58
|
}
|
|
59
|
+
// If user is authenticated and details of multiple tweets required
|
|
60
|
+
else if (this.config.userId != undefined && Array.isArray(id)) {
|
|
61
|
+
resource = Resource_1.EResourceType.TWEET_DETAILS_BULK;
|
|
62
|
+
// Fetching raw tweet details
|
|
63
|
+
const response = await this.request(resource, { ids: id });
|
|
64
|
+
// Deserializing response
|
|
65
|
+
const data = Extractors_1.extractors[resource](response, id);
|
|
66
|
+
return data;
|
|
67
|
+
}
|
|
59
68
|
// If user is not authenticated
|
|
60
69
|
else {
|
|
61
70
|
resource = Resource_1.EResourceType.TWEET_DETAILS;
|
|
62
71
|
// Fetching raw tweet details
|
|
63
|
-
const response = await this.request(resource, { id: id });
|
|
72
|
+
const response = await this.request(resource, { id: String(id) });
|
|
64
73
|
// Deserializing response
|
|
65
|
-
const data = Extractors_1.extractors[resource](response, id);
|
|
74
|
+
const data = Extractors_1.extractors[resource](response, String(id));
|
|
66
75
|
return data;
|
|
67
76
|
}
|
|
68
77
|
}
|
|
@@ -100,6 +109,44 @@ class TweetService extends FetcherService_1.FetcherService {
|
|
|
100
109
|
const data = Extractors_1.extractors[resource](response) ?? false;
|
|
101
110
|
return data;
|
|
102
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Get the list of users who liked a tweet. Only works for your own tweets.
|
|
114
|
+
*
|
|
115
|
+
* @param id - The id of the target tweet.
|
|
116
|
+
* @param count - The number of likers to fetch, must be \<= 100.
|
|
117
|
+
* @param cursor - The cursor to the batch of likers to fetch.
|
|
118
|
+
*
|
|
119
|
+
* @returns The list of users who liked the given tweet.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```
|
|
123
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
124
|
+
*
|
|
125
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
126
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
127
|
+
*
|
|
128
|
+
* // Fetching the most recent 100 likers of the Tweet with id '1234567890'
|
|
129
|
+
* rettiwt.tweet.likers('1234567890')
|
|
130
|
+
* .then(res => {
|
|
131
|
+
* console.log(res);
|
|
132
|
+
* })
|
|
133
|
+
* .catch(err => {
|
|
134
|
+
* console.log(err);
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
async likers(id, count, cursor) {
|
|
139
|
+
const resource = Resource_1.EResourceType.TWEET_LIKERS;
|
|
140
|
+
// Fetching raw likers
|
|
141
|
+
const response = await this.request(resource, {
|
|
142
|
+
id: id,
|
|
143
|
+
count: count,
|
|
144
|
+
cursor: cursor,
|
|
145
|
+
});
|
|
146
|
+
// Deserializing response
|
|
147
|
+
const data = Extractors_1.extractors[resource](response);
|
|
148
|
+
return data;
|
|
149
|
+
}
|
|
103
150
|
/**
|
|
104
151
|
* Get the list of tweets from a tweet list.
|
|
105
152
|
*
|
|
@@ -400,14 +447,13 @@ class TweetService extends FetcherService_1.FetcherService {
|
|
|
400
447
|
*
|
|
401
448
|
* @remarks For details about available filters, refer to {@link TweetFilter}
|
|
402
449
|
*/
|
|
403
|
-
async search(filter, count, cursor
|
|
450
|
+
async search(filter, count, cursor) {
|
|
404
451
|
const resource = Resource_1.EResourceType.TWEET_SEARCH;
|
|
405
452
|
// Fetching raw list of filtered tweets
|
|
406
453
|
const response = await this.request(resource, {
|
|
407
454
|
filter: filter,
|
|
408
455
|
count: count,
|
|
409
456
|
cursor: cursor,
|
|
410
|
-
results: results,
|
|
411
457
|
});
|
|
412
458
|
// Deserializing response
|
|
413
459
|
const data = Extractors_1.extractors[resource](response);
|
|
@@ -467,7 +513,7 @@ class TweetService extends FetcherService_1.FetcherService {
|
|
|
467
513
|
}
|
|
468
514
|
// If there are more tweets to fetch, adjust the cursor value
|
|
469
515
|
if (tweets.list.length > 0 && tweets.next) {
|
|
470
|
-
cursor = tweets.next
|
|
516
|
+
cursor = tweets.next;
|
|
471
517
|
}
|
|
472
518
|
// Else, start the next iteration from this batch's most recent tweet
|
|
473
519
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TweetService.js","sourceRoot":"","sources":["../../../src/services/public/TweetService.ts"],"names":[],"mappings":";;;AAAA,2BAA8B;
|
|
1
|
+
{"version":3,"file":"TweetService.js","sourceRoot":"","sources":["../../../src/services/public/TweetService.ts"],"names":[],"mappings":";;;AAAA,2BAA8B;AAE9B,6DAA0D;AAC1D,mDAAqD;AAyBrD,qDAAk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,KAAK,CAAC,MAAM,CAAC,KAA2B;QAC9C,aAAa;QACb,MAAM,IAAI,GAAG,OAAO,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAA,aAAQ,EAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC;QAChF,MAAM,EAAE,GAAW,CAClB,MAAM,IAAI,CAAC,OAAO,CAAiC,wBAAa,CAAC,uBAAuB,EAAE;YACzF,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;SACtB,CAAC,CACF,CAAC,eAAe,CAAC;QAElB,SAAS;QACT,MAAM,IAAI,CAAC,OAAO,CAAU,wBAAa,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAErG,WAAW;QACX,MAAM,IAAI,CAAC,OAAO,CAAU,wBAAa,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzF,OAAO,EAAE,CAAC;IACX,CAAC;CACD;AAvvBD,oCAuvBC"}
|
|
@@ -2,7 +2,7 @@ import { CursoredData } from '../../models/data/CursoredData';
|
|
|
2
2
|
import { Notification } from '../../models/data/Notification';
|
|
3
3
|
import { Tweet } from '../../models/data/Tweet';
|
|
4
4
|
import { User } from '../../models/data/User';
|
|
5
|
-
import {
|
|
5
|
+
import { RettiwtConfig } from '../../models/RettiwtConfig';
|
|
6
6
|
import { FetcherService } from './FetcherService';
|
|
7
7
|
/**
|
|
8
8
|
* Handles interacting with resources related to user account
|
|
@@ -15,7 +15,7 @@ export declare class UserService extends FetcherService {
|
|
|
15
15
|
*
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
|
-
constructor(config
|
|
18
|
+
constructor(config: RettiwtConfig);
|
|
19
19
|
/**
|
|
20
20
|
* Get the list of bookmarks of the logged in user.
|
|
21
21
|
*
|
|
@@ -45,7 +45,7 @@ export declare class UserService extends FetcherService {
|
|
|
45
45
|
/**
|
|
46
46
|
* Get the details of a user.
|
|
47
47
|
*
|
|
48
|
-
* @param id - The username/id of the target user.
|
|
48
|
+
* @param id - The username/id(s) of the target user/users.
|
|
49
49
|
*
|
|
50
50
|
* @returns
|
|
51
51
|
* The details of the given user.
|
|
@@ -87,7 +87,7 @@ export declare class UserService extends FetcherService {
|
|
|
87
87
|
* });
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
|
-
details(id:
|
|
90
|
+
details<T extends string | string[]>(id: T): Promise<T extends string ? User | undefined : User[]>;
|
|
91
91
|
/**
|
|
92
92
|
* Follow a user.
|
|
93
93
|
*
|
|
@@ -57,7 +57,7 @@ class UserService extends FetcherService_1.FetcherService {
|
|
|
57
57
|
/**
|
|
58
58
|
* Get the details of a user.
|
|
59
59
|
*
|
|
60
|
-
* @param id - The username/id of the target user.
|
|
60
|
+
* @param id - The username/id(s) of the target user/users.
|
|
61
61
|
*
|
|
62
62
|
* @returns
|
|
63
63
|
* The details of the given user.
|
|
@@ -101,19 +101,31 @@ class UserService extends FetcherService_1.FetcherService {
|
|
|
101
101
|
*/
|
|
102
102
|
async details(id) {
|
|
103
103
|
let resource;
|
|
104
|
-
// If
|
|
105
|
-
if (
|
|
106
|
-
resource = Resource_1.EResourceType.
|
|
104
|
+
// If details of multiple users required
|
|
105
|
+
if (Array.isArray(id)) {
|
|
106
|
+
resource = Resource_1.EResourceType.USER_DETAILS_BY_IDS_BULK;
|
|
107
|
+
// Fetching raw details
|
|
108
|
+
const response = await this.request(resource, { ids: id });
|
|
109
|
+
// Deserializing response
|
|
110
|
+
const data = Extractors_1.extractors[resource](response, id);
|
|
111
|
+
return data;
|
|
107
112
|
}
|
|
108
|
-
// If
|
|
113
|
+
// If details of single user required
|
|
109
114
|
else {
|
|
110
|
-
|
|
115
|
+
// If username is given
|
|
116
|
+
if (isNaN(Number(id))) {
|
|
117
|
+
resource = Resource_1.EResourceType.USER_DETAILS_BY_USERNAME;
|
|
118
|
+
}
|
|
119
|
+
// If id is given
|
|
120
|
+
else {
|
|
121
|
+
resource = Resource_1.EResourceType.USER_DETAILS_BY_ID;
|
|
122
|
+
}
|
|
123
|
+
// Fetching raw details
|
|
124
|
+
const response = await this.request(resource, { id: id });
|
|
125
|
+
// Deserializing response
|
|
126
|
+
const data = Extractors_1.extractors[resource](response);
|
|
127
|
+
return data;
|
|
111
128
|
}
|
|
112
|
-
// Fetching raw details
|
|
113
|
-
const response = await this.request(resource, { id: id });
|
|
114
|
-
// Deserializing response
|
|
115
|
-
const data = Extractors_1.extractors[resource](response);
|
|
116
|
-
return data;
|
|
117
129
|
}
|
|
118
130
|
/**
|
|
119
131
|
* Follow a user.
|
|
@@ -328,7 +340,7 @@ class UserService extends FetcherService_1.FetcherService {
|
|
|
328
340
|
const resource = Resource_1.EResourceType.USER_LIKES;
|
|
329
341
|
// Fetching raw list of likes
|
|
330
342
|
const response = await this.request(resource, {
|
|
331
|
-
id: this.userId,
|
|
343
|
+
id: this.config.userId,
|
|
332
344
|
count: count,
|
|
333
345
|
cursor: cursor,
|
|
334
346
|
});
|
|
@@ -434,7 +446,7 @@ class UserService extends FetcherService_1.FetcherService {
|
|
|
434
446
|
else {
|
|
435
447
|
first = false;
|
|
436
448
|
}
|
|
437
|
-
cursor = notifications.next
|
|
449
|
+
cursor = notifications.next;
|
|
438
450
|
}
|
|
439
451
|
}
|
|
440
452
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/public/UserService.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/public/UserService.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAC1D,mDAAqD;AAsBrD,qDAAkD;AAElD;;;;GAIG;AACH,MAAa,WAAY,SAAQ,+BAAc;IAC9C;;;;OAIG;IACH,YAAmB,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,yBAAyB;QACzB,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,KAAK,CAAC,QAAQ,CAAC,EAAU;QAC/B,MAAM,QAAQ,GAAG,wBAAa,CAAC,aAAa,CAAC;QAE7C,uBAAuB;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAwB,wBAAa,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEpG,6BAA6B;QAC7B,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;QAErD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA3rBD,kCA2rBC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ITidProvider } from './auth/TidProvider';
|
|
1
2
|
import { IErrorHandler } from './ErrorHandler';
|
|
2
3
|
/**
|
|
3
4
|
* The configuration for initializing a new Rettiwt instance.
|
|
@@ -7,28 +8,20 @@ import { IErrorHandler } from './ErrorHandler';
|
|
|
7
8
|
export interface IRettiwtConfig {
|
|
8
9
|
/** The apiKey (cookie) to use for authenticating Rettiwt against Twitter API. */
|
|
9
10
|
apiKey?: string;
|
|
10
|
-
/** The guestKey (guest token) to use for guest access to Twitter API. */
|
|
11
|
-
guestKey?: string;
|
|
12
11
|
/**
|
|
13
12
|
* Optional URL to proxy server to use for requests to Twitter API.
|
|
14
13
|
*
|
|
15
14
|
* @remarks When deploying to cloud platforms, if setting {@link IRettiwtConfig.authProxyUrl} does not resolve Error 429, then this might be required.
|
|
16
15
|
*/
|
|
17
16
|
proxyUrl?: URL;
|
|
18
|
-
/**
|
|
19
|
-
* Optional URL to proxy server to use for authentication against Twitter API.
|
|
20
|
-
*
|
|
21
|
-
* @remarks Required when deploying to cloud platforms to bypass Error 429.
|
|
22
|
-
*
|
|
23
|
-
* @defaultValue Same as {@link IRettiwtConfig.proxyUrl}
|
|
24
|
-
*/
|
|
25
|
-
authProxyUrl?: URL;
|
|
26
17
|
/** The max wait time (in milli-seconds) for a response; if not set, Twitter server timeout is used. */
|
|
27
18
|
timeout?: number;
|
|
28
19
|
/** Whether to write logs to console or not. */
|
|
29
20
|
logging?: boolean;
|
|
30
21
|
/** Optional custom error handler to define error conditions and process API/HTTP errors in responses. */
|
|
31
22
|
errorHandler?: IErrorHandler;
|
|
23
|
+
/** Optional custom `x-client-transaction-id` header provider. */
|
|
24
|
+
tidProvider?: ITidProvider;
|
|
32
25
|
/**
|
|
33
26
|
* Optional custom HTTP headers to add to all requests to Twitter API.
|
|
34
27
|
*
|
|
@@ -37,4 +30,10 @@ export interface IRettiwtConfig {
|
|
|
37
30
|
headers?: {
|
|
38
31
|
[key: string]: string;
|
|
39
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* The delay (in ms) to use between concurrent request.
|
|
35
|
+
*
|
|
36
|
+
* Can either be a number or a function that returns a number synchronously or asynchronously.
|
|
37
|
+
*/
|
|
38
|
+
delay?: number | (() => number | Promise<number>);
|
|
40
39
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ESearchResultType, ITweetFilter } from 'rettiwt-core';
|
|
2
1
|
/**
|
|
3
2
|
* Options specifying the data that is to be fetched.
|
|
4
3
|
*
|
|
@@ -46,14 +45,79 @@ export interface IFetchArgs {
|
|
|
46
45
|
*/
|
|
47
46
|
id?: string;
|
|
48
47
|
/**
|
|
49
|
-
* The
|
|
50
|
-
* - {@link EResourceType.LATEST}, for latest search results.
|
|
51
|
-
* - {@link EResourceType.TOP}, for top search results.
|
|
48
|
+
* The IDs of the target resources.
|
|
52
49
|
*
|
|
53
|
-
* @
|
|
50
|
+
* @remarks
|
|
51
|
+
* - Required only for {@link EResourceType.TWEET_DETAILS_BULK} and {@link EResourceType.USER_DETAILS_BY_IDS_BULK}.
|
|
52
|
+
*/
|
|
53
|
+
ids?: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The filter to be used for searching tweets.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export interface ITweetFilter {
|
|
61
|
+
/** The date upto which tweets are to be searched. */
|
|
62
|
+
endDate?: Date;
|
|
63
|
+
/** The list of words to exclude from search. */
|
|
64
|
+
excludeWords?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* The list of usernames whose tweets are to be searched.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* '\@' must be excluded from the username!
|
|
70
|
+
*/
|
|
71
|
+
fromUsers?: string[];
|
|
72
|
+
/**
|
|
73
|
+
* The list of hashtags to search.
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* '#' must be excluded from the hashtag!
|
|
77
|
+
*/
|
|
78
|
+
hashtags?: string[];
|
|
79
|
+
/** The exact phrase to search. */
|
|
80
|
+
includePhrase?: string;
|
|
81
|
+
/** The list of words to search. */
|
|
82
|
+
includeWords?: string[];
|
|
83
|
+
/** The language of the tweets to search. */
|
|
84
|
+
language?: string;
|
|
85
|
+
/** Whether to fetch tweets that are links or not. */
|
|
86
|
+
links?: boolean;
|
|
87
|
+
/** The list from which tweets are to be searched. */
|
|
88
|
+
list?: string;
|
|
89
|
+
/** The id of the tweet, before which the tweets are to be searched. */
|
|
90
|
+
maxId?: string;
|
|
91
|
+
/**
|
|
92
|
+
* The list of username mentioned in the tweets to search.
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* '\@' must be excluded from the username!
|
|
96
|
+
*/
|
|
97
|
+
mentions?: string[];
|
|
98
|
+
/** The minimun number of likes to search by. */
|
|
99
|
+
minLikes?: number;
|
|
100
|
+
/** The minimum number of replies to search by. */
|
|
101
|
+
minReplies?: number;
|
|
102
|
+
/** The minimum number of retweets to search by. */
|
|
103
|
+
minRetweets?: number;
|
|
104
|
+
/** The optional words to search. */
|
|
105
|
+
optionalWords?: string[];
|
|
106
|
+
/** The id of the tweet which is quoted in the tweets to search. */
|
|
107
|
+
quoted?: string;
|
|
108
|
+
/** Whether to fetch tweets that are replies or not. */
|
|
109
|
+
replies?: boolean;
|
|
110
|
+
/** The id of the tweet, after which the tweets are to be searched. */
|
|
111
|
+
sinceId?: string;
|
|
112
|
+
/** The date starting from which tweets are to be searched. */
|
|
113
|
+
startDate?: Date;
|
|
114
|
+
/**
|
|
115
|
+
* The list of username to whom the tweets to be searched, are adressed.
|
|
54
116
|
*
|
|
55
117
|
* @remarks
|
|
56
|
-
*
|
|
118
|
+
* '\@' must be excluded from the username!
|
|
57
119
|
*/
|
|
58
|
-
|
|
120
|
+
toUsers?: string[];
|
|
121
|
+
/** Whether to fetch top tweets or not. */
|
|
122
|
+
top?: boolean;
|
|
59
123
|
}
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import { INewTweet } from 'rettiwt-core';
|
|
2
|
-
/**
|
|
3
|
-
* Options specifying the media file to be uploaded.
|
|
4
|
-
*
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface IUploadArgs {
|
|
8
|
-
/** The id allocated to the media file to be uploaded. */
|
|
9
|
-
id?: string;
|
|
10
|
-
/** The media file to be uploaded. */
|
|
11
|
-
media?: string | ArrayBuffer;
|
|
12
|
-
/**
|
|
13
|
-
* The size (in bytes) of the media file to be uploaded.
|
|
14
|
-
*
|
|
15
|
-
* @remarks The size must be \<= 5242880 bytes.
|
|
16
|
-
*/
|
|
17
|
-
size?: number;
|
|
18
|
-
}
|
|
19
1
|
/**
|
|
20
2
|
* Options specifying the data that is to be posted.
|
|
21
3
|
*
|
|
@@ -54,3 +36,65 @@ export interface IPostArgs {
|
|
|
54
36
|
*/
|
|
55
37
|
upload?: IUploadArgs;
|
|
56
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Configuration for the new tweet to be posted.
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export interface INewTweet {
|
|
45
|
+
/**
|
|
46
|
+
* The list of media to be uploaded.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* - The media first needs to be uploaded.
|
|
50
|
+
* - After uploading, the returned id(s) can be used to reference the media here.
|
|
51
|
+
* - Maximum number of media items that can be posted is 4.
|
|
52
|
+
*/
|
|
53
|
+
media?: INewTweetMedia[];
|
|
54
|
+
/** The id of the tweet to quote. */
|
|
55
|
+
quote?: string;
|
|
56
|
+
/** The id of the Tweet to which the given Tweet must be a reply. */
|
|
57
|
+
replyTo?: string;
|
|
58
|
+
/** The date/time at which the tweet is to be scheduled for posting. */
|
|
59
|
+
scheduleFor?: Date;
|
|
60
|
+
/**
|
|
61
|
+
* The text for the tweet to be created.
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* Length of the tweet must be \<= 280 characters.
|
|
65
|
+
*/
|
|
66
|
+
text?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Configuration for the media to be uploaded.
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export interface INewTweetMedia {
|
|
74
|
+
/** The id of the media to upload. */
|
|
75
|
+
id: string;
|
|
76
|
+
/**
|
|
77
|
+
* The list of id of the users to tag in the media.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* Maximum number of users that can be tagged is 10.
|
|
81
|
+
*/
|
|
82
|
+
tags?: string[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Options specifying the media file to be uploaded.
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export interface IUploadArgs {
|
|
90
|
+
/** The id allocated to the media file to be uploaded. */
|
|
91
|
+
id?: string;
|
|
92
|
+
/** The media file to be uploaded. */
|
|
93
|
+
media?: string | ArrayBuffer;
|
|
94
|
+
/**
|
|
95
|
+
* The size (in bytes) of the media file to be uploaded.
|
|
96
|
+
*
|
|
97
|
+
* @remarks The size must be \<= 5242880 bytes.
|
|
98
|
+
*/
|
|
99
|
+
size?: number;
|
|
100
|
+
}
|
|
@@ -6,6 +6,8 @@ import { EAuthenticationType } from '../../enums/Authentication';
|
|
|
6
6
|
* - authToken, guestToken =\> Guest authentication.
|
|
7
7
|
* - authToken, csrfToken, cookie =\> User authentication.
|
|
8
8
|
* - authToken, guestToken, cookie =\> Guest authentication while logging in.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
9
11
|
*/
|
|
10
12
|
export interface IAuthCredential {
|
|
11
13
|
/** The bearer token from twitter.com. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TidDynamicArgs.js","sourceRoot":"","sources":["../../../src/types/auth/TidDynamicArgs.ts"],"names":[],"mappings":""}
|