@elizaos/plugin-xai 2.0.0-alpha.6 → 2.0.3-beta.5

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 (96) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +43 -21
  3. package/auto-enable.ts +17 -0
  4. package/package.json +44 -102
  5. package/registry-entry.json +75 -0
  6. package/dist/actions/post.d.ts +0 -3
  7. package/dist/actions/post.d.ts.map +0 -1
  8. package/dist/base.d.ts +0 -55
  9. package/dist/base.d.ts.map +0 -1
  10. package/dist/browser/index.browser.js +0 -4
  11. package/dist/browser/index.browser.js.map +0 -11
  12. package/dist/browser/index.d.ts +0 -2
  13. package/dist/cjs/index.d.ts +0 -2
  14. package/dist/cjs/index.node.cjs +0 -11197
  15. package/dist/cjs/index.node.js.map +0 -116
  16. package/dist/client/api-types.d.ts +0 -28
  17. package/dist/client/api-types.d.ts.map +0 -1
  18. package/dist/client/auth-providers/broker.d.ts +0 -19
  19. package/dist/client/auth-providers/broker.d.ts.map +0 -1
  20. package/dist/client/auth-providers/env.d.ts +0 -20
  21. package/dist/client/auth-providers/env.d.ts.map +0 -1
  22. package/dist/client/auth-providers/factory.d.ts +0 -5
  23. package/dist/client/auth-providers/factory.d.ts.map +0 -1
  24. package/dist/client/auth-providers/interactive.d.ts +0 -7
  25. package/dist/client/auth-providers/interactive.d.ts.map +0 -1
  26. package/dist/client/auth-providers/oauth2-pkce.d.ts +0 -24
  27. package/dist/client/auth-providers/oauth2-pkce.d.ts.map +0 -1
  28. package/dist/client/auth-providers/pkce.d.ts +0 -5
  29. package/dist/client/auth-providers/pkce.d.ts.map +0 -1
  30. package/dist/client/auth-providers/token-store.d.ts +0 -31
  31. package/dist/client/auth-providers/token-store.d.ts.map +0 -1
  32. package/dist/client/auth-providers/types.d.ts +0 -35
  33. package/dist/client/auth-providers/types.d.ts.map +0 -1
  34. package/dist/client/auth.d.ts +0 -38
  35. package/dist/client/auth.d.ts.map +0 -1
  36. package/dist/client/client.d.ts +0 -462
  37. package/dist/client/client.d.ts.map +0 -1
  38. package/dist/client/errors.d.ts +0 -72
  39. package/dist/client/errors.d.ts.map +0 -1
  40. package/dist/client/index.d.ts +0 -21
  41. package/dist/client/index.d.ts.map +0 -1
  42. package/dist/client/posts.d.ts +0 -325
  43. package/dist/client/posts.d.ts.map +0 -1
  44. package/dist/client/profile.d.ts +0 -140
  45. package/dist/client/profile.d.ts.map +0 -1
  46. package/dist/client/relationships.d.ts +0 -47
  47. package/dist/client/relationships.d.ts.map +0 -1
  48. package/dist/client/search.d.ts +0 -48
  49. package/dist/client/search.d.ts.map +0 -1
  50. package/dist/client/types.d.ts +0 -24
  51. package/dist/client/types.d.ts.map +0 -1
  52. package/dist/constants.d.ts +0 -5
  53. package/dist/constants.d.ts.map +0 -1
  54. package/dist/discovery.d.ts +0 -37
  55. package/dist/discovery.d.ts.map +0 -1
  56. package/dist/environment.d.ts +0 -40
  57. package/dist/environment.d.ts.map +0 -1
  58. package/dist/generated/prompts/typescript/prompts.d.ts +0 -22
  59. package/dist/generated/prompts/typescript/prompts.d.ts.map +0 -1
  60. package/dist/generated/specs/spec-helpers.d.ts +0 -49
  61. package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
  62. package/dist/generated/specs/specs.d.ts +0 -65
  63. package/dist/generated/specs/specs.d.ts.map +0 -1
  64. package/dist/index.browser.d.ts +0 -6
  65. package/dist/index.browser.d.ts.map +0 -1
  66. package/dist/index.d.ts +0 -5
  67. package/dist/index.d.ts.map +0 -1
  68. package/dist/index.node.d.ts +0 -3
  69. package/dist/index.node.d.ts.map +0 -1
  70. package/dist/interactions.d.ts +0 -129
  71. package/dist/interactions.d.ts.map +0 -1
  72. package/dist/models/grok.d.ts +0 -7
  73. package/dist/models/grok.d.ts.map +0 -1
  74. package/dist/node/index.d.ts +0 -2
  75. package/dist/node/index.node.js +0 -11212
  76. package/dist/node/index.node.js.map +0 -116
  77. package/dist/post.d.ts +0 -43
  78. package/dist/post.d.ts.map +0 -1
  79. package/dist/services/x.service.d.ts +0 -23
  80. package/dist/services/x.service.d.ts.map +0 -1
  81. package/dist/templates.d.ts +0 -6
  82. package/dist/templates.d.ts.map +0 -1
  83. package/dist/timeline.d.ts +0 -46
  84. package/dist/timeline.d.ts.map +0 -1
  85. package/dist/types.d.ts +0 -150
  86. package/dist/types.d.ts.map +0 -1
  87. package/dist/utils/error-handler.d.ts +0 -20
  88. package/dist/utils/error-handler.d.ts.map +0 -1
  89. package/dist/utils/memory.d.ts +0 -21
  90. package/dist/utils/memory.d.ts.map +0 -1
  91. package/dist/utils/settings.d.ts +0 -3
  92. package/dist/utils/settings.d.ts.map +0 -1
  93. package/dist/utils/time.d.ts +0 -2
  94. package/dist/utils/time.d.ts.map +0 -1
  95. package/dist/utils.d.ts +0 -36
  96. package/dist/utils.d.ts.map +0 -1
