x-twitter-scraper 0.4.1 → 0.5.1

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 (171) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -0
  3. package/client.d.mts +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.js +1 -1
  6. package/client.mjs +1 -1
  7. package/package.json +1 -1
  8. package/resources/account.d.mts +2 -2
  9. package/resources/account.d.ts +2 -2
  10. package/resources/compose.d.mts +186 -65
  11. package/resources/compose.d.mts.map +1 -1
  12. package/resources/compose.d.ts +186 -65
  13. package/resources/compose.d.ts.map +1 -1
  14. package/resources/compose.js +5 -2
  15. package/resources/compose.js.map +1 -1
  16. package/resources/compose.mjs +5 -2
  17. package/resources/compose.mjs.map +1 -1
  18. package/resources/credits.d.mts +1 -1
  19. package/resources/credits.d.ts +1 -1
  20. package/resources/extractions.d.mts +4 -4
  21. package/resources/extractions.d.ts +4 -4
  22. package/resources/guest-wallets.d.mts +2 -2
  23. package/resources/guest-wallets.d.ts +2 -2
  24. package/resources/monitors/keywords.d.mts +4 -4
  25. package/resources/monitors/keywords.d.ts +4 -4
  26. package/resources/monitors/keywords.js +4 -4
  27. package/resources/monitors/keywords.mjs +4 -4
  28. package/resources/monitors/monitors.d.mts +5 -4
  29. package/resources/monitors/monitors.d.mts.map +1 -1
  30. package/resources/monitors/monitors.d.ts +5 -4
  31. package/resources/monitors/monitors.d.ts.map +1 -1
  32. package/resources/monitors/monitors.js +5 -4
  33. package/resources/monitors/monitors.js.map +1 -1
  34. package/resources/monitors/monitors.mjs +5 -4
  35. package/resources/monitors/monitors.mjs.map +1 -1
  36. package/resources/shared.d.mts +24 -8
  37. package/resources/shared.d.mts.map +1 -1
  38. package/resources/shared.d.ts +24 -8
  39. package/resources/shared.d.ts.map +1 -1
  40. package/resources/support/tickets.d.mts +67 -4
  41. package/resources/support/tickets.d.mts.map +1 -1
  42. package/resources/support/tickets.d.ts +67 -4
  43. package/resources/support/tickets.d.ts.map +1 -1
  44. package/resources/support/tickets.js +22 -4
  45. package/resources/support/tickets.js.map +1 -1
  46. package/resources/support/tickets.mjs +22 -4
  47. package/resources/support/tickets.mjs.map +1 -1
  48. package/resources/x/account-connection-challenges.d.mts +1 -1
  49. package/resources/x/account-connection-challenges.d.ts +1 -1
  50. package/resources/x/account-connection-challenges.js +1 -1
  51. package/resources/x/account-connection-challenges.mjs +1 -1
  52. package/resources/x/accounts.d.mts +9 -6
  53. package/resources/x/accounts.d.mts.map +1 -1
  54. package/resources/x/accounts.d.ts +9 -6
  55. package/resources/x/accounts.d.ts.map +1 -1
  56. package/resources/x/accounts.js +4 -2
  57. package/resources/x/accounts.js.map +1 -1
  58. package/resources/x/accounts.mjs +4 -2
  59. package/resources/x/accounts.mjs.map +1 -1
  60. package/resources/x/communities/communities.d.mts +360 -10
  61. package/resources/x/communities/communities.d.mts.map +1 -1
  62. package/resources/x/communities/communities.d.ts +360 -10
  63. package/resources/x/communities/communities.d.ts.map +1 -1
  64. package/resources/x/communities/communities.js +17 -4
  65. package/resources/x/communities/communities.js.map +1 -1
  66. package/resources/x/communities/communities.mjs +17 -4
  67. package/resources/x/communities/communities.mjs.map +1 -1
  68. package/resources/x/communities/join.d.mts +361 -7
  69. package/resources/x/communities/join.d.mts.map +1 -1
  70. package/resources/x/communities/join.d.ts +361 -7
  71. package/resources/x/communities/join.d.ts.map +1 -1
  72. package/resources/x/communities/join.js +20 -5
  73. package/resources/x/communities/join.js.map +1 -1
  74. package/resources/x/communities/join.mjs +20 -5
  75. package/resources/x/communities/join.mjs.map +1 -1
  76. package/resources/x/dm.d.mts +183 -5
  77. package/resources/x/dm.d.mts.map +1 -1
  78. package/resources/x/dm.d.ts +183 -5
  79. package/resources/x/dm.d.ts.map +1 -1
  80. package/resources/x/dm.js +9 -2
  81. package/resources/x/dm.js.map +1 -1
  82. package/resources/x/dm.mjs +9 -2
  83. package/resources/x/dm.mjs.map +1 -1
  84. package/resources/x/media.d.mts +178 -10
  85. package/resources/x/media.d.mts.map +1 -1
  86. package/resources/x/media.d.ts +178 -10
  87. package/resources/x/media.d.ts.map +1 -1
  88. package/resources/x/media.js +9 -5
  89. package/resources/x/media.js.map +1 -1
  90. package/resources/x/media.mjs +9 -5
  91. package/resources/x/media.mjs.map +1 -1
  92. package/resources/x/profile.d.mts +545 -14
  93. package/resources/x/profile.d.mts.map +1 -1
  94. package/resources/x/profile.d.ts +545 -14
  95. package/resources/x/profile.d.ts.map +1 -1
  96. package/resources/x/profile.js +25 -6
  97. package/resources/x/profile.js.map +1 -1
  98. package/resources/x/profile.mjs +25 -6
  99. package/resources/x/profile.mjs.map +1 -1
  100. package/resources/x/tweets/like.d.mts +358 -6
  101. package/resources/x/tweets/like.d.mts.map +1 -1
  102. package/resources/x/tweets/like.d.ts +358 -6
  103. package/resources/x/tweets/like.d.ts.map +1 -1
  104. package/resources/x/tweets/like.js +17 -4
  105. package/resources/x/tweets/like.js.map +1 -1
  106. package/resources/x/tweets/like.mjs +17 -4
  107. package/resources/x/tweets/like.mjs.map +1 -1
  108. package/resources/x/tweets/retweet.d.mts +358 -6
  109. package/resources/x/tweets/retweet.d.mts.map +1 -1
  110. package/resources/x/tweets/retweet.d.ts +358 -6
  111. package/resources/x/tweets/retweet.d.ts.map +1 -1
  112. package/resources/x/tweets/retweet.js +17 -4
  113. package/resources/x/tweets/retweet.js.map +1 -1
  114. package/resources/x/tweets/retweet.mjs +17 -4
  115. package/resources/x/tweets/retweet.mjs.map +1 -1
  116. package/resources/x/tweets/tweets.d.mts +376 -18
  117. package/resources/x/tweets/tweets.d.mts.map +1 -1
  118. package/resources/x/tweets/tweets.d.ts +376 -18
  119. package/resources/x/tweets/tweets.d.ts.map +1 -1
  120. package/resources/x/tweets/tweets.js +25 -6
  121. package/resources/x/tweets/tweets.js.map +1 -1
  122. package/resources/x/tweets/tweets.mjs +25 -6
  123. package/resources/x/tweets/tweets.mjs.map +1 -1
  124. package/resources/x/users/follow.d.mts +361 -7
  125. package/resources/x/users/follow.d.mts.map +1 -1
  126. package/resources/x/users/follow.d.ts +361 -7
  127. package/resources/x/users/follow.d.ts.map +1 -1
  128. package/resources/x/users/follow.js +20 -5
  129. package/resources/x/users/follow.js.map +1 -1
  130. package/resources/x/users/follow.mjs +20 -5
  131. package/resources/x/users/follow.mjs.map +1 -1
  132. package/resources/x/users/users.d.mts +181 -5
  133. package/resources/x/users/users.d.mts.map +1 -1
  134. package/resources/x/users/users.d.ts +181 -5
  135. package/resources/x/users/users.d.ts.map +1 -1
  136. package/resources/x/users/users.js +9 -2
  137. package/resources/x/users/users.js.map +1 -1
  138. package/resources/x/users/users.mjs +9 -2
  139. package/resources/x/users/users.mjs.map +1 -1
  140. package/resources/x/write-actions.d.mts +155 -12
  141. package/resources/x/write-actions.d.mts.map +1 -1
  142. package/resources/x/write-actions.d.ts +155 -12
  143. package/resources/x/write-actions.d.ts.map +1 -1
  144. package/src/client.ts +1 -1
  145. package/src/resources/account.ts +2 -2
  146. package/src/resources/compose.ts +232 -65
  147. package/src/resources/credits.ts +1 -1
  148. package/src/resources/extractions.ts +4 -4
  149. package/src/resources/guest-wallets.ts +2 -2
  150. package/src/resources/monitors/keywords.ts +4 -4
  151. package/src/resources/monitors/monitors.ts +5 -4
  152. package/src/resources/shared.ts +93 -9
  153. package/src/resources/support/tickets.ts +122 -6
  154. package/src/resources/x/account-connection-challenges.ts +1 -1
  155. package/src/resources/x/accounts.ts +9 -6
  156. package/src/resources/x/communities/communities.ts +515 -12
  157. package/src/resources/x/communities/join.ts +518 -9
  158. package/src/resources/x/dm.ts +261 -6
  159. package/src/resources/x/media.ts +258 -11
  160. package/src/resources/x/profile.ts +786 -17
  161. package/src/resources/x/tweets/like.ts +515 -8
  162. package/src/resources/x/tweets/retweet.ts +523 -8
  163. package/src/resources/x/tweets/tweets.ts +529 -23
  164. package/src/resources/x/users/follow.ts +518 -9
  165. package/src/resources/x/users/users.ts +260 -6
  166. package/src/resources/x/write-actions.ts +207 -14
  167. package/src/version.ts +1 -1
  168. package/version.d.mts +1 -1
  169. package/version.d.ts +1 -1
  170. package/version.js +1 -1
  171. 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 { path } from '../../../internal/utils/path';
