x-twitter-scraper 0.7.0 → 0.8.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 (94) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +6 -0
  3. package/package.json +1 -1
  4. package/resources/shared.d.mts +382 -15
  5. package/resources/shared.d.mts.map +1 -1
  6. package/resources/shared.d.ts +382 -15
  7. package/resources/shared.d.ts.map +1 -1
  8. package/resources/support/tickets.d.mts +19 -19
  9. package/resources/support/tickets.d.mts.map +1 -1
  10. package/resources/support/tickets.d.ts +19 -19
  11. package/resources/support/tickets.d.ts.map +1 -1
  12. package/resources/trends.d.mts +12 -0
  13. package/resources/trends.d.mts.map +1 -1
  14. package/resources/trends.d.ts +12 -0
  15. package/resources/trends.d.ts.map +1 -1
  16. package/resources/x/account-connection-challenges.d.mts +1 -1
  17. package/resources/x/account-connection-challenges.d.mts.map +1 -1
  18. package/resources/x/account-connection-challenges.d.ts +1 -1
  19. package/resources/x/account-connection-challenges.d.ts.map +1 -1
  20. package/resources/x/accounts.d.mts +40 -3
  21. package/resources/x/accounts.d.mts.map +1 -1
  22. package/resources/x/accounts.d.ts +40 -3
  23. package/resources/x/accounts.d.ts.map +1 -1
  24. package/resources/x/communities/communities.d.mts +2 -12
  25. package/resources/x/communities/communities.d.mts.map +1 -1
  26. package/resources/x/communities/communities.d.ts +2 -12
  27. package/resources/x/communities/communities.d.ts.map +1 -1
  28. package/resources/x/communities/communities.js.map +1 -1
  29. package/resources/x/communities/communities.mjs.map +1 -1
  30. package/resources/x/communities/tweets.d.mts +4 -8
  31. package/resources/x/communities/tweets.d.mts.map +1 -1
  32. package/resources/x/communities/tweets.d.ts +4 -8
  33. package/resources/x/communities/tweets.d.ts.map +1 -1
  34. package/resources/x/index.d.mts +1 -1
  35. package/resources/x/index.d.mts.map +1 -1
  36. package/resources/x/index.d.ts +1 -1
  37. package/resources/x/index.d.ts.map +1 -1
  38. package/resources/x/index.js.map +1 -1
  39. package/resources/x/index.mjs.map +1 -1
  40. package/resources/x/lists.d.mts +2 -4
  41. package/resources/x/lists.d.mts.map +1 -1
  42. package/resources/x/lists.d.ts +2 -4
  43. package/resources/x/lists.d.ts.map +1 -1
  44. package/resources/x/tweets/index.d.mts +1 -1
  45. package/resources/x/tweets/index.d.mts.map +1 -1
  46. package/resources/x/tweets/index.d.ts +1 -1
  47. package/resources/x/tweets/index.d.ts.map +1 -1
  48. package/resources/x/tweets/index.js.map +1 -1
  49. package/resources/x/tweets/index.mjs.map +1 -1
  50. package/resources/x/tweets/tweets.d.mts +301 -22
  51. package/resources/x/tweets/tweets.d.mts.map +1 -1
  52. package/resources/x/tweets/tweets.d.ts +301 -22
  53. package/resources/x/tweets/tweets.d.ts.map +1 -1
  54. package/resources/x/tweets/tweets.js +5 -8
  55. package/resources/x/tweets/tweets.js.map +1 -1
  56. package/resources/x/tweets/tweets.mjs +5 -8
  57. package/resources/x/tweets/tweets.mjs.map +1 -1
  58. package/resources/x/users/users.d.mts +10 -20
  59. package/resources/x/users/users.d.mts.map +1 -1
  60. package/resources/x/users/users.d.ts +10 -20
  61. package/resources/x/users/users.d.ts.map +1 -1
  62. package/resources/x/users/users.js.map +1 -1
  63. package/resources/x/users/users.mjs.map +1 -1
  64. package/resources/x/x.d.mts +14 -3
  65. package/resources/x/x.d.mts.map +1 -1
  66. package/resources/x/x.d.ts +14 -3
  67. package/resources/x/x.d.ts.map +1 -1
  68. package/resources/x/x.js.map +1 -1
  69. package/resources/x/x.mjs.map +1 -1
  70. package/skills/x-twitter-scraper/SKILL.md +8 -4
  71. package/skills/x-twitter-scraper/metadata.json +1 -1
  72. package/skills/x-twitter-scraper/references/mcp-setup.md +12 -5
  73. package/skills/x-twitter-scraper/references/mcp-tools.md +7 -1
  74. package/skills/x-twitter-scraper/references/types-x-api.md +62 -12
  75. package/skills/x-twitter-scraper/skill-card.md +2 -2
  76. package/skills/x-twitter-scraper/skillspector-report.md +4 -1
  77. package/src/resources/shared.ts +514 -16
  78. package/src/resources/support/tickets.ts +19 -19
  79. package/src/resources/trends.ts +15 -0
  80. package/src/resources/x/account-connection-challenges.ts +1 -1
  81. package/src/resources/x/accounts.ts +59 -3
  82. package/src/resources/x/communities/communities.ts +2 -14
  83. package/src/resources/x/communities/tweets.ts +4 -8
  84. package/src/resources/x/index.ts +1 -0
  85. package/src/resources/x/lists.ts +2 -4
  86. package/src/resources/x/tweets/index.ts +1 -0
  87. package/src/resources/x/tweets/tweets.ts +393 -22
  88. package/src/resources/x/users/users.ts +10 -20
  89. package/src/resources/x/x.ts +17 -2
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
  94. package/version.mjs +1 -1
