twitter-api-v2
Advanced tools
Comparing version 1.12.8 to 1.12.9
@@ -0,1 +1,6 @@ | ||
1.12.9 | ||
------ | ||
- Fix: Add missing expansions/'tweet.fields' item for tweet edition #392 | ||
- friends/followers objects list V1 #391 (@Abdullah-Malik) | ||
1.12.8 | ||
@@ -2,0 +7,0 @@ ------ |
import { CursoredV1Paginator } from './paginator.v1'; | ||
import type { UserFollowerIdsV1Params, UserFollowerIdsV1Result, TwitterResponse } from '../types'; | ||
import type { UserFollowerIdsV1Params, UserFollowerIdsV1Result, UserFollowerListV1Params, UserFollowerListV1Result, TwitterResponse, UserV1 } from '../types'; | ||
export declare class UserFollowerListV1Paginator extends CursoredV1Paginator<UserFollowerListV1Result, UserFollowerListV1Params, UserV1> { | ||
protected _endpoint: string; | ||
protected refreshInstanceFromResult(response: TwitterResponse<UserFollowerListV1Result>, isNextPage: true): void; | ||
protected getPageLengthFromRequest(result: TwitterResponse<UserFollowerListV1Result>): number; | ||
protected getItemArray(): UserV1[]; | ||
/** | ||
* Users returned by paginator. | ||
*/ | ||
get users(): UserV1[]; | ||
} | ||
export declare class UserFollowerIdsV1Paginator extends CursoredV1Paginator<UserFollowerIdsV1Result, UserFollowerIdsV1Params, string> { | ||
@@ -4,0 +14,0 @@ protected _endpoint: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UserFollowerIdsV1Paginator = void 0; | ||
exports.UserFollowerIdsV1Paginator = exports.UserFollowerListV1Paginator = void 0; | ||
const paginator_v1_1 = require("./paginator.v1"); | ||
class UserFollowerListV1Paginator extends paginator_v1_1.CursoredV1Paginator { | ||
constructor() { | ||
super(...arguments); | ||
this._endpoint = 'followers/list.json'; | ||
} | ||
refreshInstanceFromResult(response, isNextPage) { | ||
const result = response.data; | ||
this._rateLimit = response.rateLimit; | ||
if (isNextPage) { | ||
this._realData.users.push(...result.users); | ||
this._realData.next_cursor = result.next_cursor; | ||
} | ||
} | ||
getPageLengthFromRequest(result) { | ||
return result.data.users.length; | ||
} | ||
getItemArray() { | ||
return this.users; | ||
} | ||
/** | ||
* Users returned by paginator. | ||
*/ | ||
get users() { | ||
return this._realData.users; | ||
} | ||
} | ||
exports.UserFollowerListV1Paginator = UserFollowerListV1Paginator; | ||
class UserFollowerIdsV1Paginator extends paginator_v1_1.CursoredV1Paginator { | ||
@@ -6,0 +33,0 @@ constructor() { |
import { CursoredV1Paginator } from './paginator.v1'; | ||
import type { UserFollowerIdsV1Params, UserFollowerIdsV1Result, TwitterResponse } from '../types'; | ||
import type { UserFollowerIdsV1Params, UserFollowerIdsV1Result, UserFriendListV1Params, UserFriendListV1Result, UserV1, TwitterResponse } from '../types'; | ||
export declare class UserFriendListV1Paginator extends CursoredV1Paginator<UserFriendListV1Result, UserFriendListV1Params, UserV1> { | ||
protected _endpoint: string; | ||
protected refreshInstanceFromResult(response: TwitterResponse<UserFriendListV1Result>, isNextPage: true): void; | ||
protected getPageLengthFromRequest(result: TwitterResponse<UserFriendListV1Result>): number; | ||
protected getItemArray(): UserV1[]; | ||
/** | ||
* Users returned by paginator. | ||
*/ | ||
get users(): UserV1[]; | ||
} | ||
export declare class UserFollowersIdsV1Paginator extends CursoredV1Paginator<UserFollowerIdsV1Result, UserFollowerIdsV1Params, string> { | ||
@@ -4,0 +14,0 @@ protected _endpoint: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UserFollowersIdsV1Paginator = void 0; | ||
exports.UserFollowersIdsV1Paginator = exports.UserFriendListV1Paginator = void 0; | ||
const paginator_v1_1 = require("./paginator.v1"); | ||
class UserFriendListV1Paginator extends paginator_v1_1.CursoredV1Paginator { | ||
constructor() { | ||
super(...arguments); | ||
this._endpoint = 'friends/list.json'; | ||
} | ||
refreshInstanceFromResult(response, isNextPage) { | ||
const result = response.data; | ||
this._rateLimit = response.rateLimit; | ||
if (isNextPage) { | ||
this._realData.users.push(...result.users); | ||
this._realData.next_cursor = result.next_cursor; | ||
} | ||
} | ||
getPageLengthFromRequest(result) { | ||
return result.data.users.length; | ||
} | ||
getItemArray() { | ||
return this.users; | ||
} | ||
/** | ||
* Users returned by paginator. | ||
*/ | ||
get users() { | ||
return this._realData.users; | ||
} | ||
} | ||
exports.UserFriendListV1Paginator = UserFriendListV1Paginator; | ||
class UserFollowersIdsV1Paginator extends paginator_v1_1.CursoredV1Paginator { | ||
@@ -6,0 +33,0 @@ constructor() { |
@@ -61,2 +61,12 @@ import { UserEntitiesV1 } from './entities.v1.types'; | ||
} | ||
interface UserListV1Params { | ||
screen_name?: string; | ||
user_id?: string; | ||
count?: number; | ||
cursor?: string; | ||
skip_status?: boolean; | ||
include_user_entities: boolean; | ||
} | ||
export declare type UserFollowerListV1Params = UserListV1Params; | ||
export declare type UserFriendListV1Params = UserListV1Params; | ||
export interface VerifyCredentialsV1Params { | ||
@@ -153,2 +163,11 @@ include_entities?: boolean; | ||
export declare type UserFollowingIdsV1Result = DoubleEndedIdCursorV1Result; | ||
interface UserListV1Result { | ||
next_cursor?: string; | ||
next_cursor_str?: string; | ||
previous_cursor?: string; | ||
previous_cursor_str?: string; | ||
users: UserV1[]; | ||
} | ||
export declare type UserFollowerListV1Result = UserListV1Result; | ||
export declare type UserFriendListV1Result = UserListV1Result; | ||
export interface BannerSizeV1 { | ||
@@ -155,0 +174,0 @@ h: number; |
@@ -33,7 +33,7 @@ /// <reference types="node" /> | ||
} | ||
export declare type TTweetv2Expansion = 'attachments.poll_ids' | 'attachments.media_keys' | 'author_id' | 'referenced_tweets.id' | 'in_reply_to_user_id' | 'geo.place_id' | 'entities.mentions.username' | 'referenced_tweets.id.author_id'; | ||
export declare type TTweetv2Expansion = 'attachments.poll_ids' | 'attachments.media_keys' | 'author_id' | 'referenced_tweets.id' | 'in_reply_to_user_id' | 'edit_history_tweet_ids' | 'geo.place_id' | 'entities.mentions.username' | 'referenced_tweets.id.author_id'; | ||
export declare type TTweetv2MediaField = 'duration_ms' | 'height' | 'media_key' | 'preview_image_url' | 'type' | 'url' | 'width' | 'public_metrics' | 'non_public_metrics' | 'organic_metrics' | 'alt_text' | 'variants'; | ||
export declare type TTweetv2PlaceField = 'contained_within' | 'country' | 'country_code' | 'full_name' | 'geo' | 'id' | 'name' | 'place_type'; | ||
export declare type TTweetv2PollField = 'duration_minutes' | 'end_datetime' | 'id' | 'options' | 'voting_status'; | ||
export declare type TTweetv2TweetField = 'attachments' | 'author_id' | 'context_annotations' | 'conversation_id' | 'created_at' | 'entities' | 'geo' | 'id' | 'in_reply_to_user_id' | 'lang' | 'public_metrics' | 'non_public_metrics' | 'promoted_metrics' | 'organic_metrics' | 'possibly_sensitive' | 'referenced_tweets' | 'reply_settings' | 'source' | 'text' | 'withheld'; | ||
export declare type TTweetv2TweetField = 'attachments' | 'author_id' | 'context_annotations' | 'conversation_id' | 'created_at' | 'entities' | 'geo' | 'id' | 'in_reply_to_user_id' | 'lang' | 'public_metrics' | 'non_public_metrics' | 'promoted_metrics' | 'organic_metrics' | 'edit_controls' | 'possibly_sensitive' | 'referenced_tweets' | 'reply_settings' | 'source' | 'text' | 'withheld'; | ||
export declare type TTweetv2UserField = 'created_at' | 'description' | 'entities' | 'id' | 'location' | 'name' | 'pinned_tweet_id' | 'profile_image_url' | 'protected' | 'public_metrics' | 'url' | 'username' | 'verified' | 'withheld'; | ||
@@ -40,0 +40,0 @@ export interface Tweetv2FieldsParams { |
import TwitterApiSubClient from '../client.subclient'; | ||
import { FilterStreamV1Params, SampleStreamV1Params, UserV1, VerifyCredentialsV1Params, AppRateLimitV1Result, TAppRateLimitResourceV1, HelpLanguageV1Result, ReverseGeoCodeV1Params, ReverseGeoCodeV1Result, PlaceV1, SearchGeoV1Params, SearchGeoV1Result, TrendMatchV1, TrendsPlaceV1Params, TrendLocationV1, TweetV1TimelineParams, TweetV1UserTimelineParams, TweetV1, MediaStatusV1Result, OembedTweetV1Params, OembedTweetV1Result, MuteUserListV1Params, MuteUserIdsV1Params, UserFollowerIdsV1Params, UserFollowingsIdsV1Params, UserSearchV1Params, AccountSettingsV1, ProfileBannerSizeV1, ProfileBannerSizeV1Params, FriendshipLookupV1Params, FriendshipLookupV1, FriendshipShowV1Params, FriendshipV1, FriendshipsIncomingV1Params, UserShowV1Params, UserLookupV1Params, TweetShowV1Params, TweetLookupNoMapV1Params, TweetLookupMapV1Params, TweetLookupMapV1Result, ListListsV1Params, ListV1, ListMembersV1Params, ListMemberShowV1Params, ListMembershipsV1Params, ListOwnershipsV1Params, GetListV1Params, ListStatusesV1Params, ListSubscriptionsV1Params } from '../types'; | ||
import { FilterStreamV1Params, SampleStreamV1Params, UserV1, VerifyCredentialsV1Params, AppRateLimitV1Result, TAppRateLimitResourceV1, HelpLanguageV1Result, ReverseGeoCodeV1Params, ReverseGeoCodeV1Result, PlaceV1, SearchGeoV1Params, SearchGeoV1Result, TrendMatchV1, TrendsPlaceV1Params, TrendLocationV1, TweetV1TimelineParams, TweetV1UserTimelineParams, TweetV1, MediaStatusV1Result, OembedTweetV1Params, OembedTweetV1Result, MuteUserListV1Params, MuteUserIdsV1Params, UserFollowerIdsV1Params, UserFollowingsIdsV1Params, UserFriendListV1Params, UserFollowerListV1Params, UserSearchV1Params, AccountSettingsV1, ProfileBannerSizeV1, ProfileBannerSizeV1Params, FriendshipLookupV1Params, FriendshipLookupV1, FriendshipShowV1Params, FriendshipV1, FriendshipsIncomingV1Params, UserShowV1Params, UserLookupV1Params, TweetShowV1Params, TweetLookupNoMapV1Params, TweetLookupMapV1Params, TweetLookupMapV1Result, ListListsV1Params, ListV1, ListMembersV1Params, ListMemberShowV1Params, ListMembershipsV1Params, ListOwnershipsV1Params, GetListV1Params, ListStatusesV1Params, ListSubscriptionsV1Params } from '../types'; | ||
import { HomeTimelineV1Paginator, ListTimelineV1Paginator, MentionTimelineV1Paginator, UserFavoritesV1Paginator, UserTimelineV1Paginator } from '../paginators/tweet.paginator.v1'; | ||
import { MuteUserIdsV1Paginator, MuteUserListV1Paginator } from '../paginators/mutes.paginator.v1'; | ||
import { UserFollowerIdsV1Paginator } from '../paginators/followers.paginator.v1'; | ||
import { UserFollowersIdsV1Paginator } from '../paginators/friends.paginator.v1'; | ||
import { UserFollowerIdsV1Paginator, UserFollowerListV1Paginator } from '../paginators/followers.paginator.v1'; | ||
import { UserFollowersIdsV1Paginator, UserFriendListV1Paginator } from '../paginators/friends.paginator.v1'; | ||
import { FriendshipsIncomingV1Paginator, FriendshipsOutgoingV1Paginator, UserSearchV1Paginator } from '../paginators/user.paginator.v1'; | ||
@@ -99,2 +99,12 @@ import { ListMembershipsV1Paginator, ListMembersV1Paginator, ListOwnershipsV1Paginator, ListSubscribersV1Paginator, ListSubscriptionsV1Paginator } from '../paginators/list.paginator.v1'; | ||
/** | ||
* 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 | ||
*/ | ||
userFriendList(options?: Partial<UserFriendListV1Params>): Promise<UserFriendListV1Paginator>; | ||
/** | ||
* 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 | ||
*/ | ||
userFollowerList(options?: Partial<UserFollowerListV1Params>): Promise<UserFollowerListV1Paginator>; | ||
/** | ||
* Returns an array of numeric user ids of followers of the specified user. | ||
@@ -101,0 +111,0 @@ * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids |
@@ -220,2 +220,34 @@ "use strict"; | ||
/** | ||
* 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 | ||
*/ | ||
async userFriendList(options = {}) { | ||
const queryParams = { | ||
...options, | ||
}; | ||
const initialRq = await this.get('friends/list.json', queryParams, { fullResponse: true }); | ||
return new friends_paginator_v1_1.UserFriendListV1Paginator({ | ||
realData: initialRq.data, | ||
rateLimit: initialRq.rateLimit, | ||
instance: this, | ||
queryParams, | ||
}); | ||
} | ||
/** | ||
* 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 | ||
*/ | ||
async userFollowerList(options = {}) { | ||
const queryParams = { | ||
...options, | ||
}; | ||
const initialRq = await this.get('followers/list.json', queryParams, { fullResponse: true }); | ||
return new followers_paginator_v1_1.UserFollowerListV1Paginator({ | ||
realData: initialRq.data, | ||
rateLimit: initialRq.rateLimit, | ||
instance: this, | ||
queryParams, | ||
}); | ||
} | ||
/** | ||
* Returns an array of numeric user ids of followers of the specified user. | ||
@@ -222,0 +254,0 @@ * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-followers-ids |
{ | ||
"name": "twitter-api-v2", | ||
"version": "1.12.8", | ||
"version": "1.12.9", | ||
"description": "Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
512699
11238