x-twitter-scraper 0.20.0 → 0.21.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 (214) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +120 -121
  3. package/client.d.mts +7 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +7 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/extractions.d.mts +105 -5
  11. package/resources/extractions.d.mts.map +1 -1
  12. package/resources/extractions.d.ts +105 -5
  13. package/resources/extractions.d.ts.map +1 -1
  14. package/resources/index.d.mts +1 -1
  15. package/resources/index.d.mts.map +1 -1
  16. package/resources/index.d.ts +1 -1
  17. package/resources/index.d.ts.map +1 -1
  18. package/resources/index.js.map +1 -1
  19. package/resources/index.mjs.map +1 -1
  20. package/resources/monitors/index.d.mts +1 -1
  21. package/resources/monitors/index.d.mts.map +1 -1
  22. package/resources/monitors/index.d.ts +1 -1
  23. package/resources/monitors/index.d.ts.map +1 -1
  24. package/resources/monitors/index.js.map +1 -1
  25. package/resources/monitors/index.mjs.map +1 -1
  26. package/resources/monitors/monitors.d.mts +38 -1
  27. package/resources/monitors/monitors.d.mts.map +1 -1
  28. package/resources/monitors/monitors.d.ts +38 -1
  29. package/resources/monitors/monitors.d.ts.map +1 -1
  30. package/resources/monitors/monitors.js +18 -0
  31. package/resources/monitors/monitors.js.map +1 -1
  32. package/resources/monitors/monitors.mjs +18 -0
  33. package/resources/monitors/monitors.mjs.map +1 -1
  34. package/resources/monitors/posts.d.mts +27 -0
  35. package/resources/monitors/posts.d.mts.map +1 -1
  36. package/resources/monitors/posts.d.ts +27 -0
  37. package/resources/monitors/posts.d.ts.map +1 -1
  38. package/resources/shared.d.mts +175 -5
  39. package/resources/shared.d.mts.map +1 -1
  40. package/resources/shared.d.ts +175 -5
  41. package/resources/shared.d.ts.map +1 -1
  42. package/resources/x/account-connection-attempts.d.mts +4 -0
  43. package/resources/x/account-connection-attempts.d.mts.map +1 -1
  44. package/resources/x/account-connection-attempts.d.ts +4 -0
  45. package/resources/x/account-connection-attempts.d.ts.map +1 -1
  46. package/resources/x/account-connection-links.d.mts +159 -0
  47. package/resources/x/account-connection-links.d.mts.map +1 -0
  48. package/resources/x/account-connection-links.d.ts +159 -0
  49. package/resources/x/account-connection-links.d.ts.map +1 -0
  50. package/resources/x/account-connection-links.js +82 -0
  51. package/resources/x/account-connection-links.js.map +1 -0
  52. package/resources/x/account-connection-links.mjs +78 -0
  53. package/resources/x/account-connection-links.mjs.map +1 -0
  54. package/resources/x/accounts.d.mts +13 -9
  55. package/resources/x/accounts.d.mts.map +1 -1
  56. package/resources/x/accounts.d.ts +13 -9
  57. package/resources/x/accounts.d.ts.map +1 -1
  58. package/resources/x/analysis.d.mts +540 -36
  59. package/resources/x/analysis.d.mts.map +1 -1
  60. package/resources/x/analysis.d.ts +540 -36
  61. package/resources/x/analysis.d.ts.map +1 -1
  62. package/resources/x/bookmarks.d.mts +5 -0
  63. package/resources/x/bookmarks.d.mts.map +1 -1
  64. package/resources/x/bookmarks.d.ts +5 -0
  65. package/resources/x/bookmarks.d.ts.map +1 -1
  66. package/resources/x/communities/communities.d.mts +2 -2
  67. package/resources/x/communities/communities.d.mts.map +1 -1
  68. package/resources/x/communities/communities.d.ts +2 -2
  69. package/resources/x/communities/communities.d.ts.map +1 -1
  70. package/resources/x/communities/communities.js.map +1 -1
  71. package/resources/x/communities/communities.mjs.map +1 -1
  72. package/resources/x/communities/join.d.mts +2 -2
  73. package/resources/x/communities/join.d.mts.map +1 -1
  74. package/resources/x/communities/join.d.ts +2 -2
  75. package/resources/x/communities/join.d.ts.map +1 -1
  76. package/resources/x/dm.d.mts +2 -2
  77. package/resources/x/dm.d.mts.map +1 -1
  78. package/resources/x/dm.d.ts +2 -2
  79. package/resources/x/dm.d.ts.map +1 -1
  80. package/resources/x/index.d.mts +2 -1
  81. package/resources/x/index.d.mts.map +1 -1
  82. package/resources/x/index.d.ts +2 -1
  83. package/resources/x/index.d.ts.map +1 -1
  84. package/resources/x/index.js +3 -1
  85. package/resources/x/index.js.map +1 -1
  86. package/resources/x/index.mjs +1 -0
  87. package/resources/x/index.mjs.map +1 -1
  88. package/resources/x/media.d.mts +48 -1
  89. package/resources/x/media.d.mts.map +1 -1
  90. package/resources/x/media.d.ts +48 -1
  91. package/resources/x/media.d.ts.map +1 -1
  92. package/resources/x/media.js.map +1 -1
  93. package/resources/x/media.mjs.map +1 -1
  94. package/resources/x/profile.d.mts +3 -3
  95. package/resources/x/profile.d.mts.map +1 -1
  96. package/resources/x/profile.d.ts +3 -3
  97. package/resources/x/profile.d.ts.map +1 -1
  98. package/resources/x/tweets/bookmark.d.mts +84 -0
  99. package/resources/x/tweets/bookmark.d.mts.map +1 -0
  100. package/resources/x/tweets/bookmark.d.ts +84 -0
  101. package/resources/x/tweets/bookmark.d.ts.map +1 -0
  102. package/resources/x/tweets/bookmark.js +55 -0
  103. package/resources/x/tweets/bookmark.js.map +1 -0
  104. package/resources/x/tweets/bookmark.mjs +51 -0
  105. package/resources/x/tweets/bookmark.mjs.map +1 -0
  106. package/resources/x/tweets/index.d.mts +1 -0
  107. package/resources/x/tweets/index.d.mts.map +1 -1
  108. package/resources/x/tweets/index.d.ts +1 -0
  109. package/resources/x/tweets/index.d.ts.map +1 -1
  110. package/resources/x/tweets/index.js +3 -1
  111. package/resources/x/tweets/index.js.map +1 -1
  112. package/resources/x/tweets/index.mjs +1 -0
  113. package/resources/x/tweets/index.mjs.map +1 -1
  114. package/resources/x/tweets/like.d.mts +2 -2
  115. package/resources/x/tweets/like.d.mts.map +1 -1
  116. package/resources/x/tweets/like.d.ts +2 -2
  117. package/resources/x/tweets/like.d.ts.map +1 -1
  118. package/resources/x/tweets/retweet.d.mts +2 -2
  119. package/resources/x/tweets/retweet.d.mts.map +1 -1
  120. package/resources/x/tweets/retweet.d.ts +2 -2
  121. package/resources/x/tweets/retweet.d.ts.map +1 -1
  122. package/resources/x/tweets/tweets.d.mts +41 -13
  123. package/resources/x/tweets/tweets.d.mts.map +1 -1
  124. package/resources/x/tweets/tweets.d.ts +41 -13
  125. package/resources/x/tweets/tweets.d.ts.map +1 -1
  126. package/resources/x/tweets/tweets.js +4 -0
  127. package/resources/x/tweets/tweets.js.map +1 -1
  128. package/resources/x/tweets/tweets.mjs +4 -0
  129. package/resources/x/tweets/tweets.mjs.map +1 -1
  130. package/resources/x/users/block.d.mts +84 -0
  131. package/resources/x/users/block.d.mts.map +1 -0
  132. package/resources/x/users/block.d.ts +84 -0
  133. package/resources/x/users/block.d.ts.map +1 -0
  134. package/resources/x/users/block.js +55 -0
  135. package/resources/x/users/block.js.map +1 -0
  136. package/resources/x/users/block.mjs +51 -0
  137. package/resources/x/users/block.mjs.map +1 -0
  138. package/resources/x/users/follow.d.mts +2 -2
  139. package/resources/x/users/follow.d.mts.map +1 -1
  140. package/resources/x/users/follow.d.ts +2 -2
  141. package/resources/x/users/follow.d.ts.map +1 -1
  142. package/resources/x/users/index.d.mts +3 -1
  143. package/resources/x/users/index.d.mts.map +1 -1
  144. package/resources/x/users/index.d.ts +3 -1
  145. package/resources/x/users/index.d.ts.map +1 -1
  146. package/resources/x/users/index.js +5 -1
  147. package/resources/x/users/index.js.map +1 -1
  148. package/resources/x/users/index.mjs +2 -0
  149. package/resources/x/users/index.mjs.map +1 -1
  150. package/resources/x/users/mute.d.mts +84 -0
  151. package/resources/x/users/mute.d.mts.map +1 -0
  152. package/resources/x/users/mute.d.ts +84 -0
  153. package/resources/x/users/mute.d.ts.map +1 -0
  154. package/resources/x/users/mute.js +55 -0
  155. package/resources/x/users/mute.js.map +1 -0
  156. package/resources/x/users/mute.mjs +51 -0
  157. package/resources/x/users/mute.mjs.map +1 -0
  158. package/resources/x/users/users.d.mts +359 -9
  159. package/resources/x/users/users.d.mts.map +1 -1
  160. package/resources/x/users/users.d.ts +359 -9
  161. package/resources/x/users/users.d.ts.map +1 -1
  162. package/resources/x/users/users.js +27 -1
  163. package/resources/x/users/users.js.map +1 -1
  164. package/resources/x/users/users.mjs +27 -1
  165. package/resources/x/users/users.mjs.map +1 -1
  166. package/resources/x/write-actions.d.mts +1 -1
  167. package/resources/x/write-actions.d.mts.map +1 -1
  168. package/resources/x/write-actions.d.ts +1 -1
  169. package/resources/x/write-actions.d.ts.map +1 -1
  170. package/resources/x/x.d.mts +15 -2
  171. package/resources/x/x.d.mts.map +1 -1
  172. package/resources/x/x.d.ts +15 -2
  173. package/resources/x/x.d.ts.map +1 -1
  174. package/resources/x/x.js +4 -0
  175. package/resources/x/x.js.map +1 -1
  176. package/resources/x/x.mjs +4 -0
  177. package/resources/x/x.mjs.map +1 -1
  178. package/src/client.ts +9 -0
  179. package/src/core/README.md +4 -0
  180. package/src/internal/README.md +6 -1
  181. package/src/resources/extractions.ts +125 -0
  182. package/src/resources/index.ts +2 -0
  183. package/src/resources/monitors/index.ts +2 -0
  184. package/src/resources/monitors/monitors.ts +49 -0
  185. package/src/resources/monitors/posts.ts +32 -0
  186. package/src/resources/shared.ts +203 -4
  187. package/src/resources/x/account-connection-attempts.ts +5 -0
  188. package/src/resources/x/account-connection-links.ts +215 -0
  189. package/src/resources/x/accounts.ts +15 -14
  190. package/src/resources/x/analysis.ts +618 -36
  191. package/src/resources/x/bookmarks.ts +6 -0
  192. package/src/resources/x/communities/communities.ts +12 -0
  193. package/src/resources/x/communities/join.ts +12 -0
  194. package/src/resources/x/dm.ts +12 -0
  195. package/src/resources/x/index.ts +15 -0
  196. package/src/resources/x/media.ts +64 -0
  197. package/src/resources/x/profile.ts +18 -0
  198. package/src/resources/x/tweets/bookmark.ts +127 -0
  199. package/src/resources/x/tweets/index.ts +7 -0
  200. package/src/resources/x/tweets/like.ts +12 -0
  201. package/src/resources/x/tweets/retweet.ts +12 -0
  202. package/src/resources/x/tweets/tweets.ts +69 -10
  203. package/src/resources/x/users/block.ts +119 -0
  204. package/src/resources/x/users/follow.ts +12 -0
  205. package/src/resources/x/users/index.ts +20 -0
  206. package/src/resources/x/users/mute.ts +119 -0
  207. package/src/resources/x/users/users.ts +470 -7
  208. package/src/resources/x/write-actions.ts +6 -0
  209. package/src/resources/x/x.ts +48 -0
  210. package/src/version.ts +1 -1
  211. package/version.d.mts +1 -1
  212. package/version.d.ts +1 -1
  213. package/version.js +1 -1
  214. package/version.mjs +1 -1
