x-twitter-scraper 0.13.2 → 0.14.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 (198) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +78 -37
  3. package/client.d.mts +3 -15
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +3 -15
  6. package/client.d.ts.map +1 -1
  7. package/client.js +4 -50
  8. package/client.js.map +1 -1
  9. package/client.mjs +4 -50
  10. package/client.mjs.map +1 -1
  11. package/core/api-promise.d.mts +0 -8
  12. package/core/api-promise.d.mts.map +1 -1
  13. package/core/api-promise.d.ts +0 -8
  14. package/core/api-promise.d.ts.map +1 -1
  15. package/core/api-promise.js +0 -11
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs +0 -11
  18. package/core/api-promise.mjs.map +1 -1
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts.map +1 -1
  21. package/core/error.js +0 -1
  22. package/core/error.js.map +1 -1
  23. package/core/error.mjs +0 -1
  24. package/core/error.mjs.map +1 -1
  25. package/core/streaming.d.mts.map +1 -1
  26. package/core/streaming.d.ts.map +1 -1
  27. package/core/streaming.js +0 -10
  28. package/core/streaming.js.map +1 -1
  29. package/core/streaming.mjs +0 -10
  30. package/core/streaming.mjs.map +1 -1
  31. package/internal/builtin-types.d.mts +0 -41
  32. package/internal/builtin-types.d.mts.map +1 -1
  33. package/internal/builtin-types.d.ts +0 -41
  34. package/internal/builtin-types.d.ts.map +1 -1
  35. package/internal/decoders/line.d.mts.map +1 -1
  36. package/internal/decoders/line.d.ts.map +1 -1
  37. package/internal/decoders/line.js +4 -21
  38. package/internal/decoders/line.js.map +1 -1
  39. package/internal/decoders/line.mjs +4 -21
  40. package/internal/decoders/line.mjs.map +1 -1
  41. package/internal/detect-platform.d.mts.map +1 -1
  42. package/internal/detect-platform.d.ts.map +1 -1
  43. package/internal/detect-platform.js +0 -20
  44. package/internal/detect-platform.js.map +1 -1
  45. package/internal/detect-platform.mjs +0 -20
  46. package/internal/detect-platform.mjs.map +1 -1
  47. package/internal/errors.d.mts.map +1 -1
  48. package/internal/errors.d.ts.map +1 -1
  49. package/internal/errors.js +0 -2
  50. package/internal/errors.js.map +1 -1
  51. package/internal/errors.mjs +0 -2
  52. package/internal/errors.mjs.map +1 -1
  53. package/internal/headers.d.mts +0 -8
  54. package/internal/headers.d.mts.map +1 -1
  55. package/internal/headers.d.ts +0 -8
  56. package/internal/headers.d.ts.map +1 -1
  57. package/internal/headers.js +0 -2
  58. package/internal/headers.js.map +1 -1
  59. package/internal/headers.mjs +0 -2
  60. package/internal/headers.mjs.map +1 -1
  61. package/internal/parse.d.mts.map +1 -1
  62. package/internal/parse.d.ts.map +1 -1
  63. package/internal/parse.js +0 -4
  64. package/internal/parse.js.map +1 -1
  65. package/internal/parse.mjs +0 -4
  66. package/internal/parse.mjs.map +1 -1
  67. package/internal/shim-types.d.mts +0 -6
  68. package/internal/shim-types.d.mts.map +1 -1
  69. package/internal/shim-types.d.ts +0 -6
  70. package/internal/shim-types.d.ts.map +1 -1
  71. package/internal/shims.d.mts +0 -9
  72. package/internal/shims.d.mts.map +1 -1
  73. package/internal/shims.d.ts +0 -9
  74. package/internal/shims.d.ts.map +1 -1
  75. package/internal/shims.js +2 -7
  76. package/internal/shims.js.map +1 -1
  77. package/internal/shims.mjs +2 -7
  78. package/internal/shims.mjs.map +1 -1
  79. package/internal/to-file.d.mts +0 -16
  80. package/internal/to-file.d.mts.map +1 -1
  81. package/internal/to-file.d.ts +0 -16
  82. package/internal/to-file.d.ts.map +1 -1
  83. package/internal/to-file.js +3 -14
  84. package/internal/to-file.js.map +1 -1
  85. package/internal/to-file.mjs +3 -14
  86. package/internal/to-file.mjs.map +1 -1
  87. package/internal/types.d.mts +1 -32
  88. package/internal/types.d.mts.map +1 -1
  89. package/internal/types.d.ts +1 -32
  90. package/internal/types.d.ts.map +1 -1
  91. package/internal/uploads.d.mts +0 -8
  92. package/internal/uploads.d.mts.map +1 -1
  93. package/internal/uploads.d.ts +0 -8
  94. package/internal/uploads.d.ts.map +1 -1
  95. package/internal/uploads.js +0 -18
  96. package/internal/uploads.js.map +1 -1
  97. package/internal/uploads.mjs +0 -18
  98. package/internal/uploads.mjs.map +1 -1
  99. package/internal/utils/env.d.mts +0 -7
  100. package/internal/utils/env.d.mts.map +1 -1
  101. package/internal/utils/env.d.ts +0 -7
  102. package/internal/utils/env.d.ts.map +1 -1
  103. package/internal/utils/env.js +0 -7
  104. package/internal/utils/env.js.map +1 -1
  105. package/internal/utils/env.mjs +0 -7
  106. package/internal/utils/env.mjs.map +1 -1
  107. package/internal/utils/log.d.mts.map +1 -1
  108. package/internal/utils/log.d.ts.map +1 -1
  109. package/internal/utils/log.js +1 -2
  110. package/internal/utils/log.js.map +1 -1
  111. package/internal/utils/log.mjs +1 -2
  112. package/internal/utils/log.mjs.map +1 -1
  113. package/internal/utils/path.d.mts +0 -3
  114. package/internal/utils/path.d.mts.map +1 -1
  115. package/internal/utils/path.d.ts +0 -3
  116. package/internal/utils/path.d.ts.map +1 -1
  117. package/internal/utils/path.js +0 -6
  118. package/internal/utils/path.js.map +1 -1
  119. package/internal/utils/path.mjs +0 -6
  120. package/internal/utils/path.mjs.map +1 -1
  121. package/internal/utils/query.d.mts +0 -3
  122. package/internal/utils/query.d.mts.map +1 -1
  123. package/internal/utils/query.d.ts +0 -3
  124. package/internal/utils/query.d.ts.map +1 -1
  125. package/internal/utils/query.js +0 -3
  126. package/internal/utils/query.js.map +1 -1
  127. package/internal/utils/query.mjs +0 -3
  128. package/internal/utils/query.mjs.map +1 -1
  129. package/internal/utils/values.d.mts +0 -1
  130. package/internal/utils/values.d.mts.map +1 -1
  131. package/internal/utils/values.d.ts +0 -1
  132. package/internal/utils/values.d.ts.map +1 -1
  133. package/internal/utils/values.js +0 -3
  134. package/internal/utils/values.js.map +1 -1
  135. package/internal/utils/values.mjs +0 -3
  136. package/internal/utils/values.mjs.map +1 -1
  137. package/package.json +2 -2
  138. package/resources/index.d.mts +1 -1
  139. package/resources/index.d.mts.map +1 -1
  140. package/resources/index.d.ts +1 -1
  141. package/resources/index.d.ts.map +1 -1
  142. package/resources/index.js.map +1 -1
  143. package/resources/index.mjs.map +1 -1
  144. package/resources/x/community-notes.d.mts +850 -0
  145. package/resources/x/community-notes.d.mts.map +1 -0
  146. package/resources/x/community-notes.d.ts +850 -0
  147. package/resources/x/community-notes.d.ts.map +1 -0
  148. package/resources/x/community-notes.js +62 -0
  149. package/resources/x/community-notes.js.map +1 -0
  150. package/resources/x/community-notes.mjs +58 -0
  151. package/resources/x/community-notes.mjs.map +1 -0
  152. package/resources/x/index.d.mts +2 -1
  153. package/resources/x/index.d.mts.map +1 -1
  154. package/resources/x/index.d.ts +2 -1
  155. package/resources/x/index.d.ts.map +1 -1
  156. package/resources/x/index.js +3 -1
  157. package/resources/x/index.js.map +1 -1
  158. package/resources/x/index.mjs +1 -0
  159. package/resources/x/index.mjs.map +1 -1
  160. package/resources/x/x.d.mts +255 -1
  161. package/resources/x/x.d.mts.map +1 -1
  162. package/resources/x/x.d.ts +255 -1
  163. package/resources/x/x.d.ts.map +1 -1
  164. package/resources/x/x.js +38 -0
  165. package/resources/x/x.js.map +1 -1
  166. package/resources/x/x.mjs +38 -0
  167. package/resources/x/x.mjs.map +1 -1
  168. package/src/client.ts +12 -52
  169. package/src/core/api-promise.ts +0 -11
  170. package/src/core/error.ts +0 -1
  171. package/src/core/streaming.ts +0 -10
  172. package/src/internal/builtin-types.ts +0 -41
  173. package/src/internal/decoders/line.ts +4 -21
  174. package/src/internal/detect-platform.ts +0 -21
  175. package/src/internal/errors.ts +0 -2
  176. package/src/internal/headers.ts +0 -10
  177. package/src/internal/parse.ts +0 -4
  178. package/src/internal/shim-types.ts +0 -7
  179. package/src/internal/shims.ts +2 -14
  180. package/src/internal/to-file.ts +3 -33
  181. package/src/internal/types.ts +0 -30
  182. package/src/internal/uploads.ts +0 -18
  183. package/src/internal/utils/env.ts +0 -7
  184. package/src/internal/utils/log.ts +1 -2
  185. package/src/internal/utils/path.ts +0 -6
  186. package/src/internal/utils/query.ts +0 -3
  187. package/src/internal/utils/values.ts +0 -3
  188. package/src/resources/index.ts +4 -0
  189. package/src/resources/x/community-notes.ts +1040 -0
  190. package/src/resources/x/index.ts +13 -0
  191. package/src/resources/x/x.ts +335 -0
  192. package/src/version.ts +1 -1
  193. package/version.d.mts +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.js +1 -1
  196. package/version.js.map +1 -1
  197. package/version.mjs +1 -1
  198. package/version.mjs.map +1 -1
