rettiwt-api 6.3.0-alpha.0 → 7.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.
Files changed (130) hide show
  1. package/README.md +81 -31
  2. package/dist/Rettiwt.d.ts +6 -2
  3. package/dist/Rettiwt.js +7 -3
  4. package/dist/Rettiwt.js.map +1 -1
  5. package/dist/cli.js +3 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/collections/Extractors.d.ts +15 -2
  8. package/dist/collections/Extractors.js +12 -1
  9. package/dist/collections/Extractors.js.map +1 -1
  10. package/dist/collections/Groups.js +8 -0
  11. package/dist/collections/Groups.js.map +1 -1
  12. package/dist/collections/Requests.js +8 -0
  13. package/dist/collections/Requests.js.map +1 -1
  14. package/dist/commands/Space.d.ts +10 -0
  15. package/dist/commands/Space.js +38 -0
  16. package/dist/commands/Space.js.map +1 -0
  17. package/dist/commands/User.js +139 -0
  18. package/dist/commands/User.js.map +1 -1
  19. package/dist/enums/Resource.d.ts +8 -1
  20. package/dist/enums/Resource.js +8 -0
  21. package/dist/enums/Resource.js.map +1 -1
  22. package/dist/index.d.ts +11 -1
  23. package/dist/index.js +6 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/models/RettiwtConfig.d.ts +26 -3
  26. package/dist/models/RettiwtConfig.js +68 -3
  27. package/dist/models/RettiwtConfig.js.map +1 -1
  28. package/dist/models/args/FetchArgs.d.ts +3 -0
  29. package/dist/models/args/FetchArgs.js +6 -0
  30. package/dist/models/args/FetchArgs.js.map +1 -1
  31. package/dist/models/args/PostArgs.d.ts +24 -1
  32. package/dist/models/args/PostArgs.js +52 -1
  33. package/dist/models/args/PostArgs.js.map +1 -1
  34. package/dist/models/data/Space.d.ts +70 -0
  35. package/dist/models/data/Space.js +177 -0
  36. package/dist/models/data/Space.js.map +1 -0
  37. package/dist/models/data/UserAbout.d.ts +44 -0
  38. package/dist/models/data/UserAbout.js +129 -0
  39. package/dist/models/data/UserAbout.js.map +1 -0
  40. package/dist/requests/Space.d.ts +15 -0
  41. package/dist/requests/Space.js +74 -0
  42. package/dist/requests/Space.js.map +1 -0
  43. package/dist/requests/Tweet.d.ts +4 -0
  44. package/dist/requests/Tweet.js +57 -0
  45. package/dist/requests/Tweet.js.map +1 -1
  46. package/dist/requests/User.d.ts +21 -0
  47. package/dist/requests/User.js +64 -0
  48. package/dist/requests/User.js.map +1 -1
  49. package/dist/services/internal/AuthService.d.ts +25 -0
  50. package/dist/services/internal/AuthService.js +121 -0
  51. package/dist/services/internal/AuthService.js.map +1 -1
  52. package/dist/services/public/DirectMessageService.js +3 -3
  53. package/dist/services/public/DirectMessageService.js.map +1 -1
  54. package/dist/services/public/FetcherService.d.ts +4 -3
  55. package/dist/services/public/FetcherService.js +22 -16
  56. package/dist/services/public/FetcherService.js.map +1 -1
  57. package/dist/services/public/ListService.js +5 -5
  58. package/dist/services/public/ListService.js.map +1 -1
  59. package/dist/services/public/SpaceService.d.ts +42 -0
  60. package/dist/services/public/SpaceService.js +60 -0
  61. package/dist/services/public/SpaceService.js.map +1 -0
  62. package/dist/services/public/TweetService.js +26 -23
  63. package/dist/services/public/TweetService.js.map +1 -1
  64. package/dist/services/public/UserService.d.ts +79 -0
  65. package/dist/services/public/UserService.js +203 -23
  66. package/dist/services/public/UserService.js.map +1 -1
  67. package/dist/types/RettiwtConfig.d.ts +33 -3
  68. package/dist/types/args/FetchArgs.d.ts +35 -1
  69. package/dist/types/args/PostArgs.d.ts +44 -1
  70. package/dist/types/data/Space.d.ts +89 -0
  71. package/dist/types/data/Space.js +3 -0
  72. package/dist/types/data/Space.js.map +1 -0
  73. package/dist/types/data/UserAbout.d.ts +68 -0
  74. package/dist/types/data/UserAbout.js +3 -0
  75. package/dist/types/data/UserAbout.js.map +1 -0
  76. package/dist/types/raw/base/Space.d.ts +43 -22
  77. package/dist/types/raw/space/AudioSpaceById.d.ts +50 -0
  78. package/dist/types/raw/space/AudioSpaceById.js +4 -0
  79. package/dist/types/raw/space/AudioSpaceById.js.map +1 -0
  80. package/dist/types/raw/space/Details.d.ts +2 -309
  81. package/dist/types/raw/tweet/Post.d.ts +16 -1
  82. package/dist/types/raw/user/About.d.ts +65 -0
  83. package/dist/types/raw/user/About.js +4 -0
  84. package/dist/types/raw/user/About.js.map +1 -0
  85. package/dist/types/raw/user/ChangePassword.d.ts +8 -0
  86. package/dist/types/raw/user/ChangePassword.js +3 -0
  87. package/dist/types/raw/user/ChangePassword.js.map +1 -0
  88. package/dist/types/raw/user/ProfileUpdate.d.ts +1 -0
  89. package/dist/types/raw/user/Settings.d.ts +21 -0
  90. package/dist/types/raw/user/Settings.js +4 -0
  91. package/dist/types/raw/user/Settings.js.map +1 -0
  92. package/package.json +6 -4
  93. package/src/Rettiwt.ts +10 -3
  94. package/src/cli.ts +3 -1
  95. package/src/collections/Extractors.ts +22 -3
  96. package/src/collections/Groups.ts +8 -0
  97. package/src/collections/Requests.ts +11 -0
  98. package/src/commands/Space.ts +46 -0
  99. package/src/commands/User.ts +159 -0
  100. package/src/enums/Resource.ts +9 -0
  101. package/src/index.ts +11 -1
  102. package/src/models/RettiwtConfig.ts +81 -6
  103. package/src/models/args/FetchArgs.ts +6 -0
  104. package/src/models/args/PostArgs.ts +58 -1
  105. package/src/models/data/Space.ts +201 -0
  106. package/src/models/data/UserAbout.ts +161 -0
  107. package/src/requests/Space.ts +76 -0
  108. package/src/requests/Tweet.ts +59 -0
  109. package/src/requests/User.ts +69 -0
  110. package/src/services/internal/AuthService.ts +149 -1
  111. package/src/services/public/DirectMessageService.ts +3 -3
  112. package/src/services/public/FetcherService.ts +25 -18
  113. package/src/services/public/ListService.ts +5 -5
  114. package/src/services/public/SpaceService.ts +65 -0
  115. package/src/services/public/TweetService.ts +27 -24
  116. package/src/services/public/UserService.ts +247 -23
  117. package/src/types/RettiwtConfig.ts +35 -3
  118. package/src/types/args/FetchArgs.ts +41 -1
  119. package/src/types/args/PostArgs.ts +50 -1
  120. package/src/types/data/Space.ts +122 -0
  121. package/src/types/data/UserAbout.ts +87 -0
  122. package/src/types/raw/base/Space.ts +42 -22
  123. package/src/types/raw/space/AudioSpaceById.ts +57 -0
  124. package/src/types/raw/space/Details.ts +3 -352
  125. package/src/types/raw/tweet/Post.ts +19 -1
  126. package/src/types/raw/user/About.ts +77 -0
  127. package/src/types/raw/user/ChangePassword.ts +8 -0
  128. package/src/types/raw/user/ProfileUpdate.ts +1 -0
  129. package/src/types/raw/user/Settings.ts +23 -0
  130. package/tsconfig.json +2 -2
