rettiwt-api 1.1.0 → 1.1.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.
- package/.github/workflows/build-docs.yml +27 -0
- package/README.md +3 -1
- package/dist/Test.d.ts +0 -0
- package/dist/Test.js +2 -0
- package/dist/Test.js.map +1 -0
- package/dist/index.d.ts +16 -5
- package/dist/index.js +22 -8
- package/dist/index.js.map +1 -1
- package/dist/models/graphql/Global.d.ts +4 -0
- package/dist/models/graphql/Global.js +13 -0
- package/dist/models/graphql/Global.js.map +1 -0
- package/dist/models/graphql/TweetTypes.d.ts +6 -0
- package/dist/models/graphql/TweetTypes.js +156 -0
- package/dist/models/graphql/TweetTypes.js.map +1 -0
- package/dist/models/graphql/UserTypes.d.ts +3 -0
- package/dist/models/graphql/UserTypes.js +139 -0
- package/dist/models/graphql/UserTypes.js.map +1 -0
- package/dist/queries/RootQuery.d.ts +4 -0
- package/dist/queries/RootQuery.js +70 -0
- package/dist/queries/RootQuery.js.map +1 -0
- package/dist/resolvers/AccountResolver.d.ts +12 -0
- package/dist/resolvers/AccountResolver.js +84 -0
- package/dist/resolvers/AccountResolver.js.map +1 -0
- package/dist/resolvers/ResolverBase.d.ts +5 -0
- package/dist/resolvers/ResolverBase.js +11 -0
- package/dist/resolvers/ResolverBase.js.map +1 -0
- package/dist/resolvers/TweetResolver.d.ts +54 -0
- package/dist/resolvers/TweetResolver.js +332 -0
- package/dist/resolvers/TweetResolver.js.map +1 -0
- package/dist/resolvers/UserResolver.d.ts +38 -0
- package/dist/resolvers/UserResolver.js +253 -0
- package/dist/resolvers/UserResolver.js.map +1 -0
- package/dist/services/AuthService.d.ts +6 -2
- package/dist/services/AuthService.js +4 -3
- package/dist/services/AuthService.js.map +1 -1
- package/dist/services/CacheService.d.ts +12 -7
- package/dist/services/CacheService.js +12 -7
- package/dist/services/CacheService.js.map +1 -1
- package/dist/services/FetcherService.d.ts +32 -12
- package/dist/services/FetcherService.js +45 -14
- package/dist/services/FetcherService.js.map +1 -1
- package/dist/services/accounts/AccountService.d.ts +23 -6
- package/dist/services/accounts/AccountService.js +34 -9
- package/dist/services/accounts/AccountService.js.map +1 -1
- package/dist/services/data/TrendService.d.ts +17 -0
- package/dist/services/data/TrendService.js +116 -0
- package/dist/services/data/TrendService.js.map +1 -0
- package/dist/services/data/TweetService.d.ts +22 -15
- package/dist/services/data/TweetService.js +22 -15
- package/dist/services/data/TweetService.js.map +1 -1
- package/dist/services/data/UserAccountService.d.ts +42 -0
- package/dist/services/data/UserAccountService.js +239 -0
- package/dist/services/data/UserAccountService.js.map +1 -0
- package/dist/services/data/UserService.d.ts +21 -15
- package/dist/services/data/UserService.js +21 -15
- package/dist/services/data/UserService.js.map +1 -1
- package/dist/services/helper/Deserializers.d.ts +19 -0
- package/dist/services/helper/Deserializers.js +115 -0
- package/dist/services/helper/Deserializers.js.map +1 -0
- package/dist/services/helper/Extractors.d.ts +104 -0
- package/dist/services/helper/Extractors.js +432 -0
- package/dist/services/helper/Extractors.js.map +1 -0
- package/dist/services/helper/Urls.d.ts +85 -0
- package/dist/services/helper/Urls.js +130 -0
- package/dist/services/helper/Urls.js.map +1 -0
- package/dist/services/helper/extractors/Trends.d.ts +3 -0
- package/dist/services/helper/extractors/Trends.js +51 -0
- package/dist/services/helper/extractors/Trends.js.map +1 -0
- package/dist/services/helper/urls/Trends.d.ts +7 -0
- package/dist/services/helper/urls/Trends.js +13 -0
- package/dist/services/helper/urls/Trends.js.map +1 -0
- package/dist/types/Authentication.d.ts +27 -2
- package/dist/types/Authentication.js.map +1 -1
- package/dist/types/HTTP.d.ts +3 -1
- package/dist/types/HTTP.js +3 -1
- package/dist/types/HTTP.js.map +1 -1
- package/dist/types/Resolvers.d.ts +6 -1
- package/dist/types/Service.d.ts +30 -0
- package/dist/types/Service.js +19 -0
- package/dist/types/Service.js.map +1 -0
- package/dist/types/Trends.d.ts +50 -0
- package/dist/types/Trends.js +3 -0
- package/dist/types/Trends.js.map +1 -0
- package/dist/types/Tweet.d.ts +40 -0
- package/dist/types/Tweet.js +5 -0
- package/dist/types/Tweet.js.map +1 -0
- package/dist/types/UserAccount.d.ts +19 -0
- package/dist/types/UserAccount.js +4 -0
- package/dist/types/UserAccount.js.map +1 -0
- package/dist/types/data/Errors.d.ts +9 -3
- package/dist/types/data/Errors.js +9 -3
- package/dist/types/data/Errors.js.map +1 -1
- package/dist/types/data/Service.d.ts +19 -5
- package/dist/types/data/Service.js +6 -3
- package/dist/types/data/Service.js.map +1 -1
- package/dist/types/data/Tweet.d.ts +60 -3
- package/dist/types/data/Tweet.js +0 -1
- package/dist/types/data/Tweet.js.map +1 -1
- package/dist/types/data/User.d.ts +20 -1
- package/dist/types/data/User.js +0 -1
- package/dist/types/data/User.js.map +1 -1
- package/dist/types/graphql/Errors.d.ts +15 -0
- package/dist/types/graphql/Errors.js +23 -0
- package/dist/types/graphql/Errors.js.map +1 -0
- package/dist/types/raw/general/Trends.d.ts +324 -0
- package/dist/types/raw/general/Trends.js +3 -0
- package/dist/types/raw/general/Trends.js.map +1 -0
- package/dist/types/raw/user/Tweets.d.ts +2428 -0
- package/dist/types/raw/user/Tweets.js +3 -0
- package/dist/types/raw/user/Tweets.js.map +1 -0
- package/package.json +5 -4
- package/src/index.ts +19 -6
- package/src/services/AuthService.ts +13 -7
- package/src/services/CacheService.ts +12 -7
- package/src/services/FetcherService.ts +62 -21
- package/src/services/accounts/AccountService.ts +38 -12
- package/src/services/data/TweetService.ts +25 -18
- package/src/services/data/UserService.ts +21 -15
- package/src/types/Authentication.ts +27 -2
- package/src/types/HTTP.ts +4 -2
- package/src/types/Resolvers.ts +14 -6
- package/src/types/data/Errors.ts +10 -4
- package/src/types/data/Service.ts +28 -11
- package/src/types/data/Tweet.ts +109 -31
- package/src/types/data/User.ts +47 -17
|
@@ -0,0 +1,84 @@
|
|
|
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 AccountResolver = /** @class */ (function (_super) {
|
|
60
|
+
__extends(AccountResolver, _super);
|
|
61
|
+
// MEMBER METHODS
|
|
62
|
+
function AccountResolver(context) {
|
|
63
|
+
return _super.call(this, context) || this;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @param email The email of the account to be logged into
|
|
67
|
+
* @param userName The username associated with the account
|
|
68
|
+
* @param password The password to the account
|
|
69
|
+
* @returns The cookie string that can be used to authenticate against twitter
|
|
70
|
+
*/
|
|
71
|
+
AccountResolver.prototype.resolveLogin = function (email, userName, password) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0: return [4 /*yield*/, this.context.account.login(email, userName, password)];
|
|
76
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
return AccountResolver;
|
|
82
|
+
}(ResolverBase_1["default"]));
|
|
83
|
+
exports["default"] = AccountResolver;
|
|
84
|
+
//# sourceMappingURL=AccountResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountResolver.js","sourceRoot":"","sources":["../../src/resolvers/AccountResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAY;AACZ,gEAA0C;AAK1C;IAA6C,mCAAY;IACrD,iBAAiB;IACjB,yBAAY,OAAoB;eAC5B,kBAAM,OAAO,CAAC;IAClB,CAAC;IAED;;;;;OAKG;IACG,sCAAY,GAAlB,UAAmB,KAAa,EAAE,QAAgB,EAAE,QAAgB;;;;4BACzD,qBAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAA;4BAAlE,sBAAO,SAA2D,EAAC;;;;KACtE;IACL,sBAAC;AAAD,CAAC,AAfD,CAA6C,yBAAY,GAexD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
var ResolverBase = /** @class */ (function () {
|
|
4
|
+
// MEMBER METHODS
|
|
5
|
+
function ResolverBase(context) {
|
|
6
|
+
this.context = context;
|
|
7
|
+
}
|
|
8
|
+
return ResolverBase;
|
|
9
|
+
}());
|
|
10
|
+
exports["default"] = ResolverBase;
|
|
11
|
+
//# sourceMappingURL=ResolverBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResolverBase.js","sourceRoot":"","sources":["../../src/resolvers/ResolverBase.ts"],"names":[],"mappings":";;AAGA;IAII,iBAAiB;IACjB,sBAAY,OAAoB;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IACL,mBAAC;AAAD,CAAC,AARD,IAQC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import ResolverBase from './ResolverBase';
|
|
2
|
+
import { TweetFilter } from '../types/Tweet';
|
|
3
|
+
import { DataContext } from '../types/Service';
|
|
4
|
+
export default class TweetResolver extends ResolverBase {
|
|
5
|
+
constructor(context: DataContext);
|
|
6
|
+
/**
|
|
7
|
+
* @returns The details of the tweet with the given id
|
|
8
|
+
* @param id The id of the tweet which is to be fetched
|
|
9
|
+
*/
|
|
10
|
+
resolveTweet(id: string): Promise<any>;
|
|
11
|
+
/**
|
|
12
|
+
* @returns The list of tweets matching the given filter
|
|
13
|
+
* @param filter The filter to be used for fetching matching tweets
|
|
14
|
+
* @param count The number of tweets to fetch
|
|
15
|
+
* @param cursor The cursor to the batch of tweets to fetch
|
|
16
|
+
*/
|
|
17
|
+
resolveTweets(filter: TweetFilter, count: number, cursor: string): Promise<any[]>;
|
|
18
|
+
/**
|
|
19
|
+
* @returns The list of quotes of the given tweet
|
|
20
|
+
* @param id The id of the tweet whose quotes are to be fetched
|
|
21
|
+
* @param count The number of quotes to be fetched
|
|
22
|
+
* @param all Whether to fetch all quotes or not
|
|
23
|
+
* @param cursor The cursor to the batch of tweet quotes to fetch
|
|
24
|
+
* @param quoteCount The total number of quotes of the given tweet
|
|
25
|
+
*/
|
|
26
|
+
resolveTweetQuotes(id: string, count: number, all: boolean, cursor: string, quoteCount: number): Promise<any[]>;
|
|
27
|
+
/**
|
|
28
|
+
* @returns The list of likers of the given tweet
|
|
29
|
+
* @param id The id of the tweet whose likers are to be fetched
|
|
30
|
+
* @param count The total number of likers to fetch
|
|
31
|
+
* @param all Whether to fetch all the likers of the tweet
|
|
32
|
+
* @param cursor The cursor to the batch of likers to fetch
|
|
33
|
+
* @param likesCount The total number of like of the tweet
|
|
34
|
+
*/
|
|
35
|
+
resolveTweetLikers(id: string, count: number, all: boolean, cursor: string, likesCount: number): Promise<any[]>;
|
|
36
|
+
/**
|
|
37
|
+
* @returns The list of retweeters of the given tweet
|
|
38
|
+
* @param id The id of the tweet whose retweeters are to be fetched
|
|
39
|
+
* @param count The total number of retweeters to fetch
|
|
40
|
+
* @param all Whether to fetch all retweeters
|
|
41
|
+
* @param cursor The cursor to the batch of retweeters to fetch
|
|
42
|
+
* @param retweetsCount The total number of retweets of the
|
|
43
|
+
*/
|
|
44
|
+
resolveTweetRetweeters(id: string, count: number, all: boolean, cursor: string, retweetsCount: number): Promise<any[]>;
|
|
45
|
+
/**
|
|
46
|
+
* @returns The list of replies of the given tweet
|
|
47
|
+
* @param id The id of the tweet whose replies are to be fetched
|
|
48
|
+
* @param count The total number of replies to fetch
|
|
49
|
+
* @param all Whether to fetch list of all replies
|
|
50
|
+
* @param cursor The cursor to the batch of replies to fetch
|
|
51
|
+
* @param repliesCount The total number of replies to the target tweet
|
|
52
|
+
*/
|
|
53
|
+
resolveTweetReplies(id: string, count: number, all: boolean, cursor: string, repliesCount: number): Promise<any[]>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
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
|
+
var _a;
|
|
94
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
95
|
+
var tweets, next, total, batchSize, res;
|
|
96
|
+
return __generator(this, function (_b) {
|
|
97
|
+
switch (_b.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
tweets = [];
|
|
100
|
+
next = new Service_1.Cursor(cursor);
|
|
101
|
+
total = 0;
|
|
102
|
+
batchSize = 20;
|
|
103
|
+
// Checking if the given tweet filter is valid or not
|
|
104
|
+
if (!(filter.fromUsers || filter.toUsers || filter.words || filter.hashtags || filter.mentions || filter.quoted)) {
|
|
105
|
+
throw new Error(Errors_1.ValidationErrors.InvalidTweetFilter);
|
|
106
|
+
}
|
|
107
|
+
// If required count less than batch size, setting batch size to required count
|
|
108
|
+
batchSize = (count < batchSize) ? count : batchSize;
|
|
109
|
+
_b.label = 1;
|
|
110
|
+
case 1:
|
|
111
|
+
if (!(total < count)) return [3 /*break*/, 3];
|
|
112
|
+
// If this is the last batch, change batch size to number of remaining tweets
|
|
113
|
+
batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
|
|
114
|
+
return [4 /*yield*/, this.context.tweets.getTweets(filter, count, next.value)];
|
|
115
|
+
case 2:
|
|
116
|
+
res = _b.sent();
|
|
117
|
+
// If data is available
|
|
118
|
+
if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
|
|
119
|
+
// Adding fetched tweets to list of tweets
|
|
120
|
+
tweets = tweets.concat(res.list);
|
|
121
|
+
// Updating total tweets fetched
|
|
122
|
+
total = tweets.length;
|
|
123
|
+
// Getting cursor to next batch
|
|
124
|
+
next = res.next;
|
|
125
|
+
}
|
|
126
|
+
// If no more data is available
|
|
127
|
+
else {
|
|
128
|
+
return [3 /*break*/, 3];
|
|
129
|
+
}
|
|
130
|
+
return [3 /*break*/, 1];
|
|
131
|
+
case 3:
|
|
132
|
+
// Adding the cursor to the end of list of data
|
|
133
|
+
tweets.push(next);
|
|
134
|
+
return [2 /*return*/, tweets];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* @returns The list of quotes of the given tweet
|
|
141
|
+
* @param id The id of the tweet whose quotes are to be fetched
|
|
142
|
+
* @param count The number of quotes to be fetched
|
|
143
|
+
* @param all Whether to fetch all quotes or not
|
|
144
|
+
* @param cursor The cursor to the batch of tweet quotes to fetch
|
|
145
|
+
* @param quoteCount The total number of quotes of the given tweet
|
|
146
|
+
*/
|
|
147
|
+
TweetResolver.prototype.resolveTweetQuotes = function (id, count, all, cursor, quoteCount) {
|
|
148
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
149
|
+
var quotes, filter;
|
|
150
|
+
return __generator(this, function (_a) {
|
|
151
|
+
switch (_a.label) {
|
|
152
|
+
case 0:
|
|
153
|
+
quotes = [];
|
|
154
|
+
// If all tweets are to be fetched
|
|
155
|
+
count = (all || count > quoteCount) ? quoteCount : count;
|
|
156
|
+
filter = {
|
|
157
|
+
words: [],
|
|
158
|
+
hashtags: [],
|
|
159
|
+
fromUsers: [],
|
|
160
|
+
toUsers: [],
|
|
161
|
+
mentions: [],
|
|
162
|
+
startDate: '',
|
|
163
|
+
endDate: '',
|
|
164
|
+
quoted: id
|
|
165
|
+
};
|
|
166
|
+
return [4 /*yield*/, this.resolveTweets(filter, count, cursor)];
|
|
167
|
+
case 1:
|
|
168
|
+
// Fetching the quotes using resolveTweets method
|
|
169
|
+
quotes = _a.sent();
|
|
170
|
+
return [2 /*return*/, quotes];
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* @returns The list of likers of the given tweet
|
|
177
|
+
* @param id The id of the tweet whose likers are to be fetched
|
|
178
|
+
* @param count The total number of likers to fetch
|
|
179
|
+
* @param all Whether to fetch all the likers of the tweet
|
|
180
|
+
* @param cursor The cursor to the batch of likers to fetch
|
|
181
|
+
* @param likesCount The total number of like of the tweet
|
|
182
|
+
*/
|
|
183
|
+
TweetResolver.prototype.resolveTweetLikers = function (id, count, all, cursor, likesCount) {
|
|
184
|
+
var _a;
|
|
185
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
186
|
+
var likers, next, total, batchSize, res;
|
|
187
|
+
return __generator(this, function (_b) {
|
|
188
|
+
switch (_b.label) {
|
|
189
|
+
case 0:
|
|
190
|
+
likers = [];
|
|
191
|
+
next = new Service_1.Cursor(cursor);
|
|
192
|
+
total = 0;
|
|
193
|
+
batchSize = 20;
|
|
194
|
+
// If all likers are to be fetched
|
|
195
|
+
count = (all || count > likesCount) ? likesCount : count;
|
|
196
|
+
// If required count less than batch size, setting batch size to required count
|
|
197
|
+
batchSize = (count < batchSize) ? count : batchSize;
|
|
198
|
+
_b.label = 1;
|
|
199
|
+
case 1:
|
|
200
|
+
if (!(total < count)) return [3 /*break*/, 3];
|
|
201
|
+
// If this is the last batch, change batch size to number of remaining likers
|
|
202
|
+
batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
|
|
203
|
+
return [4 /*yield*/, this.context.tweets.getTweetLikers(id, count, next.value)];
|
|
204
|
+
case 2:
|
|
205
|
+
res = _b.sent();
|
|
206
|
+
// If data is available
|
|
207
|
+
if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
|
|
208
|
+
// Adding fetched likers to list of likers
|
|
209
|
+
likers = likers.concat(res.list);
|
|
210
|
+
// Updating total likers fetched
|
|
211
|
+
total = likers.length;
|
|
212
|
+
// Getting cursor to next batch
|
|
213
|
+
next = res.next;
|
|
214
|
+
}
|
|
215
|
+
// If no more data is available
|
|
216
|
+
else {
|
|
217
|
+
return [3 /*break*/, 3];
|
|
218
|
+
}
|
|
219
|
+
return [3 /*break*/, 1];
|
|
220
|
+
case 3:
|
|
221
|
+
// Adding the cursor to the end of list of data
|
|
222
|
+
likers.push(next);
|
|
223
|
+
return [2 /*return*/, likers];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* @returns The list of retweeters of the given tweet
|
|
230
|
+
* @param id The id of the tweet whose retweeters are to be fetched
|
|
231
|
+
* @param count The total number of retweeters to fetch
|
|
232
|
+
* @param all Whether to fetch all retweeters
|
|
233
|
+
* @param cursor The cursor to the batch of retweeters to fetch
|
|
234
|
+
* @param retweetsCount The total number of retweets of the
|
|
235
|
+
*/
|
|
236
|
+
TweetResolver.prototype.resolveTweetRetweeters = function (id, count, all, cursor, retweetsCount) {
|
|
237
|
+
var _a;
|
|
238
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
239
|
+
var retweeters, next, total, batchSize, res;
|
|
240
|
+
return __generator(this, function (_b) {
|
|
241
|
+
switch (_b.label) {
|
|
242
|
+
case 0:
|
|
243
|
+
retweeters = [];
|
|
244
|
+
next = new Service_1.Cursor(cursor);
|
|
245
|
+
total = 0;
|
|
246
|
+
batchSize = 20;
|
|
247
|
+
// If all retweeters are to be fetched
|
|
248
|
+
count = (all || count > retweetsCount) ? retweetsCount : count;
|
|
249
|
+
// If required count less than batch size, setting batch size to required count
|
|
250
|
+
batchSize = (count < batchSize) ? count : batchSize;
|
|
251
|
+
_b.label = 1;
|
|
252
|
+
case 1:
|
|
253
|
+
if (!(total < count)) return [3 /*break*/, 3];
|
|
254
|
+
// If this is the last batch, change batch size to number of remaining retweeters
|
|
255
|
+
batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
|
|
256
|
+
return [4 /*yield*/, this.context.tweets.getTweetRetweeters(id, count, next.value)];
|
|
257
|
+
case 2:
|
|
258
|
+
res = _b.sent();
|
|
259
|
+
// If data is available
|
|
260
|
+
if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
|
|
261
|
+
// Adding fetched retweeters to list of retweeters
|
|
262
|
+
retweeters = retweeters.concat(res.list);
|
|
263
|
+
// Updating total retweeters fetched
|
|
264
|
+
total = retweeters.length;
|
|
265
|
+
// Getting cursor to next batch
|
|
266
|
+
next = res.next;
|
|
267
|
+
}
|
|
268
|
+
// If no more data is available
|
|
269
|
+
else {
|
|
270
|
+
return [3 /*break*/, 3];
|
|
271
|
+
}
|
|
272
|
+
return [3 /*break*/, 1];
|
|
273
|
+
case 3:
|
|
274
|
+
// Adding the cursor to the end of list of data
|
|
275
|
+
retweeters.push(next);
|
|
276
|
+
return [2 /*return*/, retweeters];
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* @returns The list of replies of the given tweet
|
|
283
|
+
* @param id The id of the tweet whose replies are to be fetched
|
|
284
|
+
* @param count The total number of replies to fetch
|
|
285
|
+
* @param all Whether to fetch list of all replies
|
|
286
|
+
* @param cursor The cursor to the batch of replies to fetch
|
|
287
|
+
* @param repliesCount The total number of replies to the target tweet
|
|
288
|
+
*/
|
|
289
|
+
TweetResolver.prototype.resolveTweetReplies = function (id, count, all, cursor, repliesCount) {
|
|
290
|
+
var _a;
|
|
291
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
292
|
+
var replies, next, total, res;
|
|
293
|
+
return __generator(this, function (_b) {
|
|
294
|
+
switch (_b.label) {
|
|
295
|
+
case 0:
|
|
296
|
+
replies = [];
|
|
297
|
+
next = new Service_1.Cursor(cursor);
|
|
298
|
+
total = 0;
|
|
299
|
+
// If all replies are to be fetched
|
|
300
|
+
count = (all || count > repliesCount) ? repliesCount : count;
|
|
301
|
+
_b.label = 1;
|
|
302
|
+
case 1:
|
|
303
|
+
if (!(total < count)) return [3 /*break*/, 3];
|
|
304
|
+
return [4 /*yield*/, this.context.tweets.getTweetReplies(id, next.value)];
|
|
305
|
+
case 2:
|
|
306
|
+
res = _b.sent();
|
|
307
|
+
// If data is available
|
|
308
|
+
if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
|
|
309
|
+
// Adding fetched replies to list of replies
|
|
310
|
+
replies = replies.concat(res.list);
|
|
311
|
+
// Updating total replies fetched
|
|
312
|
+
total = replies.length;
|
|
313
|
+
// Getting cursor to next batch
|
|
314
|
+
next = res.next;
|
|
315
|
+
}
|
|
316
|
+
// If no more data is available
|
|
317
|
+
else {
|
|
318
|
+
return [3 /*break*/, 3];
|
|
319
|
+
}
|
|
320
|
+
return [3 /*break*/, 1];
|
|
321
|
+
case 3:
|
|
322
|
+
// Adding the cursor to the end of list of data
|
|
323
|
+
replies.push(next);
|
|
324
|
+
return [2 /*return*/, replies];
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
};
|
|
329
|
+
return TweetResolver;
|
|
330
|
+
}(ResolverBase_1["default"]));
|
|
331
|
+
exports["default"] = TweetResolver;
|
|
332
|
+
//# 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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1
|
+
import ResolverBase 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
|
+
}
|