rettiwt-api 4.2.0 → 5.0.0-alpha.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.
Files changed (179) hide show
  1. package/.eslintrc.js +2 -3
  2. package/.github/workflows/documentation.yml +1 -1
  3. package/.github/workflows/publish-alpha.yml +1 -1
  4. package/.github/workflows/publish.yml +1 -1
  5. package/.prettierignore +1 -1
  6. package/.tool-versions +1 -1
  7. package/README.md +100 -100
  8. package/dist/Rettiwt.d.ts +1 -1
  9. package/dist/Rettiwt.js +15 -8
  10. package/dist/Rettiwt.js.map +1 -1
  11. package/dist/cli.js +8 -11
  12. package/dist/cli.js.map +1 -1
  13. package/dist/collections/Extractors.d.ts +1 -0
  14. package/dist/collections/Extractors.js +38 -69
  15. package/dist/collections/Extractors.js.map +1 -1
  16. package/dist/collections/Groups.js +2 -1
  17. package/dist/collections/Groups.js.map +1 -1
  18. package/dist/collections/Requests.d.ts +3 -3
  19. package/dist/collections/Requests.js +36 -35
  20. package/dist/collections/Requests.js.map +1 -1
  21. package/dist/commands/List.js +21 -78
  22. package/dist/commands/List.js.map +1 -1
  23. package/dist/commands/Tweet.js +185 -370
  24. package/dist/commands/Tweet.js.map +1 -1
  25. package/dist/commands/User.js +129 -306
  26. package/dist/commands/User.js.map +1 -1
  27. package/dist/enums/Authentication.d.ts +18 -0
  28. package/dist/enums/Authentication.js +24 -0
  29. package/dist/enums/Authentication.js.map +1 -0
  30. package/dist/enums/Data.d.ts +12 -0
  31. package/dist/enums/Data.js +14 -1
  32. package/dist/enums/Data.js.map +1 -1
  33. package/dist/enums/Resource.d.ts +1 -0
  34. package/dist/enums/Resource.js +1 -0
  35. package/dist/enums/Resource.js.map +1 -1
  36. package/dist/helper/CliUtils.js +1 -2
  37. package/dist/helper/CliUtils.js.map +1 -1
  38. package/dist/helper/JsonUtils.js +6 -11
  39. package/dist/helper/JsonUtils.js.map +1 -1
  40. package/dist/index.d.ts +1 -2
  41. package/dist/index.js +1 -2
  42. package/dist/index.js.map +1 -1
  43. package/dist/models/args/FetchArgs.d.ts +4 -133
  44. package/dist/models/args/FetchArgs.js +12 -416
  45. package/dist/models/args/FetchArgs.js.map +1 -1
  46. package/dist/models/args/PostArgs.d.ts +16 -101
  47. package/dist/models/args/PostArgs.js +26 -258
  48. package/dist/models/args/PostArgs.js.map +1 -1
  49. package/dist/models/auth/AccountCredential.d.ts +13 -0
  50. package/dist/models/auth/AccountCredential.js +21 -0
  51. package/dist/models/auth/AccountCredential.js.map +1 -0
  52. package/dist/models/auth/AuthCookie.d.ts +19 -0
  53. package/dist/models/auth/AuthCookie.js +53 -0
  54. package/dist/models/auth/AuthCookie.js.map +1 -0
  55. package/dist/models/auth/AuthCredential.d.ts +28 -0
  56. package/dist/models/auth/AuthCredential.js +76 -0
  57. package/dist/models/auth/AuthCredential.js.map +1 -0
  58. package/dist/models/data/CursoredData.d.ts +3 -4
  59. package/dist/models/data/CursoredData.js +19 -19
  60. package/dist/models/data/CursoredData.js.map +1 -1
  61. package/dist/models/data/List.d.ts +2 -8
  62. package/dist/models/data/List.js +10 -4
  63. package/dist/models/data/List.js.map +1 -1
  64. package/dist/models/data/Notification.d.ts +5 -21
  65. package/dist/models/data/Notification.js +24 -33
  66. package/dist/models/data/Notification.js.map +1 -1
  67. package/dist/models/data/Tweet.d.ts +4 -17
  68. package/dist/models/data/Tweet.js +83 -73
  69. package/dist/models/data/Tweet.js.map +1 -1
  70. package/dist/models/data/User.d.ts +2 -15
  71. package/dist/models/data/User.js +33 -23
  72. package/dist/models/data/User.js.map +1 -1
  73. package/dist/models/errors/ApiError.js +8 -24
  74. package/dist/models/errors/ApiError.js.map +1 -1
  75. package/dist/models/errors/HttpError.js +8 -24
  76. package/dist/models/errors/HttpError.js.map +1 -1
  77. package/dist/models/errors/RettiwtError.js +5 -23
  78. package/dist/models/errors/RettiwtError.js.map +1 -1
  79. package/dist/models/errors/TimeoutError.js +5 -22
  80. package/dist/models/errors/TimeoutError.js.map +1 -1
  81. package/dist/services/{public → internal}/AuthService.d.ts +5 -34
  82. package/dist/services/internal/AuthService.js +109 -0
  83. package/dist/services/internal/AuthService.js.map +1 -0
  84. package/dist/services/internal/ErrorService.js +38 -40
  85. package/dist/services/internal/ErrorService.js.map +1 -1
  86. package/dist/services/internal/LogService.d.ts +0 -6
  87. package/dist/services/internal/LogService.js +12 -32
  88. package/dist/services/internal/LogService.js.map +1 -1
  89. package/dist/services/public/FetcherService.d.ts +5 -3
  90. package/dist/services/public/FetcherService.js +96 -141
  91. package/dist/services/public/FetcherService.js.map +1 -1
  92. package/dist/services/public/ListService.js +31 -100
  93. package/dist/services/public/ListService.js.map +1 -1
  94. package/dist/services/public/TweetService.d.ts +29 -4
  95. package/dist/services/public/TweetService.js +208 -386
  96. package/dist/services/public/TweetService.js.map +1 -1
  97. package/dist/services/public/UserService.js +186 -385
  98. package/dist/services/public/UserService.js.map +1 -1
  99. package/dist/types/RettiwtConfig.d.ts +8 -0
  100. package/dist/types/args/FetchArgs.d.ts +59 -0
  101. package/dist/types/args/FetchArgs.js +3 -0
  102. package/dist/types/args/FetchArgs.js.map +1 -0
  103. package/dist/types/args/PostArgs.d.ts +56 -0
  104. package/dist/types/args/PostArgs.js +3 -0
  105. package/dist/types/args/PostArgs.js.map +1 -0
  106. package/dist/types/auth/AccountCredential.d.ts +11 -0
  107. package/dist/types/auth/AccountCredential.js +3 -0
  108. package/dist/types/auth/AccountCredential.js.map +1 -0
  109. package/dist/types/auth/AuthCookie.d.ts +13 -0
  110. package/dist/types/auth/AuthCookie.js +3 -0
  111. package/dist/types/auth/AuthCookie.js.map +1 -0
  112. package/dist/types/auth/AuthCredential.d.ts +21 -0
  113. package/dist/types/auth/AuthCredential.js +3 -0
  114. package/dist/types/auth/AuthCredential.js.map +1 -0
  115. package/dist/types/data/CursoredData.d.ts +25 -0
  116. package/dist/types/data/CursoredData.js +3 -0
  117. package/dist/types/data/CursoredData.js.map +1 -0
  118. package/dist/types/data/List.d.ts +21 -0
  119. package/dist/types/data/List.js +3 -0
  120. package/dist/types/data/List.js.map +1 -0
  121. package/dist/types/data/Notification.d.ts +20 -0
  122. package/dist/types/data/Notification.js +3 -0
  123. package/dist/types/data/Notification.js.map +1 -0
  124. package/dist/types/data/Tweet.d.ts +71 -0
  125. package/dist/types/data/Tweet.js +3 -0
  126. package/dist/types/data/Tweet.js.map +1 -0
  127. package/dist/types/data/User.d.ts +35 -0
  128. package/dist/types/data/User.js +3 -0
  129. package/dist/types/data/User.js.map +1 -0
  130. package/eslint.config.mjs +17 -0
  131. package/package.json +22 -19
  132. package/src/Rettiwt.ts +1 -1
  133. package/src/cli.ts +0 -2
  134. package/src/collections/Extractors.ts +2 -0
  135. package/src/collections/Groups.ts +1 -0
  136. package/src/collections/Requests.ts +37 -36
  137. package/src/enums/Authentication.ts +19 -0
  138. package/src/enums/Data.ts +13 -0
  139. package/src/enums/Resource.ts +1 -0
  140. package/src/helper/JsonUtils.ts +1 -1
  141. package/src/index.ts +1 -2
  142. package/src/models/args/FetchArgs.ts +4 -470
  143. package/src/models/args/PostArgs.ts +20 -285
  144. package/src/models/auth/AccountCredential.ts +19 -0
  145. package/src/models/auth/AuthCookie.ts +56 -0
  146. package/src/models/auth/AuthCredential.ts +83 -0
  147. package/src/models/data/CursoredData.ts +12 -9
  148. package/src/models/data/List.ts +3 -14
  149. package/src/models/data/Notification.ts +6 -28
  150. package/src/models/data/Tweet.ts +17 -43
  151. package/src/models/data/User.ts +5 -31
  152. package/src/services/{public → internal}/AuthService.ts +28 -55
  153. package/src/services/internal/LogService.ts +4 -19
  154. package/src/services/public/FetcherService.ts +18 -8
  155. package/src/services/public/TweetService.ts +44 -4
  156. package/src/services/public/UserService.ts +2 -2
  157. package/src/types/RettiwtConfig.ts +7 -0
  158. package/src/types/args/FetchArgs.ts +64 -0
  159. package/src/types/args/PostArgs.ts +62 -0
  160. package/src/types/auth/AccountCredential.ts +13 -0
  161. package/src/types/auth/AuthCookie.ts +20 -0
  162. package/src/types/auth/AuthCredential.ts +26 -0
  163. package/src/types/data/CursoredData.ts +28 -0
  164. package/src/types/data/List.ts +27 -0
  165. package/src/types/data/Notification.ts +26 -0
  166. package/src/types/data/Tweet.ts +96 -0
  167. package/src/types/data/User.ts +48 -0
  168. package/tsconfig.json +7 -5
  169. package/.eslintignore +0 -3
  170. package/dist/commands/Auth.d.ts +0 -10
  171. package/dist/commands/Auth.js +0 -101
  172. package/dist/commands/Auth.js.map +0 -1
  173. package/dist/models/errors/DataValidationError.d.ts +0 -30
  174. package/dist/models/errors/DataValidationError.js +0 -34
  175. package/dist/models/errors/DataValidationError.js.map +0 -1
  176. package/dist/services/public/AuthService.js +0 -205
  177. package/dist/services/public/AuthService.js.map +0 -1
  178. package/src/commands/Auth.ts +0 -46
  179. package/src/models/errors/DataValidationError.ts +0 -44