@@ -1,359 +1,10 @@
1
1
  /* eslint-disable */
2
2
 
3
+ import { IRawSpace } from '../base/Space';
4
+
3
5
  /**
4
6
  * The raw data received when fetching the details of a given space.
5
7
  *
6
8
  * @public
7
9
  */
8
- export interface ISpaceDetailsResponse {
9
- rest_id: string;
10
- state: string;
11
- title: string;
12
- media_key: string;
13
- created_at: number;
14
- started_at: number;
15
- ended_at: string;
16
- replay_start_time: number;
17
- updated_at: number;
18
- creator_results: CreatorResults;
19
- conversation_controls: number;
20
- disallow_join: boolean;
21
- is_employee_only: boolean;
22
- is_locked: boolean;
23
- is_muted: boolean;
24
- is_space_available_for_clipping: boolean;
25
- is_space_available_for_replay: boolean;
26
- narrow_cast_space_type: number;
27
- no_incognito: boolean;
28
- total_replay_watched: number;
29
- total_live_listeners: number;
30
- tweet_results: TweetResults;
31
- }
32
-
33
- interface CreatorResults {
34
- result: Result;
35
- }
36
-
37
- interface Result {
38
- __typename: string;
39
- id: string;
40
- rest_id: string;
41
- affiliates_highlighted_label: AffiliatesHighlightedLabel;
42
- has_graduated_access: boolean;
43
- is_blue_verified: boolean;
44
- profile_image_shape: string;
45
- legacy: Legacy;
46
- professional: Professional;
47
- verified_phone_status: boolean;
48
- }
49
-
50
- interface AffiliatesHighlightedLabel {
51
- label: Label;
52
- }
53
-
54
- interface Label {
55
- url: Url;
56
- badge: Badge;
57
- description: string;
58
- userLabelType: string;
59
- userLabelDisplayType: string;
60
- }
61
-
62
- interface Url {
63
- url: string;
64
- urlType: string;
65
- }
66
-
67
- interface Badge {
68
- url: string;
69
- }
70
-
71
- interface Legacy {
72
- can_dm: boolean;
73
- can_media_tag: boolean;
74
- created_at: string;
75
- default_profile: boolean;
76
- default_profile_image: boolean;
77
- description: string;
78
- entities: Entities;
79
- fast_followers_count: number;
80
- favourites_count: number;
81
- followers_count: number;
82
- friends_count: number;
83
- has_custom_timelines: boolean;
84
- is_translator: boolean;
85
- listed_count: number;
86
- location: string;
87
- media_count: number;
88
- name: string;
89
- normal_followers_count: number;
90
- pinned_tweet_ids_str: string[];
91
- possibly_sensitive: boolean;
92
- profile_banner_url: string;
93
- profile_image_url_https: string;
94
- profile_interstitial_type: string;
95
- screen_name: string;
96
- statuses_count: number;
97
- translator_type: string;
98
- url: string;
99
- verified: boolean;
100
- want_retweets: boolean;
101
- withheld_in_countries: any[];
102
- }
103
-
104
- interface Entities {
105
- description: Description;
106
- url: Url2;
107
- }
108
-
109
- interface Description {
110
- urls: any[];
111
- }
112
-
113
- interface Url2 {
114
- urls: Url3[];
115
- }
116
-
117
- interface Url3 {
118
- display_url: string;
119
- expanded_url: string;
120
- url: string;
121
- indices: number[];
122
- }
123
-
124
- interface Professional {
125
- rest_id: string;
126
- professional_type: string;
127
- category: Category[];
128
- }
129
-
130
- interface Category {
131
- id: number;
132
- name: string;
133
- icon_name: string;
134
- }
135
-
136
- interface TweetResults {
137
- result: Result2;
138
- }
139
-
140
- interface Result2 {
141
- __typename: string;
142
- rest_id: string;
143
- core: Core;
144
- card: Card;
145
- voiceInfo: VoiceInfo;
146
- unmention_data: UnmentionData;
147
- unified_card: UnifiedCard;
148
- edit_control: EditControl;
149
- is_translatable: boolean;
150
- views: Views;
151
- source: string;
152
- legacy: Legacy4;
153
- }
154
-
155
- interface Core {
156
- user_results: UserResults;
157
- }
158
-
159
- interface UserResults {
160
- result: Result3;
161
- }
162
-
163
- interface Result3 {
164
- __typename: string;
165
- id: string;
166
- rest_id: string;
167
- affiliates_highlighted_label: AffiliatesHighlightedLabel2;
168
- has_graduated_access: boolean;
169
- is_blue_verified: boolean;
170
- profile_image_shape: string;
171
- legacy: Legacy2;
172
- professional: Professional2;
173
- verified_phone_status: boolean;
174
- }
175
-
176
- interface AffiliatesHighlightedLabel2 {
177
- label: Label2;
178
- }
179
-
180
- interface Label2 {
181
- url: Url4;
182
- badge: Badge2;
183
- description: string;
184
- userLabelType: string;
185
- userLabelDisplayType: string;
186
- }
187
-
188
- interface Url4 {
189
- url: string;
190
- urlType: string;
191
- }
192
-
193
- interface Badge2 {
194
- url: string;
195
- }
196
-
197
- interface Legacy2 {
198
- can_dm: boolean;
199
- can_media_tag: boolean;
200
- created_at: string;
201
- default_profile: boolean;
202
- default_profile_image: boolean;
203
- description: string;
204
- entities: Entities2;
205
- fast_followers_count: number;
206
- favourites_count: number;
207
- followers_count: number;
208
- friends_count: number;
209
- has_custom_timelines: boolean;
210
- is_translator: boolean;
211
- listed_count: number;
212
- location: string;
213
- media_count: number;
214
- name: string;
215
- normal_followers_count: number;
216
- pinned_tweet_ids_str: string[];
217
- possibly_sensitive: boolean;
218
- profile_banner_url: string;
219
- profile_image_url_https: string;
220
- profile_interstitial_type: string;
221
- screen_name: string;
222
- statuses_count: number;
223
- translator_type: string;
224
- url: string;
225
- verified: boolean;
226
- want_retweets: boolean;
227
- withheld_in_countries: any[];
228
- }
229
-
230
- interface Entities2 {
231
- description: Description2;
232
- url: Url5;
233
- }
234
-
235
- interface Description2 {
236
- urls: any[];
237
- }
238
-
239
- interface Url5 {
240
- urls: Url6[];
241
- }
242
-
243
- interface Url6 {
244
- display_url: string;
245
- expanded_url: string;
246
- url: string;
247
- indices: number[];
248
- }
249
-
250
- interface Professional2 {
251
- rest_id: string;
252
- professional_type: string;
253
- category: Category2[];
254
- }
255
-
256
- interface Category2 {
257
- id: number;
258
- name: string;
259
- icon_name: string;
260
- }
261
-
262
- interface Card {
263
- rest_id: string;
264
- legacy: Legacy3;
265
- }
266
-
267
- interface Legacy3 {
268
- binding_values: BindingValue[];
269
- card_platform: CardPlatform;
270
- name: string;
271
- url: string;
272
- user_refs_results: any[];
273
- }
274
-
275
- interface BindingValue {
276
- key: string;
277
- value: Value;
278
- }
279
-
280
- interface Value {
281
- string_value: string;
282
- type: string;
283
- scribe_key?: string;
284
- }
285
-
286
- interface CardPlatform {
287
- platform: Platform;
288
- }
289
-
290
- interface Platform {
291
- audience: Audience;
292
- device: Device;
293
- }
294
-
295
- interface Audience {
296
- name: string;
297
- }
298
-
299
- interface Device {
300
- name: string;
301
- version: string;
302
- }
303
-
304
- interface VoiceInfo {}
305
-
306
- interface UnmentionData {}
307
-
308
- interface UnifiedCard {
309
- card_fetch_state: string;
310
- }
311
-
312
- interface EditControl {
313
- edit_tweet_ids: string[];
314
- editable_until_msecs: string;
315
- is_edit_eligible: boolean;
316
- edits_remaining: string;
317
- }
318
-
319
- interface Views {
320
- count: string;
321
- state: string;
322
- }
323
-
324
- interface Legacy4 {
325
- bookmark_count: number;
326
- bookmarked: boolean;
327
- created_at: string;
328
- conversation_id_str: string;
329
- display_text_range: number[];
330
- entities: Entities3;
331
- favorite_count: number;
332
- favorited: boolean;
333
- full_text: string;
334
- is_quote_status: boolean;
335
- lang: string;
336
- possibly_sensitive: boolean;
337
- possibly_sensitive_editable: boolean;
338
- quote_count: number;
339
- reply_count: number;
340
- retweet_count: number;
341
- retweeted: boolean;
342
- user_id_str: string;
343
- id_str: string;
344
- }
345
-
346
- interface Entities3 {
347
- hashtags: any[];
348
- symbols: any[];
349
- timestamps: any[];
350
- urls: Url7[];
351
- user_mentions: any[];
352
- }
353
-
354
- interface Url7 {
355
- display_url: string;
356
- expanded_url: string;
357
- url: string;
358
- indices: number[];
359
- }
10
+ export interface ISpaceDetailsResponse extends IRawSpace {}
@@ -10,7 +10,8 @@ export interface ITweetPostResponse {
10
10
  }
