x-twitter-scraper 0.4.1 → 0.5.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.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/resources/credits.d.mts +1 -1
- package/resources/credits.d.ts +1 -1
- package/resources/extractions.d.mts +4 -4
- package/resources/extractions.d.ts +4 -4
- package/resources/guest-wallets.d.mts +2 -2
- package/resources/guest-wallets.d.ts +2 -2
- package/resources/shared.d.mts +24 -8
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +24 -8
- package/resources/shared.d.ts.map +1 -1
- package/resources/support/tickets.d.mts +67 -4
- package/resources/support/tickets.d.mts.map +1 -1
- package/resources/support/tickets.d.ts +67 -4
- package/resources/support/tickets.d.ts.map +1 -1
- package/resources/support/tickets.js +22 -4
- package/resources/support/tickets.js.map +1 -1
- package/resources/support/tickets.mjs +22 -4
- package/resources/support/tickets.mjs.map +1 -1
- package/resources/x/account-connection-challenges.d.mts +1 -1
- package/resources/x/account-connection-challenges.d.ts +1 -1
- package/resources/x/account-connection-challenges.js +1 -1
- package/resources/x/account-connection-challenges.mjs +1 -1
- package/resources/x/accounts.d.mts +9 -6
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +9 -6
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +4 -2
- package/resources/x/accounts.js.map +1 -1
- package/resources/x/accounts.mjs +4 -2
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/communities/communities.d.mts +360 -10
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +360 -10
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +17 -4
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +17 -4
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +361 -7
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +361 -7
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +20 -5
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +20 -5
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/dm.d.mts +183 -5
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +183 -5
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +9 -2
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +9 -2
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/media.d.mts +178 -10
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +178 -10
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +9 -5
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs +9 -5
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +545 -14
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +545 -14
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +25 -6
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs +25 -6
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts +358 -6
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts +358 -6
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.js +17 -4
- package/resources/x/tweets/like.js.map +1 -1
- package/resources/x/tweets/like.mjs +17 -4
- package/resources/x/tweets/like.mjs.map +1 -1
- package/resources/x/tweets/retweet.d.mts +358 -6
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts +358 -6
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.js +17 -4
- package/resources/x/tweets/retweet.js.map +1 -1
- package/resources/x/tweets/retweet.mjs +17 -4
- package/resources/x/tweets/retweet.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +376 -18
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +376 -18
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +25 -6
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +25 -6
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/follow.d.mts +361 -7
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts +361 -7
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.js +20 -5
- package/resources/x/users/follow.js.map +1 -1
- package/resources/x/users/follow.mjs +20 -5
- package/resources/x/users/follow.mjs.map +1 -1
- package/resources/x/users/users.d.mts +181 -5
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +181 -5
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +9 -2
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +9 -2
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/write-actions.d.mts +155 -12
- package/resources/x/write-actions.d.mts.map +1 -1
- package/resources/x/write-actions.d.ts +155 -12
- package/resources/x/write-actions.d.ts.map +1 -1
- package/src/resources/credits.ts +1 -1
- package/src/resources/extractions.ts +4 -4
- package/src/resources/guest-wallets.ts +2 -2
- package/src/resources/shared.ts +93 -9
- package/src/resources/support/tickets.ts +122 -6
- package/src/resources/x/account-connection-challenges.ts +1 -1
- package/src/resources/x/accounts.ts +9 -6
- package/src/resources/x/communities/communities.ts +515 -12
- package/src/resources/x/communities/join.ts +518 -9
- package/src/resources/x/dm.ts +261 -6
- package/src/resources/x/media.ts +258 -11
- package/src/resources/x/profile.ts +786 -17
- package/src/resources/x/tweets/like.ts +515 -8
- package/src/resources/x/tweets/retweet.ts +523 -8
- package/src/resources/x/tweets/tweets.ts +529 -23
- package/src/resources/x/users/follow.ts +518 -9
- package/src/resources/x/users/users.ts +260 -6
- package/src/resources/x/write-actions.ts +207 -14
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../internal/headers';
|
|
5
6
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { maybeMultipartFormRequestOptions } from '../../internal/uploads';
|
|
6
8
|
import { path } from '../../internal/utils/path';
|
|
7
9
|
|
|
8
10
|
/**
|
|
@@ -20,8 +22,22 @@ export class Tickets extends APIResource {
|
|
|
20
22
|
* });
|
|
21
23
|
* ```
|
|
22
24
|
*/
|
|
23
|
-
create(
|
|
24
|
-
|
|
25
|
+
create(params: TicketCreateParams, options?: RequestOptions): APIPromise<TicketCreateResponse> {
|
|
26
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
27
|
+
return this._client.post(
|
|
28
|
+
'/support/tickets',
|
|
29
|
+
maybeMultipartFormRequestOptions(
|
|
30
|
+
{
|
|
31
|
+
body,
|
|
32
|
+
...options,
|
|
33
|
+
headers: buildHeaders([
|
|
34
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
35
|
+
options?.headers,
|
|
36
|
+
]),
|
|
37
|
+
},
|
|
38
|
+
this._client,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
25
41
|
}
|
|
26
42
|
|
|
27
43
|
/**
|
|
@@ -76,13 +92,40 @@ export class Tickets extends APIResource {
|
|
|
76
92
|
* );
|
|
77
93
|
* ```
|
|
78
94
|
*/
|
|
79
|
-
reply(id: string,
|
|
80
|
-
|
|
95
|
+
reply(id: string, params: TicketReplyParams, options?: RequestOptions): APIPromise<TicketReplyResponse> {
|
|
96
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
97
|
+
return this._client.post(
|
|
98
|
+
path`/support/tickets/${id}/messages`,
|
|
99
|
+
maybeMultipartFormRequestOptions(
|
|
100
|
+
{
|
|
101
|
+
body,
|
|
102
|
+
...options,
|
|
103
|
+
headers: buildHeaders([
|
|
104
|
+
{ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
|
|
105
|
+
options?.headers,
|
|
106
|
+
]),
|
|
107
|
+
},
|
|
108
|
+
this._client,
|
|
109
|
+
),
|
|
110
|
+
);
|
|
81
111
|
}
|
|
82
112
|
}
|
|
83
113
|
|
|
84
114
|
export interface TicketCreateResponse {
|
|
85
|
-
|
|
115
|
+
attachments: Array<TicketCreateResponse.Attachment>;
|
|
116
|
+
|
|
117
|
+
publicId: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export namespace TicketCreateResponse {
|
|
121
|
+
/**
|
|
122
|
+
* Attachment identifier and initial processing state.
|
|
123
|
+
*/
|
|
124
|
+
export interface Attachment {
|
|
125
|
+
publicId: string;
|
|
126
|
+
|
|
127
|
+
status: 'pending' | 'ready' | 'failed';
|
|
128
|
+
}
|
|
86
129
|
}
|
|
87
130
|
|
|
88
131
|
export interface TicketRetrieveResponse {
|
|
@@ -101,12 +144,51 @@ export interface TicketRetrieveResponse {
|
|
|
101
144
|
|
|
102
145
|
export namespace TicketRetrieveResponse {
|
|
103
146
|
export interface Message {
|
|
147
|
+
attachments?: Array<Message.Attachment>;
|
|
148
|
+
|
|
104
149
|
body?: string;
|
|
105
150
|
|
|
106
151
|
createdAt?: string;
|
|
107
152
|
|
|
108
153
|
sender?: string;
|
|
109
154
|
}
|
|
155
|
+
|
|
156
|
+
export namespace Message {
|
|
157
|
+
/**
|
|
158
|
+
* Downloadable image or video attached to a support message.
|
|
159
|
+
*/
|
|
160
|
+
export interface Attachment {
|
|
161
|
+
/**
|
|
162
|
+
* Validated media type.
|
|
163
|
+
*/
|
|
164
|
+
contentType:
|
|
165
|
+
| 'image/jpeg'
|
|
166
|
+
| 'image/png'
|
|
167
|
+
| 'image/gif'
|
|
168
|
+
| 'image/webp'
|
|
169
|
+
| 'video/mp4'
|
|
170
|
+
| 'video/quicktime'
|
|
171
|
+
| 'video/webm';
|
|
172
|
+
|
|
173
|
+
filename: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Attachment media class.
|
|
177
|
+
*/
|
|
178
|
+
kind: 'image' | 'video';
|
|
179
|
+
|
|
180
|
+
publicId: string;
|
|
181
|
+
|
|
182
|
+
sizeBytes: number;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Storage processing state.
|
|
186
|
+
*/
|
|
187
|
+
status: 'pending' | 'ready' | 'failed';
|
|
188
|
+
|
|
189
|
+
url: string;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
110
192
|
}
|
|
111
193
|
|
|
112
194
|
export interface TicketUpdateResponse {
|
|
@@ -136,13 +218,38 @@ export namespace TicketListResponse {
|
|
|
136
218
|
}
|
|
137
219
|
|
|
138
220
|
export interface TicketReplyResponse {
|
|
139
|
-
|
|
221
|
+
attachments: Array<TicketReplyResponse.Attachment>;
|
|
222
|
+
|
|
223
|
+
publicId: string;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export namespace TicketReplyResponse {
|
|
227
|
+
/**
|
|
228
|
+
* Attachment identifier and initial processing state.
|
|
229
|
+
*/
|
|
230
|
+
export interface Attachment {
|
|
231
|
+
publicId: string;
|
|
232
|
+
|
|
233
|
+
status: 'pending' | 'ready' | 'failed';
|
|
234
|
+
}
|
|
140
235
|
}
|
|
141
236
|
|
|
142
237
|
export interface TicketCreateParams {
|
|
238
|
+
/**
|
|
239
|
+
* Body param
|
|
240
|
+
*/
|
|
143
241
|
body: string;
|
|
144
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Body param
|
|
245
|
+
*/
|
|
145
246
|
subject: string;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Header param: Generate one random value per ticket or reply. Reuse it only when
|
|
250
|
+
* retrying identical text and attachments. Never log this value.
|
|
251
|
+
*/
|
|
252
|
+
'Idempotency-Key'?: string;
|
|
146
253
|
}
|
|
147
254
|
|
|
148
255
|
export interface TicketUpdateParams {
|
|
@@ -150,7 +257,16 @@ export interface TicketUpdateParams {
|
|
|
150
257
|
}
|
|
151
258
|
|
|
152
259
|
export interface TicketReplyParams {
|
|
260
|
+
/**
|
|
261
|
+
* Body param
|
|
262
|
+
*/
|
|
153
263
|
body: string;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Header param: Generate one random value per ticket or reply. Reuse it only when
|
|
267
|
+
* retrying identical text and attachments. Never log this value.
|
|
268
|
+
*/
|
|
269
|
+
'Idempotency-Key'?: string;
|
|
154
270
|
}
|
|
155
271
|
|
|
156
272
|
export declare namespace Tickets {
|
|
@@ -15,9 +15,10 @@ export class Accounts extends APIResource {
|
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
17
17
|
* const account = await client.x.accounts.create({
|
|
18
|
-
* email: '
|
|
18
|
+
* email: 'account@example.invalid',
|
|
19
19
|
* password: '<ACCOUNT_PASSWORD>',
|
|
20
|
-
* username: '
|
|
20
|
+
* username: 'your_x_username',
|
|
21
|
+
* totp_secret: '<TOTP_SECRET>',
|
|
21
22
|
* });
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
@@ -83,6 +84,7 @@ export class Accounts extends APIResource {
|
|
|
83
84
|
* ```ts
|
|
84
85
|
* const response = await client.x.accounts.reauth('id', {
|
|
85
86
|
* password: '<ACCOUNT_PASSWORD>',
|
|
87
|
+
* email: 'account@example.invalid',
|
|
86
88
|
* totp_secret: '<TOTP_SECRET>',
|
|
87
89
|
* });
|
|
88
90
|
* ```
|
|
@@ -101,10 +103,11 @@ export interface XAccount {
|
|
|
101
103
|
createdAt: string;
|
|
102
104
|
|
|
103
105
|
/**
|
|
104
|
-
* Derived connection health. `healthy` =
|
|
105
|
-
*
|
|
106
|
-
* suspended the account. `recovering` =
|
|
107
|
-
* `temporaryIssue` = retry
|
|
106
|
+
* Derived connection health. `healthy` = session active. `needsReauth` = user must
|
|
107
|
+
* submit fresh credentials. `locked` = X locked the account; unlock on x.com
|
|
108
|
+
* first. `suspended` = X banned the account. `recovering` = past cooldown, will
|
|
109
|
+
* auto-retry on next use. `temporaryIssue` = temporary connection problem; retry
|
|
110
|
+
* shortly.
|
|
108
111
|
*/
|
|
109
112
|
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
110
113
|
|