rettiwt-api 1.3.1 → 2.0.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/.eslintignore +3 -0
- package/.eslintrc.js +54 -0
- package/.github/workflows/documentation.yml +47 -0
- package/.github/workflows/{publish-to-npm.yml → publish.yml} +8 -8
- package/.prettierignore +3 -0
- package/.prettierrc +13 -0
- package/README.md +59 -61
- package/dist/Rettiwt.d.ts +19 -0
- package/dist/Rettiwt.js +30 -0
- package/dist/Rettiwt.js.map +1 -0
- package/dist/enums/ApiErrors.d.ts +30 -0
- package/dist/enums/ApiErrors.js +35 -0
- package/dist/enums/ApiErrors.js.map +1 -0
- package/dist/enums/HTTP.d.ts +11 -11
- package/dist/enums/HTTP.js +15 -16
- package/dist/enums/HTTP.js.map +1 -1
- package/dist/helper/JsonUtils.d.ts +26 -0
- package/dist/helper/JsonUtils.js +88 -0
- package/dist/helper/JsonUtils.js.map +1 -0
- package/dist/index.d.ts +10 -43
- package/dist/index.js +16 -55
- package/dist/index.js.map +1 -1
- package/dist/models/CursoredData.d.ts +37 -0
- package/dist/models/CursoredData.js +59 -0
- package/dist/models/CursoredData.js.map +1 -0
- package/dist/models/{data/Tweet.d.ts → Tweet.d.ts} +4 -4
- package/dist/models/{data/Tweet.js → Tweet.js} +7 -32
- package/dist/models/Tweet.js.map +1 -0
- package/dist/models/{data/User.d.ts → User.d.ts} +3 -3
- package/dist/models/{data/User.js → User.js} +3 -3
- package/dist/models/User.js.map +1 -0
- package/dist/services/FetcherService.d.ts +66 -0
- package/dist/services/FetcherService.js +207 -0
- package/dist/services/FetcherService.js.map +1 -0
- package/dist/services/TweetService.d.ts +88 -0
- package/dist/services/TweetService.js +244 -0
- package/dist/services/TweetService.js.map +1 -0
- package/dist/services/UserService.d.ts +60 -0
- package/dist/services/UserService.js +188 -0
- package/dist/services/UserService.js.map +1 -0
- package/dist/types/{Service.d.ts → CursoredData.d.ts} +3 -3
- package/dist/types/CursoredData.js +3 -0
- package/dist/types/CursoredData.js.map +1 -0
- package/dist/types/Tweet.js +1 -1
- package/dist/types/User.js +1 -1
- package/package.json +15 -19
- package/src/Rettiwt.ts +33 -0
- package/src/enums/ApiErrors.ts +30 -0
- package/src/enums/HTTP.ts +12 -12
- package/src/helper/JsonUtils.ts +86 -0
- package/src/index.ts +14 -57
- package/src/models/CursoredData.ts +64 -0
- package/src/models/Tweet.ts +116 -0
- package/src/models/User.ts +72 -0
- package/src/services/FetcherService.ts +183 -0
- package/src/services/TweetService.ts +153 -0
- package/src/services/UserService.ts +117 -0
- package/src/types/CursoredData.ts +24 -0
- package/src/types/Tweet.ts +35 -35
- package/src/types/User.ts +30 -30
- package/tsconfig.json +9 -9
- package/.github/workflows/build-docs.yml +0 -28
- package/dist/config/env.d.ts +0 -5
- package/dist/config/env.js +0 -9
- package/dist/config/env.js.map +0 -1
- package/dist/enums/Errors.d.ts +0 -21
- package/dist/enums/Errors.js +0 -29
- package/dist/enums/Errors.js.map +0 -1
- package/dist/graphql/enums/Errors.d.ts +0 -21
- package/dist/graphql/enums/Errors.js +0 -29
- package/dist/graphql/enums/Errors.js.map +0 -1
- package/dist/graphql/queries/RootQuery.d.ts +0 -4
- package/dist/graphql/queries/RootQuery.js +0 -78
- package/dist/graphql/queries/RootQuery.js.map +0 -1
- package/dist/graphql/resolvers/AccountResolver.d.ts +0 -12
- package/dist/graphql/resolvers/AccountResolver.js +0 -84
- package/dist/graphql/resolvers/AccountResolver.js.map +0 -1
- package/dist/graphql/resolvers/ResolverBase.d.ts +0 -16
- package/dist/graphql/resolvers/ResolverBase.js +0 -23
- package/dist/graphql/resolvers/ResolverBase.js.map +0 -1
- package/dist/graphql/resolvers/TweetResolver.d.ts +0 -46
- package/dist/graphql/resolvers/TweetResolver.js +0 -312
- package/dist/graphql/resolvers/TweetResolver.js.map +0 -1
- package/dist/graphql/resolvers/UserResolver.d.ts +0 -48
- package/dist/graphql/resolvers/UserResolver.js +0 -334
- package/dist/graphql/resolvers/UserResolver.js.map +0 -1
- package/dist/graphql/types/Global.d.ts +0 -4
- package/dist/graphql/types/Global.js +0 -13
- package/dist/graphql/types/Global.js.map +0 -1
- package/dist/graphql/types/TweetTypes.d.ts +0 -4
- package/dist/graphql/types/TweetTypes.js +0 -160
- package/dist/graphql/types/TweetTypes.js.map +0 -1
- package/dist/graphql/types/UserTypes.d.ts +0 -3
- package/dist/graphql/types/UserTypes.js +0 -137
- package/dist/graphql/types/UserTypes.js.map +0 -1
- package/dist/models/args/TweetListArgs.d.ts +0 -21
- package/dist/models/args/TweetListArgs.js +0 -54
- package/dist/models/args/TweetListArgs.js.map +0 -1
- package/dist/models/args/UserListArgs.d.ts +0 -21
- package/dist/models/args/UserListArgs.js +0 -54
- package/dist/models/args/UserListArgs.js.map +0 -1
- package/dist/models/auth/AuthCookie.d.ts +0 -21
- package/dist/models/auth/AuthCookie.js +0 -33
- package/dist/models/auth/AuthCookie.js.map +0 -1
- package/dist/models/data/CursoredData.d.ts +0 -34
- package/dist/models/data/CursoredData.js +0 -42
- package/dist/models/data/CursoredData.js.map +0 -1
- package/dist/models/data/Tweet.js.map +0 -1
- package/dist/models/data/User.js.map +0 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.js +0 -76
- package/dist/server.js.map +0 -1
- package/dist/services/auth/AccountService.d.ts +0 -83
- package/dist/services/auth/AccountService.js +0 -412
- package/dist/services/auth/AccountService.js.map +0 -1
- package/dist/services/auth/AuthService.d.ts +0 -31
- package/dist/services/auth/AuthService.js +0 -118
- package/dist/services/auth/AuthService.js.map +0 -1
- package/dist/services/data/TweetService.d.ts +0 -60
- package/dist/services/data/TweetService.js +0 -251
- package/dist/services/data/TweetService.js.map +0 -1
- package/dist/services/data/UserService.d.ts +0 -71
- package/dist/services/data/UserService.js +0 -278
- package/dist/services/data/UserService.js.map +0 -1
- package/dist/services/helper/Headers.d.ts +0 -19
- package/dist/services/helper/Headers.js +0 -62
- package/dist/services/helper/Headers.js.map +0 -1
- package/dist/services/helper/Parser.d.ts +0 -22
- package/dist/services/helper/Parser.js +0 -84
- package/dist/services/helper/Parser.js.map +0 -1
- package/dist/services/helper/extractors/Tweets.d.ts +0 -23
- package/dist/services/helper/extractors/Tweets.js +0 -200
- package/dist/services/helper/extractors/Tweets.js.map +0 -1
- package/dist/services/helper/extractors/Users.d.ts +0 -17
- package/dist/services/helper/extractors/Users.js +0 -151
- package/dist/services/helper/extractors/Users.js.map +0 -1
- package/dist/services/helper/payloads/LoginFlows.d.ts +0 -77
- package/dist/services/helper/payloads/LoginFlows.js +0 -92
- package/dist/services/helper/payloads/LoginFlows.js.map +0 -1
- package/dist/services/helper/urls/Authentication.d.ts +0 -4
- package/dist/services/helper/urls/Authentication.js +0 -11
- package/dist/services/helper/urls/Authentication.js.map +0 -1
- package/dist/services/util/CacheService.d.ts +0 -33
- package/dist/services/util/CacheService.js +0 -96
- package/dist/services/util/CacheService.js.map +0 -1
- package/dist/services/util/FetcherService.d.ts +0 -65
- package/dist/services/util/FetcherService.js +0 -202
- package/dist/services/util/FetcherService.js.map +0 -1
- package/dist/types/Args.d.ts +0 -11
- package/dist/types/Args.js +0 -4
- package/dist/types/Args.js.map +0 -1
- package/dist/types/Authentication.d.ts +0 -55
- package/dist/types/Authentication.js +0 -6
- package/dist/types/Authentication.js.map +0 -1
- package/dist/types/Resolvers.d.ts +0 -15
- package/dist/types/Resolvers.js +0 -3
- package/dist/types/Resolvers.js.map +0 -1
- package/dist/types/Rettiwt.d.ts +0 -16
- package/dist/types/Rettiwt.js +0 -3
- package/dist/types/Rettiwt.js.map +0 -1
- package/dist/types/Service.js +0 -5
- package/dist/types/Service.js.map +0 -1
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -64
- package/docs/assets/main.js +0 -58
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1280
- package/docs/classes/AccountService.html +0 -286
- package/docs/classes/AuthCookie.html +0 -146
- package/docs/classes/AuthService.html +0 -147
- package/docs/classes/CacheService.html +0 -157
- package/docs/classes/Cursor.html +0 -102
- package/docs/classes/CursoredData.html +0 -126
- package/docs/classes/DataValidationError.html +0 -120
- package/docs/classes/FetcherService.html +0 -225
- package/docs/classes/Tweet.html +0 -210
- package/docs/classes/TweetEntities.html +0 -128
- package/docs/classes/TweetFilter.html +0 -223
- package/docs/classes/TweetListArgs.html +0 -118
- package/docs/classes/TweetService.html +0 -319
- package/docs/classes/User.html +0 -230
- package/docs/classes/UserListArgs.html +0 -118
- package/docs/classes/UserService.html +0 -355
- package/docs/enums/HttpMethods.html +0 -74
- package/docs/functions/Rettiwt.html +0 -100
- package/docs/index.html +0 -159
- package/docs/interfaces/IAuthCookie.html +0 -104
- package/docs/interfaces/ICursor.html +0 -77
- package/docs/interfaces/ICursoredData.html +0 -93
- package/docs/interfaces/IDataContext.html +0 -91
- package/docs/interfaces/IDataValidationError.html +0 -109
- package/docs/interfaces/IListArgs.html +0 -87
- package/docs/interfaces/ITweet.html +0 -176
- package/docs/interfaces/ITweetEntities.html +0 -104
- package/docs/interfaces/ITweetFilter.html +0 -158
- package/docs/interfaces/IUser.html +0 -194
- package/docs/modules.html +0 -111
- package/environment.d.ts +0 -11
- package/src/config/env.ts +0 -5
- package/src/enums/Errors.ts +0 -22
- package/src/graphql/enums/Errors.ts +0 -22
- package/src/graphql/queries/RootQuery.ts +0 -75
- package/src/graphql/resolvers/AccountResolver.ts +0 -22
- package/src/graphql/resolvers/ResolverBase.ts +0 -26
- package/src/graphql/resolvers/TweetResolver.ts +0 -237
- package/src/graphql/resolvers/UserResolver.ts +0 -257
- package/src/graphql/types/Global.ts +0 -10
- package/src/graphql/types/TweetTypes.ts +0 -158
- package/src/graphql/types/UserTypes.ts +0 -135
- package/src/models/args/TweetListArgs.ts +0 -47
- package/src/models/args/UserListArgs.ts +0 -47
- package/src/models/auth/AuthCookie.ts +0 -43
- package/src/models/data/CursoredData.ts +0 -45
- package/src/models/data/Tweet.ts +0 -118
- package/src/models/data/User.ts +0 -72
- package/src/server.ts +0 -37
- package/src/services/auth/AccountService.ts +0 -283
- package/src/services/auth/AuthService.ts +0 -81
- package/src/services/data/TweetService.ts +0 -198
- package/src/services/data/UserService.ts +0 -221
- package/src/services/helper/Headers.ts +0 -60
- package/src/services/helper/Parser.ts +0 -89
- package/src/services/helper/extractors/Tweets.ts +0 -190
- package/src/services/helper/extractors/Users.ts +0 -141
- package/src/services/helper/payloads/LoginFlows.ts +0 -90
- package/src/services/helper/urls/Authentication.ts +0 -6
- package/src/services/util/CacheService.ts +0 -76
- package/src/services/util/FetcherService.ts +0 -143
- package/src/types/Args.ts +0 -12
- package/src/types/Authentication.ts +0 -63
- package/src/types/Resolvers.ts +0 -18
- package/src/types/Rettiwt.ts +0 -20
- package/src/types/Service.ts +0 -24
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
exports.__esModule = true;
|
|
6
|
-
exports.UserList = exports.User = void 0;
|
|
7
|
-
// PACKAGE
|
|
8
|
-
var graphql_1 = require("graphql");
|
|
9
|
-
// TYPES
|
|
10
|
-
var TweetTypes_1 = require("./TweetTypes");
|
|
11
|
-
var Global_1 = require("./Global");
|
|
12
|
-
// RESOLVERS
|
|
13
|
-
var UserResolver_1 = __importDefault(require("../resolvers/UserResolver"));
|
|
14
|
-
var TweetResolver_1 = __importDefault(require("../resolvers/TweetResolver"));
|
|
15
|
-
exports.User = new graphql_1.GraphQLObjectType({
|
|
16
|
-
name: 'User',
|
|
17
|
-
description: 'The details of a single target twitter user',
|
|
18
|
-
fields: function () { return ({
|
|
19
|
-
id: { type: graphql_1.GraphQLString },
|
|
20
|
-
userName: { type: graphql_1.GraphQLString },
|
|
21
|
-
fullName: { type: graphql_1.GraphQLString },
|
|
22
|
-
createdAt: { type: graphql_1.GraphQLString },
|
|
23
|
-
description: { type: graphql_1.GraphQLString },
|
|
24
|
-
isVerified: { type: graphql_1.GraphQLBoolean },
|
|
25
|
-
location: { type: graphql_1.GraphQLString },
|
|
26
|
-
pinnedTweet: {
|
|
27
|
-
type: TweetTypes_1.Tweet,
|
|
28
|
-
resolve: function (parent, args, context) { return (parent.pinnedTweet) ? new TweetResolver_1["default"](context).resolveTweet(parent.pinnedTweet) : undefined; }
|
|
29
|
-
},
|
|
30
|
-
profileBanner: { type: graphql_1.GraphQLString },
|
|
31
|
-
profileImage: { type: graphql_1.GraphQLString },
|
|
32
|
-
favouritesCount: { type: graphql_1.GraphQLInt },
|
|
33
|
-
likes: {
|
|
34
|
-
type: TweetTypes_1.TweetList,
|
|
35
|
-
args: {
|
|
36
|
-
count: {
|
|
37
|
-
description: "The number of liked tweets to fetch, must be >= 40 (when no cursor if provided)",
|
|
38
|
-
type: graphql_1.GraphQLInt,
|
|
39
|
-
defaultValue: 10
|
|
40
|
-
},
|
|
41
|
-
all: {
|
|
42
|
-
description: "Whether to fetch all tweets liked by user",
|
|
43
|
-
type: graphql_1.GraphQLBoolean,
|
|
44
|
-
defaultValue: false
|
|
45
|
-
},
|
|
46
|
-
cursor: {
|
|
47
|
-
type: graphql_1.GraphQLString,
|
|
48
|
-
description: 'The cursor to the batch of likes list to fetch',
|
|
49
|
-
defaultValue: ''
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
resolve: function (parent, args, context) { return new UserResolver_1["default"](context).resolveUserLikes(parent.id, args.count, args.all, args.cursor, parent.favouritesCount); }
|
|
53
|
-
},
|
|
54
|
-
followersCount: { type: graphql_1.GraphQLInt },
|
|
55
|
-
followers: {
|
|
56
|
-
type: exports.UserList,
|
|
57
|
-
args: {
|
|
58
|
-
count: {
|
|
59
|
-
description: "The number of followers to fetch, must be >= 40 (when no cursor is provided)",
|
|
60
|
-
type: graphql_1.GraphQLInt,
|
|
61
|
-
defaultValue: 40
|
|
62
|
-
},
|
|
63
|
-
all: {
|
|
64
|
-
description: "Whether to fetch all followers list",
|
|
65
|
-
type: graphql_1.GraphQLBoolean,
|
|
66
|
-
defaultValue: false
|
|
67
|
-
},
|
|
68
|
-
cursor: {
|
|
69
|
-
type: graphql_1.GraphQLString,
|
|
70
|
-
description: 'The cursor to the batch of followers list to fetch',
|
|
71
|
-
defaultValue: ''
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
resolve: function (parent, args, context) { return new UserResolver_1["default"](context).resolveUserFollowers(parent.id, args.count, args.all, args.cursor, parent.followersCount); }
|
|
75
|
-
},
|
|
76
|
-
followingsCount: { type: graphql_1.GraphQLInt },
|
|
77
|
-
following: {
|
|
78
|
-
type: exports.UserList,
|
|
79
|
-
args: {
|
|
80
|
-
count: {
|
|
81
|
-
type: graphql_1.GraphQLInt,
|
|
82
|
-
description: "The number of followings to fetch, must be >= 40 (when no cursor is provided)",
|
|
83
|
-
defaultValue: 40
|
|
84
|
-
},
|
|
85
|
-
all: {
|
|
86
|
-
description: "Whether to fetch all followings list",
|
|
87
|
-
type: graphql_1.GraphQLBoolean,
|
|
88
|
-
defaultValue: false
|
|
89
|
-
},
|
|
90
|
-
cursor: {
|
|
91
|
-
type: graphql_1.GraphQLString,
|
|
92
|
-
description: 'The cursor to the batch of followers list to fetch',
|
|
93
|
-
defaultValue: ''
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
resolve: function (parent, args, context) { return new UserResolver_1["default"](context).resolveUserFollowing(parent.id, args.count, args.all, args.cursor, parent.followingsCount); }
|
|
97
|
-
},
|
|
98
|
-
statusesCount: { type: graphql_1.GraphQLInt },
|
|
99
|
-
tweets: {
|
|
100
|
-
type: TweetTypes_1.TweetList,
|
|
101
|
-
args: {
|
|
102
|
-
count: {
|
|
103
|
-
description: "The number of tweets to fetch, must be >= 1",
|
|
104
|
-
type: graphql_1.GraphQLInt,
|
|
105
|
-
defaultValue: 10
|
|
106
|
-
},
|
|
107
|
-
all: {
|
|
108
|
-
description: "Whether to fetch all tweets made by user",
|
|
109
|
-
type: graphql_1.GraphQLBoolean,
|
|
110
|
-
defaultValue: false
|
|
111
|
-
},
|
|
112
|
-
cursor: {
|
|
113
|
-
type: graphql_1.GraphQLString,
|
|
114
|
-
description: 'The cursor to the batch of tweets list to fetch',
|
|
115
|
-
defaultValue: ''
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
resolve: function (parent, args, context) { return new UserResolver_1["default"](context).resolveUserTweets(parent.userName, args.count, args.all, args.cursor, parent.statusesCount); }
|
|
119
|
-
}
|
|
120
|
-
}); }
|
|
121
|
-
});
|
|
122
|
-
exports.UserList = new graphql_1.GraphQLList(new graphql_1.GraphQLUnionType({
|
|
123
|
-
name: 'UserCursorUnion',
|
|
124
|
-
description: 'A union type which can either be a User or a Cursor, used in cursored User lists',
|
|
125
|
-
types: [exports.User, Global_1.Cursor],
|
|
126
|
-
resolveType: function (data) {
|
|
127
|
-
// If it has a userName field => this is a User object
|
|
128
|
-
if (data.userName) {
|
|
129
|
-
return exports.User;
|
|
130
|
-
}
|
|
131
|
-
// If it has a value field => this is a Cursor object
|
|
132
|
-
else if (data.value) {
|
|
133
|
-
return Global_1.Cursor;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
//# sourceMappingURL=UserTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserTypes.js","sourceRoot":"","sources":["../../../src/graphql/types/UserTypes.ts"],"names":[],"mappings":";;;;;;AAAA,UAAU;AACV,mCAAmI;AAGnI,QAAQ;AACR,2CAA+C;AAC/C,mCAAkC;AAElC,YAAY;AACZ,2EAAqD;AACrD,6EAAuD;AAE1C,QAAA,IAAI,GAAsB,IAAI,2BAAiB,CAAC;IACzD,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,6CAA6C;IAC1D,MAAM,EAAE,cAAM,OAAA,CAAC;QACX,EAAE,EAAE,EAAE,IAAI,EAAE,uBAAa,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EA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;SACf;QACD,qDAAqD;aAChD,IAAI,IAAI,CAAC,KAAK,EAAE;YACjB,OAAO,eAAM,CAAC;SACjB;IACL,CAAC;CACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IListArgs } from '../../types/Args';
|
|
2
|
-
/**
|
|
3
|
-
* The arguments for fetching cursored list in TweetService.
|
|
4
|
-
*
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class TweetListArgs implements IListArgs {
|
|
8
|
-
/** The number of data items to fetch.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue 10
|
|
11
|
-
* @remarks Must be >= 10 and <= 100
|
|
12
|
-
*/
|
|
13
|
-
count: number;
|
|
14
|
-
/** The cursor to the batch of data to fetch. */
|
|
15
|
-
cursor: string;
|
|
16
|
-
/**
|
|
17
|
-
* @param count The number of data items to fetch.
|
|
18
|
-
* @param cursor The cursor to the batch of data to fetch.
|
|
19
|
-
*/
|
|
20
|
-
constructor(count?: number, cursor?: string);
|
|
21
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
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 rettiwt_core_1 = require("rettiwt-core");
|
|
16
|
-
/**
|
|
17
|
-
* The arguments for fetching cursored list in TweetService.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
var TweetListArgs = /** @class */ (function () {
|
|
22
|
-
/**
|
|
23
|
-
* @param count The number of data items to fetch.
|
|
24
|
-
* @param cursor The cursor to the batch of data to fetch.
|
|
25
|
-
*/
|
|
26
|
-
function TweetListArgs(count, cursor) {
|
|
27
|
-
if (count === void 0) { count = 10; }
|
|
28
|
-
if (cursor === void 0) { cursor = ''; }
|
|
29
|
-
this.count = count;
|
|
30
|
-
this.cursor = cursor;
|
|
31
|
-
// Validating the arguments
|
|
32
|
-
var validationResult = (0, class_validator_1.validateSync)(this);
|
|
33
|
-
// If valiation error occured
|
|
34
|
-
if (validationResult.length) {
|
|
35
|
-
throw new rettiwt_core_1.DataValidationError(validationResult);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, class_validator_1.IsInt)(),
|
|
40
|
-
(0, class_validator_1.IsOptional)(),
|
|
41
|
-
(0, class_validator_1.Max)(100),
|
|
42
|
-
(0, class_validator_1.ValidateIf)(function (ob) { return ob.cursor.length == 0; }),
|
|
43
|
-
(0, class_validator_1.Min)(10),
|
|
44
|
-
__metadata("design:type", Number)
|
|
45
|
-
], TweetListArgs.prototype, "count");
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, class_validator_1.IsString)(),
|
|
48
|
-
(0, class_validator_1.IsOptional)(),
|
|
49
|
-
__metadata("design:type", String)
|
|
50
|
-
], TweetListArgs.prototype, "cursor");
|
|
51
|
-
return TweetListArgs;
|
|
52
|
-
}());
|
|
53
|
-
exports.TweetListArgs = TweetListArgs;
|
|
54
|
-
//# sourceMappingURL=TweetListArgs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TweetListArgs.js","sourceRoot":"","sources":["../../../src/models/args/TweetListArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,mDAAkG;AAClG,6CAAmD;AAKnD;;;;GAIG;AACH;IAkBI;;;OAGG;IACH,uBAAY,KAAkB,EAAE,MAAmB;QAAvC,sBAAA,EAAA,UAAkB;QAAE,uBAAA,EAAA,WAAmB;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,2BAA2B;QAC3B,IAAM,gBAAgB,GAAG,IAAA,8BAAY,EAAC,IAAI,CAAC,CAAC;QAE5C,6BAA6B;QAC7B,IAAI,gBAAgB,CAAC,MAAM,EAAE;YACzB,MAAM,IAAI,kCAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnD;IACL,CAAC;IAtBD;QALC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;QACZ,IAAA,qBAAG,EAAC,GAAG,CAAC;QACR,IAAA,4BAAU,EAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAArB,CAAqB,CAAC;QACvC,IAAA,qBAAG,EAAC,EAAE,CAAC;;wCACM;IAKd;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yCACE;IAkBnB,oBAAC;CAAA,AAlCD,IAkCC;AAlCY,sCAAa"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IListArgs } from '../../types/Args';
|
|
2
|
-
/**
|
|
3
|
-
* The arguments for fetching cursored list in TweetService.
|
|
4
|
-
*
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class UserListArgs implements IListArgs {
|
|
8
|
-
/** The number of data items to fetch.
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue 40
|
|
11
|
-
* @remarks Must be >= 40 and <= 100
|
|
12
|
-
*/
|
|
13
|
-
count: number;
|
|
14
|
-
/** The cursor to the batch of data to fetch. */
|
|
15
|
-
cursor: string;
|
|
16
|
-
/**
|
|
17
|
-
* @param count The number of data items to fetch.
|
|
18
|
-
* @param cursor The cursor to the batch of data to fetch.
|
|
19
|
-
*/
|
|
20
|
-
constructor(count?: number, cursor?: string);
|
|
21
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
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 rettiwt_core_1 = require("rettiwt-core");
|
|
16
|
-
/**
|
|
17
|
-
* The arguments for fetching cursored list in TweetService.
|
|
18
|
-
*
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
var UserListArgs = /** @class */ (function () {
|
|
22
|
-
/**
|
|
23
|
-
* @param count The number of data items to fetch.
|
|
24
|
-
* @param cursor The cursor to the batch of data to fetch.
|
|
25
|
-
*/
|
|
26
|
-
function UserListArgs(count, cursor) {
|
|
27
|
-
if (count === void 0) { count = 40; }
|
|
28
|
-
if (cursor === void 0) { cursor = ''; }
|
|
29
|
-
this.count = count;
|
|
30
|
-
this.cursor = cursor;
|
|
31
|
-
// Validating the arguments
|
|
32
|
-
var validationResult = (0, class_validator_1.validateSync)(this);
|
|
33
|
-
// If valiation error occured
|
|
34
|
-
if (validationResult.length) {
|
|
35
|
-
throw new rettiwt_core_1.DataValidationError(validationResult);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, class_validator_1.IsInt)(),
|
|
40
|
-
(0, class_validator_1.IsOptional)(),
|
|
41
|
-
(0, class_validator_1.Max)(100),
|
|
42
|
-
(0, class_validator_1.ValidateIf)(function (ob) { return ob.cursor.length == 0; }),
|
|
43
|
-
(0, class_validator_1.Min)(40),
|
|
44
|
-
__metadata("design:type", Number)
|
|
45
|
-
], UserListArgs.prototype, "count");
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, class_validator_1.IsString)(),
|
|
48
|
-
(0, class_validator_1.IsOptional)(),
|
|
49
|
-
__metadata("design:type", String)
|
|
50
|
-
], UserListArgs.prototype, "cursor");
|
|
51
|
-
return UserListArgs;
|
|
52
|
-
}());
|
|
53
|
-
exports.UserListArgs = UserListArgs;
|
|
54
|
-
//# sourceMappingURL=UserListArgs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserListArgs.js","sourceRoot":"","sources":["../../../src/models/args/UserListArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,mDAAkG;AAClG,6CAAmD;AAKnD;;;;GAIG;AACH;IAkBI;;;OAGG;IACH,sBAAY,KAAkB,EAAE,MAAmB;QAAvC,sBAAA,EAAA,UAAkB;QAAE,uBAAA,EAAA,WAAmB;QAC/C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,2BAA2B;QAC3B,IAAM,gBAAgB,GAAG,IAAA,8BAAY,EAAC,IAAI,CAAC,CAAC;QAE5C,6BAA6B;QAC7B,IAAI,gBAAgB,CAAC,MAAM,EAAE;YACzB,MAAM,IAAI,kCAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnD;IACL,CAAC;IAtBD;QALC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;QACZ,IAAA,qBAAG,EAAC,GAAG,CAAC;QACR,IAAA,4BAAU,EAAC,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,EAArB,CAAqB,CAAC;QACvC,IAAA,qBAAG,EAAC,EAAE,CAAC;;uCACM;IAKd;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;wCACE;IAkBnB,mBAAC;CAAA,AAlCD,IAkCC;AAlCY,oCAAY"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IAuthCookie } from '../../types/Authentication';
|
|
2
|
-
/**
|
|
3
|
-
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
4
|
-
*
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class AuthCookie implements IAuthCookie {
|
|
8
|
-
/** Token used to authenticate a device. */
|
|
9
|
-
kdt: string;
|
|
10
|
-
/** Token used to authenticate a user using a Twitter ID. */
|
|
11
|
-
twid: string;
|
|
12
|
-
/** The CSRF token of the session. */
|
|
13
|
-
ct0: string;
|
|
14
|
-
/** The authentication token used while logging in to the account. */
|
|
15
|
-
auth_token: string;
|
|
16
|
-
constructor(cookie?: IAuthCookie);
|
|
17
|
-
/**
|
|
18
|
-
* @returns The string respresentation of this cookie in the valid cookie string format.
|
|
19
|
-
*/
|
|
20
|
-
toString(): string;
|
|
21
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.AuthCookie = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
var AuthCookie = /** @class */ (function () {
|
|
10
|
-
function AuthCookie(cookie) {
|
|
11
|
-
var _a, _b, _c, _d;
|
|
12
|
-
this.auth_token = (_a = cookie === null || cookie === void 0 ? void 0 : cookie.auth_token) !== null && _a !== void 0 ? _a : '';
|
|
13
|
-
this.ct0 = (_b = cookie === null || cookie === void 0 ? void 0 : cookie.ct0) !== null && _b !== void 0 ? _b : '';
|
|
14
|
-
this.kdt = (_c = cookie === null || cookie === void 0 ? void 0 : cookie.kdt) !== null && _c !== void 0 ? _c : '';
|
|
15
|
-
this.twid = (_d = cookie === null || cookie === void 0 ? void 0 : cookie.twid) !== null && _d !== void 0 ? _d : '';
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @returns The string respresentation of this cookie in the valid cookie string format.
|
|
19
|
-
*/
|
|
20
|
-
AuthCookie.prototype.toString = function () {
|
|
21
|
-
/** The string representation of this cookie. */
|
|
22
|
-
var cookieString = '';
|
|
23
|
-
// Iterating through the (key, value) pairs of this cookie
|
|
24
|
-
for (var _i = 0, _a = Object.entries(this); _i < _a.length; _i++) {
|
|
25
|
-
var _b = _a[_i], key = _b[0], value = _b[1];
|
|
26
|
-
cookieString += "".concat(key, "=").concat(value, ";");
|
|
27
|
-
}
|
|
28
|
-
return cookieString;
|
|
29
|
-
};
|
|
30
|
-
return AuthCookie;
|
|
31
|
-
}());
|
|
32
|
-
exports.AuthCookie = AuthCookie;
|
|
33
|
-
//# sourceMappingURL=AuthCookie.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthCookie.js","sourceRoot":"","sources":["../../../src/models/auth/AuthCookie.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAaI,oBAAY,MAAoB;;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,mCAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,GAAG,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,6BAAQ,GAAR;QACI,gDAAgD;QAChD,IAAI,YAAY,GAAW,EAAE,CAAC;QAE9B,0DAA0D;QAC1D,KAAyB,UAAoB,EAApB,KAAA,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAApB,cAAoB,EAApB,IAAoB,EAAE;YAAtC,IAAA,WAAY,EAAX,GAAG,QAAA,EAAE,KAAK,QAAA;YAChB,YAAY,IAAI,UAAG,GAAG,cAAI,KAAK,MAAG,CAAC;SACtC;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IACL,iBAAC;AAAD,CAAC,AAlCD,IAkCC;AAlCY,gCAAU"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ICursor, ICursoredData } from "../../types/Service";
|
|
2
|
-
/**
|
|
3
|
-
* The cursor to the batch of data to be fetched.
|
|
4
|
-
*
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class Cursor implements ICursor {
|
|
8
|
-
/** The cursor string. */
|
|
9
|
-
value: string;
|
|
10
|
-
/**
|
|
11
|
-
* Initializes a new cursor from the given cursor string.
|
|
12
|
-
*
|
|
13
|
-
* @param cursorStr The string representation of the cursor.
|
|
14
|
-
*/
|
|
15
|
-
constructor(cursorStr: string);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The data that us fetched batch-wise along with a cursor.
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
*
|
|
22
|
-
* @typeParam Type - The type of data present in the list.
|
|
23
|
-
*/
|
|
24
|
-
export declare class CursoredData<T> implements ICursoredData<T> {
|
|
25
|
-
/** The list of data of the given type. */
|
|
26
|
-
list: T[];
|
|
27
|
-
/** The cursor to the next batch of data. */
|
|
28
|
-
next: Cursor;
|
|
29
|
-
/**
|
|
30
|
-
* @param list The list of data item to store.
|
|
31
|
-
* @param next The cursor to the next batch of data.
|
|
32
|
-
*/
|
|
33
|
-
constructor(list?: T[], next?: string);
|
|
34
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
exports.__esModule = true;
|
|
3
|
-
exports.CursoredData = exports.Cursor = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The cursor to the batch of data to be fetched.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
var Cursor = /** @class */ (function () {
|
|
10
|
-
/**
|
|
11
|
-
* Initializes a new cursor from the given cursor string.
|
|
12
|
-
*
|
|
13
|
-
* @param cursorStr The string representation of the cursor.
|
|
14
|
-
*/
|
|
15
|
-
function Cursor(cursorStr) {
|
|
16
|
-
this.value = cursorStr;
|
|
17
|
-
}
|
|
18
|
-
return Cursor;
|
|
19
|
-
}());
|
|
20
|
-
exports.Cursor = Cursor;
|
|
21
|
-
/**
|
|
22
|
-
* The data that us fetched batch-wise along with a cursor.
|
|
23
|
-
*
|
|
24
|
-
* @internal
|
|
25
|
-
*
|
|
26
|
-
* @typeParam Type - The type of data present in the list.
|
|
27
|
-
*/
|
|
28
|
-
var CursoredData = /** @class */ (function () {
|
|
29
|
-
/**
|
|
30
|
-
* @param list The list of data item to store.
|
|
31
|
-
* @param next The cursor to the next batch of data.
|
|
32
|
-
*/
|
|
33
|
-
function CursoredData(list, next) {
|
|
34
|
-
if (list === void 0) { list = []; }
|
|
35
|
-
if (next === void 0) { next = ''; }
|
|
36
|
-
this.list = list;
|
|
37
|
-
this.next = new Cursor(next);
|
|
38
|
-
}
|
|
39
|
-
return CursoredData;
|
|
40
|
-
}());
|
|
41
|
-
exports.CursoredData = CursoredData;
|
|
42
|
-
//# sourceMappingURL=CursoredData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../../src/models/data/CursoredData.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAII;;;;OAIG;IACH,gBAAY,SAAiB;QACzB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,CAAC;IACL,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM;AAcnB;;;;;;GAMG;AACH;IAOI;;;OAGG;IACH,sBAAY,IAAc,EAAE,IAAiB;QAAjC,qBAAA,EAAA,SAAc;QAAE,qBAAA,EAAA,SAAiB;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACL,mBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,oCAAY"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../../src/models/data/Tweet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,UAAU;AACV,oEAAwD;AAExD;;;;GAIG;AACH;IAcI,iBAAiB;IACjB,uBAAY,QAA2B;QAdvC,cAAc;QACd,mDAAmD;QACnD,aAAQ,GAAa,EAAE,CAAC;QAExB,+CAA+C;QAC/C,SAAI,GAAa,EAAE,CAAC;QAEpB,uDAAuD;QACvD,mBAAc,GAAa,EAAE,CAAC;QAE9B,gEAAgE;QAChE,UAAK,GAAa,EAAE,CAAC;QAIjB,2BAA2B;QAC3B,IAAI,QAAQ,CAAC,aAAa,EAAE;YACxB,KAAiB,UAAsB,EAAtB,KAAA,QAAQ,CAAC,aAAa,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;gBAApC,IAAI,IAAI,SAAA;gB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AAC;QACpD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;QAClD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;QACjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC;IAC5D,CAAC;IACL,WAAC;AAAD,CAAC,AA9DD,IA8DC;AA9DY,oBAAI"}
|
package/dist/server.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
package/dist/server.js
DELETED
|
@@ -1,76 +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
|
-
// PACKAGE
|
|
43
|
-
var express_1 = __importDefault(require("express"));
|
|
44
|
-
var express_graphql_1 = require("express-graphql");
|
|
45
|
-
var graphql_1 = require("graphql");
|
|
46
|
-
require("reflect-metadata");
|
|
47
|
-
// SERVICES
|
|
48
|
-
var _1 = require(".");
|
|
49
|
-
// SCHEMA
|
|
50
|
-
var RootQuery_1 = require("./graphql/queries/RootQuery");
|
|
51
|
-
// CONFIGS
|
|
52
|
-
var env_1 = require("./config/env");
|
|
53
|
-
// Initialising express instance
|
|
54
|
-
var app = (0, express_1["default"])();
|
|
55
|
-
// Setting up graphql endpoint
|
|
56
|
-
app.use('/graphql', (0, express_graphql_1.graphqlHTTP)(function (req) { return ({
|
|
57
|
-
schema: new graphql_1.GraphQLSchema({
|
|
58
|
-
query: RootQuery_1.rootQuery
|
|
59
|
-
}),
|
|
60
|
-
context: (0, _1.Rettiwt)({
|
|
61
|
-
auth_token: req.headers['auth_token'],
|
|
62
|
-
ct0: req.headers['ct0'],
|
|
63
|
-
kdt: req.headers['kdt'],
|
|
64
|
-
twid: req.headers['twid']
|
|
65
|
-
}),
|
|
66
|
-
// If app is running in development environment, enable graphiql
|
|
67
|
-
graphiql: env_1.config.is_development
|
|
68
|
-
}); }));
|
|
69
|
-
// Setting up express server
|
|
70
|
-
app.listen(env_1.config.port, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
-
return __generator(this, function (_a) {
|
|
72
|
-
console.log("Listening on port ".concat(env_1.config.port));
|
|
73
|
-
return [2 /*return*/];
|
|
74
|
-
});
|
|
75
|
-
}); });
|
|
76
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,UAAU;AACV,oDAA8B;AAC9B,mDAA8C;AAC9C,mCAAwC;AACxC,4BAA0B;AAE1B,WAAW;AACX,sBAA4B;AAE5B,SAAS;AACT,yDAAwD;AAExD,UAAU;AACV,oCAAsC;AAEtC,gCAAgC;AAChC,IAAM,GAAG,GAAG,IAAA,oBAAO,GAAE,CAAC;AAEtB,8BAA8B;AAC9B,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,IAAA,6BAAW,EAAC,UAAA,GAAG,IAAI,OAAA,CAAC;IACpC,MAAM,EAAE,IAAI,uBAAa,CAAC;QACtB,KAAK,EAAE,qBAAS;KACnB,CAAC;IACF,OAAO,EAAE,IAAA,UAAO,EAAC;QACb,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,YAAY,CAAW;QAC/C,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAW;QACjC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAW;QACjC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAW;KACtC,CAAC;IACF,gEAAgE;IAChE,QAAQ,EAAE,YAAM,CAAC,cAAc;CAClC,CAAC,EAZqC,CAYrC,CAAC,CAAC,CAAC;AAEL,4BAA4B;AAC5B,GAAG,CAAC,MAAM,CAAC,YAAM,CAAC,IAAI,EAAE;;QACpB,OAAO,CAAC,GAAG,CAAC,4BAAqB,YAAM,CAAC,IAAI,CAAE,CAAC,CAAC;;;KACnD,CAAC,CAAC"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { IAuthCookie } from '../../types/Authentication';
|
|
2
|
-
/**
|
|
3
|
-
* Handles all operations related to a user's account, such as loggin in, managing account, etc
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export declare class AccountService {
|
|
7
|
-
/** The AuthService instance to use for authentication. */
|
|
8
|
-
private auth;
|
|
9
|
-
/** The current guest credentials to use. */
|
|
10
|
-
private guestCreds;
|
|
11
|
-
/** The email id of Twitter account to be logged into. */
|
|
12
|
-
private email;
|
|
13
|
-
/** The user name of the Twitter account ot be logged into */
|
|
14
|
-
private userName;
|
|
15
|
-
/** The password to the Twitter account to be logged into. */
|
|
16
|
-
private password;
|
|
17
|
-
/** The cookies received from Twitter after logging in. */
|
|
18
|
-
private cookies;
|
|
19
|
-
/** The flow token received after execution of current flow. */
|
|
20
|
-
private flowToken;
|
|
21
|
-
/**
|
|
22
|
-
* @returns The current guest credentials to use. If if does not exists, then a new one is created
|
|
23
|
-
*/
|
|
24
|
-
private getGuestCredentials;
|
|
25
|
-
/**
|
|
26
|
-
* Step 1: Initiates login
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
private initiateLogin;
|
|
30
|
-
/**
|
|
31
|
-
* Step 2: Does something
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
private jsInstrumentationSubtask;
|
|
35
|
-
/**
|
|
36
|
-
* Step 3: Takes the email for login
|
|
37
|
-
* @internal
|
|
38
|
-
*
|
|
39
|
-
* @throws {@link AuthenticationErrors.InvalidEmail}, if email does not exist.
|
|
40
|
-
*/
|
|
41
|
-
private enterUserIdentifier;
|
|
42
|
-
/**
|
|
43
|
-
* Step 4: Takes the username for login
|
|
44
|
-
* @internal
|
|
45
|
-
*
|
|
46
|
-
* @throws {@link AuthenticationErrors.InvalidUsername}, if wrong username entered.
|
|
47
|
-
*/
|
|
48
|
-
private enterAlternateUserIdentifier;
|
|
49
|
-
/**
|
|
50
|
-
* Step 5: Takes the password for login
|
|
51
|
-
* @internal
|
|
52
|
-
*
|
|
53
|
-
* @throws {@link AuthenticationErrors.InvalidPassword}, incorrect password entered.
|
|
54
|
-
*/
|
|
55
|
-
private enterPassword;
|
|
56
|
-
/**
|
|
57
|
-
* Step 6: Gets the actual cookies
|
|
58
|
-
* @internal
|
|
59
|
-
*/
|
|
60
|
-
private accountDuplicationCheck;
|
|
61
|
-
/**
|
|
62
|
-
* Parse the authentication cookies recieved from Twitter into known format.
|
|
63
|
-
*
|
|
64
|
-
* @internal
|
|
65
|
-
*
|
|
66
|
-
* @param cookies The raw cookies received from Twitter.
|
|
67
|
-
*
|
|
68
|
-
* @returns The parsed cookies of type {@link AuthCookie}
|
|
69
|
-
*/
|
|
70
|
-
private parseCookies;
|
|
71
|
-
/**
|
|
72
|
-
* Login to Twitter using the given credentials and get back the cookies.
|
|
73
|
-
*
|
|
74
|
-
* @public
|
|
75
|
-
*
|
|
76
|
-
* @param email The email of the account to be logged into.
|
|
77
|
-
* @param userName The username associated with the given account.
|
|
78
|
-
* @param password The password to the account.
|
|
79
|
-
*
|
|
80
|
-
* @returns The cookies for authenticating with the given account.
|
|
81
|
-
*/
|
|
82
|
-
login(email: string, userName: string, password: string): Promise<IAuthCookie>;
|
|
83
|
-
}
|