@@ -133,28 +133,28 @@ export namespace TicketCreateResponse {
133
133
  }
134
134
 
135
135
  export interface TicketRetrieveResponse {
136
- createdAt?: string;
136
+ createdAt: string;
137
137
 
138
- messages?: Array<TicketRetrieveResponse.Message>;
138
+ messages: Array<TicketRetrieveResponse.Message>;
139
139
 
140
- publicId?: string;
140
+ publicId: string;
141
141
 
142
- status?: string;
142
+ status: 'open' | 'in_progress' | 'resolved' | 'closed';
143
143
 
144
- subject?: string;
144
+ subject: string;
145
145
 
146
- updatedAt?: string;
146
+ updatedAt: string;
147
147
  }
148
148
 
149
149
  export namespace TicketRetrieveResponse {
150
150
  export interface Message {
151
- attachments?: Array<Message.Attachment>;
151
+ attachments: Array<Message.Attachment>;
152
152
 
153
- body?: string;
153
+ body: string;
154
154
 
155
- createdAt?: string;
155
+ createdAt: string;
156
156
 
157
- sender?: string;
157
+ sender: 'user' | 'support' | 'system';
158
158
  }
159
159
 
160
160
  export namespace Message {
@@ -196,28 +196,28 @@ export namespace TicketRetrieveResponse {
196
196
  }
197
197
 
198
198
  export interface TicketUpdateResponse {
199
- publicId?: string;
199
+ publicId: string;
200
200
 
201
- status?: string;
201
+ status: 'open' | 'resolved' | 'closed';
202
202
  }
203
203
 
204
204
  export interface TicketListResponse {
205
- tickets?: Array<TicketListResponse.Ticket>;
205
+ tickets: Array<TicketListResponse.Ticket>;
206
206
  }
207
207
 
208
208
  export namespace TicketListResponse {
209
209
  export interface Ticket {
210
- createdAt?: string;
210
+ createdAt: string;
211
211
 
212
- messageCount?: number;
212
+ messageCount: number;
213
213
 
214
- publicId?: string;
214
+ publicId: string;
215
215
 
216
- status?: string;
216
+ status: 'open' | 'in_progress' | 'resolved' | 'closed';
217
217
 
218
- subject?: string;
218
+ subject: string;
219
219
 
220
- updatedAt?: string;
220
+ updatedAt: string;
221
221
  }
222
222
  }
223
223
 
@@ -37,9 +37,24 @@ export namespace TrendListResponse {
37
37
 
38
38
  description?: string;
39
39
 
40
+ /**
41
+ * Promotion identifier from X. Null for organic trends.
42
+ */
43
+ promotedContent?: string | null;
44
+
40
45
  query?: string;
41
46
 
42
47
  rank?: number;
48
+
49
+ /**
50
+ * Approximate public post volume when X supplies it.
51
+ */
52
+ tweetVolume?: number | null;
53
+
54
+ /**
55
+ * X search URL for the trend.
56
+ */
57
+ url?: string;
43
58
  }
44
59
  }
45
60
 
@@ -43,7 +43,7 @@ export interface AccountConnectionChallengeSubmitResponse {
43
43
 
44
44
  health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
45
45
 
46
- status: string;
46
+ status: 'active';
47
47
 
48
48
  xUserId: string;
49
49
 
@@ -26,7 +26,7 @@ export class Accounts extends APIResource {
26
26
  * });
27
27
  * ```
28
28
  */
29
- create(body: AccountCreateParams, options?: RequestOptions): APIPromise<unknown> {
29
+ create(body: AccountCreateParams, options?: RequestOptions): APIPromise<AccountCreateResponse> {
30
30
  return this._client.post('/x/accounts', { body, ...options });
31
31
  }
32
32
 
@@ -147,7 +147,63 @@ export interface XAccountDetail {
147
147
  updatedAt?: string;
148
148
  }
149
149
 
150
- export type AccountCreateResponse = unknown;
150
+ /**
151
+ * Sanitized X account summary returned by connect and reauth.
152
+ */
153
+ export type AccountCreateResponse =
154
+ | AccountCreateResponse.SanitizedXAccount
155
+ | AccountCreateResponse.XAccountConnectionAttemptPending
156
+ | AccountCreateResponse.XAccountConnectionChallenge;
157
+
158
+ export namespace AccountCreateResponse {
159
+ /**
160
+ * Sanitized X account summary returned by connect and reauth.
161
+ */
162
+ export interface SanitizedXAccount {
163
+ id: string;
164
+
165
+ createdAt: string;
166
+
167
+ health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
168
+
169
+ status: 'active';
170
+
171
+ xUserId: string;
172
+
173
+ xUsername: string;
174
+ }
175
+
176
+ /**
177
+ * The connection is still in progress.
178
+ */
179
+ export interface XAccountConnectionAttemptPending {
180
+ id: string;
181
+
182
+ object: 'x_account_connection_attempt';
183
+
184
+ pollAfterMs: number;
185
+
186
+ status: 'pending';
187
+ }
188
+
189
+ /**
190
+ * Resumable account connection challenge. Submit the email code to finish the same
191
+ * connection attempt.
192
+ */
193
+ export interface XAccountConnectionChallenge {
194
+ id: string;
195
+
196
+ expiresAt: string;
197
+
198
+ message: string;
199
+
200
+ object: 'x_account_connection_challenge';
201
+
202
+ status: 'requires_email_code';
203
+
204
+ username: string;
205
+ }
206
+ }
151
207
 
152
208
  export interface AccountListResponse {
153
209
  accounts: Array<XAccount>;
@@ -174,7 +230,7 @@ export interface AccountReauthResponse {
174
230
 
175
231
  health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
176
232
 
177
- status: string;
233
+ status: 'active';
178
234
 
179
235
  xUserId: string;
180
236
 
@@ -665,11 +665,6 @@ export namespace CommunityRetrieveInfoResponse {
665
665
  */
666
666
  invites_policy?: string;
667
667
 
668
- /**
669
- * Whether the authenticated viewer is a member
670
- */
671
- is_member?: boolean;
672
-
673
668
  /**
674
669
  * Whether the community is marked sensitive
675
670
  */
@@ -700,11 +695,6 @@ export namespace CommunityRetrieveInfoResponse {
700
695
  */
701
696
  primary_topic?: Community.PrimaryTopic;
702
697
 
703
- /**
704
- * Authenticated viewer's community role
705
- */
706
- role?: string;
707
-
708
698
  /**
709
699
  * Community rules
710
700
  */
@@ -824,10 +814,8 @@ export interface CommunityRetrieveSearchParams {
824
814
  cursor?: string;
825
815
 
826
816
  /**
827
- * Maximum items requested from this page (1-100, default 20). The response can
828
- * contain fewer items because the source returned fewer, filters removed items, or
829
- * the available usage balance covers fewer results. Keep requesting next_cursor while
830
- * has_next_page is true, even when a page is empty. The deprecated limit and count
817
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
818
+ * results. Continue while has_next_page is true. Deprecated limit and count
831
819
  * aliases remain accepted.
832
820
  */
833
821
  pageSize?: number;
@@ -65,10 +65,8 @@ export interface TweetListParams {
65
65
  cursor?: string;
66
66
 
67
67
  /**
68
- * Maximum items requested from this page (1-100, default 20). The response can
69
- * contain fewer items because the source returned fewer, filters removed items, or
70
- * the available usage balance covers fewer results. Keep requesting next_cursor while
71
- * has_next_page is true, even when a page is empty. The deprecated limit and count
68
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
69
+ * results. Continue while has_next_page is true. Deprecated limit and count
72
70
  * aliases remain accepted.
73
71
  */
74
72
  pageSize?: number;
@@ -86,10 +84,8 @@ export interface TweetListByCommunityParams {
86
84
  cursor?: string;
87
85
 
88
86
  /**
89
- * Maximum items requested from this page (1-100, default 20). The response can
90
- * contain fewer items because the source returned fewer, filters removed items, or
91
- * the available usage balance covers fewer results. Keep requesting next_cursor while
92
- * has_next_page is true, even when a page is empty. The deprecated limit and count
87
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
88
+ * results. Continue while has_next_page is true. Deprecated limit and count
93
89
  * aliases remain accepted.
94
90
  */
95
91
  pageSize?: number;
@@ -74,6 +74,7 @@ export {
74
74
  type TweetCreateResponse,
75
75
  type TweetRetrieveResponse,
76
76
  type TweetDeleteResponse,
77
+ type TweetGetRepliesResponse,
77
78
  type TweetCreateParams,
78
79
  type TweetListParams,
79
80
  type TweetDeleteParams,
@@ -107,10 +107,8 @@ export interface ListRetrieveTweetsParams {
107
107
  includeReplies?: boolean;
108
108
 
109
109
  /**
110
- * Maximum items requested from this page (1-100, default 20). The response can
111
- * contain fewer items because the source returned fewer, filters removed items, or
112
- * the available usage balance covers fewer results. Keep requesting next_cursor while
113
- * has_next_page is true, even when a page is empty. The deprecated limit and count
110
+ * Maximum page items (1-100, default 20). Source, filters, or credits can reduce
111
+ * results. Continue while has_next_page is true. Deprecated limit and count
114
112
  * aliases remain accepted.
115
113
  */
116
114
  pageSize?: number;
@@ -25,6 +25,7 @@ export {
25
25
  type TweetCreateResponse,
26
26
  type TweetRetrieveResponse,
27
27
  type TweetDeleteResponse,
28
+ type TweetGetRepliesResponse,
28
29
  type TweetCreateParams,
29
30
  type TweetListParams,
30
31
  type TweetDeleteParams,