rettiwt-api 1.2.0 → 1.3.0
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/enums/Errors.d.ts +2 -1
- package/dist/enums/Errors.js +1 -0
- package/dist/enums/Errors.js.map +1 -1
- package/dist/graphql/queries/RootQuery.js.map +1 -1
- package/dist/graphql/resolvers/TweetResolver.d.ts +5 -5
- package/dist/graphql/resolvers/TweetResolver.js +4 -4
- package/dist/graphql/resolvers/TweetResolver.js.map +1 -1
- package/dist/graphql/types/UserTypes.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/models/args/TweetListArgs.js +2 -2
- package/dist/models/args/TweetListArgs.js.map +1 -1
- package/dist/models/args/UserListArgs.js +2 -2
- package/dist/models/args/UserListArgs.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +3 -3
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +2 -2
- package/dist/models/data/User.js.map +1 -1
- package/dist/services/data/TweetService.d.ts +2 -2
- package/dist/services/data/TweetService.js +8 -9
- package/dist/services/data/TweetService.js.map +1 -1
- package/dist/services/data/UserService.js +12 -22
- package/dist/services/data/UserService.js.map +1 -1
- package/dist/services/helper/Headers.js +34 -34
- package/dist/services/helper/Headers.js.map +1 -1
- package/dist/services/helper/extractors/Tweets.d.ts +5 -14
- package/dist/services/helper/extractors/Tweets.js +25 -89
- package/dist/services/helper/extractors/Tweets.js.map +1 -1
- package/dist/services/helper/extractors/Users.d.ts +4 -13
- package/dist/services/helper/extractors/Users.js +1 -53
- package/dist/services/helper/extractors/Users.js.map +1 -1
- package/dist/services/util/FetcherService.d.ts +3 -3
- package/dist/services/util/FetcherService.js +10 -22
- package/dist/services/util/FetcherService.js.map +1 -1
- package/dist/types/Args.d.ts +0 -27
- package/dist/types/Args.js +0 -1
- package/dist/types/Args.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AccountService.html +17 -17
- package/docs/classes/AuthCookie.html +7 -7
- package/docs/classes/AuthService.html +7 -7
- package/docs/classes/CacheService.html +7 -7
- package/docs/classes/Cursor.html +3 -3
- package/docs/classes/CursoredData.html +4 -4
- package/docs/classes/DataValidationError.html +24 -23
- package/docs/classes/FetcherService.html +15 -15
- package/docs/classes/Tweet.html +16 -16
- package/docs/classes/TweetEntities.html +8 -8
- package/docs/classes/TweetFilter.html +58 -56
- package/docs/classes/TweetListArgs.html +4 -4
- package/docs/classes/TweetService.html +15 -15
- package/docs/classes/User.html +18 -18
- package/docs/classes/UserListArgs.html +4 -4
- package/docs/classes/UserService.html +15 -15
- package/docs/enums/HttpMethods.html +3 -3
- package/docs/functions/Rettiwt.html +5 -4
- package/docs/index.html +4 -3
- package/docs/interfaces/IAuthCookie.html +5 -5
- package/docs/interfaces/ICursor.html +2 -2
- package/docs/interfaces/ICursoredData.html +3 -3
- package/docs/interfaces/IDataContext.html +4 -4
- package/docs/interfaces/IDataValidationError.html +109 -0
- package/docs/interfaces/IListArgs.html +3 -3
- package/docs/interfaces/ITweet.html +13 -13
- package/docs/interfaces/ITweetEntities.html +5 -5
- package/docs/interfaces/ITweetFilter.html +42 -42
- package/docs/interfaces/IUser.html +15 -15
- package/docs/modules.html +8 -6
- package/package.json +3 -2
- package/src/enums/Errors.ts +2 -1
- package/src/graphql/queries/RootQuery.ts +1 -1
- package/src/graphql/resolvers/TweetResolver.ts +12 -59
- package/src/graphql/types/UserTypes.ts +1 -1
- package/src/index.ts +5 -3
- package/src/models/args/TweetListArgs.ts +2 -2
- package/src/models/args/UserListArgs.ts +1 -1
- package/src/models/data/Tweet.ts +3 -3
- package/src/models/data/User.ts +2 -2
- package/src/services/data/TweetService.ts +25 -22
- package/src/services/data/UserService.ts +38 -42
- package/src/services/helper/Headers.ts +34 -34
- package/src/services/helper/Parser.ts +2 -2
- package/src/services/helper/extractors/Tweets.ts +35 -97
- package/src/services/helper/extractors/Users.ts +11 -62
- package/src/services/util/FetcherService.ts +13 -20
- package/src/types/Args.ts +0 -37
- package/Dockerfile +0 -9
- package/dist/models/args/TweetFilter.d.ts +0 -65
- package/dist/models/args/TweetFilter.js +0 -121
- package/dist/models/args/TweetFilter.js.map +0 -1
- package/dist/models/errors/DataValidationError.d.ts +0 -20
- package/dist/models/errors/DataValidationError.js +0 -23
- package/dist/models/errors/DataValidationError.js.map +0 -1
- package/dist/twitter/Url.d.ts +0 -22
- package/dist/twitter/Url.js +0 -32
- package/dist/twitter/Url.js.map +0 -1
- package/dist/twitter/enums/Resources.d.ts +0 -15
- package/dist/twitter/enums/Resources.js +0 -21
- package/dist/twitter/enums/Resources.js.map +0 -1
- package/dist/twitter/params/Query.d.ts +0 -67
- package/dist/twitter/params/Query.js +0 -64
- package/dist/twitter/params/Query.js.map +0 -1
- package/dist/twitter/payloads/Args.d.ts +0 -16
- package/dist/twitter/payloads/Args.js +0 -16
- package/dist/twitter/payloads/Args.js.map +0 -1
- package/dist/twitter/payloads/Features.d.ts +0 -28
- package/dist/twitter/payloads/Features.js +0 -37
- package/dist/twitter/payloads/Features.js.map +0 -1
- package/dist/twitter/payloads/Variables.d.ts +0 -41
- package/dist/twitter/payloads/Variables.js +0 -64
- package/dist/twitter/payloads/Variables.js.map +0 -1
- package/dist/twitter/types/request/Query.d.ts +0 -86
- package/dist/twitter/types/request/Query.js +0 -4
- package/dist/twitter/types/request/Query.js.map +0 -1
- package/dist/twitter/types/tweet/Favouriters.d.ts +0 -164
- package/dist/twitter/types/tweet/Favouriters.js +0 -3
- package/dist/twitter/types/tweet/Favouriters.js.map +0 -1
- package/dist/twitter/types/tweet/Retweeters.d.ts +0 -171
- package/dist/twitter/types/tweet/Retweeters.js +0 -3
- package/dist/twitter/types/tweet/Retweeters.js.map +0 -1
- package/dist/twitter/types/tweet/Tweet.d.ts +0 -746
- package/dist/twitter/types/tweet/Tweet.js +0 -3
- package/dist/twitter/types/tweet/Tweet.js.map +0 -1
- package/dist/twitter/types/tweet/Tweets.d.ts +0 -386
- package/dist/twitter/types/tweet/Tweets.js +0 -3
- package/dist/twitter/types/tweet/Tweets.js.map +0 -1
- package/dist/twitter/types/user/Followers.d.ts +0 -176
- package/dist/twitter/types/user/Followers.js +0 -3
- package/dist/twitter/types/user/Followers.js.map +0 -1
- package/dist/twitter/types/user/Following.d.ts +0 -176
- package/dist/twitter/types/user/Following.js +0 -3
- package/dist/twitter/types/user/Following.js.map +0 -1
- package/dist/twitter/types/user/Likes.d.ts +0 -1059
- package/dist/twitter/types/user/Likes.js +0 -3
- package/dist/twitter/types/user/Likes.js.map +0 -1
- package/dist/twitter/types/user/Tweets.d.ts +0 -1512
- package/dist/twitter/types/user/Tweets.js +0 -3
- package/dist/twitter/types/user/Tweets.js.map +0 -1
- package/dist/twitter/types/user/User.d.ts +0 -117
- package/dist/twitter/types/user/User.js +0 -3
- package/dist/twitter/types/user/User.js.map +0 -1
- package/src/models/args/TweetFilter.ts +0 -140
- package/src/models/errors/DataValidationError.ts +0 -29
- package/src/twitter/Url.ts +0 -37
- package/src/twitter/enums/Resources.ts +0 -15
- package/src/twitter/params/Query.ts +0 -100
- package/src/twitter/payloads/Args.ts +0 -21
- package/src/twitter/payloads/Features.ts +0 -33
- package/src/twitter/payloads/Variables.ts +0 -73
- package/src/twitter/types/request/Query.ts +0 -91
- package/src/twitter/types/tweet/Favouriters.ts +0 -193
- package/src/twitter/types/tweet/Retweeters.ts +0 -201
- package/src/twitter/types/tweet/Tweet.ts +0 -882
- package/src/twitter/types/tweet/Tweets.ts +0 -444
- package/src/twitter/types/user/Followers.ts +0 -208
- package/src/twitter/types/user/Following.ts +0 -208
- package/src/twitter/types/user/Likes.ts +0 -1247
- package/src/twitter/types/user/Tweets.ts +0 -1747
- package/src/twitter/types/user/User.ts +0 -135
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<ul class="tsd-hierarchy">
|
|
28
28
|
<li><a href="../classes/User.html" class="tsd-signature-type" data-tsd-kind="Class">User</a></li></ul></section><aside class="tsd-sources">
|
|
29
29
|
<ul>
|
|
30
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
30
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L6">src/types/User.ts:6</a></li></ul></aside>
|
|
31
31
|
<section class="tsd-panel-group tsd-index-group">
|
|
32
32
|
<section class="tsd-panel tsd-index-panel">
|
|
33
33
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -58,98 +58,98 @@
|
|
|
58
58
|
<div class="tsd-comment tsd-typography"><p>The creation date of user's account.</p>
|
|
59
59
|
</div><aside class="tsd-sources">
|
|
60
60
|
<ul>
|
|
61
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
61
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L17">src/types/User.ts:17</a></li></ul></aside></section>
|
|
62
62
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="description" class="tsd-anchor"></a>
|
|
63
63
|
<h3 class="tsd-anchor-link"><span>description</span><a href="#description" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
64
64
|
<div class="tsd-signature">description<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
65
65
|
<div class="tsd-comment tsd-typography"><p>The user's description.</p>
|
|
66
66
|
</div><aside class="tsd-sources">
|
|
67
67
|
<ul>
|
|
68
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
68
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L20">src/types/User.ts:20</a></li></ul></aside></section>
|
|
69
69
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="favouritesCount" class="tsd-anchor"></a>
|
|
70
70
|
<h3 class="tsd-anchor-link"><span>favourites<wbr/>Count</span><a href="#favouritesCount" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
71
71
|
<div class="tsd-signature">favourites<wbr/>Count<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
72
72
|
<div class="tsd-comment tsd-typography"><p>The number of tweets liked by the user.</p>
|
|
73
73
|
</div><aside class="tsd-sources">
|
|
74
74
|
<ul>
|
|
75
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
75
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L26">src/types/User.ts:26</a></li></ul></aside></section>
|
|
76
76
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="followersCount" class="tsd-anchor"></a>
|
|
77
77
|
<h3 class="tsd-anchor-link"><span>followers<wbr/>Count</span><a href="#followersCount" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
78
78
|
<div class="tsd-signature">followers<wbr/>Count<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
79
79
|
<div class="tsd-comment tsd-typography"><p>The number of followers of the user.</p>
|
|
80
80
|
</div><aside class="tsd-sources">
|
|
81
81
|
<ul>
|
|
82
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
82
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L29">src/types/User.ts:29</a></li></ul></aside></section>
|
|
83
83
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="followingsCount" class="tsd-anchor"></a>
|
|
84
84
|
<h3 class="tsd-anchor-link"><span>followings<wbr/>Count</span><a href="#followingsCount" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
85
85
|
<div class="tsd-signature">followings<wbr/>Count<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
86
86
|
<div class="tsd-comment tsd-typography"><p>The number of following of the user.</p>
|
|
87
87
|
</div><aside class="tsd-sources">
|
|
88
88
|
<ul>
|
|
89
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
89
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L32">src/types/User.ts:32</a></li></ul></aside></section>
|
|
90
90
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="fullName" class="tsd-anchor"></a>
|
|
91
91
|
<h3 class="tsd-anchor-link"><span>full<wbr/>Name</span><a href="#fullName" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
92
92
|
<div class="tsd-signature">full<wbr/>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
93
93
|
<div class="tsd-comment tsd-typography"><p>The full name of the user.</p>
|
|
94
94
|
</div><aside class="tsd-sources">
|
|
95
95
|
<ul>
|
|
96
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
96
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L14">src/types/User.ts:14</a></li></ul></aside></section>
|
|
97
97
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="id" class="tsd-anchor"></a>
|
|
98
98
|
<h3 class="tsd-anchor-link"><span>id</span><a href="#id" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
99
99
|
<div class="tsd-signature">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
100
100
|
<div class="tsd-comment tsd-typography"><p>The rest id of the user.</p>
|
|
101
101
|
</div><aside class="tsd-sources">
|
|
102
102
|
<ul>
|
|
103
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
103
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L8">src/types/User.ts:8</a></li></ul></aside></section>
|
|
104
104
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="isVerified" class="tsd-anchor"></a>
|
|
105
105
|
<h3 class="tsd-anchor-link"><span>is<wbr/>Verified</span><a href="#isVerified" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
106
106
|
<div class="tsd-signature">is<wbr/>Verified<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
|
|
107
107
|
<div class="tsd-comment tsd-typography"><p>Whether the account is verified or not.</p>
|
|
108
108
|
</div><aside class="tsd-sources">
|
|
109
109
|
<ul>
|
|
110
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
110
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L23">src/types/User.ts:23</a></li></ul></aside></section>
|
|
111
111
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="location" class="tsd-anchor"></a>
|
|
112
112
|
<h3 class="tsd-anchor-link"><span>location</span><a href="#location" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
113
113
|
<div class="tsd-signature">location<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
114
114
|
<div class="tsd-comment tsd-typography"><p>The location of user as provided by user.</p>
|
|
115
115
|
</div><aside class="tsd-sources">
|
|
116
116
|
<ul>
|
|
117
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
117
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L38">src/types/User.ts:38</a></li></ul></aside></section>
|
|
118
118
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="pinnedTweet" class="tsd-anchor"></a>
|
|
119
119
|
<h3 class="tsd-anchor-link"><span>pinned<wbr/>Tweet</span><a href="#pinnedTweet" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
120
120
|
<div class="tsd-signature">pinned<wbr/>Tweet<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
121
121
|
<div class="tsd-comment tsd-typography"><p>The rest id of the tweet pinned in the user's profile.</p>
|
|
122
122
|
</div><aside class="tsd-sources">
|
|
123
123
|
<ul>
|
|
124
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
124
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L41">src/types/User.ts:41</a></li></ul></aside></section>
|
|
125
125
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="profileBanner" class="tsd-anchor"></a>
|
|
126
126
|
<h3 class="tsd-anchor-link"><span>profile<wbr/>Banner</span><a href="#profileBanner" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
127
127
|
<div class="tsd-signature">profile<wbr/>Banner<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
128
128
|
<div class="tsd-comment tsd-typography"><p>The url of the profile banner image.</p>
|
|
129
129
|
</div><aside class="tsd-sources">
|
|
130
130
|
<ul>
|
|
131
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
131
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L44">src/types/User.ts:44</a></li></ul></aside></section>
|
|
132
132
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="profileImage" class="tsd-anchor"></a>
|
|
133
133
|
<h3 class="tsd-anchor-link"><span>profile<wbr/>Image</span><a href="#profileImage" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
134
134
|
<div class="tsd-signature">profile<wbr/>Image<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
135
135
|
<div class="tsd-comment tsd-typography"><p>The url of the profile image.</p>
|
|
136
136
|
</div><aside class="tsd-sources">
|
|
137
137
|
<ul>
|
|
138
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
138
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L47">src/types/User.ts:47</a></li></ul></aside></section>
|
|
139
139
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="statusesCount" class="tsd-anchor"></a>
|
|
140
140
|
<h3 class="tsd-anchor-link"><span>statuses<wbr/>Count</span><a href="#statusesCount" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
141
141
|
<div class="tsd-signature">statuses<wbr/>Count<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
|
|
142
142
|
<div class="tsd-comment tsd-typography"><p>The number of tweets made by the user.</p>
|
|
143
143
|
</div><aside class="tsd-sources">
|
|
144
144
|
<ul>
|
|
145
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
145
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L35">src/types/User.ts:35</a></li></ul></aside></section>
|
|
146
146
|
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"><a id="userName" class="tsd-anchor"></a>
|
|
147
147
|
<h3 class="tsd-anchor-link"><span>user<wbr/>Name</span><a href="#userName" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></h3>
|
|
148
148
|
<div class="tsd-signature">user<wbr/>Name<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
|
|
149
149
|
<div class="tsd-comment tsd-typography"><p>The username/screenname of the user.</p>
|
|
150
150
|
</div><aside class="tsd-sources">
|
|
151
151
|
<ul>
|
|
152
|
-
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/
|
|
152
|
+
<li>Defined in <a href="https://github.com/Rishikant181/Rettiwt-API/blob/e11e4bf/src/types/User.ts#L11">src/types/User.ts:11</a></li></ul></aside></section></section></div>
|
|
153
153
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
154
154
|
<div class="tsd-navigation settings">
|
|
155
155
|
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
package/docs/modules.html
CHANGED
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
<a href="classes/CacheService.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Cache<wbr/>Service</span></a>
|
|
28
28
|
<a href="classes/Cursor.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Cursor</span></a>
|
|
29
29
|
<a href="classes/CursoredData.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Cursored<wbr/>Data</span></a>
|
|
30
|
-
<a href="classes/DataValidationError.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Data<wbr/>Validation<wbr/>Error</span></a>
|
|
30
|
+
<a href="classes/DataValidationError.html" class="tsd-index-link tsd-kind-class tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Data<wbr/>Validation<wbr/>Error</span></a>
|
|
31
31
|
<a href="classes/FetcherService.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Fetcher<wbr/>Service</span></a>
|
|
32
32
|
<a href="classes/Tweet.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Tweet</span></a>
|
|
33
33
|
<a href="classes/TweetEntities.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Tweet<wbr/>Entities</span></a>
|
|
34
|
-
<a href="classes/TweetFilter.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Tweet<wbr/>Filter</span></a>
|
|
34
|
+
<a href="classes/TweetFilter.html" class="tsd-index-link tsd-kind-class tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Tweet<wbr/>Filter</span></a>
|
|
35
35
|
<a href="classes/TweetListArgs.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Tweet<wbr/>List<wbr/>Args</span></a>
|
|
36
36
|
<a href="classes/TweetService.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>Tweet<wbr/>Service</span></a>
|
|
37
37
|
<a href="classes/User.html" class="tsd-index-link tsd-kind-class"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg><span>User</span></a>
|
|
@@ -44,10 +44,11 @@
|
|
|
44
44
|
<a href="interfaces/ICursor.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ICursor</span></a>
|
|
45
45
|
<a href="interfaces/ICursoredData.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ICursored<wbr/>Data</span></a>
|
|
46
46
|
<a href="interfaces/IDataContext.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IData<wbr/>Context</span></a>
|
|
47
|
+
<a href="interfaces/IDataValidationError.html" class="tsd-index-link tsd-kind-interface tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IData<wbr/>Validation<wbr/>Error</span></a>
|
|
47
48
|
<a href="interfaces/IListArgs.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IList<wbr/>Args</span></a>
|
|
48
49
|
<a href="interfaces/ITweet.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ITweet</span></a>
|
|
49
50
|
<a href="interfaces/ITweetEntities.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ITweet<wbr/>Entities</span></a>
|
|
50
|
-
<a href="interfaces/ITweetFilter.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ITweet<wbr/>Filter</span></a>
|
|
51
|
+
<a href="interfaces/ITweetFilter.html" class="tsd-index-link tsd-kind-interface tsd-is-external"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>ITweet<wbr/>Filter</span></a>
|
|
51
52
|
<a href="interfaces/IUser.html" class="tsd-index-link tsd-kind-interface"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg><span>IUser</span></a>
|
|
52
53
|
</div></section>
|
|
53
54
|
<section class="tsd-index-section">
|
|
@@ -84,11 +85,11 @@
|
|
|
84
85
|
<li class="tsd-kind-class"><a href="classes/CacheService.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Cache<wbr/>Service</a></li>
|
|
85
86
|
<li class="tsd-kind-class"><a href="classes/Cursor.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Cursor</a></li>
|
|
86
87
|
<li class="tsd-kind-class"><a href="classes/CursoredData.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Cursored<wbr/>Data</a></li>
|
|
87
|
-
<li class="tsd-kind-class"><a href="classes/DataValidationError.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Data<wbr/>Validation<wbr/>Error</a></li>
|
|
88
|
+
<li class="tsd-kind-class tsd-is-external"><a href="classes/DataValidationError.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Data<wbr/>Validation<wbr/>Error</a></li>
|
|
88
89
|
<li class="tsd-kind-class"><a href="classes/FetcherService.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Fetcher<wbr/>Service</a></li>
|
|
89
90
|
<li class="tsd-kind-class"><a href="classes/Tweet.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Tweet</a></li>
|
|
90
91
|
<li class="tsd-kind-class"><a href="classes/TweetEntities.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Tweet<wbr/>Entities</a></li>
|
|
91
|
-
<li class="tsd-kind-class"><a href="classes/TweetFilter.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Tweet<wbr/>Filter</a></li>
|
|
92
|
+
<li class="tsd-kind-class tsd-is-external"><a href="classes/TweetFilter.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Tweet<wbr/>Filter</a></li>
|
|
92
93
|
<li class="tsd-kind-class"><a href="classes/TweetListArgs.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Tweet<wbr/>List<wbr/>Args</a></li>
|
|
93
94
|
<li class="tsd-kind-class"><a href="classes/TweetService.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>Tweet<wbr/>Service</a></li>
|
|
94
95
|
<li class="tsd-kind-class"><a href="classes/User.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-128-path"></use><use href="#icon-128-text"></use></svg>User</a></li>
|
|
@@ -98,10 +99,11 @@
|
|
|
98
99
|
<li class="tsd-kind-interface"><a href="interfaces/ICursor.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>ICursor</a></li>
|
|
99
100
|
<li class="tsd-kind-interface"><a href="interfaces/ICursoredData.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>ICursored<wbr/>Data</a></li>
|
|
100
101
|
<li class="tsd-kind-interface"><a href="interfaces/IDataContext.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>IData<wbr/>Context</a></li>
|
|
102
|
+
<li class="tsd-kind-interface tsd-is-external"><a href="interfaces/IDataValidationError.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>IData<wbr/>Validation<wbr/>Error</a></li>
|
|
101
103
|
<li class="tsd-kind-interface"><a href="interfaces/IListArgs.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>IList<wbr/>Args</a></li>
|
|
102
104
|
<li class="tsd-kind-interface"><a href="interfaces/ITweet.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>ITweet</a></li>
|
|
103
105
|
<li class="tsd-kind-interface"><a href="interfaces/ITweetEntities.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>ITweet<wbr/>Entities</a></li>
|
|
104
|
-
<li class="tsd-kind-interface"><a href="interfaces/ITweetFilter.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>ITweet<wbr/>Filter</a></li>
|
|
106
|
+
<li class="tsd-kind-interface tsd-is-external"><a href="interfaces/ITweetFilter.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>ITweet<wbr/>Filter</a></li>
|
|
105
107
|
<li class="tsd-kind-interface"><a href="interfaces/IUser.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>IUser</a></li>
|
|
106
108
|
<li class="tsd-kind-function"><a href="functions/Rettiwt.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>Rettiwt</a></li></ul></nav></div></div>
|
|
107
109
|
<div class="container tsd-generator">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rettiwt-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"description": "An API for fetching data from TwitterAPI, without any rate limits!",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"graphql": "14.7.0",
|
|
33
33
|
"node-cache": "5.1.2",
|
|
34
34
|
"node-libcurl": "3.0.0",
|
|
35
|
-
"reflect-metadata": "0.1.13"
|
|
35
|
+
"reflect-metadata": "0.1.13",
|
|
36
|
+
"rettiwt-core": "2.3.0"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@types/cookiejar": "2.1.2",
|
package/src/enums/Errors.ts
CHANGED
|
@@ -17,5 +17,6 @@ export enum AuthenticationErrors {
|
|
|
17
17
|
*/
|
|
18
18
|
export enum DataErrors {
|
|
19
19
|
UserNotFound = "An account with given username/id was not found",
|
|
20
|
-
TweetNotFound = "A tweet with the given id was not found"
|
|
20
|
+
TweetNotFound = "A tweet with the given id was not found",
|
|
21
|
+
NoMatchingTweetsFound = "No tweets matching the given filter were found"
|
|
21
22
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// PACKAGE
|
|
2
2
|
import { GraphQLBoolean, GraphQLInt, GraphQLList, GraphQLObjectType, GraphQLString } from 'graphql'
|
|
3
|
+
import { TweetFilter } from 'rettiwt-core';
|
|
3
4
|
|
|
4
5
|
// TYPES
|
|
5
6
|
import { User } from '../types/UserTypes';
|
|
6
7
|
import { Tweet, TweetList } from '../types/TweetTypes';
|
|
7
|
-
import { TweetFilter } from '../../models/args/TweetFilter';
|
|
8
8
|
|
|
9
9
|
// RESOLVERS
|
|
10
10
|
import UserResolver from '../resolvers/UserResolver';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
// PACKAGE
|
|
2
|
+
import { TweetFilter } from 'rettiwt-core';
|
|
3
|
+
|
|
1
4
|
// RESOLVERS
|
|
2
5
|
import ResolverBase from './ResolverBase';
|
|
3
6
|
|
|
4
7
|
// TYPES
|
|
5
|
-
import { IDataContext } from '../../types/Rettiwt'
|
|
6
|
-
import { TweetFilter } from '../../models/args/TweetFilter';
|
|
8
|
+
import { IDataContext } from '../../types/Rettiwt';
|
|
7
9
|
import { Cursor } from '../../models/data/CursoredData';
|
|
8
10
|
import { DataErrors } from '../enums/Errors';
|
|
9
11
|
|
|
@@ -15,7 +17,7 @@ export default class TweetResolver extends ResolverBase {
|
|
|
15
17
|
super(context);
|
|
16
18
|
this.batchSize = 100;
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
|
|
19
21
|
/**
|
|
20
22
|
* @returns The details of the tweet with the given id
|
|
21
23
|
* @param id The id of the tweet which is to be fetched
|
|
@@ -33,16 +35,16 @@ export default class TweetResolver extends ResolverBase {
|
|
|
33
35
|
/**
|
|
34
36
|
* @returns The list of tweets matching the given filter
|
|
35
37
|
* @param filter The filter to be used for fetching matching tweets
|
|
36
|
-
* @param count The number of tweets to fetch, must be >=
|
|
38
|
+
* @param count The number of tweets to fetch, must be >= 20 (when no cursor if provided)
|
|
37
39
|
* @param cursor The cursor to the batch of tweets to fetch
|
|
38
40
|
*/
|
|
39
41
|
async resolveTweets(filter: TweetFilter, count: number, cursor: string): Promise<any> {
|
|
40
42
|
let tweets: any[] = []; // To store the list of tweets
|
|
41
43
|
let next: Cursor = new Cursor(cursor); // To store cursor to next batch
|
|
42
44
|
let total: number = 0; // To store the total number of tweets fetched
|
|
43
|
-
|
|
45
|
+
|
|
44
46
|
/** The batch size while fetching tweets is lower (=20), compared to other data related to a tweet (=100). */
|
|
45
|
-
let batchSize: number = 20;
|
|
47
|
+
let batchSize: number = 20;
|
|
46
48
|
|
|
47
49
|
// If required count less than batch size, setting batch size to required count
|
|
48
50
|
batchSize = (count < batchSize) ? count : batchSize;
|
|
@@ -53,7 +55,7 @@ export default class TweetResolver extends ResolverBase {
|
|
|
53
55
|
batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
|
|
54
56
|
|
|
55
57
|
// Getting the data
|
|
56
|
-
const res = await this.context.tweets.getTweets(filter, batchSize, next.value
|
|
58
|
+
const res = await this.context.tweets.getTweets(filter, batchSize, next.value).catch(error => {
|
|
57
59
|
throw this.getGraphQLError(error);
|
|
58
60
|
});
|
|
59
61
|
|
|
@@ -88,7 +90,7 @@ export default class TweetResolver extends ResolverBase {
|
|
|
88
90
|
/**
|
|
89
91
|
* @returns The list of quotes of the given tweet
|
|
90
92
|
* @param id The id of the tweet whose quotes are to be fetched
|
|
91
|
-
* @param count The number of quotes to be fetched, must be >=
|
|
93
|
+
* @param count The number of quotes to be fetched, must be >= 20 (when no cursor if provided)
|
|
92
94
|
* @param all Whether to fetch all quotes or not
|
|
93
95
|
* @param cursor The cursor to the batch of tweet quotes to fetch
|
|
94
96
|
* @param quoteCount The total number of quotes of the given tweet
|
|
@@ -122,7 +124,7 @@ export default class TweetResolver extends ResolverBase {
|
|
|
122
124
|
/**
|
|
123
125
|
* @returns The list of likers of the given tweet
|
|
124
126
|
* @param id The id of the tweet whose likers are to be fetched
|
|
125
|
-
* @param count The total number of likers to fetch, must be >= 10 (when no cursor
|
|
127
|
+
* @param count The total number of likers to fetch, must be >= 10 (when no cursor is provided)
|
|
126
128
|
* @param all Whether to fetch all the likers of the tweet
|
|
127
129
|
* @param cursor The cursor to the batch of likers to fetch
|
|
128
130
|
* @param likesCount The total number of like of the tweet
|
|
@@ -179,7 +181,7 @@ export default class TweetResolver extends ResolverBase {
|
|
|
179
181
|
/**
|
|
180
182
|
* @returns The list of retweeters of the given tweet
|
|
181
183
|
* @param id The id of the tweet whose retweeters are to be fetched
|
|
182
|
-
* @param count The total number of retweeters to fetch, must be >= 10 (when no cursor
|
|
184
|
+
* @param count The total number of retweeters to fetch, must be >= 10 (when no cursor is provided)
|
|
183
185
|
* @param all Whether to fetch all retweeters
|
|
184
186
|
* @param cursor The cursor to the batch of retweeters to fetch
|
|
185
187
|
* @param retweetsCount The total number of retweets of the
|
|
@@ -232,53 +234,4 @@ export default class TweetResolver extends ResolverBase {
|
|
|
232
234
|
|
|
233
235
|
return retweeters;
|
|
234
236
|
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* THIS IS DISABLED FOR USE FOR NOW BECAUSE TWITTER DOESN'T HAVE ANY ENDPOINT FOR FETCHING REPLIES.
|
|
238
|
-
* THE DATA THIS RETURNS IS INCONSISTENT!
|
|
239
|
-
*
|
|
240
|
-
* @returns The list of replies of the given tweet
|
|
241
|
-
* @param id The id of the tweet whose replies are to be fetched
|
|
242
|
-
* @param count The total number of replies to fetch
|
|
243
|
-
* @param all Whether to fetch list of all replies
|
|
244
|
-
* @param cursor The cursor to the batch of replies to fetch
|
|
245
|
-
* @param repliesCount The total number of replies to the target tweet
|
|
246
|
-
*/
|
|
247
|
-
/*
|
|
248
|
-
async resolveTweetReplies(id: string, count: number, all: boolean, cursor: string, repliesCount: number): Promise<any[]> {
|
|
249
|
-
let replies: any[] = []; // To store the list of replies
|
|
250
|
-
let next: Cursor = new Cursor(cursor); // To store cursor to next batch
|
|
251
|
-
let total: number = 0; // To store the total number of replies fetched
|
|
252
|
-
|
|
253
|
-
// If all replies are to be fetched
|
|
254
|
-
count = (all || count > repliesCount) ? repliesCount : count;
|
|
255
|
-
|
|
256
|
-
// Repeatedly fetching data as long as total data fetched is less than requried
|
|
257
|
-
while (total < count) {
|
|
258
|
-
// Getting the data
|
|
259
|
-
const res = await this.context.tweets.getTweetReplies(id, next.value);
|
|
260
|
-
|
|
261
|
-
// If data is available
|
|
262
|
-
if (res.list?.length) {
|
|
263
|
-
// Adding fetched replies to list of replies
|
|
264
|
-
replies = replies.concat(res.list);
|
|
265
|
-
|
|
266
|
-
// Updating total replies fetched
|
|
267
|
-
total = replies.length;
|
|
268
|
-
|
|
269
|
-
// Getting cursor to next batch
|
|
270
|
-
next = res.next as Cursor;
|
|
271
|
-
}
|
|
272
|
-
// If no more data is available
|
|
273
|
-
else {
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// Adding the cursor to the end of list of data
|
|
279
|
-
replies.push(next);
|
|
280
|
-
|
|
281
|
-
return replies;
|
|
282
|
-
}
|
|
283
|
-
*/
|
|
284
237
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// PACKAGE
|
|
2
2
|
import { GraphQLBoolean, GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLList, GraphQLUnionType, GraphQLType } from 'graphql';
|
|
3
|
+
import { TweetFilter } from 'rettiwt-core';
|
|
3
4
|
|
|
4
5
|
// TYPES
|
|
5
6
|
import { Tweet, TweetList } from './TweetTypes'
|
|
6
7
|
import { Cursor } from './Global';
|
|
7
|
-
import { TweetFilter } from '../../models/args/TweetFilter';
|
|
8
8
|
|
|
9
9
|
// RESOLVERS
|
|
10
10
|
import UserResolver from '../resolvers/UserResolver';
|
package/src/index.ts
CHANGED
|
@@ -44,19 +44,21 @@ export * from './services/util/CacheService';
|
|
|
44
44
|
export * from './services/util/FetcherService';
|
|
45
45
|
|
|
46
46
|
// Exporting types
|
|
47
|
+
export { ITweetFilter } from 'rettiwt-core';
|
|
47
48
|
export * from './types/Args';
|
|
48
49
|
export { IAuthCookie } from './types/Authentication';
|
|
49
50
|
export * from './types/Rettiwt';
|
|
50
51
|
export * from './types/Service';
|
|
51
52
|
export * from './types/Tweet';
|
|
52
53
|
export * from './types/User';
|
|
54
|
+
export { IDataValidationError } from 'rettiwt-core';
|
|
53
55
|
|
|
54
56
|
// Exporting models
|
|
55
|
-
export
|
|
57
|
+
export { TweetFilter } from 'rettiwt-core';
|
|
56
58
|
export * from './models/args/TweetListArgs';
|
|
57
59
|
export * from './models/args/UserListArgs';
|
|
58
|
-
export
|
|
60
|
+
export { AuthCookie } from './models/auth/AuthCookie';
|
|
59
61
|
export * from './models/data/CursoredData';
|
|
60
62
|
export * from './models/data/Tweet';
|
|
61
63
|
export * from './models/data/User';
|
|
62
|
-
export
|
|
64
|
+
export { DataValidationError } from 'rettiwt-core';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// PACKAGES
|
|
2
2
|
import { IsInt, IsString, IsOptional, Min, validateSync, Max, ValidateIf } from 'class-validator';
|
|
3
|
+
import { DataValidationError } from 'rettiwt-core';
|
|
3
4
|
|
|
4
5
|
// TYPES
|
|
5
6
|
import { IListArgs } from '../../types/Args';
|
|
6
|
-
import { DataValidationError } from '../errors/DataValidationError';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The arguments for fetching cursored list in TweetService.
|
|
@@ -20,7 +20,7 @@ export class TweetListArgs implements IListArgs {
|
|
|
20
20
|
@IsOptional()
|
|
21
21
|
@Max(100)
|
|
22
22
|
@ValidateIf(ob => ob.cursor.length == 0)
|
|
23
|
-
@Min(10)
|
|
23
|
+
@Min(10)
|
|
24
24
|
count: number;
|
|
25
25
|
|
|
26
26
|
/** The cursor to the batch of data to fetch. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// PACKAGES
|
|
2
2
|
import { IsInt, IsString, IsOptional, Min, validateSync, Max, ValidateIf } from 'class-validator';
|
|
3
|
+
import { DataValidationError } from 'rettiwt-core';
|
|
3
4
|
|
|
4
5
|
// TYPES
|
|
5
6
|
import { IListArgs } from '../../types/Args';
|
|
6
|
-
import { DataValidationError } from '../errors/DataValidationError';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The arguments for fetching cursored list in TweetService.
|
package/src/models/data/Tweet.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// TYPES
|
|
2
2
|
import { ITweet, ITweetEntities } from '../../types/Tweet';
|
|
3
|
-
import {
|
|
3
|
+
import { ITweet as IRawTweet, IEntities as IRawTweetEntities } from 'rettiwt-core';
|
|
4
4
|
|
|
5
5
|
// PARSERS
|
|
6
6
|
import * as Parsers from '../../services/helper/Parser';
|
|
@@ -25,7 +25,7 @@ export class TweetEntities implements ITweetEntities {
|
|
|
25
25
|
media: string[] = [];
|
|
26
26
|
|
|
27
27
|
// MEMBER METHODS
|
|
28
|
-
constructor(entities:
|
|
28
|
+
constructor(entities: IRawTweetEntities) {
|
|
29
29
|
// Extracting user mentions
|
|
30
30
|
if (entities.user_mentions) {
|
|
31
31
|
for (let user of entities.user_mentions) {
|
|
@@ -101,7 +101,7 @@ export class Tweet implements ITweet {
|
|
|
101
101
|
/**
|
|
102
102
|
* @param tweet The raw tweet data.
|
|
103
103
|
*/
|
|
104
|
-
constructor(tweet:
|
|
104
|
+
constructor(tweet: IRawTweet) {
|
|
105
105
|
this.id = tweet.rest_id;
|
|
106
106
|
this.createdAt = tweet.legacy.created_at;
|
|
107
107
|
this.tweetBy = tweet.legacy.user_id_str;
|
package/src/models/data/User.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// TYPES
|
|
2
2
|
import { IUser } from '../../types/User';
|
|
3
|
-
import {
|
|
3
|
+
import { IUser as IRawUser } from 'rettiwt-core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The details of a single user.
|
|
@@ -53,7 +53,7 @@ export class User implements IUser {
|
|
|
53
53
|
/**
|
|
54
54
|
* @param user The raw user data.
|
|
55
55
|
*/
|
|
56
|
-
constructor(user:
|
|
56
|
+
constructor(user: IRawUser) {
|
|
57
57
|
this.id = user.rest_id;
|
|
58
58
|
this.userName = user.legacy.screen_name;
|
|
59
59
|
this.fullName = user.legacy.name;
|