rettiwt-api 1.4.0 → 2.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 (232) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.js +54 -0
  3. package/.github/workflows/documentation.yml +29 -9
  4. package/.github/workflows/publish.yml +8 -3
  5. package/.prettierignore +3 -0
  6. package/.prettierrc +13 -0
  7. package/README.md +59 -61
  8. package/dist/Rettiwt.d.ts +19 -0
  9. package/dist/Rettiwt.js +30 -0
  10. package/dist/Rettiwt.js.map +1 -0
  11. package/dist/enums/ApiErrors.d.ts +30 -0
  12. package/dist/enums/ApiErrors.js +35 -0
  13. package/dist/enums/ApiErrors.js.map +1 -0
  14. package/dist/enums/HTTP.d.ts +11 -11
  15. package/dist/enums/HTTP.js +15 -16
  16. package/dist/enums/HTTP.js.map +1 -1
  17. package/dist/helper/JsonUtils.d.ts +26 -0
  18. package/dist/helper/JsonUtils.js +88 -0
  19. package/dist/helper/JsonUtils.js.map +1 -0
  20. package/dist/index.d.ts +10 -43
  21. package/dist/index.js +16 -55
  22. package/dist/index.js.map +1 -1
  23. package/dist/models/CursoredData.d.ts +37 -0
  24. package/dist/models/CursoredData.js +59 -0
  25. package/dist/models/CursoredData.js.map +1 -0
  26. package/dist/models/{data/Tweet.d.ts → Tweet.d.ts} +4 -4
  27. package/dist/models/{data/Tweet.js → Tweet.js} +7 -32
  28. package/dist/models/Tweet.js.map +1 -0
  29. package/dist/models/{data/User.d.ts → User.d.ts} +3 -3
  30. package/dist/models/{data/User.js → User.js} +3 -3
  31. package/dist/models/User.js.map +1 -0
  32. package/dist/services/FetcherService.d.ts +66 -0
  33. package/dist/services/FetcherService.js +209 -0
  34. package/dist/services/FetcherService.js.map +1 -0
  35. package/dist/services/TweetService.d.ts +88 -0
  36. package/dist/services/TweetService.js +244 -0
  37. package/dist/services/TweetService.js.map +1 -0
  38. package/dist/services/UserService.d.ts +60 -0
  39. package/dist/services/UserService.js +188 -0
  40. package/dist/services/UserService.js.map +1 -0
  41. package/dist/types/{Service.d.ts → CursoredData.d.ts} +3 -3
  42. package/dist/types/CursoredData.js +3 -0
  43. package/dist/types/CursoredData.js.map +1 -0
  44. package/dist/types/Tweet.js +1 -1
  45. package/dist/types/User.js +1 -1
  46. package/package.json +15 -19
  47. package/src/Rettiwt.ts +33 -0
  48. package/src/enums/ApiErrors.ts +30 -0
  49. package/src/enums/HTTP.ts +12 -12
  50. package/src/helper/JsonUtils.ts +86 -0
  51. package/src/index.ts +14 -57
  52. package/src/models/CursoredData.ts +64 -0
  53. package/src/models/Tweet.ts +116 -0
  54. package/src/models/User.ts +72 -0
  55. package/src/services/FetcherService.ts +186 -0
  56. package/src/services/TweetService.ts +153 -0
  57. package/src/services/UserService.ts +117 -0
  58. package/src/types/CursoredData.ts +24 -0
  59. package/src/types/Tweet.ts +35 -35
  60. package/src/types/User.ts +30 -30
  61. package/tsconfig.json +9 -9
  62. package/dist/config/env.d.ts +0 -5
  63. package/dist/config/env.js +0 -9
  64. package/dist/config/env.js.map +0 -1
  65. package/dist/enums/Errors.d.ts +0 -21
  66. package/dist/enums/Errors.js +0 -29
  67. package/dist/enums/Errors.js.map +0 -1
  68. package/dist/graphql/enums/Errors.d.ts +0 -21
  69. package/dist/graphql/enums/Errors.js +0 -29
  70. package/dist/graphql/enums/Errors.js.map +0 -1
  71. package/dist/graphql/queries/RootQuery.d.ts +0 -4
  72. package/dist/graphql/queries/RootQuery.js +0 -83
  73. package/dist/graphql/queries/RootQuery.js.map +0 -1
  74. package/dist/graphql/resolvers/AccountResolver.d.ts +0 -12
  75. package/dist/graphql/resolvers/AccountResolver.js +0 -84
  76. package/dist/graphql/resolvers/AccountResolver.js.map +0 -1
  77. package/dist/graphql/resolvers/ResolverBase.d.ts +0 -16
  78. package/dist/graphql/resolvers/ResolverBase.js +0 -23
  79. package/dist/graphql/resolvers/ResolverBase.js.map +0 -1
  80. package/dist/graphql/resolvers/TweetResolver.d.ts +0 -46
  81. package/dist/graphql/resolvers/TweetResolver.js +0 -302
  82. package/dist/graphql/resolvers/TweetResolver.js.map +0 -1
  83. package/dist/graphql/resolvers/UserResolver.d.ts +0 -48
  84. package/dist/graphql/resolvers/UserResolver.js +0 -334
  85. package/dist/graphql/resolvers/UserResolver.js.map +0 -1
  86. package/dist/graphql/types/Global.d.ts +0 -4
  87. package/dist/graphql/types/Global.js +0 -13
  88. package/dist/graphql/types/Global.js.map +0 -1
  89. package/dist/graphql/types/TweetTypes.d.ts +0 -4
  90. package/dist/graphql/types/TweetTypes.js +0 -160
  91. package/dist/graphql/types/TweetTypes.js.map +0 -1
  92. package/dist/graphql/types/UserTypes.d.ts +0 -3
  93. package/dist/graphql/types/UserTypes.js +0 -137
  94. package/dist/graphql/types/UserTypes.js.map +0 -1
  95. package/dist/models/args/TweetListArgs.d.ts +0 -21
  96. package/dist/models/args/TweetListArgs.js +0 -54
  97. package/dist/models/args/TweetListArgs.js.map +0 -1
  98. package/dist/models/args/UserListArgs.d.ts +0 -21
  99. package/dist/models/args/UserListArgs.js +0 -54
  100. package/dist/models/args/UserListArgs.js.map +0 -1
  101. package/dist/models/auth/AuthCookie.d.ts +0 -21
  102. package/dist/models/auth/AuthCookie.js +0 -33
  103. package/dist/models/auth/AuthCookie.js.map +0 -1
  104. package/dist/models/data/CursoredData.d.ts +0 -34
  105. package/dist/models/data/CursoredData.js +0 -42
  106. package/dist/models/data/CursoredData.js.map +0 -1
  107. package/dist/models/data/Tweet.js.map +0 -1
  108. package/dist/models/data/User.js.map +0 -1
  109. package/dist/server.d.ts +0 -1
  110. package/dist/server.js +0 -76
  111. package/dist/server.js.map +0 -1
  112. package/dist/services/auth/AccountService.d.ts +0 -83
  113. package/dist/services/auth/AccountService.js +0 -412
  114. package/dist/services/auth/AccountService.js.map +0 -1
  115. package/dist/services/auth/AuthService.d.ts +0 -31
  116. package/dist/services/auth/AuthService.js +0 -118
  117. package/dist/services/auth/AuthService.js.map +0 -1
  118. package/dist/services/data/TweetService.d.ts +0 -60
  119. package/dist/services/data/TweetService.js +0 -250
  120. package/dist/services/data/TweetService.js.map +0 -1
  121. package/dist/services/data/UserService.d.ts +0 -71
  122. package/dist/services/data/UserService.js +0 -278
  123. package/dist/services/data/UserService.js.map +0 -1
  124. package/dist/services/helper/Headers.d.ts +0 -19
  125. package/dist/services/helper/Headers.js +0 -62
  126. package/dist/services/helper/Headers.js.map +0 -1
  127. package/dist/services/helper/Parser.d.ts +0 -22
  128. package/dist/services/helper/Parser.js +0 -84
  129. package/dist/services/helper/Parser.js.map +0 -1
  130. package/dist/services/helper/extractors/Tweets.d.ts +0 -23
  131. package/dist/services/helper/extractors/Tweets.js +0 -200
  132. package/dist/services/helper/extractors/Tweets.js.map +0 -1
  133. package/dist/services/helper/extractors/Users.d.ts +0 -17
  134. package/dist/services/helper/extractors/Users.js +0 -151
  135. package/dist/services/helper/extractors/Users.js.map +0 -1
  136. package/dist/services/helper/payloads/LoginFlows.d.ts +0 -77
  137. package/dist/services/helper/payloads/LoginFlows.js +0 -92
  138. package/dist/services/helper/payloads/LoginFlows.js.map +0 -1
  139. package/dist/services/helper/urls/Authentication.d.ts +0 -4
  140. package/dist/services/helper/urls/Authentication.js +0 -11
  141. package/dist/services/helper/urls/Authentication.js.map +0 -1
  142. package/dist/services/util/CacheService.d.ts +0 -33
  143. package/dist/services/util/CacheService.js +0 -96
  144. package/dist/services/util/CacheService.js.map +0 -1
  145. package/dist/services/util/FetcherService.d.ts +0 -65
  146. package/dist/services/util/FetcherService.js +0 -202
  147. package/dist/services/util/FetcherService.js.map +0 -1
  148. package/dist/types/Args.d.ts +0 -11
  149. package/dist/types/Args.js +0 -4
  150. package/dist/types/Args.js.map +0 -1
  151. package/dist/types/Authentication.d.ts +0 -55
  152. package/dist/types/Authentication.js +0 -6
  153. package/dist/types/Authentication.js.map +0 -1
  154. package/dist/types/Resolvers.d.ts +0 -15
  155. package/dist/types/Resolvers.js +0 -3
  156. package/dist/types/Resolvers.js.map +0 -1
  157. package/dist/types/Rettiwt.d.ts +0 -16
  158. package/dist/types/Rettiwt.js +0 -3
  159. package/dist/types/Rettiwt.js.map +0 -1
  160. package/dist/types/Service.js +0 -5
  161. package/dist/types/Service.js.map +0 -1
  162. package/docs/.nojekyll +0 -1
  163. package/docs/assets/highlight.css +0 -64
  164. package/docs/assets/main.js +0 -58
  165. package/docs/assets/search.js +0 -1
  166. package/docs/assets/style.css +0 -1280
  167. package/docs/classes/AccountService.html +0 -286
  168. package/docs/classes/AuthCookie.html +0 -146
  169. package/docs/classes/AuthService.html +0 -147
  170. package/docs/classes/CacheService.html +0 -157
  171. package/docs/classes/Cursor.html +0 -102
  172. package/docs/classes/CursoredData.html +0 -126
  173. package/docs/classes/DataValidationError.html +0 -120
  174. package/docs/classes/FetcherService.html +0 -225
  175. package/docs/classes/Tweet.html +0 -210
  176. package/docs/classes/TweetEntities.html +0 -128
  177. package/docs/classes/TweetFilter.html +0 -233
  178. package/docs/classes/TweetListArgs.html +0 -118
  179. package/docs/classes/TweetService.html +0 -319
  180. package/docs/classes/User.html +0 -230
  181. package/docs/classes/UserListArgs.html +0 -118
  182. package/docs/classes/UserService.html +0 -355
  183. package/docs/enums/HttpMethods.html +0 -74
  184. package/docs/functions/Rettiwt.html +0 -100
  185. package/docs/index.html +0 -159
  186. package/docs/interfaces/IAuthCookie.html +0 -104
  187. package/docs/interfaces/ICursor.html +0 -77
  188. package/docs/interfaces/ICursoredData.html +0 -93
  189. package/docs/interfaces/IDataContext.html +0 -91
  190. package/docs/interfaces/IDataValidationError.html +0 -109
  191. package/docs/interfaces/IListArgs.html +0 -87
  192. package/docs/interfaces/ITweet.html +0 -176
  193. package/docs/interfaces/ITweetEntities.html +0 -104
  194. package/docs/interfaces/ITweetFilter.html +0 -158
  195. package/docs/interfaces/IUser.html +0 -194
  196. package/docs/modules.html +0 -111
  197. package/environment.d.ts +0 -11
  198. package/src/config/env.ts +0 -5
  199. package/src/enums/Errors.ts +0 -22
  200. package/src/graphql/enums/Errors.ts +0 -22
  201. package/src/graphql/queries/RootQuery.ts +0 -81
  202. package/src/graphql/resolvers/AccountResolver.ts +0 -22
  203. package/src/graphql/resolvers/ResolverBase.ts +0 -26
  204. package/src/graphql/resolvers/TweetResolver.ts +0 -225
  205. package/src/graphql/resolvers/UserResolver.ts +0 -257
  206. package/src/graphql/types/Global.ts +0 -10
  207. package/src/graphql/types/TweetTypes.ts +0 -158
  208. package/src/graphql/types/UserTypes.ts +0 -134
  209. package/src/models/args/TweetListArgs.ts +0 -47
  210. package/src/models/args/UserListArgs.ts +0 -47
  211. package/src/models/auth/AuthCookie.ts +0 -43
  212. package/src/models/data/CursoredData.ts +0 -45
  213. package/src/models/data/Tweet.ts +0 -118
  214. package/src/models/data/User.ts +0 -72
  215. package/src/server.ts +0 -37
  216. package/src/services/auth/AccountService.ts +0 -283
  217. package/src/services/auth/AuthService.ts +0 -81
  218. package/src/services/data/TweetService.ts +0 -197
  219. package/src/services/data/UserService.ts +0 -221
  220. package/src/services/helper/Headers.ts +0 -60
  221. package/src/services/helper/Parser.ts +0 -89
  222. package/src/services/helper/extractors/Tweets.ts +0 -190
  223. package/src/services/helper/extractors/Users.ts +0 -141
  224. package/src/services/helper/payloads/LoginFlows.ts +0 -90
  225. package/src/services/helper/urls/Authentication.ts +0 -6
  226. package/src/services/util/CacheService.ts +0 -76
  227. package/src/services/util/FetcherService.ts +0 -143
  228. package/src/types/Args.ts +0 -12
  229. package/src/types/Authentication.ts +0 -63
  230. package/src/types/Resolvers.ts +0 -18
  231. package/src/types/Rettiwt.ts +0 -20
  232. package/src/types/Service.ts +0 -24