@@ -0,0 +1,215 @@
1
+ // SPDX-FileCopyrightText: 2026 Xquik contributors
2
+ //
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
5
+ import { APIResource } from '../../core/resource';
6
+ import { APIPromise } from '../../core/api-promise';
7
+ import { RequestOptions } from '../../internal/request-options';
8
+ import { path } from '../../internal/utils/path';
9
+
10
+ /**
11
+ * Connected X account management
12
+ */
13
+ export class AccountConnectionLinks extends APIResource {
14
+ /**
15
+ * Creates a link to a page Xquik hosts, where a person connects an X account with
16
+ * no Xquik signup. Your backend never receives their password or 2FA secret, and
17
+ * the account belongs to you. Send `accountId` to reconnect 1 of your accounts
18
+ * instead. Connecting is free. Takes a Full access API key holding
19
+ * `connectsXAccounts`, or a dashboard session. The link works for 30 minutes, &
20
+ * the response is the only place its token appears. A link a key made stops while
21
+ * that key is paused or loses `connectsXAccounts`, & for good once it's revoked,
22
+ * rotated, expired or deleted.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const accountConnectionLink =
27
+ * await client.x.accountConnectionLinks.create({
28
+ * reference: 'user-42',
29
+ * });
30
+ * ```
31
+ */
32
+ create(
33
+ body: AccountConnectionLinkCreateParams | null | undefined = {},
34
+ options?: RequestOptions,
35
+ ): APIPromise<AccountConnectionLinkCreateResponse> {
36
+ return this._client.post('/x/account-connection-links', { body, ...options });
37
+ }
38
+
39
+ /**
40
+ * Reads what happened on a link. `status` reads `connected` once the person
41
+ * finishes, with `xUserId`, `xUsername` & `health`. It never holds the token.
42
+ * Takes a Full access API key holding `connectsXAccounts`, or a dashboard session.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const accountConnectionLink =
47
+ * await client.x.accountConnectionLinks.retrieve(
48
+ * 'xlink_AAAAAAAAAAAAAAAA',
49
+ * );
50
+ * ```
51
+ */
52
+ retrieve(id: string, options?: RequestOptions): APIPromise<XAccountConnectionLink> {
53
+ return this._client.get(path`/x/account-connection-links/${id}`, options);
54
+ }
55
+
56
+ /**
57
+ * Lists your connect links, newest first, with `apiKeyId` naming the API key that
58
+ * made each one, or null for a dashboard session. Use it to find and revoke the
59
+ * links a leaked key made. It never holds a token. Takes a Full access API key
60
+ * holding `connectsXAccounts`, or a dashboard session.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * const accountConnectionLinks =
65
+ * await client.x.accountConnectionLinks.list();
66
+ * ```
67
+ */
68
+ list(
69
+ query: AccountConnectionLinkListParams | null | undefined = {},
70
+ options?: RequestOptions,
71
+ ): APIPromise<AccountConnectionLinkListResponse> {
72
+ return this._client.get('/x/account-connection-links', { query, ...options });
73
+ }
74
+
75
+ /**
76
+ * Stops a link working. An account it already connected stays connected. Takes a
77
+ * Full access API key holding `connectsXAccounts`, or a dashboard session.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const accountConnectionLink =
82
+ * await client.x.accountConnectionLinks.delete(
83
+ * 'xlink_AAAAAAAAAAAAAAAA',
84
+ * );
85
+ * ```
86
+ */
87
+ delete(id: string, options?: RequestOptions): APIPromise<AccountConnectionLinkDeleteResponse> {
88
+ return this._client.delete(path`/x/account-connection-links/${id}`, options);
89
+ }
90
+ }
91
+
92
+ /**
93
+ * A link where a person connects an X account on Xquik's page.
94
+ */
95
+ export interface XAccountConnectionLink {
96
+ id: string;
97
+
98
+ accountId: string | null;
99
+
100
+ /**
101
+ * The ID of the API key that made the link, or null when a dashboard session made
102
+ * it.
103
+ */
104
+ apiKeyId: string | null;
105
+
106
+ completedAt: string | null;
107
+
108
+ createdAt: string;
109
+
110
+ expiresAt: string;
111
+
112
+ /**
113
+ * Why the last login didn't finish.
114
+ */
115
+ failure: string | null;
116
+
117
+ health: string | null;
118
+
119
+ object: 'x_account_connection_link';
120
+
121
+ purpose: 'connect' | 'reconnect';
122
+
123
+ reference: string | null;
124
+
125
+ returnUrl: string | null;
126
+
127
+ /**
128
+ * `failed` means 5 logins were refused, so make a new link. `revoked` means you
129
+ * revoked it, or the key that made it is paused, revoked, expired, no longer Full
130
+ * access or without `connectsXAccounts`. A link whose key resumes within its 30
131
+ * minutes reads `pending` again.
132
+ */
133
+ status: 'pending' | 'connecting' | 'requires_email_code' | 'connected' | 'failed' | 'expired' | 'revoked';
134
+
135
+ xUserId: string | null;
136
+
137
+ xUsername: string | null;
138
+
139
+ /**
140
+ * Present only in the response that creates the link.
141
+ */
142
+ url?: string;
143
+ }
144
+
145
+ /**
146
+ * A link where a person connects an X account on Xquik's page.
147
+ */
148
+ export interface AccountConnectionLinkCreateResponse extends XAccountConnectionLink {
149
+ /**
150
+ * The page to open. Its fragment holds the token, so treat it as a secret & keep
151
+ * it out of logs.
152
+ */
153
+ url: string;
154
+ }
155
+
156
+ /**
157
+ * Your connect links, newest first.
158
+ */
159
+ export interface AccountConnectionLinkListResponse {
160
+ hasMore: boolean;
161
+
162
+ links: Array<XAccountConnectionLink>;
163
+
164
+ /**
165
+ * Pass unchanged as cursor while hasMore is true.
166
+ */
167
+ nextCursor?: string;
168
+ }
169
+
170
+ export interface AccountConnectionLinkDeleteResponse {
171
+ success: true;
172
+ }
173
+
174
+ export interface AccountConnectionLinkCreateParams {
175
+ /**
176
+ * The ID of 1 of your X accounts. The link then reconnects that account.
177
+ */
178
+ accountId?: string;
179
+
180
+ /**
181
+ * Your own ID for this person. It comes back when you read the link.
182
+ */
183
+ reference?: string;
184
+
185
+ /**
186
+ * A public https URL the page offers as a button once the account connects. Xquik
187
+ * never redirects by itself, & never adds the token.
188
+ */
189
+ returnUrl?: string;
190
+ }
191
+
192
+ export interface AccountConnectionLinkListParams {
193
+ /**
194
+ * Previous nextCursor. The after alias also works. Offset pagination is not
195
+ * supported.
196
+ */
197
+ cursor?: string;
198
+
199
+ /**
200
+ * Maximum items per page, from 1 to 10,000. Default 200. Pass nextCursor as cursor
201
+ * for the next page.
202
+ */
203
+ limit?: number;
204
+ }
205
+
206
+ export declare namespace AccountConnectionLinks {
207
+ export {
208
+ type XAccountConnectionLink as XAccountConnectionLink,
209
+ type AccountConnectionLinkCreateResponse as AccountConnectionLinkCreateResponse,
210
+ type AccountConnectionLinkListResponse as AccountConnectionLinkListResponse,
211
+ type AccountConnectionLinkDeleteResponse as AccountConnectionLinkDeleteResponse,
212
+ type AccountConnectionLinkCreateParams as AccountConnectionLinkCreateParams,
213
+ type AccountConnectionLinkListParams as AccountConnectionLinkListParams,
214
+ };
215
+ }
@@ -243,21 +243,10 @@ export interface AccountBulkRetryResponse {
243
243
  }
