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,6 +2,7 @@
|
|
|
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';
|
|
6
7
|
import { maybeMultipartFormRequestOptions } from '../../internal/uploads';
|
|
7
8
|
|
|
@@ -16,6 +17,7 @@ export class Profile extends APIResource {
|
|
|
16
17
|
* ```ts
|
|
17
18
|
* const profile = await client.x.profile.update({
|
|
18
19
|
* account: '@elonmusk',
|
|
20
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
19
21
|
* description: 'description_value',
|
|
20
22
|
* location: 'location_value',
|
|
21
23
|
* name: 'Example Name',
|
|
@@ -23,8 +25,13 @@ export class Profile extends APIResource {
|
|
|
23
25
|
* });
|
|
24
26
|
* ```
|
|
25
27
|
*/
|
|
26
|
-
update(
|
|
27
|
-
|
|
28
|
+
update(params: ProfileUpdateParams, options?: RequestOptions): APIPromise<ProfileUpdateResponse> {
|
|
29
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
30
|
+
return this._client.patch('/x/profile', {
|
|
31
|
+
body,
|
|
32
|
+
...options,
|
|
33
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
34
|
+
});
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
/**
|
|
@@ -35,16 +42,25 @@ export class Profile extends APIResource {
|
|
|
35
42
|
* const response = await client.x.profile.updateAvatar({
|
|
36
43
|
* account: '@elonmusk',
|
|
37
44
|
* url: 'https://example.com/avatar.png',
|
|
45
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
38
46
|
* });
|
|
39
47
|
* ```
|
|
40
48
|
*/
|
|
41
49
|
updateAvatar(
|
|
42
|
-
|
|
50
|
+
params: ProfileUpdateAvatarParams,
|
|
43
51
|
options?: RequestOptions,
|
|
44
52
|
): APIPromise<ProfileUpdateAvatarResponse> {
|
|
53
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
45
54
|
return this._client.patch(
|
|
46
55
|
'/x/profile/avatar',
|
|
47
|
-
maybeMultipartFormRequestOptions(
|
|
56
|
+
maybeMultipartFormRequestOptions(
|
|
57
|
+
{
|
|
58
|
+
body,
|
|
59
|
+
...options,
|
|
60
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
61
|
+
},
|
|
62
|
+
this._client,
|
|
63
|
+
),
|
|
48
64
|
);
|
|
49
65
|
}
|
|
50
66
|
|
|
@@ -56,78 +72,831 @@ export class Profile extends APIResource {
|
|
|
56
72
|
* const response = await client.x.profile.updateBanner({
|
|
57
73
|
* account: '@elonmusk',
|
|
58
74
|
* url: 'https://example.com/banner.png',
|
|
75
|
+
* 'Idempotency-Key': 'Idempotency-Key',
|
|
59
76
|
* });
|
|
60
77
|
* ```
|
|
61
78
|
*/
|
|
62
79
|
updateBanner(
|
|
63
|
-
|
|
80
|
+
params: ProfileUpdateBannerParams,
|
|
64
81
|
options?: RequestOptions,
|
|
65
82
|
): APIPromise<ProfileUpdateBannerResponse> {
|
|
83
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
66
84
|
return this._client.patch(
|
|
67
85
|
'/x/profile/banner',
|
|
68
|
-
maybeMultipartFormRequestOptions(
|
|
86
|
+
maybeMultipartFormRequestOptions(
|
|
87
|
+
{
|
|
88
|
+
body,
|
|
89
|
+
...options,
|
|
90
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
91
|
+
},
|
|
92
|
+
this._client,
|
|
93
|
+
),
|
|
69
94
|
);
|
|
70
95
|
}
|
|
71
96
|
}
|
|
72
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing
|
|
100
|
+
* the original Idempotency-Key returns this same record. Submit a new write only
|
|
101
|
+
* when safeToRetry is true, using a new key.
|
|
102
|
+
*/
|
|
73
103
|
export interface ProfileUpdateResponse {
|
|
74
|
-
|
|
104
|
+
id: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Connected account selected for the write.
|
|
108
|
+
*/
|
|
109
|
+
account: ProfileUpdateResponse.Account | null;
|
|
110
|
+
|
|
111
|
+
action:
|
|
112
|
+
| 'create_tweet'
|
|
113
|
+
| 'delete_tweet'
|
|
114
|
+
| 'like'
|
|
115
|
+
| 'unlike'
|
|
116
|
+
| 'retweet'
|
|
117
|
+
| 'unretweet'
|
|
118
|
+
| 'follow'
|
|
119
|
+
| 'unfollow'
|
|
120
|
+
| 'remove_follower'
|
|
121
|
+
| 'send_dm'
|
|
122
|
+
| 'upload_media'
|
|
123
|
+
| 'update_profile'
|
|
124
|
+
| 'update_avatar'
|
|
125
|
+
| 'update_banner'
|
|
126
|
+
| 'create_community'
|
|
127
|
+
| 'delete_community'
|
|
128
|
+
| 'join_community'
|
|
129
|
+
| 'leave_community';
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* plannedCredits is the approved maximum. chargedCredits comes from the settled
|
|
133
|
+
* credit ledger. Pending or failed writes are not charged.
|
|
134
|
+
*/
|
|
135
|
+
billing: ProfileUpdateResponse.Billing;
|
|
136
|
+
|
|
137
|
+
charged: boolean;
|
|
138
|
+
|
|
139
|
+
chargedCredits: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Exact follow-up an API client or agent should perform.
|
|
143
|
+
*/
|
|
144
|
+
nextAction: ProfileUpdateResponse.NextAction | null;
|
|
145
|
+
|
|
146
|
+
object: 'x_write_action';
|
|
147
|
+
|
|
148
|
+
pollAfterMs: number | null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Stable fingerprint and sanitized payload for replay checks.
|
|
152
|
+
*/
|
|
153
|
+
request: ProfileUpdateResponse.Request;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Confirmed result produced by the write, when available.
|
|
157
|
+
*/
|
|
158
|
+
result: ProfileUpdateResponse.Result | null;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* True only when a new attempt can reasonably succeed.
|
|
162
|
+
*/
|
|
163
|
+
retryable: boolean;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* True only when no write was dispatched and a new idempotency key may be used.
|
|
167
|
+
*/
|
|
168
|
+
safeToRetry: boolean;
|
|
169
|
+
|
|
170
|
+
sendDispatched: boolean;
|
|
171
|
+
|
|
172
|
+
status: 'accepted' | 'dispatching' | 'pending_confirmation' | 'success' | 'failed' | 'expired';
|
|
173
|
+
|
|
174
|
+
statusUrl: string;
|
|
175
|
+
|
|
176
|
+
success: boolean;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Existing X resource targeted by the write, when applicable.
|
|
180
|
+
*/
|
|
181
|
+
target: ProfileUpdateResponse.Target | null;
|
|
182
|
+
|
|
183
|
+
targetId: string | null;
|
|
184
|
+
|
|
185
|
+
terminal: boolean;
|
|
186
|
+
|
|
187
|
+
writeActionId: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Compatibility field for a confirmed community ID.
|
|
191
|
+
*/
|
|
192
|
+
communityId?: string;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Confirmed community name when available.
|
|
196
|
+
*/
|
|
197
|
+
communityName?: string;
|
|
198
|
+
|
|
199
|
+
completedAt?: string;
|
|
200
|
+
|
|
201
|
+
confirmationAttempts?: number;
|
|
202
|
+
|
|
203
|
+
confirmationCheckedAt?: string;
|
|
204
|
+
|
|
205
|
+
confirmedAt?: string;
|
|
206
|
+
|
|
207
|
+
createdAt?: string;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Structured recovery context for a failed write.
|
|
211
|
+
*/
|
|
212
|
+
details?: { [key: string]: unknown };
|
|
213
|
+
|
|
214
|
+
error?: string;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Deadline for resolving a non-terminal write. This is not the Idempotency-Key
|
|
218
|
+
* retention deadline.
|
|
219
|
+
*/
|
|
220
|
+
expiresAt?: string;
|
|
221
|
+
|
|
222
|
+
idempotent?: boolean;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Media count, kind, size, and billing details when used.
|
|
226
|
+
*/
|
|
227
|
+
media?: { [key: string]: unknown };
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Compatibility field for a confirmed media upload ID.
|
|
231
|
+
*/
|
|
232
|
+
mediaId?: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Public media URL when the upload creates one.
|
|
236
|
+
*/
|
|
237
|
+
mediaUrl?: string;
|
|
238
|
+
|
|
239
|
+
message?: string;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Compatibility field for a confirmed direct message ID.
|
|
243
|
+
*/
|
|
244
|
+
messageId?: string;
|
|
245
|
+
|
|
246
|
+
requestHash?: string;
|
|
247
|
+
|
|
248
|
+
requestId?: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Compatibility result ID for other write actions.
|
|
252
|
+
*/
|
|
253
|
+
resultId?: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Dispatch timestamp when the write reached execution.
|
|
257
|
+
*/
|
|
258
|
+
sendDispatchedAt?: string;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Compatibility field for a confirmed tweet result ID.
|
|
262
|
+
*/
|
|
263
|
+
tweetId?: string;
|
|
264
|
+
|
|
265
|
+
updatedAt?: string;
|
|
75
266
|
}
|
|
76
267
|
|
|
268
|
+
export namespace ProfileUpdateResponse {
|
|
269
|
+
/**
|
|
270
|
+
* Connected account selected for the write.
|
|
271
|
+
*/
|
|
272
|
+
export interface Account {
|
|
273
|
+
id: string;
|
|
274
|
+
|
|
275
|
+
username: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* plannedCredits is the approved maximum. chargedCredits comes from the settled
|
|
280
|
+
* credit ledger. Pending or failed writes are not charged.
|
|
281
|
+
*/
|
|
282
|
+
export interface Billing {
|
|
283
|
+
charged: boolean;
|
|
284
|
+
|
|
285
|
+
chargedCredits: string;
|
|
286
|
+
|
|
287
|
+
plannedCredits: string;
|
|
288
|
+
|
|
289
|
+
status: 'not_charged' | 'pending' | 'charged' | 'charge_failed' | 'refunded';
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Exact follow-up an API client or agent should perform.
|
|
294
|
+
*/
|
|
295
|
+
export interface NextAction {
|
|
296
|
+
type: 'poll' | 'retry' | 'verify_result' | 'fix_request';
|
|
297
|
+
|
|
298
|
+
afterMs?: number;
|
|
299
|
+
|
|
300
|
+
requiresNewIdempotencyKey?: boolean;
|
|
301
|
+
|
|
302
|
+
url?: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Stable fingerprint and sanitized payload for replay checks.
|
|
307
|
+
*/
|
|
308
|
+
export interface Request {
|
|
309
|
+
/**
|
|
310
|
+
* Stable hash of account, action, target, and payload.
|
|
311
|
+
*/
|
|
312
|
+
hash: string | null;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Exact sanitized payload dispatched for this action.
|
|
316
|
+
*/
|
|
317
|
+
payload: { [key: string]: unknown } | null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Confirmed result produced by the write, when available.
|
|
322
|
+
*/
|
|
323
|
+
export interface Result {
|
|
324
|
+
id?: string;
|
|
325
|
+
|
|
326
|
+
state?: string;
|
|
327
|
+
|
|
328
|
+
type?: 'tweet' | 'direct_message' | 'media' | 'community' | 'state_change';
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Existing X resource targeted by the write, when applicable.
|
|
333
|
+
*/
|
|
334
|
+
export interface Target {
|
|
335
|
+
id: string;
|
|
336
|
+
|
|
337
|
+
type: 'tweet' | 'user' | 'community';
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing
|
|
343
|
+
* the original Idempotency-Key returns this same record. Submit a new write only
|
|
344
|
+
* when safeToRetry is true, using a new key.
|
|
345
|
+
*/
|
|
77
346
|
export interface ProfileUpdateAvatarResponse {
|
|
78
|
-
|
|
347
|
+
id: string;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Connected account selected for the write.
|
|
351
|
+
*/
|
|
352
|
+
account: ProfileUpdateAvatarResponse.Account | null;
|
|
353
|
+
|
|
354
|
+
action:
|
|
355
|
+
| 'create_tweet'
|
|
356
|
+
| 'delete_tweet'
|
|
357
|
+
| 'like'
|
|
358
|
+
| 'unlike'
|
|
359
|
+
| 'retweet'
|
|
360
|
+
| 'unretweet'
|
|
361
|
+
| 'follow'
|
|
362
|
+
| 'unfollow'
|
|
363
|
+
| 'remove_follower'
|
|
364
|
+
| 'send_dm'
|
|
365
|
+
| 'upload_media'
|
|
366
|
+
| 'update_profile'
|
|
367
|
+
| 'update_avatar'
|
|
368
|
+
| 'update_banner'
|
|
369
|
+
| 'create_community'
|
|
370
|
+
| 'delete_community'
|
|
371
|
+
| 'join_community'
|
|
372
|
+
| 'leave_community';
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* plannedCredits is the approved maximum. chargedCredits comes from the settled
|
|
376
|
+
* credit ledger. Pending or failed writes are not charged.
|
|
377
|
+
*/
|
|
378
|
+
billing: ProfileUpdateAvatarResponse.Billing;
|
|
379
|
+
|
|
380
|
+
charged: boolean;
|
|
381
|
+
|
|
382
|
+
chargedCredits: string;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Exact follow-up an API client or agent should perform.
|
|
386
|
+
*/
|
|
387
|
+
nextAction: ProfileUpdateAvatarResponse.NextAction | null;
|
|
388
|
+
|
|
389
|
+
object: 'x_write_action';
|
|
390
|
+
|
|
391
|
+
pollAfterMs: number | null;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Stable fingerprint and sanitized payload for replay checks.
|
|
395
|
+
*/
|
|
396
|
+
request: ProfileUpdateAvatarResponse.Request;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Confirmed result produced by the write, when available.
|
|
400
|
+
*/
|
|
401
|
+
result: ProfileUpdateAvatarResponse.Result | null;
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* True only when a new attempt can reasonably succeed.
|
|
405
|
+
*/
|
|
406
|
+
retryable: boolean;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* True only when no write was dispatched and a new idempotency key may be used.
|
|
410
|
+
*/
|
|
411
|
+
safeToRetry: boolean;
|
|
412
|
+
|
|
413
|
+
sendDispatched: boolean;
|
|
414
|
+
|
|
415
|
+
status: 'accepted' | 'dispatching' | 'pending_confirmation' | 'success' | 'failed' | 'expired';
|
|
416
|
+
|
|
417
|
+
statusUrl: string;
|
|
418
|
+
|
|
419
|
+
success: boolean;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Existing X resource targeted by the write, when applicable.
|
|
423
|
+
*/
|
|
424
|
+
target: ProfileUpdateAvatarResponse.Target | null;
|
|
425
|
+
|
|
426
|
+
targetId: string | null;
|
|
427
|
+
|
|
428
|
+
terminal: boolean;
|
|
429
|
+
|
|
430
|
+
writeActionId: string;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Compatibility field for a confirmed community ID.
|
|
434
|
+
*/
|
|
435
|
+
communityId?: string;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Confirmed community name when available.
|
|
439
|
+
*/
|
|
440
|
+
communityName?: string;
|
|
441
|
+
|
|
442
|
+
completedAt?: string;
|
|
443
|
+
|
|
444
|
+
confirmationAttempts?: number;
|
|
445
|
+
|
|
446
|
+
confirmationCheckedAt?: string;
|
|
447
|
+
|
|
448
|
+
confirmedAt?: string;
|
|
449
|
+
|
|
450
|
+
createdAt?: string;
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Structured recovery context for a failed write.
|
|
454
|
+
*/
|
|
455
|
+
details?: { [key: string]: unknown };
|
|
456
|
+
|
|
457
|
+
error?: string;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Deadline for resolving a non-terminal write. This is not the Idempotency-Key
|
|
461
|
+
* retention deadline.
|
|
462
|
+
*/
|
|
463
|
+
expiresAt?: string;
|
|
464
|
+
|
|
465
|
+
idempotent?: boolean;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Media count, kind, size, and billing details when used.
|
|
469
|
+
*/
|
|
470
|
+
media?: { [key: string]: unknown };
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Compatibility field for a confirmed media upload ID.
|
|
474
|
+
*/
|
|
475
|
+
mediaId?: string;
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Public media URL when the upload creates one.
|
|
479
|
+
*/
|
|
480
|
+
mediaUrl?: string;
|
|
481
|
+
|
|
482
|
+
message?: string;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Compatibility field for a confirmed direct message ID.
|
|
486
|
+
*/
|
|
487
|
+
messageId?: string;
|
|
488
|
+
|
|
489
|
+
requestHash?: string;
|
|
490
|
+
|
|
491
|
+
requestId?: string;
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Compatibility result ID for other write actions.
|
|
495
|
+
*/
|
|
496
|
+
resultId?: string;
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Dispatch timestamp when the write reached execution.
|
|
500
|
+
*/
|
|
501
|
+
sendDispatchedAt?: string;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Compatibility field for a confirmed tweet result ID.
|
|
505
|
+
*/
|
|
506
|
+
tweetId?: string;
|
|
507
|
+
|
|
508
|
+
updatedAt?: string;
|
|
79
509
|
}
|
|
80
510
|
|
|
511
|
+
export namespace ProfileUpdateAvatarResponse {
|
|
512
|
+
/**
|
|
513
|
+
* Connected account selected for the write.
|
|
514
|
+
*/
|
|
515
|
+
export interface Account {
|
|
516
|
+
id: string;
|
|
517
|
+
|
|
518
|
+
username: string;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* plannedCredits is the approved maximum. chargedCredits comes from the settled
|
|
523
|
+
* credit ledger. Pending or failed writes are not charged.
|
|
524
|
+
*/
|
|
525
|
+
export interface Billing {
|
|
526
|
+
charged: boolean;
|
|
527
|
+
|
|
528
|
+
chargedCredits: string;
|
|
529
|
+
|
|
530
|
+
plannedCredits: string;
|
|
531
|
+
|
|
532
|
+
status: 'not_charged' | 'pending' | 'charged' | 'charge_failed' | 'refunded';
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Exact follow-up an API client or agent should perform.
|
|
537
|
+
*/
|
|
538
|
+
export interface NextAction {
|
|
539
|
+
type: 'poll' | 'retry' | 'verify_result' | 'fix_request';
|
|
540
|
+
|
|
541
|
+
afterMs?: number;
|
|
542
|
+
|
|
543
|
+
requiresNewIdempotencyKey?: boolean;
|
|
544
|
+
|
|
545
|
+
url?: string;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Stable fingerprint and sanitized payload for replay checks.
|
|
550
|
+
*/
|
|
551
|
+
export interface Request {
|
|
552
|
+
/**
|
|
553
|
+
* Stable hash of account, action, target, and payload.
|
|
554
|
+
*/
|
|
555
|
+
hash: string | null;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Exact sanitized payload dispatched for this action.
|
|
559
|
+
*/
|
|
560
|
+
payload: { [key: string]: unknown } | null;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Confirmed result produced by the write, when available.
|
|
565
|
+
*/
|
|
566
|
+
export interface Result {
|
|
567
|
+
id?: string;
|
|
568
|
+
|
|
569
|
+
state?: string;
|
|
570
|
+
|
|
571
|
+
type?: 'tweet' | 'direct_message' | 'media' | 'community' | 'state_change';
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Existing X resource targeted by the write, when applicable.
|
|
576
|
+
*/
|
|
577
|
+
export interface Target {
|
|
578
|
+
id: string;
|
|
579
|
+
|
|
580
|
+
type: 'tweet' | 'user' | 'community';
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing
|
|
586
|
+
* the original Idempotency-Key returns this same record. Submit a new write only
|
|
587
|
+
* when safeToRetry is true, using a new key.
|
|
588
|
+
*/
|
|
81
589
|
export interface ProfileUpdateBannerResponse {
|
|
82
|
-
|
|
590
|
+
id: string;
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Connected account selected for the write.
|
|
594
|
+
*/
|
|
595
|
+
account: ProfileUpdateBannerResponse.Account | null;
|
|
596
|
+
|
|
597
|
+
action:
|
|
598
|
+
| 'create_tweet'
|
|
599
|
+
| 'delete_tweet'
|
|
600
|
+
| 'like'
|
|
601
|
+
| 'unlike'
|
|
602
|
+
| 'retweet'
|
|
603
|
+
| 'unretweet'
|
|
604
|
+
| 'follow'
|
|
605
|
+
| 'unfollow'
|
|
606
|
+
| 'remove_follower'
|
|
607
|
+
| 'send_dm'
|
|
608
|
+
| 'upload_media'
|
|
609
|
+
| 'update_profile'
|
|
610
|
+
| 'update_avatar'
|
|
611
|
+
| 'update_banner'
|
|
612
|
+
| 'create_community'
|
|
613
|
+
| 'delete_community'
|
|
614
|
+
| 'join_community'
|
|
615
|
+
| 'leave_community';
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* plannedCredits is the approved maximum. chargedCredits comes from the settled
|
|
619
|
+
* credit ledger. Pending or failed writes are not charged.
|
|
620
|
+
*/
|
|
621
|
+
billing: ProfileUpdateBannerResponse.Billing;
|
|
622
|
+
|
|
623
|
+
charged: boolean;
|
|
624
|
+
|
|
625
|
+
chargedCredits: string;
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Exact follow-up an API client or agent should perform.
|
|
629
|
+
*/
|
|
630
|
+
nextAction: ProfileUpdateBannerResponse.NextAction | null;
|
|
631
|
+
|
|
632
|
+
object: 'x_write_action';
|
|
633
|
+
|
|
634
|
+
pollAfterMs: number | null;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Stable fingerprint and sanitized payload for replay checks.
|
|
638
|
+
*/
|
|
639
|
+
request: ProfileUpdateBannerResponse.Request;
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Confirmed result produced by the write, when available.
|
|
643
|
+
*/
|
|
644
|
+
result: ProfileUpdateBannerResponse.Result | null;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* True only when a new attempt can reasonably succeed.
|
|
648
|
+
*/
|
|
649
|
+
retryable: boolean;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* True only when no write was dispatched and a new idempotency key may be used.
|
|
653
|
+
*/
|
|
654
|
+
safeToRetry: boolean;
|
|
655
|
+
|
|
656
|
+
sendDispatched: boolean;
|
|
657
|
+
|
|
658
|
+
status: 'accepted' | 'dispatching' | 'pending_confirmation' | 'success' | 'failed' | 'expired';
|
|
659
|
+
|
|
660
|
+
statusUrl: string;
|
|
661
|
+
|
|
662
|
+
success: boolean;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Existing X resource targeted by the write, when applicable.
|
|
666
|
+
*/
|
|
667
|
+
target: ProfileUpdateBannerResponse.Target | null;
|
|
668
|
+
|
|
669
|
+
targetId: string | null;
|
|
670
|
+
|
|
671
|
+
terminal: boolean;
|
|
672
|
+
|
|
673
|
+
writeActionId: string;
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Compatibility field for a confirmed community ID.
|
|
677
|
+
*/
|
|
678
|
+
communityId?: string;
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* Confirmed community name when available.
|
|
682
|
+
*/
|
|
683
|
+
communityName?: string;
|
|
684
|
+
|
|
685
|
+
completedAt?: string;
|
|
686
|
+
|
|
687
|
+
confirmationAttempts?: number;
|
|
688
|
+
|
|
689
|
+
confirmationCheckedAt?: string;
|
|
690
|
+
|
|
691
|
+
confirmedAt?: string;
|
|
692
|
+
|
|
693
|
+
createdAt?: string;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Structured recovery context for a failed write.
|
|
697
|
+
*/
|
|
698
|
+
details?: { [key: string]: unknown };
|
|
699
|
+
|
|
700
|
+
error?: string;
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Deadline for resolving a non-terminal write. This is not the Idempotency-Key
|
|
704
|
+
* retention deadline.
|
|
705
|
+
*/
|
|
706
|
+
expiresAt?: string;
|
|
707
|
+
|
|
708
|
+
idempotent?: boolean;
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Media count, kind, size, and billing details when used.
|
|
712
|
+
*/
|
|
713
|
+
media?: { [key: string]: unknown };
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Compatibility field for a confirmed media upload ID.
|
|
717
|
+
*/
|
|
718
|
+
mediaId?: string;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Public media URL when the upload creates one.
|
|
722
|
+
*/
|
|
723
|
+
mediaUrl?: string;
|
|
724
|
+
|
|
725
|
+
message?: string;
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Compatibility field for a confirmed direct message ID.
|
|
729
|
+
*/
|
|
730
|
+
messageId?: string;
|
|
731
|
+
|
|
732
|
+
requestHash?: string;
|
|
733
|
+
|
|
734
|
+
requestId?: string;
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Compatibility result ID for other write actions.
|
|
738
|
+
*/
|
|
739
|
+
resultId?: string;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Dispatch timestamp when the write reached execution.
|
|
743
|
+
*/
|
|
744
|
+
sendDispatchedAt?: string;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Compatibility field for a confirmed tweet result ID.
|
|
748
|
+
*/
|
|
749
|
+
tweetId?: string;
|
|
750
|
+
|
|
751
|
+
updatedAt?: string;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export namespace ProfileUpdateBannerResponse {
|
|
755
|
+
/**
|
|
756
|
+
* Connected account selected for the write.
|
|
757
|
+
*/
|
|
758
|
+
export interface Account {
|
|
759
|
+
id: string;
|
|
760
|
+
|
|
761
|
+
username: string;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* plannedCredits is the approved maximum. chargedCredits comes from the settled
|
|
766
|
+
* credit ledger. Pending or failed writes are not charged.
|
|
767
|
+
*/
|
|
768
|
+
export interface Billing {
|
|
769
|
+
charged: boolean;
|
|
770
|
+
|
|
771
|
+
chargedCredits: string;
|
|
772
|
+
|
|
773
|
+
plannedCredits: string;
|
|
774
|
+
|
|
775
|
+
status: 'not_charged' | 'pending' | 'charged' | 'charge_failed' | 'refunded';
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* Exact follow-up an API client or agent should perform.
|
|
780
|
+
*/
|
|
781
|
+
export interface NextAction {
|
|
782
|
+
type: 'poll' | 'retry' | 'verify_result' | 'fix_request';
|
|
783
|
+
|
|
784
|
+
afterMs?: number;
|
|
785
|
+
|
|
786
|
+
requiresNewIdempotencyKey?: boolean;
|
|
787
|
+
|
|
788
|
+
url?: string;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Stable fingerprint and sanitized payload for replay checks.
|
|
793
|
+
*/
|
|
794
|
+
export interface Request {
|
|
795
|
+
/**
|
|
796
|
+
* Stable hash of account, action, target, and payload.
|
|
797
|
+
*/
|
|
798
|
+
hash: string | null;
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
* Exact sanitized payload dispatched for this action.
|
|
802
|
+
*/
|
|
803
|
+
payload: { [key: string]: unknown } | null;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Confirmed result produced by the write, when available.
|
|
808
|
+
*/
|
|
809
|
+
export interface Result {
|
|
810
|
+
id?: string;
|
|
811
|
+
|
|
812
|
+
state?: string;
|
|
813
|
+
|
|
814
|
+
type?: 'tweet' | 'direct_message' | 'media' | 'community' | 'state_change';
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Existing X resource targeted by the write, when applicable.
|
|
819
|
+
*/
|
|
820
|
+
export interface Target {
|
|
821
|
+
id: string;
|
|
822
|
+
|
|
823
|
+
type: 'tweet' | 'user' | 'community';
|
|
824
|
+
}
|
|
83
825
|
}
|
|
84
826
|
|
|
85
827
|
export interface ProfileUpdateParams {
|
|
86
828
|
/**
|
|
87
|
-
* X account (@username or ID) to update profile
|
|
829
|
+
* Body param: X account (@username or ID) to update profile
|
|
88
830
|
*/
|
|
89
831
|
account: string;
|
|
90
832
|
|
|
91
833
|
/**
|
|
92
|
-
*
|
|
834
|
+
* Header param: Generate one unique value for each intended write. Reuse it only
|
|
835
|
+
* when retrying the exact same account, action, target, and payload. A reused key
|
|
836
|
+
* returns the original action. Reusing it with different input returns 409. Replay
|
|
837
|
+
* protection remains active for at least 90 days.
|
|
838
|
+
*/
|
|
839
|
+
'Idempotency-Key': string;
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Body param: Bio description
|
|
93
843
|
*/
|
|
94
844
|
description?: string;
|
|
95
845
|
|
|
846
|
+
/**
|
|
847
|
+
* Body param
|
|
848
|
+
*/
|
|
96
849
|
location?: string;
|
|
97
850
|
|
|
98
851
|
/**
|
|
99
|
-
* Display name
|
|
852
|
+
* Body param: Display name
|
|
100
853
|
*/
|
|
101
854
|
name?: string;
|
|
102
855
|
|
|
103
856
|
/**
|
|
104
|
-
* Website URL
|
|
857
|
+
* Body param: Website URL
|
|
105
858
|
*/
|
|
106
859
|
url?: string;
|
|
107
860
|
}
|
|
108
861
|
|
|
109
862
|
export interface ProfileUpdateAvatarParams {
|
|
110
863
|
/**
|
|
111
|
-
* X account (@username or ID) receiving avatar from URL
|
|
864
|
+
* Body param: X account (@username or ID) receiving avatar from URL
|
|
112
865
|
*/
|
|
113
866
|
account: string;
|
|
114
867
|
|
|
115
868
|
/**
|
|
116
|
-
* HTTPS URL to the avatar image to download
|
|
869
|
+
* Body param: HTTPS URL to the avatar image to download
|
|
117
870
|
*/
|
|
118
871
|
url: string;
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Header param: Generate one unique value for each intended write. Reuse it only
|
|
875
|
+
* when retrying the exact same account, action, target, and payload. A reused key
|
|
876
|
+
* returns the original action. Reusing it with different input returns 409. Replay
|
|
877
|
+
* protection remains active for at least 90 days.
|
|
878
|
+
*/
|
|
879
|
+
'Idempotency-Key': string;
|
|
119
880
|
}
|
|
120
881
|
|
|
121
882
|
export interface ProfileUpdateBannerParams {
|
|
122
883
|
/**
|
|
123
|
-
* X account (@username or ID) receiving banner from URL
|
|
884
|
+
* Body param: X account (@username or ID) receiving banner from URL
|
|
124
885
|
*/
|
|
125
886
|
account: string;
|
|
126
887
|
|
|
127
888
|
/**
|
|
128
|
-
* HTTPS URL to the banner image to download
|
|
889
|
+
* Body param: HTTPS URL to the banner image to download
|
|
129
890
|
*/
|
|
130
891
|
url: string;
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Header param: Generate one unique value for each intended write. Reuse it only
|
|
895
|
+
* when retrying the exact same account, action, target, and payload. A reused key
|
|
896
|
+
* returns the original action. Reusing it with different input returns 409. Replay
|
|
897
|
+
* protection remains active for at least 90 days.
|
|
898
|
+
*/
|
|
899
|
+
'Idempotency-Key': string;
|
|
131
900
|
}
|
|
132
901
|
|
|
133
902
|
export declare namespace Profile {
|