/** * @api.video/nodejs-client * api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. * * The version of the OpenAPI document: 1 * * * NOTE: This class is auto generated. * Do not edit the class manually. */ import HttpClient, { ApiResponseHeaders } from '../HttpClient'; import LiveStream from '../model/LiveStream'; import LiveStreamCreationPayload from '../model/LiveStreamCreationPayload'; import LiveStreamListResponse from '../model/LiveStreamListResponse'; import LiveStreamUpdatePayload from '../model/LiveStreamUpdatePayload'; import { Readable } from 'stream'; /** * no description */ export default class LiveStreamsApi { private httpClient; constructor(httpClient: HttpClient); /** * Creates a livestream object. * Create live stream * @param liveStreamCreationPayload */ create(liveStreamCreationPayload: LiveStreamCreationPayload): Promise; /** * Creates a livestream object. * Create live stream * @param liveStreamCreationPayload */ createWithResponseHeaders(liveStreamCreationPayload: LiveStreamCreationPayload): Promise<{ headers: ApiResponseHeaders; body: LiveStream; }>; /** * Get a livestream by id. * Retrieve live stream * @param liveStreamId The unique ID for the live stream you want to watch. */ get(liveStreamId: string): Promise; /** * Get a livestream by id. * Retrieve live stream * @param liveStreamId The unique ID for the live stream you want to watch. */ getWithResponseHeaders(liveStreamId: string): Promise<{ headers: ApiResponseHeaders; body: LiveStream; }>; /** * Updates the livestream object. * Update a live stream * @param liveStreamId The unique ID for the live stream that you want to update information for such as player details. * @param liveStreamUpdatePayload */ update(liveStreamId: string, liveStreamUpdatePayload?: LiveStreamUpdatePayload): Promise; /** * Updates the livestream object. * Update a live stream * @param liveStreamId The unique ID for the live stream that you want to update information for such as player details. * @param liveStreamUpdatePayload */ updateWithResponseHeaders(liveStreamId: string, liveStreamUpdatePayload?: LiveStreamUpdatePayload): Promise<{ headers: ApiResponseHeaders; body: LiveStream; }>; /** * If you do not need a live stream any longer, you can send a request to delete it. All you need is the liveStreamId. * Delete a live stream * @param liveStreamId The unique ID for the live stream that you want to remove. */ delete(liveStreamId: string): Promise; /** * If you do not need a live stream any longer, you can send a request to delete it. All you need is the liveStreamId. * Delete a live stream * @param liveStreamId The unique ID for the live stream that you want to remove. */ deleteWithResponseHeaders(liveStreamId: string): Promise<{ headers: ApiResponseHeaders; body: void; }>; /** * Get the list of livestreams on the workspace. * List all live streams * @param {Object} searchParams * @param { string } searchParams.streamKey The unique stream key that allows you to stream videos. * @param { string } searchParams.name You can filter live streams by their name or a part of their name. * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ list(args?: { streamKey?: string; name?: string; sortBy?: 'name' | 'createdAt' | 'updatedAt'; sortOrder?: 'asc' | 'desc'; currentPage?: number; pageSize?: number; }): Promise; /** * Get the list of livestreams on the workspace. * List all live streams * @param {Object} searchParams * @param { string } searchParams.streamKey The unique stream key that allows you to stream videos. * @param { string } searchParams.name You can filter live streams by their name or a part of their name. * @param { 'name' | 'createdAt' | 'updatedAt' } searchParams.sortBy Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. * @param { 'asc' | 'desc' } searchParams.sortOrder Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ listWithResponseHeaders({ streamKey, name, sortBy, sortOrder, currentPage, pageSize, }?: { streamKey?: string; name?: string; sortBy?: 'name' | 'createdAt' | 'updatedAt'; sortOrder?: 'asc' | 'desc'; currentPage?: number; pageSize?: number; }): Promise<{ headers: ApiResponseHeaders; body: LiveStreamListResponse; }>; /** * Upload the thumbnail for the livestream. * Upload a thumbnail * @param liveStreamId The unique ID for the live stream you want to upload. * @param file The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB. */ uploadThumbnail(liveStreamId: string, file: string | Readable | Buffer): Promise; /** * Upload the thumbnail for the livestream. * Upload a thumbnail * @param liveStreamId The unique ID for the live stream you want to upload. * @param file The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB. */ uploadThumbnailWithResponseHeaders(liveStreamId: string, file: string | Readable | Buffer): Promise<{ headers: ApiResponseHeaders; body: LiveStream; }>; /** * Send the unique identifier for a live stream to delete its thumbnail. * Delete a thumbnail * @param liveStreamId The unique identifier of the live stream whose thumbnail you want to delete. */ deleteThumbnail(liveStreamId: string): Promise; /** * Send the unique identifier for a live stream to delete its thumbnail. * Delete a thumbnail * @param liveStreamId The unique identifier of the live stream whose thumbnail you want to delete. */ deleteThumbnailWithResponseHeaders(liveStreamId: string): Promise<{ headers: ApiResponseHeaders; body: LiveStream; }>; /** * Request the completion of a live stream that is currently running. This operation is asynchronous and the live stream will stop after a few seconds. The API adds the `EXT-X-ENDLIST` tag to the live stream's HLS manifest. This stops the live stream on the player and also stops the recording of the live stream. The API keeps the incoming connection from the streamer open for at most 1 minute, which can be used to terminate the stream. * Complete a live stream * @param liveStreamId The unique ID for the live stream you want to complete. */ complete(liveStreamId: string): Promise; /** * Request the completion of a live stream that is currently running. This operation is asynchronous and the live stream will stop after a few seconds. The API adds the `EXT-X-ENDLIST` tag to the live stream's HLS manifest. This stops the live stream on the player and also stops the recording of the live stream. The API keeps the incoming connection from the streamer open for at most 1 minute, which can be used to terminate the stream. * Complete a live stream * @param liveStreamId The unique ID for the live stream you want to complete. */ completeWithResponseHeaders(liveStreamId: string): Promise<{ headers: ApiResponseHeaders; body: void; }>; }