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
|
@@ -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,MAAqB;QACvC,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACI,KAAK,CAAC,SAAS,CAAC,KAAc,EAAE,MAAe;QACrD,MAAM,QAAQ,GAAG,wBAAa,CAAC,cAAc,CAAC;QAE9C,6BAA6B;QAC7B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAyB,QAAQ,EAAE;YACrE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACI,KAAK,CAAC,OAAO,CAA8B,EAAK;QACt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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,26 +8,32 @@ 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;
|
|
25
|
+
/**
|
|
26
|
+
* Optional custom HTTP headers to add to all requests to Twitter API.
|
|
27
|
+
*
|
|
28
|
+
* @remarks Custom headers can be useful for proxies, avoiding rate limits, etc.
|
|
29
|
+
*/
|
|
30
|
+
headers?: {
|
|
31
|
+
[key: string]: string;
|
|
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>);
|
|
32
39
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options specifying the data that is to be fetched.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IFetchArgs {
|
|
7
|
+
/**
|
|
8
|
+
* The number of data items to fetch.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* - Works only for cursored resources.
|
|
12
|
+
* - Does not work for {@link EResourceType.TWEET_REPLIES}.
|
|
13
|
+
* - Must be \<= 20 for:
|
|
14
|
+
* - {@link EResourceType.USER_TIMELINE}
|
|
15
|
+
* - {@link EResourceType.USER_TIMELINE}
|
|
16
|
+
* - {@link EResourceType.USER_TIMELINE_AND_REPLIES}
|
|
17
|
+
* - Must be \<= 100 for all other cursored resources.
|
|
18
|
+
* - Due a bug on Twitter's end, count does not work for {@link EResourceType.USER_FOLLOWERS} and {@link EResourceType.USER_FOLLOWING}.
|
|
19
|
+
* - Has not effect for:
|
|
20
|
+
* - {@link EResourceType.USER_FEED_FOLLOWED}
|
|
21
|
+
* - {@link EResourceType.USER_FEED_RECOMMENDED}
|
|
22
|
+
*/
|
|
23
|
+
count?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The cursor to the batch of data to fetch.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* - May be used for cursored resources.
|
|
29
|
+
* - Has no effect for other resources.
|
|
30
|
+
*/
|
|
31
|
+
cursor?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The filter for searching tweets.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Required when searching for tweets using {@link EResourceType.TWEET_SEARCH}.
|
|
37
|
+
*/
|
|
38
|
+
filter?: ITweetFilter;
|
|
39
|
+
/**
|
|
40
|
+
* The id of the target resource.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* - Required for all resources except {@link EResourceType.TWEET_SEARCH} and {@link EResourceType.USER_TIMELINE_RECOMMENDED}.
|
|
44
|
+
* - For {@link EResourceType.USER_DETAILS_BY_USERNAME}, can be alphanumeric, while for others, is strictly numeric.
|
|
45
|
+
*/
|
|
46
|
+
id?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The IDs of the target resources.
|
|
49
|
+
*
|
|
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.
|
|
116
|
+
*
|
|
117
|
+
* @remarks
|
|
118
|
+
* '\@' must be excluded from the username!
|
|
119
|
+
*/
|
|
120
|
+
toUsers?: string[];
|
|
121
|
+
/** Whether to fetch top tweets or not. */
|
|
122
|
+
top?: boolean;
|
|
123
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FetchArgs.js","sourceRoot":"","sources":["../../../src/types/args/FetchArgs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options specifying the data that is to be posted.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IPostArgs {
|
|
7
|
+
/**
|
|
8
|
+
* The id of the target resource.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Required only when posting using the following resources:
|
|
12
|
+
* - {@link EResourceType.TWEET_LIKE}
|
|
13
|
+
* - {@link EResourceType.TWEET_RETWEET}
|
|
14
|
+
* - {@link EResourceType.TWEET_UNLIKE}
|
|
15
|
+
* - {@link EResourceType.TWEET_UNPOST}
|
|
16
|
+
* - {@link EResourceType.TWEET_UNRETWEET}
|
|
17
|
+
* - {@link EResourceType.USER_FOLLOW}
|
|
18
|
+
* - {@link EResourceType.USER_UNFOLLOW}
|
|
19
|
+
*/
|
|
20
|
+
id?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The tweet that is to be posted.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* Required only when posting a tweet using {@link EResourceType.TWEET_POST}
|
|
26
|
+
*/
|
|
27
|
+
tweet?: INewTweet;
|
|
28
|
+
/**
|
|
29
|
+
* The media file to be uploaded.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Required only when uploading a media using the following resources:
|
|
33
|
+
* - {@link EResourceType.MEDIA_UPLOAD_APPEND}
|
|
34
|
+
* - {@link EResourceType.MEDIA_UPLOAD_FINALIZE}
|
|
35
|
+
* - {@link EResourceType.MEDIA_UPLOAD_INITIALIZE}
|
|
36
|
+
*/
|
|
37
|
+
upload?: IUploadArgs;
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostArgs.js","sourceRoot":"","sources":["../../../src/types/args/PostArgs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IAuthCookie {
|
|
7
|
+
/** The bearer token from twitter.com. */
|
|
8
|
+
auth_token: string;
|
|
9
|
+
/** The CSRF token for the session. */
|
|
10
|
+
ct0: string;
|
|
11
|
+
/** Token used to authenticate a device. */
|
|
12
|
+
kdt: string;
|
|
13
|
+
/** Token used to authenticate a user using a Twitter ID. */
|
|
14
|
+
twid: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCookie.js","sourceRoot":"","sources":["../../../src/types/auth/AuthCookie.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EAuthenticationType } from '../../enums/Authentication';
|
|
2
|
+
/**
|
|
3
|
+
* The credentials for authenticating against Twitter.
|
|
4
|
+
*
|
|
5
|
+
* Depending on which tokens are present, the authentication type is determined as follows:
|
|
6
|
+
* - authToken, guestToken =\> Guest authentication.
|
|
7
|
+
* - authToken, csrfToken, cookie =\> User authentication.
|
|
8
|
+
* - authToken, guestToken, cookie =\> Guest authentication while logging in.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface IAuthCredential {
|
|
13
|
+
/** The bearer token from twitter.com. */
|
|
14
|
+
authToken?: string;
|
|
15
|
+
/** The type of authentication. */
|
|
16
|
+
authenticationType?: EAuthenticationType;
|
|
17
|
+
/** The cookie of the twitter account, which is used to authenticate against twitter. */
|
|
18
|
+
cookies?: string;
|
|
19
|
+
/** The CSRF token for the session. */
|
|
20
|
+
csrfToken?: string;
|
|
21
|
+
/** The guest token provided by Twitter API. */
|
|
22
|
+
guestToken?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCredential.js","sourceRoot":"","sources":["../../../src/types/auth/AuthCredential.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TidDynamicArgs.js","sourceRoot":"","sources":["../../../src/types/auth/TidDynamicArgs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TidHeader.js","sourceRoot":"","sources":["../../../src/types/auth/TidHeader.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parameters for generating the transaction ID.
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface ITidParams {
|
|
7
|
+
/** Secret used for transaction ID calculation. */
|
|
8
|
+
keyword: string;
|
|
9
|
+
/** Request method. */
|
|
10
|
+
method: string;
|
|
11
|
+
/** Endpoint path without query parameters. */
|
|
12
|
+
path: string;
|
|
13
|
+
/** Twitter verification key received from HTML. */
|
|
14
|
+
verificationKey: string;
|
|
15
|
+
/** Animation frames extracted from HTML. */
|
|
16
|
+
frames: number[][][];
|
|
17
|
+
/** Indices used for getting the correct verification key bytes during animation key calculation. */
|
|
18
|
+
indices: number[];
|
|
19
|
+
/** Final byte of the transaction ID. */
|
|
20
|
+
extraByte: number;
|
|
21
|
+
/** Current time */
|
|
22
|
+
time?: number;
|
|
23
|
+
/** XOR byte used for final hash calculation, must be in 0-255 range. */
|
|
24
|
+
xorByte?: number;
|
|
25
|
+
/** Precomputed animation key. */
|
|
26
|
+
animationKey?: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TidParams.js","sourceRoot":"","sources":["../../../src/types/auth/TidParams.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service responsible for generating the `x-client-transaction-id` header.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface ITidProvider {
|
|
7
|
+
/**
|
|
8
|
+
* Generates new `x-client-transaction-id` header.
|
|
9
|
+
*
|
|
10
|
+
* @param method - Request method.
|
|
11
|
+
* @param path - Endpoint path without query parameters.
|
|
12
|
+
*/
|
|
13
|
+
generate(method: string, path: string): Promise<string | undefined>;
|
|
14
|
+
/**
|
|
15
|
+
* Refresh arguments obtained from parsing the HTML page, if any.
|
|
16
|
+
*/
|
|
17
|
+
refreshDynamicArgs(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TidProvider.js","sourceRoot":"","sources":["../../../src/types/auth/TidProvider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { INotification } from './Notification';
|
|
2
|
+
import { ITweet } from './Tweet';
|
|
3
|
+
import { IUser } from './User';
|
|
4
|
+
/**
|
|
5
|
+
* The data that is fetched batch-wise using a cursor.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam T - Type of data to be stored.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface ICursoredData<T extends INotification | ITweet | IUser> {
|
|
12
|
+
/** The batch of data of the given type. */
|
|
13
|
+
list: T[];
|
|
14
|
+
/** The cursor to the next batch of data. */
|
|
15
|
+
next: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../../src/types/data/CursoredData.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The details of a single Twitter List.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IList {
|
|
7
|
+
/** The date and time of creation of the list, int UTC string format. */
|
|
8
|
+
createdAt: string;
|
|
9
|
+
/** The rest id of the user who created the list. */
|
|
10
|
+
createdBy: string;
|
|
11
|
+
/** The list description. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** The rest id of the list. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** The number of memeber of the list. */
|
|
16
|
+
memberCount: number;
|
|
17
|
+
/** The name of the list. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** The number of subscribers of the list. */
|
|
20
|
+
subscriberCount: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/types/data/List.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ENotificationType } from '../../enums/Notification';
|
|
2
|
+
/**
|
|
3
|
+
* The details of a single notification.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface INotification {
|
|
8
|
+
/** The list of id of the users from whom the notification was received. */
|
|
9
|
+
from: string[];
|
|
10
|
+
/** The id of the notification. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** The text contents of the notification. */
|
|
13
|
+
message: string;
|
|
14
|
+
/** The date/time at which the notification was received. */
|
|
15
|
+
receivedAt: string;
|
|
16
|
+
/** The list of id of the target tweet(s) of the notification. */
|
|
17
|
+
target: string[];
|
|
18
|
+
/** The type of notification. */
|
|
19
|
+
type?: ENotificationType;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.js","sourceRoot":"","sources":["../../../src/types/data/Notification.ts"],"names":[],"mappings":""}
|