rettiwt-api 1.1.2 → 1.1.7

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 (301) hide show
  1. package/README.md +32 -7
  2. package/dist/endpoints/Endpoints.d.ts +14 -0
  3. package/dist/endpoints/Endpoints.js +20 -0
  4. package/dist/endpoints/Endpoints.js.map +1 -0
  5. package/dist/endpoints/Url.d.ts +5 -0
  6. package/dist/endpoints/Url.js +12 -0
  7. package/dist/endpoints/Url.js.map +1 -0
  8. package/dist/enums/Endpoints.d.ts +25 -0
  9. package/dist/enums/Endpoints.js +31 -0
  10. package/dist/enums/Endpoints.js.map +1 -0
  11. package/dist/enums/Errors.d.ts +20 -0
  12. package/dist/enums/Errors.js +28 -0
  13. package/dist/enums/Errors.js.map +1 -0
  14. package/dist/enums/HTTP.d.ts +17 -0
  15. package/dist/enums/HTTP.js +23 -0
  16. package/dist/enums/HTTP.js.map +1 -0
  17. package/dist/graphql/enums/Errors.d.ts +21 -0
  18. package/dist/graphql/enums/Errors.js +29 -0
  19. package/dist/graphql/enums/Errors.js.map +1 -0
  20. package/dist/graphql/queries/RootQuery.js +10 -3
  21. package/dist/graphql/queries/RootQuery.js.map +1 -1
  22. package/dist/graphql/resolvers/AccountResolver.d.ts +3 -3
  23. package/dist/graphql/resolvers/AccountResolver.js.map +1 -1
  24. package/dist/graphql/resolvers/ResolverBase.d.ts +14 -3
  25. package/dist/graphql/resolvers/ResolverBase.js +13 -1
  26. package/dist/graphql/resolvers/ResolverBase.js.map +1 -1
  27. package/dist/graphql/resolvers/TweetResolver.d.ts +3 -3
  28. package/dist/graphql/resolvers/TweetResolver.js +30 -18
  29. package/dist/graphql/resolvers/TweetResolver.js.map +1 -1
  30. package/dist/graphql/resolvers/UserResolver.d.ts +13 -4
  31. package/dist/graphql/resolvers/UserResolver.js +83 -18
  32. package/dist/graphql/resolvers/UserResolver.js.map +1 -1
  33. package/dist/graphql/types/Errors.d.ts +20 -0
  34. package/dist/graphql/types/Errors.js +28 -0
  35. package/dist/graphql/types/Errors.js.map +1 -0
  36. package/dist/graphql/types/TweetTypes.js +2 -2
  37. package/dist/graphql/types/TweetTypes.js.map +1 -1
  38. package/dist/graphql/types/UserTypes.js +1 -1
  39. package/dist/graphql/types/UserTypes.js.map +1 -1
  40. package/dist/index.d.ts +31 -15
  41. package/dist/index.js +32 -17
  42. package/dist/index.js.map +1 -1
  43. package/dist/middlewares/Authentication.d.ts +0 -0
  44. package/dist/middlewares/Authentication.js +2 -0
  45. package/dist/middlewares/Authentication.js.map +1 -0
  46. package/dist/models/args/TweetFilter.d.ts +59 -0
  47. package/dist/models/args/TweetFilter.js +101 -0
  48. package/dist/models/args/TweetFilter.js.map +1 -0
  49. package/dist/models/args/TweetListArgs.d.ts +21 -0
  50. package/dist/models/args/TweetListArgs.js +54 -0
  51. package/dist/models/args/TweetListArgs.js.map +1 -0
  52. package/dist/models/args/UserListArgs.d.ts +21 -0
  53. package/dist/models/args/UserListArgs.js +54 -0
  54. package/dist/models/args/UserListArgs.js.map +1 -0
  55. package/dist/models/auth/AuthCookie.d.ts +21 -0
  56. package/dist/models/auth/AuthCookie.js +33 -0
  57. package/dist/models/auth/AuthCookie.js.map +1 -0
  58. package/dist/models/data/CursoredData.d.ts +34 -0
  59. package/dist/models/data/CursoredData.js +42 -0
  60. package/dist/models/data/CursoredData.js.map +1 -0
  61. package/dist/models/data/DataValidationError.d.ts +18 -0
  62. package/dist/models/data/DataValidationError.js +21 -0
  63. package/dist/models/data/DataValidationError.js.map +1 -0
  64. package/dist/models/data/Errors.d.ts +18 -0
  65. package/dist/models/data/Errors.js +21 -0
  66. package/dist/models/data/Errors.js.map +1 -0
  67. package/dist/models/data/Service.d.ts +33 -0
  68. package/dist/models/data/Service.js +41 -0
  69. package/dist/models/data/Service.js.map +1 -0
  70. package/dist/models/data/Tweet.d.ts +53 -0
  71. package/dist/models/data/Tweet.js +104 -0
  72. package/dist/models/data/Tweet.js.map +1 -0
  73. package/dist/models/data/User.d.ts +41 -0
  74. package/dist/models/data/User.js +32 -0
  75. package/dist/models/data/User.js.map +1 -0
  76. package/dist/models/errors/DataValidationError.d.ts +20 -0
  77. package/dist/models/errors/DataValidationError.js +23 -0
  78. package/dist/models/errors/DataValidationError.js.map +1 -0
  79. package/dist/models/query/Variables.d.ts +2 -0
  80. package/dist/models/query/Variables.js +10 -0
  81. package/dist/models/query/Variables.js.map +1 -0
  82. package/dist/requests/Url.d.ts +5 -0
  83. package/dist/requests/Url.js +12 -0
  84. package/dist/requests/Url.js.map +1 -0
  85. package/dist/requests/payloads/Variables.d.ts +23 -0
  86. package/dist/requests/payloads/Variables.js +24 -0
  87. package/dist/requests/payloads/Variables.js.map +1 -0
  88. package/dist/server.d.ts +1 -1
  89. package/dist/server.js +9 -10
  90. package/dist/server.js.map +1 -1
  91. package/dist/services/accounts/AccountService.d.ts +6 -0
  92. package/dist/services/accounts/AccountService.js +6 -0
  93. package/dist/services/accounts/AccountService.js.map +1 -1
  94. package/dist/services/auth/AccountService.d.ts +88 -0
  95. package/dist/services/auth/AccountService.js +392 -0
  96. package/dist/services/auth/AccountService.js.map +1 -0
  97. package/dist/services/auth/AuthService.d.ts +31 -0
  98. package/dist/services/auth/AuthService.js +118 -0
  99. package/dist/services/auth/AuthService.js.map +1 -0
  100. package/dist/services/auth/LoginFlows.d.ts +77 -0
  101. package/dist/services/auth/LoginFlows.js +92 -0
  102. package/dist/services/auth/LoginFlows.js.map +1 -0
  103. package/dist/services/data/TweetService.d.ts +46 -16
  104. package/dist/services/data/TweetService.js +71 -54
  105. package/dist/services/data/TweetService.js.map +1 -1
  106. package/dist/services/data/UserService.d.ts +58 -19
  107. package/dist/services/data/UserService.js +104 -68
  108. package/dist/services/data/UserService.js.map +1 -1
  109. package/dist/services/helper/Headers.d.ts +4 -4
  110. package/dist/services/helper/Headers.js.map +1 -1
  111. package/dist/services/helper/Parser.d.ts +2 -2
  112. package/dist/services/helper/Parser.js.map +1 -1
  113. package/dist/services/helper/extractors/Tweets.d.ts +6 -6
  114. package/dist/services/helper/extractors/Tweets.js +1 -1
  115. package/dist/services/helper/extractors/Tweets.js.map +1 -1
  116. package/dist/services/helper/extractors/Users.d.ts +10 -4
  117. package/dist/services/helper/extractors/Users.js +54 -2
  118. package/dist/services/helper/extractors/Users.js.map +1 -1
  119. package/dist/services/helper/payloads/LoginFlows.d.ts +77 -0
  120. package/dist/services/helper/payloads/LoginFlows.js +92 -0
  121. package/dist/services/helper/payloads/LoginFlows.js.map +1 -0
  122. package/dist/services/helper/urls/Users.d.ts +8 -1
  123. package/dist/services/helper/urls/Users.js +12 -2
  124. package/dist/services/helper/urls/Users.js.map +1 -1
  125. package/dist/services/util/CacheService.d.ts +33 -0
  126. package/dist/services/util/CacheService.js +96 -0
  127. package/dist/services/util/CacheService.js.map +1 -0
  128. package/dist/services/util/FetcherService.d.ts +65 -0
  129. package/dist/services/util/FetcherService.js +214 -0
  130. package/dist/services/util/FetcherService.js.map +1 -0
  131. package/dist/types/Args.d.ts +38 -0
  132. package/dist/types/Args.js +5 -0
  133. package/dist/types/Args.js.map +1 -0
  134. package/dist/types/Authentication.d.ts +17 -2
  135. package/dist/types/Authentication.js +1 -0
  136. package/dist/types/Authentication.js.map +1 -1
  137. package/dist/types/Query.d.ts +80 -0
  138. package/dist/types/Query.js +3 -0
  139. package/dist/types/Query.js.map +1 -0
  140. package/dist/types/Resolvers.d.ts +5 -4
  141. package/dist/types/Rettiwt.d.ts +16 -0
  142. package/dist/types/Rettiwt.js +3 -0
  143. package/dist/types/Rettiwt.js.map +1 -0
  144. package/dist/types/Service.d.ts +15 -23
  145. package/dist/types/Service.js +2 -16
  146. package/dist/types/Service.js.map +1 -1
  147. package/dist/types/Tweet.d.ts +25 -19
  148. package/dist/types/Tweet.js +0 -2
  149. package/dist/types/Tweet.js.map +1 -1
  150. package/dist/types/User.d.ts +35 -0
  151. package/dist/types/User.js +3 -0
  152. package/dist/types/User.js.map +1 -0
  153. package/dist/types/args/TweetFilter.d.ts +54 -0
  154. package/dist/types/args/TweetFilter.js +96 -0
  155. package/dist/types/args/TweetFilter.js.map +1 -0
  156. package/dist/types/args/TweetListArg.d.ts +10 -0
  157. package/dist/types/args/TweetListArg.js +42 -0
  158. package/dist/types/args/TweetListArg.js.map +1 -0
  159. package/dist/types/args/TweetListArgs.d.ts +20 -0
  160. package/dist/types/args/TweetListArgs.js +52 -0
  161. package/dist/types/args/TweetListArgs.js.map +1 -0
  162. package/dist/types/args/UserListArgs.d.ts +16 -0
  163. package/dist/types/args/UserListArgs.js +48 -0
  164. package/dist/types/args/UserListArgs.js.map +1 -0
  165. package/dist/types/data/TweetFilter.d.ts +49 -0
  166. package/dist/types/data/TweetFilter.js +63 -0
  167. package/dist/types/data/TweetFilter.js.map +1 -0
  168. package/dist/types/interfaces/Args.d.ts +38 -0
  169. package/dist/types/interfaces/Args.js +5 -0
  170. package/dist/types/interfaces/Args.js.map +1 -0
  171. package/dist/types/interfaces/Authentication.d.ts +40 -0
  172. package/dist/types/interfaces/Authentication.js +5 -0
  173. package/dist/types/interfaces/Authentication.js.map +1 -0
  174. package/dist/types/interfaces/Resolvers.d.ts +14 -0
  175. package/dist/types/interfaces/Resolvers.js +3 -0
  176. package/dist/types/interfaces/Resolvers.js.map +1 -0
  177. package/dist/types/interfaces/Rettiwt.d.ts +16 -0
  178. package/dist/types/interfaces/Rettiwt.js +3 -0
  179. package/dist/types/interfaces/Rettiwt.js.map +1 -0
  180. package/dist/types/interfaces/Service.d.ts +13 -0
  181. package/dist/types/interfaces/Service.js +3 -0
  182. package/dist/types/interfaces/Service.js.map +1 -0
  183. package/dist/types/interfaces/Services.d.ts +13 -0
  184. package/dist/types/interfaces/Services.js +3 -0
  185. package/dist/types/interfaces/Services.js.map +1 -0
  186. package/dist/types/interfaces/Tweet.d.ts +46 -0
  187. package/dist/types/interfaces/Tweet.js +3 -0
  188. package/dist/types/interfaces/Tweet.js.map +1 -0
  189. package/dist/types/interfaces/TweetFilter.d.ts +0 -0
  190. package/dist/types/interfaces/TweetFilter.js +2 -0
  191. package/dist/types/interfaces/TweetFilter.js.map +1 -0
  192. package/{src/types/data/User.ts → dist/types/interfaces/User.d.ts} +35 -51
  193. package/dist/types/interfaces/User.js +3 -0
  194. package/dist/types/interfaces/User.js.map +1 -0
  195. package/dist/types/raw/data/tweet/Favouriters.d.ts +164 -0
  196. package/dist/types/raw/data/tweet/Favouriters.js +3 -0
  197. package/dist/types/raw/data/tweet/Favouriters.js.map +1 -0
  198. package/dist/types/raw/data/tweet/Retweeters.d.ts +171 -0
  199. package/dist/types/raw/data/tweet/Retweeters.js +3 -0
  200. package/dist/types/raw/data/tweet/Retweeters.js.map +1 -0
  201. package/dist/types/raw/data/tweet/Tweet.d.ts +746 -0
  202. package/dist/types/raw/data/tweet/Tweet.js +3 -0
  203. package/dist/types/raw/data/tweet/Tweet.js.map +1 -0
  204. package/dist/types/raw/data/tweet/Tweets.d.ts +386 -0
  205. package/dist/types/raw/data/tweet/Tweets.js +3 -0
  206. package/dist/types/raw/data/tweet/Tweets.js.map +1 -0
  207. package/dist/types/raw/data/user/Followers.d.ts +176 -0
  208. package/dist/types/raw/data/user/Followers.js +3 -0
  209. package/dist/types/raw/data/user/Followers.js.map +1 -0
  210. package/dist/types/raw/data/user/Following.d.ts +176 -0
  211. package/dist/types/raw/data/user/Following.js +3 -0
  212. package/dist/types/raw/data/user/Following.js.map +1 -0
  213. package/dist/types/raw/data/user/Likes.d.ts +1059 -0
  214. package/dist/types/raw/data/user/Likes.js +3 -0
  215. package/dist/types/raw/data/user/Likes.js.map +1 -0
  216. package/dist/types/raw/data/user/User.d.ts +117 -0
  217. package/dist/types/raw/data/user/User.js +3 -0
  218. package/dist/types/raw/data/user/User.js.map +1 -0
  219. package/dist/types/raw/query/tweet/Details.d.ts +80 -0
  220. package/dist/types/raw/query/tweet/Details.js +5 -0
  221. package/dist/types/raw/query/tweet/Details.js.map +1 -0
  222. package/dist/types/raw/query/tweet/Engagements.d.ts +29 -0
  223. package/dist/types/raw/query/tweet/Engagements.js +3 -0
  224. package/dist/types/raw/query/tweet/Engagements.js.map +1 -0
  225. package/dist/types/raw/query/tweet/Likes.d.ts +29 -0
  226. package/dist/types/raw/query/tweet/Likes.js +3 -0
  227. package/dist/types/raw/query/tweet/Likes.js.map +1 -0
  228. package/dist/types/raw/query/tweet/Retweets.d.ts +29 -0
  229. package/dist/types/raw/query/tweet/Retweets.js +3 -0
  230. package/dist/types/raw/query/tweet/Retweets.js.map +1 -0
  231. package/dist/types/raw/query/tweet/Search.d.ts +40 -0
  232. package/dist/types/raw/query/tweet/Search.js +3 -0
  233. package/dist/types/raw/query/tweet/Search.js.map +1 -0
  234. package/dist/types/raw/query/tweet/TweetDetails.d.ts +34 -0
  235. package/dist/types/raw/query/tweet/TweetDetails.js +5 -0
  236. package/dist/types/raw/query/tweet/TweetDetails.js.map +1 -0
  237. package/dist/types/raw/query/tweet/TweetLike.d.ts +29 -0
  238. package/dist/types/raw/query/tweet/TweetLike.js +3 -0
  239. package/dist/types/raw/query/tweet/TweetLike.js.map +1 -0
  240. package/dist/types/raw/query/tweet/TweetLikes.d.ts +29 -0
  241. package/dist/types/raw/query/tweet/TweetLikes.js +3 -0
  242. package/dist/types/raw/query/tweet/TweetLikes.js.map +1 -0
  243. package/dist/types/raw/query/tweet/TweetRetweets.d.ts +0 -0
  244. package/dist/types/raw/query/tweet/TweetRetweets.js +2 -0
  245. package/dist/types/raw/query/tweet/TweetRetweets.js.map +1 -0
  246. package/dist/types/raw/query/user/Details.d.ts +34 -0
  247. package/dist/types/raw/query/user/Details.js +3 -0
  248. package/dist/types/raw/query/user/Details.js.map +1 -0
  249. package/dist/types/raw/user/Tweets.d.ts +668 -1584
  250. package/dist/types/services/args/TweetFilter.d.ts +50 -0
  251. package/dist/types/services/args/TweetFilter.js +76 -0
  252. package/dist/types/services/args/TweetFilter.js.map +1 -0
  253. package/package.json +6 -3
  254. package/src/enums/Errors.ts +21 -0
  255. package/src/graphql/enums/Errors.ts +22 -0
  256. package/src/graphql/queries/RootQuery.ts +11 -4
  257. package/src/graphql/resolvers/AccountResolver.ts +3 -3
  258. package/src/graphql/resolvers/ResolverBase.ts +19 -5
  259. package/src/graphql/resolvers/TweetResolver.ts +26 -17
  260. package/src/graphql/resolvers/UserResolver.ts +75 -20
  261. package/src/graphql/types/TweetTypes.ts +2 -2
  262. package/src/graphql/types/UserTypes.ts +4 -4
  263. package/src/index.ts +39 -17
  264. package/src/models/args/TweetFilter.ts +119 -0
  265. package/src/models/args/TweetListArgs.ts +47 -0
  266. package/src/models/args/UserListArgs.ts +47 -0
  267. package/src/models/auth/AuthCookie.ts +43 -0
  268. package/src/models/data/CursoredData.ts +45 -0
  269. package/src/models/data/Tweet.ts +118 -0
  270. package/src/models/data/User.ts +72 -0
  271. package/src/models/errors/DataValidationError.ts +29 -0
  272. package/src/server.ts +9 -10
  273. package/src/services/{accounts → auth}/AccountService.ts +71 -19
  274. package/src/services/auth/AuthService.ts +81 -0
  275. package/src/services/data/TweetService.ts +81 -62
  276. package/src/services/data/UserService.ts +118 -80
  277. package/src/services/helper/Headers.ts +4 -4
  278. package/src/services/helper/Parser.ts +2 -2
  279. package/src/services/helper/extractors/Tweets.ts +7 -7
  280. package/src/services/helper/extractors/Users.ts +60 -5
  281. package/src/services/helper/urls/Users.ts +39 -23
  282. package/src/services/{CacheService.ts → util/CacheService.ts} +4 -1
  283. package/src/services/{FetcherService.ts → util/FetcherService.ts} +19 -11
  284. package/src/types/Args.ts +49 -0
  285. package/src/types/Authentication.ts +29 -7
  286. package/src/types/Resolvers.ts +5 -4
  287. package/src/types/Rettiwt.ts +20 -0
  288. package/src/types/Service.ts +24 -0
  289. package/src/types/Tweet.ts +61 -0
  290. package/src/types/User.ts +48 -0
  291. package/src/types/raw/user/Tweets.ts +1747 -0
  292. package/tsconfig.json +2 -2
  293. package/src/services/AuthService.ts +0 -68
  294. package/src/services/helper/deserializers/Tweets.ts +0 -70
  295. package/src/services/helper/deserializers/Users.ts +0 -26
  296. package/src/types/data/Errors.ts +0 -37
  297. package/src/types/data/Service.ts +0 -55
  298. package/src/types/data/Tweet.ts +0 -123
  299. package/src/types/raw/auth/Cookie.ts +0 -16
  300. /package/src/{types → enums}/HTTP.ts +0 -0
  301. /package/src/services/{accounts → helper/payloads}/LoginFlows.ts +0 -0
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ exports.__esModule = true;
12
+ exports.TweetFilter = void 0;
13
+ // PACKAGE
14
+ var class_validator_1 = require("class-validator");
15
+ var DataValidationError_1 = require("../errors/DataValidationError");
16
+ /**
17
+ * The filter to be used for fetching tweets from Twitter.
18
+ *
19
+ * @internal
20
+ */
21
+ var TweetFilter = /** @class */ (function () {
22
+ /**
23
+ * @param filter The incoming filter in JSON format.
24
+ */
25
+ function TweetFilter(filter) {
26
+ this.endDate = filter.endDate;
27
+ this.fromUsers = filter.fromUsers;
28
+ this.hashtags = filter.hashtags;
29
+ this.links = filter.links;
30
+ this.mentions = filter.mentions;
31
+ this.quoted = filter.quoted;
32
+ this.sinceId = filter.sinceId;
33
+ this.startDate = filter.startDate;
34
+ this.toUsers = filter.toUsers;
35
+ this.words = filter.words;
36
+ // Validating the filter
37
+ var validationResult = (0, class_validator_1.validateSync)(this);
38
+ // If valiation error occured
39
+ if (validationResult.length) {
40
+ throw new DataValidationError_1.DataValidationError(validationResult);
41
+ }
42
+ }
43
+ __decorate([
44
+ (0, class_validator_1.IsArray)(),
45
+ (0, class_validator_1.IsString)({ each: true }),
46
+ (0, class_validator_1.IsOptional)(),
47
+ __metadata("design:type", Array)
48
+ ], TweetFilter.prototype, "words");
49
+ __decorate([
50
+ (0, class_validator_1.IsArray)(),
51
+ (0, class_validator_1.IsString)({ each: true }),
52
+ (0, class_validator_1.IsOptional)(),
53
+ __metadata("design:type", Array)
54
+ ], TweetFilter.prototype, "hashtags");
55
+ __decorate([
56
+ (0, class_validator_1.IsArray)(),
57
+ (0, class_validator_1.IsString)({ each: true }),
58
+ (0, class_validator_1.IsOptional)(),
59
+ __metadata("design:type", Array)
60
+ ], TweetFilter.prototype, "fromUsers");
61
+ __decorate([
62
+ (0, class_validator_1.IsArray)(),
63
+ (0, class_validator_1.IsString)({ each: true }),
64
+ (0, class_validator_1.IsOptional)(),
65
+ __metadata("design:type", Array)
66
+ ], TweetFilter.prototype, "toUsers");
67
+ __decorate([
68
+ (0, class_validator_1.IsArray)(),
69
+ (0, class_validator_1.IsString)({ each: true }),
70
+ (0, class_validator_1.IsOptional)(),
71
+ __metadata("design:type", Array)
72
+ ], TweetFilter.prototype, "mentions");
73
+ __decorate([
74
+ (0, class_validator_1.IsOptional)(),
75
+ (0, class_validator_1.IsDateString)(),
76
+ __metadata("design:type", String)
77
+ ], TweetFilter.prototype, "startDate");
78
+ __decorate([
79
+ (0, class_validator_1.IsOptional)(),
80
+ (0, class_validator_1.IsDateString)(),
81
+ __metadata("design:type", String)
82
+ ], TweetFilter.prototype, "endDate");
83
+ __decorate([
84
+ (0, class_validator_1.IsNumberString)(),
85
+ (0, class_validator_1.IsOptional)(),
86
+ __metadata("design:type", String)
87
+ ], TweetFilter.prototype, "sinceId");
88
+ __decorate([
89
+ (0, class_validator_1.IsNumberString)(),
90
+ (0, class_validator_1.IsOptional)(),
91
+ __metadata("design:type", String)
92
+ ], TweetFilter.prototype, "quoted");
93
+ __decorate([
94
+ (0, class_validator_1.IsBoolean)(),
95
+ (0, class_validator_1.IsOptional)(),
96
+ __metadata("design:type", Boolean)
97
+ ], TweetFilter.prototype, "links");
98
+ return TweetFilter;
99
+ }());
100
+ exports.TweetFilter = TweetFilter;
101
+ //# sourceMappingURL=TweetFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TweetFilter.js","sourceRoot":"","sources":["../../../src/models/args/TweetFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,mDAAuH;AAIvH,qEAAoE;AAEpE;;;;GAIG;AACH;IAmFI;;OAEG;IACH,qBAAY,MAAmB;QAC3B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1B,wBAAwB;QACxB,IAAM,gBAAgB,GAAG,IAAA,8BAAY,EAAC,IAAI,CAAC,CAAC;QAE5C,6BAA6B;QAC7B,IAAI,gBAAgB,CAAC,MAAM,EAAE;YACzB,MAAM,IAAI,yCAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnD;IACL,CAAC;IApGD;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACxB,IAAA,4BAAU,GAAE;;sCACI;IAUjB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACxB,IAAA,4BAAU,GAAE;;yCACO;IAUpB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACxB,IAAA,4BAAU,GAAE;;0CACQ;IAUrB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACxB,IAAA,4BAAU,GAAE;;wCACM;IAUnB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACxB,IAAA,4BAAU,GAAE;;yCACO;IASpB;QAFC,IAAA,4BAAU,GAAE;QACZ,IAAA,8BAAY,GAAE;;0CACI;IASnB;QAFC,IAAA,4BAAU,GAAE;QACZ,IAAA,8BAAY,GAAE;;wCACE;IAKjB;QAFC,IAAA,gCAAc,GAAE;QAChB,IAAA,4BAAU,GAAE;;wCACI;IAKjB;QAFC,IAAA,gCAAc,GAAE;QAChB,IAAA,4BAAU,GAAE;;uCACG;IAQhB;QAFC,IAAA,2BAAS,GAAE;QACX,IAAA,4BAAU,GAAE;;sCACG;IAyBpB,kBAAC;CAAA,AA1GD,IA0GC;AA1GY,kCAAW"}
@@ -0,0 +1,21 @@
1
+ import { IListArgs } from '../../types/Args';
2
+ /**
3
+ * The arguments for fetching cursored list in TweetService.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare class TweetListArgs implements IListArgs {
8
+ /** The number of data items to fetch.
9
+ *
10
+ * @defaultValue 10
11
+ * @remarks Must be >= 10 and <= 100
12
+ */
13
+ count: number;
14
+ /** The cursor to the batch of data to fetch. */
15
+ cursor: string;
16
+ /**
17
+ * @param count The number of data items to fetch.
18
+ * @param cursor The cursor to the batch of data to fetch.
19
+ */
20
+ constructor(count?: number, cursor?: string);
21
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ exports.__esModule = true;
12
+ exports.TweetListArgs = void 0;
13
+ // PACKAGES
14
+ var class_validator_1 = require("class-validator");
15
+ var DataValidationError_1 = require("../errors/DataValidationError");
16
+ /**
17
+ * The arguments for fetching cursored list in TweetService.
18
+ *
19
+ * @internal
20
+ */
21
+ var TweetListArgs = /** @class */ (function () {
22
+ /**
23
+ * @param count The number of data items to fetch.
24
+ * @param cursor The cursor to the batch of data to fetch.
25
+ */
26
+ function TweetListArgs(count, cursor) {
27
+ if (count === void 0) { count = 10; }
28
+ if (cursor === void 0) { cursor = ''; }
29
+ this.count = count;
30
+ this.cursor = cursor;
31
+ // Validating the arguments
32
+ var validationResult = (0, class_validator_1.validateSync)(this);
33
+ // If valiation error occured
34
+ if (validationResult.length) {
35
+ throw new DataValidationError_1.DataValidationError(validationResult);
36
+ }
37
+ }
38
+ __decorate([
39
+ (0, class_validator_1.IsInt)(),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.Max)(100),
42
+ (0, class_validator_1.ValidateIf)(function (ob) { return ob.cursor.length == 0; }),
43
+ (0, class_validator_1.Min)(10),
44
+ __metadata("design:type", Number)
45
+ ], TweetListArgs.prototype, "count");
46
+ __decorate([
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_1.IsOptional)(),
49
+ __metadata("design:type", String)
50
+ ], TweetListArgs.prototype, "cursor");
51
+ return TweetListArgs;
52
+ }());
53
+ exports.TweetListArgs = TweetListArgs;
54
+ //# sourceMappingURL=TweetListArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TweetListArgs.js","sourceRoot":"","sources":["../../../src/models/args/TweetListArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,mDAAkG;AAIlG,qEAAoE;AAEpE;;;;GAIG;AACH;IAkBI;;;OAGG;IACH,uBAAY,KAAkB,EAAE,MAAmB;QAAvC,sBAAA,EAAA,UAAkB;QAAE,uBAAA,EAAA,WAAmB;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,2BAA2B;QAC3B,IAAM,gBAAgB,GAAG,IAAA,8BAAY,EAAC,IAAI,CAAC,CAAC;QAE5C,6BAA6B;QAC7B,IAAI,gBAAgB,CAAC,MAAM,EAAE;YACzB,MAAM,IAAI,yCAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnD;IACL,CAAC;IAtBD;QALC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;QACZ,IAAA,qBAAG,EAAC,GAAG,CAAC;QACR,IAAA,4BAAU,EAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAArB,CAAqB,CAAC;QACvC,IAAA,qBAAG,EAAC,EAAE,CAAC;;wCACM;IAKd;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yCACE;IAkBnB,oBAAC;CAAA,AAlCD,IAkCC;AAlCY,sCAAa"}
@@ -0,0 +1,21 @@
1
+ import { IListArgs } from '../../types/Args';
2
+ /**
3
+ * The arguments for fetching cursored list in TweetService.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare class UserListArgs implements IListArgs {
8
+ /** The number of data items to fetch.
9
+ *
10
+ * @defaultValue 40
11
+ * @remarks Must be >= 40 and <= 100
12
+ */
13
+ count: number;
14
+ /** The cursor to the batch of data to fetch. */
15
+ cursor: string;
16
+ /**
17
+ * @param count The number of data items to fetch.
18
+ * @param cursor The cursor to the batch of data to fetch.
19
+ */
20
+ constructor(count?: number, cursor?: string);
21
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ exports.__esModule = true;
12
+ exports.UserListArgs = void 0;
13
+ // PACKAGES
14
+ var class_validator_1 = require("class-validator");
15
+ var DataValidationError_1 = require("../errors/DataValidationError");
16
+ /**
17
+ * The arguments for fetching cursored list in TweetService.
18
+ *
19
+ * @internal
20
+ */
21
+ var UserListArgs = /** @class */ (function () {
22
+ /**
23
+ * @param count The number of data items to fetch.
24
+ * @param cursor The cursor to the batch of data to fetch.
25
+ */
26
+ function UserListArgs(count, cursor) {
27
+ if (count === void 0) { count = 40; }
28
+ if (cursor === void 0) { cursor = ''; }
29
+ this.count = count;
30
+ this.cursor = cursor;
31
+ // Validating the arguments
32
+ var validationResult = (0, class_validator_1.validateSync)(this);
33
+ // If valiation error occured
34
+ if (validationResult.length) {
35
+ throw new DataValidationError_1.DataValidationError(validationResult);
36
+ }
37
+ }
38
+ __decorate([
39
+ (0, class_validator_1.IsInt)(),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.Max)(100),
42
+ (0, class_validator_1.ValidateIf)(function (ob) { return ob.cursor.length == 0; }),
43
+ (0, class_validator_1.Min)(40),
44
+ __metadata("design:type", Number)
45
+ ], UserListArgs.prototype, "count");
46
+ __decorate([
47
+ (0, class_validator_1.IsString)(),
48
+ (0, class_validator_1.IsOptional)(),
49
+ __metadata("design:type", String)
50
+ ], UserListArgs.prototype, "cursor");
51
+ return UserListArgs;
52
+ }());
53
+ exports.UserListArgs = UserListArgs;
54
+ //# sourceMappingURL=UserListArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserListArgs.js","sourceRoot":"","sources":["../../../src/models/args/UserListArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,mDAAkG;AAIlG,qEAAoE;AAEpE;;;;GAIG;AACH;IAkBI;;;OAGG;IACH,sBAAY,KAAkB,EAAE,MAAmB;QAAvC,sBAAA,EAAA,UAAkB;QAAE,uBAAA,EAAA,WAAmB;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,2BAA2B;QAC3B,IAAM,gBAAgB,GAAG,IAAA,8BAAY,EAAC,IAAI,CAAC,CAAC;QAE5C,6BAA6B;QAC7B,IAAI,gBAAgB,CAAC,MAAM,EAAE;YACzB,MAAM,IAAI,yCAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnD;IACL,CAAC;IAtBD;QALC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;QACZ,IAAA,qBAAG,EAAC,GAAG,CAAC;QACR,IAAA,4BAAU,EAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAArB,CAAqB,CAAC;QACvC,IAAA,qBAAG,EAAC,EAAE,CAAC;;uCACM;IAKd;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;wCACE;IAkBnB,mBAAC;CAAA,AAlCD,IAkCC;AAlCY,oCAAY"}
@@ -0,0 +1,21 @@
1
+ import { IAuthCookie } from '../../types/Authentication';
2
+ /**
3
+ * The cookie containing the tokens that are used to authenticate against Twitter.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare class AuthCookie implements IAuthCookie {
8
+ /** Token used to authenticate a device. */
9
+ kdt: string;
10
+ /** Token used to authenticate a user using a Twitter ID. */
11
+ twid: string;
12
+ /** The CSRF token of the session. */
13
+ ct0: string;
14
+ /** The authentication token used while logging in to the account. */
15
+ auth_token: string;
16
+ constructor(cookie?: IAuthCookie);
17
+ /**
18
+ * @returns The string respresentation of this cookie in the valid cookie string format.
19
+ */
20
+ toString(): string;
21
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.AuthCookie = void 0;
4
+ /**
5
+ * The cookie containing the tokens that are used to authenticate against Twitter.
6
+ *
7
+ * @internal
8
+ */
9
+ var AuthCookie = /** @class */ (function () {
10
+ function AuthCookie(cookie) {
11
+ var _a, _b, _c, _d;
12
+ this.auth_token = (_a = cookie === null || cookie === void 0 ? void 0 : cookie.auth_token) !== null && _a !== void 0 ? _a : '';
13
+ this.ct0 = (_b = cookie === null || cookie === void 0 ? void 0 : cookie.ct0) !== null && _b !== void 0 ? _b : '';
14
+ this.kdt = (_c = cookie === null || cookie === void 0 ? void 0 : cookie.kdt) !== null && _c !== void 0 ? _c : '';
15
+ this.twid = (_d = cookie === null || cookie === void 0 ? void 0 : cookie.twid) !== null && _d !== void 0 ? _d : '';
16
+ }
17
+ /**
18
+ * @returns The string respresentation of this cookie in the valid cookie string format.
19
+ */
20
+ AuthCookie.prototype.toString = function () {
21
+ /** The string representation of this cookie. */
22
+ var cookieString = '';
23
+ // Iterating through the (key, value) pairs of this cookie
24
+ for (var _i = 0, _a = Object.entries(this); _i < _a.length; _i++) {
25
+ var _b = _a[_i], key = _b[0], value = _b[1];
26
+ cookieString += "".concat(key, "=").concat(value, ";");
27
+ }
28
+ return cookieString;
29
+ };
30
+ return AuthCookie;
31
+ }());
32
+ exports.AuthCookie = AuthCookie;
33
+ //# sourceMappingURL=AuthCookie.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthCookie.js","sourceRoot":"","sources":["../../../src/models/auth/AuthCookie.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAaI,oBAAY,MAAoB;;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,mCAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,6BAAQ,GAAR;QACI,gDAAgD;QAChD,IAAI,YAAY,GAAW,EAAE,CAAC;QAE9B,0DAA0D;QAC1D,KAAyB,UAAoB,EAApB,KAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAApB,cAAoB,EAApB,IAAoB,EAAE;YAAtC,IAAA,WAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;YAChB,YAAY,IAAI,UAAG,GAAG,cAAI,KAAK,MAAG,CAAC;SACtC;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IACL,iBAAC;AAAD,CAAC,AAlCD,IAkCC;AAlCY,gCAAU"}
@@ -0,0 +1,34 @@
1
+ import { ICursor, ICursoredData } from "../../types/Service";
2
+ /**
3
+ * The cursor to the batch of data to be fetched.
4
+ *
5
+ * @internal
6
+ */
7
+ export declare class Cursor implements ICursor {
8
+ /** The cursor string. */
9
+ value: string;
10
+ /**
11
+ * Initializes a new cursor from the given cursor string.
12
+ *
13
+ * @param cursorStr The string representation of the cursor.
14
+ */
15
+ constructor(cursorStr: string);
16
+ }
17
+ /**
18
+ * The data that us fetched batch-wise along with a cursor.
19
+ *
20
+ * @internal
21
+ *
22
+ * @typeParam Type - The type of data present in the list.
23
+ */
24
+ export declare class CursoredData<T> implements ICursoredData<T> {
25
+ /** The list of data of the given type. */
26
+ list: T[];
27
+ /** The cursor to the next batch of data. */
28
+ next: Cursor;
29
+ /**
30
+ * @param list The list of data item to store.
31
+ * @param next The cursor to the next batch of data.
32
+ */
33
+ constructor(list?: T[], next?: string);
34
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.CursoredData = exports.Cursor = void 0;
4
+ /**
5
+ * The cursor to the batch of data to be fetched.
6
+ *
7
+ * @internal
8
+ */
9
+ var Cursor = /** @class */ (function () {
10
+ /**
11
+ * Initializes a new cursor from the given cursor string.
12
+ *
13
+ * @param cursorStr The string representation of the cursor.
14
+ */
15
+ function Cursor(cursorStr) {
16
+ this.value = cursorStr;
17
+ }
18
+ return Cursor;
19
+ }());
20
+ exports.Cursor = Cursor;
21
+ /**
22
+ * The data that us fetched batch-wise along with a cursor.
23
+ *
24
+ * @internal
25
+ *
26
+ * @typeParam Type - The type of data present in the list.
27
+ */
28
+ var CursoredData = /** @class */ (function () {
29
+ /**
30
+ * @param list The list of data item to store.
31
+ * @param next The cursor to the next batch of data.
32
+ */
33
+ function CursoredData(list, next) {
34
+ if (list === void 0) { list = []; }
35
+ if (next === void 0) { next = ''; }
36
+ this.list = list;
37
+ this.next = new Cursor(next);
38
+ }
39
+ return CursoredData;
40
+ }());
41
+ exports.CursoredData = CursoredData;
42
+ //# sourceMappingURL=CursoredData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../../src/models/data/CursoredData.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAII;;;;OAIG;IACH,gBAAY,SAAiB;QACzB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,CAAC;IACL,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM;AAcnB;;;;;;GAMG;AACH;IAOI;;;OAGG;IACH,sBAAY,IAAc,EAAE,IAAiB;QAAjC,qBAAA,EAAA,SAAc;QAAE,qBAAA,EAAA,SAAiB;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACL,mBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,oCAAY"}
@@ -0,0 +1,18 @@
1
+ import { ValidationError } from "class-validator";
2
+ /**
3
+ * Error when any fields of a JSON data fails to validate.
4
+ *
5
+ * @param errorDetails The details of about the specific fields that failed to validate.
6
+ */
7
+ export declare class DataValidationError implements Error {
8
+ /** The name of the error. */
9
+ name: string;
10
+ /** The user-friendly error message. */
11
+ message: string;
12
+ /** The error data. */
13
+ data: ValidationError[];
14
+ /**
15
+ * @param data The error details.
16
+ */
17
+ constructor(errorDetails: ValidationError[]);
18
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.DataValidationError = void 0;
4
+ /**
5
+ * Error when any fields of a JSON data fails to validate.
6
+ *
7
+ * @param errorDetails The details of about the specific fields that failed to validate.
8
+ */
9
+ var DataValidationError = /** @class */ (function () {
10
+ /**
11
+ * @param data The error details.
12
+ */
13
+ function DataValidationError(errorDetails) {
14
+ this.name = 'ValidationError';
15
+ this.message = 'One or more validation errors occured. Refer to data for details';
16
+ this.data = errorDetails;
17
+ }
18
+ return DataValidationError;
19
+ }());
20
+ exports.DataValidationError = DataValidationError;
21
+ //# sourceMappingURL=DataValidationError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataValidationError.js","sourceRoot":"","sources":["../../../src/models/data/DataValidationError.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAUI;;OAEG;IACH,6BAAY,YAA+B;QACvC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,kEAAkE,CAAC;QAClF,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC7B,CAAC;IACL,0BAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,kDAAmB"}
@@ -0,0 +1,18 @@
1
+ import { ValidationError } from "class-validator";
2
+ /**
3
+ * Error when any fields of a JSON data fails to validate.
4
+ *
5
+ * @param errorDetails The details of about the specific fields that failed to validate.
6
+ */
7
+ export declare class DataValidationError implements Error {
8
+ /** The name of the error. */
9
+ name: string;
10
+ /** The user-friendly error message. */
11
+ message: string;
12
+ /** The error data. */
13
+ data: ValidationError[];
14
+ /**
15
+ * @param data The error details.
16
+ */
17
+ constructor(errorDetails: ValidationError[]);
18
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.DataValidationError = void 0;
4
+ /**
5
+ * Error when any fields of a JSON data fails to validate.
6
+ *
7
+ * @param errorDetails The details of about the specific fields that failed to validate.
8
+ */
9
+ var DataValidationError = /** @class */ (function () {
10
+ /**
11
+ * @param data The error details.
12
+ */
13
+ function DataValidationError(errorDetails) {
14
+ this.name = 'ValidationError';
15
+ this.message = 'One or more validation errors occured. Refer to data for details';
16
+ this.data = errorDetails;
17
+ }
18
+ return DataValidationError;
19
+ }());
20
+ exports.DataValidationError = DataValidationError;
21
+ //# sourceMappingURL=Errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../src/models/data/Errors.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAUI;;OAEG;IACH,6BAAY,YAA+B;QACvC,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,kEAAkE,CAAC;QAClF,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC7B,CAAC;IACL,0BAAC;AAAD,CAAC,AAlBD,IAkBC;AAlBY,kDAAmB"}
@@ -0,0 +1,33 @@
1
+ import { CursoredDataInterface } from "../../types/interfaces/Service";
2
+ /**
3
+ * The cursor to the batch of data to be fetched.
4
+ *
5
+ * @public
6
+ */
7
+ export declare class Cursor {
8
+ /** The cursor string. */
9
+ value: string;
10
+ /**
11
+ * Initializes a new cursor from the given cursor string.
12
+ *
13
+ * @param cursorStr The string representation of the cursor.
14
+ */
15
+ constructor(cursorStr: string);
16
+ }
17
+ /**
18
+ * The data that us fetched batch-wise along with a cursor.
19
+ *
20
+ * @typeParam Type - The type of data present in the list.
21
+ * @public
22
+ */
23
+ export declare class CursoredData<T> implements CursoredDataInterface<T> {
24
+ /** The list of data of the given type. */
25
+ list: T[];
26
+ /** The cursor to the next batch of data. */
27
+ next: Cursor;
28
+ /**
29
+ * @param list The list of data item to store.
30
+ * @param next The cursor to the next batch of data.
31
+ */
32
+ constructor(list?: T[], next?: string);
33
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.CursoredData = exports.Cursor = void 0;
4
+ /**
5
+ * The cursor to the batch of data to be fetched.
6
+ *
7
+ * @public
8
+ */
9
+ var Cursor = /** @class */ (function () {
10
+ /**
11
+ * Initializes a new cursor from the given cursor string.
12
+ *
13
+ * @param cursorStr The string representation of the cursor.
14
+ */
15
+ function Cursor(cursorStr) {
16
+ this.value = cursorStr;
17
+ }
18
+ return Cursor;
19
+ }());
20
+ exports.Cursor = Cursor;
21
+ /**
22
+ * The data that us fetched batch-wise along with a cursor.
23
+ *
24
+ * @typeParam Type - The type of data present in the list.
25
+ * @public
26
+ */
27
+ var CursoredData = /** @class */ (function () {
28
+ /**
29
+ * @param list The list of data item to store.
30
+ * @param next The cursor to the next batch of data.
31
+ */
32
+ function CursoredData(list, next) {
33
+ if (list === void 0) { list = []; }
34
+ if (next === void 0) { next = ''; }
35
+ this.list = list;
36
+ this.next = new Cursor(next);
37
+ }
38
+ return CursoredData;
39
+ }());
40
+ exports.CursoredData = CursoredData;
41
+ //# sourceMappingURL=Service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Service.js","sourceRoot":"","sources":["../../../src/models/data/Service.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAII;;;;OAIG;IACH,gBAAY,SAAiB;QACzB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,CAAC;IACL,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM;AAcnB;;;;;GAKG;AACH;IAOI;;;OAGG;IACH,sBAAY,IAAc,EAAE,IAAiB;QAAjC,qBAAA,EAAA,SAAc;QAAE,qBAAA,EAAA,SAAiB;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACL,mBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,oCAAY"}
@@ -0,0 +1,53 @@
1
+ import { ITweet, ITweetEntities } from '../../types/Tweet';
2
+ import { Result as RawTweet, Entities2 as RawTweetEntities } from '../../types/raw/tweet/Tweet';
3
+ /**
4
+ * The different types parsed entities like urls, media, mentions, hashtags, etc.
5
+ *
6
+ * @internal
7
+ */
8
+ export declare class TweetEntities implements ITweetEntities {
9
+ /** The list of hashtags mentioned in the tweet. */
10
+ hashtags: string[];
11
+ /** The list of urls mentioned in the tweet. */
12
+ urls: string[];
13
+ /** The list of IDs of users mentioned in the tweet. */
14
+ mentionedUsers: string[];
15
+ /** The list of urls to various media mentioned in the tweet. */
16
+ media: string[];
17
+ constructor(entities: RawTweetEntities);
18
+ }
19
+ /**
20
+ * The details of a single Tweet.
21
+ *
22
+ * @internal
23
+ */
24
+ export declare class Tweet implements ITweet {
25
+ /** The rest id of the tweet. */
26
+ id: string;
27
+ /** The rest id of the user who made the tweet. */
28
+ tweetBy: string;
29
+ /** The date and time of creation of the tweet, in UTC string format. */
30
+ createdAt: string;
31
+ /** Additional tweet entities like urls, mentions, etc. */
32
+ entities: TweetEntities;
33
+ /** The rest id of the tweet which is quoted in the tweet. */
34
+ quoted: string;
35
+ /** The full text content of the tweet. */
36
+ fullText: string;
37
+ /** The rest id of the user to which the tweet is a reply. */
38
+ replyTo: string;
39
+ /** The language in which the tweet is written. */
40
+ lang: string;
41
+ /** The number of quotes of the tweet. */
42
+ quoteCount: number;
43
+ /** The number of replies to the tweet. */
44
+ replyCount: number;
45
+ /** The number of retweets of the tweet. */
46
+ retweetCount: number;
47
+ /** The number of likes of the tweet. */
48
+ likeCount: number;
49
+ /**
50
+ * @param tweet The raw tweet data.
51
+ */
52
+ constructor(tweet: RawTweet);
53
+ }