diff --git a/README.md b/README.md index 17b2daf1..23305224 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,36 @@ Method | Description | HTTP request [**list()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/ApiKeyApi.md#list) | Get list API keys | **GET** `/api_keys` +#### MediaApi + +Method | Description | HTTP request +------------- | ------------- | ------------- +[**create()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#create) | Create media object | **POST** `/media/create` +[**update()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#update) | update media info | **PATCH** `/media/{id}` +[**delete()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#delete) | Delete media | **DELETE** `/media/{id}` +[**uploadThumbnail()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#uploadThumbnail) | Upload media thumbnail | **POST** `/media/{id}/thumbnail` +[**deleteThumbnail()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#deleteThumbnail) | Delete media thumbnail | **DELETE** `/media/{id}/thumbnail` +[**createCaption()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#createCaption) | Create a new media caption | **POST** `/media/{id}/captions/{lan}` +[**deleteCaption()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#deleteCaption) | Delete a media caption | **DELETE** `/media/{id}/captions/{lan}` +[**getCaptions()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#getCaptions) | Get media captions | **GET** `/media/{id}/captions` +[**getCost()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#getCost) | get media transcoding cost | **GET** `/media/cost` +[**getDetail()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#getDetail) | get media detail | **GET** `/media/{id}` +[**getMediaList()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#getMediaList) | Get user videos list | **POST** `/media` +[**getMediaPlayerInfo()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#getMediaPlayerInfo) | Get media object | **GET** `/media/{id}/player.json` +[**setDefaultCaption()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#setDefaultCaption) | Set default caption | **PATCH** `/media/{id}/captions/{lan}` +[**uploadMediaComplete()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#uploadMediaComplete) | Get upload media when complete | **GET** `/media/{id}/complete` +[**uploadPart()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaApi.md#uploadPart) | Upload part of media | **POST** `/media/{id}/part` + + +#### MediaChapterApi + +Method | Description | HTTP request +------------- | ------------- | ------------- +[**create()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaChapterApi.md#create) | Create a media chapter | **POST** `/media/{id}/chapters/{lan}` +[**get()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaChapterApi.md#get) | Get media chapters | **GET** `/media/{id}/chapters` +[**delete()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/MediaChapterApi.md#delete) | Delete a video chapter | **DELETE** `/media/{id}/chapters/{lan}` + + #### PlayersApi Method | Description | HTTP request @@ -111,36 +141,6 @@ Method | Description | HTTP request [**updatePlaylist()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/PlaylistApi.md#updatePlaylist) | Update a playlist | **PATCH** `/playlists/{id}` -#### VideoApi - -Method | Description | HTTP request -------------- | ------------- | ------------- -[**create()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#create) | Create video object | **POST** `/videos/create` -[**update()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#update) | update video info | **PATCH** `/videos/{id}` -[**delete()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#delete) | Delete video | **DELETE** `/videos/{id}` -[**uploadThumbnail()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#uploadThumbnail) | Upload video thumbnail | **POST** `/videos/{id}/thumbnail` -[**deleteThumbnail()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#deleteThumbnail) | Delete video thumbnail | **DELETE** `/videos/{id}/thumbnail` -[**createCaption()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#createCaption) | Create a new video caption | **POST** `/videos/{id}/captions/{lan}` -[**deleteCaption()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#deleteCaption) | Delete a video caption | **DELETE** `/videos/{id}/captions/{lan}` -[**getCaptions()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#getCaptions) | Get video captions | **GET** `/videos/{id}/captions` -[**getCost()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#getCost) | get video transcoding cost | **GET** `/videos/cost` -[**getDetail()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#getDetail) | get video detail | **GET** `/videos/{id}` -[**getVideoList()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#getVideoList) | Get user videos list | **POST** `/videos` -[**getVideoPlayerInfo()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#getVideoPlayerInfo) | Get video object | **GET** `/videos/{id}/player.json` -[**setDefaultCaption()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#setDefaultCaption) | Set default caption | **PATCH** `/videos/{id}/captions/{lan}` -[**uploadPart()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#uploadPart) | Upload part of video | **POST** `/videos/{id}/part` -[**uploadVideoComplete()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoApi.md#uploadVideoComplete) | Get upload video when complete | **GET** `/videos/{id}/complete` - - -#### VideoChapterApi - -Method | Description | HTTP request -------------- | ------------- | ------------- -[**create()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoChapterApi.md#create) | Create a video chapter | **POST** `/videos/{id}/chapters/{lan}` -[**get()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoChapterApi.md#get) | Get video chapters | **GET** `/videos/{id}/chapters` -[**delete()**](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/api/VideoChapterApi.md#delete) | Delete a video chapter | **DELETE** `/videos/{id}/chapters/{lan}` - - #### WebhookApi Method | Description | HTTP request @@ -165,6 +165,10 @@ Method | Description | HTTP request - [CreateApiKeyData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateApiKeyData.md) - [CreateApiKeyRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateApiKeyRequest.md) - [CreateApiKeyResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateApiKeyResponse.md) + - [CreateMediaCaptionData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateMediaCaptionData.md) + - [CreateMediaCaptionResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateMediaCaptionResponse.md) + - [CreateMediaChapterData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateMediaChapterData.md) + - [CreateMediaChapterResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateMediaChapterResponse.md) - [CreateMediaRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateMediaRequest.md) - [CreateMediaResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateMediaResponse.md) - [CreatePlayerThemeRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreatePlayerThemeRequest.md) @@ -173,15 +177,20 @@ Method | Description | HTTP request - [CreatePlaylistData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreatePlaylistData.md) - [CreatePlaylistRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreatePlaylistRequest.md) - [CreatePlaylistResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreatePlaylistResponse.md) - - [CreateVideoCaptionData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateVideoCaptionData.md) - - [CreateVideoCaptionResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateVideoCaptionResponse.md) - - [CreateVideoChapterData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateVideoChapterData.md) - - [CreateVideoChapterResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateVideoChapterResponse.md) - [CreateWebhookData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateWebhookData.md) - [CreateWebhookRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateWebhookRequest.md) - [CreateWebhookResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/CreateWebhookResponse.md) - [GetApiKeysData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetApiKeysData.md) - [GetApiKeysResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetApiKeysResponse.md) + - [GetMediaCaptionsData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaCaptionsData.md) + - [GetMediaCaptionsResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaCaptionsResponse.md) + - [GetMediaChaptersData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaChaptersData.md) + - [GetMediaChaptersResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaChaptersResponse.md) + - [GetMediaDetailResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaDetailResponse.md) + - [GetMediaListData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaListData.md) + - [GetMediaListRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaListRequest.md) + - [GetMediaListResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaListResponse.md) + - [GetMediaPlayerInfoResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetMediaPlayerInfoResponse.md) - [GetPlayerThemeByIdData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetPlayerThemeByIdData.md) - [GetPlayerThemeByIdResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetPlayerThemeByIdResponse.md) - [GetPlayerThemeData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetPlayerThemeData.md) @@ -195,18 +204,12 @@ Method | Description | HTTP request - [GetTranscodeCostResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetTranscodeCostResponse.md) - [GetUserWebhookData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetUserWebhookData.md) - [GetUserWebhookResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetUserWebhookResponse.md) - - [GetVideoCaptionsData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoCaptionsData.md) - - [GetVideoCaptionsResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoCaptionsResponse.md) - - [GetVideoChaptersData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoChaptersData.md) - - [GetVideoChaptersResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoChaptersResponse.md) - - [GetVideoDetailResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoDetailResponse.md) - - [GetVideoListData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoListData.md) - - [GetVideoListRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoListRequest.md) - - [GetVideoListResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoListResponse.md) - - [GetVideoPlayerInfoResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetVideoPlayerInfoResponse.md) - [GetWebhooksListData](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetWebhooksListData.md) - [GetWebhooksListResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/GetWebhooksListResponse.md) - [Media](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/Media.md) + - [MediaAssets](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/MediaAssets.md) + - [MediaCaption](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/MediaCaption.md) + - [MediaChapter](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/MediaChapter.md) - [Metadata](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/Metadata.md) - [MoveVideoInPlaylistRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/MoveVideoInPlaylistRequest.md) - [PlayerTheme](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/PlayerTheme.md) @@ -223,15 +226,12 @@ Method | Description | HTTP request - [ResponseError](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/ResponseError.md) - [ResponseSuccess](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/ResponseSuccess.md) - [Theme](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/Theme.md) + - [UpdateMediaInfoRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/UpdateMediaInfoRequest.md) - [UpdatePlayerThemeRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/UpdatePlayerThemeRequest.md) - [UpdatePlayerThemeResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/UpdatePlayerThemeResponse.md) - - [UpdateVideoInfoRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/UpdateVideoInfoRequest.md) - [UpdateWebhookRequest](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/UpdateWebhookRequest.md) - [UploadLogoByIdResponse](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/UploadLogoByIdResponse.md) - [User](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/User.md) - - [VideoAssets](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/VideoAssets.md) - - [VideoCaption](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/VideoCaption.md) - - [VideoChapter](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/VideoChapter.md) - [VideoConfig](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/VideoConfig.md) - [VideoWatermark](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/VideoWatermark.md) - [Webhook](https://github.com/AIOZNetwork/aiozstream-nodejs-client/blob/main/docs/model/Webhook.md) diff --git a/docs/api/VideoApi.md b/docs/api/MediaApi.md similarity index 59% rename from docs/api/VideoApi.md rename to docs/api/MediaApi.md index b1cada6d..0f915b16 100644 --- a/docs/api/VideoApi.md +++ b/docs/api/MediaApi.md @@ -1,37 +1,37 @@ -# VideoApi +# MediaApi All URIs are relative to *http://localhost/api* | Method | Description | HTTP request | | ------------- | ------------- | ------------- | -| [**create()**](VideoApi.md#create) | Create video object | **POST** /videos/create | -| [**update()**](VideoApi.md#update) | update video info | **PATCH** /videos/{id} | -| [**delete()**](VideoApi.md#delete) | Delete video | **DELETE** /videos/{id} | -| [**uploadThumbnail()**](VideoApi.md#uploadThumbnail) | Upload video thumbnail | **POST** /videos/{id}/thumbnail | -| [**deleteThumbnail()**](VideoApi.md#deleteThumbnail) | Delete video thumbnail | **DELETE** /videos/{id}/thumbnail | -| [**createCaption()**](VideoApi.md#createCaption) | Create a new video caption | **POST** /videos/{id}/captions/{lan} | -| [**deleteCaption()**](VideoApi.md#deleteCaption) | Delete a video caption | **DELETE** /videos/{id}/captions/{lan} | -| [**getCaptions()**](VideoApi.md#getCaptions) | Get video captions | **GET** /videos/{id}/captions | -| [**getCost()**](VideoApi.md#getCost) | get video transcoding cost | **GET** /videos/cost | -| [**getDetail()**](VideoApi.md#getDetail) | get video detail | **GET** /videos/{id} | -| [**getVideoList()**](VideoApi.md#getVideoList) | Get user videos list | **POST** /videos | -| [**getVideoPlayerInfo()**](VideoApi.md#getVideoPlayerInfo) | Get video object | **GET** /videos/{id}/player.json | -| [**setDefaultCaption()**](VideoApi.md#setDefaultCaption) | Set default caption | **PATCH** /videos/{id}/captions/{lan} | -| [**uploadPart()**](VideoApi.md#uploadPart) | Upload part of video | **POST** /videos/{id}/part | -| [**uploadVideoComplete()**](VideoApi.md#uploadVideoComplete) | Get upload video when complete | **GET** /videos/{id}/complete | +| [**create()**](MediaApi.md#create) | Create media object | **POST** /media/create | +| [**update()**](MediaApi.md#update) | update media info | **PATCH** /media/{id} | +| [**delete()**](MediaApi.md#delete) | Delete media | **DELETE** /media/{id} | +| [**uploadThumbnail()**](MediaApi.md#uploadThumbnail) | Upload media thumbnail | **POST** /media/{id}/thumbnail | +| [**deleteThumbnail()**](MediaApi.md#deleteThumbnail) | Delete media thumbnail | **DELETE** /media/{id}/thumbnail | +| [**createCaption()**](MediaApi.md#createCaption) | Create a new media caption | **POST** /media/{id}/captions/{lan} | +| [**deleteCaption()**](MediaApi.md#deleteCaption) | Delete a media caption | **DELETE** /media/{id}/captions/{lan} | +| [**getCaptions()**](MediaApi.md#getCaptions) | Get media captions | **GET** /media/{id}/captions | +| [**getCost()**](MediaApi.md#getCost) | get media transcoding cost | **GET** /media/cost | +| [**getDetail()**](MediaApi.md#getDetail) | get media detail | **GET** /media/{id} | +| [**getMediaList()**](MediaApi.md#getMediaList) | Get user videos list | **POST** /media | +| [**getMediaPlayerInfo()**](MediaApi.md#getMediaPlayerInfo) | Get media object | **GET** /media/{id}/player.json | +| [**setDefaultCaption()**](MediaApi.md#setDefaultCaption) | Set default caption | **PATCH** /media/{id}/captions/{lan} | +| [**uploadMediaComplete()**](MediaApi.md#uploadMediaComplete) | Get upload media when complete | **GET** /media/{id}/complete | +| [**uploadPart()**](MediaApi.md#uploadPart) | Upload part of media | **POST** /media/{id}/part | -## **`create()` - Create video object** +## **`create()` - Create media object** -Create a video object +Create a media object ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **request** | [**CreateMediaRequest**](../model/CreateMediaRequest.md)| **yes**| video's info | + | **request** | [**CreateMediaRequest**](../model/CreateMediaRequest.md)| **yes**| media's info | ### Return type @@ -44,15 +44,15 @@ Promise<[**CreateMediaResponse**](../model/CreateMediaResponse.md)>. --- -## **`update()` - update video info** +## **`update()` - update media info** ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| video's id | - | **input** | [**UpdateVideoInfoRequest**](../model/UpdateVideoInfoRequest.md)| **yes**| input | + | **id** | **string**| **yes**| media's id | + | **input** | [**UpdateMediaInfoRequest**](../model/UpdateMediaInfoRequest.md)| **yes**| input | ### Return type @@ -65,16 +65,16 @@ Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. --- -## **`delete()` - Delete video** +## **`delete()` - Delete media** -Delete a video by video ID. +Delete a media by media ID. ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| Media ID | ### Return type @@ -87,15 +87,15 @@ Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. --- -## **`uploadThumbnail()` - Upload video thumbnail** +## **`uploadThumbnail()` - Upload media thumbnail** ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| video's id | - | **file** | **string \| Readable \| Buffer**| **yes**| file video to be uploaded | + | **id** | **string**| **yes**| media's id | + | **file** | **string \| Readable \| Buffer**| **yes**| file media to be uploaded | ### Return type @@ -108,14 +108,14 @@ Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. --- -## **`deleteThumbnail()` - Delete video thumbnail** +## **`deleteThumbnail()` - Delete media thumbnail** ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| video's id | + | **id** | **string**| **yes**| media's id | ### Return type @@ -128,23 +128,23 @@ Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. --- -## **`createCaption()` - Create a new video caption** +## **`createCaption()` - Create a new media caption** -Uploads a VTT file and creates a new video caption for the specified video. +Uploads a VTT file and creates a new media caption for the specified media. ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| Media ID | | **lan** | **string**| **yes**| Language | | **file** | **string \| Readable \| Buffer**| **yes**| VTT File | ### Return type -Promise<[**CreateVideoCaptionResponse**](../model/CreateVideoCaptionResponse.md)>. +Promise<[**CreateMediaCaptionResponse**](../model/CreateMediaCaptionResponse.md)>. @@ -152,16 +152,16 @@ Promise<[**CreateVideoCaptionResponse**](../model/CreateVideoCaptionResponse.md) --- -## **`deleteCaption()` - Delete a video caption** +## **`deleteCaption()` - Delete a media caption** -Delete a caption in a specific language by providing the video ID for the video you want to delete the caption from and the language the caption is in. +Delete a caption in a specific language by providing the media ID for the media you want to delete the caption from and the language the caption is in. ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| Media ID | | **lan** | **string**| **yes**| Language | @@ -175,23 +175,23 @@ Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. --- -## **`getCaptions()` - Get video captions** +## **`getCaptions()` - Get media captions** -Retrieves a list of video captions for the specified video. +Retrieves a list of media captions for the specified media. ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| Media ID | | **offset** | **number**| no| offset, allowed values greater than or equal to 0. Default(0) | | **limit** | **number**| no| results per page. Allowed values 1-100, default is 25 | ### Return type -Promise<[**GetVideoCaptionsResponse**](../model/GetVideoCaptionsResponse.md)>. +Promise<[**GetMediaCaptionsResponse**](../model/GetMediaCaptionsResponse.md)>. @@ -199,10 +199,10 @@ Promise<[**GetVideoCaptionsResponse**](../model/GetVideoCaptionsResponse.md)>. --- -## **`getCost()` - get video transcoding cost** +## **`getCost()` - get media transcoding cost** -get video transcoding cost +get media transcoding cost ### Parameters @@ -223,29 +223,29 @@ Promise<[**GetTranscodeCostResponse**](../model/GetTranscodeCostResponse.md)>. --- -## **`getDetail()` - get video detail** +## **`getDetail()` - get media detail** -Retrieve the video details by video id. +Retrieve the media details by media id. ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| video's id | + | **id** | **string**| **yes**| mediav's id | ### Return type -Promise<[**GetVideoDetailResponse**](../model/GetVideoDetailResponse.md)>. +Promise<[**GetMediaDetailResponse**](../model/GetMediaDetailResponse.md)>. --- - -## **`getVideoList()` - Get user videos list** + +## **`getMediaList()` - Get user videos list** Retrieve a list of videos for the authenticated user. @@ -254,35 +254,35 @@ Retrieve a list of videos for the authenticated user. | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **request** | [**GetVideoListRequest**](../model/GetVideoListRequest.md)| **yes**| video's info | + | **request** | [**GetMediaListRequest**](../model/GetMediaListRequest.md)| **yes**| video's info | ### Return type -Promise<[**GetVideoListResponse**](../model/GetVideoListResponse.md)>. +Promise<[**GetMediaListResponse**](../model/GetMediaListResponse.md)>. --- - -## **`getVideoPlayerInfo()` - Get video object** + +## **`getMediaPlayerInfo()` - Get media object** -Get video object +Get media object ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| media ID | | **token** | **string**| no| Token | ### Return type -Promise<[**GetVideoPlayerInfoResponse**](../model/GetVideoPlayerInfoResponse.md)>. +Promise<[**GetMediaPlayerInfoResponse**](../model/GetMediaPlayerInfoResponse.md)>. @@ -293,13 +293,13 @@ Promise<[**GetVideoPlayerInfoResponse**](../model/GetVideoPlayerInfoResponse.md) ## **`setDefaultCaption()` - Set default caption** -Set default caption for a video +Set default caption for a media ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| Media ID | | **lan** | **string**| **yes**| Language | @@ -310,13 +310,35 @@ Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. +--- + + +## **`uploadMediaComplete()` - Get upload media when complete** + + +Get upload media when complete. + +### Parameters + +| Name | Type | Required | Description | +| ------------- | ------------- | ------------- | ------------- | + | **id** | **string**| **yes**| media's id | + + +### Return type + +Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. + + + + --- -## **`uploadPart()` - Upload part of video** +## **`uploadPart()` - Upload part of media** -Upload part of video +Upload part of media ### Parameters @@ -363,27 +385,5 @@ const res = await uploadSession.uploadLastPart('test/data/10m.mp4.part.c'); // console.log(result); ``` ---- - - -## **`uploadVideoComplete()` - Get upload video when complete** - - -Get upload video when complete. - -### Parameters - -| Name | Type | Required | Description | -| ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| video's id | - - -### Return type - -Promise<[**ResponseSuccess**](../model/ResponseSuccess.md)>. - - - - --- diff --git a/docs/api/VideoChapterApi.md b/docs/api/MediaChapterApi.md similarity index 63% rename from docs/api/VideoChapterApi.md rename to docs/api/MediaChapterApi.md index b45ddf8d..80afd8db 100644 --- a/docs/api/VideoChapterApi.md +++ b/docs/api/MediaChapterApi.md @@ -1,32 +1,32 @@ -# VideoChapterApi +# MediaChapterApi All URIs are relative to *http://localhost/api* | Method | Description | HTTP request | | ------------- | ------------- | ------------- | -| [**create()**](VideoChapterApi.md#create) | Create a video chapter | **POST** /videos/{id}/chapters/{lan} | -| [**get()**](VideoChapterApi.md#get) | Get video chapters | **GET** /videos/{id}/chapters | -| [**delete()**](VideoChapterApi.md#delete) | Delete a video chapter | **DELETE** /videos/{id}/chapters/{lan} | +| [**create()**](MediaChapterApi.md#create) | Create a media chapter | **POST** /media/{id}/chapters/{lan} | +| [**get()**](MediaChapterApi.md#get) | Get media chapters | **GET** /media/{id}/chapters | +| [**delete()**](MediaChapterApi.md#delete) | Delete a video chapter | **DELETE** /media/{id}/chapters/{lan} | -## **`create()` - Create a video chapter** +## **`create()` - Create a media chapter** -Create a VTT file to add chapters to your video. Chapters help break the video into sections. +Create a VTT file to add chapters to your media. Chapters help break the media into sections. ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| Media ID | | **lan** | **string**| **yes**| Language | | **file** | **string \| Readable \| Buffer**| **yes**| VTT File | ### Return type -Promise<[**CreateVideoChapterResponse**](../model/CreateVideoChapterResponse.md)>. +Promise<[**CreateMediaChapterResponse**](../model/CreateMediaChapterResponse.md)>. @@ -34,23 +34,23 @@ Promise<[**CreateVideoChapterResponse**](../model/CreateVideoChapterResponse.md) --- -## **`get()` - Get video chapters** +## **`get()` - Get media chapters** -Get a chapter for by video id in a specific language. +Get a chapter for by media id in a specific language. ### Parameters | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | - | **id** | **string**| **yes**| Video ID | + | **id** | **string**| **yes**| Media ID | | **offset** | **number**| no| offset, allowed values greater than or equal to 0. Default(0) | | **limit** | **number**| no| results per page. Allowed values 1-100, default is 25 | ### Return type -Promise<[**GetVideoChaptersResponse**](../model/GetVideoChaptersResponse.md)>. +Promise<[**GetMediaChaptersResponse**](../model/GetMediaChaptersResponse.md)>. diff --git a/docs/model/AddPlayerThemesToVideoRequest.md b/docs/model/AddPlayerThemesToVideoRequest.md index cf397ad4..4b3e6529 100644 --- a/docs/model/AddPlayerThemesToVideoRequest.md +++ b/docs/model/AddPlayerThemesToVideoRequest.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**mediaId** | **string** | | [optional] **playerThemeId** | **string** | | [optional] -**videoId** | **string** | | [optional] diff --git a/docs/model/CreateVideoChapterData.md b/docs/model/CreateMediaCaptionData.md similarity index 58% rename from docs/model/CreateVideoChapterData.md rename to docs/model/CreateMediaCaptionData.md index 0869f41e..8ef6e8d8 100644 --- a/docs/model/CreateVideoChapterData.md +++ b/docs/model/CreateMediaCaptionData.md @@ -1,11 +1,11 @@ -# CreateVideoChapterData +# CreateMediaCaptionData ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**videoChapter** | [**VideoChapter**](VideoChapter.md) | | [optional] +**mediaCaption** | [**MediaCaption**](MediaCaption.md) | | [optional] diff --git a/docs/model/CreateVideoChapterResponse.md b/docs/model/CreateMediaCaptionResponse.md similarity index 65% rename from docs/model/CreateVideoChapterResponse.md rename to docs/model/CreateMediaCaptionResponse.md index 302d2360..aac1d7d2 100644 --- a/docs/model/CreateVideoChapterResponse.md +++ b/docs/model/CreateMediaCaptionResponse.md @@ -1,11 +1,11 @@ -# CreateVideoChapterResponse +# CreateMediaCaptionResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**CreateVideoChapterData**](CreateVideoChapterData.md) | | [optional] +**data** | [**CreateMediaCaptionData**](CreateMediaCaptionData.md) | | [optional] **status** | **string** | | [optional] diff --git a/docs/model/CreateVideoCaptionData.md b/docs/model/CreateMediaChapterData.md similarity index 58% rename from docs/model/CreateVideoCaptionData.md rename to docs/model/CreateMediaChapterData.md index 49bcbcdd..10d49300 100644 --- a/docs/model/CreateVideoCaptionData.md +++ b/docs/model/CreateMediaChapterData.md @@ -1,11 +1,11 @@ -# CreateVideoCaptionData +# CreateMediaChapterData ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**videoCaption** | [**VideoCaption**](VideoCaption.md) | | [optional] +**mediaChapter** | [**MediaChapter**](MediaChapter.md) | | [optional] diff --git a/docs/model/CreateVideoCaptionResponse.md b/docs/model/CreateMediaChapterResponse.md similarity index 65% rename from docs/model/CreateVideoCaptionResponse.md rename to docs/model/CreateMediaChapterResponse.md index e118decc..9bd16f93 100644 --- a/docs/model/CreateVideoCaptionResponse.md +++ b/docs/model/CreateMediaChapterResponse.md @@ -1,11 +1,11 @@ -# CreateVideoCaptionResponse +# CreateMediaChapterResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**CreateVideoCaptionData**](CreateVideoCaptionData.md) | | [optional] +**data** | [**CreateMediaChapterData**](CreateMediaChapterData.md) | | [optional] **status** | **string** | | [optional] diff --git a/docs/model/GetVideoChaptersData.md b/docs/model/GetMediaCaptionsData.md similarity index 67% rename from docs/model/GetVideoChaptersData.md rename to docs/model/GetMediaCaptionsData.md index 8bff7e5f..4456df02 100644 --- a/docs/model/GetVideoChaptersData.md +++ b/docs/model/GetMediaCaptionsData.md @@ -1,12 +1,12 @@ -# GetVideoChaptersData +# GetMediaCaptionsData ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**mediaCaptions** | [**Array<MediaCaption>**](MediaCaption.md) | | [optional] **total** | **number** | | [optional] -**videoChapters** | [**Array<VideoChapter>**](VideoChapter.md) | | [optional] diff --git a/docs/model/GetVideoCaptionsResponse.md b/docs/model/GetMediaCaptionsResponse.md similarity index 65% rename from docs/model/GetVideoCaptionsResponse.md rename to docs/model/GetMediaCaptionsResponse.md index a70c822a..71f42152 100644 --- a/docs/model/GetVideoCaptionsResponse.md +++ b/docs/model/GetMediaCaptionsResponse.md @@ -1,11 +1,11 @@ -# GetVideoCaptionsResponse +# GetMediaCaptionsResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**GetVideoCaptionsData**](GetVideoCaptionsData.md) | | [optional] +**data** | [**GetMediaCaptionsData**](GetMediaCaptionsData.md) | | [optional] **status** | **string** | | [optional] diff --git a/docs/model/GetVideoCaptionsData.md b/docs/model/GetMediaChaptersData.md similarity index 67% rename from docs/model/GetVideoCaptionsData.md rename to docs/model/GetMediaChaptersData.md index 211e6834..7affeec6 100644 --- a/docs/model/GetVideoCaptionsData.md +++ b/docs/model/GetMediaChaptersData.md @@ -1,12 +1,12 @@ -# GetVideoCaptionsData +# GetMediaChaptersData ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**mediaChapters** | [**Array<MediaChapter>**](MediaChapter.md) | | [optional] **total** | **number** | | [optional] -**videoCaptions** | [**Array<VideoCaption>**](VideoCaption.md) | | [optional] diff --git a/docs/model/GetVideoChaptersResponse.md b/docs/model/GetMediaChaptersResponse.md similarity index 65% rename from docs/model/GetVideoChaptersResponse.md rename to docs/model/GetMediaChaptersResponse.md index f3b59eb3..0166267a 100644 --- a/docs/model/GetVideoChaptersResponse.md +++ b/docs/model/GetMediaChaptersResponse.md @@ -1,11 +1,11 @@ -# GetVideoChaptersResponse +# GetMediaChaptersResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**GetVideoChaptersData**](GetVideoChaptersData.md) | | [optional] +**data** | [**GetMediaChaptersData**](GetMediaChaptersData.md) | | [optional] **status** | **string** | | [optional] diff --git a/docs/model/GetVideoDetailResponse.md b/docs/model/GetMediaDetailResponse.md similarity index 89% rename from docs/model/GetVideoDetailResponse.md rename to docs/model/GetMediaDetailResponse.md index 3dad0552..544832de 100644 --- a/docs/model/GetVideoDetailResponse.md +++ b/docs/model/GetMediaDetailResponse.md @@ -1,5 +1,5 @@ -# GetVideoDetailResponse +# GetMediaDetailResponse ## Properties diff --git a/docs/model/GetVideoListData.md b/docs/model/GetMediaListData.md similarity index 64% rename from docs/model/GetVideoListData.md rename to docs/model/GetMediaListData.md index ffedbf13..168e9977 100644 --- a/docs/model/GetVideoListData.md +++ b/docs/model/GetMediaListData.md @@ -1,12 +1,12 @@ -# GetVideoListData +# GetMediaListData ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**media** | [**Array<Media>**](Media.md) | | [optional] **total** | **number** | | [optional] -**videos** | [**Array<Media>**](Media.md) | | [optional] diff --git a/docs/model/GetVideoListRequest.md b/docs/model/GetMediaListRequest.md similarity index 86% rename from docs/model/GetVideoListRequest.md rename to docs/model/GetMediaListRequest.md index af04c566..f1f2be13 100644 --- a/docs/model/GetVideoListRequest.md +++ b/docs/model/GetMediaListRequest.md @@ -1,5 +1,5 @@ -# GetVideoListRequest +# GetMediaListRequest ## Properties @@ -11,7 +11,7 @@ Name | Type | Description | Notes **orderBy** | **string** | | [optional] **search** | **string** | | [optional] **sortBy** | **string** | | [optional] -**status** | **string** | | [optional] +**status** | **Array<string>** | | [optional] **tags** | **Array<string>** | | [optional] **type** | **string** | | [optional] diff --git a/docs/model/GetVideoListResponse.md b/docs/model/GetMediaListResponse.md similarity index 65% rename from docs/model/GetVideoListResponse.md rename to docs/model/GetMediaListResponse.md index f1b52bdf..957dcae4 100644 --- a/docs/model/GetVideoListResponse.md +++ b/docs/model/GetMediaListResponse.md @@ -1,11 +1,11 @@ -# GetVideoListResponse +# GetMediaListResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**GetVideoListData**](GetVideoListData.md) | | [optional] +**data** | [**GetMediaListData**](GetMediaListData.md) | | [optional] **status** | **string** | | [optional] diff --git a/docs/model/GetVideoPlayerInfoResponse.md b/docs/model/GetMediaPlayerInfoResponse.md similarity index 80% rename from docs/model/GetVideoPlayerInfoResponse.md rename to docs/model/GetMediaPlayerInfoResponse.md index b51b2cc3..71e3209e 100644 --- a/docs/model/GetVideoPlayerInfoResponse.md +++ b/docs/model/GetMediaPlayerInfoResponse.md @@ -1,13 +1,13 @@ -# GetVideoPlayerInfoResponse +# GetMediaPlayerInfoResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**assets** | [**VideoAssets**](VideoAssets.md) | | [optional] -**captions** | [**Array<VideoCaption>**](VideoCaption.md) | | [optional] -**chapters** | [**Array<VideoChapter>**](VideoChapter.md) | | [optional] +**assets** | [**MediaAssets**](MediaAssets.md) | | [optional] +**captions** | [**Array<MediaCaption>**](MediaCaption.md) | | [optional] +**chapters** | [**Array<MediaChapter>**](MediaChapter.md) | | [optional] **createdAt** | **string** | | [optional] **description** | **string** | | [optional] **duration** | **number** | | [optional] diff --git a/docs/model/Media.md b/docs/model/Media.md index 19189d4f..4d00cf6e 100644 --- a/docs/model/Media.md +++ b/docs/model/Media.md @@ -5,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**assets** | [**VideoAssets**](VideoAssets.md) | | [optional] -**captions** | [**Array<VideoCaption>**](VideoCaption.md) | | [optional] -**chapters** | [**Array<VideoChapter>**](VideoChapter.md) | | [optional] +**assets** | [**MediaAssets**](MediaAssets.md) | | [optional] +**captions** | [**Array<MediaCaption>**](MediaCaption.md) | | [optional] +**chapters** | [**Array<MediaChapter>**](MediaChapter.md) | | [optional] **createdAt** | **string** | | [optional] **description** | **string** | | [optional] **duration** | **number** | | [optional] diff --git a/docs/model/VideoAssets.md b/docs/model/MediaAssets.md similarity index 97% rename from docs/model/VideoAssets.md rename to docs/model/MediaAssets.md index 611548e4..26c2ac60 100644 --- a/docs/model/VideoAssets.md +++ b/docs/model/MediaAssets.md @@ -1,5 +1,5 @@ -# VideoAssets +# MediaAssets ## Properties diff --git a/docs/model/VideoCaption.md b/docs/model/MediaCaption.md similarity index 95% rename from docs/model/VideoCaption.md rename to docs/model/MediaCaption.md index 5877c6ae..27be5bbd 100644 --- a/docs/model/VideoCaption.md +++ b/docs/model/MediaCaption.md @@ -1,5 +1,5 @@ -# VideoCaption +# MediaCaption ## Properties diff --git a/docs/model/VideoChapter.md b/docs/model/MediaChapter.md similarity index 92% rename from docs/model/VideoChapter.md rename to docs/model/MediaChapter.md index 5768f907..402cea1b 100644 --- a/docs/model/VideoChapter.md +++ b/docs/model/MediaChapter.md @@ -1,5 +1,5 @@ -# VideoChapter +# MediaChapter ## Properties diff --git a/docs/model/Playlist.md b/docs/model/Playlist.md index 07173f06..7987fbdd 100644 --- a/docs/model/Playlist.md +++ b/docs/model/Playlist.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **id** | **string** | | [optional] **iframe** | **string** | | [optional] **itemCount** | **number** | | [optional] +**items** | [**Array<PlaylistItem>**](PlaylistItem.md) | | [optional] **metadata** | **Map<String, string>** | | [optional] **name** | **string** | | [optional] **playlistType** | **string** | | [optional] @@ -19,7 +20,6 @@ Name | Type | Description | Notes **thumbnailUrl** | **string** | | [optional] **updatedAt** | **string** | | [optional] **userId** | **string** | | [optional] -**videoItems** | [**Array<PlaylistItem>**](PlaylistItem.md) | | [optional] diff --git a/docs/model/PlaylistItem.md b/docs/model/PlaylistItem.md index d4b76818..062d8887 100644 --- a/docs/model/PlaylistItem.md +++ b/docs/model/PlaylistItem.md @@ -7,11 +7,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **createdAt** | **string** | | [optional] **id** | **string** | | [optional] +**media** | [**PlaylistItemMedia**](PlaylistItemMedia.md) | | [optional] **nextId** | **string** | | [optional] **playlistId** | **string** | | [optional] **previousId** | **string** | | [optional] **updatedAt** | **string** | | [optional] -**video** | [**PlaylistItemMedia**](PlaylistItemMedia.md) | | [optional] **videoId** | **string** | | [optional] diff --git a/docs/model/PlaylistItemMedia.md b/docs/model/PlaylistItemMedia.md index c7caa4ea..51b89840 100644 --- a/docs/model/PlaylistItemMedia.md +++ b/docs/model/PlaylistItemMedia.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**captions** | [**Array<VideoCaption>**](VideoCaption.md) | | [optional] -**chapters** | [**Array<VideoChapter>**](VideoChapter.md) | | [optional] +**captions** | [**Array<MediaCaption>**](MediaCaption.md) | | [optional] +**chapters** | [**Array<MediaChapter>**](MediaChapter.md) | | [optional] **description** | **string** | | [optional] **duration** | **number** | | [optional] **hlsUrl** | **string** | | [optional] diff --git a/docs/model/RemovePlayerThemesFromMediaRequest.md b/docs/model/RemovePlayerThemesFromMediaRequest.md index e09d5a5d..37662203 100644 --- a/docs/model/RemovePlayerThemesFromMediaRequest.md +++ b/docs/model/RemovePlayerThemesFromMediaRequest.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**mediaId** | **string** | | [optional] **playerThemeId** | **string** | | [optional] -**videoId** | **string** | | [optional] diff --git a/docs/model/UpdateVideoInfoRequest.md b/docs/model/UpdateMediaInfoRequest.md similarity index 95% rename from docs/model/UpdateVideoInfoRequest.md rename to docs/model/UpdateMediaInfoRequest.md index 4ed247b4..2278097e 100644 --- a/docs/model/UpdateVideoInfoRequest.md +++ b/docs/model/UpdateMediaInfoRequest.md @@ -1,5 +1,5 @@ -# UpdateVideoInfoRequest +# UpdateMediaInfoRequest ## Properties diff --git a/src/ObjectSerializer.ts b/src/ObjectSerializer.ts index c08859bb..78933f03 100644 --- a/src/ObjectSerializer.ts +++ b/src/ObjectSerializer.ts @@ -19,6 +19,10 @@ import Controls from './model/Controls'; import CreateApiKeyData from './model/CreateApiKeyData'; import CreateApiKeyRequest from './model/CreateApiKeyRequest'; import CreateApiKeyResponse from './model/CreateApiKeyResponse'; +import CreateMediaCaptionData from './model/CreateMediaCaptionData'; +import CreateMediaCaptionResponse from './model/CreateMediaCaptionResponse'; +import CreateMediaChapterData from './model/CreateMediaChapterData'; +import CreateMediaChapterResponse from './model/CreateMediaChapterResponse'; import CreateMediaRequest from './model/CreateMediaRequest'; import CreateMediaResponse from './model/CreateMediaResponse'; import CreatePlayerThemeRequest from './model/CreatePlayerThemeRequest'; @@ -27,15 +31,20 @@ import CreatePlayerThemesResponse from './model/CreatePlayerThemesResponse'; import CreatePlaylistData from './model/CreatePlaylistData'; import CreatePlaylistRequest from './model/CreatePlaylistRequest'; import CreatePlaylistResponse from './model/CreatePlaylistResponse'; -import CreateVideoCaptionData from './model/CreateVideoCaptionData'; -import CreateVideoCaptionResponse from './model/CreateVideoCaptionResponse'; -import CreateVideoChapterData from './model/CreateVideoChapterData'; -import CreateVideoChapterResponse from './model/CreateVideoChapterResponse'; import CreateWebhookData from './model/CreateWebhookData'; import CreateWebhookRequest from './model/CreateWebhookRequest'; import CreateWebhookResponse from './model/CreateWebhookResponse'; import GetApiKeysData from './model/GetApiKeysData'; import GetApiKeysResponse from './model/GetApiKeysResponse'; +import GetMediaCaptionsData from './model/GetMediaCaptionsData'; +import GetMediaCaptionsResponse from './model/GetMediaCaptionsResponse'; +import GetMediaChaptersData from './model/GetMediaChaptersData'; +import GetMediaChaptersResponse from './model/GetMediaChaptersResponse'; +import GetMediaDetailResponse from './model/GetMediaDetailResponse'; +import GetMediaListData from './model/GetMediaListData'; +import GetMediaListRequest from './model/GetMediaListRequest'; +import GetMediaListResponse from './model/GetMediaListResponse'; +import GetMediaPlayerInfoResponse from './model/GetMediaPlayerInfoResponse'; import GetPlayerThemeByIdData from './model/GetPlayerThemeByIdData'; import GetPlayerThemeByIdResponse from './model/GetPlayerThemeByIdResponse'; import GetPlayerThemeData from './model/GetPlayerThemeData'; @@ -49,18 +58,12 @@ import GetTranscodeCostData from './model/GetTranscodeCostData'; import GetTranscodeCostResponse from './model/GetTranscodeCostResponse'; import GetUserWebhookData from './model/GetUserWebhookData'; import GetUserWebhookResponse from './model/GetUserWebhookResponse'; -import GetVideoCaptionsData from './model/GetVideoCaptionsData'; -import GetVideoCaptionsResponse from './model/GetVideoCaptionsResponse'; -import GetVideoChaptersData from './model/GetVideoChaptersData'; -import GetVideoChaptersResponse from './model/GetVideoChaptersResponse'; -import GetVideoDetailResponse from './model/GetVideoDetailResponse'; -import GetVideoListData from './model/GetVideoListData'; -import GetVideoListRequest from './model/GetVideoListRequest'; -import GetVideoListResponse from './model/GetVideoListResponse'; -import GetVideoPlayerInfoResponse from './model/GetVideoPlayerInfoResponse'; import GetWebhooksListData from './model/GetWebhooksListData'; import GetWebhooksListResponse from './model/GetWebhooksListResponse'; import Media from './model/Media'; +import MediaAssets from './model/MediaAssets'; +import MediaCaption from './model/MediaCaption'; +import MediaChapter from './model/MediaChapter'; import Metadata from './model/Metadata'; import MoveVideoInPlaylistRequest from './model/MoveVideoInPlaylistRequest'; import PlayerTheme from './model/PlayerTheme'; @@ -77,15 +80,12 @@ import RequestCreateCaption from './model/RequestCreateCaption'; import ResponseError from './model/ResponseError'; import ResponseSuccess from './model/ResponseSuccess'; import Theme from './model/Theme'; +import UpdateMediaInfoRequest from './model/UpdateMediaInfoRequest'; import UpdatePlayerThemeRequest from './model/UpdatePlayerThemeRequest'; import UpdatePlayerThemeResponse from './model/UpdatePlayerThemeResponse'; -import UpdateVideoInfoRequest from './model/UpdateVideoInfoRequest'; import UpdateWebhookRequest from './model/UpdateWebhookRequest'; import UploadLogoByIdResponse from './model/UploadLogoByIdResponse'; import User from './model/User'; -import VideoAssets from './model/VideoAssets'; -import VideoCaption from './model/VideoCaption'; -import VideoChapter from './model/VideoChapter'; import VideoConfig from './model/VideoConfig'; import VideoWatermark from './model/VideoWatermark'; import Webhook from './model/Webhook'; @@ -126,6 +126,10 @@ const typeMap: { [index: string]: any } = { CreateApiKeyData: CreateApiKeyData, CreateApiKeyRequest: CreateApiKeyRequest, CreateApiKeyResponse: CreateApiKeyResponse, + CreateMediaCaptionData: CreateMediaCaptionData, + CreateMediaCaptionResponse: CreateMediaCaptionResponse, + CreateMediaChapterData: CreateMediaChapterData, + CreateMediaChapterResponse: CreateMediaChapterResponse, CreateMediaRequest: CreateMediaRequest, CreateMediaResponse: CreateMediaResponse, CreatePlayerThemeRequest: CreatePlayerThemeRequest, @@ -134,15 +138,20 @@ const typeMap: { [index: string]: any } = { CreatePlaylistData: CreatePlaylistData, CreatePlaylistRequest: CreatePlaylistRequest, CreatePlaylistResponse: CreatePlaylistResponse, - CreateVideoCaptionData: CreateVideoCaptionData, - CreateVideoCaptionResponse: CreateVideoCaptionResponse, - CreateVideoChapterData: CreateVideoChapterData, - CreateVideoChapterResponse: CreateVideoChapterResponse, CreateWebhookData: CreateWebhookData, CreateWebhookRequest: CreateWebhookRequest, CreateWebhookResponse: CreateWebhookResponse, GetApiKeysData: GetApiKeysData, GetApiKeysResponse: GetApiKeysResponse, + GetMediaCaptionsData: GetMediaCaptionsData, + GetMediaCaptionsResponse: GetMediaCaptionsResponse, + GetMediaChaptersData: GetMediaChaptersData, + GetMediaChaptersResponse: GetMediaChaptersResponse, + GetMediaDetailResponse: GetMediaDetailResponse, + GetMediaListData: GetMediaListData, + GetMediaListRequest: GetMediaListRequest, + GetMediaListResponse: GetMediaListResponse, + GetMediaPlayerInfoResponse: GetMediaPlayerInfoResponse, GetPlayerThemeByIdData: GetPlayerThemeByIdData, GetPlayerThemeByIdResponse: GetPlayerThemeByIdResponse, GetPlayerThemeData: GetPlayerThemeData, @@ -156,18 +165,12 @@ const typeMap: { [index: string]: any } = { GetTranscodeCostResponse: GetTranscodeCostResponse, GetUserWebhookData: GetUserWebhookData, GetUserWebhookResponse: GetUserWebhookResponse, - GetVideoCaptionsData: GetVideoCaptionsData, - GetVideoCaptionsResponse: GetVideoCaptionsResponse, - GetVideoChaptersData: GetVideoChaptersData, - GetVideoChaptersResponse: GetVideoChaptersResponse, - GetVideoDetailResponse: GetVideoDetailResponse, - GetVideoListData: GetVideoListData, - GetVideoListRequest: GetVideoListRequest, - GetVideoListResponse: GetVideoListResponse, - GetVideoPlayerInfoResponse: GetVideoPlayerInfoResponse, GetWebhooksListData: GetWebhooksListData, GetWebhooksListResponse: GetWebhooksListResponse, Media: Media, + MediaAssets: MediaAssets, + MediaCaption: MediaCaption, + MediaChapter: MediaChapter, Metadata: Metadata, MoveVideoInPlaylistRequest: MoveVideoInPlaylistRequest, PlayerTheme: PlayerTheme, @@ -184,15 +187,12 @@ const typeMap: { [index: string]: any } = { ResponseError: ResponseError, ResponseSuccess: ResponseSuccess, Theme: Theme, + UpdateMediaInfoRequest: UpdateMediaInfoRequest, UpdatePlayerThemeRequest: UpdatePlayerThemeRequest, UpdatePlayerThemeResponse: UpdatePlayerThemeResponse, - UpdateVideoInfoRequest: UpdateVideoInfoRequest, UpdateWebhookRequest: UpdateWebhookRequest, UploadLogoByIdResponse: UploadLogoByIdResponse, User: User, - VideoAssets: VideoAssets, - VideoCaption: VideoCaption, - VideoChapter: VideoChapter, VideoConfig: VideoConfig, VideoWatermark: VideoWatermark, Webhook: Webhook, diff --git a/src/api/VideoApi.ts b/src/api/MediaApi.ts similarity index 84% rename from src/api/VideoApi.ts rename to src/api/MediaApi.ts index 281debef..1608982f 100644 --- a/src/api/VideoApi.ts +++ b/src/api/MediaApi.ts @@ -16,17 +16,17 @@ import FormData from 'form-data'; import ObjectSerializer from '../ObjectSerializer'; import HttpClient, { QueryOptions, ApiResponseHeaders } from '../HttpClient'; import ProgressiveSession from '../model/ProgressiveSession'; +import CreateMediaCaptionResponse from '../model/CreateMediaCaptionResponse'; import CreateMediaRequest from '../model/CreateMediaRequest'; import CreateMediaResponse from '../model/CreateMediaResponse'; -import CreateVideoCaptionResponse from '../model/CreateVideoCaptionResponse'; +import GetMediaCaptionsResponse from '../model/GetMediaCaptionsResponse'; +import GetMediaDetailResponse from '../model/GetMediaDetailResponse'; +import GetMediaListRequest from '../model/GetMediaListRequest'; +import GetMediaListResponse from '../model/GetMediaListResponse'; +import GetMediaPlayerInfoResponse from '../model/GetMediaPlayerInfoResponse'; import GetTranscodeCostResponse from '../model/GetTranscodeCostResponse'; -import GetVideoCaptionsResponse from '../model/GetVideoCaptionsResponse'; -import GetVideoDetailResponse from '../model/GetVideoDetailResponse'; -import GetVideoListRequest from '../model/GetVideoListRequest'; -import GetVideoListResponse from '../model/GetVideoListResponse'; -import GetVideoPlayerInfoResponse from '../model/GetVideoPlayerInfoResponse'; import ResponseSuccess from '../model/ResponseSuccess'; -import UpdateVideoInfoRequest from '../model/UpdateVideoInfoRequest'; +import UpdateMediaInfoRequest from '../model/UpdateMediaInfoRequest'; import UploadProgressEvent from '../model/UploadProgressEvent'; import { Readable } from 'stream'; import { readableToBuffer } from '../HttpClient'; @@ -35,7 +35,7 @@ import * as crypto from 'crypto'; /** * no description */ -export default class VideoApi { +export default class MediaApi { private httpClient: HttpClient; constructor(httpClient: HttpClient) { @@ -43,9 +43,9 @@ export default class VideoApi { } /** - * Create a video object - * Create video object - * @param request video's info + * Create a media object + * Create media object + * @param request media's info */ public async create( request: CreateMediaRequest = {} @@ -54,9 +54,9 @@ export default class VideoApi { } /** - * Create a video object - * Create video object - * @param request video's info + * Create a media object + * Create media object + * @param request media's info */ public async createWithResponseHeaders( request: CreateMediaRequest = {} @@ -69,7 +69,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/create'.substring(1); + const localVarPath = '/media/create'.substring(1); // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ @@ -102,25 +102,25 @@ export default class VideoApi { } /** - * update video info - * @param id video's id + * update media info + * @param id media's id * @param input input */ public async update( id: string, - input: UpdateVideoInfoRequest = {} + input: UpdateMediaInfoRequest = {} ): Promise { return this.updateWithResponseHeaders(id, input).then((res) => res.body); } /** - * update video info - * @param id video's id + * update media info + * @param id media's id * @param input input */ public async updateWithResponseHeaders( id: string, - input: UpdateVideoInfoRequest = {} + input: UpdateMediaInfoRequest = {} ): Promise<{ headers: ApiResponseHeaders; body: ResponseSuccess }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; @@ -135,7 +135,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/{id}' + const localVarPath = '/media/{id}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -146,7 +146,7 @@ export default class VideoApi { queryParams.headers['Content-Type'] = contentType; queryParams.body = ObjectSerializer.stringify( - ObjectSerializer.serialize(input, 'UpdateVideoInfoRequest', ''), + ObjectSerializer.serialize(input, 'UpdateMediaInfoRequest', ''), contentType ); @@ -168,18 +168,18 @@ export default class VideoApi { } /** - * Delete a video by video ID. - * Delete video - * @param id Video ID + * Delete a media by media ID. + * Delete media + * @param id Media ID */ public async delete(id: string): Promise { return this.deleteWithResponseHeaders(id).then((res) => res.body); } /** - * Delete a video by video ID. - * Delete video - * @param id Video ID + * Delete a media by media ID. + * Delete media + * @param id Media ID */ public async deleteWithResponseHeaders( id: string @@ -192,7 +192,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/{id}' + const localVarPath = '/media/{id}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -214,9 +214,9 @@ export default class VideoApi { } /** - * Upload video thumbnail - * @param id video's id - * @param file file video to be uploaded + * Upload media thumbnail + * @param id media's id + * @param file file media to be uploaded */ public async uploadThumbnail( id: string, @@ -228,9 +228,9 @@ export default class VideoApi { } /** - * Upload video thumbnail - * @param id video's id - * @param file file video to be uploaded + * Upload media thumbnail + * @param id media's id + * @param file file media to be uploaded */ public async uploadThumbnailWithResponseHeaders( id: string, @@ -254,7 +254,7 @@ export default class VideoApi { } // Path Params - const localVarPath = '/videos/{id}/thumbnail' + const localVarPath = '/media/{id}/thumbnail' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -281,16 +281,16 @@ export default class VideoApi { } /** - * Delete video thumbnail - * @param id video's id + * Delete media thumbnail + * @param id media's id */ public async deleteThumbnail(id: string): Promise { return this.deleteThumbnailWithResponseHeaders(id).then((res) => res.body); } /** - * Delete video thumbnail - * @param id video's id + * Delete media thumbnail + * @param id media's id */ public async deleteThumbnailWithResponseHeaders( id: string @@ -303,7 +303,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/{id}/thumbnail' + const localVarPath = '/media/{id}/thumbnail' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -325,9 +325,9 @@ export default class VideoApi { } /** - * Uploads a VTT file and creates a new video caption for the specified video. - * Create a new video caption - * @param id Video ID + * Uploads a VTT file and creates a new media caption for the specified media. + * Create a new media caption + * @param id Media ID * @param lan Language * @param file VTT File */ @@ -335,16 +335,16 @@ export default class VideoApi { id: string, lan: string, file: string | Readable | Buffer - ): Promise { + ): Promise { return this.createCaptionWithResponseHeaders(id, lan, file).then( (res) => res.body ); } /** - * Uploads a VTT file and creates a new video caption for the specified video. - * Create a new video caption - * @param id Video ID + * Uploads a VTT file and creates a new media caption for the specified media. + * Create a new media caption + * @param id Media ID * @param lan Language * @param file VTT File */ @@ -354,7 +354,7 @@ export default class VideoApi { file: string | Readable | Buffer ): Promise<{ headers: ApiResponseHeaders; - body: CreateVideoCaptionResponse; + body: CreateMediaCaptionResponse; }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; @@ -379,7 +379,7 @@ export default class VideoApi { } // Path Params - const localVarPath = '/videos/{id}/captions/{lan}' + const localVarPath = '/media/{id}/captions/{lan}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'lan' + '}', encodeURIComponent(String(lan))); @@ -399,17 +399,17 @@ export default class VideoApi { response.body, response.headers['content-type'] ), - 'CreateVideoCaptionResponse', + 'CreateMediaCaptionResponse', '' - ) as CreateVideoCaptionResponse, + ) as CreateMediaCaptionResponse, }; }); } /** - * Delete a caption in a specific language by providing the video ID for the video you want to delete the caption from and the language the caption is in. - * Delete a video caption - * @param id Video ID + * Delete a caption in a specific language by providing the media ID for the media you want to delete the caption from and the language the caption is in. + * Delete a media caption + * @param id Media ID * @param lan Language */ public async deleteCaption( @@ -422,9 +422,9 @@ export default class VideoApi { } /** - * Delete a caption in a specific language by providing the video ID for the video you want to delete the caption from and the language the caption is in. - * Delete a video caption - * @param id Video ID + * Delete a caption in a specific language by providing the media ID for the media you want to delete the caption from and the language the caption is in. + * Delete a media caption + * @param id Media ID * @param lan Language */ public async deleteCaptionWithResponseHeaders( @@ -444,7 +444,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/{id}/captions/{lan}' + const localVarPath = '/media/{id}/captions/{lan}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'lan' + '}', encodeURIComponent(String(lan))); @@ -467,10 +467,10 @@ export default class VideoApi { } /** - * Retrieves a list of video captions for the specified video. - * Get video captions + * Retrieves a list of media captions for the specified media. + * Get media captions * @param {Object} searchParams - * @param { string } searchParams.id Video ID + * @param { string } searchParams.id Media ID * @param { number } searchParams.offset offset, allowed values greater than or equal to 0. Default(0) * @param { number } searchParams.limit results per page. Allowed values 1-100, default is 25 */ @@ -478,15 +478,15 @@ export default class VideoApi { id: string; offset?: number; limit?: number; - }): Promise { + }): Promise { return this.getCaptionsWithResponseHeaders(args).then((res) => res.body); } /** - * Retrieves a list of video captions for the specified video. - * Get video captions + * Retrieves a list of media captions for the specified media. + * Get media captions * @param {Object} searchParams - * @param { string } searchParams.id Video ID + * @param { string } searchParams.id Media ID * @param { number } searchParams.offset offset, allowed values greater than or equal to 0. Default(0) * @param { number } searchParams.limit results per page. Allowed values 1-100, default is 25 */ @@ -498,7 +498,7 @@ export default class VideoApi { id: string; offset?: number; limit?: number; - }): Promise<{ headers: ApiResponseHeaders; body: GetVideoCaptionsResponse }> { + }): Promise<{ headers: ApiResponseHeaders; body: GetMediaCaptionsResponse }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; if (id === null || id === undefined) { @@ -507,7 +507,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/{id}/captions' + const localVarPath = '/media/{id}/captions' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -539,16 +539,16 @@ export default class VideoApi { response.body, response.headers['content-type'] ), - 'GetVideoCaptionsResponse', + 'GetMediaCaptionsResponse', '' - ) as GetVideoCaptionsResponse, + ) as GetMediaCaptionsResponse, }; }); } /** - * get video transcoding cost - * get video transcoding cost + * get media transcoding cost + * get media transcoding cost * @param qualities media's qualities * @param type media's type * @param duration media's duration @@ -564,8 +564,8 @@ export default class VideoApi { } /** - * get video transcoding cost - * get video transcoding cost + * get media transcoding cost + * get media transcoding cost * @param qualities media's qualities * @param type media's type * @param duration media's duration @@ -593,7 +593,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/cost'.substring(1); + const localVarPath = '/media/cost'.substring(1); // Query Params const urlSearchParams = new URLSearchParams(); @@ -637,22 +637,22 @@ export default class VideoApi { } /** - * Retrieve the video details by video id. - * get video detail - * @param id video's id + * Retrieve the media details by media id. + * get media detail + * @param id mediav's id */ - public async getDetail(id: string): Promise { + public async getDetail(id: string): Promise { return this.getDetailWithResponseHeaders(id).then((res) => res.body); } /** - * Retrieve the video details by video id. - * get video detail - * @param id video's id + * Retrieve the media details by media id. + * get media detail + * @param id mediav's id */ public async getDetailWithResponseHeaders( id: string - ): Promise<{ headers: ApiResponseHeaders; body: GetVideoDetailResponse }> { + ): Promise<{ headers: ApiResponseHeaders; body: GetMediaDetailResponse }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; if (id === null || id === undefined) { @@ -661,7 +661,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/{id}' + const localVarPath = '/media/{id}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -675,9 +675,9 @@ export default class VideoApi { response.body, response.headers['content-type'] ), - 'GetVideoDetailResponse', + 'GetMediaDetailResponse', '' - ) as GetVideoDetailResponse, + ) as GetMediaDetailResponse, }; }); } @@ -687,10 +687,10 @@ export default class VideoApi { * Get user videos list * @param request video's info */ - public async getVideoList( - request: GetVideoListRequest = {} - ): Promise { - return this.getVideoListWithResponseHeaders(request).then( + public async getMediaList( + request: GetMediaListRequest = {} + ): Promise { + return this.getMediaListWithResponseHeaders(request).then( (res) => res.body ); } @@ -700,18 +700,18 @@ export default class VideoApi { * Get user videos list * @param request video's info */ - public async getVideoListWithResponseHeaders( - request: GetVideoListRequest = {} - ): Promise<{ headers: ApiResponseHeaders; body: GetVideoListResponse }> { + public async getMediaListWithResponseHeaders( + request: GetMediaListRequest = {} + ): Promise<{ headers: ApiResponseHeaders; body: GetMediaListResponse }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; if (request === null || request === undefined) { throw new Error( - 'Required parameter request was null or undefined when calling getVideoList.' + 'Required parameter request was null or undefined when calling getMediaList.' ); } // Path Params - const localVarPath = '/videos'.substring(1); + const localVarPath = '/media'.substring(1); // Body Params const contentType = ObjectSerializer.getPreferredMediaType([ @@ -720,7 +720,7 @@ export default class VideoApi { queryParams.headers['Content-Type'] = contentType; queryParams.body = ObjectSerializer.stringify( - ObjectSerializer.serialize(request, 'GetVideoListRequest', ''), + ObjectSerializer.serialize(request, 'GetMediaListRequest', ''), contentType ); @@ -734,37 +734,37 @@ export default class VideoApi { response.body, response.headers['content-type'] ), - 'GetVideoListResponse', + 'GetMediaListResponse', '' - ) as GetVideoListResponse, + ) as GetMediaListResponse, }; }); } /** - * Get video object - * Get video object + * Get media object + * Get media object * @param {Object} searchParams - * @param { string } searchParams.id Video ID + * @param { string } searchParams.id media ID * @param { string } searchParams.token Token */ - public async getVideoPlayerInfo(args: { + public async getMediaPlayerInfo(args: { id: string; token?: string; - }): Promise { - return this.getVideoPlayerInfoWithResponseHeaders(args).then( + }): Promise { + return this.getMediaPlayerInfoWithResponseHeaders(args).then( (res) => res.body ); } /** - * Get video object - * Get video object + * Get media object + * Get media object * @param {Object} searchParams - * @param { string } searchParams.id Video ID + * @param { string } searchParams.id media ID * @param { string } searchParams.token Token */ - public async getVideoPlayerInfoWithResponseHeaders({ + public async getMediaPlayerInfoWithResponseHeaders({ id, token, }: { @@ -772,17 +772,17 @@ export default class VideoApi { token?: string; }): Promise<{ headers: ApiResponseHeaders; - body: GetVideoPlayerInfoResponse; + body: GetMediaPlayerInfoResponse; }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; if (id === null || id === undefined) { throw new Error( - 'Required parameter id was null or undefined when calling getVideoPlayerInfo.' + 'Required parameter id was null or undefined when calling getMediaPlayerInfo.' ); } // Path Params - const localVarPath = '/videos/{id}/player.json' + const localVarPath = '/media/{id}/player.json' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -808,17 +808,17 @@ export default class VideoApi { response.body, response.headers['content-type'] ), - 'GetVideoPlayerInfoResponse', + 'GetMediaPlayerInfoResponse', '' - ) as GetVideoPlayerInfoResponse, + ) as GetMediaPlayerInfoResponse, }; }); } /** - * Set default caption for a video + * Set default caption for a media * Set default caption - * @param id Video ID + * @param id Media ID * @param lan Language */ public async setDefaultCaption( @@ -831,9 +831,9 @@ export default class VideoApi { } /** - * Set default caption for a video + * Set default caption for a media * Set default caption - * @param id Video ID + * @param id Media ID * @param lan Language */ public async setDefaultCaptionWithResponseHeaders( @@ -853,7 +853,7 @@ export default class VideoApi { ); } // Path Params - const localVarPath = '/videos/{id}/captions/{lan}' + const localVarPath = '/media/{id}/captions/{lan}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'lan' + '}', encodeURIComponent(String(lan))); @@ -876,7 +876,55 @@ export default class VideoApi { } /** - * Upload part of video + * Get upload media when complete. + * Get upload media when complete + * @param id media's id + */ + public async uploadMediaComplete(id: string): Promise { + return this.uploadMediaCompleteWithResponseHeaders(id).then( + (res) => res.body + ); + } + + /** + * Get upload media when complete. + * Get upload media when complete + * @param id media's id + */ + public async uploadMediaCompleteWithResponseHeaders( + id: string + ): Promise<{ headers: ApiResponseHeaders; body: ResponseSuccess }> { + const queryParams: QueryOptions = {}; + queryParams.headers = {}; + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling uploadMediaComplete.' + ); + } + // Path Params + const localVarPath = '/media/{id}/complete' + .substring(1) + .replace('{' + 'id' + '}', encodeURIComponent(String(id))); + + queryParams.method = 'GET'; + + return this.httpClient.call(localVarPath, queryParams).then((response) => { + return { + headers: response.headers, + body: ObjectSerializer.deserialize( + ObjectSerializer.parse( + response.body, + response.headers['content-type'] + ), + 'ResponseSuccess', + '' + ) as ResponseSuccess, + }; + }); + } + + /** + * Upload part of media * This will create a progressive upload session. * @param id video's id * @param hash Md5 hash of part @@ -950,7 +998,7 @@ export default class VideoApi { throw new Error(`${file} is empty`); } // Path Params - const localVarPath = '/videos/{id}/part' + const localVarPath = '/media/{id}/part' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -1001,8 +1049,8 @@ export default class VideoApi { } /** - * Upload part of video - * Upload part of video + * Upload part of media + * Upload part of media * @param id video's id * @param file File media to be uploaded * @param hash Md5 hash of part @@ -1025,8 +1073,8 @@ export default class VideoApi { } /** - * Upload part of video - * Upload part of video + * Upload part of media + * Upload part of media * @param id video's id * @param file File media to be uploaded * @param hash Md5 hash of part @@ -1055,7 +1103,7 @@ export default class VideoApi { throw new Error(`${file} is empty`); } // Path Params - const localVarPath = '/videos/{id}/part' + const localVarPath = '/media/{id}/part' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -1209,52 +1257,4 @@ export default class VideoApi { formData.append('index', index); } } - - /** - * Get upload video when complete. - * Get upload video when complete - * @param id video's id - */ - public async uploadVideoComplete(id: string): Promise { - return this.uploadVideoCompleteWithResponseHeaders(id).then( - (res) => res.body - ); - } - - /** - * Get upload video when complete. - * Get upload video when complete - * @param id video's id - */ - public async uploadVideoCompleteWithResponseHeaders( - id: string - ): Promise<{ headers: ApiResponseHeaders; body: ResponseSuccess }> { - const queryParams: QueryOptions = {}; - queryParams.headers = {}; - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling uploadVideoComplete.' - ); - } - // Path Params - const localVarPath = '/videos/{id}/complete' - .substring(1) - .replace('{' + 'id' + '}', encodeURIComponent(String(id))); - - queryParams.method = 'GET'; - - return this.httpClient.call(localVarPath, queryParams).then((response) => { - return { - headers: response.headers, - body: ObjectSerializer.deserialize( - ObjectSerializer.parse( - response.body, - response.headers['content-type'] - ), - 'ResponseSuccess', - '' - ) as ResponseSuccess, - }; - }); - } } diff --git a/src/api/VideoChapterApi.ts b/src/api/MediaChapterApi.ts similarity index 83% rename from src/api/VideoChapterApi.ts rename to src/api/MediaChapterApi.ts index 1a2c461e..cd6ec3bc 100644 --- a/src/api/VideoChapterApi.ts +++ b/src/api/MediaChapterApi.ts @@ -15,8 +15,8 @@ import { URLSearchParams } from 'url'; import FormData from 'form-data'; import ObjectSerializer from '../ObjectSerializer'; import HttpClient, { QueryOptions, ApiResponseHeaders } from '../HttpClient'; -import CreateVideoChapterResponse from '../model/CreateVideoChapterResponse'; -import GetVideoChaptersResponse from '../model/GetVideoChaptersResponse'; +import CreateMediaChapterResponse from '../model/CreateMediaChapterResponse'; +import GetMediaChaptersResponse from '../model/GetMediaChaptersResponse'; import ResponseSuccess from '../model/ResponseSuccess'; import { Readable } from 'stream'; import { readableToBuffer } from '../HttpClient'; @@ -24,7 +24,7 @@ import { readableToBuffer } from '../HttpClient'; /** * no description */ -export default class VideoChapterApi { +export default class MediaChapterApi { private httpClient: HttpClient; constructor(httpClient: HttpClient) { @@ -32,9 +32,9 @@ export default class VideoChapterApi { } /** - * Create a VTT file to add chapters to your video. Chapters help break the video into sections. - * Create a video chapter - * @param id Video ID + * Create a VTT file to add chapters to your media. Chapters help break the media into sections. + * Create a media chapter + * @param id Media ID * @param lan Language * @param file VTT File */ @@ -42,16 +42,16 @@ export default class VideoChapterApi { id: string, lan: string, file: string | Readable | Buffer - ): Promise { + ): Promise { return this.createWithResponseHeaders(id, lan, file).then( (res) => res.body ); } /** - * Create a VTT file to add chapters to your video. Chapters help break the video into sections. - * Create a video chapter - * @param id Video ID + * Create a VTT file to add chapters to your media. Chapters help break the media into sections. + * Create a media chapter + * @param id Media ID * @param lan Language * @param file VTT File */ @@ -61,7 +61,7 @@ export default class VideoChapterApi { file: string | Readable | Buffer ): Promise<{ headers: ApiResponseHeaders; - body: CreateVideoChapterResponse; + body: CreateMediaChapterResponse; }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; @@ -86,7 +86,7 @@ export default class VideoChapterApi { } // Path Params - const localVarPath = '/videos/{id}/chapters/{lan}' + const localVarPath = '/media/{id}/chapters/{lan}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'lan' + '}', encodeURIComponent(String(lan))); @@ -106,18 +106,18 @@ export default class VideoChapterApi { response.body, response.headers['content-type'] ), - 'CreateVideoChapterResponse', + 'CreateMediaChapterResponse', '' - ) as CreateVideoChapterResponse, + ) as CreateMediaChapterResponse, }; }); } /** - * Get a chapter for by video id in a specific language. - * Get video chapters + * Get a chapter for by media id in a specific language. + * Get media chapters * @param {Object} searchParams - * @param { string } searchParams.id Video ID + * @param { string } searchParams.id Media ID * @param { number } searchParams.offset offset, allowed values greater than or equal to 0. Default(0) * @param { number } searchParams.limit results per page. Allowed values 1-100, default is 25 */ @@ -125,15 +125,15 @@ export default class VideoChapterApi { id: string; offset?: number; limit?: number; - }): Promise { + }): Promise { return this.getWithResponseHeaders(args).then((res) => res.body); } /** - * Get a chapter for by video id in a specific language. - * Get video chapters + * Get a chapter for by media id in a specific language. + * Get media chapters * @param {Object} searchParams - * @param { string } searchParams.id Video ID + * @param { string } searchParams.id Media ID * @param { number } searchParams.offset offset, allowed values greater than or equal to 0. Default(0) * @param { number } searchParams.limit results per page. Allowed values 1-100, default is 25 */ @@ -145,7 +145,7 @@ export default class VideoChapterApi { id: string; offset?: number; limit?: number; - }): Promise<{ headers: ApiResponseHeaders; body: GetVideoChaptersResponse }> { + }): Promise<{ headers: ApiResponseHeaders; body: GetMediaChaptersResponse }> { const queryParams: QueryOptions = {}; queryParams.headers = {}; if (id === null || id === undefined) { @@ -154,7 +154,7 @@ export default class VideoChapterApi { ); } // Path Params - const localVarPath = '/videos/{id}/chapters' + const localVarPath = '/media/{id}/chapters' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))); @@ -186,9 +186,9 @@ export default class VideoChapterApi { response.body, response.headers['content-type'] ), - 'GetVideoChaptersResponse', + 'GetMediaChaptersResponse', '' - ) as GetVideoChaptersResponse, + ) as GetMediaChaptersResponse, }; }); } @@ -226,7 +226,7 @@ export default class VideoChapterApi { ); } // Path Params - const localVarPath = '/videos/{id}/chapters/{lan}' + const localVarPath = '/media/{id}/chapters/{lan}' .substring(1) .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'lan' + '}', encodeURIComponent(String(lan))); diff --git a/src/index.ts b/src/index.ts index 3b827f2e..9bc88b9d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,10 +12,10 @@ import HttpClient from './HttpClient'; import ApiKeyApi from './api/ApiKeyApi'; +import MediaApi from './api/MediaApi'; +import MediaChapterApi from './api/MediaChapterApi'; import PlayersApi from './api/PlayersApi'; import PlaylistApi from './api/PlaylistApi'; -import VideoApi from './api/VideoApi'; -import VideoChapterApi from './api/VideoChapterApi'; import WebhookApi from './api/WebhookApi'; import { createReadStream, existsSync, statSync } from 'fs'; import UploadProgressEvent from './model/UploadProgressEvent'; @@ -32,10 +32,10 @@ const MAX_CHUNK_SIZE = 128 * 1024 * 1024; class StreamClient { private httpClient: HttpClient; private _apiKey: ApiKeyApi; + private _media: MediaApi; + private _mediaChapter: MediaChapterApi; private _players: PlayersApi; private _playlist: PlaylistApi; - private _video: VideoApi; - private _videoChapter: VideoChapterApi; private _webhook: WebhookApi; constructor(params: { @@ -77,10 +77,10 @@ class StreamClient { }); this._apiKey = new ApiKeyApi(this.httpClient); + this._media = new MediaApi(this.httpClient); + this._mediaChapter = new MediaChapterApi(this.httpClient); this._players = new PlayersApi(this.httpClient); this._playlist = new PlaylistApi(this.httpClient); - this._video = new VideoApi(this.httpClient); - this._videoChapter = new VideoChapterApi(this.httpClient); this._webhook = new WebhookApi(this.httpClient); } @@ -93,35 +93,35 @@ class StreamClient { } /** - * Get an PlayersApi instance - * @return PlayersApi + * Get an MediaApi instance + * @return MediaApi */ - public get players(): PlayersApi { - return this._players; + public get media(): MediaApi { + return this._media; } /** - * Get an PlaylistApi instance - * @return PlaylistApi + * Get an MediaChapterApi instance + * @return MediaChapterApi */ - public get playlist(): PlaylistApi { - return this._playlist; + public get mediaChapter(): MediaChapterApi { + return this._mediaChapter; } /** - * Get an VideoApi instance - * @return VideoApi + * Get an PlayersApi instance + * @return PlayersApi */ - public get video(): VideoApi { - return this._video; + public get players(): PlayersApi { + return this._players; } /** - * Get an VideoChapterApi instance - * @return VideoChapterApi + * Get an PlaylistApi instance + * @return PlaylistApi */ - public get videoChapter(): VideoChapterApi { - return this._videoChapter; + public get playlist(): PlaylistApi { + return this._playlist; } /** diff --git a/src/model/AddPlayerThemesToVideoRequest.ts b/src/model/AddPlayerThemesToVideoRequest.ts index ac572982..11eb4eeb 100644 --- a/src/model/AddPlayerThemesToVideoRequest.ts +++ b/src/model/AddPlayerThemesToVideoRequest.ts @@ -12,21 +12,21 @@ import AttributeType from './AttributeType.js'; export default class AddPlayerThemesToVideoRequest { + 'mediaId'?: string; 'playerThemeId'?: string; - 'videoId'?: string; static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ { - name: 'playerThemeId', - baseName: 'player_theme_id', + name: 'mediaId', + baseName: 'media_id', type: 'string', format: '', }, { - name: 'videoId', - baseName: 'video_id', + name: 'playerThemeId', + baseName: 'player_theme_id', type: 'string', format: '', }, diff --git a/src/model/CreateVideoCaptionData.ts b/src/model/CreateMediaCaptionData.ts similarity index 62% rename from src/model/CreateVideoCaptionData.ts rename to src/model/CreateMediaCaptionData.ts index 9b49c22e..73d08d0f 100644 --- a/src/model/CreateVideoCaptionData.ts +++ b/src/model/CreateMediaCaptionData.ts @@ -10,23 +10,23 @@ */ import AttributeType from './AttributeType.js'; -import VideoCaption from './VideoCaption.js'; +import MediaCaption from './MediaCaption.js'; -export default class CreateVideoCaptionData { - 'videoCaption'?: VideoCaption; +export default class CreateMediaCaptionData { + 'mediaCaption'?: MediaCaption; static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ { - name: 'videoCaption', - baseName: 'video_caption', - type: 'VideoCaption', + name: 'mediaCaption', + baseName: 'media_caption', + type: 'MediaCaption', format: '', }, ]; static getAttributeTypeMap(): Array { - return CreateVideoCaptionData.attributeTypeMap; + return CreateMediaCaptionData.attributeTypeMap; } } diff --git a/src/model/CreateVideoCaptionResponse.ts b/src/model/CreateMediaCaptionResponse.ts similarity index 71% rename from src/model/CreateVideoCaptionResponse.ts rename to src/model/CreateMediaCaptionResponse.ts index 2db9d576..3fea89f7 100644 --- a/src/model/CreateVideoCaptionResponse.ts +++ b/src/model/CreateMediaCaptionResponse.ts @@ -10,10 +10,10 @@ */ import AttributeType from './AttributeType.js'; -import CreateVideoCaptionData from './CreateVideoCaptionData.js'; +import CreateMediaCaptionData from './CreateMediaCaptionData.js'; -export default class CreateVideoCaptionResponse { - 'data'?: CreateVideoCaptionData; +export default class CreateMediaCaptionResponse { + 'data'?: CreateMediaCaptionData; 'status'?: string; static readonly discriminator?: string = undefined; @@ -22,7 +22,7 @@ export default class CreateVideoCaptionResponse { { name: 'data', baseName: 'data', - type: 'CreateVideoCaptionData', + type: 'CreateMediaCaptionData', format: '', }, { @@ -34,6 +34,6 @@ export default class CreateVideoCaptionResponse { ]; static getAttributeTypeMap(): Array { - return CreateVideoCaptionResponse.attributeTypeMap; + return CreateMediaCaptionResponse.attributeTypeMap; } } diff --git a/src/model/CreateVideoChapterData.ts b/src/model/CreateMediaChapterData.ts similarity index 62% rename from src/model/CreateVideoChapterData.ts rename to src/model/CreateMediaChapterData.ts index f449dfb8..8e8f33be 100644 --- a/src/model/CreateVideoChapterData.ts +++ b/src/model/CreateMediaChapterData.ts @@ -10,23 +10,23 @@ */ import AttributeType from './AttributeType.js'; -import VideoChapter from './VideoChapter.js'; +import MediaChapter from './MediaChapter.js'; -export default class CreateVideoChapterData { - 'videoChapter'?: VideoChapter; +export default class CreateMediaChapterData { + 'mediaChapter'?: MediaChapter; static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ { - name: 'videoChapter', - baseName: 'video_chapter', - type: 'VideoChapter', + name: 'mediaChapter', + baseName: 'media_chapter', + type: 'MediaChapter', format: '', }, ]; static getAttributeTypeMap(): Array { - return CreateVideoChapterData.attributeTypeMap; + return CreateMediaChapterData.attributeTypeMap; } } diff --git a/src/model/CreateVideoChapterResponse.ts b/src/model/CreateMediaChapterResponse.ts similarity index 71% rename from src/model/CreateVideoChapterResponse.ts rename to src/model/CreateMediaChapterResponse.ts index 5e7cd8db..42690438 100644 --- a/src/model/CreateVideoChapterResponse.ts +++ b/src/model/CreateMediaChapterResponse.ts @@ -10,10 +10,10 @@ */ import AttributeType from './AttributeType.js'; -import CreateVideoChapterData from './CreateVideoChapterData.js'; +import CreateMediaChapterData from './CreateMediaChapterData.js'; -export default class CreateVideoChapterResponse { - 'data'?: CreateVideoChapterData; +export default class CreateMediaChapterResponse { + 'data'?: CreateMediaChapterData; 'status'?: string; static readonly discriminator?: string = undefined; @@ -22,7 +22,7 @@ export default class CreateVideoChapterResponse { { name: 'data', baseName: 'data', - type: 'CreateVideoChapterData', + type: 'CreateMediaChapterData', format: '', }, { @@ -34,6 +34,6 @@ export default class CreateVideoChapterResponse { ]; static getAttributeTypeMap(): Array { - return CreateVideoChapterResponse.attributeTypeMap; + return CreateMediaChapterResponse.attributeTypeMap; } } diff --git a/src/model/GetVideoChaptersData.ts b/src/model/GetMediaCaptionsData.ts similarity index 67% rename from src/model/GetVideoChaptersData.ts rename to src/model/GetMediaCaptionsData.ts index 1c4828f5..af29438f 100644 --- a/src/model/GetVideoChaptersData.ts +++ b/src/model/GetMediaCaptionsData.ts @@ -10,30 +10,30 @@ */ import AttributeType from './AttributeType.js'; -import VideoChapter from './VideoChapter.js'; +import MediaCaption from './MediaCaption.js'; -export default class GetVideoChaptersData { +export default class GetMediaCaptionsData { + 'mediaCaptions'?: Array; 'total'?: number; - 'videoChapters'?: Array; static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ { - name: 'total', - baseName: 'total', - type: 'number', + name: 'mediaCaptions', + baseName: 'media_captions', + type: 'Array', format: '', }, { - name: 'videoChapters', - baseName: 'video_chapters', - type: 'Array', + name: 'total', + baseName: 'total', + type: 'number', format: '', }, ]; static getAttributeTypeMap(): Array { - return GetVideoChaptersData.attributeTypeMap; + return GetMediaCaptionsData.attributeTypeMap; } } diff --git a/src/model/GetVideoChaptersResponse.ts b/src/model/GetMediaCaptionsResponse.ts similarity index 72% rename from src/model/GetVideoChaptersResponse.ts rename to src/model/GetMediaCaptionsResponse.ts index 3b68390d..8c45c7cd 100644 --- a/src/model/GetVideoChaptersResponse.ts +++ b/src/model/GetMediaCaptionsResponse.ts @@ -10,10 +10,10 @@ */ import AttributeType from './AttributeType.js'; -import GetVideoChaptersData from './GetVideoChaptersData.js'; +import GetMediaCaptionsData from './GetMediaCaptionsData.js'; -export default class GetVideoChaptersResponse { - 'data'?: GetVideoChaptersData; +export default class GetMediaCaptionsResponse { + 'data'?: GetMediaCaptionsData; 'status'?: string; static readonly discriminator?: string = undefined; @@ -22,7 +22,7 @@ export default class GetVideoChaptersResponse { { name: 'data', baseName: 'data', - type: 'GetVideoChaptersData', + type: 'GetMediaCaptionsData', format: '', }, { @@ -34,6 +34,6 @@ export default class GetVideoChaptersResponse { ]; static getAttributeTypeMap(): Array { - return GetVideoChaptersResponse.attributeTypeMap; + return GetMediaCaptionsResponse.attributeTypeMap; } } diff --git a/src/model/GetVideoCaptionsData.ts b/src/model/GetMediaChaptersData.ts similarity index 67% rename from src/model/GetVideoCaptionsData.ts rename to src/model/GetMediaChaptersData.ts index 7484beb1..05ae0029 100644 --- a/src/model/GetVideoCaptionsData.ts +++ b/src/model/GetMediaChaptersData.ts @@ -10,30 +10,30 @@ */ import AttributeType from './AttributeType.js'; -import VideoCaption from './VideoCaption.js'; +import MediaChapter from './MediaChapter.js'; -export default class GetVideoCaptionsData { +export default class GetMediaChaptersData { + 'mediaChapters'?: Array; 'total'?: number; - 'videoCaptions'?: Array; static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ { - name: 'total', - baseName: 'total', - type: 'number', + name: 'mediaChapters', + baseName: 'media_chapters', + type: 'Array', format: '', }, { - name: 'videoCaptions', - baseName: 'video_captions', - type: 'Array', + name: 'total', + baseName: 'total', + type: 'number', format: '', }, ]; static getAttributeTypeMap(): Array { - return GetVideoCaptionsData.attributeTypeMap; + return GetMediaChaptersData.attributeTypeMap; } } diff --git a/src/model/GetVideoCaptionsResponse.ts b/src/model/GetMediaChaptersResponse.ts similarity index 72% rename from src/model/GetVideoCaptionsResponse.ts rename to src/model/GetMediaChaptersResponse.ts index ee593a6d..6549429b 100644 --- a/src/model/GetVideoCaptionsResponse.ts +++ b/src/model/GetMediaChaptersResponse.ts @@ -10,10 +10,10 @@ */ import AttributeType from './AttributeType.js'; -import GetVideoCaptionsData from './GetVideoCaptionsData.js'; +import GetMediaChaptersData from './GetMediaChaptersData.js'; -export default class GetVideoCaptionsResponse { - 'data'?: GetVideoCaptionsData; +export default class GetMediaChaptersResponse { + 'data'?: GetMediaChaptersData; 'status'?: string; static readonly discriminator?: string = undefined; @@ -22,7 +22,7 @@ export default class GetVideoCaptionsResponse { { name: 'data', baseName: 'data', - type: 'GetVideoCaptionsData', + type: 'GetMediaChaptersData', format: '', }, { @@ -34,6 +34,6 @@ export default class GetVideoCaptionsResponse { ]; static getAttributeTypeMap(): Array { - return GetVideoCaptionsResponse.attributeTypeMap; + return GetMediaChaptersResponse.attributeTypeMap; } } diff --git a/src/model/GetVideoDetailResponse.ts b/src/model/GetMediaDetailResponse.ts similarity index 87% rename from src/model/GetVideoDetailResponse.ts rename to src/model/GetMediaDetailResponse.ts index b44a910e..e81498f4 100644 --- a/src/model/GetVideoDetailResponse.ts +++ b/src/model/GetMediaDetailResponse.ts @@ -12,7 +12,7 @@ import AttributeType from './AttributeType.js'; import Media from './Media.js'; -export default class GetVideoDetailResponse { +export default class GetMediaDetailResponse { 'data'?: Media; 'status'?: string; @@ -34,6 +34,6 @@ export default class GetVideoDetailResponse { ]; static getAttributeTypeMap(): Array { - return GetVideoDetailResponse.attributeTypeMap; + return GetMediaDetailResponse.attributeTypeMap; } } diff --git a/src/model/GetVideoListData.ts b/src/model/GetMediaListData.ts similarity index 79% rename from src/model/GetVideoListData.ts rename to src/model/GetMediaListData.ts index 29c82ce5..137bb0de 100644 --- a/src/model/GetVideoListData.ts +++ b/src/model/GetMediaListData.ts @@ -12,28 +12,28 @@ import AttributeType from './AttributeType.js'; import Media from './Media.js'; -export default class GetVideoListData { +export default class GetMediaListData { + 'media'?: Array; 'total'?: number; - 'videos'?: Array; static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ { - name: 'total', - baseName: 'total', - type: 'number', + name: 'media', + baseName: 'media', + type: 'Array', format: '', }, { - name: 'videos', - baseName: 'videos', - type: 'Array', + name: 'total', + baseName: 'total', + type: 'number', format: '', }, ]; static getAttributeTypeMap(): Array { - return GetVideoListData.attributeTypeMap; + return GetMediaListData.attributeTypeMap; } } diff --git a/src/model/GetVideoListRequest.ts b/src/model/GetMediaListRequest.ts similarity index 91% rename from src/model/GetVideoListRequest.ts rename to src/model/GetMediaListRequest.ts index 5ff3f10f..d5a50806 100644 --- a/src/model/GetVideoListRequest.ts +++ b/src/model/GetMediaListRequest.ts @@ -12,14 +12,14 @@ import AttributeType from './AttributeType.js'; import Metadata from './Metadata.js'; -export default class GetVideoListRequest { +export default class GetMediaListRequest { 'limit'?: number; 'metadata'?: Array; 'offset'?: number; 'orderBy'?: string; 'search'?: string; 'sortBy'?: string; - 'status'?: string; + 'status'?: Array; 'tags'?: Array; 'type'?: string; @@ -65,7 +65,7 @@ export default class GetVideoListRequest { { name: 'status', baseName: 'status', - type: 'string', + type: 'Array', format: '', }, { @@ -83,6 +83,6 @@ export default class GetVideoListRequest { ]; static getAttributeTypeMap(): Array { - return GetVideoListRequest.attributeTypeMap; + return GetMediaListRequest.attributeTypeMap; } } diff --git a/src/model/GetVideoListResponse.ts b/src/model/GetMediaListResponse.ts similarity index 74% rename from src/model/GetVideoListResponse.ts rename to src/model/GetMediaListResponse.ts index 0ffc0a30..2f4791a2 100644 --- a/src/model/GetVideoListResponse.ts +++ b/src/model/GetMediaListResponse.ts @@ -10,10 +10,10 @@ */ import AttributeType from './AttributeType.js'; -import GetVideoListData from './GetVideoListData.js'; +import GetMediaListData from './GetMediaListData.js'; -export default class GetVideoListResponse { - 'data'?: GetVideoListData; +export default class GetMediaListResponse { + 'data'?: GetMediaListData; 'status'?: string; static readonly discriminator?: string = undefined; @@ -22,7 +22,7 @@ export default class GetVideoListResponse { { name: 'data', baseName: 'data', - type: 'GetVideoListData', + type: 'GetMediaListData', format: '', }, { @@ -34,6 +34,6 @@ export default class GetVideoListResponse { ]; static getAttributeTypeMap(): Array { - return GetVideoListResponse.attributeTypeMap; + return GetMediaListResponse.attributeTypeMap; } } diff --git a/src/model/GetVideoPlayerInfoResponse.ts b/src/model/GetMediaPlayerInfoResponse.ts similarity index 86% rename from src/model/GetVideoPlayerInfoResponse.ts rename to src/model/GetMediaPlayerInfoResponse.ts index 9ee8694b..de3e39ed 100644 --- a/src/model/GetVideoPlayerInfoResponse.ts +++ b/src/model/GetMediaPlayerInfoResponse.ts @@ -10,17 +10,17 @@ */ import AttributeType from './AttributeType.js'; +import MediaAssets from './MediaAssets.js'; +import MediaCaption from './MediaCaption.js'; +import MediaChapter from './MediaChapter.js'; import Metadata from './Metadata.js'; import PlayerTheme from './PlayerTheme.js'; import QualityObject from './QualityObject.js'; -import VideoAssets from './VideoAssets.js'; -import VideoCaption from './VideoCaption.js'; -import VideoChapter from './VideoChapter.js'; -export default class GetVideoPlayerInfoResponse { - 'assets'?: VideoAssets; - 'captions'?: Array; - 'chapters'?: Array; +export default class GetMediaPlayerInfoResponse { + 'assets'?: MediaAssets; + 'captions'?: Array; + 'chapters'?: Array; 'createdAt'?: string; 'description'?: string; 'duration'?: number; @@ -44,19 +44,19 @@ export default class GetVideoPlayerInfoResponse { { name: 'assets', baseName: 'assets', - type: 'VideoAssets', + type: 'MediaAssets', format: '', }, { name: 'captions', baseName: 'captions', - type: 'Array', + type: 'Array', format: '', }, { name: 'chapters', baseName: 'chapters', - type: 'Array', + type: 'Array', format: '', }, { @@ -158,6 +158,6 @@ export default class GetVideoPlayerInfoResponse { ]; static getAttributeTypeMap(): Array { - return GetVideoPlayerInfoResponse.attributeTypeMap; + return GetMediaPlayerInfoResponse.attributeTypeMap; } } diff --git a/src/model/Media.ts b/src/model/Media.ts index b75521f9..dd604560 100644 --- a/src/model/Media.ts +++ b/src/model/Media.ts @@ -10,17 +10,17 @@ */ import AttributeType from './AttributeType.js'; +import MediaAssets from './MediaAssets.js'; +import MediaCaption from './MediaCaption.js'; +import MediaChapter from './MediaChapter.js'; import Metadata from './Metadata.js'; import PlayerTheme from './PlayerTheme.js'; import QualityObject from './QualityObject.js'; -import VideoAssets from './VideoAssets.js'; -import VideoCaption from './VideoCaption.js'; -import VideoChapter from './VideoChapter.js'; export default class Media { - 'assets'?: VideoAssets; - 'captions'?: Array; - 'chapters'?: Array; + 'assets'?: MediaAssets; + 'captions'?: Array; + 'chapters'?: Array; 'createdAt'?: string; 'description'?: string; 'duration'?: number; @@ -46,19 +46,19 @@ export default class Media { { name: 'assets', baseName: 'assets', - type: 'VideoAssets', + type: 'MediaAssets', format: '', }, { name: 'captions', baseName: 'captions', - type: 'Array', + type: 'Array', format: '', }, { name: 'chapters', baseName: 'chapters', - type: 'Array', + type: 'Array', format: '', }, { diff --git a/src/model/VideoAssets.ts b/src/model/MediaAssets.ts similarity index 95% rename from src/model/VideoAssets.ts rename to src/model/MediaAssets.ts index 04411e49..3055b8f8 100644 --- a/src/model/VideoAssets.ts +++ b/src/model/MediaAssets.ts @@ -11,7 +11,7 @@ import AttributeType from './AttributeType.js'; -export default class VideoAssets { +export default class MediaAssets { 'dashIframe'?: string; 'dashPlayerUrl'?: string; 'dashUrl'?: string; @@ -82,6 +82,6 @@ export default class VideoAssets { ]; static getAttributeTypeMap(): Array { - return VideoAssets.attributeTypeMap; + return MediaAssets.attributeTypeMap; } } diff --git a/src/model/VideoCaption.ts b/src/model/MediaCaption.ts similarity index 93% rename from src/model/VideoCaption.ts rename to src/model/MediaCaption.ts index 636f7695..e83a08d4 100644 --- a/src/model/VideoCaption.ts +++ b/src/model/MediaCaption.ts @@ -11,7 +11,7 @@ import AttributeType from './AttributeType.js'; -export default class VideoCaption { +export default class MediaCaption { 'description'?: string; 'isDefault'?: boolean; 'language'?: string; @@ -54,6 +54,6 @@ export default class VideoCaption { ]; static getAttributeTypeMap(): Array { - return VideoCaption.attributeTypeMap; + return MediaCaption.attributeTypeMap; } } diff --git a/src/model/VideoChapter.ts b/src/model/MediaChapter.ts similarity index 89% rename from src/model/VideoChapter.ts rename to src/model/MediaChapter.ts index 5bc503d5..62c33c41 100644 --- a/src/model/VideoChapter.ts +++ b/src/model/MediaChapter.ts @@ -11,7 +11,7 @@ import AttributeType from './AttributeType.js'; -export default class VideoChapter { +export default class MediaChapter { 'language'?: string; 'url'?: string; @@ -33,6 +33,6 @@ export default class VideoChapter { ]; static getAttributeTypeMap(): Array { - return VideoChapter.attributeTypeMap; + return MediaChapter.attributeTypeMap; } } diff --git a/src/model/Playlist.ts b/src/model/Playlist.ts index 7c2ebe05..1045d1cb 100644 --- a/src/model/Playlist.ts +++ b/src/model/Playlist.ts @@ -18,6 +18,7 @@ export default class Playlist { 'id'?: string; 'iframe'?: string; 'itemCount'?: number; + 'items'?: Array; 'metadata'?: { [key: string]: string }; 'name'?: string; 'playlistType'?: string; @@ -27,7 +28,6 @@ export default class Playlist { 'thumbnailUrl'?: string; 'updatedAt'?: string; 'userId'?: string; - 'videoItems'?: Array; static readonly discriminator?: string = undefined; @@ -62,6 +62,12 @@ export default class Playlist { type: 'number', format: '', }, + { + name: 'items', + baseName: 'items', + type: 'Array', + format: '', + }, { name: 'metadata', baseName: 'metadata', @@ -116,12 +122,6 @@ export default class Playlist { type: 'string', format: '', }, - { - name: 'videoItems', - baseName: 'video_items', - type: 'Array', - format: '', - }, ]; static getAttributeTypeMap(): Array { diff --git a/src/model/PlaylistItem.ts b/src/model/PlaylistItem.ts index b65d60db..e01b202c 100644 --- a/src/model/PlaylistItem.ts +++ b/src/model/PlaylistItem.ts @@ -15,11 +15,11 @@ import PlaylistItemMedia from './PlaylistItemMedia.js'; export default class PlaylistItem { 'createdAt'?: string; 'id'?: string; + 'media'?: PlaylistItemMedia; 'nextId'?: string; 'playlistId'?: string; 'previousId'?: string; 'updatedAt'?: string; - 'video'?: PlaylistItemMedia; 'videoId'?: string; static readonly discriminator?: string = undefined; @@ -37,6 +37,12 @@ export default class PlaylistItem { type: 'string', format: '', }, + { + name: 'media', + baseName: 'media', + type: 'PlaylistItemMedia', + format: '', + }, { name: 'nextId', baseName: 'next_id', @@ -61,12 +67,6 @@ export default class PlaylistItem { type: 'string', format: '', }, - { - name: 'video', - baseName: 'video', - type: 'PlaylistItemMedia', - format: '', - }, { name: 'videoId', baseName: 'video_id', diff --git a/src/model/PlaylistItemMedia.ts b/src/model/PlaylistItemMedia.ts index 1e78fd7e..0f5bf4a3 100644 --- a/src/model/PlaylistItemMedia.ts +++ b/src/model/PlaylistItemMedia.ts @@ -10,12 +10,12 @@ */ import AttributeType from './AttributeType.js'; -import VideoCaption from './VideoCaption.js'; -import VideoChapter from './VideoChapter.js'; +import MediaCaption from './MediaCaption.js'; +import MediaChapter from './MediaChapter.js'; export default class PlaylistItemMedia { - 'captions'?: Array; - 'chapters'?: Array; + 'captions'?: Array; + 'chapters'?: Array; 'description'?: string; 'duration'?: number; 'hlsUrl'?: string; @@ -30,13 +30,13 @@ export default class PlaylistItemMedia { { name: 'captions', baseName: 'captions', - type: 'Array', + type: 'Array', format: '', }, { name: 'chapters', baseName: 'chapters', - type: 'Array', + type: 'Array', format: '', }, { diff --git a/src/model/RemovePlayerThemesFromMediaRequest.ts b/src/model/RemovePlayerThemesFromMediaRequest.ts index 972b5115..17098816 100644 --- a/src/model/RemovePlayerThemesFromMediaRequest.ts +++ b/src/model/RemovePlayerThemesFromMediaRequest.ts @@ -12,21 +12,21 @@ import AttributeType from './AttributeType.js'; export default class RemovePlayerThemesFromMediaRequest { + 'mediaId'?: string; 'playerThemeId'?: string; - 'videoId'?: string; static readonly discriminator?: string = undefined; static readonly attributeTypeMap: Array = [ { - name: 'playerThemeId', - baseName: 'player_theme_id', + name: 'mediaId', + baseName: 'media_id', type: 'string', format: '', }, { - name: 'videoId', - baseName: 'video_id', + name: 'playerThemeId', + baseName: 'player_theme_id', type: 'string', format: '', }, diff --git a/src/model/UpdateVideoInfoRequest.ts b/src/model/UpdateMediaInfoRequest.ts similarity index 93% rename from src/model/UpdateVideoInfoRequest.ts rename to src/model/UpdateMediaInfoRequest.ts index dac94f6a..b43533f5 100644 --- a/src/model/UpdateVideoInfoRequest.ts +++ b/src/model/UpdateMediaInfoRequest.ts @@ -12,7 +12,7 @@ import AttributeType from './AttributeType.js'; import Metadata from './Metadata.js'; -export default class UpdateVideoInfoRequest { +export default class UpdateMediaInfoRequest { /** * Description of the media */ @@ -80,6 +80,6 @@ export default class UpdateVideoInfoRequest { ]; static getAttributeTypeMap(): Array { - return UpdateVideoInfoRequest.attributeTypeMap; + return UpdateMediaInfoRequest.attributeTypeMap; } } diff --git a/test/ApiKey.spec.ts b/test/ApiKey.spec.ts index 8933eac1..6cd270fb 100644 --- a/test/ApiKey.spec.ts +++ b/test/ApiKey.spec.ts @@ -1,4 +1,4 @@ -import { expect } from '@jest/globals'; +import { describe, expect, it } from '@jest/globals'; import StreamError from '../src/StreamError'; import { anonymousMockTestClient, mockTestClient } from './src/mockTestClient'; import { v4 as uuidv4 } from 'uuid'; diff --git a/test/PlayerTheme.spec.ts b/test/PlayerTheme.spec.ts index 34890332..d0440bae 100644 --- a/test/PlayerTheme.spec.ts +++ b/test/PlayerTheme.spec.ts @@ -1,9 +1,9 @@ -import { expect } from '@jest/globals'; +import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'; import StreamError from '../src/StreamError'; import fs from 'fs'; import { anonymousMockTestClient, mockTestClient } from './src/mockTestClient'; -import { openInvalidFile, openTestImageFile } from './Video.spec'; import { v4 as uuidv4 } from 'uuid'; +import { openInvalidFile, openTestImageFile } from './Video.spec'; let testPlayerIDForUpdateAndDeleteAndGet: string | undefined; const playerName = 'Test Player Theme'; const logoURL = 'https://example.com/logo.png'; @@ -142,7 +142,7 @@ describe('Players Service', () => { it('Valid Add', async () => { const response = await testClient.players.addPlayer({ playerThemeId: testPlayerIDForUpdateAndDeleteAndGet as string, - videoId: testVideoForPlayer, + mediaId: testVideoForPlayer, }); expect(response).toBeDefined(); }); @@ -151,7 +151,7 @@ describe('Players Service', () => { await expect( testClient.players.addPlayer({ playerThemeId: 'invalid-id', - videoId: testVideoForPlayer, + mediaId: testVideoForPlayer, }) ).rejects.toThrow(StreamError); }); @@ -317,14 +317,14 @@ describe('Players Service', () => { await expect( anonymousTestClient.players.removePlayer({ playerThemeId: testPlayerIDForUpdateAndDeleteAndGet as string, - videoId: testVideoForPlayer, + mediaId: testVideoForPlayer, }) ).rejects.toThrow(StreamError); }); it('Valid Remove', async () => { const response = await testClient.players.removePlayer({ playerThemeId: testPlayerIDForUpdateAndDeleteAndGet as string, - videoId: testVideoForPlayer, + mediaId: testVideoForPlayer, }); expect(response).toBeDefined(); }); @@ -333,7 +333,7 @@ describe('Players Service', () => { await expect( testClient.players.removePlayer({ playerThemeId: 'invalid-id', - videoId: testVideoForPlayer, + mediaId: testVideoForPlayer, }) ).rejects.toThrow(StreamError); }); @@ -351,7 +351,7 @@ describe('Players Service', () => { await expect( testClient.players.removePlayer({ playerThemeId: newId, - videoId: newId, + mediaId: newId, }) ).rejects.toThrow(StreamError); }); diff --git a/test/PlaylistApi.spec.ts b/test/PlaylistApi.spec.ts index 15181ba9..edc791a8 100644 --- a/test/PlaylistApi.spec.ts +++ b/test/PlaylistApi.spec.ts @@ -1,4 +1,4 @@ -import { expect } from '@jest/globals'; +import { describe, expect, it } from '@jest/globals'; import StreamError from '../src/StreamError'; import { anonymousMockTestClient, mockTestClient } from './src/mockTestClient'; import { openInvalidFile, openTestImageFile } from './Video.spec'; @@ -220,9 +220,9 @@ describe('Playlist Service', () => { const response = await testClient.playlist.getPlaylistById({ id: testPlaylistID as string, }); - testFirstItemID = response.data?.playlist?.videoItems?.[1]?.id; - testSecondItemID = response.data?.playlist?.videoItems?.[1]?.nextId; - testThirdItemID = response.data?.playlist?.videoItems?.[1]?.previousId; + testFirstItemID = response.data?.playlist?.items?.[1]?.id; + testSecondItemID = response.data?.playlist?.items?.[1]?.nextId; + testThirdItemID = response.data?.playlist?.items?.[1]?.previousId; expect(response).toBeDefined(); }); diff --git a/test/Video.spec.ts b/test/Video.spec.ts index 3da2dbaa..6a8344fc 100644 --- a/test/Video.spec.ts +++ b/test/Video.spec.ts @@ -1,4 +1,4 @@ -import { expect } from '@jest/globals'; +import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'; import fs from 'fs'; import crypto from 'crypto'; import StreamError from '../src/StreamError'; @@ -53,7 +53,7 @@ function getFileHash(file: fs.ReadStream): Promise { describe('Video Service', () => { describe('create', () => { it('Valid Complete Request', async () => { - const resp = await testClient.video.create({ + const resp = await testClient.media.create({ title: 'Test Video', description: 'Test Description', isPublic: true, @@ -76,7 +76,7 @@ describe('Video Service', () => { }); it('Name create oversize video', async () => { - const resp = await testClient.video.create({ + const resp = await testClient.media.create({ title: 'Test Video', qualities: [ { @@ -92,7 +92,7 @@ describe('Video Service', () => { }); it('Valid Minimal Request', async () => { - const resp = await testClient.video.create({ + const resp = await testClient.media.create({ title: 'Test Video', qualities: [ { @@ -110,7 +110,7 @@ describe('Video Service', () => { it('Invalid Title - Empty', async () => { await expect( - testClient.video.create({ + testClient.media.create({ qualities: [ { type: 'hls', @@ -124,7 +124,7 @@ describe('Video Service', () => { it('Invalid Title - Too Long', async () => { await expect( - testClient.video.create({ + testClient.media.create({ title: 'a'.repeat(256), qualities: [ { @@ -139,7 +139,7 @@ describe('Video Service', () => { it('Invalid Description - Too Long', async () => { await expect( - testClient.video.create({ + testClient.media.create({ title: 'Test Video', description: 'a'.repeat(1001), qualities: [ @@ -155,7 +155,7 @@ describe('Video Service', () => { it('Invalid Metadata - Key Too Long', async () => { await expect( - testClient.video.create({ + testClient.media.create({ title: 'Test Video', qualities: [ { @@ -171,7 +171,7 @@ describe('Video Service', () => { it('Invalid Qualities - Invalid Value', async () => { await expect( - testClient.video.create({ + testClient.media.create({ title: 'Test Video', qualities: [ { @@ -188,14 +188,14 @@ describe('Video Service', () => { describe('update', () => { it('Update other', async () => { await expect( - anonymousTestClient.video.update(testVideoID, { + anonymousTestClient.media.update(testVideoID, { title: title, description: description, }) ).rejects.toThrow(StreamError); }); it('Valid Update All Fields', async () => { - const resp = await testClient.video.update(testVideoID, { + const resp = await testClient.media.update(testVideoID, { title: title, description: description, }); @@ -203,14 +203,14 @@ describe('Video Service', () => { }); it('Valid Update Title Only', async () => { - const resp = await testClient.video.update(testVideoID, { + const resp = await testClient.media.update(testVideoID, { title: title, }); expect(resp).toBeDefined(); }); it('Valid Update Description Only', async () => { - const resp = await testClient.video.update(testVideoID, { + const resp = await testClient.media.update(testVideoID, { description: description, }); expect(resp).toBeDefined(); @@ -218,7 +218,7 @@ describe('Video Service', () => { it('Invalid Title Length', async () => { await expect( - testClient.video.update(testVideoID, { + testClient.media.update(testVideoID, { title: 'a'.repeat(256), }) ).rejects.toThrow(StreamError); @@ -226,7 +226,7 @@ describe('Video Service', () => { it('Invalid Video ID', async () => { await expect( - testClient.video.update('invalid-id', { + testClient.media.update('invalid-id', { title: title, }) ).rejects.toThrow(StreamError); @@ -234,7 +234,7 @@ describe('Video Service', () => { it('Non-existent Video ID', async () => { await expect( - testClient.video.update('non-existent-id', { + testClient.media.update('non-existent-id', { title: title, }) ).rejects.toThrow(StreamError); @@ -243,7 +243,7 @@ describe('Video Service', () => { it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.video.update(newId, { + testClient.media.update(newId, { title: title, }) ).rejects.toThrow(StreamError); @@ -253,34 +253,34 @@ describe('Video Service', () => { describe('getDetail', () => { it('Get other', async () => { await expect( - anonymousTestClient.video.getDetail(testVideoID) + anonymousTestClient.media.getDetail(testVideoID) ).rejects.toThrow(StreamError); }); it('Valid Get Detail', async () => { - const resp = await testClient.video.getDetail(testVideoID); + const resp = await testClient.media.getDetail(testVideoID); expect(resp.data?.id).toBeDefined(); expect(resp.data?.title).toBeDefined(); expect(resp.status).toBeDefined(); }); it('Invalid ID Format', async () => { - await expect(testClient.video.getDetail('invalid-uuid')).rejects.toThrow( + await expect(testClient.media.getDetail('invalid-uuid')).rejects.toThrow( StreamError ); }); it('Non-existent ID', async () => { await expect( - testClient.video.getDetail('non-existent-id') + testClient.media.getDetail('non-existent-id') ).rejects.toThrow(StreamError); }); it('Empty ID', async () => { - await expect(testClient.video.getDetail('')).rejects.toThrow(StreamError); + await expect(testClient.media.getDetail('')).rejects.toThrow(StreamError); }); it('Not exist ID', async () => { const newId = uuidv4(); - await expect(testClient.video.getDetail(newId)).rejects.toThrow( + await expect(testClient.media.getDetail(newId)).rejects.toThrow( StreamError ); }); @@ -292,12 +292,12 @@ describe('Video Service', () => { it('Upload thumbnail other', async () => { validThumbnail = await openTestImageFile(); await expect( - anonymousTestClient.video.uploadThumbnail(testVideoID, validThumbnail) + anonymousTestClient.media.uploadThumbnail(testVideoID, validThumbnail) ).rejects.toThrow(StreamError); }); it('Valid Thumbnail Upload', async () => { validThumbnail = await openTestImageFile(); - const resp = await testClient.video.uploadThumbnail( + const resp = await testClient.media.uploadThumbnail( testVideoID, validThumbnail ); @@ -307,62 +307,62 @@ describe('Video Service', () => { it('Invalid File Type', async () => { const invalidFile = await openInvalidFile(); await expect( - testClient.video.uploadThumbnail(testVideoID, invalidFile) + testClient.media.uploadThumbnail(testVideoID, invalidFile) ).rejects.toThrow(StreamError); }); it('Invalid Video ID', async () => { await expect( - testClient.video.uploadThumbnail('invalid-id', validThumbnail) + testClient.media.uploadThumbnail('invalid-id', validThumbnail) ).rejects.toThrow(StreamError); }); it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.video.uploadThumbnail(newId, validThumbnail) + testClient.media.uploadThumbnail(newId, validThumbnail) ).rejects.toThrow(StreamError); }); }); describe('getCost', () => { it('Valid Single Quality', async () => { - const resp = await testClient.video.getCost('720p', 'video', 120.5); + const resp = await testClient.media.getCost('720p', 'video', 120.5); expect(resp).toBeDefined(); }); it('Valid Multiple Qualities', async () => { - const resp = await testClient.video.getCost('720p,1080p', 'video', 120.5); + const resp = await testClient.media.getCost('720p,1080p', 'video', 120.5); expect(resp).toBeDefined(); }); it('Invalid Quality', async () => { await expect( - testClient.video.getCost('invalid', 'video', 120.5) + testClient.media.getCost('invalid', 'video', 120.5) ).rejects.toThrow(StreamError); }); it('Empty Quality', async () => { await expect( - testClient.video.getCost('', 'video', 120.5) + testClient.media.getCost('', 'video', 120.5) ).rejects.toThrow(StreamError); }); it('Negative Duration', async () => { await expect( - testClient.video.getCost('720p', 'video', -1) + testClient.media.getCost('720p', 'video', -1) ).rejects.toThrow(StreamError); }); }); describe('getVideoList', () => { it('Valid Get Video List With No Filter', async () => { - const resp = await testClient.video.getVideoList(); + const resp = await testClient.media.getMediaList(); expect(resp).toBeDefined(); }); it('Valid Get Video List With Filter', async () => { - const resp = await testClient.video.getVideoList({ + const resp = await testClient.media.getMediaList({ limit: 1, offset: 0, orderBy: 'desc', @@ -375,7 +375,7 @@ describe('Video Service', () => { describe('uploadPart', () => { it('Valid File Upload', async () => { const video = await getVideoFilePath('558k.mp4'); - const resp = await testClient.video.uploadPart(testVideoID, video); + const resp = await testClient.media.uploadPart(testVideoID, video); expect(resp).toBeDefined(); }); @@ -384,14 +384,14 @@ describe('Video Service', () => { const videoFile = fs.createReadStream(video); const videoHash = await getFileHash(videoFile); await expect( - testClient.video.uploadPart('invalid-id', video, videoHash, '1') + testClient.media.uploadPart('invalid-id', video, videoHash, '1') ).rejects.toThrow(StreamError); }); it('Not exist ID', async () => { const newId = uuidv4(); const video = await getVideoFilePath('558k.mp4'); - await expect(testClient.video.uploadPart(newId, video)).rejects.toThrow( + await expect(testClient.media.uploadPart(newId, video)).rejects.toThrow( StreamError ); }); @@ -399,25 +399,25 @@ describe('Video Service', () => { describe('uploadVideoComplete', () => { it('Valid Get Upload When Video Completes', async () => { - const resp = await testClient.video.uploadVideoComplete(testVideoID); + const resp = await testClient.media.uploadMediaComplete(testVideoID); expect(resp).toBeDefined(); }); it('Invalid Video ID', async () => { await expect( - testClient.video.uploadVideoComplete('invalid-id') + testClient.media.uploadMediaComplete('invalid-id') ).rejects.toThrow(StreamError); }); it('Empty Video ID', async () => { - await expect(testClient.video.uploadVideoComplete('')).rejects.toThrow( + await expect(testClient.media.uploadMediaComplete('')).rejects.toThrow( StreamError ); }); it('Not exist ID', async () => { const newId = uuidv4(); - await expect(testClient.video.uploadVideoComplete(newId)).rejects.toThrow( + await expect(testClient.media.uploadMediaComplete(newId)).rejects.toThrow( StreamError ); }); @@ -425,7 +425,7 @@ describe('Video Service', () => { describe('getVideoPlayerInfo', () => { it('Valid Get Video Player Info', async () => { - const resp = await testClient.video.getVideoPlayerInfo({ + const resp = await testClient.media.getMediaPlayerInfo({ id: testVideoID, }); expect(resp).toBeDefined(); @@ -433,7 +433,7 @@ describe('Video Service', () => { it('Invalid Video ID', async () => { await expect( - testClient.video.getVideoPlayerInfo({ + testClient.media.getMediaPlayerInfo({ id: 'invalid-id', }) ).rejects.toThrow(StreamError); @@ -441,7 +441,7 @@ describe('Video Service', () => { it('Empty Video ID', async () => { await expect( - testClient.video.getVideoPlayerInfo({ + testClient.media.getMediaPlayerInfo({ id: '', }) ).rejects.toThrow(StreamError); @@ -450,7 +450,7 @@ describe('Video Service', () => { it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.video.getVideoPlayerInfo({ + testClient.media.getMediaPlayerInfo({ id: newId, }) ).rejects.toThrow(StreamError); @@ -460,7 +460,7 @@ describe('Video Service', () => { describe('createCaption', () => { it('Valid Create Video Captions', async () => { const tmpFilePath = await createTempVTTFile(); - const resp = await testClient.video.createCaption( + const resp = await testClient.media.createCaption( testVideoCaptionID, testLang, tmpFilePath @@ -471,21 +471,21 @@ describe('Video Service', () => { it('Empty Language', async () => { const tmpFile = await createTempVTTFile(); await expect( - testClient.video.createCaption(testVideoCaptionID, '', tmpFile) + testClient.media.createCaption(testVideoCaptionID, '', tmpFile) ).rejects.toThrow(StreamError); }); it('Invalid Video ID', async () => { const tmpFile = await createTempVTTFile(); await expect( - testClient.video.createCaption('invalid-id', testLang, tmpFile) + testClient.media.createCaption('invalid-id', testLang, tmpFile) ).rejects.toThrow(StreamError); }); }); describe('getCaptions', () => { it('Valid Get Video Captions', async () => { - const resp = await testClient.video.getCaptions({ + const resp = await testClient.media.getCaptions({ id: testVideoCaptionID, }); expect(resp).toBeDefined(); @@ -493,14 +493,14 @@ describe('Video Service', () => { it('Invalid Video ID', async () => { await expect( - testClient.video.getCaptions({ + testClient.media.getCaptions({ id: 'invalid-id', }) ).rejects.toThrow(StreamError); }); it('Empty Video ID', async () => { await expect( - testClient.video.getCaptions({ + testClient.media.getCaptions({ id: '', }) ).rejects.toThrow(StreamError); @@ -508,7 +508,7 @@ describe('Video Service', () => { it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.video.getCaptions({ + testClient.media.getCaptions({ id: newId, }) ).rejects.toThrow(StreamError); @@ -517,7 +517,7 @@ describe('Video Service', () => { describe('setDefaultCaption', () => { it('Valid Set Default Caption', async () => { - const resp = await testClient.video.setDefaultCaption( + const resp = await testClient.media.setDefaultCaption( testVideoCaptionID, testLang ); @@ -526,26 +526,26 @@ describe('Video Service', () => { it('Invalid Video ID', async () => { await expect( - testClient.video.setDefaultCaption('invalid-id', testLang) + testClient.media.setDefaultCaption('invalid-id', testLang) ).rejects.toThrow(StreamError); }); it('Empty Video ID', async () => { await expect( - testClient.video.setDefaultCaption('', testLang) + testClient.media.setDefaultCaption('', testLang) ).rejects.toThrow(StreamError); }); it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.video.setDefaultCaption(newId, testLang) + testClient.media.setDefaultCaption(newId, testLang) ).rejects.toThrow(StreamError); }); }); describe('deleteCaption', () => { it('Valid Delete Video Captions', async () => { - const resp = await testClient.video.deleteCaption( + const resp = await testClient.media.deleteCaption( testVideoCaptionID, testLang ); @@ -554,20 +554,20 @@ describe('Video Service', () => { it('Invalid Video ID', async () => { await expect( - testClient.video.deleteCaption('invalid-id', testLang) + testClient.media.deleteCaption('invalid-id', testLang) ).rejects.toThrow(StreamError); }); it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.video.deleteCaption(newId, testLang) + testClient.media.deleteCaption(newId, testLang) ).rejects.toThrow(StreamError); }); }); describe('Delete Video', () => { beforeAll(async () => { - const resp = await testClient.video.create({ + const resp = await testClient.media.create({ title: title, description: description, isPublic: true, @@ -591,7 +591,7 @@ describe('Video Service', () => { it('Delete other', async () => { await expect( - anonymousTestClient.video.delete(testVideoID) + anonymousTestClient.media.delete(testVideoID) ).rejects.toThrow(StreamError); }); @@ -601,24 +601,24 @@ describe('Video Service', () => { 'Video ID is not defined. Ensure the video is created before deletion tests.' ); } - const resp = await testClient.video.delete(testVideoID); + const resp = await testClient.media.delete(testVideoID); expect(resp).toBeDefined(); }); it('Invalid Video ID', async () => { - await expect(testClient.video.delete('invalid-id')).rejects.toThrow( + await expect(testClient.media.delete('invalid-id')).rejects.toThrow( StreamError ); }); it('Not exist ID', async () => { const newId = uuidv4(); - await expect(testClient.video.delete(newId)).rejects.toThrow(StreamError); + await expect(testClient.media.delete(newId)).rejects.toThrow(StreamError); }); afterAll(async () => { for (const id of deletedVideoLater) { try { - await testClient.video.delete(id); + await testClient.media.delete(id); } catch (error) { console.error( `Failed to delete Live Stream Key with ID ${id}:`, diff --git a/test/VideoChapter.spec.ts b/test/VideoChapter.spec.ts index 5210cad5..cde84138 100644 --- a/test/VideoChapter.spec.ts +++ b/test/VideoChapter.spec.ts @@ -1,4 +1,4 @@ -import { expect } from '@jest/globals'; +import { afterEach, describe, expect, it } from '@jest/globals'; import StreamError from '../src/StreamError'; import fs from 'fs'; import path from 'path'; @@ -33,7 +33,7 @@ describe('VideoChapter Service', () => { describe('CreateVideoChapter', () => { it('Valid Create', async () => { const tmpFilePath = await createTempVTTFile(); - const response = await testClient.videoChapter.create( + const response = await testClient.mediaChapter.create( testVideoIDForChapter, testLang, tmpFilePath @@ -45,7 +45,7 @@ describe('VideoChapter Service', () => { it('Invalid Video ID', async () => { const tmpFilePath = await createTempVTTFile(); await expect( - testClient.videoChapter.create('invalid-id', testLang, tmpFilePath) + testClient.mediaChapter.create('invalid-id', testLang, tmpFilePath) ).rejects.toThrow(StreamError); tmpFilePath.close(); }); @@ -53,7 +53,7 @@ describe('VideoChapter Service', () => { it('Invalid Language', async () => { const tmpFilePath = await createTempVTTFile(); await expect( - testClient.videoChapter.create( + testClient.mediaChapter.create( testVideoIDForChapter, 'invalid', tmpFilePath @@ -66,7 +66,7 @@ describe('VideoChapter Service', () => { const tmpFilePath = await createTempVTTFile(); const newId = uuidv4(); await expect( - testClient.videoChapter.create(newId, testLang, tmpFilePath) + testClient.mediaChapter.create(newId, testLang, tmpFilePath) ).rejects.toThrow(StreamError); tmpFilePath.close(); }); @@ -78,7 +78,7 @@ describe('VideoChapter Service', () => { describe('GetVideoChapters', () => { it('Valid Get', async () => { - const response = await testClient.videoChapter.get({ + const response = await testClient.mediaChapter.get({ id: testVideoIDForChapter, limit: 10, offset: 0, @@ -89,7 +89,7 @@ describe('VideoChapter Service', () => { it('Invalid Video ID', async () => { await expect( - testClient.videoChapter.get({ + testClient.mediaChapter.get({ id: 'invalid-id', limit: 10, offset: 0, @@ -99,7 +99,7 @@ describe('VideoChapter Service', () => { it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.videoChapter.get({ + testClient.mediaChapter.get({ id: newId, limit: 10, offset: 0, @@ -110,7 +110,7 @@ describe('VideoChapter Service', () => { describe('DeleteVideoChapter', () => { it('Valid Delete', async () => { - const response = await testClient.videoChapter.delete( + const response = await testClient.mediaChapter.delete( testVideoIDForChapter, testLang ); @@ -119,26 +119,26 @@ describe('VideoChapter Service', () => { it('Invalid Video ID', async () => { await expect( - testClient.videoChapter.delete('invalid-id', testLang) + testClient.mediaChapter.delete('invalid-id', testLang) ).rejects.toThrow(StreamError); }); it('Empty Video ID', async () => { await expect( - testClient.videoChapter.delete('', testLang) + testClient.mediaChapter.delete('', testLang) ).rejects.toThrow(StreamError); }); it('Empty Language', async () => { await expect( - testClient.videoChapter.delete(testVideoIDForChapter, '') + testClient.mediaChapter.delete(testVideoIDForChapter, '') ).rejects.toThrow(StreamError); }); it('Not exist ID', async () => { const newId = uuidv4(); await expect( - testClient.videoChapter.delete(newId, testLang) + testClient.mediaChapter.delete(newId, testLang) ).rejects.toThrow(StreamError); }); }); diff --git a/test/Webhook.spec.ts b/test/Webhook.spec.ts index 48dd7cd1..53bd0b8f 100644 --- a/test/Webhook.spec.ts +++ b/test/Webhook.spec.ts @@ -1,4 +1,4 @@ -import { expect } from '@jest/globals'; +import { describe, expect, it } from '@jest/globals'; import StreamError from '../src/StreamError'; import { anonymousMockTestClient, mockTestClient } from './src/mockTestClient'; import { v4 as uuidv4 } from 'uuid';