@@ -1,325 +0,0 @@
1
- import type { ApiV2Includes, PollV2, TTweetv2Expansion, TTweetv2MediaField, TTweetv2PlaceField, TTweetv2PollField, TTweetv2TweetField, TTweetv2UserField, TweetV2 } from "twitter-api-v2";
2
- import type { XAuth } from "./auth";
3
- import type { QueryPostsResponse } from "./types";
4
- type PostV2 = TweetV2;
5
- type TPostv2Expansion = TTweetv2Expansion;
6
- type TPostv2MediaField = TTweetv2MediaField;
7
- type TPostv2PlaceField = TTweetv2PlaceField;
8
- type TPostv2PollField = TTweetv2PollField;
9
- type TPostv2PostField = TTweetv2TweetField;
10
- type TPostv2UserField = TTweetv2UserField;
11
- /**
12
- * Default options for X API v2 request parameters.
13
- * @typedef {Object} defaultOptions
14
- * @property {TPostv2Expansion[]} expansions - List of expansions to include in the request.
15
- * @property {TPostv2PostField[]} postFields - List of post fields to include in the request.
16
- * @property {TPostv2PollField[]} pollFields - List of poll fields to include in the request.
17
- * @property {TPostv2MediaField[]} mediaFields - List of media fields to include in the request.
18
- * @property {TPostv2UserField[]} userFields - List of user fields to include in the request.
19
- * @property {TPostv2PlaceField[]} placeFields - List of place fields to include in the request.
20
- */
21
- export declare const defaultOptions: {
22
- expansions: TPostv2Expansion[];
23
- postFields: TPostv2PostField[];
24
- pollFields: TPostv2PollField[];
25
- mediaFields: TPostv2MediaField[];
26
- userFields: TPostv2UserField[];
27
- placeFields: TPostv2PlaceField[];
28
- };
29
- /**
30
- * Interface representing a mention.
31
- * @typedef {Object} Mention
32
- * @property {string} id - The unique identifier for the mention.
33
- * @property {string} [username] - The username associated with the mention.
34
- * @property {string} [name] - The name associated with the mention.
35
- */
36
- export interface Mention {
37
- id: string;
38
- username?: string;
39
- name?: string;
40
- }
41
- /**
42
- * Interface representing a photo object.
43
- * @interface
44
- * @property {string} id - The unique identifier for the photo.
45
- * @property {string} url - The URL for the photo image.
46
- * @property {string} [alt_text] - The alternative text for the photo image. Optional.
47
- */
48
- export interface Photo {
49
- id: string;
50
- url: string;
51
- alt_text: string | undefined;
52
- }
53
- /**
54
- * Interface representing a video object.
55
- * @typedef {Object} Video
56
- * @property {string} id - The unique identifier for the video.
57
- * @property {string} preview - The URL for the preview image of the video.
58
- * @property {string} [url] - The optional URL for the video.
59
- */
60
- export interface Video {
61
- id: string;
62
- preview: string;
63
- url?: string;
64
- }
65
- /**
66
- * Interface representing a raw place object.
67
- * @typedef {Object} PlaceRaw
68
- * @property {string} [id] - The unique identifier of the place.
69
- * @property {string} [place_type] - The type of the place.
70
- * @property {string} [name] - The name of the place.
71
- * @property {string} [full_name] - The full name of the place.
72
- * @property {string} [country_code] - The country code of the place.
73
- * @property {string} [country] - The country name of the place.
74
- * @property {Object} [bounding_box] - The bounding box coordinates of the place.
75
- * @property {string} [bounding_box.type] - The type of the bounding box.
76
- * @property {number[][][]} [bounding_box.coordinates] - The coordinates of the bounding box in an array format.
77
- */
78
- export interface PlaceRaw {
79
- id?: string;
80
- place_type?: string;
81
- name?: string;
82
- full_name?: string;
83
- country_code?: string;
84
- country?: string;
85
- bounding_box?: {
86
- type?: string;
87
- coordinates?: number[][][];
88
- };
89
- }
90
- /**
91
- * Interface representing poll data.
92
- *
93
- * @property {string} [id] - The unique identifier for the poll.
94
- * @property {string} [end_datetime] - The end date and time for the poll.
95
- * @property {string} [voting_status] - The status of the voting process.
96
- * @property {number} duration_minutes - The duration of the poll in minutes.
97
- * @property {PollOption[]} options - An array of poll options.
98
- */
99
- export interface PollData {
100
- id?: string;
101
- end_datetime?: string;
102
- voting_status?: string;
103
- duration_minutes: number;
104
- options: PollOption[];
105
- }
106
- /**
107
- * Interface representing a poll option.
108
- * @typedef {Object} PollOption
109
- * @property {number} [position] - The position of the option.
110
- * @property {string} label - The label of the option.
111
- * @property {number} [votes] - The number of votes for the option.
112
- */
113
- export interface PollOption {
114
- position?: number;
115
- label: string;
116
- votes?: number;
117
- }
118
- /**
119
- * A parsed Post object.
120
- */
121
- /**
122
- * Represents a Post on X.
123
- * @typedef { Object } Post
124
- * @property { number } [bookmarkCount] - The number of times this Post has been bookmarked.
125
- * @property { string } [conversationId] - The ID of the conversation this Post is a part of.
126
- * @property {string[]} hashtags - An array of hashtags mentioned in the Post.
127
- * @property { string } [html] - The HTML content of the Post.
128
- * @property { string } [id] - The unique ID of the Post.
129
- * @property { Post } [inReplyToStatus] - The Post that this Post is in reply to.
130
- * @property { string } [inReplyToStatusId] - The ID of the Post that this Post is in reply to.
131
- * @property { boolean } [isQuoted] - Indicates if this Post is a quote of another Post.
132
- * @property { boolean } [isPin] - Indicates if this Post is pinned.
133
- * @property { boolean } [isReply] - Indicates if this Post is a reply to another Post.
134
- * @property { boolean } [isRepost] - Indicates if this Post is a repost.
135
- * @property { boolean } [isSelfThread] - Indicates if this Post is part of a self thread.
136
- * @property { string } [language] - The language of the Post.
137
- * @property { number } [likes] - The number of likes on the Post.
138
- * @property { string } [name] - The name associated with the Post.
139
- * @property {Mention[]} mentions - An array of mentions in the Post.
140
- * @property { string } [permanentUrl] - The permanent URL of the Post.
141
- * @property {Photo[]} photos - An array of photos attached to the Post.
142
- * @property { PlaceRaw } [place] - The place associated with the Post.
143
- * @property { Post } [quotedStatus] - The quoted Post.
144
- * @property { string } [quotedStatusId] - The ID of the quoted Post.
145
- * @property { number } [quotes] - The number of times this Post has been quoted.
146
- * @property { number } [replies] - The number of replies to the Post.
147
- * @property { number } [reposts] - The number of reposts on the Post.
148
- * @property { Post } [repostedStatus] - The status that was reposted.
149
- * @property { string } [repostedStatusId] - The ID of the reposted status.
150
- * @property { string } [text] - The text content of the Post.
151
- * @property {Post[]} thread - An array representing an X thread.
152
- * @property { Date } [timeParsed] - The parsed timestamp of the Post.
153
- * @property { number } [timestamp] - The timestamp of the Post.
154
- * @property {string[]} urls - An array of URLs mentioned in the Post.
155
- * @property { string } [userId] - The ID of the user who posted the Post.
156
- * @property { string } [username] - The username of the user who posted the Post.
157
- * @property {Video[]} videos - An array of videos attached to the Post.
158
- * @property { number } [views] - The number of views on the Post.
159
- * @property { boolean } [sensitiveContent] - Indicates if the Post contains sensitive content.
160
- * @property {PollV2 | null} [poll] - The poll attached to the Post, if any.
161
- */
162
- export interface Post {
163
- bookmarkCount?: number;
164
- conversationId?: string;
165
- hashtags: string[];
166
- html?: string;
167
- id?: string;
168
- inReplyToStatus?: Post;
169
- inReplyToStatusId?: string;
170
- isQuoted?: boolean;
171
- isPin?: boolean;
172
- isReply?: boolean;
173
- isRepost?: boolean;
174
- isSelfThread?: boolean;
175
- language?: string;
176
- likes?: number;
177
- name?: string;
178
- mentions: Mention[];
179
- permanentUrl?: string;
180
- photos: Photo[];
181
- place?: PlaceRaw;
182
- quotedStatus?: Post;
183
- quotedStatusId?: string;
184
- quotes?: number;
185
- replies?: number;
186
- reposts?: number;
187
- repostedStatus?: Post;
188
- repostedStatusId?: string;
189
- text?: string;
190
- thread: Post[];
191
- timeParsed?: Date;
192
- timestamp?: number;
193
- urls: string[];
194
- userId?: string;
195
- username?: string;
196
- videos: Video[];
197
- views?: number;
198
- sensitiveContent?: boolean;
199
- poll?: PollV2 | null;
200
- }
201
- export interface Reposter {
202
- rest_id: string;
203
- screen_name: string;
204
- name: string;
205
- description?: string;
206
- }
207
- export type PostQuery = Partial<Post> | ((post: Post) => boolean | Promise<boolean>);
208
- export declare function fetchPosts(userId: string, maxPosts: number, cursor: string | undefined, auth: XAuth): Promise<QueryPostsResponse>;
209
- export declare function fetchPostsAndReplies(userId: string, maxPosts: number, cursor: string | undefined, auth: XAuth): Promise<QueryPostsResponse>;
210
- export declare function createCreatePostRequestV2(text: string, auth: XAuth, postId?: string, options?: {
211
- poll?: PollData;
212
- }): Promise<Post | null>;
213
- export declare function parsePostV2ToV1(postV2: PostV2, includes?: ApiV2Includes): Post;
214
- export declare function createCreatePostRequest(text: string, auth: XAuth, postId?: string, mediaData?: {
215
- data: Buffer;
216
- mediaType: string;
217
- }[], _hideLinkPreview?: boolean): Promise<{
218
- ok: boolean;
219
- json: () => Promise<import("twitter-api-v2").TweetV2PostTweetResult>;
220
- data: import("twitter-api-v2").TweetV2PostTweetResult;
221
- }>;
222
- export declare function createCreateNotePostRequest(text: string, auth: XAuth, postId?: string, mediaData?: {
223
- data: Buffer;
224
- mediaType: string;
225
- }[]): Promise<{
226
- ok: boolean;
227
- json: () => Promise<import("twitter-api-v2").TweetV2PostTweetResult>;
228
- data: import("twitter-api-v2").TweetV2PostTweetResult;
229
- }>;
230
- export declare function fetchListPosts(listId: string, maxPosts: number, cursor: string | undefined, auth: XAuth): Promise<QueryPostsResponse>;
231
- export declare function deletePost(postId: string, auth: XAuth): Promise<{
232
- ok: boolean;
233
- success: boolean;
234
- json: () => Promise<import("twitter-api-v2").TweetV2DeleteTweetResult>;
235
- data: import("twitter-api-v2").TweetV2DeleteTweetResult;
236
- }>;
237
- export declare function getPosts(user: string, maxPosts: number, auth: XAuth): AsyncGenerator<Post, void>;
238
- export declare function getPostsByUserId(userId: string, maxPosts: number, auth: XAuth): AsyncGenerator<Post, void>;
239
- export declare function getPostsAndReplies(user: string, maxPosts: number, auth: XAuth): AsyncGenerator<Post, void>;
240
- export declare function getPostsAndRepliesByUserId(userId: string, maxPosts: number, auth: XAuth): AsyncGenerator<Post, void>;
241
- export declare function fetchLikedPosts(userId: string, maxPosts: number, cursor: string | undefined, auth: XAuth): Promise<QueryPostsResponse>;
242
- export declare function getPostWhere(posts: AsyncIterable<Post>, query: PostQuery): Promise<Post | null>;
243
- export declare function getPostsWhere(posts: AsyncIterable<Post>, query: PostQuery): Promise<Post[]>;
244
- export declare function getLatestPost(user: string, includeReposts: boolean, max: number, auth: XAuth): Promise<Post | null | undefined>;
245
- export declare function getPost(id: string, auth: XAuth): Promise<Post | null>;
246
- export declare function getPostV2(id: string, auth: XAuth, options?: {
247
- expansions?: TPostv2Expansion[];
248
- postFields?: TPostv2PostField[];
249
- pollFields?: TPostv2PollField[];
250
- mediaFields?: TPostv2MediaField[];
251
- userFields?: TPostv2UserField[];
252
- placeFields?: TPostv2PlaceField[];
253
- }): Promise<Post | null>;
254
- export declare function getPostsV2(ids: string[], auth: XAuth, options?: {
255
- expansions?: TPostv2Expansion[];
256
- postFields?: TPostv2PostField[];
257
- pollFields?: TPostv2PollField[];
258
- mediaFields?: TPostv2MediaField[];
259
- userFields?: TPostv2UserField[];
260
- placeFields?: TPostv2PlaceField[];
261
- }): Promise<Post[]>;
262
- export declare function getPostAnonymous(id: string, auth: XAuth): Promise<Post | null>;
263
- export declare function createQuotePostRequest(text: string, quotedPostId: string, auth: XAuth, _mediaData?: {
264
- data: Buffer;
265
- mediaType: string;
266
- }[]): Promise<{
267
- ok: boolean;
268
- json: () => Promise<import("twitter-api-v2").TweetV2PostTweetResult>;
269
- data: import("twitter-api-v2").TweetV2PostTweetResult;
270
- }>;
271
- /**
272
- * Likes a post with the given post ID.
273
- * @param postId The ID of the post to like.
274
- * @param auth The authentication object.
275
- * @returns A promise that resolves when the post is liked.
276
- */
277
- export declare function likePost(postId: string, auth: XAuth): Promise<void>;
278
- /**
279
- * Reposts a post with the given post ID.
280
- * @param postId The ID of the post to repost.
281
- * @param auth The authentication object.
282
- * @returns A promise that resolves when the post is reposted.
283
- */
284
- export declare function repost(postId: string, auth: XAuth): Promise<void>;
285
- /**
286
- * Unlikes a post with the given post ID.
287
- * @param postId The ID of the post to unlike.
288
- * @param auth The authentication object.
289
- * @returns A promise that resolves when the post is unliked.
290
- */
291
- export declare function unlikePost(postId: string, auth: XAuth): Promise<void>;
292
- /**
293
- * Removes a repost of a post with the given post ID.
294
- * @param postId The ID of the post to unrepost.
295
- * @param auth The authentication object.
296
- * @returns A promise that resolves when the repost is removed.
297
- */
298
- export declare function unrepost(postId: string, auth: XAuth): Promise<void>;
299
- export declare function createCreateLongPostRequest(text: string, auth: XAuth, postId?: string, mediaData?: {
300
- data: Buffer;
301
- mediaType: string;
302
- }[]): Promise<{
303
- ok: boolean;
304
- json: () => Promise<import("twitter-api-v2").TweetV2PostTweetResult>;
305
- data: import("twitter-api-v2").TweetV2PostTweetResult;
306
- }>;
307
- /**
308
- * Fetches a single page of reposters for a given post, collecting both bottom and top cursors.
309
- * Logs each user's description in the process.
310
- * All comments must remain in English.
311
- */
312
- export declare function fetchRepostersPage(_postId: string, _auth: XAuth, _cursor?: string, _count?: number): Promise<{
313
- reposters: Reposter[];
314
- bottomCursor?: string;
315
- topCursor?: string;
316
- }>;
317
- /**
318
- * Retrieves *all* reposters by chaining requests until no next cursor is found.
319
- * @param postId The ID of the post.
320
- * @param auth The XAuth object for authentication.
321
- * @returns A list of all users that reposted the post.
322
- */
323
- export declare function getAllReposters(postId: string, auth: XAuth): Promise<Reposter[]>;
324
- export {};
325
- //# sourceMappingURL=posts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../client/posts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAGb,MAAM,EAEN,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAIjB,OAAO,EAER,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,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,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAevE;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAe3E;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAezE;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,KAAK,EACX,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE;;;;GAKlD;AAID;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,MAAM,EAChB,MAAM,SAAK,GACV,OAAO,CAAC;IACT,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CASD;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAyBtF"}
@@ -1,140 +0,0 @@
1
- import type { RequestApiResult } from "./api-types";
2
- import type { XAuth } from "./auth";
3
- import type { XApiErrorRaw } from "./errors";
4
- /**
5
- * Interface representing a raw user object from the X API.
6
- * @typedef {Object} XUserRaw
7
- * @property {string} [created_at] - The date the user was created.
8
- * @property {string} [description] - The user's description.
9
- * @property {Object} [entities] - Additional entities associated with the user.
10
- * @property {Object} [url] - The URL associated with the user.
11
- * @property {Object[]} [urls] - Array of URLs associated with the user.
12
- * @property {string} [expanded_url] - The expanded URL.
13
- * @property {number} [favourites_count] - The number of favorited items.
14
- * @property {number} [followers_count] - The number of followers.
15
- * @property {number} [friends_count] - The number of friends.
16
- * @property {number} [media_count] - The number of media items.
17
- * @property {number} [statuses_count] - The number of statuses.
18
- * @property {string} [id_str] - The user ID as a string.
19
- * @property {number} [listed_count] - The number of lists the user is listed in.
20
- * @property {string} [name] - The user's name.
21
- * @property {string} location - The user's location.
22
- * @property {boolean} [geo_enabled] - Indicates if geo locations are enabled.
23
- * @property {string[]} [pinned_tweet_ids_str] - Array of pinned post IDs as strings.
24
- * @property {string} [profile_background_color] - The background color of the user's profile.
25
- * @property {string} [profile_banner_url] - The URL of the user's profile banner.
26
- * @property {string} [profile_image_url_https] - The URL of the user's profile image (HTTPS).
27
- * @property {boolean} [protected] - Indicates if the user's account is protected.
28
- * @property {string} [screen_name] - The user's screen name.
29
- * @property {boolean} [verified] - Indicates if the user is verified.
30
- * @property {boolean} [has_custom_timelines] - Indicates if the user has custom timelines.
31
- * @property {boolean} [has_extended_profile] - Indicates if the user has an extended profile.
32
- * @property {string} [url] - The user's URL.
33
- * @property {boolean} [can_dm] - Indicates if direct messages are enabled for the user.
34
- */
35
- export interface XUserRaw {
36
- created_at?: string;
37
- description?: string;
38
- entities?: {
39
- url?: {
40
- urls?: {
41
- expanded_url?: string;
42
- }[];
43
- };
44
- };
45
- favourites_count?: number;
46
- followers_count?: number;
47
- friends_count?: number;
48
- media_count?: number;
49
- statuses_count?: number;
50
- id_str?: string;
51
- listed_count?: number;
52
- name?: string;
53
- location: string;
54
- geo_enabled?: boolean;
55
- pinned_tweet_ids_str?: string[];
56
- profile_background_color?: string;
57
- profile_banner_url?: string;
58
- profile_image_url_https?: string;
59
- protected?: boolean;
60
- screen_name?: string;
61
- verified?: boolean;
62
- has_custom_timelines?: boolean;
63
- has_extended_profile?: boolean;
64
- url?: string;
65
- can_dm?: boolean;
66
- }
67
- /**
68
- * A parsed profile object.
69
- */
70
- /**
71
- * Interface representing a user profile.
72
- * @typedef {Object} Profile
73
- * @property {string} [avatar] - The URL to the user's avatar.
74
- * @property {string} [banner] - The URL to the user's banner image.
75
- * @property {string} [biography] - The user's biography.
76
- * @property {string} [birthday] - The user's birthday.
77
- * @property {number} [followersCount] - The number of followers the user has.
78
- * @property {number} [followingCount] - The number of users the user is following.
79
- * @property {number} [friendsCount] - The number of friends the user has.
80
- * @property {number} [mediaCount] - The number of media items the user has posted.
81
- * @property {number} [statusesCount] - The number of statuses the user has posted.
82
- * @property {boolean} [isPrivate] - Indicates if the user's profile is private.
83
- * @property {boolean} [isVerified] - Indicates if the user account is verified.
84
- * @property {boolean} [isBlueVerified] - Indicates if the user account has blue verification badge.
85
- * @property {Date} [joined] - The date the user joined the platform.
86
- * @property {number} [likesCount] - The number of likes the user has received.
87
- * @property {number} [listedCount] - The number of times the user has been listed.
88
- * @property {string} location - The user's location.
89
- * @property {string} [name] - The user's name.
90
- * @property {string[]} [pinnedPostIds] - The IDs of the user's pinned posts.
91
- * @property {number} [postsCount] - The number of posts the user has posted.
92
- * @property {string} [url] - The user's website URL.
93
- * @property {string} [userId] - The unique user ID.
94
- * @property {string} [username] - The user's username.
95
- * @property {string} [website] - The user's website.
96
- * @property {boolean} [canDm] - Indicates if the user can receive direct messages.
97
- */
98
- export interface Profile {
99
- avatar?: string;
100
- banner?: string;
101
- biography?: string;
102
- birthday?: string;
103
- followersCount?: number;
104
- followingCount?: number;
105
- friendsCount?: number;
106
- mediaCount?: number;
107
- statusesCount?: number;
108
- isPrivate?: boolean;
109
- isVerified?: boolean;
110
- isBlueVerified?: boolean;
111
- joined?: Date;
112
- likesCount?: number;
113
- listedCount?: number;
114
- location: string;
115
- name?: string;
116
- pinnedPostIds?: string[];
117
- postsCount?: number;
118
- url?: string;
119
- userId?: string;
120
- username?: string;
121
- website?: string;
122
- canDm?: boolean;
123
- }
124
- export interface UserRaw {
125
- data: {
126
- user: {
127
- result: {
128
- rest_id?: string;
129
- is_blue_verified?: boolean;
130
- legacy: XUserRaw;
131
- };
132
- };
133
- };
134
- errors?: XApiErrorRaw[];
135
- }
136
- export declare function parseProfile(user: XUserRaw, isBlueVerified?: boolean): Profile;
137
- export declare function getProfile(username: string, auth: XAuth): Promise<RequestApiResult<Profile>>;
138
- export declare function getScreenNameByUserId(userId: string, auth: XAuth): Promise<RequestApiResult<string>>;
139
- export declare function getEntityIdByScreenName(screenName: string, auth: XAuth): Promise<RequestApiResult<string>>;
140
- //# sourceMappingURL=profile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../client/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,QAAQ;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,GAAG,CAAC,EAAE;YACJ,IAAI,CAAC,EAAE;gBACL,YAAY,CAAC,EAAE,MAAM,CAAC;aACvB,EAAE,CAAC;SACL,CAAC;KACH,CAAC;IACF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IAC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AM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;gBAC3B,MAAM,EAAE,QAAQ,CAAC;aAClB,CAAC;SACH,CAAC;KACH,CAAC;IACF,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACzB;AAMD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAkC9E;AAuCD,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CA8CpC;AAID,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CA+BnC;AAED,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,KAAK,GACV,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAyBnC"}
@@ -1,47 +0,0 @@
1
- import type { XAuth } from "./auth";
2
- import type { Profile } from "./profile";
3
- import type { QueryProfilesResponse } from "./types";
4
- /**
5
- * Function to get the following profiles of a user.
6
- * @param {string} userId - The ID of the user to get the following profiles for.
7
- * @param {number} maxProfiles - The maximum number of profiles to retrieve.
8
- * @param {XAuth} auth - The X authentication credentials.
9
- * @returns {AsyncGenerator<Profile, void>} An async generator that yields Profile objects.
10
- */
11
- export declare function getFollowing(userId: string, maxProfiles: number, auth: XAuth): AsyncGenerator<Profile, void>;
12
- /**
13
- * Get followers for a specific user.
14
- * @param {string} userId - The user ID for which to retrieve followers.
15
- * @param {number} maxProfiles - The maximum number of profiles to retrieve.
16
- * @param {XAuth} auth - The authentication credentials for the X API.
17
- * @returns {AsyncGenerator<Profile, void>} - An async generator that yields Profile objects representing followers.
18
- */
19
- export declare function getFollowers(userId: string, maxProfiles: number, auth: XAuth): AsyncGenerator<Profile, void>;
20
- /**
21
- * Fetches the profiles that a user is following.
22
- * @param {string} userId - The ID of the user whose following profiles are to be fetched.
23
- * @param {number} maxProfiles - The maximum number of profiles to fetch.
24
- * @param {XAuth} auth - The X authentication details.
25
- * @param {string} [cursor] - Optional cursor for pagination.
26
- * @returns {Promise<QueryProfilesResponse>} A Promise that resolves with the response containing profiles the user is following.
27
- */
28
- export declare function fetchProfileFollowing(userId: string, maxProfiles: number, auth: XAuth, cursor?: string): Promise<QueryProfilesResponse>;
29
- /**
30
- * Fetches the profile followers for a given user ID.
31
- *
32
- * @param {string} userId - The user ID for which to fetch profile followers.
33
- * @param {number} maxProfiles - The maximum number of profiles to fetch.
34
- * @param {XAuth} auth - The X authentication credentials.
35
- * @param {string} [cursor] - Optional cursor for paginating results.
36
- * @returns {Promise<QueryProfilesResponse>} A promise that resolves with the parsed profile followers timeline.
37
- */
38
- export declare function fetchProfileFollowers(userId: string, maxProfiles: number, auth: XAuth, cursor?: string): Promise<QueryProfilesResponse>;
39
- /**
40
- * Follow a user using X API v2
41
- *
42
- * @param {string} username - The username to follow
43
- * @param {XAuth} auth - The authentication credentials
44
- * @returns {Promise<Response>} Response from the API
45
- */
46
- export declare function followUser(username: string, auth: XAuth): Promise<Response>;
47
- //# sourceMappingURL=relationships.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../client/relationships.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAwDrD;;;;;;GAMG;AACH,wBAAuB,YAAY,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,KAAK,GACV,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAiD/B;AAED;;;;;;GAMG;AACH,wBAAuB,YAAY,CACjC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,KAAK,GACV,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAiD/B;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,KAAK,EACX,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC,CAuChC;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,KAAK,EACX,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,qBAAqB,CAAC,CAuChC;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAgCjF"}
@@ -1,48 +0,0 @@
1
- import type { XAuth } from "./auth";
2
- import type { Post } from "./posts";
3
- import type { Profile } from "./profile";
4
- /**
5
- * The categories that can be used in X searches.
6
- */
7
- /**
8
- * Enum representing different search modes.
9
- * @enum {number}
10
- */
11
- export declare enum SearchMode {
12
- Top = 0,
13
- Latest = 1,
14
- Photos = 2,
15
- Videos = 3,
16
- Users = 4
17
- }
18
- /**
19
- * Search for posts using X API v2
20
- *
21
- * @param query Search query
22
- * @param maxPosts Maximum number of posts to return
23
- * @param searchMode Search mode (not all modes are supported in v2)
24
- * @param auth Authentication
25
- * @returns Async generator of posts
26
- */
27
- export declare function searchPosts(query: string, maxPosts: number, searchMode: SearchMode, auth: XAuth): AsyncGenerator<Post, void>;
28
- /**
29
- * Search for users using X API v2.
30
- * User search is limited in standard X API v2 -
31
- * searches for users mentioned in posts matching the query.
32
- *
33
- * @param query Search query
34
- * @param maxProfiles Maximum number of profiles to return
35
- * @param auth Authentication
36
- * @returns Async generator of profiles
37
- */
38
- export declare function searchProfiles(query: string, maxProfiles: number, auth: XAuth): AsyncGenerator<Profile, void>;
39
- /**
40
- * Fetch posts quoting a specific post
41
- *
42
- * @param quotedPostId The ID of the quoted post
43
- * @param maxPosts Maximum number of posts to return
44
- * @param auth Authentication
45
- * @returns Async generator of posts
46
- */
47
- export declare function searchQuotedPosts(quotedPostId: string, maxPosts: number, auth: XAuth): AsyncGenerator<Post, void>;
48
- //# sourceMappingURL=search.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../client/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH;;;GAGG;AAEH,oBAAY,UAAU;IACpB,GAAG,IAAI;IACP,MAAM,IAAI;IACV,MAAM,IAAI;IACV,MAAM,IAAI;IACV,KAAK,IAAI;CACV;AAED;;;;;;;;GAQG;AACH,wBAAuB,WAAW,CAChC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,KAAK,GACV,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CA6E5B;AAED;;;;;;;;;GASG;AACH,wBAAuB,cAAc,CACnC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,KAAK,GACV,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CA6D/B;AAED;;;;;;;GAOG;AACH,wBAAuB,iBAAiB,CACtC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,KAAK,GACV,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAM5B"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Common types for X plugin API responses.
3
- * Uses type-only imports to avoid circular dependencies.
4
- * Profile and Post interfaces are defined in profile.ts and posts.ts.
5
- */
6
- import type { Post } from "./posts";
7
- import type { Profile } from "./profile";
8
- /**
9
- * Response for paginated posts queries
10
- */
11
- export interface QueryPostsResponse {
12
- posts: Post[];
13
- next?: string;
14
- previous?: string;
15
- }
16
- /**
17
- * Response for paginated profiles queries
18
- */
19
- export interface QueryProfilesResponse {
20
- profiles: Profile[];
21
- next?: string;
22
- previous?: string;
23
- }
24
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../client/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -1,5 +0,0 @@
1
- export declare const X_SERVICE_NAME = "x";
2
- export declare const TWEET_CHAR_LIMIT = 280;
3
- export declare const TWEET_MAX_LENGTH = 280;
4
- export declare const THREAD_TWEET_MAX_LENGTH = 4000;
5
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,uBAAuB,OAAO,CAAC"}