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
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles all operations related to a user's account, such as loggin in, managing account, etc
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
1
5
|
export declare class AccountService {
|
|
6
|
+
/** The AuthService instance to use for authentication. */
|
|
2
7
|
private auth;
|
|
8
|
+
/** The current guest credentials to use. */
|
|
3
9
|
private guestCreds;
|
|
10
|
+
/** The cookies received from Twitter after logging in. */
|
|
4
11
|
private cookies;
|
|
12
|
+
/** The flow token received after execution of current flow. */
|
|
5
13
|
private flowToken;
|
|
6
14
|
constructor();
|
|
7
15
|
/**
|
|
@@ -9,30 +17,39 @@ export declare class AccountService {
|
|
|
9
17
|
*/
|
|
10
18
|
private getGuestCredentials;
|
|
11
19
|
/**
|
|
12
|
-
*
|
|
20
|
+
* Step 1: Initiates login
|
|
21
|
+
* @internal
|
|
13
22
|
*/
|
|
14
23
|
private initiateLogin;
|
|
15
24
|
/**
|
|
16
|
-
*
|
|
25
|
+
* Step 2: Does something
|
|
26
|
+
* @internal
|
|
17
27
|
*/
|
|
18
28
|
private jsInstrumentationSubtask;
|
|
19
29
|
/**
|
|
20
|
-
*
|
|
30
|
+
* Step 3: Takes the email for login
|
|
31
|
+
* @internal
|
|
21
32
|
*/
|
|
22
33
|
private enterUserIdentifier;
|
|
23
34
|
/**
|
|
24
|
-
*
|
|
35
|
+
* Step 4: Takes the username for login
|
|
36
|
+
* @internal
|
|
25
37
|
*/
|
|
26
38
|
private enterAlternateUserIdentifier;
|
|
27
39
|
/**
|
|
28
|
-
*
|
|
40
|
+
* Step 5: Takes the password for login
|
|
41
|
+
* @internal
|
|
29
42
|
*/
|
|
30
43
|
private enterPassword;
|
|
31
44
|
/**
|
|
32
|
-
*
|
|
45
|
+
* Step 6: Gets the actual cookies
|
|
46
|
+
* @internal
|
|
33
47
|
*/
|
|
34
48
|
private accountDuplicationCheck;
|
|
35
49
|
/**
|
|
50
|
+
* Login to Twitter using the given credentials and get back the cookies.
|
|
51
|
+
* @public
|
|
52
|
+
*
|
|
36
53
|
* @param email The email of the account to be logged into
|
|
37
54
|
* @param userName The username associated with the given account
|
|
38
55
|
* @param password The password to the account
|
|
@@ -48,6 +48,10 @@ var AuthService_1 = require("../AuthService");
|
|
|
48
48
|
var LoginFlows_1 = __importDefault(require("./LoginFlows"));
|
|
49
49
|
var Headers_1 = require("../helper/Headers");
|
|
50
50
|
var cookiejar_1 = require("cookiejar");
|
|
51
|
+
/**
|
|
52
|
+
* Handles all operations related to a user's account, such as loggin in, managing account, etc
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
51
55
|
var AccountService = /** @class */ (function () {
|
|
52
56
|
// MEMBER METHODS
|
|
53
57
|
function AccountService() {
|
|
@@ -77,7 +81,8 @@ var AccountService = /** @class */ (function () {
|
|
|
77
81
|
});
|
|
78
82
|
};
|
|
79
83
|
/**
|
|
80
|
-
*
|
|
84
|
+
* Step 1: Initiates login
|
|
85
|
+
* @internal
|
|
81
86
|
*/
|
|
82
87
|
AccountService.prototype.initiateLogin = function () {
|
|
83
88
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -107,7 +112,8 @@ var AccountService = /** @class */ (function () {
|
|
|
107
112
|
});
|
|
108
113
|
};
|
|
109
114
|
/**
|
|
110
|
-
*
|
|
115
|
+
* Step 2: Does something
|
|
116
|
+
* @internal
|
|
111
117
|
*/
|
|
112
118
|
AccountService.prototype.jsInstrumentationSubtask = function () {
|
|
113
119
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -135,7 +141,8 @@ var AccountService = /** @class */ (function () {
|
|
|
135
141
|
});
|
|
136
142
|
};
|
|
137
143
|
/**
|
|
138
|
-
*
|
|
144
|
+
* Step 3: Takes the email for login
|
|
145
|
+
* @internal
|
|
139
146
|
*/
|
|
140
147
|
AccountService.prototype.enterUserIdentifier = function (email) {
|
|
141
148
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -163,7 +170,8 @@ var AccountService = /** @class */ (function () {
|
|
|
163
170
|
});
|
|
164
171
|
};
|
|
165
172
|
/**
|
|
166
|
-
*
|
|
173
|
+
* Step 4: Takes the username for login
|
|
174
|
+
* @internal
|
|
167
175
|
*/
|
|
168
176
|
AccountService.prototype.enterAlternateUserIdentifier = function (userName) {
|
|
169
177
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -191,7 +199,8 @@ var AccountService = /** @class */ (function () {
|
|
|
191
199
|
});
|
|
192
200
|
};
|
|
193
201
|
/**
|
|
194
|
-
*
|
|
202
|
+
* Step 5: Takes the password for login
|
|
203
|
+
* @internal
|
|
195
204
|
*/
|
|
196
205
|
AccountService.prototype.enterPassword = function (password) {
|
|
197
206
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -219,7 +228,8 @@ var AccountService = /** @class */ (function () {
|
|
|
219
228
|
});
|
|
220
229
|
};
|
|
221
230
|
/**
|
|
222
|
-
*
|
|
231
|
+
* Step 6: Gets the actual cookies
|
|
232
|
+
* @internal
|
|
223
233
|
*/
|
|
224
234
|
AccountService.prototype.accountDuplicationCheck = function () {
|
|
225
235
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -239,7 +249,7 @@ var AccountService = /** @class */ (function () {
|
|
|
239
249
|
_e)]))];
|
|
240
250
|
case 2:
|
|
241
251
|
res = _f.sent();
|
|
242
|
-
//
|
|
252
|
+
// Getting the cookies from the set-cookie header of the reponse.
|
|
243
253
|
this.cookies = new cookiejar_1.CookieJar().setCookies(res.headers[0]['Set-Cookie']);
|
|
244
254
|
// Getting the flow token
|
|
245
255
|
this.flowToken = res.data['flow_token'];
|
|
@@ -249,6 +259,9 @@ var AccountService = /** @class */ (function () {
|
|
|
249
259
|
});
|
|
250
260
|
};
|
|
251
261
|
/**
|
|
262
|
+
* Login to Twitter using the given credentials and get back the cookies.
|
|
263
|
+
* @public
|
|
264
|
+
*
|
|
252
265
|
* @param email The email of the account to be logged into
|
|
253
266
|
* @param userName The username associated with the given account
|
|
254
267
|
* @param password The password to the account
|
|
@@ -259,10 +272,22 @@ var AccountService = /** @class */ (function () {
|
|
|
259
272
|
return __generator(this, function (_a) {
|
|
260
273
|
switch (_a.label) {
|
|
261
274
|
case 0:
|
|
262
|
-
|
|
275
|
+
/**
|
|
276
|
+
* This works by sending a chain of request that are required for login to twitter.
|
|
277
|
+
* Each method in the chain returns a flow token that must be provied as payload in the next method in the chain.
|
|
278
|
+
* Each such method is called a subtask.
|
|
279
|
+
* Each subtask sets the {@link flowToken} property of the class which is then given in the payload of the next subtask.
|
|
280
|
+
* The final subtask returns the headers which actually contains the cookie in the 'set-cookie' field.
|
|
281
|
+
*/
|
|
263
282
|
return [4 /*yield*/, this.initiateLogin()];
|
|
264
283
|
case 1:
|
|
265
|
-
|
|
284
|
+
/**
|
|
285
|
+
* This works by sending a chain of request that are required for login to twitter.
|
|
286
|
+
* Each method in the chain returns a flow token that must be provied as payload in the next method in the chain.
|
|
287
|
+
* Each such method is called a subtask.
|
|
288
|
+
* Each subtask sets the {@link flowToken} property of the class which is then given in the payload of the next subtask.
|
|
289
|
+
* The final subtask returns the headers which actually contains the cookie in the 'set-cookie' field.
|
|
290
|
+
*/
|
|
266
291
|
_a.sent();
|
|
267
292
|
return [4 /*yield*/, this.jsInstrumentationSubtask()];
|
|
268
293
|
case 2:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountService.js","sourceRoot":"","sources":["../../../src/services/accounts/AccountService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAW;AACX,6CAAkD;AAElD,WAAW;AACX,8CAA6C;AAK7C,UAAU;AACV,4DAAsC;AACtC,6CAAgD;AAChD,uCAA8C;AAE9C;
|
|
1
|
+
{"version":3,"file":"AccountService.js","sourceRoot":"","sources":["../../../src/services/accounts/AccountService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAW;AACX,6CAAkD;AAElD,WAAW;AACX,8CAA6C;AAK7C,UAAU;AACV,4DAAsC;AACtC,6CAAgD;AAChD,uCAA8C;AAE9C;;;GAGG;AACH;IAcI,iBAAiB;IACjB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AAA;;wBAAjD,SAAiD,CAAC;wBAClD,qBAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAA;;wBAAlC,SAAkC,CAAC;wBACnC,qBAAM,IAAI,CAAC,uBAAuB,EAAE,EAAA;;wBAApC,SAAoC,CAAC;wBAErC,8BAA8B;wBAC9B,sBAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAC;;;;KACjC;IACL,qBAAC;AAAD,CAAC,AAnKD,IAmKC;AAnKY,wCAAc"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AuthService } from "../AuthService";
|
|
2
|
+
import { FetcherService } from "../FetcherService";
|
|
3
|
+
import Trends, { trendOn } from "../../types/Trends";
|
|
4
|
+
/**
|
|
5
|
+
* A class that handles trend-related functionalities.
|
|
6
|
+
*
|
|
7
|
+
* @class TrendService
|
|
8
|
+
* @extends FetcherService
|
|
9
|
+
*
|
|
10
|
+
* @param {AuthService} auth - An instance of the `AuthService` class.
|
|
11
|
+
*
|
|
12
|
+
* @property {(type: trendOn) => Promise<Trends>} getTrends - A method to retrieve trends based on the specified type.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TrendService extends FetcherService {
|
|
15
|
+
constructor(auth: AuthService);
|
|
16
|
+
getTrends(type: trendOn): Promise<Trends>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (_) try {
|
|
56
|
+
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;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.__esModule = true;
|
|
77
|
+
exports.TrendService = void 0;
|
|
78
|
+
var FetcherService_1 = require("../FetcherService");
|
|
79
|
+
// URLS
|
|
80
|
+
var Urls = __importStar(require("../helper/urls/Trends"));
|
|
81
|
+
var Trends_1 = require("../helper/extractors/Trends");
|
|
82
|
+
/**
|
|
83
|
+
* A class that handles trend-related functionalities.
|
|
84
|
+
*
|
|
85
|
+
* @class TrendService
|
|
86
|
+
* @extends FetcherService
|
|
87
|
+
*
|
|
88
|
+
* @param {AuthService} auth - An instance of the `AuthService` class.
|
|
89
|
+
*
|
|
90
|
+
* @property {(type: trendOn) => Promise<Trends>} getTrends - A method to retrieve trends based on the specified type.
|
|
91
|
+
*/
|
|
92
|
+
var TrendService = /** @class */ (function (_super) {
|
|
93
|
+
__extends(TrendService, _super);
|
|
94
|
+
function TrendService(auth) {
|
|
95
|
+
var _this = _super.call(this, auth) || this;
|
|
96
|
+
_this.isAuthenticated = auth.isAuthenticated;
|
|
97
|
+
return _this;
|
|
98
|
+
}
|
|
99
|
+
TrendService.prototype.getTrends = function (type) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
+
var res, Data;
|
|
102
|
+
return __generator(this, function (_a) {
|
|
103
|
+
switch (_a.label) {
|
|
104
|
+
case 0: return [4 /*yield*/, this.request(Urls.trendsUrl(type), false)];
|
|
105
|
+
case 1:
|
|
106
|
+
res = _a.sent();
|
|
107
|
+
Data = (0, Trends_1.extractTrendData)(res.data);
|
|
108
|
+
return [2 /*return*/, Data];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
return TrendService;
|
|
114
|
+
}(FetcherService_1.FetcherService));
|
|
115
|
+
exports.TrendService = TrendService;
|
|
116
|
+
//# sourceMappingURL=TrendService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrendService.js","sourceRoot":"","sources":["../../../src/services/data/TrendService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,oDAAmD;AAMnD,OAAO;AACP,0DAA8C;AAC9C,sDAA+D;AAE/D;;;;;;;;;GASG;AAEH;IAAkC,gCAAc;IAC5C,sBAAY,IAAiB;QAA7B,YACI,kBAAM,IAAI,CAAC,SAEd;QADG,KAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;;IAChD,CAAC;IAEK,gCAAS,GAAf,UAAgB,IAAY;;;;;4BACd,qBAAM,IAAI,CAAC,OAAO,CAAY,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,EAAA;;wBAAhE,GAAG,GAAG,SAA0D;wBAChE,IAAI,GAAG,IAAA,yBAAgB,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC;wBACtC,sBAAO,IAAI,EAAC;;;;KACf;IACL,mBAAC;AAAD,CAAC,AAXD,CAAkC,+BAAc,GAW/C;AAXY,oCAAY"}
|
|
@@ -4,34 +4,41 @@ import { TweetFilter, Tweet } from "../../types/data/Tweet";
|
|
|
4
4
|
import { User } from "../../types/data/User";
|
|
5
5
|
import { CursoredData } from '../../types/data/Service';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Handles fetching of data related to tweets.
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export declare class TweetService extends FetcherService {
|
|
11
|
+
/**
|
|
12
|
+
* @param auth The AuthService instance to use for authentication.
|
|
13
|
+
*/
|
|
10
14
|
constructor(auth: AuthService);
|
|
11
15
|
/**
|
|
12
|
-
* @
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @
|
|
16
|
+
* @param filter The filter be used for searching the tweets.
|
|
17
|
+
* @param count The number of tweets to fetch.
|
|
18
|
+
* @param cursor The cursor to the next batch of tweets. If blank, first batch is fetched.
|
|
19
|
+
* @returns The list of tweets that match the given filter.
|
|
20
|
+
* @remarks count must be >= 1 and <= 100.
|
|
16
21
|
*/
|
|
17
22
|
getTweets(filter: TweetFilter, count: number, cursor: string): Promise<CursoredData<Tweet>>;
|
|
18
23
|
/**
|
|
19
|
-
* @
|
|
20
|
-
* @
|
|
24
|
+
* @param tweetId The rest id of the target tweet.
|
|
25
|
+
* @returns The details of a single tweet with the given tweet id.
|
|
21
26
|
*/
|
|
22
27
|
getTweetById(tweetId: string): Promise<Tweet>;
|
|
23
28
|
/**
|
|
24
|
-
* @
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @
|
|
29
|
+
* @param tweetId The rest id of the target tweet.
|
|
30
|
+
* @param count The batch size of the list.
|
|
31
|
+
* @param cursor The cursor to the next batch of users. If blank, first batch is fetched.
|
|
32
|
+
* @returns The list of users who liked the given tweet.
|
|
33
|
+
* @remarks count must be >= 10 (when no cursor is provided) and <= 100.
|
|
28
34
|
*/
|
|
29
35
|
getTweetLikers(tweetId: string, count: number, cursor: string): Promise<CursoredData<User>>;
|
|
30
36
|
/**
|
|
31
|
-
* @
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @
|
|
37
|
+
* @param tweetId The rest id of the target tweet.
|
|
38
|
+
* @param count The batch size of the list.
|
|
39
|
+
* @param cursor The cursor to the next batch of users. If blank, first batch is fetched.
|
|
40
|
+
* @returns The list of users who retweeted the given tweet.
|
|
41
|
+
* @remarks count must be >= 10 (when no cursor is provided) and <= 100.
|
|
35
42
|
*/
|
|
36
43
|
getTweetRetweeters(tweetId: string, count: number, cursor: string): Promise<CursoredData<User>>;
|
|
37
44
|
}
|
|
@@ -88,19 +88,24 @@ var TweetDeserializers = __importStar(require("../helper/deserializers/Tweets"))
|
|
|
88
88
|
// PARSERS
|
|
89
89
|
var Parser_1 = require("../helper/Parser");
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* Handles fetching of data related to tweets.
|
|
92
|
+
* @public
|
|
92
93
|
*/
|
|
93
94
|
var TweetService = /** @class */ (function (_super) {
|
|
94
95
|
__extends(TweetService, _super);
|
|
95
96
|
// MEMBER METHODS
|
|
97
|
+
/**
|
|
98
|
+
* @param auth The AuthService instance to use for authentication.
|
|
99
|
+
*/
|
|
96
100
|
function TweetService(auth) {
|
|
97
101
|
return _super.call(this, auth) || this;
|
|
98
102
|
}
|
|
99
103
|
/**
|
|
100
|
-
* @
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* @
|
|
104
|
+
* @param filter The filter be used for searching the tweets.
|
|
105
|
+
* @param count The number of tweets to fetch.
|
|
106
|
+
* @param cursor The cursor to the next batch of tweets. If blank, first batch is fetched.
|
|
107
|
+
* @returns The list of tweets that match the given filter.
|
|
108
|
+
* @remarks count must be >= 1 and <= 100.
|
|
104
109
|
*/
|
|
105
110
|
TweetService.prototype.getTweets = function (filter, count, cursor) {
|
|
106
111
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -128,8 +133,8 @@ var TweetService = /** @class */ (function (_super) {
|
|
|
128
133
|
});
|
|
129
134
|
};
|
|
130
135
|
/**
|
|
131
|
-
* @
|
|
132
|
-
* @
|
|
136
|
+
* @param tweetId The rest id of the target tweet.
|
|
137
|
+
* @returns The details of a single tweet with the given tweet id.
|
|
133
138
|
*/
|
|
134
139
|
TweetService.prototype.getTweetById = function (tweetId) {
|
|
135
140
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -156,10 +161,11 @@ var TweetService = /** @class */ (function (_super) {
|
|
|
156
161
|
});
|
|
157
162
|
};
|
|
158
163
|
/**
|
|
159
|
-
* @
|
|
160
|
-
* @param
|
|
161
|
-
* @param
|
|
162
|
-
* @
|
|
164
|
+
* @param tweetId The rest id of the target tweet.
|
|
165
|
+
* @param count The batch size of the list.
|
|
166
|
+
* @param cursor The cursor to the next batch of users. If blank, first batch is fetched.
|
|
167
|
+
* @returns The list of users who liked the given tweet.
|
|
168
|
+
* @remarks count must be >= 10 (when no cursor is provided) and <= 100.
|
|
163
169
|
*/
|
|
164
170
|
TweetService.prototype.getTweetLikers = function (tweetId, count, cursor) {
|
|
165
171
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -191,10 +197,11 @@ var TweetService = /** @class */ (function (_super) {
|
|
|
191
197
|
});
|
|
192
198
|
};
|
|
193
199
|
/**
|
|
194
|
-
* @
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
197
|
-
* @
|
|
200
|
+
* @param tweetId The rest id of the target tweet.
|
|
201
|
+
* @param count The batch size of the list.
|
|
202
|
+
* @param cursor The cursor to the next batch of users. If blank, first batch is fetched.
|
|
203
|
+
* @returns The list of users who retweeted the given tweet.
|
|
204
|
+
* @remarks count must be >= 10 (when no cursor is provided) and <= 100.
|
|
198
205
|
*/
|
|
199
206
|
TweetService.prototype.getTweetRetweeters = function (tweetId, count, cursor) {
|
|
200
207
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TweetService.js","sourceRoot":"","sources":["../../../src/services/data/TweetService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAW;AACX,oDAAmD;AAYnD,8DAAkD;AAElD,OAAO;AACP,+DAAmD;AAEnD,aAAa;AACb,2EAA+D;AAE/D,gBAAgB;AAChB,+EAAmE;AACnE,iFAAqE;AAErE,UAAU;AACV,2CAAiD;AAEjD
|
|
1
|
+
{"version":3,"file":"TweetService.js","sourceRoot":"","sources":["../../../src/services/data/TweetService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAI,CAAC,EAA9B,CAA8B,CAAC,CAAC;wBAElF,sBAAO;gCACH,IAAI,EAAE,KAAK;gCACX,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;6BAC/B,EAAC;;;;KACL;IAmCL,mBAAC;AAAD,CAAC,AA7KD,CAAkC,+BAAc,GA6K/C;AA7KY,oCAAY"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FetcherService } from '../FetcherService';
|
|
2
|
+
import { AuthService } from '../AuthService';
|
|
3
|
+
import { User } from '../../types/UserAccount';
|
|
4
|
+
import { Tweet } from '../../types/Tweet';
|
|
5
|
+
import { CursoredData } from '../../types/Service';
|
|
6
|
+
/**
|
|
7
|
+
* A service that deals with fetching of data related to user account
|
|
8
|
+
*/
|
|
9
|
+
export declare class UserAccountService extends FetcherService {
|
|
10
|
+
constructor(auth: AuthService);
|
|
11
|
+
/**
|
|
12
|
+
* @returns The user account details of the given user
|
|
13
|
+
* @param screenName The screen name of the target user.
|
|
14
|
+
*/
|
|
15
|
+
getUserAccountDetails(screenName: string): Promise<User>;
|
|
16
|
+
/**
|
|
17
|
+
* @returns The user account details of the user with given rest id
|
|
18
|
+
* @param restId The screen name of the target user.
|
|
19
|
+
*/
|
|
20
|
+
getUserAccountDetailsById(restId: string): Promise<User>;
|
|
21
|
+
/**
|
|
22
|
+
* @returns The list of users followed by the target user
|
|
23
|
+
* @param userId The rest id of the target user
|
|
24
|
+
* @param count The batch size of the list
|
|
25
|
+
* @param cursor The cursor to next batch. If blank, first batch is fetched
|
|
26
|
+
*/
|
|
27
|
+
getUserFollowing(userId: string, count: number, cursor: string): Promise<CursoredData<User>>;
|
|
28
|
+
/**
|
|
29
|
+
* @returns The list of users following the target user
|
|
30
|
+
* @param userId The rest id of the target user
|
|
31
|
+
* @param count The batch size of the list
|
|
32
|
+
* @param cursor The cursor to next batch. If blank, first batch is fetched
|
|
33
|
+
*/
|
|
34
|
+
getUserFollowers(userId: string, count: number, cursor: string): Promise<CursoredData<User>>;
|
|
35
|
+
/**
|
|
36
|
+
* @returns The list of tweets liked by the target user
|
|
37
|
+
* @param userId The rest id of the target user
|
|
38
|
+
* @param count The batch size of the list
|
|
39
|
+
* @param cursor The cursor to next batch. If blank, first batch is fetched
|
|
40
|
+
*/
|
|
41
|
+
getUserLikes(userId: string, count: number, cursor: string): Promise<CursoredData<Tweet>>;
|
|
42
|
+
}
|