rettiwt-api 1.1.0 → 1.1.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.
Files changed (125) hide show
  1. package/.github/workflows/build-docs.yml +27 -0
  2. package/README.md +3 -1
  3. package/dist/Test.d.ts +0 -0
  4. package/dist/Test.js +2 -0
  5. package/dist/Test.js.map +1 -0
  6. package/dist/index.d.ts +16 -5
  7. package/dist/index.js +22 -8
  8. package/dist/index.js.map +1 -1
  9. package/dist/models/graphql/Global.d.ts +4 -0
  10. package/dist/models/graphql/Global.js +13 -0
  11. package/dist/models/graphql/Global.js.map +1 -0
  12. package/dist/models/graphql/TweetTypes.d.ts +6 -0
  13. package/dist/models/graphql/TweetTypes.js +156 -0
  14. package/dist/models/graphql/TweetTypes.js.map +1 -0
  15. package/dist/models/graphql/UserTypes.d.ts +3 -0
  16. package/dist/models/graphql/UserTypes.js +139 -0
  17. package/dist/models/graphql/UserTypes.js.map +1 -0
  18. package/dist/queries/RootQuery.d.ts +4 -0
  19. package/dist/queries/RootQuery.js +70 -0
  20. package/dist/queries/RootQuery.js.map +1 -0
  21. package/dist/resolvers/AccountResolver.d.ts +12 -0
  22. package/dist/resolvers/AccountResolver.js +84 -0
  23. package/dist/resolvers/AccountResolver.js.map +1 -0
  24. package/dist/resolvers/ResolverBase.d.ts +5 -0
  25. package/dist/resolvers/ResolverBase.js +11 -0
  26. package/dist/resolvers/ResolverBase.js.map +1 -0
  27. package/dist/resolvers/TweetResolver.d.ts +54 -0
  28. package/dist/resolvers/TweetResolver.js +332 -0
  29. package/dist/resolvers/TweetResolver.js.map +1 -0
  30. package/dist/resolvers/UserResolver.d.ts +38 -0
  31. package/dist/resolvers/UserResolver.js +253 -0
  32. package/dist/resolvers/UserResolver.js.map +1 -0
  33. package/dist/services/AuthService.d.ts +6 -2
  34. package/dist/services/AuthService.js +4 -3
  35. package/dist/services/AuthService.js.map +1 -1
  36. package/dist/services/CacheService.d.ts +12 -7
  37. package/dist/services/CacheService.js +12 -7
  38. package/dist/services/CacheService.js.map +1 -1
  39. package/dist/services/FetcherService.d.ts +32 -12
  40. package/dist/services/FetcherService.js +45 -14
  41. package/dist/services/FetcherService.js.map +1 -1
  42. package/dist/services/accounts/AccountService.d.ts +23 -6
  43. package/dist/services/accounts/AccountService.js +48 -9
  44. package/dist/services/accounts/AccountService.js.map +1 -1
  45. package/dist/services/data/TrendService.d.ts +17 -0
  46. package/dist/services/data/TrendService.js +116 -0
  47. package/dist/services/data/TrendService.js.map +1 -0
  48. package/dist/services/data/TweetService.d.ts +22 -15
  49. package/dist/services/data/TweetService.js +22 -15
  50. package/dist/services/data/TweetService.js.map +1 -1
  51. package/dist/services/data/UserAccountService.d.ts +42 -0
  52. package/dist/services/data/UserAccountService.js +239 -0
  53. package/dist/services/data/UserAccountService.js.map +1 -0
  54. package/dist/services/data/UserService.d.ts +21 -15
  55. package/dist/services/data/UserService.js +21 -15
  56. package/dist/services/data/UserService.js.map +1 -1
  57. package/dist/services/helper/Deserializers.d.ts +19 -0
  58. package/dist/services/helper/Deserializers.js +115 -0
  59. package/dist/services/helper/Deserializers.js.map +1 -0
  60. package/dist/services/helper/Extractors.d.ts +104 -0
  61. package/dist/services/helper/Extractors.js +432 -0
  62. package/dist/services/helper/Extractors.js.map +1 -0
  63. package/dist/services/helper/Urls.d.ts +85 -0
  64. package/dist/services/helper/Urls.js +130 -0
  65. package/dist/services/helper/Urls.js.map +1 -0
  66. package/dist/services/helper/extractors/Trends.d.ts +3 -0
  67. package/dist/services/helper/extractors/Trends.js +51 -0
  68. package/dist/services/helper/extractors/Trends.js.map +1 -0
  69. package/dist/services/helper/urls/Trends.d.ts +7 -0
  70. package/dist/services/helper/urls/Trends.js +13 -0
  71. package/dist/services/helper/urls/Trends.js.map +1 -0
  72. package/dist/types/Authentication.d.ts +27 -2
  73. package/dist/types/Authentication.js.map +1 -1
  74. package/dist/types/HTTP.d.ts +3 -1
  75. package/dist/types/HTTP.js +3 -1
  76. package/dist/types/HTTP.js.map +1 -1
  77. package/dist/types/Resolvers.d.ts +6 -1
  78. package/dist/types/Service.d.ts +30 -0
  79. package/dist/types/Service.js +19 -0
  80. package/dist/types/Service.js.map +1 -0
  81. package/dist/types/Trends.d.ts +50 -0
  82. package/dist/types/Trends.js +3 -0
  83. package/dist/types/Trends.js.map +1 -0
  84. package/dist/types/Tweet.d.ts +40 -0
  85. package/dist/types/Tweet.js +5 -0
  86. package/dist/types/Tweet.js.map +1 -0
  87. package/dist/types/UserAccount.d.ts +19 -0
  88. package/dist/types/UserAccount.js +4 -0
  89. package/dist/types/UserAccount.js.map +1 -0
  90. package/dist/types/data/Errors.d.ts +13 -4
  91. package/dist/types/data/Errors.js +12 -3
  92. package/dist/types/data/Errors.js.map +1 -1
  93. package/dist/types/data/Service.d.ts +19 -5
  94. package/dist/types/data/Service.js +6 -3
  95. package/dist/types/data/Service.js.map +1 -1
  96. package/dist/types/data/Tweet.d.ts +60 -3
  97. package/dist/types/data/Tweet.js +0 -1
  98. package/dist/types/data/Tweet.js.map +1 -1
  99. package/dist/types/data/User.d.ts +20 -1
  100. package/dist/types/data/User.js +0 -1
  101. package/dist/types/data/User.js.map +1 -1
  102. package/dist/types/graphql/Errors.d.ts +15 -0
  103. package/dist/types/graphql/Errors.js +23 -0
  104. package/dist/types/graphql/Errors.js.map +1 -0
  105. package/dist/types/raw/general/Trends.d.ts +324 -0
  106. package/dist/types/raw/general/Trends.js +3 -0
  107. package/dist/types/raw/general/Trends.js.map +1 -0
  108. package/dist/types/raw/user/Tweets.d.ts +2428 -0
  109. package/dist/types/raw/user/Tweets.js +3 -0
  110. package/dist/types/raw/user/Tweets.js.map +1 -0
  111. package/package.json +5 -4
  112. package/src/index.ts +19 -6
  113. package/src/services/AuthService.ts +13 -7
  114. package/src/services/CacheService.ts +12 -7
  115. package/src/services/FetcherService.ts +62 -21
  116. package/src/services/accounts/AccountService.ts +61 -12
  117. package/src/services/data/TweetService.ts +25 -18
  118. package/src/services/data/UserService.ts +21 -15
  119. package/src/types/Authentication.ts +27 -2
  120. package/src/types/HTTP.ts +4 -2
  121. package/src/types/Resolvers.ts +14 -6
  122. package/src/types/data/Errors.ts +13 -4
  123. package/src/types/data/Service.ts +28 -11
  124. package/src/types/data/Tweet.ts +109 -31
  125. package/src/types/data/User.ts +47 -17
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.trendsUrl = exports.AddTweet = exports.tweetRetweetUrl = exports.tweetLikesUrl = exports.tweetRepliesUrl = exports.tweetDetailsUrl = exports.tweetsUrl = exports.userTweetsUrl = exports.userLikesUrl = exports.userFollowersUrl = exports.userFollowingUrl = exports.userAccountByIdUrl = exports.userAccountUrl = exports.guestTokenUrl = void 0;
4
+ /**
5
+ * @returns The url for fetching a guest token
6
+ */
7
+ function guestTokenUrl() {
8
+ return "https://api.twitter.com/1.1/guest/activate.json";
9
+ }
10
+ exports.guestTokenUrl = guestTokenUrl;
11
+ /**
12
+ * @returns The url for fetching user account details.
13
+ * @param screenName The screen name of the target user
14
+ */
15
+ function userAccountUrl(screenName) {
16
+ return "https://api.twitter.com/graphql/hVhfo_TquFTmgL7gYwf91Q/UserByScreenName?variables=%7B%22screen_name%22%3A%22".concat(screenName, "%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%7D");
17
+ }
18
+ exports.userAccountUrl = userAccountUrl;
19
+ /**
20
+ * @returns The url for fetching user account details.
21
+ * @param restid The restId of the target user
22
+ */
23
+ function userAccountByIdUrl(restId) {
24
+ return "https://api.twitter.com/graphql/mi_IjXgFyr41N9zkszPz9w/UserByRestId?variables=%7B%22userId%22%3A%22".concat(restId, "%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%7D");
25
+ }
26
+ exports.userAccountByIdUrl = userAccountByIdUrl;
27
+ /**
28
+ * @returns The url for fetching the list of users followed bu target user.
29
+ * @param userId The rest id of the target user
30
+ * @param count The batch size of the list of following
31
+ * @param cursor The cursor to next batch
32
+ */
33
+ function userFollowingUrl(userId, count, cursor) {
34
+ return "https://api.twitter.com/graphql/mSnjZc5CTm2Z5Lu_i4XsPQ/Following?variables=%7B%22userId%22%3A%22".concat(userId, "%22%2C%22count%22%3A").concat(count, "%2C%22cursor%22%3A%22").concat(encodeURIComponent(cursor), "%22%2C%22includePromotedContent%22%3Afalse%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
35
+ }
36
+ exports.userFollowingUrl = userFollowingUrl;
37
+ /**
38
+ * @return The url for fetching the list of followers of the target user
39
+ * @param userId The rest id of the target user
40
+ * @param count The batch size for the list of followers
41
+ * @param cursor The cusor to next batch
42
+ */
43
+ function userFollowersUrl(userId, count, cursor) {
44
+ return "https://api.twitter.com/graphql/nwlAnaw7oKXcVLi91ehy7Q/Followers?variables=%7B%22userId%22%3A%22".concat(userId, "%22%2C%22count%22%3A").concat(count, "%2C%22cursor%22%3A%22").concat(encodeURIComponent(cursor), "%22%2C%22includePromotedContent%22%3Afalse%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
45
+ }
46
+ exports.userFollowersUrl = userFollowersUrl;
47
+ /**
48
+ * @returns The url for fetching the list of tweets liked by the target user
49
+ * @param userId The rest id of the target user
50
+ * @param count The batch size for the list of tweets
51
+ * @param cursor The cusor to next batch
52
+ */
53
+ function userLikesUrl(userId, count, cursor) {
54
+ return "https://api.twitter.com/graphql/gP4ZKghLd4tpILgS6VudAQ/Likes?variables=%7B%22userId%22%3A%22".concat(userId, "%22%2C%22count%22%3A").concat(count, "%2C%22cursor%22%3A%22").concat(encodeURIComponent(cursor), "%22%2C%22includePromotedContent%22%3Afalse%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%2C%22withClientEventToken%22%3Afalse%2C%22withBirdwatchNotes%22%3Afalse%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
55
+ }
56
+ exports.userLikesUrl = userLikesUrl;
57
+ /**
58
+ * @returns The url for fetching the list of tweets made by the target user
59
+ * @param userId The rest id of the target user
60
+ * @param count The batch size for the list of tweets
61
+ * @param cursor The cursor to next batch
62
+ */
63
+ function userTweetsUrl(userId, count, cursor) {
64
+ return "https://api.twitter.com/graphql/MsEBEnQjKQCsRlAbC6qKcA/UserTweets?variables=%7B%22userId%22%3A%22".concat(userId, "%22%2C%22count%22%3A").concat(count, "%2C%22cursor%22%3A%22").concat(encodeURIComponent(cursor), "%22%2C%22includePromotedContent%22%3Atrue%2C%22withQuickPromoteEligibilityTweetFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
65
+ }
66
+ exports.userTweetsUrl = userTweetsUrl;
67
+ /**
68
+ * @returns The url for fetching the list of tweets matching the given filter
69
+ * @param query The query to be used for searching tweets
70
+ * @param count The number of tweets to fetch
71
+ * @param cursor The cusor to next batch *
72
+ */
73
+ function tweetsUrl(query, count, cursor) {
74
+ return "https://api.twitter.com/2/search/adaptive.json?include_want_retweets=1&include_quote_count=true&include_reply_count=1&tweet_mode=extended&include_entities=true&include_user_entities=true&simple_quoted_tweet=true&q=".concat(query, "&tweet_search_mode=live&count=").concat(count, "&query_source=typed_query&cursor=").concat(encodeURIComponent(cursor));
75
+ }
76
+ exports.tweetsUrl = tweetsUrl;
77
+ /**
78
+ * @returns The url for fetching the details of a given tweet
79
+ * @param tweetId The rest id of the target tweet
80
+ */
81
+ function tweetDetailsUrl(tweetId) {
82
+ return "https://api.twitter.com/graphql/lXI2kaM2hgmbf7h42kpxuA/TweetDetail?variables=%7B%22focalTweetId%22%3A%22".concat(tweetId, "%22%2C%22referrer%22%3A%22profile%22%2C%22with_rux_injections%22%3Afalse%2C%22includePromotedContent%22%3Atrue%2C%22withCommunity%22%3Atrue%2C%22withQuickPromoteEligibilityTweetFields%22%3Atrue%2C%22withBirdwatchNotes%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
83
+ }
84
+ exports.tweetDetailsUrl = tweetDetailsUrl;
85
+ /**
86
+ * @returns The url for fetching the list of replies to a given tweet
87
+ * @param tweetId The rest of the target tweet
88
+ * @param cursor The curor to next batch
89
+ */
90
+ function tweetRepliesUrl(tweetId, cursor) {
91
+ return "https://api.twitter.com/graphql/lXI2kaM2hgmbf7h42kpxuA/TweetDetail?variables=%7B%22focalTweetId%22%3A%22".concat(tweetId, "%22%2C%22cursor%22%3A%22").concat(encodeURIComponent(cursor), "%22%2C%22referrer%22%3A%22tweet%22%2C%22with_rux_injections%22%3Afalse%2C%22includePromotedContent%22%3Atrue%2C%22withCommunity%22%3Atrue%2C%22withQuickPromoteEligibilityTweetFields%22%3Atrue%2C%22withBirdwatchNotes%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
92
+ }
93
+ exports.tweetRepliesUrl = tweetRepliesUrl;
94
+ /**
95
+ * @returns The url for fetching the list of users who liked a given tweet
96
+ * @param tweetId The rest id of the target tweet
97
+ * @param count The batch size of the list of users
98
+ * @param cursor The curor to next batch
99
+ */
100
+ function tweetLikesUrl(tweetId, count, cursor) {
101
+ return "https://api.twitter.com/graphql/56ZwFC3Vui31fF8IYX8EGA/Favoriters?variables=%7B%22tweetId%22%3A%22".concat(tweetId, "%22%2C%22count%22%3A").concat(count, "%2C%22cursor%22%3A%22").concat(encodeURIComponent(cursor), "%22%2C%22includePromotedContent%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
102
+ }
103
+ exports.tweetLikesUrl = tweetLikesUrl;
104
+ /**
105
+ * @returns The url for fetching the list of user who retweeted the given tweet
106
+ * @param tweetId The rest id of the target tweet
107
+ * @param count The batch size of the list of users
108
+ * @param cursor The curor to next batch
109
+ */
110
+ function tweetRetweetUrl(tweetId, count, cursor) {
111
+ return "https://api.twitter.com/graphql/Wd7DVeLqMj_JQiTL0tjJwQ/Retweeters?variables=%7B%22tweetId%22%3A%22".concat(tweetId, "%22%2C%22count%22%3A").concat(count, "%2C%22cursor%22%3A%22").concat(encodeURIComponent(cursor), "%22%2C%22includePromotedContent%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%7D&features=%7B%22responsive_web_twitter_blue_verified_badge_is_enabled%22%3Atrue%2C%22verified_phone_label_enabled%22%3Atrue%2C%22responsive_web_graphql_timeline_navigation_enabled%22%3Atrue%2C%22view_counts_public_visibility_enabled%22%3Atrue%2C%22longform_notetweets_consumption_enabled%22%3Afalse%2C%22tweetypie_unmention_optimization_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Atrue%2C%22vibe_api_enabled%22%3Atrue%2C%22responsive_web_edit_tweet_api_enabled%22%3Atrue%2C%22graphql_is_translatable_rweb_tweet_is_translatable_enabled%22%3Atrue%2C%22view_counts_everywhere_api_enabled%22%3Atrue%2C%22standardized_nudges_misinfo%22%3Atrue%2C%22tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled%22%3Afalse%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_text_conversations_enabled%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%7D");
112
+ }
113
+ exports.tweetRetweetUrl = tweetRetweetUrl;
114
+ /**
115
+ * @returns The url for adding new Tweet
116
+ */
117
+ function AddTweet() {
118
+ return "https://api.twitter.com/1.1/statuses/update.json";
119
+ }
120
+ exports.AddTweet = AddTweet;
121
+ /**
122
+ *
123
+ * @param type selection for trending by generic topics availed to us by Twitter. e.g. news, sports, entertainment, overall, etc.
124
+ * @returns url to fetch trends from
125
+ */
126
+ function trendsUrl(type) {
127
+ return "https://api.twitter.com/2/guide.json?include_profile_interstitial_type=1&include_blocking=1&include_blocked_by=1&include_followed_by=1&include_want_retweets=1&include_mute_edge=1&include_can_dm=1&include_can_media_tag=1&include_ext_has_nft_avatar=1&include_ext_is_blue_verified=1&include_ext_verified_type=1&skip_status=1&cards_platform=Web-12&include_cards=1&include_ext_alt_text=true&include_ext_limited_action_results=false&include_quote_count=true&include_reply_count=1&tweet_mode=extended&include_ext_collab_control=true&include_ext_views=true&include_entities=true&include_user_entities=true&include_ext_media_color=true&include_ext_media_availability=true&include_ext_sensitive_media_warning=true&include_ext_trusted_friends_metadata=true&send_error_codes=true&simple_quoted_tweet=true&count=20&requestContext=launch&include_page_configuration=true&initial_tab_id=".concat(type, "&entity_tokens=false&ext=mediaStats%2ChighlightedLabel%2ChasNftAvatar%2CvoiceInfo%2Cenrichments%2CsuperFollowMetadata%2CunmentionInfo%2CeditControl%2Ccollab_control%2Cvibe");
128
+ }
129
+ exports.trendsUrl = trendsUrl;
130
+ //# sourceMappingURL=Urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Urls.js","sourceRoot":"","sources":["../../../src/services/helper/Urls.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,aAAa;IACzB,OAAO,iDAAiD,CAAC;AAC7D,CAAC;AAFD,sCAEC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAAC,UAAkB;IAC7C,OAAO,sHAA+G,UAAU,6RAA0R,CAAA;AAC9Z,CAAC;AAFD,wCAEC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,MAAc;IAC7C,OAAO,6GAAsG,MAAM,6RAA0R,CAAC;AAClZ,CAAC;AAFD,gDAEC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,MAAc,EAAE,KAAa,EAAE,MAAc;IAC1E,OAAO,0GAAmG,MAAM,iCAAuB,KAAK,kCAAwB,kBAAkB,CAAC,MAAM,CAAC,2nCAAwnC,CAAC;AAC3zC,CAAC;AAFD,4CAEC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,MAAc,EAAE,KAAa,EAAE,MAAc;IAC1E,OAAO,0GAAmG,MAAM,iCAAuB,KAAK,kCAAwB,kBAAkB,CAAC,MAAM,CAAC,2nCAAwnC,CAAC;AAC3zC,CAAC;AAFD,4CAEC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,MAAc,EAAE,KAAa,EAAE,MAAc;IACtE,OAAO,sGAA+F,MAAM,iCAAuB,KAAK,kCAAwB,kBAAkB,CAAC,MAAM,CAAC,0vCAAuvC,CAAC;AACt7C,CAAC;AAFD,oCAEC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,MAAc,EAAE,KAAa,EAAE,MAAc;IACvE,OAAO,2GAAoG,MAAM,iCAAuB,KAAK,kCAAwB,kBAAkB,CAAC,MAAM,CAAC,0rCAAurC,CAAC;AAC33C,CAAC;AAFD,sCAEC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,KAAa,EAAE,KAAa,EAAE,MAAc;IAClE,OAAO,gOAAyN,KAAK,2CAAiC,KAAK,8CAAoC,kBAAkB,CAAC,MAAM,CAAC,CAAE,CAAC;AAChV,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,eAAe,CAAC,OAAe;IAC3C,OAAO,kHAA2G,OAAO,22CAAw2C,CAAC;AACt+C,CAAC;AAFD,0CAEC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,MAAc;IAC3D,OAAO,kHAA2G,OAAO,qCAA2B,kBAAkB,CAAC,MAAM,CAAC,y2CAAs2C,CAAC;AACzhD,CAAC;AAFD,0CAEC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAe,EAAE,KAAa,EAAE,MAAc;IACxE,OAAO,4GAAqG,OAAO,iCAAuB,KAAK,kCAAwB,kBAAkB,CAAC,MAAM,CAAC,0nCAAunC,CAAC;AAC7zC,CAAC;AAFD,sCAEC;AAED;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,KAAa,EAAE,MAAc;IAC1E,OAAO,4GAAqG,OAAO,iCAAuB,KAAK,kCAAwB,kBAAkB,CAAC,MAAM,CAAC,0nCAAunC,CAAC;AAC7zC,CAAC;AAFD,0CAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACpB,OAAO,kDAAkD,CAAC;AAC9D,CAAC;AAFD,4BAEC;AAED;;;;GAIG;AACH,SAAgB,SAAS,CAAC,IAAY;IAElC,OAAO,i3BAA02B,IAAI,gLAA6K,CAAC;AACviC,CAAC;AAHD,8BAGC"}
@@ -0,0 +1,3 @@
1
+ import RawTrends from '../../../types/raw/general/Trends';
2
+ import Trends from '../../../types/Trends';
3
+ export declare function extractTrendData(res: RawTrends): Trends;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ exports.__esModule = true;
26
+ exports.extractTrendData = void 0;
27
+ var Parsers = __importStar(require("../Parser"));
28
+ function extractTrendData(res) {
29
+ var _a, _b;
30
+ // Setting Initial values
31
+ var currentTrends = {
32
+ trendingNow: [],
33
+ trendCategory: res.pageConfiguration.tabs.initialTabId
34
+ };
35
+ // Fetching each Trend and its data and push it to currentTrends.trendingNow
36
+ (_b = (_a = res.timeline.instructions[1].addEntries) === null || _a === void 0 ? void 0 : _a.entries[1].content.timelineModule) === null || _b === void 0 ? void 0 : _b.items.forEach(function (entry) {
37
+ var _a;
38
+ var trend = {
39
+ name: entry.item.content.trend.name,
40
+ rank: Number(entry.item.content.trend.rank),
41
+ //Getting approx amount of tweets done if it exists in the metaData
42
+ approxtweetCount: Parsers.convertToNumber((_a = entry.item.content.trend.trendMetadata.metaDescription) !== null && _a !== void 0 ? _a : ''),
43
+ relatedTopics: entry.item.clientEventInfo.details.guideDetails.transparentGuideDetails.trendMetadata.associatedCuratedTweetIds,
44
+ domainContext: entry.item.content.trend.trendMetadata.domainContext
45
+ };
46
+ currentTrends.trendingNow.push(trend);
47
+ });
48
+ return currentTrends;
49
+ }
50
+ exports.extractTrendData = extractTrendData;
51
+ //# sourceMappingURL=Trends.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trends.js","sourceRoot":"","sources":["../../../../src/services/helper/extractors/Trends.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,iDAAoC;AAIpC,SAAgB,gBAAgB,CAAC,GAAa;;IAE1C,yBAAyB;IACzB,IAAI,aAAa,GAAQ;QACrB,WAAW,EAAC,EAAE;QACd,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY;KACzD,CAAA;IAED,4EAA4E;IAC5E,MAAA,MAAA,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,0CAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,cAAc,0CAAE,KAAK,CAAC,OAAO,CAAC,UAAA,KAAK;;QAC3F,IAAM,KAAK,GAAY;YACnB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI;YACnC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;YAE3C,oEAAoE;YACpE,gBAAgB,EAAG,OAAO,CAAC,eAAe,CAAC,MAAA,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,eAAe,mCAAE,EAAE,CAAC;YAEtG,aAAa,EAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,uBAAuB,CAAC,aAAa,CAAC,yBAAyB;YAC/H,aAAa,EAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa;SAEvE,CAAA;QACD,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,OAAO,aAAa,CAAA;AACxB,CAAC;AAzBD,4CAyBC"}
@@ -0,0 +1,7 @@
1
+ import { trendOn } from "../../../types/Trends";
2
+ /**
3
+ *
4
+ * @param type selection for trending by generic topics availed to us by Twitter. e.g. news, sports, entertainment, overall, etc.
5
+ * @returns url to fetch trends from
6
+ */
7
+ export declare function trendsUrl(type: trendOn): string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.trendsUrl = void 0;
4
+ /**
5
+ *
6
+ * @param type selection for trending by generic topics availed to us by Twitter. e.g. news, sports, entertainment, overall, etc.
7
+ * @returns url to fetch trends from
8
+ */
9
+ function trendsUrl(type) {
10
+ return "https://api.twitter.com/2/guide.json?include_profile_interstitial_type=1&include_blocking=1&include_blocked_by=1&include_followed_by=1&include_want_retweets=1&include_mute_edge=1&include_can_dm=1&include_can_media_tag=1&include_ext_has_nft_avatar=1&include_ext_is_blue_verified=1&include_ext_verified_type=1&skip_status=1&cards_platform=Web-12&include_cards=1&include_ext_alt_text=true&include_ext_limited_action_results=false&include_quote_count=true&include_reply_count=1&tweet_mode=extended&include_ext_collab_control=true&include_ext_views=true&include_entities=true&include_user_entities=true&include_ext_media_color=true&include_ext_media_availability=true&include_ext_sensitive_media_warning=true&include_ext_trusted_friends_metadata=true&send_error_codes=true&simple_quoted_tweet=true&count=20&requestContext=launch&include_page_configuration=true&initial_tab_id=".concat(type, "&entity_tokens=false&ext=mediaStats%2ChighlightedLabel%2ChasNftAvatar%2CvoiceInfo%2Cenrichments%2CsuperFollowMetadata%2CunmentionInfo%2CeditControl%2Ccollab_control%2Cvibe");
11
+ }
12
+ exports.trendsUrl = trendsUrl;
13
+ //# sourceMappingURL=Trends.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trends.js","sourceRoot":"","sources":["../../../../src/services/helper/urls/Trends.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,SAAgB,SAAS,CAAC,IAAY;IAElC,OAAO,i3BAA02B,IAAI,gLAA6K,CAAC;AACviC,CAAC;AAHD,8BAGC"}
@@ -1,15 +1,40 @@
1
1
  /**
2
- * @summary Stores the guest credentials for guest users
2
+ * The guest credentials for guest authentication.
3
+ *
4
+ * @internal
3
5
  */
4
6
  export interface GuestCredentials {
7
+ /** The bearer token from twitter.com.
8
+ *
9
+ * @remarks This is a static bearer token from twitter.com.
10
+ */
5
11
  authToken: string;
12
+ /** The guest token.
13
+ *
14
+ * @remarks This is generated from twitter.com by calling GETTING https://api.twitter.com/1.1/guest/activate.json endpoint.
15
+ */
6
16
  guestToken: string;
7
17
  }
8
18
  /**
9
- * @summary Stores the credentials for authenticated/logged in users
19
+ * The credentials for authenticated/logged in users.
20
+ *
21
+ * @internal
10
22
  */
11
23
  export interface AuthCredentials {
24
+ /** The bearer token from twitter.com.
25
+ *
26
+ * @remarks This is a static bearer token from twitter.com.
27
+ */
12
28
  authToken: string;
29
+ /** The guest token.
30
+ *
31
+ * @remarks This is generated from twitter.com by calling GETTING https://api.twitter.com/1.1/guest/activate.json endpoint.
32
+ */
13
33
  csrfToken: string;
34
+ /** The cookie of the twitter account, which is used to authenticate against twitter.
35
+ *
36
+ * @remarks The cookie can be obtained/scraped from any one of the outgoing HTTP request headers to twitter.com.
37
+ * It can also be obtained after logging in to twitter, from the 'set-cookie' field of response.
38
+ */
14
39
  cookie: string;
15
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.js","sourceRoot":"","sources":["../../src/types/Authentication.ts"],"names":[],"mappings":";;AAMC,CAAC;AASD,CAAC"}
1
+ {"version":3,"file":"Authentication.js","sourceRoot":"","sources":["../../src/types/Authentication.ts"],"names":[],"mappings":";;AAgBC,CAAC;AAwBD,CAAC"}
@@ -1,5 +1,7 @@
1
1
  /**
2
- * @summary Stores the different types of http status codes
2
+ * The different types of http status codes
3
+ *
4
+ * @internal
3
5
  */
4
6
  export declare enum HttpStatus {
5
7
  BadRequest = 400,
@@ -2,7 +2,9 @@
2
2
  exports.__esModule = true;
3
3
  exports.HttpStatus = void 0;
4
4
  /**
5
- * @summary Stores the different types of http status codes
5
+ * The different types of http status codes
6
+ *
7
+ * @internal
6
8
  */
7
9
  var HttpStatus;
8
10
  (function (HttpStatus) {
@@ -1 +1 @@
1
- {"version":3,"file":"HTTP.js","sourceRoot":"","sources":["../../src/types/HTTP.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,UAWX;AAXD,WAAY,UAAU;IAClB,yDAAgB,CAAA;IAChB,6DAAkB,CAAA;IAClB,uDAAe,CAAA;IACf,qDAAc,CAAA;IACd,qEAAsB,CAAA;IACtB,iEAAoB,CAAA;IACpB,mEAAqB,CAAA;IACrB,2EAAyB,CAAA;IACzB,yDAAgB,CAAA;IAChB,yEAAwB,CAAA;AAC5B,CAAC,EAXW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAWrB;AAAA,CAAC"}
1
+ {"version":3,"file":"HTTP.js","sourceRoot":"","sources":["../../src/types/HTTP.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,UAWX;AAXD,WAAY,UAAU;IAClB,yDAAgB,CAAA;IAChB,6DAAkB,CAAA;IAClB,uDAAe,CAAA;IACf,qDAAc,CAAA;IACd,qEAAsB,CAAA;IACtB,iEAAoB,CAAA;IACpB,mEAAqB,CAAA;IACrB,2EAAyB,CAAA;IACzB,yDAAgB,CAAA;IAChB,yEAAwB,CAAA;AAC5B,CAAC,EAXW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAWrB;AAAA,CAAC"}
@@ -1,9 +1,14 @@
1
1
  /**
2
- * @summary Stores the data returned from extractors
2
+ * The data returned from extractor methods.
3
+ * @internal
3
4
  */
4
5
  export interface DataExtract {
6
+ /** The required data. */
5
7
  required: any;
8
+ /** The cursor string to the next batch of data. */
6
9
  cursor: string;
10
+ /** Additional extracted user details. */
7
11
  users: any;
12
+ /** Additional extracted tweet details */
8
13
  tweets: any;
9
14
  }
@@ -0,0 +1,30 @@
1
+ import { AccountService } from "../services/accounts/AccountService";
2
+ import { TweetService } from "../services/data/TweetService";
3
+ import { UserAccountService } from "../services/data/UserAccountService";
4
+ /**
5
+ * @summary Stores the cursor to the batch of data
6
+ */
7
+ export declare class Cursor {
8
+ value: string;
9
+ /**
10
+ * @summary Initializes a new cursor from the given cursor string
11
+ * @param cursorStr The string representation of the cursor
12
+ */
13
+ constructor(cursorStr: string);
14
+ }
15
+ /**
16
+ * @summary Stores cursored data that is returned by services
17
+ */
18
+ export interface CursoredData<Type> {
19
+ list?: Type[];
20
+ next?: Cursor;
21
+ error?: Error;
22
+ }
23
+ /**
24
+ * @summary Stores the data context from where data is to be fetched
25
+ */
26
+ export interface DataContext {
27
+ users: UserAccountService;
28
+ tweets: TweetService;
29
+ account: AccountService;
30
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.Cursor = void 0;
4
+ /**
5
+ * @summary Stores the cursor to the batch of data
6
+ */
7
+ var Cursor = /** @class */ (function () {
8
+ // MEMBER DATA
9
+ /**
10
+ * @summary Initializes a new cursor from the given cursor string
11
+ * @param cursorStr The string representation of the cursor
12
+ */
13
+ function Cursor(cursorStr) {
14
+ this.value = cursorStr;
15
+ }
16
+ return Cursor;
17
+ }());
18
+ exports.Cursor = Cursor;
19
+ //# sourceMappingURL=Service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Service.js","sourceRoot":"","sources":["../../src/types/Service.ts"],"names":[],"mappings":";;;AAKA;;GAEG;AACH;IAII,cAAc;IACd;;;OAGG;IACH,gBAAY,SAAiB;QACzB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,CAAC;IACL,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * A data structure representing a collection of trending topics.
3
+ *
4
+ * @interface Trends
5
+ *
6
+ * @property {trendEntry[]} trendingNow - An array of `trendEntry` objects representing the trending topics.
7
+ * * @property {string} trendCategory - the category the trending topic list are all trending in.
8
+ */
9
+ export default interface Trends {
10
+ trendingNow: trendEntry[];
11
+ trendCategory: string;
12
+ }
13
+ /**
14
+ * A data structure representing a trend entry.
15
+ *
16
+ * @interface trendEntry
17
+ *
18
+ * @property {string} name - The name of the trend.
19
+ * @property {number} rank - The rank of the trend.
20
+ * @property {number} approxtweetCount - The approximate number of tweets for the trend.
21
+ * @property {string[]} relatedTopics - An array of related topics for the trend.
22
+
23
+ * @property {string} domainContext - The domain context for the trend. i.e. what category is it specifically trenging on
24
+ */
25
+ export interface trendEntry {
26
+ name: string;
27
+ rank: number;
28
+ approxtweetCount: number;
29
+ relatedTopics: string[];
30
+ domainContext: string;
31
+ }
32
+ /**
33
+ * An enum representing the different trend categories.
34
+ *
35
+ * @enum {string}
36
+ * @constant
37
+ *
38
+ * @property {string} foryou - Trending topics for the user.
39
+ * @property {string} overall - Overall trending topics.
40
+ * @property {string} news - Trending news topics.
41
+ * @property {string} sports - Trending sports topics.
42
+ * @property {string} entertainment - Trending entertainment topics.
43
+ */
44
+ export declare const enum trendOn {
45
+ foryou = "for-you",
46
+ overall = "trending",
47
+ news = "news-unified",
48
+ sports = "sports-unified",
49
+ entertainment = "entertainment-unified"
50
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=Trends.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trends.js","sourceRoot":"","sources":["../../src/types/Trends.ts"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @summary Stores the filter to be used for fetching tweets from TwitterAPI
3
+ */
4
+ export interface TweetFilter {
5
+ words?: string[];
6
+ hashtags?: string[];
7
+ fromUsers?: string[];
8
+ toUsers?: string[];
9
+ mentions?: string[];
10
+ startDate?: string;
11
+ endDate?: string;
12
+ quoted?: string;
13
+ links?: boolean;
14
+ }
15
+ /**
16
+ * @summary Stores the different types of tweet elements like urls, media, mentions, hashtags, etc
17
+ */
18
+ export interface TweetEntities {
19
+ hashtags: string[];
20
+ urls: string[];
21
+ mentionedUsers: string[];
22
+ media: string[];
23
+ }
24
+ /**
25
+ * @summary Stores a single tweet
26
+ */
27
+ export interface Tweet {
28
+ id: string;
29
+ tweetBy: string;
30
+ createdAt: string;
31
+ entities: TweetEntities;
32
+ quoted: string;
33
+ fullText: string;
34
+ replyTo: string;
35
+ lang: string;
36
+ quoteCount: number;
37
+ replyCount: number;
38
+ retweetCount: number;
39
+ likeCount: number;
40
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // This file contains various objects related to handling of Tweets made by a user
3
+ exports.__esModule = true;
4
+ ;
5
+ //# sourceMappingURL=Tweet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../src/types/Tweet.ts"],"names":[],"mappings":";AAAA,kFAAkF;;AAejF,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @summary Stores the complete details of the given user's account
3
+ */
4
+ export interface User {
5
+ id: string;
6
+ userName: string;
7
+ fullName: string;
8
+ createdAt: string;
9
+ description: string;
10
+ isVerified: boolean;
11
+ favouritesCount: number;
12
+ followersCount: number;
13
+ followingsCount: number;
14
+ statusesCount: number;
15
+ location: string;
16
+ pinnedTweet: string;
17
+ profileBanner: string;
18
+ profileImage: string;
19
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // This file contains various objects for handling data related to User Account
3
+ exports.__esModule = true;
4
+ //# sourceMappingURL=UserAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserAccount.js","sourceRoot":"","sources":["../../src/types/UserAccount.ts"],"names":[],"mappings":";AAAA,+EAA+E"}
@@ -1,11 +1,18 @@
1
1
  /**
2
- * @summary Stores different types of error messages related to authentication
2
+ * Different types of error messages related to authentication.
3
+ *
4
+ * @public
3
5
  */
4
6
  export declare enum AuthenticationErrors {
5
- NotAuthenticated = "Cannot fetch this data without authentication"
7
+ NotAuthenticated = "Cannot fetch this data without authentication",
8
+ InvalidEmail = "No Twitter account found for the given email address",
9
+ InvalidUsername = "Incorrect username given for the given Twitter account",
10
+ InvalidPassword = "Incorrect password given for the given Twitter account"
6
11
  }
7
12
  /**
8
- * @summary Stores different types error messages for validation errors
13
+ * Different types error messages for validation errors.
14
+ *
15
+ * @public
9
16
  */
10
17
  export declare enum ValidationErrors {
11
18
  InvalidTweetFilter = "Atleast one of fromUsers/toUsers/mentions/hashtags/words argument is required",
@@ -13,7 +20,9 @@ export declare enum ValidationErrors {
13
20
  InvalidCount = "Invalid count provided"
14
21
  }
15
22
  /**
16
- * @summary Stores all the different type of error messages that are returned by services
23
+ * Different type of error messages that are returned by services.
24
+ *
25
+ * @public
17
26
  */
18
27
  export declare enum DataErrors {
19
28
  UserNotFound = "An account with given username/id was not found",
@@ -2,15 +2,22 @@
2
2
  exports.__esModule = true;
3
3
  exports.DataErrors = exports.ValidationErrors = exports.AuthenticationErrors = void 0;
4
4
  /**
5
- * @summary Stores different types of error messages related to authentication
5
+ * Different types of error messages related to authentication.
6
+ *
7
+ * @public
6
8
  */
7
9
  var AuthenticationErrors;
8
10
  (function (AuthenticationErrors) {
9
11
  AuthenticationErrors["NotAuthenticated"] = "Cannot fetch this data without authentication";
12
+ AuthenticationErrors["InvalidEmail"] = "No Twitter account found for the given email address";
13
+ AuthenticationErrors["InvalidUsername"] = "Incorrect username given for the given Twitter account";
14
+ AuthenticationErrors["InvalidPassword"] = "Incorrect password given for the given Twitter account";
10
15
  })(AuthenticationErrors = exports.AuthenticationErrors || (exports.AuthenticationErrors = {}));
11
16
  ;
12
17
  /**
13
- * @summary Stores different types error messages for validation errors
18
+ * Different types error messages for validation errors.
19
+ *
20
+ * @public
14
21
  */
15
22
  var ValidationErrors;
16
23
  (function (ValidationErrors) {
@@ -20,7 +27,9 @@ var ValidationErrors;
20
27
  })(ValidationErrors = exports.ValidationErrors || (exports.ValidationErrors = {}));
21
28
  ;
22
29
  /**
23
- * @summary Stores all the different type of error messages that are returned by services
30
+ * Different type of error messages that are returned by services.
31
+ *
32
+ * @public
24
33
  */
25
34
  var DataErrors;
26
35
  (function (DataErrors) {
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../src/types/data/Errors.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC5B,0FAAkE,CAAA;AACtE,CAAC,EAFW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAE/B;AAAA,CAAC;AAEF;;GAEG;AACH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,wHAAoG,CAAA;IACpG,gFAA4D,CAAA;IAC5D,2DAAuC,CAAA;AAC3C,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAAA,CAAC;AAEF;;GAEG;AACH,IAAY,UAQX;AARD,WAAY,UAAU;IAClB,8EAAgE,CAAA;IAChE,uEAAyD,CAAA;IACzD,2EAA6D,CAAA;IAC7D,+EAAiE,CAAA;IACjE,uFAAyE,CAAA;IACzE,4FAA8E,CAAA;IAC9E,8FAAgF,CAAA;AACpF,CAAC,EARW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAQrB;AAAA,CAAC"}
1
+ {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../src/types/data/Errors.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC5B,0FAAkE,CAAA;IAClE,6FAAqE,CAAA;IACrE,kGAA0E,CAAA;IAC1E,kGAA0E,CAAA;AAC9E,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AAAA,CAAC;AAEF;;;;GAIG;AACH,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,wHAAoG,CAAA;IACpG,gFAA4D,CAAA;IAC5D,2DAAuC,CAAA;AAC3C,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAAA,CAAC;AAEF;;;;GAIG;AACH,IAAY,UAQX;AARD,WAAY,UAAU;IAClB,8EAAgE,CAAA;IAChE,uEAAyD,CAAA;IACzD,2EAA6D,CAAA;IAC7D,+EAAiE,CAAA;IACjE,uFAAyE,CAAA;IACzE,4FAA8E,CAAA;IAC9E,8FAAgF,CAAA;AACpF,CAAC,EARW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAQrB;AAAA,CAAC"}