package/.eslintrc.js CHANGED
@@ -17,9 +17,8 @@ module.exports = {
17
17
  node: true,
18
18
  jest: true,
19
19
  },
20
- ignorePatterns: ['.eslintrc.js'],
20
+ ignorePatterns: ['.eslintrc.js', 'eslint.config.mjs'],
21
21
  rules: {
22
- '@typescript-eslint/ban-ts-comment': 'off',
23
22
  '@typescript-eslint/naming-convention': [
24
23
  'warn',
25
24
  {
@@ -136,7 +135,7 @@ module.exports = {
136
135
  },
137
136
  ],
138
137
  '@typescript-eslint/no-explicit-any': 'warn',
139
- '@typescript-eslint/no-inferrable-types': 'off',
138
+ '@typescript-eslint/no-inferrable-types': 'warn',
140
139
  'tsdoc/syntax': 'warn',
141
140
  'sort-imports': [
142
141
  'warn',
@@ -14,7 +14,7 @@ jobs:
14
14
  - uses: actions/checkout@v3
15
15
  - uses: actions/setup-node@v3
16
16
  with:
17
- node-version: '20.x'
17
+ node-version: '22.x'
18
18
 
19
19
  # Installing dependencies
20
20
  - run: npm install
@@ -14,7 +14,7 @@ jobs:
14
14
  - uses: actions/checkout@v3
15
15
  - uses: actions/setup-node@v3
16
16
  with:
17
- node-version: '20.x'
17
+ node-version: '22.x'
18
18
  registry-url: https://registry.npmjs.org/
19
19
 
20
20
  # Installing dependencies
@@ -14,7 +14,7 @@ jobs:
14
14
  - uses: actions/checkout@v3
15
15
  - uses: actions/setup-node@v3
16
16
  with:
17
- node-version: '20.x'
17
+ node-version: '22.x'
18
18
  registry-url: https://registry.npmjs.org/
19
19
 
20
20
  # Installing dependencies
package/.prettierignore CHANGED
@@ -1,3 +1,3 @@
1
- node_modules/
2
1
  dist/
2
+ node_modules/
3
3
  docs/
package/.tool-versions CHANGED
@@ -1 +1 @@
1
- nodejs 20.18.1
1
+ nodejs 22.13.1
package/README.md CHANGED
@@ -4,8 +4,8 @@ A CLI tool and an API for fetching data from Twitter for free!
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - NodeJS 20
8
- - A working Twitter account (optional)
7
+ - NodeJS 20
8
+ - A working Twitter account (optional)
9
9
 
10
10
  ## Installation
11
11
 
@@ -21,44 +21,44 @@ For using the package in your own project, you can install it as a [dependency](
21
21
 
22
22
  Rettiwt-API can be used with or without logging in to Twitter. As such, the two authentication strategies are:
23
23
 
24
- - 'guest' authentication (without logging in) grants access to the following resources/actions:
25
-
26
- - Tweet Details
27
- - User Details (by username)
28
- - User Replies Timeline
29
- - User Timeline
30
-
31
- - 'user' authentication (logging in) grants access to the following resources/actions:
32
-
33
- - List Tweets
34
- - List Members
35
- - Tweet Details
36
- - Tweet Like
37
- - Tweet Media Upload
38
- - Tweet Post
39
- - Tweet Retweet
40
- - Tweet Retweeters
41
- - Tweet Schedule
42
- - Tweet Search
43
- - Tweet Stream
44
- - Tweet Unlike
45
- - Tweet Unpost
46
- - Tweet Unretweet
47
- - User Bookmarks
48
- - User Details (by username or id)
49
- - User Follow
50
- - User Followed Feed
51
- - User Followers
52
- - User Following
53
- - User Highlights
54
- - User Likes
55
- - User Media
56
- - User Notification
57
- - User Recommended Feed
58
- - User Replies Timeline
59
- - User Subscriptions
60
- - User Timeline
61
- - User Unfollow
24
+ - 'guest' authentication (without logging in) grants access to the following resources/actions:
25
+
26
+ - Tweet Details
27
+ - User Details (by username)
28
+ - User Replies Timeline
29
+ - User Timeline
30
+
31
+ - 'user' authentication (logging in) grants access to the following resources/actions:
32
+
33
+ - List Tweets
34
+ - List Members
35
+ - Tweet Details
36
+ - Tweet Like
37
+ - Tweet Media Upload
38
+ - Tweet Post
39
+ - Tweet Retweet
40
+ - Tweet Retweeters
41
+ - Tweet Schedule
42
+ - Tweet Search
43
+ - Tweet Stream
44
+ - Tweet Unlike
45
+ - Tweet Unpost
46
+ - Tweet Unretweet
47
+ - User Bookmarks
48
+ - User Details (by username or id)
49
+ - User Follow
50
+ - User Followed Feed
51
+ - User Followers
52
+ - User Following
53
+ - User Highlights
54
+ - User Likes
55
+ - User Media
56
+ - User Notification
57
+ - User Recommended Feed
58
+ - User Replies Timeline
59
+ - User Subscriptions
60
+ - User Timeline
61
+ - User Unfollow
62
62
 
63
63
  By default, Rettiwt-API uses 'guest' authentication. If however, access to the full set of resources is required, 'user' authentication can be used. This is done by using the cookies associated with your Twitter/X account, and encoding them into an `API_KEY` for convenience. The said `API_KEY` can be obtained by using a browser extension, as follows:
64
64
 
@@ -84,8 +84,8 @@ By default, Rettiwt-API uses 'guest' authentication. If however, access to the f
84
84
 
85
85
  #### Notes:
86
86
 
87
- - `API_KEY` created in this way should last 5 years from the date of login, as long as the credentials to the account aren't changed.
88
- - This approach can also be done without going into incognito/in-private mode, in which case you can either login as usual or skip the login step if you're already logged in, and continue from the steps after login. However, this makes the `API_KEY` to last only as long as the Twitter/X account isn't logged out of (you may exit the browser as usual) or 5 years, whichever comes first. That's why it's recommended to use incognito/in-private mode, so that the `API_KEY` isn't accidentially revoked by logging out.
87
+ - `API_KEY` created in this way should last 5 years from the date of login, as long as the credentials to the account aren't changed.
88
+ - This approach can also be done without going into incognito/in-private mode, in which case you can either login as usual or skip the login step if you're already logged in, and continue from the steps after login. However, this makes the `API_KEY` to last only as long as the Twitter/X account isn't logged out of (you may exit the browser as usual) or 5 years, whichever comes first. That's why it's recommended to use incognito/in-private mode, so that the `API_KEY` isn't accidentially revoked by logging out.
89
89
 
90
90
  ### 2. Using the CLI (Borked):
91
91
 
@@ -102,33 +102,33 @@ By default, Rettiwt-API uses 'guest' authentication. If however, access to the f
102
102
 
103
103
  #### Notes:
104
104
 
105
- - The `API_KEY` created in this way expires after one year from the day it was generated.
105
+ - The `API_KEY` created in this way expires after one year from the day it was generated.
106
106
 
107
107
  ## The API_KEY
108
108
 
109
109
  The API_KEY generated by logging in is what allows Rettiwt-API to authenticate as a logged in user while interacting with the Twitter API ('user' authentication). As such it is a very sensitive information and therefore, must be stored securely. The following points must be kept in mind while using the API_KEY for 'user' authentication:
110
110
 
111
- - The API_KEY is generated by logging into Twitter using the email, username and password and encoding the returned cookies as a base64 string. This encoded string is the API_KEY.
112
- - The API_KEY provides the same level of authorization as any standard Twitter account, nothing more, nothing less.
113
- - Since generation of API_KEY is equivalent to logging in to Twitter, repeated generation attempts might trigger Twitter's anti-bot measures, the same way repeated login attempts do.
114
- - Therefore, it is recommended to generate the API_KEY only once, then use it every time it is needed.
115
- - Do not generate an API_KEY if it has not expired yet!
111
+ - The API_KEY is generated by logging into Twitter using the email, username and password and encoding the returned cookies as a base64 string. This encoded string is the API_KEY.
112
+ - The API_KEY provides the same level of authorization as any standard Twitter account, nothing more, nothing less.
113
+ - Since generation of API_KEY is equivalent to logging in to Twitter, repeated generation attempts might trigger Twitter's anti-bot measures, the same way repeated login attempts do.
114
+ - Therefore, it is recommended to generate the API_KEY only once, then use it every time it is needed.
115
+ - Do not generate an API_KEY if it has not expired yet!
116
116
 
117
117
  ## Notes for non-programmers
118
118
 
119
- - If you have no idea of programming, it's recommended to use the CLI.
120
- - The CLI provides an easy to use interface which does not require any knowledge of JavaScript or programming
121
- - Please skip to [CLI-Usage](https://rishikant181.github.io/Rettiwt-API/#md:cli-usage) for details.
119
+ - If you have no idea of programming, it's recommended to use the CLI.
120
+ - The CLI provides an easy to use interface which does not require any knowledge of JavaScript or programming
121
+ - Please skip to [CLI-Usage](https://rishikant181.github.io/Rettiwt-API/#md:cli-usage) for details.
122
122
 
123
123
  ## Usage as a dependency
124
124
 
125
125
  Rettiwt-API can be used as a dependency for your NodeJS project. In such a case, it is not required to install Rettiwt-API globally and you may install it locally in the root of your project using the command:
126
126
 
127
- - `npm install --save rettiwt-api` (using npm)
127
+ - `npm install --save rettiwt-api` (using npm)
128
128
 
129
129
  or
130
130
 
131
- - `yarn add rettiwt-api` (using yarn)
131
+ - `yarn add rettiwt-api` (using yarn)
132
132
 
133
133
  However, in this case, for accessing the CLI, you will be required to prepend the CLI commands with `npx` in order to tell NodeJS to use the locally installed package.
134
134
 
@@ -142,14 +142,14 @@ When used as a dependency, the [Rettiwt](https://rishikant181.github.io/Rettiwt-
142
142
 
143
143
  A new Rettiwt instance can be initialized using the following code snippets:
144
144
 
145
- - `const rettiwt = new Rettiwt()` (for 'guest' authentication)
146
- - `const rettiwt = new Rettiwt({ apiKey: API_KEY })` (for 'user' authentication)
145
+ - `const rettiwt = new Rettiwt()` (for 'guest' authentication)
146
+ - `const rettiwt = new Rettiwt({ apiKey: API_KEY })` (for 'user' authentication)
147
147
 
148
148
  The Rettiwt class has three members:
149
149
 
150
- - `auth` memeber, for managing authentication
151
- - `tweet` member, for accessing resources related to tweets
152
- - `user` member, for accessing resources related to users
150
+ - `auth` memeber, for managing authentication
151
+ - `tweet` member, for accessing resources related to tweets
152
+ - `user` member, for accessing resources related to users
153
153
 
154
154
  For details regarding usage of these members for accessing the Twitter API, refer to [Features](https://rishikant181.github.io/Rettiwt-API/#md:features).
155
155
 
@@ -257,9 +257,9 @@ rettiwt.auth.login('<email>', '<username>', '<password>')
257
257
 
258
258
  Where,
259
259
 
260
- - `<email>` is the email associated with the Twitter account to be logged into.
261
- - `<username>` is the username associated with the Twitter account.
262
- - `<password>` is the password to the Twitter account.
260
+ - `<email>` is the email associated with the Twitter account to be logged into.
261
+ - `<username>` is the username associated with the Twitter account.
262
+ - `<password>` is the password to the Twitter account.
263
263
 
264
264
  ## Using a proxy
265
265
 
@@ -284,7 +284,7 @@ This issue can be bypassed by using a proxy only for authentication, using the f
284
284
 
285
285
  Where,
286
286
 
287
- - `PROXY_URL` is the URL to the proxy server to use.
287
+ - `PROXY_URL` is the URL to the proxy server to use.
288
288
 
289
289
  Authentication proxy is required only in the following two scenarios:
290
290
 
@@ -306,7 +306,7 @@ const rettiwt = new Rettiwt({ apiKey: API_KEY, logging: true });
306
306
 
307
307
  Rettiwt-API also provides direct access to the raw response data, bypassing any preprocessing by the library itself. This can be achieved by using the [`FetcherService`](https://rishikant181.github.io/Rettiwt-API/classes/FetcherService.html) class instead of the `Rettiwt` class, as demonstrated by the example below, which fetches the raw details of a user with the username 'user1':
308
308
 
309
- - ### JavaScript example:
309
+ - ### JavaScript example:
310
310
 
311
311
  ```js
312
312
  import { FetcherService, EResourceType } from 'rettiwt-api';
@@ -325,7 +325,7 @@ fetcher
325
325
  });
326
326
  ```
327
327
 
328
- - ### TypeScript example:
328
+ - ### TypeScript example:
329
329
 
330
330
  ```ts
331
331
  import { FetcherService, EResourceType, IUserDetailsResponse } from 'rettiwt-api';
@@ -352,48 +352,48 @@ So far, the following operations are supported:
352
352
 
353
353
  ### Authentication
354
354
 
355
- - [Logging in as user](https://rishikant181.github.io/Rettiwt-API/classes/AuthService.html#login)
356
- - [Logging in as guest](https://rishikant181.github.io/Rettiwt-API/classes/AuthService.html#guest)
355
+ - [Logging in as user](https://rishikant181.github.io/Rettiwt-API/classes/AuthService.html#login)
356
+ - [Logging in as guest](https://rishikant181.github.io/Rettiwt-API/classes/AuthService.html#guest)
357
357
 
358
358
  ### List
359
359
 
360
- - [Getting the members of a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/ListService.html#members)
361
- - [Getting the list of tweets from a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/ListService.html#tweets)
360
+ - [Getting the members of a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/ListService.html#members)
361
+ - [Getting the list of tweets from a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/ListService.html#tweets)
362
362
 
363
363
  ### Tweets
364
364
 
365
- - [Getting the details of a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#details)
366
- - [Liking a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#like)
367
- - [Getting the list of tweets from a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#list)
368
- - [Posting a new tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#post)
369
- - [Retweeting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#retweet)
370
- - [Getting the list of users who retweeted a given tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#retweeters)
371
- - [Scheduling a new tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#schedule)
372
- - [Searching for the list of tweets that match a given filter](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#search)
373
- - [Streaming filtered tweets in pseudo-realtime](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#stream)
374
- - [Unliking a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unlike)
375
- - [Unposting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unpost)
376
- - [Unretweeting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unretweet)
377
- - [Unscheduling a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unschedule)
378
- - [Uploading a media file for a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#upload)
365
+ - [Getting the details of a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#details)
366
+ - [Liking a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#like)
367
+ - [Getting the list of tweets from a given Twitter list](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#list)
368
+ - [Posting a new tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#post)
369
+ - [Retweeting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#retweet)
370
+ - [Getting the list of users who retweeted a given tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#retweeters)
371
+ - [Scheduling a new tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#schedule)
372
+ - [Searching for the list of tweets that match a given filter](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#search)
373
+ - [Streaming filtered tweets in pseudo-realtime](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#stream)
374
+ - [Unliking a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unlike)
375
+ - [Unposting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unpost)
376
+ - [Unretweeting a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unretweet)
377
+ - [Unscheduling a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#unschedule)
378
+ - [Uploading a media file for a tweet](https://rishikant181.github.io/Rettiwt-API/classes/TweetService.html#upload)
379
379
 
380
380
  ### Users
381
381
 
382
- - [Getting the list of tweets bookmarked by the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#bookmarks)
383
- - [Getting the details of a user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#details)
384
- - [Following a given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#follow)
385
- - [Getting the followed feed of the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#followed)
386
- - [Getting the list of users who follow the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#followers)
387
- - [Getting the list of users who are followed by the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#following)
388
- - [Getting the list of highlighted tweets of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#highlights)
389
- - [Getting the list of tweets liked by the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#likes)
390
- - [Getting the media timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#media)
391
- - [Streaming notifications of the logged-in user in pseudo-realtime](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#notifications)
392
- - [Getting the recommended feed of the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#recommended)
393
- - [Getting the replies timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#replies)
394
- - [Getting the list of subscriptions of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#subscriptions)
395
- - [Getting the tweet timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#timeline)
396
- - [Unfollowing a given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#unfollow)
382
+ - [Getting the list of tweets bookmarked by the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#bookmarks)
383
+ - [Getting the details of a user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#details)
384
+ - [Following a given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#follow)
385
+ - [Getting the followed feed of the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#followed)
386
+ - [Getting the list of users who follow the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#followers)
387
+ - [Getting the list of users who are followed by the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#following)
388
+ - [Getting the list of highlighted tweets of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#highlights)
389
+ - [Getting the list of tweets liked by the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#likes)
390
+ - [Getting the media timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#media)
391
+ - [Streaming notifications of the logged-in user in pseudo-realtime](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#notifications)
392
+ - [Getting the recommended feed of the logged-in user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#recommended)
393
+ - [Getting the replies timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#replies)
394
+ - [Getting the list of subscriptions of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#subscriptions)
395
+ - [Getting the tweet timeline of the given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#timeline)
396
+ - [Unfollowing a given user](https://rishikant181.github.io/Rettiwt-API/classes/UserService.html#unfollow)
397
397
 
398
398
  ## CLI Usage
399
399
 
@@ -410,8 +410,8 @@ By default, the CLI operates in 'guest' authentication. If you want to use 'user
410
410
 
411
411
  Help for the CLI can be obtained from the CLI itself:
412
412
 
413
- - For help regarding the available commands, use the command `rettiwt help`
414
- - For help regarding a specific command, use the command `rettiwt help <command_name>`
413
+ - For help regarding the available commands, use the command `rettiwt help`
414
+ - For help regarding a specific command, use the command `rettiwt help <command_name>`
415
415
 
416
416
  ## API Reference
417
417
 
@@ -419,7 +419,7 @@ The complete API reference can be found at [this](https://rishikant181.github.io
419
419
 
420
420
  ## Additional information
421
421
 
422
- - This API uses the cookies of a Twitter account to fetch data from Twitter and as such, there is always a chance (although a measly one) of getting the account banned by Twitter algorithm.
422
+ - This API uses the cookies of a Twitter account to fetch data from Twitter and as such, there is always a chance (although a measly one) of getting the account banned by Twitter algorithm.
423
423
 
424
424
  ## Donation
425
425
 
package/dist/Rettiwt.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthService } from './services/public/AuthService';
1
+ import { AuthService } from './services/internal/AuthService';
2
2
  import { ListService } from './services/public/ListService';
3
3
  import { TweetService } from './services/public/TweetService';
4
4
  import { UserService } from './services/public/UserService';
package/dist/Rettiwt.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Rettiwt = void 0;
4
- var AuthService_1 = require("./services/public/AuthService");
5
- var ListService_1 = require("./services/public/ListService");
6
- var TweetService_1 = require("./services/public/TweetService");
7
- var UserService_1 = require("./services/public/UserService");
4
+ const AuthService_1 = require("./services/internal/AuthService");
5
+ const ListService_1 = require("./services/public/ListService");
6
+ const TweetService_1 = require("./services/public/TweetService");
7
+ const UserService_1 = require("./services/public/UserService");
8
8
  /**
9
9
  * The class for accessing Twitter API.
10
10
  *
@@ -46,19 +46,26 @@ var UserService_1 = require("./services/public/UserService");
46
46
  *
47
47
  * @public
48
48
  */
49
- var Rettiwt = /** @class */ (function () {
49
+ class Rettiwt {
50
+ /** The instance used to authenticate. */
51
+ auth;
52
+ /** The instance used to fetch data related to lists. */
53
+ list;
54
+ /** The instance used to fetch data related to tweets. */
55
+ tweet;
56
+ /** The instance used to fetch data related to users. */
57
+ user;
50
58
  /**
51
59
  * Initializes a new Rettiwt instance using the given api key.
52
60
  *
53
61
  * @param config - The config object for configuring the Rettiwt instance.
54
62
  */
55
- function Rettiwt(config) {
63
+ constructor(config) {
56
64
  this.auth = new AuthService_1.AuthService(config);
57
65
  this.list = new ListService_1.ListService(config);
58
66
  this.tweet = new TweetService_1.TweetService(config);
59
67
  this.user = new UserService_1.UserService(config);
60
68
  }
61
- return Rettiwt;
62
- }());
69
+ }
63
70
  exports.Rettiwt = Rettiwt;
64
71
  //# sourceMappingURL=Rettiwt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Rettiwt.js","sourceRoot":"","sources":["../src/Rettiwt.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAC5D,6DAA4D;AAC5D,+DAA8D;AAC9D,6DAA4D;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH;IAaC;;;;OAIG;IACH,iBAAmB,MAAuB;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IACF,cAAC;AAAD,CAAC,AAxBD,IAwBC;AAxBY,0BAAO"}
1
+ {"version":3,"file":"Rettiwt.js","sourceRoot":"","sources":["../src/Rettiwt.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,+DAA4D;AAC5D,iEAA8D;AAC9D,+DAA4D;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAa,OAAO;IACnB,yCAAyC;IAClC,IAAI,CAAc;IAEzB,wDAAwD;IACjD,IAAI,CAAc;IAEzB,yDAAyD;IAClD,KAAK,CAAe;IAE3B,wDAAwD;IACjD,IAAI,CAAc;IAEzB;;;;OAIG;IACH,YAAmB,MAAuB;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACD;AAxBD,0BAwBC"}
package/dist/cli.js CHANGED
@@ -3,16 +3,14 @@
3
3
  var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  return (mod && mod.__esModule) ? mod : { "default": mod };
5
5
  };
6
- var _a;
7
6
  Object.defineProperty(exports, "__esModule", { value: true });
8
- var commander_1 = require("commander");
9
- var Auth_1 = __importDefault(require("./commands/Auth"));
10
- var List_1 = __importDefault(require("./commands/List"));
11
- var Tweet_1 = __importDefault(require("./commands/Tweet"));
12
- var User_1 = __importDefault(require("./commands/User"));
13
- var Rettiwt_1 = require("./Rettiwt");
7
+ const commander_1 = require("commander");
8
+ const List_1 = __importDefault(require("./commands/List"));
9
+ const Tweet_1 = __importDefault(require("./commands/Tweet"));
10
+ const User_1 = __importDefault(require("./commands/User"));
11
+ const Rettiwt_1 = require("./Rettiwt");
14
12
  // Creating a new commandline program
15
- var program = (0, commander_1.createCommand)('rettiwt')
13
+ const program = (0, commander_1.createCommand)('rettiwt')
16
14
  .description('A CLI tool for accessing the Twitter API for free!')
17
15
  .passThroughOptions()
18
16
  .enablePositionalOptions();
@@ -25,8 +23,8 @@ program
25
23
  // Parsing the program to get supplied options
26
24
  program.parse();
27
25
  // Initializing Rettiwt instance using the given options
28
- var rettiwt = new Rettiwt_1.Rettiwt({
29
- apiKey: (_a = process.env.API_KEY) !== null && _a !== void 0 ? _a : program.opts().key,
26
+ const rettiwt = new Rettiwt_1.Rettiwt({
27
+ apiKey: process.env.API_KEY ?? program.opts().key,
30
28
  logging: program.opts().log ? true : false,
31
29
  proxyUrl: program.opts().proxy,
32
30
  timeout: program.opts().timeout ? Number(program.opts().timeout) : undefined,
@@ -35,7 +33,6 @@ var rettiwt = new Rettiwt_1.Rettiwt({
35
33
  program.addCommand((0, List_1.default)(rettiwt));
36
34
  program.addCommand((0, Tweet_1.default)(rettiwt));
37
35
  program.addCommand((0, User_1.default)(rettiwt));
38
- program.addCommand((0, Auth_1.default)(rettiwt));
39
36
  // Finalizing the CLI
40
37
  program.parse();
41
38
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;AAEA,uCAA0C;AAE1C,yDAAmC;AACnC,yDAAmC;AACnC,2DAAqC;AACrC,yDAAmC;AACnC,qCAAoC;AAEpC,qCAAqC;AACrC,IAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,SAAS,CAAC;KACtC,WAAW,CAAC,oDAAoD,CAAC;KACjE,kBAAkB,EAAE;KACpB,uBAAuB,EAAE,CAAC;AAE5B,iBAAiB;AACjB,OAAO;KACL,MAAM,CAAC,oBAAoB,EAAE,uCAAuC,CAAC;KACrE,MAAM,CAAC,WAAW,EAAE,2BAA2B,CAAC;KAChD,MAAM,CAAC,sBAAsB,EAAE,6BAA6B,CAAC;KAC7D,MAAM,CAAC,wBAAwB,EAAE,mDAAmD,CAAC,CAAC;AAExF,8CAA8C;AAC9C,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,wDAAwD;AACxD,IAAM,OAAO,GAAY,IAAI,iBAAO,CAAC;IACpC,MAAM,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,OAAO,mCAAK,OAAO,CAAC,IAAI,EAAE,CAAC,GAAc;IAC7D,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;IAC1C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,KAAY;IACrC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;CAC5E,CAAC,CAAC;AAEH,sBAAsB;AACtB,OAAO,CAAC,UAAU,CAAC,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC,CAAC;AAElC,qBAAqB;AACrB,OAAO,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAA0C;AAE1C,2DAAmC;AACnC,6DAAqC;AACrC,2DAAmC;AACnC,uCAAoC;AAEpC,qCAAqC;AACrC,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,SAAS,CAAC;KACtC,WAAW,CAAC,oDAAoD,CAAC;KACjE,kBAAkB,EAAE;KACpB,uBAAuB,EAAE,CAAC;AAE5B,iBAAiB;AACjB,OAAO;KACL,MAAM,CAAC,oBAAoB,EAAE,uCAAuC,CAAC;KACrE,MAAM,CAAC,WAAW,EAAE,2BAA2B,CAAC;KAChD,MAAM,CAAC,sBAAsB,EAAE,6BAA6B,CAAC;KAC7D,MAAM,CAAC,wBAAwB,EAAE,mDAAmD,CAAC,CAAC;AAExF,8CAA8C;AAC9C,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,wDAAwD;AACxD,MAAM,OAAO,GAAY,IAAI,iBAAO,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAK,OAAO,CAAC,IAAI,EAAE,CAAC,GAAc;IAC7D,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;IAC1C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,KAAY;IACrC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;CAC5E,CAAC,CAAC;AAEH,sBAAsB;AACtB,OAAO,CAAC,UAAU,CAAC,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC,CAAC;AAElC,qBAAqB;AACrB,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -18,6 +18,7 @@ export declare const extractors: {
18
18
  TWEET_DETAILS_ALT: (response: ITweetRepliesResponse, id: string) => Tweet | undefined;
19
19
  TWEET_LIKE: (response: ITweetLikeResponse) => boolean;
20
20
  TWEET_POST: (response: ITweetPostResponse) => string;
21
+ TWEET_REPLIES: (response: ITweetDetailsResponse) => CursoredData<Tweet>;
21
22
  TWEET_RETWEET: (response: ITweetRetweetResponse) => boolean;
22
23
  TWEET_RETWEETERS: (response: ITweetRetweetersResponse) => CursoredData<User>;
23
24
  TWEET_SCHEDULE: (response: ITweetScheduleResponse) => string;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractors = void 0;
4
- var Data_1 = require("../enums/Data");
5
- var CursoredData_1 = require("../models/data/CursoredData");
6
- var Tweet_1 = require("../models/data/Tweet");
7
- var User_1 = require("../models/data/User");
4
+ const Data_1 = require("../enums/Data");
5
+ const CursoredData_1 = require("../models/data/CursoredData");
6
+ const Tweet_1 = require("../models/data/Tweet");
7
+ const User_1 = require("../models/data/User");
8
8
  /**
9
9
  * Collection of data extractors for each resource.
10
10
  *
@@ -12,71 +12,40 @@ var User_1 = require("../models/data/User");
12
12
  */
13
13
  exports.extractors = {
14
14
  /* eslint-disable @typescript-eslint/naming-convention */
15
- LIST_MEMBERS: function (response) {
16
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER);
17
- },
18
- LIST_TWEETS: function (response) {
19
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
20
- },
21
- MEDIA_UPLOAD_APPEND: function () { return undefined; },
22
- MEDIA_UPLOAD_FINALIZE: function () { return undefined; },
23
- MEDIA_UPLOAD_INITIALIZE: function (response) { var _a; return (_a = response.media_id_string) !== null && _a !== void 0 ? _a : undefined; },
24
- TWEET_DETAILS: function (response, id) { return Tweet_1.Tweet.single(response, id); },
25
- TWEET_DETAILS_ALT: function (response, id) { return Tweet_1.Tweet.single(response, id); },
26
- TWEET_LIKE: function (response) { var _a; return (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.favorite_tweet) ? true : false); },
27
- TWEET_POST: function (response) { var _a, _b, _c, _d, _e; return (_e = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.create_tweet) === null || _b === void 0 ? void 0 : _b.tweet_results) === null || _c === void 0 ? void 0 : _c.result) === null || _d === void 0 ? void 0 : _d.rest_id) !== null && _e !== void 0 ? _e : undefined; },
28
- TWEET_RETWEET: function (response) { var _a; return (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.create_retweet) ? true : false); },
29
- TWEET_RETWEETERS: function (response) {
30
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER);
31
- },
32
- TWEET_SCHEDULE: function (response) { var _a, _b, _c; return (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.tweet) === null || _b === void 0 ? void 0 : _b.rest_id) !== null && _c !== void 0 ? _c : undefined; },
33
- TWEET_SEARCH: function (response) {
34
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
35
- },
36
- TWEET_UNLIKE: function (response) { var _a; return (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.unfavorite_tweet) ? true : false); },
37
- TWEET_UNPOST: function (response) { var _a; return (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.delete_tweet) ? true : false); },
38
- TWEET_UNRETWEET: function (response) { var _a, _b, _c; return ((_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.unretweet) === null || _b === void 0 ? void 0 : _b.source_tweet_results) === null || _c === void 0 ? void 0 : _c.result) ? true : false; },
39
- TWEET_UNSCHEDULE: function (response) { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.scheduledtweet_delete) == 'Done'; },
40
- USER_BOOKMARKS: function (response) {
41
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
42
- },
43
- USER_DETAILS_BY_USERNAME: function (response) { return User_1.User.single(response); },
44
- USER_DETAILS_BY_ID: function (response) { return User_1.User.single(response); },
45
- USER_FEED_FOLLOWED: function (response) {
46
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
47
- },
48
- USER_FEED_RECOMMENDED: function (response) {
49
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
50
- },
51
- USER_FOLLOW: function (response) { return ((response === null || response === void 0 ? void 0 : response.id) ? true : false); },
52
- USER_FOLLOWING: function (response) {
53
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER);
54
- },
55
- USER_FOLLOWERS: function (response) {
56
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER);
57
- },
58
- USER_HIGHLIGHTS: function (response) {
59
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
60
- },
61
- USER_LIKES: function (response) {
62
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
63
- },
64
- USER_MEDIA: function (response) {
65
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
66
- },
67
- USER_NOTIFICATIONS: function (response) {
68
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.NOTIFICATION);
69
- },
70
- USER_SUBSCRIPTIONS: function (response) {
71
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER);
72
- },
73
- USER_TIMELINE: function (response) {
74
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
75
- },
76
- USER_TIMELINE_AND_REPLIES: function (response) {
77
- return new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET);
78
- },
79
- USER_UNFOLLOW: function (response) { return ((response === null || response === void 0 ? void 0 : response.id) ? true : false); },
15
+ LIST_MEMBERS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER),
16
+ LIST_TWEETS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
17
+ MEDIA_UPLOAD_APPEND: () => undefined,
18
+ MEDIA_UPLOAD_FINALIZE: () => undefined,
19
+ MEDIA_UPLOAD_INITIALIZE: (response) => response.media_id_string ?? undefined,
20
+ TWEET_DETAILS: (response, id) => Tweet_1.Tweet.single(response, id),
21
+ TWEET_DETAILS_ALT: (response, id) => Tweet_1.Tweet.single(response, id),
22
+ TWEET_LIKE: (response) => (response?.data?.favorite_tweet ? true : false),
23
+ TWEET_POST: (response) => response?.data?.create_tweet?.tweet_results?.result?.rest_id ?? undefined,
24
+ TWEET_REPLIES: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
25
+ TWEET_RETWEET: (response) => (response?.data?.create_retweet ? true : false),
26
+ TWEET_RETWEETERS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER),
27
+ TWEET_SCHEDULE: (response) => response?.data?.tweet?.rest_id ?? undefined,
28
+ TWEET_SEARCH: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
29
+ TWEET_UNLIKE: (response) => (response?.data?.unfavorite_tweet ? true : false),
30
+ TWEET_UNPOST: (response) => (response?.data?.delete_tweet ? true : false),
31
+ TWEET_UNRETWEET: (response) => response?.data?.unretweet?.source_tweet_results?.result ? true : false,
32
+ TWEET_UNSCHEDULE: (response) => response?.data?.scheduledtweet_delete == 'Done',
33
+ USER_BOOKMARKS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
34
+ USER_DETAILS_BY_USERNAME: (response) => User_1.User.single(response),
35
+ USER_DETAILS_BY_ID: (response) => User_1.User.single(response),
36
+ USER_FEED_FOLLOWED: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
37
+ USER_FEED_RECOMMENDED: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
38
+ USER_FOLLOW: (response) => (response?.id ? true : false),
39
+ USER_FOLLOWING: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER),
40
+ USER_FOLLOWERS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER),
41
+ USER_HIGHLIGHTS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
42
+ USER_LIKES: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
43
+ USER_MEDIA: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
44
+ USER_NOTIFICATIONS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.NOTIFICATION),
45
+ USER_SUBSCRIPTIONS: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.USER),
46
+ USER_TIMELINE: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
47
+ USER_TIMELINE_AND_REPLIES: (response) => new CursoredData_1.CursoredData(response, Data_1.EBaseType.TWEET),
48
+ USER_UNFOLLOW: (response) => (response?.id ? true : false),
80
49
  /* eslint-enable @typescript-eslint/naming-convention */
81
50
  };
82
51
  //# sourceMappingURL=Extractors.js.map