7
8
 
@@ -16,11 +17,17 @@ export class Like extends APIResource {
16
17
  * ```ts
17
18
  * const like = await client.x.tweets.like.create('id', {
18
19
  * account: '@elonmusk',
20
+ * 'Idempotency-Key': 'Idempotency-Key',
19
21
  * });
20
22
  * ```
21
23
  */
22
- create(id: string, body: LikeCreateParams, options?: RequestOptions): APIPromise<LikeCreateResponse> {
23
- return this._client.post(path`/x/tweets/${id}/like`, { body, ...options });
24
+ create(id: string, params: LikeCreateParams, options?: RequestOptions): APIPromise<LikeCreateResponse> {
25
+ const { 'Idempotency-Key': idempotencyKey, ...body } = params;
26
+ return this._client.post(path`/x/tweets/${id}/like`, {
27
+ body,
28
+ ...options,
29
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
30
+ });
24
31
  }
25
32
 
26
33
  /**
@@ -30,34 +37,534 @@ export class Like extends APIResource {
30
37
  * ```ts
31
38
  * const like = await client.x.tweets.like.delete('id', {
32
39
  * account: '@elonmusk',
40
+ * 'Idempotency-Key': 'Idempotency-Key',
33
41
  * });
34
42
  * ```
35
43
  */
36
- delete(id: string, body: LikeDeleteParams, options?: RequestOptions): APIPromise<LikeDeleteResponse> {
37
- return this._client.delete(path`/x/tweets/${id}/like`, { body, ...options });
44
+ delete(id: string, params: LikeDeleteParams, options?: RequestOptions): APIPromise<LikeDeleteResponse> {
45
+ const { 'Idempotency-Key': idempotencyKey, ...body } = params;
46
+ return this._client.delete(path`/x/tweets/${id}/like`, {
47
+ body,
48
+ ...options,
49
+ headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
50
+ });
38
51
  }
39
52
  }
40
53
 
54
+ /**
55
+ * Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing
56
+ * the original Idempotency-Key returns this same record. Submit a new write only
57
+ * when safeToRetry is true, using a new key.
58
+ */
41
59
  export interface LikeCreateResponse {
42
- success: true;
60
+ id: string;
61
+
62
+ /**
63
+ * Connected account selected for the write.
64
+ */
65
+ account: LikeCreateResponse.Account | null;
66
+
67
+ action:
68
+ | 'create_tweet'
69
+ | 'delete_tweet'
70
+ | 'like'
71
+ | 'unlike'
72
+ | 'retweet'
73
+ | 'unretweet'
74
+ | 'follow'
75
+ | 'unfollow'
76
+ | 'remove_follower'
77
+ | 'send_dm'
78
+ | 'upload_media'
79
+ | 'update_profile'
80
+ | 'update_avatar'
81
+ | 'update_banner'
82
+ | 'create_community'
83
+ | 'delete_community'
84
+ | 'join_community'
85
+ | 'leave_community';
86
+
87
+ /**
88
+ * plannedCredits is the approved maximum. chargedCredits comes from the settled
89
+ * credit ledger. Pending or failed writes are not charged.
90
+ */
91
+ billing: LikeCreateResponse.Billing;
92
+
93
+ charged: boolean;
94
+
95
+ chargedCredits: string;
96
+
97
+ /**
98
+ * Exact follow-up an API client or agent should perform.
99
+ */
100
+ nextAction: LikeCreateResponse.NextAction | null;
101
+
102
+ object: 'x_write_action';
103
+
104
+ pollAfterMs: number | null;
105
+
106
+ /**
107
+ * Stable fingerprint and sanitized payload for replay checks.
108
+ */
109
+ request: LikeCreateResponse.Request;
110
+
111
+ /**
112
+ * Confirmed result produced by the write, when available.
113
+ */
114
+ result: LikeCreateResponse.Result | null;
115
+
116
+ /**
117
+ * True only when a new attempt can reasonably succeed.
118
+ */
119
+ retryable: boolean;
120
+
121
+ /**
122
+ * True only when no write was dispatched and a new idempotency key may be used.
123
+ */
124
+ safeToRetry: boolean;
125
+
126
+ sendDispatched: boolean;
127
+
128
+ status: 'accepted' | 'dispatching' | 'pending_confirmation' | 'success' | 'failed' | 'expired';
129
+
130
+ statusUrl: string;
131
+
132
+ success: boolean;
133
+
134
+ /**
135
+ * Existing X resource targeted by the write, when applicable.
136
+ */
137
+ target: LikeCreateResponse.Target | null;
138
+
139
+ targetId: string | null;
140
+
141
+ terminal: boolean;
142
+
143
+ writeActionId: string;
144
+
145
+ /**
146
+ * Compatibility field for a confirmed community ID.
147
+ */
148
+ communityId?: string;
149
+
150
+ /**
151
+ * Confirmed community name when available.
152
+ */
153
+ communityName?: string;
154
+
155
+ completedAt?: string;
156
+
157
+ confirmationAttempts?: number;
158
+
159
+ confirmationCheckedAt?: string;
160
+
161
+ confirmedAt?: string;
162
+
163
+ createdAt?: string;
164
+
165
+ /**
166
+ * Structured recovery context for a failed write.
167
+ */
168
+ details?: { [key: string]: unknown };
169
+
170
+ error?: string;
171
+
172
+ /**
173
+ * Deadline for resolving a non-terminal write. This is not the Idempotency-Key
174
+ * retention deadline.
175
+ */
176
+ expiresAt?: string;
177
+
178
+ idempotent?: boolean;
179
+
180
+ /**
181
+ * Media count, kind, size, and billing details when used.
182
+ */
183
+ media?: { [key: string]: unknown };
184
+
185
+ /**
186
+ * Compatibility field for a confirmed media upload ID.
187
+ */
188
+ mediaId?: string;
189
+
190
+ /**
191
+ * Public media URL when the upload creates one.
192
+ */
193
+ mediaUrl?: string;
194
+
195
+ message?: string;
196
+
197
+ /**
198
+ * Compatibility field for a confirmed direct message ID.
199
+ */
200
+ messageId?: string;
201
+
202
+ requestHash?: string;
203
+
204
+ requestId?: string;
205
+
206
+ /**
207
+ * Compatibility result ID for other write actions.
208
+ */
209
+ resultId?: string;
210
+
211
+ /**
212
+ * Dispatch timestamp when the write reached execution.
213
+ */
214
+ sendDispatchedAt?: string;
215
+
216
+ /**
217
+ * Compatibility field for a confirmed tweet result ID.
218
+ */
219
+ tweetId?: string;
220
+
221
+ updatedAt?: string;
222
+ }
223
+
224
+ export namespace LikeCreateResponse {
225
+ /**
226
+ * Connected account selected for the write.
227
+ */
228
+ export interface Account {
229
+ id: string;
230
+
231
+ username: string;
232
+ }
233
+
234
+ /**
235
+ * plannedCredits is the approved maximum. chargedCredits comes from the settled
236
+ * credit ledger. Pending or failed writes are not charged.
237
+ */
238
+ export interface Billing {
239
+ charged: boolean;
240
+
241
+ chargedCredits: string;
242
+
243
+ plannedCredits: string;
244
+
245
+ status: 'not_charged' | 'pending' | 'charged' | 'charge_failed' | 'refunded';
246
+ }
247
+
248
+ /**
249
+ * Exact follow-up an API client or agent should perform.
250
+ */
251
+ export interface NextAction {
252
+ type: 'poll' | 'retry' | 'verify_result' | 'fix_request';
253
+
254
+ afterMs?: number;
255
+
256
+ requiresNewIdempotencyKey?: boolean;
257
+
258
+ url?: string;
259
+ }
260
+
261
+ /**
262
+ * Stable fingerprint and sanitized payload for replay checks.
263
+ */
264
+ export interface Request {
265
+ /**
266
+ * Stable hash of account, action, target, and payload.
267
+ */
268
+ hash: string | null;
269
+
270
+ /**
271
+ * Exact sanitized payload dispatched for this action.
272
+ */
273
+ payload: { [key: string]: unknown } | null;
274
+ }
275
+
276
+ /**
277
+ * Confirmed result produced by the write, when available.
278
+ */
279
+ export interface Result {
280
+ id?: string;
281
+
282
+ state?: string;
283
+
284
+ type?: 'tweet' | 'direct_message' | 'media' | 'community' | 'state_change';
285
+ }
286
+
287
+ /**
288
+ * Existing X resource targeted by the write, when applicable.
289
+ */
290
+ export interface Target {
291
+ id: string;
292
+
293
+ type: 'tweet' | 'user' | 'community';
294
+ }
43
295
  }
44
296
 
297
+ /**
298
+ * Durable write lifecycle record. Poll statusUrl until terminal is true. Reusing
299
+ * the original Idempotency-Key returns this same record. Submit a new write only
300
+ * when safeToRetry is true, using a new key.
301
+ */
45
302
  export interface LikeDeleteResponse {
46
- success: true;
303
+ id: string;
304
+
305
+ /**
306
+ * Connected account selected for the write.
307
+ */
308
+ account: LikeDeleteResponse.Account | null;
309
+
310
+ action:
311
+ | 'create_tweet'
312
+ | 'delete_tweet'
313
+ | 'like'
314
+ | 'unlike'
315
+ | 'retweet'
316
+ | 'unretweet'
317
+ | 'follow'
318
+ | 'unfollow'
319
+ | 'remove_follower'
320
+ | 'send_dm'
321
+ | 'upload_media'
322
+ | 'update_profile'
323
+ | 'update_avatar'
324
+ | 'update_banner'
325
+ | 'create_community'
326
+ | 'delete_community'
327
+ | 'join_community'
328
+ | 'leave_community';
329
+
330
+ /**
331
+ * plannedCredits is the approved maximum. chargedCredits comes from the settled
332
+ * credit ledger. Pending or failed writes are not charged.
333
+ */
334
+ billing: LikeDeleteResponse.Billing;
335
+
336
+ charged: boolean;
337
+
338
+ chargedCredits: string;
339
+
340
+ /**
341
+ * Exact follow-up an API client or agent should perform.
342
+ */
343
+ nextAction: LikeDeleteResponse.NextAction | null;
344
+
345
+ object: 'x_write_action';
346
+
347
+ pollAfterMs: number | null;
348
+
349
+ /**
350
+ * Stable fingerprint and sanitized payload for replay checks.
351
+ */
352
+ request: LikeDeleteResponse.Request;
353
+
354
+ /**
355
+ * Confirmed result produced by the write, when available.
356
+ */
357
+ result: LikeDeleteResponse.Result | null;
358
+
359
+ /**
360
+ * True only when a new attempt can reasonably succeed.
361
+ */
362
+ retryable: boolean;
363
+
364
+ /**
365
+ * True only when no write was dispatched and a new idempotency key may be used.
366
+ */
367
+ safeToRetry: boolean;
368
+
369
+ sendDispatched: boolean;
370
+
371
+ status: 'accepted' | 'dispatching' | 'pending_confirmation' | 'success' | 'failed' | 'expired';
372
+
373
+ statusUrl: string;
374
+
375
+ success: boolean;
376
+
377
+ /**
378
+ * Existing X resource targeted by the write, when applicable.
379
+ */
380
+ target: LikeDeleteResponse.Target | null;
381
+
382
+ targetId: string | null;
383
+
384
+ terminal: boolean;
385
+
386
+ writeActionId: string;
387
+
388
+ /**
389
+ * Compatibility field for a confirmed community ID.
390
+ */
391
+ communityId?: string;
392
+
393
+ /**
394
+ * Confirmed community name when available.
395
+ */
396
+ communityName?: string;
397
+
398
+ completedAt?: string;
399
+
400
+ confirmationAttempts?: number;
401
+
402
+ confirmationCheckedAt?: string;
403
+
404
+ confirmedAt?: string;
405
+
406
+ createdAt?: string;
407
+
408
+ /**
409
+ * Structured recovery context for a failed write.
410
+ */
411
+ details?: { [key: string]: unknown };
412
+
413
+ error?: string;
414
+
415
+ /**
416
+ * Deadline for resolving a non-terminal write. This is not the Idempotency-Key
417
+ * retention deadline.
418
+ */
419
+ expiresAt?: string;
420
+
421
+ idempotent?: boolean;
422
+
423
+ /**
424
+ * Media count, kind, size, and billing details when used.
425
+ */
426
+ media?: { [key: string]: unknown };
427
+
428
+ /**
429
+ * Compatibility field for a confirmed media upload ID.
430
+ */
431
+ mediaId?: string;
432
+
433
+ /**
434
+ * Public media URL when the upload creates one.
435
+ */
436
+ mediaUrl?: string;
437
+
438
+ message?: string;
439
+
440
+ /**
441
+ * Compatibility field for a confirmed direct message ID.
442
+ */
443
+ messageId?: string;
444
+
445
+ requestHash?: string;
446
+
447
+ requestId?: string;
448
+
449
+ /**
450
+ * Compatibility result ID for other write actions.
451
+ */
452
+ resultId?: string;
453
+
454
+ /**
455
+ * Dispatch timestamp when the write reached execution.
456
+ */
457
+ sendDispatchedAt?: string;
458
+
459
+ /**
460
+ * Compatibility field for a confirmed tweet result ID.
461
+ */
462
+ tweetId?: string;
463
+
464
+ updatedAt?: string;
465
+ }
466
+
467
+ export namespace LikeDeleteResponse {
468
+ /**
469
+ * Connected account selected for the write.
470
+ */
471
+ export interface Account {
472
+ id: string;
473
+
474
+ username: string;
475
+ }
476
+
477
+ /**
478
+ * plannedCredits is the approved maximum. chargedCredits comes from the settled
479
+ * credit ledger. Pending or failed writes are not charged.
480
+ */
481
+ export interface Billing {
482
+ charged: boolean;
483
+
484
+ chargedCredits: string;
485
+
486
+ plannedCredits: string;
487
+
488
+ status: 'not_charged' | 'pending' | 'charged' | 'charge_failed' | 'refunded';
489
+ }
490
+
491
+ /**
492
+ * Exact follow-up an API client or agent should perform.
493
+ */
494
+ export interface NextAction {
495
+ type: 'poll' | 'retry' | 'verify_result' | 'fix_request';
496
+
497
+ afterMs?: number;
498
+
499
+ requiresNewIdempotencyKey?: boolean;
500
+
501
+ url?: string;
502
+ }
503
+
504
+ /**
505
+ * Stable fingerprint and sanitized payload for replay checks.
506
+ */
507
+ export interface Request {
508
+ /**
509
+ * Stable hash of account, action, target, and payload.
510
+ */
511
+ hash: string | null;
512
+
513
+ /**
514
+ * Exact sanitized payload dispatched for this action.
515
+ */
516
+ payload: { [key: string]: unknown } | null;
517
+ }
518
+
519
+ /**
520
+ * Confirmed result produced by the write, when available.
521
+ */
522
+ export interface Result {
523
+ id?: string;
524
+
525
+ state?: string;
526
+
527
+ type?: 'tweet' | 'direct_message' | 'media' | 'community' | 'state_change';
528
+ }
529
+
530
+ /**
531
+ * Existing X resource targeted by the write, when applicable.
532
+ */
533
+ export interface Target {
534
+ id: string;
535
+
536
+ type: 'tweet' | 'user' | 'community';
537
+ }
47
538
  }
48
539
 
49
540
  export interface LikeCreateParams {
50
541
  /**
51
- * X account identifier (@username or account ID)
542
+ * Body param: X account identifier (@username or account ID)
52
543
  */
53
544
  account: string;
545
+
546
+ /**
547
+ * Header param: Generate one unique value for each intended write. Reuse it only
548
+ * when retrying the exact same account, action, target, and payload. A reused key
549
+ * returns the original action. Reusing it with different input returns 409. Replay
550
+ * protection remains active for at least 90 days.
551
+ */
552
+ 'Idempotency-Key': string;
54
553
  }
55
554
 
56
555
  export interface LikeDeleteParams {
57
556
  /**
58
- * X account identifier (@username or account ID)
557
+ * Body param: X account identifier (@username or account ID)
59
558
  */
60
559
  account: string;
560
+
561
+ /**
562
+ * Header param: Generate one unique value for each intended write. Reuse it only
563
+ * when retrying the exact same account, action, target, and payload. A reused key
564
+ * returns the original action. Reusing it with different input returns 409. Replay
565
+ * protection remains active for at least 90 days.
566
+ */
567
+ 'Idempotency-Key': string;
61
568
  }
62
569
 
63
570
  export declare namespace Like {