rettiwt-api 2.4.2 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -0
- package/.github/workflows/documentation.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/.prettierrc +1 -1
- package/README.md +69 -19
- package/dist/Rettiwt.d.ts +7 -4
- package/dist/Rettiwt.js +4 -2
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/Auth.d.ts +2 -1
- package/dist/commands/Auth.js +10 -17
- package/dist/commands/Auth.js.map +1 -1
- package/dist/commands/Tweet.js +36 -3
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/enums/{ApiErrors.js → Api.js} +1 -1
- package/dist/enums/Api.js.map +1 -0
- package/dist/enums/Http.d.ts +68 -0
- package/dist/enums/Http.js +73 -0
- package/dist/enums/Http.js.map +1 -0
- package/dist/enums/Logging.d.ts +1 -0
- package/dist/enums/Logging.js +1 -0
- package/dist/enums/Logging.js.map +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/index.js +22 -17
- package/dist/index.js.map +1 -1
- package/dist/models/args/TweetArgs.d.ts +44 -0
- package/dist/models/args/TweetArgs.js +82 -0
- package/dist/models/args/TweetArgs.js.map +1 -0
- package/dist/models/{public → data}/CursoredData.d.ts +5 -3
- package/dist/models/{public → data}/CursoredData.js +1 -0
- package/dist/models/data/CursoredData.js.map +1 -0
- package/dist/{types/public → models/data}/List.d.ts +8 -1
- package/dist/models/data/List.js.map +1 -0
- package/dist/models/data/Media.d.ts +14 -0
- package/dist/models/data/Media.js +19 -0
- package/dist/models/data/Media.js.map +1 -0
- package/dist/{types/public → models/data}/Tweet.d.ts +26 -8
- package/dist/models/{public → data}/Tweet.js +4 -0
- package/dist/models/data/Tweet.js.map +1 -0
- package/dist/{types/public → models/data}/User.d.ts +8 -1
- package/dist/models/data/User.js.map +1 -0
- package/dist/models/errors/ApiError.d.ts +17 -0
- package/dist/models/errors/ApiError.js +42 -0
- package/dist/models/errors/ApiError.js.map +1 -0
- package/dist/models/errors/HttpError.d.ts +17 -0
- package/dist/models/errors/HttpError.js +42 -0
- package/dist/models/errors/HttpError.js.map +1 -0
- package/dist/models/errors/RettiwtError.d.ts +8 -0
- package/dist/models/errors/RettiwtError.js +34 -0
- package/dist/models/errors/RettiwtError.js.map +1 -0
- package/dist/models/errors/TimeoutError.d.ts +14 -0
- package/dist/models/errors/TimeoutError.js +39 -0
- package/dist/models/errors/TimeoutError.js.map +1 -0
- package/dist/services/internal/ErrorService.d.ts +85 -0
- package/dist/services/internal/ErrorService.js +144 -0
- package/dist/services/internal/ErrorService.js.map +1 -0
- package/dist/services/internal/FetcherService.d.ts +22 -24
- package/dist/services/internal/FetcherService.js +79 -59
- package/dist/services/internal/FetcherService.js.map +1 -1
- package/dist/services/public/AuthService.d.ts +66 -0
- package/dist/services/public/AuthService.js +160 -0
- package/dist/services/public/AuthService.js.map +1 -0
- package/dist/services/public/TweetService.d.ts +27 -8
- package/dist/services/public/TweetService.js +45 -8
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +5 -5
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/ErrorHandler.d.ts +13 -0
- package/dist/types/{public/User.js → ErrorHandler.js} +1 -1
- package/dist/types/ErrorHandler.js.map +1 -0
- package/dist/types/RettiwtConfig.d.ts +32 -0
- package/dist/types/RettiwtConfig.js.map +1 -0
- package/package.json +6 -5
- package/src/Rettiwt.ts +10 -5
- package/src/cli.ts +4 -2
- package/src/commands/Auth.ts +5 -16
- package/src/commands/Tweet.ts +56 -3
- package/src/enums/Http.ts +68 -0
- package/src/enums/Logging.ts +1 -0
- package/src/index.ts +25 -18
- package/src/models/args/TweetArgs.ts +98 -0
- package/src/models/{public → data}/CursoredData.ts +6 -5
- package/src/models/{public → data}/List.ts +14 -4
- package/src/models/data/Media.ts +19 -0
- package/src/models/{public → data}/Tweet.ts +39 -5
- package/src/models/{public → data}/User.ts +28 -4
- package/src/models/errors/ApiError.ts +24 -0
- package/src/models/errors/HttpError.ts +24 -0
- package/src/models/errors/RettiwtError.ts +12 -0
- package/src/models/errors/TimeoutError.ts +18 -0
- package/src/services/internal/ErrorService.ts +158 -0
- package/src/services/internal/FetcherService.ts +94 -80
- package/src/services/public/AuthService.ts +97 -0
- package/src/services/public/TweetService.ts +48 -10
- package/src/services/public/UserService.ts +7 -5
- package/src/types/ErrorHandler.ts +13 -0
- package/src/types/RettiwtConfig.ts +40 -0
- package/dist/enums/ApiErrors.js.map +0 -1
- package/dist/enums/HTTP.d.ts +0 -17
- package/dist/enums/HTTP.js +0 -22
- package/dist/enums/HTTP.js.map +0 -1
- package/dist/models/internal/RettiwtConfig.d.ts +0 -18
- package/dist/models/internal/RettiwtConfig.js +0 -24
- package/dist/models/internal/RettiwtConfig.js.map +0 -1
- package/dist/models/public/CursoredData.js.map +0 -1
- package/dist/models/public/List.d.ts +0 -22
- package/dist/models/public/List.js.map +0 -1
- package/dist/models/public/Tweet.d.ts +0 -62
- package/dist/models/public/Tweet.js.map +0 -1
- package/dist/models/public/User.d.ts +0 -29
- package/dist/models/public/User.js.map +0 -1
- package/dist/types/internal/RettiwtConfig.d.ts +0 -15
- package/dist/types/internal/RettiwtConfig.js.map +0 -1
- package/dist/types/public/CursoredData.d.ts +0 -22
- package/dist/types/public/CursoredData.js +0 -3
- package/dist/types/public/CursoredData.js.map +0 -1
- package/dist/types/public/List.js +0 -3
- package/dist/types/public/List.js.map +0 -1
- package/dist/types/public/Tweet.js +0 -3
- package/dist/types/public/Tweet.js.map +0 -1
- package/dist/types/public/User.js.map +0 -1
- package/src/enums/HTTP.ts +0 -17
- package/src/models/internal/RettiwtConfig.ts +0 -26
- package/src/types/internal/RettiwtConfig.ts +0 -18
- package/src/types/public/CursoredData.ts +0 -24
- package/src/types/public/List.ts +0 -27
- package/src/types/public/Tweet.ts +0 -86
- package/src/types/public/User.ts +0 -48
- /package/dist/enums/{ApiErrors.d.ts → Api.d.ts} +0 -0
- /package/dist/models/{public → data}/List.js +0 -0
- /package/dist/models/{public → data}/User.js +0 -0
- /package/dist/types/{internal/RettiwtConfig.js → RettiwtConfig.js} +0 -0
- /package/src/enums/{ApiErrors.ts → Api.ts} +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// PACKAGES
|
|
2
|
+
import { Auth } from 'rettiwt-auth';
|
|
3
|
+
|
|
4
|
+
// SERVICES
|
|
5
|
+
import { FetcherService } from '../internal/FetcherService';
|
|
6
|
+
|
|
7
|
+
// TYPES
|
|
8
|
+
import { IRettiwtConfig } from '../../types/RettiwtConfig';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Handles authentication.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export class AuthService extends FetcherService {
|
|
16
|
+
/**
|
|
17
|
+
* @param config - The config object for configuring the Rettiwt instance.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
public constructor(config?: IRettiwtConfig) {
|
|
22
|
+
super(config);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Login to twitter using account credentials.
|
|
27
|
+
*
|
|
28
|
+
* @param email - The email id associated with the Twitter account.
|
|
29
|
+
* @param userName - The username associated with the Twitter account.
|
|
30
|
+
* @param password - The password to the Twitter account.
|
|
31
|
+
* @returns The API_KEY for the Twitter account.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```
|
|
35
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
36
|
+
*
|
|
37
|
+
* // Creating a new Rettiwt instance
|
|
38
|
+
* const rettiwt = new Rettiwt();
|
|
39
|
+
*
|
|
40
|
+
* // Logging in an getting the API_KEY
|
|
41
|
+
* rettiwt.auth.login("email@domain.com", "username", "password")
|
|
42
|
+
* .then(apiKey => {
|
|
43
|
+
* // Use the API_KEY
|
|
44
|
+
* ...
|
|
45
|
+
* })
|
|
46
|
+
* .catch(err => {
|
|
47
|
+
* console.log(err);
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
public async login(email: string, userName: string, password: string): Promise<string> {
|
|
52
|
+
// Logging in and getting the credentials
|
|
53
|
+
let apiKey: string =
|
|
54
|
+
((
|
|
55
|
+
await new Auth({ proxyUrl: this.authProxyUrl }).getUserCredential({
|
|
56
|
+
email: email,
|
|
57
|
+
userName: userName,
|
|
58
|
+
password: password,
|
|
59
|
+
})
|
|
60
|
+
).toHeader().cookie as string) ?? '';
|
|
61
|
+
|
|
62
|
+
// Converting the credentials to base64 string
|
|
63
|
+
apiKey = Buffer.from(apiKey).toString('base64');
|
|
64
|
+
|
|
65
|
+
return apiKey;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Login to twitter as guest.
|
|
70
|
+
*
|
|
71
|
+
* @returns A new guest key.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```
|
|
75
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
76
|
+
*
|
|
77
|
+
* // Creating a new Rettiwt instance
|
|
78
|
+
* const rettiwt = new Rettiwt();
|
|
79
|
+
*
|
|
80
|
+
* // Logging in an getting a new guest key
|
|
81
|
+
* rettiwt.auth.guest()
|
|
82
|
+
* .then(guestKey => {
|
|
83
|
+
* // Use the guest key
|
|
84
|
+
* ...
|
|
85
|
+
* })
|
|
86
|
+
* .catch(err => {
|
|
87
|
+
* console.log(err);
|
|
88
|
+
* });
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
public async guest(): Promise<string> {
|
|
92
|
+
// Getting a new guest key
|
|
93
|
+
const guestKey: string = (await new Auth().getGuestCredential()).guestToken ?? '';
|
|
94
|
+
|
|
95
|
+
return guestKey;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
// PACKAGES
|
|
2
|
-
import { EResourceType, TweetFilter } from 'rettiwt-core';
|
|
2
|
+
import { EResourceType, MediaArgs, TweetFilter } from 'rettiwt-core';
|
|
3
3
|
|
|
4
4
|
// SERVICES
|
|
5
5
|
import { FetcherService } from '../internal/FetcherService';
|
|
6
6
|
|
|
7
|
+
// TYPES
|
|
8
|
+
import { IRettiwtConfig } from '../../types/RettiwtConfig';
|
|
9
|
+
|
|
7
10
|
// MODELS
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
11
|
+
import { Tweet } from '../../models/data/Tweet';
|
|
12
|
+
import { User } from '../../models/data/User';
|
|
13
|
+
import { CursoredData } from '../../models/data/CursoredData';
|
|
14
|
+
import { TweetArgs, TweetMediaArgs } from '../../models/args/TweetArgs';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* Handles fetching of data related to tweets.
|
|
@@ -21,7 +24,7 @@ export class TweetService extends FetcherService {
|
|
|
21
24
|
*
|
|
22
25
|
* @internal
|
|
23
26
|
*/
|
|
24
|
-
public constructor(config?:
|
|
27
|
+
public constructor(config?: IRettiwtConfig) {
|
|
25
28
|
super(config);
|
|
26
29
|
}
|
|
27
30
|
|
|
@@ -220,10 +223,11 @@ export class TweetService extends FetcherService {
|
|
|
220
223
|
/**
|
|
221
224
|
* Post a tweet.
|
|
222
225
|
*
|
|
223
|
-
* @param
|
|
226
|
+
* @param text - The text to be posted, length must be \<= 280 characters.
|
|
227
|
+
* @param media - The list of media to post in the tweet, max number of media must be \<= 4.
|
|
224
228
|
* @returns Whether posting was successful or not.
|
|
225
229
|
*
|
|
226
|
-
* @example
|
|
230
|
+
* @example Posting a simple text
|
|
227
231
|
* ```
|
|
228
232
|
* import { Rettiwt } from 'rettiwt-api';
|
|
229
233
|
*
|
|
@@ -240,11 +244,45 @@ export class TweetService extends FetcherService {
|
|
|
240
244
|
* });
|
|
241
245
|
* ```
|
|
242
246
|
*
|
|
247
|
+
* @example Posting a tweet with an image
|
|
248
|
+
* ```
|
|
249
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
250
|
+
*
|
|
251
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
252
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
253
|
+
*
|
|
254
|
+
* // Posting a tweet, containing an image called 'mountains.jpg', to twitter
|
|
255
|
+
* rettiwt.tweet.tweet('What a nice view!', [{ path: 'mountains.jpg' }])
|
|
256
|
+
* .then(res => {
|
|
257
|
+
* console.log(res);
|
|
258
|
+
* })
|
|
259
|
+
* .catch(err => {
|
|
260
|
+
* console.log(err);
|
|
261
|
+
* });
|
|
262
|
+
* ```
|
|
263
|
+
*
|
|
243
264
|
* @public
|
|
244
265
|
*/
|
|
245
|
-
public async tweet(
|
|
266
|
+
public async tweet(text: string, media?: TweetMediaArgs[]): Promise<boolean> {
|
|
267
|
+
// Converting JSON args to object
|
|
268
|
+
const tweet: TweetArgs = new TweetArgs({ text: text, media: media });
|
|
269
|
+
|
|
270
|
+
/** Stores the list of media that has been uploaded */
|
|
271
|
+
const uploadedMedia: MediaArgs[] = [];
|
|
272
|
+
|
|
273
|
+
// If tweet includes media, upload the media items
|
|
274
|
+
if (tweet.media) {
|
|
275
|
+
for (const item of tweet.media) {
|
|
276
|
+
// Uploading the media item and getting it's allocated id
|
|
277
|
+
const id: string = await this.upload(item.path);
|
|
278
|
+
|
|
279
|
+
// Storing the uploaded media item
|
|
280
|
+
uploadedMedia.push(new MediaArgs({ id: id, tags: item.tags }));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
246
284
|
// Posting the tweet
|
|
247
|
-
const data = await this.post(EResourceType.CREATE_TWEET, {
|
|
285
|
+
const data = await this.post(EResourceType.CREATE_TWEET, { tweet: { text: text, media: uploadedMedia } });
|
|
248
286
|
|
|
249
287
|
return data;
|
|
250
288
|
}
|
|
@@ -4,13 +4,15 @@ import { EResourceType } from 'rettiwt-core';
|
|
|
4
4
|
// SERVICES
|
|
5
5
|
import { FetcherService } from '../internal/FetcherService';
|
|
6
6
|
|
|
7
|
+
// TYPES
|
|
8
|
+
import { IRettiwtConfig } from '../../types/RettiwtConfig';
|
|
9
|
+
|
|
7
10
|
// MODELS
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Tweet } from '../../models/public/Tweet';
|
|
11
|
+
import { User } from '../../models/data/User';
|
|
12
|
+
import { Tweet } from '../../models/data/Tweet';
|
|
11
13
|
|
|
12
14
|
// TYPES
|
|
13
|
-
import { CursoredData } from '../../models/
|
|
15
|
+
import { CursoredData } from '../../models/data/CursoredData';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Handles fetching of data related to user account
|
|
@@ -23,7 +25,7 @@ export class UserService extends FetcherService {
|
|
|
23
25
|
*
|
|
24
26
|
* @internal
|
|
25
27
|
*/
|
|
26
|
-
public constructor(config?:
|
|
28
|
+
public constructor(config?: IRettiwtConfig) {
|
|
27
29
|
super(config);
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the error handler that processes API/HTTP errors in the responses.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IErrorHandler {
|
|
7
|
+
/**
|
|
8
|
+
* The method called when an error response is received from Twitter API.
|
|
9
|
+
*
|
|
10
|
+
* @param error - The error caught while making request to Twitter API.
|
|
11
|
+
*/
|
|
12
|
+
handle(error: unknown): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// TYPES
|
|
2
|
+
import { IErrorHandler } from './ErrorHandler';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The configuration for initializing a new Rettiwt instance.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export interface IRettiwtConfig {
|
|
10
|
+
/** The apiKey (cookie) to use for authenticating Rettiwt against Twitter API. */
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
|
|
13
|
+
/** The guestKey (guest token) to use for guest access to Twitter API. */
|
|
14
|
+
guestKey?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Optional URL to proxy server to use for requests to Twitter API.
|
|
18
|
+
*
|
|
19
|
+
* @remarks When deploying to cloud platforms, if setting {@link IRettiwtConfig.authProxyUrl} does not resolve Error 429, then this might be required.
|
|
20
|
+
*/
|
|
21
|
+
proxyUrl?: URL;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Optional URL to proxy server to use for authentication against Twitter API.
|
|
25
|
+
*
|
|
26
|
+
* @remarks Required when deploying to cloud platforms to bypass Error 429.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue Same as {@link IRettiwtConfig.proxyUrl}
|
|
29
|
+
*/
|
|
30
|
+
authProxyUrl?: URL;
|
|
31
|
+
|
|
32
|
+
/** The max wait time (in milli-seconds) for a response; if not set, Twitter server timeout is used. */
|
|
33
|
+
timeout?: number;
|
|
34
|
+
|
|
35
|
+
/** Whether to write logs to console or not. */
|
|
36
|
+
logging?: boolean;
|
|
37
|
+
|
|
38
|
+
/** Optional custom error handler to define error conditions and process API/HTTP errors in responses. */
|
|
39
|
+
errorHandler?: IErrorHandler;
|
|
40
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiErrors.js","sourceRoot":"","sources":["../../src/enums/ApiErrors.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,UAwBX;AAxBD,WAAY,UAAU;IACrB,+DAAiD,CAAA;IACjD,iEAAmD,CAAA;IACnD,2DAA6C,CAAA;IAC7C,yDAA2C,CAAA;IAC3C,kEAAoD,CAAA;IACpD,8DAAgD,CAAA;IAChD,yDAA2C,CAAA;IAC3C,sDAAwC,CAAA;IACxC,6DAA+C,CAAA;IAC/C,2DAA6C,CAAA;IAC7C,6DAA+C,CAAA;IAC/C,6DAA+C,CAAA;IAC/C,+EAAiE,CAAA;IACjE,0EAA4D,CAAA;IAC5D,uDAAyC,CAAA;IACzC,gEAAkD,CAAA;IAClD,kFAAoE,CAAA;IACpE,oEAAsD,CAAA;IACtD,wDAA0C,CAAA;IAC1C,2DAA6C,CAAA;IAC7C,2DAA6C,CAAA;IAC7C,0FAA4E,CAAA;IAC5E,+EAAiE,CAAA;AAClE,CAAC,EAxBW,UAAU,0BAAV,UAAU,QAwBrB"}
|
package/dist/enums/HTTP.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The different types of http status codes
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export declare enum EHttpStatus {
|
|
7
|
-
BAD_REQUEST = 400,
|
|
8
|
-
UNAUTHORIZED = 401,
|
|
9
|
-
FORBIDDEN = 403,
|
|
10
|
-
NOT_FOUND = 404,
|
|
11
|
-
METHOD_NOT_ALLOWED = 405,
|
|
12
|
-
REQUEST_TIMEOUT = 408,
|
|
13
|
-
TOO_MANY_REQUESTS = 429,
|
|
14
|
-
INTERNAL_SERVER_ERROR = 500,
|
|
15
|
-
BAD_GATEWAY = 502,
|
|
16
|
-
SERVICE_UNAVAILABLE = 503
|
|
17
|
-
}
|
package/dist/enums/HTTP.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EHttpStatus = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The different types of http status codes
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
var EHttpStatus;
|
|
10
|
-
(function (EHttpStatus) {
|
|
11
|
-
EHttpStatus[EHttpStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
12
|
-
EHttpStatus[EHttpStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
13
|
-
EHttpStatus[EHttpStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
14
|
-
EHttpStatus[EHttpStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
15
|
-
EHttpStatus[EHttpStatus["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
16
|
-
EHttpStatus[EHttpStatus["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
17
|
-
EHttpStatus[EHttpStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
18
|
-
EHttpStatus[EHttpStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
19
|
-
EHttpStatus[EHttpStatus["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
20
|
-
EHttpStatus[EHttpStatus["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
21
|
-
})(EHttpStatus || (exports.EHttpStatus = EHttpStatus = {}));
|
|
22
|
-
//# sourceMappingURL=HTTP.js.map
|
package/dist/enums/HTTP.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HTTP.js","sourceRoot":"","sources":["../../src/enums/HTTP.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,WAWX;AAXD,WAAY,WAAW;IACtB,6DAAiB,CAAA;IACjB,+DAAkB,CAAA;IAClB,yDAAe,CAAA;IACf,yDAAe,CAAA;IACf,2EAAwB,CAAA;IACxB,qEAAqB,CAAA;IACrB,yEAAuB,CAAA;IACvB,iFAA2B,CAAA;IAC3B,6DAAiB,CAAA;IACjB,6EAAyB,CAAA;AAC1B,CAAC,EAXW,WAAW,2BAAX,WAAW,QAWtB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IRettiwtConfig } from '../../types/internal/RettiwtConfig';
|
|
2
|
-
/**
|
|
3
|
-
* The configuration for initializing a new Rettiwt instance.
|
|
4
|
-
*
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare class RettiwtConfig implements IRettiwtConfig {
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
guestKey?: string;
|
|
10
|
-
proxyUrl?: URL;
|
|
11
|
-
logging?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Initializes a new configuration object from the given config.
|
|
14
|
-
*
|
|
15
|
-
* @param config - The configuration object.
|
|
16
|
-
*/
|
|
17
|
-
constructor(config: RettiwtConfig);
|
|
18
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RettiwtConfig = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The configuration for initializing a new Rettiwt instance.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
var RettiwtConfig = /** @class */ (function () {
|
|
10
|
-
/**
|
|
11
|
-
* Initializes a new configuration object from the given config.
|
|
12
|
-
*
|
|
13
|
-
* @param config - The configuration object.
|
|
14
|
-
*/
|
|
15
|
-
function RettiwtConfig(config) {
|
|
16
|
-
this.apiKey = config.apiKey;
|
|
17
|
-
this.guestKey = config.guestKey;
|
|
18
|
-
this.proxyUrl = config.proxyUrl;
|
|
19
|
-
this.logging = config.logging;
|
|
20
|
-
}
|
|
21
|
-
return RettiwtConfig;
|
|
22
|
-
}());
|
|
23
|
-
exports.RettiwtConfig = RettiwtConfig;
|
|
24
|
-
//# sourceMappingURL=RettiwtConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RettiwtConfig.js","sourceRoot":"","sources":["../../../src/models/internal/RettiwtConfig.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAMC;;;;OAIG;IACH,uBAAmB,MAAqB;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,CAAC;IACF,oBAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBY,sCAAa"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../../src/models/public/CursoredData.ts"],"names":[],"mappings":";;;AAOA;;;;;;GAMG;AACH;IAIC;;;OAGG;IACH,sBAAmB,IAAc,EAAE,IAAiB;QAAjC,qBAAA,EAAA,SAAc;QAAE,qBAAA,EAAA,SAAiB;QAP7C,SAAI,GAAQ,EAAE,CAAC;QAQrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACF,mBAAC;AAAD,CAAC,AAZD,IAYC;AAZY,oCAAY;AAczB;;;;GAIG;AACH;IAGC;;;;OAIG;IACH,gBAAmB,SAAiB;QACnC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACxB,CAAC;IACF,aAAC;AAAD,CAAC,AAXD,IAWC;AAXY,wBAAM"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IList as IRawList } from 'rettiwt-core';
|
|
2
|
-
import { IList } from '../../types/public/List';
|
|
3
|
-
/**
|
|
4
|
-
* The details of a single Twitter List.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare class List implements IList {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
createdAt: string;
|
|
12
|
-
description: string;
|
|
13
|
-
memberCount: number;
|
|
14
|
-
subscriberCount: number;
|
|
15
|
-
createdBy: string;
|
|
16
|
-
/**
|
|
17
|
-
* Initializes a new Tweet List from the given raw list data.
|
|
18
|
-
*
|
|
19
|
-
* @param list - list The raw tweet list data.
|
|
20
|
-
*/
|
|
21
|
-
constructor(list: IRawList);
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/models/public/List.ts"],"names":[],"mappings":";;;AAMA;;;;GAIG;AACH;IASC;;;;OAIG;IACH,cAAmB,IAAc;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;QACzD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;IAC9C,CAAC;IACF,WAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,oBAAI"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ITweet as IRawTweet, IEntities as IRawTweetEntities, IExtendedMedia as IRawExtendedMedia, EMediaType } from 'rettiwt-core';
|
|
2
|
-
import { ITweet, ITweetEntities } from '../../types/public/Tweet';
|
|
3
|
-
import { User } from './User';
|
|
4
|
-
/**
|
|
5
|
-
* The details of a single Tweet.
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export declare class Tweet implements ITweet {
|
|
10
|
-
id: string;
|
|
11
|
-
tweetBy: User;
|
|
12
|
-
createdAt: string;
|
|
13
|
-
entities: TweetEntities;
|
|
14
|
-
media: TweetMedia[];
|
|
15
|
-
quoted: string;
|
|
16
|
-
fullText: string;
|
|
17
|
-
replyTo: string;
|
|
18
|
-
lang: string;
|
|
19
|
-
quoteCount: number;
|
|
20
|
-
replyCount: number;
|
|
21
|
-
retweetCount: number;
|
|
22
|
-
likeCount: number;
|
|
23
|
-
viewCount: number;
|
|
24
|
-
bookmarkCount: number;
|
|
25
|
-
/**
|
|
26
|
-
* Initializes a new Tweet from the given raw tweet data.
|
|
27
|
-
*
|
|
28
|
-
* @param tweet - The raw tweet data.
|
|
29
|
-
*/
|
|
30
|
-
constructor(tweet: IRawTweet);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The different types parsed entities like urls, media, mentions, hashtags, etc.
|
|
34
|
-
*
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export declare class TweetEntities implements ITweetEntities {
|
|
38
|
-
hashtags: string[];
|
|
39
|
-
urls: string[];
|
|
40
|
-
mentionedUsers: string[];
|
|
41
|
-
/**
|
|
42
|
-
* Initializes the TweetEntities from the raw tweet entities.
|
|
43
|
-
*
|
|
44
|
-
* @param entities - The raw tweet entities.
|
|
45
|
-
*/
|
|
46
|
-
constructor(entities: IRawTweetEntities);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* A single media content.
|
|
50
|
-
*
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
export declare class TweetMedia {
|
|
54
|
-
type: EMediaType;
|
|
55
|
-
url: string;
|
|
56
|
-
/**
|
|
57
|
-
* Initializes the TweetMedia from the raw tweet media.
|
|
58
|
-
*
|
|
59
|
-
* @param media - The raw tweet media.
|
|
60
|
-
*/
|
|
61
|
-
constructor(media: IRawExtendedMedia);
|
|
62
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../../src/models/public/Tweet.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IUser as IRawUser } from 'rettiwt-core';
|
|
2
|
-
import { IUser } from '../../types/public/User';
|
|
3
|
-
/**
|
|
4
|
-
* The details of a single user.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare class User implements IUser {
|
|
9
|
-
id: string;
|
|
10
|
-
userName: string;
|
|
11
|
-
fullName: string;
|
|
12
|
-
createdAt: string;
|
|
13
|
-
description: string;
|
|
14
|
-
isVerified: boolean;
|
|
15
|
-
favouritesCount: number;
|
|
16
|
-
followersCount: number;
|
|
17
|
-
followingsCount: number;
|
|
18
|
-
statusesCount: number;
|
|
19
|
-
location: string;
|
|
20
|
-
pinnedTweet: string;
|
|
21
|
-
profileBanner: string;
|
|
22
|
-
profileImage: string;
|
|
23
|
-
/**
|
|
24
|
-
* Initializes a new User from the given raw user data.
|
|
25
|
-
*
|
|
26
|
-
* @param user - The raw user data.
|
|
27
|
-
*/
|
|
28
|
-
constructor(user: IRawUser);
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/models/public/User.ts"],"names":[],"mappings":";;;AAMA;;;;GAIG;AACH;IAgBC;;;;OAIG;IACH,cAAmB,IAAc;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;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;IACzD,CAAC;IACF,WAAC;AAAD,CAAC,AArCD,IAqCC;AArCY,oBAAI"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The configuration for initializing a new Rettiwt instance.
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export interface IRettiwtConfig {
|
|
7
|
-
/** The apiKey (cookie) to use for authenticating Rettiwt against Twitter API. */
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
/** The guestKey (guest token) to use for guest access to Twitter API. */
|
|
10
|
-
guestKey?: string;
|
|
11
|
-
/** Optional URL with proxy configuration to use for requests to Twitter API. */
|
|
12
|
-
proxyUrl?: URL;
|
|
13
|
-
/** Whether to write logs to console or not. */
|
|
14
|
-
logging?: boolean;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RettiwtConfig.js","sourceRoot":"","sources":["../../../src/types/internal/RettiwtConfig.ts"],"names":[],"mappings":""}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The data that us fetched batch-wise along with a cursor.
|
|
3
|
-
*
|
|
4
|
-
* @typeParam T - Type of data present in the list.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export interface ICursoredData<T> {
|
|
9
|
-
/** The list of data of the given type. */
|
|
10
|
-
list: T[];
|
|
11
|
-
/** The cursor to the next batch of data. */
|
|
12
|
-
next: ICursor;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The cursor to the batch of data to be fetched.
|
|
16
|
-
*
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export interface ICursor {
|
|
20
|
-
/** The cursor string. */
|
|
21
|
-
value: string;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../../src/types/public/CursoredData.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/types/public/List.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../../src/types/public/Tweet.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/types/public/User.ts"],"names":[],"mappings":""}
|
package/src/enums/HTTP.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The different types of http status codes
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export enum EHttpStatus {
|
|
7
|
-
BAD_REQUEST = 400,
|
|
8
|
-
UNAUTHORIZED = 401,
|
|
9
|
-
FORBIDDEN = 403,
|
|
10
|
-
NOT_FOUND = 404,
|
|
11
|
-
METHOD_NOT_ALLOWED = 405,
|
|
12
|
-
REQUEST_TIMEOUT = 408,
|
|
13
|
-
TOO_MANY_REQUESTS = 429,
|
|
14
|
-
INTERNAL_SERVER_ERROR = 500,
|
|
15
|
-
BAD_GATEWAY = 502,
|
|
16
|
-
SERVICE_UNAVAILABLE = 503,
|
|
17
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// TYPES
|
|
2
|
-
import { IRettiwtConfig } from '../../types/internal/RettiwtConfig';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The configuration for initializing a new Rettiwt instance.
|
|
6
|
-
*
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export class RettiwtConfig implements IRettiwtConfig {
|
|
10
|
-
public apiKey?: string;
|
|
11
|
-
public guestKey?: string;
|
|
12
|
-
public proxyUrl?: URL;
|
|
13
|
-
public logging?: boolean;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Initializes a new configuration object from the given config.
|
|
17
|
-
*
|
|
18
|
-
* @param config - The configuration object.
|
|
19
|
-
*/
|
|
20
|
-
public constructor(config: RettiwtConfig) {
|
|
21
|
-
this.apiKey = config.apiKey;
|
|
22
|
-
this.guestKey = config.guestKey;
|
|
23
|
-
this.proxyUrl = config.proxyUrl;
|
|
24
|
-
this.logging = config.logging;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The configuration for initializing a new Rettiwt instance.
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export interface IRettiwtConfig {
|
|
7
|
-
/** The apiKey (cookie) to use for authenticating Rettiwt against Twitter API. */
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
|
|
10
|
-
/** The guestKey (guest token) to use for guest access to Twitter API. */
|
|
11
|
-
guestKey?: string;
|
|
12
|
-
|
|
13
|
-
/** Optional URL with proxy configuration to use for requests to Twitter API. */
|
|
14
|
-
proxyUrl?: URL;
|
|
15
|
-
|
|
16
|
-
/** Whether to write logs to console or not. */
|
|
17
|
-
logging?: boolean;
|
|
18
|
-
}
|