rettiwt-api 1.0.1

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 (156) hide show
  1. package/.dockerignore +2 -0
  2. package/.gitattributes +3 -0
  3. package/Dockerfile +9 -0
  4. package/README.md +38 -0
  5. package/dist/config/env.d.ts +5 -0
  6. package/dist/config/env.js +9 -0
  7. package/dist/config/env.js.map +1 -0
  8. package/dist/index.d.ts +10 -0
  9. package/dist/index.js +23 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/models/graphql/Global.d.ts +4 -0
  12. package/dist/models/graphql/Global.js +13 -0
  13. package/dist/models/graphql/Global.js.map +1 -0
  14. package/dist/models/graphql/TweetTypes.d.ts +6 -0
  15. package/dist/models/graphql/TweetTypes.js +156 -0
  16. package/dist/models/graphql/TweetTypes.js.map +1 -0
  17. package/dist/models/graphql/UserTypes.d.ts +3 -0
  18. package/dist/models/graphql/UserTypes.js +139 -0
  19. package/dist/models/graphql/UserTypes.js.map +1 -0
  20. package/dist/queries/RootQuery.d.ts +4 -0
  21. package/dist/queries/RootQuery.js +59 -0
  22. package/dist/queries/RootQuery.js.map +1 -0
  23. package/dist/resolvers/ResolverBase.d.ts +5 -0
  24. package/dist/resolvers/ResolverBase.js +11 -0
  25. package/dist/resolvers/ResolverBase.js.map +1 -0
  26. package/dist/resolvers/TweetResolver.d.ts +54 -0
  27. package/dist/resolvers/TweetResolver.js +328 -0
  28. package/dist/resolvers/TweetResolver.js.map +1 -0
  29. package/dist/resolvers/UserResolver.d.ts +47 -0
  30. package/dist/resolvers/UserResolver.js +302 -0
  31. package/dist/resolvers/UserResolver.js.map +1 -0
  32. package/dist/server.d.ts +1 -0
  33. package/dist/server.js +75 -0
  34. package/dist/server.js.map +1 -0
  35. package/dist/services/AuthService.d.ts +17 -0
  36. package/dist/services/AuthService.js +103 -0
  37. package/dist/services/AuthService.js.map +1 -0
  38. package/dist/services/CacheService.d.ts +25 -0
  39. package/dist/services/CacheService.js +141 -0
  40. package/dist/services/CacheService.js.map +1 -0
  41. package/dist/services/FetcherService.d.ts +30 -0
  42. package/dist/services/FetcherService.js +171 -0
  43. package/dist/services/FetcherService.js.map +1 -0
  44. package/dist/services/data/TweetService.d.ts +43 -0
  45. package/dist/services/data/TweetService.js +229 -0
  46. package/dist/services/data/TweetService.js.map +1 -0
  47. package/dist/services/data/UserAccountService.d.ts +49 -0
  48. package/dist/services/data/UserAccountService.js +250 -0
  49. package/dist/services/data/UserAccountService.js.map +1 -0
  50. package/dist/services/helper/Deserializers.d.ts +19 -0
  51. package/dist/services/helper/Deserializers.js +115 -0
  52. package/dist/services/helper/Deserializers.js.map +1 -0
  53. package/dist/services/helper/Extractors.d.ts +101 -0
  54. package/dist/services/helper/Extractors.js +409 -0
  55. package/dist/services/helper/Extractors.js.map +1 -0
  56. package/dist/services/helper/Headers.d.ts +9 -0
  57. package/dist/services/helper/Headers.js +47 -0
  58. package/dist/services/helper/Headers.js.map +1 -0
  59. package/dist/services/helper/Parser.d.ts +28 -0
  60. package/dist/services/helper/Parser.js +104 -0
  61. package/dist/services/helper/Parser.js.map +1 -0
  62. package/dist/services/helper/Urls.d.ts +74 -0
  63. package/dist/services/helper/Urls.js +114 -0
  64. package/dist/services/helper/Urls.js.map +1 -0
  65. package/dist/test/Test.js +2 -0
  66. package/dist/test/Test.js.map +1 -0
  67. package/dist/types/Authentication.d.ts +15 -0
  68. package/dist/types/Authentication.js +5 -0
  69. package/dist/types/Authentication.js.map +1 -0
  70. package/dist/types/HTTP.d.ts +22 -0
  71. package/dist/types/HTTP.js +30 -0
  72. package/dist/types/HTTP.js.map +1 -0
  73. package/dist/types/Service.d.ts +27 -0
  74. package/dist/types/Service.js +19 -0
  75. package/dist/types/Service.js.map +1 -0
  76. package/dist/types/Tweet.d.ts +40 -0
  77. package/dist/types/Tweet.js +5 -0
  78. package/dist/types/Tweet.js.map +1 -0
  79. package/dist/types/UserAccount.d.ts +19 -0
  80. package/dist/types/UserAccount.js +4 -0
  81. package/dist/types/UserAccount.js.map +1 -0
  82. package/dist/types/graphql/Errors.d.ts +15 -0
  83. package/dist/types/graphql/Errors.js +23 -0
  84. package/dist/types/graphql/Errors.js.map +1 -0
  85. package/dist/types/raw/auth/Cookie.d.ts +16 -0
  86. package/dist/types/raw/auth/Cookie.js +3 -0
  87. package/dist/types/raw/auth/Cookie.js.map +1 -0
  88. package/dist/types/raw/tweet/Favouriters.d.ts +164 -0
  89. package/dist/types/raw/tweet/Favouriters.js +3 -0
  90. package/dist/types/raw/tweet/Favouriters.js.map +1 -0
  91. package/dist/types/raw/tweet/Retweeters.d.ts +171 -0
  92. package/dist/types/raw/tweet/Retweeters.js +3 -0
  93. package/dist/types/raw/tweet/Retweeters.js.map +1 -0
  94. package/dist/types/raw/tweet/Tweet.d.ts +746 -0
  95. package/dist/types/raw/tweet/Tweet.js +3 -0
  96. package/dist/types/raw/tweet/Tweet.js.map +1 -0
  97. package/dist/types/raw/tweet/Tweets.d.ts +386 -0
  98. package/dist/types/raw/tweet/Tweets.js +3 -0
  99. package/dist/types/raw/tweet/Tweets.js.map +1 -0
  100. package/dist/types/raw/user/Followers.d.ts +176 -0
  101. package/dist/types/raw/user/Followers.js +3 -0
  102. package/dist/types/raw/user/Followers.js.map +1 -0
  103. package/dist/types/raw/user/Following.d.ts +176 -0
  104. package/dist/types/raw/user/Following.js +3 -0
  105. package/dist/types/raw/user/Following.js.map +1 -0
  106. package/dist/types/raw/user/Likes.d.ts +1059 -0
  107. package/dist/types/raw/user/Likes.js +3 -0
  108. package/dist/types/raw/user/Likes.js.map +1 -0
  109. package/dist/types/raw/user/Tweets.d.ts +2428 -0
  110. package/dist/types/raw/user/Tweets.js +3 -0
  111. package/dist/types/raw/user/Tweets.js.map +1 -0
  112. package/dist/types/raw/user/User.d.ts +117 -0
  113. package/dist/types/raw/user/User.js +3 -0
  114. package/dist/types/raw/user/User.js.map +1 -0
  115. package/dist/types/raw/user/Users.d.ts +120 -0
  116. package/dist/types/raw/user/Users.js +3 -0
  117. package/dist/types/raw/user/Users.js.map +1 -0
  118. package/environment.d.ts +11 -0
  119. package/package.json +40 -0
  120. package/src/config/env.ts +5 -0
  121. package/src/index.ts +19 -0
  122. package/src/models/graphql/Global.ts +10 -0
  123. package/src/models/graphql/TweetTypes.ts +154 -0
  124. package/src/models/graphql/UserTypes.ts +137 -0
  125. package/src/queries/RootQuery.ts +56 -0
  126. package/src/resolvers/ResolverBase.ts +12 -0
  127. package/src/resolvers/TweetResolver.ts +257 -0
  128. package/src/resolvers/UserResolver.ts +239 -0
  129. package/src/server.ts +36 -0
  130. package/src/services/AuthService.ts +58 -0
  131. package/src/services/CacheService.ts +70 -0
  132. package/src/services/FetcherService.ts +84 -0
  133. package/src/services/data/TweetService.ts +163 -0
  134. package/src/services/data/UserAccountService.ts +187 -0
  135. package/src/services/helper/Deserializers.ts +95 -0
  136. package/src/services/helper/Extractors.ts +455 -0
  137. package/src/services/helper/Headers.ts +45 -0
  138. package/src/services/helper/Parser.ts +108 -0
  139. package/src/services/helper/Urls.ts +109 -0
  140. package/src/types/Authentication.ts +16 -0
  141. package/src/types/HTTP.ts +23 -0
  142. package/src/types/Service.ts +36 -0
  143. package/src/types/Tweet.ts +44 -0
  144. package/src/types/UserAccount.ts +21 -0
  145. package/src/types/graphql/Errors.ts +16 -0
  146. package/src/types/raw/auth/Cookie.ts +16 -0
  147. package/src/types/raw/tweet/Favouriters.ts +193 -0
  148. package/src/types/raw/tweet/Retweeters.ts +201 -0
  149. package/src/types/raw/tweet/Tweet.ts +882 -0
  150. package/src/types/raw/tweet/Tweets.ts +444 -0
  151. package/src/types/raw/user/Followers.ts +208 -0
  152. package/src/types/raw/user/Following.ts +208 -0
  153. package/src/types/raw/user/Likes.ts +1247 -0
  154. package/src/types/raw/user/Tweets.ts +2847 -0
  155. package/src/types/raw/user/User.ts +135 -0
  156. package/tsconfig.json +95 -0
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ var __importDefault = (this && this.__importDefault) || function (mod) {
54
+ return (mod && mod.__esModule) ? mod : { "default": mod };
55
+ };
56
+ exports.__esModule = true;
57
+ // RESOLVERS
58
+ var ResolverBase_1 = __importDefault(require("./ResolverBase"));
59
+ var Service_1 = require("../types/Service");
60
+ // HELPERS
61
+ var Errors_1 = require("../types/graphql/Errors");
62
+ var TweetResolver = /** @class */ (function (_super) {
63
+ __extends(TweetResolver, _super);
64
+ // MEMBER METHODS
65
+ function TweetResolver(context) {
66
+ return _super.call(this, context) || this;
67
+ }
68
+ /**
69
+ * @returns The details of the tweet with the given id
70
+ * @param id The id of the tweet which is to be fetched
71
+ */
72
+ TweetResolver.prototype.resolveTweet = function (id) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ var res;
75
+ return __generator(this, function (_a) {
76
+ switch (_a.label) {
77
+ case 0: return [4 /*yield*/, this.context.tweets.getTweetById(id)];
78
+ case 1:
79
+ res = _a.sent();
80
+ // Evaluating response
81
+ return [2 /*return*/, res];
82
+ }
83
+ });
84
+ });
85
+ };
86
+ /**
87
+ * @returns The list of tweets matching the given filter
88
+ * @param filter The filter to be used for fetching matching tweets
89
+ * @param count The number of tweets to fetch
90
+ * @param cursor The cursor to the batch of tweets to fetch
91
+ */
92
+ TweetResolver.prototype.resolveTweets = function (filter, count, cursor) {
93
+ return __awaiter(this, void 0, void 0, function () {
94
+ var tweets, next, total, batchSize, res;
95
+ return __generator(this, function (_a) {
96
+ switch (_a.label) {
97
+ case 0:
98
+ tweets = [];
99
+ next = new Service_1.Cursor(cursor);
100
+ total = 0;
101
+ batchSize = 20;
102
+ // Checking if the given tweet filter is valid or not
103
+ if (!(filter.fromUsers || filter.toUsers || filter.words || filter.hashtags || filter.mentions || filter.quoted)) {
104
+ throw new Error(Errors_1.ValidationErrors.InvalidTweetFilter);
105
+ }
106
+ // If required count less than batch size, setting batch size to required count
107
+ batchSize = (count < batchSize) ? count : batchSize;
108
+ _a.label = 1;
109
+ case 1:
110
+ if (!(total < count)) return [3 /*break*/, 3];
111
+ // If this is the last batch, change batch size to number of remaining tweets
112
+ batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
113
+ return [4 /*yield*/, this.context.tweets.getTweets(filter, count, next.value)];
114
+ case 2:
115
+ res = _a.sent();
116
+ // If data is available
117
+ if (res.list.length) {
118
+ // Adding fetched tweets to list of tweets
119
+ tweets = tweets.concat(res.list);
120
+ // Updating total tweets fetched
121
+ total = tweets.length;
122
+ // Getting cursor to next batch
123
+ next = res.next;
124
+ }
125
+ // If no more data is available
126
+ else {
127
+ return [3 /*break*/, 3];
128
+ }
129
+ return [3 /*break*/, 1];
130
+ case 3:
131
+ // Adding the cursor to the end of list of data
132
+ tweets.push(next);
133
+ return [2 /*return*/, tweets];
134
+ }
135
+ });
136
+ });
137
+ };
138
+ /**
139
+ * @returns The list of quotes of the given tweet
140
+ * @param id The id of the tweet whose quotes are to be fetched
141
+ * @param count The number of quotes to be fetched
142
+ * @param all Whether to fetch all quotes or not
143
+ * @param cursor The cursor to the batch of tweet quotes to fetch
144
+ * @param quoteCount The total number of quotes of the given tweet
145
+ */
146
+ TweetResolver.prototype.resolveTweetQuotes = function (id, count, all, cursor, quoteCount) {
147
+ return __awaiter(this, void 0, void 0, function () {
148
+ var quotes, filter;
149
+ return __generator(this, function (_a) {
150
+ switch (_a.label) {
151
+ case 0:
152
+ quotes = [];
153
+ // If all tweets are to be fetched
154
+ count = (all || count > quoteCount) ? quoteCount : count;
155
+ filter = {
156
+ words: [],
157
+ hashtags: [],
158
+ fromUsers: [],
159
+ toUsers: [],
160
+ mentions: [],
161
+ startDate: '',
162
+ endDate: '',
163
+ quoted: id
164
+ };
165
+ return [4 /*yield*/, this.resolveTweets(filter, count, cursor)];
166
+ case 1:
167
+ // Fetching the quotes using resolveTweets method
168
+ quotes = _a.sent();
169
+ return [2 /*return*/, quotes];
170
+ }
171
+ });
172
+ });
173
+ };
174
+ /**
175
+ * @returns The list of likers of the given tweet
176
+ * @param id The id of the tweet whose likers are to be fetched
177
+ * @param count The total number of likers to fetch
178
+ * @param all Whether to fetch all the likers of the tweet
179
+ * @param cursor The cursor to the batch of likers to fetch
180
+ * @param likesCount The total number of like of the tweet
181
+ */
182
+ TweetResolver.prototype.resolveTweetLikers = function (id, count, all, cursor, likesCount) {
183
+ return __awaiter(this, void 0, void 0, function () {
184
+ var likers, next, total, batchSize, res;
185
+ return __generator(this, function (_a) {
186
+ switch (_a.label) {
187
+ case 0:
188
+ likers = [];
189
+ next = new Service_1.Cursor(cursor);
190
+ total = 0;
191
+ batchSize = 20;
192
+ // If all likers are to be fetched
193
+ count = (all || count > likesCount) ? likesCount : count;
194
+ // If required count less than batch size, setting batch size to required count
195
+ batchSize = (count < batchSize) ? count : batchSize;
196
+ _a.label = 1;
197
+ case 1:
198
+ if (!(total < count)) return [3 /*break*/, 3];
199
+ // If this is the last batch, change batch size to number of remaining likers
200
+ batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
201
+ return [4 /*yield*/, this.context.tweets.getTweetLikers(id, count, next.value)];
202
+ case 2:
203
+ res = _a.sent();
204
+ // If data is available
205
+ if (res.list.length) {
206
+ // Adding fetched likers to list of likers
207
+ likers = likers.concat(res.list);
208
+ // Updating total likers fetched
209
+ total = likers.length;
210
+ // Getting cursor to next batch
211
+ next = res.next;
212
+ }
213
+ // If no more data is available
214
+ else {
215
+ return [3 /*break*/, 3];
216
+ }
217
+ return [3 /*break*/, 1];
218
+ case 3:
219
+ // Adding the cursor to the end of list of data
220
+ likers.push(next);
221
+ return [2 /*return*/, likers];
222
+ }
223
+ });
224
+ });
225
+ };
226
+ /**
227
+ * @returns The list of retweeters of the given tweet
228
+ * @param id The id of the tweet whose retweeters are to be fetched
229
+ * @param count The total number of retweeters to fetch
230
+ * @param all Whether to fetch all retweeters
231
+ * @param cursor The cursor to the batch of retweeters to fetch
232
+ * @param retweetsCount The total number of retweets of the
233
+ */
234
+ TweetResolver.prototype.resolveTweetRetweeters = function (id, count, all, cursor, retweetsCount) {
235
+ return __awaiter(this, void 0, void 0, function () {
236
+ var retweeters, next, total, batchSize, res;
237
+ return __generator(this, function (_a) {
238
+ switch (_a.label) {
239
+ case 0:
240
+ retweeters = [];
241
+ next = new Service_1.Cursor(cursor);
242
+ total = 0;
243
+ batchSize = 20;
244
+ // If all retweeters are to be fetched
245
+ count = (all || count > retweetsCount) ? retweetsCount : count;
246
+ // If required count less than batch size, setting batch size to required count
247
+ batchSize = (count < batchSize) ? count : batchSize;
248
+ _a.label = 1;
249
+ case 1:
250
+ if (!(total < count)) return [3 /*break*/, 3];
251
+ // If this is the last batch, change batch size to number of remaining retweeters
252
+ batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
253
+ return [4 /*yield*/, this.context.tweets.getTweetRetweeters(id, count, next.value)];
254
+ case 2:
255
+ res = _a.sent();
256
+ // If data is available
257
+ if (res.list.length) {
258
+ // Adding fetched retweeters to list of retweeters
259
+ retweeters = retweeters.concat(res.list);
260
+ // Updating total retweeters fetched
261
+ total = retweeters.length;
262
+ // Getting cursor to next batch
263
+ next = res.next;
264
+ }
265
+ // If no more data is available
266
+ else {
267
+ return [3 /*break*/, 3];
268
+ }
269
+ return [3 /*break*/, 1];
270
+ case 3:
271
+ // Adding the cursor to the end of list of data
272
+ retweeters.push(next);
273
+ return [2 /*return*/, retweeters];
274
+ }
275
+ });
276
+ });
277
+ };
278
+ /**
279
+ * @returns The list of replies of the given tweet
280
+ * @param id The id of the tweet whose replies are to be fetched
281
+ * @param count The total number of replies to fetch
282
+ * @param all Whether to fetch list of all replies
283
+ * @param cursor The cursor to the batch of replies to fetch
284
+ * @param repliesCount The total number of replies to the target tweet
285
+ */
286
+ TweetResolver.prototype.resolveTweetReplies = function (id, count, all, cursor, repliesCount) {
287
+ return __awaiter(this, void 0, void 0, function () {
288
+ var replies, next, total, res;
289
+ return __generator(this, function (_a) {
290
+ switch (_a.label) {
291
+ case 0:
292
+ replies = [];
293
+ next = new Service_1.Cursor(cursor);
294
+ total = 0;
295
+ // If all replies are to be fetched
296
+ count = (all || count > repliesCount) ? repliesCount : count;
297
+ _a.label = 1;
298
+ case 1:
299
+ if (!(total < count)) return [3 /*break*/, 3];
300
+ return [4 /*yield*/, this.context.tweets.getTweetReplies(id, next.value)];
301
+ case 2:
302
+ res = _a.sent();
303
+ // If data is available
304
+ if (res.list.length) {
305
+ // Adding fetched replies to list of replies
306
+ replies = replies.concat(res.list);
307
+ // Updating total replies fetched
308
+ total = replies.length;
309
+ // Getting cursor to next batch
310
+ next = res.next;
311
+ }
312
+ // If no more data is available
313
+ else {
314
+ return [3 /*break*/, 3];
315
+ }
316
+ return [3 /*break*/, 1];
317
+ case 3:
318
+ // Adding the cursor to the end of list of data
319
+ replies.push(next);
320
+ return [2 /*return*/, replies];
321
+ }
322
+ });
323
+ });
324
+ };
325
+ return TweetResolver;
326
+ }(ResolverBase_1["default"]));
327
+ exports["default"] = TweetResolver;
328
+ //# sourceMappingURL=TweetResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TweetResolver.js","sourceRoot":"","sources":["../../src/resolvers/TweetResolver.ts"],"names":[],"mappings":";;;;;;;;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olverBase from './ResolverBase';
2
+ import { DataContext } from '../types/Service';
3
+ export default class UserResolver extends ResolverBase {
4
+ constructor(context: DataContext);
5
+ /**
6
+ * @returns The details of the target twitter user
7
+ * @param userName The user name of the target twitter user
8
+ * @param id The id of the target twitter user
9
+ */
10
+ resolveUserDetails(userName: string, id: string): Promise<any>;
11
+ /**
12
+ * @returns The list of tweets liked by the given user
13
+ * @param id The id of the user whose likes are to be fetched
14
+ * @param count The number of likes to fetch
15
+ * @param all Whether to fetch list of all tweets liked by user
16
+ * @param cursor The cursor to the batch of likes to fetch
17
+ * @param favouritesCount The total number of tweets liked by target user
18
+ */
19
+ resolveUserLikes(id: string, count: number, all: boolean, cursor: string, favouritesCount: number): Promise<any>;
20
+ /**
21
+ * @returns The list of followers of the given twiiter user
22
+ * @param id The id of the user whose followers are to be fetched
23
+ * @param count The number of followers to fetch
24
+ * @param all Whether to fetch all followers list
25
+ * @param cursor The cursor to the batch of followers to fetch
26
+ * @param followerCount The total number of followers of the target user
27
+ */
28
+ resolveUserFollowers(id: string, count: number, all: boolean, cursor: string, followersCount: number): Promise<any>;
29
+ /**
30
+ * @returns The list of following of the given twiiter user
31
+ * @param id The id of the user whose followings are to be fetched
32
+ * @param count The number of following to fetch
33
+ * @param all Whether to fetch list of all followings
34
+ * @param cursor The cursor to the batch of followings to fetch
35
+ * @param followingsCount The total number of followings of the target user
36
+ */
37
+ resolveUserFollowing(id: string, count: number, all: boolean, cursor: string, followingsCount: number): Promise<any>;
38
+ /**
39
+ * @returns The list of tweets made by the given user
40
+ * @param id The id of the user whose tweets are to be fetched
41
+ * @param count The number of tweets to fetch
42
+ * @param all Whether to fetch list of all tweets made by user
43
+ * @param cursor The cursor to the batch of tweets to fetch
44
+ * @param statusesCount The total number of tweets made by target user
45
+ */
46
+ resolveUserTweets(id: string, count: number, all: boolean, cursor: string, statusesCount: number): Promise<any>;
47
+ }