@@ -1,334 +0,0 @@
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 CursoredData_1 = require("../../models/data/CursoredData");
60
- var Errors_1 = require("../enums/Errors");
61
- var UserResolver = /** @class */ (function (_super) {
62
- __extends(UserResolver, _super);
63
- // MEMBER METHODS
64
- function UserResolver(context) {
65
- var _this = _super.call(this, context) || this;
66
- _this.batchSize = 40;
67
- return _this;
68
- }
69
- /**
70
- * @returns The details of the target twitter user
71
- * @param userName The user name of the target twitter user
72
- * @param id The id/username of the target twitter user
73
- */
74
- UserResolver.prototype.resolveUserDetails = function (id) {
75
- return __awaiter(this, void 0, void 0, function () {
76
- var _this = this;
77
- return __generator(this, function (_a) {
78
- switch (_a.label) {
79
- case 0: return [4 /*yield*/, this.context.users.getUserDetails(id)["catch"](function (error) {
80
- throw _this.getGraphQLError(error);
81
- })];
82
- case 1: return [2 /*return*/, _a.sent()];
83
- }
84
- });
85
- });
86
- };
87
- /**
88
- * @returns The list of tweets made by the given user
89
- * @param userName The username of the user whose tweets are to be fetched
90
- * @param count The number of tweets to fetch, must be >= 10
91
- * @param all Whether to fetch list of all tweets made by user
92
- * @param cursor The cursor to the batch of tweets to fetch
93
- * @param statusesCount The total number of tweets made by target user
94
- */
95
- UserResolver.prototype.resolveUserTweets = function (userName, count, all, cursor, statusesCount) {
96
- var _a;
97
- return __awaiter(this, void 0, void 0, function () {
98
- var likes, next, total, res;
99
- var _this = this;
100
- return __generator(this, function (_b) {
101
- switch (_b.label) {
102
- case 0:
103
- likes = [];
104
- next = new CursoredData_1.Cursor(cursor);
105
- total = 0;
106
- // If all tweets are to be fetched
107
- count = all ? statusesCount : count;
108
- // If required count less than batch size, setting batch size to required count
109
- this.batchSize = (count < this.batchSize) ? count : this.batchSize;
110
- _b.label = 1;
111
- case 1:
112
- // If this is the last batch, change batch size to number of remaining tweets
113
- this.batchSize = ((count - total) < this.batchSize) ? (count - total) : this.batchSize;
114
- return [4 /*yield*/, this.context.tweets.getTweets({ fromUsers: [userName] }, this.batchSize, next.value)["catch"](function (error) {
115
- throw _this.getGraphQLError(error);
116
- })];
117
- case 2:
118
- res = _b.sent();
119
- // If data is available
120
- if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
121
- // Adding fetched tweets to list of tweets
122
- likes = likes.concat(res.list);
123
- // Updating total tweets fetched
124
- total = likes.length;
125
- // Getting cursor to next batch
126
- next = res.next;
127
- }
128
- // If no more data is available
129
- else {
130
- return [3 /*break*/, 4];
131
- }
132
- _b.label = 3;
133
- case 3:
134
- if (total < count) return [3 /*break*/, 1];
135
- _b.label = 4;
136
- case 4:
137
- // If no likes found
138
- if (!likes.length) {
139
- return [2 /*return*/, new Error(Errors_1.DataErrors.NoUserTweetsFound)];
140
- }
141
- // Adding the cursor to the end of list of data
142
- likes.push(next);
143
- return [2 /*return*/, likes];
144
- }
145
- });
146
- });
147
- };
148
- /**
149
- * @returns The list of tweets liked by the given user
150
- * @param id The id of the user whose likes are to be fetched
151
- * @param count The number of likes to fetch, must be >= 40
152
- * @param all Whether to fetch list of all tweets liked by user
153
- * @param cursor The cursor to the batch of likes to fetch
154
- * @param favouritesCount The total number of tweets liked by target user
155
- */
156
- UserResolver.prototype.resolveUserLikes = function (id, count, all, cursor, favouritesCount) {
157
- var _a;
158
- return __awaiter(this, void 0, void 0, function () {
159
- var likes, next, total, res;
160
- var _this = this;
161
- return __generator(this, function (_b) {
162
- switch (_b.label) {
163
- case 0:
164
- likes = [];
165
- next = new CursoredData_1.Cursor(cursor);
166
- total = 0;
167
- // If all liked tweets are to be fetched
168
- count = all ? favouritesCount : count;
169
- // If required count less than batch size, setting batch size to required count
170
- this.batchSize = (count < this.batchSize) ? count : this.batchSize;
171
- _b.label = 1;
172
- case 1:
173
- // If this is the last batch, change batch size to number of remaining tweets
174
- this.batchSize = ((count - total) < this.batchSize) ? (count - total) : this.batchSize;
175
- return [4 /*yield*/, this.context.users.getUserLikes(id, this.batchSize, next.value)["catch"](function (error) {
176
- throw _this.getGraphQLError(error);
177
- })];
178
- case 2:
179
- res = _b.sent();
180
- // If data is available
181
- if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
182
- // Adding fetched tweets to list of tweets
183
- likes = likes.concat(res.list);
184
- // Updating total tweets fetched
185
- total = likes.length;
186
- // Getting cursor to next batch
187
- next = res.next;
188
- }
189
- // If no more data is available
190
- else {
191
- return [3 /*break*/, 4];
192
- }
193
- _b.label = 3;
194
- case 3:
195
- if (total < count) return [3 /*break*/, 1];
196
- _b.label = 4;
197
- case 4:
198
- // If no likes found
199
- if (!likes.length) {
200
- return [2 /*return*/, new Error(Errors_1.DataErrors.NoLikedTweetsFound)];
201
- }
202
- // Adding the cursor to the end of list of data
203
- likes.push(next);
204
- return [2 /*return*/, likes];
205
- }
206
- });
207
- });
208
- };
209
- /**
210
- * @returns The list of followers of the given twiiter user
211
- * @param id The id of the user whose followers are to be fetched
212
- * @param count The number of followers to fetch, must be >= 40 when no cursor is provided
213
- * @param all Whether to fetch all followers list
214
- * @param cursor The cursor to the batch of followers to fetch
215
- * @param followerCount The total number of followers of the target user
216
- */
217
- UserResolver.prototype.resolveUserFollowers = function (id, count, all, cursor, followersCount) {
218
- var _a;
219
- return __awaiter(this, void 0, void 0, function () {
220
- var followers, next, total, res;
221
- var _this = this;
222
- return __generator(this, function (_b) {
223
- switch (_b.label) {
224
- case 0:
225
- followers = [];
226
- next = new CursoredData_1.Cursor(cursor);
227
- total = 0;
228
- // If all followers are to be fetched
229
- count = all ? followersCount : count;
230
- // If required count less than batch size, setting batch size to required count
231
- this.batchSize = (count < this.batchSize) ? count : this.batchSize;
232
- _b.label = 1;
233
- case 1:
234
- // If this is the last batch, change batch size to number of remaining followers
235
- this.batchSize = ((count - total) < this.batchSize) ? (count - total) : this.batchSize;
236
- return [4 /*yield*/, this.context.users.getUserFollowers(id, this.batchSize, next.value)["catch"](function (error) {
237
- throw _this.getGraphQLError(error);
238
- })];
239
- case 2:
240
- res = _b.sent();
241
- // If data is available
242
- if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
243
- // Adding fetched followers to list of followers
244
- followers = followers.concat(res.list);
245
- // Updating total followers fetched
246
- total = followers.length;
247
- // Getting cursor to next batch
248
- next = res.next;
249
- }
250
- // If no more data is available
251
- else {
252
- return [3 /*break*/, 4];
253
- }
254
- _b.label = 3;
255
- case 3:
256
- if (total < count) return [3 /*break*/, 1];
257
- _b.label = 4;
258
- case 4:
259
- // If no followers found
260
- if (!followers.length) {
261
- return [2 /*return*/, new Error(Errors_1.DataErrors.NoFollowsFound)];
262
- }
263
- // Adding the cursor to the end of list of data
264
- followers.push(next);
265
- return [2 /*return*/, followers];
266
- }
267
- });
268
- });
269
- };
270
- /**
271
- * @returns The list of following of the given twiiter user
272
- * @param id The id of the user whose followings are to be fetched
273
- * @param count The number of following to fetch, should be >= 40 when no cursor is provided
274
- * @param all Whether to fetch list of all followings
275
- * @param cursor The cursor to the batch of followings to fetch
276
- * @param followingsCount The total number of followings of the target user
277
- */
278
- UserResolver.prototype.resolveUserFollowing = function (id, count, all, cursor, followingsCount) {
279
- var _a;
280
- return __awaiter(this, void 0, void 0, function () {
281
- var following, next, total, res;
282
- var _this = this;
283
- return __generator(this, function (_b) {
284
- switch (_b.label) {
285
- case 0:
286
- following = [];
287
- next = new CursoredData_1.Cursor(cursor);
288
- total = 0;
289
- // If all followings are to be fetched
290
- count = all ? followingsCount : count;
291
- // If required count less than batch size, setting batch size to required count
292
- this.batchSize = (count < this.batchSize) ? count : this.batchSize;
293
- _b.label = 1;
294
- case 1:
295
- // If this is the last batch, change batch size to number of remaining following
296
- this.batchSize = ((count - total) < this.batchSize) ? (count - total) : this.batchSize;
297
- return [4 /*yield*/, this.context.users.getUserFollowing(id, this.batchSize, next.value)["catch"](function (error) {
298
- throw _this.getGraphQLError(error);
299
- })];
300
- case 2:
301
- res = _b.sent();
302
- // If data is available
303
- if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
304
- // Adding fetched following to list of following
305
- following = following.concat(res.list);
306
- // Updating total following fetched
307
- total = following.length;
308
- // Getting cursor to next batch
309
- next = res.next;
310
- }
311
- // If no more data is available
312
- else {
313
- return [3 /*break*/, 4];
314
- }
315
- _b.label = 3;
316
- case 3:
317
- if (total < count) return [3 /*break*/, 1];
318
- _b.label = 4;
319
- case 4:
320
- // If no following found
321
- if (!following.length) {
322
- return [2 /*return*/, new Error(Errors_1.DataErrors.NoFollowsFound)];
323
- }
324
- // Adding the cursor to the end of list of data
325
- following.push(next);
326
- return [2 /*return*/, following];
327
- }
328
- });
329
- });
330
- };
331
- return UserResolver;
332
- }(ResolverBase_1["default"]));
333
- exports["default"] = UserResolver;
334
- //# sourceMappingURL=UserResolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserResolver.js","sourceRoot":"","sources":["../../../src/graphql/resolvers/UserResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAY;AACZ,gEAA0C;AAI1C,+DAAwD;AACxD,0CAA6C;AAE7C;IAA0C,gCAAY;IAIlD,iBAAiB;IACjB,sBAAY,OAAqB;QAAjC,YACI,kBAAM,OAAO,CAAC,SAEjB;QADG,KAAI,CAAC,SAAS,GAAG,EAAE,CAAC;;IACxB,CAAC;IAED;;;;OAIG;IACG,yCAAkB,GAAxB,UAAyB,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,GAAG,CAAC,IAAc,CAAC;yBAC7B;wBACD,+BAA+B;6BAC1B;4BACD,wBAAM;yBACT;;;4BACI,KAAK,GAAG,KAAK;;;wBAEtB,wBAAwB;wBACxB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;4BACnB,sBAAO,IAAI,KAAK,CAAC,mBAAU,CAAC,cAAc,CAAC,EAAC;yBAC/C;wBAED,+CAA+C;wBAC/C,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBAErB,sBAAO,SAAS,EAAC;;;;KACpB;IACL,mBAAC;AAAD,CAAC,AAxPD,CAA0C,yBAAY,GAwPrD"}
@@ -1,4 +0,0 @@
1
- import { GraphQLObjectType } from "graphql";
2
- export declare const Cursor: GraphQLObjectType<any, any, {
3
- [key: string]: any;
4
- }>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.Cursor = void 0;
4
- // PACKAGE
5
- var graphql_1 = require("graphql");
6
- exports.Cursor = new graphql_1.GraphQLObjectType({
7
- name: 'Cursor',
8
- description: 'Cursor data for the next batch of list data',
9
- fields: function () { return ({
10
- value: { type: graphql_1.GraphQLString }
11
- }); }
12
- });
13
- //# sourceMappingURL=Global.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Global.js","sourceRoot":"","sources":["../../../src/graphql/types/Global.ts"],"names":[],"mappings":";;;AAAA,UAAU;AACV,mCAA4D;AAE/C,QAAA,MAAM,GAAG,IAAI,2BAAiB,CAAC;IACxC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,6CAA6C;IAC1D,MAAM,EAAE,cAAM,OAAA,CAAC;QACX,KAAK,EAAE,EAAE,IAAI,EAAE,uBAAa,EAAE;KACjC,CAAC,EAFY,CAEZ;CACL,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { GraphQLList, GraphQLObjectType, GraphQLType } from "graphql";
2
- export declare const TweetTokens: GraphQLObjectType;
3
- export declare const Tweet: GraphQLObjectType;
4
- export declare const TweetList: GraphQLList<GraphQLType>;
@@ -1,160 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- exports.__esModule = true;
6
- exports.TweetList = exports.Tweet = exports.TweetTokens = void 0;
7
- // PACKAGE
8
- var graphql_1 = require("graphql");
9
- // TYPES
10
- var UserTypes_1 = require("./UserTypes");
11
- var Global_1 = require("./Global");
12
- // RESOLVERS
13
- var TweetResolver_1 = __importDefault(require("../resolvers/TweetResolver"));
14
- var UserResolver_1 = __importDefault(require("../resolvers/UserResolver"));
15
- exports.TweetTokens = new graphql_1.GraphQLObjectType({
16
- name: 'TweetTokens',
17
- description: 'Additional extracted tokens from the tweet like mentions, hashtags, etc',
18
- fields: function () { return ({
19
- hashtags: { type: new graphql_1.GraphQLList(graphql_1.GraphQLString) },
20
- urls: { type: new graphql_1.GraphQLList(graphql_1.GraphQLString) },
21
- mentionedUsers: {
22
- type: UserTypes_1.UserList,
23
- resolve: function (parent, args, context) { return parent.mentionedUsers.map(function (user) { return new UserResolver_1["default"](context).resolveUserDetails(user); }); }
24
- },
25
- media: { type: new graphql_1.GraphQLList(graphql_1.GraphQLString) }
26
- }); }
27
- });
28
- exports.Tweet = new graphql_1.GraphQLObjectType({
29
- name: 'Tweet',
30
- description: 'The details of single tweet',
31
- fields: function () { return ({
32
- id: { type: graphql_1.GraphQLString },
33
- tweetBy: {
34
- type: UserTypes_1.User,
35
- resolve: function (parent, args, context) { return new UserResolver_1["default"](context).resolveUserDetails(parent.tweetBy); }
36
- },
37
- createdAt: { type: graphql_1.GraphQLString },
38
- entities: { type: exports.TweetTokens },
39
- quoted: {
40
- type: exports.Tweet,
41
- resolve: function (parent, args, context) { return parent.quoted ? new TweetResolver_1["default"](context).resolveTweet(parent.quoted) : undefined; }
42
- },
43
- fullText: { type: graphql_1.GraphQLString },
44
- replyTo: {
45
- type: exports.Tweet,
46
- resolve: function (parent, args, context) { return parent.replyTo ? new TweetResolver_1["default"](context).resolveTweet(parent.replyTo) : undefined; }
47
- },
48
- lang: { type: graphql_1.GraphQLString },
49
- quoteCount: { type: graphql_1.GraphQLInt },
50
- quotes: {
51
- type: exports.TweetList,
52
- args: {
53
- count: {
54
- type: graphql_1.GraphQLInt,
55
- description: "The number of quotes to fetch, must be >= 1",
56
- defaultValue: 10
57
- },
58
- all: {
59
- type: graphql_1.GraphQLBoolean,
60
- description: "Whether to fetch all quotes",
61
- defaultValue: false
62
- },
63
- cursor: {
64
- type: graphql_1.GraphQLString,
65
- description: 'The cursor to the batch of quotes list to fetch',
66
- defaultValue: ''
67
- }
68
- },
69
- resolve: function (parent, args, context) { return new TweetResolver_1["default"](context).resolveTweetQuotes(parent.id, args.count, args.all, args.cursor, parent.quoteCount); }
70
- },
71
- likeCount: { type: graphql_1.GraphQLInt },
72
- likers: {
73
- type: UserTypes_1.UserList,
74
- args: {
75
- count: {
76
- type: graphql_1.GraphQLInt,
77
- description: "The number of likers to fetch, must be >= 10 (when no cursor if provided)",
78
- defaultValue: 10
79
- },
80
- all: {
81
- type: graphql_1.GraphQLBoolean,
82
- description: "Whether to fetch all likers",
83
- defaultValue: false
84
- },
85
- cursor: {
86
- type: graphql_1.GraphQLString,
87
- description: 'The cursor to the batch of likers list to fetch',
88
- defaultValue: ''
89
- }
90
- },
91
- resolve: function (parent, args, context) { return new TweetResolver_1["default"](context).resolveTweetLikers(parent.id, args.count, args.all, args.cursor, parent.likeCount); }
92
- },
93
- retweetCount: { type: graphql_1.GraphQLInt },
94
- retweeters: {
95
- type: UserTypes_1.UserList,
96
- args: {
97
- count: {
98
- type: graphql_1.GraphQLInt,
99
- description: "The number of retweeters to fetch, must be >= 10 (when no cursor if provided)",
100
- defaultValue: 10
101
- },
102
- all: {
103
- type: graphql_1.GraphQLBoolean,
104
- description: "Whether to fetch all likers",
105
- defaultValue: false
106
- },
107
- cursor: {
108
- type: graphql_1.GraphQLString,
109
- description: 'The cursor to the batch of retweeters list to fetch',
110
- defaultValue: ''
111
- }
112
- },
113
- resolve: function (parent, args, context) { return new TweetResolver_1["default"](context).resolveTweetRetweeters(parent.id, args.count, args.all, args.cursor, parent.retweetCount); }
114
- },
115
- replyCount: { type: graphql_1.GraphQLInt }
116
- /**
117
- * THIS IS DISABLED FOR USE FOR NOW BECAUSE TWITTER DOESN'T HAVE ANY ENDPOINT FOR FETCHING REPLIES.
118
- * THE DATA THIS RETURNS IS INCONSISTENT!
119
- */
120
- /*
121
- replies: {
122
- type: TweetList,
123
- args: {
124
- count: {
125
- type: GraphQLInt,
126
- description: "The number of replies to fetch",
127
- defaultValue: 10
128
- },
129
- all: {
130
- type: GraphQLBoolean,
131
- description: "Whether to fetch all replies",
132
- defaultValue: false
133
- },
134
- cursor: {
135
- type: GraphQLString,
136
- description: 'The cursor to the batch of replies list to fetch',
137
- defaultValue: ''
138
- }
139
- },
140
- resolve: (parent, args, context) => new TweetResolver(context).resolveTweetReplies(parent.id, args.count, args.all, args.cursor, parent.replyCount)
141
- }
142
- */
143
- }); }
144
- });
145
- exports.TweetList = new graphql_1.GraphQLList(new graphql_1.GraphQLUnionType({
146
- name: 'TweetCursorUnion',
147
- description: 'A union type which can either be a Tweet or a Cursor, used in cursored tweet lists',
148
- types: [exports.Tweet, Global_1.Cursor],
149
- resolveType: function (data) {
150
- // If it has fullText field => this is a Tweet object
151
- if (data.fullText) {
152
- return exports.Tweet;
153
- }
154
- // If it has a value field => this is a cursor object
155
- else if (data.value) {
156
- return Global_1.Cursor;
157
- }
158
- }
159
- }));
160
- //# sourceMappingURL=TweetTypes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TweetTypes.js","sourceRoot":"","sources":["../../../src/graphql/types/TweetTypes.ts"],"names":[],"mappings":";;;;;;AAAA,UAAU;AACV,mCAAmI;AAEnI,QAAQ;AACR,yCAA6C;AAC7C,mCAAkC;AAElC,YAAY;AACZ,6EAAuD;AACvD,2EAAqD;AAExC,QAAA,WAAW,GAAsB,IAAI,2BA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CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EAApH,CAAoH;SAC3J;QACD,UAAU,EAAE,EAAE,IAAI,EAAE,oBAAU,EAAE;QAChC;;;WAGG;QACH;;;;;;;;;;;;;;;;;;;;;;UAsBE;KACL,CAAC,EAhHY,CAgHZ;CACL,CAAC,CAAC;AAEU,QAAA,SAAS,GAA6B,IAAI,qBAAW,CAAC,IAAI,0BAAgB,CAAC;IACpF,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,oFAAoF;IACjG,KAAK,EAAE,CAAC,aAAK,EAAE,eAAM,CAAC;IACtB,WAAW,EAAE,UAAC,IAAI;QACd,qDAAqD;QACrD,IAAG,IAAI,CAAC,QAAQ,EAAE;YACd,OAAO,aAAK,CAAC;SAChB;QACD,qDAAqD;aAChD,IAAG,IAAI,CAAC,KAAK,EAAE;YAChB,OAAO,eAAM,CAAC;SACjB;IACL,CAAC;CACJ,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { GraphQLObjectType, GraphQLList, GraphQLType } from 'graphql';
2
- export declare const User: GraphQLObjectType;
3
- export declare const UserList: GraphQLList<GraphQLType>;