Skip to content

Commit 0d12a20

Browse files
committed
v1.2.1
1 parent 6e973ad commit 0d12a20

File tree

3 files changed

+130
-22
lines changed

3 files changed

+130
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "twitter-api-sdk",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "A TypeScript SDK for the Twitter API",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/gen/Client.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
tweetCountsFullArchiveSearch,
4343
tweetCountsRecentSearch,
4444
getTweetsFirehoseStream,
45+
getTweetsLabelStream,
4546
sampleStream,
4647
getTweetsSample10Stream,
4748
tweetsFullarchiveSearch,
@@ -107,8 +108,8 @@ export class Client {
107108
auth: string | AuthClient,
108109
requestOptions?: Partial<RequestOptions>
109110
) {
110-
this.version = "1.2.0";
111-
this.twitterApiOpenApiVersion = "2.51";
111+
this.version = "1.2.1";
112+
this.twitterApiOpenApiVersion = "2.54";
112113
this.#auth = typeof auth === "string" ? new OAuth2Bearer(auth) : auth;
113114
this.#defaultRequestOptions = {
114115
...requestOptions,
@@ -291,6 +292,27 @@ export class Client {
291292
method: "GET",
292293
}),
293294

295+
/**
296+
* Tweets Label stream
297+
*
298+
299+
* Streams 100% of labeling events applied to Tweets
300+
* @param params - The params for getTweetsLabelStream
301+
* @param request_options - Customize the options for this request
302+
*/
303+
getTweetsLabelStream: (
304+
params: TwitterParams<getTweetsLabelStream> = {},
305+
request_options?: Partial<RequestOptions>
306+
): AsyncGenerator<TwitterResponse<getTweetsLabelStream>> =>
307+
stream<TwitterResponse<getTweetsLabelStream>>({
308+
auth: this.#auth,
309+
...this.#defaultRequestOptions,
310+
...request_options,
311+
endpoint: `/2/tweets/label/stream`,
312+
params,
313+
method: "GET",
314+
}),
315+
294316
/**
295317
* Users Compliance stream
296318
*

src/gen/openapi-types.ts

Lines changed: 105 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export interface paths {
9797
/** Streams 100% of public Tweets. */
9898
get: operations["getTweetsFirehoseStream"];
9999
};
100+
"/2/tweets/label/stream": {
101+
/** Streams 100% of labeling events applied to Tweets */
102+
get: operations["getTweetsLabelStream"];
103+
};
100104
"/2/tweets/sample/stream": {
101105
/** Streams a deterministic 1% of public Tweets. */
102106
get: operations["sampleStream"];
@@ -1179,28 +1183,11 @@ export interface components {
11791183
title: string;
11801184
type: string;
11811185
};
1182-
ProblemErrors: {
1183-
errors: components["schemas"]["Problems"];
1184-
};
1185-
/** @description Represents the response in case of throwing an exception. Mainly for the openapi-generator */
1186-
ProblemOrError:
1187-
| components["schemas"]["Error"]
1188-
| components["schemas"]["Problem"];
1189-
Problems: components["schemas"]["Problem"][];
11901186
/**
11911187
* @description Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following.
11921188
* @enum {string}
11931189
*/
11941190
ReplySettings: "everyone" | "mentionedUsers" | "following" | "other";
1195-
ReportUsersRequest: {
1196-
description: string;
1197-
user_ids: components["schemas"]["UserId"][];
1198-
};
1199-
ReportUsersResponse: {
1200-
data?: {
1201-
id?: number;
1202-
};
1203-
};
12041191
/** @description A problem that indicates that a given Tweet, User, etc. does not exist. */
12051192
ResourceNotFoundProblem: components["schemas"]["Problem"] & {
12061193
parameter: string;
@@ -1588,6 +1575,8 @@ export interface components {
15881575
/** @description The count for the bucket. */
15891576
TweetCount: number;
15901577
TweetCreateRequest: {
1578+
/** @description Card Uri Parameter. This is mutually exclusive from Quote Tweet Id, Poll, Media, and Direct Message Deep Link. */
1579+
card_uri?: string;
15911580
/** @description Link to take the conversation from the public timeline to a private Direct Message. */
15921581
direct_message_deep_link?: string;
15931582
/**
@@ -1599,14 +1588,19 @@ export interface components {
15991588
geo?: {
16001589
place_id?: string;
16011590
};
1602-
/** @description Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id and Poll. */
1591+
/** @description Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id, Poll, and Card URI. */
16031592
media?: {
16041593
/** @description A list of Media Ids to be attached to a created Tweet. */
16051594
media_ids: components["schemas"]["MediaId"][];
16061595
/** @description A list of User Ids to be tagged in the media for created Tweet. */
16071596
tagged_user_ids?: components["schemas"]["UserId"][];
16081597
};
1609-
/** @description Poll options for a Tweet with a poll. This is mutually exclusive from Media and Quote Tweet Id. */
1598+
/**
1599+
* @description Nullcasted (promoted-only) Tweets do not appear in the public timeline and are not served to followers.
1600+
* @default false
1601+
*/
1602+
nullcast?: boolean;
1603+
/** @description Poll options for a Tweet with a poll. This is mutually exclusive from Media, Quote Tweet Id, and Card URI. */
16101604
poll?: {
16111605
/**
16121606
* Format: int32
@@ -1682,6 +1676,49 @@ export interface components {
16821676
* @example 1346889436626259968
16831677
*/
16841678
TweetId: string;
1679+
/** @description Tweet label data. */
1680+
TweetLabelData:
1681+
| components["schemas"]["TweetNoticeSchema"]
1682+
| components["schemas"]["TweetUnviewableSchema"];
1683+
/** @description Tweet label stream events. */
1684+
TweetLabelStreamResponse:
1685+
| {
1686+
data: components["schemas"]["TweetLabelData"];
1687+
}
1688+
| {
1689+
errors: components["schemas"]["Problem"][];
1690+
};
1691+
TweetNotice: {
1692+
/**
1693+
* @description If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’.
1694+
* @example apply
1695+
*/
1696+
application: string;
1697+
/** @description Information shown on the Tweet label */
1698+
details?: string;
1699+
/**
1700+
* Format: date-time
1701+
* @description Event time.
1702+
* @example 2021-07-06T18:40:40.000Z
1703+
*/
1704+
event_at: string;
1705+
/**
1706+
* @description The type of label on the Tweet
1707+
* @example misleading
1708+
*/
1709+
event_type: string;
1710+
/** @description Link to more information about this kind of label */
1711+
extended_details_url?: string;
1712+
/** @description Title/header of the Tweet label */
1713+
label_title?: string;
1714+
tweet: {
1715+
author_id: components["schemas"]["UserId"];
1716+
id: components["schemas"]["TweetId"];
1717+
};
1718+
};
1719+
TweetNoticeSchema: {
1720+
public_tweet_notice: components["schemas"]["TweetNotice"];
1721+
};
16851722
TweetTakedownComplianceSchema: {
16861723
/**
16871724
* Format: date-time
@@ -1704,6 +1741,26 @@ export interface components {
17041741
TweetUndropComplianceSchema: {
17051742
undrop: components["schemas"]["TweetComplianceSchema"];
17061743
};
1744+
TweetUnviewable: {
1745+
/**
1746+
* @description If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’.
1747+
* @example apply
1748+
*/
1749+
application: string;
1750+
/**
1751+
* Format: date-time
1752+
* @description Event time.
1753+
* @example 2021-07-06T18:40:40.000Z
1754+
*/
1755+
event_at: string;
1756+
tweet: {
1757+
author_id: components["schemas"]["UserId"];
1758+
id: components["schemas"]["TweetId"];
1759+
};
1760+
};
1761+
TweetUnviewableSchema: {
1762+
public_tweet_unviewable: components["schemas"]["TweetUnviewable"];
1763+
};
17071764
/** @description Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). */
17081765
TweetWithheld: {
17091766
/** @description Indicates if the content is being withheld for on the basis of copyright infringement. */
@@ -3070,6 +3127,34 @@ export interface operations {
30703127
};
30713128
};
30723129
};
3130+
/** Streams 100% of labeling events applied to Tweets */
3131+
getTweetsLabelStream: {
3132+
parameters: {
3133+
query: {
3134+
/** The number of minutes of backfill requested. */
3135+
backfill_minutes?: number;
3136+
/** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet labels will be provided. */
3137+
start_time?: string;
3138+
/** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Tweet labels will be provided. */
3139+
end_time?: string;
3140+
};
3141+
};
3142+
responses: {
3143+
/** The request has succeeded. */
3144+
200: {
3145+
content: {
3146+
"application/json": components["schemas"]["TweetLabelStreamResponse"];
3147+
};
3148+
};
3149+
/** The request has failed. */
3150+
default: {
3151+
content: {
3152+
"application/json": components["schemas"]["Error"];
3153+
"application/problem+json": components["schemas"]["Problem"];
3154+
};
3155+
};
3156+
};
3157+
};
30733158
/** Streams a deterministic 1% of public Tweets. */
30743159
sampleStream: {
30753160
parameters: {
@@ -4728,6 +4813,7 @@ export type getTweetsComplianceStream = operations['getTweetsComplianceStream']
47284813
export type tweetCountsFullArchiveSearch = operations['tweetCountsFullArchiveSearch']
47294814
export type tweetCountsRecentSearch = operations['tweetCountsRecentSearch']
47304815
export type getTweetsFirehoseStream = operations['getTweetsFirehoseStream']
4816+
export type getTweetsLabelStream = operations['getTweetsLabelStream']
47314817
export type sampleStream = operations['sampleStream']
47324818
export type getTweetsSample10Stream = operations['getTweetsSample10Stream']
47334819
export type tweetsFullarchiveSearch = operations['tweetsFullarchiveSearch']

0 commit comments

Comments
 (0)