Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openapi-4.2-update #12

Merged
merged 2 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twitter-api-sdk",
"version": "1.0.5",
"version": "1.0.6",
"description": "A TypeScript SDK for the Twitter API",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/gen/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ export class Client {
getRules: (
params: TwitterParams<getRules> = {},
request_options?: Partial<RequestOptions>
): Promise<TwitterResponse<getRules>> =>
rest<TwitterResponse<getRules>>({
): TwitterPaginatedResponse<TwitterResponse<getRules>> =>
paginate<TwitterResponse<getRules>>({
auth: this.#auth,
...this.#defaultRequestOptions,
...request_options,
Expand Down
42 changes: 42 additions & 0 deletions src/gen/openapi-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ export interface components {
*/
description?: string;
images?: components["schemas"]["URLImage"][];
media_key?: components["schemas"]["MediaKey"];
};
/** @description Represent the portion of text recognized as a URL, and its start and end position within the text. */
UrlEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] &
Expand Down Expand Up @@ -841,6 +842,18 @@ export interface components {
/** Format: uri */
preview_image_url?: string;
duration_ms?: number;
/** @description An array of all available variants of the media */
variants?: {
/** @description The bit rate of the media */
bit_rate?: number;
/** @description The content type of the media */
content_type?: string;
/**
* Format: uri
* @description The url to the media
*/
url?: string;
}[];
/** @description Engagement metrics for the Media at the time of the request. */
public_metrics?: {
/**
Expand Down Expand Up @@ -947,6 +960,18 @@ export interface components {
AnimatedGif: components["schemas"]["Media"] & {
/** Format: uri */
preview_image_url?: string;
/** @description An array of all available variants of the media */
variants?: {
/** @description The bit rate of the media */
bit_rate?: number;
/** @description The content type of the media */
content_type?: string;
/**
* Format: uri
* @description The url to the media
*/
url?: string;
}[];
};
/** @description The Media Key identifier for this attachment. */
MediaKey: string;
Expand Down Expand Up @@ -1159,6 +1184,13 @@ export interface components {
RulesResponseMetadata: {
sent: string;
summary?: components["schemas"]["RulesRequestSummary"];
/** @description This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */
next_token?: string;
/**
* Format: int32
* @description Number of Rules in result set
*/
result_count?: number;
};
RulesRequestSummary:
| {
Expand Down Expand Up @@ -1439,6 +1471,13 @@ export interface components {
MultiComplianceJobResponse: {
data?: components["schemas"]["ComplianceJob"][];
errors?: components["schemas"]["Problem"][];
meta?: {
/**
* Format: int32
* @description Number of compliance jobs returned
*/
result_count?: number;
};
};
Space: {
id: components["schemas"]["SpaceID"];
Expand Down Expand Up @@ -1644,6 +1683,7 @@ export interface components {
| "organic_metrics"
| "promoted_metrics"
| "alt_text"
| "variants"
)[];
/** @description A comma separated list of Place fields to display. */
PlaceFieldsParameter: (
Expand Down Expand Up @@ -2488,6 +2528,8 @@ export interface operations {
query: {
/** The maximum number of results to be returned. */
max_results?: number;
/** The set of entities to exclude (e.g. 'replies' or 'retweets') */
exclude?: components["parameters"]["TweetTypeExcludesRequestParameter"];
/** A comma separated list of fields to expand. */
expansions?: components["parameters"]["TweetExpansionsParameter"];
/** A comma separated list of Tweet fields to display. */
Expand Down
2 changes: 1 addition & 1 deletion src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function request({
url.toString(),
{
headers: {
"User-Agent": `twitter-api-typescript-sdk/1.0.5`,
"User-Agent": `twitter-api-typescript-sdk/1.0.6`,
...(isPost
? { "Content-Type": "application/json; charset=utf-8" }
: undefined),
Expand Down