diff --git a/README.md b/README.md index 0a79ecd..94e1a15 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Twitter API v2 -[![Twitter API v2 badge](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2)](https://developer.twitter.com/en/docs/twitter-api/early-access) -[![Twitter API v1.1 badge](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fstandard)](https://developer.twitter.com/en/docs/twitter-api/v1) +[![Twitter API v2 badge](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2)](https://developer.x.com/en/docs/twitter-api/early-access) +[![Twitter API v1.1 badge](https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fstandard)](https://developer.x.com/en/docs/twitter-api/v1) [![Version badge](https://badgen.net/github/release/PLhery/node-twitter-api-v2)](https://github.com/PLhery/node-twitter-api-v2) [![Checks badge](https://github.com/PLhery/node-twitter-api-v2/actions/workflows/CI.yml/badge.svg)](https://github.com/PLhery/node-twitter-api-v2/actions/workflows/CI.yml) [![Package size badge](https://badgen.net/bundlephobia/minzip/twitter-api-v2)](https://bundlephobia.com/package/twitter-api-v2) @@ -12,7 +12,7 @@ Main maintainer: [@alkihis](https://github.com/alkihis) - (https://twitter.com/plhery)", + "author": "Paul-Louis Hery (https://x.com/plhery)", "license": "Apache-2.0", "files": [ "dist" @@ -56,4 +56,4 @@ "bugs": { "url": "https://github.com/plhery/node-twitter-api/issues" } -} +} \ No newline at end of file diff --git a/src/client-mixins/request-handler.helper.ts b/src/client-mixins/request-handler.helper.ts index dfc45d9..ed5968c 100644 --- a/src/client-mixins/request-handler.helper.ts +++ b/src/client-mixins/request-handler.helper.ts @@ -43,7 +43,7 @@ export class RequestHandlerHelper { } protected isFormEncodedEndpoint() { - return this.requestData.url.href.startsWith('https://api.twitter.com/oauth/'); + return this.requestData.url.href.startsWith('https://api.x.com/oauth/'); } /* Error helpers */ diff --git a/src/client-mixins/request-param.helper.ts b/src/client-mixins/request-param.helper.ts index b2e34cc..299c9b2 100644 --- a/src/client-mixins/request-param.helper.ts +++ b/src/client-mixins/request-param.helper.ts @@ -39,7 +39,7 @@ export class RequestParamHelpers { return 'json'; } - if (url.hostname === 'upload.twitter.com') { + if (url.hostname === 'upload.x.com') { if (url.pathname === '/1.1/media/upload.json') { return 'form-data'; } @@ -165,7 +165,7 @@ export class RequestParamHelpers { /** * Replace URL parameters available in pathname, like `:id`, with data given in `parameters`: - * `https://twitter.com/:id.json` + `{ id: '20' }` => `https://twitter.com/20.json` + * `https://x.com/:id.json` + `{ id: '20' }` => `https://x.com/20.json` */ static applyRequestParametersToUrl(url: URL, parameters: TRequestQuery) { url.pathname = url.pathname.replace(/:([A-Z_-]+)/ig, (fullMatch, paramName: string) => { diff --git a/src/client/readonly.ts b/src/client/readonly.ts index a0e9f07..8563710 100644 --- a/src/client/readonly.ts +++ b/src/client/readonly.ts @@ -94,10 +94,10 @@ export default class TwitterApiReadOnly extends TwitterApiBase { }: Partial = {} ) { const oauthResult = await this.post( - 'https://api.twitter.com/oauth/request_token', + 'https://api.x.com/oauth/request_token', { oauth_callback, x_auth_access_type: authAccessType } ); - let url = `https://api.twitter.com/oauth/${linkMode}?oauth_token=${encodeURIComponent(oauthResult.oauth_token)}`; + let url = `https://api.x.com/oauth/${linkMode}?oauth_token=${encodeURIComponent(oauthResult.oauth_token)}`; if (forceLogin !== undefined) { url += `&force_login=${encodeURIComponent(forceLogin)}`; @@ -147,7 +147,7 @@ export default class TwitterApiReadOnly extends TwitterApiBase { throw new Error('You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login'); const oauth_result = await this.post( - 'https://api.twitter.com/oauth/access_token', + 'https://api.x.com/oauth/access_token', { oauth_token: tokens.accessToken, oauth_verifier } ); @@ -186,7 +186,7 @@ export default class TwitterApiReadOnly extends TwitterApiBase { // Create a client with Basic authentication const basicClient = new TwitterApi({ username: tokens.appKey, password: tokens.appSecret }, this._requestMaker.clientSettings); - const res = await basicClient.post('https://api.twitter.com/oauth2/token', { grant_type: 'client_credentials' }); + const res = await basicClient.post('https://api.x.com/oauth2/token', { grant_type: 'client_credentials' }); // New object with Bearer token return new TwitterApi(res.access_token, this._requestMaker.clientSettings); @@ -200,7 +200,7 @@ export default class TwitterApiReadOnly extends TwitterApiBase { * - **You can only use v2 API endpoints with this authentication method.** * - **You need to specify which scope you want to have when you create your auth link. Make sure it matches your needs.** * - * See https://developer.twitter.com/en/docs/authentication/oauth-2-0/user-access-token for details. + * See https://developer.x.com/en/docs/authentication/oauth-2-0/user-access-token for details. * * ```ts * // Instantiate TwitterApi with client ID @@ -230,7 +230,7 @@ export default class TwitterApiReadOnly extends TwitterApiBase { const rawScope = options.scope ?? ''; const scope = Array.isArray(rawScope) ? rawScope.join(' ') : rawScope; - const url = new URL('https://twitter.com/i/oauth2/authorize'); + const url = new URL('https://x.com/i/oauth2/authorize'); const query = { response_type: 'code', client_id: this._requestMaker.clientId, @@ -293,7 +293,7 @@ export default class TwitterApiReadOnly extends TwitterApiBase { ); } - const accessTokenResult = await this.post('https://api.twitter.com/2/oauth2/token', { + const accessTokenResult = await this.post('https://api.x.com/2/oauth2/token', { code, code_verifier: codeVerifier, redirect_uri: redirectUri, @@ -323,7 +323,7 @@ export default class TwitterApiReadOnly extends TwitterApiBase { ); } - const accessTokenResult = await this.post('https://api.twitter.com/2/oauth2/token', { + const accessTokenResult = await this.post('https://api.x.com/2/oauth2/token', { refresh_token: refreshToken, grant_type: 'refresh_token', client_id: this._requestMaker.clientId, @@ -347,7 +347,7 @@ export default class TwitterApiReadOnly extends TwitterApiBase { ); } - return await this.post('https://api.twitter.com/2/oauth2/revoke', { + return await this.post('https://api.x.com/2/oauth2/revoke', { client_id: this._requestMaker.clientId, client_secret: this._requestMaker.clientSecret, token, diff --git a/src/globals.ts b/src/globals.ts index 1497d54..7c6a4e1 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -1,5 +1,5 @@ -export const API_V2_PREFIX = 'https://api.twitter.com/2/'; -export const API_V2_LABS_PREFIX = 'https://api.twitter.com/labs/2/'; -export const API_V1_1_PREFIX = 'https://api.twitter.com/1.1/'; -export const API_V1_1_UPLOAD_PREFIX = 'https://upload.twitter.com/1.1/'; -export const API_V1_1_STREAM_PREFIX = 'https://stream.twitter.com/1.1/'; +export const API_V2_PREFIX = 'https://api.x.com/2/'; +export const API_V2_LABS_PREFIX = 'https://api.x.com/labs/2/'; +export const API_V1_1_PREFIX = 'https://api.x.com/1.1/'; +export const API_V1_1_UPLOAD_PREFIX = 'https://upload.x.com/1.1/'; +export const API_V1_1_STREAM_PREFIX = 'https://stream.x.com/1.1/'; diff --git a/src/types/errors.types.ts b/src/types/errors.types.ts index 823ed40..bd46b59 100644 --- a/src/types/errors.types.ts +++ b/src/types/errors.types.ts @@ -338,23 +338,23 @@ export enum EApiV1ErrorCode { export enum EApiV2ErrorCode { // Request errors - InvalidRequest = 'https://api.twitter.com/2/problems/invalid-request', - ClientForbidden = 'https://api.twitter.com/2/problems/client-forbidden', - UnsupportedAuthentication = 'https://api.twitter.com/2/problems/unsupported-authentication', + InvalidRequest = 'https://developer.x.com/en/support/x-api/error-troubleshooting#invalid-request', + ClientForbidden = 'https://developer.x.com/en/support/x-api/error-troubleshooting#client-forbidden', + UnsupportedAuthentication = 'https://developer.x.com/en/support/x-api/error-troubleshooting#unsupported-authentication', // Stream rules errors - InvalidRules = 'https://api.twitter.com/2/problems/invalid-rules', - TooManyRules = 'https://api.twitter.com/2/problems/rule-cap', - DuplicatedRules = 'https://api.twitter.com/2/problems/duplicate-rules', + InvalidRules = 'https://developer.x.com/en/support/x-api/error-troubleshooting#invalid-rules', + TooManyRules = 'https://developer.x.com/en/support/x-api/error-troubleshooting#rule-cap', + DuplicatedRules = 'https://developer.x.com/en/support/x-api/error-troubleshooting#duplicate-rules', // Twitter errors - RateLimitExceeded = 'https://api.twitter.com/2/problems/usage-capped', - ConnectionError = 'https://api.twitter.com/2/problems/streaming-connection', - ClientDisconnected = 'https://api.twitter.com/2/problems/client-disconnected', - TwitterDisconnectedYou = 'https://api.twitter.com/2/problems/operational-disconnect', + RateLimitExceeded = 'https://developer.x.com/en/support/x-api/error-troubleshooting#usage-capped', + ConnectionError = 'https://developer.x.com/en/support/x-api/error-troubleshooting#streaming-connection', + ClientDisconnected = 'https://developer.x.com/en/support/x-api/error-troubleshooting#client-disconnected', + TwitterDisconnectedYou = 'https://developer.x.com/en/support/x-api/error-troubleshooting#operational-disconnect', // Resource errors - ResourceNotFound = 'https://api.twitter.com/2/problems/resource-not-found', - ResourceUnauthorized = 'https://api.twitter.com/2/problems/not-authorized-for-resource', - DisallowedResource = 'https://api.twitter.com/2/problems/disallowed-resource', + ResourceNotFound = 'https://developer.x.com/en/support/x-api/error-troubleshooting#resource-not-found', + ResourceUnauthorized = 'https://developer.x.com/en/support/x-api/error-troubleshooting#not-authorized-for-resource', + DisallowedResource = 'https://developer.x.com/en/support/x-api/error-troubleshooting#disallowed-resource', } diff --git a/src/types/v1/streaming.v1.types.ts b/src/types/v1/streaming.v1.types.ts index c4c78ed..fc47324 100644 --- a/src/types/v1/streaming.v1.types.ts +++ b/src/types/v1/streaming.v1.types.ts @@ -7,7 +7,7 @@ export interface AskTweetStreamV1Params { } /** - * See https://developer.twitter.com/en/docs/twitter-api/v1/tweets/filter-realtime/guides/basic-stream-parameters + * See https://developer.x.com/en/docs/twitter-api/v1/tweets/filter-realtime/guides/basic-stream-parameters * for detailed documentation. */ export interface FilterStreamV1Params extends AskTweetStreamV1Params { diff --git a/src/v1/client.v1.read.ts b/src/v1/client.v1.read.ts index 8742ca4..36bd719 100644 --- a/src/v1/client.v1.read.ts +++ b/src/v1/client.v1.read.ts @@ -85,7 +85,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a single Tweet, specified by the id parameter. The Tweet's author will also be embedded within the Tweet. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id */ public singleTweet(tweetId: string, options: Partial = {}) { return this.get('statuses/show.json', { tweet_mode: 'extended', id: tweetId, ...options }); @@ -93,7 +93,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns fully-hydrated Tweet objects for up to 100 Tweets per request. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-lookup */ public tweets(ids: string | string[], options?: TweetLookupNoMapV1Params): Promise; public tweets(ids: string | string[], options: TweetLookupMapV1Params): Promise; @@ -104,16 +104,16 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a single Tweet, specified by either a Tweet web URL or the Tweet ID, in an oEmbed-compatible format. * The returned HTML snippet will be automatically recognized as an Embedded Tweet when Twitter's widget JavaScript is included on the page. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-oembed */ public oembedTweet(tweetId: string, options: Partial = {}) { return this.get( 'oembed', { - url: `https://twitter.com/i/statuses/${tweetId}`, + url: `https://x.com/i/statuses/${tweetId}`, ...options, }, - { prefix: 'https://publish.twitter.com/' }, + { prefix: 'https://publish.x.com/' }, ); } @@ -122,7 +122,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a collection of the most recent Tweets and Retweets posted by the authenticating user and the users they follow. * The home timeline is central to how most users interact with the Twitter service. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-home_timeline + * https://developer.x.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-home_timeline */ public async homeTimeline(options: Partial = {}) { const queryParams: Partial = { @@ -141,8 +141,8 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the 20 most recent mentions (Tweets containing a users's @screen_name) for the authenticating user. - * The timeline returned is the equivalent of the one seen when you view your mentions on twitter.com. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline + * The timeline returned is the equivalent of the one seen when you view your mentions on x.com. + * https://developer.x.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-mentions_timeline */ public async mentionTimeline(options: Partial = {}) { const queryParams: Partial = { @@ -162,7 +162,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a collection of the most recent Tweets posted by the user indicated by the user_id parameters. * User timelines belonging to protected users may only be requested when the authenticated user either "owns" the timeline or is an approved follower of the owner. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline + * https://developer.x.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline */ public async userTimeline(userId: string, options: Partial = {}) { const queryParams: Partial = { @@ -183,7 +183,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a collection of the most recent Tweets posted by the user indicated by the screen_name parameters. * User timelines belonging to protected users may only be requested when the authenticated user either "owns" the timeline or is an approved follower of the owner. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline + * https://developer.x.com/en/docs/twitter-api/v1/tweets/timelines/api-reference/get-statuses-user_timeline */ public async userTimelineByUsername(username: string, options: Partial = {}) { const queryParams: Partial = { @@ -204,7 +204,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the most recent Tweets liked by the authenticating or specified user, 20 tweets by default. * Note: favorites are now known as likes. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list */ public async favoriteTimeline(userId: string, options: Partial = {}) { const queryParams: Partial = { @@ -225,7 +225,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the most recent Tweets liked by the authenticating or specified user, 20 tweets by default. * Note: favorites are now known as likes. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-favorites-list */ public async favoriteTimelineByUsername(username: string, options: Partial = {}) { const queryParams: Partial = { @@ -248,7 +248,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a variety of information about the user specified by the required user_id or screen_name parameter. * The author's most recent Tweet will be returned inline when possible. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show */ public user(user: UserShowV1Params) { return this.get('users/show.json', { tweet_mode: 'extended', ...user }); @@ -257,7 +257,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns fully-hydrated user objects for up to 100 users per request, * as specified by comma-separated values passed to the user_id and/or screen_name parameters. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-lookup */ public users(query: UserLookupV1Params) { return this.get('users/lookup.json', { tweet_mode: 'extended', ...query }); @@ -267,7 +267,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { * Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; * returns a 401 status code and an error message if not. * Use this method to test if supplied user credentials are valid. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-verify_credentials */ public verifyCredentials(options: Partial = {}) { return this.get('account/verify_credentials.json', options); @@ -275,7 +275,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns an array of user objects the authenticating user has muted. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-list */ public async listMutedUsers(options: Partial = {}) { const queryParams: Partial = { @@ -294,7 +294,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns an array of numeric user ids the authenticating user has muted. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-ids + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/get-mutes-users-ids */ public async listMutedUserIds(options: Partial = {}) { const queryParams: Partial = { @@ -313,7 +313,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns an array of user objects of friends of the specified user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-list + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-list */ public async userFriendList(options: Partial = {}) { const queryParams: Partial = { @@ -331,7 +331,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns an array of user objects of followers of the specified user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-list + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-list */ public async userFollowerList(options: Partial = {}) { const queryParams: Partial = { @@ -349,7 +349,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns an array of numeric user ids of followers of the specified user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids */ public async userFollowerIds(options: Partial = {}) { const queryParams: Partial = { @@ -368,7 +368,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns an array of numeric user ids of friends of the specified user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friends-ids */ public async userFollowingIds(options: Partial = {}) { const queryParams: Partial = { @@ -387,7 +387,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Provides a simple, relevance-based search interface to public user accounts on Twitter. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-search + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-search */ public async searchUsers(query: string, options: Partial = {}) { const queryParams: Partial = { @@ -410,7 +410,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns detailed information about the relationship between two arbitrary users. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show */ public friendship(sources: FriendshipShowV1Params) { return this.get('friendships/show.json', sources as Partial); @@ -418,7 +418,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the relationships of the authenticating user to the comma-separated list of up to 100 screen_names or user_ids provided. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-lookup */ public friendships(friendships: FriendshipLookupV1Params) { return this.get('friendships/lookup.json', friendships as Partial); @@ -426,7 +426,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a collection of user_ids that the currently authenticated user does not want to receive retweets from. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-no_retweets-ids + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-no_retweets-ids */ public friendshipsNoRetweets() { return this.get('friendships/no_retweets/ids.json', { stringify_ids: true }); @@ -434,7 +434,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a collection of numeric IDs for every user who has a pending request to follow the authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-incoming */ public async friendshipsIncoming(options: Partial = {}) { const queryParams: Partial = { @@ -453,7 +453,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a collection of numeric IDs for every protected user for whom the authenticating user has a pending follow request. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-outgoing + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-friendships-outgoing */ public async friendshipsOutgoing(options: Partial = {}) { const queryParams: Partial = { @@ -474,7 +474,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Get current account settings for authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings */ public accountSettings() { return this.get('account/settings.json'); @@ -483,7 +483,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a map of the available size variations of the specified user's profile banner. * If the user has not uploaded a profile banner, a HTTP 404 will be served instead. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-users-profile_banner + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-users-profile_banner */ public userProfileBannerSizes(params: ProfileBannerSizeV1Params) { return this.get('users/profile_banner.json', params); @@ -493,7 +493,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-show */ public list(options: GetListV1Params) { return this.get('lists/show.json', { tweet_mode: 'extended', ...options }); @@ -502,7 +502,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns all lists the authenticating or specified user subscribes to, including their own. * If no user is given, the authenticating user is used. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list */ public lists(options: ListListsV1Params = {}) { return this.get('lists/list.json', { tweet_mode: 'extended', ...options }); @@ -510,7 +510,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the members of the specified list. Private list members will only be shown if the authenticated user owns the specified list. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members */ public async listMembers(options: Partial = {}) { const queryParams: Partial = { @@ -529,7 +529,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Check if the specified user is a member of the specified list. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-members-show */ public listGetMember(options: ListMemberShowV1Params) { return this.get('lists/members/show.json', { tweet_mode: 'extended', ...options }); @@ -538,7 +538,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the lists the specified user has been added to. * If user_id or screen_name are not provided, the memberships for the authenticating user are returned. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-memberships */ public async listMemberships(options: Partial = {}) { const queryParams: Partial = { @@ -557,7 +557,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the lists owned by the specified Twitter user. Private lists will only be shown if the authenticated user is also the owner of the lists. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-ownerships */ public async listOwnerships(options: Partial = {}) { const queryParams: Partial = { @@ -576,7 +576,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a timeline of tweets authored by members of the specified list. Retweets are included by default. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-statuses */ public async listStatuses(options: Partial) { const queryParams: Partial = { @@ -595,7 +595,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the subscribers of the specified list. Private list subscribers will only be shown if the authenticated user owns the specified list. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers */ public async listSubscribers(options: Partial = {}) { const queryParams: Partial = { @@ -614,7 +614,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Check if the specified user is a subscriber of the specified list. Returns the user if they are a subscriber. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscribers-show */ public listGetSubscriber(options: ListMemberShowV1Params) { return this.get('lists/subscribers/show.json', { tweet_mode: 'extended', ...options }); @@ -623,7 +623,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Obtain a collection of the lists the specified user is subscribed to, 20 lists per page by default. * Does not include the user's own lists. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions */ public async listSubscriptions(options: Partial = {}) { const queryParams: Partial = { @@ -645,7 +645,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * The STATUS command (this method) is used to periodically poll for updates of media processing operation. * After the STATUS command response returns succeeded, you can move on to the next step which is usually create Tweet with media_id. - * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/get-media-upload-status + * https://developer.x.com/en/docs/twitter-api/v1/media/upload-media/api-reference/get-media-upload-status */ public mediaInfo(mediaId: string) { return this.get( @@ -663,7 +663,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns public statuses that match one or more filter predicates. * Multiple parameters may be specified which allows most clients to use a single connection to the Streaming API. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/filter-realtime/api-reference/post-statuses-filter + * https://developer.x.com/en/docs/twitter-api/v1/tweets/filter-realtime/api-reference/post-statuses-filter */ public filterStream(params?: Partial & { autoConnect?: true }): Promise>; public filterStream(params: Partial & { autoConnect: false }): TweetStream; @@ -692,7 +692,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns a small random sample of all public statuses. * The Tweets returned by the default access level are the same, so if two different clients connect to this endpoint, they will see the same Tweets. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/sample-realtime/api-reference/get-statuses-sample + * https://developer.x.com/en/docs/twitter-api/v1/tweets/sample-realtime/api-reference/get-statuses-sample */ public sampleStream(params?: Partial & { autoConnect?: true }): Promise>; public sampleStream(params: Partial & { autoConnect: false }): TweetStream; @@ -704,7 +704,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { } /** - * Create a client that is prefixed with `https//stream.twitter.com` instead of classic API URL. + * Create a client that is prefixed with `https//stream.x.com` instead of classic API URL. */ public get stream(): this { const copiedClient = new TwitterApiv1(this); @@ -718,7 +718,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the top 50 trending topics for a specific id, if trending information is available for it. * Note: The id parameter for this endpoint is the "where on earth identifier" or WOEID, which is a legacy identifier created by Yahoo and has been deprecated. - * https://developer.twitter.com/en/docs/twitter-api/v1/trends/trends-for-location/api-reference/get-trends-place + * https://developer.x.com/en/docs/twitter-api/v1/trends/trends-for-location/api-reference/get-trends-place */ public trendsByPlace(woeId: string | number, options: Partial = {}) { return this.get('trends/place.json', { id: woeId, ...options }); @@ -728,7 +728,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { * Returns the locations that Twitter has trending topic information for. * The response is an array of "locations" that encode the location's WOEID * and some other human-readable information such as a canonical name and country the location belongs in. - * https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-available + * https://developer.x.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-available */ public trendsAvailable() { return this.get('trends/available.json'); @@ -736,7 +736,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the locations that Twitter has trending topic information for, closest to a specified location. - * https://developer.twitter.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-closest + * https://developer.x.com/en/docs/twitter-api/v1/trends/locations-with-trending-topics/api-reference/get-trends-closest */ public trendsClosest(lat: number, long: number) { return this.get('trends/closest.json', { lat, long }); @@ -746,7 +746,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns all the information about a known place. - * https://developer.twitter.com/en/docs/twitter-api/v1/geo/place-information/api-reference/get-geo-id-place_id + * https://developer.x.com/en/docs/twitter-api/v1/geo/place-information/api-reference/get-geo-id-place_id */ public geoPlace(placeId: string) { return this.get('geo/id/:place_id.json', undefined, { params: { place_id: placeId } }); @@ -755,7 +755,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Search for places that can be attached to a Tweet via POST statuses/update. * This request will return a list of all the valid places that can be used as the place_id when updating a status. - * https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-search + * https://developer.x.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-search */ public geoSearch(options: Partial) { return this.get('geo/search.json', options); @@ -764,7 +764,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Given a latitude and a longitude, searches for up to 20 places that can be used as a place_id when updating a status. * This request is an informative call and will deliver generalized results about geography. - * https://developer.twitter.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-reverse_geocode + * https://developer.x.com/en/docs/twitter-api/v1/geo/places-near-location/api-reference/get-geo-reverse_geocode */ public geoReverseGeoCode(options: ReverseGeoCodeV1Params) { return this.get('geo/reverse_geocode.json', options as Partial); @@ -776,7 +776,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { * Returns the current rate limits for methods belonging to the specified resource families. * Each API resource belongs to a "resource family" which is indicated in its method documentation. * The method's resource family can be determined from the first component of the path after the resource version. - * https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status + * https://developer.x.com/en/docs/twitter-api/v1/developer-utilities/rate-limit-status/api-reference/get-application-rate_limit_status */ public rateLimitStatuses(...resources: TAppRateLimitResourceV1[]) { return this.get('application/rate_limit_status.json', { resources }); @@ -784,7 +784,7 @@ export default class TwitterApiv1ReadOnly extends TwitterApiSubClient { /** * Returns the list of languages supported by Twitter along with the language code supported by Twitter. - * https://developer.twitter.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages + * https://developer.x.com/en/docs/twitter-api/v1/developer-utilities/supported-languages/api-reference/get-help-languages */ public supportedLanguages() { return this.get('help/languages.json'); diff --git a/src/v1/client.v1.ts b/src/v1/client.v1.ts index 352587c..b3d404b 100644 --- a/src/v1/client.v1.ts +++ b/src/v1/client.v1.ts @@ -36,7 +36,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Publishes a new message_create event resulting in a Direct Message sent to a specified user from the authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/new-event */ public sendDm({ recipient_id, custom_profile_id, ...params }: SendDMV1Params) { const args: CreateDMEventV1Args = { @@ -61,7 +61,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Returns a single Direct Message event by the given id. * - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/get-event + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/get-event */ public getDmEvent(id: string) { return this.get('direct_messages/events/show.json', { id }); @@ -70,7 +70,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Deletes the direct message specified in the required ID parameter. * The authenticating user must be the recipient of the specified direct message. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/delete-message-event + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/delete-message-event */ public deleteDm(id: string) { return this.delete('direct_messages/events/destroy.json', { id }); @@ -80,7 +80,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { * Returns all Direct Message events (both sent and received) within the last 30 days. * Sorted in reverse-chronological order. * - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events */ public async listDmEvents(args: Partial = {}) { const queryParams = { ...args }; @@ -98,7 +98,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Creates a new Welcome Message that will be stored and sent in the future from the authenticating user in defined circumstances. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message */ public newWelcomeDm(name: string, data: MessageCreateDataV1) { const args: CreateWelcomeDMEventV1Args = { @@ -115,7 +115,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Returns a Welcome Message by the given id. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message */ public getWelcomeDm(id: string) { return this.get('direct_messages/welcome_messages/show.json', { id }); @@ -123,7 +123,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Deletes a Welcome Message by the given id. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message */ public deleteWelcomeDm(id: string) { return this.delete('direct_messages/welcome_messages/destroy.json', { id }); @@ -132,7 +132,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Updates a Welcome Message by the given ID. * Updates to the welcome_message object are atomic. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/update-welcome-message + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/update-welcome-message */ public updateWelcomeDm(id: string, data: MessageCreateDataV1) { const args = { message_data: data }; @@ -146,7 +146,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { * Returns all Direct Message events (both sent and received) within the last 30 days. * Sorted in reverse-chronological order. * - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/sending-and-receiving/api-reference/list-events */ public async listWelcomeDms(args: Partial = {}) { const queryParams = { ...args }; @@ -164,7 +164,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Creates a new Welcome Message Rule that determines which Welcome Message will be shown in a given conversation. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message-rule + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/new-welcome-message-rule */ public newWelcomeDmRule(welcomeMessageId: string) { return this.post('direct_messages/welcome_messages/rules/new.json', { @@ -176,7 +176,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Returns a Welcome Message Rule by the given id. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message-rule + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/get-welcome-message-rule */ public getWelcomeDmRule(id: string) { return this.get('direct_messages/welcome_messages/rules/show.json', { id }); @@ -184,7 +184,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Deletes a Welcome Message Rule by the given id. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message-rule + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/delete-welcome-message-rule */ public deleteWelcomeDmRule(id: string) { return this.delete('direct_messages/welcome_messages/rules/destroy.json', { id }); @@ -192,7 +192,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Retrieves all welcome DM rules for this account. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/list-welcome-message-rules + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/api-reference/list-welcome-message-rules */ public async listWelcomeDmRules(args: Partial = {}) { const queryParams = { ...args }; @@ -225,7 +225,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Marks a message as read in the recipient’s Direct Message conversation view with the sender. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-read-receipt + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-read-receipt */ public markDmAsRead(lastEventId: string, recipientId: string) { return this.post('direct_messages/mark_read.json', { @@ -236,7 +236,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Displays a visual typing indicator in the recipient’s Direct Message conversation view with the sender. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-typing-indicator + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/typing-indicator-and-read-receipts/api-reference/new-typing-indicator */ public indicateDmTyping(recipientId: string) { return this.post('direct_messages/indicate_typing.json', { @@ -248,7 +248,7 @@ export class TwitterApiv1 extends TwitterApiv1ReadWrite { /** * Get a single image attached to a direct message. TwitterApi client must be logged with OAuth 1.0a. - * https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/message-attachments/guides/retrieving-media + * https://developer.x.com/en/docs/twitter-api/v1/direct-messages/message-attachments/guides/retrieving-media */ public async downloadDmImage(urlOrDm: string | DirectMessageCreateV1) { if (typeof urlOrDm !== 'string') { diff --git a/src/v1/client.v1.write.ts b/src/v1/client.v1.write.ts index d00ecac..ffe1a1d 100644 --- a/src/v1/client.v1.write.ts +++ b/src/v1/client.v1.write.ts @@ -51,7 +51,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Post a new tweet. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update */ public tweet(status: string, payload: Partial = {}) { const queryParams: Partial = { @@ -65,16 +65,16 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Quote an existing tweet. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update */ public async quote(status: string, quotingStatusId: string, payload: Partial = {}) { - const url = 'https://twitter.com/i/statuses/' + quotingStatusId; + const url = 'https://x.com/i/statuses/' + quotingStatusId; return this.tweet(status, { ...payload, attachment_url: url }); } /** * Post a series of tweets. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update */ public async tweetThread(tweets: (SendTweetV1Params | string)[]) { const postedTweets: TweetV1[] = []; @@ -100,7 +100,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Reply to an existing tweet. Shortcut to `.tweet` with tweaked parameters. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-update */ public reply(status: string, in_reply_to_status_id: string, payload: Partial = {}) { return this.tweet(status, { @@ -112,7 +112,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Delete an existing tweet belonging to you. - * https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id + * https://developer.x.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/post-statuses-destroy-id */ public deleteTweet(tweetId: string) { return this.post('statuses/destroy/:id.json', { tweet_mode: 'extended' }, { params: { id: tweetId } }); @@ -123,7 +123,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Report the specified user as a spam account to Twitter. * Additionally, optionally performs the equivalent of POST blocks/create on behalf of the authenticated user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-users-report_spam + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/mute-block-report-users/api-reference/post-users-report_spam */ public reportUserAsSpam(options: ReportSpamV1Params) { return this.post('users/report_spam.json', { tweet_mode: 'extended', ...options }); @@ -131,7 +131,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Turn on/off Retweets and device notifications from the specified user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-update + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-update */ public updateFriendship(options: Partial) { return this.post('friendships/update.json', options); @@ -139,7 +139,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Follow the specified user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-create + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-create */ public createFriendship(options: Partial) { return this.post('friendships/create.json', options); @@ -147,7 +147,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Unfollow the specified user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy */ public destroyFriendship(options: Partial) { return this.post('friendships/destroy.json', options); @@ -157,7 +157,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Update current account settings for authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/get-account-settings */ public updateAccountSettings(options: Partial) { return this.post('account/settings.json', options); @@ -165,7 +165,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Sets some values that users are able to set under the "Account" tab of their settings page. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile */ public updateAccountProfile(options: Partial) { return this.post('account/update_profile.json', options); @@ -173,7 +173,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Uploads a profile banner on behalf of the authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_banner */ public async updateAccountProfileBanner(file: TUploadableMedia, options: Partial = {}) { const queryParams = { @@ -185,7 +185,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Updates the authenticating user's profile image. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image */ public async updateAccountProfileImage(file: TUploadableMedia, options: Partial = {}) { const queryParams = { @@ -198,7 +198,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Removes the uploaded profile banner for the authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-remove_profile_banner + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-remove_profile_banner */ public removeAccountProfileBanner() { return this.post('account/remove_profile_banner.json'); @@ -208,7 +208,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Creates a new list for the authenticated user. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-create */ public createList(options: ListCreateV1Params) { return this.post('lists/create.json', { tweet_mode: 'extended', ...options }); @@ -216,7 +216,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Updates the specified list. The authenticated user must own the list to be able to update it. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-update + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-update */ public updateList(options: UpdateListV1Params) { return this.post('lists/update.json', { tweet_mode: 'extended', ...options }); @@ -224,7 +224,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Deletes the specified list. The authenticated user must own the list to be able to destroy it. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-destroy */ public removeList(options: GetListV1Params) { return this.post('lists/destroy.json', { tweet_mode: 'extended', ...options }); @@ -234,7 +234,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { * Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. * If you add a single `user_id` or `screen_name`, it will target `lists/members/create.json`, otherwise * it will target `lists/members/create_all.json`. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create_all + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-create_all */ public addListMembers(options: AddOrRemoveListMembersV1Params) { const hasMultiple = (options.user_id && hasMultipleItems(options.user_id)) || (options.screen_name && hasMultipleItems(options.screen_name)); @@ -247,7 +247,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { * Removes multiple members to a list, by specifying a comma-separated list of member ids or screen names. * If you add a single `user_id` or `screen_name`, it will target `lists/members/destroy.json`, otherwise * it will target `lists/members/destroy_all.json`. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy_all + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-members-destroy_all */ public removeListMembers(options: AddOrRemoveListMembersV1Params) { const hasMultiple = (options.user_id && hasMultipleItems(options.user_id)) || (options.screen_name && hasMultipleItems(options.screen_name)); @@ -258,7 +258,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Subscribes the authenticated user to the specified list. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-create + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-create */ public subscribeToList(options: GetListV1Params) { return this.post('lists/subscribers/create.json', { tweet_mode: 'extended', ...options }); @@ -266,7 +266,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Unsubscribes the authenticated user of the specified list. - * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-destroy + * https://developer.x.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/post-lists-subscribers-destroy */ public unsubscribeOfList(options: GetListV1Params) { return this.post('lists/subscribers/destroy.json', { tweet_mode: 'extended', ...options }); @@ -277,7 +277,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * This endpoint can be used to provide additional information about the uploaded media_id. * This feature is currently only supported for images and GIFs. - * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-metadata-create + * https://developer.x.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-metadata-create */ public createMediaMetadata(mediaId: string, metadata: Partial) { return this.post( @@ -291,7 +291,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { * Use this endpoint to associate uploaded subtitles to an uploaded video. You can associate subtitles to video before or after Tweeting. * **To obtain subtitle media ID, you must upload each subtitle file separately using `.uploadMedia()` method.** * - * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-create + * https://developer.x.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-create */ public createMediaSubtitles(mediaId: string, subtitles: MediaSubtitleV1Param[]) { return this.post( @@ -303,7 +303,7 @@ export default class TwitterApiv1ReadWrite extends TwitterApiv1ReadOnly { /** * Use this endpoint to dissociate subtitles from a video and delete the subtitles. You can dissociate subtitles from a video before or after Tweeting. - * https://developer.twitter.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-delete + * https://developer.x.com/en/docs/twitter-api/v1/media/upload-media/api-reference/post-media-subtitles-delete */ public deleteMediaSubtitles(mediaId: string, ...languages: string[]) { return this.post( diff --git a/src/v2/client.v2.read.ts b/src/v2/client.v2.read.ts index 5e44cc7..9df8fb6 100644 --- a/src/v2/client.v2.read.ts +++ b/src/v2/client.v2.read.ts @@ -99,7 +99,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * The recent search endpoint returns Tweets from the last seven days that match a search query. - * https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent + * https://developer.x.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-recent */ public async search(options: Tweetv2SearchParams): Promise; public async search(query: string, options?: Partial): Promise @@ -122,7 +122,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * since the first Tweet was created March 26, 2006. * * This endpoint is only available to those users who have been approved for the Academic Research product track. - * https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all + * https://developer.x.com/en/docs/twitter-api/tweets/search/api-reference/get-tweets-search-all */ public async searchAll(query: string, options: Partial = {}) { const queryParams = { ...options, query }; @@ -138,7 +138,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a variety of information about a single Tweet specified by the requested ID. - * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id + * https://developer.x.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets-id * * OAuth2 scope: `users.read`, `tweet.read` */ @@ -148,7 +148,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a variety of information about tweets specified by list of IDs. - * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets + * https://developer.x.com/en/docs/twitter-api/tweets/lookup/api-reference/get-tweets * * OAuth2 scope: `users.read`, `tweet.read` */ @@ -159,7 +159,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * The recent Tweet counts endpoint returns count of Tweets from the last seven days that match a search query. * OAuth2 Bearer auth only. - * https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent + * https://developer.x.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-recent */ public tweetCountRecent(query: string, options: Partial = {}) { return this.get('tweets/counts/recent', { query, ...options }); @@ -171,7 +171,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * since the first Tweet was created March 26, 2006. * OAuth2 Bearer auth only. * **This endpoint has pagination, yet it is not supported by bundled paginators. Use `next_token` to fetch next page.** - * https://developer.twitter.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-all + * https://developer.x.com/en/docs/twitter-api/tweets/counts/api-reference/get-tweets-counts-all */ public tweetCountAll(query: string, options: Partial = {}) { return this.get('tweets/counts/all', { query, ...options }); @@ -179,7 +179,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Allows you to get information about who has Retweeted a Tweet. - * https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/get-tweets-id-retweeted_by + * https://developer.x.com/en/docs/twitter-api/tweets/retweets/api-reference/get-tweets-id-retweeted_by */ public tweetRetweetedBy(tweetId: string, options?: Partial): Promise; public tweetRetweetedBy(tweetId: string, options: TweetRetweetedOrLikedByV2ParamsWithPaginator): Promise; @@ -205,7 +205,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Allows you to get information about who has Liked a Tweet. - * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/get-tweets-id-liking_users + * https://developer.x.com/en/docs/twitter-api/tweets/likes/api-reference/get-tweets-id-liking_users */ public tweetLikedBy(tweetId: string, options?: Partial): Promise; public tweetLikedBy(tweetId: string, options: TweetRetweetedOrLikedByV2ParamsWithPaginator): Promise; @@ -232,7 +232,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Allows you to retrieve a collection of the most recent Tweets and Retweets posted by you and users you follow, also known as home timeline. * This endpoint returns up to the last 3200 Tweets. - * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-reverse-chronological + * https://developer.x.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-reverse-chronological * * OAuth 2 scopes: `tweet.read` `users.read` */ @@ -257,7 +257,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * Returns Tweets composed by a single user, specified by the requested user ID. * By default, the most recent ten Tweets are returned per request. * Using pagination, the most recent 3,200 Tweets can be retrieved. - * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets + * https://developer.x.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-tweets */ public async userTimeline(userId: string, options: Partial = {}) { const initialRq = await this.get('users/:id/tweets', options, { @@ -278,7 +278,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * Returns Tweets mentioning a single user specified by the requested user ID. * By default, the most recent ten Tweets are returned per request. * Using pagination, up to the most recent 800 Tweets can be retrieved. - * https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-mentions + * https://developer.x.com/en/docs/twitter-api/tweets/timelines/api-reference/get-users-id-mentions */ public async userMentionTimeline(userId: string, options: Partial = {}) { const initialRq = await this.get('users/:id/mentions', options, { @@ -297,7 +297,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns Quote Tweets for a Tweet specified by the requested Tweet ID. - * https://developer.twitter.com/en/docs/twitter-api/tweets/quote-tweets/api-reference/get-tweets-id-quote_tweets + * https://developer.x.com/en/docs/twitter-api/tweets/quote-tweets/api-reference/get-tweets-id-quote_tweets * * OAuth2 scopes: `users.read` `tweet.read` */ @@ -320,7 +320,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Allows you to get information about a authenticated user’s 800 most recent bookmarked Tweets. - * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/get-users-id-bookmarks + * https://developer.x.com/en/docs/twitter-api/tweets/bookmarks/api-reference/get-users-id-bookmarks * * OAuth2 scopes: `users.read` `tweet.read` `bookmark.read` */ @@ -344,7 +344,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns information about an authorized user. - * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me + * https://developer.x.com/en/docs/twitter-api/users/lookup/api-reference/get-users-me * * OAuth2 scopes: `tweet.read` & `users.read` */ @@ -354,7 +354,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a variety of information about a single user specified by the requested ID. - * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id + * https://developer.x.com/en/docs/twitter-api/users/lookup/api-reference/get-users-id */ public user(userId: string, options: Partial = {}) { return this.get('users/:id', options, { params: { id: userId } }); @@ -362,7 +362,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a variety of information about one or more users specified by the requested IDs. - * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users + * https://developer.x.com/en/docs/twitter-api/users/lookup/api-reference/get-users */ public users(userIds: string | string[], options: Partial = {}) { const ids = Array.isArray(userIds) ? userIds.join(',') : userIds; @@ -371,7 +371,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a variety of information about a single user specified by their username. - * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by-username-username + * https://developer.x.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by-username-username */ public userByUsername(username: string, options: Partial = {}) { return this.get('users/by/username/:username', options, { params: { username } }); @@ -379,7 +379,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a variety of information about one or more users specified by their usernames. - * https://developer.twitter.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by + * https://developer.x.com/en/docs/twitter-api/users/lookup/api-reference/get-users-by * * OAuth2 scope: `users.read`, `tweet.read` */ @@ -390,7 +390,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of users who are followers of the specified user ID. - * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-followers + * https://developer.x.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-followers */ public followers(userId: string, options?: Partial): Promise; public followers(userId: string, options: FollowersV2ParamsWithPaginator): Promise; @@ -415,7 +415,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of users the specified user ID is following. - * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-following + * https://developer.x.com/en/docs/twitter-api/users/follows/api-reference/get-users-id-following * * OAuth2 scope: `follows.read` */ @@ -442,7 +442,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Allows you to get information about a user’s liked Tweets. - * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/get-users-id-liked_tweets + * https://developer.x.com/en/docs/twitter-api/tweets/likes/api-reference/get-users-id-liked_tweets */ public async userLikedTweets(userId: string, options: Partial = {}) { const params = { id: userId }; @@ -459,7 +459,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of users who are blocked by the authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/get-users-blocking + * https://developer.x.com/en/docs/twitter-api/users/blocks/api-reference/get-users-blocking */ public async userBlockingUsers(userId: string, options: Partial = {}) { const params = { id: userId }; @@ -476,7 +476,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of users who are muted by the authenticating user. - * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/get-users-muting + * https://developer.x.com/en/docs/twitter-api/users/mutes/api-reference/get-users-muting */ public async userMutingUsers(userId: string, options: Partial = {}) { const params = { id: userId }; @@ -495,7 +495,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns the details of a specified List. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-lists-id + * https://developer.x.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-lists-id */ public list(id: string, options: Partial = {}) { return this.get('lists/:id', options, { params: { id } }); @@ -503,7 +503,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns all Lists owned by the specified user. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-users-id-owned_lists + * https://developer.x.com/en/docs/twitter-api/lists/list-lookup/api-reference/get-users-id-owned_lists */ public async listsOwned(userId: string, options: Partial = {}) { const params = { id: userId }; @@ -520,7 +520,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns all Lists a specified user is a member of. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-users-id-list_memberships + * https://developer.x.com/en/docs/twitter-api/lists/list-members/api-reference/get-users-id-list_memberships */ public async listMemberships(userId: string, options: Partial = {}) { const params = { id: userId }; @@ -537,7 +537,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns all Lists a specified user follows. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-users-id-followed_lists + * https://developer.x.com/en/docs/twitter-api/lists/list-follows/api-reference/get-users-id-followed_lists */ public async listFollowed(userId: string, options: Partial = {}) { const params = { id: userId }; @@ -554,7 +554,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of Tweets from the specified List. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-tweets/api-reference/get-lists-id-tweets + * https://developer.x.com/en/docs/twitter-api/lists/list-tweets/api-reference/get-lists-id-tweets */ public async listTweets(listId: string, options: Partial = {}) { const params = { id: listId }; @@ -571,7 +571,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of users who are members of the specified List. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/get-lists-id-members + * https://developer.x.com/en/docs/twitter-api/lists/list-members/api-reference/get-lists-id-members */ public async listMembers(listId: string, options: Partial = {}) { const params = { id: listId }; @@ -588,7 +588,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of users who are followers of the specified List. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-follows/api-reference/get-lists-id-followers + * https://developer.x.com/en/docs/twitter-api/lists/list-follows/api-reference/get-lists-id-followers */ public async listFollowers(listId: string, options: Partial = {}) { const params = { id: listId }; @@ -612,7 +612,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * * OAuth 2 scopes: `dm.read`, `tweet.read`, `user.read` * - * https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_events + * https://developer.x.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_events */ public async listDmEvents(options: Partial = {}) { const initialRq = await this.get('dm_events', options, { fullResponse: true }); @@ -631,7 +631,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * * OAuth 2 scopes: `dm.read`, `tweet.read`, `user.read` * - * https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_conversations-dm_conversation_id-dm_events + * https://developer.x.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_conversations-dm_conversation_id-dm_events */ public async listDmEventsWithParticipant(participantId: string, options: Partial = {}) { const params = { participant_id: participantId }; @@ -652,7 +652,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * * OAuth 2 scopes: `dm.read`, `tweet.read`, `user.read` * - * https://developer.twitter.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_conversations-dm_conversation_id-dm_events + * https://developer.x.com/en/docs/twitter-api/direct-messages/lookup/api-reference/get-dm_conversations-dm_conversation_id-dm_events */ public async listDmEventsOfConversation(dmConversationId: string, options: Partial = {}) { const params = { dm_conversation_id: dmConversationId }; @@ -671,7 +671,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Get a single space by ID. - * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id + * https://developer.x.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id * * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`. */ @@ -681,7 +681,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Get spaces using their IDs. - * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces + * https://developer.x.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces * * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`. */ @@ -691,7 +691,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Get spaces using their creator user ID(s). (no pagination available) - * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids + * https://developer.x.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids * * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`. */ @@ -701,7 +701,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Search through spaces using multiple params. (no pagination available) - * https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search + * https://developer.x.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search */ public searchSpaces(options: SpaceV2SearchParams) { return this.get('spaces/search', options as Partial); @@ -713,7 +713,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * * **OAuth 2.0 Access Token required** * - * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-buyers + * https://developer.x.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-buyers * * OAuth2 scopes: `tweet.read`, `users.read`, `space.read`. */ @@ -723,7 +723,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns Tweets shared in the requested Spaces. - * https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-tweets + * https://developer.x.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id-tweets * * OAuth2 scope: `users.read`, `tweet.read`, `space.read` */ @@ -735,7 +735,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Streams Tweets in real-time based on a specific set of filter rules. - * https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream + * https://developer.x.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream */ public searchStream(options?: Partial & { autoConnect?: true }): Promise>; public searchStream(options: Partial & { autoConnect: false }): TweetStream; @@ -747,7 +747,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Return a list of rules currently active on the streaming endpoint, either as a list or individually. - * https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules + * https://developer.x.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream-rules */ public streamRules(options: Partial = {}) { return this.get('tweets/search/stream/rules', options); @@ -757,7 +757,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * Add or delete rules to your stream. * To create one or more rules, submit an add JSON body with an array of rules and operators. * Similarly, to delete one or more rules, submit a delete JSON body with an array of list of existing rule IDs. - * https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/post-tweets-search-stream-rules + * https://developer.x.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/post-tweets-search-stream-rules */ public updateStreamRules(options: StreamingV2AddRulesParams, query?: Partial): Promise; public updateStreamRules(options: StreamingV2DeleteRulesParams, query?: Partial): Promise; @@ -771,7 +771,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Streams about 1% of all Tweets in real-time. - * https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream + * https://developer.x.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream */ public sampleStream(options?: Partial & { autoConnect?: true }): Promise>; public sampleStream(options: Partial & { autoConnect: false }): TweetStream; @@ -783,7 +783,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Streams about 10% of all Tweets in real-time. - * https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample10-stream + * https://developer.x.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample10-stream */ public sample10Stream(options?: Partial & { autoConnect?: true }): Promise>; public sample10Stream(options: Partial & { autoConnect: false }): TweetStream; @@ -797,7 +797,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Returns a list of recent compliance jobs. - * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs + * https://developer.x.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs */ public complianceJobs(options: BatchComplianceSearchV2Params) { return this.get('compliance/jobs', options as Partial); @@ -805,7 +805,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Get a single compliance job with the specified ID. - * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs-id + * https://developer.x.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/get-compliance-jobs-id */ public complianceJob(jobId: string) { return this.get('compliance/jobs/:id', undefined, { params: { id: jobId } }); @@ -816,7 +816,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { * You can run one batch job at a time. Returns the created job, but **not the job result!**. * * You can obtain the result (**after job is completed**) with `.complianceJobResult`. - * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs + * https://developer.x.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs */ public async sendComplianceJob(jobParams: BatchComplianceV2Params) { const job = await this.post('compliance/jobs', { type: jobParams.type, name: jobParams.name }); @@ -837,7 +837,7 @@ export default class TwitterApiv2ReadOnly extends TwitterApiSubClient { /** * Get the result of a running or completed job, obtained through `.complianceJob`, `.complianceJobs` or `.sendComplianceJob`. * If job is still running (`in_progress`), it will await until job is completed. **This could be quite long!** - * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs + * https://developer.x.com/en/docs/twitter-api/compliance/batch-compliance/api-reference/post-compliance-jobs */ public async complianceJobResult(job: BatchComplianceJobV2) { let runningJob = job; diff --git a/src/v2/client.v2.write.ts b/src/v2/client.v2.write.ts index dbb02e5..7772e33 100644 --- a/src/v2/client.v2.write.ts +++ b/src/v2/client.v2.write.ts @@ -53,7 +53,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Hides or unhides a reply to a Tweet. - * https://developer.twitter.com/en/docs/twitter-api/tweets/hide-replies/api-reference/put-tweets-id-hidden + * https://developer.x.com/en/docs/twitter-api/tweets/hide-replies/api-reference/put-tweets-id-hidden */ public hideReply(tweetId: string, makeHidden: boolean) { return this.put('tweets/:id/hidden', { hidden: makeHidden }, { params: { id: tweetId } }); @@ -61,7 +61,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Causes the user ID identified in the path parameter to Like the target Tweet. - * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-user_id-likes + * https://developer.x.com/en/docs/twitter-api/tweets/likes/api-reference/post-users-user_id-likes * * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API. */ @@ -72,7 +72,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows a user or authenticated user ID to unlike a Tweet. * The request succeeds with no action when the user sends a request to a user they're not liking the Tweet or have already unliked the Tweet. - * https://developer.twitter.com/en/docs/twitter-api/tweets/likes/api-reference/delete-users-id-likes-tweet_id + * https://developer.x.com/en/docs/twitter-api/tweets/likes/api-reference/delete-users-id-likes-tweet_id * * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API. */ @@ -84,7 +84,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Causes the user ID identified in the path parameter to Retweet the target Tweet. - * https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets + * https://developer.x.com/en/docs/twitter-api/tweets/retweets/api-reference/post-users-id-retweets * * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API. */ @@ -95,7 +95,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows a user or authenticated user ID to remove the Retweet of a Tweet. * The request succeeds with no action when the user sends a request to a user they're not Retweeting the Tweet or have already removed the Retweet of. - * https://developer.twitter.com/en/docs/twitter-api/tweets/retweets/api-reference/delete-users-id-retweets-tweet_id + * https://developer.x.com/en/docs/twitter-api/tweets/retweets/api-reference/delete-users-id-retweets-tweet_id * * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API. */ @@ -107,7 +107,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Creates a Tweet on behalf of an authenticated user. - * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets + * https://developer.x.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets */ public tweet(status: string, payload?: Partial): Promise; public tweet(payload: SendTweetV2Params): Promise; @@ -123,7 +123,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Reply to a Tweet on behalf of an authenticated user. - * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets + * https://developer.x.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets */ public reply(status: string, toTweetId: string, payload: Partial = {}) { const reply = { in_reply_to_tweet_id: toTweetId, ...payload.reply ?? {} }; @@ -133,7 +133,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Quote an existing Tweet on behalf of an authenticated user. - * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets + * https://developer.x.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets */ public quote(status: string, quotedTweetId: string, payload: Partial = {}) { return this.tweet(status, { ...payload, quote_tweet_id: quotedTweetId }); @@ -141,7 +141,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Post a series of tweets. - * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets + * https://developer.x.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets */ public async tweetThread(tweets: (SendTweetV2Params | string)[]) { const postedTweets: TweetV2PostTweetResult[] = []; @@ -167,7 +167,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows a user or authenticated user ID to delete a Tweet - * https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/delete-tweets-id + * https://developer.x.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/delete-tweets-id */ public deleteTweet(tweetId: string) { return this.delete('tweets/:id', undefined, { @@ -181,7 +181,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Causes the user ID of an authenticated user identified in the path parameter to Bookmark the target Tweet provided in the request body. - * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/post-users-id-bookmarks + * https://developer.x.com/en/docs/twitter-api/tweets/bookmarks/api-reference/post-users-id-bookmarks * * OAuth2 scopes: `users.read` `tweet.read` `bookmark.write` */ @@ -192,7 +192,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows a user or authenticated user ID to remove a Bookmark of a Tweet. - * https://developer.twitter.com/en/docs/twitter-api/tweets/bookmarks/api-reference/delete-users-id-bookmarks-tweet_id + * https://developer.x.com/en/docs/twitter-api/tweets/bookmarks/api-reference/delete-users-id-bookmarks-tweet_id * * OAuth2 scopes: `users.read` `tweet.read` `bookmark.write` */ @@ -206,7 +206,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows a user ID to follow another user. * If the target user does not have public Tweets, this endpoint will send a follow request. - * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following + * https://developer.x.com/en/docs/twitter-api/users/follows/api-reference/post-users-source_user_id-following * * OAuth2 scope: `follows.write` * @@ -218,7 +218,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows a user ID to unfollow another user. - * https://developer.twitter.com/en/docs/twitter-api/users/follows/api-reference/delete-users-source_id-following + * https://developer.x.com/en/docs/twitter-api/users/follows/api-reference/delete-users-source_id-following * * OAuth2 scope: `follows.write` * @@ -233,7 +233,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Causes the user (in the path) to block the target user. * The user (in the path) must match the user context authorizing the request. - * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/post-users-user_id-blocking + * https://developer.x.com/en/docs/twitter-api/users/blocks/api-reference/post-users-user_id-blocking * * **Note**: You must specify the currently logged user ID; you can obtain it through v1.1 API. */ @@ -243,7 +243,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows a user or authenticated user ID to unblock another user. - * https://developer.twitter.com/en/docs/twitter-api/users/blocks/api-reference/delete-users-user_id-blocking + * https://developer.x.com/en/docs/twitter-api/users/blocks/api-reference/delete-users-user_id-blocking * * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API. */ @@ -255,7 +255,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows an authenticated user ID to mute the target user. - * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/post-users-user_id-muting + * https://developer.x.com/en/docs/twitter-api/users/mutes/api-reference/post-users-user_id-muting * * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API. */ @@ -266,7 +266,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Allows an authenticated user ID to unmute the target user. * The request succeeds with no action when the user sends a request to a user they're not muting or have already unmuted. - * https://developer.twitter.com/en/docs/twitter-api/users/mutes/api-reference/delete-users-user_id-muting + * https://developer.x.com/en/docs/twitter-api/users/mutes/api-reference/delete-users-user_id-muting * * **Note**: You must specify the currently logged user ID ; you can obtain it through v1.1 API. */ @@ -280,7 +280,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Creates a new list for the authenticated user. - * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists + * https://developer.x.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-lists */ public createList(options: ListCreateV2Params) { return this.post('lists', options); @@ -288,7 +288,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Updates the specified list. The authenticated user must own the list to be able to update it. - * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/put-lists-id + * https://developer.x.com/en/docs/twitter-api/lists/manage-lists/api-reference/put-lists-id */ public updateList(listId: string, options: ListUpdateV2Params = {}) { return this.put('lists/:id', options, { params: { id: listId } }); @@ -296,7 +296,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Deletes the specified list. The authenticated user must own the list to be able to destroy it. - * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id + * https://developer.x.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-lists-id */ public removeList(listId: string) { return this.delete('lists/:id', undefined, { params: { id: listId } }); @@ -304,7 +304,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Adds a member to a list. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/post-lists-id-members + * https://developer.x.com/en/docs/twitter-api/lists/list-members/api-reference/post-lists-id-members */ public addListMember(listId: string, userId: string) { return this.post('lists/:id/members', { user_id: userId }, { params: { id: listId } }); @@ -312,7 +312,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Remember a member to a list. - * https://developer.twitter.com/en/docs/twitter-api/lists/list-members/api-reference/delete-lists-id-members-user_id + * https://developer.x.com/en/docs/twitter-api/lists/list-members/api-reference/delete-lists-id-members-user_id */ public removeListMember(listId: string, userId: string) { return this.delete('lists/:id/members/:user_id', undefined, { params: { id: listId, user_id: userId } }); @@ -320,7 +320,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Subscribes the authenticated user to the specified list. - * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-followed-lists + * https://developer.x.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-followed-lists */ public subscribeToList(loggedUserId: string, listId: string) { return this.post('users/:id/followed_lists', { list_id: listId }, { params: { id: loggedUserId } }); @@ -328,7 +328,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Unsubscribes the authenticated user to the specified list. - * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-followed-lists-list_id + * https://developer.x.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-followed-lists-list_id */ public unsubscribeOfList(loggedUserId: string, listId: string) { return this.delete('users/:id/followed_lists/:list_id', undefined, { params: { id: loggedUserId, list_id: listId } }); @@ -336,7 +336,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Enables the authenticated user to pin a List. - * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-pinned-lists + * https://developer.x.com/en/docs/twitter-api/lists/manage-lists/api-reference/post-users-id-pinned-lists */ public pinList(loggedUserId: string, listId: string) { return this.post('users/:id/pinned_lists', { list_id: listId }, { params: { id: loggedUserId } }); @@ -344,7 +344,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Enables the authenticated user to unpin a List. - * https://developer.twitter.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-pinned-lists-list_id + * https://developer.x.com/en/docs/twitter-api/lists/manage-lists/api-reference/delete-users-id-pinned-lists-list_id */ public unpinList(loggedUserId: string, listId: string) { return this.delete('users/:id/pinned_lists/:list_id', undefined, { params: { id: loggedUserId, list_id: listId } }); @@ -354,7 +354,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Creates a Direct Message on behalf of an authenticated user, and adds it to the specified conversation. - * https://developer.twitter.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations-dm_conversation_id-messages + * https://developer.x.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations-dm_conversation_id-messages */ public sendDmInConversation(conversationId: string, message: PostDMInConversationParams) { return this.post('dm_conversations/:dm_conversation_id/messages', message, { params: { dm_conversation_id: conversationId } }); @@ -363,7 +363,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Creates a one-to-one Direct Message and adds it to the one-to-one conversation. * This method either creates a new one-to-one conversation or retrieves the current conversation and adds the Direct Message to it. - * https://developer.twitter.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations-with-participant_id-messages + * https://developer.x.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations-with-participant_id-messages */ public sendDmToParticipant(participantId: string, message: PostDMInConversationParams) { return this.post('dm_conversations/with/:participant_id/messages', message, { params: { participant_id: participantId } }); @@ -371,7 +371,7 @@ export default class TwitterApiv2ReadWrite extends TwitterApiv2ReadOnly { /** * Creates a new group conversation and adds a Direct Message to it on behalf of an authenticated user. - * https://developer.twitter.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations + * https://developer.x.com/en/docs/twitter-api/direct-messages/manage/api-reference/post-dm_conversations */ public createDmConversation(options: CreateDMConversationParams) { return this.post('dm_conversations', options); diff --git a/test/tweet.v1.test.ts b/test/tweet.v1.test.ts index d09ca73..4dc11d9 100644 --- a/test/tweet.v1.test.ts +++ b/test/tweet.v1.test.ts @@ -12,7 +12,7 @@ describe('Tweets endpoints for v1.1 API', () => { it.skip('.get - Get 2 tweets using raw HTTP method & specific endpoint', async () => { // Using raw HTTP method and URL - const response1 = await client.get('https://api.twitter.com/1.1/search/tweets.json?q=@jack&count=2'); + const response1 = await client.get('https://api.x.com/1.1/search/tweets.json?q=@jack&count=2'); // Using query parser const response2 = await client.v1.get('search/tweets.json', { q: 'jack', @@ -33,7 +33,7 @@ describe('Tweets endpoints for v1.1 API', () => { it('.get - Get 2 tweets of a specific user', async () => { // Using raw HTTP method and URL - const response1 = await client.get('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=jack&count=2'); + const response1 = await client.get('https://api.x.com/1.1/statuses/user_timeline.json?screen_name=jack&count=2'); // Using query parser const response2 = await client.v1.get('statuses/user_timeline.json', { screen_name: 'jack', diff --git a/test/tweet.v2.test.ts b/test/tweet.v2.test.ts index 6d599c0..d542785 100644 --- a/test/tweet.v2.test.ts +++ b/test/tweet.v2.test.ts @@ -13,7 +13,7 @@ describe('Tweets endpoints for v2 API', () => { it('.get - Get 2 tweets using raw HTTP method & specific endpoint', async () => { // Using raw HTTP method and URL - const response1 = await client.get('https://api.twitter.com/2/tweets?ids=20,1306166445135605761&expansions=author_id&tweet.fields=public_metrics&user.fields=name,public_metrics'); + const response1 = await client.get('https://api.x.com/2/tweets?ids=20,1306166445135605761&expansions=author_id&tweet.fields=public_metrics&user.fields=name,public_metrics'); // Using query parser const response2 = await client.v2.get('tweets', { ids: '20,1306166445135605761',