@@ -0,0 +1,1040 @@
1
+ // SPDX-FileCopyrightText: 2026 Xquik contributors
2
+ //
3
+ // SPDX-License-Identifier: Apache-2.0
4
+
5
+ import { APIResource } from '../../core/resource';
6
+ import * as Shared from '../shared';
7
+ import { APIPromise } from '../../core/api-promise';
8
+ import { RequestOptions } from '../../internal/request-options';
9
+ import { path } from '../../internal/utils/path';
10
+
11
+ /**
12
+ * Community Notes contributors, their notes, ratings & deleted notes
13
+ */
14
+ export class CommunityNotes extends APIResource {
15
+ /**
16
+ * Returns the notes a contributor deleted, newest first. X keeps each note's ID,
17
+ * times, rating & tags. A notice replaces its text & post. Each note costs 1
18
+ * credit. A contributor who deleted none returns an empty list, free.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * const response =
23
+ * await client.x.communityNotes.listContributorDeletedNotes(
24
+ * 'alias',
25
+ * );
26
+ * ```
27
+ */
28
+ listContributorDeletedNotes(
29
+ alias: string,
30
+ query: CommunityNoteListContributorDeletedNotesParams | null | undefined = {},
31
+ options?: RequestOptions,
32
+ ): APIPromise<CommunityNoteListContributorDeletedNotesResponse> {
33
+ return this._client.get(path`/x/community-notes/contributors/${alias}/deleted-notes`, {
34
+ query,
35
+ ...options,
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Returns a contributor's notes, newest first, each with the post it is on.
41
+ * Includes notes X has not rated helpful, which x.com shows under no post. Each
42
+ * note costs 1 credit. Follow next_cursor for more.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const response =
47
+ * await client.x.communityNotes.listContributorNotes('alias');
48
+ * ```
49
+ */
50
+ listContributorNotes(
51
+ alias: string,
52
+ query: CommunityNoteListContributorNotesParams | null | undefined = {},
53
+ options?: RequestOptions,
54
+ ): APIPromise<CommunityNoteListContributorNotesResponse> {
55
+ return this._client.get(path`/x/community-notes/contributors/${alias}/notes`, { query, ...options });
56
+ }
57
+
58
+ /**
59
+ * Returns 1 Community Notes contributor by the alias X gives them. Includes note
60
+ * counts by rating, rating counts & the deleted notes count. Each lookup costs 1
61
+ * credit.
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * const response =
66
+ * await client.x.communityNotes.retrieveContributor('alias');
67
+ * ```
68
+ */
69
+ retrieveContributor(
70
+ alias: string,
71
+ query: CommunityNoteRetrieveContributorParams | null | undefined = {},
72
+ options?: RequestOptions,
73
+ ): APIPromise<CommunityNoteRetrieveContributorResponse> {
74
+ return this._client.get(path`/x/community-notes/contributors/${alias}`, { query, ...options });
75
+ }
76
+ }
77
+
78
+ /**
79
+ * 1 page of Community Notes. Follow next_cursor while the response reports more
80
+ * pages.
81
+ */
82
+ export interface CommunityNoteListContributorDeletedNotesResponse {
83
+ has_next_page: boolean;
84
+
85
+ next_cursor: string;
86
+
87
+ notes: Array<CommunityNoteListContributorDeletedNotesResponse.Note>;
88
+ }
89
+
90
+ export namespace CommunityNoteListContributorDeletedNotesResponse {
91
+ /**
92
+ * A Community Note as its writer's page lists it, with the post it is on. A deleted
93
+ * note has no text, classification or post. A field X leaves out is left out.
94
+ */
95
+ export interface Note {
96
+ /**
97
+ * Note ID.
98
+ */
99
+ id: string;
100
+
101
+ /**
102
+ * Whether the note scores above X's bar for a possible helpful rating.
103
+ */
104
+ abovePcrhThreshold?: boolean;
105
+
106
+ /**
107
+ * Whether the rating is under appeal.
108
+ */
109
+ appealStatus?: string;
110
+
111
+ /**
112
+ * What the writer says of the post, such as MisinformedOrPotentiallyMisleading or
113
+ * NotMisleading.
114
+ */
115
+ classification?: string;
116
+
117
+ /**
118
+ * The note's writer, with the counts X sends beside a note. GET
119
+ * /x/community-notes/contributors/{alias} serves every count.
120
+ */
121
+ contributor?: Note.Contributor;
122
+
123
+ /**
124
+ * When the contributor wrote the note.
125
+ */
126
+ createdAt?: string;
127
+
128
+ /**
129
+ * The X scoring model that set the rating.
130
+ */
131
+ decidedBy?: string;
132
+
133
+ /**
134
+ * Whether the writer deleted the note.
135
+ */
136
+ deleted?: boolean;
137
+
138
+ /**
139
+ * The link a link note is on, as X shows it.
140
+ */
141
+ displayUrl?: string;
142
+
143
+ /**
144
+ * Links, tags & accounts inside the text, by character range.
145
+ */
146
+ entities?: Array<Note.Entity>;
147
+
148
+ /**
149
+ * Whether X marks that scoring model as fully visible.
150
+ */
151
+ fullyVisibleModel?: boolean;
152
+
153
+ /**
154
+ * Why raters called the note helpful.
155
+ */
156
+ helpfulTags?: Array<string>;
157
+
158
+ /**
159
+ * Views of the note, when X shares them.
160
+ */
161
+ impressionCount?: number;
162
+
163
+ /**
164
+ * Whether the note came through X's API.
165
+ */
166
+ isApiAuthor?: boolean;
167
+
168
+ /**
169
+ * Whether the note is about the post's media. X can show such a note on other
170
+ * posts.
171
+ */
172
+ isMediaNote?: boolean;
173
+
174
+ /**
175
+ * Whether X offers a translation of the note.
176
+ */
177
+ isTranslatable?: boolean;
178
+
179
+ /**
180
+ * Whether the note is on a link.
181
+ */
182
+ isUrlNote?: boolean;
183
+
184
+ /**
185
+ * Language code of the note.
186
+ */
187
+ language?: string;
188
+
189
+ /**
190
+ * Other posts X matched a media note to.
191
+ */
192
+ mediaNoteMatchCount?: number;
193
+
194
+ /**
195
+ * Why raters called the note not helpful.
196
+ */
197
+ notHelpfulTags?: Array<string>;
198
+
199
+ /**
200
+ * The post the note is on. Null when X no longer shows it.
201
+ */
202
+ post?: Shared.SearchTweet | null;
203
+
204
+ /**
205
+ * ID of the post the note is on.
206
+ */
207
+ postId?: string;
208
+
209
+ /**
210
+ * Why X shows no post, when X says.
211
+ */
212
+ postUnavailable?: Note.PostUnavailable;
213
+
214
+ /**
215
+ * X's current rating, such as NeedsMoreRatings, CurrentlyRatedHelpful or
216
+ * CurrentlyRatedNotHelpful. x.com shows only helpful notes under posts.
217
+ */
218
+ ratingStatus?: string;
219
+
220
+ /**
221
+ * What the note says.
222
+ */
223
+ text?: string;
224
+
225
+ /**
226
+ * Milliseconds from the note's creation to its helpful rating.
227
+ */
228
+ timeToHelpfulFromNoteMs?: number;
229
+
230
+ /**
231
+ * Milliseconds from the post's creation to the note's helpful rating.
232
+ */
233
+ timeToHelpfulFromPostMs?: number;
234
+
235
+ /**
236
+ * X's notice in place of a deleted note.
237
+ */
238
+ tombstone?: string;
239
+ }
240
+
241
+ export namespace Note {
242
+ /**
243
+ * The note's writer, with the counts X sends beside a note. GET
244
+ * /x/community-notes/contributors/{alias} serves every count.
245
+ */
246
+ export interface Contributor {
247
+ /**
248
+ * The alias X gives the contributor.
249
+ */
250
+ alias: string;
251
+
252
+ /**
253
+ * Notes the contributor deleted.
254
+ */
255
+ deletedNotesCount?: number;
256
+
257
+ /**
258
+ * Whether the contributor writes notes through X's API.
259
+ */
260
+ isApiContributor?: boolean;
261
+
262
+ /**
263
+ * Whether X marks the contributor as a top writer.
264
+ */
265
+ isTopWriter?: boolean;
266
+
267
+ /**
268
+ * How many notes a contributor wrote, by X's current rating.
269
+ */
270
+ notesCount?: Contributor.NotesCount;
271
+
272
+ /**
273
+ * How a contributor's ratings of other notes went.
274
+ */
275
+ ratingsCount?: Contributor.RatingsCount;
276
+ }
277
+
278
+ export namespace Contributor {
279
+ /**
280
+ * How many notes a contributor wrote, by X's current rating.
281
+ */
282
+ export interface NotesCount {
283
+ /**
284
+ * Notes that need more ratings.
285
+ */
286
+ awaitingMoreRatings?: number;
287
+
288
+ /**
289
+ * Notes X rates helpful now.
290
+ */
291
+ currentlyRatedHelpful?: number;
292
+
293
+ /**
294
+ * Notes X rates not helpful now.
295
+ */
296
+ currentlyRatedNotHelpful?: number;
297
+
298
+ /**
299
+ * When X last counted the notes.
300
+ */
301
+ updatedAt?: string;
302
+ }
303
+
304
+ /**
305
+ * How a contributor's ratings of other notes went.
306
+ */
307
+ export interface RatingsCount {
308
+ /**
309
+ * Ratings on notes that need more ratings.
310
+ */
311
+ awaitingMoreRatings?: number;
312
+
313
+ /**
314
+ * Ratings made after X rated the note.
315
+ */
316
+ ratedAfterDecision?: number;
317
+
318
+ /**
319
+ * Ratings that matched the rating X gave the note.
320
+ */
321
+ successful?: RatingsCount.Successful;
322
+
323
+ /**
324
+ * Ratings that went against the rating X gave the note.
325
+ */
326
+ unsuccessful?: RatingsCount.Unsuccessful;
327
+
328
+ /**
329
+ * When X last counted the ratings.
330
+ */
331
+ updatedAt?: string;
332
+ }
333
+
334
+ export namespace RatingsCount {
335
+ /**
336
+ * Ratings that matched the rating X gave the note.
337
+ */
338
+ export interface Successful {
339
+ /**
340
+ * Ratings that called a note helpful.
341
+ */
342
+ helpfulCount?: number;
343
+
344
+ /**
345
+ * Ratings that called a note not helpful.
346
+ */
347
+ notHelpfulCount?: number;
348
+
349
+ /**
350
+ * All ratings in the group, when X sends the sum.
351
+ */
352
+ total?: number;
353
+ }
354
+
355
+ /**
356
+ * Ratings that went against the rating X gave the note.
357
+ */
358
+ export interface Unsuccessful {
359
+ /**
360
+ * Ratings that called a note helpful.
361
+ */
362
+ helpfulCount?: number;
363
+
364
+ /**
365
+ * Ratings that called a note not helpful.
366
+ */
367
+ notHelpfulCount?: number;
368
+
369
+ /**
370
+ * All ratings in the group, when X sends the sum.
371
+ */
372
+ total?: number;
373
+ }
374
+ }
375
+ }
376
+
377
+ /**
378
+ * A link, tag or account inside a note's text.
379
+ */
380
+ export interface Entity {
381
+ /**
382
+ * Where it starts in the text.
383
+ */
384
+ fromIndex?: number;
385
+
386
+ /**
387
+ * What it points at.
388
+ */
389
+ ref?: Entity.Ref;
390
+
391
+ /**
392
+ * Where it ends in the text.
393
+ */
394
+ toIndex?: number;
395
+ }
396
+
397
+ export namespace Entity {
398
+ /**
399
+ * What it points at.
400
+ */
401
+ export interface Ref {
402
+ /**
403
+ * A mentioned account's username.
404
+ */
405
+ screenName?: string;
406
+
407
+ /**
408
+ * A hashtag's or cashtag's text.
409
+ */
410
+ text?: string;
411
+
412
+ /**
413
+ * X's kind, such as TimelineUrl.
414
+ */
415
+ type?: string;
416
+
417
+ /**
418
+ * The link.
419
+ */
420
+ url?: string;
421
+
422
+ /**
423
+ * How X opens the link, such as ExternalUrl.
424
+ */
425
+ urlType?: string;
426
+ }
427
+ }
428
+
429
+ /**
430
+ * Why X shows no post, when X says.
431
+ */
432
+ export interface PostUnavailable {
433
+ /**
434
+ * Why X shows no post, as X names it.
435
+ */
436
+ reason: string;
437
+ }
438
+ }
439
+ }
440
+
441
+ /**
442
+ * 1 page of Community Notes. Follow next_cursor while the response reports more
443
+ * pages.
444
+ */
445
+ export interface CommunityNoteListContributorNotesResponse {
446
+ has_next_page: boolean;
447
+
448
+ next_cursor: string;
449
+
450
+ notes: Array<CommunityNoteListContributorNotesResponse.Note>;
451
+ }
452
+
453
+ export namespace CommunityNoteListContributorNotesResponse {
454
+ /**
455
+ * A Community Note as its writer's page lists it, with the post it is on. A deleted
456
+ * note has no text, classification or post. A field X leaves out is left out.
457
+ */
458
+ export interface Note {
459
+ /**
460
+ * Note ID.
461
+ */
462
+ id: string;
463
+
464
+ /**
465
+ * Whether the note scores above X's bar for a possible helpful rating.
466
+ */
467
+ abovePcrhThreshold?: boolean;
468
+
469
+ /**
470
+ * Whether the rating is under appeal.
471
+ */
472
+ appealStatus?: string;
473
+
474
+ /**
475
+ * What the writer says of the post, such as MisinformedOrPotentiallyMisleading or
476
+ * NotMisleading.
477
+ */
478
+ classification?: string;
479
+
480
+ /**
481
+ * The note's writer, with the counts X sends beside a note. GET
482
+ * /x/community-notes/contributors/{alias} serves every count.
483
+ */
484
+ contributor?: Note.Contributor;
485
+
486
+ /**
487
+ * When the contributor wrote the note.
488
+ */
489
+ createdAt?: string;
490
+
491
+ /**
492
+ * The X scoring model that set the rating.
493
+ */
494
+ decidedBy?: string;
495
+
496
+ /**
497
+ * Whether the writer deleted the note.
498
+ */
499
+ deleted?: boolean;
500
+
501
+ /**
502
+ * The link a link note is on, as X shows it.
503
+ */
504
+ displayUrl?: string;
505
+
506
+ /**
507
+ * Links, tags & accounts inside the text, by character range.
508
+ */
509
+ entities?: Array<Note.Entity>;
510
+
511
+ /**
512
+ * Whether X marks that scoring model as fully visible.
513
+ */
514
+ fullyVisibleModel?: boolean;
515
+
516
+ /**
517
+ * Why raters called the note helpful.
518
+ */
519
+ helpfulTags?: Array<string>;
520
+
521
+ /**
522
+ * Views of the note, when X shares them.
523
+ */
524
+ impressionCount?: number;
525
+
526
+ /**
527
+ * Whether the note came through X's API.
528
+ */
529
+ isApiAuthor?: boolean;
530
+
531
+ /**
532
+ * Whether the note is about the post's media. X can show such a note on other
533
+ * posts.
534
+ */
535
+ isMediaNote?: boolean;
536
+
537
+ /**
538
+ * Whether X offers a translation of the note.
539
+ */
540
+ isTranslatable?: boolean;
541
+
542
+ /**
543
+ * Whether the note is on a link.
544
+ */
545
+ isUrlNote?: boolean;
546
+
547
+ /**
548
+ * Language code of the note.
549
+ */
550
+ language?: string;
551
+
552
+ /**
553
+ * Other posts X matched a media note to.
554
+ */
555
+ mediaNoteMatchCount?: number;
556
+
557
+ /**
558
+ * Why raters called the note not helpful.
559
+ */
560
+ notHelpfulTags?: Array<string>;
561
+
562
+ /**
563
+ * The post the note is on. Null when X no longer shows it.
564
+ */
565
+ post?: Shared.SearchTweet | null;
566
+
567
+ /**
568
+ * ID of the post the note is on.
569
+ */
570
+ postId?: string;
571
+
572
+ /**
573
+ * Why X shows no post, when X says.
574
+ */
575
+ postUnavailable?: Note.PostUnavailable;
576
+
577
+ /**
578
+ * X's current rating, such as NeedsMoreRatings, CurrentlyRatedHelpful or
579
+ * CurrentlyRatedNotHelpful. x.com shows only helpful notes under posts.
580
+ */
581
+ ratingStatus?: string;
582
+
583
+ /**
584
+ * What the note says.
585
+ */
586
+ text?: string;
587
+
588
+ /**
589
+ * Milliseconds from the note's creation to its helpful rating.
590
+ */
591
+ timeToHelpfulFromNoteMs?: number;
592
+
593
+ /**
594
+ * Milliseconds from the post's creation to the note's helpful rating.
595
+ */
596
+ timeToHelpfulFromPostMs?: number;
597
+
598
+ /**
599
+ * X's notice in place of a deleted note.
600
+ */
601
+ tombstone?: string;
602
+ }
603
+
604
+ export namespace Note {
605
+ /**
606
+ * The note's writer, with the counts X sends beside a note. GET
607
+ * /x/community-notes/contributors/{alias} serves every count.
608
+ */
609
+ export interface Contributor {
610
+ /**
611
+ * The alias X gives the contributor.
612
+ */
613
+ alias: string;
614
+
615
+ /**
616
+ * Notes the contributor deleted.
617
+ */
618
+ deletedNotesCount?: number;
619
+
620
+ /**
621
+ * Whether the contributor writes notes through X's API.
622
+ */
623
+ isApiContributor?: boolean;
624
+
625
+ /**
626
+ * Whether X marks the contributor as a top writer.
627
+ */
628
+ isTopWriter?: boolean;
629
+
630
+ /**
631
+ * How many notes a contributor wrote, by X's current rating.
632
+ */
633
+ notesCount?: Contributor.NotesCount;
634
+
635
+ /**
636
+ * How a contributor's ratings of other notes went.
637
+ */
638
+ ratingsCount?: Contributor.RatingsCount;
639
+ }
640
+
641
+ export namespace Contributor {
642
+ /**
643
+ * How many notes a contributor wrote, by X's current rating.
644
+ */
645
+ export interface NotesCount {
646
+ /**
647
+ * Notes that need more ratings.
648
+ */
649
+ awaitingMoreRatings?: number;
650
+
651
+ /**
652
+ * Notes X rates helpful now.
653
+ */
654
+ currentlyRatedHelpful?: number;
655
+
656
+ /**
657
+ * Notes X rates not helpful now.
658
+ */
659
+ currentlyRatedNotHelpful?: number;
660
+
661
+ /**
662
+ * When X last counted the notes.
663
+ */
664
+ updatedAt?: string;
665
+ }
666
+
667
+ /**
668
+ * How a contributor's ratings of other notes went.
669
+ */
670
+ export interface RatingsCount {
671
+ /**
672
+ * Ratings on notes that need more ratings.
673
+ */
674
+ awaitingMoreRatings?: number;
675
+
676
+ /**
677
+ * Ratings made after X rated the note.
678
+ */
679
+ ratedAfterDecision?: number;
680
+
681
+ /**
682
+ * Ratings that matched the rating X gave the note.
683
+ */
684
+ successful?: RatingsCount.Successful;
685
+
686
+ /**
687
+ * Ratings that went against the rating X gave the note.
688
+ */
689
+ unsuccessful?: RatingsCount.Unsuccessful;
690
+
691
+ /**
692
+ * When X last counted the ratings.
693
+ */
694
+ updatedAt?: string;
695
+ }
696
+
697
+ export namespace RatingsCount {
698
+ /**
699
+ * Ratings that matched the rating X gave the note.
700
+ */
701
+ export interface Successful {
702
+ /**
703
+ * Ratings that called a note helpful.
704
+ */
705
+ helpfulCount?: number;
706
+
707
+ /**
708
+ * Ratings that called a note not helpful.
709
+ */
710
+ notHelpfulCount?: number;
711
+
712
+ /**
713
+ * All ratings in the group, when X sends the sum.
714
+ */
715
+ total?: number;
716
+ }
717
+
718
+ /**
719
+ * Ratings that went against the rating X gave the note.
720
+ */
721
+ export interface Unsuccessful {
722
+ /**
723
+ * Ratings that called a note helpful.
724
+ */
725
+ helpfulCount?: number;
726
+
727
+ /**
728
+ * Ratings that called a note not helpful.
729
+ */
730
+ notHelpfulCount?: number;
731
+
732
+ /**
733
+ * All ratings in the group, when X sends the sum.
734
+ */
735
+ total?: number;
736
+ }
737
+ }
738
+ }
739
+
740
+ /**
741
+ * A link, tag or account inside a note's text.
742
+ */
743
+ export interface Entity {
744
+ /**
745
+ * Where it starts in the text.
746
+ */
747
+ fromIndex?: number;
748
+
749
+ /**
750
+ * What it points at.
751
+ */
752
+ ref?: Entity.Ref;
753
+
754
+ /**
755
+ * Where it ends in the text.
756
+ */
757
+ toIndex?: number;
758
+ }
759
+
760
+ export namespace Entity {
761
+ /**
762
+ * What it points at.
763
+ */
764
+ export interface Ref {
765
+ /**
766
+ * A mentioned account's username.
767
+ */
768
+ screenName?: string;
769
+
770
+ /**
771
+ * A hashtag's or cashtag's text.
772
+ */
773
+ text?: string;
774
+
775
+ /**
776
+ * X's kind, such as TimelineUrl.
777
+ */
778
+ type?: string;
779
+
780
+ /**
781
+ * The link.
782
+ */
783
+ url?: string;
784
+
785
+ /**
786
+ * How X opens the link, such as ExternalUrl.
787
+ */
788
+ urlType?: string;
789
+ }
790
+ }
791
+
792
+ /**
793
+ * Why X shows no post, when X says.
794
+ */
795
+ export interface PostUnavailable {
796
+ /**
797
+ * Why X shows no post, as X names it.
798
+ */
799
+ reason: string;
800
+ }
801
+ }
802
+ }
803
+
804
+ export interface CommunityNoteRetrieveContributorResponse {
805
+ /**
806
+ * A Community Notes contributor. X names contributors by an alias, never by their
807
+ * X account. A field X leaves out is left out. Beside a note, X sends its writer
808
+ * with only some of the counts.
809
+ */
810
+ contributor: CommunityNoteRetrieveContributorResponse.Contributor;
811
+ }
812
+
813
+ export namespace CommunityNoteRetrieveContributorResponse {
814
+ /**
815
+ * A Community Notes contributor. X names contributors by an alias, never by their
816
+ * X account. A field X leaves out is left out. Beside a note, X sends its writer
817
+ * with only some of the counts.
818
+ */
819
+ export interface Contributor {
820
+ /**
821
+ * The alias X gives the contributor.
822
+ */
823
+ alias: string;
824
+
825
+ /**
826
+ * Notes the contributor deleted.
827
+ */
828
+ deletedNotesCount?: number;
829
+
830
+ /**
831
+ * Whether the contributor writes notes through X's API.
832
+ */
833
+ isApiContributor?: boolean;
834
+
835
+ /**
836
+ * Whether X marks the contributor as a top writer.
837
+ */
838
+ isTopWriter?: boolean;
839
+
840
+ /**
841
+ * How many notes a contributor wrote, by X's current rating.
842
+ */
843
+ notesCount?: Contributor.NotesCount;
844
+
845
+ /**
846
+ * How a contributor's ratings of other notes went.
847
+ */
848
+ ratingsCount?: Contributor.RatingsCount;
849
+ }
850
+
851
+ export namespace Contributor {
852
+ /**
853
+ * How many notes a contributor wrote, by X's current rating.
854
+ */
855
+ export interface NotesCount {
856
+ /**
857
+ * Notes that need more ratings.
858
+ */
859
+ awaitingMoreRatings?: number;
860
+
861
+ /**
862
+ * Notes X rates helpful now.
863
+ */
864
+ currentlyRatedHelpful?: number;
865
+
866
+ /**
867
+ * Notes X rates not helpful now.
868
+ */
869
+ currentlyRatedNotHelpful?: number;
870
+
871
+ /**
872
+ * When X last counted the notes.
873
+ */
874
+ updatedAt?: string;
875
+ }
876
+
877
+ /**
878
+ * How a contributor's ratings of other notes went.
879
+ */
880
+ export interface RatingsCount {
881
+ /**
882
+ * Ratings on notes that need more ratings.
883
+ */
884
+ awaitingMoreRatings?: number;
885
+
886
+ /**
887
+ * Ratings made after X rated the note.
888
+ */
889
+ ratedAfterDecision?: number;
890
+
891
+ /**
892
+ * Ratings that matched the rating X gave the note.
893
+ */
894
+ successful?: RatingsCount.Successful;
895
+
896
+ /**
897
+ * Ratings that went against the rating X gave the note.
898
+ */
899
+ unsuccessful?: RatingsCount.Unsuccessful;
900
+
901
+ /**
902
+ * When X last counted the ratings.
903
+ */
904
+ updatedAt?: string;
905
+ }
906
+
907
+ export namespace RatingsCount {
908
+ /**
909
+ * Ratings that matched the rating X gave the note.
910
+ */
911
+ export interface Successful {
912
+ /**
913
+ * Ratings that called a note helpful.
914
+ */
915
+ helpfulCount?: number;
916
+
917
+ /**
918
+ * Ratings that called a note not helpful.
919
+ */
920
+ notHelpfulCount?: number;
921
+
922
+ /**
923
+ * All ratings in the group, when X sends the sum.
924
+ */
925
+ total?: number;
926
+ }
927
+
928
+ /**
929
+ * Ratings that went against the rating X gave the note.
930
+ */
931
+ export interface Unsuccessful {
932
+ /**
933
+ * Ratings that called a note helpful.
934
+ */
935
+ helpfulCount?: number;
936
+
937
+ /**
938
+ * Ratings that called a note not helpful.
939
+ */
940
+ notHelpfulCount?: number;
941
+
942
+ /**
943
+ * All ratings in the group, when X sends the sum.
944
+ */
945
+ total?: number;
946
+ }
947
+ }
948
+ }
949
+ }
950
+
951
+ export interface CommunityNoteListContributorDeletedNotesParams {
952
+ /**
953
+ * Pagination cursor for collection results. Also read as next_cursor, next_token,
954
+ * pagination_token or continuation_token.
955
+ */
956
+ cursor?: string;
957
+
958
+ /**
959
+ * Fields to keep in each row, comma-separated. Use dots for nested fields, such as
960
+ * author.username. A list keeps the field in each item. Case & underscores do not
961
+ * matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics
962
+ * always stay. An unknown name answers 400 unknown_field with the valid names,
963
+ * before any read. The price stays the same. SDK row types then hold only the
964
+ * named fields.
965
+ */
966
+ fields?: string;
967
+
968
+ /**
969
+ * Fields to drop from each row, comma-separated. It takes the same names as
970
+ * fields. With fields, it drops from the kept fields.
971
+ */
972
+ omit?: string;
973
+
974
+ /**
975
+ * Notes per page (1-10, default 10). A low credit balance can return fewer. Follow
976
+ * next_cursor for more pages. Also read as limit, count, max_results, maxItems,
977
+ * max_items & per_page.
978
+ */
979
+ pageSize?: number;
980
+ }
981
+
982
+ export interface CommunityNoteListContributorNotesParams {
983
+ /**
984
+ * Pagination cursor for collection results. Also read as next_cursor, next_token,
985
+ * pagination_token or continuation_token.
986
+ */
987
+ cursor?: string;
988
+
989
+ /**
990
+ * Fields to keep in each row, comma-separated. Use dots for nested fields, such as
991
+ * author.username. A list keeps the field in each item. Case & underscores do not
992
+ * matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics
993
+ * always stay. An unknown name answers 400 unknown_field with the valid names,
994
+ * before any read. The price stays the same. SDK row types then hold only the
995
+ * named fields.
996
+ */
997
+ fields?: string;
998
+
999
+ /**
1000
+ * Fields to drop from each row, comma-separated. It takes the same names as
1001
+ * fields. With fields, it drops from the kept fields.
1002
+ */
1003
+ omit?: string;
1004
+
1005
+ /**
1006
+ * Notes per page (1-10, default 10). A low credit balance can return fewer. Follow
1007
+ * next_cursor for more pages. Also read as limit, count, max_results, maxItems,
1008
+ * max_items & per_page.
1009
+ */
1010
+ pageSize?: number;
1011
+ }
1012
+
1013
+ export interface CommunityNoteRetrieveContributorParams {
1014
+ /**
1015
+ * Fields to keep in each row, comma-separated. Use dots for nested fields, such as
1016
+ * author.username. A list keeps the field in each item. Case & underscores do not
1017
+ * matter. A row that lacks a field leaves it out. Cursors, counts & diagnostics
1018
+ * always stay. An unknown name answers 400 unknown_field with the valid names,
1019
+ * before any read. The price stays the same. SDK row types then hold only the
1020
+ * named fields.
1021
+ */
1022
+ fields?: string;
1023
+
1024
+ /**
1025
+ * Fields to drop from each row, comma-separated. It takes the same names as
1026
+ * fields. With fields, it drops from the kept fields.
1027
+ */
1028
+ omit?: string;
1029
+ }
1030
+
1031
+ export declare namespace CommunityNotes {
1032
+ export {
1033
+ type CommunityNoteListContributorDeletedNotesResponse as CommunityNoteListContributorDeletedNotesResponse,
1034
+ type CommunityNoteListContributorNotesResponse as CommunityNoteListContributorNotesResponse,
1035
+ type CommunityNoteRetrieveContributorResponse as CommunityNoteRetrieveContributorResponse,
1036
+ type CommunityNoteListContributorDeletedNotesParams as CommunityNoteListContributorDeletedNotesParams,
1037
+ type CommunityNoteListContributorNotesParams as CommunityNoteListContributorNotesParams,
1038
+ type CommunityNoteRetrieveContributorParams as CommunityNoteRetrieveContributorParams,
1039
+ };
1040
+ }