rettiwt-api 1.1.8 → 1.3.0
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 +22 -21
- package/.github/workflows/publish-to-npm.yml +29 -0
- package/README.md +52 -40
- package/dist/config/env.d.ts +5 -5
- package/dist/config/env.js +8 -8
- package/dist/enums/Errors.d.ts +21 -20
- package/dist/enums/Errors.js +28 -27
- package/dist/enums/Errors.js.map +1 -1
- package/dist/enums/HTTP.d.ts +17 -17
- package/dist/enums/HTTP.js +22 -22
- package/dist/graphql/enums/Errors.d.ts +21 -21
- package/dist/graphql/enums/Errors.js +28 -28
- package/dist/graphql/queries/RootQuery.d.ts +4 -4
- package/dist/graphql/queries/RootQuery.js +77 -77
- package/dist/graphql/queries/RootQuery.js.map +1 -1
- package/dist/graphql/resolvers/AccountResolver.d.ts +12 -12
- package/dist/graphql/resolvers/AccountResolver.js +83 -83
- package/dist/graphql/resolvers/ResolverBase.d.ts +16 -16
- package/dist/graphql/resolvers/ResolverBase.js +22 -22
- package/dist/graphql/resolvers/TweetResolver.d.ts +46 -46
- package/dist/graphql/resolvers/TweetResolver.js +311 -311
- package/dist/graphql/resolvers/TweetResolver.js.map +1 -1
- package/dist/graphql/resolvers/UserResolver.d.ts +48 -48
- package/dist/graphql/resolvers/UserResolver.js +333 -333
- package/dist/graphql/resolvers/UserResolver.js.map +1 -1
- package/dist/graphql/types/Global.d.ts +4 -4
- package/dist/graphql/types/Global.js +12 -12
- package/dist/graphql/types/TweetTypes.d.ts +4 -4
- package/dist/graphql/types/TweetTypes.js +159 -159
- package/dist/graphql/types/UserTypes.d.ts +3 -3
- package/dist/graphql/types/UserTypes.js +136 -136
- package/dist/graphql/types/UserTypes.js.map +1 -1
- package/dist/index.d.ts +45 -43
- package/dist/index.js +72 -70
- package/dist/index.js.map +1 -1
- package/dist/models/args/TweetListArgs.d.ts +21 -21
- package/dist/models/args/TweetListArgs.js +53 -53
- package/dist/models/args/TweetListArgs.js.map +1 -1
- package/dist/models/args/UserListArgs.d.ts +21 -21
- package/dist/models/args/UserListArgs.js +53 -53
- package/dist/models/args/UserListArgs.js.map +1 -1
- package/dist/models/auth/AuthCookie.d.ts +21 -21
- package/dist/models/auth/AuthCookie.js +32 -32
- package/dist/models/data/CursoredData.d.ts +34 -34
- package/dist/models/data/CursoredData.js +41 -41
- package/dist/models/data/Tweet.d.ts +53 -53
- package/dist/models/data/Tweet.js +103 -103
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +41 -41
- package/dist/models/data/User.js +31 -31
- package/dist/models/data/User.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +75 -75
- package/dist/services/auth/AccountService.d.ts +83 -83
- package/dist/services/auth/AccountService.js +411 -411
- package/dist/services/auth/AuthService.d.ts +31 -31
- package/dist/services/auth/AuthService.js +117 -117
- package/dist/services/data/TweetService.d.ts +60 -74
- package/dist/services/data/TweetService.js +250 -254
- package/dist/services/data/TweetService.js.map +1 -1
- package/dist/services/data/UserService.d.ts +71 -87
- package/dist/services/data/UserService.js +277 -296
- package/dist/services/data/UserService.js.map +1 -1
- package/dist/services/helper/Headers.d.ts +19 -19
- package/dist/services/helper/Headers.js +61 -61
- package/dist/services/helper/Headers.js.map +1 -1
- package/dist/services/helper/Parser.d.ts +22 -28
- package/dist/services/helper/Parser.js +83 -104
- package/dist/services/helper/Parser.js.map +1 -1
- package/dist/services/helper/extractors/Tweets.d.ts +23 -32
- package/dist/services/helper/extractors/Tweets.js +199 -263
- package/dist/services/helper/extractors/Tweets.js.map +1 -1
- package/dist/services/helper/extractors/Users.d.ts +17 -26
- package/dist/services/helper/extractors/Users.js +150 -202
- package/dist/services/helper/extractors/Users.js.map +1 -1
- package/dist/services/helper/payloads/LoginFlows.d.ts +77 -77
- package/dist/services/helper/payloads/LoginFlows.js +91 -91
- package/dist/services/helper/urls/Authentication.d.ts +4 -4
- package/dist/services/helper/urls/Authentication.js +10 -10
- package/dist/services/util/CacheService.d.ts +33 -33
- package/dist/services/util/CacheService.js +95 -95
- package/dist/services/util/FetcherService.d.ts +65 -65
- package/dist/services/util/FetcherService.js +201 -213
- package/dist/services/util/FetcherService.js.map +1 -1
- package/dist/types/Args.d.ts +11 -38
- package/dist/types/Args.js +3 -4
- package/dist/types/Args.js.map +1 -1
- package/dist/types/Authentication.d.ts +55 -55
- package/dist/types/Authentication.js +5 -5
- package/dist/types/Resolvers.d.ts +15 -15
- package/dist/types/Resolvers.js +2 -2
- package/dist/types/Rettiwt.d.ts +16 -16
- package/dist/types/Rettiwt.js +2 -2
- package/dist/types/Service.d.ts +22 -22
- package/dist/types/Service.js +4 -4
- package/dist/types/Tweet.d.ts +46 -46
- package/dist/types/Tweet.js +2 -2
- package/dist/types/User.d.ts +35 -35
- package/dist/types/User.js +2 -2
- 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 +286 -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 +120 -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 +223 -0
- package/docs/classes/TweetListArgs.html +118 -0
- package/docs/classes/TweetService.html +319 -0
- package/docs/classes/User.html +230 -0
- package/docs/classes/UserListArgs.html +118 -0
- package/docs/classes/UserService.html +355 -0
- package/docs/enums/HttpMethods.html +74 -0
- package/docs/functions/Rettiwt.html +100 -0
- package/docs/index.html +159 -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/IDataValidationError.html +109 -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 +111 -0
- package/package.json +4 -3
- package/src/enums/Errors.ts +2 -1
- package/src/graphql/queries/RootQuery.ts +1 -1
- package/src/graphql/resolvers/TweetResolver.ts +12 -59
- package/src/graphql/resolvers/UserResolver.ts +4 -4
- package/src/graphql/types/UserTypes.ts +2 -2
- package/src/index.ts +5 -3
- package/src/models/args/TweetListArgs.ts +2 -2
- package/src/models/args/UserListArgs.ts +1 -1
- package/src/models/data/Tweet.ts +3 -3
- package/src/models/data/User.ts +2 -2
- package/src/services/data/TweetService.ts +45 -72
- package/src/services/data/UserService.ts +61 -71
- package/src/services/helper/Headers.ts +34 -34
- package/src/services/helper/Parser.ts +5 -26
- package/src/services/helper/extractors/Tweets.ts +35 -97
- package/src/services/helper/extractors/Users.ts +11 -62
- package/src/services/util/FetcherService.ts +15 -22
- package/src/types/Args.ts +0 -37
- package/Dockerfile +0 -9
- package/dist/Test.d.ts +0 -0
- package/dist/Test.js +0 -2
- package/dist/Test.js.map +0 -1
- package/dist/endpoints/Endpoints.d.ts +0 -14
- package/dist/endpoints/Endpoints.js +0 -20
- package/dist/endpoints/Endpoints.js.map +0 -1
- package/dist/endpoints/Url.d.ts +0 -5
- package/dist/endpoints/Url.js +0 -12
- package/dist/endpoints/Url.js.map +0 -1
- package/dist/enums/Endpoints.d.ts +0 -25
- package/dist/enums/Endpoints.js +0 -31
- package/dist/enums/Endpoints.js.map +0 -1
- package/dist/graphql/types/Errors.d.ts +0 -20
- package/dist/graphql/types/Errors.js +0 -28
- package/dist/graphql/types/Errors.js.map +0 -1
- package/dist/middlewares/Authentication.d.ts +0 -0
- package/dist/middlewares/Authentication.js +0 -2
- package/dist/middlewares/Authentication.js.map +0 -1
- package/dist/models/args/TweetFilter.d.ts +0 -59
- package/dist/models/args/TweetFilter.js +0 -101
- package/dist/models/args/TweetFilter.js.map +0 -1
- package/dist/models/data/DataValidationError.d.ts +0 -18
- package/dist/models/data/DataValidationError.js +0 -21
- package/dist/models/data/DataValidationError.js.map +0 -1
- package/dist/models/data/Errors.d.ts +0 -18
- package/dist/models/data/Errors.js +0 -21
- package/dist/models/data/Errors.js.map +0 -1
- package/dist/models/data/Service.d.ts +0 -33
- package/dist/models/data/Service.js +0 -41
- package/dist/models/data/Service.js.map +0 -1
- package/dist/models/errors/DataValidationError.d.ts +0 -20
- package/dist/models/errors/DataValidationError.js +0 -23
- package/dist/models/errors/DataValidationError.js.map +0 -1
- package/dist/models/graphql/Global.d.ts +0 -4
- package/dist/models/graphql/Global.js +0 -13
- package/dist/models/graphql/Global.js.map +0 -1
- package/dist/models/graphql/TweetTypes.d.ts +0 -6
- package/dist/models/graphql/TweetTypes.js +0 -156
- package/dist/models/graphql/TweetTypes.js.map +0 -1
- package/dist/models/graphql/UserTypes.d.ts +0 -3
- package/dist/models/graphql/UserTypes.js +0 -139
- package/dist/models/graphql/UserTypes.js.map +0 -1
- package/dist/models/query/Variables.d.ts +0 -2
- package/dist/models/query/Variables.js +0 -10
- package/dist/models/query/Variables.js.map +0 -1
- package/dist/queries/RootQuery.d.ts +0 -4
- package/dist/queries/RootQuery.js +0 -70
- package/dist/queries/RootQuery.js.map +0 -1
- package/dist/requests/Url.d.ts +0 -5
- package/dist/requests/Url.js +0 -12
- package/dist/requests/Url.js.map +0 -1
- package/dist/requests/payloads/Variables.d.ts +0 -23
- package/dist/requests/payloads/Variables.js +0 -24
- package/dist/requests/payloads/Variables.js.map +0 -1
- package/dist/resolvers/AccountResolver.d.ts +0 -12
- package/dist/resolvers/AccountResolver.js +0 -84
- package/dist/resolvers/AccountResolver.js.map +0 -1
- package/dist/resolvers/ResolverBase.d.ts +0 -5
- package/dist/resolvers/ResolverBase.js +0 -11
- package/dist/resolvers/ResolverBase.js.map +0 -1
- package/dist/resolvers/TweetResolver.d.ts +0 -54
- package/dist/resolvers/TweetResolver.js +0 -332
- package/dist/resolvers/TweetResolver.js.map +0 -1
- package/dist/resolvers/UserResolver.d.ts +0 -38
- package/dist/resolvers/UserResolver.js +0 -253
- package/dist/resolvers/UserResolver.js.map +0 -1
- package/dist/services/AuthService.d.ts +0 -22
- package/dist/services/AuthService.js +0 -106
- package/dist/services/AuthService.js.map +0 -1
- package/dist/services/CacheService.d.ts +0 -30
- package/dist/services/CacheService.js +0 -93
- package/dist/services/CacheService.js.map +0 -1
- package/dist/services/FetcherService.d.ts +0 -61
- package/dist/services/FetcherService.js +0 -209
- package/dist/services/FetcherService.js.map +0 -1
- package/dist/services/accounts/AccountService.d.ts +0 -65
- package/dist/services/accounts/AccountService.js +0 -336
- package/dist/services/accounts/AccountService.js.map +0 -1
- package/dist/services/accounts/LoginFlows.d.ts +0 -77
- package/dist/services/accounts/LoginFlows.js +0 -92
- package/dist/services/accounts/LoginFlows.js.map +0 -1
- package/dist/services/auth/LoginFlows.d.ts +0 -77
- package/dist/services/auth/LoginFlows.js +0 -92
- package/dist/services/auth/LoginFlows.js.map +0 -1
- package/dist/services/data/TrendService.d.ts +0 -17
- package/dist/services/data/TrendService.js +0 -116
- package/dist/services/data/TrendService.js.map +0 -1
- package/dist/services/data/UserAccountService.d.ts +0 -42
- package/dist/services/data/UserAccountService.js +0 -239
- package/dist/services/data/UserAccountService.js.map +0 -1
- package/dist/services/helper/Deserializers.d.ts +0 -19
- package/dist/services/helper/Deserializers.js +0 -115
- package/dist/services/helper/Deserializers.js.map +0 -1
- package/dist/services/helper/Extractors.d.ts +0 -104
- package/dist/services/helper/Extractors.js +0 -432
- package/dist/services/helper/Extractors.js.map +0 -1
- package/dist/services/helper/Urls.d.ts +0 -85
- package/dist/services/helper/Urls.js +0 -130
- package/dist/services/helper/Urls.js.map +0 -1
- package/dist/services/helper/deserializers/Tweets.d.ts +0 -12
- package/dist/services/helper/deserializers/Tweets.js +0 -92
- package/dist/services/helper/deserializers/Tweets.js.map +0 -1
- package/dist/services/helper/deserializers/Users.d.ts +0 -7
- package/dist/services/helper/deserializers/Users.js +0 -27
- package/dist/services/helper/deserializers/Users.js.map +0 -1
- package/dist/services/helper/extractors/Trends.d.ts +0 -3
- package/dist/services/helper/extractors/Trends.js +0 -51
- package/dist/services/helper/extractors/Trends.js.map +0 -1
- package/dist/services/helper/urls/Trends.d.ts +0 -7
- package/dist/services/helper/urls/Trends.js +0 -13
- package/dist/services/helper/urls/Trends.js.map +0 -1
- package/dist/services/helper/urls/Tweets.d.ts +0 -32
- package/dist/services/helper/urls/Tweets.js +0 -51
- package/dist/services/helper/urls/Tweets.js.map +0 -1
- package/dist/services/helper/urls/Users.d.ts +0 -38
- package/dist/services/helper/urls/Users.js +0 -76
- package/dist/services/helper/urls/Users.js.map +0 -1
- package/dist/types/HTTP.d.ts +0 -17
- package/dist/types/HTTP.js +0 -23
- package/dist/types/HTTP.js.map +0 -1
- package/dist/types/Query.d.ts +0 -80
- package/dist/types/Query.js +0 -3
- package/dist/types/Query.js.map +0 -1
- package/dist/types/Trends.d.ts +0 -50
- package/dist/types/Trends.js +0 -3
- package/dist/types/Trends.js.map +0 -1
- package/dist/types/UserAccount.d.ts +0 -19
- package/dist/types/UserAccount.js +0 -4
- package/dist/types/UserAccount.js.map +0 -1
- package/dist/types/args/TweetFilter.d.ts +0 -54
- package/dist/types/args/TweetFilter.js +0 -96
- package/dist/types/args/TweetFilter.js.map +0 -1
- package/dist/types/args/TweetListArg.d.ts +0 -10
- package/dist/types/args/TweetListArg.js +0 -42
- package/dist/types/args/TweetListArg.js.map +0 -1
- package/dist/types/args/TweetListArgs.d.ts +0 -20
- package/dist/types/args/TweetListArgs.js +0 -52
- package/dist/types/args/TweetListArgs.js.map +0 -1
- package/dist/types/args/UserListArgs.d.ts +0 -16
- package/dist/types/args/UserListArgs.js +0 -48
- package/dist/types/args/UserListArgs.js.map +0 -1
- package/dist/types/data/Errors.d.ts +0 -35
- package/dist/types/data/Errors.js +0 -45
- package/dist/types/data/Errors.js.map +0 -1
- package/dist/types/data/Service.d.ts +0 -43
- package/dist/types/data/Service.js +0 -22
- package/dist/types/data/Service.js.map +0 -1
- package/dist/types/data/Tweet.d.ts +0 -98
- package/dist/types/data/Tweet.js +0 -4
- package/dist/types/data/Tweet.js.map +0 -1
- package/dist/types/data/TweetFilter.d.ts +0 -49
- package/dist/types/data/TweetFilter.js +0 -63
- package/dist/types/data/TweetFilter.js.map +0 -1
- package/dist/types/data/User.d.ts +0 -38
- package/dist/types/data/User.js +0 -3
- package/dist/types/data/User.js.map +0 -1
- package/dist/types/graphql/Errors.d.ts +0 -15
- package/dist/types/graphql/Errors.js +0 -23
- package/dist/types/graphql/Errors.js.map +0 -1
- package/dist/types/interfaces/Args.d.ts +0 -38
- package/dist/types/interfaces/Args.js +0 -5
- package/dist/types/interfaces/Args.js.map +0 -1
- package/dist/types/interfaces/Authentication.d.ts +0 -40
- package/dist/types/interfaces/Authentication.js +0 -5
- package/dist/types/interfaces/Authentication.js.map +0 -1
- package/dist/types/interfaces/Resolvers.d.ts +0 -14
- package/dist/types/interfaces/Resolvers.js +0 -3
- package/dist/types/interfaces/Resolvers.js.map +0 -1
- package/dist/types/interfaces/Rettiwt.d.ts +0 -16
- package/dist/types/interfaces/Rettiwt.js +0 -3
- package/dist/types/interfaces/Rettiwt.js.map +0 -1
- package/dist/types/interfaces/Service.d.ts +0 -13
- package/dist/types/interfaces/Service.js +0 -3
- package/dist/types/interfaces/Service.js.map +0 -1
- package/dist/types/interfaces/Services.d.ts +0 -13
- package/dist/types/interfaces/Services.js +0 -3
- package/dist/types/interfaces/Services.js.map +0 -1
- package/dist/types/interfaces/Tweet.d.ts +0 -46
- package/dist/types/interfaces/Tweet.js +0 -3
- package/dist/types/interfaces/Tweet.js.map +0 -1
- package/dist/types/interfaces/TweetFilter.d.ts +0 -0
- package/dist/types/interfaces/TweetFilter.js +0 -2
- package/dist/types/interfaces/TweetFilter.js.map +0 -1
- package/dist/types/interfaces/User.d.ts +0 -35
- package/dist/types/interfaces/User.js +0 -3
- package/dist/types/interfaces/User.js.map +0 -1
- package/dist/types/raw/auth/Cookie.d.ts +0 -16
- package/dist/types/raw/auth/Cookie.js +0 -3
- package/dist/types/raw/auth/Cookie.js.map +0 -1
- package/dist/types/raw/data/tweet/Favouriters.d.ts +0 -164
- package/dist/types/raw/data/tweet/Favouriters.js +0 -3
- package/dist/types/raw/data/tweet/Favouriters.js.map +0 -1
- package/dist/types/raw/data/tweet/Retweeters.d.ts +0 -171
- package/dist/types/raw/data/tweet/Retweeters.js +0 -3
- package/dist/types/raw/data/tweet/Retweeters.js.map +0 -1
- package/dist/types/raw/data/tweet/Tweet.d.ts +0 -746
- package/dist/types/raw/data/tweet/Tweet.js +0 -3
- package/dist/types/raw/data/tweet/Tweet.js.map +0 -1
- package/dist/types/raw/data/tweet/Tweets.d.ts +0 -386
- package/dist/types/raw/data/tweet/Tweets.js +0 -3
- package/dist/types/raw/data/tweet/Tweets.js.map +0 -1
- package/dist/types/raw/data/user/Followers.d.ts +0 -176
- package/dist/types/raw/data/user/Followers.js +0 -3
- package/dist/types/raw/data/user/Followers.js.map +0 -1
- package/dist/types/raw/data/user/Following.d.ts +0 -176
- package/dist/types/raw/data/user/Following.js +0 -3
- package/dist/types/raw/data/user/Following.js.map +0 -1
- package/dist/types/raw/data/user/Likes.d.ts +0 -1059
- package/dist/types/raw/data/user/Likes.js +0 -3
- package/dist/types/raw/data/user/Likes.js.map +0 -1
- package/dist/types/raw/data/user/User.d.ts +0 -117
- package/dist/types/raw/data/user/User.js +0 -3
- package/dist/types/raw/data/user/User.js.map +0 -1
- package/dist/types/raw/general/Trends.d.ts +0 -324
- package/dist/types/raw/general/Trends.js +0 -3
- package/dist/types/raw/general/Trends.js.map +0 -1
- package/dist/types/raw/query/tweet/Details.d.ts +0 -80
- package/dist/types/raw/query/tweet/Details.js +0 -5
- package/dist/types/raw/query/tweet/Details.js.map +0 -1
- package/dist/types/raw/query/tweet/Engagements.d.ts +0 -29
- package/dist/types/raw/query/tweet/Engagements.js +0 -3
- package/dist/types/raw/query/tweet/Engagements.js.map +0 -1
- package/dist/types/raw/query/tweet/Likes.d.ts +0 -29
- package/dist/types/raw/query/tweet/Likes.js +0 -3
- package/dist/types/raw/query/tweet/Likes.js.map +0 -1
- package/dist/types/raw/query/tweet/Retweets.d.ts +0 -29
- package/dist/types/raw/query/tweet/Retweets.js +0 -3
- package/dist/types/raw/query/tweet/Retweets.js.map +0 -1
- package/dist/types/raw/query/tweet/Search.d.ts +0 -40
- package/dist/types/raw/query/tweet/Search.js +0 -3
- package/dist/types/raw/query/tweet/Search.js.map +0 -1
- package/dist/types/raw/query/tweet/TweetDetails.d.ts +0 -34
- package/dist/types/raw/query/tweet/TweetDetails.js +0 -5
- package/dist/types/raw/query/tweet/TweetDetails.js.map +0 -1
- package/dist/types/raw/query/tweet/TweetLike.d.ts +0 -29
- package/dist/types/raw/query/tweet/TweetLike.js +0 -3
- package/dist/types/raw/query/tweet/TweetLike.js.map +0 -1
- package/dist/types/raw/query/tweet/TweetLikes.d.ts +0 -29
- package/dist/types/raw/query/tweet/TweetLikes.js +0 -3
- package/dist/types/raw/query/tweet/TweetLikes.js.map +0 -1
- package/dist/types/raw/query/tweet/TweetRetweets.d.ts +0 -0
- package/dist/types/raw/query/tweet/TweetRetweets.js +0 -2
- package/dist/types/raw/query/tweet/TweetRetweets.js.map +0 -1
- package/dist/types/raw/query/user/Details.d.ts +0 -34
- package/dist/types/raw/query/user/Details.js +0 -3
- package/dist/types/raw/query/user/Details.js.map +0 -1
- package/dist/types/raw/tweet/Favouriters.d.ts +0 -164
- package/dist/types/raw/tweet/Favouriters.js +0 -3
- package/dist/types/raw/tweet/Favouriters.js.map +0 -1
- package/dist/types/raw/tweet/Retweeters.d.ts +0 -171
- package/dist/types/raw/tweet/Retweeters.js +0 -3
- package/dist/types/raw/tweet/Retweeters.js.map +0 -1
- package/dist/types/raw/tweet/Tweet.d.ts +0 -746
- package/dist/types/raw/tweet/Tweet.js +0 -3
- package/dist/types/raw/tweet/Tweet.js.map +0 -1
- package/dist/types/raw/tweet/Tweets.d.ts +0 -386
- package/dist/types/raw/tweet/Tweets.js +0 -3
- package/dist/types/raw/tweet/Tweets.js.map +0 -1
- package/dist/types/raw/user/Followers.d.ts +0 -176
- package/dist/types/raw/user/Followers.js +0 -3
- package/dist/types/raw/user/Followers.js.map +0 -1
- package/dist/types/raw/user/Following.d.ts +0 -176
- package/dist/types/raw/user/Following.js +0 -3
- package/dist/types/raw/user/Following.js.map +0 -1
- package/dist/types/raw/user/Likes.d.ts +0 -1059
- package/dist/types/raw/user/Likes.js +0 -3
- package/dist/types/raw/user/Likes.js.map +0 -1
- package/dist/types/raw/user/Tweets.d.ts +0 -1512
- package/dist/types/raw/user/Tweets.js +0 -3
- package/dist/types/raw/user/Tweets.js.map +0 -1
- package/dist/types/raw/user/User.d.ts +0 -117
- package/dist/types/raw/user/User.js +0 -3
- package/dist/types/raw/user/User.js.map +0 -1
- package/dist/types/services/args/TweetFilter.d.ts +0 -50
- package/dist/types/services/args/TweetFilter.js +0 -76
- package/dist/types/services/args/TweetFilter.js.map +0 -1
- package/src/models/args/TweetFilter.ts +0 -119
- package/src/models/errors/DataValidationError.ts +0 -29
- package/src/services/helper/urls/Tweets.ts +0 -46
- package/src/services/helper/urls/Users.ts +0 -78
- package/src/types/raw/tweet/Favouriters.ts +0 -193
- package/src/types/raw/tweet/Retweeters.ts +0 -201
- package/src/types/raw/tweet/Tweet.ts +0 -882
- package/src/types/raw/tweet/Tweets.ts +0 -444
- package/src/types/raw/user/Followers.ts +0 -208
- package/src/types/raw/user/Following.ts +0 -208
- package/src/types/raw/user/Likes.ts +0 -1247
- package/src/types/raw/user/Tweets.ts +0 -1747
- package/src/types/raw/user/User.ts +0 -135
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
-
};
|
|
56
|
-
exports.__esModule = true;
|
|
57
|
-
// RESOLVERS
|
|
58
|
-
var ResolverBase_1 = __importDefault(require("./ResolverBase"));
|
|
59
|
-
// TYPES
|
|
60
|
-
var Service_1 = require("../types/Service");
|
|
61
|
-
// HELPERS
|
|
62
|
-
var Errors_1 = require("../types/graphql/Errors");
|
|
63
|
-
var UserResolver = /** @class */ (function (_super) {
|
|
64
|
-
__extends(UserResolver, _super);
|
|
65
|
-
// MEMBER METHODS
|
|
66
|
-
function UserResolver(context) {
|
|
67
|
-
return _super.call(this, context) || this;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @returns The details of the target twitter user
|
|
71
|
-
* @param userName The user name of the target twitter user
|
|
72
|
-
* @param id The id of the target twitter user
|
|
73
|
-
*/
|
|
74
|
-
UserResolver.prototype.resolveUserDetails = function (userName, id) {
|
|
75
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
76
|
-
return __generator(this, function (_a) {
|
|
77
|
-
switch (_a.label) {
|
|
78
|
-
case 0:
|
|
79
|
-
if (!userName) return [3 /*break*/, 2];
|
|
80
|
-
return [4 /*yield*/, this.context.users.getUserAccountDetails(userName)];
|
|
81
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
82
|
-
case 2:
|
|
83
|
-
if (!id) return [3 /*break*/, 4];
|
|
84
|
-
return [4 /*yield*/, this.context.users.getUserAccountDetailsById(id)];
|
|
85
|
-
case 3: return [2 /*return*/, _a.sent()];
|
|
86
|
-
case 4: throw new Error(Errors_1.ValidationErrors.NoUserIdentification);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* @returns The list of tweets liked by the given user
|
|
93
|
-
* @param id The id of the user whose likes are to be fetched
|
|
94
|
-
* @param count The number of likes to fetch
|
|
95
|
-
* @param all Whether to fetch list of all tweets liked by user
|
|
96
|
-
* @param cursor The cursor to the batch of likes to fetch
|
|
97
|
-
* @param favouritesCount The total number of tweets liked by target user
|
|
98
|
-
*/
|
|
99
|
-
UserResolver.prototype.resolveUserLikes = function (id, count, all, cursor, favouritesCount) {
|
|
100
|
-
var _a;
|
|
101
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
-
var likes, next, total, batchSize, res;
|
|
103
|
-
return __generator(this, function (_b) {
|
|
104
|
-
switch (_b.label) {
|
|
105
|
-
case 0:
|
|
106
|
-
likes = [];
|
|
107
|
-
next = new Service_1.Cursor(cursor);
|
|
108
|
-
total = 0;
|
|
109
|
-
batchSize = 20;
|
|
110
|
-
// If all liked tweets are to be fetched
|
|
111
|
-
count = all ? favouritesCount : count;
|
|
112
|
-
// If required count less than batch size, setting batch size to required count
|
|
113
|
-
batchSize = (count < batchSize) ? count : batchSize;
|
|
114
|
-
_b.label = 1;
|
|
115
|
-
case 1:
|
|
116
|
-
if (!(total < count)) return [3 /*break*/, 3];
|
|
117
|
-
// If this is the last batch, change batch size to number of remaining tweets
|
|
118
|
-
batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
|
|
119
|
-
return [4 /*yield*/, this.context.users.getUserLikes(id, count, next.value)];
|
|
120
|
-
case 2:
|
|
121
|
-
res = _b.sent();
|
|
122
|
-
// If data is available
|
|
123
|
-
if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
|
|
124
|
-
// Adding fetched tweets to list of tweets
|
|
125
|
-
likes = likes.concat(res.list);
|
|
126
|
-
// Updating total tweets fetched
|
|
127
|
-
total = likes.length;
|
|
128
|
-
// Getting cursor to next batch
|
|
129
|
-
next = res.next;
|
|
130
|
-
}
|
|
131
|
-
// If no more data is available
|
|
132
|
-
else {
|
|
133
|
-
return [3 /*break*/, 3];
|
|
134
|
-
}
|
|
135
|
-
return [3 /*break*/, 1];
|
|
136
|
-
case 3:
|
|
137
|
-
// Adding the cursor to the end of list of data
|
|
138
|
-
likes.push(next);
|
|
139
|
-
return [2 /*return*/, likes];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* @returns The list of followers of the given twiiter user
|
|
146
|
-
* @param id The id of the user whose followers are to be fetched
|
|
147
|
-
* @param count The number of followers to fetch
|
|
148
|
-
* @param all Whether to fetch all followers list
|
|
149
|
-
* @param cursor The cursor to the batch of followers to fetch
|
|
150
|
-
* @param followerCount The total number of followers of the target user
|
|
151
|
-
*/
|
|
152
|
-
UserResolver.prototype.resolveUserFollowers = function (id, count, all, cursor, followersCount) {
|
|
153
|
-
var _a;
|
|
154
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
155
|
-
var followers, next, total, batchSize, res;
|
|
156
|
-
return __generator(this, function (_b) {
|
|
157
|
-
switch (_b.label) {
|
|
158
|
-
case 0:
|
|
159
|
-
followers = [];
|
|
160
|
-
next = new Service_1.Cursor(cursor);
|
|
161
|
-
total = 0;
|
|
162
|
-
batchSize = 20;
|
|
163
|
-
// If all followers are to be fetched
|
|
164
|
-
count = (all || count > followersCount) ? followersCount : count;
|
|
165
|
-
// If required count less than batch size, setting batch size to required count
|
|
166
|
-
batchSize = (count < batchSize) ? count : batchSize;
|
|
167
|
-
_b.label = 1;
|
|
168
|
-
case 1:
|
|
169
|
-
if (!(total < count)) return [3 /*break*/, 3];
|
|
170
|
-
// If this is the last batch, change batch size to number of remaining followers
|
|
171
|
-
batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
|
|
172
|
-
return [4 /*yield*/, this.context.users.getUserFollowers(id, count, next.value)];
|
|
173
|
-
case 2:
|
|
174
|
-
res = _b.sent();
|
|
175
|
-
// If data is available
|
|
176
|
-
if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
|
|
177
|
-
// Adding fetched followers to list of followers
|
|
178
|
-
followers = followers.concat(res.list);
|
|
179
|
-
// Updating total followers fetched
|
|
180
|
-
total = followers.length;
|
|
181
|
-
// Getting cursor to next batch
|
|
182
|
-
next = res.next;
|
|
183
|
-
}
|
|
184
|
-
// If no more data is available
|
|
185
|
-
else {
|
|
186
|
-
return [3 /*break*/, 3];
|
|
187
|
-
}
|
|
188
|
-
return [3 /*break*/, 1];
|
|
189
|
-
case 3:
|
|
190
|
-
// Adding the cursor to the end of list of data
|
|
191
|
-
followers.push(next);
|
|
192
|
-
return [2 /*return*/, followers];
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* @returns The list of following of the given twiiter user
|
|
199
|
-
* @param id The id of the user whose followings are to be fetched
|
|
200
|
-
* @param count The number of following to fetch
|
|
201
|
-
* @param all Whether to fetch list of all followings
|
|
202
|
-
* @param cursor The cursor to the batch of followings to fetch
|
|
203
|
-
* @param followingsCount The total number of followings of the target user
|
|
204
|
-
*/
|
|
205
|
-
UserResolver.prototype.resolveUserFollowing = function (id, count, all, cursor, followingsCount) {
|
|
206
|
-
var _a;
|
|
207
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
208
|
-
var following, next, total, batchSize, res;
|
|
209
|
-
return __generator(this, function (_b) {
|
|
210
|
-
switch (_b.label) {
|
|
211
|
-
case 0:
|
|
212
|
-
following = [];
|
|
213
|
-
next = new Service_1.Cursor(cursor);
|
|
214
|
-
total = 0;
|
|
215
|
-
batchSize = 20;
|
|
216
|
-
// If all followings are to be fetched
|
|
217
|
-
count = (all || count > followingsCount) ? followingsCount : count;
|
|
218
|
-
// If required count less than batch size, setting batch size to required count
|
|
219
|
-
batchSize = (count < batchSize) ? count : batchSize;
|
|
220
|
-
_b.label = 1;
|
|
221
|
-
case 1:
|
|
222
|
-
if (!(total < count)) return [3 /*break*/, 3];
|
|
223
|
-
// If this is the last batch, change batch size to number of remaining following
|
|
224
|
-
batchSize = ((count - total) < batchSize) ? (count - total) : batchSize;
|
|
225
|
-
return [4 /*yield*/, this.context.users.getUserFollowing(id, count, next.value)];
|
|
226
|
-
case 2:
|
|
227
|
-
res = _b.sent();
|
|
228
|
-
// If data is available
|
|
229
|
-
if ((_a = res.list) === null || _a === void 0 ? void 0 : _a.length) {
|
|
230
|
-
// Adding fetched following to list of following
|
|
231
|
-
following = following.concat(res.list);
|
|
232
|
-
// Updating total following fetched
|
|
233
|
-
total = following.length;
|
|
234
|
-
// Getting cursor to next batch
|
|
235
|
-
next = res.next;
|
|
236
|
-
}
|
|
237
|
-
// If no more data is available
|
|
238
|
-
else {
|
|
239
|
-
return [3 /*break*/, 3];
|
|
240
|
-
}
|
|
241
|
-
return [3 /*break*/, 1];
|
|
242
|
-
case 3:
|
|
243
|
-
// Adding the cursor to the end of list of data
|
|
244
|
-
following.push(next);
|
|
245
|
-
return [2 /*return*/, following];
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
};
|
|
250
|
-
return UserResolver;
|
|
251
|
-
}(ResolverBase_1["default"]));
|
|
252
|
-
exports["default"] = UserResolver;
|
|
253
|
-
//# sourceMappingURL=UserResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserResolver.js","sourceRoot":"","sources":["../../src/resolvers/UserResolver.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { GuestCredentials, AuthCredentials } from '../types/Authentication';
|
|
2
|
-
/**
|
|
3
|
-
* Handles authentication of http requests and other authentication related tasks.
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare class AuthService {
|
|
7
|
-
/** The common bearer token for authentication. */
|
|
8
|
-
private authToken;
|
|
9
|
-
/** The current authentication credentials. */
|
|
10
|
-
private credentials;
|
|
11
|
-
/** Whether instance has been authenticated or not. */
|
|
12
|
-
isAuthenticated: boolean;
|
|
13
|
-
constructor(cookie?: string);
|
|
14
|
-
/**
|
|
15
|
-
* @returns The current authentication credentials. A different credential is returned each time this is invoked
|
|
16
|
-
*/
|
|
17
|
-
getAuthCredentials(): Promise<AuthCredentials>;
|
|
18
|
-
/**
|
|
19
|
-
* @returns The guest credentials fetched from twitter.
|
|
20
|
-
*/
|
|
21
|
-
getGuestCredentials(): Promise<GuestCredentials>;
|
|
22
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
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;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
|
-
exports.__esModule = true;
|
|
42
|
-
exports.AuthService = void 0;
|
|
43
|
-
// PACKAGE
|
|
44
|
-
var axios_1 = __importDefault(require("axios"));
|
|
45
|
-
// URLS
|
|
46
|
-
var Authentication_1 = require("./helper/urls/Authentication");
|
|
47
|
-
// CONFIGS
|
|
48
|
-
var env_1 = require("../config/env");
|
|
49
|
-
/**
|
|
50
|
-
* Handles authentication of http requests and other authentication related tasks.
|
|
51
|
-
* @internal
|
|
52
|
-
*/
|
|
53
|
-
var AuthService = /** @class */ (function () {
|
|
54
|
-
// MEMBER METHODS
|
|
55
|
-
function AuthService(cookie) {
|
|
56
|
-
if (cookie === void 0) { cookie = ''; }
|
|
57
|
-
// Reading the auth token from the config, since it's always the same
|
|
58
|
-
this.authToken = env_1.config.twitter_auth_token;
|
|
59
|
-
// Setting authentication status
|
|
60
|
-
this.isAuthenticated = cookie != '';
|
|
61
|
-
// Setting up the authenticated credentials
|
|
62
|
-
/**
|
|
63
|
-
* The following regex pattern is used to extract the csrfToken from the cookie string.
|
|
64
|
-
* This is done by matching any string between the characters 'ct0=' and nearest enclosing ';'.
|
|
65
|
-
* (?<=pattern) starts matching after the given pattern.
|
|
66
|
-
* (?=pattern) stops matching just before the pattern.
|
|
67
|
-
*/
|
|
68
|
-
this.credentials = { authToken: this.authToken, csrfToken: cookie.match(/(?<=ct0=).+?(?=;)/) + '', cookie: cookie };
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @returns The current authentication credentials. A different credential is returned each time this is invoked
|
|
72
|
-
*/
|
|
73
|
-
AuthService.prototype.getAuthCredentials = function () {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
-
return __generator(this, function (_a) {
|
|
76
|
-
return [2 /*return*/, this.credentials];
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* @returns The guest credentials fetched from twitter.
|
|
82
|
-
*/
|
|
83
|
-
AuthService.prototype.getGuestCredentials = function () {
|
|
84
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
85
|
-
var _this = this;
|
|
86
|
-
return __generator(this, function (_a) {
|
|
87
|
-
switch (_a.label) {
|
|
88
|
-
case 0: return [4 /*yield*/, axios_1["default"].post((0, Authentication_1.guestTokenUrl)(), null, {
|
|
89
|
-
headers: {
|
|
90
|
-
'Authorization': this.authToken
|
|
91
|
-
}
|
|
92
|
-
}).then(function (res) { return ({
|
|
93
|
-
authToken: _this.authToken,
|
|
94
|
-
guestToken: res.data.guest_token
|
|
95
|
-
}); })];
|
|
96
|
-
case 1:
|
|
97
|
-
// Getting the guest credentials from twitter
|
|
98
|
-
return [2 /*return*/, _a.sent()];
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
return AuthService;
|
|
104
|
-
}());
|
|
105
|
-
exports.AuthService = AuthService;
|
|
106
|
-
//# sourceMappingURL=AuthService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthService.js","sourceRoot":"","sources":["../../src/services/AuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,UAAU;AACV,gDAA0B;AAE1B,OAAO;AACP,+DAA6D;AAK7D,UAAU;AACV,qCAAuC;AAEvC;;;GAGG;AACH;IAWI,iBAAiB;IACjB,qBAAY,MAAmB;QAAnB,uBAAA,EAAA,WAAmB;QAC3B,qEAAqE;QACrE,IAAI,CAAC,SAAS,GAAG,YAAM,CAAC,kBAAkB,CAAC;QAE3C,gCAAgC;QAChC,IAAI,CAAC,eAAe,GAAG,MAAM,IAAI,EAAE,CAAC;QAEpC,2CAA2C;QAC3C;;;;;WAKG;QACH,IAAI,CAAC,WAAW,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC;IAEvH,CAAC;IAED;;OAEG;IACG,wCAAkB,GAAxB;;;gBACI,sBAAO,IAAI,CAAC,WAAW,EAAC;;;KAC3B;IAED;;OAEG;IACG,yCAAmB,GAAzB;;;;;4BAEW,qBAAM,kBAAK,CAAC,IAAI,CAA0B,IAAA,8BAAa,GAAE,EAAE,IAAI,EAAE;4BACpE,OAAO,EAAE;gCACL,eAAe,EAAE,IAAI,CAAC,SAAS;6BAClC;yBACJ,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG,IAAI,OAAA,CAAC;4BACZ,SAAS,EAAE,KAAI,CAAC,SAAS;4BACzB,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,WAAW;yBACnC,CAAC,EAHa,CAGb,CAAC,EAAA;;oBARH,6CAA6C;oBAC7C,sBAAO,SAOJ,EAAC;;;;KACP;IACL,kBAAC;AAAD,CAAC,AAnDD,IAmDC;AAnDY,kCAAW"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Handles reading and writing of data from and to cache.
|
|
3
|
-
*
|
|
4
|
-
* This services uses a local node-cache instance to cache data, since the data to be cached has no real purpose outside of the server session.
|
|
5
|
-
* This serivce follows a singleton pattern, where at any point, only a single instance of this class exists.
|
|
6
|
-
* This is done so that all the data is cached in a single instance, which makes sharing of cached data between different endpoints possible.
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare class CacheService {
|
|
10
|
-
private static instance;
|
|
11
|
-
private client;
|
|
12
|
-
private constructor();
|
|
13
|
-
/**
|
|
14
|
-
* @returns The current working instance of CacheService
|
|
15
|
-
*/
|
|
16
|
-
static getInstance(): CacheService;
|
|
17
|
-
/**
|
|
18
|
-
* Stores the input data in the cache.
|
|
19
|
-
*
|
|
20
|
-
* @param data The input data to store.
|
|
21
|
-
* @returns Whether writing to cache was successful or not.
|
|
22
|
-
* @remarks In order to cache data, the data to be cached must have a unique 'id' field.
|
|
23
|
-
*/
|
|
24
|
-
write(data: any): void;
|
|
25
|
-
/**
|
|
26
|
-
* @param id The id id of the data to be fetched from cache.
|
|
27
|
-
* @returns The data with the given id.
|
|
28
|
-
*/
|
|
29
|
-
read(id: string): any;
|
|
30
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
exports.__esModule = true;
|
|
29
|
-
exports.CacheService = void 0;
|
|
30
|
-
// PACKAGES
|
|
31
|
-
var node_cache_1 = __importDefault(require("node-cache"));
|
|
32
|
-
// PARSERS
|
|
33
|
-
var Parsers = __importStar(require("./helper/Parser"));
|
|
34
|
-
/**
|
|
35
|
-
* Handles reading and writing of data from and to cache.
|
|
36
|
-
*
|
|
37
|
-
* This services uses a local node-cache instance to cache data, since the data to be cached has no real purpose outside of the server session.
|
|
38
|
-
* This serivce follows a singleton pattern, where at any point, only a single instance of this class exists.
|
|
39
|
-
* This is done so that all the data is cached in a single instance, which makes sharing of cached data between different endpoints possible.
|
|
40
|
-
* @internal
|
|
41
|
-
*/
|
|
42
|
-
var CacheService = /** @class */ (function () {
|
|
43
|
-
// MEMBER METHODS
|
|
44
|
-
function CacheService() {
|
|
45
|
-
// Initializing new cache
|
|
46
|
-
this.client = new node_cache_1["default"]();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @returns The current working instance of CacheService
|
|
50
|
-
*/
|
|
51
|
-
CacheService.getInstance = function () {
|
|
52
|
-
// If an instance doesnt exists already
|
|
53
|
-
if (!this.instance) {
|
|
54
|
-
this.instance = new CacheService();
|
|
55
|
-
}
|
|
56
|
-
// Returning the current instance
|
|
57
|
-
return this.instance;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Stores the input data in the cache.
|
|
61
|
-
*
|
|
62
|
-
* @param data The input data to store.
|
|
63
|
-
* @returns Whether writing to cache was successful or not.
|
|
64
|
-
* @remarks In order to cache data, the data to be cached must have a unique 'id' field.
|
|
65
|
-
*/
|
|
66
|
-
CacheService.prototype.write = function (data) {
|
|
67
|
-
// Converting the data to a list of data
|
|
68
|
-
data = Parsers.dataToList(data);
|
|
69
|
-
// Iterating over the list of data
|
|
70
|
-
for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
|
|
71
|
-
var item = data_1[_i];
|
|
72
|
-
// Storing whether data is already cached or not
|
|
73
|
-
var cached = this.client.has(Parsers.findJSONKey(item, 'id'));
|
|
74
|
-
// If data does not already exist in cache
|
|
75
|
-
if (!cached) {
|
|
76
|
-
// Adding data to cache
|
|
77
|
-
this.client.set(Parsers.findJSONKey(item, 'id'), item);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* @param id The id id of the data to be fetched from cache.
|
|
83
|
-
* @returns The data with the given id.
|
|
84
|
-
*/
|
|
85
|
-
CacheService.prototype.read = function (id) {
|
|
86
|
-
// Getting data from cache
|
|
87
|
-
var res = this.client.get(id);
|
|
88
|
-
return res;
|
|
89
|
-
};
|
|
90
|
-
return CacheService;
|
|
91
|
-
}());
|
|
92
|
-
exports.CacheService = CacheService;
|
|
93
|
-
//# sourceMappingURL=CacheService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CacheService.js","sourceRoot":"","sources":["../../src/services/CacheService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,WAAW;AACX,0DAAmC;AAEnC,UAAU;AACV,uDAA2C;AAE3C;;;;;;;GAOG;AACH;IAKI,iBAAiB;IACjB;QACI,yBAAyB;QACzB,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAS,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACI,wBAAW,GAAlB;QACI,uCAAuC;QACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;SACtC;QAED,iCAAiC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACI,4BAAK,GAAZ,UAAa,IAAS;QAClB,wCAAwC;QACxC,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEhC,kCAAkC;QAClC,KAAiB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;YAAlB,IAAI,IAAI,aAAA;YACT,gDAAgD;YAChD,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YAE9D,0CAA0C;YAC1C,IAAG,CAAC,MAAM,EAAE;gBACR,uBAAuB;gBACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;aAC1D;SACJ;IACL,CAAC;IAED;;;OAGG;IACI,2BAAI,GAAX,UAAY,EAAU;QAClB,0BAA0B;QAC1B,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAE9B,OAAO,GAAG,CAAC;IACf,CAAC;IACL,mBAAC;AAAD,CAAC,AA1DD,IA0DC;AA1DY,oCAAY"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { CurlyResult } from 'node-libcurl';
|
|
2
|
-
import { AuthService } from './AuthService';
|
|
3
|
-
/**
|
|
4
|
-
* The different types of http requests.
|
|
5
|
-
*/
|
|
6
|
-
export declare enum HttpMethods {
|
|
7
|
-
POST = "POST",
|
|
8
|
-
GET = "GET"
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Handles all HTTP requests.
|
|
12
|
-
* @internal
|
|
13
|
-
*
|
|
14
|
-
* This serves as the base service from which all other data services derive their behaviour.
|
|
15
|
-
*/
|
|
16
|
-
export declare class FetcherService {
|
|
17
|
-
/** The authentication service instance. */
|
|
18
|
-
private auth;
|
|
19
|
-
/** The caching service instance. */
|
|
20
|
-
private cache;
|
|
21
|
-
/** Whether instance has been authenticated or not. */
|
|
22
|
-
protected isAuthenticated: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* @param auth The AuthService instance to use for authentication.
|
|
25
|
-
*/
|
|
26
|
-
constructor(auth: AuthService);
|
|
27
|
-
/**
|
|
28
|
-
* The middleware for handling any HTTP error.
|
|
29
|
-
*
|
|
30
|
-
* @param res The response object received.
|
|
31
|
-
* @throws {@link HttpStatus}.
|
|
32
|
-
* @returns The received response, if no HTTP errors are found.
|
|
33
|
-
*/
|
|
34
|
-
private handleHTTPError;
|
|
35
|
-
/**
|
|
36
|
-
* Creates an HTTP request according to the given parameters.
|
|
37
|
-
*
|
|
38
|
-
* This method internally uses node-libcurl library to make curl requests to the URL, instead of node-fetch.
|
|
39
|
-
* This has been done since that way it better mimics the HTTP requests made from browser.
|
|
40
|
-
*
|
|
41
|
-
* @param url The url to fetch data from.
|
|
42
|
-
* @param authenticate Whether to authenticate requests or not.
|
|
43
|
-
* @param method The HTTP method (from {@link HttpMethods}) to use.
|
|
44
|
-
* @param data The data to be sent along with the request (for POST request).
|
|
45
|
-
* @returns The {@link CurlyResult} received.
|
|
46
|
-
*/
|
|
47
|
-
protected request<DataType>(url: string, authenticate?: boolean, method?: HttpMethods, data?: any): Promise<CurlyResult<DataType>>;
|
|
48
|
-
/**
|
|
49
|
-
* Caches the extracted data into the {@link CacheService} instance.
|
|
50
|
-
*
|
|
51
|
-
* @param data The extracted data to be cached
|
|
52
|
-
*/
|
|
53
|
-
protected cacheData(data: any): void;
|
|
54
|
-
/**
|
|
55
|
-
* Fetches the data with the given id from the cache.
|
|
56
|
-
*
|
|
57
|
-
* @param id The id of the data to be read from cache.
|
|
58
|
-
* @returns The data with the given id. If does not exists, returns undefined.
|
|
59
|
-
*/
|
|
60
|
-
protected readData(id: string): any;
|
|
61
|
-
}
|