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