Skip to content

Commit

Permalink
Add discarded videos feature
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo authored Sep 16, 2024
1 parent 7a3f72e commit 25afd04
Show file tree
Hide file tree
Showing 66 changed files with 774 additions and 93 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to this project will be documented in this file.

## [2.6.2] - 2024-09-16
- Add discarded video endpoints

## [2.6.1] - 2024-09-05
- Add sort parameters in analytics endpoints

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ Method | Description | HTTP request
[**list()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#list) | List all video objects | **GET** `/videos`
[**uploadThumbnail()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#uploadThumbnail) | Upload a thumbnail | **POST** `/videos/{videoId}/thumbnail`
[**pickThumbnail()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#pickThumbnail) | Set a thumbnail | **PATCH** `/videos/{videoId}/thumbnail`
[**getDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#getDiscarded) | Retrieve a discarded video object | **GET** `/discarded/videos/{videoId}`
[**getStatus()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#getStatus) | Retrieve video status and details | **GET** `/videos/{videoId}/status`
[**listDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#listDiscarded) | List all discarded video objects | **GET** `/discarded/videos`
[**updateDiscarded()**](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/api/VideosApi.md#updateDiscarded) | Update a discarded video object | **PATCH** `/discarded/videos/{videoId}`


#### WatermarksApi
Expand Down Expand Up @@ -231,6 +234,7 @@ Method | Description | HTTP request
- [CaptionsUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/CaptionsUpdatePayload.md)
- [Chapter](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/Chapter.md)
- [ChaptersListResponse](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/ChaptersListResponse.md)
- [DiscardedVideoUpdatePayload](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/DiscardedVideoUpdatePayload.md)
- [FilterBy](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy.md)
- [FilterBy1](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy1.md)
- [FilterBy2](https://github.com/apivideo/api.video-nodejs-client/blob/main/docs/model/FilterBy2.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/api/LiveStreamsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Get the list of livestreams on the workspace.
| ------------- | ------------- | ------------- | ------------- |
| **streamKey** | **string**| no| The unique stream key that allows you to stream videos. |
| **name** | **string**| no| You can filter live streams by their name or a part of their name. |
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ISO-8601 time format. |
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`. `name` - the name of the live stream. `createdAt` - the time a live stream was created. `updatedAt` - the time a live stream was last updated. When using `createdAt` or `updatedAt`, the API sorts the results based on the ATOM UTC time format. |
| **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending. |
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api/PlayerThemesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Retrieve a list of all the player themes you created, as well as details about e

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format. |
| **sortBy** | **'name' \| 'createdAt' \| 'updatedAt'**| no| createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ATOM UTC format. |
| **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. |
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |
Expand Down
2 changes: 1 addition & 1 deletion docs/api/UploadTokensApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Retrieve a list of all currently active delegated tokens.

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **sortBy** | **'createdAt' \| 'ttl'**| no| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ISO-8601 format. |
| **sortBy** | **'createdAt' \| 'ttl'**| no| Allowed: createdAt, ttl. You can use these to sort by when a token was created, or how much longer the token will be active (ttl - time to live). Date and time is presented in ATOM UTC format. |
| **sortOrder** | **'asc' \| 'desc'**| no| Allowed: asc, desc. Ascending is 0-9 or A-Z. Descending is 9-0 or Z-A. |
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |
Expand Down
84 changes: 82 additions & 2 deletions docs/api/VideosApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ All URIs are relative to *https://ws.api.video*
| [**list()**](VideosApi.md#list) | List all video objects | **GET** /videos |
| [**uploadThumbnail()**](VideosApi.md#uploadThumbnail) | Upload a thumbnail | **POST** /videos/{videoId}/thumbnail |
| [**pickThumbnail()**](VideosApi.md#pickThumbnail) | Set a thumbnail | **PATCH** /videos/{videoId}/thumbnail |
| [**getDiscarded()**](VideosApi.md#getDiscarded) | Retrieve a discarded video object | **GET** /discarded/videos/{videoId} |
| [**getStatus()**](VideosApi.md#getStatus) | Retrieve video status and details | **GET** /videos/{videoId}/status |
| [**listDiscarded()**](VideosApi.md#listDiscarded) | List all discarded video objects | **GET** /discarded/videos |
| [**updateDiscarded()**](VideosApi.md#updateDiscarded) | Update a discarded video object | **PATCH** /discarded/videos/{videoId} |


<a name="create"></a>
Expand Down Expand Up @@ -217,7 +220,7 @@ Promise<[**Video**](../model/Video.md)>.
## **`delete()` - Delete a video object**


If you do not need a video any longer, you can send a request to delete it. All you need is the videoId.
If you do not need a video any longer, you can send a request to delete it. All you need is the videoId. By default, deleted videos cannot be recovered. If you have the Video Restore feature enabled, this operation will discard the video instead of permanently deleting it. Make sure you subscribe to the Video Restore feature if you want to be able to restore deleted videos! The Video Restore feature retains videos for 90 days, after which the videos are permanently deleted

### Parameters

Expand Down Expand Up @@ -247,7 +250,7 @@ This method returns a list of your videos (with all their details). With no para
| ------------- | ------------- | ------------- | ------------- |
| **title** | **string**| no| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. |
| **tags** | **Array&lt;string&gt;**| no| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. |
| **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. |
| **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. |
| **description** | **string**| no| Retrieve video objects by &#x60;description&#x60;. |
| **liveStreamId** | **string**| no| Retrieve video objects that were recorded from a live stream by &#x60;liveStreamId&#x60;. |
| **sortBy** | **&#39;title&#39; \| &#39;createdAt&#39; \| &#39;publishedAt&#39; \| &#39;updatedAt&#39;**| no| Use this parameter to sort videos by the their created time, published time, updated time, or by title. |
Expand Down Expand Up @@ -331,6 +334,28 @@ Promise<[**Video**](../model/Video.md)>.



---

<a name="getDiscarded"></a>
## **`getDiscarded()` - Retrieve a discarded video object**


This call provides the same information provided on video creation. For private videos, it will generate a unique token url. Use this to retrieve any details you need about a video, or set up a private viewing URL.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **videoId** | **string**| **yes**| The unique identifier for the video you want details about. |


### Return type

Promise<[**Video**](../model/Video.md)>.




---

<a name="getStatus"></a>
Expand All @@ -353,5 +378,60 @@ Promise<[**VideoStatus**](../model/VideoStatus.md)>.



---

<a name="listDiscarded"></a>
## **`listDiscarded()` - List all discarded video objects**


This method returns a list of your discarded videos (with all their details). With no parameters added, the API returns the first page of all discarded videos. You can filter discarded videos using the parameters described below.

### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **title** | **string**| no| The title of a specific video you want to find. The search will match exactly to what term you provide and return any videos that contain the same term as part of their titles. |
| **tags** | **Array&lt;string&gt;**| no| A tag is a category you create and apply to videos. You can search for videos with particular tags by listing one or more here. Only videos that have all the tags you list will be returned. |
| **metadata** | **{ [key: string]: string; }**| no| Videos can be tagged with metadata tags in key:value pairs. You can search for videos with specific key value pairs using this parameter. |
| **description** | **string**| no| Retrieve video objects by &#x60;description&#x60;. |
| **liveStreamId** | **string**| no| Retrieve video objects that were recorded from a live stream by &#x60;liveStreamId&#x60;. |
| **sortBy** | **&#39;title&#39; \| &#39;createdAt&#39; \| &#39;publishedAt&#39; \| &#39;updatedAt&#39;**| no| Use this parameter to sort videos by the their created time, published time, updated time, or by title. |
| **sortOrder** | **&#39;asc&#39; \| &#39;desc&#39;**| no| Use this parameter to sort results. &#x60;asc&#x60; is ascending and sorts from A to Z. &#x60;desc&#x60; is descending and sorts from Z to A. |
| **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 |
| **pageSize** | **number**| no| Results per page. Allowed values 1-100, default is 25. |


### Return type

Promise<[**VideosListResponse**](../model/VideosListResponse.md)>.




---

<a name="updateDiscarded"></a>
## **`updateDiscarded()` - Update a discarded video object**


Use this endpoint to restore a discarded video when you have the Video Restore feature enabled.



### Parameters

| Name | Type | Required | Description |
| ------------- | ------------- | ------------- | ------------- |
| **videoId** | **string**| **yes**| The video ID for the video you want to restore. |
| **discardedVideoUpdatePayload** | [**DiscardedVideoUpdatePayload**](../model/DiscardedVideoUpdatePayload.md)| **yes**| |


### Return type

Promise<[**Video**](../model/Video.md)>.




---

11 changes: 11 additions & 0 deletions docs/model/DiscardedVideoUpdatePayload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# DiscardedVideoUpdatePayload

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**discarded** | **boolean** | Use this parameter to restore a discarded video when you have the Video Restore feature enabled. This parameter only accepts &#x60;false&#x60; as a value! | [optional]



4 changes: 2 additions & 2 deletions docs/model/LiveStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Name | Type | Description | Notes
**playerId** | **string** | The unique identifier for the player. | [optional]
**broadcasting** | **boolean** | Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not. | [optional]
**restreams** | [**Array&lt;RestreamsResponseObject&gt;**](RestreamsResponseObject.md) | Returns the list of restream destinations. |
**createdAt** | **Date** | When the player was created, presented in ISO-8601 format. | [optional]
**updatedAt** | **Date** | When the player was last updated, presented in ISO-8601 format. | [optional]
**createdAt** | **Date** | When the player was created, presented in ATOM UTC format. | [optional]
**updatedAt** | **Date** | When the player was last updated, presented in ATOM UTC format. | [optional]



2 changes: 1 addition & 1 deletion docs/model/PlayerSessionEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | Possible values are: ready, play, pause, resume, seek.backward, seek.forward, end | [optional]
**emittedAt** | **Date** | When an event occurred, presented in ISO-8601 format. | [optional]
**emittedAt** | **Date** | When an event occurred, presented in ATOM UTC format. | [optional]
**at** | **number** | | [optional]
**from** | **number** | | [optional]
**to** | **number** | | [optional]
Expand Down
4 changes: 2 additions & 2 deletions docs/model/PlayerTheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Name | Type | Description | Notes
**hideTitle** | **boolean** | enable/disable title. Default: false | [optional]
**forceLoop** | **boolean** | enable/disable looping. Default: false | [optional]
**playerId** | **string** | |
**createdAt** | **Date** | When the player was created, presented in ISO-8601 format. | [optional]
**updatedAt** | **Date** | When the player was last updated, presented in ISO-8601 format. | [optional]
**createdAt** | **Date** | When the player was created, presented in ATOM UTC format. | [optional]
**updatedAt** | **Date** | When the player was last updated, presented in ATOM UTC format. | [optional]
**assets** | [**PlayerThemeAssets**](PlayerThemeAssets.md) | | [optional]


Expand Down
4 changes: 2 additions & 2 deletions docs/model/UploadToken.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **string** | The unique identifier for the token you will use to authenticate an upload. | [optional]
**ttl** | **number** | Time-to-live - how long the upload token is valid for. | [optional]
**createdAt** | **Date** | When the token was created, displayed in ISO-8601 format. | [optional]
**expiresAt** | **Date** | When the token expires, displayed in ISO-8601 format. | [optional]
**createdAt** | **Date** | When the token was created, displayed in ATOM UTC format. | [optional]
**expiresAt** | **Date** | When the token expires, displayed in ATOM UTC format. | [optional]



11 changes: 7 additions & 4 deletions docs/model/Video.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**videoId** | **string** | The unique identifier of the video object. |
**createdAt** | **Date** | When a video was created, presented in ISO-8601 format. | [optional]
**createdAt** | **Date** | When a video was created, presented in ATOM UTC format. | [optional]
**title** | **string** | The title of the video content. | [optional]
**description** | **string** | A description for the video content. | [optional]
**publishedAt** | **Date** | The date and time the API created the video. Date and time are provided using ISO-8601 UTC format. | [optional]
**updatedAt** | **Date** | The date and time the video was updated. Date and time are provided using ISO-8601 UTC format. | [optional]
**publishedAt** | **Date** | The date and time the API created the video. Date and time are provided using ATOM UTC format. | [optional]
**updatedAt** | **Date** | The date and time the video was updated. Date and time are provided using ATOM UTC format. | [optional]
**discardedAt** | **Date** | The date and time the video was discarded. The API populates this field only if you have the Video Restore feature enabled and discard a video. Date and time are provided using ATOM UTC format. | [optional]
**deletesAt** | **Date** | The date and time the video will be permanently deleted. The API populates this field only if you have the Video Restore feature enabled and discard a video. Discarded videos are pemanently deleted after 90 days. Date and time are provided using ATOM UTC format. | [optional]
**discarded** | **boolean** | Returns &#x60;true&#x60; for videos you discarded when you have the Video Restore feature enabled. Returns &#x60;false&#x60; for every other video. | [optional]
**tags** | **Array&lt;string&gt;** | One array of tags (each tag is a string) in order to categorize a video. Tags may include spaces. | [optional]
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. [Dynamic Metadata](https://api.video/blog/endpoints/dynamic-metadata/) allows you to define a key that allows any value pair. | [optional]
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | Metadata you can use to categorise and filter videos. Metadata is a list of dictionaries, where each dictionary represents a key value pair for categorising a video. | [optional]
**source** | [**VideoSource**](VideoSource.md) | | [optional]
**assets** | [**VideoAssets**](VideoAssets.md) | | [optional]
**playerId** | **string** | The id of the player that will be applied on the video. | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/model/VideoCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Name | Type | Description | Notes
**mp4Support** | **boolean** | Enables mp4 version in addition to streamed version. | [optional]
**playerId** | **string** | The unique identification number for your video player. | [optional]
**tags** | **Array&lt;string&gt;** | A list of tags you want to use to describe your video. | [optional]
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. These pairs can be made dynamic, allowing you to segment your audience. Read more on [dynamic metadata](https://api.video/blog/endpoints/dynamic-metadata/). | [optional]
**metadata** | [**Array&lt;Metadata&gt;**](Metadata.md) | A list of key value pairs that you use to provide metadata for your video. | [optional]
**clip** | [**VideoClip**](VideoClip.md) | | [optional]
**watermark** | [**VideoWatermark**](VideoWatermark.md) | | [optional]

Expand Down
Loading

0 comments on commit 25afd04

Please sign in to comment.