11
11
 
12
12
  interface Data {
13
- create_tweet: CreateTweet;
13
+ create_tweet?: CreateTweet;
14
+ create_note_tweet?: CreateTweet;
14
15
  }
15
16
 
16
17
  interface CreateTweet {
@@ -148,3 +149,20 @@ interface UserMention {
148
149
  }
149
150
 
150
151
  interface UnmentionInfo {}
152
+
153
+ /**
154
+ * The raw data received after creating a note tweet (long-form tweet for X Premium accounts).
155
+ *
156
+ * @public
157
+ */
158
+ export interface ITweetPostNoteResponse {
159
+ data: NoteTweetData;
160
+ }
161
+
162
+ interface NoteTweetData {
163
+ notetweet_create: NoteTweetCreate;
164
+ }
165
+
166
+ interface NoteTweetCreate {
167
+ tweet_results: TweetResults;
168
+ }
@@ -0,0 +1,77 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * The raw data received when fetching the about profile of the given user.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IUserAboutResponse {
9
+ data: Data;
10
+ }
11
+
12
+ interface Data {
13
+ user_result_by_screen_name: UserResultByScreenName;
14
+ }
15
+
16
+ interface UserResultByScreenName {
17
+ result: IUserAboutResult;
18
+ id: string;
19
+ }
20
+
21
+ export interface IUserAboutResult {
22
+ __typename: string;
23
+ id: string;
24
+ rest_id: string;
25
+ avatar?: Avatar;
26
+ core?: Core;
27
+ profile_image_shape?: string;
28
+ verification?: Verification;
29
+ affiliates_highlighted_label?: unknown;
30
+ is_blue_verified?: boolean;
31
+ privacy?: Privacy;
32
+ about_profile?: AboutProfile;
33
+ verification_info?: VerificationInfo;
34
+ identity_profile_labels_highlighted_label?: unknown;
35
+ }
36
+
37
+ interface Avatar {
38
+ image_url: string;
39
+ }
40
+
41
+ interface Core {
42
+ created_at: string;
43
+ name: string;
44
+ screen_name: string;
45
+ }
46
+
47
+ interface Verification {
48
+ verified: boolean;
49
+ }
50
+
51
+ interface Privacy {
52
+ protected: boolean;
53
+ }
54
+
55
+ interface AboutProfile {
56
+ created_country_accurate?: boolean;
57
+ account_based_in?: string;
58
+ location_accurate?: boolean;
59
+ learn_more_url?: string;
60
+ source?: string;
61
+ username_changes?: UsernameChanges;
62
+ }
63
+
64
+ interface UsernameChanges {
65
+ count?: string;
66
+ last_changed_at_msec?: string;
67
+ }
68
+
69
+ interface VerificationInfo {
70
+ reason?: VerificationReason;
71
+ id?: string;
72
+ is_identity_verified?: boolean;
73
+ }
74
+
75
+ interface VerificationReason {
76
+ verified_since_msec?: string;
77
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The raw data received when changing the account password.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IUserChangePasswordResponse {
7
+ status: string;
8
+ }
@@ -39,6 +39,7 @@ export interface IUserProfileUpdateResponse {
39
39
  profile_image_url: string;
40
40
  profile_image_url_https: string;
41
41
  profile_banner_url: string;
42
+ profile_banner_url_https?: string;
42
43
  profile_link_color: string;
43
44
  profile_sidebar_border_color: string;
44
45
  profile_sidebar_fill_color: string;
@@ -0,0 +1,23 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any */
2
+
3
+ /**
4
+ * The raw data received from the account settings endpoint.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IUserSettingsResponse {
9
+ screen_name: string;
10
+ protected: boolean;
11
+ language: string;
12
+ geo_enabled: boolean;
13
+ discoverable_by_email: boolean;
14
+ discoverable_by_mobile_phone: boolean;
15
+ use_cookie_personalization: boolean;
16
+ sleep_time: {
17
+ enabled: boolean;
18
+ end_time: any;
19
+ start_time: any;
20
+ };
21
+ display_sensitive_media: boolean;
22
+ allow_media_tagging: string;
23
+ }
package/tsconfig.json CHANGED
@@ -69,7 +69,7 @@
69
69
  // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
70
70
  // "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
71
71
  /* Type Checking */
72
- "strict": true /* Enable all strict type-checking options. */
72
+ "strict": true /* Enable all strict type-checking options. */,
73
73
  // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
74
74
  // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
75
75
  // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
@@ -90,7 +90,7 @@
90
90
  // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
91
91
  /* Completeness */
92
92
  // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
93
- // "skipLibCheck": true /* Skip type checking all .d.ts files. */
93
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
94
94
  },
95
95
  "include": ["src/**/*"],
96
96
  "exclude": ["node_modules", "**/*.spec.ts", "playground/*"]