244
244
 
245
245
  /**
246
- * Sanitized X account summary returned by connect and reauth.
246
+ * The account once the sign-in finishes. While it still runs or waits on an email
247
+ * code, the same pending attempt or challenge that `create` returns.
247
248
  */
248
- export interface AccountReauthResponse {
249
- id: string;
250
-
251
- createdAt: string;
252
-
253
- health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
254
-
255
- status: 'active';
256
-
257
- xUserId: string;
258
-
259
- xUsername: string;
260
- }
249
+ export type AccountReauthResponse = AccountCreateResponse;
261
250
 
262
251
  export interface AccountCreateParams {
263
252
  /**
@@ -279,6 +268,12 @@ export interface AccountCreateParams {
279
268
  * X username of the account to connect, with or without @
280
269
  */
281
270
  username: string;
271
+
272
+ /**
273
+ * An ID you generate to read this attempt's status, even if the response never
274
+ * reaches you. Leave it out to get one in a pending response.
275
+ */
276
+ connection_attempt_id?: string;
282
277
  }
283
278
 
284
279
  export interface AccountListParams {
@@ -310,6 +305,12 @@ export interface AccountReauthParams {
310
305
  */
311
306
  password: string;
312
307
 
308
+ /**
309
+ * An ID you generate to read this reconnect's status, even if the response never
310
+ * reaches you. Leave it out to get one in a pending response.
311
+ */
312
+ connection_attempt_id?: string;
313
+
313
314
  /**
314
315
  * Email for the X account (updates stored email)
315
316
  */