twitter-api-client
Version:
Node.js / JavaScript client for Twitter API
115 lines (95 loc) • 2.65 kB
TypeScript
export interface MediaUploadInitParams {
/**
* Must be set to INIT (case sensitive).
*/
'command': string;
/**
* The size of the media being uploaded in bytes.
*/
'total_bytes': string | number;
/**
* The MIME type of the media being uploaded.
*/
'media_type': string;
/**
* A string enum value which identifies a media usecase.
This identifier is used to enforce usecase specific constraints
(e.g. file size, video duration) and enable advanced features.
*/
'media_category'?: string;
/**
* A comma-separated list of user IDs to set as additional owners allowed to use the returned
media_id in Tweets or Cards. Up to 100 additional owners may be specified.
*/
'additional_owners'?: string;
}
export interface MediaUploadAppendParams {
/**
* Must be set to APPEND (case sensitive).
*/
'command': string;
/**
* The media_id returned from the INIT command.
*/
'media_id': string;
/**
* The raw binary file content being uploaded. It must be <= 5 MB, and cannot be used with media_data.
*/
'media'?: string;
/**
* The base64-encoded chunk of media file. It must be <= 5 MB and cannot be
used with media. Use raw binary (media parameter) when possible.
*/
'media_data'?: string;
/**
* An ordered index of file chunk. It must be between 0-999 inclusive.
The first segment has index 0, second segment has index 1, and so on.
*/
'segment_index': string;
}
export interface MediaUploadStatusParams {
/**
* Must be set to STATUS (case sensitive).
*/
'command': string;
/**
* The media_id returned from the INIT command.
*/
'media_id': string;
}
export interface MediaUploadFinalizeParams {
/**
* Must be set to FINALIZE (case sensitive).
*/
'command': string;
/**
* The media_id returned from the INIT command.
*/
'media_id': string;
}
export interface MediaUploadParams {
/**
* The raw binary file content being uploaded.
*/
'media'?: string;
/**
* The base64 encoded file content being uploaded.
*/
'media_data'?: string;
/**
* The category that represents how the media will be used. This field is required when using the media with the Ads API
*/
'media_category'?: string;
}
export interface MediaMetadataCreateParams {
/**
* The ID of the media to add metadata to
*/
'media_id': string;
/**
* An object containing { text: "the-alt-text" }
*/
'alt_text': {
text: string;
};
}