rettiwt-api 1.1.2 → 1.1.5
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/README.md +32 -7
- package/dist/endpoints/Endpoints.d.ts +14 -0
- package/dist/endpoints/Endpoints.js +20 -0
- package/dist/endpoints/Endpoints.js.map +1 -0
- package/dist/endpoints/Url.d.ts +5 -0
- package/dist/endpoints/Url.js +12 -0
- package/dist/endpoints/Url.js.map +1 -0
- package/dist/enums/Endpoints.d.ts +25 -0
- package/dist/enums/Endpoints.js +31 -0
- package/dist/enums/Endpoints.js.map +1 -0
- package/dist/enums/Errors.d.ts +20 -0
- package/dist/enums/Errors.js +28 -0
- package/dist/enums/Errors.js.map +1 -0
- package/dist/enums/HTTP.d.ts +17 -0
- package/dist/enums/HTTP.js +23 -0
- package/dist/enums/HTTP.js.map +1 -0
- package/dist/graphql/enums/Errors.d.ts +20 -0
- package/dist/graphql/enums/Errors.js +28 -0
- package/dist/graphql/enums/Errors.js.map +1 -0
- package/dist/graphql/queries/RootQuery.js +10 -3
- package/dist/graphql/queries/RootQuery.js.map +1 -1
- package/dist/graphql/resolvers/AccountResolver.d.ts +3 -3
- package/dist/graphql/resolvers/AccountResolver.js.map +1 -1
- package/dist/graphql/resolvers/ResolverBase.d.ts +14 -3
- package/dist/graphql/resolvers/ResolverBase.js +13 -1
- package/dist/graphql/resolvers/ResolverBase.js.map +1 -1
- package/dist/graphql/resolvers/TweetResolver.d.ts +3 -3
- package/dist/graphql/resolvers/TweetResolver.js +30 -18
- package/dist/graphql/resolvers/TweetResolver.js.map +1 -1
- package/dist/graphql/resolvers/UserResolver.d.ts +4 -4
- package/dist/graphql/resolvers/UserResolver.js +23 -19
- package/dist/graphql/resolvers/UserResolver.js.map +1 -1
- package/dist/graphql/types/Errors.d.ts +20 -0
- package/dist/graphql/types/Errors.js +28 -0
- package/dist/graphql/types/Errors.js.map +1 -0
- package/dist/graphql/types/TweetTypes.js +2 -2
- package/dist/graphql/types/TweetTypes.js.map +1 -1
- package/dist/index.d.ts +31 -15
- package/dist/index.js +32 -17
- package/dist/index.js.map +1 -1
- package/dist/middlewares/Authentication.d.ts +0 -0
- package/dist/middlewares/Authentication.js +2 -0
- package/dist/middlewares/Authentication.js.map +1 -0
- package/dist/models/args/TweetFilter.d.ts +59 -0
- package/dist/models/args/TweetFilter.js +101 -0
- package/dist/models/args/TweetFilter.js.map +1 -0
- package/dist/models/args/TweetListArgs.d.ts +21 -0
- package/dist/models/args/TweetListArgs.js +54 -0
- package/dist/models/args/TweetListArgs.js.map +1 -0
- package/dist/models/args/UserListArgs.d.ts +21 -0
- package/dist/models/args/UserListArgs.js +54 -0
- package/dist/models/args/UserListArgs.js.map +1 -0
- package/dist/models/auth/AuthCookie.d.ts +21 -0
- package/dist/models/auth/AuthCookie.js +33 -0
- package/dist/models/auth/AuthCookie.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +34 -0
- package/dist/models/data/CursoredData.js +42 -0
- package/dist/models/data/CursoredData.js.map +1 -0
- package/dist/models/data/DataValidationError.d.ts +18 -0
- package/dist/models/data/DataValidationError.js +21 -0
- package/dist/models/data/DataValidationError.js.map +1 -0
- package/dist/models/data/Errors.d.ts +18 -0
- package/dist/models/data/Errors.js +21 -0
- package/dist/models/data/Errors.js.map +1 -0
- package/dist/models/data/Service.d.ts +33 -0
- package/dist/models/data/Service.js +41 -0
- package/dist/models/data/Service.js.map +1 -0
- package/dist/models/data/Tweet.d.ts +53 -0
- package/dist/models/data/Tweet.js +104 -0
- package/dist/models/data/Tweet.js.map +1 -0
- package/dist/models/data/User.d.ts +41 -0
- package/dist/models/data/User.js +32 -0
- package/dist/models/data/User.js.map +1 -0
- package/dist/models/errors/DataValidationError.d.ts +20 -0
- package/dist/models/errors/DataValidationError.js +23 -0
- package/dist/models/errors/DataValidationError.js.map +1 -0
- package/dist/models/query/Variables.d.ts +2 -0
- package/dist/models/query/Variables.js +10 -0
- package/dist/models/query/Variables.js.map +1 -0
- package/dist/requests/Url.d.ts +5 -0
- package/dist/requests/Url.js +12 -0
- package/dist/requests/Url.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +9 -10
- package/dist/server.js.map +1 -1
- package/dist/services/accounts/AccountService.d.ts +6 -0
- package/dist/services/accounts/AccountService.js +6 -0
- package/dist/services/accounts/AccountService.js.map +1 -1
- package/dist/services/auth/AccountService.d.ts +88 -0
- package/dist/services/auth/AccountService.js +392 -0
- package/dist/services/auth/AccountService.js.map +1 -0
- package/dist/services/auth/AuthService.d.ts +31 -0
- package/dist/services/auth/AuthService.js +118 -0
- package/dist/services/auth/AuthService.js.map +1 -0
- package/dist/services/auth/LoginFlows.d.ts +77 -0
- package/dist/services/auth/LoginFlows.js +92 -0
- package/dist/services/auth/LoginFlows.js.map +1 -0
- package/dist/services/data/TweetService.d.ts +46 -16
- package/dist/services/data/TweetService.js +71 -54
- package/dist/services/data/TweetService.js.map +1 -1
- package/dist/services/data/UserService.d.ts +45 -21
- package/dist/services/data/UserService.js +78 -75
- package/dist/services/data/UserService.js.map +1 -1
- package/dist/services/helper/Headers.d.ts +4 -4
- package/dist/services/helper/Headers.js.map +1 -1
- package/dist/services/helper/Parser.d.ts +2 -2
- package/dist/services/helper/Parser.js.map +1 -1
- package/dist/services/helper/extractors/Tweets.d.ts +6 -6
- package/dist/services/helper/extractors/Tweets.js +1 -1
- package/dist/services/helper/extractors/Tweets.js.map +1 -1
- package/dist/services/helper/extractors/Users.d.ts +4 -4
- package/dist/services/helper/extractors/Users.js +1 -1
- package/dist/services/helper/extractors/Users.js.map +1 -1
- package/dist/services/helper/payloads/LoginFlows.d.ts +77 -0
- package/dist/services/helper/payloads/LoginFlows.js +92 -0
- package/dist/services/helper/payloads/LoginFlows.js.map +1 -0
- package/dist/services/util/CacheService.d.ts +33 -0
- package/dist/services/util/CacheService.js +96 -0
- package/dist/services/util/CacheService.js.map +1 -0
- package/dist/services/util/FetcherService.d.ts +65 -0
- package/dist/services/util/FetcherService.js +214 -0
- package/dist/services/util/FetcherService.js.map +1 -0
- package/dist/types/Args.d.ts +38 -0
- package/dist/types/Args.js +5 -0
- package/dist/types/Args.js.map +1 -0
- package/dist/types/Authentication.d.ts +17 -2
- package/dist/types/Authentication.js +1 -0
- package/dist/types/Authentication.js.map +1 -1
- package/dist/types/Resolvers.d.ts +5 -4
- package/dist/types/Rettiwt.d.ts +16 -0
- package/dist/types/Rettiwt.js +3 -0
- package/dist/types/Rettiwt.js.map +1 -0
- package/dist/types/Service.d.ts +15 -23
- package/dist/types/Service.js +2 -16
- package/dist/types/Service.js.map +1 -1
- package/dist/types/Tweet.d.ts +25 -19
- package/dist/types/Tweet.js +0 -2
- package/dist/types/Tweet.js.map +1 -1
- package/dist/types/User.d.ts +35 -0
- package/dist/types/User.js +3 -0
- package/dist/types/User.js.map +1 -0
- package/dist/types/args/TweetFilter.d.ts +54 -0
- package/dist/types/args/TweetFilter.js +96 -0
- package/dist/types/args/TweetFilter.js.map +1 -0
- package/dist/types/args/TweetListArg.d.ts +10 -0
- package/dist/types/args/TweetListArg.js +42 -0
- package/dist/types/args/TweetListArg.js.map +1 -0
- package/dist/types/args/TweetListArgs.d.ts +20 -0
- package/dist/types/args/TweetListArgs.js +52 -0
- package/dist/types/args/TweetListArgs.js.map +1 -0
- package/dist/types/args/UserListArgs.d.ts +16 -0
- package/dist/types/args/UserListArgs.js +48 -0
- package/dist/types/args/UserListArgs.js.map +1 -0
- package/dist/types/data/TweetFilter.d.ts +49 -0
- package/dist/types/data/TweetFilter.js +63 -0
- package/dist/types/data/TweetFilter.js.map +1 -0
- package/dist/types/interfaces/Args.d.ts +38 -0
- package/dist/types/interfaces/Args.js +5 -0
- package/dist/types/interfaces/Args.js.map +1 -0
- package/dist/types/interfaces/Authentication.d.ts +40 -0
- package/dist/types/interfaces/Authentication.js +5 -0
- package/dist/types/interfaces/Authentication.js.map +1 -0
- package/dist/types/interfaces/Resolvers.d.ts +14 -0
- package/dist/types/interfaces/Resolvers.js +3 -0
- package/dist/types/interfaces/Resolvers.js.map +1 -0
- package/dist/types/interfaces/Rettiwt.d.ts +16 -0
- package/dist/types/interfaces/Rettiwt.js +3 -0
- package/dist/types/interfaces/Rettiwt.js.map +1 -0
- package/dist/types/interfaces/Service.d.ts +13 -0
- package/dist/types/interfaces/Service.js +3 -0
- package/dist/types/interfaces/Service.js.map +1 -0
- package/dist/types/interfaces/Services.d.ts +13 -0
- package/dist/types/interfaces/Services.js +3 -0
- package/dist/types/interfaces/Services.js.map +1 -0
- package/dist/types/interfaces/Tweet.d.ts +46 -0
- package/dist/types/interfaces/Tweet.js +3 -0
- package/dist/types/interfaces/Tweet.js.map +1 -0
- package/dist/types/interfaces/TweetFilter.d.ts +0 -0
- package/dist/types/interfaces/TweetFilter.js +2 -0
- package/dist/types/interfaces/TweetFilter.js.map +1 -0
- package/{src/types/data/User.ts → dist/types/interfaces/User.d.ts} +35 -51
- package/dist/types/interfaces/User.js +3 -0
- package/dist/types/interfaces/User.js.map +1 -0
- package/dist/types/raw/query/tweet/TweetDetails.d.ts +34 -0
- package/dist/types/raw/query/tweet/TweetDetails.js +5 -0
- package/dist/types/raw/query/tweet/TweetDetails.js.map +1 -0
- package/dist/types/raw/user/User.js.map +1 -1
- package/dist/types/services/args/TweetFilter.d.ts +50 -0
- package/dist/types/services/args/TweetFilter.js +76 -0
- package/dist/types/services/args/TweetFilter.js.map +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +64 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1280 -0
- package/docs/classes/AccountService.html +303 -0
- package/docs/classes/AuthCookie.html +146 -0
- package/docs/classes/AuthService.html +147 -0
- package/docs/classes/CacheService.html +157 -0
- package/docs/classes/Cursor.html +102 -0
- package/docs/classes/CursoredData.html +126 -0
- package/docs/classes/DataValidationError.html +119 -0
- package/docs/classes/FetcherService.html +225 -0
- package/docs/classes/Tweet.html +210 -0
- package/docs/classes/TweetEntities.html +128 -0
- package/docs/classes/TweetFilter.html +204 -0
- package/docs/classes/TweetListArgs.html +118 -0
- package/docs/classes/TweetService.html +313 -0
- package/docs/classes/User.html +230 -0
- package/docs/classes/UserListArgs.html +118 -0
- package/docs/classes/UserService.html +315 -0
- package/docs/enums/HttpMethods.html +74 -0
- package/docs/functions/Rettiwt.html +99 -0
- package/docs/index.html +161 -0
- package/docs/interfaces/IAuthCookie.html +104 -0
- package/docs/interfaces/ICursor.html +77 -0
- package/docs/interfaces/ICursoredData.html +93 -0
- package/docs/interfaces/IDataContext.html +91 -0
- package/docs/interfaces/IListArgs.html +87 -0
- package/docs/interfaces/ITweet.html +176 -0
- package/docs/interfaces/ITweetEntities.html +104 -0
- package/docs/interfaces/ITweetFilter.html +158 -0
- package/docs/interfaces/IUser.html +194 -0
- package/docs/modules.html +109 -0
- package/package.json +5 -2
- package/src/enums/Errors.ts +21 -0
- package/src/graphql/enums/Errors.ts +21 -0
- package/src/graphql/queries/RootQuery.ts +11 -4
- package/src/graphql/resolvers/AccountResolver.ts +3 -3
- package/src/graphql/resolvers/ResolverBase.ts +19 -5
- package/src/graphql/resolvers/TweetResolver.ts +26 -17
- package/src/graphql/resolvers/UserResolver.ts +18 -20
- package/src/graphql/types/TweetTypes.ts +2 -2
- package/src/graphql/types/UserTypes.ts +1 -1
- package/src/index.ts +39 -17
- package/src/models/args/TweetFilter.ts +119 -0
- package/src/models/args/TweetListArgs.ts +47 -0
- package/src/models/args/UserListArgs.ts +47 -0
- package/src/models/auth/AuthCookie.ts +43 -0
- package/src/models/data/CursoredData.ts +45 -0
- package/src/models/data/Tweet.ts +118 -0
- package/src/models/data/User.ts +72 -0
- package/src/models/errors/DataValidationError.ts +29 -0
- package/src/server.ts +9 -10
- package/src/services/{accounts → auth}/AccountService.ts +71 -19
- package/src/services/auth/AuthService.ts +81 -0
- package/src/services/data/TweetService.ts +77 -58
- package/src/services/data/UserService.ts +93 -89
- package/src/services/helper/Headers.ts +4 -4
- package/src/services/helper/Parser.ts +2 -2
- package/src/services/helper/extractors/Tweets.ts +7 -7
- package/src/services/helper/extractors/Users.ts +5 -5
- package/src/services/{CacheService.ts → util/CacheService.ts} +4 -1
- package/src/services/{FetcherService.ts → util/FetcherService.ts} +19 -11
- package/src/types/Args.ts +49 -0
- package/src/types/Authentication.ts +29 -7
- package/src/types/Resolvers.ts +5 -4
- package/src/types/Rettiwt.ts +20 -0
- package/src/types/Service.ts +24 -0
- package/src/types/Tweet.ts +61 -0
- package/src/types/User.ts +48 -0
- package/tsconfig.json +2 -2
- package/src/services/AuthService.ts +0 -68
- package/src/services/helper/deserializers/Tweets.ts +0 -70
- package/src/services/helper/deserializers/Users.ts +0 -26
- package/src/types/data/Errors.ts +0 -37
- package/src/types/data/Service.ts +0 -55
- package/src/types/data/Tweet.ts +0 -123
- package/src/types/raw/auth/Cookie.ts +0 -16
- /package/src/{types → enums}/HTTP.ts +0 -0
- /package/src/services/{accounts → helper/payloads}/LoginFlows.ts +0 -0
package/dist/types/Service.d.ts
CHANGED
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import { AccountService } from "../services/accounts/AccountService";
|
|
2
|
-
import { TweetService } from "../services/data/TweetService";
|
|
3
|
-
import { UserAccountService } from "../services/data/UserAccountService";
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
2
|
+
* The cursor to the batch of data to be fetched.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
6
|
+
export interface ICursor {
|
|
7
|
+
/** The cursor string. */
|
|
8
8
|
value: string;
|
|
9
|
-
/**
|
|
10
|
-
* @summary Initializes a new cursor from the given cursor string
|
|
11
|
-
* @param cursorStr The string representation of the cursor
|
|
12
|
-
*/
|
|
13
|
-
constructor(cursorStr: string);
|
|
14
9
|
}
|
|
15
10
|
/**
|
|
16
|
-
*
|
|
11
|
+
* The data that us fetched batch-wise along with a cursor.
|
|
12
|
+
*
|
|
13
|
+
* @typeParam Type - The type of data present in the list.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
17
16
|
*/
|
|
18
|
-
export interface
|
|
19
|
-
list
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @summary Stores the data context from where data is to be fetched
|
|
25
|
-
*/
|
|
26
|
-
export interface DataContext {
|
|
27
|
-
users: UserAccountService;
|
|
28
|
-
tweets: TweetService;
|
|
29
|
-
account: AccountService;
|
|
17
|
+
export interface ICursoredData<Type> {
|
|
18
|
+
/** The list of data of the given type. */
|
|
19
|
+
list: Type[];
|
|
20
|
+
/** The cursor to the next batch of data. */
|
|
21
|
+
next: ICursor;
|
|
30
22
|
}
|
package/dist/types/Service.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @summary Stores the cursor to the batch of data
|
|
6
|
-
*/
|
|
7
|
-
var Cursor = /** @class */ (function () {
|
|
8
|
-
// MEMBER DATA
|
|
9
|
-
/**
|
|
10
|
-
* @summary Initializes a new cursor from the given cursor string
|
|
11
|
-
* @param cursorStr The string representation of the cursor
|
|
12
|
-
*/
|
|
13
|
-
function Cursor(cursorStr) {
|
|
14
|
-
this.value = cursorStr;
|
|
15
|
-
}
|
|
16
|
-
return Cursor;
|
|
17
|
-
}());
|
|
18
|
-
exports.Cursor = Cursor;
|
|
3
|
+
;
|
|
4
|
+
;
|
|
19
5
|
//# sourceMappingURL=Service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Service.js","sourceRoot":"","sources":["../../src/types/Service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Service.js","sourceRoot":"","sources":["../../src/types/Service.ts"],"names":[],"mappings":";;AAQC,CAAC;AAeD,CAAC"}
|
package/dist/types/Tweet.d.ts
CHANGED
|
@@ -1,40 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The different types parsed entities like urls, media, mentions, hashtags, etc.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
3
5
|
*/
|
|
4
|
-
export interface
|
|
5
|
-
|
|
6
|
-
hashtags?: string[];
|
|
7
|
-
fromUsers?: string[];
|
|
8
|
-
toUsers?: string[];
|
|
9
|
-
mentions?: string[];
|
|
10
|
-
startDate?: string;
|
|
11
|
-
endDate?: string;
|
|
12
|
-
quoted?: string;
|
|
13
|
-
links?: boolean;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @summary Stores the different types of tweet elements like urls, media, mentions, hashtags, etc
|
|
17
|
-
*/
|
|
18
|
-
export interface TweetEntities {
|
|
6
|
+
export interface ITweetEntities {
|
|
7
|
+
/** The list of hashtags mentioned in the tweet. */
|
|
19
8
|
hashtags: string[];
|
|
9
|
+
/** The list of urls mentioned in the tweet. */
|
|
20
10
|
urls: string[];
|
|
11
|
+
/** The list of IDs of users mentioned in the tweet. */
|
|
21
12
|
mentionedUsers: string[];
|
|
13
|
+
/** The list of urls to various media mentioned in the tweet. */
|
|
22
14
|
media: string[];
|
|
23
15
|
}
|
|
24
16
|
/**
|
|
25
|
-
*
|
|
17
|
+
* The details of a single Tweet.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
26
20
|
*/
|
|
27
|
-
export interface
|
|
21
|
+
export interface ITweet {
|
|
22
|
+
/** The rest id of the tweet. */
|
|
28
23
|
id: string;
|
|
24
|
+
/** The rest id of the user who made the tweet. */
|
|
29
25
|
tweetBy: string;
|
|
26
|
+
/** The date and time of creation of the tweet, in UTC string format. */
|
|
30
27
|
createdAt: string;
|
|
31
|
-
entities
|
|
28
|
+
/** Additional tweet entities like urls, mentions, etc. */
|
|
29
|
+
entities: ITweetEntities;
|
|
30
|
+
/** The rest id of the tweet which is quoted in the tweet. */
|
|
32
31
|
quoted: string;
|
|
32
|
+
/** The full text content of the tweet. */
|
|
33
33
|
fullText: string;
|
|
34
|
+
/** The rest id of the user to which the tweet is a reply. */
|
|
34
35
|
replyTo: string;
|
|
36
|
+
/** The language in which the tweet is written. */
|
|
35
37
|
lang: string;
|
|
38
|
+
/** The number of quotes of the tweet. */
|
|
36
39
|
quoteCount: number;
|
|
40
|
+
/** The number of replies to the tweet. */
|
|
37
41
|
replyCount: number;
|
|
42
|
+
/** The number of retweets of the tweet. */
|
|
38
43
|
retweetCount: number;
|
|
44
|
+
/** The number of likes of the tweet. */
|
|
39
45
|
likeCount: number;
|
|
40
46
|
}
|
package/dist/types/Tweet.js
CHANGED
package/dist/types/Tweet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../src/types/Tweet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../src/types/Tweet.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The details of a single user.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IUser {
|
|
7
|
+
/** The rest id of the user. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** The username/screenname of the user. */
|
|
10
|
+
userName: string;
|
|
11
|
+
/** The full name of the user. */
|
|
12
|
+
fullName: string;
|
|
13
|
+
/** The creation date of user's account. */
|
|
14
|
+
createdAt: string;
|
|
15
|
+
/** The user's description. */
|
|
16
|
+
description: string;
|
|
17
|
+
/** Whether the account is verified or not. */
|
|
18
|
+
isVerified: boolean;
|
|
19
|
+
/** The number of tweets liked by the user. */
|
|
20
|
+
favouritesCount: number;
|
|
21
|
+
/** The number of followers of the user. */
|
|
22
|
+
followersCount: number;
|
|
23
|
+
/** The number of following of the user. */
|
|
24
|
+
followingsCount: number;
|
|
25
|
+
/** The number of tweets made by the user. */
|
|
26
|
+
statusesCount: number;
|
|
27
|
+
/** The location of user as provided by user. */
|
|
28
|
+
location: string;
|
|
29
|
+
/** The rest id of the tweet pinned in the user's profile. */
|
|
30
|
+
pinnedTweet: string;
|
|
31
|
+
/** The url of the profile banner image. */
|
|
32
|
+
profileBanner: string;
|
|
33
|
+
/** The url of the profile image. */
|
|
34
|
+
profileImage: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/types/User.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TweetFilterInterface } from '../interfaces/Args';
|
|
2
|
+
export declare class TweetFilter implements TweetFilterInterface {
|
|
3
|
+
/** The list of words to search. */
|
|
4
|
+
words?: string[];
|
|
5
|
+
/** The list of hashtags to search.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* '#' must be excluded from the hashtag!
|
|
9
|
+
*/
|
|
10
|
+
hashtags?: string[];
|
|
11
|
+
/** The list of usernames whose tweets are to be searched.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* '@' must be excluded from the username!
|
|
15
|
+
*/
|
|
16
|
+
fromUsers?: string[];
|
|
17
|
+
/** The list of username to whom the tweets to be searched, are adressed.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* '@' must be excluded from the username!
|
|
21
|
+
*/
|
|
22
|
+
toUsers?: string[];
|
|
23
|
+
/** The list of username mentioned in the tweets to search.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* '@' must be excluded from the username!
|
|
27
|
+
*/
|
|
28
|
+
mentions?: string[];
|
|
29
|
+
/** The date starting from which tweets are to be searched.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Must be in the format YYYY-MM-DD.
|
|
33
|
+
*/
|
|
34
|
+
startDate?: string;
|
|
35
|
+
/** The date upto which tweets are to be searched.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* Must be in the format YYYY-MM-DD.
|
|
39
|
+
*/
|
|
40
|
+
endDate?: string;
|
|
41
|
+
/** The id of the tweet, after which the tweets are to be searched. */
|
|
42
|
+
sinceId?: string;
|
|
43
|
+
/** The id of the tweet which is quoted in the tweets to search. */
|
|
44
|
+
quoted?: string;
|
|
45
|
+
/** Whether to fetch tweets that are links or not.
|
|
46
|
+
*
|
|
47
|
+
* @defaultValue false
|
|
48
|
+
*/
|
|
49
|
+
links?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @param filter The incoming filter in JSON format.
|
|
52
|
+
*/
|
|
53
|
+
constructor(filter: TweetFilter);
|
|
54
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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 Errors_1 = require("../data/Errors");
|
|
16
|
+
var TweetFilter = /** @class */ (function () {
|
|
17
|
+
/**
|
|
18
|
+
* @param filter The incoming filter in JSON format.
|
|
19
|
+
*/
|
|
20
|
+
function TweetFilter(filter) {
|
|
21
|
+
this.endDate = filter.endDate;
|
|
22
|
+
this.fromUsers = filter.fromUsers;
|
|
23
|
+
this.hashtags = filter.hashtags;
|
|
24
|
+
this.links = filter.links;
|
|
25
|
+
this.mentions = filter.mentions;
|
|
26
|
+
this.quoted = filter.quoted;
|
|
27
|
+
this.sinceId = filter.sinceId;
|
|
28
|
+
this.startDate = filter.startDate;
|
|
29
|
+
this.toUsers = filter.toUsers;
|
|
30
|
+
this.words = filter.words;
|
|
31
|
+
// Validating the filter
|
|
32
|
+
var validationResult = (0, class_validator_1.validateSync)(this);
|
|
33
|
+
// If valiation error occured
|
|
34
|
+
if (validationResult.length) {
|
|
35
|
+
throw new Errors_1.DataValidationError(validationResult);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsArray)(),
|
|
40
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
41
|
+
(0, class_validator_1.IsOptional)(),
|
|
42
|
+
__metadata("design:type", Array)
|
|
43
|
+
], TweetFilter.prototype, "words");
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsArray)(),
|
|
46
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
__metadata("design:type", Array)
|
|
49
|
+
], TweetFilter.prototype, "hashtags");
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsArray)(),
|
|
52
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
53
|
+
(0, class_validator_1.IsOptional)(),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], TweetFilter.prototype, "fromUsers");
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsArray)(),
|
|
58
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
59
|
+
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
__metadata("design:type", Array)
|
|
61
|
+
], TweetFilter.prototype, "toUsers");
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_validator_1.IsArray)(),
|
|
64
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
65
|
+
(0, class_validator_1.IsOptional)(),
|
|
66
|
+
__metadata("design:type", Array)
|
|
67
|
+
], TweetFilter.prototype, "mentions");
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_validator_1.IsOptional)(),
|
|
70
|
+
(0, class_validator_1.IsDateString)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], TweetFilter.prototype, "startDate");
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsOptional)(),
|
|
75
|
+
(0, class_validator_1.IsDateString)(),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], TweetFilter.prototype, "endDate");
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, class_validator_1.IsNumberString)(),
|
|
80
|
+
(0, class_validator_1.IsOptional)(),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], TweetFilter.prototype, "sinceId");
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, class_validator_1.IsNumberString)(),
|
|
85
|
+
(0, class_validator_1.IsOptional)(),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], TweetFilter.prototype, "quoted");
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, class_validator_1.IsBoolean)(),
|
|
90
|
+
(0, class_validator_1.IsOptional)(),
|
|
91
|
+
__metadata("design:type", Boolean)
|
|
92
|
+
], TweetFilter.prototype, "links");
|
|
93
|
+
return TweetFilter;
|
|
94
|
+
}());
|
|
95
|
+
exports.TweetFilter = TweetFilter;
|
|
96
|
+
//# sourceMappingURL=TweetFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TweetFilter.js","sourceRoot":"","sources":["../../../src/types/args/TweetFilter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,UAAU;AACV,mDAAuH;AAIvH,yCAAqD;AAErD;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,4BAAmB,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,42 @@
|
|
|
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_transformer_1 = require("class-transformer");
|
|
15
|
+
var class_validator_1 = require("class-validator");
|
|
16
|
+
var TweetListArgs = /** @class */ (function () {
|
|
17
|
+
function TweetListArgs() {
|
|
18
|
+
/** The number of data items to fetch.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue 10
|
|
21
|
+
* @remarks Must be >= 10
|
|
22
|
+
*/
|
|
23
|
+
this.count = 10;
|
|
24
|
+
/** The cursor to the batch of data to fetch. */
|
|
25
|
+
this.cursor = '';
|
|
26
|
+
}
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_transformer_1.Type)(function () { return Number; }),
|
|
29
|
+
(0, class_validator_1.IsInt)(),
|
|
30
|
+
(0, class_validator_1.IsOptional)(),
|
|
31
|
+
(0, class_validator_1.Min)(10),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], TweetListArgs.prototype, "count");
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], TweetListArgs.prototype, "cursor");
|
|
39
|
+
return TweetListArgs;
|
|
40
|
+
}());
|
|
41
|
+
exports.TweetListArgs = TweetListArgs;
|
|
42
|
+
//# sourceMappingURL=TweetListArg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TweetListArg.js","sourceRoot":"","sources":["../../../src/types/args/TweetListArg.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,uDAAyC;AACzC,mDAAmE;AAEnE;IAAA;QACI;;;;WAIG;QAKH,UAAK,GAAY,EAAE,CAAC;QAEpB,gDAAgD;QAGhD,WAAM,GAAY,EAAE,CAAC;IACzB,CAAC;IANG;QAJC,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;QAClB,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;QACZ,IAAA,qBAAG,EAAC,EAAE,CAAC;;wCACY;IAKpB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yCACQ;IACzB,oBAAC;CAAA,AAhBD,IAgBC;AAhBY,sCAAa"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ListArgs } from '../interfaces/Args';
|
|
2
|
+
/**
|
|
3
|
+
* @param count The number of data items to fetch.
|
|
4
|
+
* @param cursor The cursor to the next batch of data.
|
|
5
|
+
*/
|
|
6
|
+
export declare class TweetListArgs implements ListArgs {
|
|
7
|
+
/** The number of data items to fetch.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue 10
|
|
10
|
+
* @remarks Must be >= 10 and <= 100
|
|
11
|
+
*/
|
|
12
|
+
count: number;
|
|
13
|
+
/** The cursor to the batch of data to fetch. */
|
|
14
|
+
cursor: string;
|
|
15
|
+
/**
|
|
16
|
+
* @param count The number of data items to fetch.
|
|
17
|
+
* @param cursor The cursor to the batch of data to fetch.
|
|
18
|
+
*/
|
|
19
|
+
constructor(count?: number, cursor?: string);
|
|
20
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 Errors_1 = require("../data/Errors");
|
|
16
|
+
/**
|
|
17
|
+
* @param count The number of data items to fetch.
|
|
18
|
+
* @param cursor The cursor to the next batch of data.
|
|
19
|
+
*/
|
|
20
|
+
var TweetListArgs = /** @class */ (function () {
|
|
21
|
+
/**
|
|
22
|
+
* @param count The number of data items to fetch.
|
|
23
|
+
* @param cursor The cursor to the batch of data to fetch.
|
|
24
|
+
*/
|
|
25
|
+
function TweetListArgs(count, cursor) {
|
|
26
|
+
if (count === void 0) { count = 10; }
|
|
27
|
+
if (cursor === void 0) { cursor = ''; }
|
|
28
|
+
this.count = count;
|
|
29
|
+
this.cursor = cursor;
|
|
30
|
+
// Validating the arguments
|
|
31
|
+
var validationResult = (0, class_validator_1.validateSync)(this);
|
|
32
|
+
// If valiation error occured
|
|
33
|
+
if (validationResult.length) {
|
|
34
|
+
throw new Errors_1.DataValidationError(validationResult);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsInt)(),
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.Min)(10),
|
|
41
|
+
(0, class_validator_1.Max)(100),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], TweetListArgs.prototype, "count");
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_validator_1.IsString)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], TweetListArgs.prototype, "cursor");
|
|
49
|
+
return TweetListArgs;
|
|
50
|
+
}());
|
|
51
|
+
exports.TweetListArgs = TweetListArgs;
|
|
52
|
+
//# sourceMappingURL=TweetListArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TweetListArgs.js","sourceRoot":"","sources":["../../../src/types/args/TweetListArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,mDAAsF;AAItF,yCAAqD;AAErD;;;GAGG;AACH;IAiBI;;;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,4BAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnD;IACL,CAAC;IAtBD;QAJC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;QACZ,IAAA,qBAAG,EAAC,EAAE,CAAC;QACP,IAAA,qBAAG,EAAC,GAAG,CAAC;;wCACK;IAKd;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yCACE;IAkBnB,oBAAC;CAAA,AAjCD,IAiCC;AAjCY,sCAAa"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ListArgs } from '../interfaces/Args';
|
|
2
|
+
export declare class UserListArgs implements ListArgs {
|
|
3
|
+
/** The number of data items to fetch.
|
|
4
|
+
*
|
|
5
|
+
* @defaultValue 40
|
|
6
|
+
* @remarks Must be >= 40 and <= 100
|
|
7
|
+
*/
|
|
8
|
+
count: number;
|
|
9
|
+
/** The cursor to the batch of data to fetch. */
|
|
10
|
+
cursor: string;
|
|
11
|
+
/**
|
|
12
|
+
* @param count The number of data items to fetch.
|
|
13
|
+
* @param cursor The cursor to the batch of data to fetch.
|
|
14
|
+
*/
|
|
15
|
+
constructor(count?: number, cursor?: string);
|
|
16
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 Errors_1 = require("../data/Errors");
|
|
16
|
+
var UserListArgs = /** @class */ (function () {
|
|
17
|
+
/**
|
|
18
|
+
* @param count The number of data items to fetch.
|
|
19
|
+
* @param cursor The cursor to the batch of data to fetch.
|
|
20
|
+
*/
|
|
21
|
+
function UserListArgs(count, cursor) {
|
|
22
|
+
if (count === void 0) { count = 40; }
|
|
23
|
+
if (cursor === void 0) { cursor = ''; }
|
|
24
|
+
this.count = count;
|
|
25
|
+
this.cursor = cursor;
|
|
26
|
+
// Validating the arguments
|
|
27
|
+
var validationResult = (0, class_validator_1.validateSync)(this);
|
|
28
|
+
// If valiation error occured
|
|
29
|
+
if (validationResult.length) {
|
|
30
|
+
throw new Errors_1.DataValidationError(validationResult);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsInt)(),
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
36
|
+
(0, class_validator_1.Min)(40),
|
|
37
|
+
(0, class_validator_1.Max)(100),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], UserListArgs.prototype, "count");
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], UserListArgs.prototype, "cursor");
|
|
45
|
+
return UserListArgs;
|
|
46
|
+
}());
|
|
47
|
+
exports.UserListArgs = UserListArgs;
|
|
48
|
+
//# sourceMappingURL=UserListArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserListArgs.js","sourceRoot":"","sources":["../../../src/types/args/UserListArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,mDAAsF;AAItF,yCAAqD;AAErD;IAiBI;;;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,4BAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnD;IACL,CAAC;IAtBD;QAJC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;QACZ,IAAA,qBAAG,EAAC,EAAE,CAAC;QACP,IAAA,qBAAG,EAAC,GAAG,CAAC;;uCACK;IAKd;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;wCACE;IAkBnB,mBAAC;CAAA,AAjCD,IAiCC;AAjCY,oCAAY"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare class TweetFilter {
|
|
2
|
+
/** The list of words to search. */
|
|
3
|
+
words?: string[];
|
|
4
|
+
/** The list of hashtags to search.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* '#' must be excluded from the hashtag!
|
|
8
|
+
*/
|
|
9
|
+
hashtags?: string[];
|
|
10
|
+
/** The list of usernames whose tweets are to be searched.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* '@' must be excluded from the username!
|
|
14
|
+
*/
|
|
15
|
+
fromUsers?: string[];
|
|
16
|
+
/** The list of username to whom the tweets to be searched, are adressed.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* '@' must be excluded from the username!
|
|
20
|
+
*/
|
|
21
|
+
toUsers?: string[];
|
|
22
|
+
/** The list of username mentioned in the tweets to search.
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* '@' must be excluded from the username!
|
|
26
|
+
*/
|
|
27
|
+
mentions?: string[];
|
|
28
|
+
/** The date starting from which tweets are to be searched.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Must be in the format YYYY-MM-DD.
|
|
32
|
+
*/
|
|
33
|
+
startDate?: string;
|
|
34
|
+
/** The date upto which tweets are to be searched.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Must be in the format YYYY-MM-DD.
|
|
38
|
+
*/
|
|
39
|
+
endDate?: string;
|
|
40
|
+
/** The id of the tweet, after which the tweets are to be searched. */
|
|
41
|
+
sinceId?: string;
|
|
42
|
+
/** The id of the tweet which is quoted in the tweets to search. */
|
|
43
|
+
quoted?: string;
|
|
44
|
+
/** Whether to fetch tweets that are links or not.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue false
|
|
47
|
+
*/
|
|
48
|
+
links?: boolean;
|
|
49
|
+
}
|